From c23be7fdddd64fb40a772a94b667452f310b9c42 Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Mon, 27 Nov 2023 09:37:37 +0000 Subject: Add netxduo regression test. --- .devcontainer/devcontainer.json | 13 + .github/workflows/regression_test.yml | 43 + .gitignore | 2 + addons/azure_iot/nx_azure_iot.c | 1 + addons/azure_iot/nx_azure_iot_adu_agent.c | 4 +- samples/demo_netxduo_snmp.c | 11 + samples/demo_snmp_helper.h | 38 +- scripts/build_nxd.sh | 3 + scripts/install.sh | 32 + scripts/test_nxd.sh | 3 + test/cmake/.gitignore | 2 + test/cmake/libs/CMakeLists.txt | 33 + test/cmake/libs/tx_user.h | 56 + test/cmake/netxduo/CMakeLists.txt | 565 ++ test/cmake/netxduo/additionals.cmake | 22 + test/cmake/netxduo/coverage.sh | 9 + test/cmake/netxduo/libs | 1 + test/cmake/netxduo/regression/CMakeLists.txt | 1355 +++ test/cmake/netxduo/run.sh | 9 + test/cmake/netxduo/samples/CMakeLists.txt | 61 + .../auto_ip_test/netx_auto_ip_address_check_test.c | 325 + .../auto_ip_test/netx_auto_ip_announce_num_test.c | 307 + .../auto_ip_test/netx_auto_ip_arp_dest_addr_test.c | 501 ++ .../auto_ip_test/netx_auto_ip_basic_test.c | 438 + .../netx_auto_ip_conflicts_check_test.c | 320 + .../auto_ip_test/netx_auto_ip_max_conflicts_test.c | 304 + test/regression/bsd_test/bsd_test_setup.docx | Bin 0 -> 24408 bytes test/regression/bsd_test/netx_bsd_aton_test.c | 106 + .../bsd_test/netx_bsd_getaddrinfo_test.c | 1276 +++ .../bsd_test/netx_bsd_inet_addr_pton_test.c | 136 + .../bsd_test/netx_bsd_ioctl_nonblocking_test.c | 1369 +++ test/regression/bsd_test/netx_bsd_multicast_test.c | 429 + test/regression/bsd_test/netx_bsd_ntoa_test.c | 123 + test/regression/bsd_test/netx_bsd_ntop_test.c | 143 + test/regression/bsd_test/netx_bsd_pton_test.c | 141 + .../bsd_test/netx_bsd_raw_basic_blocking_test.c | 472 + .../bsd_test/netx_bsd_raw_basic_nonblocking_test.c | 519 ++ .../netx_bsd_raw_basic_rx_nohdr_blocking_test.c | 469 + .../netx_bsd_raw_basic_rx_nohdr_nonblocking_test.c | 542 ++ .../bsd_test/netx_bsd_raw_bind_connect_test.c | 533 ++ test/regression/bsd_test/netx_bsd_raw_ping_test.c | 276 + test/regression/bsd_test/netx_bsd_raw_pppoe_test.c | 560 ++ .../netx_bsd_raw_rx_nohdr_basic_blocking_test.c | 469 + test/regression/bsd_test/netx_bsd_raw_tx_test.c | 549 ++ .../bsd_test/netx_bsd_tcp_2nd_bind_test.c | 225 + .../bsd_test/netx_bsd_tcp_accept_blocking_test.c | 515 ++ .../netx_bsd_tcp_accept_blocking_timeout_test.c | 549 ++ .../netx_bsd_tcp_accept_nonblocking_test.c | 579 ++ .../netx_bsd_tcp_accept_nonblocking_timeout_test.c | 610 ++ .../bsd_test/netx_bsd_tcp_accept_noselect_test.c | 583 ++ .../bsd_test/netx_bsd_tcp_basic_blocking_test.c | 1101 +++ .../bsd_test/netx_bsd_tcp_basic_nonblocking_test.c | 1222 +++ test/regression/bsd_test/netx_bsd_tcp_bind_test.c | 809 ++ .../netx_bsd_tcp_blocking_bidirection_test.c | 912 ++ .../netx_bsd_tcp_clients_share_port_test.c | 855 ++ .../netx_bsd_tcp_clients_shared_port_test.c | 585 ++ .../bsd_test/netx_bsd_tcp_disconnect_test.c | 576 ++ .../bsd_test/netx_bsd_tcp_fionread_test.c | 423 + .../bsd_test/netx_bsd_tcp_getsockname_test.c | 454 + .../netx_bsd_tcp_getsockname_without_bind_test.c | 335 + .../bsd_test/netx_bsd_tcp_multiple_accept_test.c | 552 ++ .../regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c | 1117 +++ .../bsd_test/netx_bsd_tcp_sendto_recvfrom_test.c | 482 + .../netx_bsd_tcp_servers_share_port_test.c | 927 ++ .../netx_bsd_tcp_servers_shared_port_test.c | 598 ++ .../bsd_test/netx_bsd_tcp_two_blocking_test.c | 399 + .../bsd_test/netx_bsd_tcp_udp_select_test.c | 413 + .../bsd_test/netx_bsd_udp_basic_blocking_test.c | 501 ++ .../bsd_test/netx_bsd_udp_basic_nonblocking_test.c | 568 ++ .../bsd_test/netx_bsd_udp_bind_connect_test.c | 553 ++ test/regression/bsd_test/netx_bsd_udp_bind_test.c | 1268 +++ .../netx_bsd_udp_blocking_bidirection_test.c | 680 ++ .../bsd_test/netx_bsd_udp_checksum_corrupt_test.c | 291 + .../bsd_test/netx_bsd_udp_connect_test.c | 563 ++ test/regression/cloud_test/netx_cloud_api_test.c | 284 + test/regression/cloud_test/netx_cloud_basic_test.c | 291 + .../cloud_test/netx_cloud_module_event_test.c | 287 + .../netx_cloud_module_register_deregister_test.c | 227 + .../regression/dhcp_test/netx_dhcp_03_01_01_test.c | 380 + .../regression/dhcp_test/netx_dhcp_03_01_02_test.c | 335 + .../regression/dhcp_test/netx_dhcp_03_01_03_test.c | 404 + .../regression/dhcp_test/netx_dhcp_03_02_01_test.c | 388 + .../regression/dhcp_test/netx_dhcp_03_02_02_test.c | 395 + .../regression/dhcp_test/netx_dhcp_03_02_03_test.c | 380 + .../regression/dhcp_test/netx_dhcp_03_04_01_test.c | 367 + .../regression/dhcp_test/netx_dhcp_03_05_01_test.c | 349 + .../regression/dhcp_test/netx_dhcp_04_01_01_test.c | 353 + .../dhcp_test/netx_dhcp_04_03_02_01_test.c | 392 + .../dhcp_test/netx_dhcp_04_03_02_02_test.c | 603 ++ .../dhcp_test/netx_dhcp_04_03_02_03_test.c | 640 ++ .../dhcp_test/netx_dhcp_04_03_05_01_test.c | 383 + .../dhcp_test/netx_dhcp_04_04_01_01_test.c | 350 + .../dhcp_test/netx_dhcp_04_04_01_02_test.c | 540 ++ .../dhcp_test/netx_dhcp_basic_restore_test.c | 409 + test/regression/dhcp_test/netx_dhcp_basic_test.c | 407 + .../netx_dhcp_client_activate_interfaces_test.c | 871 ++ ...client_arp_probe_fail_multiple_interface_test.c | 1033 +++ ..._dhcp_client_arpprobe_fail_multiple_interface.c | 1077 +++ .../dhcp_test/netx_dhcp_client_arpprobe_fails.c | 702 ++ .../netx_dhcp_client_arpprobe_multiple_interface.c | 950 ++ ..._dhcp_client_arpprobe_multiple_interface_test.c | 949 ++ .../dhcp_test/netx_dhcp_client_arpprobe_succeeds.c | 614 ++ .../dhcp_test/netx_dhcp_client_decline_test.c | 999 +++ .../netx_dhcp_client_interface_0_only_test.c | 561 ++ .../netx_dhcp_client_interface_1_only_test.c | 595 ++ .../netx_dhcp_client_interface_order_test.c | 260 + .../dhcp_test/netx_dhcp_client_ip_mutex_test.c | 192 + .../dhcp_test/netx_dhcp_client_ntp_option_test.c | 537 ++ .../dhcp_test/netx_dhcp_client_nxe_api_test.c | 299 + .../netx_dhcp_client_parameter_request_test.c | 390 + .../netx_dhcp_client_secondary_interface_test.c | 609 ++ ...hcp_client_send_with_zero_source_address_test.c | 217 + .../netx_dhcp_client_server_source_port_test.c | 414 + .../netx_dhcp_client_special_attributes_test.c | 586 ++ .../dhcp_test/netx_dhcp_client_two_interfaces.c | 858 ++ .../dhcp_test/netx_dhcp_clone_function.c | 125 + .../dhcp_test/netx_dhcp_clone_function.h | 6 + .../regression/dhcp_test/netx_dhcp_coverage_test.c | 907 ++ test/regression/dhcp_test/netx_dhcp_delete_test.c | 425 + test/regression/dhcp_test/netx_dhcp_enable_test.c | 419 + .../dhcp_test/netx_dhcp_extract_information_test.c | 1034 +++ .../dhcp_test/netx_dhcp_get_option_value_test.c | 544 ++ .../dhcp_test/netx_dhcp_multiple_instances_test.c | 525 ++ .../dhcp_test/netx_dhcp_packet_process_test.c | 459 + .../dhcp_test/netx_dhcp_reinitialize_test.c | 425 + test/regression/dhcp_test/netx_dhcp_release_test.c | 419 + .../netx_dhcp_send_request_internal_test.c | 615 ++ .../netx_dhcp_server_improper_term_test.c | 518 ++ .../dhcp_test/netx_dhcp_server_options_test.c | 391 + .../netx_dhcp_server_second_interface_test.c | 552 ++ .../netx_dhcp_server_small_packet_payload_test.c | 327 + test/regression/dhcp_test/netx_dhcp_server_test.c | 525 ++ .../dhcp_test/netx_dhcp_skip_discover_test.c | 398 + test/regression/dhcp_test/netx_dhcp_start_test.c | 419 + test/regression/dhcp_test/netx_dhcp_stop_test.c | 419 + test/regression/dhcp_test/netx_dhcp_unicast_test.c | 486 + .../dhcp_test/netx_dhcp_user_option_add_test.c | 393 + test/regression/dhcp_test/netx_dhcpv6_basic_test.c | 567 ++ .../netx_dhcpv6_client_process_server_duid_test.c | 399 + .../dhcp_test/netx_dhcpv6_extended_api_test.c | 592 ++ .../dhcp_test/netx_dhcpv6_packet_loss_test.c | 1106 +++ .../dhcp_test/netx_dhcpv6_server_ia_options_test.c | 699 ++ .../dhcp_test/netx_dhcpv6_server_iana_test.c | 352 + ...netx_dhcpv6_server_process_repeated_msgs_test.c | 771 ++ .../dhcp_test/netx_dhcpv6_user_option_add_test.c | 710 ++ .../dns_test/netx_dns_abnormal_packet_test.c | 533 ++ test/regression/dns_test/netx_dns_coverage_test.c | 146 + .../dns_test/netx_dns_fake_response_test.c | 386 + test/regression/dns_test/netx_dns_function_test.c | 1612 ++++ .../dns_test/netx_dns_invalid_name_unencode_test.c | 407 + .../dns_test/netx_dns_invalid_resource_get_test.c | 428 + .../dns_test/netx_dns_non_blocking_a_test.c | 420 + test/regression/dns_test/netx_dns_nxe_api_test.c | 261 + .../dns_test/netx_dns_packet_double_release_test.c | 351 + ...request_a_response_cname_a_smtp_live_com_test.c | 433 + .../dns_test/netx_dns_source_port_test.c | 375 + test/regression/dns_test/response_a_berkley_edu.c | 44 + .../dns_test/response_a_cname_www_npr_org.c | 57 + test/regression/dns_test/response_a_google_com.c | 134 + .../dns_test/response_aaaa_berkley_edu.c | 46 + .../dns_test/response_cname_mail_baidu_com.c | 48 + .../dns_test/response_mx_a_berkley_edu.c | 57 + .../regression/dns_test/response_mx_a_google_com.c | 135 + test/regression/dns_test/response_mx_google_com.c | 89 + test/regression/dns_test/response_ns_a_ti_com.c | 95 + test/regression/dns_test/response_soa_google_com.c | 54 + test/regression/dns_test/response_srv_google_com.c | 122 + test/regression/dns_test/response_txt_google_com.c | 53 + .../dns_test/response_with_invalid_resource.c | 103 + .../netx_ftp_access_control_commands_01_test.c | 317 + .../netx_ftp_access_control_commands_02_test.c | 322 + .../netx_ftp_access_control_commands_03_test.c | 487 + .../netx_ftp_access_control_commands_04_test.c | 381 + test/regression/ftp_test/netx_ftp_basic_test.c | 339 + .../netx_ftp_client_buffer_overflow_test.c | 402 + .../netx_ftp_client_file_write_fail_test.c | 1026 +++ ..._client_invalid_username_password_length_test.c | 293 + ...ftp_client_multiple_connection_responses_test.c | 426 + .../ftp_test/netx_ftp_client_packet_leak_test.c | 358 + .../ftp_test/netx_ftp_client_pasv_denied.c | 670 ++ .../ftp_test/netx_ftp_client_pasv_file_read_test.c | 987 +++ .../netx_ftp_client_pasv_file_write_test.c | 1008 +++ .../ftp_test/netx_ftp_commands_characters_test.c | 377 + .../ftp_test/netx_ftp_commands_replys_test.c | 444 + .../ftp_test/netx_ftp_control_connection_test.c | 294 + .../ftp_test/netx_ftp_data_connection_test.c | 367 + .../ftp_test/netx_ftp_disconnection_event_test.c | 312 + .../netx_ftp_establish_data_connection_03_test.c | 422 + .../netx_ftp_establish_data_connection_05_test.c | 303 + .../netx_ftp_establish_data_connection_06_test.c | 337 + .../netx_ftp_establish_data_connection_08_test.c | 340 + test/regression/ftp_test/netx_ftp_ipv6_epsv_test.c | 467 + .../ftp_test/netx_ftp_parse_ipv6_address_test.c | 118 + test/regression/ftp_test/netx_ftp_pasv_port_test.c | 321 + test/regression/ftp_test/netx_ftp_pasv_stor_test.c | 489 + .../regression/ftp_test/netx_ftp_pasv_twice_test.c | 414 + test/regression/ftp_test/netx_ftp_rst_test.c | 338 + .../netx_ftp_server_abnormal_packet_test.c | 349 + .../netx_ftp_server_dangling_pointer_test.c | 351 + .../netx_ftp_server_invalid_month_crash_test.c | 740 ++ .../ftp_test/netx_ftp_server_list_command_test.c | 535 ++ .../ftp_test/netx_ftp_server_mss_too_small_test.c | 452 + .../netx_ftp_service_commands_RETR_STOR_test.c | 379 + .../ftp_test/netx_ftp_service_commands_dele_test.c | 396 + .../netx_ftp_service_commands_file_write_test.c | 423 + .../netx_ftp_service_commands_m_d_dir_test.c | 424 + .../netx_ftp_service_commands_nlist_test.c | 433 + .../netx_ftp_service_commands_rename_test.c | 414 + .../regression/ftp_test/netx_ftp_two_listen_test.c | 314 + .../ftp_test/netx_ftp_user_data_type_test.c | 362 + .../http_test/netx_http_basic_authenticate_test.c | 443 + test/regression/http_test/netx_http_basic_test.c | 439 + .../netx_http_client_change_connect_port_test.c | 681 ++ .../http_test/netx_http_delete_basic_test.c | 390 + .../http_test/netx_http_digest_authenticate_test.c | 528 ++ .../netx_http_digest_authenticate_timeout_test.c | 531 ++ .../http_test/netx_http_get_content_length_test.c | 615 ++ .../netx_http_get_contentlength_packetleak_test.c | 646 ++ .../netx_http_get_put_referred_URI_test.c | 629 ++ .../http_test/netx_http_head_basic_test.c | 390 + .../http_test/netx_http_if_modified_since_test.c | 464 + .../http_test/netx_http_multipart_fragment_test.c | 599 ++ .../http_test/netx_http_multipart_underflow_test.c | 614 ++ .../http_test/netx_http_post_basic_test.c | 464 + .../netx_http_request_in_multiple_packets_test.c | 452 + .../netx_http_server_type_retrieve_test.c | 190 + .../http_test/netx_http_status_400_test.c | 406 + .../http_test/netx_http_status_404_test.c | 392 + .../http_test/netx_http_status_501_test.c | 315 + test/regression/mdns_test/capture/_http._tcp.c | 59 + .../regression/mdns_test/capture/_http._tcp.pcapng | Bin 0 -> 1376 bytes .../mdns_test/capture/_pdl-datastream._tcp.c | 131 + .../mdns_test/capture/_pdl-datastream._tcp.pcapng | Bin 0 -> 2564 bytes test/regression/mdns_test/capture/_printer._tcp.c | 125 + .../mdns_test/capture/_printer._tcp.pcapng | Bin 0 -> 2460 bytes test/regression/mdns_test/capture/_smb._tcp.c | 102 + test/regression/mdns_test/capture/_smb._tcp.pcapng | Bin 0 -> 1672 bytes test/regression/mdns_test/capture/address_change.c | 346 + .../mdns_test/capture/address_change.pcapng | Bin 0 -> 3152 bytes .../capture/announcement_in_multiple_packets.c | 1935 ++++ .../announcement_in_multiple_packets.pcapng | Bin 0 -> 15852 bytes .../mdns_test/capture/case_insensitivity.c | 36 + .../mdns_test/capture/case_insensitivity.pcapng | Bin 0 -> 684 bytes test/regression/mdns_test/capture/client_passive.c | 209 + .../mdns_test/capture/client_passive.pcapng | Bin 0 -> 2064 bytes test/regression/mdns_test/capture/command.txt | 4 + .../mdns_test/capture/continuous_query.c | 122 + .../mdns_test/capture/continuous_query.pcapng | Bin 0 -> 2444 bytes .../mdns_test/capture/continuous_query_a.c | 30 + .../mdns_test/capture/continuous_query_a.pcapng | Bin 0 -> 640 bytes .../capture/continuous_query_unique_answer.c | 53 + .../capture/continuous_query_unique_answer.pcapng | Bin 0 -> 816 bytes test/regression/mdns_test/capture/dns_sd_query.c | 351 + .../mdns_test/capture/dns_sd_query.pcapng | Bin 0 -> 3432 bytes .../capture/duplicate_question_suppression.c | 182 + .../mdns_test/capture/error_response.pcapng | Bin 0 -> 4384 bytes test/regression/mdns_test/capture/ipv6_query.c | 68 + .../regression/mdns_test/capture/ipv6_query.pcapng | Bin 0 -> 1376 bytes .../mdns_test/capture/known_answer_suppression.c | 101 + .../capture/known_answer_suppression.pcapng | Bin 0 -> 2088 bytes .../known_answer_suppression_query_half_ttl.c | 172 + .../known_answer_suppression_query_half_ttl.pcapng | Bin 0 -> 1756 bytes .../capture/known_answer_suppression_response.c | 82 + .../known_answer_suppression_response.pcapng | Bin 0 -> 1048 bytes .../capture/mdns_known_answer_suppression_unique.c | 26 + .../mdns_known_answer_suppression_unique.pcapng | Bin 0 -> 644 bytes .../capture/multiple_questions_per_query.c | 68 + .../capture/multiple_questions_per_query.pcapng | Bin 0 -> 948 bytes test/regression/mdns_test/capture/one_shot_query.c | 86 + .../mdns_test/capture/one_shot_query.pcapng | Bin 0 -> 1080 bytes .../mdns_test/capture/probing_conflict.c | 280 + .../mdns_test/capture/probing_conflict.pcapng | Bin 0 -> 2600 bytes .../mdns_test/capture/probing_conflict_any_type.c | 139 + .../capture/probing_conflict_any_type.pcapng | Bin 0 -> 1492 bytes .../mdns_test/capture/query_and_response_chaos.c | 2034 +++++ .../capture/query_and_response_chaos.pcapng | Bin 0 -> 16524 bytes .../mdns_test/capture/query_and_response_v6.c | 99 + .../mdns_test/capture/query_and_response_v6.pcapng | Bin 0 -> 1188 bytes .../mdns_test/capture/query_during_probing_1.c | 240 + .../capture/query_during_probing_1.pcapng | Bin 0 -> 2292 bytes .../mdns_test/capture/query_during_probing_2.c | 56 + .../capture/query_during_probing_2.pcapng | Bin 0 -> 840 bytes test/regression/mdns_test/capture/query_rr_a.c | 42 + .../regression/mdns_test/capture/query_rr_a.pcapng | Bin 0 -> 732 bytes .../mdns_test/capture/query_rr_timeout.c | 83 + .../mdns_test/capture/query_rr_timeout.pcapng | Bin 0 -> 1052 bytes .../mdns_test/capture/query_start_stop.c | 110 + .../mdns_test/capture/query_start_stop.pcapng | Bin 0 -> 1264 bytes test/regression/mdns_test/capture/query_with_tc.c | 658 ++ .../mdns_test/capture/query_with_tc.pcapng | Bin 0 -> 5644 bytes .../mdns_test/capture/responder_cooperating.c | 52 + .../mdns_test/capture/responder_cooperating.pcapng | Bin 0 -> 808 bytes .../mdns_test/capture/responder_cooperating_2.c | 54 + .../capture/responder_cooperating_2.pcapng | Bin 0 -> 828 bytes test/regression/mdns_test/capture/response_a.c | 99 + .../regression/mdns_test/capture/response_a.pcapng | Bin 0 -> 1196 bytes .../mdns_test/capture/response_aggregation.c | 182 + .../mdns_test/capture/response_aggregation.pcapng | Bin 0 -> 1840 bytes .../capture/response_in_multiple_packets.c | 470 + .../capture/response_in_multiple_packets.pcapng | Bin 0 -> 4140 bytes .../mdns_test/capture/response_interval.c | 85 + .../mdns_test/capture/response_interval.pcapng | Bin 0 -> 1072 bytes .../mdns_test/capture/response_interval_2.c | 520 ++ .../mdns_test/capture/response_interval_2.pcapng | Bin 0 -> 4512 bytes .../mdns_test/capture/response_no_delay.c | 36 + .../mdns_test/capture/response_no_delay.pcapng | Bin 0 -> 684 bytes .../mdns_test/capture/response_to_address_query.c | 42 + .../capture/response_to_address_query.pcapng | Bin 0 -> 732 bytes .../mdns_test/capture/response_with_tc.c | 110 + .../mdns_test/capture/response_with_tc.pcapng | Bin 0 -> 1272 bytes test/regression/mdns_test/capture/rr_timeout.c | 87 + .../regression/mdns_test/capture/rr_timeout.pcapng | Bin 0 -> 1088 bytes test/regression/mdns_test/capture/send_goodbye.c | 229 + .../mdns_test/capture/send_goodbye.pcapng | Bin 0 -> 2220 bytes .../mdns_test/capture/server_announcement.c | 282 + .../mdns_test/capture/server_announcement.pcapng | Bin 0 -> 2628 bytes .../mdns_test/capture/server_announcement_v6.c | 327 + .../capture/server_announcement_v6.pcapng | Bin 0 -> 3008 bytes .../capture/server_announcement_with_txt.c | 276 + .../capture/server_announcement_with_txt.pcapng | Bin 0 -> 2604 bytes .../mdns_test/capture/server_interface_reset.c | 628 ++ .../capture/server_interface_reset.pcapng | Bin 0 -> 5396 bytes .../mdns_test/mdns_address_change_test.c | 382 + .../mdns_announcement_in_multiple_packets_test.c | 2000 +++++ .../mdns_test/mdns_basic_ipv6_announcement_test.c | 364 + .../mdns_test/mdns_basic_ipv6_query_test.c | 104 + .../mdns_test/mdns_basic_ipv6_response_test.c | 141 + .../mdns_test/mdns_case_insensitivity_test.c | 58 + .../mdns_test/mdns_client_passive_test.c | 244 + .../mdns_continuous_query_interval_test.c | 174 + .../mdns_test/mdns_continuous_query_test.c | 150 + .../mdns_continuous_query_unique_answer_test.c | 84 + test/regression/mdns_test/mdns_dns_sd_query_test.c | 386 + .../mdns_test/mdns_dns_sd_response_test.c | 381 + .../mdns_duplicate_answer_suppression_test.c | 96 + .../mdns_duplicate_question_suppression_test.c | 251 + .../mdns_test/mdns_known_answer_ignored_test.c | 193 + ..._known_answer_suppression_query_half_ttl_test.c | 201 + .../mdns_known_answer_suppression_query_test.c | 139 + .../mdns_known_answer_suppression_response_test.c | 145 + .../mdns_known_answer_suppression_unique_test.c | 55 + .../mdns_multiple_questions_per_query_test.c | 41 + test/regression/mdns_test/mdns_poof_test.c | 103 + .../mdns_test/mdns_probing_conflict_test.c | 321 + .../mdns_test/mdns_query_and_response_chaos_test.c | 2113 +++++ .../mdns_test/mdns_query_during_probing_test.c | 337 + .../mdns_test/mdns_query_http_tcp_test.c | 91 + .../mdns_test/mdns_query_pdl_datastram_tcp_test.c | 153 + .../mdns_test/mdns_query_printer_tcp_test.c | 146 + .../mdns_test/mdns_query_rr_timeout_test.c | 148 + .../regression/mdns_test/mdns_query_smb_tcp_test.c | 123 + .../mdns_test/mdns_query_start_stop_test.c | 189 + .../regression/mdns_test/mdns_query_with_tc_test.c | 691 ++ .../mdns_test/mdns_response_aggregation_test.c | 216 + .../mdns_response_in_multiple_packets_test.c | 479 + .../mdns_test/mdns_response_interval_test.c | 275 + .../mdns_test/mdns_response_no_delay_test.c | 65 + .../mdns_response_to_address_query_test.c | 72 + .../mdns_test/mdns_response_with_tc_test.c | 341 + .../mdns_server_announcement_with_txt_test.c | 328 + .../mdns_test/mdns_server_interface_reset.c | 670 ++ .../mdns_test/mdns_server_send_goodbye_test.c | 62 + test/regression/mdns_test/mdns_test_setup.docx | Bin 0 -> 42485 bytes .../mdns_test/netx_mdns_announcement_repeat_test.c | 498 ++ .../mdns_test/netx_mdns_bad_packet_test.c | 623 ++ .../mdns_test/netx_mdns_buffer_size_test.c | 176 + .../mdns_test/netx_mdns_create_delete_test.c | 212 + .../mdns_test/netx_mdns_domain_name_test.c | 284 + .../mdns_test/netx_mdns_interface_test.c | 253 + .../mdns_test/netx_mdns_internal_function_test.c | 1182 +++ .../mdns_test/netx_mdns_ipv6_string_test.c | 429 + .../netx_mdns_local_cache_continuous_query_test.c | 298 + .../netx_mdns_local_cache_one_shot_query_test.c | 204 + .../mdns_test/netx_mdns_multiple_answers_test.c | 262 + test/regression/mdns_test/netx_mdns_name_test.c | 217 + .../mdns_test/netx_mdns_one_shot_query_test.c | 284 + .../netx_mdns_peer_service_change_notify_test.c | 381 + test/regression/mdns_test/netx_mdns_ram_test.c | 299 + .../mdns_test/netx_mdns_read_overflow_test.c | 406 + .../netx_mdns_responder_cooperating_test.c | 431 + .../netx_mdns_response_with_question_test.c | 255 + .../regression/mdns_test/netx_mdns_run_test_case.c | 829 ++ .../mdns_test/netx_mdns_second_interface_test.c | 282 + .../mdns_test/netx_mdns_service_add_delete_test.c | 399 + .../mdns_test/netx_mdns_service_lookup_test.c | 271 + .../mdns_test/netx_mdns_source_address_test.c | 299 + .../mdns_test/netx_mdns_source_port_test.c | 249 + test/regression/mdns_test/netx_mdns_test.h | 145 + test/regression/mdns_test/netx_mdns_ttl_test.c | 225 + .../mdns_test/netx_mdns_two_buffer_test.c | 304 + .../mdns_test/netx_mdns_txt_notation_test.c | 225 + test/regression/mdns_test/netx_mdns_txt_test.c | 189 + test/regression/mqtt_test/netx_mqtt_api_test.c | 318 + test/regression/mqtt_test/netx_mqtt_branch_test.c | 398 + .../mqtt_test/netx_mqtt_connack_error_test.c | 487 + .../mqtt_test/netx_mqtt_connect_auth_empty_test.c | 655 ++ .../mqtt_test/netx_mqtt_connect_auth_test.c | 663 ++ .../mqtt_test/netx_mqtt_connect_non_block_2_test.c | 489 + .../mqtt_test/netx_mqtt_connect_non_block_test.c | 526 ++ .../netx_mqtt_connect_packet_send_failure_test.c | 383 + test/regression/mqtt_test/netx_mqtt_connect_test.c | 507 ++ .../mqtt_test/netx_mqtt_connect_v6_test.c | 555 ++ .../netx_mqtt_connect_will_message_test.c | 525 ++ .../netx_mqtt_connect_will_topic_only_test.c | 527 ++ .../netx_mqtt_connect_with_auth_will_test.c | 553 ++ .../mqtt_test/netx_mqtt_keepalive_test.c | 656 ++ .../mqtt_test/netx_mqtt_keepalive_timeout_test.c | 641 ++ .../mqtt_test/netx_mqtt_multiple_receive_test.c | 751 ++ .../mqtt_test/netx_mqtt_not_connected_test.c | 160 + .../mqtt_test/netx_mqtt_null_password_test.c | 147 + .../mqtt_test/netx_mqtt_packet_leak_test.c | 554 ++ .../netx_mqtt_publish_non_zero_packet_id_test.c | 815 ++ .../netx_mqtt_publish_packet_chain_test.c | 431 + .../mqtt_test/netx_mqtt_publish_qos0_test.c | 582 ++ .../mqtt_test/netx_mqtt_publish_qos1_test.c | 580 ++ .../mqtt_test/netx_mqtt_publish_qos2_test.c | 363 + .../mqtt_test/netx_mqtt_receive_qos0_test.c | 587 ++ .../mqtt_test/netx_mqtt_receive_qos1_test.c | 606 ++ .../mqtt_test/netx_mqtt_receive_qos2_test.c | 410 + .../mqtt_test/netx_mqtt_receive_span_test.c | 619 ++ .../mqtt_test/netx_mqtt_remaining_length_test.c | 210 + .../netx_mqtt_subscribe_non_zero_packet_id_test.c | 723 ++ .../netx_mqtt_subscribe_packet_chain_test.c | 393 + .../mqtt_test/netx_mqtt_subscribe_test.c | 595 ++ test/regression/mqtt_test/netx_mqtt_testcontrol.c | 506 ++ .../netx_mqtt_transmit_queue_depth_test.c | 360 + .../mqtt_test/netx_mqtt_unsubscribe_test.c | 626 ++ .../mqtt_test/netx_mqtt_websocket_block_test.c | 739 ++ .../mqtt_test/netx_mqtt_websocket_non_block_test.c | 762 ++ .../netx_nat_entry_removed_after_timeout_test.c | 554 ++ test/regression/nat_test/netx_nat_icmp_test.c | 492 ++ .../nat_test/netx_nat_invalid_header_test.c | 489 + .../nat_test/netx_nat_tcp_fragment_test.c | 671 ++ test/regression/nat_test/netx_nat_tcp_port_test.c | 639 ++ test/regression/nat_test/netx_nat_tcp_port_test2.c | 640 ++ .../netx_nat_tcp_remove_oldest_udp_entry_test.c | 618 ++ test/regression/nat_test/netx_nat_tcp_test1.c | 560 ++ test/regression/nat_test/netx_nat_tcp_test2.c | 573 ++ .../nat_test/netx_nat_udp_fragment_test.c | 545 ++ test/regression/nat_test/netx_nat_udp_port_test.c | 630 ++ test/regression/nat_test/netx_nat_udp_test.c | 817 ++ test/regression/netxduo_test/netx_101_17_test.c | 282 + test/regression/netxduo_test/netx_101_18_test.c | 398 + test/regression/netxduo_test/netx_102_18_test.c | 325 + test/regression/netxduo_test/netx_102_19_test.c | 309 + test/regression/netxduo_test/netx_102_20_test.c | 451 + test/regression/netxduo_test/netx_102_21_test.c | 451 + test/regression/netxduo_test/netx_102_22_test.c | 348 + test/regression/netxduo_test/netx_102_23_test.c | 400 + test/regression/netxduo_test/netx_102_24_test.c | 360 + test/regression/netxduo_test/netx_102_25_test.c | 399 + test/regression/netxduo_test/netx_103_17_test.c | 482 + test/regression/netxduo_test/netx_104_17_test.c | 459 + test/regression/netxduo_test/netx_106_17_test.c | 396 + test/regression/netxduo_test/netx_10_23_01_test.c | 363 + test/regression/netxduo_test/netx_10_23_02_test.c | 444 + test/regression/netxduo_test/netx_10_24_01_test.c | 331 + test/regression/netxduo_test/netx_10_24_02_test.c | 362 + test/regression/netxduo_test/netx_10_24_03_test.c | 347 + test/regression/netxduo_test/netx_10_25_test.c | 384 + test/regression/netxduo_test/netx_10_26_test.c | 394 + test/regression/netxduo_test/netx_11_18_test.c | 330 + test/regression/netxduo_test/netx_11_19_test.c | 317 + test/regression/netxduo_test/netx_11_23_test.c | 380 + test/regression/netxduo_test/netx_11_24_test.c | 346 + test/regression/netxduo_test/netx_11_25_test.c | 322 + test/regression/netxduo_test/netx_11_26_test.c | 354 + test/regression/netxduo_test/netx_11_27_test.c | 349 + test/regression/netxduo_test/netx_11_28_test.c | 318 + test/regression/netxduo_test/netx_11_29_test.c | 318 + test/regression/netxduo_test/netx_12_01_test.c | 422 + test/regression/netxduo_test/netx_12_02_test.c | 409 + test/regression/netxduo_test/netx_12_03_test.c | 425 + test/regression/netxduo_test/netx_12_04_test.c | 420 + test/regression/netxduo_test/netx_12_17_test.c | 418 + test/regression/netxduo_test/netx_12_18_test.c | 447 + test/regression/netxduo_test/netx_12_19_test.c | 439 + test/regression/netxduo_test/netx_12_20_test.c | 535 ++ test/regression/netxduo_test/netx_12_21_test.c | 443 + test/regression/netxduo_test/netx_12_23_test.c | 315 + test/regression/netxduo_test/netx_12_24_test.c | 375 + test/regression/netxduo_test/netx_12_25_test.c | 454 + test/regression/netxduo_test/netx_12_26_test.c | 472 + test/regression/netxduo_test/netx_12_27_test.c | 491 ++ test/regression/netxduo_test/netx_12_30_test.c | 470 + test/regression/netxduo_test/netx_12_31_test.c | 411 + test/regression/netxduo_test/netx_13_01_test.c | 420 + test/regression/netxduo_test/netx_13_02_test.c | 414 + test/regression/netxduo_test/netx_13_04_test.c | 404 + test/regression/netxduo_test/netx_13_05_test.c | 439 + test/regression/netxduo_test/netx_13_17_test.c | 402 + test/regression/netxduo_test/netx_14_19_test.c | 345 + test/regression/netxduo_test/netx_14_20_test.c | 343 + test/regression/netxduo_test/netx_15_03_test.c | 394 + test/regression/netxduo_test/netx_15_20_test.c | 460 + test/regression/netxduo_test/netx_15_21_test.c | 469 + test/regression/netxduo_test/netx_15_24_test.c | 375 + test/regression/netxduo_test/netx_15_25_test.c | 344 + test/regression/netxduo_test/netx_15_26_test.c | 321 + test/regression/netxduo_test/netx_16_02_test.c | 370 + test/regression/netxduo_test/netx_16_17_test.c | 315 + test/regression/netxduo_test/netx_16_19_test.c | 360 + test/regression/netxduo_test/netx_16_21_test.c | 385 + test/regression/netxduo_test/netx_16_22_test.c | 391 + test/regression/netxduo_test/netx_17_17_test.c | 378 + test/regression/netxduo_test/netx_18_21_test.c | 371 + test/regression/netxduo_test/netx_1_01_test.c | 347 + test/regression/netxduo_test/netx_1_02_test.c | 325 + test/regression/netxduo_test/netx_1_03_test.c | 346 + test/regression/netxduo_test/netx_1_04_ipv6_test.c | 327 + test/regression/netxduo_test/netx_1_04_test.c | 309 + test/regression/netxduo_test/netx_1_05_test.c | 362 + test/regression/netxduo_test/netx_1_17_test.c | 313 + test/regression/netxduo_test/netx_1_18_test.c | 325 + test/regression/netxduo_test/netx_1_19_01_test.c | 321 + test/regression/netxduo_test/netx_1_19_02_test.c | 338 + test/regression/netxduo_test/netx_1_19_03_test.c | 321 + test/regression/netxduo_test/netx_1_20_test.c | 359 + test/regression/netxduo_test/netx_1_21_01_test.c | 377 + test/regression/netxduo_test/netx_1_21_02_test.c | 346 + test/regression/netxduo_test/netx_1_26_01_test.c | 396 + test/regression/netxduo_test/netx_1_26_02_test.c | 362 + test/regression/netxduo_test/netx_1_27_01_test.c | 380 + test/regression/netxduo_test/netx_1_27_02_test.c | 352 + test/regression/netxduo_test/netx_1_27_03_test.c | 385 + test/regression/netxduo_test/netx_1_27_04_test.c | 368 + test/regression/netxduo_test/netx_23_02_01_test.c | 410 + test/regression/netxduo_test/netx_23_02_02_test.c | 415 + test/regression/netxduo_test/netx_23_02_03_test.c | 273 + test/regression/netxduo_test/netx_23_02_04_test.c | 273 + test/regression/netxduo_test/netx_2_01_test.c | 390 + test/regression/netxduo_test/netx_2_02_test.c | 370 + test/regression/netxduo_test/netx_2_17_test.c | 360 + test/regression/netxduo_test/netx_2_20_test.c | 451 + test/regression/netxduo_test/netx_3_01_test.c | 329 + test/regression/netxduo_test/netx_3_02_test.c | 356 + test/regression/netxduo_test/netx_3_03_test.c | 385 + test/regression/netxduo_test/netx_3_04_test.c | 525 ++ test/regression/netxduo_test/netx_3_06_test.c | 449 + test/regression/netxduo_test/netx_3_07_test.c | 426 + test/regression/netxduo_test/netx_3_08_test.c | 397 + test/regression/netxduo_test/netx_3_17_test.c | 469 + test/regression/netxduo_test/netx_3_18_test.c | 536 ++ test/regression/netxduo_test/netx_3_19_test.c | 514 ++ test/regression/netxduo_test/netx_3_20_test.c | 486 + test/regression/netxduo_test/netx_3_21_test.c | 550 ++ test/regression/netxduo_test/netx_3_23_test.c | 535 ++ test/regression/netxduo_test/netx_4_01_test.c | 376 + test/regression/netxduo_test/netx_4_17_test.c | 191 + test/regression/netxduo_test/netx_4_21_test.c | 328 + test/regression/netxduo_test/netx_4_23_test.c | 331 + test/regression/netxduo_test/netx_4_24_test.c | 293 + test/regression/netxduo_test/netx_4_25_test.c | 315 + test/regression/netxduo_test/netx_4_26_test.c | 293 + test/regression/netxduo_test/netx_4_27_test.c | 297 + test/regression/netxduo_test/netx_4_28_test.c | 341 + test/regression/netxduo_test/netx_4_29_test.c | 301 + test/regression/netxduo_test/netx_5_18_test.c | 195 + test/regression/netxduo_test/netx_5_19_test.c | 327 + test/regression/netxduo_test/netx_5_20_test.c | 303 + test/regression/netxduo_test/netx_5_21_test.c | 202 + test/regression/netxduo_test/netx_5_22_test.c | 357 + test/regression/netxduo_test/netx_5_23_test.c | 318 + test/regression/netxduo_test/netx_5_24_test.c | 383 + test/regression/netxduo_test/netx_5_25_test.c | 380 + test/regression/netxduo_test/netx_6_17_test.c | 337 + test/regression/netxduo_test/netx_6_18_test.c | 171 + test/regression/netxduo_test/netx_6_20_test.c | 385 + test/regression/netxduo_test/netx_6_22_01_test.c | 387 + test/regression/netxduo_test/netx_6_22_02_test.c | 340 + test/regression/netxduo_test/netx_6_23_test.c | 325 + test/regression/netxduo_test/netx_6_24_test.c | 292 + test/regression/netxduo_test/netx_6_25_test.c | 310 + test/regression/netxduo_test/netx_6_27_test.c | 165 + test/regression/netxduo_test/netx_6_28_test.c | 347 + test/regression/netxduo_test/netx_6_29_test.c | 325 + test/regression/netxduo_test/netx_6_32_test.c | 298 + test/regression/netxduo_test/netx_8_01_test.c | 487 + test/regression/netxduo_test/netx_8_02_test.c | 428 + test/regression/netxduo_test/netx_8_17_test.c | 366 + test/regression/netxduo_test/netx_8_18_test.c | 450 + test/regression/netxduo_test/netx_8_19_test.c | 359 + test/regression/netxduo_test/netx_8_20_test.c | 352 + test/regression/netxduo_test/netx_8_21_test.c | 392 + test/regression/netxduo_test/netx_8_29_01_test.c | 385 + test/regression/netxduo_test/netx_8_29_02_test.c | 380 + test/regression/netxduo_test/netx_8_29_03_test.c | 341 + test/regression/netxduo_test/netx_8_29_04_test.c | 367 + test/regression/netxduo_test/netx_9_17_test.c | 336 + test/regression/netxduo_test/netx_9_18_test.c | 333 + test/regression/netxduo_test/netx_9_19_01_test.c | 372 + test/regression/netxduo_test/netx_9_19_02_test.c | 315 + test/regression/netxduo_test/netx_9_20_test.c | 321 + test/regression/netxduo_test/netx_9_21_01_test.c | 365 + test/regression/netxduo_test/netx_9_21_02_test.c | 359 + test/regression/netxduo_test/netx_9_22_test.c | 349 + test/regression/netxduo_test/netx_9_27_test.c | 428 + .../netxduo_test/netx_api_compile_test.c | 332 + .../netxduo_test/netx_arp_auto_entry_test.c | 168 + test/regression/netxduo_test/netx_arp_basic_test.c | 327 + .../regression/netxduo_test/netx_arp_branch_test.c | 846 ++ .../netxduo_test/netx_arp_conflict_test.c | 183 + .../netxduo_test/netx_arp_dual_pool_test.c | 217 + .../netx_arp_dynamic_entry_fail_test.c | 176 + .../netxduo_test/netx_arp_dynamic_entry_set_test.c | 202 + .../netxduo_test/netx_arp_dynamic_entry_test.c | 423 + .../netxduo_test/netx_arp_dynamic_entry_test2.c | 260 + .../netxduo_test/netx_arp_dynamic_entry_test3.c | 174 + .../netx_arp_dynamic_entry_timeout_test.c | 160 + .../netx_arp_dynamic_invalidate_test.c | 405 + .../netx_arp_entry_abnormal_operation_test.c | 570 ++ .../netxduo_test/netx_arp_entry_cache_test.c | 383 + .../netxduo_test/netx_arp_gratuitous_test.c | 489 + .../netxduo_test/netx_arp_invalid_type_test.c | 149 + .../netx_arp_no_duplicate_entry_test.c | 425 + .../netxduo_test/netx_arp_nxe_api_test.c | 789 ++ .../netxduo_test/netx_arp_packet_allocate_test.c | 232 + .../netxduo_test/netx_arp_queue_depth_test.c | 172 + .../netx_arp_static_entries_delete_test.c | 423 + .../netx_arp_static_entry_create_test.c | 316 + .../netx_arp_static_entry_pollute_test.c | 210 + .../netxduo_test/netx_arp_static_entry_test.c | 473 + .../netxduo_test/netx_caller_check_test.c | 1105 +++ test/regression/netxduo_test/netx_checksum_test.c | 323 + .../netxduo_test/netx_dest_table_add_fail_test.c | 235 + .../netx_forward_icmp_small_header_test.c | 222 + .../netx_forward_icmp_small_header_test2.c | 299 + .../netx_forward_icmp_small_header_test3.c | 314 + .../netxduo_test/netx_forward_icmp_test.c | 377 + .../netxduo_test/netx_forward_icmp_ttl_test.c | 303 + .../netx_forward_link_local_address_test.c | 187 + .../netxduo_test/netx_forward_multicast_test.c | 224 + .../netxduo_test/netx_forward_tcp_test_1.c | 479 + .../netxduo_test/netx_forward_tcp_test_2.c | 476 + .../netxduo_test/netx_forward_tcp_test_3.c | 480 + .../netxduo_test/netx_forward_tcp_test_4.c | 476 + .../netxduo_test/netx_forward_tcp_test_5.c | 476 + .../netxduo_test/netx_forward_udp_fragment_test.c | 497 ++ .../netxduo_test/netx_forward_udp_fragment_test2.c | 457 + .../netxduo_test/netx_forward_udp_fragment_test3.c | 445 + .../netxduo_test/netx_forward_udp_fragment_test4.c | 446 + .../netxduo_test/netx_forward_udp_test.c | 954 ++ .../netxduo_test/netx_http_proxy_basic_test.c | 481 + .../netxduo_test/netx_http_proxy_data_fin_test.c | 589 ++ .../netxduo_test/netx_http_proxy_disconnect_test.c | 531 ++ .../netx_http_proxy_error_response_test.c | 545 ++ .../netx_http_proxy_multiple_response_test.c | 504 ++ .../netxduo_test/netx_http_proxy_non_block_test.c | 479 + .../netxduo_test/netx_icmp_branch_test.c | 242 + .../netxduo_test/netx_icmp_broadcast_ping_test.c | 230 + .../netxduo_test/netx_icmp_cleanup_test.c | 422 + .../netxduo_test/netx_icmp_interface2_ping6_test.c | 623 ++ .../netxduo_test/netx_icmp_interface2_ping_test.c | 206 + .../netx_icmp_invalid_echo_reply_test.c | 159 + .../netxduo_test/netx_icmp_invalid_source_test.c | 160 + .../netxduo_test/netx_icmp_loopback_fail_test.c | 158 + .../netxduo_test/netx_icmp_loopback_test.c | 171 + .../netxduo_test/netx_icmp_loopback_test2.c | 178 + .../netxduo_test/netx_icmp_multiple_ping6_test1.c | 289 + .../netxduo_test/netx_icmp_multiple_ping6_test2.c | 277 + .../netxduo_test/netx_icmp_multiple_ping_test1.c | 244 + .../netxduo_test/netx_icmp_multiple_ping_test2.c | 244 + .../netxduo_test/netx_icmp_nxe_api_test.c | 670 ++ .../netx_icmp_packet_receive_function_test.c | 424 + .../netx_icmp_ping6_data_append_test.c | 194 + .../netxduo_test/netx_icmp_ping6_fragment_test.c | 225 + .../regression/netxduo_test/netx_icmp_ping6_test.c | 509 ++ .../netxduo_test/netx_icmp_ping_fragment_test.c | 203 + .../netxduo_test/netx_icmp_ping_multicast_test.c | 188 + test/regression/netxduo_test/netx_icmp_ping_test.c | 531 ++ .../netx_icmp_send_error_message_test.c | 470 + .../netx_icmp_send_error_message_test_1.c | 284 + .../netx_icmp_tunnel_ipv4_ipv4_ping_test.c | 240 + .../netx_icmp_tunnel_ipv4_ipv6_ping_test.c | 280 + .../netx_icmp_tunnel_ipv6_ipv4_ping_test.c | 311 + .../netx_icmp_tunnel_ipv6_ipv6_ping_test.c | 308 + .../regression/netxduo_test/netx_icmpv6_DAD_test.c | 426 + .../netx_icmpv6_abnormal_mtu_in_ra_test.c | 201 + .../netxduo_test/netx_icmpv6_branch_test.c | 578 ++ .../netx_icmpv6_destination_table_periodic_test.c | 985 +++ .../netxduo_test/netx_icmpv6_echo_reply_test.c | 287 + .../netxduo_test/netx_icmpv6_echo_request_test.c | 288 + .../netx_icmpv6_error_small_packet_test.c | 305 + .../netxduo_test/netx_icmpv6_error_test.c | 548 ++ .../netxduo_test/netx_icmpv6_invalid_length_test.c | 183 + .../netx_icmpv6_invalid_length_test2.c | 177 + .../netx_icmpv6_invalid_message_test.c | 230 + .../netxduo_test/netx_icmpv6_invalid_na.c | 178 + .../netx_icmpv6_invalid_ra_dest_test.c | 189 + .../netx_icmpv6_invalid_ra_option_test.c | 183 + .../netxduo_test/netx_icmpv6_mtu_option_test.c | 190 + .../netx_icmpv6_na_buffer_overwrite_test.c | 367 + test/regression/netxduo_test/netx_icmpv6_na_test.c | 262 + .../netx_icmpv6_na_tlla_changed_test.c | 346 + .../netx_icmpv6_ns_buffer_overwrite_test.c | 367 + .../netx_icmpv6_ns_with_small_packet_test.c | 166 + .../netx_icmpv6_ra_address_full_test.c | 198 + .../netx_icmpv6_ra_buffer_overwrite_test.c | 371 + .../netx_icmpv6_ra_flag_callback_test.c | 192 + .../netx_icmpv6_ra_invalid_length_test.c | 176 + .../netxduo_test/netx_icmpv6_ra_lifetime_test.c | 231 + .../netxduo_test/netx_icmpv6_ra_router_full_test.c | 186 + .../netx_icmpv6_ra_slla_changed_test.c | 253 + .../netx_icmpv6_redirect_buffer_overwrite_test.c | 370 + .../netx_icmpv6_redirect_nd_full_test.c | 283 + .../netxduo_test/netx_icmpv6_redirect_test.c | 540 ++ .../netx_icmpv6_router_solicitation_test.c | 211 + .../netxduo_test/netx_icmpv6_solicitated_ra_test.c | 196 + .../netx_icmpv6_too_big_buffer_overwrite_test.c | 367 + .../regression/netxduo_test/netx_igmp_basic_test.c | 219 + .../netxduo_test/netx_igmp_branch_test.c | 516 ++ .../netx_igmp_checksum_computation_test.c | 373 + ...netx_igmp_interface_indirect_report_send_test.c | 307 + .../netxduo_test/netx_igmp_join_fail_test.c | 183 + .../regression/netxduo_test/netx_igmp_leave_test.c | 158 + .../netxduo_test/netx_igmp_loopback_test.c | 312 + .../netxduo_test/netx_igmp_multicast_basic_test.c | 302 + .../netxduo_test/netx_igmp_nxe_api_test.c | 744 ++ .../netx_igmp_packet_receive_function_test.c | 412 + .../netxduo_test/netx_igmp_router_query_test.c | 471 + .../netxduo_test/netx_ip_abnormal_packet_test.c | 762 ++ .../netx_ip_address_change_notify_test.c | 223 + .../netx_ip_address_conflict_callback_test.c | 212 + .../netx_ip_address_conflict_detection_test.c | 497 ++ .../netxduo_test/netx_ip_address_get_test.c | 204 + .../netxduo_test/netx_ip_address_set_test.c | 462 + .../netx_ip_auxiliary_packet_pool_set_test.c | 167 + test/regression/netxduo_test/netx_ip_basic_test.c | 386 + test/regression/netxduo_test/netx_ip_branch_test.c | 1143 +++ .../netx_ip_chain_packet_process_test.c | 358 + test/regression/netxduo_test/netx_ip_create_test.c | 126 + test/regression/netxduo_test/netx_ip_delete_test.c | 727 ++ .../netxduo_test/netx_ip_driver_deferred_test.c | 308 + .../netx_ip_fragmentation_disable_test.c | 277 + .../netx_ip_fragmentation_dispatch_fail_test.c | 166 + .../netx_ip_fragmentation_duplicate_test.c | 448 + .../netx_ip_fragmentation_invalid_test.c | 407 + .../netx_ip_fragmentation_order_test.c | 476 + .../netx_ip_fragmentation_packet_copy_test.c | 327 + .../netx_ip_fragmentation_packet_delay_test.c | 328 + .../netx_ip_fragmentation_packet_drop_test.c | 328 + .../netxduo_test/netx_ip_fragmentation_test.c | 503 ++ ...x_ip_fragmentation_time_exceeded_message_test.c | 301 + .../netx_ip_fragmentation_timeout_check_test.c | 346 + .../netx_ip_fragmentation_timeout_check_test2.c | 359 + ..._fragmentation_wrong_destination_address_test.c | 361 + ...tx_ip_fragmentation_wrong_protocol_field_test.c | 359 + ...x_ip_fragmentation_wrong_protocol_field_test2.c | 395 + .../netxduo_test/netx_ip_gateway_address_test.c | 237 + .../netxduo_test/netx_ip_idle_scan_test.c | 213 + .../netx_ip_interface_address_get_test.c | 208 + .../netx_ip_interface_address_set_test.c | 526 ++ .../netx_ip_interface_attachment_test.c | 229 + .../netx_ip_interface_capability_test.c | 135 + .../netx_ip_interface_detachment_arp_table_test.c | 257 + .../netx_ip_interface_detachment_gateway_test.c | 136 + ...x_ip_interface_detachment_tcp_connection_test.c | 369 + .../netx_ip_interface_detachment_test.c | 321 + .../netxduo_test/netx_ip_interface_info_get_test.c | 227 + ...x_ip_interface_physical_address_set_fail_test.c | 136 + .../netx_ip_interface_physical_address_test.c | 149 + .../netx_ip_interface_status_check_fail_test.c | 280 + .../netx_ip_interface_status_check_test.c | 339 + .../netx_ip_invalid_packet_receive_test.c | 420 + .../netxduo_test/netx_ip_link_local_address_test.c | 314 + .../netxduo_test/netx_ip_link_status_test.c | 288 + .../netxduo_test/netx_ip_loopback_multihome_test.c | 253 + .../netxduo_test/netx_ip_malformed_packet_test.c | 158 + .../netxduo_test/netx_ip_malformed_packet_test.h | 9315 ++++++++++++++++++++ .../netx_ip_max_payload_size_find_test.c | 296 + .../netx_ip_multicast_interface_detach_test.c | 216 + .../regression/netxduo_test/netx_ip_nxe_api_test.c | 1746 ++++ .../netx_ip_packet_filter_extended_test.c | 369 + .../netxduo_test/netx_ip_packet_filter_test.c | 369 + .../netxduo_test/netx_ip_raw_loopback_test.c | 240 + .../netxduo_test/netx_ip_raw_packet_filter_test.c | 265 + .../netxduo_test/netx_ip_raw_packet_queue_test.c | 252 + .../netxduo_test/netx_ip_raw_packet_test.c | 557 ++ .../netxduo_test/netx_ip_route_reachable_test.c | 181 + .../netxduo_test/netx_ip_static_route_add_test.c | 184 + .../netx_ip_static_route_delete_test.c | 144 + .../netxduo_test/netx_ip_static_route_find_test.c | 216 + .../netxduo_test/netx_ip_status_check_test.c | 198 + .../netxduo_test/netx_ipv4_option_process_test.c | 523 ++ .../netxduo_test/netx_ipv6_address_delete_test.c | 373 + .../netxduo_test/netx_ipv6_address_get_test.c | 237 + .../netxduo_test/netx_ipv6_address_set_test.c | 693 ++ .../netxduo_test/netx_ipv6_branch_test.c | 871 ++ .../netx_ipv6_default_router_api_test.c | 496 ++ .../netxduo_test/netx_ipv6_default_router_test.c | 316 + .../netxduo_test/netx_ipv6_disable_test.c | 231 + .../netxduo_test/netx_ipv6_fragment_fail_test.c | 188 + .../netx_ipv6_fragmentation_error_test1.c | 248 + .../netx_ipv6_fragmentation_error_test2.c | 271 + .../netxduo_test/netx_ipv6_fragmentation_test.c | 275 + .../netx_ipv6_hop_by_hop_fragment_test.c | 400 + .../netx_ipv6_hop_by_hop_option_error_test.c | 279 + .../netx_ipv6_interface_detachment_router_test.c | 196 + .../netx_ipv6_invalid_packet_receive_test.c | 333 + .../netxduo_test/netx_ipv6_multicast_basic_test.c | 296 + .../netx_ipv6_multicast_interface_detach_test.c | 232 + .../netxduo_test/netx_ipv6_multicast_ping_test.c | 311 + .../netxduo_test/netx_ipv6_multicast_ping_test1.c | 193 + .../netxduo_test/netx_ipv6_nd_cache_api_test.c | 384 + .../netxduo_test/netx_ipv6_nxe_api_test.c | 991 +++ .../netxduo_test/netx_ipv6_packet_chain_test.c | 346 + test/regression/netxduo_test/netx_ipv6_pmtu_test.c | 650 ++ .../netxduo_test/netx_ipv6_prefix_test.c | 407 + .../netxduo_test/netx_ipv6_raw_packet_test.c | 389 + .../netxduo_test/netx_ipv6_search_onlink_test.c | 481 + .../netxduo_test/netx_ipv6_send_fail_test.c | 295 + .../netx_ipv6_stateless_address_autoconfig_test.c | 460 + .../netxduo_test/netx_ipv6_util_api_test.c | 1139 +++ .../netx_low_watermark_fragment_test.c | 308 + .../netxduo_test/netx_low_watermark_test.c | 502 ++ .../netx_low_watermark_zero_window_test.c | 330 + .../netxduo_test/netx_nd_cache_add_test.c | 404 + .../netxduo_test/netx_nd_cache_api_test.c | 384 + .../netxduo_test/netx_nd_cache_branch_test.c | 187 + .../netxduo_test/netx_nd_cache_nxe_api_test.c | 420 + .../netx_nd_cache_under_interface_detach_test.c | 324 + .../netx_nd_cache_with_own_address_test.c | 239 + .../netx_nxd_udp_socket_send_special_test.c | 269 + test/regression/netxduo_test/netx_old_api_test.c | 141 + .../netxduo_test/netx_packet_basic_test.c | 733 ++ .../netxduo_test/netx_packet_branch_test.c | 248 + .../netxduo_test/netx_packet_data_append_test.c | 131 + .../netxduo_test/netx_packet_debug_info_test.c | 553 ++ .../netxduo_test/netx_packet_nxe_api_test.c | 911 ++ .../netxduo_test/netx_packet_payload_size_test.c | 384 + .../netxduo_test/netx_packet_suspension_test.c | 241 + .../netxduo_test/netx_ramdriver_callback_test.c | 358 + .../netxduo_test/netx_rarp_basic_processing_test.c | 453 + .../netxduo_test/netx_rarp_branch_test.c | 383 + .../netx_rarp_multiple_interfaces_test.c | 292 + .../netxduo_test/netx_rarp_nxe_api_test.c | 218 + .../netx_rarp_packet_allocate_fail_test.c | 186 + .../netxduo_test/netx_raw_nxe_api_test.c | 744 ++ .../netxduo_test/netx_raw_special_test.c | 324 + .../netxduo_test/netx_tcp_4_duplicate_ack_test.c | 340 + .../netx_tcp_ack_before_release_test.c | 313 + .../netx_tcp_ack_check_for_syn_message_test.c | 383 + .../netxduo_test/netx_tcp_ack_check_issue_test.c | 328 + .../netx_tcp_advertised_window_update_test.c | 331 + .../netxduo_test/netx_tcp_basic_processing_test.c | 646 ++ .../regression/netxduo_test/netx_tcp_branch_test.c | 2150 +++++ .../netxduo_test/netx_tcp_chained_packet_test.c | 295 + .../netx_tcp_client_bind_cleanup_test.c | 305 + .../netx_tcp_client_packet_leak_test.c | 333 + .../netx_tcp_client_socket_bind_test.c | 206 + .../netx_tcp_client_socket_port_get_test.c | 179 + .../netx_tcp_client_socket_unbind_test.c | 193 + .../netxduo_test/netx_tcp_connection_reset_test.c | 359 + test/regression/netxduo_test/netx_tcp_cwnd_test.c | 395 + .../netxduo_test/netx_tcp_data_transfer_test.c | 545 ++ .../netxduo_test/netx_tcp_data_trim_test.c | 335 + .../netx_tcp_delayed_retransmission_test.c | 371 + .../netx_tcp_delayed_retransmission_test2.c | 359 + .../netxduo_test/netx_tcp_dropped_packet_test.c | 502 ++ .../netxduo_test/netx_tcp_dropped_packet_test2.c | 314 + .../netxduo_test/netx_tcp_duplicate_accept_test.c | 294 + .../netx_tcp_error_operation_check_test.c | 235 + .../netxduo_test/netx_tcp_fast_disconnect_test.c | 475 + .../netxduo_test/netx_tcp_fast_retransmit_test.c | 362 + .../netx_tcp_fin_wait1_to_time_wait_test.c | 306 + .../netxduo_test/netx_tcp_fin_wait_recv_test.c | 300 + .../netxduo_test/netx_tcp_invalid_length_test.c | 222 + .../netxduo_test/netx_tcp_invalid_option_test.c | 492 ++ .../netxduo_test/netx_tcp_invalid_option_test2.c | 459 + .../netx_tcp_invalid_packet_chain_test.c | 397 + .../netx_tcp_ipv4_interface2_mss_test.c | 336 + .../netx_tcp_ipv6_basic_processing_test.c | 546 ++ .../netx_tcp_ipv6_delayed_retransmission_test.c | 390 + .../netx_tcp_ipv6_interface2_mss_test.c | 379 + .../netxduo_test/netx_tcp_ipv6_window_scale_test.c | 361 + .../netxduo_test/netx_tcp_keepalive_test.c | 302 + .../netx_tcp_large_data_transfer_test.c | 295 + .../netxduo_test/netx_tcp_large_mtu_test.c | 318 + .../netxduo_test/netx_tcp_large_mtu_test2.c | 351 + .../netx_tcp_listen_packet_leak_test.c | 339 + .../regression/netxduo_test/netx_tcp_listen_test.c | 332 + .../netxduo_test/netx_tcp_loopback_test.c | 391 + .../netxduo_test/netx_tcp_max_window_scale_test.c | 454 + .../netxduo_test/netx_tcp_mss_option_test.c | 428 + .../netxduo_test/netx_tcp_multiple_send_test.c | 342 + .../netxduo_test/netx_tcp_multiple_send_test2.c | 343 + .../netx_tcp_new_reno_algorithm_test1.c | 616 ++ .../netx_tcp_new_reno_algorithm_test2.c | 711 ++ .../netx_tcp_new_reno_algorithm_test3.c | 684 ++ .../netx_tcp_new_reno_algorithm_test4.c | 590 ++ .../netx_tcp_new_reno_algorithm_test5.c | 370 + .../netxduo_test/netx_tcp_not_enabled_test.c | 289 + .../netxduo_test/netx_tcp_nxe_api_test.c | 2298 +++++ .../netxduo_test/netx_tcp_odd_window_test.c | 314 + .../netxduo_test/netx_tcp_out_of_order_ack_test.c | 2801 ++++++ .../netx_tcp_out_of_order_packet_max_test.c | 319 + .../netx_tcp_out_of_order_packet_test.c | 493 ++ .../netx_tcp_out_of_window_control_packet_test.c | 334 + .../netx_tcp_overlapping_packet_test.c | 362 + .../netx_tcp_overlapping_packet_test_10.c | 319 + .../netx_tcp_overlapping_packet_test_11.c | 335 + .../netx_tcp_overlapping_packet_test_12.c | 347 + .../netx_tcp_overlapping_packet_test_13.c | 332 + .../netx_tcp_overlapping_packet_test_14.c | 326 + .../netx_tcp_overlapping_packet_test_15.c | 350 + .../netx_tcp_overlapping_packet_test_16.c | 340 + .../netx_tcp_overlapping_packet_test_17.c | 341 + .../netx_tcp_overlapping_packet_test_18.c | 334 + .../netx_tcp_overlapping_packet_test_2.c | 339 + .../netx_tcp_overlapping_packet_test_3.c | 348 + .../netx_tcp_overlapping_packet_test_4.c | 360 + .../netx_tcp_overlapping_packet_test_5.c | 348 + .../netx_tcp_overlapping_packet_test_6.c | 328 + .../netx_tcp_overlapping_packet_test_7.c | 328 + .../netx_tcp_overlapping_packet_test_8.c | 319 + .../netx_tcp_overlapping_packet_test_9.c | 337 + .../netxduo_test/netx_tcp_packet_leak_test.c | 345 + .../netx_tcp_packet_receive_function_test.c | 451 + .../netx_tcp_queue_depth_notify_test.c | 359 + .../netxduo_test/netx_tcp_race_condition_test.c | 304 + .../netxduo_test/netx_tcp_race_condition_test2.c | 383 + .../netxduo_test/netx_tcp_receive_cleanup_test.c | 261 + .../netx_tcp_receive_under_interface_detach_test.c | 265 + ...netx_tcp_receive_under_interface_detach_test2.c | 281 + .../netxduo_test/netx_tcp_reset_during_send_test.c | 275 + .../netxduo_test/netx_tcp_retransmit_test.c | 334 + .../netxduo_test/netx_tcp_retransmit_test_1.c | 465 + .../netxduo_test/netx_tcp_send_disconnect_test.c | 267 + .../netxduo_test/netx_tcp_send_fail_test.c | 466 + .../netxduo_test/netx_tcp_send_fail_test2.c | 323 + .../netxduo_test/netx_tcp_send_fail_test3.c | 277 + .../netx_tcp_server_socket_accept_test.c | 275 + .../netxduo_test/netx_tcp_simultaneous_test.c | 348 + .../netxduo_test/netx_tcp_small_packet_test.c | 159 + .../netx_tcp_small_window_preempt_test.c | 474 + .../netxduo_test/netx_tcp_small_window_test.c | 546 ++ .../netx_tcp_socket_available_bytes_test.c | 320 + .../netxduo_test/netx_tcp_socket_delete_test.c | 184 + .../netx_tcp_socket_listen_queue_test.c | 876 ++ .../netxduo_test/netx_tcp_socket_listen_test.c | 161 + .../netxduo_test/netx_tcp_socket_mss_test.c | 361 + .../netx_tcp_socket_receive_rst_test.c | 289 + .../netxduo_test/netx_tcp_socket_relisten_test.c | 484 + .../netxduo_test/netx_tcp_socket_relisten_test2.c | 503 ++ .../netx_tcp_socket_send_internal_test.c | 213 + .../netxduo_test/netx_tcp_socket_state_wait_test.c | 305 + .../netxduo_test/netx_tcp_socket_unaccept_test.c | 360 + .../netxduo_test/netx_tcp_socket_unbind_test.c | 273 + .../netxduo_test/netx_tcp_socket_unbind_test2.c | 192 + .../netxduo_test/netx_tcp_socket_unlisten_test.c | 184 + .../netx_tcp_time_wait_to_close_test.c | 242 + .../netxduo_test/netx_tcp_transmit_cleanup_test.c | 427 + .../netxduo_test/netx_tcp_transmit_not_done_test.c | 299 + ...netx_tcp_transmit_under_interface_detach_test.c | 288 + .../netx_tcp_tunnel_ipv4_ipv4_basic_test.c | 466 + .../netx_tcp_tunnel_ipv4_ipv6_address_test.c | 419 + .../netx_tcp_tunnel_ipv4_ipv6_basic_test.c | 502 ++ .../netx_tcp_tunnel_ipv4_ipv6_big_packet_test.c | 515 ++ .../netx_tcp_tunnel_ipv4_ipv6_small_windows_test.c | 626 ++ .../netx_tcp_tunnel_ipv6_ipv4_basic_test.c | 521 ++ .../netx_tcp_tunnel_ipv6_ipv6_basic_test.c | 517 ++ .../netxduo_test/netx_tcp_tx_queue_exceed_test.c | 316 + .../netxduo_test/netx_tcp_udp_random_port_test.c | 215 + .../netxduo_test/netx_tcp_urgent_packet_test.c | 337 + .../netxduo_test/netx_tcp_window_update_test.c | 314 + .../netxduo_test/netx_tcp_wrapping_sequence_test.c | 488 + .../netx_tcp_wrapping_sequence_test2.c | 324 + .../netx_tcp_wrapping_sequence_test3.c | 324 + .../netx_tcp_wrapping_sequence_test4.c | 325 + .../netx_tcp_zero_window_probe_2_test.c | 357 + .../netx_tcp_zero_window_probe_3_test.c | 396 + .../netxduo_test/netx_tcp_zero_window_probe_test.c | 359 + .../netxduo_test/netx_tcp_zero_window_test.c | 564 ++ .../netxduo_test/netx_udp_basic_processing_test.c | 699 ++ .../netxduo_test/netx_udp_bind_cleanup_test.c | 202 + .../regression/netxduo_test/netx_udp_branch_test.c | 477 + .../netxduo_test/netx_udp_checksum_zero_test.c | 296 + .../netxduo_test/netx_udp_fragment_test.c | 566 ++ .../netx_udp_fragmentation_processing_test.c | 2309 +++++ .../netxduo_test/netx_udp_free_port_find_test.c | 218 + .../netx_udp_ipv4_interface2_test_1_test.c | 511 ++ .../netx_udp_ipv6_interface2_test_1_test.c | 592 ++ .../netxduo_test/netx_udp_loopback_test.c | 358 + .../netxduo_test/netx_udp_multiple_ports_test.c | 617 ++ .../netxduo_test/netx_udp_nxe_api_test.c | 1353 +++ .../netxduo_test/netx_udp_packet_receive_test.c | 670 ++ .../netxduo_test/netx_udp_packet_type_test.c | 663 ++ .../netxduo_test/netx_udp_port_table_udpate_test.c | 347 + .../netxduo_test/netx_udp_port_unreachable_test.c | 296 + .../netxduo_test/netx_udp_socket_bind_test.c | 170 + .../netxduo_test/netx_udp_socket_delete_test.c | 139 + .../netx_udp_socket_unbind_receive_test.c | 143 + .../netxduo_test/netx_udp_socket_unbind_test.c | 232 + .../netxduo_test/netx_udp_source_send_test.c | 545 ++ .../netx_udp_tunnel_ipv4_ipv4_basic_test.c | 405 + .../netx_udp_tunnel_ipv4_ipv6_basic_test.c | 429 + .../netx_udp_tunnel_ipv6_ipv4_basic_test.c | 446 + .../netx_udp_tunnel_ipv6_ipv6_basic_test.c | 444 + test/regression/netxduo_test/netx_utility_test.c | 688 ++ .../pop3_test/netx_pop3_abnormal_packet_test.c | 157 + .../pop3_test/netx_pop3_mail_receive_test.c | 612 ++ .../netx_pop3_packet_with_endmarker_test.c | 727 ++ .../pop3_test/netx_pop3_two_mails_received_test.c | 732 ++ .../ppp_test/netx_ppp_IPCP_abnormal_packet_test.c | 279 + test/regression/ppp_test/netx_ppp_IPCP_nak_test.c | 490 + .../ppp_test/netx_ppp_IPCP_retransmit_test.c | 425 + test/regression/ppp_test/netx_ppp_IPCP_timeout.c | 362 + .../ppp_test/netx_ppp_LCP_invalid_packet_test.c | 238 + test/regression/ppp_test/netx_ppp_LCP_timeout.c | 233 + .../ppp_test/netx_ppp_PAP_bad_password_test.c | 410 + .../ppp_test/netx_ppp_PAP_bad_username_test.c | 413 + .../ppp_test/netx_ppp_acfc_option_test.c | 431 + .../netx_ppp_chap_bad_secret_failed_retry_test.c | 430 + ...netx_ppp_chap_bad_secret_passed_on_retry_test.c | 474 + .../ppp_test/netx_ppp_check_boundary_test.c | 426 + test/regression/ppp_test/netx_ppp_pap_basic_test.c | 511 ++ .../netx_ppp_pap_null_name_password_test.c | 340 + .../regression/ppp_test/netx_ppp_pfc_option_test.c | 431 + .../ppp_test/netx_ppp_request_dns_server_test.c | 289 + .../pppoe_test/netx_pppoe_ac_name_test.c | 473 + .../pppoe_test/netx_pppoe_api_extended_test.c | 470 + test/regression/pppoe_test/netx_pppoe_api_test.c | 463 + test/regression/pppoe_test/netx_pppoe_basic_test.c | 457 + .../pppoe_test/netx_pppoe_session_control_test.c | 542 ++ .../netx_ptp_client_announce_timeout_test.c | 254 + .../regression/ptp_test/netx_ptp_client_api_test.c | 279 + .../ptp_test/netx_ptp_client_basic_test.c | 234 + .../ptp_test/netx_ptp_client_calibrate_test.c | 348 + .../ptp_test/netx_ptp_client_ipv6_test.c | 260 + .../netx_ptp_client_master_selection_test.c | 322 + .../ptp_test/netx_ptp_client_two_steps_off_test.c | 234 + test/regression/ptp_test/netx_ptp_utility.c | 526 ++ test/regression/ptp_test/netx_ptp_utility.h | 70 + .../rtp_test/netx_rtcp_abnormal_packet_test.c | 337 + test/regression/rtp_test/netx_rtcp_basic_test.c | 232 + .../rtp_test/netx_rtcp_packet_process_test.c | 279 + .../rtp_test/netx_rtcp_packet_send_test.c | 203 + test/regression/rtp_test/netx_rtp_api_test.c | 152 + test/regression/rtp_test/netx_rtp_basic_test.c | 264 + .../rtp_test/netx_rtp_free_udp_port_find_test.c | 224 + .../rtp_test/netx_rtp_multi_clients_test.c | 380 + .../rtp_test/netx_rtp_multi_interfaces_test.c | 948 ++ test/regression/rtp_test/netx_rtp_multicast_test.c | 372 + .../rtp_test/netx_rtp_session_aac_send_test.c | 383 + .../rtp_test/netx_rtp_session_h264_send_test.c | 499 ++ .../rtp_test/netx_rtp_session_jpeg_send_test.c | 558 ++ .../rtp_test/netx_rtp_session_packet_send_test.c | 355 + test/regression/rtsp_test/netx_rtsp_api_test.c | 312 + .../rtsp_test/netx_rtsp_client_timeout_test.c | 952 ++ .../rtsp_test/netx_rtsp_delete_beforehand_test.c | 695 ++ .../rtsp_test/netx_rtsp_error_response_test.c | 402 + .../rtsp_test/netx_rtsp_multiple_clients_test.c | 871 ++ .../rtsp_test/netx_rtsp_multiple_request_test.c | 359 + .../rtsp_test/netx_rtsp_rtp_basic_test.c | 704 ++ .../rtsp_test/netx_rtsp_rtp_ipv6_basic_test.c | 722 ++ .../rtsp_test/netx_rtsp_rtp_ipv6_multicast_test.c | 931 ++ .../rtsp_test/netx_rtsp_rtp_multicast_test.c | 886 ++ .../smtp_test/netx_smtp_abnormal_packet_test.c | 515 ++ .../smtp_test/netx_smtp_auth_logon_function_test.c | 591 ++ .../netx_smtp_auth_no_type_function_test.c | 586 ++ .../smtp_test/netx_smtp_auth_no_type_test.c | 586 ++ .../smtp_test/netx_smtp_auth_none_test.c | 575 ++ .../smtp_test/netx_smtp_basic_function_test.c | 584 ++ .../smtp_test/netx_smtp_invalid_release_test.c | 557 ++ .../netx_smtp_missing_last_250_EHLO_message_test.c | 654 ++ ...x_smtp_two_packet_EHLO_auth_last_message_test.c | 665 ++ .../netx_smtp_two_packet_EHLO_message_test.c | 666 ++ test/regression/smtp_test/smtp_server_packets.c | 299 + test/regression/smtp_test/smtp_test_files.mk | 15 + test/regression/snmp_test/GetSet_IPv4v6Address.c | 57 + .../GetSet_Integers_Large_and_Neg_Numbers.c | 79 + test/regression/snmp_test/GetSet_OctetStrings.c | 58 + .../snmp_test/Get_Miscellaneous_Data_type.c | 137 + test/regression/snmp_test/get_snmp_v3_request.c | 94 + .../snmp_test/netx_snmp_abnormal_packet_test.c | 489 + .../regression/snmp_test/netx_snmp_basic_v2_test.c | 668 ++ .../netx_snmp_no_security_function_test.c | 827 ++ .../snmp_test/netx_snmp_setget_integers_test.c | 668 ++ .../snmp_test/netx_snmp_setget_ip_address_test.c | 721 ++ .../snmp_test/netx_snmp_setget_misc_test.c | 734 ++ .../netx_snmp_setget_octet_strings_test.c | 681 ++ .../snmp_test/netx_snmp_v1_buffer_overwrite_test.c | 504 ++ .../netx_snmp_v1_object_id_buffer_overwrite_test.c | 426 + .../netx_snmp_v1_packet_double_release_test.c | 461 + .../snmp_test/netx_snmp_v2_buffer_overwrite_test.c | 477 + .../snmp_test/netx_snmp_v2_get_bulk_request_test.c | 616 ++ .../snmp_test/netx_snmp_v2_send_trap_test.c | 670 ++ .../snmp_test/netx_snmp_v2_unknown_oid_test.c | 634 ++ .../snmp_test/netx_snmp_v3_buffer_overwrite_test.c | 520 ++ ...etx_snmp_v3_decrypt_pdu_buffer_overwrite_test.c | 524 ++ ...etx_snmp_v3_encrypt_pdu_buffer_overwrite_test.c | 517 ++ ..._v3_encrypt_pdu_padding_buffer_overwrite_test.c | 525 ++ .../netx_snmp_v3_md5_failed_security_test.c | 660 ++ .../netx_snmp_v3_md5_security_extended_test.c | 668 ++ .../snmp_test/netx_snmp_v3_md5_security_test.c | 641 ++ .../netx_snmp_v3_no_security_function_test.c | 660 ++ .../snmp_test/netx_snmp_v3_nosec_traplist_test.c | 895 ++ .../netx_snmp_v3_object_id_buffer_overwrite_test.c | 517 ++ test/regression/snmp_test/small_mib_helper.c | 116 + test/regression/snmp_test/small_mib_helper.h | 40 + test/regression/snmp_test/snmp_manager_packets.c | 1980 +++++ .../netx_sntp_client_broadcast_basic_test.c | 334 + .../netx_sntp_client_ipv6_broadcast_basic_test.c | 339 + .../netx_sntp_client_ipv6_unicast_basic_test.c | 339 + .../sntp_test/netx_sntp_client_kod_test.c | 269 + .../sntp_test/netx_sntp_client_packet_chain_test.c | 389 + .../netx_sntp_client_seconds_to_date_test.c | 130 + .../netx_sntp_client_unicast_basic_test.c | 355 + .../netx_sntp_client_unicast_display_date_test.c | 361 + .../netx_sntp_forward_unicast_update_test.c | 322 + .../sntp_test/netx_sntp_request_unicast_test.c | 419 + test/regression/tahi_test/netx_tahi.h | 95 + .../tahi_test/netx_tahi_dhcpv6_test_01_002.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_003.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_004.c | 165 + .../tahi_test/netx_tahi_dhcpv6_test_01_005.c | 165 + .../tahi_test/netx_tahi_dhcpv6_test_01_006.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_007.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_008.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_009.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_010.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_011.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_012.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_013.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_014.c | 229 + .../tahi_test/netx_tahi_dhcpv6_test_01_019.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_020.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_021.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_022.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_023.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_024.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_025.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_026.c | 165 + .../tahi_test/netx_tahi_dhcpv6_test_01_027.c | 165 + .../tahi_test/netx_tahi_dhcpv6_test_01_028.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_029.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_030.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_031.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_032.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_033.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_034.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_035.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_036.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_037.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_038.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_039.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_040.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_041.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_042.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_043.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_044.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_045.c | 177 + .../tahi_test/netx_tahi_dhcpv6_test_01_046.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_047.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_048.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_049.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_050.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_051.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_052.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_053.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_054.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_055.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_056.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_057.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_058.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_059.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_060.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_01_061.c | 174 + .../tahi_test/netx_tahi_dhcpv6_test_01_062.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_063.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_064.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_065.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_066.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_067.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_068.c | 339 + .../tahi_test/netx_tahi_dhcpv6_test_01_069.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_070.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_071.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_072.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_01_073.c | 331 + .../tahi_test/netx_tahi_dhcpv6_test_01_074.c | 340 + .../tahi_test/netx_tahi_dhcpv6_test_01_075.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_01_076.c | 332 + .../tahi_test/netx_tahi_dhcpv6_test_01_077.c | 333 + .../tahi_test/netx_tahi_dhcpv6_test_01_078.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_079.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_080.c | 167 + .../tahi_test/netx_tahi_dhcpv6_test_01_081.c | 175 + .../tahi_test/netx_tahi_dhcpv6_test_01_082.c | 318 + .../tahi_test/netx_tahi_dhcpv6_test_01_083.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_084.c | 314 + .../tahi_test/netx_tahi_dhcpv6_test_01_085.c | 311 + .../tahi_test/netx_tahi_dhcpv6_test_01_086.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_087.c | 325 + .../tahi_test/netx_tahi_dhcpv6_test_01_088.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_089.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_01_090.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_091.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_092.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_093.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_094.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_095.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_096.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_01_097.c | 325 + .../tahi_test/netx_tahi_dhcpv6_test_01_098.c | 325 + .../tahi_test/netx_tahi_dhcpv6_test_01_099.c | 324 + .../tahi_test/netx_tahi_dhcpv6_test_04_002.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_003.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_004.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_005.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_006.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_007.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_008.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_04_009.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_04_010.c | 437 + .../tahi_test/netx_tahi_dhcpv6_test_04_012.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_04_013.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_04_014.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_04_015.c | 164 + .../tahi_test/netx_tahi_dhcpv6_test_04_016.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_04_017.c | 166 + .../tahi_test/netx_tahi_dhcpv6_test_04_018.c | 178 + .../tahi_test/netx_tahi_dhcpv6_test_04_019.c | 178 + .../tahi_test/netx_tahi_dhcpv6_test_04_020.c | 417 + .../tahi_test/netx_tahi_dhcpv6_test_04_021.c | 417 + .../tahi_test/netx_tahi_dhcpv6_test_04_022.c | 434 + .../tahi_test/netx_tahi_dhcpv6_test_04_026.c | 163 + .../tahi_test/netx_tahi_dhcpv6_test_04_027.c | 229 + .../tahi_test/netx_tahi_dhcpv6_test_07_002.c | 418 + .../tahi_test/netx_tahi_dhcpv6_test_07_003.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_004.c | 414 + .../tahi_test/netx_tahi_dhcpv6_test_07_005.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_006.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_007.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_008.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_009.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_010.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_011.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_012.c | 414 + .../tahi_test/netx_tahi_dhcpv6_test_07_013.c | 414 + .../tahi_test/netx_tahi_dhcpv6_test_07_014.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_015.c | 323 + .../tahi_test/netx_tahi_dhcpv6_test_07_016.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_017.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_018.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_019.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_020.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_021.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_022.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_023.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_024.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_025.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_026.c | 176 + .../tahi_test/netx_tahi_dhcpv6_test_07_027.c | 238 + .../regression/tahi_test/netx_tahi_run_test_case.c | 1165 +++ test/regression/tahi_test/netx_tahi_test_1.c | 305 + test/regression/tahi_test/netx_tahi_test_2_01.c | 525 ++ test/regression/tahi_test/netx_tahi_test_2_02.c | 146 + test/regression/tahi_test/netx_tahi_test_2_03.c | 145 + test/regression/tahi_test/netx_tahi_test_2_04.c | 145 + test/regression/tahi_test/netx_tahi_test_2_05.c | 145 + test/regression/tahi_test/netx_tahi_test_2_06.c | 145 + test/regression/tahi_test/netx_tahi_test_2_07.c | 145 + test/regression/tahi_test/netx_tahi_test_2_08.c | 145 + test/regression/tahi_test/netx_tahi_test_2_09.c | 145 + test/regression/tahi_test/netx_tahi_test_2_10.c | 240 + test/regression/tahi_test/netx_tahi_test_2_11.c | 348 + test/regression/tahi_test/netx_tahi_test_3_01.c | 150 + test/regression/tahi_test/netx_tahi_test_3_02.c | 150 + test/regression/tahi_test/netx_tahi_test_3_03.c | 134 + test/regression/tahi_test/netx_tahi_test_3_04.c | 150 + test/regression/tahi_test/netx_tahi_test_3_05.c | 134 + test/regression/tahi_test/netx_tahi_test_3_06.c | 150 + test/regression/tahi_test/netx_tahi_test_3_07.c | 150 + test/regression/tahi_test/netx_tahi_test_3_08.c | 150 + test/regression/tahi_test/netx_tahi_test_3_09.c | 150 + test/regression/tahi_test/netx_tahi_test_3_10.c | 150 + test/regression/tahi_test/netx_tahi_test_3_11.c | 150 + test/regression/tahi_test/netx_tahi_test_3_12.c | 150 + test/regression/tahi_test/netx_tahi_test_3_13.c | 150 + test/regression/tahi_test/netx_tahi_test_3_14.c | 134 + test/regression/tahi_test/netx_tahi_test_3_15.c | 134 + test/regression/tahi_test/netx_tahi_test_3_16.c | 150 + test/regression/tahi_test/netx_tahi_test_3_17.c | 150 + test/regression/tahi_test/netx_tahi_test_3_18.c | 150 + test/regression/tahi_test/netx_tahi_test_3_19.c | 150 + test/regression/tahi_test/netx_tahi_test_3_20.c | 150 + test/regression/tahi_test/netx_tahi_test_3_21.c | 150 + test/regression/tahi_test/netx_tahi_test_3_22.c | 150 + test/regression/tahi_test/netx_tahi_test_3_23.c | 134 + test/regression/tahi_test/netx_tahi_test_3_24.c | 134 + test/regression/tahi_test/netx_tahi_test_3_25.c | 150 + test/regression/tahi_test/netx_tahi_test_3_26.c | 150 + test/regression/tahi_test/netx_tahi_test_3_27.c | 150 + test/regression/tahi_test/netx_tahi_test_3_28.c | 150 + test/regression/tahi_test/netx_tahi_test_3_29.c | 150 + test/regression/tahi_test/netx_tahi_test_3_30.c | 150 + test/regression/tahi_test/netx_tahi_test_3_31.c | 150 + test/regression/tahi_test/netx_tahi_test_3_32.c | 150 + test/regression/tahi_test/netx_tahi_test_3_33.c | 150 + test/regression/tahi_test/netx_tahi_test_3_34.c | 150 + test/regression/tahi_test/netx_tahi_test_3_35.c | 150 + test/regression/tahi_test/netx_tahi_test_3_36.c | 150 + test/regression/tahi_test/netx_tahi_test_3_37.c | 150 + test/regression/tahi_test/netx_tahi_test_3_38.c | 150 + test/regression/tahi_test/netx_tahi_test_3_39.c | 150 + test/regression/tahi_test/netx_tahi_test_3_40.c | 150 + test/regression/tahi_test/netx_tahi_test_3_41.c | 150 + test/regression/tahi_test/netx_tahi_test_3_42.c | 150 + test/regression/tahi_test/netx_tahi_test_3_43.c | 150 + test/regression/tahi_test/netx_tahi_test_3_44.c | 150 + test/regression/tahi_test/netx_tahi_test_3_45.c | 150 + test/regression/tahi_test/netx_tahi_test_4_10.c | 150 + test/regression/tahi_test/netx_tahi_test_4_11.c | 150 + test/regression/tahi_test/netx_tahi_test_4_12.c | 150 + test/regression/tahi_test/netx_tahi_test_4_13.c | 150 + test/regression/tahi_test/netx_tahi_test_4_14.c | 150 + test/regression/tahi_test/netx_tahi_test_4_15.c | 150 + test/regression/tahi_test/netx_tahi_test_4_16.c | 150 + test/regression/tahi_test/netx_tahi_test_4_2.c | 150 + test/regression/tahi_test/netx_tahi_test_4_3.c | 150 + test/regression/tahi_test/netx_tahi_test_4_4.c | 150 + test/regression/tahi_test/netx_tahi_test_4_5.c | 150 + test/regression/tahi_test/netx_tahi_test_4_6.c | 150 + test/regression/tahi_test/netx_tahi_test_4_7.c | 150 + test/regression/tahi_test/netx_tahi_test_4_8.c | 150 + test/regression/tahi_test/netx_tahi_test_4_9.c | 150 + test/regression/tahi_test/netx_tahi_test_5.c | 208 + test/regression/tahi_test/netx_tahi_test_ipsec.c | 625 ++ test/regression/tahi_test/netx_tahi_test_ipsec_2.c | 899 ++ .../tahi_test/netx_tahi_test_ipsec_udp.c | 671 ++ .../tahi_test/netx_tahi_test_ipsec_udp_2.c | 968 ++ test/regression/tahi_test/tahi.a | Bin 0 -> 2198906 bytes test/regression/tahi_test/tahi.so | Bin 0 -> 1705368 bytes test/regression/tahi_test/tahi64.a | Bin 0 -> 2656014 bytes test/regression/tahi_test/tahi64.so | Bin 0 -> 2895190 bytes test/regression/tahi_test/tahi_01_001.c | 32 + test/regression/tahi_test/tahi_01_002.c | 368 + test/regression/tahi_test/tahi_01_003.c | 173 + test/regression/tahi_test/tahi_01_004.c | 175 + test/regression/tahi_test/tahi_01_005.c | 167 + test/regression/tahi_test/tahi_01_006.c | 165 + test/regression/tahi_test/tahi_01_007.c | 106 + test/regression/tahi_test/tahi_01_008.c | 7481 ++++++++++++++++ test/regression/tahi_test/tahi_01_009.c | 185 + test/regression/tahi_test/tahi_01_010.c | 178 + test/regression/tahi_test/tahi_01_011.c | 185 + test/regression/tahi_test/tahi_01_012.c | 105 + test/regression/tahi_test/tahi_01_013.c | 7699 ++++++++++++++++ test/regression/tahi_test/tahi_01_014.c | 188 + test/regression/tahi_test/tahi_01_015.c | 187 + test/regression/tahi_test/tahi_01_016.c | 186 + test/regression/tahi_test/tahi_01_017.c | 189 + test/regression/tahi_test/tahi_01_018.c | 189 + test/regression/tahi_test/tahi_01_019.c | 122 + test/regression/tahi_test/tahi_01_020.c | 191 + test/regression/tahi_test/tahi_01_021.c | 190 + test/regression/tahi_test/tahi_01_022.c | 177 + test/regression/tahi_test/tahi_01_023.c | 177 + test/regression/tahi_test/tahi_01_024.c | 155 + test/regression/tahi_test/tahi_01_025.c | 104 + test/regression/tahi_test/tahi_01_026.c | 183 + test/regression/tahi_test/tahi_01_027.c | 184 + test/regression/tahi_test/tahi_01_028.c | 183 + test/regression/tahi_test/tahi_01_029.c | 117 + test/regression/tahi_test/tahi_01_030.c | 155 + test/regression/tahi_test/tahi_01_031.c | 155 + test/regression/tahi_test/tahi_01_032.c | 155 + test/regression/tahi_test/tahi_01_033.c | 239 + test/regression/tahi_test/tahi_01_034.c | 184 + test/regression/tahi_test/tahi_01_035.c | 183 + test/regression/tahi_test/tahi_01_036.c | 184 + test/regression/tahi_test/tahi_01_037.c | 117 + test/regression/tahi_test/tahi_01_038.c | 436 + test/regression/tahi_test/tahi_01_039.c | 383 + test/regression/tahi_test/tahi_01_040.c | 451 + test/regression/tahi_test/tahi_01_041.c | 450 + test/regression/tahi_test/tahi_01_042.c | 492 ++ test/regression/tahi_test/tahi_01_043.c | 491 ++ test/regression/tahi_test/tahi_01_044.c | 489 + test/regression/tahi_test/tahi_01_045.c | 484 + test/regression/tahi_test/tahi_01_046.c | 483 + test/regression/tahi_test/tahi_01_047.c | 1052 +++ test/regression/tahi_test/tahi_01_048.c | 395 + test/regression/tahi_test/tahi_01_049.c | 467 + test/regression/tahi_test/tahi_01_050.c | 411 + test/regression/tahi_test/tahi_01_051.c | 412 + test/regression/tahi_test/tahi_01_052.c | 343 + test/regression/tahi_test/tahi_01_053.c | 181 + test/regression/tahi_test/tahi_01_054.c | 177 + test/regression/tahi_test/tahi_02_001.c | 88 + test/regression/tahi_test/tahi_02_002.c | 72 + test/regression/tahi_test/tahi_02_003.c | 135 + test/regression/tahi_test/tahi_02_004.c | 132 + test/regression/tahi_test/tahi_02_005.c | 200 + test/regression/tahi_test/tahi_02_006.c | 407 + test/regression/tahi_test/tahi_02_007.c | 210 + test/regression/tahi_test/tahi_02_008.c | 279 + test/regression/tahi_test/tahi_02_009.c | 297 + test/regression/tahi_test/tahi_02_010.c | 367 + test/regression/tahi_test/tahi_02_011.c | 367 + test/regression/tahi_test/tahi_02_012.c | 469 + test/regression/tahi_test/tahi_02_013.c | 336 + test/regression/tahi_test/tahi_02_014.c | 336 + test/regression/tahi_test/tahi_02_015.c | 336 + test/regression/tahi_test/tahi_02_016.c | 32 + test/regression/tahi_test/tahi_02_017.c | 31 + test/regression/tahi_test/tahi_02_018.c | 32 + test/regression/tahi_test/tahi_02_019.c | 32 + test/regression/tahi_test/tahi_02_020.c | 32 + test/regression/tahi_test/tahi_02_021.c | 32 + test/regression/tahi_test/tahi_02_022.c | 32 + test/regression/tahi_test/tahi_02_023.c | 33 + test/regression/tahi_test/tahi_02_024.c | 113 + test/regression/tahi_test/tahi_02_025.c | 113 + test/regression/tahi_test/tahi_02_026.c | 85 + test/regression/tahi_test/tahi_02_027.c | 150 + test/regression/tahi_test/tahi_02_028.c | 150 + test/regression/tahi_test/tahi_02_029.c | 86 + test/regression/tahi_test/tahi_02_030.c | 229 + test/regression/tahi_test/tahi_02_031.c | 190 + test/regression/tahi_test/tahi_02_032.c | 229 + test/regression/tahi_test/tahi_02_033.c | 190 + test/regression/tahi_test/tahi_02_034.c | 191 + test/regression/tahi_test/tahi_02_035.c | 191 + test/regression/tahi_test/tahi_02_036.c | 191 + test/regression/tahi_test/tahi_02_037.c | 191 + test/regression/tahi_test/tahi_02_038.c | 166 + test/regression/tahi_test/tahi_02_039.c | 150 + test/regression/tahi_test/tahi_02_040.c | 165 + test/regression/tahi_test/tahi_02_041.c | 178 + test/regression/tahi_test/tahi_02_042.c | 266 + test/regression/tahi_test/tahi_02_043.c | 267 + test/regression/tahi_test/tahi_02_044.c | 227 + test/regression/tahi_test/tahi_02_045.c | 87 + test/regression/tahi_test/tahi_02_046.c | 87 + test/regression/tahi_test/tahi_02_047.c | 87 + test/regression/tahi_test/tahi_02_048.c | 87 + test/regression/tahi_test/tahi_02_049.c | 87 + test/regression/tahi_test/tahi_02_050.c | 87 + test/regression/tahi_test/tahi_02_051.c | 88 + test/regression/tahi_test/tahi_02_052.c | 86 + test/regression/tahi_test/tahi_02_053.c | 86 + test/regression/tahi_test/tahi_02_054.c | 86 + test/regression/tahi_test/tahi_02_055.c | 86 + test/regression/tahi_test/tahi_02_056.c | 85 + test/regression/tahi_test/tahi_02_057.c | 85 + test/regression/tahi_test/tahi_02_058.c | 85 + test/regression/tahi_test/tahi_02_059.c | 85 + test/regression/tahi_test/tahi_02_060.c | 175 + test/regression/tahi_test/tahi_02_061.c | 175 + test/regression/tahi_test/tahi_02_062.c | 112 + test/regression/tahi_test/tahi_02_063.c | 112 + test/regression/tahi_test/tahi_02_064.c | 86 + test/regression/tahi_test/tahi_02_065.c | 188 + test/regression/tahi_test/tahi_02_066.c | 188 + test/regression/tahi_test/tahi_02_067.c | 188 + test/regression/tahi_test/tahi_02_068.c | 188 + test/regression/tahi_test/tahi_02_069.c | 189 + test/regression/tahi_test/tahi_02_070.c | 189 + test/regression/tahi_test/tahi_02_071.c | 189 + test/regression/tahi_test/tahi_02_072.c | 189 + test/regression/tahi_test/tahi_02_073.c | 151 + test/regression/tahi_test/tahi_02_074.c | 151 + test/regression/tahi_test/tahi_02_075.c | 151 + test/regression/tahi_test/tahi_02_076.c | 189 + test/regression/tahi_test/tahi_02_077.c | 189 + test/regression/tahi_test/tahi_02_078.c | 189 + test/regression/tahi_test/tahi_02_079.c | 151 + test/regression/tahi_test/tahi_02_080.c | 151 + test/regression/tahi_test/tahi_02_081.c | 188 + test/regression/tahi_test/tahi_02_082.c | 188 + test/regression/tahi_test/tahi_02_083.c | 151 + test/regression/tahi_test/tahi_02_084.c | 123 + test/regression/tahi_test/tahi_02_085.c | 190 + test/regression/tahi_test/tahi_02_086.c | 190 + test/regression/tahi_test/tahi_02_087.c | 152 + test/regression/tahi_test/tahi_02_088.c | 152 + test/regression/tahi_test/tahi_02_089.c | 191 + test/regression/tahi_test/tahi_02_090.c | 191 + test/regression/tahi_test/tahi_02_091.c | 152 + test/regression/tahi_test/tahi_02_092.c | 152 + test/regression/tahi_test/tahi_02_093.c | 152 + test/regression/tahi_test/tahi_02_094.c | 191 + test/regression/tahi_test/tahi_02_095.c | 152 + test/regression/tahi_test/tahi_02_096.c | 286 + test/regression/tahi_test/tahi_02_097.c | 152 + test/regression/tahi_test/tahi_02_098.c | 152 + test/regression/tahi_test/tahi_02_099.c | 151 + test/regression/tahi_test/tahi_02_100.c | 151 + test/regression/tahi_test/tahi_02_101.c | 127 + test/regression/tahi_test/tahi_02_102.c | 127 + test/regression/tahi_test/tahi_02_103.c | 203 + test/regression/tahi_test/tahi_02_104.c | 203 + test/regression/tahi_test/tahi_02_105.c | 128 + test/regression/tahi_test/tahi_02_106.c | 128 + test/regression/tahi_test/tahi_02_107.c | 204 + test/regression/tahi_test/tahi_02_108.c | 204 + test/regression/tahi_test/tahi_02_109.c | 128 + test/regression/tahi_test/tahi_02_110.c | 165 + test/regression/tahi_test/tahi_02_111.c | 128 + test/regression/tahi_test/tahi_02_112.c | 204 + test/regression/tahi_test/tahi_02_113.c | 128 + test/regression/tahi_test/tahi_02_114.c | 128 + test/regression/tahi_test/tahi_02_115.c | 128 + test/regression/tahi_test/tahi_02_116.c | 165 + test/regression/tahi_test/tahi_02_117.c | 127 + test/regression/tahi_test/tahi_02_118.c | 127 + test/regression/tahi_test/tahi_02_119.c | 282 + test/regression/tahi_test/tahi_02_120.c | 282 + test/regression/tahi_test/tahi_02_121.c | 282 + test/regression/tahi_test/tahi_02_122.c | 282 + test/regression/tahi_test/tahi_02_123.c | 417 + test/regression/tahi_test/tahi_02_124.c | 283 + test/regression/tahi_test/tahi_02_125.c | 283 + test/regression/tahi_test/tahi_02_126.c | 283 + test/regression/tahi_test/tahi_02_127.c | 88 + test/regression/tahi_test/tahi_02_128.c | 91 + test/regression/tahi_test/tahi_02_129.c | 128 + test/regression/tahi_test/tahi_02_130.c | 210 + test/regression/tahi_test/tahi_02_131.c | 96 + test/regression/tahi_test/tahi_02_132.c | 96 + test/regression/tahi_test/tahi_02_133.c | 96 + test/regression/tahi_test/tahi_02_134.c | 96 + test/regression/tahi_test/tahi_02_135.c | 85 + test/regression/tahi_test/tahi_02_136.c | 85 + test/regression/tahi_test/tahi_02_137.c | 85 + test/regression/tahi_test/tahi_02_138.c | 414 + test/regression/tahi_test/tahi_02_139.c | 91 + test/regression/tahi_test/tahi_02_140.c | 92 + test/regression/tahi_test/tahi_02_141.c | 93 + test/regression/tahi_test/tahi_02_142.c | 92 + test/regression/tahi_test/tahi_02_143.c | 92 + test/regression/tahi_test/tahi_02_144.c | 93 + test/regression/tahi_test/tahi_02_145.c | 387 + test/regression/tahi_test/tahi_02_146.c | 387 + test/regression/tahi_test/tahi_02_147.c | 7811 ++++++++++++++++ test/regression/tahi_test/tahi_02_148.c | 512 ++ test/regression/tahi_test/tahi_02_149.c | 516 ++ test/regression/tahi_test/tahi_02_150.c | 719 ++ test/regression/tahi_test/tahi_02_151.c | 1320 +++ test/regression/tahi_test/tahi_02_152.c | 115 + test/regression/tahi_test/tahi_02_153.c | 128 + test/regression/tahi_test/tahi_02_154.c | 166 + test/regression/tahi_test/tahi_02_155.c | 205 + test/regression/tahi_test/tahi_02_156.c | 206 + test/regression/tahi_test/tahi_02_157.c | 343 + test/regression/tahi_test/tahi_02_158.c | 274 + test/regression/tahi_test/tahi_02_159.c | 273 + test/regression/tahi_test/tahi_02_160.c | 169 + test/regression/tahi_test/tahi_02_161.c | 169 + test/regression/tahi_test/tahi_02_162.c | 169 + test/regression/tahi_test/tahi_02_163.c | 235 + test/regression/tahi_test/tahi_02_164.c | 237 + test/regression/tahi_test/tahi_02_165.c | 236 + test/regression/tahi_test/tahi_02_166.c | 154 + test/regression/tahi_test/tahi_02_167.c | 185 + test/regression/tahi_test/tahi_02_168.c | 88 + test/regression/tahi_test/tahi_02_169.c | 516 ++ test/regression/tahi_test/tahi_02_170.c | 391 + test/regression/tahi_test/tahi_02_171.c | 318 + test/regression/tahi_test/tahi_02_172.c | 326 + test/regression/tahi_test/tahi_02_173.c | 319 + test/regression/tahi_test/tahi_02_174.c | 318 + test/regression/tahi_test/tahi_02_175.c | 318 + test/regression/tahi_test/tahi_02_176.c | 275 + test/regression/tahi_test/tahi_02_177.c | 275 + test/regression/tahi_test/tahi_02_178.c | 275 + test/regression/tahi_test/tahi_02_179.c | 275 + test/regression/tahi_test/tahi_02_180.c | 275 + test/regression/tahi_test/tahi_02_181.c | 275 + test/regression/tahi_test/tahi_02_182.c | 275 + test/regression/tahi_test/tahi_02_183.c | 275 + test/regression/tahi_test/tahi_02_184.c | 275 + test/regression/tahi_test/tahi_02_185.c | 408 + test/regression/tahi_test/tahi_02_186.c | 416 + test/regression/tahi_test/tahi_02_187.c | 409 + test/regression/tahi_test/tahi_02_188.c | 417 + test/regression/tahi_test/tahi_02_189.c | 410 + test/regression/tahi_test/tahi_02_190.c | 409 + test/regression/tahi_test/tahi_02_191.c | 409 + test/regression/tahi_test/tahi_02_192.c | 409 + test/regression/tahi_test/tahi_02_193.c | 409 + test/regression/tahi_test/tahi_02_194.c | 409 + test/regression/tahi_test/tahi_02_195.c | 409 + test/regression/tahi_test/tahi_02_196.c | 409 + test/regression/tahi_test/tahi_02_197.c | 409 + test/regression/tahi_test/tahi_02_198.c | 541 ++ test/regression/tahi_test/tahi_02_199.c | 409 + test/regression/tahi_test/tahi_02_200.c | 582 ++ test/regression/tahi_test/tahi_02_201.c | 410 + test/regression/tahi_test/tahi_02_202.c | 413 + test/regression/tahi_test/tahi_02_203.c | 410 + test/regression/tahi_test/tahi_02_204.c | 385 + test/regression/tahi_test/tahi_02_205.c | 307 + test/regression/tahi_test/tahi_02_206.c | 320 + test/regression/tahi_test/tahi_02_207.c | 328 + test/regression/tahi_test/tahi_02_208.c | 496 ++ test/regression/tahi_test/tahi_02_209.c | 308 + test/regression/tahi_test/tahi_02_210.c | 334 + test/regression/tahi_test/tahi_02_211.c | 342 + test/regression/tahi_test/tahi_02_212.c | 510 ++ test/regression/tahi_test/tahi_02_213.c | 410 + test/regression/tahi_test/tahi_02_214.c | 411 + test/regression/tahi_test/tahi_02_215.c | 372 + test/regression/tahi_test/tahi_02_216.c | 380 + test/regression/tahi_test/tahi_02_217.c | 548 ++ test/regression/tahi_test/tahi_02_218.c | 403 + test/regression/tahi_test/tahi_02_219.c | 404 + test/regression/tahi_test/tahi_02_220.c | 539 ++ test/regression/tahi_test/tahi_02_221.c | 412 + test/regression/tahi_test/tahi_02_222.c | 580 ++ test/regression/tahi_test/tahi_02_223.c | 407 + test/regression/tahi_test/tahi_02_224.c | 408 + test/regression/tahi_test/tahi_02_225.c | 446 + test/regression/tahi_test/tahi_02_226.c | 454 + test/regression/tahi_test/tahi_02_227.c | 622 ++ test/regression/tahi_test/tahi_02_228.c | 308 + test/regression/tahi_test/tahi_02_229.c | 308 + test/regression/tahi_test/tahi_02_230.c | 308 + test/regression/tahi_test/tahi_02_231.c | 308 + test/regression/tahi_test/tahi_02_232.c | 308 + test/regression/tahi_test/tahi_02_233.c | 308 + test/regression/tahi_test/tahi_02_234.c | 440 + test/regression/tahi_test/tahi_02_235.c | 308 + test/regression/tahi_test/tahi_02_236.c | 308 + test/regression/tahi_test/tahi_03_001.c | 94 + test/regression/tahi_test/tahi_03_002.c | 161 + test/regression/tahi_test/tahi_03_003.c | 136 + test/regression/tahi_test/tahi_03_004.c | 139 + test/regression/tahi_test/tahi_03_005.c | 136 + test/regression/tahi_test/tahi_03_006.c | 138 + test/regression/tahi_test/tahi_03_007.c | 201 + test/regression/tahi_test/tahi_03_008.c | 201 + test/regression/tahi_test/tahi_03_009.c | 201 + test/regression/tahi_test/tahi_03_010.c | 164 + test/regression/tahi_test/tahi_03_011.c | 164 + test/regression/tahi_test/tahi_03_012.c | 201 + test/regression/tahi_test/tahi_03_013.c | 202 + test/regression/tahi_test/tahi_03_014.c | 173 + test/regression/tahi_test/tahi_03_015.c | 111 + test/regression/tahi_test/tahi_03_016.c | 139 + test/regression/tahi_test/tahi_03_017.c | 165 + test/regression/tahi_test/tahi_03_018.c | 202 + test/regression/tahi_test/tahi_03_019.c | 202 + test/regression/tahi_test/tahi_03_020.c | 284 + test/regression/tahi_test/tahi_03_021.c | 152 + test/regression/tahi_test/tahi_03_022.c | 202 + test/regression/tahi_test/tahi_03_023.c | 174 + test/regression/tahi_test/tahi_03_024.c | 111 + test/regression/tahi_test/tahi_03_025.c | 165 + test/regression/tahi_test/tahi_03_026.c | 202 + test/regression/tahi_test/tahi_03_027.c | 167 + test/regression/tahi_test/tahi_03_028.c | 141 + test/regression/tahi_test/tahi_03_029.c | 141 + test/regression/tahi_test/tahi_03_030.c | 185 + test/regression/tahi_test/tahi_03_031.c | 316 + test/regression/tahi_test/tahi_03_032.c | 342 + test/regression/tahi_test/tahi_03_033.c | 102 + test/regression/tahi_test/tahi_03_034.c | 102 + test/regression/tahi_test/tahi_03_035.c | 102 + test/regression/tahi_test/tahi_03_036.c | 102 + test/regression/tahi_test/tahi_03_037.c | 102 + test/regression/tahi_test/tahi_03_038.c | 102 + test/regression/tahi_test/tahi_03_039.c | 102 + test/regression/tahi_test/tahi_03_040.c | 115 + test/regression/tahi_test/tahi_03_041.c | 141 + test/regression/tahi_test/tahi_03_042.c | 421 + test/regression/tahi_test/tahi_03_043.c | 248 + test/regression/tahi_test/tahi_03_044.c | 329 + test/regression/tahi_test/tahi_03_045.c | 346 + test/regression/tahi_test/tahi_04_002.c | 195 + test/regression/tahi_test/tahi_04_003.c | 499 ++ test/regression/tahi_test/tahi_04_004.c | 555 ++ test/regression/tahi_test/tahi_04_005.c | 4970 +++++++++++ test/regression/tahi_test/tahi_04_006.c | 1087 +++ test/regression/tahi_test/tahi_04_007.c | 2320 +++++ test/regression/tahi_test/tahi_04_008.c | 1666 ++++ test/regression/tahi_test/tahi_04_009.c | 1007 +++ test/regression/tahi_test/tahi_04_010.c | 1007 +++ test/regression/tahi_test/tahi_04_011.c | 1682 ++++ test/regression/tahi_test/tahi_04_012.c | 1683 ++++ test/regression/tahi_test/tahi_04_013.c | 979 ++ test/regression/tahi_test/tahi_04_014.c | 7101 +++++++++++++++ test/regression/tahi_test/tahi_04_015.c | 2007 +++++ test/regression/tahi_test/tahi_04_016.c | 2183 +++++ test/regression/tahi_test/tahi_05_002.c | 418 + test/regression/tahi_test/tahi_05_003.c | 173 + test/regression/tahi_test/tahi_05_004.c | 399 + test/regression/tahi_test/tahi_05_005.c | 375 + test/regression/tahi_test/tahi_05_006.c | 167 + test/regression/tahi_test/tahi_05_007.c | 167 + test/regression/tahi_test/tahi_05_008.c | 351 + test/regression/tahi_test/tahi_05_009.c | 766 ++ test/regression/tahi_test/tahi_05_010.c | 765 ++ test/regression/tahi_test/tahi_05_012.c | 438 + test/regression/tahi_test/tahi_05_013.c | 437 + test/regression/tahi_test/tahi_05_014.c | 417 + test/regression/tahi_test/tahi_05_015.c | 569 ++ test/regression/tahi_test/tahi_05_017.c | 947 ++ test/regression/tahi_test/tahi_05_018.c | 569 ++ test/regression/tahi_test/tahi_05_020.c | 948 ++ test/regression/tahi_test/tahi_05_021.c | 569 ++ test/regression/tahi_test/tahi_05_022.c | 736 ++ test/regression/tahi_test/tahi_05_024.c | 1203 +++ test/regression/tahi_test/tahi_05_025.c | 737 ++ test/regression/tahi_test/tahi_dhcpv6_01_001.c | 28 + test/regression/tahi_test/tahi_dhcpv6_01_002.c | 403 + test/regression/tahi_test/tahi_dhcpv6_01_003.c | 382 + test/regression/tahi_test/tahi_dhcpv6_01_004.c | 489 + test/regression/tahi_test/tahi_dhcpv6_01_005.c | 490 + test/regression/tahi_test/tahi_dhcpv6_01_006.c | 399 + test/regression/tahi_test/tahi_dhcpv6_01_007.c | 319 + test/regression/tahi_test/tahi_dhcpv6_01_008.c | 193 + test/regression/tahi_test/tahi_dhcpv6_01_009.c | 255 + test/regression/tahi_test/tahi_dhcpv6_01_010.c | 281 + test/regression/tahi_test/tahi_dhcpv6_01_011.c | 194 + test/regression/tahi_test/tahi_dhcpv6_01_012.c | 193 + test/regression/tahi_test/tahi_dhcpv6_01_013.c | 193 + test/regression/tahi_test/tahi_dhcpv6_01_014.c | 377 + test/regression/tahi_test/tahi_dhcpv6_01_019.c | 195 + test/regression/tahi_test/tahi_dhcpv6_01_020.c | 216 + test/regression/tahi_test/tahi_dhcpv6_01_021.c | 256 + test/regression/tahi_test/tahi_dhcpv6_01_022.c | 373 + test/regression/tahi_test/tahi_dhcpv6_01_023.c | 194 + test/regression/tahi_test/tahi_dhcpv6_01_024.c | 258 + test/regression/tahi_test/tahi_dhcpv6_01_025.c | 430 + test/regression/tahi_test/tahi_dhcpv6_01_026.c | 366 + test/regression/tahi_test/tahi_dhcpv6_01_027.c | 418 + test/regression/tahi_test/tahi_dhcpv6_01_028.c | 410 + test/regression/tahi_test/tahi_dhcpv6_01_029.c | 320 + test/regression/tahi_test/tahi_dhcpv6_01_030.c | 623 ++ test/regression/tahi_test/tahi_dhcpv6_01_031.c | 189 + test/regression/tahi_test/tahi_dhcpv6_01_032.c | 192 + test/regression/tahi_test/tahi_dhcpv6_01_033.c | 212 + test/regression/tahi_test/tahi_dhcpv6_01_034.c | 292 + test/regression/tahi_test/tahi_dhcpv6_01_035.c | 329 + test/regression/tahi_test/tahi_dhcpv6_01_036.c | 274 + test/regression/tahi_test/tahi_dhcpv6_01_037.c | 253 + test/regression/tahi_test/tahi_dhcpv6_01_038.c | 254 + test/regression/tahi_test/tahi_dhcpv6_01_039.c | 363 + test/regression/tahi_test/tahi_dhcpv6_01_040.c | 473 + test/regression/tahi_test/tahi_dhcpv6_01_041.c | 428 + test/regression/tahi_test/tahi_dhcpv6_01_042.c | 429 + test/regression/tahi_test/tahi_dhcpv6_01_043.c | 454 + test/regression/tahi_test/tahi_dhcpv6_01_044.c | 522 ++ test/regression/tahi_test/tahi_dhcpv6_01_045.c | 555 ++ test/regression/tahi_test/tahi_dhcpv6_01_046.c | 365 + test/regression/tahi_test/tahi_dhcpv6_01_047.c | 391 + test/regression/tahi_test/tahi_dhcpv6_01_048.c | 555 ++ test/regression/tahi_test/tahi_dhcpv6_01_049.c | 441 + test/regression/tahi_test/tahi_dhcpv6_01_050.c | 615 ++ test/regression/tahi_test/tahi_dhcpv6_01_051.c | 442 + test/regression/tahi_test/tahi_dhcpv6_01_052.c | 508 ++ test/regression/tahi_test/tahi_dhcpv6_01_053.c | 517 ++ test/regression/tahi_test/tahi_dhcpv6_01_054.c | 482 + test/regression/tahi_test/tahi_dhcpv6_01_055.c | 530 ++ test/regression/tahi_test/tahi_dhcpv6_01_056.c | 331 + test/regression/tahi_test/tahi_dhcpv6_01_057.c | 461 + test/regression/tahi_test/tahi_dhcpv6_01_058.c | 407 + test/regression/tahi_test/tahi_dhcpv6_01_059.c | 525 ++ test/regression/tahi_test/tahi_dhcpv6_01_060.c | 296 + test/regression/tahi_test/tahi_dhcpv6_01_061.c | 350 + test/regression/tahi_test/tahi_dhcpv6_01_062.c | 360 + test/regression/tahi_test/tahi_dhcpv6_01_063.c | 367 + test/regression/tahi_test/tahi_dhcpv6_01_064.c | 392 + test/regression/tahi_test/tahi_dhcpv6_01_065.c | 144 + test/regression/tahi_test/tahi_dhcpv6_01_066.c | 362 + test/regression/tahi_test/tahi_dhcpv6_01_067.c | 497 ++ test/regression/tahi_test/tahi_dhcpv6_01_068.c | 709 ++ test/regression/tahi_test/tahi_dhcpv6_01_069.c | 528 ++ test/regression/tahi_test/tahi_dhcpv6_01_070.c | 452 + test/regression/tahi_test/tahi_dhcpv6_01_071.c | 313 + test/regression/tahi_test/tahi_dhcpv6_01_072.c | 324 + test/regression/tahi_test/tahi_dhcpv6_01_073.c | 324 + test/regression/tahi_test/tahi_dhcpv6_01_074.c | 439 + test/regression/tahi_test/tahi_dhcpv6_01_075.c | 536 ++ test/regression/tahi_test/tahi_dhcpv6_01_076.c | 479 + test/regression/tahi_test/tahi_dhcpv6_01_077.c | 478 + test/regression/tahi_test/tahi_dhcpv6_01_078.c | 395 + test/regression/tahi_test/tahi_dhcpv6_01_079.c | 386 + test/regression/tahi_test/tahi_dhcpv6_01_080.c | 331 + test/regression/tahi_test/tahi_dhcpv6_01_081.c | 323 + test/regression/tahi_test/tahi_dhcpv6_01_082.c | 189 + test/regression/tahi_test/tahi_dhcpv6_01_083.c | 250 + test/regression/tahi_test/tahi_dhcpv6_01_084.c | 1555 ++++ test/regression/tahi_test/tahi_dhcpv6_01_085.c | 235 + test/regression/tahi_test/tahi_dhcpv6_01_086.c | 325 + test/regression/tahi_test/tahi_dhcpv6_01_087.c | 271 + test/regression/tahi_test/tahi_dhcpv6_01_088.c | 347 + test/regression/tahi_test/tahi_dhcpv6_01_089.c | 291 + test/regression/tahi_test/tahi_dhcpv6_01_090.c | 405 + test/regression/tahi_test/tahi_dhcpv6_01_091.c | 215 + test/regression/tahi_test/tahi_dhcpv6_01_092.c | 431 + test/regression/tahi_test/tahi_dhcpv6_01_093.c | 250 + test/regression/tahi_test/tahi_dhcpv6_01_094.c | 313 + test/regression/tahi_test/tahi_dhcpv6_01_095.c | 299 + test/regression/tahi_test/tahi_dhcpv6_01_096.c | 301 + test/regression/tahi_test/tahi_dhcpv6_01_097.c | 310 + test/regression/tahi_test/tahi_dhcpv6_01_098.c | 311 + test/regression/tahi_test/tahi_dhcpv6_01_099.c | 218 + test/regression/tahi_test/tahi_dhcpv6_04_002.c | 150 + test/regression/tahi_test/tahi_dhcpv6_04_003.c | 260 + test/regression/tahi_test/tahi_dhcpv6_04_004.c | 221 + test/regression/tahi_test/tahi_dhcpv6_04_005.c | 191 + test/regression/tahi_test/tahi_dhcpv6_04_006.c | 256 + test/regression/tahi_test/tahi_dhcpv6_04_007.c | 255 + test/regression/tahi_test/tahi_dhcpv6_04_008.c | 370 + test/regression/tahi_test/tahi_dhcpv6_04_009.c | 312 + test/regression/tahi_test/tahi_dhcpv6_04_010.c | 587 ++ test/regression/tahi_test/tahi_dhcpv6_04_012.c | 309 + test/regression/tahi_test/tahi_dhcpv6_04_013.c | 308 + test/regression/tahi_test/tahi_dhcpv6_04_014.c | 361 + test/regression/tahi_test/tahi_dhcpv6_04_015.c | 359 + test/regression/tahi_test/tahi_dhcpv6_04_016.c | 414 + test/regression/tahi_test/tahi_dhcpv6_04_017.c | 330 + test/regression/tahi_test/tahi_dhcpv6_04_018.c | 375 + test/regression/tahi_test/tahi_dhcpv6_04_019.c | 334 + test/regression/tahi_test/tahi_dhcpv6_04_020.c | 330 + test/regression/tahi_test/tahi_dhcpv6_04_021.c | 336 + test/regression/tahi_test/tahi_dhcpv6_04_022.c | 615 ++ test/regression/tahi_test/tahi_dhcpv6_04_026.c | 164 + test/regression/tahi_test/tahi_dhcpv6_04_027.c | 386 + test/regression/tahi_test/tahi_dhcpv6_07_002.c | 555 ++ test/regression/tahi_test/tahi_dhcpv6_07_003.c | 469 + test/regression/tahi_test/tahi_dhcpv6_07_004.c | 455 + test/regression/tahi_test/tahi_dhcpv6_07_005.c | 458 + test/regression/tahi_test/tahi_dhcpv6_07_006.c | 531 ++ test/regression/tahi_test/tahi_dhcpv6_07_007.c | 385 + test/regression/tahi_test/tahi_dhcpv6_07_008.c | 519 ++ test/regression/tahi_test/tahi_dhcpv6_07_009.c | 467 + test/regression/tahi_test/tahi_dhcpv6_07_010.c | 467 + test/regression/tahi_test/tahi_dhcpv6_07_011.c | 468 + test/regression/tahi_test/tahi_dhcpv6_07_012.c | 458 + test/regression/tahi_test/tahi_dhcpv6_07_013.c | 543 ++ test/regression/tahi_test/tahi_dhcpv6_07_014.c | 542 ++ test/regression/tahi_test/tahi_dhcpv6_07_015.c | 422 + test/regression/tahi_test/tahi_dhcpv6_07_016.c | 424 + test/regression/tahi_test/tahi_dhcpv6_07_017.c | 424 + test/regression/tahi_test/tahi_dhcpv6_07_018.c | 424 + test/regression/tahi_test/tahi_dhcpv6_07_019.c | 497 ++ test/regression/tahi_test/tahi_dhcpv6_07_020.c | 424 + test/regression/tahi_test/tahi_dhcpv6_07_021.c | 428 + test/regression/tahi_test/tahi_dhcpv6_07_022.c | 428 + test/regression/tahi_test/tahi_dhcpv6_07_023.c | 421 + test/regression/tahi_test/tahi_dhcpv6_07_024.c | 427 + test/regression/tahi_test/tahi_dhcpv6_07_025.c | 475 + test/regression/tahi_test/tahi_dhcpv6_07_026.c | 462 + test/regression/tahi_test/tahi_dhcpv6_07_027.c | 612 ++ test/regression/tahi_test/tahi_ipsec_001.c | 163 + test/regression/tahi_test/tahi_ipsec_002.c | 147 + test/regression/tahi_test/tahi_ipsec_003.c | 121 + test/regression/tahi_test/tahi_ipsec_004.c | 119 + test/regression/tahi_test/tahi_ipsec_005.c | 1411 +++ test/regression/tahi_test/tahi_ipsec_006.c | 181 + test/regression/tahi_test/tahi_ipsec_007.c | 135 + test/regression/tahi_test/tahi_ipsec_008.c | 110 + test/regression/tahi_test/tahi_ipsec_008_02.c | 46 + test/regression/tahi_test/tahi_ipsec_009.c | 82 + test/regression/tahi_test/tahi_ipsec_009_02.c | 32 + test/regression/tahi_test/tahi_ipsec_010.c | 148 + test/regression/tahi_test/tahi_ipsec_012.c | 102 + test/regression/tahi_test/tahi_ipsec_013.c | 102 + test/regression/tahi_test/tahi_ipsec_014.c | 82 + test/regression/tahi_test/tahi_ipsec_015.c | 82 + test/regression/tahi_test/tahi_ipsec_016.c | 78 + test/regression/tahi_test/tahi_ipsec_017.c | 85 + test/regression/tahi_test/tahi_ipsec_018.c | 82 + test/regression/tahi_test/tahi_ipsec_019.c | 79 + test/regression/tahi_test/tahi_ipsec_022.c | 92 + test/regression/tahi_test/tahi_ipsec_023.c | 92 + test/regression/tahi_test/tahi_ipsec_024.c | 139 + test/regression/tahi_test/tahi_ipsec_025.c | 169 + test/regression/tahi_test/tahi_ipsec_026.c | 93 + test/regression/tahi_test/tahi_ipsec_udp_001.c | 165 + test/regression/tahi_test/tahi_ipsec_udp_002.c | 147 + test/regression/tahi_test/tahi_ipsec_udp_004.c | 119 + test/regression/tahi_test/tahi_ipsec_udp_005.c | 1279 +++ test/regression/tahi_test/tahi_ipsec_udp_006.c | 180 + test/regression/tahi_test/tahi_ipsec_udp_007.c | 135 + test/regression/tahi_test/tahi_ipsec_udp_008.c | 139 + test/regression/tahi_test/tahi_ipsec_udp_009.c | 82 + test/regression/tahi_test/tahi_ipsec_udp_009_02.c | 32 + test/regression/tahi_test/tahi_ipsec_udp_010.c | 148 + test/regression/tahi_test/tahi_ipsec_udp_011.c | 83 + test/regression/tahi_test/tahi_ipsec_udp_012.c | 101 + test/regression/tahi_test/tahi_ipsec_udp_013.c | 236 + test/regression/tahi_test/tahi_ipsec_udp_014.c | 82 + test/regression/tahi_test/tahi_ipsec_udp_015.c | 82 + test/regression/tahi_test/tahi_ipsec_udp_016.c | 78 + test/regression/tahi_test/tahi_ipsec_udp_017.c | 85 + test/regression/tahi_test/tahi_ipsec_udp_018.c | 82 + test/regression/tahi_test/tahi_ipsec_udp_019.c | 79 + test/regression/tahi_test/tahi_ipsec_udp_022.c | 92 + test/regression/tahi_test/tahi_ipsec_udp_023.c | 92 + test/regression/tahi_test/tahi_ipsec_udp_024.c | 139 + test/regression/tahi_test/tahi_ipsec_udp_025.c | 168 + test/regression/tahi_test/tahi_ipsec_udp_026.c | 92 + .../netx_telnet_activity_timeout_test.c | 567 ++ .../telnet_test/netx_telnet_basic_test.c | 474 + .../netx_telnet_create_packet_pool_test.c | 387 + .../telnet_test/netx_telnet_max_connections_test.c | 662 ++ test/regression/telnet_test/netx_telnet_rst_test.c | 317 + .../netx_telnet_server_bad_option_reply_test.c | 472 + .../netx_telnet_server_options_negotiate_test.c | 480 + .../telnet_test/netx_telnet_two_listen_test.c | 299 + test/regression/test/netxtestcontrol.c | 3418 +++++++ test/regression/test/netxtestcontrol.h | 8 + .../test/nx_ram_network_driver_test_1500.c | 2879 ++++++ .../test/nx_ram_network_driver_test_1500.h | 50 + test/regression/tftp_test/netx_tftp_basic_test.c | 432 + .../netx_tftp_error_destionation_port_test.c | 421 + .../tftp_test/netx_tftp_error_file_name_test.c | 408 + .../tftp_test/netx_tftp_ipv6_basic_test.c | 374 + .../tftp_test/netx_tftp_large_data_test.c | 500 ++ .../tftp_test/netx_tftp_malformed_packet_test.c | 465 + .../tftp_test/netx_tftp_read_interaction_test.c | 563 ++ .../tftp_test/netx_tftp_write_interaction_test.c | 501 ++ test/regression/web_test/ecc_certs.c | 1201 +++ .../web_test/http_digest_authentication.c | 179 + test/regression/web_test/netx_https_api_test.c | 2149 +++++ test/regression/web_test/netx_https_testcontrol.c | 551 ++ test/regression/web_test/netx_web_abnormal_test.c | 541 ++ .../netx_web_basic_authenticate_empty_test.c | 502 ++ .../web_test/netx_web_basic_authenticate_test.c | 504 ++ test/regression/web_test/netx_web_basic_ecc_test.c | 392 + test/regression/web_test/netx_web_basic_test.c | 650 ++ .../web_test/netx_web_certifiacte_verify_test.c | 387 + .../netx_web_chunked_request_additional_test.c | 738 ++ .../web_test/netx_web_chunked_request_test.c | 709 ++ .../netx_web_chunked_response_packet_chain_test.c | 533 ++ .../netx_web_chunked_response_process_test.c | 643 ++ .../web_test/netx_web_chunked_response_test.c | 588 ++ .../web_test/netx_web_client_cleanup_test.c | 525 ++ .../netx_web_client_receive_no_packet_test.c | 435 + .../regression/web_test/netx_web_client_rst_test.c | 323 + .../web_test/netx_web_client_send_fail_test.c | 442 + .../web_test/netx_web_concurrent_sessions_test.c | 643 ++ .../web_test/netx_web_connect_three_times_test.c | 456 + .../web_test/netx_web_delete_basic_test.c | 525 ++ .../web_test/netx_web_digest_authenticate_test.c | 733 ++ .../web_test/netx_web_digest_authenticate_test2.c | 499 ++ .../netx_web_digest_authenticate_timeout_test.c | 573 ++ .../web_test/netx_web_external_client_test.c | 350 + .../netx_web_external_server_chunked_test.c | 197 + .../web_test/netx_web_external_server_test.c | 262 + .../web_test/netx_web_get_content_length_test.c | 622 ++ .../web_test/netx_web_get_put_referred_URI_test.c | 527 ++ .../regression/web_test/netx_web_head_basic_test.c | 459 + .../regression/web_test/netx_web_host_field_test.c | 510 ++ test/regression/web_test/netx_web_http_demo_test.c | 221 + .../regression/web_test/netx_web_https_demo_test.c | 441 + .../web_test/netx_web_if_modified_since_test.c | 558 ++ .../web_test/netx_web_invalid_release_test.c | 504 ++ .../web_test/netx_web_keep_alive_abnormal_test.c | 495 ++ .../regression/web_test/netx_web_keep_alive_test.c | 526 ++ .../web_test/netx_web_multipart_fragment_test.c | 820 ++ .../web_test/netx_web_multipart_underflow_test.c | 832 ++ .../web_test/netx_web_multiple_sessions_test.c | 549 ++ .../netx_web_multiple_sessions_timeout_test.c | 485 + .../web_test/netx_web_non_block_basic_test.c | 516 ++ .../web_test/netx_web_non_block_reconnect_test.c | 537 ++ .../web_test/netx_web_one_session_test.c | 360 + .../web_test/netx_web_packet_allocate_test.c | 580 ++ .../regression/web_test/netx_web_post_basic_test.c | 484 + .../web_test/netx_web_post_long_message_test.c | 401 + test/regression/web_test/netx_web_put_basic_test.c | 513 ++ .../netx_web_request_in_multiple_packets_test.c | 527 ++ .../netx_web_response_in_multiple_packets_test.c | 565 ++ .../web_test/netx_web_secure_connect_fail_test.c | 381 + .../web_test/netx_web_secure_reconnect_test.c | 374 + .../netx_web_server_chunked_content_process_test.c | 657 ++ .../netx_web_server_content_process_test.c | 659 ++ .../netx_web_server_type_get_extended_test.c | 208 + .../regression/web_test/netx_web_status_400_test.c | 499 ++ .../regression/web_test/netx_web_status_404_test.c | 498 ++ .../regression/web_test/netx_web_status_501_test.c | 494 ++ .../web_test/netx_web_status_code_test.c | 397 + .../web_test/netx_web_tcpserver_rst_test.c | 243 + .../netx_web_tcpserver_tls_fail_rst_test.c | 283 + .../web_test/netx_web_tcpserver_two_listen_test.c | 275 + test/regression/web_test/test_ca_cert.c | 84 + test/regression/web_test/test_device_cert.c | 190 + test/regression/web_test/test_utility.h | 53 + .../netx_websocket_16_bit_payload_length_test.c | 626 ++ .../websocket_test/netx_websocket_common_process.c | 155 + .../websocket_test/netx_websocket_connect_test.c | 570 ++ .../websocket_test/netx_websocket_delete_test.c | 395 + .../netx_websocket_disconnect_test.c | 430 + .../websocket_test/netx_websocket_fin_test.c | 466 + .../websocket_test/netx_websocket_mask_test.c | 461 + .../netx_websocket_multi_instance_test.c | 621 ++ .../websocket_test/netx_websocket_non_block_test.c | 622 ++ .../netx_websocket_one_frame_in_packets_test.c | 447 + ...x_websocket_one_packet_with_multi_frames_test.c | 893 ++ .../websocket_test/netx_websocket_opcode_test.c | 460 + .../netx_websocket_send_chain_packets_test.c | 442 + utility/iperf/nx_iperf.c | 1977 +++++ utility/iperf/nx_iperf.h | 1981 +---- 1999 files changed, 742489 insertions(+), 1998 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/regression_test.yml create mode 100755 scripts/build_nxd.sh create mode 100755 scripts/install.sh create mode 100755 scripts/test_nxd.sh create mode 100644 test/cmake/.gitignore create mode 100644 test/cmake/libs/CMakeLists.txt create mode 100644 test/cmake/libs/tx_user.h create mode 100644 test/cmake/netxduo/CMakeLists.txt create mode 100644 test/cmake/netxduo/additionals.cmake create mode 100755 test/cmake/netxduo/coverage.sh create mode 120000 test/cmake/netxduo/libs create mode 100644 test/cmake/netxduo/regression/CMakeLists.txt create mode 100755 test/cmake/netxduo/run.sh create mode 100644 test/cmake/netxduo/samples/CMakeLists.txt create mode 100644 test/regression/auto_ip_test/netx_auto_ip_address_check_test.c create mode 100644 test/regression/auto_ip_test/netx_auto_ip_announce_num_test.c create mode 100644 test/regression/auto_ip_test/netx_auto_ip_arp_dest_addr_test.c create mode 100644 test/regression/auto_ip_test/netx_auto_ip_basic_test.c create mode 100644 test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c create mode 100644 test/regression/auto_ip_test/netx_auto_ip_max_conflicts_test.c create mode 100644 test/regression/bsd_test/bsd_test_setup.docx create mode 100644 test/regression/bsd_test/netx_bsd_aton_test.c create mode 100644 test/regression/bsd_test/netx_bsd_getaddrinfo_test.c create mode 100644 test/regression/bsd_test/netx_bsd_inet_addr_pton_test.c create mode 100644 test/regression/bsd_test/netx_bsd_ioctl_nonblocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_multicast_test.c create mode 100644 test/regression/bsd_test/netx_bsd_ntoa_test.c create mode 100644 test/regression/bsd_test/netx_bsd_ntop_test.c create mode 100644 test/regression/bsd_test/netx_bsd_pton_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_basic_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_basic_nonblocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_nonblocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_bind_connect_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_ping_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_pppoe_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_rx_nohdr_basic_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_raw_tx_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_2nd_bind_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_accept_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_accept_blocking_timeout_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_timeout_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_accept_noselect_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_basic_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_basic_nonblocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_bind_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_blocking_bidirection_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_clients_share_port_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_clients_shared_port_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_disconnect_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_fionread_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_getsockname_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_multiple_accept_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_sendto_recvfrom_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_servers_shared_port_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_two_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_tcp_udp_select_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_basic_blocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_basic_nonblocking_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_bind_connect_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_bind_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_blocking_bidirection_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_checksum_corrupt_test.c create mode 100644 test/regression/bsd_test/netx_bsd_udp_connect_test.c create mode 100644 test/regression/cloud_test/netx_cloud_api_test.c create mode 100644 test/regression/cloud_test/netx_cloud_basic_test.c create mode 100644 test/regression/cloud_test/netx_cloud_module_event_test.c create mode 100644 test/regression/cloud_test/netx_cloud_module_register_deregister_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_01_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_01_02_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_01_03_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_02_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_02_02_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_02_03_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_04_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_03_05_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_01_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_03_02_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_03_02_02_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_03_02_03_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_03_05_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_04_01_01_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_04_04_01_02_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_basic_restore_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_basic_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_activate_interfaces_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_decline_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_interface_order_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_ip_mutex_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_ntp_option_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_nxe_api_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_parameter_request_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_secondary_interface_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_send_with_zero_source_address_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_server_source_port_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c create mode 100644 test/regression/dhcp_test/netx_dhcp_clone_function.c create mode 100644 test/regression/dhcp_test/netx_dhcp_clone_function.h create mode 100644 test/regression/dhcp_test/netx_dhcp_coverage_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_delete_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_enable_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_extract_information_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_get_option_value_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_multiple_instances_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_packet_process_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_reinitialize_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_release_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_send_request_internal_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_server_improper_term_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_server_options_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_server_second_interface_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_server_small_packet_payload_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_server_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_skip_discover_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_start_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_stop_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_unicast_test.c create mode 100644 test/regression/dhcp_test/netx_dhcp_user_option_add_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_basic_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_client_process_server_duid_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_extended_api_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_packet_loss_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_server_ia_options_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_server_iana_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_server_process_repeated_msgs_test.c create mode 100644 test/regression/dhcp_test/netx_dhcpv6_user_option_add_test.c create mode 100644 test/regression/dns_test/netx_dns_abnormal_packet_test.c create mode 100644 test/regression/dns_test/netx_dns_coverage_test.c create mode 100644 test/regression/dns_test/netx_dns_fake_response_test.c create mode 100644 test/regression/dns_test/netx_dns_function_test.c create mode 100644 test/regression/dns_test/netx_dns_invalid_name_unencode_test.c create mode 100644 test/regression/dns_test/netx_dns_invalid_resource_get_test.c create mode 100644 test/regression/dns_test/netx_dns_non_blocking_a_test.c create mode 100644 test/regression/dns_test/netx_dns_nxe_api_test.c create mode 100644 test/regression/dns_test/netx_dns_packet_double_release_test.c create mode 100644 test/regression/dns_test/netx_dns_request_a_response_cname_a_smtp_live_com_test.c create mode 100644 test/regression/dns_test/netx_dns_source_port_test.c create mode 100644 test/regression/dns_test/response_a_berkley_edu.c create mode 100644 test/regression/dns_test/response_a_cname_www_npr_org.c create mode 100644 test/regression/dns_test/response_a_google_com.c create mode 100644 test/regression/dns_test/response_aaaa_berkley_edu.c create mode 100644 test/regression/dns_test/response_cname_mail_baidu_com.c create mode 100644 test/regression/dns_test/response_mx_a_berkley_edu.c create mode 100644 test/regression/dns_test/response_mx_a_google_com.c create mode 100644 test/regression/dns_test/response_mx_google_com.c create mode 100644 test/regression/dns_test/response_ns_a_ti_com.c create mode 100644 test/regression/dns_test/response_soa_google_com.c create mode 100644 test/regression/dns_test/response_srv_google_com.c create mode 100644 test/regression/dns_test/response_txt_google_com.c create mode 100644 test/regression/dns_test/response_with_invalid_resource.c create mode 100644 test/regression/ftp_test/netx_ftp_access_control_commands_01_test.c create mode 100644 test/regression/ftp_test/netx_ftp_access_control_commands_02_test.c create mode 100644 test/regression/ftp_test/netx_ftp_access_control_commands_03_test.c create mode 100644 test/regression/ftp_test/netx_ftp_access_control_commands_04_test.c create mode 100644 test/regression/ftp_test/netx_ftp_basic_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_buffer_overflow_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_file_write_fail_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_invalid_username_password_length_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_multiple_connection_responses_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_packet_leak_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_pasv_denied.c create mode 100644 test/regression/ftp_test/netx_ftp_client_pasv_file_read_test.c create mode 100644 test/regression/ftp_test/netx_ftp_client_pasv_file_write_test.c create mode 100644 test/regression/ftp_test/netx_ftp_commands_characters_test.c create mode 100644 test/regression/ftp_test/netx_ftp_commands_replys_test.c create mode 100644 test/regression/ftp_test/netx_ftp_control_connection_test.c create mode 100644 test/regression/ftp_test/netx_ftp_data_connection_test.c create mode 100644 test/regression/ftp_test/netx_ftp_disconnection_event_test.c create mode 100644 test/regression/ftp_test/netx_ftp_establish_data_connection_03_test.c create mode 100644 test/regression/ftp_test/netx_ftp_establish_data_connection_05_test.c create mode 100644 test/regression/ftp_test/netx_ftp_establish_data_connection_06_test.c create mode 100644 test/regression/ftp_test/netx_ftp_establish_data_connection_08_test.c create mode 100644 test/regression/ftp_test/netx_ftp_ipv6_epsv_test.c create mode 100644 test/regression/ftp_test/netx_ftp_parse_ipv6_address_test.c create mode 100644 test/regression/ftp_test/netx_ftp_pasv_port_test.c create mode 100644 test/regression/ftp_test/netx_ftp_pasv_stor_test.c create mode 100644 test/regression/ftp_test/netx_ftp_pasv_twice_test.c create mode 100644 test/regression/ftp_test/netx_ftp_rst_test.c create mode 100644 test/regression/ftp_test/netx_ftp_server_abnormal_packet_test.c create mode 100644 test/regression/ftp_test/netx_ftp_server_dangling_pointer_test.c create mode 100644 test/regression/ftp_test/netx_ftp_server_invalid_month_crash_test.c create mode 100644 test/regression/ftp_test/netx_ftp_server_list_command_test.c create mode 100644 test/regression/ftp_test/netx_ftp_server_mss_too_small_test.c create mode 100644 test/regression/ftp_test/netx_ftp_service_commands_RETR_STOR_test.c create mode 100644 test/regression/ftp_test/netx_ftp_service_commands_dele_test.c create mode 100644 test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c create mode 100644 test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c create mode 100644 test/regression/ftp_test/netx_ftp_service_commands_nlist_test.c create mode 100644 test/regression/ftp_test/netx_ftp_service_commands_rename_test.c create mode 100644 test/regression/ftp_test/netx_ftp_two_listen_test.c create mode 100644 test/regression/ftp_test/netx_ftp_user_data_type_test.c create mode 100644 test/regression/http_test/netx_http_basic_authenticate_test.c create mode 100644 test/regression/http_test/netx_http_basic_test.c create mode 100644 test/regression/http_test/netx_http_client_change_connect_port_test.c create mode 100644 test/regression/http_test/netx_http_delete_basic_test.c create mode 100644 test/regression/http_test/netx_http_digest_authenticate_test.c create mode 100644 test/regression/http_test/netx_http_digest_authenticate_timeout_test.c create mode 100644 test/regression/http_test/netx_http_get_content_length_test.c create mode 100644 test/regression/http_test/netx_http_get_contentlength_packetleak_test.c create mode 100644 test/regression/http_test/netx_http_get_put_referred_URI_test.c create mode 100644 test/regression/http_test/netx_http_head_basic_test.c create mode 100644 test/regression/http_test/netx_http_if_modified_since_test.c create mode 100644 test/regression/http_test/netx_http_multipart_fragment_test.c create mode 100644 test/regression/http_test/netx_http_multipart_underflow_test.c create mode 100644 test/regression/http_test/netx_http_post_basic_test.c create mode 100644 test/regression/http_test/netx_http_request_in_multiple_packets_test.c create mode 100644 test/regression/http_test/netx_http_server_type_retrieve_test.c create mode 100644 test/regression/http_test/netx_http_status_400_test.c create mode 100644 test/regression/http_test/netx_http_status_404_test.c create mode 100644 test/regression/http_test/netx_http_status_501_test.c create mode 100644 test/regression/mdns_test/capture/_http._tcp.c create mode 100644 test/regression/mdns_test/capture/_http._tcp.pcapng create mode 100644 test/regression/mdns_test/capture/_pdl-datastream._tcp.c create mode 100644 test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng create mode 100644 test/regression/mdns_test/capture/_printer._tcp.c create mode 100644 test/regression/mdns_test/capture/_printer._tcp.pcapng create mode 100644 test/regression/mdns_test/capture/_smb._tcp.c create mode 100644 test/regression/mdns_test/capture/_smb._tcp.pcapng create mode 100644 test/regression/mdns_test/capture/address_change.c create mode 100644 test/regression/mdns_test/capture/address_change.pcapng create mode 100644 test/regression/mdns_test/capture/announcement_in_multiple_packets.c create mode 100644 test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng create mode 100644 test/regression/mdns_test/capture/case_insensitivity.c create mode 100644 test/regression/mdns_test/capture/case_insensitivity.pcapng create mode 100644 test/regression/mdns_test/capture/client_passive.c create mode 100644 test/regression/mdns_test/capture/client_passive.pcapng create mode 100644 test/regression/mdns_test/capture/command.txt create mode 100644 test/regression/mdns_test/capture/continuous_query.c create mode 100644 test/regression/mdns_test/capture/continuous_query.pcapng create mode 100644 test/regression/mdns_test/capture/continuous_query_a.c create mode 100644 test/regression/mdns_test/capture/continuous_query_a.pcapng create mode 100644 test/regression/mdns_test/capture/continuous_query_unique_answer.c create mode 100644 test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng create mode 100644 test/regression/mdns_test/capture/dns_sd_query.c create mode 100644 test/regression/mdns_test/capture/dns_sd_query.pcapng create mode 100644 test/regression/mdns_test/capture/duplicate_question_suppression.c create mode 100644 test/regression/mdns_test/capture/error_response.pcapng create mode 100644 test/regression/mdns_test/capture/ipv6_query.c create mode 100644 test/regression/mdns_test/capture/ipv6_query.pcapng create mode 100644 test/regression/mdns_test/capture/known_answer_suppression.c create mode 100644 test/regression/mdns_test/capture/known_answer_suppression.pcapng create mode 100644 test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c create mode 100644 test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng create mode 100644 test/regression/mdns_test/capture/known_answer_suppression_response.c create mode 100644 test/regression/mdns_test/capture/known_answer_suppression_response.pcapng create mode 100644 test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c create mode 100644 test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng create mode 100644 test/regression/mdns_test/capture/multiple_questions_per_query.c create mode 100644 test/regression/mdns_test/capture/multiple_questions_per_query.pcapng create mode 100644 test/regression/mdns_test/capture/one_shot_query.c create mode 100644 test/regression/mdns_test/capture/one_shot_query.pcapng create mode 100644 test/regression/mdns_test/capture/probing_conflict.c create mode 100644 test/regression/mdns_test/capture/probing_conflict.pcapng create mode 100644 test/regression/mdns_test/capture/probing_conflict_any_type.c create mode 100644 test/regression/mdns_test/capture/probing_conflict_any_type.pcapng create mode 100644 test/regression/mdns_test/capture/query_and_response_chaos.c create mode 100644 test/regression/mdns_test/capture/query_and_response_chaos.pcapng create mode 100644 test/regression/mdns_test/capture/query_and_response_v6.c create mode 100644 test/regression/mdns_test/capture/query_and_response_v6.pcapng create mode 100644 test/regression/mdns_test/capture/query_during_probing_1.c create mode 100644 test/regression/mdns_test/capture/query_during_probing_1.pcapng create mode 100644 test/regression/mdns_test/capture/query_during_probing_2.c create mode 100644 test/regression/mdns_test/capture/query_during_probing_2.pcapng create mode 100644 test/regression/mdns_test/capture/query_rr_a.c create mode 100644 test/regression/mdns_test/capture/query_rr_a.pcapng create mode 100644 test/regression/mdns_test/capture/query_rr_timeout.c create mode 100644 test/regression/mdns_test/capture/query_rr_timeout.pcapng create mode 100644 test/regression/mdns_test/capture/query_start_stop.c create mode 100644 test/regression/mdns_test/capture/query_start_stop.pcapng create mode 100644 test/regression/mdns_test/capture/query_with_tc.c create mode 100644 test/regression/mdns_test/capture/query_with_tc.pcapng create mode 100644 test/regression/mdns_test/capture/responder_cooperating.c create mode 100644 test/regression/mdns_test/capture/responder_cooperating.pcapng create mode 100644 test/regression/mdns_test/capture/responder_cooperating_2.c create mode 100644 test/regression/mdns_test/capture/responder_cooperating_2.pcapng create mode 100644 test/regression/mdns_test/capture/response_a.c create mode 100644 test/regression/mdns_test/capture/response_a.pcapng create mode 100644 test/regression/mdns_test/capture/response_aggregation.c create mode 100644 test/regression/mdns_test/capture/response_aggregation.pcapng create mode 100644 test/regression/mdns_test/capture/response_in_multiple_packets.c create mode 100644 test/regression/mdns_test/capture/response_in_multiple_packets.pcapng create mode 100644 test/regression/mdns_test/capture/response_interval.c create mode 100644 test/regression/mdns_test/capture/response_interval.pcapng create mode 100644 test/regression/mdns_test/capture/response_interval_2.c create mode 100644 test/regression/mdns_test/capture/response_interval_2.pcapng create mode 100644 test/regression/mdns_test/capture/response_no_delay.c create mode 100644 test/regression/mdns_test/capture/response_no_delay.pcapng create mode 100644 test/regression/mdns_test/capture/response_to_address_query.c create mode 100644 test/regression/mdns_test/capture/response_to_address_query.pcapng create mode 100644 test/regression/mdns_test/capture/response_with_tc.c create mode 100644 test/regression/mdns_test/capture/response_with_tc.pcapng create mode 100644 test/regression/mdns_test/capture/rr_timeout.c create mode 100644 test/regression/mdns_test/capture/rr_timeout.pcapng create mode 100644 test/regression/mdns_test/capture/send_goodbye.c create mode 100644 test/regression/mdns_test/capture/send_goodbye.pcapng create mode 100644 test/regression/mdns_test/capture/server_announcement.c create mode 100644 test/regression/mdns_test/capture/server_announcement.pcapng create mode 100644 test/regression/mdns_test/capture/server_announcement_v6.c create mode 100644 test/regression/mdns_test/capture/server_announcement_v6.pcapng create mode 100644 test/regression/mdns_test/capture/server_announcement_with_txt.c create mode 100644 test/regression/mdns_test/capture/server_announcement_with_txt.pcapng create mode 100644 test/regression/mdns_test/capture/server_interface_reset.c create mode 100644 test/regression/mdns_test/capture/server_interface_reset.pcapng create mode 100644 test/regression/mdns_test/mdns_address_change_test.c create mode 100644 test/regression/mdns_test/mdns_announcement_in_multiple_packets_test.c create mode 100644 test/regression/mdns_test/mdns_basic_ipv6_announcement_test.c create mode 100644 test/regression/mdns_test/mdns_basic_ipv6_query_test.c create mode 100644 test/regression/mdns_test/mdns_basic_ipv6_response_test.c create mode 100644 test/regression/mdns_test/mdns_case_insensitivity_test.c create mode 100644 test/regression/mdns_test/mdns_client_passive_test.c create mode 100644 test/regression/mdns_test/mdns_continuous_query_interval_test.c create mode 100644 test/regression/mdns_test/mdns_continuous_query_test.c create mode 100644 test/regression/mdns_test/mdns_continuous_query_unique_answer_test.c create mode 100644 test/regression/mdns_test/mdns_dns_sd_query_test.c create mode 100644 test/regression/mdns_test/mdns_dns_sd_response_test.c create mode 100644 test/regression/mdns_test/mdns_duplicate_answer_suppression_test.c create mode 100644 test/regression/mdns_test/mdns_duplicate_question_suppression_test.c create mode 100644 test/regression/mdns_test/mdns_known_answer_ignored_test.c create mode 100644 test/regression/mdns_test/mdns_known_answer_suppression_query_half_ttl_test.c create mode 100644 test/regression/mdns_test/mdns_known_answer_suppression_query_test.c create mode 100644 test/regression/mdns_test/mdns_known_answer_suppression_response_test.c create mode 100644 test/regression/mdns_test/mdns_known_answer_suppression_unique_test.c create mode 100644 test/regression/mdns_test/mdns_multiple_questions_per_query_test.c create mode 100644 test/regression/mdns_test/mdns_poof_test.c create mode 100644 test/regression/mdns_test/mdns_probing_conflict_test.c create mode 100644 test/regression/mdns_test/mdns_query_and_response_chaos_test.c create mode 100644 test/regression/mdns_test/mdns_query_during_probing_test.c create mode 100644 test/regression/mdns_test/mdns_query_http_tcp_test.c create mode 100644 test/regression/mdns_test/mdns_query_pdl_datastram_tcp_test.c create mode 100644 test/regression/mdns_test/mdns_query_printer_tcp_test.c create mode 100644 test/regression/mdns_test/mdns_query_rr_timeout_test.c create mode 100644 test/regression/mdns_test/mdns_query_smb_tcp_test.c create mode 100644 test/regression/mdns_test/mdns_query_start_stop_test.c create mode 100644 test/regression/mdns_test/mdns_query_with_tc_test.c create mode 100644 test/regression/mdns_test/mdns_response_aggregation_test.c create mode 100644 test/regression/mdns_test/mdns_response_in_multiple_packets_test.c create mode 100644 test/regression/mdns_test/mdns_response_interval_test.c create mode 100644 test/regression/mdns_test/mdns_response_no_delay_test.c create mode 100644 test/regression/mdns_test/mdns_response_to_address_query_test.c create mode 100644 test/regression/mdns_test/mdns_response_with_tc_test.c create mode 100644 test/regression/mdns_test/mdns_server_announcement_with_txt_test.c create mode 100644 test/regression/mdns_test/mdns_server_interface_reset.c create mode 100644 test/regression/mdns_test/mdns_server_send_goodbye_test.c create mode 100644 test/regression/mdns_test/mdns_test_setup.docx create mode 100644 test/regression/mdns_test/netx_mdns_announcement_repeat_test.c create mode 100644 test/regression/mdns_test/netx_mdns_bad_packet_test.c create mode 100644 test/regression/mdns_test/netx_mdns_buffer_size_test.c create mode 100644 test/regression/mdns_test/netx_mdns_create_delete_test.c create mode 100644 test/regression/mdns_test/netx_mdns_domain_name_test.c create mode 100644 test/regression/mdns_test/netx_mdns_interface_test.c create mode 100644 test/regression/mdns_test/netx_mdns_internal_function_test.c create mode 100644 test/regression/mdns_test/netx_mdns_ipv6_string_test.c create mode 100644 test/regression/mdns_test/netx_mdns_local_cache_continuous_query_test.c create mode 100644 test/regression/mdns_test/netx_mdns_local_cache_one_shot_query_test.c create mode 100644 test/regression/mdns_test/netx_mdns_multiple_answers_test.c create mode 100644 test/regression/mdns_test/netx_mdns_name_test.c create mode 100644 test/regression/mdns_test/netx_mdns_one_shot_query_test.c create mode 100644 test/regression/mdns_test/netx_mdns_peer_service_change_notify_test.c create mode 100644 test/regression/mdns_test/netx_mdns_ram_test.c create mode 100644 test/regression/mdns_test/netx_mdns_read_overflow_test.c create mode 100644 test/regression/mdns_test/netx_mdns_responder_cooperating_test.c create mode 100644 test/regression/mdns_test/netx_mdns_response_with_question_test.c create mode 100644 test/regression/mdns_test/netx_mdns_run_test_case.c create mode 100644 test/regression/mdns_test/netx_mdns_second_interface_test.c create mode 100644 test/regression/mdns_test/netx_mdns_service_add_delete_test.c create mode 100644 test/regression/mdns_test/netx_mdns_service_lookup_test.c create mode 100644 test/regression/mdns_test/netx_mdns_source_address_test.c create mode 100644 test/regression/mdns_test/netx_mdns_source_port_test.c create mode 100644 test/regression/mdns_test/netx_mdns_test.h create mode 100644 test/regression/mdns_test/netx_mdns_ttl_test.c create mode 100644 test/regression/mdns_test/netx_mdns_two_buffer_test.c create mode 100644 test/regression/mdns_test/netx_mdns_txt_notation_test.c create mode 100644 test/regression/mdns_test/netx_mdns_txt_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_api_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_branch_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connack_error_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_auth_empty_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_auth_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_non_block_2_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_non_block_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_packet_send_failure_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_v6_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_will_message_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_will_topic_only_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_connect_with_auth_will_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_keepalive_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_keepalive_timeout_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_multiple_receive_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_not_connected_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_null_password_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_packet_leak_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_publish_non_zero_packet_id_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_publish_packet_chain_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_publish_qos0_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_publish_qos1_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_publish_qos2_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_receive_qos0_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_receive_qos1_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_receive_qos2_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_receive_span_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_remaining_length_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_subscribe_non_zero_packet_id_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_subscribe_packet_chain_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_subscribe_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_testcontrol.c create mode 100644 test/regression/mqtt_test/netx_mqtt_transmit_queue_depth_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_unsubscribe_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_websocket_block_test.c create mode 100644 test/regression/mqtt_test/netx_mqtt_websocket_non_block_test.c create mode 100644 test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c create mode 100644 test/regression/nat_test/netx_nat_icmp_test.c create mode 100644 test/regression/nat_test/netx_nat_invalid_header_test.c create mode 100644 test/regression/nat_test/netx_nat_tcp_fragment_test.c create mode 100644 test/regression/nat_test/netx_nat_tcp_port_test.c create mode 100644 test/regression/nat_test/netx_nat_tcp_port_test2.c create mode 100644 test/regression/nat_test/netx_nat_tcp_remove_oldest_udp_entry_test.c create mode 100644 test/regression/nat_test/netx_nat_tcp_test1.c create mode 100644 test/regression/nat_test/netx_nat_tcp_test2.c create mode 100644 test/regression/nat_test/netx_nat_udp_fragment_test.c create mode 100644 test/regression/nat_test/netx_nat_udp_port_test.c create mode 100644 test/regression/nat_test/netx_nat_udp_test.c create mode 100644 test/regression/netxduo_test/netx_101_17_test.c create mode 100644 test/regression/netxduo_test/netx_101_18_test.c create mode 100644 test/regression/netxduo_test/netx_102_18_test.c create mode 100644 test/regression/netxduo_test/netx_102_19_test.c create mode 100644 test/regression/netxduo_test/netx_102_20_test.c create mode 100644 test/regression/netxduo_test/netx_102_21_test.c create mode 100644 test/regression/netxduo_test/netx_102_22_test.c create mode 100644 test/regression/netxduo_test/netx_102_23_test.c create mode 100644 test/regression/netxduo_test/netx_102_24_test.c create mode 100644 test/regression/netxduo_test/netx_102_25_test.c create mode 100644 test/regression/netxduo_test/netx_103_17_test.c create mode 100644 test/regression/netxduo_test/netx_104_17_test.c create mode 100644 test/regression/netxduo_test/netx_106_17_test.c create mode 100644 test/regression/netxduo_test/netx_10_23_01_test.c create mode 100644 test/regression/netxduo_test/netx_10_23_02_test.c create mode 100644 test/regression/netxduo_test/netx_10_24_01_test.c create mode 100644 test/regression/netxduo_test/netx_10_24_02_test.c create mode 100644 test/regression/netxduo_test/netx_10_24_03_test.c create mode 100644 test/regression/netxduo_test/netx_10_25_test.c create mode 100644 test/regression/netxduo_test/netx_10_26_test.c create mode 100644 test/regression/netxduo_test/netx_11_18_test.c create mode 100644 test/regression/netxduo_test/netx_11_19_test.c create mode 100644 test/regression/netxduo_test/netx_11_23_test.c create mode 100644 test/regression/netxduo_test/netx_11_24_test.c create mode 100644 test/regression/netxduo_test/netx_11_25_test.c create mode 100644 test/regression/netxduo_test/netx_11_26_test.c create mode 100644 test/regression/netxduo_test/netx_11_27_test.c create mode 100644 test/regression/netxduo_test/netx_11_28_test.c create mode 100644 test/regression/netxduo_test/netx_11_29_test.c create mode 100644 test/regression/netxduo_test/netx_12_01_test.c create mode 100644 test/regression/netxduo_test/netx_12_02_test.c create mode 100644 test/regression/netxduo_test/netx_12_03_test.c create mode 100644 test/regression/netxduo_test/netx_12_04_test.c create mode 100644 test/regression/netxduo_test/netx_12_17_test.c create mode 100644 test/regression/netxduo_test/netx_12_18_test.c create mode 100644 test/regression/netxduo_test/netx_12_19_test.c create mode 100644 test/regression/netxduo_test/netx_12_20_test.c create mode 100644 test/regression/netxduo_test/netx_12_21_test.c create mode 100644 test/regression/netxduo_test/netx_12_23_test.c create mode 100644 test/regression/netxduo_test/netx_12_24_test.c create mode 100644 test/regression/netxduo_test/netx_12_25_test.c create mode 100644 test/regression/netxduo_test/netx_12_26_test.c create mode 100644 test/regression/netxduo_test/netx_12_27_test.c create mode 100644 test/regression/netxduo_test/netx_12_30_test.c create mode 100644 test/regression/netxduo_test/netx_12_31_test.c create mode 100644 test/regression/netxduo_test/netx_13_01_test.c create mode 100644 test/regression/netxduo_test/netx_13_02_test.c create mode 100644 test/regression/netxduo_test/netx_13_04_test.c create mode 100644 test/regression/netxduo_test/netx_13_05_test.c create mode 100644 test/regression/netxduo_test/netx_13_17_test.c create mode 100644 test/regression/netxduo_test/netx_14_19_test.c create mode 100644 test/regression/netxduo_test/netx_14_20_test.c create mode 100644 test/regression/netxduo_test/netx_15_03_test.c create mode 100644 test/regression/netxduo_test/netx_15_20_test.c create mode 100644 test/regression/netxduo_test/netx_15_21_test.c create mode 100644 test/regression/netxduo_test/netx_15_24_test.c create mode 100644 test/regression/netxduo_test/netx_15_25_test.c create mode 100644 test/regression/netxduo_test/netx_15_26_test.c create mode 100644 test/regression/netxduo_test/netx_16_02_test.c create mode 100644 test/regression/netxduo_test/netx_16_17_test.c create mode 100644 test/regression/netxduo_test/netx_16_19_test.c create mode 100644 test/regression/netxduo_test/netx_16_21_test.c create mode 100644 test/regression/netxduo_test/netx_16_22_test.c create mode 100644 test/regression/netxduo_test/netx_17_17_test.c create mode 100644 test/regression/netxduo_test/netx_18_21_test.c create mode 100644 test/regression/netxduo_test/netx_1_01_test.c create mode 100644 test/regression/netxduo_test/netx_1_02_test.c create mode 100644 test/regression/netxduo_test/netx_1_03_test.c create mode 100644 test/regression/netxduo_test/netx_1_04_ipv6_test.c create mode 100644 test/regression/netxduo_test/netx_1_04_test.c create mode 100644 test/regression/netxduo_test/netx_1_05_test.c create mode 100644 test/regression/netxduo_test/netx_1_17_test.c create mode 100644 test/regression/netxduo_test/netx_1_18_test.c create mode 100644 test/regression/netxduo_test/netx_1_19_01_test.c create mode 100644 test/regression/netxduo_test/netx_1_19_02_test.c create mode 100644 test/regression/netxduo_test/netx_1_19_03_test.c create mode 100644 test/regression/netxduo_test/netx_1_20_test.c create mode 100644 test/regression/netxduo_test/netx_1_21_01_test.c create mode 100644 test/regression/netxduo_test/netx_1_21_02_test.c create mode 100644 test/regression/netxduo_test/netx_1_26_01_test.c create mode 100644 test/regression/netxduo_test/netx_1_26_02_test.c create mode 100644 test/regression/netxduo_test/netx_1_27_01_test.c create mode 100644 test/regression/netxduo_test/netx_1_27_02_test.c create mode 100644 test/regression/netxduo_test/netx_1_27_03_test.c create mode 100644 test/regression/netxduo_test/netx_1_27_04_test.c create mode 100644 test/regression/netxduo_test/netx_23_02_01_test.c create mode 100644 test/regression/netxduo_test/netx_23_02_02_test.c create mode 100644 test/regression/netxduo_test/netx_23_02_03_test.c create mode 100644 test/regression/netxduo_test/netx_23_02_04_test.c create mode 100644 test/regression/netxduo_test/netx_2_01_test.c create mode 100644 test/regression/netxduo_test/netx_2_02_test.c create mode 100644 test/regression/netxduo_test/netx_2_17_test.c create mode 100644 test/regression/netxduo_test/netx_2_20_test.c create mode 100644 test/regression/netxduo_test/netx_3_01_test.c create mode 100644 test/regression/netxduo_test/netx_3_02_test.c create mode 100644 test/regression/netxduo_test/netx_3_03_test.c create mode 100644 test/regression/netxduo_test/netx_3_04_test.c create mode 100644 test/regression/netxduo_test/netx_3_06_test.c create mode 100644 test/regression/netxduo_test/netx_3_07_test.c create mode 100644 test/regression/netxduo_test/netx_3_08_test.c create mode 100644 test/regression/netxduo_test/netx_3_17_test.c create mode 100644 test/regression/netxduo_test/netx_3_18_test.c create mode 100644 test/regression/netxduo_test/netx_3_19_test.c create mode 100644 test/regression/netxduo_test/netx_3_20_test.c create mode 100644 test/regression/netxduo_test/netx_3_21_test.c create mode 100644 test/regression/netxduo_test/netx_3_23_test.c create mode 100644 test/regression/netxduo_test/netx_4_01_test.c create mode 100644 test/regression/netxduo_test/netx_4_17_test.c create mode 100644 test/regression/netxduo_test/netx_4_21_test.c create mode 100644 test/regression/netxduo_test/netx_4_23_test.c create mode 100644 test/regression/netxduo_test/netx_4_24_test.c create mode 100644 test/regression/netxduo_test/netx_4_25_test.c create mode 100644 test/regression/netxduo_test/netx_4_26_test.c create mode 100644 test/regression/netxduo_test/netx_4_27_test.c create mode 100644 test/regression/netxduo_test/netx_4_28_test.c create mode 100644 test/regression/netxduo_test/netx_4_29_test.c create mode 100644 test/regression/netxduo_test/netx_5_18_test.c create mode 100644 test/regression/netxduo_test/netx_5_19_test.c create mode 100644 test/regression/netxduo_test/netx_5_20_test.c create mode 100644 test/regression/netxduo_test/netx_5_21_test.c create mode 100644 test/regression/netxduo_test/netx_5_22_test.c create mode 100644 test/regression/netxduo_test/netx_5_23_test.c create mode 100644 test/regression/netxduo_test/netx_5_24_test.c create mode 100644 test/regression/netxduo_test/netx_5_25_test.c create mode 100644 test/regression/netxduo_test/netx_6_17_test.c create mode 100644 test/regression/netxduo_test/netx_6_18_test.c create mode 100644 test/regression/netxduo_test/netx_6_20_test.c create mode 100644 test/regression/netxduo_test/netx_6_22_01_test.c create mode 100644 test/regression/netxduo_test/netx_6_22_02_test.c create mode 100644 test/regression/netxduo_test/netx_6_23_test.c create mode 100644 test/regression/netxduo_test/netx_6_24_test.c create mode 100644 test/regression/netxduo_test/netx_6_25_test.c create mode 100644 test/regression/netxduo_test/netx_6_27_test.c create mode 100644 test/regression/netxduo_test/netx_6_28_test.c create mode 100644 test/regression/netxduo_test/netx_6_29_test.c create mode 100644 test/regression/netxduo_test/netx_6_32_test.c create mode 100644 test/regression/netxduo_test/netx_8_01_test.c create mode 100644 test/regression/netxduo_test/netx_8_02_test.c create mode 100644 test/regression/netxduo_test/netx_8_17_test.c create mode 100644 test/regression/netxduo_test/netx_8_18_test.c create mode 100644 test/regression/netxduo_test/netx_8_19_test.c create mode 100644 test/regression/netxduo_test/netx_8_20_test.c create mode 100644 test/regression/netxduo_test/netx_8_21_test.c create mode 100644 test/regression/netxduo_test/netx_8_29_01_test.c create mode 100644 test/regression/netxduo_test/netx_8_29_02_test.c create mode 100644 test/regression/netxduo_test/netx_8_29_03_test.c create mode 100644 test/regression/netxduo_test/netx_8_29_04_test.c create mode 100644 test/regression/netxduo_test/netx_9_17_test.c create mode 100644 test/regression/netxduo_test/netx_9_18_test.c create mode 100644 test/regression/netxduo_test/netx_9_19_01_test.c create mode 100644 test/regression/netxduo_test/netx_9_19_02_test.c create mode 100644 test/regression/netxduo_test/netx_9_20_test.c create mode 100644 test/regression/netxduo_test/netx_9_21_01_test.c create mode 100644 test/regression/netxduo_test/netx_9_21_02_test.c create mode 100644 test/regression/netxduo_test/netx_9_22_test.c create mode 100644 test/regression/netxduo_test/netx_9_27_test.c create mode 100644 test/regression/netxduo_test/netx_api_compile_test.c create mode 100644 test/regression/netxduo_test/netx_arp_auto_entry_test.c create mode 100644 test/regression/netxduo_test/netx_arp_basic_test.c create mode 100644 test/regression/netxduo_test/netx_arp_branch_test.c create mode 100644 test/regression/netxduo_test/netx_arp_conflict_test.c create mode 100644 test/regression/netxduo_test/netx_arp_dual_pool_test.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_entry_fail_test.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_entry_set_test.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_entry_test.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_entry_test2.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_entry_test3.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_entry_timeout_test.c create mode 100644 test/regression/netxduo_test/netx_arp_dynamic_invalidate_test.c create mode 100644 test/regression/netxduo_test/netx_arp_entry_abnormal_operation_test.c create mode 100644 test/regression/netxduo_test/netx_arp_entry_cache_test.c create mode 100644 test/regression/netxduo_test/netx_arp_gratuitous_test.c create mode 100644 test/regression/netxduo_test/netx_arp_invalid_type_test.c create mode 100644 test/regression/netxduo_test/netx_arp_no_duplicate_entry_test.c create mode 100644 test/regression/netxduo_test/netx_arp_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_arp_packet_allocate_test.c create mode 100644 test/regression/netxduo_test/netx_arp_queue_depth_test.c create mode 100644 test/regression/netxduo_test/netx_arp_static_entries_delete_test.c create mode 100644 test/regression/netxduo_test/netx_arp_static_entry_create_test.c create mode 100644 test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c create mode 100644 test/regression/netxduo_test/netx_arp_static_entry_test.c create mode 100644 test/regression/netxduo_test/netx_caller_check_test.c create mode 100644 test/regression/netxduo_test/netx_checksum_test.c create mode 100644 test/regression/netxduo_test/netx_dest_table_add_fail_test.c create mode 100644 test/regression/netxduo_test/netx_forward_icmp_small_header_test.c create mode 100644 test/regression/netxduo_test/netx_forward_icmp_small_header_test2.c create mode 100644 test/regression/netxduo_test/netx_forward_icmp_small_header_test3.c create mode 100644 test/regression/netxduo_test/netx_forward_icmp_test.c create mode 100644 test/regression/netxduo_test/netx_forward_icmp_ttl_test.c create mode 100644 test/regression/netxduo_test/netx_forward_link_local_address_test.c create mode 100644 test/regression/netxduo_test/netx_forward_multicast_test.c create mode 100644 test/regression/netxduo_test/netx_forward_tcp_test_1.c create mode 100644 test/regression/netxduo_test/netx_forward_tcp_test_2.c create mode 100644 test/regression/netxduo_test/netx_forward_tcp_test_3.c create mode 100644 test/regression/netxduo_test/netx_forward_tcp_test_4.c create mode 100644 test/regression/netxduo_test/netx_forward_tcp_test_5.c create mode 100644 test/regression/netxduo_test/netx_forward_udp_fragment_test.c create mode 100644 test/regression/netxduo_test/netx_forward_udp_fragment_test2.c create mode 100644 test/regression/netxduo_test/netx_forward_udp_fragment_test3.c create mode 100644 test/regression/netxduo_test/netx_forward_udp_fragment_test4.c create mode 100644 test/regression/netxduo_test/netx_forward_udp_test.c create mode 100644 test/regression/netxduo_test/netx_http_proxy_basic_test.c create mode 100644 test/regression/netxduo_test/netx_http_proxy_data_fin_test.c create mode 100644 test/regression/netxduo_test/netx_http_proxy_disconnect_test.c create mode 100644 test/regression/netxduo_test/netx_http_proxy_error_response_test.c create mode 100644 test/regression/netxduo_test/netx_http_proxy_multiple_response_test.c create mode 100644 test/regression/netxduo_test/netx_http_proxy_non_block_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_branch_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_broadcast_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_cleanup_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_interface2_ping6_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_interface2_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_invalid_echo_reply_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_invalid_source_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_loopback_fail_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_loopback_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_loopback_test2.c create mode 100644 test/regression/netxduo_test/netx_icmp_multiple_ping6_test1.c create mode 100644 test/regression/netxduo_test/netx_icmp_multiple_ping6_test2.c create mode 100644 test/regression/netxduo_test/netx_icmp_multiple_ping_test1.c create mode 100644 test/regression/netxduo_test/netx_icmp_multiple_ping_test2.c create mode 100644 test/regression/netxduo_test/netx_icmp_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_packet_receive_function_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_ping6_data_append_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_ping6_fragment_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_ping6_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_ping_fragment_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_ping_multicast_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_send_error_message_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_send_error_message_test_1.c create mode 100644 test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv4_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv6_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv4_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv6_ping_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_DAD_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_abnormal_mtu_in_ra_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_branch_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_destination_table_periodic_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_echo_reply_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_echo_request_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_error_small_packet_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_error_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_invalid_length_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_invalid_length_test2.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_invalid_message_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_invalid_na.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_invalid_ra_dest_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_invalid_ra_option_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_mtu_option_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_na_buffer_overwrite_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_na_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_na_tlla_changed_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ns_buffer_overwrite_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ns_with_small_packet_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_address_full_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_buffer_overwrite_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_flag_callback_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_invalid_length_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_lifetime_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_router_full_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_ra_slla_changed_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_redirect_buffer_overwrite_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_redirect_nd_full_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_redirect_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_router_solicitation_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_solicitated_ra_test.c create mode 100644 test/regression/netxduo_test/netx_icmpv6_too_big_buffer_overwrite_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_basic_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_branch_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_checksum_computation_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_interface_indirect_report_send_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_join_fail_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_leave_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_loopback_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_multicast_basic_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_packet_receive_function_test.c create mode 100644 test/regression/netxduo_test/netx_igmp_router_query_test.c create mode 100644 test/regression/netxduo_test/netx_ip_abnormal_packet_test.c create mode 100644 test/regression/netxduo_test/netx_ip_address_change_notify_test.c create mode 100644 test/regression/netxduo_test/netx_ip_address_conflict_callback_test.c create mode 100644 test/regression/netxduo_test/netx_ip_address_conflict_detection_test.c create mode 100644 test/regression/netxduo_test/netx_ip_address_get_test.c create mode 100644 test/regression/netxduo_test/netx_ip_address_set_test.c create mode 100644 test/regression/netxduo_test/netx_ip_auxiliary_packet_pool_set_test.c create mode 100644 test/regression/netxduo_test/netx_ip_basic_test.c create mode 100644 test/regression/netxduo_test/netx_ip_branch_test.c create mode 100644 test/regression/netxduo_test/netx_ip_chain_packet_process_test.c create mode 100644 test/regression/netxduo_test/netx_ip_create_test.c create mode 100644 test/regression/netxduo_test/netx_ip_delete_test.c create mode 100644 test/regression/netxduo_test/netx_ip_driver_deferred_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_disable_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_dispatch_fail_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_duplicate_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_invalid_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_order_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_packet_copy_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_packet_delay_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_packet_drop_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_time_exceeded_message_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test2.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_wrong_destination_address_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test.c create mode 100644 test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test2.c create mode 100644 test/regression/netxduo_test/netx_ip_gateway_address_test.c create mode 100644 test/regression/netxduo_test/netx_ip_idle_scan_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_address_get_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_address_set_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_attachment_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_capability_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_detachment_arp_table_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_detachment_gateway_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_detachment_tcp_connection_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_detachment_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_info_get_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_physical_address_set_fail_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_physical_address_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_status_check_fail_test.c create mode 100644 test/regression/netxduo_test/netx_ip_interface_status_check_test.c create mode 100644 test/regression/netxduo_test/netx_ip_invalid_packet_receive_test.c create mode 100644 test/regression/netxduo_test/netx_ip_link_local_address_test.c create mode 100644 test/regression/netxduo_test/netx_ip_link_status_test.c create mode 100644 test/regression/netxduo_test/netx_ip_loopback_multihome_test.c create mode 100644 test/regression/netxduo_test/netx_ip_malformed_packet_test.c create mode 100644 test/regression/netxduo_test/netx_ip_malformed_packet_test.h create mode 100644 test/regression/netxduo_test/netx_ip_max_payload_size_find_test.c create mode 100644 test/regression/netxduo_test/netx_ip_multicast_interface_detach_test.c create mode 100644 test/regression/netxduo_test/netx_ip_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_ip_packet_filter_extended_test.c create mode 100644 test/regression/netxduo_test/netx_ip_packet_filter_test.c create mode 100644 test/regression/netxduo_test/netx_ip_raw_loopback_test.c create mode 100644 test/regression/netxduo_test/netx_ip_raw_packet_filter_test.c create mode 100644 test/regression/netxduo_test/netx_ip_raw_packet_queue_test.c create mode 100644 test/regression/netxduo_test/netx_ip_raw_packet_test.c create mode 100644 test/regression/netxduo_test/netx_ip_route_reachable_test.c create mode 100644 test/regression/netxduo_test/netx_ip_static_route_add_test.c create mode 100644 test/regression/netxduo_test/netx_ip_static_route_delete_test.c create mode 100644 test/regression/netxduo_test/netx_ip_static_route_find_test.c create mode 100644 test/regression/netxduo_test/netx_ip_status_check_test.c create mode 100644 test/regression/netxduo_test/netx_ipv4_option_process_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_address_delete_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_address_get_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_address_set_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_branch_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_default_router_api_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_default_router_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_disable_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_fragment_fail_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_fragmentation_error_test1.c create mode 100644 test/regression/netxduo_test/netx_ipv6_fragmentation_error_test2.c create mode 100644 test/regression/netxduo_test/netx_ipv6_fragmentation_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_hop_by_hop_fragment_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_hop_by_hop_option_error_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_interface_detachment_router_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_invalid_packet_receive_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_multicast_basic_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_multicast_interface_detach_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_multicast_ping_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_multicast_ping_test1.c create mode 100644 test/regression/netxduo_test/netx_ipv6_nd_cache_api_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_packet_chain_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_pmtu_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_prefix_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_raw_packet_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_search_onlink_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_send_fail_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_stateless_address_autoconfig_test.c create mode 100644 test/regression/netxduo_test/netx_ipv6_util_api_test.c create mode 100644 test/regression/netxduo_test/netx_low_watermark_fragment_test.c create mode 100644 test/regression/netxduo_test/netx_low_watermark_test.c create mode 100644 test/regression/netxduo_test/netx_low_watermark_zero_window_test.c create mode 100644 test/regression/netxduo_test/netx_nd_cache_add_test.c create mode 100644 test/regression/netxduo_test/netx_nd_cache_api_test.c create mode 100644 test/regression/netxduo_test/netx_nd_cache_branch_test.c create mode 100644 test/regression/netxduo_test/netx_nd_cache_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_nd_cache_under_interface_detach_test.c create mode 100644 test/regression/netxduo_test/netx_nd_cache_with_own_address_test.c create mode 100644 test/regression/netxduo_test/netx_nxd_udp_socket_send_special_test.c create mode 100644 test/regression/netxduo_test/netx_old_api_test.c create mode 100644 test/regression/netxduo_test/netx_packet_basic_test.c create mode 100644 test/regression/netxduo_test/netx_packet_branch_test.c create mode 100644 test/regression/netxduo_test/netx_packet_data_append_test.c create mode 100644 test/regression/netxduo_test/netx_packet_debug_info_test.c create mode 100644 test/regression/netxduo_test/netx_packet_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_packet_payload_size_test.c create mode 100644 test/regression/netxduo_test/netx_packet_suspension_test.c create mode 100644 test/regression/netxduo_test/netx_ramdriver_callback_test.c create mode 100644 test/regression/netxduo_test/netx_rarp_basic_processing_test.c create mode 100644 test/regression/netxduo_test/netx_rarp_branch_test.c create mode 100644 test/regression/netxduo_test/netx_rarp_multiple_interfaces_test.c create mode 100644 test/regression/netxduo_test/netx_rarp_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_rarp_packet_allocate_fail_test.c create mode 100644 test/regression/netxduo_test/netx_raw_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_raw_special_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_4_duplicate_ack_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ack_before_release_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ack_check_for_syn_message_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ack_check_issue_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_advertised_window_update_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_basic_processing_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_branch_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_chained_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_client_bind_cleanup_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_client_socket_bind_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_client_socket_port_get_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_client_socket_unbind_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_connection_reset_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_cwnd_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_data_transfer_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_data_trim_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_delayed_retransmission_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_delayed_retransmission_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_dropped_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_dropped_packet_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_duplicate_accept_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_error_operation_check_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_fast_disconnect_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_fast_retransmit_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_fin_wait1_to_time_wait_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_fin_wait_recv_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_invalid_length_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_invalid_option_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_invalid_option_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_invalid_packet_chain_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ipv4_interface2_mss_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ipv6_basic_processing_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ipv6_delayed_retransmission_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ipv6_interface2_mss_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_ipv6_window_scale_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_keepalive_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_large_data_transfer_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_large_mtu_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_large_mtu_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_listen_packet_leak_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_listen_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_loopback_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_max_window_scale_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_mss_option_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_multiple_send_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_multiple_send_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test1.c create mode 100644 test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test3.c create mode 100644 test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test4.c create mode 100644 test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test5.c create mode 100644 test/regression/netxduo_test/netx_tcp_not_enabled_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_odd_window_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_out_of_order_ack_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_out_of_order_packet_max_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_out_of_order_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_out_of_window_control_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_10.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_11.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_12.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_13.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_14.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_15.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_16.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_17.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_18.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_2.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_3.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_4.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_5.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_6.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_7.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_8.c create mode 100644 test/regression/netxduo_test/netx_tcp_overlapping_packet_test_9.c create mode 100644 test/regression/netxduo_test/netx_tcp_packet_leak_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_packet_receive_function_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_queue_depth_notify_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_race_condition_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_race_condition_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_receive_cleanup_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_reset_during_send_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_retransmit_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_retransmit_test_1.c create mode 100644 test/regression/netxduo_test/netx_tcp_send_disconnect_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_send_fail_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_send_fail_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_send_fail_test3.c create mode 100644 test/regression/netxduo_test/netx_tcp_server_socket_accept_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_simultaneous_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_small_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_small_window_preempt_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_small_window_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_available_bytes_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_delete_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_listen_queue_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_listen_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_mss_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_receive_rst_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_relisten_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_relisten_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_send_internal_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_state_wait_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_unaccept_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_unbind_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_unbind_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_socket_unlisten_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_time_wait_to_close_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_transmit_cleanup_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_transmit_not_done_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_transmit_under_interface_detach_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv4_basic_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_address_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_basic_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_big_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_small_windows_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv4_basic_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv6_basic_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_tx_queue_exceed_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_udp_random_port_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_urgent_packet_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_window_update_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_wrapping_sequence_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_wrapping_sequence_test2.c create mode 100644 test/regression/netxduo_test/netx_tcp_wrapping_sequence_test3.c create mode 100644 test/regression/netxduo_test/netx_tcp_wrapping_sequence_test4.c create mode 100644 test/regression/netxduo_test/netx_tcp_zero_window_probe_2_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_zero_window_probe_test.c create mode 100644 test/regression/netxduo_test/netx_tcp_zero_window_test.c create mode 100644 test/regression/netxduo_test/netx_udp_basic_processing_test.c create mode 100644 test/regression/netxduo_test/netx_udp_bind_cleanup_test.c create mode 100644 test/regression/netxduo_test/netx_udp_branch_test.c create mode 100644 test/regression/netxduo_test/netx_udp_checksum_zero_test.c create mode 100644 test/regression/netxduo_test/netx_udp_fragment_test.c create mode 100644 test/regression/netxduo_test/netx_udp_fragmentation_processing_test.c create mode 100644 test/regression/netxduo_test/netx_udp_free_port_find_test.c create mode 100644 test/regression/netxduo_test/netx_udp_ipv4_interface2_test_1_test.c create mode 100644 test/regression/netxduo_test/netx_udp_ipv6_interface2_test_1_test.c create mode 100644 test/regression/netxduo_test/netx_udp_loopback_test.c create mode 100644 test/regression/netxduo_test/netx_udp_multiple_ports_test.c create mode 100644 test/regression/netxduo_test/netx_udp_nxe_api_test.c create mode 100644 test/regression/netxduo_test/netx_udp_packet_receive_test.c create mode 100644 test/regression/netxduo_test/netx_udp_packet_type_test.c create mode 100644 test/regression/netxduo_test/netx_udp_port_table_udpate_test.c create mode 100644 test/regression/netxduo_test/netx_udp_port_unreachable_test.c create mode 100644 test/regression/netxduo_test/netx_udp_socket_bind_test.c create mode 100644 test/regression/netxduo_test/netx_udp_socket_delete_test.c create mode 100644 test/regression/netxduo_test/netx_udp_socket_unbind_receive_test.c create mode 100644 test/regression/netxduo_test/netx_udp_socket_unbind_test.c create mode 100644 test/regression/netxduo_test/netx_udp_source_send_test.c create mode 100644 test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv4_basic_test.c create mode 100644 test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv6_basic_test.c create mode 100644 test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv4_basic_test.c create mode 100644 test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv6_basic_test.c create mode 100644 test/regression/netxduo_test/netx_utility_test.c create mode 100644 test/regression/pop3_test/netx_pop3_abnormal_packet_test.c create mode 100644 test/regression/pop3_test/netx_pop3_mail_receive_test.c create mode 100644 test/regression/pop3_test/netx_pop3_packet_with_endmarker_test.c create mode 100644 test/regression/pop3_test/netx_pop3_two_mails_received_test.c create mode 100644 test/regression/ppp_test/netx_ppp_IPCP_abnormal_packet_test.c create mode 100644 test/regression/ppp_test/netx_ppp_IPCP_nak_test.c create mode 100644 test/regression/ppp_test/netx_ppp_IPCP_retransmit_test.c create mode 100644 test/regression/ppp_test/netx_ppp_IPCP_timeout.c create mode 100644 test/regression/ppp_test/netx_ppp_LCP_invalid_packet_test.c create mode 100644 test/regression/ppp_test/netx_ppp_LCP_timeout.c create mode 100644 test/regression/ppp_test/netx_ppp_PAP_bad_password_test.c create mode 100644 test/regression/ppp_test/netx_ppp_PAP_bad_username_test.c create mode 100644 test/regression/ppp_test/netx_ppp_acfc_option_test.c create mode 100644 test/regression/ppp_test/netx_ppp_chap_bad_secret_failed_retry_test.c create mode 100644 test/regression/ppp_test/netx_ppp_chap_bad_secret_passed_on_retry_test.c create mode 100644 test/regression/ppp_test/netx_ppp_check_boundary_test.c create mode 100644 test/regression/ppp_test/netx_ppp_pap_basic_test.c create mode 100644 test/regression/ppp_test/netx_ppp_pap_null_name_password_test.c create mode 100644 test/regression/ppp_test/netx_ppp_pfc_option_test.c create mode 100644 test/regression/ppp_test/netx_ppp_request_dns_server_test.c create mode 100644 test/regression/pppoe_test/netx_pppoe_ac_name_test.c create mode 100644 test/regression/pppoe_test/netx_pppoe_api_extended_test.c create mode 100644 test/regression/pppoe_test/netx_pppoe_api_test.c create mode 100644 test/regression/pppoe_test/netx_pppoe_basic_test.c create mode 100644 test/regression/pppoe_test/netx_pppoe_session_control_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_announce_timeout_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_api_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_basic_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_calibrate_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_ipv6_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_master_selection_test.c create mode 100644 test/regression/ptp_test/netx_ptp_client_two_steps_off_test.c create mode 100644 test/regression/ptp_test/netx_ptp_utility.c create mode 100644 test/regression/ptp_test/netx_ptp_utility.h create mode 100644 test/regression/rtp_test/netx_rtcp_abnormal_packet_test.c create mode 100644 test/regression/rtp_test/netx_rtcp_basic_test.c create mode 100644 test/regression/rtp_test/netx_rtcp_packet_process_test.c create mode 100644 test/regression/rtp_test/netx_rtcp_packet_send_test.c create mode 100644 test/regression/rtp_test/netx_rtp_api_test.c create mode 100644 test/regression/rtp_test/netx_rtp_basic_test.c create mode 100644 test/regression/rtp_test/netx_rtp_free_udp_port_find_test.c create mode 100644 test/regression/rtp_test/netx_rtp_multi_clients_test.c create mode 100644 test/regression/rtp_test/netx_rtp_multi_interfaces_test.c create mode 100644 test/regression/rtp_test/netx_rtp_multicast_test.c create mode 100644 test/regression/rtp_test/netx_rtp_session_aac_send_test.c create mode 100644 test/regression/rtp_test/netx_rtp_session_h264_send_test.c create mode 100644 test/regression/rtp_test/netx_rtp_session_jpeg_send_test.c create mode 100644 test/regression/rtp_test/netx_rtp_session_packet_send_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_api_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_client_timeout_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_delete_beforehand_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_error_response_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_multiple_clients_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_multiple_request_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_rtp_basic_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_rtp_ipv6_basic_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_rtp_ipv6_multicast_test.c create mode 100644 test/regression/rtsp_test/netx_rtsp_rtp_multicast_test.c create mode 100644 test/regression/smtp_test/netx_smtp_abnormal_packet_test.c create mode 100644 test/regression/smtp_test/netx_smtp_auth_logon_function_test.c create mode 100644 test/regression/smtp_test/netx_smtp_auth_no_type_function_test.c create mode 100644 test/regression/smtp_test/netx_smtp_auth_no_type_test.c create mode 100644 test/regression/smtp_test/netx_smtp_auth_none_test.c create mode 100644 test/regression/smtp_test/netx_smtp_basic_function_test.c create mode 100644 test/regression/smtp_test/netx_smtp_invalid_release_test.c create mode 100644 test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c create mode 100644 test/regression/smtp_test/netx_smtp_two_packet_EHLO_auth_last_message_test.c create mode 100644 test/regression/smtp_test/netx_smtp_two_packet_EHLO_message_test.c create mode 100644 test/regression/smtp_test/smtp_server_packets.c create mode 100644 test/regression/smtp_test/smtp_test_files.mk create mode 100644 test/regression/snmp_test/GetSet_IPv4v6Address.c create mode 100644 test/regression/snmp_test/GetSet_Integers_Large_and_Neg_Numbers.c create mode 100644 test/regression/snmp_test/GetSet_OctetStrings.c create mode 100644 test/regression/snmp_test/Get_Miscellaneous_Data_type.c create mode 100644 test/regression/snmp_test/get_snmp_v3_request.c create mode 100644 test/regression/snmp_test/netx_snmp_abnormal_packet_test.c create mode 100644 test/regression/snmp_test/netx_snmp_basic_v2_test.c create mode 100644 test/regression/snmp_test/netx_snmp_no_security_function_test.c create mode 100644 test/regression/snmp_test/netx_snmp_setget_integers_test.c create mode 100644 test/regression/snmp_test/netx_snmp_setget_ip_address_test.c create mode 100644 test/regression/snmp_test/netx_snmp_setget_misc_test.c create mode 100644 test/regression/snmp_test/netx_snmp_setget_octet_strings_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v1_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v1_object_id_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v1_packet_double_release_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v2_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v2_send_trap_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v2_unknown_oid_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_decrypt_pdu_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_md5_failed_security_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_md5_security_extended_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_md5_security_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_no_security_function_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_nosec_traplist_test.c create mode 100644 test/regression/snmp_test/netx_snmp_v3_object_id_buffer_overwrite_test.c create mode 100644 test/regression/snmp_test/small_mib_helper.c create mode 100644 test/regression/snmp_test/small_mib_helper.h create mode 100644 test/regression/snmp_test/snmp_manager_packets.c create mode 100644 test/regression/sntp_test/netx_sntp_client_broadcast_basic_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_ipv6_broadcast_basic_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_ipv6_unicast_basic_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_kod_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_packet_chain_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_seconds_to_date_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_unicast_basic_test.c create mode 100644 test/regression/sntp_test/netx_sntp_client_unicast_display_date_test.c create mode 100644 test/regression/sntp_test/netx_sntp_forward_unicast_update_test.c create mode 100644 test/regression/sntp_test/netx_sntp_request_unicast_test.c create mode 100644 test/regression/tahi_test/netx_tahi.h create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_002.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_003.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_004.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_005.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_006.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_007.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_008.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_009.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_010.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_011.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_012.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_013.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_014.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_019.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_020.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_021.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_022.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_023.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_024.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_025.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_026.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_027.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_028.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_029.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_030.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_031.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_032.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_033.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_034.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_035.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_036.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_037.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_038.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_039.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_040.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_041.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_042.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_043.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_044.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_045.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_046.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_047.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_048.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_049.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_050.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_051.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_052.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_053.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_054.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_055.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_056.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_057.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_058.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_059.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_060.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_061.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_062.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_063.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_064.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_065.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_066.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_067.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_068.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_069.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_070.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_071.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_072.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_073.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_074.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_075.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_076.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_077.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_078.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_079.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_080.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_081.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_082.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_083.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_084.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_085.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_086.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_087.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_088.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_089.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_090.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_091.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_092.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_093.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_094.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_095.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_096.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_097.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_098.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_01_099.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_002.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_003.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_004.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_005.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_006.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_007.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_008.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_009.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_010.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_012.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_013.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_014.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_015.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_016.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_017.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_018.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_019.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_020.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_021.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_022.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_026.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_04_027.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_002.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_003.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_004.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_005.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_006.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_007.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_008.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_009.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_010.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_011.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_012.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_013.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_014.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_015.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_016.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_017.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_018.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_019.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_020.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_021.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_022.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_023.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_024.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_025.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_026.c create mode 100644 test/regression/tahi_test/netx_tahi_dhcpv6_test_07_027.c create mode 100644 test/regression/tahi_test/netx_tahi_run_test_case.c create mode 100644 test/regression/tahi_test/netx_tahi_test_1.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_01.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_02.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_03.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_04.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_05.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_06.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_07.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_08.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_09.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_10.c create mode 100644 test/regression/tahi_test/netx_tahi_test_2_11.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_01.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_02.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_03.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_04.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_05.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_06.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_07.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_08.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_09.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_10.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_11.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_12.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_13.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_14.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_15.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_16.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_17.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_18.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_19.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_20.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_21.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_22.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_23.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_24.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_25.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_26.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_27.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_28.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_29.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_30.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_31.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_32.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_33.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_34.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_35.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_36.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_37.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_38.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_39.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_40.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_41.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_42.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_43.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_44.c create mode 100644 test/regression/tahi_test/netx_tahi_test_3_45.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_10.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_11.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_12.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_13.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_14.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_15.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_16.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_2.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_3.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_4.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_5.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_6.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_7.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_8.c create mode 100644 test/regression/tahi_test/netx_tahi_test_4_9.c create mode 100644 test/regression/tahi_test/netx_tahi_test_5.c create mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec.c create mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec_2.c create mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec_udp.c create mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c create mode 100644 test/regression/tahi_test/tahi.a create mode 100644 test/regression/tahi_test/tahi.so create mode 100644 test/regression/tahi_test/tahi64.a create mode 100644 test/regression/tahi_test/tahi64.so create mode 100644 test/regression/tahi_test/tahi_01_001.c create mode 100644 test/regression/tahi_test/tahi_01_002.c create mode 100644 test/regression/tahi_test/tahi_01_003.c create mode 100644 test/regression/tahi_test/tahi_01_004.c create mode 100644 test/regression/tahi_test/tahi_01_005.c create mode 100644 test/regression/tahi_test/tahi_01_006.c create mode 100644 test/regression/tahi_test/tahi_01_007.c create mode 100644 test/regression/tahi_test/tahi_01_008.c create mode 100644 test/regression/tahi_test/tahi_01_009.c create mode 100644 test/regression/tahi_test/tahi_01_010.c create mode 100644 test/regression/tahi_test/tahi_01_011.c create mode 100644 test/regression/tahi_test/tahi_01_012.c create mode 100644 test/regression/tahi_test/tahi_01_013.c create mode 100644 test/regression/tahi_test/tahi_01_014.c create mode 100644 test/regression/tahi_test/tahi_01_015.c create mode 100644 test/regression/tahi_test/tahi_01_016.c create mode 100644 test/regression/tahi_test/tahi_01_017.c create mode 100644 test/regression/tahi_test/tahi_01_018.c create mode 100644 test/regression/tahi_test/tahi_01_019.c create mode 100644 test/regression/tahi_test/tahi_01_020.c create mode 100644 test/regression/tahi_test/tahi_01_021.c create mode 100644 test/regression/tahi_test/tahi_01_022.c create mode 100644 test/regression/tahi_test/tahi_01_023.c create mode 100644 test/regression/tahi_test/tahi_01_024.c create mode 100644 test/regression/tahi_test/tahi_01_025.c create mode 100644 test/regression/tahi_test/tahi_01_026.c create mode 100644 test/regression/tahi_test/tahi_01_027.c create mode 100644 test/regression/tahi_test/tahi_01_028.c create mode 100644 test/regression/tahi_test/tahi_01_029.c create mode 100644 test/regression/tahi_test/tahi_01_030.c create mode 100644 test/regression/tahi_test/tahi_01_031.c create mode 100644 test/regression/tahi_test/tahi_01_032.c create mode 100644 test/regression/tahi_test/tahi_01_033.c create mode 100644 test/regression/tahi_test/tahi_01_034.c create mode 100644 test/regression/tahi_test/tahi_01_035.c create mode 100644 test/regression/tahi_test/tahi_01_036.c create mode 100644 test/regression/tahi_test/tahi_01_037.c create mode 100644 test/regression/tahi_test/tahi_01_038.c create mode 100644 test/regression/tahi_test/tahi_01_039.c create mode 100644 test/regression/tahi_test/tahi_01_040.c create mode 100644 test/regression/tahi_test/tahi_01_041.c create mode 100644 test/regression/tahi_test/tahi_01_042.c create mode 100644 test/regression/tahi_test/tahi_01_043.c create mode 100644 test/regression/tahi_test/tahi_01_044.c create mode 100644 test/regression/tahi_test/tahi_01_045.c create mode 100644 test/regression/tahi_test/tahi_01_046.c create mode 100644 test/regression/tahi_test/tahi_01_047.c create mode 100644 test/regression/tahi_test/tahi_01_048.c create mode 100644 test/regression/tahi_test/tahi_01_049.c create mode 100644 test/regression/tahi_test/tahi_01_050.c create mode 100644 test/regression/tahi_test/tahi_01_051.c create mode 100644 test/regression/tahi_test/tahi_01_052.c create mode 100644 test/regression/tahi_test/tahi_01_053.c create mode 100644 test/regression/tahi_test/tahi_01_054.c create mode 100644 test/regression/tahi_test/tahi_02_001.c create mode 100644 test/regression/tahi_test/tahi_02_002.c create mode 100644 test/regression/tahi_test/tahi_02_003.c create mode 100644 test/regression/tahi_test/tahi_02_004.c create mode 100644 test/regression/tahi_test/tahi_02_005.c create mode 100644 test/regression/tahi_test/tahi_02_006.c create mode 100644 test/regression/tahi_test/tahi_02_007.c create mode 100644 test/regression/tahi_test/tahi_02_008.c create mode 100644 test/regression/tahi_test/tahi_02_009.c create mode 100644 test/regression/tahi_test/tahi_02_010.c create mode 100644 test/regression/tahi_test/tahi_02_011.c create mode 100644 test/regression/tahi_test/tahi_02_012.c create mode 100644 test/regression/tahi_test/tahi_02_013.c create mode 100644 test/regression/tahi_test/tahi_02_014.c create mode 100644 test/regression/tahi_test/tahi_02_015.c create mode 100644 test/regression/tahi_test/tahi_02_016.c create mode 100644 test/regression/tahi_test/tahi_02_017.c create mode 100644 test/regression/tahi_test/tahi_02_018.c create mode 100644 test/regression/tahi_test/tahi_02_019.c create mode 100644 test/regression/tahi_test/tahi_02_020.c create mode 100644 test/regression/tahi_test/tahi_02_021.c create mode 100644 test/regression/tahi_test/tahi_02_022.c create mode 100644 test/regression/tahi_test/tahi_02_023.c create mode 100644 test/regression/tahi_test/tahi_02_024.c create mode 100644 test/regression/tahi_test/tahi_02_025.c create mode 100644 test/regression/tahi_test/tahi_02_026.c create mode 100644 test/regression/tahi_test/tahi_02_027.c create mode 100644 test/regression/tahi_test/tahi_02_028.c create mode 100644 test/regression/tahi_test/tahi_02_029.c create mode 100644 test/regression/tahi_test/tahi_02_030.c create mode 100644 test/regression/tahi_test/tahi_02_031.c create mode 100644 test/regression/tahi_test/tahi_02_032.c create mode 100644 test/regression/tahi_test/tahi_02_033.c create mode 100644 test/regression/tahi_test/tahi_02_034.c create mode 100644 test/regression/tahi_test/tahi_02_035.c create mode 100644 test/regression/tahi_test/tahi_02_036.c create mode 100644 test/regression/tahi_test/tahi_02_037.c create mode 100644 test/regression/tahi_test/tahi_02_038.c create mode 100644 test/regression/tahi_test/tahi_02_039.c create mode 100644 test/regression/tahi_test/tahi_02_040.c create mode 100644 test/regression/tahi_test/tahi_02_041.c create mode 100644 test/regression/tahi_test/tahi_02_042.c create mode 100644 test/regression/tahi_test/tahi_02_043.c create mode 100644 test/regression/tahi_test/tahi_02_044.c create mode 100644 test/regression/tahi_test/tahi_02_045.c create mode 100644 test/regression/tahi_test/tahi_02_046.c create mode 100644 test/regression/tahi_test/tahi_02_047.c create mode 100644 test/regression/tahi_test/tahi_02_048.c create mode 100644 test/regression/tahi_test/tahi_02_049.c create mode 100644 test/regression/tahi_test/tahi_02_050.c create mode 100644 test/regression/tahi_test/tahi_02_051.c create mode 100644 test/regression/tahi_test/tahi_02_052.c create mode 100644 test/regression/tahi_test/tahi_02_053.c create mode 100644 test/regression/tahi_test/tahi_02_054.c create mode 100644 test/regression/tahi_test/tahi_02_055.c create mode 100644 test/regression/tahi_test/tahi_02_056.c create mode 100644 test/regression/tahi_test/tahi_02_057.c create mode 100644 test/regression/tahi_test/tahi_02_058.c create mode 100644 test/regression/tahi_test/tahi_02_059.c create mode 100644 test/regression/tahi_test/tahi_02_060.c create mode 100644 test/regression/tahi_test/tahi_02_061.c create mode 100644 test/regression/tahi_test/tahi_02_062.c create mode 100644 test/regression/tahi_test/tahi_02_063.c create mode 100644 test/regression/tahi_test/tahi_02_064.c create mode 100644 test/regression/tahi_test/tahi_02_065.c create mode 100644 test/regression/tahi_test/tahi_02_066.c create mode 100644 test/regression/tahi_test/tahi_02_067.c create mode 100644 test/regression/tahi_test/tahi_02_068.c create mode 100644 test/regression/tahi_test/tahi_02_069.c create mode 100644 test/regression/tahi_test/tahi_02_070.c create mode 100644 test/regression/tahi_test/tahi_02_071.c create mode 100644 test/regression/tahi_test/tahi_02_072.c create mode 100644 test/regression/tahi_test/tahi_02_073.c create mode 100644 test/regression/tahi_test/tahi_02_074.c create mode 100644 test/regression/tahi_test/tahi_02_075.c create mode 100644 test/regression/tahi_test/tahi_02_076.c create mode 100644 test/regression/tahi_test/tahi_02_077.c create mode 100644 test/regression/tahi_test/tahi_02_078.c create mode 100644 test/regression/tahi_test/tahi_02_079.c create mode 100644 test/regression/tahi_test/tahi_02_080.c create mode 100644 test/regression/tahi_test/tahi_02_081.c create mode 100644 test/regression/tahi_test/tahi_02_082.c create mode 100644 test/regression/tahi_test/tahi_02_083.c create mode 100644 test/regression/tahi_test/tahi_02_084.c create mode 100644 test/regression/tahi_test/tahi_02_085.c create mode 100644 test/regression/tahi_test/tahi_02_086.c create mode 100644 test/regression/tahi_test/tahi_02_087.c create mode 100644 test/regression/tahi_test/tahi_02_088.c create mode 100644 test/regression/tahi_test/tahi_02_089.c create mode 100644 test/regression/tahi_test/tahi_02_090.c create mode 100644 test/regression/tahi_test/tahi_02_091.c create mode 100644 test/regression/tahi_test/tahi_02_092.c create mode 100644 test/regression/tahi_test/tahi_02_093.c create mode 100644 test/regression/tahi_test/tahi_02_094.c create mode 100644 test/regression/tahi_test/tahi_02_095.c create mode 100644 test/regression/tahi_test/tahi_02_096.c create mode 100644 test/regression/tahi_test/tahi_02_097.c create mode 100644 test/regression/tahi_test/tahi_02_098.c create mode 100644 test/regression/tahi_test/tahi_02_099.c create mode 100644 test/regression/tahi_test/tahi_02_100.c create mode 100644 test/regression/tahi_test/tahi_02_101.c create mode 100644 test/regression/tahi_test/tahi_02_102.c create mode 100644 test/regression/tahi_test/tahi_02_103.c create mode 100644 test/regression/tahi_test/tahi_02_104.c create mode 100644 test/regression/tahi_test/tahi_02_105.c create mode 100644 test/regression/tahi_test/tahi_02_106.c create mode 100644 test/regression/tahi_test/tahi_02_107.c create mode 100644 test/regression/tahi_test/tahi_02_108.c create mode 100644 test/regression/tahi_test/tahi_02_109.c create mode 100644 test/regression/tahi_test/tahi_02_110.c create mode 100644 test/regression/tahi_test/tahi_02_111.c create mode 100644 test/regression/tahi_test/tahi_02_112.c create mode 100644 test/regression/tahi_test/tahi_02_113.c create mode 100644 test/regression/tahi_test/tahi_02_114.c create mode 100644 test/regression/tahi_test/tahi_02_115.c create mode 100644 test/regression/tahi_test/tahi_02_116.c create mode 100644 test/regression/tahi_test/tahi_02_117.c create mode 100644 test/regression/tahi_test/tahi_02_118.c create mode 100644 test/regression/tahi_test/tahi_02_119.c create mode 100644 test/regression/tahi_test/tahi_02_120.c create mode 100644 test/regression/tahi_test/tahi_02_121.c create mode 100644 test/regression/tahi_test/tahi_02_122.c create mode 100644 test/regression/tahi_test/tahi_02_123.c create mode 100644 test/regression/tahi_test/tahi_02_124.c create mode 100644 test/regression/tahi_test/tahi_02_125.c create mode 100644 test/regression/tahi_test/tahi_02_126.c create mode 100644 test/regression/tahi_test/tahi_02_127.c create mode 100644 test/regression/tahi_test/tahi_02_128.c create mode 100644 test/regression/tahi_test/tahi_02_129.c create mode 100644 test/regression/tahi_test/tahi_02_130.c create mode 100644 test/regression/tahi_test/tahi_02_131.c create mode 100644 test/regression/tahi_test/tahi_02_132.c create mode 100644 test/regression/tahi_test/tahi_02_133.c create mode 100644 test/regression/tahi_test/tahi_02_134.c create mode 100644 test/regression/tahi_test/tahi_02_135.c create mode 100644 test/regression/tahi_test/tahi_02_136.c create mode 100644 test/regression/tahi_test/tahi_02_137.c create mode 100644 test/regression/tahi_test/tahi_02_138.c create mode 100644 test/regression/tahi_test/tahi_02_139.c create mode 100644 test/regression/tahi_test/tahi_02_140.c create mode 100644 test/regression/tahi_test/tahi_02_141.c create mode 100644 test/regression/tahi_test/tahi_02_142.c create mode 100644 test/regression/tahi_test/tahi_02_143.c create mode 100644 test/regression/tahi_test/tahi_02_144.c create mode 100644 test/regression/tahi_test/tahi_02_145.c create mode 100644 test/regression/tahi_test/tahi_02_146.c create mode 100644 test/regression/tahi_test/tahi_02_147.c create mode 100644 test/regression/tahi_test/tahi_02_148.c create mode 100644 test/regression/tahi_test/tahi_02_149.c create mode 100644 test/regression/tahi_test/tahi_02_150.c create mode 100644 test/regression/tahi_test/tahi_02_151.c create mode 100644 test/regression/tahi_test/tahi_02_152.c create mode 100644 test/regression/tahi_test/tahi_02_153.c create mode 100644 test/regression/tahi_test/tahi_02_154.c create mode 100644 test/regression/tahi_test/tahi_02_155.c create mode 100644 test/regression/tahi_test/tahi_02_156.c create mode 100644 test/regression/tahi_test/tahi_02_157.c create mode 100644 test/regression/tahi_test/tahi_02_158.c create mode 100644 test/regression/tahi_test/tahi_02_159.c create mode 100644 test/regression/tahi_test/tahi_02_160.c create mode 100644 test/regression/tahi_test/tahi_02_161.c create mode 100644 test/regression/tahi_test/tahi_02_162.c create mode 100644 test/regression/tahi_test/tahi_02_163.c create mode 100644 test/regression/tahi_test/tahi_02_164.c create mode 100644 test/regression/tahi_test/tahi_02_165.c create mode 100644 test/regression/tahi_test/tahi_02_166.c create mode 100644 test/regression/tahi_test/tahi_02_167.c create mode 100644 test/regression/tahi_test/tahi_02_168.c create mode 100644 test/regression/tahi_test/tahi_02_169.c create mode 100644 test/regression/tahi_test/tahi_02_170.c create mode 100644 test/regression/tahi_test/tahi_02_171.c create mode 100644 test/regression/tahi_test/tahi_02_172.c create mode 100644 test/regression/tahi_test/tahi_02_173.c create mode 100644 test/regression/tahi_test/tahi_02_174.c create mode 100644 test/regression/tahi_test/tahi_02_175.c create mode 100644 test/regression/tahi_test/tahi_02_176.c create mode 100644 test/regression/tahi_test/tahi_02_177.c create mode 100644 test/regression/tahi_test/tahi_02_178.c create mode 100644 test/regression/tahi_test/tahi_02_179.c create mode 100644 test/regression/tahi_test/tahi_02_180.c create mode 100644 test/regression/tahi_test/tahi_02_181.c create mode 100644 test/regression/tahi_test/tahi_02_182.c create mode 100644 test/regression/tahi_test/tahi_02_183.c create mode 100644 test/regression/tahi_test/tahi_02_184.c create mode 100644 test/regression/tahi_test/tahi_02_185.c create mode 100644 test/regression/tahi_test/tahi_02_186.c create mode 100644 test/regression/tahi_test/tahi_02_187.c create mode 100644 test/regression/tahi_test/tahi_02_188.c create mode 100644 test/regression/tahi_test/tahi_02_189.c create mode 100644 test/regression/tahi_test/tahi_02_190.c create mode 100644 test/regression/tahi_test/tahi_02_191.c create mode 100644 test/regression/tahi_test/tahi_02_192.c create mode 100644 test/regression/tahi_test/tahi_02_193.c create mode 100644 test/regression/tahi_test/tahi_02_194.c create mode 100644 test/regression/tahi_test/tahi_02_195.c create mode 100644 test/regression/tahi_test/tahi_02_196.c create mode 100644 test/regression/tahi_test/tahi_02_197.c create mode 100644 test/regression/tahi_test/tahi_02_198.c create mode 100644 test/regression/tahi_test/tahi_02_199.c create mode 100644 test/regression/tahi_test/tahi_02_200.c create mode 100644 test/regression/tahi_test/tahi_02_201.c create mode 100644 test/regression/tahi_test/tahi_02_202.c create mode 100644 test/regression/tahi_test/tahi_02_203.c create mode 100644 test/regression/tahi_test/tahi_02_204.c create mode 100644 test/regression/tahi_test/tahi_02_205.c create mode 100644 test/regression/tahi_test/tahi_02_206.c create mode 100644 test/regression/tahi_test/tahi_02_207.c create mode 100644 test/regression/tahi_test/tahi_02_208.c create mode 100644 test/regression/tahi_test/tahi_02_209.c create mode 100644 test/regression/tahi_test/tahi_02_210.c create mode 100644 test/regression/tahi_test/tahi_02_211.c create mode 100644 test/regression/tahi_test/tahi_02_212.c create mode 100644 test/regression/tahi_test/tahi_02_213.c create mode 100644 test/regression/tahi_test/tahi_02_214.c create mode 100644 test/regression/tahi_test/tahi_02_215.c create mode 100644 test/regression/tahi_test/tahi_02_216.c create mode 100644 test/regression/tahi_test/tahi_02_217.c create mode 100644 test/regression/tahi_test/tahi_02_218.c create mode 100644 test/regression/tahi_test/tahi_02_219.c create mode 100644 test/regression/tahi_test/tahi_02_220.c create mode 100644 test/regression/tahi_test/tahi_02_221.c create mode 100644 test/regression/tahi_test/tahi_02_222.c create mode 100644 test/regression/tahi_test/tahi_02_223.c create mode 100644 test/regression/tahi_test/tahi_02_224.c create mode 100644 test/regression/tahi_test/tahi_02_225.c create mode 100644 test/regression/tahi_test/tahi_02_226.c create mode 100644 test/regression/tahi_test/tahi_02_227.c create mode 100644 test/regression/tahi_test/tahi_02_228.c create mode 100644 test/regression/tahi_test/tahi_02_229.c create mode 100644 test/regression/tahi_test/tahi_02_230.c create mode 100644 test/regression/tahi_test/tahi_02_231.c create mode 100644 test/regression/tahi_test/tahi_02_232.c create mode 100644 test/regression/tahi_test/tahi_02_233.c create mode 100644 test/regression/tahi_test/tahi_02_234.c create mode 100644 test/regression/tahi_test/tahi_02_235.c create mode 100644 test/regression/tahi_test/tahi_02_236.c create mode 100644 test/regression/tahi_test/tahi_03_001.c create mode 100644 test/regression/tahi_test/tahi_03_002.c create mode 100644 test/regression/tahi_test/tahi_03_003.c create mode 100644 test/regression/tahi_test/tahi_03_004.c create mode 100644 test/regression/tahi_test/tahi_03_005.c create mode 100644 test/regression/tahi_test/tahi_03_006.c create mode 100644 test/regression/tahi_test/tahi_03_007.c create mode 100644 test/regression/tahi_test/tahi_03_008.c create mode 100644 test/regression/tahi_test/tahi_03_009.c create mode 100644 test/regression/tahi_test/tahi_03_010.c create mode 100644 test/regression/tahi_test/tahi_03_011.c create mode 100644 test/regression/tahi_test/tahi_03_012.c create mode 100644 test/regression/tahi_test/tahi_03_013.c create mode 100644 test/regression/tahi_test/tahi_03_014.c create mode 100644 test/regression/tahi_test/tahi_03_015.c create mode 100644 test/regression/tahi_test/tahi_03_016.c create mode 100644 test/regression/tahi_test/tahi_03_017.c create mode 100644 test/regression/tahi_test/tahi_03_018.c create mode 100644 test/regression/tahi_test/tahi_03_019.c create mode 100644 test/regression/tahi_test/tahi_03_020.c create mode 100644 test/regression/tahi_test/tahi_03_021.c create mode 100644 test/regression/tahi_test/tahi_03_022.c create mode 100644 test/regression/tahi_test/tahi_03_023.c create mode 100644 test/regression/tahi_test/tahi_03_024.c create mode 100644 test/regression/tahi_test/tahi_03_025.c create mode 100644 test/regression/tahi_test/tahi_03_026.c create mode 100644 test/regression/tahi_test/tahi_03_027.c create mode 100644 test/regression/tahi_test/tahi_03_028.c create mode 100644 test/regression/tahi_test/tahi_03_029.c create mode 100644 test/regression/tahi_test/tahi_03_030.c create mode 100644 test/regression/tahi_test/tahi_03_031.c create mode 100644 test/regression/tahi_test/tahi_03_032.c create mode 100644 test/regression/tahi_test/tahi_03_033.c create mode 100644 test/regression/tahi_test/tahi_03_034.c create mode 100644 test/regression/tahi_test/tahi_03_035.c create mode 100644 test/regression/tahi_test/tahi_03_036.c create mode 100644 test/regression/tahi_test/tahi_03_037.c create mode 100644 test/regression/tahi_test/tahi_03_038.c create mode 100644 test/regression/tahi_test/tahi_03_039.c create mode 100644 test/regression/tahi_test/tahi_03_040.c create mode 100644 test/regression/tahi_test/tahi_03_041.c create mode 100644 test/regression/tahi_test/tahi_03_042.c create mode 100644 test/regression/tahi_test/tahi_03_043.c create mode 100644 test/regression/tahi_test/tahi_03_044.c create mode 100644 test/regression/tahi_test/tahi_03_045.c create mode 100644 test/regression/tahi_test/tahi_04_002.c create mode 100644 test/regression/tahi_test/tahi_04_003.c create mode 100644 test/regression/tahi_test/tahi_04_004.c create mode 100644 test/regression/tahi_test/tahi_04_005.c create mode 100644 test/regression/tahi_test/tahi_04_006.c create mode 100644 test/regression/tahi_test/tahi_04_007.c create mode 100644 test/regression/tahi_test/tahi_04_008.c create mode 100644 test/regression/tahi_test/tahi_04_009.c create mode 100644 test/regression/tahi_test/tahi_04_010.c create mode 100644 test/regression/tahi_test/tahi_04_011.c create mode 100644 test/regression/tahi_test/tahi_04_012.c create mode 100644 test/regression/tahi_test/tahi_04_013.c create mode 100644 test/regression/tahi_test/tahi_04_014.c create mode 100644 test/regression/tahi_test/tahi_04_015.c create mode 100644 test/regression/tahi_test/tahi_04_016.c create mode 100644 test/regression/tahi_test/tahi_05_002.c create mode 100644 test/regression/tahi_test/tahi_05_003.c create mode 100644 test/regression/tahi_test/tahi_05_004.c create mode 100644 test/regression/tahi_test/tahi_05_005.c create mode 100644 test/regression/tahi_test/tahi_05_006.c create mode 100644 test/regression/tahi_test/tahi_05_007.c create mode 100644 test/regression/tahi_test/tahi_05_008.c create mode 100644 test/regression/tahi_test/tahi_05_009.c create mode 100644 test/regression/tahi_test/tahi_05_010.c create mode 100644 test/regression/tahi_test/tahi_05_012.c create mode 100644 test/regression/tahi_test/tahi_05_013.c create mode 100644 test/regression/tahi_test/tahi_05_014.c create mode 100644 test/regression/tahi_test/tahi_05_015.c create mode 100644 test/regression/tahi_test/tahi_05_017.c create mode 100644 test/regression/tahi_test/tahi_05_018.c create mode 100644 test/regression/tahi_test/tahi_05_020.c create mode 100644 test/regression/tahi_test/tahi_05_021.c create mode 100644 test/regression/tahi_test/tahi_05_022.c create mode 100644 test/regression/tahi_test/tahi_05_024.c create mode 100644 test/regression/tahi_test/tahi_05_025.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_001.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_002.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_003.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_004.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_005.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_006.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_007.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_008.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_009.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_010.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_011.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_012.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_013.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_014.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_019.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_020.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_021.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_022.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_023.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_024.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_025.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_026.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_027.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_028.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_029.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_030.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_031.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_032.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_033.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_034.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_035.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_036.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_037.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_038.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_039.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_040.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_041.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_042.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_043.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_044.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_045.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_046.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_047.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_048.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_049.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_050.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_051.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_052.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_053.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_054.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_055.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_056.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_057.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_058.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_059.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_060.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_061.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_062.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_063.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_064.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_065.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_066.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_067.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_068.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_069.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_070.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_071.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_072.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_073.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_074.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_075.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_076.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_077.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_078.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_079.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_080.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_081.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_082.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_083.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_084.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_085.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_086.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_087.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_088.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_089.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_090.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_091.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_092.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_093.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_094.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_095.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_096.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_097.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_098.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_01_099.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_002.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_003.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_004.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_005.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_006.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_007.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_008.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_009.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_010.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_012.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_013.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_014.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_015.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_016.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_017.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_018.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_019.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_020.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_021.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_022.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_026.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_04_027.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_002.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_003.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_004.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_005.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_006.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_007.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_008.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_009.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_010.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_011.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_012.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_013.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_014.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_015.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_016.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_017.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_018.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_019.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_020.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_021.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_022.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_023.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_024.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_025.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_026.c create mode 100644 test/regression/tahi_test/tahi_dhcpv6_07_027.c create mode 100644 test/regression/tahi_test/tahi_ipsec_001.c create mode 100644 test/regression/tahi_test/tahi_ipsec_002.c create mode 100644 test/regression/tahi_test/tahi_ipsec_003.c create mode 100644 test/regression/tahi_test/tahi_ipsec_004.c create mode 100644 test/regression/tahi_test/tahi_ipsec_005.c create mode 100644 test/regression/tahi_test/tahi_ipsec_006.c create mode 100644 test/regression/tahi_test/tahi_ipsec_007.c create mode 100644 test/regression/tahi_test/tahi_ipsec_008.c create mode 100644 test/regression/tahi_test/tahi_ipsec_008_02.c create mode 100644 test/regression/tahi_test/tahi_ipsec_009.c create mode 100644 test/regression/tahi_test/tahi_ipsec_009_02.c create mode 100644 test/regression/tahi_test/tahi_ipsec_010.c create mode 100644 test/regression/tahi_test/tahi_ipsec_012.c create mode 100644 test/regression/tahi_test/tahi_ipsec_013.c create mode 100644 test/regression/tahi_test/tahi_ipsec_014.c create mode 100644 test/regression/tahi_test/tahi_ipsec_015.c create mode 100644 test/regression/tahi_test/tahi_ipsec_016.c create mode 100644 test/regression/tahi_test/tahi_ipsec_017.c create mode 100644 test/regression/tahi_test/tahi_ipsec_018.c create mode 100644 test/regression/tahi_test/tahi_ipsec_019.c create mode 100644 test/regression/tahi_test/tahi_ipsec_022.c create mode 100644 test/regression/tahi_test/tahi_ipsec_023.c create mode 100644 test/regression/tahi_test/tahi_ipsec_024.c create mode 100644 test/regression/tahi_test/tahi_ipsec_025.c create mode 100644 test/regression/tahi_test/tahi_ipsec_026.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_001.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_002.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_004.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_005.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_006.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_007.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_008.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_009.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_009_02.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_010.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_011.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_012.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_013.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_014.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_015.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_016.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_017.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_018.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_019.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_022.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_023.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_024.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_025.c create mode 100644 test/regression/tahi_test/tahi_ipsec_udp_026.c create mode 100644 test/regression/telnet_test/netx_telnet_activity_timeout_test.c create mode 100644 test/regression/telnet_test/netx_telnet_basic_test.c create mode 100644 test/regression/telnet_test/netx_telnet_create_packet_pool_test.c create mode 100644 test/regression/telnet_test/netx_telnet_max_connections_test.c create mode 100644 test/regression/telnet_test/netx_telnet_rst_test.c create mode 100644 test/regression/telnet_test/netx_telnet_server_bad_option_reply_test.c create mode 100644 test/regression/telnet_test/netx_telnet_server_options_negotiate_test.c create mode 100644 test/regression/telnet_test/netx_telnet_two_listen_test.c create mode 100644 test/regression/test/netxtestcontrol.c create mode 100644 test/regression/test/netxtestcontrol.h create mode 100644 test/regression/test/nx_ram_network_driver_test_1500.c create mode 100644 test/regression/test/nx_ram_network_driver_test_1500.h create mode 100644 test/regression/tftp_test/netx_tftp_basic_test.c create mode 100644 test/regression/tftp_test/netx_tftp_error_destionation_port_test.c create mode 100644 test/regression/tftp_test/netx_tftp_error_file_name_test.c create mode 100644 test/regression/tftp_test/netx_tftp_ipv6_basic_test.c create mode 100644 test/regression/tftp_test/netx_tftp_large_data_test.c create mode 100644 test/regression/tftp_test/netx_tftp_malformed_packet_test.c create mode 100644 test/regression/tftp_test/netx_tftp_read_interaction_test.c create mode 100644 test/regression/tftp_test/netx_tftp_write_interaction_test.c create mode 100644 test/regression/web_test/ecc_certs.c create mode 100644 test/regression/web_test/http_digest_authentication.c create mode 100644 test/regression/web_test/netx_https_api_test.c create mode 100644 test/regression/web_test/netx_https_testcontrol.c create mode 100644 test/regression/web_test/netx_web_abnormal_test.c create mode 100644 test/regression/web_test/netx_web_basic_authenticate_empty_test.c create mode 100644 test/regression/web_test/netx_web_basic_authenticate_test.c create mode 100644 test/regression/web_test/netx_web_basic_ecc_test.c create mode 100644 test/regression/web_test/netx_web_basic_test.c create mode 100644 test/regression/web_test/netx_web_certifiacte_verify_test.c create mode 100644 test/regression/web_test/netx_web_chunked_request_additional_test.c create mode 100644 test/regression/web_test/netx_web_chunked_request_test.c create mode 100644 test/regression/web_test/netx_web_chunked_response_packet_chain_test.c create mode 100644 test/regression/web_test/netx_web_chunked_response_process_test.c create mode 100644 test/regression/web_test/netx_web_chunked_response_test.c create mode 100644 test/regression/web_test/netx_web_client_cleanup_test.c create mode 100644 test/regression/web_test/netx_web_client_receive_no_packet_test.c create mode 100644 test/regression/web_test/netx_web_client_rst_test.c create mode 100644 test/regression/web_test/netx_web_client_send_fail_test.c create mode 100644 test/regression/web_test/netx_web_concurrent_sessions_test.c create mode 100644 test/regression/web_test/netx_web_connect_three_times_test.c create mode 100644 test/regression/web_test/netx_web_delete_basic_test.c create mode 100644 test/regression/web_test/netx_web_digest_authenticate_test.c create mode 100644 test/regression/web_test/netx_web_digest_authenticate_test2.c create mode 100644 test/regression/web_test/netx_web_digest_authenticate_timeout_test.c create mode 100644 test/regression/web_test/netx_web_external_client_test.c create mode 100644 test/regression/web_test/netx_web_external_server_chunked_test.c create mode 100644 test/regression/web_test/netx_web_external_server_test.c create mode 100644 test/regression/web_test/netx_web_get_content_length_test.c create mode 100644 test/regression/web_test/netx_web_get_put_referred_URI_test.c create mode 100644 test/regression/web_test/netx_web_head_basic_test.c create mode 100644 test/regression/web_test/netx_web_host_field_test.c create mode 100644 test/regression/web_test/netx_web_http_demo_test.c create mode 100644 test/regression/web_test/netx_web_https_demo_test.c create mode 100644 test/regression/web_test/netx_web_if_modified_since_test.c create mode 100644 test/regression/web_test/netx_web_invalid_release_test.c create mode 100644 test/regression/web_test/netx_web_keep_alive_abnormal_test.c create mode 100644 test/regression/web_test/netx_web_keep_alive_test.c create mode 100644 test/regression/web_test/netx_web_multipart_fragment_test.c create mode 100644 test/regression/web_test/netx_web_multipart_underflow_test.c create mode 100644 test/regression/web_test/netx_web_multiple_sessions_test.c create mode 100644 test/regression/web_test/netx_web_multiple_sessions_timeout_test.c create mode 100644 test/regression/web_test/netx_web_non_block_basic_test.c create mode 100644 test/regression/web_test/netx_web_non_block_reconnect_test.c create mode 100644 test/regression/web_test/netx_web_one_session_test.c create mode 100644 test/regression/web_test/netx_web_packet_allocate_test.c create mode 100644 test/regression/web_test/netx_web_post_basic_test.c create mode 100644 test/regression/web_test/netx_web_post_long_message_test.c create mode 100644 test/regression/web_test/netx_web_put_basic_test.c create mode 100644 test/regression/web_test/netx_web_request_in_multiple_packets_test.c create mode 100644 test/regression/web_test/netx_web_response_in_multiple_packets_test.c create mode 100644 test/regression/web_test/netx_web_secure_connect_fail_test.c create mode 100644 test/regression/web_test/netx_web_secure_reconnect_test.c create mode 100644 test/regression/web_test/netx_web_server_chunked_content_process_test.c create mode 100644 test/regression/web_test/netx_web_server_content_process_test.c create mode 100644 test/regression/web_test/netx_web_server_type_get_extended_test.c create mode 100644 test/regression/web_test/netx_web_status_400_test.c create mode 100644 test/regression/web_test/netx_web_status_404_test.c create mode 100644 test/regression/web_test/netx_web_status_501_test.c create mode 100644 test/regression/web_test/netx_web_status_code_test.c create mode 100644 test/regression/web_test/netx_web_tcpserver_rst_test.c create mode 100644 test/regression/web_test/netx_web_tcpserver_tls_fail_rst_test.c create mode 100644 test/regression/web_test/netx_web_tcpserver_two_listen_test.c create mode 100644 test/regression/web_test/test_ca_cert.c create mode 100644 test/regression/web_test/test_device_cert.c create mode 100644 test/regression/web_test/test_utility.h create mode 100644 test/regression/websocket_test/netx_websocket_16_bit_payload_length_test.c create mode 100644 test/regression/websocket_test/netx_websocket_common_process.c create mode 100644 test/regression/websocket_test/netx_websocket_connect_test.c create mode 100644 test/regression/websocket_test/netx_websocket_delete_test.c create mode 100644 test/regression/websocket_test/netx_websocket_disconnect_test.c create mode 100644 test/regression/websocket_test/netx_websocket_fin_test.c create mode 100644 test/regression/websocket_test/netx_websocket_mask_test.c create mode 100644 test/regression/websocket_test/netx_websocket_multi_instance_test.c create mode 100644 test/regression/websocket_test/netx_websocket_non_block_test.c create mode 100644 test/regression/websocket_test/netx_websocket_one_frame_in_packets_test.c create mode 100644 test/regression/websocket_test/netx_websocket_one_packet_with_multi_frames_test.c create mode 100644 test/regression/websocket_test/netx_websocket_opcode_test.c create mode 100644 test/regression/websocket_test/netx_websocket_send_chain_packets_test.c diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..9b4fdaf1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "image": "ghcr.io/tiejunms/azure_rtos_docker", + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools" + ], + + "remoteUser": "vscode", + + "runArgs": [ "--cap-add=NET_ADMIN"] +} \ No newline at end of file diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml new file mode 100644 index 00000000..0e19b390 --- /dev/null +++ b/.github/workflows/regression_test.yml @@ -0,0 +1,43 @@ +# This is a basic workflow that is manually triggered + +name: regression_test + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + workflow_dispatch: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + nxd: + permissions: + contents: read + issues: read + checks: write + pull-requests: write + pages: write + id-token: write + uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master + with: + build_script: ./scripts/build_nxd.sh + test_script: ./scripts/test_nxd.sh + cmake_path: ./test/cmake/netxduo + result_affix: NetXDuo + skip_deploy: true + deploy: + permissions: + contents: read + issues: read + checks: write + pull-requests: write + pages: write + id-token: write + needs: [nxd] + uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master + with: + skip_test: true + deploy_list: "NetXDuo" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9c33dc7f..2d01435e 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .vscode/ _deps/ build/ +coverage_report/ CMakeFiles/ CMakeScripts/ CMakeLists.txt.user @@ -11,4 +12,5 @@ cmake_install.cmake install_manifest.txt compile_commands.json CTestTestfile.cmake +.run.sh diff --git a/addons/azure_iot/nx_azure_iot.c b/addons/azure_iot/nx_azure_iot.c index eef8bf8a..b9df5a98 100644 --- a/addons/azure_iot/nx_azure_iot.c +++ b/addons/azure_iot/nx_azure_iot.c @@ -420,6 +420,7 @@ UINT status; /* Do nothing if the client is not connected. */ if (client_ptr -> nxd_mqtt_client_state != NXD_MQTT_CLIENT_STATE_CONNECTED) { + tx_mutex_put(client_ptr -> nxd_mqtt_client_mutex_ptr); LogError(LogLiteralArgs("MQTT NOT CONNECTED")); return(NX_AZURE_IOT_DISCONNECTED); } diff --git a/addons/azure_iot/nx_azure_iot_adu_agent.c b/addons/azure_iot/nx_azure_iot_adu_agent.c index ed80ea63..47d8750a 100644 --- a/addons/azure_iot/nx_azure_iot_adu_agent.c +++ b/addons/azure_iot/nx_azure_iot_adu_agent.c @@ -1745,8 +1745,8 @@ static UINT nx_azure_iot_adu_agent_jws_split(UCHAR *jws, UINT jws_length, UCHAR **signature, UINT *signature_length) { -UCHAR *dot1_pointer; -UCHAR *dot2_pointer; +UCHAR *dot1_pointer = jws; +UCHAR *dot2_pointer = jws; UINT dot_count = 0; UINT i = 0; diff --git a/samples/demo_netxduo_snmp.c b/samples/demo_netxduo_snmp.c index ede9b484..85f580cb 100644 --- a/samples/demo_netxduo_snmp.c +++ b/samples/demo_netxduo_snmp.c @@ -453,6 +453,17 @@ UINT status; if (mib2_mib[i].object_set_callback) { + /* If the object data type is string. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_ANS1_OCTET_STRING) + { + + /* Check the string length of the object value. */ + if (object_data -> nx_snmp_object_octet_string_size > mib2_mib[i].length) + { + return(NX_SNMP_ERROR_TOOBIG); + } + } + /* Yes, call the set function. */ status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); } diff --git a/samples/demo_snmp_helper.h b/samples/demo_snmp_helper.h index a9a14e08..73279c7c 100644 --- a/samples/demo_snmp_helper.h +++ b/samples/demo_snmp_helper.h @@ -46,7 +46,7 @@ ULONG ipDefaultTTL = NX_IP_TIME_TO_LIVE; /* ipDefault underlying application driver, but for now simple defaults are used. */ ULONG ifLastChange = 2048; /* ifLastChange:TimeTicks RO */ ULONG ifInOctets = 155; /* ifInOctets:Counter RO */ -ULONG ifInUcastPkts = 0; /* ifInUcastPkts:Counter RO */ +ULONG64 ifInUcastPkts = 0; /* ifInUcastPkts:Counter RO */ UCHAR ifDescr[] = "NetX Physical Interface"; /* ifDescr:OctetString RO */ /* Define the MIB-2 "address translation" group, assuming one address translation. */ @@ -62,31 +62,31 @@ MIB_ENTRY mib2_mib[] = { /* OBJECT ID OBJECT VARIABLE GET ROUTINE/ GET_OCTET_ROUTINE SET ROUTINE LENGTH */ - {(UCHAR *) "1.3.6.1.2.1.1.1.0", sysDescr, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.1.2.0", sysObjectID, nx_snmp_object_id_get, NX_NULL, NX_NULL, 0}, - {(UCHAR *) "1.3.6.1.2.1.1.3.0", &sysUpTime, nx_snmp_object_timetics_get, NX_NULL, NX_NULL, 0}, - {(UCHAR *) "1.3.6.1.2.1.1.4.0", sysContact, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.1.5.0", sysName, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.1.6.0", sysLocation, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.1.7.0", &sysServices, nx_snmp_object_integer_get, NX_NULL, NX_NULL, 0}, + {(UCHAR *) "1.3.6.1.2.1.1.1.0", sysDescr, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysDescr)}, + {(UCHAR *) "1.3.6.1.2.1.1.2.0", sysObjectID, nx_snmp_object_id_get, NX_NULL, NX_NULL, sizeof(sysObjectID)}, + {(UCHAR *) "1.3.6.1.2.1.1.3.0", &sysUpTime, nx_snmp_object_timetics_get, NX_NULL, NX_NULL, sizeof(sysUpTime)}, + {(UCHAR *) "1.3.6.1.2.1.1.4.0", sysContact, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysContact)}, + {(UCHAR *) "1.3.6.1.2.1.1.5.0", sysName, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysName)}, + {(UCHAR *) "1.3.6.1.2.1.1.6.0", sysLocation, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysLocation)}, + {(UCHAR *) "1.3.6.1.2.1.1.7.0", &sysServices, nx_snmp_object_integer_get, NX_NULL, NX_NULL, sizeof(sysServices)}, - {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.0", &atNetworkAddress, nx_snmp_object_ip_address_get, NX_NULL, nx_snmp_object_ip_address_set, 0}, + {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.0", &atNetworkAddress, nx_snmp_object_ip_address_get, NX_NULL, nx_snmp_object_ip_address_set, sizeof(atNetworkAddress)}, #ifdef FEATURE_NX_IPV6 /* Either GET method should work. IPv6 addresses are handled as octet strings and accept any IPv6 address format e.g. addresses with '::'s are accepted as is. */ - {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.1", &atIPv6NetworkAddress, nx_snmp_object_ipv6_address_get, NX_NULL, nx_snmp_object_ipv6_address_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.2", &atIPv6NetworkAddress, NX_NULL, nx_snmp_object_octet_string_get, nx_snmp_object_octet_string_set, 0}, + {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.1", &atIPv6NetworkAddress, nx_snmp_object_ipv6_address_get, NX_NULL, nx_snmp_object_ipv6_address_set, sizeof(atIPv6NetworkAddress)}, + {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.2", &atIPv6NetworkAddress, NX_NULL, nx_snmp_object_octet_string_get, nx_snmp_object_octet_string_set, sizeof(atIPv6NetworkAddress)}, #endif - {(UCHAR *) "1.3.6.1.2.1.2.2.1.2.0", ifDescr, nx_snmp_object_string_get, NX_NULL, NX_NULL, 0}, - {(UCHAR *) "1.3.6.1.2.1.3.1.1.2.0", &atPhysAddress, NX_NULL, nx_snmp_object_octet_string_get, nx_snmp_object_octet_string_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.2.2.1.9.0", &ifLastChange, nx_snmp_object_timetics_get, NX_NULL, nx_snmp_object_timetics_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.2.2.1.10.0", &ifInOctets, nx_snmp_object_counter_get, NX_NULL, nx_snmp_object_counter_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.2.2.1.11.0", &ifInUcastPkts, nx_snmp_object_counter64_get, NX_NULL, nx_snmp_object_counter64_set, 0}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.2.0", ifDescr, nx_snmp_object_string_get, NX_NULL, NX_NULL, sizeof(ifDescr)}, + {(UCHAR *) "1.3.6.1.2.1.3.1.1.2.0", &atPhysAddress, NX_NULL, nx_snmp_object_octet_string_get, nx_snmp_object_octet_string_set, sizeof(atPhysAddress)}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.9.0", &ifLastChange, nx_snmp_object_timetics_get, NX_NULL, nx_snmp_object_timetics_set, sizeof(ifLastChange)}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.10.0", &ifInOctets, nx_snmp_object_counter_get, NX_NULL, nx_snmp_object_counter_set, sizeof(ifInOctets)}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.11.0", &ifInUcastPkts, nx_snmp_object_counter64_get, NX_NULL, nx_snmp_object_counter64_set, sizeof(ifInUcastPkts)}, - {(UCHAR *) "1.3.6.1.2.1.4.1.0", &ipForwarding, nx_snmp_object_integer_get, NX_NULL, nx_snmp_object_integer_set, 0}, - {(UCHAR *) "1.3.6.1.2.1.4.2.0", &ipDefaultTTL, nx_snmp_object_integer_get, NX_NULL, NX_NULL, 0}, + {(UCHAR *) "1.3.6.1.2.1.4.1.0", &ipForwarding, nx_snmp_object_integer_get, NX_NULL, nx_snmp_object_integer_set, sizeof(ipForwarding)}, + {(UCHAR *) "1.3.6.1.2.1.4.2.0", &ipDefaultTTL, nx_snmp_object_integer_get, NX_NULL, NX_NULL, sizeof(ipDefaultTTL)}, - {(UCHAR *) "1.3.6.1.7", (UCHAR *) "1.3.6.1.7", nx_snmp_object_end_of_mib, NX_NULL, NX_NULL, 0}, + {(UCHAR *) "1.3.6.1.7", (UCHAR *) "1.3.6.1.7", nx_snmp_object_end_of_mib, NX_NULL, NX_NULL, sizeof("1.3.6.1.7") - 1}, {NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, 0} }; diff --git a/scripts/build_nxd.sh b/scripts/build_nxd.sh new file mode 100755 index 00000000..d9948699 --- /dev/null +++ b/scripts/build_nxd.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +$(dirname `realpath $0`)/../test/cmake/netxduo/run.sh build default_build_coverage v4_full_build v6_full_build diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 00000000..25da84ce --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# + +# Remove large folder +rm -rf /opt/hostedtoolcache + +# Install necessary softwares for Ubuntu. + +sudo dpkg --add-architecture i386 +sudo apt-get update +sudo apt-get install -y \ + gcc-multilib \ + git \ + g++ \ + python3-pip \ + ninja-build \ + unifdef \ + p7zip-full \ + tofrodos \ + dos2unix \ + gawk \ + libssl-dev:i386 \ + software-properties-common + +wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - +CODENAME=$(lsb_release -c | cut -f2 -d':' | sed 's/\t//') +apt-add-repository "deb https://apt.kitware.com/ubuntu/ $CODENAME main" + +python3 -m pip install --upgrade pip +pip3 install gcovr==4.1 +pip install --upgrade cmake + diff --git a/scripts/test_nxd.sh b/scripts/test_nxd.sh new file mode 100755 index 00000000..aad1f8bd --- /dev/null +++ b/scripts/test_nxd.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo/run.sh test default_build_coverage v4_full_build diff --git a/test/cmake/.gitignore b/test/cmake/.gitignore new file mode 100644 index 00000000..58bc3cea --- /dev/null +++ b/test/cmake/.gitignore @@ -0,0 +1,2 @@ +threadx +filex \ No newline at end of file diff --git a/test/cmake/libs/CMakeLists.txt b/test/cmake/libs/CMakeLists.txt new file mode 100644 index 00000000..4552fcbb --- /dev/null +++ b/test/cmake/libs/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) + +project(libs LANGUAGES C) + +if($ENV{ENABLE_64}) + message(STATUS "Building for 64bit") +else() + add_compile_options(-m32) + add_link_options(-m32) + message(STATUS "Building for 32bit") +endif() +message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}.") + +set(TX_USER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/tx_user.h) +get_filename_component( + externals ${CMAKE_CURRENT_SOURCE_DIR}/../.. ABSOLUTE) +add_subdirectory(${externals}/threadx threadx) +add_subdirectory(${externals}/filex filex) +target_compile_options(threadx PRIVATE -DTX_ENABLE_EVENT_TRACE) +if(NOT DEFINED ENV{ENABLE_IDLE}) + target_compile_options(threadx PRIVATE -DTX_LINUX_NO_IDLE_ENABLE) +endif() + +foreach(lib threadx filex) + get_target_property(dirs ${lib} INCLUDE_DIRECTORIES) + execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc) + foreach(dir ${dirs}) + file(GLOB header_files ${dir}/*.h) + foreach(header_file ${header_files}) + execute_process(COMMAND ln -sf ${header_file} ${CMAKE_BINARY_DIR}/inc) + endforeach() + endforeach() +endforeach() \ No newline at end of file diff --git a/test/cmake/libs/tx_user.h b/test/cmake/libs/tx_user.h new file mode 100644 index 00000000..99dcb050 --- /dev/null +++ b/test/cmake/libs/tx_user.h @@ -0,0 +1,56 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** User Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_user.h PORTABLE C */ +/* 6.0 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains user defines for configuring ThreadX in specific */ +/* ways. This file will have an effect only if the application and */ +/* ThreadX library are built with TX_INCLUDE_USER_DEFINE_FILE defined. */ +/* Note that all the defines in this file may also be made on the */ +/* command line when building ThreadX library and application objects. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* */ +/**************************************************************************/ + +#ifndef TX_USER_H +#define TX_USER_H + +#define TX_THREAD_USER_EXTENSION int bsd_errno; + +#endif \ No newline at end of file diff --git a/test/cmake/netxduo/CMakeLists.txt b/test/cmake/netxduo/CMakeLists.txt new file mode 100644 index 00000000..6ecaa22f --- /dev/null +++ b/test/cmake/netxduo/CMakeLists.txt @@ -0,0 +1,565 @@ +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0057 NEW) +cmake_policy(SET CMP0077 NEW) + +project(netxduo_test LANGUAGES C) + +# Set build configurations +set(BUILD_CONFIGURATIONS + default_build_coverage + dhcp_default_build_coverage + dns_default_build_coverage + v4_build + v4_dns_cache_build + v4_no_checksum_build + v4_physical_48_build + v4_small_build + v4_packet_pad_build + v4_full_build + v4_no_frag_build + v4_no_check_build + v4_no_reset_disconn_build + v4_dual_pool_build + v4_no_chain_build + v4_link_cap_build + v4_address_check_build + v4_ipsec_build + v4_ipsec_dual_pool_build + v4_ipsec_packet_pad_build + v4_ipsec_small_build + v4_ipsec_full_build + v4_ipsec_no_frag_build + v4_ipsec_no_chain_build + v4_ipsec_no_check_build + v4_ipsec_no_reset_disconn_build + v4_ipsec_link_cap_build + v6_build + v6_only_build + v6_only_link_cap_build + v6_no_checksum_build + v6_dual_pool_build + v6_packet_pad_build + v6_physical_48_build + v6_small_nd_cache_build + v6_small_build + v6_full_build + v6_no_frag_build + v6_pmtu_no_frag_build + v6_no_chain_build + v6_no_dad_build + v6_no_check_build + v6_no_icmpv6_error_build + v6_no_reset_disconn_build + v6_link_cap_build + v6_address_change_build + v6_multicast_build + v6_no_rs_build + v6_ipsec_build + v6_ipsec_dual_pool_build + v6_ipsec_packet_pad_build + v6_ipsec_tahi_build + v6_ipsec_small_build + v6_ipsec_full_build + v6_ipsec_full_tahi_build + v6_ipsec_no_frag_build + v6_ipsec_no_chain_build + v6_ipsec_no_dad_build + v6_ipsec_no_check_build + v6_ipsec_no_check_tahi_build + v6_ipsec_no_icmpv6_error_build + v6_ipsec_no_reset_disconn_build + v6_ipsec_no_reset_disconn_tahi_build + v6_ipsec_link_cap_build + v6_dhcp_tahi_build + v6_bsd_raw_build + v6_full_secure_build + optimize_build) +set(CMAKE_CONFIGURATION_TYPES + ${BUILD_CONFIGURATIONS} + CACHE STRING "list of supported configuration types" FORCE) +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + ${CMAKE_CONFIGURATION_TYPES}) +list(GET CMAKE_CONFIGURATION_TYPES 0 BUILD_TYPE) +if((NOT CMAKE_BUILD_TYPE) OR (NOT ("${CMAKE_BUILD_TYPE}" IN_LIST + CMAKE_CONFIGURATION_TYPES))) + set(CMAKE_BUILD_TYPE + "${BUILD_TYPE}" + CACHE STRING "Build Type of the project" FORCE) +endif() + +if(NOT PRODUCT) + set(PRODUCT netxduo) +endif() + +message(STATUS "Build for ${PRODUCT}") +message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}.") + +set(IPV4 -DNX_DISABLE_IPV6) +set(DISABLE_RX_CHECKSUM + -DNX_DISABLE_ICMPV4_RX_CHECKSUM -DNX_DISABLE_ICMPV6_RX_CHECKSUM + -DNX_DISABLE_IP_RX_CHECKSUM -DNX_DISABLE_TCP_RX_CHECKSUM + -DNX_DISABLE_UDP_RX_CHECKSUM) +set(DISABLE_TX_CHECKSUM + -DNX_DISABLE_ICMPV4_TX_CHECKSUM -DNX_DISABLE_ICMPV6_TX_CHECKSUM + -DNX_DISABLE_IP_TX_CHECKSUM -DNX_DISABLE_TCP_TX_CHECKSUM + -DNX_DISABLE_UDP_TX_CHECKSUM) +set(PHY_HEADER -DNX_PHYSICAL_HEADER=48) +set(NO_INFO + -DNX_DISABLE_ARP_INFO + -DNX_DISABLE_IP_INFO + -DNX_DISABLE_ICMP_INFO + -DNX_DISABLE_PACKET_INFO + -DNX_DISABLE_RARP_INFO + -DNX_DISABLE_TCP_INFO + -DNX_DISABLE_UDP_INFO) +set(NO_FRAG -DNX_DISABLE_FRAGMENTATION) +set(NO_CHECK -DTX_DISABLE_ERROR_CHECKING -DNX_DISABLE_ERROR_CHECKING) +set(NO_RESET_DISCONNECT -DNX_DISABLE_RESET_DISCONNECT) +set(NO_AUTO_ARP_ENTRY -DNX_DISABLE_ARP_AUTO_ENTRY) +set(IMME_ACK -DNX_TCP_ACK_EVERY_N_PACKETS=1) +set(NO_LOOPBACK -DNX_DISABLE_LOOPBACK_INTERFACE) +set(NO_RX_SIZE_CHECK -DNX_DISABLE_RX_SIZE_CHECKING) +set(NO_IGMPV2 -DNX_DISABLE_IGMPV2) +set(TCP_KEEPALIVE -DNX_ENABLE_TCP_KEEPALIVE -DNX_TCP_KEEPALIVE_INITIAL=60 + -DTCP_KEEPALIVE_RETRY -DNX_TCP_KEEPALIVE_RETRY=10) +set(TCP_WINDOW -DNX_ENABLE_TCP_WINDOW_SCALING) +set(IP_STATIC_ROUTING -DNX_ENABLE_IP_STATIC_ROUTING) +set(PACKET_ALIGNMENT -DNX_PACKET_ALIGNMENT=64) +set(MULTI_INTERFACE -DNX_MAX_PHYSICAL_INTERFACES=4 + -DNX_DHCP_CLIENT_MAX_RECORDS=2) +set(IMME_FRAG_ASSEMBLY -DNX_FRAGMENT_IMMEDIATE_ASSEMBLY) +set(MSS_CHECK -DNX_ENABLE_TCP_MSS_CHECK -DNX_TCP_MSS_MINIMUM=32) +set(TCP_QUEUE_NOTIFY -DNX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY) +set(ARP_EXPIRATION_RATE -DNX_ARP_EXPIRATION_RATE=5) +set(NAT -DNX_NAT_ENABLE) +set(IP_PACKET_FILTER -DNX_ENABLE_IP_PACKET_FILTER) +set(TRACE -DTX_ENABLE_EVENT_TRACE) +set(BSD + -D__suseconds_t_defined + -D_STRUCT_TIMEVAL + -D_SYS_SELECT_H + -DNX_ENABLE_EXTENDED_NOTIFY_SUPPORT + -DNX_BSD_SOCKET_QUEUE_MAX=20 + -DNX_BSD_ENABLE + -DNX_IPV6_NEIGHBOR_CACHE_SIZE=32 + -DNX_IPV6_DESTINATION_TABLE_SIZE=32 + -DNX_BSD_ENABLE_DNS + -DNX_DNS_ENABLE_EXTENDED_RR_TYPES) +set(TAHI -DNX_TAHI_ENABLE) +set(IPV6 -DFEATURE_NX_IPV6) +set(IPV6_PMTU_DISCOVERY -DNX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +set(IPSEC -DNX_IPSEC_ENABLE -DNX_ENABLE_CCS -DNX_IPSEC_ANTI_REPLAY_ENABLE + -DNX_IPSEC_ESN_ENABLE -DNX_IPSEC_ENBALE_DEBUG_LOG) +set(IPSEC_TAHI -DNX_IPSEC_ENABLE) +set(NO_DAD -DNX_DISABLE_IPV6_DAD) +set(NO_ICMPV6_ERROR -DNX_DISABLE_ICMPV6_ERROR_MESSAGE) +set(NO_CHAIN -DNX_DISABLE_PACKET_CHAIN -DNX_DISABLE_FRAGMENTATION) +set(LINK_CAP -DNX_ENABLE_INTERFACE_CAPABILITY) +set(ADDRESS_CHANGE_NOTIFY -DNX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY) +set(ADDRESS_CHECK -DNX_ENABLE_SOURCE_ADDRESS_CHECK + -DNX_ENABLE_ICMP_ADDRESS_CHECK) +set(MULTICAST -DNX_ENABLE_IPV6_MULTICAST) +set(LOW_WATERMARK -DNX_ENABLE_LOW_WATERMARK) +if(PRODUCT STREQUAL netxduo) + set(BSD_RAW ${BSD} -DNX_BSD_RAW_SUPPORT -DNX_ENABLE_IP_RAW_PACKET_FILTER + -DNX_BSD_RAW_PPPOE_SUPPORT -DNX_ENABLE_IP_RAW_PACKET_FILTER) + list(REMOVE_ITEM BSD_RAW -DNX_BSD_RAW_PPPOE_SUPPORT) + set(RAW_FILTER -DNX_ENABLE_IP_RAW_PACKET_FILTER) + set(RAW_ALL_STACK -DNX_ENABLE_IP_RAW_PACKET_ALL_STACK) +endif() +set(NO_REDIRECT_PROCESS -DNX_DISABLE_ICMPV6_REDIRECT_PROCESS) +set(NO_RA_PROCESS -DNX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) +set(NO_RS -DNX_DISABLE_ICMPV6_ROUTER_SOLICITATION) +set(STATELESS_AC -DNX_IPV6_STATELESS_AUTOCONFIG_CONTROL) +set(NO_PURGE_UNUSED_CACHE -DNX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES) +set(PACKET_PAD -DNX_PACKET_HEADER_PAD=4) +set(MSS_CHECK -DNX_ENABLE_TCP_MSS_CHECK -DNX_TCP_MSS_MINIMUM=32) +set(DUAL_POOL -DNX_ENABLE_DUAL_PACKET_POOL) +set(DHCPV6_TAHI -DNX_DHCPV6_TAHI_ENABLE) +set(MULTIPART -DNX_HTTP_MULTIPART_ENABLE) +set(PACKET_DEBUG -DNX_ENABLE_PACKET_DEBUG_INFO) +set(TCP_RX_LIMIT -DNX_TCP_MAX_OUT_OF_ORDER_PACKETS=8) +set(TELNET_MAX_CLIENTS -DNX_TELNET_MAX_CLIENTS=2) +set(TELNET_ACTIVITY_TIMEOUT -DNX_TELNET_ACTIVITY_TIMEOUT=10) +set(TELNET_TIMEOUT_PERIOD -DNX_TELNET_TIMEOUT_PERIOD=2) +set(CREATE_TELNET_PACKET_POOL -DNX_TELNET_SERVER_USER_CREATE_PACKET_POOL) +set(LCP_PROTOCOL_RETRIES -DNX_PPP_MAX_LCP_PROTOCOL_RETRIES=5) +set(IPCP_PROTOCOL_RETRIES -DNX_PPP_MAX_IPCP_PROTOCOL_RETRIES=5) +set(PREFIX_LIMIT -DNX_IPV6_PREFIX_LIST_TABLE_SIZE=4) +set(LARGE_DEST_TABLE -DNX_IPV6_DESTINATION_TABLE_SIZE=32) +set(ND_CACHE_LIMIT -DNX_IPV6_NEIGHBOR_CACHE_SIZE=8) +set(TX_RX_INTERFACE_CAPABILITY + -DNX_INTERFACE_CAPABILITY=NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM|NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM|NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM|NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM|NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM|NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM|NX_INTERFACE_CAPABILITY_IPV4_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_TCP_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_ICMPV6_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_IGMP_RX_CHECKSUM +) +set(RX_INTERFACE_CAPABILITY + -DNX_INTERFACE_CAPABILITY=NX_INTERFACE_CAPABILITY_IPV4_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_TCP_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_ICMPV6_RX_CHECKSUM|NX_INTERFACE_CAPABILITY_IGMP_RX_CHECKSUM +) +set(NO_INTERFACE_CAPABILITY -DNX_INTERFACE_CAPABILITY=0) +set(DHCP_ARP_PROBE -DNX_DHCP_CLIENT_SEND_ARP_PROBE) +set(NO_ASSERT -DNX_DISABLE_ASSERT) +set(NO_IPV4 -DNX_DISABLE_IPV4) +set(MDNS_IPV6 -DNX_MDNS_ENABLE_IPV6 -DFEATURE_NX_IPV6 + -DNX_ENABLE_IPV6_MULTICAST -DNX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY) +set(MDNS_NO_CLIENT -DNX_MDNS_DISABLE_CLIENT) +set(MDNS_NO_SERVER -DNX_MDNS_DISABLE_SERVER) +set(PPPOE -DNX_PPP_PPPOE_ENABLE -DNX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE + -DNX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) +set(PPPOE_CONTROL -DNX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) +set(HTTP_DIGEST -DNX_HTTP_DIGEST_ENABLE) +set(DHCP_RESTORE -DNX_DHCP_CLIENT_RESTORE_STATE) +set(DNS_CACHE -DNX_DNS_CACHE_ENABLE) +set(TCPIP_OFFLOAD -DNX_ENABLE_TCPIP_OFFLOAD ${LINK_CAP}) +set(ARP -DNX_ARP_DEFEND_BY_REPLY) +set(HTTP_PROXY -DNX_ENABLE_HTTP_PROXY) +set(RAND_ID -DNX_ENABLE_IP_ID_RANDOMIZATION) +set(PPP_COMPRESSION -DNX_PPP_COMPRESSION_ENABLE) + +set(v4_build ${IPV4} ${PACKET_DEBUG}) +set(v4_dns_cache_build ${IPV4} ${DNS_CACHE}) +set(v4_no_checksum_build ${IPV4} ${DISABLE_TX_CHECKSUM} ${DISABLE_RX_CHECKSUM}) +set(v4_physical_48_build ${IPV4} ${PHY_HEADER} ${MDNS_NO_CLIENT} ${PPPOE}) +set(v4_small_build + ${IPV4} + ${NO_INFO} + ${NO_FRAG} + ${NO_CHECK} + ${NO_RESET_DISCONNECT} + ${NO_AUTO_ARP_ENTRY} + ${IMME_ACK} + ${NO_LOOPBACK} + ${NO_RX_SIZE_CHECK} + ${NO_IGMPV2} + ${RAND_ID}) +set(v4_packet_pad_build ${IPV4} ${PACKET_ALIGNMENT}) +set(v4_full_build + ${IPV4} + ${TCP_KEEPALIVE} + ${TCP_WINDOW} + ${IP_STATIC_ROUTING} + ${BSD} + ${MULTI_INTERFACE} + ${IMME_FRAG_ASSEMBLY} + ${MSS_CHECK} + ${TCP_QUEUE_NOTIFY} + ${RAW_FILTER} + ${ARP_EXPIRATION_RATE} + ${MULTIPART} + ${NAT} + ${PACKET_DEBUG} + ${DUAL_POOL} + ${IP_PACKET_FILTER} + ${CREATE_TELNET_PACKET_POOL} + ${TELNET_MAX_CLIENTS} + ${TELNET_ACTIVITY_TIMEOUT} + ${TELNET_TIMEOUT_PERIOD} + ${LCP_PROTOCOL_RETRIES} + ${IPCP_PROTOCOL_RETRIES} + ${DHCP_ARP_PROBE} + ${TRACE} + ${DHCP_RESTORE} + ${DNS_CACHE} + ${ARP} + ${HTTP_PROXY} + ${PPP_COMPRESSION}) +set(v4_no_frag_build ${IPV4} ${NO_FRAG}) +set(v4_no_check_build ${IPV4} ${NO_CHECK}) +set(v4_no_reset_disconn_build ${IPV4} ${NO_RESET_DISCONNECT}) + +# netxduo only +set(v4_dual_pool_build ${IPV4} ${DUAL_POOL}) +set(v4_no_chain_build ${IPV4} ${NO_CHAIN} ${MDNS_NO_SERVER}) +set(v4_link_cap_build ${IPV4} ${LINK_CAP} ${RX_INTERFACE_CAPABILITY} + ${MULTI_INTERFACE} ${TCPIP_OFFLOAD}) +set(v4_address_check_build ${IPV4} ${ADDRESS_CHECK}) +set(v4_ipsec_build ${IPV4} ${IPSEC} ${PACKET_DEBUG}) +set(v4_ipsec_dual_pool_build ${IPV4} ${IPSEC} ${DUAL_POOL}) +set(v4_ipsec_packet_pad_build ${IPV4} ${IPSEC} ${PACKET_PAD}) +set(v4_ipsec_small_build + ${IPV4} + ${IPSEC} + ${NO_INFO} + ${NO_FRAG} + ${NO_CHECK} + ${NO_RESET_DISCONNECT} + ${MDNS_NO_CLIENT}) +set(v4_ipsec_full_build + ${IPV4} + ${IPSEC} + ${TCP_KEEPALIVE} + ${TCP_KEEPALIVE_INITIAL} + ${TCP_KEEPALIVE_RETRY} + ${TCP_KEEPALIVE_RETRIES} + ${TCP_WINDOW} + ${IP_STATIC_ROUTING} + ${BSD} + ${MULTI_INTERFACE} + ${MULTIPART} + ${NAT} + ${PACKET_DEBUG} + ${DUAL_POOL} + ${IP_PACKET_FILTER} + ${DHCP_ARP_PROBE}) +set(v4_ipsec_no_frag_build ${IPV4} ${IPSEC} ${NO_FRAG}) +set(v4_ipsec_no_chain_build ${IPV4} ${IPSEC} ${NO_CHAIN}) +set(v4_ipsec_no_check_build ${IPV4} ${IPSEC} ${NO_CHECK} ${BSD} + ${MULTI_INTERFACE} ${NAT}) +set(v4_ipsec_no_reset_disconn_build ${IPV4} ${IPSEC} ${NO_RESET_DISCONNECT} + ${MDNS_NO_SERVER}) +set(v4_ipsec_link_cap_build ${IPV4} ${IPSEC} ${LINK_CAP}) +set(v6_build ${IPV6}) +set(v6_only_build ${IPV6} ${NO_IPV4} ${TRACE} ${MDNS_NO_CLIENT}) +set(v6_only_link_cap_build ${IPV6} ${NO_IPV4} ${LINK_CAP}) +set(v6_no_checksum_build ${IPV6} ${DISABLE_TX_CHECKSUM} ${DISABLE_RX_CHECKSUM}) +set(v6_dual_pool_build ${IPV6} ${DUAL_POOL}) +set(v6_packet_pad_build ${IPV6} ${PACKET_PAD}) +set(v6_physical_48_build ${IPV6} ${PHY_HEADER} ${MDNS_NO_SERVER} ${PPPOE} ${PPPOE_CONTROL}) +set(v6_small_nd_cache_build ${IPV6} ${MULTI_INTERFACE} ${ND_CACHE_LIMIT} + ${NO_PURGE_UNUSED_CACHE} ${LARGE_DEST_TABLE}) +set(v6_small_build + ${IPV6} + ${NO_INFO} + ${NO_FRAG} + ${NO_DAD} + ${NO_CHECK} + ${NO_ICMPV6_ERROR} + ${NO_RESET_DISCONNECT} + ${NO_REDIRECT_PROCESS} + ${NO_RA_PROCESS} + ${NO_RS} + ${NO_PURGE_UNUSED_CACHE} + ${IMME_ACK} + ${NO_LOOPBACK} + ${NO_RX_SIZE_CHECK} + ${PACKET_ALIGNMENT} + ${PREFIX_LIMIT} + ${MDNS_NO_SERVER} + ${RAND_ID}) +set(v6_full_build + ${IPV6} + ${IPV6_PMTU_DISCOVERY} + ${TCP_KEEPALIVE} + ${TCP_KEEPALIVE_INITIAL} + ${TCP_KEEPALIVE_RETRY} + ${TCP_KEEPALIVE_RETRIES} + ${TCP_WINDOW} + ${IP_STATIC_ROUTING} + ${TAHI} + ${BSD} + ${MULTI_INTERFACE} + ${STATELESS_AC} + ${IMME_FRAG_ASSEMBLY} + ${MSS_CHECK} + ${TCP_QUEUE_NOTIFY} + ${RAW_FILTER} + ${RAW_ALL_STACK} + ${ADDRESS_CHANGE_NOTIFY} + ${MULTIPART} + ${NAT} + ${PACKET_DEBUG} + ${DUAL_POOL} + ${IP_PACKET_FILTER} + ${DHCP_ARP_PROBE} + ${MDNS_IPV6} + ${HTTP_DIGEST} + ${DHCP_RESTORE} + ${DNS_CACHE} + ${TCPIP_OFFLOAD} + ${ARP} + ${HTTP_PROXY} + ${PPP_COMPRESSION}) +set(v6_full_secure_build + ${v6_full_build} + -DNX_SECURE_ENABLE) +set(v6_no_frag_build ${IPV6} ${NO_FRAG}) +set(v6_pmtu_no_frag_build ${v6_no_frag_build} ${IPV6_PMTU_DISCOVERY}) +set(v6_no_chain_build ${IPV6} ${NO_CHAIN} ${MDNS_NO_CLIENT}) +set(v6_no_dad_build ${IPV6} ${NO_DAD}) +set(v6_no_check_build ${IPV6} ${NO_CHECK} ${TAHI} ${IPV6_PMTU_DISCOVERY}) +set(v6_no_icmpv6_error_build ${IPV6} ${NO_ICMPV6_ERROR}) +set(v6_no_reset_disconn_build ${IPV6} ${NO_RESET_DISCONNECT} ${TAHI} + ${IPV6_PMTU_DISCOVERY}) +set(v6_link_cap_build ${IPV6} ${LINK_CAP} ${TX_RX_INTERFACE_CAPABILITY} + ${MULTI_INTERFACE}) +set(v6_address_change_build ${IPV6} ${ADDRESS_CHANGE_NOTIFY} ${MDNS_NO_SERVER}) +set(v6_multicast_build ${IPV6} ${MULTICAST} ${MULTI_INTERFACE}) +set(v6_ipsec_build + ${IPV6} + ${IPSEC} + ${BSD} + ${BSD_DNS} + ${MULTI_INTERFACE} + ${NAT} + ${PACKET_DEBUG} + ${TCP_RX_LIMIT} + ${CREATE_TELNET_PACKET_POOL} + ${TELNET_MAX_CLIENTS} + ${TELNET_ACTIVITY_TIMEOUT} + ${TELNET_TIMEOUT_PERIOD} + ${LCP_PROTOCOL_RETRIES} + ${IPCP_PROTOCOL_RETRIES} + ${LOW_WATERMARK} + ${IP_PACKET_FILTER} + ${TRACE} + ${MDNS_IPV6}) +set(v6_ipsec_dual_pool_build ${IPV6} ${IPSEC} ${DUAL_POOL}) +set(v6_ipsec_packet_pad_build ${IPV6} ${IPSEC} ${PACKET_PAD}) +set(v6_ipsec_tahi_build + ${IPV6} + ${IPSEC_TAHI} + ${TAHI} + ${BSD} + ${MULTI_INTERFACE} + ${IPV6_PMTU_DISCOVERY} + ${NAT}) +set(v6_ipsec_small_build + ${IPV6} + ${IPSEC} + ${NO_INFO} + ${NO_FRAG} + ${NO_DAD} + ${NO_CHECK} + ${NO_ICMPV6_ERROR} + ${NO_RESET_DISCONNECT} + ${PACKET_DEBUG}) +set(v6_ipsec_full_build + ${IPV6} + ${IPSEC_TAHI} + ${IPV6_PMTU_DISCOVERY} + ${TCP_KEEPALIVE} + ${TCP_KEEPALIVE_INITIAL} + ${TCP_KEEPALIVE_RETRY} + ${TCP_KEEPALIVE_RETRIES} + ${TCP_WINDOW} + ${IP_STATIC_ROUTING} + ${TAHI} + ${MULTIPART} + ${DUAL_POOL} + ${LOW_WATERMARK} + ${IP_PACKET_FILTER} + ${DHCP_ARP_PROBE} + ${MDNS_IPV6}) +set(v6_ipsec_full_tahi_build + ${IPV6} + ${IPSEC_TAHI} + ${TCP_KEEPALIVE} + ${TCP_KEEPALIVE_INITIAL} + ${TCP_KEEPALIVE_RETRY} + ${TCP_KEEPALIVE_RETRIES} + ${TCP_WINDOW} + ${IP_STATIC_ROUTING} + ${TAHI} + ${BSD} + ${MULTI_INTERFACE} + ${STATELESS_AC} + ${NAT} + ${LOW_WATERMARK} + ${DHCP_ARP_PROBE} + ${IPV6_PMTU_DISCOVERY} + ${MDNS_IPV6}) +set(v6_ipsec_no_frag_build ${IPV6} ${IPSEC} ${NO_FRAG}) +set(v6_ipsec_no_chain_build ${IPV6} ${IPSEC} ${NO_CHAIN} ${MDNS_NO_CLIENT}) +set(v6_ipsec_no_dad_build ${IPV6} ${IPSEC} ${NO_DAD}) +set(v6_ipsec_no_check_build ${IPV6} ${IPSEC_TAHI} ${NO_CHECK} ${TAHI} + ${IPV6_PMTU_DISCOVERY}) +set(v6_ipsec_no_check_tahi_build + ${IPV6} + ${IPSEC_TAHI} + ${NO_CHECK} + ${TAHI} + ${BSD} + ${MULTI_INTERFACE} + ${STATELESS_AC} + ${NAT}) +set(v6_no_rs_build ${IPV6} ${STATELESS_AC} ${NO_RS}) +set(v6_ipsec_no_icmpv6_error_build ${IPV6} ${IPSEC} ${NO_ICMPV6_ERROR}) +set(v6_ipsec_no_reset_disconn_build + ${IPV6} ${IPSEC_TAHI} ${NO_RESET_DISCONNECT} ${TAHI} ${IPV6_PMTU_DISCOVERY}) +set(v6_ipsec_no_reset_disconn_tahi_build + ${IPV6} ${IPSEC_TAHI} ${NO_RESET_DISCONNECT} ${TAHI} ${MDNS_NO_SERVER}) +set(v6_ipsec_link_cap_build ${IPV6} ${IPSEC} ${LINK_CAP}) +set(v6_dhcp_tahi_build ${IPV6} ${ADDRESS_CHANGE_NOTIFY} ${DHCPV6_TAHI} ${TAHI} + ${IPV6_PMTU_DISCOVERY}) +set(v6_bsd_raw_build ${IPV6} ${BSD_RAW} ${MULTI_INTERFACE} ${RAW_ALL_STACK}) +set(default_build_coverage -DNX_TAHI_ENABLE -DNX_MAX_PHYSICAL_INTERFACES=4 -DNX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +set(optimize_build ${default_build_coverage} -O3) +set(dhcp_default_build_coverage ${default_build_coverage} -DNX_DHCP_CLIENT_USER_CREATE_PACKET_POOL -DNX_DISABLE_ASSERT) +set(dns_default_build_coverage ${default_build_coverage} -DNX_DNS_CLIENT_USER_CREATE_PACKET_POOL -DNX_DNS_CLIENT_CLEAR_QUEUE) + +if($ENV{ENABLE_64}) + message(STATUS "Building for 64bit") + set(NXD_ENABLE_FILE_SERVERS OFF) +else() + add_compile_options(-m32) + add_link_options(-m32) + message(STATUS "Building for 32bit") + set(NXD_ENABLE_FILE_SERVERS ON) +endif() +add_compile_options( + -std=c99 + -ggdb + -g3 + -gdwarf-2 + -fdiagnostics-color + # -Werror + -DTX_INCLUDE_USER_DEFINE_FILE + ${${CMAKE_BUILD_TYPE}}) + +enable_testing() + +if("-DNX_BSD_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + set(NXD_ENABLE_BSD ON) +endif() +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../.. ${PRODUCT}) +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/regression regression) +if(NOT "$ENV{ENABLE_64}") + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/samples samples) + if(PRODUCT STREQUAL netxduo) + include(additionals.cmake) + endif() +endif() + +# Coverage +if(CMAKE_BUILD_TYPE MATCHES ".*_coverage") + target_compile_options(${PRODUCT} PRIVATE -fprofile-arcs -ftest-coverage) + target_link_options(${PRODUCT} PRIVATE -fprofile-arcs -ftest-coverage) +endif() + +# Build ThreadX library once +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/run.sh build_libs) +add_custom_target(build_libs ALL COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/run.sh + build_libs) +add_dependencies(${PRODUCT} build_libs) +target_include_directories(${PRODUCT} PUBLIC ${CMAKE_BINARY_DIR}/../libs/inc) +add_library(threadx SHARED IMPORTED GLOBAL) +add_library("azrtos::threadx" ALIAS threadx) +set_target_properties( + threadx PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/../libs/threadx/libthreadx.so) +add_library(filex SHARED IMPORTED GLOBAL) +add_library("azrtos::filex" ALIAS filex) +set_target_properties( + filex PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/../libs/filex/libfilex.so) +target_link_libraries(${PRODUCT} PUBLIC filex) + +target_compile_options( + ${PRODUCT} + PRIVATE -Werror + -Wall + -Wextra + -pedantic + -fmessage-length=0 + -fsigned-char + -ffunction-sections + -fdata-sections + -Wunused + -Wuninitialized + -Wmissing-declarations + -Wconversion + -Wpointer-arith + -Wshadow + -Wlogical-op + -Waggregate-return + -Wfloat-equal) diff --git a/test/cmake/netxduo/additionals.cmake b/test/cmake/netxduo/additionals.cmake new file mode 100644 index 00000000..31caa837 --- /dev/null +++ b/test/cmake/netxduo/additionals.cmake @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.13.0 FATAL_ERROR) + +# See https://cmake.org/cmake/help/latest/policy/CMP0079.html for more info +cmake_policy(SET CMP0079 NEW) + +target_include_directories(netxduo PUBLIC ${SOURCE_DIR}) + +get_target_property(SOURCES_LIST netxduo SOURCES) +get_target_property(SOURCE_DIR netxduo SOURCE_DIR) + +if("-DNX_DISABLE_PACKET_CHAIN" IN_LIST ${CMAKE_BUILD_TYPE}) + # Remove nx_secure from build + aux_source_directory(${SOURCE_DIR}/nx_secure/src SECURE_SOURCES) + list(REMOVE_ITEM SOURCES_LIST ${SECURE_SOURCES}) + # Remove MQTT from build + list(REMOVE_ITEM SOURCES_LIST ${SOURCE_DIR}/addons/mqtt/nxd_mqtt_client.c) + # Remove WebSocket from build + list(REMOVE_ITEM SOURCES_LIST ${SOURCE_DIR}/addons/websocket/nx_websocket_client.c) + # Remove RTP from build + list(REMOVE_ITEM SOURCES_LIST ${SOURCE_DIR}/addons/rtp/nx_rtp_sender.c) +endif() +set_target_properties(netxduo PROPERTIES SOURCES "${SOURCES_LIST}") diff --git a/test/cmake/netxduo/coverage.sh b/test/cmake/netxduo/coverage.sh new file mode 100755 index 00000000..435de047 --- /dev/null +++ b/test/cmake/netxduo/coverage.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) +root_path=$(cd ../../../common/src; pwd) +mkdir -p coverage_report/$1 +gcovr --object-directory=build/$1/netxduo/CMakeFiles/netxduo.dir/common/src -r ../../../common/src -e $root_path/nx_ram_network_driver.c --xml-pretty --output coverage_report/$1.xml +gcovr --object-directory=build/$1/netxduo/CMakeFiles/netxduo.dir/common/src -r ../../../common/src -e $root_path/nx_ram_network_driver.c --html --html-details --output coverage_report/$1/index.html diff --git a/test/cmake/netxduo/libs b/test/cmake/netxduo/libs new file mode 120000 index 00000000..d4bda9b4 --- /dev/null +++ b/test/cmake/netxduo/libs @@ -0,0 +1 @@ +../libs \ No newline at end of file diff --git a/test/cmake/netxduo/regression/CMakeLists.txt b/test/cmake/netxduo/regression/CMakeLists.txt new file mode 100644 index 00000000..c2d25e5d --- /dev/null +++ b/test/cmake/netxduo/regression/CMakeLists.txt @@ -0,0 +1,1355 @@ +cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) +cmake_policy(SET CMP0057 NEW) + +project(regression_test LANGUAGES C) + +get_filename_component(SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../regression + ABSOLUTE) + +set(auto_ip_test_cases + ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_address_check_test.c + ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_arp_dest_addr_test.c + ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_basic_test.c + ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_max_conflicts_test.c + # ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_conflicts_check_test.c + ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_announce_num_test.c) + +if("-DNX_BSD_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + set(bsd_test_cases + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_clients_shared_port_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_accept_noselect_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_blocking_bidirection_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_blocking_bidirection_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_clients_share_port_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_servers_share_port_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_basic_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_two_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_2nd_bind_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_multicast_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_bind_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_disconnect_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_udp_select_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_accept_nonblocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_pton_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_ntoa_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_ntop_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_ioctl_nonblocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_connect_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_sendto_recvfrom_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_accept_nonblocking_timeout_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_bind_connect_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_basic_nonblocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_multiple_accept_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_bind_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_aton_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_inet_addr_pton_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_accept_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_basic_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_basic_nonblocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_servers_shared_port_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_getsockname_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_accept_blocking_timeout_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_udp_checksum_corrupt_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_getaddrinfo_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_rcvbuf_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_tcp_fionread_test.c) + if("-DNX_BSD_RAW_SUPPORT" IN_LIST ${CMAKE_BUILD_TYPE}) + list( + APPEND + bsd_test_cases + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_rx_nohdr_basic_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_basic_rx_nohdr_nonblocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_bind_connect_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_basic_nonblocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_basic_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_basic_rx_nohdr_blocking_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_pppoe_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_ping_test.c + ${SOURCE_DIR}/bsd_test/netx_bsd_raw_tx_test.c) + endif() +endif() + +if(PRODUCT STREQUAL netxduo) + set(cloud_test_cases + ${SOURCE_DIR}/cloud_test/netx_cloud_api_test.c + ${SOURCE_DIR}/cloud_test/netx_cloud_basic_test.c + ${SOURCE_DIR}/cloud_test/netx_cloud_module_event_test.c + ${SOURCE_DIR}/cloud_test/netx_cloud_module_register_deregister_test.c) +endif() + +set(dhcp_test_cases + # ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_01_02_test.c + # ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_01_03_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_01_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_02_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_02_02_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_02_03_test.c + # ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_04_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_05_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_01_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_03_02_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_03_02_02_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_03_02_03_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_03_05_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_04_01_01_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_04_01_02_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_basic_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_basic_restore_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_user_option_add_test.c + # ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface. + # c ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_tes + # t.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_packet_process_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_send_with_zero_source_address_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_multiple_instances_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_send_request_internal_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_extract_information_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_get_option_value_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_delete_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_stop_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_enable_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_start_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_release_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_reinitialize_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_activate_interfaces_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_secondary_interface_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_interface_order_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_ip_mutex_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_server_source_port_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_ntp_option_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_parameter_request_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_coverage_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_unicast_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_server_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_server_improper_term_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_server_second_interface_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_server_options_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_server_small_packet_payload_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_skip_discover_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_nxe_api_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_basic_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_extended_api_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_packet_loss_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_client_process_server_duid_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_server_ia_options_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_server_iana_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_server_process_repeated_msgs_test.c + ${SOURCE_DIR}/dhcp_test/netx_dhcpv6_user_option_add_test.c) + +set(dns_test_cases + ${SOURCE_DIR}/dns_test/netx_dns_coverage_test.c + ${SOURCE_DIR}/dns_test/netx_dns_function_test.c + ${SOURCE_DIR}/dns_test/netx_dns_request_a_response_cname_a_smtp_live_com_test.c + ${SOURCE_DIR}/dns_test/netx_dns_invalid_name_unencode_test.c + ${SOURCE_DIR}/dns_test/netx_dns_invalid_resource_get_test.c + ${SOURCE_DIR}/dns_test/netx_dns_abnormal_packet_test.c + ${SOURCE_DIR}/dns_test/netx_dns_source_port_test.c + ${SOURCE_DIR}/dns_test/netx_dns_non_blocking_a_test.c + ${SOURCE_DIR}/dns_test/netx_dns_nxe_api_test.c + ${SOURCE_DIR}/dns_test/netx_dns_fake_response_test.c + ${SOURCE_DIR}/dns_test/netx_dns_packet_double_release_test.c) + +set(ftp_test_cases + ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_02_test.c + # ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_m_d_dir_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_03_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_invalid_username_password_length_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_pasv_file_write_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_data_connection_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_nlist_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_user_data_type_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_basic_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_establish_data_connection_05_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_commands_replys_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_RETR_STOR_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_rename_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_establish_data_connection_08_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_04_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_pasv_denied.c + ${SOURCE_DIR}/ftp_test/netx_ftp_commands_characters_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_pasv_file_read_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_buffer_overflow_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_file_write_fail_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_establish_data_connection_06_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_file_write_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_establish_data_connection_03_test.c + # ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_dele_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_01_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_control_connection_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_server_invalid_month_crash_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_rst_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_two_listen_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_multiple_connection_responses_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_client_packet_leak_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_parse_ipv6_address_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_server_abnormal_packet_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_server_list_command_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_server_dangling_pointer_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_server_mss_too_small_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_pasv_twice_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_disconnection_event_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_ipv6_epsv_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_pasv_port_test.c + ${SOURCE_DIR}/ftp_test/netx_ftp_pasv_stor_test.c) + +set(http_test_cases + ${SOURCE_DIR}/http_test/netx_http_get_put_referred_URI_test.c + ${SOURCE_DIR}/http_test/netx_http_if_modified_since_test.c + ${SOURCE_DIR}/http_test/netx_http_client_change_connect_port_test.c + # ${SOURCE_DIR}/http_test/netx_http_status_400_test.c + ${SOURCE_DIR}/http_test/netx_http_post_basic_test.c + ${SOURCE_DIR}/http_test/netx_http_get_contentlength_packetleak_test.c + ${SOURCE_DIR}/http_test/netx_http_status_404_test.c + ${SOURCE_DIR}/http_test/netx_http_basic_test.c + ${SOURCE_DIR}/http_test/netx_http_basic_authenticate_test.c + ${SOURCE_DIR}/http_test/netx_http_get_content_length_test.c + # ${SOURCE_DIR}/http_test/netx_http_status_501_test.c + ${SOURCE_DIR}/http_test/netx_http_request_in_multiple_packets_test.c + ${SOURCE_DIR}/http_test/netx_http_head_basic_test.c + ${SOURCE_DIR}/http_test/netx_http_delete_basic_test.c + ${SOURCE_DIR}/http_test/netx_http_multipart_fragment_test.c + ${SOURCE_DIR}/http_test/netx_http_multipart_underflow_test.c + ${SOURCE_DIR}/http_test/netx_http_digest_authenticate_test.c + ${SOURCE_DIR}/http_test/netx_http_server_type_retrieve_test.c + ${SOURCE_DIR}/http_test/netx_http_digest_authenticate_timeout_test.c) + +if(PRODUCT STREQUAL netxduo) + set(mdns_test_cases + ${SOURCE_DIR}/mdns_test/netx_mdns_announcement_repeat_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_bad_packet_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_buffer_size_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_create_delete_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_domain_name_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_interface_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_second_interface_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_internal_function_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_local_cache_continuous_query_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_local_cache_one_shot_query_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_multiple_answers_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_name_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_one_shot_query_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_responder_cooperating_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_response_with_question_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_service_add_delete_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_service_lookup_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_source_address_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_source_port_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_ttl_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_two_buffer_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_txt_notation_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_txt_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_peer_service_change_notify_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_ipv6_string_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_read_overflow_test.c) + if(NOT "-DNX_DISABLE_IPV4" IN_LIST ${CMAKE_BUILD_TYPE}) + list(APPEND mdns_test_cases ${SOURCE_DIR}/mdns_test/netx_mdns_ram_test.c) + endif() + + set(nat_test_cases + ${SOURCE_DIR}/nat_test/netx_nat_tcp_fragment_test.c + ${SOURCE_DIR}/nat_test/netx_nat_tcp_test1.c + ${SOURCE_DIR}/nat_test/netx_nat_tcp_port_test2.c + ${SOURCE_DIR}/nat_test/netx_nat_udp_fragment_test.c + ${SOURCE_DIR}/nat_test/netx_nat_icmp_test.c + ${SOURCE_DIR}/nat_test/netx_nat_udp_test.c + ${SOURCE_DIR}/nat_test/netx_nat_tcp_test2.c + ${SOURCE_DIR}/nat_test/netx_nat_udp_port_test.c + ${SOURCE_DIR}/nat_test/netx_nat_tcp_port_test.c + ${SOURCE_DIR}/nat_test/netx_nat_invalid_header_test.c) +endif() + +set(netxduo_test_cases + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_mtu_option_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_icmp_small_header_test2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_receive_under_interface_detach_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_29_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_new_reno_algorithm_test4.c + ${SOURCE_DIR}/netxduo_test/netx_15_26_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_ipv6_interface2_test_1_test.c + ${SOURCE_DIR}/netxduo_test/netx_15_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_31_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_small_window_preempt_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_conflict_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_29_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_suspension_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_tunnel_ipv4_ipv6_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_interface2_ping6_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_prefix_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_26_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_unaccept_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_28_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_21_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_10_23_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_29_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_27_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_22_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_packet_delay_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_dropped_packet_test2.c + ${SOURCE_DIR}/netxduo_test/netx_10_26_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_leave_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_14_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_address_delete_test.c + ${SOURCE_DIR}/netxduo_test/netx_2_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_no_duplicate_entry_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_raw_loopback_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_multiple_send_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_22_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_icmp_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ack_check_for_syn_message_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_raw_packet_filter_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_max_payload_size_find_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_06_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_21_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_fragmentation_error_test2.c + ${SOURCE_DIR}/netxduo_test/netx_udp_packet_type_test.c + ${SOURCE_DIR}/netxduo_test/netx_raw_special_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_raw_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_udp_test.c + ${SOURCE_DIR}/netxduo_test/netx_api_compile_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_cleanup_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_window_update_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_28_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_auto_entry_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_client_socket_unbind_test.c + ${SOURCE_DIR}/netxduo_test/netx_10_24_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_malformed_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_idle_scan_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_multiple_send_test2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_fast_disconnect_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_keepalive_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_abnormal_mtu_in_ra_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_multiple_ping_test1.c + ${SOURCE_DIR}/netxduo_test/netx_old_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_loopback_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_time_exceeded_message_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_icmp_small_header_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_invalid_ra_dest_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_retransmit_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_basic_processing_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_client_socket_port_get_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_capability_test.c + ${SOURCE_DIR}/netxduo_test/netx_23_02_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_data_trim_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_26_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_14_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_detachment_tcp_connection_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_address_get_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_invalid_echo_reply_test.c + ${SOURCE_DIR}/netxduo_test/netx_10_24_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_urgent_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_transmit_cleanup_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_entry_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_na_tlla_changed_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_listen_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_disable_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_multiple_ping6_test1.c + ${SOURCE_DIR}/netxduo_test/netx_ip_address_get_test.c + ${SOURCE_DIR}/netxduo_test/netx_10_24_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_default_router_test.c + ${SOURCE_DIR}/netxduo_test/netx_106_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_invalid_packet_receive_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_router_query_test.c + ${SOURCE_DIR}/netxduo_test/netx_ramdriver_callback_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_static_entry_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_static_entry_pollute_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_flag_callback_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_udp_fragment_test4.c + ${SOURCE_DIR}/netxduo_test/netx_checksum_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_2_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_11.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_router_full_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_multiple_ping_test2.c + ${SOURCE_DIR}/netxduo_test/netx_forward_tcp_test_5.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_15.c + ${SOURCE_DIR}/netxduo_test/netx_ip_link_local_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_address_get_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv6_ipv6_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_entry_test2.c + ${SOURCE_DIR}/netxduo_test/netx_arp_queue_depth_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_echo_reply_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_connection_reset_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_payload_size_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_tcp_test_1.c + ${SOURCE_DIR}/netxduo_test/netx_ip_address_conflict_detection_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_tunnel_ipv4_ipv6_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv4_ipv4_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_tunnel_ipv6_ipv6_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_socket_unbind_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_static_entry_create_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_28_test.c + # ${SOURCE_DIR}/netxduo_test/netx_18_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_14.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_tunnel_ipv4_ipv4_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_multiple_ping6_test2.c + ${SOURCE_DIR}/netxduo_test/netx_6_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_loopback_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_link_local_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_broadcast_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_util_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_16_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_send_error_message_test_1.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dual_pool_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_22_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_queue_depth_notify_test.c + ${SOURCE_DIR}/netxduo_test/netx_16_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_receive_under_interface_detach_test2.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_packet_receive_function_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_address_set_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_pmtu_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_ping6_data_append_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_4.c + ${SOURCE_DIR}/netxduo_test/netx_nd_cache_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_interface_detachment_router_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_client_bind_cleanup_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_new_reno_algorithm_test2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_out_of_order_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_12.c + ${SOURCE_DIR}/netxduo_test/netx_9_22_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_27_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_05_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_checksum_zero_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_stateless_address_autoconfig_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_9.c + ${SOURCE_DIR}/netxduo_test/netx_nd_cache_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_15_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_status_check_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_multicast_interface_detach_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_port_unreachable_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_loopback_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_wrapping_sequence_test3.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_27_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_loopback_multihome_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_unbind_test2.c + ${SOURCE_DIR}/netxduo_test/netx_3_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ipv6_delayed_retransmission_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_entry_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_wrong_destination_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_04_ipv6_test.c + ${SOURCE_DIR}/netxduo_test/netx_2_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_delayed_retransmission_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_chained_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_icmp_small_header_test3.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_fragmentation_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_large_mtu_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_large_mtu_test2.c + ${SOURCE_DIR}/netxduo_test/netx_low_watermark_zero_window_test.c + ${SOURCE_DIR}/netxduo_test/netx_low_watermark_fragment_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_30_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_create_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_redirect_nd_full_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_echo_request_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_listen_queue_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_packet_receive_function_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_multiple_ports_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_17.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_join_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_13_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_send_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_27_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_driver_deferred_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_tunnel_ipv4_ipv4_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_21_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_packet_receive_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_na_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_na_buffer_overwrite_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_bind_cleanup_test.c + ${SOURCE_DIR}/netxduo_test/netx_16_22_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_packet_receive_function_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_unlisten_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_address_set_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_8.c + ${SOURCE_DIR}/netxduo_test/netx_4_17_test.c + # ${SOURCE_DIR}/netxduo_test/netx_11_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_packet_copy_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_multicast_interface_detach_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_socket_delete_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_timeout_check_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_timeout_check_test2.c + ${SOURCE_DIR}/netxduo_test/netx_9_27_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_29_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_21_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_server_socket_accept_test.c + ${SOURCE_DIR}/netxduo_test/netx_13_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_ping_multicast_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_07_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_nd_cache_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_send_disconnect_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_ping_fragment_test.c + ${SOURCE_DIR}/netxduo_test/netx_caller_check_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_3.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_5.c + ${SOURCE_DIR}/netxduo_test/netx_103_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_duplicate_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_basic_processing_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_status_check_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_search_onlink_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_physical_address_set_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_not_enabled_test.c + ${SOURCE_DIR}/netxduo_test/netx_16_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_23_02_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_27_test.c + ${SOURCE_DIR}/netxduo_test/netx_13_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test2.c + ${SOURCE_DIR}/netxduo_test/netx_ip_gateway_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_static_route_delete_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_relisten_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_chain_packet_process_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ipv4_interface2_mss_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_retransmit_test_1.c + ${SOURCE_DIR}/netxduo_test/netx_rarp_multiple_interfaces_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ipv6_window_scale_test.c + ${SOURCE_DIR}/netxduo_test/netx_2_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_invalid_packet_receive_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_invalid_length_test2.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_send_error_message_test.c + ${SOURCE_DIR}/netxduo_test/netx_104_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_free_port_find_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv4_option_process_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_10.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_receive_cleanup_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_gratuitous_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_interface2_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_entry_test3.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_error_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_error_small_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_status_check_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ipv6_interface2_mss_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_wrapping_sequence_test2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_16.c + ${SOURCE_DIR}/netxduo_test/netx_ip_route_reachable_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_wrapping_sequence_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_address_conflict_callback_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_send_fail_test3.c + ${SOURCE_DIR}/netxduo_test/netx_6_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ack_check_issue_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_tcp_test_4.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_small_windows_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_static_entries_delete_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_transmit_under_interface_detach_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_loopback_test2.c + ${SOURCE_DIR}/netxduo_test/netx_5_22_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_checksum_computation_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_abnormal_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_16_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_delete_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_link_status_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_tunnel_ipv6_ipv6_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_19_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_hop_by_hop_option_error_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_26_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_packet_filter_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_packet_filter_extended_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_invalid_na.c + ${SOURCE_DIR}/netxduo_test/netx_low_watermark_test.c + ${SOURCE_DIR}/netxduo_test/netx_rarp_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_detachment_arp_table_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_max_window_scale_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_raw_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_out_of_order_packet_max_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_nd_cache_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_24_test.c + ${SOURCE_DIR}/netxduo_test/netx_23_02_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_address_full_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_zero_window_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_info_get_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_error_operation_check_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_detachment_gateway_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_duplicate_accept_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_08_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_ipv4_interface2_test_1_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_address_set_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_DAD_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_29_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_tunnel_ipv6_ipv4_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_fin_wait1_to_time_wait_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_udp_fragment_test3.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_loopback_test.c + ${SOURCE_DIR}/netxduo_test/netx_15_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_101_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_19_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_entry_cache_test.c + ${SOURCE_DIR}/netxduo_test/netx_13_05_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_29_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_auxiliary_packet_pool_set_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_physical_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_invalid_length_test.c + ${SOURCE_DIR}/netxduo_test/netx_13_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_invalidate_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_raw_packet_queue_test.c + ${SOURCE_DIR}/netxduo_test/netx_dest_table_add_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_static_route_find_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_19_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_mss_option_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_mss_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_13.c + ${SOURCE_DIR}/netxduo_test/netx_6_27_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_fragment_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_available_bytes_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_listen_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_listen_packet_leak_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_source_send_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_ping6_fragment_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_ipv6_basic_processing_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_attachment_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_send_fail_test2.c + ${SOURCE_DIR}/netxduo_test/netx_1_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_18.c + ${SOURCE_DIR}/netxduo_test/netx_arp_invalid_type_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tx_queue_exceed_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_time_wait_to_close_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_fast_retransmit_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_4_duplicate_ack_test.c + ${SOURCE_DIR}/netxduo_test/netx_15_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_fragmentation_processing_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_socket_unbind_receive_test.c + ${SOURCE_DIR}/netxduo_test/netx_5_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_19_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_router_solicitation_test.c + ${SOURCE_DIR}/netxduo_test/netx_rarp_packet_allocate_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_icmp_ttl_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_udp_fragment_test2.c + ${SOURCE_DIR}/netxduo_test/netx_101_18_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_zero_window_probe_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_zero_window_probe_2_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_zero_window_probe_3_test.c + ${SOURCE_DIR}/netxduo_test/netx_6_32_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_socket_bind_test.c + ${SOURCE_DIR}/netxduo_test/netx_nxd_udp_socket_send_special_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_send_internal_test.c + ${SOURCE_DIR}/netxduo_test/netx_rarp_basic_processing_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_small_window_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_new_reno_algorithm_test5.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_delayed_retransmission_test2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_fin_wait_recv_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_10_23_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv6_ipv4_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_15_03_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_destination_table_periodic_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_send_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_udp_fragment_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_transmit_not_done_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_entry_abnormal_operation_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_port_table_udpate_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_order_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_27_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_forward_tcp_test_2.c + ${SOURCE_DIR}/netxduo_test/netx_23_02_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_7.c + ${SOURCE_DIR}/netxduo_test/netx_4_27_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_unbind_test.c + ${SOURCE_DIR}/netxduo_test/netx_udp_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_dispatch_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_26_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_address_change_notify_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_20_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_nd_cache_under_interface_detach_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_invalid_source_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_client_socket_bind_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_client_packet_leak_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_29_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_3_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_debug_info_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_lifetime_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_simultaneous_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_hop_by_hop_fragment_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_23_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_wrapping_sequence_test4.c + ${SOURCE_DIR}/netxduo_test/netx_nd_cache_add_test.c + ${SOURCE_DIR}/netxduo_test/netx_rarp_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_multicast_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_default_router_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_reset_during_send_test.c + ${SOURCE_DIR}/netxduo_test/netx_packet_data_append_test.c + ${SOURCE_DIR}/netxduo_test/netx_igmp_interface_indirect_report_send_test.c + ${SOURCE_DIR}/netxduo_test/netx_17_17_test.c + # ${SOURCE_DIR}/netxduo_test/netx_tcp_ack_before_release_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_out_of_window_control_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_04_test.c + ${SOURCE_DIR}/netxduo_test/netx_10_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_fragment_fail_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_invalid_option_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_invalid_option_test2.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_redirect_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_redirect_buffer_overwrite_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_ping6_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_branch_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_new_reno_algorithm_test3.c + ${SOURCE_DIR}/netxduo_test/netx_3_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_dropped_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_12_25_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_delete_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_packet_allocate_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_solicitated_ra_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_disable_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_data_transfer_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_odd_window_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_multicast_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_loopback_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_6.c + ${SOURCE_DIR}/netxduo_test/netx_ip_static_route_add_test.c + ${SOURCE_DIR}/netxduo_test/netx_raw_nxe_api_test.c + ${SOURCE_DIR}/netxduo_test/netx_4_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_slla_changed_test.c + ${SOURCE_DIR}/netxduo_test/netx_102_21_test.c + ${SOURCE_DIR}/netxduo_test/netx_11_19_test.c + ${SOURCE_DIR}/netxduo_test/netx_nd_cache_with_own_address_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_relisten_test2.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_entry_set_test.c + ${SOURCE_DIR}/netxduo_test/netx_arp_dynamic_entry_timeout_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_packet_leak_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmp_tunnel_ipv6_ipv4_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_19_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_fragmentation_error_test1.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_new_reno_algorithm_test1.c + ${SOURCE_DIR}/netxduo_test/netx_ip_interface_detachment_test.c + ${SOURCE_DIR}/netxduo_test/netx_8_01_test.c + ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_packet_drop_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_state_wait_test.c + ${SOURCE_DIR}/netxduo_test/netx_1_26_02_test.c + ${SOURCE_DIR}/netxduo_test/netx_9_17_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_multicast_ping_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_multicast_ping_test1.c + ${SOURCE_DIR}/netxduo_test/netx_forward_tcp_test_3.c + ${SOURCE_DIR}/netxduo_test/netx_forward_multicast_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_big_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_udp_random_port_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_invalid_message_test.c + ${SOURCE_DIR}/netxduo_test/netx_ipv6_packet_chain_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_invalid_length_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ra_buffer_overwrite_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_invalid_length_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_large_data_transfer_test.c + ${SOURCE_DIR}/netxduo_test/netx_utility_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ns_with_small_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_ns_buffer_overwrite_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_small_packet_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_advertised_window_update_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_invalid_ra_option_test.c + ${SOURCE_DIR}/netxduo_test/netx_icmpv6_too_big_buffer_overwrite_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_race_condition_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_race_condition_test2.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_socket_receive_rst_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_invalid_packet_chain_test.c + ${SOURCE_DIR}/netxduo_test/netx_http_proxy_basic_test.c + ${SOURCE_DIR}/netxduo_test/netx_http_proxy_non_block_test.c + ${SOURCE_DIR}/netxduo_test/netx_http_proxy_multiple_response_test.c + ${SOURCE_DIR}/netxduo_test/netx_http_proxy_error_response_test.c + ${SOURCE_DIR}/netxduo_test/netx_http_proxy_disconnect_test.c + ${SOURCE_DIR}/netxduo_test/netx_http_proxy_data_fin_test.c) + +set(websocket_test_cases + ${SOURCE_DIR}/websocket_test/netx_websocket_send_chain_packets_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_non_block_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_multi_instance_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_delete_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_16_bit_payload_length_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_one_packet_with_multi_frames_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_one_frame_in_packets_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_disconnect_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_connect_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_mask_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_fin_test.c + ${SOURCE_DIR}/websocket_test/netx_websocket_opcode_test.c) + +set(pop3_test_cases + ${SOURCE_DIR}/pop3_test/netx_pop3_two_mails_received_test.c + ${SOURCE_DIR}/pop3_test/netx_pop3_mail_receive_test.c + ${SOURCE_DIR}/pop3_test/netx_pop3_packet_with_endmarker_test.c + ${SOURCE_DIR}/pop3_test/netx_pop3_abnormal_packet_test.c) + +set(ppp_test_cases + ${SOURCE_DIR}/ppp_test/netx_ppp_PAP_bad_password_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_check_boundary_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_IPCP_timeout.c + ${SOURCE_DIR}/ppp_test/netx_ppp_request_dns_server_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_chap_bad_secret_passed_on_retry_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_chap_bad_secret_failed_retry_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_LCP_timeout.c + ${SOURCE_DIR}/ppp_test/netx_ppp_PAP_bad_username_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_pap_null_name_password_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_LCP_invalid_packet_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_IPCP_abnormal_packet_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_IPCP_nak_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_IPCP_retransmit_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_pap_basic_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_pfc_option_test.c + ${SOURCE_DIR}/ppp_test/netx_ppp_acfc_option_test.c) + +set(pppoe_test_cases + ${SOURCE_DIR}/pppoe_test/netx_pppoe_basic_test.c + ${SOURCE_DIR}/pppoe_test/netx_pppoe_api_test.c + ${SOURCE_DIR}/pppoe_test/netx_pppoe_api_extended_test.c + ${SOURCE_DIR}/pppoe_test/netx_pppoe_ac_name_test.c + ${SOURCE_DIR}/pppoe_test/netx_pppoe_session_control_test.c) + +if(PRODUCT STREQUAL netxduo) + if(NOT "-DNX_DISABLE_IPV4" IN_LIST ${CMAKE_BUILD_TYPE}) + set(ptp_test_cases + ${SOURCE_DIR}/ptp_test/netx_ptp_client_announce_timeout_test.c + ${SOURCE_DIR}/ptp_test/netx_ptp_client_api_test.c + ${SOURCE_DIR}/ptp_test/netx_ptp_client_basic_test.c + ${SOURCE_DIR}/ptp_test/netx_ptp_client_calibrate_test.c + ${SOURCE_DIR}/ptp_test/netx_ptp_client_ipv6_test.c + ${SOURCE_DIR}/ptp_test/netx_ptp_client_master_selection_test.c + ${SOURCE_DIR}/ptp_test/netx_ptp_client_two_steps_off_test.c) + endif() +endif() + +set(rtp_test_cases + ${SOURCE_DIR}/rtp_test/netx_rtp_multi_interfaces_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_session_packet_send_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_session_jpeg_send_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_session_h264_send_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_session_aac_send_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_free_udp_port_find_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_multi_clients_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_multicast_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_basic_test.c + ${SOURCE_DIR}/rtp_test/netx_rtp_api_test.c + ${SOURCE_DIR}/rtp_test/netx_rtcp_abnormal_packet_test.c + ${SOURCE_DIR}/rtp_test/netx_rtcp_basic_test.c + ${SOURCE_DIR}/rtp_test/netx_rtcp_packet_process_test.c + ${SOURCE_DIR}/rtp_test/netx_rtcp_packet_send_test.c) + +set(rtsp_test_cases + ${SOURCE_DIR}/rtsp_test/netx_rtsp_api_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_rtp_basic_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_rtp_ipv6_basic_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_rtp_multicast_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_rtp_ipv6_multicast_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_multiple_request_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_multiple_clients_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_client_timeout_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_error_response_test.c + ${SOURCE_DIR}/rtsp_test/netx_rtsp_delete_beforehand_test.c) + +set(smtp_test_cases + ${SOURCE_DIR}/smtp_test/netx_smtp_auth_none_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_auth_logon_function_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_auth_no_type_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_two_packet_EHLO_auth_last_message_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_basic_function_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_two_packet_EHLO_message_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_abnormal_packet_test.c + ${SOURCE_DIR}/smtp_test/netx_smtp_invalid_release_test.c) + +set(snmp_test_cases + ${SOURCE_DIR}/snmp_test/netx_snmp_v1_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v1_object_id_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v1_packet_double_release_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_basic_v2_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v2_get_bulk_request_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v2_unknown_oid_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v2_send_trap_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v2_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_nosec_traplist_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_md5_failed_security_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_md5_security_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_md5_security_extended_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_no_security_function_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_decrypt_pdu_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_encrypt_pdu_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_v3_object_id_buffer_overwrite_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_setget_integers_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_setget_octet_strings_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_setget_ip_address_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_setget_misc_test.c + ${SOURCE_DIR}/snmp_test/netx_snmp_abnormal_packet_test.c) + +set(sntp_test_cases + ${SOURCE_DIR}/sntp_test/netx_sntp_forward_unicast_update_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_request_unicast_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_unicast_basic_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_ipv6_broadcast_basic_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_ipv6_unicast_basic_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_broadcast_basic_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_unicast_display_date_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_seconds_to_date_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_kod_test.c + ${SOURCE_DIR}/sntp_test/netx_sntp_client_packet_chain_test.c) + +if(PRODUCT STREQUAL netxduo) + if("-DNX_TAHI_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + if("-DNX_ENABLE_IPV6_PATH_MTU_DISCOVERY" IN_LIST ${CMAKE_BUILD_TYPE}) + set(tahi_test_cases + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_15.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_40.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_12.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_33.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_18.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_16.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_15.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_22.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_5.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_35.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_19.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_09.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_16.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_7.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_03.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_04.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_05.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_10.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_10.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_01.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_05.c + # ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_44.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_11.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_29.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_34.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_2.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_39.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_10.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_04.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_12.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_1.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_3.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_02.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_01.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_20.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_02.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_37.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_5.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_42.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_13.c + # ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_45.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_11.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_21.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_41.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_06.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_09.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_4.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_6.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_32.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_24.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_14.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_06.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_07.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_17.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_30.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_07.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_27.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_9.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_31.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_28.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_14.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_13.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_38.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_25.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_11.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_08.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_8.c + # ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_43.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_23.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_36.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_03.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_08.c + ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_26.c) + endif() + + if("-DNX_DHCPV6_TAHI_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + set(tahi_dhcpv6_test_cases + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_011.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_036.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_040.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_041.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_037.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_008.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_087.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_013.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_086.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_018.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_071.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_005.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_079.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_082.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_027.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_074.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_003.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_014.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_032.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_026.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_023.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_052.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_015.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_056.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_017.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_009.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_021.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_089.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_008.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_081.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_007.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_021.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_042.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_022.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_053.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_020.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_072.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_019.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_095.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_020.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_027.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_088.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_091.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_019.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_092.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_076.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_058.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_048.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_002.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_025.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_096.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_044.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_030.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_019.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_066.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_043.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_011.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_007.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_045.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_009.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_065.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_004.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_012.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_060.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_014.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_093.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_003.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_005.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_028.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_012.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_013.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_018.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_016.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_061.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_017.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_085.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_038.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_003.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_063.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_025.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_004.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_069.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_005.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_022.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_024.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_007.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_023.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_027.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_067.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_031.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_039.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_010.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_012.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_034.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_020.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_062.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_002.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_014.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_059.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_057.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_021.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_070.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_002.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_054.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_084.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_006.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_010.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_035.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_008.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_006.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_004.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_077.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_064.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_075.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_098.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_046.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_097.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_073.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_050.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_013.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_015.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_009.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_016.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_047.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_024.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_083.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_080.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_026.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_029.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_04_010.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_022.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_026.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_090.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_055.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_049.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_078.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_033.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_051.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_094.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_07_006.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_068.c + ${SOURCE_DIR}/tahi_test/netx_tahi_dhcpv6_test_01_099.c) + endif() + endif() +endif() + +set(telnet_test_cases + ${SOURCE_DIR}/telnet_test/netx_telnet_activity_timeout_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_max_connections_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_create_packet_pool_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_server_options_negotiate_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_basic_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_server_bad_option_reply_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_rst_test.c + ${SOURCE_DIR}/telnet_test/netx_telnet_two_listen_test.c) + +set(tftp_test_cases + ${SOURCE_DIR}/tftp_test/netx_tftp_basic_test.c + ${SOURCE_DIR}/tftp_test/netx_tftp_write_interaction_test.c + ${SOURCE_DIR}/tftp_test/netx_tftp_error_file_name_test.c + ${SOURCE_DIR}/tftp_test/netx_tftp_read_interaction_test.c + ${SOURCE_DIR}/tftp_test/netx_tftp_error_destionation_port_test.c + ${SOURCE_DIR}/tftp_test/netx_tftp_malformed_packet_test.c) + +if(NOT "-DNX_DISABLE_IPV6" IN_LIST ${CMAKE_BUILD_TYPE}) + list(APPEND tftp_test_cases + ${SOURCE_DIR}/tftp_test/netx_tftp_ipv6_basic_test.c) +endif() + +if("full_build" IN_LIST CMAKE_BUILD_TYPE) + # For test cases requires huge CPU resoures, run for full build only + list(APPEND tftp_test_cases + ${SOURCE_DIR}/tftp_test/netx_tftp_large_data_test.c + ${SOURCE_DIR}/netxduo_test/netx_tcp_cwnd_test.c) +endif() + +set(test_utility_files + ${SOURCE_DIR}/test/nx_ram_network_driver_test_1500.c + ${SOURCE_DIR}/test/netxtestcontrol.c + # DHCP utilities + ${SOURCE_DIR}/dhcp_test/netx_dhcp_clone_function.c + # DNS utilities + ${SOURCE_DIR}/dns_test/response_txt_google_com.c + ${SOURCE_DIR}/dns_test/response_cname_mail_baidu_com.c + ${SOURCE_DIR}/dns_test/response_mx_a_berkley_edu.c + ${SOURCE_DIR}/dns_test/response_mx_a_google_com.c + ${SOURCE_DIR}/dns_test/response_soa_google_com.c + ${SOURCE_DIR}/dns_test/response_mx_google_com.c + ${SOURCE_DIR}/dns_test/response_a_berkley_edu.c + ${SOURCE_DIR}/dns_test/response_aaaa_berkley_edu.c + ${SOURCE_DIR}/dns_test/response_srv_google_com.c + ${SOURCE_DIR}/dns_test/response_a_cname_www_npr_org.c + ${SOURCE_DIR}/dns_test/response_a_google_com.c + ${SOURCE_DIR}/dns_test/response_ns_a_ti_com.c + ${SOURCE_DIR}/dns_test/response_with_invalid_resource.c) +if(NOT "$ENV{ENABLE_64}") + list( + APPEND + test_utility_files + # SMTP utilities + ${SOURCE_DIR}/smtp_test/smtp_server_packets.c + # SNMP utilites + ${SOURCE_DIR}/snmp_test/get_snmp_v3_request.c + ${SOURCE_DIR}/snmp_test/snmp_manager_packets.c + ${SOURCE_DIR}/snmp_test/GetSet_Integers_Large_and_Neg_Numbers.c + ${SOURCE_DIR}/snmp_test/GetSet_IPv4v6Address.c + ${SOURCE_DIR}/snmp_test/GetSet_OctetStrings.c + ${SOURCE_DIR}/snmp_test/Get_Miscellaneous_Data_type.c + ${SOURCE_DIR}/snmp_test/small_mib_helper.c) +endif() + +if(PRODUCT STREQUAL netxduo) + if(NOT "$ENV{ENABLE_64}") + list( + APPEND + test_utility_files + # MDNS utilities + ${SOURCE_DIR}/mdns_test/mdns_address_change_test.c + ${SOURCE_DIR}/mdns_test/mdns_announcement_in_multiple_packets_test.c + ${SOURCE_DIR}/mdns_test/mdns_basic_ipv6_announcement_test.c + ${SOURCE_DIR}/mdns_test/mdns_basic_ipv6_query_test.c + ${SOURCE_DIR}/mdns_test/mdns_basic_ipv6_response_test.c + ${SOURCE_DIR}/mdns_test/mdns_case_insensitivity_test.c + ${SOURCE_DIR}/mdns_test/mdns_client_passive_test.c + ${SOURCE_DIR}/mdns_test/mdns_continuous_query_interval_test.c + ${SOURCE_DIR}/mdns_test/mdns_continuous_query_test.c + ${SOURCE_DIR}/mdns_test/mdns_continuous_query_unique_answer_test.c + ${SOURCE_DIR}/mdns_test/mdns_dns_sd_query_test.c + ${SOURCE_DIR}/mdns_test/mdns_dns_sd_response_test.c + ${SOURCE_DIR}/mdns_test/mdns_duplicate_answer_suppression_test.c + ${SOURCE_DIR}/mdns_test/mdns_duplicate_question_suppression_test.c + ${SOURCE_DIR}/mdns_test/mdns_known_answer_ignored_test.c + ${SOURCE_DIR}/mdns_test/mdns_known_answer_suppression_query_half_ttl_test.c + ${SOURCE_DIR}/mdns_test/mdns_known_answer_suppression_query_test.c + ${SOURCE_DIR}/mdns_test/mdns_known_answer_suppression_response_test.c + ${SOURCE_DIR}/mdns_test/mdns_known_answer_suppression_unique_test.c + ${SOURCE_DIR}/mdns_test/mdns_multiple_questions_per_query_test.c + ${SOURCE_DIR}/mdns_test/mdns_poof_test.c + ${SOURCE_DIR}/mdns_test/mdns_probing_conflict_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_and_response_chaos_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_during_probing_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_http_tcp_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_pdl_datastram_tcp_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_printer_tcp_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_rr_timeout_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_smb_tcp_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_start_stop_test.c + ${SOURCE_DIR}/mdns_test/mdns_query_with_tc_test.c + ${SOURCE_DIR}/mdns_test/mdns_response_aggregation_test.c + ${SOURCE_DIR}/mdns_test/mdns_response_interval_test.c + ${SOURCE_DIR}/mdns_test/mdns_response_in_multiple_packets_test.c + ${SOURCE_DIR}/mdns_test/mdns_response_no_delay_test.c + ${SOURCE_DIR}/mdns_test/mdns_response_to_address_query_test.c + ${SOURCE_DIR}/mdns_test/mdns_response_with_tc_test.c + ${SOURCE_DIR}/mdns_test/mdns_server_announcement_with_txt_test.c + ${SOURCE_DIR}/mdns_test/mdns_server_interface_reset.c + ${SOURCE_DIR}/mdns_test/mdns_server_send_goodbye_test.c + ${SOURCE_DIR}/mdns_test/netx_mdns_run_test_case.c + # PTP utilities + ${SOURCE_DIR}/ptp_test/netx_ptp_utility.c) + endif() + list(APPEND test_utility_files + # TAHI utilities + ${SOURCE_DIR}/tahi_test/netx_tahi_run_test_case.c) +endif() +add_library(test_utility ${test_utility_files}) +target_link_libraries(test_utility PUBLIC azrtos::${PRODUCT}) +target_include_directories(test_utility PUBLIC ${SOURCE_DIR}/test + ${SOURCE_DIR}/tahi_test) +target_compile_definitions(test_utility PUBLIC BATCH_TEST CTEST) +if("-DNX_TAHI_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + add_library(tahi SHARED IMPORTED) + if($ENV{ENABLE_64}) + set_target_properties(tahi PROPERTIES IMPORTED_LOCATION + ${SOURCE_DIR}/tahi_test/tahi64.so) + else() + set_target_properties(tahi PROPERTIES IMPORTED_LOCATION + ${SOURCE_DIR}/tahi_test/tahi.so) + endif() + target_link_libraries(test_utility PUBLIC tahi) +endif() + +if($ENV{ENABLE_64}) + set(test_cases ${netxduo_test_cases} ${dhcp_test_cases} ${dns_test_cases}) +elseif($ENV{DHCP_ONLY}) + set(test_cases ${dhcp_test_cases}) +elseif($ENV{DNS_ONLY}) + set(test_cases ${dns_test_cases}) +else() + set(test_cases + ${auto_ip_test_cases} + ${bsd_test_cases} + ${cloud_test_cases} + ${dhcp_test_cases} + ${dns_test_cases} + ${ftp_test_cases} + ${http_test_cases} + ${ipsec_test_cases} + ${mdns_test_cases} + ${nat_test_cases} + ${netxduo_test_cases} + ${websocket_test_cases} + ${pop3_test_cases} + ${ppp_test_cases} + ${pppoe_test_cases} + ${ptp_test_cases} + ${rtp_test_cases} + ${rtsp_test_cases} + ${smtp_test_cases} + ${snmp_test_cases} + ${sntp_test_cases} + ${tahi_test_cases} + ${tahi_dhcpv6_test_cases} + ${telnet_test_cases} + ${tftp_test_cases}) +endif() + +foreach(test_case ${test_cases}) + get_filename_component(test_name ${test_case} NAME_WE) + add_executable(${test_name} ${test_case}) + target_link_libraries(${test_name} PRIVATE test_utility) + add_test(${CMAKE_BUILD_TYPE}::${test_name} ${test_name}) +endforeach() diff --git a/test/cmake/netxduo/run.sh b/test/cmake/netxduo/run.sh new file mode 100755 index 00000000..ff51762d --- /dev/null +++ b/test/cmake/netxduo/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd $(dirname $0) + +# if threadx repo does not exist, clone it +[ -d ../threadx ] || git clone https://github.com/azure-rtos/threadx.git ../threadx --depth 1 +[ -d ../filex ] || git clone https://github.com/azure-rtos/filex.git ../filex --depth 1 +[ -f .run.sh ] || ln -sf ../threadx/scripts/cmake_bootstrap.sh .run.sh +./.run.sh $* \ No newline at end of file diff --git a/test/cmake/netxduo/samples/CMakeLists.txt b/test/cmake/netxduo/samples/CMakeLists.txt new file mode 100644 index 00000000..a2241c69 --- /dev/null +++ b/test/cmake/netxduo/samples/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) +cmake_policy(SET CMP0057 NEW) + +project(samples LANGUAGES C) + +set(SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../../samples) + +set(sample_files + ${SOURCE_DIR}/demo_netxduo_dns.c + ${SOURCE_DIR}/demo_netxduo_ftp.c + ${SOURCE_DIR}/demo_netxduo_http.c + ${SOURCE_DIR}/demo_netxduo_snmp.c + ${SOURCE_DIR}/demo_netxduo_sntp_client.c + ${SOURCE_DIR}/demo_netxduo_telnet.c + ${SOURCE_DIR}/demo_netxduo_tftp.c + ${SOURCE_DIR}/demo_netx_duo_tcp.c + ${SOURCE_DIR}/demo_netx_duo_udp.c) + +if("-DNX_BSD_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + list(APPEND sample_files ${SOURCE_DIR}/demo_bsd_raw.c + ${SOURCE_DIR}/demo_bsd_tcp.c ${SOURCE_DIR}/demo_bsd_udp.c) +endif() +if("-DNX_MAX_PHYSICAL_INTERFACES" IN_LIST ${CMAKE_BUILD_TYPE}) + list(APPEND sample_files ${SOURCE_DIR}/demo_netx_duo_multihome_tcp.c + ${SOURCE_DIR}/demo_netx_duo_multihome_udp.c) +endif() +if(("-DNX_PPP_PPPOE_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) + AND NOT ("-DNX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE" IN_LIST + ${CMAKE_BUILD_TYPE})) + list(APPEND sample_files ${SOURCE_DIR}/demo_netx_pppoe_client.c + ${SOURCE_DIR}/demo_netx_pppoe_server.c) +endif() +if(NOT ("-DNX_DISABLE_IPV6" IN_LIST ${CMAKE_BUILD_TYPE})) + list(APPEND sample_files ${SOURCE_DIR}/demo_netxduo_dhcpv6_client.c) +endif() +if(NOT "-DNX_DISABLE_IPV4" IN_LIST ${CMAKE_BUILD_TYPE}) + list( + APPEND + sample_files + ${SOURCE_DIR}/demo_netxduo_smtp_client.c + ${SOURCE_DIR}/demo_netxduo_multihome_dhcp_client.c + ${SOURCE_DIR}/demo_netx_ppp.c + ${SOURCE_DIR}/demo_netx_duo_ptp_client.c + ${SOURCE_DIR}/demo_netxduo_dhcp.c + ${SOURCE_DIR}/demo_netxduo_pop3_client.c + ${SOURCE_DIR}/demo_netx_auto_ip.c) +endif() +if((NOT "-DNX_DISABLE_IPV4" IN_LIST ${CMAKE_BUILD_TYPE}) + AND NOT ("-DNX_DISABLE_PACKET_CHAIN" IN_LIST ${CMAKE_BUILD_TYPE})) + list(APPEND sample_files ${SOURCE_DIR}/demo_netx_secure_tls.c) +endif() + +if("-DNX_BSD_RAW_SUPPORT" IN_LIST ${CMAKE_BUILD_TYPE}) + set(sample_files "") +endif() + +foreach(sample_file ${sample_files}) + get_filename_component(sample_file_name ${sample_file} NAME_WE) + add_executable(${sample_file_name} ${sample_file}) + target_link_libraries(${sample_file_name} PRIVATE azrtos::${PRODUCT}) +endforeach() diff --git a/test/regression/auto_ip_test/netx_auto_ip_address_check_test.c b/test/regression/auto_ip_test/netx_auto_ip_address_check_test.c new file mode 100644 index 00000000..8b064f81 --- /dev/null +++ b/test/regression/auto_ip_test/netx_auto_ip_address_check_test.c @@ -0,0 +1,325 @@ +/* This is a small demo of the NetX TCP/IP stack using the AUTO IP module. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_arp.h" + +#include "nx_auto_ip.h" +#include "nx_ram_network_driver_test_1500.h" + + +#define DEMO_STACK_SIZE 4096 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the AUTO IP structures for each IP instance. */ + +static NX_AUTO_IP auto_ip_0; + + +/* Define the counters used in the demo application... */ +static ULONG address_changes; +static ULONG error_counter; +static UINT checkNum; +static ULONG conn_ip_address; +static UINT check_source_phyAddr; +static UINT check_source_ip; +static UINT check_dest_phyAddr; +static UINT check_dest_ip; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_address_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + check_source_phyAddr = NX_FALSE; + check_source_ip = NX_FALSE; + check_dest_phyAddr = NX_FALSE; + check_dest_ip = NX_FALSE; + + /* Initializes the variables. */ + error_counter = 0; + checkNum = NX_AUTO_IP_PROBE_NUM + NX_AUTO_IP_ANNOUNCE_NUM; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 4096, 1); + pointer = pointer + 4096; + + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Create the AutoIP instance for each IP instance. */ + status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); + pointer = pointer + 4096; + + /* Check AutoIP create status. */ + if (status) + error_counter++; + + /* Start both AutoIP instances. */ + status = nx_auto_ip_start(&auto_ip_0, IP_ADDRESS(169,254,10,10)); + + /* Check AutoIP start status. */ + if (status) + error_counter++; + + + /* Register an IP address change function for each IP instance. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_changed, (void *) &auto_ip_0); + + /* Check IP address change notify status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +ULONG network_mask; + + printf("NetX Test: Auto_IP Address Check Processing Test....................."); + + advanced_packet_process_callback = my_arp_packet_process; + + /* Wait for IP address to be resolved. */ + tx_thread_sleep(NX_AUTO_IP_PROBE_MAX * checkNum * NX_IP_PERIODIC_RATE); + + /* Call IP status check routine. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the current IP address. */ + + nx_ip_address_get(&ip_0, &conn_ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((conn_ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (conn_ip_address < IP_ADDRESS(169, 254, 1, 0)) || (conn_ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_stop(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_delete(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + + if ((error_counter) ||(check_source_phyAddr != NX_TRUE) || (check_source_ip != NX_TRUE) || (check_dest_phyAddr != NX_TRUE) || (check_dest_ip != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address) +{ + +ULONG ip_address; +ULONG network_mask; +NX_AUTO_IP *auto_ip_ptr; + + + /* Setup pointer to auto IP instance. */ + auto_ip_ptr = (NX_AUTO_IP *) auto_ip_address; + + /* Pickup the current IP address. */ + nx_ip_address_get(ip_ptr, &ip_address, &network_mask); + + /* Determine if the IP address has changed back to zero. If so, make sure the + AutoIP instance is started. */ + if (ip_address == 0) + { + + /* Get the last AutoIP address for this node. */ + nx_auto_ip_get_address(auto_ip_ptr, &ip_address); + + /* Start this AutoIP instance. */ + nx_auto_ip_start(auto_ip_ptr, ip_address); + } + + /* Determine if the IP address has transitioned to a non local IP address. */ + else if ((ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0)) + { + + /* Stop the AutoIP processing. */ + nx_auto_ip_stop(auto_ip_ptr); + + /* Delete the AutoIP instance. */ + nx_auto_ip_delete(auto_ip_ptr); + } + + /* Increment a counter. */ + address_changes++; +} + + + +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +ULONG *message_ptr; +ULONG sender_physical_msw; +ULONG sender_physical_lsw; +ULONG sender_ip_address; +ULONG target_physical_msw; +ULONG target_physical_lsw; +ULONG target_ip_address; +UINT message_type; + + /* Setup a pointer to the ARP message. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Pickup the ARP message type. */ + message_type = (UINT) (*(message_ptr+1) & 0xFFFF); + + /* Pick up the sender's physical address from the message. */ + sender_physical_msw = (*(message_ptr+2) >> 16); + sender_physical_lsw = (*(message_ptr+2) << 16) | (*(message_ptr+3) >> 16); + sender_ip_address = (*(message_ptr+3) << 16) | (*(message_ptr+4) >> 16); + target_physical_msw = (*(message_ptr+4) >> 16); + target_physical_lsw = (*(message_ptr+5)); + target_ip_address = (*(message_ptr+6)); + + if (message_type != NX_ARP_OPTION_REQUEST) + error_counter++; + else + { + if((sender_physical_msw == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_physical_address_msw) && (sender_physical_lsw == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_physical_address_lsw)) + check_source_phyAddr = NX_TRUE; + if(sender_ip_address == 0) + check_source_ip = NX_TRUE; + if((target_physical_msw == 0) && (target_physical_lsw == 0)) + check_dest_phyAddr = NX_TRUE; + if(target_ip_address == IP_ADDRESS(169,254,10,10)) + check_dest_ip = NX_TRUE; + } + + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; + + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_address_check_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Auto_IP Address Check Processing Test.....................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/auto_ip_test/netx_auto_ip_announce_num_test.c b/test/regression/auto_ip_test/netx_auto_ip_announce_num_test.c new file mode 100644 index 00000000..80e25aa6 --- /dev/null +++ b/test/regression/auto_ip_test/netx_auto_ip_announce_num_test.c @@ -0,0 +1,307 @@ +/* Having probed to determine a unique address to use, the host MUST then announce its claimed address by broadcasting + ANNOUNCE_NUM ARP announcements, spaced ANNOUNCE_INTERVAL seconds apart. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_arp.h" + +#include "nx_auto_ip.h" +#include "nx_ram_network_driver_test_1500.h" + + +#define DEMO_STACK_SIZE 4096 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the AUTO IP structures for each IP instance. */ + +static NX_AUTO_IP auto_ip_0; + + +/* Define the counters used in the demo application... */ +static ULONG address_changes; +static ULONG error_counter; +static UINT checkNum; +static ULONG conn_ip_address; +static UINT announce_num; +static UINT current_time; +static UINT start_time; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_announce_num_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + + /* Initializes the variables. */ + error_counter = 0; + announce_num = 0; + current_time = 0; + start_time = 0; + checkNum = NX_AUTO_IP_PROBE_NUM + NX_AUTO_IP_ANNOUNCE_NUM; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 4096, 1); + pointer = pointer + 4096; + + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Create the AutoIP instance for each IP instance. */ + status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); + pointer = pointer + 4096; + + /* Check AutoIP create status. */ + if (status) + error_counter++; + + /* Start both AutoIP instances. */ + status = nx_auto_ip_start(&auto_ip_0, IP_ADDRESS(169,254,10,10)); + + /* Check AutoIP start status. */ + if (status) + error_counter++; + + + /* Register an IP address change function for each IP instance. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_changed, (void *) &auto_ip_0); + + /* Check IP address change notify status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +ULONG network_mask; + + printf("NetX Test: Auto_IP Announce NUM Processing Test......................"); + + advanced_packet_process_callback = my_arp_packet_process; + + /* Wait for IP address to be resolved. */ + tx_thread_sleep(NX_AUTO_IP_PROBE_MAX * checkNum * NX_IP_PERIODIC_RATE); + + /* Call IP status check routine. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the current IP address. */ + + nx_ip_address_get(&ip_0, &conn_ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((conn_ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (conn_ip_address < IP_ADDRESS(169, 254, 1, 0)) || (conn_ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_stop(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_delete(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter) ||(announce_num != NX_AUTO_IP_ANNOUNCE_NUM)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address) +{ + +ULONG ip_address; +ULONG network_mask; +NX_AUTO_IP *auto_ip_ptr; + + + /* Setup pointer to auto IP instance. */ + auto_ip_ptr = (NX_AUTO_IP *) auto_ip_address; + + /* Pickup the current IP address. */ + nx_ip_address_get(ip_ptr, &ip_address, &network_mask); + + /* Determine if the IP address has changed back to zero. If so, make sure the + AutoIP instance is started. */ + if (ip_address == 0) + { + + /* Get the last AutoIP address for this node. */ + nx_auto_ip_get_address(auto_ip_ptr, &ip_address); + + /* Start this AutoIP instance. */ + nx_auto_ip_start(auto_ip_ptr, ip_address); + } + + /* Determine if the IP address has transitioned to a non local IP address. */ + else if ((ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0)) + { + + /* Stop the AutoIP processing. */ + nx_auto_ip_stop(auto_ip_ptr); + + /* Delete the AutoIP instance. */ + nx_auto_ip_delete(auto_ip_ptr); + } + + /* Increment a counter. */ + address_changes++; +} + + + +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +ULONG *message_ptr; +UINT message_type; + + /* Setup a pointer to the ARP message. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + + /* Pickup the ARP message type. */ + message_type = (UINT) (*(message_ptr+1) & 0xFFFF); + + if (message_type != NX_ARP_OPTION_REQUEST) + error_counter++; + else + { + if(announce_num == 0) + { + start_time = tx_time_get(); + announce_num++; + } + else + { + current_time = tx_time_get(); + + if(current_time >= start_time + (announce_num * NX_IP_PERIODIC_RATE * NX_AUTO_IP_ANNOUNCE_INTERVAL)) + announce_num++; + } + } + + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + + if(announce_num == NX_AUTO_IP_ANNOUNCE_NUM) + advanced_packet_process_callback = NULL; + + return NX_TRUE; + + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_announce_num_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Auto_IP Announce NUM Processing Test......................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/auto_ip_test/netx_auto_ip_arp_dest_addr_test.c b/test/regression/auto_ip_test/netx_auto_ip_arp_dest_addr_test.c new file mode 100644 index 00000000..d0ea8b13 --- /dev/null +++ b/test/regression/auto_ip_test/netx_auto_ip_arp_dest_addr_test.c @@ -0,0 +1,501 @@ +/* This is a small demo of the NetX TCP/IP stack using the AUTO IP module. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_auto_ip.h" +#include "nx_arp.h" +#include "nx_ram_network_driver_test_1500.h" + + + +#define DEMO_STACK_SIZE 4096 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET client_socket; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; + + +/* Define the AUTO IP structures for each IP instance. */ + +static NX_AUTO_IP auto_ip_0; +static NX_AUTO_IP auto_ip_1; + + +/* Define the counters used in the demo application... */ +static ULONG address_changes; +static ULONG error_counter; +static ULONG packet_counter; +static UINT checkNum; +static ULONG conn_ip_address; +static UINT is_arped; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_arp_dest_addr_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initializes the variables. */ + error_counter = 0; + packet_counter = 0; + is_arped = NX_FALSE; + + checkNum = NX_AUTO_IP_PROBE_NUM + NX_AUTO_IP_ANNOUNCE_NUM; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 4096, 1); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Create the AutoIP instance for each IP instance. */ + status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); + pointer = pointer + 4096; + status += nx_auto_ip_create(&auto_ip_1, "AutoIP 1", &ip_1, pointer, 4096, 2); + pointer = pointer + 4096; + + /* Check AutoIP create status. */ + if (status) + error_counter++; + + /* Start both AutoIP instances. */ + status = nx_auto_ip_start(&auto_ip_0, 0 /*IP_ADDRESS(169,254,254,255)*/); + status += nx_auto_ip_start(&auto_ip_1, 0 /*IP_ADDRESS(169,254,254,255)*/); + + /* Check AutoIP start status. */ + if (status) + error_counter++; + + /* Register an IP address change function for each IP instance. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_changed, (void *) &auto_ip_0); + status += nx_ip_address_change_notify(&ip_1, ip_address_changed, (void *) &auto_ip_1); + + /* Check IP address change notify status. */ + if (status) + error_counter++; + + /* Create semaphores. */ + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + + /* Check semaphore create status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG network_mask; + + printf("NetX Test: Auto_IP ARP Destination Address Processing Test..........."); + + advanced_packet_process_callback = my_arp_packet_process; + + status = tx_semaphore_get(&sema_0, (NX_AUTO_IP_PROBE_NUM * NX_AUTO_IP_PROBE_MAX + NX_AUTO_IP_ANNOUNCE_NUM * NX_AUTO_IP_ANNOUNCE_INTERVAL) * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup thread_1. */ + tx_semaphore_put(&sema_1); + + /* Pickup the current IP address. */ + + nx_ip_address_get(&ip_0, &conn_ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((conn_ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (conn_ip_address < IP_ADDRESS(169, 254, 1, 0)) || (conn_ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check status. */ + if (status) + error_counter++; + + + + /* Setup this thread to listen. */ + + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Server socket disconnect the connection. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisted on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Stop the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_stop(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_delete(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG network_mask; + + status = tx_semaphore_get(&sema_1, (NX_AUTO_IP_PROBE_NUM * NX_AUTO_IP_PROBE_MAX + NX_AUTO_IP_ANNOUNCE_NUM * NX_AUTO_IP_ANNOUNCE_INTERVAL) * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_semaphore_get(&sema_1, TX_WAIT_FOREVER); + + /* Pickup the current IP address. */ + nx_ip_address_get(&ip_1, &ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (ip_address < IP_ADDRESS(169, 254, 1, 0)) || (ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, conn_ip_address, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Stop the AutoIP instance auto_ip_1. */ + status = nx_auto_ip_stop(&auto_ip_1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the AutoIP instance auto_ip_1. */ + status = nx_auto_ip_delete(&auto_ip_1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter) || (is_arped != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address) +{ + +ULONG ip_address; +ULONG network_mask; +NX_AUTO_IP *auto_ip_ptr; + + + /* Setup pointer to auto IP instance. */ + auto_ip_ptr = (NX_AUTO_IP *) auto_ip_address; + + /* Pickup the current IP address. */ + nx_ip_address_get(ip_ptr, &ip_address, &network_mask); + + /* Determine if the IP address has changed back to zero. If so, make sure the + AutoIP instance is started. */ + if (ip_address == 0) + { + + /* Get the last AutoIP address for this node. */ + nx_auto_ip_get_address(auto_ip_ptr, &ip_address); + + /* Start this AutoIP instance. */ + nx_auto_ip_start(auto_ip_ptr, ip_address); + } + + /* Determine if the IP address has transitioned to a non local IP address. */ + else if ((ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0)) + { + + /* Stop the AutoIP processing. */ + nx_auto_ip_stop(auto_ip_ptr); + + /* Delete the AutoIP instance. */ + nx_auto_ip_delete(auto_ip_ptr); + } + + /* Increment a counter. */ + address_changes++; + + /* Wakeup test threads. */ + if(ip_ptr == &ip_0) + tx_semaphore_put(&sema_0); + else + tx_semaphore_put(&sema_1); +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +ULONG *message_ptr; +UINT message_type; +#if 0 +ULONG target_ip_address; +#endif + + /* Setup a pointer to the ARP message. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Pickup the ARP message type. */ + message_type = (UINT) (*(message_ptr+1) & 0xFFFF); +#if 0 + target_ip_address = (*(message_ptr+6)); +#endif + + if (message_type != NX_ARP_OPTION_REQUEST) + error_counter++; + else + { +#if 0 + /* Not clear about the purpose here. Removed by Tiejun. */ + if(target_ip_address == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_ip_address) +#endif + is_arped = NX_TRUE; + advanced_packet_process_callback = NULL; + } + + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + + + return NX_TRUE; + + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_arp_dest_addr_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Auto_IP ARP Destination Address Processing Test...........N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/auto_ip_test/netx_auto_ip_basic_test.c b/test/regression/auto_ip_test/netx_auto_ip_basic_test.c new file mode 100644 index 00000000..a6ae5e54 --- /dev/null +++ b/test/regression/auto_ip_test/netx_auto_ip_basic_test.c @@ -0,0 +1,438 @@ +/* This is a small demo of the NetX TCP/IP stack using the AUTO IP module. */ + +#include "nx_auto_ip.h" +#include "tx_api.h" +#include "nx_api.h" + + +#define DEMO_STACK_SIZE 4096 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET client_socket; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; + + +/* Define the AUTO IP structures for each IP instance. */ + +static NX_AUTO_IP auto_ip_0; +static NX_AUTO_IP auto_ip_1; + + +/* Define the counters used in the demo application... */ +static ULONG address_changes; +static ULONG error_counter; +static ULONG packet_counter; +static ULONG conn_ip_address; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initializes the variables. */ + error_counter = 0; + packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 4096, 1); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Create the AutoIP instance for each IP instance. */ + status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); + pointer = pointer + 4096; + status += nx_auto_ip_create(&auto_ip_1, "AutoIP 1", &ip_1, pointer, 4096, 2); + pointer = pointer + 4096; + + /* Check AutoIP create status. */ + if (status) + error_counter++; + + /* Start both AutoIP instances. */ + status = nx_auto_ip_start(&auto_ip_0, 0 /*IP_ADDRESS(169,254,254,255)*/); + status += nx_auto_ip_start(&auto_ip_1, 0 /*IP_ADDRESS(169,254,254,255)*/); + + /* Check AutoIP start status. */ + if (status) + error_counter++; + + /* Register an IP address change function for each IP instance. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_changed, (void *) &auto_ip_0); + status += nx_ip_address_change_notify(&ip_1, ip_address_changed, (void *) &auto_ip_1); + + /* Check IP address change notify status. */ + if (status) + error_counter++; + + /* Create semaphores. */ + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + + /* Check semaphore create status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG network_mask; + + printf("NetX Test: Auto_IP Basic Processing Test............................."); + + status = tx_semaphore_get(&sema_0, (NX_AUTO_IP_PROBE_NUM * NX_AUTO_IP_PROBE_MAX + NX_AUTO_IP_ANNOUNCE_NUM * NX_AUTO_IP_ANNOUNCE_INTERVAL) * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup thread_1. */ + tx_semaphore_put(&sema_1); + + /* Pickup the current IP address. */ + + nx_ip_address_get(&ip_0, &conn_ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((conn_ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (conn_ip_address < IP_ADDRESS(169, 254, 1, 0)) || (conn_ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check status. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Server socket disconnect the connection. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisted on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Stop the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_stop(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_delete(&auto_ip_0); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG network_mask; + + status = tx_semaphore_get(&sema_1, (NX_AUTO_IP_PROBE_NUM * NX_AUTO_IP_PROBE_MAX + NX_AUTO_IP_ANNOUNCE_NUM * NX_AUTO_IP_ANNOUNCE_INTERVAL) * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_semaphore_get(&sema_1, TX_WAIT_FOREVER); + + /* Pickup the current IP address. */ + nx_ip_address_get(&ip_1, &ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (ip_address < IP_ADDRESS(169, 254, 1, 0)) || (ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, conn_ip_address, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Stop the AutoIP instance auto_ip_1. */ + status = nx_auto_ip_stop(&auto_ip_1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the AutoIP instance auto_ip_1. */ + status = nx_auto_ip_delete(&auto_ip_1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address) +{ + +ULONG ip_address; +ULONG network_mask; +NX_AUTO_IP *auto_ip_ptr; + + + /* Setup pointer to auto IP instance. */ + auto_ip_ptr = (NX_AUTO_IP *) auto_ip_address; + + /* Pickup the current IP address. */ + nx_ip_address_get(ip_ptr, &ip_address, &network_mask); + + /* Determine if the IP address has changed back to zero. If so, make sure the + AutoIP instance is started. */ + if (ip_address == 0) + { + + /* Get the last AutoIP address for this node. */ + nx_auto_ip_get_address(auto_ip_ptr, &ip_address); + + /* Start this AutoIP instance. */ + nx_auto_ip_start(auto_ip_ptr, ip_address); + } + + /* Determine if the IP address has transitioned to a non local IP address. */ + else if ((ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0)) + { + + /* Stop the AutoIP processing. */ + nx_auto_ip_stop(auto_ip_ptr); + + /* Delete the AutoIP instance. */ + nx_auto_ip_delete(auto_ip_ptr); + } + + /* Increment a counter. */ + address_changes++; + + /* Wakeup test threads. */ + if(ip_ptr == &ip_0) + tx_semaphore_put(&sema_0); + else + tx_semaphore_put(&sema_1); +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Auto_IP Basic Processing Test.............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c b/test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c new file mode 100644 index 00000000..5586a280 --- /dev/null +++ b/test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c @@ -0,0 +1,320 @@ +/* This is a small demo of the NetX TCP/IP stack using the AUTO IP module. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_arp.h" + +#include "nx_auto_ip.h" +#include "nx_ram_network_driver_test_1500.h" + + +#define DEMO_STACK_SIZE 4096 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the AUTO IP structures for each IP instance. */ + +static NX_AUTO_IP auto_ip_0; + + +/* Define the counters used in the demo application... */ +static ULONG address_changes; +static ULONG error_counter; +static UINT checkNum; +static UINT conflicts_check_counter; +static UINT conflicts_counter; +static UINT is_conflicted; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_conflicts_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + + /* Initializes the variables. */ + error_counter = 0; + conflicts_check_counter = 0; + conflicts_counter = 0; + is_conflicted = NX_FALSE; + + checkNum = NX_AUTO_IP_PROBE_NUM + NX_AUTO_IP_ANNOUNCE_NUM; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 4096, 1); + pointer = pointer + 4096; + + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Create the AutoIP instance for each IP instance. */ + status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); + pointer = pointer + 4096; + + /* Check AutoIP create status. */ + if (status) + error_counter++; + + /* Start both AutoIP instances. */ + status = nx_auto_ip_start(&auto_ip_0, IP_ADDRESS(169,254,10,10)); + + /* Check AutoIP start status. */ + if (status) + error_counter++; + + + /* Register an IP address change function for each IP instance. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_changed, (void *) &auto_ip_0); + + /* Check IP address change notify status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +UINT i; + + printf("NetX Test: Auto_IP Conflicts Check Processing Test..................."); + + advanced_packet_process_callback = my_arp_packet_process; + + + /* Wait for IP address to be resolved. */ + for(i=0; i nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Pickup the ARP message type. */ + message_type = (UINT) (*(message_ptr+1) & 0xFFFF); + + /* Pick up the sender's physical address from the message. */ + sender_physical_msw = (*(message_ptr+2) >> 16); + sender_physical_lsw = (*(message_ptr+2) << 16) | (*(message_ptr+3) >> 16); + target_ip_address = (*(message_ptr+6)); + + if (message_type != NX_ARP_OPTION_REQUEST) + error_counter++; + else + { + if((sender_physical_msw == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_physical_address_msw) && (sender_physical_lsw == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_physical_address_lsw) + && (target_ip_address == IP_ADDRESS(169,254,10,10)) && (conflicts_check_counter == 0)) + { + sender_physical_msw = 0; + conflicts_check_counter = 1; + conflicts_counter = auto_ip_0.nx_auto_ip_conflict_count; + } + else if(conflicts_check_counter == 1) + { + if(auto_ip_0.nx_auto_ip_conflict_count == (conflicts_counter + 1)) + is_conflicted = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + } + + } + + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + + return NX_TRUE; + + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_conflicts_check_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Auto_IP Conflicts Check Processing Test...................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/auto_ip_test/netx_auto_ip_max_conflicts_test.c b/test/regression/auto_ip_test/netx_auto_ip_max_conflicts_test.c new file mode 100644 index 00000000..c7f35731 --- /dev/null +++ b/test/regression/auto_ip_test/netx_auto_ip_max_conflicts_test.c @@ -0,0 +1,304 @@ +/* This is a small demo of the NetX TCP/IP stack using the AUTO IP module. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_arp.h" +#include "nx_auto_ip.h" +#include "nx_ram_network_driver_test_1500.h" + + +#define DEMO_STACK_SIZE 4096 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the AUTO IP structures for each IP instance. */ + +static NX_AUTO_IP auto_ip_0; + + +/* Define the counters used in the demo application... */ +static ULONG error_counter; +static UINT current_time; +static UINT start_time; +static UINT arp_probe; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_max_conflicts_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initializes the variables. */ + error_counter = 0; + current_time = 0; + start_time = 0; + arp_probe = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 4096, 1); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + + /* Create the AutoIP instance for each IP instance. */ + status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); + pointer = pointer + 4096; + + /* Check AutoIP create status. */ + if (status) + error_counter++; + + /* Start both AutoIP instances. */ + status = nx_auto_ip_start(&auto_ip_0, IP_ADDRESS(169,254,10,10)); + + /* Check AutoIP start status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +ULONG conn_ip_address; +ULONG network_mask; + + printf("NetX Test: Auto_IP MAX Conflicts Processing Test....................."); + + advanced_packet_process_callback = my_arp_packet_process; + + /* Call IP status check routine. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &actual_status, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the current IP address. */ + nx_ip_address_get(&ip_0, &conn_ip_address, &network_mask); + + /* Check whether the AutoIP allocates addresses in the range of 169.254.1.0 through 169.254.254.255.*/ + if((conn_ip_address & 0xFFFF0000UL) != IP_ADDRESS(169, 254, 0, 0) || (conn_ip_address < IP_ADDRESS(169, 254, 1, 0)) || (conn_ip_address > IP_ADDRESS(169, 254, 254, 255))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_stop(&auto_ip_0); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the AutoIP instance auto_ip_0. */ + status = nx_auto_ip_delete(&auto_ip_0); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if ((error_counter) || (arp_probe != (NX_AUTO_IP_MAX_CONFLICTS + 2)) || + (auto_ip_0.nx_auto_ip_conflict_count != (NX_AUTO_IP_MAX_CONFLICTS + 1))) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +ULONG *message_ptr; +UINT message_type; +ULONG sender_mac_msw; +ULONG sender_mac_lsw; +ULONG sender_ip; +ULONG receive_mac_msw; +ULONG receive_mac_lsw; +ULONG receive_ip; +NX_PACKET *conflict_packet; + + + /* Setup a pointer to the ARP message. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 6)); + + /* Pickup the ARP message type. */ + message_type = (UINT)(*(message_ptr+1) & 0xFFFF); + + /* Pick up the mac and ip address. */ + sender_mac_msw = (*(message_ptr + 2) >> 16); + sender_mac_lsw = ((*(message_ptr + 2) & 0x0000FFFF) << 16) | (*(message_ptr + 3) >> 16); + sender_ip = ((*(message_ptr + 3) & 0x0000FFFF) << 16) | (*(message_ptr + 4) >> 16); + receive_mac_msw = (*(message_ptr + 4) & 0x0000FFFF); + receive_mac_lsw = (*(message_ptr + 5)); + receive_ip = *(message_ptr + 6); + + /* Check if ARP probe. */ + if ((message_type != NX_ARP_OPTION_REQUEST) || + (sender_mac_msw != ip_ptr -> nx_ip_interface[0].nx_interface_physical_address_msw) || + (sender_mac_lsw != ip_ptr -> nx_ip_interface[0].nx_interface_physical_address_lsw) || + (sender_ip != 0) || + (receive_mac_msw != 0) || + (receive_mac_lsw != 0) || + (receive_ip != auto_ip_0.nx_auto_ip_current_local_address)) + { + error_counter++; + return NX_TRUE; + } + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 6)); + + /* Update the arp counter. */ + arp_probe ++; + + /* Check the arp counter. */ + if (arp_probe <= (NX_AUTO_IP_MAX_CONFLICTS + 1)) + { + + /* Check the conflict count. */ + if (arp_probe != (auto_ip_0.nx_auto_ip_conflict_count + 1)) + { + error_counter++; + return NX_TRUE; + } + + /* Initialize the conflict start time. */ + if (arp_probe == (NX_AUTO_IP_MAX_CONFLICTS + 1)) + start_time = tx_time_get(); + + /* Inject conflict arp. */ + if (nx_packet_copy(packet_ptr, &conflict_packet, &pool_0, NX_NO_WAIT)) + { + error_counter++; + return NX_TRUE; + } + + /* Setup a pointer to the conflict ARP message. */ + message_ptr = (ULONG *) conflict_packet -> nx_packet_prepend_ptr; + + /* Just change the sender mac of probe to act as conflict ARP. */ + *(message_ptr + 2) -= 1; + + /* Receive conflict arp. */ + _nx_arp_packet_deferred_receive(ip_ptr, conflict_packet); + } + else + { + current_time = tx_time_get(); + + /* Check the extra delay. */ + if ((current_time - start_time) < (NX_IP_PERIODIC_RATE * NX_AUTO_IP_RATE_LIMIT_INTERVAL)) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_auto_ip_max_conflicts_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Auto_IP MAX Conflicts Processing Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/bsd_test_setup.docx b/test/regression/bsd_test/bsd_test_setup.docx new file mode 100644 index 00000000..38b4c031 Binary files /dev/null and b/test/regression/bsd_test/bsd_test_setup.docx differ diff --git a/test/regression/bsd_test/netx_bsd_aton_test.c b/test/regression/bsd_test/netx_bsd_aton_test.c new file mode 100644 index 00000000..6ac48238 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_aton_test.c @@ -0,0 +1,106 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD ntest_0; +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +static ULONG error_counter; + +/* Define the ThreadX and NetX object control blocks... */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_aton_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + +} + +static void ntest_0_entry(ULONG thread_input) +{ + +struct in_addr in_val; +int status; + + printf("NetX Test: Basic BSD aton Test..........................."); + + status = inet_aton("11.10.10.10", &in_val); + if((status != 1) || (in_val.s_addr != htonl(0x0b0a0a0a))) + error_counter++; + + status = inet_aton("11.10.2570", &in_val); /* 2570 == 0x0a0a */ + if((status != 1) || (in_val.s_addr != htonl(0x0b0a0a0a))) + error_counter++; + + status = inet_aton("11.657930", &in_val); /* 657930 == 0x0a0a0a */ + if((status != 1) || (in_val.s_addr != htonl(0x0b0a0a0a))) + error_counter++; + + /* octal */ + status = inet_aton("013.012.012.012", &in_val); + if((status != 1) || (in_val.s_addr != htonl(0x0b0a0a0a))) + error_counter++; + + /* hex */ + status = inet_aton("0xb.0xa.0xa.0xa", &in_val); + if((status != 1) || (in_val.s_addr != htonl(0x0b0a0a0a))) + error_counter++; + + /* decimal, octal and hex */ + status = inet_aton("11.012.0xa.10", &in_val); + if((status != 1) || (in_val.s_addr != htonl(0x0b0a0a0a))) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_aton_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD aton Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_getaddrinfo_test.c b/test/regression/bsd_test/netx_bsd_getaddrinfo_test.c new file mode 100644 index 00000000..2c89d554 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_getaddrinfo_test.c @@ -0,0 +1,1276 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef NX_BSD_ENABLE +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#include "nxd_dns.h" +#else +#include "nx_bsd.h" +#include "nx_dns.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +static char response_cname_www_baidu_com[100] = { +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x00, 0x56, 0xa6, 0x10, 0x00, 0x00, 0x40, 0x11, +0x52, 0xcc, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xc7, 0x20, 0x00, 0x42, +0x1b, 0x3d, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, +0x77, 0x77, 0x05, 0x62, 0x61, 0x69, 0x64, 0x75, +0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x05, 0x00, +0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, +0x00, 0x01, 0xe7, 0x00, 0x0f, 0x03, 0x77, 0x77, +0x77, 0x01, 0x61, 0x06, 0x73, 0x68, 0x69, 0x66, +0x65, 0x6e, 0xc0, 0x16 }; + +static char response_a_www_baidu_com[132] = { +0x00, 0x15, 0x5d, 0x64, 0x17, 0x05, 0x8c, 0xec, /* ..]d.... */ +0x4b, 0x68, 0xd1, 0xfe, 0x08, 0x00, 0x45, 0x00, /* Kh....E. */ +0x00, 0x76, 0x63, 0x9e, 0x40, 0x00, 0x40, 0x11, /* .vc.@.@. */ +0x8d, 0x6d, 0xc0, 0xa8, 0x64, 0x02, 0xc0, 0xa8, /* .m..d... */ +0x64, 0x18, 0x00, 0x35, 0xc1, 0x9f, 0x00, 0x62, /* d..5...b */ +0x23, 0x29, 0x11, 0x95, 0x81, 0x80, 0x00, 0x01, /* #)...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, /* .......w */ +0x77, 0x77, 0x05, 0x62, 0x61, 0x69, 0x64, 0x75, /* ww.baidu */ +0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, /* .com.... */ +0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x02, 0x01, 0x00, 0x0f, 0x03, 0x77, 0x77, /* ......ww */ +0x77, 0x01, 0x61, 0x06, 0x73, 0x68, 0x69, 0x66, /* w.a.shif */ +0x65, 0x6e, 0xc0, 0x16, 0xc0, 0x2b, 0x00, 0x01, /* en...+.. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, /* ..... .. */ +0x73, 0xef, 0xd2, 0x1b, 0xc0, 0x2b, 0x00, 0x01, /* s....+.. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, /* ..... .. */ +0x73, 0xef, 0xd3, 0x70 /* s..p */ +}; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static NX_DNS client_dns; +static NX_UDP_SOCKET udp_socket; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +#define DNS_START_OFFSET (14 + 20 + 8) +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT response_sequence; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *send_buffer = "Hello World"; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +#ifdef __PRODUCT_NETXDUO__ +static char large_msg[1000]; +#endif +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_getaddrinfo_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check BSD enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; +#ifdef FEATURE_NX_IPV6 +static ULONG stack_space6[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread6[NUM_CLIENTS]; +#endif +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; +int sockaddr_len; +fd_set read_fds, write_fds, except_fds; +struct timeval wait_time; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 remote_address; +#else +struct sockaddr_in remote_address; +#endif + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + if(message_id == 2) + { +#ifdef FEATURE_NX_IPV6 + sockaddr_len = sizeof(struct sockaddr_in6); +#else + sockaddr_len = sizeof(struct sockaddr_in); +#endif + ret = recvfrom(sockfd, (char*)buf, sizeof(buf), 0, (struct sockaddr*)&remote_address, &sockaddr_len); + + if(ret < 0) + error_counter++; + if(nx_bsd_socket_array[sockfd - 0x20].nx_bsd_socket_family == AF_INET) + { + if(sockaddr_len != sizeof(struct sockaddr_in)) + error_counter++; + if(((struct sockaddr_in*)&remote_address) -> sin_family != AF_INET) + error_counter++; + if(((struct sockaddr_in*)&remote_address) -> sin_addr.s_addr != htonl(0x01020305)) + error_counter++; + } +#ifdef FEATURE_NX_IPV6 + else if(nx_bsd_socket_array[sockfd - 0x20].nx_bsd_socket_family == AF_INET6) + { + if(sockaddr_len != sizeof(struct sockaddr_in6)) + error_counter++; + if((remote_address.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_address.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_address.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_address.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + } +#endif + } + else + { + + /* Peek message test. */ + ret = recv(sockfd, buf, sizeof(buf), MSG_PEEK); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + ret = recv(sockfd, buf, sizeof(buf), 0); + } + if(ret <= 0) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Invoke recvfrom with MSG_DONTWAIT flag. */ + ret = recvfrom(sockfd, (char*)buf, sizeof(buf), MSG_DONTWAIT, (struct sockaddr*)&remote_address, &sockaddr_len); + if(ret >= 0) + error_counter++; + else if((errno != EWOULDBLOCK) || (errno != EAGAIN)) + error_counter++; + + /* Invoke recv with MSG_DONTWAIT flag. */ + ret = recv(sockfd, (char*)buf, sizeof(buf), MSG_DONTWAIT); + if(ret >= 0) + error_counter++; + else if((errno != EWOULDBLOCK) || (errno != EAGAIN)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + /* Invoke send with MSG_DONTWAIT flag. The message is larger than tx_window. Partial data should be sent. */ + ret = send(sockfd, large_msg, sizeof(large_msg), MSG_DONTWAIT); + if (ret <= 0) + error_counter++; +#endif + + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + FD_ZERO(&except_fds); + FD_SET(sockfd, &read_fds); + FD_SET(sockfd, &write_fds); + FD_SET(sockfd, &except_fds); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + wait_time.tv_sec = 1; + wait_time.tv_usec = 0; + select(sockfd + 1, &read_fds, &write_fds, &except_fds, &wait_time); + if((FD_ISSET(sockfd, &read_fds) && FD_ISSET(sockfd, &write_fds) && FD_ISSET(sockfd, &except_fds)) == 0) + error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in local_addr; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 local_addr6; +int port; +int sockfd1; +#endif +int bytes_sent; +int ret; +char buf; +struct addrinfo *server_info; + + if (getaddrinfo("1.2.3.5", "12", NX_NULL, &server_info) != 0) + { + error_counter++; + return; + } + + sockfd = socket(server_info -> ai_family, server_info -> ai_socktype, + server_info -> ai_protocol); + if(sockfd < 0) + error_counter++; + + if(connect(sockfd, server_info -> ai_addr, server_info -> ai_addrlen) < 0) + error_counter++; + + freeaddrinfo(server_info); + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Get the port bind to any. */ + port = nx_bsd_socket_array[sockfd - NX_BSD_SOCKFD_START].nx_bsd_socket_tcp_socket -> nx_tcp_socket_port; + + sockfd1 = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd1 < 0) + error_counter++; + + memset(&local_addr6, 0, sizeof(local_addr6)); + local_addr6.sin6_family = AF_INET6; + local_addr6.sin6_port = htons(port); + + /* Bind to the same port. */ + ret = bind(sockfd1, (struct sockaddr*)&local_addr6, sizeof(local_addr6)); + if(ret < 0) + error_counter++; + + ret = soc_close(sockfd1); + if(ret < 0) + error_counter++; +#endif + + /* Call recv before peer orderly shutdown. */ + ret = recv(sockfd, &buf, 1, 0); + if (ret != 0) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + /* Call recv after peer orderly shutdown. */ + ret = recv(sockfd, &buf, 1, 0); + if (ret != 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +struct addrinfo hints, *server_info; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + + if (getaddrinfo(NX_NULL, "12345", &hints, &server_info) != 0) + { + error_counter++; + return; + } + + sockfd = socket(server_info -> ai_family, server_info -> ai_socktype, + server_info -> ai_protocol); + if(sockfd < 0) + error_counter++; + + ret = bind(sockfd, server_info -> ai_addr, server_info -> ai_addrlen); + if(ret < 0) + error_counter++; + + freeaddrinfo(server_info); + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin_family != AF_INET) + error_counter++; + else if(local_addr.sin_port != htons(12345)) + error_counter++; + else if(local_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1, 2, 3, 4))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin_family != AF_INET) + error_counter++; + else if(remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) + error_counter++; + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + + +#ifdef FEATURE_NX_IPV6 +static void test_tcp_client6(void) +{ +int sockfd; +int bytes_sent; +int ret; +struct addrinfo *server_info; + + if (getaddrinfo("fe80::211:22ff:fe33:4457", "12", NX_NULL, &server_info) != 0) + { + error_counter++; + return; + } + + sockfd = socket(server_info -> ai_family, server_info -> ai_socktype, + server_info -> ai_protocol); + if(sockfd < 0) + error_counter++; + + if(connect(sockfd, server_info -> ai_addr, server_info -> ai_addrlen) < 0) + error_counter++; + + freeaddrinfo(server_info); + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (INT)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +struct addrinfo hints, *server_info; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + + if (getaddrinfo(NX_NULL, "12346", &hints, &server_info) != 0) + { + error_counter++; + return; + } + + sockfd = socket(server_info -> ai_family, server_info -> ai_socktype, + server_info -> ai_protocol); + if(sockfd < 0) + error_counter++; + + ret = bind(sockfd, server_info -> ai_addr, server_info -> ai_addrlen); + if(ret < 0) + error_counter++; + + freeaddrinfo(server_info); + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + + if(address_length != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin6_family != AF_INET6) + error_counter++; + else if(local_addr.sin6_port != htons(12346)) + error_counter++; + else if((local_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip0.nxd_ip_address.v6[0])) || + (local_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip0.nxd_ip_address.v6[1])) || + (local_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip0.nxd_ip_address.v6[2])) || + (local_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip0.nxd_ip_address.v6[3]))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin6_family != AF_INET6) + error_counter++; + else if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread6[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space6[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +#endif + +static void close_before_accept_test() +{ +int server_fd, client_fd; +int ret; +struct sockaddr_in remote_addr, local_addr; + + /* Setup server socket. */ + server_fd = socket(AF_INET, SOCK_STREAM, 0); + if(server_fd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(server_fd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(server_fd, 5); + if(ret < 0) + error_counter++; + + /* Setup client socket. */ + client_fd = socket(AF_INET, SOCK_STREAM, 0); + if(client_fd < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12345); + remote_addr.sin_addr.s_addr = htonl(0x01020304); + + if(connect(client_fd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + /* Close before calling accept. */ + soc_close(server_fd); + soc_close(client_fd); +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in remote_addr; +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif +int ret; + + + printf("NetX Test: Basic BSD getaddrinfo Test...................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = (CHAR)(ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (CHAR)(ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + close_before_accept_test(); + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client4(); + + tx_semaphore_put(&sema_1); + test_tcp_server4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client6(); + + tx_semaphore_put(&sema_1); + test_tcp_server6(); +#endif + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Now open another socket and attempt to connect to the an incorrect + remote host so we expect an unsuccessful connections. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020306); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + + if(errno != ETIMEDOUT) + error_counter++; + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* After the previous failed connection, make sure we can still open a socket. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[i]); + + + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } + + +} + + +#ifdef FEATURE_NX_IPV6 +static void multiple_client6(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nxd_tcp_client_socket_connect(&tcp_sockets[i], &ipv6_address_ip0, 12346, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char *)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } + +} +#endif + +static void netx_tcp_server(void) +{ +NX_PACKET *packet_ptr; +UINT status; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != strlen(send_buffer))) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&sema_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} + +static UINT nx_dns_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, + USHORT transmit_id, UCHAR *data, UINT length) +{ +UINT status; +NX_PACKET *response_packet; +UCHAR *data_ptr; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, data + DNS_START_OFFSET, length - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = length - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(transmit_id >> 8); + *data_ptr = (UCHAR)transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(server_socket, response_packet, IP_ADDRESS(1, 2, 3, 4), port); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ +NX_PACKET *packet_ptr; +USHORT transmit_id; +UCHAR *data_ptr; +UINT port; + + nx_udp_socket_receive(socket_ptr, &packet_ptr, NX_NO_WAIT); + nx_udp_packet_info_extract(packet_ptr, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Get the DNS transmit ID. */ + data_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + transmit_id = *data_ptr++; + transmit_id = (USHORT)((transmit_id << 8) | *data_ptr); + + nx_packet_release(packet_ptr); + + if (response_sequence == 0) + { + nx_dns_response_packet_send(socket_ptr, port, transmit_id, response_a_www_baidu_com, sizeof(response_a_www_baidu_com)); + } + else + { + nx_dns_response_packet_send(socket_ptr, port, transmit_id, response_cname_www_baidu_com, sizeof(response_cname_www_baidu_com)); + } + + response_sequence++; +} + +static void dns_test() +{ +struct addrinfo hints, *addrinfo; + + /* Initialize DNS client. */ + nx_dns_create(&client_dns, &ip_0, (UCHAR *)"DNS Client"); +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + nx_dns_packet_pool_set(&client_dns, &pool_0); +#endif + nx_dns_server_add(&client_dns, IP_ADDRESS(1, 2, 3, 5)); + + /* Create a UDP socket to respond DNS query. */ + nx_udp_socket_create(&ip_1, &udp_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + nx_udp_socket_bind(&udp_socket, 53, TX_WAIT_FOREVER); + nx_udp_socket_receive_notify(&udp_socket, receive_packet_function); + response_sequence = 0; + + /* Get CName by getaddrinfo. */ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_CANONNAME; + if (getaddrinfo("www.baidu.com", "80", &hints, &addrinfo) != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + if (addrinfo -> ai_canonname == NX_NULL) + { + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + if (strcmp(addrinfo -> ai_canonname, "www.a.shifen.com")) +#else + if (strcmp(addrinfo -> ai_canonname, "www.baidu.com")) +#endif + { + printf("ERROR!\n"); + test_control_return(1); + } + freeaddrinfo(addrinfo); + + nx_udp_socket_unbind(&udp_socket); + nx_udp_socket_delete(&udp_socket); + nx_dns_delete(&client_dns); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_BSD_ENABLE_DNS + dns_test(); +#endif + + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + multiple_client4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_put(&sema_0); + netx_tcp_server(); + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + multiple_client6(); +#endif + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#endif /* NX_BSD_ENABLE */ diff --git a/test/regression/bsd_test/netx_bsd_inet_addr_pton_test.c b/test/regression/bsd_test/netx_bsd_inet_addr_pton_test.c new file mode 100644 index 00000000..b0a1222f --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_inet_addr_pton_test.c @@ -0,0 +1,136 @@ +/* This NetX test concentrates on the basic BSD utility function, inet_addr and inet_pton which + both call inet_aton for converting addresses into a in_addr numeric format. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD ntest_0; +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +static ULONG error_counter; + + +/* Define the ThreadX and NetX object control blocks... */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_inet_addr_pton_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + +} + +static void ntest_0_entry(ULONG thread_input) +{ + +struct in_addr in_val; +UCHAR ipv4_addr_num1[4] = {0x1, 0x2, 0x3, 0x4}; + +CHAR *ipv4_addr_str1 = "1.2.3.4"; +CHAR *ipv4_addr_str2 = "1.2.3.g"; +UCHAR ipv4_addr[4]; +UINT status; + + + printf("NetX Test: Basic BSD inet_addr inet_pton Test............"); + + in_val.s_addr = inet_addr("10.10.10.10"); + + if((in_val.s_addr == 0xFFFFFFFF) || (in_val.s_addr != 0x0a0a0a0a)) + error_counter++; + + in_val.s_addr = inet_addr("10.10.2570"); /* 2570 == 0x0a0a */ + if((in_val.s_addr == 0xFFFFFFFF) || (in_val.s_addr != 0x0a0a0a0a)) + error_counter++; + + in_val.s_addr = inet_addr("10.657930"); /* 657930 == 0x0a0a0a */ + if((in_val.s_addr == 0xFFFFFFFF) || (in_val.s_addr != 0x0a0a0a0a)) + error_counter++; + + /* octal */ + in_val.s_addr = inet_addr("012.012.012.012"); + if((in_val.s_addr == 0xFFFFFFFF) || (in_val.s_addr != 0x0a0a0a0a)) + error_counter++; + + /* hex */ + in_val.s_addr = inet_addr("0xa.0xa.0xa.0xa"); + if((in_val.s_addr == 0xFFFFFFFF) || (in_val.s_addr != 0x0a0a0a0a)) + error_counter++; + + /* decimal, octal and hex */ + in_val.s_addr = inet_addr("10.012.0xa.10"); + if((in_val.s_addr == 0xFFFFFFFF) || (in_val.s_addr != 0x0a0a0a0a)) + error_counter++; + + /* Invalid IP address. */ + in_val.s_addr = inet_addr("10.10.10,10.10"); + if(in_val.s_addr != 0xFFFFFFFF) + error_counter++; + + /* Invalid IP address char */ + in_val.s_addr = inet_addr("10.10.1h"); + if(in_val.s_addr != 0xFFFFFFFF) + error_counter++; + + /* Invalid first character. */ + in_val.s_addr = inet_addr("a0.10.1h"); + if(in_val.s_addr != 0xFFFFFFFF) + error_counter++; + + status = inet_pton(AF_INET, ipv4_addr_str1, ipv4_addr); + if((status != 1) && (memcmp(ipv4_addr, ipv4_addr_num1, 4) != 0 )) + error_counter++; + + status = inet_pton(AF_INET, ipv4_addr_str2, ipv4_addr); + if(status != 0) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_inet_addr_pton_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: Basic BSD inet_addr inet_pton Test............N/A\n"); + test_control_return(3); +} + +#endif diff --git a/test/regression/bsd_test/netx_bsd_ioctl_nonblocking_test.c b/test/regression/bsd_test/netx_bsd_ioctl_nonblocking_test.c new file mode 100644 index 00000000..8a5b0839 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_ioctl_nonblocking_test.c @@ -0,0 +1,1369 @@ +/* This NetX test concentrates on the basic BSD non-blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *send_buffer = "Hello World"; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_ioctl_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 2); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status != TX_SUCCESS) + error_counter++; +} + + +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static ULONG stack_blocking_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; + +#ifdef FEATURE_NX_IPV6 +static ULONG stack_space6[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread6[NUM_CLIENTS]; +#endif +static TX_THREAD helper_thread[NUM_CLIENTS]; +static TX_THREAD helper_blocking_thread[NUM_CLIENTS]; + +static VOID bsd_server_blocking_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; + /* Note the socket is already in non-blocking mode. */ + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + ret = recv(sockfd, buf, sizeof(buf), 0); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id&3])) || strncmp(buf, requests[message_id&3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id&3], strlen(response[message_id&3]), 0); + if(ret != (int)strlen(response[message_id&3])) + error_counter++; + + /* Wait until client received. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + tx_semaphore_put(&sema_0); + return; + +} +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +fd_set read_fd, except_fd; +struct timeval tv; +char buf[30]; + /* Note the socket is already in non-blocking mode. */ + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + FD_ZERO(&except_fd); + FD_SET(sockfd, &except_fd); + + tv.tv_sec = 1; + tv.tv_usec = 0; + + ret = select(sockfd + 1, &read_fd, NULL, &except_fd, &tv); + if(ret < 0) + { + error_counter++; + return; + } + if(ret == 1) + { + /* Check for read_fd */ + if(FD_ISSET(sockfd, &read_fd)) + { + ret = recv(sockfd, buf, sizeof(buf), 0); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id&3])) || strncmp(buf, requests[message_id&3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id&3], strlen(response[message_id&3]), 0); + if(ret != (int)strlen(response[message_id&3])) + error_counter++; + + /* Wait until client received. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + } + } + else error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + +static void test_tcp_blocking_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +int ioctl_arg; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + /* Set the socket to non-blocking mode. */ + ioctl_arg = NX_TRUE; + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + /* Set the socket to blocking mode. */ + ioctl_arg = NX_FALSE; + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin_family != AF_INET) + error_counter++; + else if(local_addr.sin_port != htons(12345)) + error_counter++; + else if(local_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1, 2, 3, 4))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin_family != AF_INET) + error_counter++; + else if(remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) + error_counter++; + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_blocking_thread[i], "helper thread", bsd_server_blocking_helper_thread_entry, + i, stack_blocking_space[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } + +} + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +fd_set read_fd; +struct timeval tv; +int error, len; +int ioctl_arg = NX_TRUE; + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + /* Set the socket to non-blocking mode. */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + tv.tv_sec = 2; + tv.tv_usec = 0; + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + continue; + } + } + } + ret = soc_close(newsock); + if(ret != 0) + error_counter++; + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +#ifdef FEATURE_NX_IPV6 + +static void test_tcp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +fd_set read_fd; +struct timeval tv; +int error, len; +int ioctl_arg = NX_TRUE; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12346); + + /* Set the socket to non-blocking mode. */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + tv.tv_sec = 2; + tv.tv_usec = 0; + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + address_length = sizeof(remote_addr); + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(struct sockaddr_in6)) + error_counter++; + else if(remote_addr.sin6_family != AF_INET6) + error_counter++; + else if((remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread6[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space6[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + continue; + } + } + } + ret = soc_close(newsock); + if(ret < 0) + error_counter++; + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} +#endif + + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +fd_set write_fd; +struct timeval tv; +int bytes_sent; +int error, len; +int ioctl_arg = NX_TRUE; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + soc_close(sockfd); + return; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + { + error_counter++; + return; + } + } + + /* Now select on the socket. */ + + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + ret = select(FD_SETSIZE, NULL, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &write_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret != 0) + { + error_counter++; + return; + } + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + } +} + +#ifdef FEATURE_NX_IPV6 +static void test_tcp_client6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +fd_set write_fd; +struct timeval tv; +int bytes_sent; +int error, len; +int ioctl_arg = NX_TRUE; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(12); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1.nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1.nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1.nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1.nxd_ip_address.v6[3]); + + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + soc_close(sockfd); + return; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + { + error_counter++; + return; + } + } + + /* Now select on the socket. */ + + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + ret = select(sockfd + 1, NULL, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &write_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret != 0) + { + error_counter++; + return; + } + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (INT)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + } +} + +#endif /*FEATURE_NX_IPV6 */ +static void ntest_0_entry(ULONG thread_input) +{ +int retry; +int sockfd; +struct sockaddr_in remote_addr; +int ret; +fd_set read_fd, write_fd; +struct timeval tv; +int ioctl_arg = NX_TRUE; +#ifdef FEATURE_NX_IPV6 +UINT status; +char mac_ip0[6]; +char mac_ip1[6]; +#endif + printf("NetX Test: Basic BSD TCP Ioctl Non Blocking Connect Test."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + /* Server run first. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + test_tcp_client4(); + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + +#ifdef FEATURE_NX_IPV6 + /* Server run first. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + test_tcp_client6(); + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server6(); +#endif + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + /* blocking test. */ + test_tcp_blocking_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ + retry = 0; + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + error_counter++; + } + + do + { + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + + ret = select(sockfd + 1, &read_fd, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret == 0) + { + retry++; + if(retry == 31) + error_counter++; + } + else if(ret < 1) + { + error_counter++; + } + else if(FD_ISSET(sockfd, &write_fd)) + break; + }while(error_counter == 0); + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + } + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + + /* Now open another socket and attempt to connect to the an incorrect + remote host so we expect an unsuccessful connections. */ + retry = 0; + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(ioctl(sockfd, FIONBIO, &ioctl_arg)) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + error_counter++; + } + + do + { + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + + ret = select(sockfd + 1, &read_fd, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret == 0) + { + retry++; + if(retry == 31) + error_counter++; + } + else if(ret < 1) + { + error_counter++; + } + else if((FD_ISSET(sockfd, &write_fd))) + break; + }while(error_counter == 0); + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + } + + + + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + + test_control_return(0); + +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i&3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i&3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 0); +#ifdef NX_DISABLE_RESET_DISCONNECT + if((status != NX_SUCCESS) && (status != NX_NOT_CONNECTED)) + error_counter++; +#endif + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + + tx_semaphore_put(&sema_1); + } +} + + +#ifdef FEATURE_NX_IPV6 +static void multiple_client6(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nxd_tcp_client_socket_connect(&tcp_sockets[i], &ipv6_address_ip0, 12346, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Wait all remote thread close first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 0); +#ifdef NX_DISABLE_RESET_DISCONNECT + if((status != NX_SUCCESS) && (status != NX_NOT_CONNECTED)) + error_counter++; +#endif + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + } + + +} + +#endif + +static void netx_tcp_server(void) +{ + +UINT status; +NX_PACKET *packet_ptr; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length != strlen(send_buffer)) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&sema_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); + +#ifdef FEATURE_NX_IPV6 + /* Wakeup client. */ + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client6(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +#endif + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + return; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + return; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + return; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_ioctl_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Ioctl Non Blocking Connect Test.N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_multicast_test.c b/test/regression/bsd_test/netx_bsd_multicast_test.c new file mode 100644 index 00000000..3a7c8cfe --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_multicast_test.c @@ -0,0 +1,429 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_bsd.h" +#else +#include "nx_ip.h" +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#define MULTICAST_ADDRESS IP_ADDRESS(239, 1, 2, 3) +#define MULTICAST_TTL_VALUE 65 + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef __PRODUCT_NETX__ +#define NX_IPV4_HEADER NX_IP_HEADER +#endif + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_multicast_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; +} + +static void test_udp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +struct ip_mreq mreq; +UCHAR ttl; +int status; +int i; + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + memset(&mreq, 0, sizeof(struct ip_mreq)); + + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + mreq.imr_multiaddr.s_addr = htonl(MULTICAST_ADDRESS); + + status = setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); + if(status) + error_counter++; + + ttl = MULTICAST_TTL_VALUE; + status = setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); + if(status) + error_counter++; + + /* Make sure the address is recorded into the IGMP table. */ + error_counter++; + for(i = 0; i < NX_MAX_MULTICAST_GROUPS; i++) + { +#ifdef __PRODUCT_NETXDUO__ + if(ip_0.nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_count == 0) + continue; + + if((ip_0.nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_list == MULTICAST_ADDRESS) && + (ip_0.nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_interface_list == &(ip_0.nx_ip_interface[0]))) + { + error_counter--; + break; + } +#else + if(ip_0.nx_ip_igmp_join_count[i] == 0) + continue; + + if((ip_0.nx_ip_igmp_join_list[i] == MULTICAST_ADDRESS) && + (ip_0.nx_ip_igmp_join_interface_list[i] == &(ip_0.nx_ip_interface[0]))) + { + error_counter--; + break; + } +#endif + + } + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[0])) || strncmp(buf, requests[0], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + tx_thread_sleep(1); + + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + mreq.imr_multiaddr.s_addr = htonl(MULTICAST_ADDRESS); + status = setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); + + if(status) + error_counter++; + + /* Make sure the address has been removed from the IGMP table. */ + for(i = 0; i < NX_MAX_MULTICAST_GROUPS; i++) + { +#ifdef __PRODUCT_NETXDUO__ + if(ip_0.nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_count == 0) + continue; + + if((ip_0.nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_list == MULTICAST_ADDRESS) && + (ip_0.nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_interface_list == &(ip_0.nx_ip_interface[0]))) + { + error_counter++; + break; + } +#else + if(ip_0.nx_ip_igmp_join_count[i] == 0) + continue; + + if((ip_0.nx_ip_igmp_join_list[i] == MULTICAST_ADDRESS) && + (ip_0.nx_ip_igmp_join_interface_list[i] == &(ip_0.nx_ip_interface[0]))) + { + error_counter++; + break; + } +#endif + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + printf("NetX Test: Basic BSD Multicast Test......................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + test_udp_server4(); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NX_IPV4_HEADER *ipv4_header_ptr; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Enable IGMP */ + status = nx_igmp_enable(&ip_1); + if(status) + error_counter++; + + /* Join the test IGMP group */ + if(nx_igmp_multicast_join(&ip_1, MULTICAST_ADDRESS)) + error_counter++; + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, IP_ADDRESS(1,2,3,4), 12345); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + + /* Verify the TTL value. */ +#ifdef __PRODUCT_NETXDUO__ + ipv4_header_ptr = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_ip_header; +#else + ipv4_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr - 8 - 20); +#endif + if((ipv4_header_ptr -> nx_ip_header_word_2 >> 24) != MULTICAST_TTL_VALUE) + error_counter++; + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_multicast_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD Multicast Test......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_ntoa_test.c b/test/regression/bsd_test/netx_bsd_ntoa_test.c new file mode 100644 index 00000000..78c59ad8 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_ntoa_test.c @@ -0,0 +1,123 @@ +/* This NetX test concentrates on inet_ntoa function. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD ntest_0; +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the ThreadX and NetX object control blocks... */ +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static ULONG error_counter; + +/* Define the ThreadX and NetX object control blocks... */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_ntoa_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 1024); + pointer = pointer + 1024; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, DEMO_STACK_SIZE, 1); + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = bsd_initialize(&ip_0, &pool_0, pointer, DEMO_STACK_SIZE, 2); + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ + +struct in_addr in_val; +INT status; +ULONG addr; +CHAR *addr_str; +CHAR *ret; + + printf("NetX Test: Basic BSD ntoa Test..........................."); + + addr_str = "11.10.10.10"; + addr = htonl(0x0b0a0a0a); + status = inet_aton(addr_str, &in_val); + if ((status != 1) || (in_val.s_addr != addr)) + error_counter++; + + ret = inet_ntoa(in_val); + + if (ret == NX_NULL) + error_counter++; + else if (strcmp(ret, addr_str)) + error_counter++; + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_ntoa_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD ntoa Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_ntop_test.c b/test/regression/bsd_test/netx_bsd_ntop_test.c new file mode 100644 index 00000000..e96f4cc7 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_ntop_test.c @@ -0,0 +1,143 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD ntest_0; +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; + +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 + +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +static ULONG error_counter; + +/* Define the ThreadX and NetX object control blocks... */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_ntop_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Enable BSD */ + status = bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + +} + +static void ntest_0_entry(ULONG thread_input) +{ + +/* Network byte ordered IPv6 adddress. */ + +/* fe80::74ac:2217:530:5d7f */ +ULONG ipv6_addr1[] = {htonl(0xfe800000), htonl(0), htonl(0x74ac2217), htonl(0x5305d7f)}; +/* fe80::74ac:0:530:5d7f */ +ULONG ipv6_addr2[] = {htonl(0xfe800000), htonl(0), htonl(0x74ac0000), htonl(0x5305d7f)}; +/* ::ffff:1.2.3.4 */ +ULONG ipv6_addr3[] = {htonl(0), htonl(0), htonl(0xffff), htonl(0x01020304)}; +/* ::1.2.3.4 */ +ULONG ipv6_addr4[] = {htonl(0), htonl(0), htonl(0), htonl(0x01020304)}; +/* fe80:1232:af65:f3d2:2d28:af23:201:403*/ +ULONG ipv6_addr5[] = {htonl(0xfe801232), htonl(0xaf65f3d2), htonl(0x2d28af23), htonl(0x2010403)}; + + +/* Max Length = 46. "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255" */ +CHAR dst[46]; +const CHAR *rt_ptr; + + + printf("NetX Test: Basic BSD ntop Test..........................."); + + rt_ptr = inet_ntop(AF_INET6, ((VOID *)(&ipv6_addr1[0])), dst, 46); + if((rt_ptr == NX_NULL) || (strcmp(dst, "fe80::74ac:2217:530:5d7f") != 0)) + error_counter++; + + rt_ptr = inet_ntop(AF_INET6, (VOID *)(&ipv6_addr2[0]), dst, 46); + if((rt_ptr == NX_NULL) || (strcmp(dst, "fe80::74ac:0:530:5d7f") != 0)) + error_counter++; + + rt_ptr = inet_ntop(AF_INET6, (VOID *)(&ipv6_addr3[0]), dst, 46); + if((rt_ptr == NX_NULL) || (strcmp(dst, "::ffff:1.2.3.4") != 0)) + error_counter++; + + rt_ptr = inet_ntop(AF_INET6, (VOID *)(&ipv6_addr4[0]), dst, 46); + if((rt_ptr == NX_NULL) || (strcmp(dst, "::1.2.3.4") != 0)) + error_counter++; + + rt_ptr = inet_ntop(AF_INET6, (VOID *)(&ipv6_addr5[0]), dst, 46); + if((rt_ptr == NX_NULL) || (strcmp(dst, "fe80:1232:af65:f3d2:2d28:af23:201:403") != 0)) + error_counter++; + + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +#else +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_ntop_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD ntop Test...........................N/A\n"); + test_control_return(3); +} + +#endif diff --git a/test/regression/bsd_test/netx_bsd_pton_test.c b/test/regression/bsd_test/netx_bsd_pton_test.c new file mode 100644 index 00000000..31b0ab8e --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_pton_test.c @@ -0,0 +1,141 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD ntest_0; +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +static ULONG error_counter; + +/* Define the ThreadX and NetX object control blocks... */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_pton_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + +CHAR *ipv6_addr_str1 = "fe80::74ac:2217:530:5d7f"; +ULONG ipv6_addr_num1[] = {htonl(0xfe800000), htonl(0), htonl(0x74ac2217), htonl(0x05305d7f)}; + +CHAR *ipv6_addr_str2 = "fe80::74ac:0:530:5d7f"; +ULONG ipv6_addr_num2[] = {htonl(0xfe800000), htonl(0), htonl(0x74ac0000), htonl(0x05305d7f)}; + +CHAR *ipv6_addr_str3 = "::ffff:1.2.3.4"; +ULONG ipv6_addr_num3[] = {htonl(0), htonl(0), htonl(0xffff), htonl(0x01020304)}; + +CHAR *ipv6_addr_str4 = "::1.2.3.4"; +ULONG ipv6_addr_num4[] = {htonl(0), htonl(0), htonl(0), htonl(0x01020304)}; + +CHAR *ipv6_addr_str5 = "fe80::74gc:0:p30:5d7f"; + +CHAR *ipv6_addr_str6 = "2001:0000:0000:0003:0000:0000:0000:0053"; +CHAR *ipv6_addr_str6_1 = "2001:0:0:3::0053"; +ULONG ipv6_addr_num6[] = {htonl(0x20010000), htonl(3), htonl(0), htonl(0x53)}; + +CHAR *ipv4_addr_str1 = "1.2.3.4"; +ULONG ipv4_addr_num1[] = {htonl(0x01020304)}; + +CHAR *ipv4_addr_str2 = "1.2.3.g"; + +CHAR *ipv4_addr_str3 = "11.10.2570"; /* 2570 == 0x0a0a */ +ULONG ipv4_addr_num3[] = {htonl(0x0b0a0a0a)}; + +UCHAR ipv6_addr[16]; /* 16*8 == 128 */ +UCHAR ipv4_addr[4]; /* 4*8 == 32 */ + + + printf("NetX Test: Basic BSD pton Test..........................."); + + status = inet_pton(AF_INET6, ipv6_addr_str1, ipv6_addr); + if((status != 1) || (memcmp(ipv6_addr, ipv6_addr_num1, 16) != 0 )) + error_counter++; + + status = inet_pton(AF_INET6, ipv6_addr_str2, ipv6_addr); + if((status != 1) || (memcmp(ipv6_addr, ipv6_addr_num2, 16) != 0 )) + error_counter++; + + status = inet_pton(AF_INET6, ipv6_addr_str3, ipv6_addr); + if((status != 1) || (memcmp(ipv6_addr, ipv6_addr_num3, 16) != 0 )) + error_counter++; + + status = inet_pton(AF_INET6, ipv6_addr_str4, ipv6_addr); + if((status != 1) || (memcmp(ipv6_addr, ipv6_addr_num4, 16) != 0 )) + error_counter++; + + status = inet_pton(AF_INET6, ipv6_addr_str5, ipv6_addr); + if(status != 0) + error_counter++; + + status = inet_pton(AF_INET6, ipv6_addr_str6, ipv6_addr); + if((status != 1) || (memcmp(ipv6_addr, ipv6_addr_num6, 16) != 0 )) + error_counter++; + + status = inet_pton(AF_INET6, ipv6_addr_str6_1, ipv6_addr); + if((status != 1) || (memcmp(ipv6_addr, ipv6_addr_num6, 16) != 0 )) + error_counter++; + + status = inet_pton(AF_INET, ipv4_addr_str1, ipv4_addr); + if((status != 1) || (memcmp(ipv4_addr, ipv4_addr_num1, 4) != 0 )) + error_counter++; + + status = inet_pton(AF_INET, ipv4_addr_str2, ipv4_addr); + if(status != 0) + error_counter++; + + status = inet_pton(AF_INET, ipv4_addr_str3, ipv4_addr); + if((status != 1) || (memcmp(ipv4_addr, ipv4_addr_num3, 4) != 0 )) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +#else +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_pton_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD pton Test...........................N/A\n"); + test_control_return(3); +} + +#endif diff --git a/test/regression/bsd_test/netx_bsd_raw_basic_blocking_test.c b/test/regression/bsd_test/netx_bsd_raw_basic_blocking_test.c new file mode 100644 index 00000000..aeb55049 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_basic_blocking_test.c @@ -0,0 +1,472 @@ +/* This NetX test concentrates on the basic BSD RAW blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 8192 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +extern UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable raw processing for both IP instances. */ + status += nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; +} + +static void test_raw_server_ipv4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +struct sockaddr_ll sock_addr; +int ret; +char buf[30]; +int addrlen; + + + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5)))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)(strlen(requests[0]) + 20)) || strncmp((buf + 20), requests[0], (ret - 20))) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +#ifdef NX_BSD_RAW_SUPPORT + /* Test raw packet type. */ + sockfd = socket(AF_PACKET, SOCK_RAW, 200); + if(sockfd < 0) + error_counter++; + + sock_addr.sll_family = AF_PACKET; + sock_addr.sll_ifindex = 0; + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&sock_addr, sizeof(sock_addr)); + if(ret != (int)strlen(response[0])) + error_counter++; + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +#endif + + + /* Give the reciever a chance to receive the raw data. */ + tx_thread_sleep(2); + +} + +#ifdef FEATURE_NX_IPV6 +static void test_raw_server_ipv6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +char buf[50]; +int addrlen; + + + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + /* Validate the data. */ + if((ret != (INT)(strlen(requests[0]) )) || strncmp((buf ), requests[0], ret )) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Give the reciever a chance to receive the raw data. */ + tx_thread_sleep(2); + +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +UINT status; +char mac_ip0[6]; +char mac_ip1[6]; +#endif + printf("NetX Test: Basic BSD Raw Blocking Test..................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + test_raw_server_ipv4(); + + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ +#if 0 + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; +#endif + + /* Allow the stateless autoaddress configuration/DAD to finish */ + tx_thread_sleep(3); + +#ifdef FEATURE_NX_IPV6 + test_raw_server_ipv6(); +#endif + + validate_bsd_structure(); + tx_thread_sleep(2); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NXD_ADDRESS dest_addr; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Send a RAW packet */ + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1,2,3,4); + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &dest_addr, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + tx_thread_sleep(1); + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#ifdef FEATURE_NX_IPV6 + /* Test IPv6 */ + tx_thread_sleep(5); + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &ipv6_address_ip0, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + tx_thread_sleep(1); + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#endif +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } + +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD Raw Blocking Test...................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_basic_nonblocking_test.c b/test/regression/bsd_test/netx_bsd_raw_basic_nonblocking_test.c new file mode 100644 index 00000000..ef8d098e --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_basic_nonblocking_test.c @@ -0,0 +1,519 @@ +/* This NetX test concentrates on the basic BSD RAW non-blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +extern UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable raw processing for both IP instances. */ + status = nx_ip_raw_packet_enable(&ip_0); + status = nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status != TX_SUCCESS) + error_counter++; +} + +static void test_raw_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +char buf[30]; +fd_set read_fd; +struct timeval tv; +int addrlen; +int error, len; + + + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret > 0) + error_counter++; + else + { + /* Check errno */ + if(errno != EWOULDBLOCK) + error_counter++; + } + + /* Select on the socket. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); +#if 0 + if(error) + error_counter++; +#endif + + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret < 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5)))) + error_counter++; + + /* Validate the data. */ + if(((ret - 20) != (int)strlen(requests[0])) || strncmp((buf + 20), requests[0], (ret - 20))) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} + +#ifdef FEATURE_NX_IPV6 +static void test_raw_server_ipv6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +char buf[50]; +int addrlen; +fd_set read_fd; +struct timeval tv; +int error, len; + + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret > 0) + error_counter++; + else + { + /* Check errno */ + if(errno != EWOULDBLOCK) + error_counter++; + } + + /* Select on the socket. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); +#if 0 + if(error) + error_counter++; +#endif + + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + /* Validate the data. */ + if((ret != (INT)(strlen(requests[0]))) || strncmp(buf , requests[0], ret )) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + printf("NetX Test: Basic BSD RAW Non-Blocking Test..............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + tx_semaphore_put(&sema_1); + + test_raw_server4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_put(&sema_1); + test_raw_server_ipv6(); +#endif + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NXD_ADDRESS dest_addr; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Send a RAW packet */ + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1,2,3,4); + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &dest_addr, 100, 128, 0); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, (char*)response[0], strlen(response[0]))) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Test IPv6 */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &ipv6_address_ip0, 100, 128, 0); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char *)packet_ptr -> nx_packet_prepend_ptr, (char *)response[0], strlen(response[0]))) + error_counter++; + +#endif + tx_semaphore_put(&sema_0); + +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD RAW Non-Blocking Test...............N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_blocking_test.c b/test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_blocking_test.c new file mode 100644 index 00000000..34f765c2 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_blocking_test.c @@ -0,0 +1,469 @@ +/* This NetX test concentrates on the basic BSD RAW blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +extern UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_rx_nohdr_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable raw processing for both IP instances. */ + status += nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; +} + +static void test_raw_server_ipv4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +char buf[30]; +int addrlen; +int option; + + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the RX_NO_HDR option. */ + option = 1; + + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + + if(ret != 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5)))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)(strlen(requests[0]))) || strncmp((buf ), requests[0], (ret))) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + + /* Give the reciever a chance to receive the raw data. */ + tx_thread_sleep(2); + +} + +#ifdef FEATURE_NX_IPV6 +static void test_raw_server_ipv6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +char buf[50]; +int addrlen; +int option; + + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the RX_NO_HDR option. */ + option = 1; + + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + + if(ret != 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + /* Validate the data. */ + if((ret != (INT)(strlen(requests[0]))) || strncmp((buf), requests[0], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Give the reciever a chance to receive the raw data. */ + tx_thread_sleep(2); + +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +UINT status; +char mac_ip0[6]; +char mac_ip1[6]; +#endif + printf("NetX Test: Basic BSD Raw Rx NoHdr Blocking Test.........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + test_raw_server_ipv4(); + + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ +#if 0 + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; +#endif + + /* Allow the stateless autoaddress configuration/DAD to finish */ + tx_thread_sleep(3); + +#ifdef FEATURE_NX_IPV6 + test_raw_server_ipv6(); +#endif + + validate_bsd_structure(); + tx_thread_sleep(2); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NXD_ADDRESS dest_addr; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Send a RAW packet */ + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1,2,3,4); + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &dest_addr, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + tx_thread_sleep(1); + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#ifdef FEATURE_NX_IPV6 + /* Test IPv6 */ + tx_thread_sleep(5); + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &ipv6_address_ip0, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + tx_thread_sleep(1); + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#endif +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } + +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_rx_nohdr_blocking_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD Raw Rx NoHdr Blocking Test..........N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_nonblocking_test.c b/test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_nonblocking_test.c new file mode 100644 index 00000000..445a5df4 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_basic_rx_nohdr_nonblocking_test.c @@ -0,0 +1,542 @@ +/* This NetX test concentrates on the basic BSD RAW non-blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +extern UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_rx_nohdr_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable raw processing for both IP instances. */ + status = nx_ip_raw_packet_enable(&ip_0); + status = nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status != TX_SUCCESS) + error_counter++; +} + +static void test_raw_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +char buf[30]; +fd_set read_fd; +struct timeval tv; +int addrlen; +int option; +int error, len; + + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the RX_NO_HDR option. */ + option = 1; + + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + + if(ret != 0) + error_counter++; + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret > 0) + error_counter++; + else + { + /* Check errno */ + if(errno != EWOULDBLOCK) + error_counter++; + } + + /* Select on the socket. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + /* Set the len. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret < 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5)))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[0])) || strncmp((buf ), requests[0], (ret))) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close down the socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} + +#ifdef FEATURE_NX_IPV6 +static void test_raw_server_ipv6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +char buf[50]; +int addrlen; +fd_set read_fd; +struct timeval tv; +int option; +int error, len; + + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + /* Set the RX_NO_HDR option. */ + option = 1; + + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + + if(ret != 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret > 0) + error_counter++; + else + { + /* Check errno */ + if(errno != EWOULDBLOCK) + error_counter++; + } + + /* Select on the socket. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + /* Set the len. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + /* Validate the data. */ + if((ret != (INT)(strlen(requests[0]))) || strncmp(buf, requests[0], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + printf("NetX Test: Basic BSD RAW RX NoHdr Non-Blocking Test......"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + tx_semaphore_put(&sema_1); + + test_raw_server4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_put(&sema_1); + test_raw_server_ipv6(); +#endif + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NXD_ADDRESS dest_addr; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Send a RAW packet */ + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1,2,3,4); + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &dest_addr, 100, 128, 0); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, (char*)response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#ifdef FEATURE_NX_IPV6 + /* Test IPv6 */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &ipv6_address_ip0, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char *)packet_ptr -> nx_packet_prepend_ptr, (char *)response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#endif + tx_semaphore_put(&sema_0); + +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_basic_rx_nohdr_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD RAW RX NoHdr Non-Blocking Test......N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_bind_connect_test.c b/test/regression/bsd_test/netx_bsd_raw_bind_connect_test.c new file mode 100644 index 00000000..38ecb829 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_bind_connect_test.c @@ -0,0 +1,533 @@ +/* This NetX test concentrates on the basic BSD RAW non-blocking bind to a specific address and connect + send operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#ifdef __PRODUCT_NETX__ +#include "nx_bsd.h" +#else +#include "nxd_bsd.h" +#endif + +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#endif +#include "nx_ipv4.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +static TX_SEMAPHORE sema; +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0[3][3]; +static NXD_ADDRESS ipv6_address_ip1[3][3]; +static char *bsd6_msg[3][3] = {{"BSD6_MSG IF0 LLA", "BSD6_MSG IF0 GA0", "MSD6_MSG IF0 GA1"}, + {"BSD6_MSG IF1 LLA", "BSD6_MSG IF1 GA0", "MSD6_MSG IF1 GA1"}, + {"BSD6_MSG IF2 LLA", "BSD6_MSG IF2 GA0", "MSD6_MSG IF2 GA1"}}; +#endif /* FEATURE_NX_IPV6 */ +static char *bsd4_msg[3] = {"BSD4_MSG 0", "BSD4_MSG 1", "MSD4_MSG 2"}; + +static void validate_bsd_structure(void); + +#define IP0_IF0_V4_ADDR IP_ADDRESS(1,2,3,4) +#define IP0_IF1_V4_ADDR IP_ADDRESS(2,2,3,4) +#define IP0_IF2_V4_ADDR IP_ADDRESS(3,2,3,4) + +#define IP1_IF0_V4_ADDR IP_ADDRESS(1,2,3,5) +#define IP1_IF1_V4_ADDR IP_ADDRESS(2,2,3,5) +#define IP1_IF2_V4_ADDR IP_ADDRESS(3,2,3,5) + +#define ITERATIONS 100 +static ULONG ip0_address[3] = {IP0_IF0_V4_ADDR, IP0_IF1_V4_ADDR, IP0_IF2_V4_ADDR}; +static ULONG ip1_address[3] = {IP1_IF0_V4_ADDR, IP1_IF1_V4_ADDR, IP1_IF2_V4_ADDR}; +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_bind_connect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP0_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Attach a 2nd interface */ + status += nx_ip_interface_attach(&ip_0, "ip_0_second", IP0_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_0, "ip_0_third", IP0_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP1_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_1, "ip_1_second", IP1_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "ip_1_third", IP1_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable RAW processing for both IP instances. */ + status = nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema, "test done", 0); + if (status) + error_counter++; +} + + + + +#ifdef FEATURE_NX_IPV6 +static void test_raw6_on_interface_address(int iface, int address) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; + + + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_port = htons(100); + local_addr.sin6_family = AF_INET6; + if(iface != 3) + { + local_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[0]); + local_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[1]); + local_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[2]); + local_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[3]); + } + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[3]); + + remote_addr.sin6_port = htons(100); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + + ret = send(sockfd, bsd6_msg[iface][address], strlen(bsd6_msg[iface][address]), 0); + if(ret != (INT)strlen(bsd6_msg[iface][address])) + error_counter++; + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + +#endif /* FEATURE_NX_IPV6 */ + +static void test_raw4_on_interface(int i) +{ + +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; + + + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(100); + local_addr.sin_addr.s_addr = htonl(ip0_address[i]); + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(100); + remote_addr.sin_addr.s_addr = htonl(ip1_address[i]); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + ret = send(sockfd, bsd4_msg[i], strlen(bsd4_msg[i]), 0); + if(ret != (int)strlen(bsd4_msg[i])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +static char mac_ip0[6]; +static char mac_ip1[6]; +int j; +int addr_index; +UINT status; +int i; +#endif +int iface; + + + printf("NetX Test: Basic BSD RAW Bind Connect Send Test.........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + + for(i = 0; i < 3; i++) + { + mac_ip0[0] = (char)(ip_0.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (char)(ip_1.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + for(j = 0; j < 3; j ++) + { + if(j == 0) + { + /* First set up IPv6 linklocal addresses. */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ((mac_ip0[0] | 0x2) << 24) | (mac_ip0[1] << 16) | (mac_ip0[2] << 8) | 0xFF; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = (0xFE << 24) | ((mac_ip0[3] | 0x2) << 16) | (mac_ip0[4] << 8) | mac_ip0[5]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = + ((mac_ip1[0] | 0x2) << 24) | (mac_ip1[1] << 16) | (mac_ip1[2] << 8) | 0xFF; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = + (0xFE << 24) | ((mac_ip1[3] | 0x2) << 16) | (mac_ip1[4] << 8) | mac_ip1[5]; + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 10, NX_NULL); + } + else + { + /* Global Adddress */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ipv6_address_ip0[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = ipv6_address_ip0[i][0].nxd_ip_address.v6[3]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = ipv6_address_ip1[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = ipv6_address_ip1[i][0].nxd_ip_address.v6[3]; + + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 64, NX_NULL); + } + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1[i][j].nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0[i][j].nxd_ip_address.v6, 0, mac_ip0); + } + + } + + + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + + + if(status) + error_counter++; +#endif + + /* Wait for the semaphore to signal the other party is ready. */ + tx_semaphore_get(&sema, 2 * NX_IP_PERIODIC_RATE); + + for(iface = 0; iface < 3; iface++) + { + test_raw4_on_interface(iface); + + tx_semaphore_get(&sema, 2 * NX_IP_PERIODIC_RATE); + +#ifdef FEATURE_NX_IPV6 + for(addr_index = 1; addr_index < 3; addr_index++) + { + + test_raw6_on_interface_address(iface, addr_index); + + tx_semaphore_get(&sema, 2 * NX_IP_PERIODIC_RATE); + } + +#endif + } + + + tx_semaphore_delete(&sema); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ +ULONG actual_status; +UINT status; +UINT iface; +NX_PACKET *packet_ptr; +NX_IPV4_HEADER *ipv4_header; +#ifdef FEATURE_NX_IPV6 +NX_IPV6_HEADER *ipv6_header; +UINT addr_index; +#endif + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + tx_semaphore_put(&sema); + + + for(iface = 0; iface < 3; iface++) + { + + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + error_counter++; + continue; + } + + ipv4_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_ip_header; + if(ipv4_header -> nx_ip_header_source_ip != ip0_address[iface]) + error_counter++; + if((ipv4_header -> nx_ip_header_word_2 & 0x00FF0000) != (100 << 16)) + error_counter++; + if(ipv4_header -> nx_ip_header_destination_ip != ip1_address[iface]) + error_counter++; + if((packet_ptr -> nx_packet_length != strlen(bsd4_msg[iface])) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd4_msg[iface], packet_ptr -> nx_packet_length))) + error_counter++; + + nx_packet_release(packet_ptr); + + tx_semaphore_put(&sema); + +#ifdef FEATURE_NX_IPV6 + for(addr_index = 1; addr_index < 3; addr_index++) + { + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, 1 * NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + ipv6_header = (NX_IPV6_HEADER*)packet_ptr -> nx_packet_ip_header; + + if((ipv6_header -> nx_ip_header_source_ip[0] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[0]) || + (ipv6_header -> nx_ip_header_source_ip[1] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[1]) || + (ipv6_header -> nx_ip_header_source_ip[2] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[2]) || + (ipv6_header -> nx_ip_header_source_ip[3] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[3])) + error_counter++; + if((ipv6_header -> nx_ip_header_destination_ip[0] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[0]) || + (ipv6_header -> nx_ip_header_destination_ip[1] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[1]) || + (ipv6_header -> nx_ip_header_destination_ip[2] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[2]) || + (ipv6_header -> nx_ip_header_destination_ip[3] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[3])) + error_counter++; + if((ipv6_header -> nx_ip_header_word_1 & 0x0000FF00) != (100 << 8)) + error_counter++; + + if((packet_ptr -> nx_packet_length != strlen(bsd6_msg[iface][addr_index])) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd6_msg[iface][addr_index], packet_ptr -> nx_packet_length))) + error_counter++; + + nx_packet_release(packet_ptr); + + tx_semaphore_put(&sema); + } +#endif + } +} + +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_bind_connect_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD RAW Bind Connect Send Test..........N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_ping_test.c b/test/regression/bsd_test/netx_bsd_raw_ping_test.c new file mode 100644 index 00000000..08493b7c --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_ping_test.c @@ -0,0 +1,276 @@ +/* This NetX test concentrates on the basic BSD RAW Ping. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_IP_RAW_PACKET_ALL_STACK) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 8192 +#define LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +/* Echo request from 172.31.144.1 to 172.31.159.102. */ +static char echo_request[] = +"\x08\x00\x4d\x50\x00\x01\x00\x0b\x61\x62\x63\x64\x65\x66\x67\x68" \ +"\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x61" \ +"\x62\x63\x64\x65\x66\x67\x68\x69"; +/* Echo reply from 172.31.159.102 to 172.31.144.1. */ +static char echo_reply[] = +"\x00\x00\x55\x50\x00\x01\x00\x0b\x61\x62\x63\x64\x65\x66\x67\x68" \ +"\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x61" \ +"\x62\x63\x64\x65\x66\x67\x68\x69"; +static char receive_buffer[100]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_ping_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * 32); + pointer = pointer + (256 + sizeof(NX_PACKET)) * 32; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(172, 31, 144, 1), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(172, 31, 159, 102), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status += nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Enable raw processing for both IP instances. */ + status += nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +int addrlen; +int option; +UINT i; +UINT original_threshold; + + printf("NetX Test: Basic BSD Raw Ping Test......................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + for (i = 0 ; (i < LOOP) && (error_counter == 0); i++) + { + sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); + if(sockfd < 0) + error_counter++; + + option = 1; + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + if(ret != 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = 0; + remote_addr.sin_addr.s_addr = htonl(IP_ADDRESS(172, 31, 159, 102)); + + if (i == (LOOP >> 1)) + { + + /* Temporarily disable preemption. */ + tx_thread_preemption_change(tx_thread_identify(), 0, &original_threshold); + } + + /* Send echo request. */ + ret = sendto(sockfd, echo_request, sizeof(echo_request) - 1, 0, (struct sockaddr*)&remote_addr, + sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + if (i == (LOOP >> 1)) + { + + /* Special case: close socket before packet is received. */ + /* Close down the socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Restore original preemption threshold. */ + tx_thread_preemption_change(tx_thread_identify(), original_threshold, &original_threshold); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + continue; + } + + /* Receive echo reply. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, receive_buffer, sizeof(receive_buffer), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(172, 31, 159, 102)))) + error_counter++; + + if ((ret != (sizeof(echo_reply) - 1)) || (memcmp(receive_buffer, echo_reply, ret))) + error_counter++; + + /* Close down the socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + validate_bsd_structure(); + tx_thread_sleep(2); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } + +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_ping_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD Raw Ping Test.......................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/bsd_test/netx_bsd_raw_pppoe_test.c b/test/regression/bsd_test/netx_bsd_raw_pppoe_test.c new file mode 100644 index 00000000..c31905ec --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_pppoe_test.c @@ -0,0 +1,560 @@ +/* This NetX test concentrates on the BSD RAW Packet blocking operation for PPPoE traffic. */ +/* This test case covers the following scenarios: + Be able to create socket_1 of PPPOE_SESS for receiving SESS traffice, + socket_2 for receiving PPPOE_DISC traffic + socket_3 for sending either PPPOE_DISC or PPPOE_SESS traffic. +*/ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined (__PRODUCT_NETXDUO__) && defined (NX_BSD_RAW_PPPOE_SUPPORT) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 8192 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static TX_SEMAPHORE ntest1_sem; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); + +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char response[4][32] = {" Response1", " Response2", " Response3", " Response4"}; + +static char rcvBuffer[50]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_pppoe_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2,2,3,4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + if (status) + error_counter++; + + + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable raw processing for both IP instances. */ + status += nx_ip_raw_packet_enable(&ip_0); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; + + tx_semaphore_create(&ntest1_sem, "ntest0 semaphore", 0); +} + + +static char mac_ip0_if0[6]; +static char mac_ip0_if1[6]; + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +struct sockaddr_ll sock_addr_if0; +struct sockaddr_ll sock_addr_if1; +int recv_bytes; +int i, n; +int fromAddr_len; +struct sockaddr_ll fromAddr; +int sock_sess0; +int sock_sess1; +int sock_disc0; +int sock_disc1; +int ioctl_arg; +USHORT type; + + + + printf("NetX Test: Basic BSD PPPoE SESS Blocking Test............"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + mac_ip0_if0[0] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8) & 0xFF; + mac_ip0_if0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0_if0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0_if0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0_if0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0_if0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip0_if1[0] = (ip_0.nx_ip_interface[1].nx_interface_physical_address_msw >> 8) & 0xFF; + mac_ip0_if1[1] = ip_0.nx_ip_interface[1].nx_interface_physical_address_msw & 0xFF; + mac_ip0_if1[2] = (ip_0.nx_ip_interface[1].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0_if1[3] = (ip_0.nx_ip_interface[1].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0_if1[4] = (ip_0.nx_ip_interface[1].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0_if1[5] = ip_0.nx_ip_interface[1].nx_interface_physical_address_lsw & 0xff; + + + /* Creaet sock_sess0 and sock_sess1 for PPPOE_SESS */ + sock_sess0 = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_PPPOE_SESS); + sock_sess1 = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_PPPOE_SESS); + /* Creaet sock_disc0 and sock_disc1 for PPPOE_SESS */ + sock_disc0 = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_PPPOE_DISC); + sock_disc1 = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_PPPOE_DISC); + + /* Validate the sockets. */ + if((sock_sess0 == 0) || (sock_sess1 == 0) || (sock_disc0 == 0) || (sock_disc1 == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* First test that the receiver is able to block on receiving a DISC or a SESS message. */ + sock_addr_if0.sll_family = AF_PACKET; + sock_addr_if0.sll_protocol = ETHERTYPE_PPPOE_SESS; + sock_addr_if0.sll_ifindex = 0; + + tx_semaphore_put(&ntest1_sem); + /* Expect ntest_1 to send one DISC to if0, one DISC to if1, one SESS to if0, one SESS to if1 */ + /* ntest_0 only receives data on recv_sess0 and recv_disc0 */ + + fromAddr_len = sizeof(fromAddr); + recv_bytes = recvfrom(sock_sess0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != (strlen("Request1") + 1 + 14)) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_SESS) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Request1")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 1)) + error_counter++; + + + + recv_bytes = recvfrom(sock_sess0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != (strlen("Request2") + 1 + 14)) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_SESS) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Request2")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 0)) + error_counter++; + + recv_bytes = recvfrom(sock_disc0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != (strlen("Request3") + 1 + 14)) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_DISC) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Request3")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 1)) + error_counter++; + + recv_bytes = recvfrom(sock_disc0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != (strlen("Request4") + 1 + 14)) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_DISC) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Request4")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 0)) + error_counter++; + + /* ntest_0 sends out SESS messages through sock_sess0 (if0) and sock_sess1 (if1). Verify that + ntest_0 is able to receive both messages on sock_sess0. */ + sock_addr_if0.sll_family = AF_PACKET; + sock_addr_if0.sll_ifindex = 0; + + /* Set up response[0] to be SESS packet, send through interface 0 */ + for(i = 0; i < 6; i++) + { + response[0][i] = mac_ip0_if1[i]; + response[0][i + 6] = mac_ip0_if0[i]; + } + response[0][12] = (ETHERTYPE_PPPOE_SESS >> 8); + response[0][13] = ETHERTYPE_PPPOE_SESS & 0xFF; + + n = sendto(sock_sess0, response[0], sizeof(response[0]), 0, (struct sockaddr*)&sock_addr_if0, sizeof(sock_addr_if0)); + if(n != sizeof(response[0])) + error_counter++; + + /* Set up response[1] to be SESS packet, send through interface 1 */ + for(i = 0; i < 6; i++) + { + response[1][i] = mac_ip0_if0[i]; + response[1][i + 6] = mac_ip0_if1[i]; + } + response[1][12] = (ETHERTYPE_PPPOE_SESS >> 8); + response[1][13] = ETHERTYPE_PPPOE_SESS & 0xFF; + + sock_addr_if1.sll_family = AF_PACKET; + sock_addr_if1.sll_protocol = ETHERTYPE_PPPOE_SESS; + sock_addr_if1.sll_ifindex = 1; + + n = sendto(sock_sess0, response[1], sizeof(response[1]), 0, (struct sockaddr*)&sock_addr_if1, sizeof(sock_addr_if1)); + if(n != sizeof(response[1])) + error_counter++; + + recv_bytes = recvfrom(sock_sess0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != sizeof(response[0])) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_SESS) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Response1")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 1)) + error_counter++; + + recv_bytes = recvfrom(sock_sess0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != sizeof(response[1])) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_SESS) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Response2")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 0)) + error_counter++; + + /* Set up response[2] to be DISC packet, send through interface 0 */ + for(i = 0; i < 6; i++) + { + response[2][i] = mac_ip0_if1[i]; + response[2][i + 6] = mac_ip0_if0[i]; + } + response[2][12] = (ETHERTYPE_PPPOE_DISC >> 8); + response[2][13] = ETHERTYPE_PPPOE_DISC & 0xFF; + + sock_addr_if0.sll_protocol = ETHERTYPE_PPPOE_DISC; + + n = sendto(sock_sess0, response[2], sizeof(response[2]), 0, (struct sockaddr*)&sock_addr_if0, sizeof(sock_addr_if0)); + if(n != sizeof(response[0])) + error_counter++; + + sock_addr_if0.sll_family = AF_PACKET; + sock_addr_if0.sll_ifindex = 1; + + /* Set up response[3] to be DISC packet, send through interface 1 */ + for(i = 0; i < 6; i++) + { + response[3][i] = mac_ip0_if0[i]; + response[3][i + 6] = mac_ip0_if1[i]; + } + response[3][12] = (ETHERTYPE_PPPOE_DISC >> 8); + response[3][13] = ETHERTYPE_PPPOE_DISC & 0xFF; + + sock_addr_if1.sll_protocol = ETHERTYPE_PPPOE_DISC; + + n = sendto(sock_sess0, response[3], sizeof(response[3]), 0, (struct sockaddr*)&sock_addr_if1, sizeof(sock_addr_if1)); + if(n != sizeof(response[3])) + error_counter++; + + recv_bytes = recvfrom(sock_disc0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != sizeof(response[2])) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_DISC) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Response3")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 1)) + error_counter++; + + recv_bytes = recvfrom(sock_disc0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes != sizeof(response[3])) + error_counter++; + type = (rcvBuffer[12] << 8) | rcvBuffer[13]; + if(type != ETHERTYPE_PPPOE_DISC) + error_counter++; + + if(strcmp(&rcvBuffer[14], "Response4")) + error_counter++; + + if(fromAddr_len != sizeof(struct sockaddr_ll)) + error_counter++; + + if((fromAddr.sll_family != AF_PACKET) || (fromAddr.sll_ifindex != 0)) + error_counter++; + + + /* Set all sockets to be non-blocking */ + ioctl_arg = NX_TRUE; + if(ioctl(sock_sess0, FIONBIO, &ioctl_arg)) + error_counter++; + + if(ioctl(sock_sess1, FIONBIO, &ioctl_arg)) + error_counter++; + + if(ioctl(sock_disc0, FIONBIO, &ioctl_arg)) + error_counter++; + + if(ioctl(sock_disc1, FIONBIO, &ioctl_arg)) + error_counter++; + + /* Now try to receive from all these sockets and none of them should have any data available for read. */ + recv_bytes = recvfrom(sock_sess0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes > 0) + error_counter++; + recv_bytes = recvfrom(sock_sess1, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes > 0) + error_counter++; + recv_bytes = recvfrom(sock_disc0, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes > 0) + error_counter++; + recv_bytes = recvfrom(sock_disc1, rcvBuffer, sizeof(rcvBuffer), 0, (struct sockaddr*)&fromAddr, &fromAddr_len); + if(recv_bytes > 0) + error_counter++; + + soc_close(sock_sess0); + soc_close(sock_sess1); + soc_close(sock_disc0); + soc_close(sock_disc1); + + validate_bsd_structure(); + tx_thread_sleep(2); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { +#ifdef __PRODUCT_NETX__ + if(nx_bsd_socket_array[i].nx_bsd_socket_in_use) +#else + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) +#endif + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } + +} +static void ntest_1_packet_send(int msg_id, int if_id, int type) +{ +UINT status; +int i; +NX_PACKET *packet_ptr; +NX_IP_DRIVER driver_request; + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); + if(status) + { + error_counter++; + return; + } + + /* Construct the first message as SESS type, sent through interface 0 */ + for(i = 0; i < 6; i++) + { + if(if_id == 0) + { + packet_ptr -> nx_packet_prepend_ptr[i] = mac_ip0_if1[i]; + packet_ptr -> nx_packet_prepend_ptr[i + 6] = mac_ip0_if0[i]; + } + else + { + packet_ptr -> nx_packet_prepend_ptr[i] = mac_ip0_if0[i]; + packet_ptr -> nx_packet_prepend_ptr[i + 6] = mac_ip0_if1[i]; + } + } + packet_ptr -> nx_packet_prepend_ptr[12] = type >> 8; + packet_ptr -> nx_packet_prepend_ptr[13] = type & 0xFF; + memcpy(&packet_ptr -> nx_packet_prepend_ptr[14], requests[msg_id], (strlen(requests[msg_id]) + 1)); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + strlen(requests[msg_id]) + 14 + 1; + packet_ptr -> nx_packet_length = strlen(requests[msg_id]) + 14 + 1; + + + driver_request.nx_ip_driver_ptr = &ip_0; + driver_request.nx_ip_driver_command = NX_LINK_PACKET_PPPOE_SESS_SEND; + driver_request.nx_ip_driver_packet = packet_ptr; + driver_request.nx_ip_driver_interface = &(ip_0.nx_ip_interface[if_id]); + + (driver_request.nx_ip_driver_interface -> nx_interface_link_driver_entry)(&driver_request); + + return; +} + + +static void ntest_1_entry(ULONG thread_input) +{ + + + tx_semaphore_get(&ntest1_sem, NX_IP_PERIODIC_RATE); + + tx_thread_sleep(5); + + ntest_1_packet_send(0, 0, NX_LINK_PACKET_PPPOE_SESS_SEND); + ntest_1_packet_send(1, 1, NX_LINK_PACKET_PPPOE_SESS_SEND); + ntest_1_packet_send(2, 0, NX_LINK_PACKET_PPPOE_DISC_SEND); + ntest_1_packet_send(3, 1, NX_LINK_PACKET_PPPOE_DISC_SEND); + + +} + + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_pppoe_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD Raw PPPOE Test......................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_rx_nohdr_basic_blocking_test.c b/test/regression/bsd_test/netx_bsd_raw_rx_nohdr_basic_blocking_test.c new file mode 100644 index 00000000..58c67ca5 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_rx_nohdr_basic_blocking_test.c @@ -0,0 +1,469 @@ +/* This NetX test concentrates on the basic BSD RAW blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +extern UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_rx_nohdr_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable raw processing for both IP instances. */ + status += nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; +} + +static void test_raw_server_ipv4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +char buf[30]; +int addrlen; +int option; +int status; + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the RX_NO_HDR option. */ + option = 1; + + status = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + + if(status != 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5)))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[0])) || strncmp(buf, requests[0], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + + /* Give the reciever a chance to receive the raw data. */ + tx_thread_sleep(2); + +} + +#ifdef FEATURE_NX_IPV6 +static void test_raw_server_ipv6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +char buf[50]; +int addrlen; +int option; +int status; + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set the RX_NO_HDR option. */ + option = 1; + + status = setsockopt(sockfd, IPPROTO_IP, IP_RAW_RX_NO_HEADER, (void*)&option, sizeof(option)); + + if(status != 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + /* Validate the data. */ + if((ret != (INT)(strlen(requests[0]))) || (strncmp(buf, requests[0], ret))) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Give the reciever a chance to receive the raw data. */ + tx_thread_sleep(2); + +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +UINT status; +char mac_ip0[6]; +char mac_ip1[6]; +#endif + printf("NetX Test: Basic BSD Raw Rx Nohdr Blocking Test.........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + test_raw_server_ipv4(); + + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ +#if 0 + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; +#endif + + /* Allow the stateless autoaddress configuration/DAD to finish */ + tx_thread_sleep(3); + +#ifdef FEATURE_NX_IPV6 + test_raw_server_ipv6(); +#endif + + validate_bsd_structure(); + tx_thread_sleep(2); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NXD_ADDRESS dest_addr; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Send a RAW packet */ + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1,2,3,4); + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &dest_addr, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + tx_thread_sleep(1); + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#ifdef FEATURE_NX_IPV6 + /* Test IPv6 */ + tx_thread_sleep(5); + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + status = _nxd_ip_raw_packet_send(&ip_1, packet_ptr, &ipv6_address_ip0, 100, 128, 0); + if(status) + error_counter++; + + error_counter++; + tx_thread_sleep(1); + /* Ready to reaceive a message */ + status = nx_ip_raw_packet_receive(&ip_1, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + else + error_counter--; + +#endif +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } + +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_rx_nohdr_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD Raw Rx Nohdr Blocking Test..........N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_raw_tx_test.c b/test/regression/bsd_test/netx_bsd_raw_tx_test.c new file mode 100644 index 00000000..9e16bd2d --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_raw_tx_test.c @@ -0,0 +1,549 @@ +/* This NetX test concentrates on the basic BSD RAW non-blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#ifdef NX_BSD_ENABLE +#include "nxd_bsd.h" +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* The IPv6 packet assumes + src address fe80::f584:1fdb:425:a239 + dst address ff02::1:ffd6:5775 +*/ +char ipv6_packet[] = { +0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x84, +0x1f, 0xdb, 0x04, 0x25, 0xa2, 0x39, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0xd6, 0x57, 0x75, 0x87, 0x00, +0x39, 0xad, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x1a, +0x23, 0x6c, 0xab, 0xd6, 0x57, 0x75, 0x01, 0x01, +0x00, 0x1e, 0x8c, 0xd5, 0xd3, 0x1f }; + + +/* In this test case the source IP address must be +192.168.1.185, dest 157.56.52.38 +Source MAC 18:a9:05:cc:8f:16 +dst MAC 00:24:a5:b5:2c:58 +*/ +static char ipv4_packet[] = { +0x45, 0x00, +0x00, 0x3c, 0x3e, 0xa2, 0x00, 0x00, 0x80, 0x11, +0x68, 0x4f, 0xc0, 0xa8, 0x01, 0xb9, 0x9d, 0x38, +0x34, 0x26, 0x34, 0x4f, 0x9c, 0x64, 0x00, 0x28, +0xdc, 0x3e, 0xa6, 0x3e, 0x02, 0x00, 0x25, 0xbb, +0xa3, 0x96, 0x53, 0x4c, 0x32, 0x2f, 0x5d, 0x8d, +0x26, 0x51, 0x42, 0x0e, 0xf6, 0x5c, 0x6c, 0x96, +0x1c, 0x7d, 0x64, 0x3d, 0xd1, 0x86, 0xe5, 0x62, +0x67, 0x5b }; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ + +static int test_case = 0; +extern void (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void bsd_tx_packet_process_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +char data_buffer[100]; +ULONG ip_id; +ULONG checksum; + switch(test_case) + { + case 0: + if(packet_ptr -> nx_packet_length != sizeof(ipv4_packet)) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, + ipv4_packet, sizeof(ipv4_packet))) + error_counter++; + break; + + case 1: + if(packet_ptr -> nx_packet_length != sizeof(ipv4_packet)) + error_counter++; + memcpy(data_buffer, ipv4_packet, sizeof(ipv4_packet)); + ip_id = (packet_ptr -> nx_packet_prepend_ptr[4] << 8); + ip_id = (ip_id | (packet_ptr -> nx_packet_prepend_ptr[5])); + if(ip_id != ip_0.nx_ip_packet_id) + error_counter++; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + (packet_ptr -> nx_packet_prepend_ptr[0] & 0xF) << 2, + NULL, NULL); + + checksum = ~checksum & NX_LOWER_16_MASK; + if(checksum) + error_counter++; + + data_buffer[4] = (ip_id & 0xFF00) >> 8; + data_buffer[5] = ip_id & 0xFF; + + data_buffer[10] = packet_ptr -> nx_packet_prepend_ptr[10]; + data_buffer[11] = packet_ptr -> nx_packet_prepend_ptr[11]; + + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, + data_buffer, sizeof(ipv4_packet))) + error_counter++; + break; + + case 2: + if(packet_ptr -> nx_packet_length != (sizeof(ipv4_packet) + 20)) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, + ipv4_packet, sizeof(ipv4_packet))) + error_counter++; + break; + case 3: + if(packet_ptr -> nx_packet_length != (sizeof(ipv6_packet))) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, + ipv6_packet, sizeof(ipv6_packet))) + error_counter++; + break; + + case 4: + if(packet_ptr -> nx_packet_length != (sizeof(ipv6_packet) + 40)) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, + ipv6_packet, sizeof(ipv6_packet))) + error_counter++; + break; + + default: + error_counter++; + break; + + } + + nx_packet_release(packet_ptr); +} + +/* Define what the initial system looks like. */ +extern UINT _nxd_ip_raw_packet_send(NX_IP *ip_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *destination_ip, ULONG protocol, UINT ttl, ULONG tos); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_tx_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 1, 185), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set up the gateway address */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(192, 168, 1, 1)); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable raw processing for both IP instances. */ + status = nx_ip_raw_packet_enable(&ip_0); + + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check RAW enable and BSD init status. */ + if (status) + error_counter++; +} + + +static char buffer[100]; +static void test_raw_ipv4_sendto(int hdrincl) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; + + /* Create a raw socket. */ + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set IP_HDRINCL */ + + ret = setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &hdrincl, sizeof(hdrincl)); + if(ret) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(5); + remote_addr.sin_addr.s_addr = htonl(IP_ADDRESS(1 ,2, 3, 4)); + + memcpy(buffer, ipv4_packet, sizeof(ipv4_packet)); + + if(hdrincl) + test_case = 0; + else + test_case = 2; + + ret = sendto(sockfd, buffer, sizeof(ipv4_packet), 0, (struct sockaddr*)&remote_addr, + sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + /* Test with sendto */ + if(hdrincl == 1) + { + + /* Clear the IP ID field, and make sure the stack is able to fill in the ID value. */ + buffer[4] = 0; + buffer[5] = 0; + + test_case = 1; + } + else + test_case = 2; + ret = sendto(sockfd, buffer, sizeof(ipv4_packet), 0, (struct sockaddr*)&remote_addr, + sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +#ifdef FEATURE_NX_IPV6 +static void test_raw_ipv6_sendto(int hdrincl) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; + + /* Create a raw socket. */ + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set IP_HDRINCL */ + + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_IPV6_HDRINCL, &hdrincl, sizeof(hdrincl)); + if(ret) + error_counter++; + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(5); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(0xff020000); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(0); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(0xf5841fdb); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(0x0425a239); + + if(hdrincl) + test_case = 3; + else + test_case = 4; + + ret = sendto(sockfd, ipv6_packet, sizeof(ipv6_packet), 0, (struct sockaddr*)&remote_addr, + sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_raw_ipv6_send(int hdrincl) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; + + /* Create a raw socket. */ + sockfd = socket(AF_INET6, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + /* Set IP_HDRINCL */ + + ret = setsockopt(sockfd, IPPROTO_IP, IP_RAW_IPV6_HDRINCL, &hdrincl, sizeof(hdrincl)); + if(ret) + error_counter++; +#if 1 + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(5); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(0xff020000); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(0); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(0xf5841fdb); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(0x0425a239); +#endif + if(hdrincl) + test_case = 3; + else + test_case = 4; + + ret = sendto(sockfd, ipv6_packet, sizeof(ipv6_packet), 0, (struct sockaddr*)&remote_addr, + sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} +#endif /* FEATURE_NX_IPV6 */ + +static void test_raw_ipv4_send(int hdrincl) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; + + /* Create a raw socket. */ + sockfd = socket(AF_INET, SOCK_RAW, 100); + if(sockfd < 0) + error_counter++; + + ret = setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &hdrincl, sizeof(hdrincl)); + if(ret) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(5); + remote_addr.sin_addr.s_addr = htonl(IP_ADDRESS(1 ,2, 3, 4)); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + /* Clear the IP ID field, and make sure the stack is able to fill in the ID value. */ + memcpy(buffer, ipv4_packet, sizeof(ipv4_packet)); + if(hdrincl) + test_case = 0; + else + test_case = 2; + ret = send(sockfd, buffer, sizeof(ipv4_packet), 0); + if(ret < 0) + error_counter++; + + if(hdrincl == 1) + { + buffer[4] = 0; + buffer[5] = 0; + + test_case = 1; + } + else + test_case = 2; + ret = send(sockfd, buffer, sizeof(ipv4_packet), 0); + if(ret < 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +#ifdef FEATURE_NX_IPV6 +char mac_ip[6]; +#endif + + printf("NetX Test: Basic BSD RAW TX Test........................."); + + /* Populate the ARP table for the gateway address */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(192, 168, 1, 1), (0x00 << 8) | 0x24, + ((0xa5 << 24) | (0xb5 << 16) | (0x2c << 8) | 0x58)); + if(status) + error_counter++; + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 10, NX_NULL); + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0xf5841fdb; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0x0425a239; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip1, 10, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + + mac_ip[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip); + + if(status) + error_counter++; +#endif + + packet_process_callback = bsd_tx_packet_process_callback; + + test_raw_ipv4_sendto(1); + + test_raw_ipv4_send(1); + + test_raw_ipv4_sendto(0); + + test_raw_ipv4_send(0); + +#ifdef FEATURE_NX_IPV6 + test_raw_ipv6_sendto(1); + + test_raw_ipv6_send(1); + + test_raw_ipv6_sendto(0); + + test_raw_ipv6_send(0); +#endif + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#endif /* NX_BSD_ENABLE */ + +#else /* __PRODUCT_NETXDUO__ */ + +extern void test_control_return(UINT status); +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_raw_tx_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Basic BSD RAW TX Test.........................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/bsd_test/netx_bsd_tcp_2nd_bind_test.c b/test/regression/bsd_test/netx_bsd_tcp_2nd_bind_test.c new file mode 100644 index 00000000..b524a257 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_2nd_bind_test.c @@ -0,0 +1,225 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +#define BSD_THREAD_PRIORITY 2 + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#define PACKET_SIZE 256 +#define PACKET_POOL_SIZE ((PACKET_SIZE + sizeof(NX_PACKET)) * 2) + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_2nd_bind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + if (status) + error_counter++; + + pointer += PACKET_POOL_SIZE; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + if (status) + error_counter++; + + /* Increment the free memory pointer. */ + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + if (status) + error_counter++; + + /* Increment the free memory pointer. */ + pointer = pointer + 1024; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable BSD */ + status = bsd_initialize(&ip_0, &pool_0, pointer, DEMO_STACK_SIZE, BSD_THREAD_PRIORITY); + /* Check TCP enable status. */ + if (status) + error_counter++; + + pointer += DEMO_STACK_SIZE; + +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd1; +int sockfd2; + +struct sockaddr_in local_addr; + +int ret; + + + printf("NetX Test: Basic BSD TCP 2nd Bind Test..................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the first socket. */ + sockfd1 = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd1 < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd1, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Bind the 2nd socket to the same port. */ + sockfd2 = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd2 < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd2, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret >= 0) + error_counter++; + else if(errno != EADDRINUSE) + error_counter++; + + ret = soc_close(sockfd1); + ret += soc_close(sockfd2); + + if(ret) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_2nd_bind_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP 2nd Bind Test...................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/bsd_test/netx_bsd_tcp_accept_blocking_test.c b/test/regression/bsd_test/netx_bsd_tcp_accept_blocking_test.c new file mode 100644 index 00000000..11117b9c --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_accept_blocking_test.c @@ -0,0 +1,515 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static TX_SEMAPHORE sema_2; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS NX_BSD_MAX_SOCKETS +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + status += tx_semaphore_create(&sema_2, "SEMA 2", 0); + if(status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + ret = recv(sockfd, buf, sizeof(buf), 0); + if(ret <= 0) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + if((sockfd - NX_BSD_SOCKFD_START + 1) != (NUM_CLIENTS / 2)) + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + else + tx_semaphore_get(&sema_2, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +int accept_no_memory = 0; + + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + { + if(i != (NUM_CLIENTS - 1)) + error_counter++; + else + { + if(errno != ENOMEM) + error_counter++; + else + { + accept_no_memory = 1; + tx_thread_sleep(10); + i--; + continue; + } + } + } + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + + tx_thread_relinquish(); + } + + if(accept_no_memory != 1) + error_counter++; + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: Basic BSD TCP Accept Blocking Test............"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + + } + if(status != NX_SUCCESS) + error_counter++; + + /* Send messages to each server */ + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Receive messages. */ + + for(i = 0; i < NUM_CLIENTS - 1; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_2); + + /* Shutdown one socket (the one in the middle of the group. */ + status = nx_tcp_socket_disconnect(&tcp_sockets[NUM_CLIENTS/2], NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[NUM_CLIENTS/2].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS/2]); + + status += nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS/2]); + if(status != NX_SUCCESS) + error_counter++; + + /* Now we should be able to try another connection */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[(NUM_CLIENTS - 1) & 3], strlen(requests[(NUM_CLIENTS - 1) & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[NUM_CLIENTS - 1], packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_socket_receive(&tcp_sockets[NUM_CLIENTS - 1], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[(NUM_CLIENTS - 1) & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[(NUM_CLIENTS - 1) & 3], packet_ptr -> nx_packet_length)) + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(packet_ptr); + + /* Wakeup server thread. */ + for(i = 0; i < NUM_CLIENTS - 2; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + tx_semaphore_put(&sema_2); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + if(i == NUM_CLIENTS / 2) + continue; + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[i]); + + + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_blocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Accept Blocking Test............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_accept_blocking_timeout_test.c b/test/regression/bsd_test/netx_bsd_tcp_accept_blocking_timeout_test.c new file mode 100644 index 00000000..a039d49e --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_accept_blocking_timeout_test.c @@ -0,0 +1,549 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static TX_SEMAPHORE sema_2; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS NX_BSD_MAX_SOCKETS +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_blocking_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + status += tx_semaphore_create(&sema_2, "SEMA 2", 0); + if(status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + ret = recv(sockfd, buf, sizeof(buf), 0); + if(ret <= 0) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + /* Wait until client received. */ + if((sockfd - NX_BSD_SOCKFD_START + 1) != (NUM_CLIENTS / 2)) + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + else + tx_semaphore_get(&sema_2, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +int accept_no_memory = 0; + + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + { + if(i != (NUM_CLIENTS - 1)) + error_counter++; + else + { + if(errno != ENOMEM) + error_counter++; + else + { + accept_no_memory = 1; + tx_thread_sleep(10); + i--; + continue; + } + } + } + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + + tx_thread_relinquish(); + } + + if(accept_no_memory != 1) + error_counter++; + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: Basic BSD TCP Accept Blocking Timeout Test...."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + + } + if(status != NX_SUCCESS) + error_counter++; + + /* Now we should be able to try another connection */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + else + { + /* Let's delete the socket. */ + if(tcp_sockets[NUM_CLIENTS - 1].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS - 1]); + if(status) + error_counter++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS - 1]); + + /* Recreate the socket. */ + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[NUM_CLIENTS - 1], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[NUM_CLIENTS - 1], NX_ANY_PORT, 0); + if(status) + error_counter++; + } + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Receive messages. */ + + for(i = 0; i < NUM_CLIENTS - 1; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_2); + + /* Shutdown one socket (the one in the middle of the group. */ + status = nx_tcp_socket_disconnect(&tcp_sockets[NUM_CLIENTS/2], NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[NUM_CLIENTS/2].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS/2]); + + status += nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS/2]); + if(status != NX_SUCCESS) + error_counter++; + + /* Now we should be able to try another connection */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[(NUM_CLIENTS - 1) & 3], strlen(requests[(NUM_CLIENTS - 1) & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[NUM_CLIENTS - 1], packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_socket_receive(&tcp_sockets[NUM_CLIENTS - 1], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[(NUM_CLIENTS - 1) & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[(NUM_CLIENTS - 1) & 3], packet_ptr -> nx_packet_length)) + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(packet_ptr); + + /* Wakeup server thread. */ + for(i = 0; i < NUM_CLIENTS - 2; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + tx_semaphore_put(&sema_2); + + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + if(i == NUM_CLIENTS / 2) + continue; + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[i]); + + + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_blocking_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Accept Blocking Timeout Test....N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_test.c b/test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_test.c new file mode 100644 index 00000000..8a278eca --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_test.c @@ -0,0 +1,579 @@ +/* This NetX test concentrates on the basic BSD non-blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static TX_SEMAPHORE sema_2; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS NX_BSD_MAX_SOCKETS + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 2); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + status += tx_semaphore_create(&sema_2, "SEMA 2", 0); + if(status != TX_SUCCESS) + error_counter++; +} + + +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +fd_set read_fd; +struct timeval tv; +char buf[30]; + /* Note the socket is already in non-blocking mode. */ + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 1; + tv.tv_usec = 0; + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret < 0) + { + error_counter++; + return; + } + if(ret == 1) + { + /* Check for read_fd */ + if(FD_ISSET(sockfd, &read_fd)) + { + ret = recv(sockfd, buf, sizeof(buf), 0); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + /* Wait until client received. */ + if((sockfd - NX_BSD_SOCKFD_START + 1) != (NUM_CLIENTS / 2)) + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + else + tx_semaphore_get(&sema_2, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + } + } + else error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +fd_set read_fd; +struct timeval tv; +int accept_no_memory = 0; +int error, len; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + tv.tv_sec = 2; + tv.tv_usec = 0; + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &read_fd)) + { + error_counter++; + } + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + continue; + } + } + } + else + { + if(i != (NUM_CLIENTS - 1)) + error_counter++; + else + { + if(errno != ENOMEM) + error_counter++; + else + { + accept_no_memory = 1; + tx_thread_sleep(10); + i--; + continue; + } + } + } + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + if(accept_no_memory != 1) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: Basic BSD TCP Accept Nonblocking Test........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + + test_control_return(0); + +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i&3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i&3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_2); + + /* Shutdown one socket (the one in the middle of the group. */ + status = nx_tcp_socket_disconnect(&tcp_sockets[NUM_CLIENTS/2], NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[NUM_CLIENTS/2].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS/2]); + + status += nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS/2]); + if(status != NX_SUCCESS) + error_counter++; + + /* Now we should be able to try another connection */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[(NUM_CLIENTS - 1) & 3], strlen(requests[(NUM_CLIENTS - 1) & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[NUM_CLIENTS - 1], packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_socket_receive(&tcp_sockets[NUM_CLIENTS - 1], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[(NUM_CLIENTS - 1) & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[(NUM_CLIENTS - 1) & 3], packet_ptr -> nx_packet_length)) + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(packet_ptr); + + /* Wakeup server thread. */ + for(i = 0; i < NUM_CLIENTS - 2; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + tx_semaphore_put(&sema_2); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + if(i == NUM_CLIENTS / 2) + continue; + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if((status == NX_SUCCESS) || (status == NX_NOT_CONNECTED) || (status == NX_DISCONNECT_FAILED)) + status = 0; + else + error_counter++; + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status) + error_counter++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter ++; + + + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); + +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + return; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + return; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + return; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Accept Nonblocking Test.........N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_timeout_test.c b/test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_timeout_test.c new file mode 100644 index 00000000..d3a76bab --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_accept_nonblocking_timeout_test.c @@ -0,0 +1,610 @@ +/* This NetX test concentrates on the basic BSD non-blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static TX_SEMAPHORE sema_2; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS NX_BSD_MAX_SOCKETS + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_nonblocking_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 2); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + status += tx_semaphore_create(&sema_2, "SEMA 2", 0); + if(status != TX_SUCCESS) + error_counter++; +} + + +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +fd_set read_fd; +struct timeval tv; +char buf[30]; + /* Note the socket is already in non-blocking mode. */ + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 1; + tv.tv_usec = 0; + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret < 0) + { + error_counter++; + return; + } + if(ret == 1) + { + /* Check for read_fd */ + if(FD_ISSET(sockfd, &read_fd)) + { + ret = recv(sockfd, buf, sizeof(buf), 0); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + /* Wait until client received. */ + if((sockfd - NX_BSD_SOCKFD_START + 1) != (NUM_CLIENTS / 2)) + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + else + tx_semaphore_get(&sema_2, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + } + } + else error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +fd_set read_fd; +struct timeval tv; +int accept_no_memory = 0; +int error, len; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + tv.tv_sec = 2; + tv.tv_usec = 0; + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &read_fd)) + { + error_counter++; + } + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + continue; + } + } + } + else + { + if(i != (NUM_CLIENTS - 1)) + error_counter++; + else + { + if(errno != ENOMEM) + error_counter++; + else + { + accept_no_memory = 1; + tx_thread_sleep(1); + i--; + continue; + } + } + } + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + if(accept_no_memory != 1) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: Basic BSD TCP Accept Nonblocking timeout Test."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + + test_control_return(0); + +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + + /* Now attempt to make another connection. We know this one would fail. */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE / 10); + if(status == NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + else + { + /* Let's delete the socket. */ + if(tcp_sockets[NUM_CLIENTS - 1].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS - 1]); + if(status) + error_counter++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS - 1]); + + /* Recreate the socket. */ + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[NUM_CLIENTS - 1], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[NUM_CLIENTS - 1], NX_ANY_PORT, 0); + if(status) + error_counter++; + } + + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, 1); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i&3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i&3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_2); + + /* Shutdown one socket (the one in the middle of the group. */ + status = nx_tcp_socket_disconnect(&tcp_sockets[NUM_CLIENTS/2], 2); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[NUM_CLIENTS/2].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS/2]); + + status += nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS/2]); + if(status != NX_SUCCESS) + error_counter++; + + /* Now we should be able to try another connection */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[(NUM_CLIENTS - 1) & 3], strlen(requests[(NUM_CLIENTS - 1) & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[NUM_CLIENTS - 1], packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_socket_receive(&tcp_sockets[NUM_CLIENTS - 1], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[(NUM_CLIENTS - 1) & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[(NUM_CLIENTS - 1) & 3], packet_ptr -> nx_packet_length)) + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(packet_ptr); + + /* Wakeup server thread. */ + for(i = 0; i < NUM_CLIENTS - 2; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + tx_semaphore_put(&sema_2); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + if(i == NUM_CLIENTS / 2) + continue; + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if((status == NX_SUCCESS) || (status == NX_NOT_CONNECTED) || (status == NX_DISCONNECT_FAILED)) + status = 0; + else + error_counter++; + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status) + error_counter++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter ++; + + + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); + +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + return; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + return; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + return; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_nonblocking_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Accept Nonblocking timeout Test.N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_accept_noselect_test.c b/test/regression/bsd_test/netx_bsd_tcp_accept_noselect_test.c new file mode 100644 index 00000000..23885de5 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_accept_noselect_test.c @@ -0,0 +1,583 @@ +/* This NetX test concentrates on the basic BSD non-blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static TX_SEMAPHORE sema_2; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS NX_BSD_MAX_SOCKETS + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_noselect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 2); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + status += tx_semaphore_create(&sema_2, "SEMA 2", 0); + if(status) + error_counter++; +} + + +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +fd_set read_fd; +struct timeval tv; +char buf[30]; + /* Note the socket is already in non-blocking mode. */ + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 5; + tv.tv_usec = 0; + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret < 0) + { + error_counter++; + return; + } + if(ret == 1) + { + /* Check for read_fd */ + if(FD_ISSET(sockfd, &read_fd)) + { + ret = recv(sockfd, buf, sizeof(buf), 0); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + if((sockfd - NX_BSD_SOCKFD_START + 1) != (NUM_CLIENTS / 2)) + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + else + tx_semaphore_get(&sema_2, 5 * NX_IP_PERIODIC_RATE); + + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + } + } + else error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +int accept_no_memory = 0; +int not_accepted; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + + not_accepted = 1; + + while(not_accepted) + { + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(fcntl(newsock, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + not_accepted = 0; + } + } + } + else if(errno == ENOMEM) + { + accept_no_memory = 1; + tx_thread_sleep(1); + } + else if(errno == EWOULDBLOCK) + { + tx_thread_sleep(1); + } + + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + if(accept_no_memory != 1) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: Basic BSD TCP Accept No Select Test..........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + + test_control_return(0); + +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + + /* Now we should be able to try another connection. This one would fail. */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, 1); + if(status == NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + /* Disconnect and clean up this socket. */ + status = nx_tcp_socket_disconnect(&tcp_sockets[NUM_CLIENTS - 1], NX_IP_PERIODIC_RATE / 10); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[NUM_CLIENTS - 1].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS - 1]); + + status += nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS - 1]); + if(status != NX_SUCCESS) + error_counter++; + + /* Recreate the socket. */ + status = nx_tcp_socket_create(&ip_1, &tcp_sockets[NUM_CLIENTS - 1], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[NUM_CLIENTS - 1], NX_ANY_PORT, 0); + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE / 10); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < (NUM_CLIENTS - 1); i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i&3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i&3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_2); + + /* Shutdown one socket (the one in the middle of the group. */ + status = nx_tcp_socket_disconnect(&tcp_sockets[NUM_CLIENTS/2], NX_IP_PERIODIC_RATE / 10); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[NUM_CLIENTS/2].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[NUM_CLIENTS/2]); + + status += nx_tcp_socket_delete(&tcp_sockets[NUM_CLIENTS/2]); + if(status != NX_SUCCESS) + error_counter++; + + /* Now we should be able to try another connection */ + status = nx_tcp_client_socket_connect(&tcp_sockets[NUM_CLIENTS - 1], IP_ADDRESS(1, 2, 3, 4), 12345, TX_TIMER_TICKS_PER_SECOND); + if(status != NX_SUCCESS) + { + /* At this point, we anticpate the BSD system to run out of resource and is unable to make + this connection. */ + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[(NUM_CLIENTS - 1) & 3], strlen(requests[(NUM_CLIENTS - 1) & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[NUM_CLIENTS - 1], packet_ptr, NX_IP_PERIODIC_RATE / 10); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_socket_receive(&tcp_sockets[NUM_CLIENTS - 1], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[(NUM_CLIENTS - 1) & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[(NUM_CLIENTS - 1) & 3], packet_ptr -> nx_packet_length)) + error_counter++; + if(status != NX_SUCCESS) + nx_packet_release(packet_ptr); + + /* Wakeup server thread. */ + for(i = 0; i < NUM_CLIENTS - 2; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + tx_semaphore_put(&sema_2); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + if(i == NUM_CLIENTS / 2) + continue; + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if((status == NX_SUCCESS) || (status == NX_NOT_CONNECTED) || (status == NX_DISCONNECT_FAILED)) + status = 0; + else + error_counter++; + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status) + error_counter++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter ++; + + + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + return; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + return; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + return; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_accept_noselect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Accept No Select Test...........N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_basic_blocking_test.c b/test/regression/bsd_test/netx_bsd_tcp_basic_blocking_test.c new file mode 100644 index 00000000..49bba72a --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_basic_blocking_test.c @@ -0,0 +1,1101 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *send_buffer = "Hello World"; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +#ifdef __PRODUCT_NETXDUO__ +static char large_msg[1000]; +#endif +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; +#ifdef FEATURE_NX_IPV6 +static ULONG stack_space6[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread6[NUM_CLIENTS]; +#endif +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; +int sockaddr_len; +fd_set read_fds, write_fds, except_fds; +struct timeval wait_time; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 remote_address; +#else +struct sockaddr_in remote_address; +#endif + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + if(message_id == 2) + { +#ifdef FEATURE_NX_IPV6 + sockaddr_len = sizeof(struct sockaddr_in6); +#else + sockaddr_len = sizeof(struct sockaddr_in); +#endif + ret = recvfrom(sockfd, (char*)buf, sizeof(buf), 0, (struct sockaddr*)&remote_address, &sockaddr_len); + + if(ret < 0) + error_counter++; + if(nx_bsd_socket_array[sockfd - 0x20].nx_bsd_socket_family == AF_INET) + { + if(sockaddr_len != sizeof(struct sockaddr_in)) + error_counter++; + if(((struct sockaddr_in*)&remote_address) -> sin_family != AF_INET) + error_counter++; + if(((struct sockaddr_in*)&remote_address) -> sin_addr.s_addr != htonl(0x01020305)) + error_counter++; + } +#ifdef FEATURE_NX_IPV6 + else if(nx_bsd_socket_array[sockfd - 0x20].nx_bsd_socket_family == AF_INET6) + { + if(sockaddr_len != sizeof(struct sockaddr_in6)) + error_counter++; + if((remote_address.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_address.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_address.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_address.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + } +#endif + } + else + { + + /* Peek message test. */ + ret = recv(sockfd, buf, sizeof(buf), MSG_PEEK); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + ret = recv(sockfd, buf, sizeof(buf), 0); + } + if(ret <= 0) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Invoke recvfrom with MSG_DONTWAIT flag. */ + ret = recvfrom(sockfd, (char*)buf, sizeof(buf), MSG_DONTWAIT, (struct sockaddr*)&remote_address, &sockaddr_len); + if(ret >= 0) + error_counter++; + else if((errno != EWOULDBLOCK) || (errno != EAGAIN)) + error_counter++; + + /* Invoke recv with MSG_DONTWAIT flag. */ + ret = recv(sockfd, (char*)buf, sizeof(buf), MSG_DONTWAIT); + if(ret >= 0) + error_counter++; + else if((errno != EWOULDBLOCK) || (errno != EAGAIN)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + /* Invoke send with MSG_DONTWAIT flag. The message is larger than tx_window. Partial data should be sent. */ + ret = send(sockfd, large_msg, sizeof(large_msg), MSG_DONTWAIT); + if (ret <= 0) + error_counter++; +#endif + + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + FD_ZERO(&except_fds); + FD_SET(sockfd, &read_fds); + FD_SET(sockfd, &write_fds); + FD_SET(sockfd, &except_fds); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + wait_time.tv_sec = 1; + wait_time.tv_usec = 0; + select(sockfd + 1, &read_fds, &write_fds, &except_fds, &wait_time); + if((FD_ISSET(sockfd, &read_fds) && FD_ISSET(sockfd, &write_fds) && FD_ISSET(sockfd, &except_fds)) == 0) + error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 local_addr6; +int port; +int sockfd1; +#endif +int bytes_sent; +int ret; +char buf; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = INADDR_ANY; + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Get the port bind to any. */ + port = nx_bsd_socket_array[sockfd - NX_BSD_SOCKFD_START].nx_bsd_socket_tcp_socket -> nx_tcp_socket_port; + + sockfd1 = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd1 < 0) + error_counter++; + + memset(&local_addr6, 0, sizeof(local_addr6)); + local_addr6.sin6_family = AF_INET6; + local_addr6.sin6_port = htons(port); + + /* Bind to the same port. */ + ret = bind(sockfd1, (struct sockaddr*)&local_addr6, sizeof(local_addr6)); + if(ret < 0) + error_counter++; + + ret = soc_close(sockfd1); + if(ret < 0) + error_counter++; +#endif + + /* Call recv before peer orderly shutdown. */ + ret = recv(sockfd, &buf, 1, 0); + if (ret != 0) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + /* Call recv after peer orderly shutdown. */ + ret = recv(sockfd, &buf, 1, 0); + if (ret != 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin_family != AF_INET) + error_counter++; + else if(local_addr.sin_port != htons(12345)) + error_counter++; + else if(local_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1, 2, 3, 4))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin_family != AF_INET) + error_counter++; + else if(remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) + error_counter++; + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + + +#ifdef FEATURE_NX_IPV6 +static void test_tcp_client6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int bytes_sent; +int ret; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(12); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1.nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1.nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1.nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1.nxd_ip_address.v6[3]); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (INT)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12346); + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + + if(address_length != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin6_family != AF_INET6) + error_counter++; + else if(local_addr.sin6_port != htons(12346)) + error_counter++; + else if((local_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip0.nxd_ip_address.v6[0])) || + (local_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip0.nxd_ip_address.v6[1])) || + (local_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip0.nxd_ip_address.v6[2])) || + (local_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip0.nxd_ip_address.v6[3]))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin6_family != AF_INET6) + error_counter++; + else if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread6[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space6[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +#endif + +static void close_before_accept_test() +{ +int server_fd, client_fd; +int ret; +struct sockaddr_in remote_addr, local_addr; + + /* Setup server socket. */ + server_fd = socket(AF_INET, SOCK_STREAM, 0); + if(server_fd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(server_fd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(server_fd, 5); + if(ret < 0) + error_counter++; + + /* Setup client socket. */ + client_fd = socket(AF_INET, SOCK_STREAM, 0); + if(client_fd < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12345); + remote_addr.sin_addr.s_addr = htonl(0x01020304); + + if(connect(client_fd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + /* Close before calling accept. */ + soc_close(server_fd); + soc_close(client_fd); +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in remote_addr; +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif +int ret; + + + printf("NetX Test: Basic BSD TCP Basic Blocking Test............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = (CHAR)(ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (CHAR)(ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + close_before_accept_test(); + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client4(); + + tx_semaphore_put(&sema_1); + test_tcp_server4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client6(); + + tx_semaphore_put(&sema_1); + test_tcp_server6(); +#endif + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Now open another socket and attempt to connect to the an incorrect + remote host so we expect an unsuccessful connections. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020306); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + + if(errno != ETIMEDOUT) + error_counter++; + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* After the previous failed connection, make sure we can still open a socket. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[i]); + + + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } + + +} + + +#ifdef FEATURE_NX_IPV6 +static void multiple_client6(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nxd_tcp_client_socket_connect(&tcp_sockets[i], &ipv6_address_ip0, 12346, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char *)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } + +} +#endif + +static void netx_tcp_server(void) +{ +NX_PACKET *packet_ptr; +UINT status; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != strlen(send_buffer))) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&sema_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + multiple_client4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_put(&sema_0); + netx_tcp_server(); + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + multiple_client6(); +#endif + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Basic Blocking Test.............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_basic_nonblocking_test.c b/test/regression/bsd_test/netx_bsd_tcp_basic_nonblocking_test.c new file mode 100644 index 00000000..875d9811 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_basic_nonblocking_test.c @@ -0,0 +1,1222 @@ +/* This NetX test concentrates on the basic BSD non-blocking operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *send_buffer = "Hello World"; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_basic_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 4096, 2); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status != TX_SUCCESS) + error_counter++; +} + + +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; +#ifdef FEATURE_NX_IPV6 +static ULONG stack_space6[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread6[NUM_CLIENTS]; +#endif +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +fd_set read_fd; +struct timeval tv; +char buf[30]; + /* Note the socket is already in non-blocking mode. */ + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 1; + tv.tv_usec = 0; + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret < 0) + { + error_counter++; + return; + } + if(ret == 1) + { + /* Check for read_fd */ + if(FD_ISSET(sockfd, &read_fd)) + { + ret = recv(sockfd, buf, sizeof(buf), 0); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id&3])) || strncmp(buf, requests[message_id&3], ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id&3], strlen(response[message_id&3]), 0); + if(ret != (int)strlen(response[message_id&3])) + error_counter++; + + /* Wait until remote disconnects. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 3; + tv.tv_usec = 0; + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + } + } + else error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +fd_set read_fd; +struct timeval tv; +int error, len; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + tv.tv_sec = 2; + tv.tv_usec = 0; + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + continue; + } + } + } + ret = soc_close(newsock); + if(ret != 0) + error_counter++; + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +#ifdef FEATURE_NX_IPV6 + +static void test_tcp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +fd_set read_fd; +struct timeval tv; +int error, len; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12346); + + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + tv.tv_sec = 2; + tv.tv_usec = 0; + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + address_length = sizeof(remote_addr); + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock > 0) + { + if(address_length != sizeof(struct sockaddr_in6)) + error_counter++; + else if(remote_addr.sin6_family != AF_INET6) + error_counter++; + else if((remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + if(error_counter == 0) + { + + /* Set the new socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + else + { + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + tx_thread_create(&helper_thread6[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space6[i], DEMO_STACK_SIZE, 2,2, TX_NO_TIME_SLICE, TX_AUTO_START); + continue; + } + } + } + ret = soc_close(newsock); + if(ret < 0) + error_counter++; + } + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} +#endif + + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int ret; +fd_set write_fd; +struct timeval tv; +int bytes_sent; +int error, len; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + soc_close(sockfd); + return; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + { + error_counter++; + return; + } + } + + /* Now select on the socket. */ + + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + ret = select(FD_SETSIZE, NULL, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &write_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret != 0) + { + error_counter++; + return; + } + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + } +} + +#ifdef FEATURE_NX_IPV6 +static void test_tcp_client6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int ret; +fd_set write_fd; +struct timeval tv; +int bytes_sent; +int error, len; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(12); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1.nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1.nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1.nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1.nxd_ip_address.v6[3]); + + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + soc_close(sockfd); + return; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + { + error_counter++; + return; + } + } + + /* Now select on the socket. */ + + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + ret = select(sockfd + 1, NULL, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret != 1) + error_counter++; + else if(!FD_ISSET(sockfd, &write_fd)) + error_counter++; + + /* Check pending error. */ + len = sizeof(error); + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len); + if(error) + error_counter++; + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret != 0) + { + error_counter++; + return; + } + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (INT)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + } +} + +#endif /*FEATURE_NX_IPV6 */ +static void ntest_0_entry(ULONG thread_input) +{ +int retry; +int sockfd; +struct sockaddr_in remote_addr; +int ret; +fd_set read_fd, write_fd; +struct timeval tv; +#ifdef FEATURE_NX_IPV6 +UINT status; +char mac_ip0[6]; +char mac_ip1[6]; +#endif + printf("NetX Test: Basic BSD TCP Non Blocking Connect Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + /* Server run first. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + test_tcp_client4(); + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + +#ifdef FEATURE_NX_IPV6 + /* Server run first. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + test_tcp_client6(); + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server6(); +#endif + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ + retry = 0; + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + error_counter++; + } + + do + { + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + + ret = select(sockfd + 1, &read_fd, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret == 0) + { + retry++; + if(retry == 31) + error_counter++; + } + else if(ret < 1) + { + error_counter++; + } + else if(FD_ISSET(sockfd, &write_fd)) + break; + }while(error_counter == 0); + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + } + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + + /* Now open another socket and attempt to connect to the an incorrect + remote host so we expect an unsuccessful connections. */ + retry = 0; + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket as non-blocking */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + { + /* Non blocking call, it shouldn't succeed. */ + error_counter++; + } + else + { + /* Make sure the errno is EINPROGRESS */ + if(errno != EINPROGRESS) + error_counter++; + } + + do + { + /* Wait for one second. */ + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + FD_ZERO(&write_fd); + FD_SET(sockfd, &write_fd); + + + ret = select(sockfd + 1, &read_fd, &write_fd, NULL, &tv); + + /* If select returns, there should only be one socket in the write group being selected. */ + if(ret == 0) + { + retry++; + if(retry == 31) + error_counter++; + } + else if(ret < 1) + { + error_counter++; + } + else if((FD_ISSET(sockfd, &write_fd))) + break; + }while(error_counter == 0); + + if(error_counter == 0) + { + /* select successfully returns. So do connect call again. This connect call should return 0. */ + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + } + + + + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + + test_control_return(0); + +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i&3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i&3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Wait all remote thread close first. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 0); +#ifdef NX_DISABLE_RESET_DISCONNECT + if((status != NX_SUCCESS) && (status != NX_NOT_CONNECTED)) + error_counter++; +#endif + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + + + } + + +} + + +#ifdef FEATURE_NX_IPV6 +static void multiple_client6(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nxd_tcp_client_socket_connect(&tcp_sockets[i], &ipv6_address_ip0, 12346, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i&3], strlen(requests[i&3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Wait all remote thread close first. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 0); +#ifdef NX_DISABLE_RESET_DISCONNECT + if((status != NX_SUCCESS) && (status != NX_NOT_CONNECTED)) + error_counter++; +#endif + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + } + + status = nx_tcp_socket_delete(&tcp_sockets[i]); + if(status != NX_SUCCESS) + error_counter ++; + } + + +} + +#endif + +static void netx_tcp_server(void) +{ + +UINT status; +NX_PACKET *packet_ptr; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length != strlen(send_buffer)) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&sema_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); + +#ifdef FEATURE_NX_IPV6 + /* Wakeup client. */ + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + multiple_client6(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +#endif +} + + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + return; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + return; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + return; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_basic_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Non Blocking Connect Test.......N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_bind_test.c b/test/regression/bsd_test/netx_bsd_tcp_bind_test.c new file mode 100644 index 00000000..2ffd285a --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_bind_test.c @@ -0,0 +1,809 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 140 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; +static TX_SEMAPHORE server_done_sema, test_done_sema, sema_0; +static int test_case = 0; +/* Define thread prototypes. */ +static TX_MUTEX protection; +static int count; +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0[3][3]; +static NXD_ADDRESS ipv6_address_ip1[3][3]; +#endif +static char *requests = "Request1"; +static void validate_bsd_structure(void); +static VOID bsd_server_helper_thread_entry(ULONG thread_input); + +#define IP0_IF0_V4_ADDR IP_ADDRESS(1,2,3,4) +#define IP0_IF1_V4_ADDR IP_ADDRESS(2,2,3,4) +#define IP0_IF2_V4_ADDR IP_ADDRESS(3,2,3,4) + +#define IP1_IF0_V4_ADDR IP_ADDRESS(1,2,3,5) +#define IP1_IF1_V4_ADDR IP_ADDRESS(2,2,3,5) +#define IP1_IF2_V4_ADDR IP_ADDRESS(3,2,3,5) + +static ULONG ip0_address[3] = {IP0_IF0_V4_ADDR, IP0_IF1_V4_ADDR, IP0_IF2_V4_ADDR}; +static ULONG ip1_address[3] = {IP1_IF0_V4_ADDR, IP1_IF1_V4_ADDR, IP1_IF2_V4_ADDR}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_bind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + memset(helper_thread, 0, sizeof(TX_THREAD) * NUM_CLIENTS); + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP0_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Attach a 2nd interface */ + status += nx_ip_interface_attach(&ip_0, "ip_0_second", IP0_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_0, "ip_0_third", IP0_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP1_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_1, "ip_1_second", IP1_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "ip_1_third", IP1_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + + if (status) + error_counter++; + + + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&server_done_sema, "server done", 0); + status += tx_semaphore_create(&test_done_sema, "test done", 0); + status += tx_semaphore_create(&sema_0, "SEMA 0", 0); + + if (status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; + +#if 0 +static void test_tcp_server4_6_bind_synch(void) +{ +int thread_count, test_case_count, i; +UINT status = 0; + + switch(test_case) + { + case 0: thread_count = 5; test_case_count = 9; break; + case 1: thread_count = 5; test_case_count = 9; break; + case 2: thread_count = 4; test_case_count = 7; break; + case 3: thread_count = 4; test_case_count = 4; break; + case 4: thread_count = 3; break; + } + + /* Let all the server threads run. */ + for(i = 0; i < thread_count; i++) + tx_semaphore_put(&server_wait_sema); + + /* Let the client run. */ + tx_semaphore_put(&client_wait_sema); + + /* Wait for all tests to finish. */ + if(test_case != 4) + { + for(i = 0; i < test_case_count; i++) + { + status = tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + if(status != TX_SUCCESS) + error_counter++; + + } + } +} +#endif +static VOID bsd_server4_helper_thread_test_2(ULONG param) +{ +int sockfd; +struct sockaddr_in remote_addr,local_addr; +int address_length; +int ret; +int newsock; +int index; +UINT status; +INT reuseaddr = 1; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Test bind to port 0. */ + local_addr.sin_family = AF_INET; + local_addr.sin_port = 0; + local_addr.sin_addr.s_addr = INADDR_ANY; + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(sockfd, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + + /* Check whether port is zero. */ + if (local_addr.sin_port == 0) + error_counter++; + soc_close(sockfd); + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(INT)); + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + if(param < 3) + local_addr.sin_addr.s_addr = htonl(ip0_address[param]); + else + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + + + while(1) + { + if((test_case == 1) && (param == 1)) + break; + if((test_case == 2) && (param == 3)) + break; + + if(test_case == 4) + break; + + address_length = sizeof(remote_addr); + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock < 0) + error_counter++; + if(address_length != sizeof(remote_addr)) + error_counter++; + + if(param < 3) + if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(ip1_address[param]))) + error_counter++; + + if(newsock > 0) + { + tx_mutex_get(&protection, 5 * NX_IP_PERIODIC_RATE); + index = count; + count++; + tx_mutex_put(&protection); + client_data[index].sockfd = newsock; + client_data[index].message_id = 0xFFFF; + + status = tx_thread_create(&helper_thread[index], "helper thread", bsd_server_helper_thread_entry, + index, stack_space[index], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, + TX_AUTO_START); + if(status) + error_counter++; + } + } + if(soc_close(sockfd) < 0) + error_counter++; + + tx_semaphore_put(&server_done_sema); +} + +#ifdef FEATURE_NX_IPV6 +static VOID bsd_server6_helper_thread_test_2(ULONG param) +{ +int sockfd; +struct sockaddr_in6 remote_addr,local_addr; +int address_length; +int ret; +int newsock; +int if_index, addr_index, index; +INT reuseaddr = 1; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(INT)); + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12345); + if(param != 0xFF00) + { + if_index = param >> 8; + addr_index = param & 0xFF; + local_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip0[if_index][addr_index].nxd_ip_address.v6[0]); + local_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip0[if_index][addr_index].nxd_ip_address.v6[1]); + local_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip0[if_index][addr_index].nxd_ip_address.v6[2]); + local_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip0[if_index][addr_index].nxd_ip_address.v6[3]); + } + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + + + + while(1) + { + if((test_case == 3) && (param == 0xFF00)) + break; + + if(test_case == 4) + break; + + address_length = sizeof(remote_addr); + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + if(newsock < 0) + error_counter++; + if(address_length != sizeof(remote_addr)) + error_counter++; + + if(param != 0xFF00) + { + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1[if_index][addr_index].nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1[if_index][addr_index].nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1[if_index][addr_index].nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1[if_index][addr_index].nxd_ip_address.v6[3]))) + error_counter++; + } + + if(newsock > 0) + { + + tx_mutex_get(&protection, 5 * NX_IP_PERIODIC_RATE); + index = count; + count++; + tx_mutex_put(&protection); + client_data[index].sockfd = newsock; + client_data[index].message_id = 0xFFFF; + + tx_thread_create(&helper_thread[index], "helper thread", bsd_server_helper_thread_entry, + index, stack_space[index], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, + TX_AUTO_START); + } + + } + if(soc_close(sockfd) < 0) + error_counter++; + + tx_semaphore_put(&server_done_sema); +} +#endif + +static VOID test_tcp_server4_6_bind(void) +{ +#ifdef FEATURE_NX_IPV6 +UINT status; +int index; + + tx_mutex_get(&protection, 5 * NX_IP_PERIODIC_RATE); + index = count; + count = count + 5; + tx_mutex_put(&protection); + + /* Create a thread that binds to the first IPv4 interface. */ + status = tx_thread_create(&helper_thread[index], (CHAR*)"IPv4 if0", bsd_server4_helper_thread_test_2, + 0, stack_space[index], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Create a thread that binds to the 2nd IPv4 interface. */ + status += tx_thread_create(&helper_thread[index + 1], "IPv4 if1", bsd_server4_helper_thread_test_2, + 1, stack_space[index + 1], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Create a thread that binds to the IPv4 INADDR_ANY */ + status += tx_thread_create(&helper_thread[index + 2], "IPv4 if_any", bsd_server4_helper_thread_test_2, + 3, stack_space[index + 2], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Create a thread that binds to the 1st IPv6 address of the 2nd interface IPv6 address. */ + status += tx_thread_create(&helper_thread[index + 3], "IPv6 if0", bsd_server6_helper_thread_test_2, + 0x0101, stack_space[index + 3], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Create a thread that binds to INADDR6_ANY */ + status += tx_thread_create(&helper_thread[index + 4], "IPv6 if_any", bsd_server6_helper_thread_test_2, + 0xFF00, stack_space[index + 4], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + /* The first test is to make sure they can all make connections with only the ones they are assigned to. */ + if(status) + error_counter++; + +#if 0 + test_tcp_server4_6_bind_synch(); + + test_case = 1; /* Kill socket binds to the 2nd IPv4 interface. */ + + test_tcp_server4_6_bind_synch(); + + test_case = 2;/* Kill socket binds to IPv4 INADDR_ANY. */ + + test_tcp_server4_6_bind_synch(); + + test_case = 3; /* Kill socket binds to IPv6 INADDR_ANY */ + + /* Create a thread that binds to the IPv4 INADDR_ANY */ + status = tx_thread_create(&helper_thread[index + 2], "IPv4 if_any", bsd_server4_helper_thread_test_2, + 3, stack_space[index + 2], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + + + test_tcp_server4_6_bind_synch(); + + + test_case = 4; /* Done. */ + test_tcp_server4_6_bind_synch(); + +#endif + tx_semaphore_get(&test_done_sema, 5 * NX_IP_PERIODIC_RATE); + +#endif + +} + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + + ret = recv(sockfd, buf, sizeof(buf), 0); + if(ret <= 0) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests)) || strncmp(buf, requests, ret)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, buf, ret, 0); + if(ret <= 0) + error_counter++; + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + if(message_id == 0xFFFF) + tx_semaphore_put(&server_done_sema); + return; +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +int i,j; +#endif + + + tx_mutex_create(&protection, "test protection", TX_NO_INHERIT); + count = 0; + + + printf("NetX Test: Basic BSD TCP Bind Test......................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + + for(i = 0; i < 3; i++) + { + mac_ip0[0] = (char)(ip_0.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (char)(ip_1.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + for(j = 0; j < 3; j ++) + { + if(j == 0) + { + /* First set up IPv6 linklocal addresses. */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ((mac_ip0[0] | 0x2) << 24) | (mac_ip0[1] << 16) | (mac_ip0[2] << 8) | 0xFF; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = (0xFE << 24) | ((mac_ip0[3] | 0x2) << 16) | (mac_ip0[4] << 8) | mac_ip0[5]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = + ((mac_ip1[0] | 0x2) << 24) | (mac_ip1[1] << 16) | (mac_ip1[2] << 8) | 0xFF; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = + (0xFE << 24) | ((mac_ip1[3] | 0x2) << 16) | (mac_ip1[4] << 8) | mac_ip1[5]; + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 10, NX_NULL); + } + else + { + /* Global Adddress */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ipv6_address_ip0[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = ipv6_address_ip0[i][0].nxd_ip_address.v6[3]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = ipv6_address_ip1[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = ipv6_address_ip1[i][0].nxd_ip_address.v6[3]; + + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 64, NX_NULL); + } + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1[i][j].nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0[i][j].nxd_ip_address.v6, 0, mac_ip0); + } + + } + + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + if(status) + error_counter++; + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + tx_semaphore_put(&server_done_sema); + + test_tcp_server4_6_bind(); + + /* Done. */ + tx_semaphore_delete(&server_done_sema); + tx_semaphore_delete(&test_done_sema); + tx_semaphore_delete(&sema_0); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets; +static void test_client_bind(void) +{ + +int i, j; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + + + for(i = 0; i < 3; i++) + { + for(j = 0; j < 3; j++) + { + status = nx_tcp_socket_create(&ip_1, &tcp_sockets, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets, NX_ANY_PORT, 0); + + if(status != NX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + if(j == 0) + status = nx_tcp_client_socket_connect(&tcp_sockets, ip0_address[i], 12345, NX_IP_PERIODIC_RATE / 5); + else + status = nxd_tcp_client_socket_connect(&tcp_sockets, &ipv6_address_ip0[i][j], 12345, NX_IP_PERIODIC_RATE / 5); +#else + status = nx_tcp_client_socket_connect(&tcp_sockets, ip0_address[i], 12345, NX_IP_PERIODIC_RATE / 5); +#endif + + if(status != NX_SUCCESS) + { + status = nx_tcp_client_socket_unbind(&tcp_sockets); + status += nx_tcp_socket_delete(&tcp_sockets); + + if(status) + error_counter++; + continue; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests, strlen(requests), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets, packet_ptr, 2); + if(status != NX_SUCCESS) + error_counter++; +#if 0 + tx_thread_sleep(1); +#endif + status = nx_tcp_socket_receive(&tcp_sockets, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(requests)) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, requests, packet_ptr -> nx_packet_length)) + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(packet_ptr); + + tx_semaphore_put(&sema_0); + status = nx_tcp_socket_disconnect(&tcp_sockets, 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + if(tcp_sockets.nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets); + + + status += nx_tcp_socket_delete(&tcp_sockets); + + if(status != NX_SUCCESS) + error_counter++; + } + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +int i; +int index; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + tx_semaphore_get(&server_done_sema, TX_WAIT_FOREVER); + + /* Simulate a multiple client conneting to the same server. */ + test_client_bind(); + + for(i = 0; i < 9; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + + test_case = 1; /* Kill socket binds to the 2nd IPv4 interface. */ + test_client_bind(); + for(i = 0; i < 10; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + test_client_bind(); + for(i = 0; i < 9; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + + test_case = 2; /* Kill socket binds to IPv4 INADDR_ANY */ + test_client_bind(); + for(i = 0; i < 9; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + test_client_bind(); + for(i = 0; i < 7; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + + test_case = 3; /* Kill socket binds to IPv6 INADDR_ANY */ +#if 1 + tx_mutex_get(&protection, 5 * NX_IP_PERIODIC_RATE); + index = count; + count++; + tx_mutex_put(&protection); +#endif + status = tx_thread_create(&helper_thread[index], "IPv4 if_any", bsd_server4_helper_thread_test_2, + 3, stack_space[index], DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + test_client_bind(); + for(i = 0; i < 6; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + test_client_bind(); + for(i = 0; i < 4; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + test_case = 4; + test_client_bind(); + for(i = 0; i < 6; i++) + tx_semaphore_get(&server_done_sema, 5 * NX_IP_PERIODIC_RATE); + + tx_semaphore_put(&test_done_sema); + +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_bind_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Bind Test.......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_blocking_bidirection_test.c b/test/regression/bsd_test/netx_bsd_tcp_blocking_bidirection_test.c new file mode 100644 index 00000000..386cc51a --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_blocking_bidirection_test.c @@ -0,0 +1,912 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 +#define NUM_MESSAGES 20 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *bsd_send_buffer = "From BSD Test"; +static char *netx_send_buffer = "From Native NetX Test"; +#ifdef FEATURE_NX_IPV6 +static char *bsd_send_buffer6 = "From BSD Test 6"; +static char *netx_send_buffer6 = "From Native NetX Test 6"; +#endif + +static void validate_bsd_structure(void); + +static char *bsd_transmit_v4_thread_stack; +static char *bsd_receive_v4_thread_stack; +static char *netx_transmit_v4_thread_stack; +static char *netx_receive_v4_thread_stack; + + +static TX_THREAD netx_transmit_v4_thread; +static TX_THREAD netx_receive_v4_thread; +static TX_THREAD bsd_transmit_v4_thread; +static TX_THREAD bsd_receive_v4_thread; + + + +#ifdef FEATURE_NX_IPV6 +static char *bsd_transmit_v6_thread_stack; +static char *bsd_receive_v6_thread_stack; +static char *netx_transmit_v6_thread_stack; +static char *netx_receive_v6_thread_stack; + +static TX_THREAD bsd_transmit_v6_thread; +static TX_THREAD bsd_receive_v6_thread; +static TX_THREAD netx_receive_v6_thread; +static TX_THREAD netx_transmit_v6_thread; +#endif + +static TX_SEMAPHORE bsd_sema; +static TX_SEMAPHORE netx_sema; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_blocking_bidirection_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + netx_transmit_v4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + netx_receive_v4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + bsd_transmit_v4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + bsd_receive_v4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + +#ifdef FEATURE_NX_IPV6 + netx_transmit_v6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + netx_receive_v6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + bsd_transmit_v6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + bsd_receive_v6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; +#endif +#if 0 + client4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + client6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; +#endif + status = tx_semaphore_create(&netx_sema, "test done", 0); + status += tx_semaphore_create(&bsd_sema, "test done", 0); + if(status != TX_SUCCESS) + error_counter++; +} + +static void transmit_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + ret = send(sockfd, bsd_send_buffer, strlen(bsd_send_buffer), 0); + + if(ret != (int)strlen(bsd_send_buffer)) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 50); + } + + tx_semaphore_put(&bsd_sema); + +} + +static void receive_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; +char buffer[30]; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + ret = recv(sockfd, buffer, sizeof(buffer), 0); + + if(ret != (int)strlen(netx_send_buffer)) + error_counter++; + else if(strncmp(buffer, netx_send_buffer, ret)) + error_counter++; + } + + tx_semaphore_put(&bsd_sema); + +} + +#ifdef FEATURE_NX_IPV6 +static void transmit6_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + ret = send(sockfd, bsd_send_buffer6, strlen(bsd_send_buffer6), 0); + + if(ret != (INT)strlen(bsd_send_buffer6)) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 50); + } + + tx_semaphore_put(&bsd_sema); + +} + +static void receive6_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; +char buffer[30]; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + ret = recv(sockfd, buffer, sizeof(buffer), 0); + + if(ret != (INT)strlen(netx_send_buffer6)) + error_counter++; + else if(strncmp(buffer, netx_send_buffer6, ret)) + error_counter++; + } + + tx_semaphore_put(&bsd_sema); + +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in peer_address; +struct sockaddr_in local_address; +int addr_len; +int new_sock; +UINT status; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 local_address6; +struct sockaddr_in6 peer_address6; +char mac_ip0[6]; +char mac_ip1[6]; +int sockfd6; +int new_sock6; +INT reuseaddr = 1; +#endif +int ret; + + printf("NetX Test: Basic BSD TCP Blocking Bidirection Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + tx_thread_sleep(NX_IP_PERIODIC_RATE / 10); + + /* Set up TCP socket and connect to IPv4 server. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd <= 0) + error_counter++; + + peer_address.sin_family = AF_INET; + peer_address.sin_port = htons(12345); + peer_address.sin_addr.s_addr = htonl(IP_ADDRESS(1, 2, 3, 5)); + + if(connect(sockfd, (struct sockaddr*)&peer_address, sizeof(peer_address)) < 0) + error_counter++; + + /* Create a thread to handle IPv4 TCP receive */ + ret = tx_thread_create(&bsd_transmit_v4_thread, "transmit v4 thread", transmit_entry, sockfd, + bsd_transmit_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + ret += tx_thread_create(&bsd_receive_v4_thread, "receive v4 thread", receive_entry, sockfd, + bsd_receive_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + if(ret != TX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set up TCP socket and connect to IPv6 server. */ + sockfd6 = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd6 <= 0) + error_counter++; + + peer_address6.sin6_family = AF_INET6; + peer_address6.sin6_port = htons(12345); + peer_address6.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1.nxd_ip_address.v6[0]); + peer_address6.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1.nxd_ip_address.v6[1]); + peer_address6.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1.nxd_ip_address.v6[2]); + peer_address6.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1.nxd_ip_address.v6[3]); + + if(connect(sockfd6, (struct sockaddr*)&peer_address6, sizeof(peer_address6)) < 0) + error_counter++; + + /* Create a thread to handle IPv6 TCP receive */ + ret = tx_thread_create(&bsd_transmit_v6_thread, "transmit v6 thread", transmit6_entry, sockfd6, + bsd_transmit_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + ret += tx_thread_create(&bsd_receive_v6_thread, "receive v6 thread", receive6_entry, sockfd6, + bsd_receive_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(ret != TX_SUCCESS) + error_counter++; + +#endif + + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + + /* Close down both sockets. */ +#ifdef FEATURE_NX_IPV6 + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + ret = soc_close(sockfd6); +#endif + ret += soc_close(sockfd); + if(ret) error_counter++; +#ifdef FEATURE_NX_IPV6 + tx_thread_delete(&bsd_transmit_v6_thread); + tx_thread_delete(&bsd_receive_v6_thread); +#endif + + tx_thread_delete(&bsd_transmit_v4_thread); + tx_thread_delete(&bsd_receive_v4_thread); + + /* Set up a TCP server socket and wait for IPv4 connection. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd <= 0) + error_counter++; + + local_address.sin_family = AF_INET; + local_address.sin_port = htons(12345); + local_address.sin_addr.s_addr = htonl(INADDR_ANY); + + if(bind(sockfd, (struct sockaddr*)&local_address, sizeof(local_address)) < 0) + error_counter++; + + if(listen(sockfd, 5) < 0) + error_counter++; + + addr_len = sizeof(peer_address); + new_sock = accept(sockfd, (struct sockaddr*)&peer_address, &addr_len); + if(new_sock < 0) + error_counter++; + /* Create a thread to handle IPv4 TCP receive */ + ret = tx_thread_create(&bsd_transmit_v4_thread, "transmit v4 thread", transmit_entry, new_sock, + bsd_transmit_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + ret += tx_thread_create(&bsd_receive_v4_thread, "receive v4 thread", receive_entry, new_sock, + bsd_receive_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + if(ret != TX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set up a TCP server socket and wait for IPv6 connection. */ + sockfd6 = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd6 <= 0) + error_counter++; + setsockopt(sockfd6, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(INT)); + memset(&local_address6, 0, sizeof(local_address6)); + local_address6.sin6_family = AF_INET6; + local_address6.sin6_port = htons(12345); + if(bind(sockfd6, (struct sockaddr*)&local_address6, sizeof(local_address6)) < 0) + error_counter++; + + if(listen(sockfd6, 5) < 0) + error_counter++; + + addr_len = sizeof(peer_address6); + new_sock6 = accept(sockfd6, (struct sockaddr*)&peer_address6, &addr_len); + if(new_sock6 < 0) + error_counter++; + /* Create a thread to handle IPv4 TCP receive */ + ret = tx_thread_create(&bsd_transmit_v6_thread, "transmit v6 thread", transmit6_entry, new_sock6, + bsd_transmit_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + ret += tx_thread_create(&bsd_receive_v6_thread, "receive v6 thread", receive6_entry, new_sock6, + bsd_receive_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + if(ret != TX_SUCCESS) + error_counter++; +#endif + /* Wait for test to finish. */ + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + +#ifdef FEATURE_NX_IPV6 + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + ret = soc_close(sockfd6); + ret = soc_close(new_sock6); +#endif + ret = soc_close(sockfd); + ret = soc_close(new_sock); + +#ifdef FEATURE_NX_IPV6 + tx_thread_delete(&bsd_transmit_v6_thread); + tx_thread_delete(&bsd_receive_v6_thread); +#endif + + tx_thread_delete(&bsd_transmit_v4_thread); + tx_thread_delete(&bsd_receive_v4_thread); + + if(status) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void netx_transmit_v4_entry(ULONG param) +{ +NX_TCP_SOCKET *socket_ptr = (NX_TCP_SOCKET*)param; +int i; +NX_PACKET *packet_ptr; +ULONG status; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, netx_send_buffer, strlen(netx_send_buffer), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(socket_ptr, packet_ptr, NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + error_counter++; + } + + tx_semaphore_put(&netx_sema); +} + +static void netx_receive_v4_entry(ULONG param) +{ +NX_TCP_SOCKET *socket_ptr = (NX_TCP_SOCKET*)param; +int i; +NX_PACKET *packet_ptr; +ULONG status; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(socket_ptr, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != strlen(bsd_send_buffer))) + error_counter++; + + if(status == NX_SUCCESS) + nx_packet_release(packet_ptr); + + } + + tx_semaphore_put(&netx_sema); +} + +#ifdef FEATURE_NX_IPV6 +static void netx_transmit_v6_entry(ULONG param) +{ +NX_TCP_SOCKET *socket_ptr = (NX_TCP_SOCKET*)param; +int i; +NX_PACKET *packet_ptr; +ULONG status; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, netx_send_buffer6, strlen(netx_send_buffer6), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(socket_ptr, packet_ptr, NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + error_counter++; + } + + tx_semaphore_put(&netx_sema); +} + +static void netx_receive_v6_entry(ULONG param) +{ +NX_TCP_SOCKET *socket_ptr = (NX_TCP_SOCKET*)param; +int i; +NX_PACKET *packet_ptr; +ULONG status; + + for(i = 0; i < NUM_MESSAGES; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(socket_ptr, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Check for error. */ + if (packet_ptr -> nx_packet_length != strlen(bsd_send_buffer6)) + error_counter++; + else if(memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd_send_buffer6, packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + + } + + tx_semaphore_put(&netx_sema); +} + +#endif +static void netx_tcp_server(void) +{ +NX_TCP_SOCKET server_socket4; +#ifdef FEATURE_NX_IPV6 +NX_TCP_SOCKET server_socket6; +#endif +UINT status; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket4, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12345, &server_socket4, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket4, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + status = nx_tcp_socket_create(&ip_1, &server_socket6, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + status += nx_tcp_server_socket_relisten(&ip_1, 12345, &server_socket6); + + /* Check for error. */ + if ((status == NX_SUCCESS) || (status == NX_CONNECTION_PENDING)) + { + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket6, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + } + else + error_counter++; + + status = tx_thread_create(&netx_transmit_v6_thread, "netx transmit v6 thread", netx_transmit_v6_entry, (ULONG)&server_socket6, + netx_transmit_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + status += tx_thread_create(&netx_receive_v6_thread, "netx receive v6 thread", netx_receive_v6_entry, (ULONG)&server_socket6, + netx_receive_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(status != TX_SUCCESS) + error_counter++; + +#endif + + status = tx_thread_create(&netx_transmit_v4_thread, "netx transmit v4 thread", netx_transmit_v4_entry, (ULONG)&server_socket4, + netx_transmit_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + status += tx_thread_create(&netx_receive_v4_thread, "netx receive v4 thread", netx_receive_v4_entry, (ULONG)&server_socket4, + netx_receive_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(status != TX_SUCCESS) + error_counter++; + + + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + + /* Close down both sockets. */ +#ifdef FEATURE_NX_IPV6 + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); +#endif + +#ifdef FEATURE_NX_IPV6 + tx_thread_delete(&netx_transmit_v6_thread); + tx_thread_delete(&netx_receive_v6_thread); +#endif + + tx_thread_delete(&netx_transmit_v4_thread); + tx_thread_delete(&netx_receive_v4_thread); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket4, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket4); + + status += nx_tcp_socket_delete(&server_socket4); + /* Check for error. */ + if (status) + error_counter++; +#ifdef FEATURE_NX_IPV6 + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket6, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status != NX_SUCCESS) && (status != NX_DISCONNECT_FAILED)) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket6); + + /* Check for error. */ + if (status) + error_counter++; + + + nx_tcp_socket_delete(&server_socket6); +#endif + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12345); + + /* Check for error. */ + if (status) + error_counter++; + +} + +static void netx_tcp_client(void) +{ +NX_TCP_SOCKET client_socket4; +#ifdef FEATURE_NX_IPV6 +NX_TCP_SOCKET client_socket6; +#endif +UINT status; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket4, "Client Socket 4", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + status += nx_tcp_client_socket_bind(&client_socket4, NX_ANY_PORT, 0); + status += nx_tcp_client_socket_connect(&client_socket4, IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if (status) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + status = nx_tcp_socket_create(&ip_1, &client_socket6, "Client Socket 4", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + status += nx_tcp_client_socket_bind(&client_socket6, NX_ANY_PORT, 0); + + status += nxd_tcp_client_socket_connect(&client_socket6, &ipv6_address_ip0, 12345, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + status = tx_thread_create(&netx_transmit_v6_thread, "netx transmit v6 thread", netx_transmit_v6_entry, (ULONG)&client_socket6, + netx_transmit_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + status += tx_thread_create(&netx_receive_v6_thread, "netx receive v6 thread", netx_receive_v6_entry, (ULONG)&client_socket6, + netx_receive_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(status) + error_counter++; + +#endif + status = tx_thread_create(&netx_transmit_v4_thread, "netx transmit v4 thread", netx_transmit_v4_entry, (ULONG)&client_socket4, + netx_transmit_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + status += tx_thread_create(&netx_receive_v4_thread, "netx receive v4 thread", netx_receive_v4_entry, (ULONG)&client_socket4, + netx_receive_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(status != TX_SUCCESS) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); +#endif + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + + status = nx_tcp_socket_disconnect(&client_socket4, NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(client_socket4.nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&client_socket4); + + + status += nx_tcp_socket_delete(&client_socket4); + + if(status != NX_SUCCESS) + error_counter++; +#ifdef FEATURE_NX_IPV6 + status = nx_tcp_socket_disconnect(&client_socket6, NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(client_socket6.nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&client_socket6); + + + status += nx_tcp_socket_delete(&client_socket6); + + if(status != NX_SUCCESS) + error_counter++; +#endif + + tx_semaphore_delete(&netx_sema); + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + + netx_tcp_server(); + + + netx_tcp_client(); + +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_blocking_bidirection_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Blocking Bidirection Test.......N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_clients_share_port_test.c b/test/regression/bsd_test/netx_bsd_tcp_clients_share_port_test.c new file mode 100644 index 00000000..6a5832a3 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_clients_share_port_test.c @@ -0,0 +1,855 @@ +/* This demoonstrates sharing a port between an IPv4 and IPv6 TCP client socket to send + and receive packets (e.g emulates a socket that can send/receive iPv4 and Ipv6 packets) + using a simulated Ethernet driver. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) && defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_client6; +static TX_THREAD thread_server; +static TX_THREAD thread_server6; +static NX_PACKET_POOL bsd_pool; +static NX_IP bsd_ip_server; +static NX_IP bsd_ip_client; + +static UINT error_counter = 0; + +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define SERVER_PORT 74 +#define SERVER6_PORT 76 +#define CLIENT_PORT 87 + +/* Define global data. */ + +static UINT ipv4_client_complete = NX_FALSE; +static UINT ipv6_client_complete = NX_FALSE; + +/* Define thread prototypes. */ + + +static VOID thread_client_entry(ULONG thread_input); +static VOID thread_client6_entry(ULONG thread_input); +static VOID thread_server_entry(ULONG thread_input); +static VOID thread_server6_entry(ULONG thread_input); +VOID _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_clients_share_port_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a BSD packet pool. */ + status = nx_packet_pool_create(&bsd_pool, "NetX BSD Packet Pool", 1516, pointer, 16384); + + pointer = pointer + 16384; + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /********************** Set up the Server IP instance **************************/ + + /* Create a thread for the IPv4 server. */ + status= tx_thread_create(&thread_server, "BSD App IPv4 Server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + + /* Create a thread for IPv6 server. */ + status= tx_thread_create(&thread_server6, "BSD App IPv6 Server", thread_server6_entry, 0, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create an IP instance for the BSD . */ + status = nx_ip_create(&bsd_ip_server, "NetX BSD IPv4 Server", SERVER_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_ip_server); + + /* Enable ARP and supply ARP cache memory for BSD */ + status += nx_arp_enable(&bsd_ip_server, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + + /********************** Set up the Client **************************/ + + + /* Create an IP instance for the BSD . */ + status = nx_ip_create(&bsd_ip_client, "NetX BSD IPv4 Client", CLIENT_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_ip_client); + + status = nx_icmp_enable(&bsd_ip_client); + /* Enable ARP and supply ARP cache memory for BSD */ + status += nx_arp_enable(&bsd_ip_client, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + + /* Create a thread for IPv4 client. */ + status= tx_thread_create(&thread_client, "BSD App IPpv4 Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create a thread for IPv6 client. */ + status= tx_thread_create(&thread_client6, "BSD App IPv6 Client", thread_client6_entry, 0, + pointer, DEMO_STACK_SIZE, + 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + + /* Now initialize BSD IP. */ + status = bsd_initialize (&bsd_ip_client, &bsd_pool, pointer, 2048, 4); + + /* Check for BSD errors. */ + if (status) + { + error_counter++; + } + + pointer = pointer + 2048; + + return; +} + +/* Define the IPv4 server thread */ +void thread_server_entry(ULONG thread_input) +{ + +INT status; +ULONG actual_status; +NX_TCP_SOCKET server_ipv4_socket; +NX_PACKET *packet_rcv_ptr, *packet_ptr; +char *requests[2] = {"Request1", "Request2"}; +UINT ipv4_server_complete = NX_FALSE; + + /* Check status... */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(11); + } + + /* Wait for IPv6 get set up first. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + status = nx_ip_status_check(&bsd_ip_server, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(12); + } + + status = nx_tcp_socket_create(&bsd_ip_server, &server_ipv4_socket, "Server IPv4 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(13); + } + + status = nx_tcp_server_socket_listen(&bsd_ip_server, SERVER_PORT, &server_ipv4_socket, 5, NX_NULL); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(14); + } + + status = nx_tcp_server_socket_accept(&server_ipv4_socket, 1000); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(15); + } + + while(!ipv4_server_complete) + { + + status = nx_tcp_socket_receive(&server_ipv4_socket, &packet_rcv_ptr, 500); + if(status != NX_SUCCESS) + { + if (status == NX_NOT_CONNECTED) + { + + ipv4_server_complete = NX_TRUE; + break; + } + + test_control_return(16); + error_counter++; + } + + else + { + + nx_packet_release(packet_rcv_ptr); + } + + status = nx_packet_allocate(&bsd_pool, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status ) + { + + test_control_return(17); + error_counter++; + } + + status = nx_packet_data_append(packet_ptr, requests[0], strlen(requests[0]), + &bsd_pool, NX_NO_WAIT); + if (status ) + { + + test_control_return(18); + error_counter++; + } + + status = nx_tcp_socket_send(&server_ipv4_socket, packet_ptr, 100); + + if (status) + { + nx_packet_release(packet_ptr); + + + if (status == NX_NOT_CONNECTED) + { + ipv4_server_complete = NX_TRUE; + break; + } + + test_control_return(19); + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 2); + } + + status = nx_tcp_socket_disconnect(&server_ipv4_socket, 200); + + if (status !=NX_SUCCESS) + { + test_control_return(20); + } + nx_tcp_socket_delete(&server_ipv4_socket); + + if (status !=NX_SUCCESS) + { + test_control_return(21); + } + /* All done */ + return; + +} + +/* Define the IPv6 server thread */ + +void thread_server6_entry(ULONG thread_input) +{ + +INT status; +ULONG actual_status; +NX_TCP_SOCKET server_ipv6_socket; +NX_PACKET *packet_rcv_ptr, *packet_ptr; +char *requests[2] = {"Request6_1", "Request6_2"}; +UINT ipv6_server_complete = NX_FALSE; +UINT address_index; +NXD_ADDRESS ip_address; + + + /* Check status... */ + if (error_counter) + { + printf("ERROR22!\n"); + test_control_return(22); + } + + printf("NetX Test: BSD TCP Client Socket Shared Port Test........"); + status = nx_ip_status_check(&bsd_ip_server, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR23!\n"); + test_control_return(23); + } + + status = nxd_ipv6_enable(&bsd_ip_server); + + if((status != NX_SUCCESS) && (status != NX_ALREADY_ENABLED)) + { + printf("ERROR24!\n"); + test_control_return(24); + } + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_ip_server); + if(status) + { + printf("ERROR25!\n"); + test_control_return(25); + } + + /* This assumes we are using the primary network interface (index 0). */ + status = nxd_ipv6_address_set(&bsd_ip_server, 0, NX_NULL, 10, &address_index); + + if (status) + { + printf("ERROR26!\n"); + test_control_return(26); + } + + /* Set ip interface address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010db8; + ip_address.nxd_ip_address.v6[1] = 0x0000f101; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 0x101; + + + /* Set the host global IP address. We are assuming a 64 + bit prefix here but this can be any value (< 128). */ + status = nxd_ipv6_address_set(&bsd_ip_server, 0, &ip_address, 64, &address_index); + + if (status) + { + printf("ERROR27!\n"); + test_control_return(27); + } + + /* Wait for IPv6 stack to finish DAD process. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&bsd_ip_server, &server_ipv6_socket, "Server IPv6 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + if (status ) + { + printf("ERROR28!\n"); + test_control_return(28); + } + + status = nx_tcp_server_socket_listen(&bsd_ip_server, SERVER6_PORT, &server_ipv6_socket, 5, NX_NULL); + + if (status ) + { + printf("ERROR29!\n"); + test_control_return(29); + } + + status = nx_tcp_server_socket_accept(&server_ipv6_socket, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + printf("ERROR30!\n"); + test_control_return(30); + } + + while(!ipv6_server_complete) + { + + status = nx_tcp_socket_receive(&server_ipv6_socket, &packet_rcv_ptr, 500); + if(status != NX_SUCCESS) + { + if (status == NX_NOT_CONNECTED) + { + + ipv6_server_complete = NX_TRUE; + break; + } + + + printf("ERROR31!\n"); + test_control_return(31); + error_counter++; + } + + else + { + nx_packet_release(packet_rcv_ptr); + } + + status = nx_packet_allocate(&bsd_pool, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status ) + { + + printf("ERROR32\n"); + test_control_return(32); + error_counter++; + } + + status = nx_packet_data_append(packet_ptr, requests[1], strlen(requests[1]), + &bsd_pool, NX_NO_WAIT); + if (status ) + { + + printf("ERROR33!\n"); + test_control_return(33); + error_counter++; + } + + status = nx_tcp_socket_send(&server_ipv6_socket, packet_ptr, 100); + + if (status) + { + nx_packet_release(packet_ptr); + + + if (status == NX_NOT_CONNECTED) + { + + ipv6_server_complete = NX_TRUE; + break; + } + + printf("ERROR34!\n"); + test_control_return(34); + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 2); + } + + nx_tcp_socket_disconnect(&server_ipv6_socket, 200); + nx_tcp_socket_delete(&server_ipv6_socket); + + /* Wait for IPv4 to close down before closing down our server socket. */ + while (!ipv6_client_complete) + { + tx_thread_sleep(20); + } + + if(error_counter) + { + printf("ERROR35!\n"); + test_control_return(35); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the IPv6 Client thread. */ + +void thread_client6_entry(ULONG thread_input) +{ + +INT status; +ULONG actual_status; +INT sock6_tcp_client; +struct sockaddr_in6 echoServAddr6, echoClientAddr6; +UINT address_index; +NXD_ADDRESS ip_address; +CHAR Client_Rcv_Buffer[100]; +UINT loopcount = 0; + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 2); + + status = nx_ip_status_check(&bsd_ip_client, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR36!\n"); + test_control_return(36); + } + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_ip_client); + if((status != NX_SUCCESS) && (status != NX_ALREADY_ENABLED)) + { + printf("ERROR37!\n"); + test_control_return(37); + } + + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_ip_client); + if(status) + { + printf("ERROR38!\n"); + test_control_return(38); + } + + /* This assumes we are using the primary network interface (index 0). */ + status = nxd_ipv6_address_set(&bsd_ip_client, 0, NX_NULL, 10, &address_index); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR39!\n"); + test_control_return(39); + } + + + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010db8; + ip_address.nxd_ip_address.v6[1] = 0xf101; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 0x1235; + + + /* Set the host global IP address. We are assuming a 64 + bit prefix here but this can be any value (< 128). */ + status = nxd_ipv6_address_set(&bsd_ip_client, 0, &ip_address, 64, &address_index); + + if (status) + { + printf("ERROR40!\n"); + test_control_return(40); + } + + + /* Wait for IPv6 stack to finish DAD process. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + echoClientAddr6.sin6_addr._S6_un._S6_u32[0] = htonl(0x20010db8); + echoClientAddr6.sin6_addr._S6_un._S6_u32[1] = htonl(0xf101); + echoClientAddr6.sin6_addr._S6_un._S6_u32[2] = 0x0; + echoClientAddr6.sin6_addr._S6_un._S6_u32[3] = htonl(0x1235); + echoClientAddr6.sin6_port = htons(CLIENT_PORT); + echoClientAddr6.sin6_family = AF_INET6; + + memset(&echoServAddr6, 0, sizeof(echoServAddr6)); + echoServAddr6.sin6_addr._S6_un._S6_u32[0] = htonl(0x20010db8); + echoServAddr6.sin6_addr._S6_un._S6_u32[1] = htonl(0xf101); + echoServAddr6.sin6_addr._S6_un._S6_u32[2] = 0x0; + echoServAddr6.sin6_addr._S6_un._S6_u32[3] = htonl(0x0101); + echoServAddr6.sin6_port = htons(SERVER6_PORT); + echoServAddr6.sin6_family = AF_INET6; + + + /* Now make client connections with the server. */ + while (!ipv6_client_complete) + { + + /* Create BSD TCP Socket */ + sock6_tcp_client = socket( AF_INET6, SOCK_STREAM, IPPROTO_TCP); + + if (sock6_tcp_client == ERROR) + { + printf("ERROR41!\n"); + test_control_return(41); + } + + status = bind (sock6_tcp_client, (struct sockaddr *) &echoClientAddr6, sizeof(echoClientAddr6)); + + if (status == ERROR) + { + printf("ERROR42!\n"); + test_control_return(42); + } + + /* Now connect this client to the server */ + status = connect(sock6_tcp_client, (struct sockaddr *)&echoServAddr6, sizeof(echoServAddr6)); + + /* Check for error. */ + if (status == ERROR) + { + printf("ERROR43!\n"); + test_control_return(43); + return; + + } + + /* Now receive the echoed packet from the server */ + while(loopcount < 5) + { + + send(sock6_tcp_client, "Hello", (strlen("Hello")+1), 0); + + memset(&Client_Rcv_Buffer[0], 0, 100); + status = recv(sock6_tcp_client, (VOID *)Client_Rcv_Buffer, 100, 0); + + if (status < 0) + { + + if (errno == EAGAIN) + { + continue; + } + else if (errno == ENOTCONN) + { + + break; + } + else + { + /* Another error has occurred.... */ + + + printf("ERROR44!\n"); + test_control_return(44); + error_counter++; + break; + } + + } + else if (status == 0) + { + + break; + } + + tx_thread_sleep(80 * NX_IP_PERIODIC_RATE / 100); + loopcount++; + } + + ipv6_client_complete = NX_TRUE; + + break; + } + + + /* close this client socket */ + status = soc_close(sock6_tcp_client); + + if (status != ERROR) + { + + printf("ERROR46!\n"); + test_control_return(45); + error_counter++; + } +} + + +/* Define the IPv4 Client thread. */ +void thread_client_entry(ULONG thread_input) +{ + +INT status; +UINT loopcount = 0; +ULONG actual_status; +INT sock_tcp_client; +struct sockaddr_in echoServAddr; +struct sockaddr_in echoClientAddr; +CHAR Client_Rcv_Buffer[100]; + + /* IPv4 waits for IPv6 DAD protocol */ + tx_thread_sleep(550 * NX_IP_PERIODIC_RATE / 100); + + status = nx_ip_status_check(&bsd_ip_client, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR46a!\n"); + test_control_return(46); + } + + echoClientAddr.sin_family = AF_INET; + echoClientAddr.sin_port = htons(CLIENT_PORT); + echoClientAddr.sin_addr.s_addr = htonl(CLIENT_ADDRESS); + + memset(&echoServAddr, 0, sizeof(echoServAddr)); + echoServAddr.sin_family = AF_INET; + echoServAddr.sin_addr.s_addr = htonl(SERVER_ADDRESS); + echoServAddr.sin_port = htons(SERVER_PORT); + + /* Now make client connections with the server. */ + while (!ipv4_client_complete) + { + + /* Create BSD TCP Socket */ + sock_tcp_client = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_client == -1) + { + printf("ERROR47!\n"); + test_control_return(47); + } + + status = bind (sock_tcp_client, (struct sockaddr *) &echoClientAddr, sizeof(echoClientAddr)); + + if (status < 0) + { + printf("ERROR%d!\n", errno); + test_control_return(48); + } + + /* Now connect this client to the server */ + status = connect(sock_tcp_client, (struct sockaddr *)&echoServAddr, sizeof(echoServAddr)); + + /* Check for error. */ + if (status != OK) + { + printf("ERROR49!\n"); + test_control_return(49); + } + + /* Now receive the echoed packet from the server */ + while(loopcount < 5) + { + + status = send(sock_tcp_client, "Hello from Client4", (strlen("Hello from Client4")+1), 0); + + if (status == ERROR) + { + + printf("ERROR50!\n"); + test_control_return(50); + error_counter++; + } + + memset(&Client_Rcv_Buffer[0], 0, 100); + status = recv(sock_tcp_client, (VOID *)Client_Rcv_Buffer, 100, 0); + + if (status < 0) + { + + if (errno == EAGAIN) + { + continue; + } + else if (errno == ENOTCONN) + { + break; + } + else + { + /* Another error has occurred.... */ + + printf("ERROR51!\n"); + test_control_return(51); + error_counter++; + break; + } + + } + else if (status == 0) + { + + break; + } + tx_thread_sleep(80 * NX_IP_PERIODIC_RATE / 100); + loopcount++; + } + + ipv4_client_complete = NX_TRUE; + } + + /* close this client socket */ + status = soc_close(sock_tcp_client); + + if (status == ERROR) + { + + printf("ERROR53!\n"); + test_control_return(53); + error_counter++; + } + + /* All done */ + return; +} +#else /* FEATURE_NX_IPV6 */ + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_clients_share_port_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: BSD TCP Client Socket Shared Port Test........N/A\n"); + + test_control_return(3); + +} + +#endif /* FEATURE_NX_IPV6 */ + + + + diff --git a/test/regression/bsd_test/netx_bsd_tcp_clients_shared_port_test.c b/test/regression/bsd_test/netx_bsd_tcp_clients_shared_port_test.c new file mode 100644 index 00000000..6ae1f9e0 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_clients_shared_port_test.c @@ -0,0 +1,585 @@ +/* This demonstrates sharing a port between an IPv4 and IPv6 TCP client socket to send + and receive packets (e.g emulates a socket that can send/receive iPv4 and Ipv6 packets) + using a simulated Ethernet driver. */ + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) && defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_PACKET_POOL bsd_pool; +static NX_IP bsd_server_ip; +static NX_IP bsd_client_ip; +static NX_TCP_SOCKET server_socket1; +static NX_TCP_SOCKET server_socket2; + +static UINT error_counter = 0; + +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_PORT 87 + + +static char *requests[2] = {"Request1", "Request2"}; +static char *responses[2] = {"Response1", "Response2"}; +static UINT spin = NX_TRUE; + +/* Define thread prototypes. */ + +static VOID thread_client_entry(ULONG thread_input); +static VOID thread_server_entry(ULONG thread_input); +void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_clients_shared_port_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a BSD packet pool. */ + status = nx_packet_pool_create(&bsd_pool, "NetX BSD Packet Pool", 256, pointer, 16384); + + pointer = pointer + 16384; + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /********************** Set up the Server IP instance **************************/ + + /* Create a thread for server. */ + status= tx_thread_create(&thread_server, "BSD App Server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create an IP instance for the BSD Server. */ + status = nx_ip_create(&bsd_server_ip, "NetX BSD Server", SERVER_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_server_ip); + + /* Enable ARP and supply ARP cache memory for BSD Server Instance */ + status += nx_arp_enable(&bsd_server_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + pointer = pointer + 2048; + + /********************** Set up the Client IP instance **************************/ + + /* Create a thread for client. */ + status= tx_thread_create(&thread_client, "BSD App Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create an IP instance for the BSD Client. */ + status = nx_ip_create(&bsd_client_ip, "NetX BSD Client", CLIENT_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_client_ip); + + /* Enable ARP and supply ARP cache memory for BSD Client Instance */ + status += nx_arp_enable(&bsd_client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + /* Now initialize BSD Client IP. */ + status = bsd_initialize (&bsd_client_ip, &bsd_pool, pointer, 2048, 4); + + /* Check for BSD errors. */ + if (status) + { + error_counter++; + } + + return; +} + + + +void thread_client_entry(ULONG thread_input) +{ + +INT status, sock_tcp_client, sock_tcp_client6; +struct sockaddr_in echoClientAddr; +struct sockaddr_in echoServAddr; +struct sockaddr_in localAddr; +struct sockaddr_in6 echoServAddr6; +struct sockaddr_in6 echoClientAddr6; +struct sockaddr_in6 localAddr6; +NXD_ADDRESS ip_address; +UINT address_index; +UINT loopcount = 0; +CHAR rcvBuffer[32]; +INT length; + + + printf("NetX Test: Basic BSD TCP Client Socket Shared Port Test............"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + memset(&echoClientAddr, 0, sizeof(echoClientAddr)); + + memset(&echoClientAddr6, 0, sizeof(echoClientAddr6)); + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_client_ip); + if(status) + { + printf("ERROR!\n"); + error_counter++; + } + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_client_ip); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set ip_0 interface address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010db8; + ip_address.nxd_ip_address.v6[1] = 0xf101; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 0x1235; + + status = nxd_ipv6_address_set(&bsd_client_ip, 0, NX_NULL, 10, &address_index); + + status |= nxd_ipv6_address_set(&bsd_client_ip, 0, &ip_address, 64, &address_index); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for IPv6 stack to finish DAD process. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + echoClientAddr6.sin6_addr._S6_un._S6_u32[0] = htonl(0x20010db8); + echoClientAddr6.sin6_addr._S6_un._S6_u32[1] = htonl(0xf101); + echoClientAddr6.sin6_addr._S6_un._S6_u32[2] = 0x0; + echoClientAddr6.sin6_addr._S6_un._S6_u32[3] = htonl(0x1235); + echoClientAddr6.sin6_port = htons(CLIENT_PORT); + echoClientAddr6.sin6_family = AF_INET6; + + + echoServAddr6.sin6_addr._S6_un._S6_u32[0] = htonl(0x20010db8); + echoServAddr6.sin6_addr._S6_un._S6_u32[1] = htonl(0xf101); + echoServAddr6.sin6_addr._S6_un._S6_u32[2] = 0x0; + echoServAddr6.sin6_addr._S6_un._S6_u32[3] = htonl(0x1234); + echoServAddr6.sin6_port = htons(77); + echoServAddr6.sin6_family = AF_INET6; + + /* Create BSD TCP IPv6 Client Socket */ + sock_tcp_client6 = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_client6 == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create BSD TCP IPv4 Client Socket */ + sock_tcp_client = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_client == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + echoClientAddr.sin_family = AF_INET; + echoClientAddr.sin_port = htons(CLIENT_PORT); + echoClientAddr.sin_addr.s_addr = htonl(CLIENT_ADDRESS); + + + echoServAddr.sin_family = AF_INET; + echoServAddr.sin_port = htons(76); + echoServAddr.sin_addr.s_addr = htonl(SERVER_ADDRESS); + + /* Bind the IPv4 and IPv6 Client sockets. */ + status = bind (sock_tcp_client, (struct sockaddr *) &echoClientAddr, sizeof(echoClientAddr)); + status |= bind (sock_tcp_client6, (struct sockaddr *) &echoClientAddr6, sizeof(echoClientAddr6)); + if (status < 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now connect to TCP server socket. */ + status = connect(sock_tcp_client, (struct sockaddr *)&echoServAddr, sizeof(echoServAddr)); + if (status < 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + length = sizeof(localAddr); + status = getsockname(sock_tcp_client, (struct sockaddr *)&localAddr, &length); + if (localAddr.sin_port != htons(CLIENT_PORT)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = connect(sock_tcp_client6, (struct sockaddr *)&echoServAddr6, sizeof(echoServAddr6)); + if (status < 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + length = sizeof(localAddr6); + status = getsockname(sock_tcp_client6, (struct sockaddr *)&localAddr6, &length); + if (localAddr6.sin6_port != htons(CLIENT_PORT)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* All set to accept client connections */ + + /* Loop to handle IPv4 and IPv6 clients*/ + while(loopcount < 5) + { + + /* Send data to server connected to specified client. This demo assumes the + server will receive and send in order of server #1 and server #2. This is + ok since we only need to establish that BSD can emulate a socket that sends + and receives IPv4 packets. */ + status = send(sock_tcp_client, requests[0], strlen(requests[0]), 0); + + if (status == ERROR) + { + error_counter++; + } + + + /* Send data to server connected to specified client. */ + status = send(sock_tcp_client6, requests[1], strlen(requests[1]), 0); + + if (status == ERROR ) + { + error_counter++; + } + status = recv(sock_tcp_client, (VOID *)rcvBuffer, 32, 0); + if (status == ERROR) + { + error_counter++; + } + + status = recv(sock_tcp_client6, (VOID *)rcvBuffer, 32, 0); + if (status == ERROR) + { + error_counter++; + } + + loopcount++; + } + + /* Stop the Server thread. */ + spin = NX_FALSE; + + /* Close down our sockets. */ + soc_close(sock_tcp_client); + soc_close(sock_tcp_client6); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(loopcount != 5) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the Server thread. */ + +void thread_server_entry(ULONG thread_input) +{ + +INT status; +NXD_ADDRESS server_ip_address; +UINT address_index; +NX_PACKET *packet_ptr4, *packet_ptr3, *packet_ptr2, *packet_ptr; + + + /* Allow Netx to initialize the driver. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE / 5); + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_server_ip); + if(status) + test_control_return(1); + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_server_ip); + if(status) + test_control_return(1); + + /* Set Client IPv6 interface address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + server_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + server_ip_address.nxd_ip_address.v6[2] = 0; + server_ip_address.nxd_ip_address.v6[3] = 0x1234; + + status = nxd_ipv6_address_set(&bsd_server_ip, 0, NX_NULL, 10, &address_index); + + status |= nxd_ipv6_address_set(&bsd_server_ip, 0, &server_ip_address, 64, &address_index); + if (status) + test_control_return(1); + + /* Time for duplicate address check. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set Server IPv6 interface address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + server_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + server_ip_address.nxd_ip_address.v6[2] = 0; + server_ip_address.nxd_ip_address.v6[3] = 0x1234; + + status = nx_tcp_socket_create(&bsd_server_ip, &server_socket1, "Server IPv4 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + status += nx_tcp_socket_create(&bsd_server_ip, &server_socket2, "Server IPv6 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + if (status ) + { + test_control_return(1); + } + + status = nx_tcp_server_socket_listen(&bsd_server_ip, 76, &server_socket1, 5, NX_NULL); + status += nx_tcp_server_socket_listen(&bsd_server_ip, 77, &server_socket2, 5, NX_NULL); + + if (status ) + { + test_control_return(1); + } + + status = nx_tcp_server_socket_accept(&server_socket1, 4 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_server_socket_accept(&server_socket2, 4 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + while(spin) + { + + status = nx_tcp_socket_receive(&server_socket1, &packet_ptr3, 4 * NX_IP_PERIODIC_RATE); + + /* Check if the Client terminated the connection. */ + if (spin!= NX_TRUE) + { + /* It did, so let's bail. */ + break; + } + + /* Otherwise we expect a packet. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + nx_packet_release(packet_ptr3); + } + + status = nx_tcp_socket_receive(&server_socket2, &packet_ptr4, 4 * NX_IP_PERIODIC_RATE); + + /* Check if the Client terminated the connection. */ + if (spin!= NX_TRUE) + { + /* It did, so let's bail. */ + break; + } + + /* Here we expect a packet. */ + if(status != NX_SUCCESS) + { + error_counter++; + } + else + { + nx_packet_release(packet_ptr4); + } + + status = nx_packet_allocate(&bsd_pool, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + { + + /* No packets available. Abort! */ + + printf("ERROR!\n"); + test_control_return(1); + } + status = nx_packet_data_append(packet_ptr, responses[0], strlen(responses[0]), + &bsd_pool, NX_NO_WAIT); + if (status) + { + test_control_return(1); + } + + status = nx_packet_allocate(&bsd_pool, &packet_ptr2, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + { + /* No packets available. Abort! */ + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr2, responses[1], strlen(responses[1]), + &bsd_pool, NX_NO_WAIT); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_socket_send(&server_socket1, packet_ptr, NX_IP_PERIODIC_RATE); + + if (status ) + { + error_counter++; + nx_packet_release(packet_ptr2); + } + + status = nx_tcp_socket_send(&server_socket2, packet_ptr2, NX_IP_PERIODIC_RATE); + + if (status ) + { + nx_packet_release(packet_ptr2); + error_counter++; + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + nx_tcp_socket_delete(&server_socket1); + nx_tcp_socket_delete(&server_socket2); + + /* All done */ + return; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_clients_shared_port_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Client Socket Shared Port Test............N/A"); + + test_control_return(3); + +} +#endif /* defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) */ + + + + diff --git a/test/regression/bsd_test/netx_bsd_tcp_disconnect_test.c b/test/regression/bsd_test/netx_bsd_tcp_disconnect_test.c new file mode 100644 index 00000000..5c95e666 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_disconnect_test.c @@ -0,0 +1,576 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 1024 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; +static TX_THREAD ntest_3; +static TX_THREAD ntest_4; +static TX_THREAD ntest_5; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +/* Define the counters used in the test application... */ +#define NUM_ITERATION 3000 +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (100) / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; + +static char *send_buffer = "Hello World"; +typedef struct helper_thread_block_struct +{ + ULONG stack_space[DEMO_STACK_SIZE / sizeof(ULONG)]; + TX_THREAD helper_thread; +} HELPER_THREAD_BLOCK; + +static HELPER_THREAD_BLOCK *helper_thread_block_ptr; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, 1, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, 1, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the main thread. */ + tx_thread_create(&ntest_2, "client thread 1", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, 1, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_3, "client thread 2", ntest_2_entry, 1, + pointer, DEMO_STACK_SIZE, + 2, 2, 1, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_4, "client thread 3", ntest_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 2, 2, 1, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_5, "client thread 4", ntest_2_entry, 3, + pointer, DEMO_STACK_SIZE, + 2, 2, 1, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + helper_thread_block_ptr = (HELPER_THREAD_BLOCK*)pointer; + pointer += sizeof(HELPER_THREAD_BLOCK) * 10; + + memset(helper_thread_block_ptr, 0, sizeof(HELPER_THREAD_BLOCK) * 10); + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd; +char buf[30]; + + sockfd = thread_input; + + /* Receive data from the client. */ + ret = recv(sockfd, buf, sizeof(buf), 0); + if(ret < 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + tx_semaphore_put(&sema_0); +} + + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int bytes_sent; +int ret; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + { + error_counter++; + return; + } + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + else + { + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + } + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i, j; +UINT status; +HELPER_THREAD_BLOCK *helper_thread_ptr; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + for(i = 0; i < 4; i++) + tx_semaphore_put(&sema_1); + + /* 3 iterations. */ + for(i = 0; i < NUM_ITERATION; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + + if(address_length != sizeof(remote_addr)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + + for(j = 0; j < 10; j++) + { + helper_thread_ptr = (HELPER_THREAD_BLOCK *)((UINT)helper_thread_block_ptr + sizeof(HELPER_THREAD_BLOCK) * j); + + if((helper_thread_ptr -> helper_thread.tx_thread_id == 0) || + (helper_thread_ptr -> helper_thread.tx_thread_state == TX_COMPLETED)) + { + + if(helper_thread_ptr -> helper_thread.tx_thread_state == TX_COMPLETED) + { + tx_thread_delete(&(helper_thread_ptr -> helper_thread)); + } + status = tx_thread_create(&helper_thread_ptr -> helper_thread, "helper thread", bsd_server_helper_thread_entry, + newsock, &helper_thread_ptr -> stack_space[0], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + tx_thread_relinquish(); + break; + } + } + } + /* Close down the socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_ITERATION; i++) + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); +} + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int iterations = 0; +int i; + + + printf("NetX Test: Basic BSD TCP Disconnect Test................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + for(iterations = 0; iterations < NUM_ITERATION; iterations++) + { + test_tcp_client4(); + } + + tx_thread_resume(&ntest_2); + tx_thread_resume(&ntest_3); + tx_thread_resume(&ntest_4); + tx_thread_resume(&ntest_5); + + test_tcp_server4(); + + for(i = 0; i < 4; i++) + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets[4]; +static void nx_client4(int thread_input) +{ +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[thread_input], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[thread_input], NX_ANY_PORT, 0); + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + status = nx_tcp_client_socket_connect(&tcp_sockets[thread_input], IP_ADDRESS(1, 2, 3, 4), 12345, 1 * NX_IP_PERIODIC_RATE); + + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + +#if 0 + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); +#endif + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, send_buffer, strlen(send_buffer), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[thread_input], packet_ptr, NX_IP_PERIODIC_RATE); + + + if(status != NX_SUCCESS) + error_counter++; +#if 0 + status = NX_SUCCESS; + + status = nx_tcp_socket_receive(&tcp_sockets[thread_input], &packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(send_buffer)) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, send_buffer, packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); +#endif + status = nx_tcp_socket_disconnect(&tcp_sockets[thread_input], 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[thread_input].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[thread_input]); + + + status += nx_tcp_socket_delete(&tcp_sockets[thread_input]); + + if(status != NX_SUCCESS) + error_counter++; +} +static NX_TCP_SOCKET server_socket; +static void netx_tcp_server(void) +{ + +NX_PACKET *packet_ptr; +UINT status; +int i; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + for(i = 0; i < NUM_ITERATION; i++) + { + tx_semaphore_put(&sema_0); + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != strlen(send_buffer))) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + if (status && (status != NX_CONNECTION_PENDING)) + error_counter++; + } + + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + netx_tcp_server(); + +} + +static void ntest_2_entry(ULONG thread_input) +{ +int iterations = 0; + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + for(iterations = 0; iterations < (NUM_ITERATION / 4); iterations++) + nx_client4(thread_input); + + tx_semaphore_put(&sema_0); +} + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Disconnect Test.................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_fionread_test.c b/test/regression/bsd_test/netx_bsd_tcp_fionread_test.c new file mode 100644 index 00000000..52fd72cc --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_fionread_test.c @@ -0,0 +1,423 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS NX_BSD_MAX_SOCKETS +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +static char request[] = "Test_Request"; +static char response[] = "Test_Response"; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_fionread_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data; +static ULONG stack_space[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread; + +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30] = {0}; +int size; + + sockfd = client_data.sockfd; + message_id = client_data.message_id; + + /* Receive data from the client. */ + ret = recv(sockfd, buf, 4, 0); + if(ret != 4) + error_counter++; + + ret = ioctl(sockfd, FIONREAD, &size); + if(ret) + error_counter++; + + ret = recv(sockfd, buf + 4, sizeof(buf) - 4, 0); + if(ret != size) + error_counter++; + + /* Validate the data. */ + if((ret + 4) != (int)strlen(request) || strncmp(buf, request, (ret + 4))) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response, strlen(response), 0); + if(ret != (int)strlen(response)) + error_counter++; + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret) + error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +UINT status; +int accept_no_memory = 0; + + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret) + error_counter++; + + ret = listen(sockfd, 5); + if(ret) + error_counter++; + + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + { + error_counter++; + } + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Set the client data */ + client_data.sockfd = newsock; + client_data.message_id = 0; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread, "helper thread", bsd_server_helper_thread_entry, + 0, stack_space, DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + tx_thread_relinquish(); + + /* Close down the socket. */ + ret = soc_close(sockfd); + if(ret) + error_counter++; + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: Basic BSD TCP FIONREAD Test..................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wakeup client. */ + tx_semaphore_put(&sema_1); + + test_tcp_server4(); + + /* Wait until client finish. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_socket; +static void multiple_client4(void) +{ + +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + + status = nx_tcp_socket_create(&ip_1, &tcp_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_socket, NX_ANY_PORT, 0); + + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_client_socket_connect(&tcp_socket, IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + error_counter++; + + /* Send messages to each server */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, request, strlen(request), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_socket, packet_ptr, NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + error_counter++; + + /* Receive messages. */ + status = nx_tcp_socket_receive(&tcp_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response)) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response, packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + + /* Shutdown the socket. */ + status = nx_tcp_socket_disconnect(&tcp_socket, 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_socket.nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_socket); + + + status += nx_tcp_socket_delete(&tcp_socket); + + if(status != NX_SUCCESS) + error_counter++; +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + multiple_client4(); + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_fionread_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP FIONREAD Test...................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_getsockname_test.c b/test/regression/bsd_test/netx_bsd_tcp_getsockname_test.c new file mode 100644 index 00000000..559c3d3f --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_getsockname_test.c @@ -0,0 +1,454 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 1 +/* Define the counters used in the test application... */ +static void *server1_stack_area; +static void *server2_stack_area; +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_getsockname_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + server1_stack_area = pointer; + server2_stack_area = pointer + DEMO_STACK_SIZE; + pointer = (void*)((ULONG)server2_stack_area + DEMO_STACK_SIZE); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[4]; +static ULONG stack_space[4][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[4]; + +static TX_THREAD tcp_server1, tcp_server2; +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + ret = recv(sockfd, buf, sizeof(buf), 0); + if(ret <= 0) + error_counter++; + + buf[ret] = 0; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || (strncmp(buf, requests[message_id & 3], ret))) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + tx_thread_sleep(1); + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + return; +} + +static NX_TCP_SOCKET client_socket; + +static void start_tcp_client4(int port) +{ +UINT status; +NX_PACKET *packet_ptr; + + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", NX_IP_NORMAL, + NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, 0); + if(status != NX_SUCCESS) + error_counter++; + + + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1,2,3,4), port, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if(status) + error_counter++; + + if(port == 12345) + status = nx_packet_data_append(packet_ptr, requests[0], strlen(requests[0]), &pool_0, NX_NO_WAIT); + else + status = nx_packet_data_append(packet_ptr, requests[1], strlen(requests[1]), &pool_0, NX_NO_WAIT); + + if(status) + error_counter++; + + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + status = nx_tcp_socket_receive(&client_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + else if(port == 12345) + { + if((packet_ptr -> nx_packet_length != strlen(response[0])) || + (strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], packet_ptr -> nx_packet_length))) + error_counter++; + nx_packet_release(packet_ptr); + } + else + { + if((packet_ptr -> nx_packet_length != strlen(response[1])) || + (strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[1], packet_ptr -> nx_packet_length))) + error_counter++; + nx_packet_release(packet_ptr); + } + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + if(client_socket.nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&client_socket); + + status += nx_tcp_socket_delete(&client_socket); + if(status) + error_counter++; +} +static void tcp_server_entry(ULONG); +static void start_tcp_server4(void) +{ +UINT status; + status = tx_thread_create(&tcp_server1, "tcp server1", tcp_server_entry, 12345, + server1_stack_area, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, + TX_AUTO_START); +#if 1 + status += tx_thread_create(&tcp_server2, "tcp server2", tcp_server_entry, 12346, + server2_stack_area, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, + TX_AUTO_START); +#endif + if(status) + error_counter++; + +} + +static void tcp_server_entry(ULONG param) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i, j; +UINT status; +int port = (int)param; + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(port); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + for(j = 0; j < 2; j++) + { + address_length = sizeof(remote_addr); + + if(port == 12345) + i = 0; + else + i = 1; + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Set the client data */ + client_data[j * 2 + i].sockfd = newsock; + client_data[j * 2 + i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[j*2 + i], "helper thread", bsd_server_helper_thread_entry, + j * 2 + i, stack_space[j*2 + i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + if(status != TX_SUCCESS) + error_counter++; + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + + + printf("NetX Test: BSD TCP getsockname Test......................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + start_tcp_server4(); + + tx_thread_sleep(2); + + start_tcp_client4(12345); + + start_tcp_client4(12346); + + start_tcp_client4(12345); + + start_tcp_client4(12346); + + tx_thread_sleep(10); + + validate_bsd_structure(); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_getsockname_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: BSD TCP getsockname Test......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c b/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c new file mode 100644 index 00000000..62752fbb --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c @@ -0,0 +1,335 @@ +/* This NetX test verifies the issue report by JIRA: https://expresslogic.atlassian.net/projects/NETXDUO/issues/NETXDUO-223. */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; +static ULONG client_ip; +static ULONG client_port; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +static void validate_bsd_structure(void); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_getsockname_without_bind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ +int ret; +int sockfd; +int address_length; +struct sockaddr_in remote_addr; +struct sockaddr_in local_addr; + + printf("NetX Test: Basic BSD TCP getsockname Without Bind Test..."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Connect to port not listening. */ + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(sockfd, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin_family != AF_INET) + error_counter++; + else if(local_addr.sin_port == 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + /* Connect to port that is listening. */ + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(sockfd, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin_family != AF_INET) + error_counter++; + else if(local_addr.sin_port != htons(client_port)) + error_counter++; + else if(local_addr.sin_addr.s_addr != htonl(client_ip)) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_socket_peer_info_get(&server_socket, &client_ip, &client_port); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_getsockname_without_bind_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP getsockname Without Bind Test...N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_multiple_accept_test.c b/test/regression/bsd_test/netx_bsd_tcp_multiple_accept_test.c new file mode 100644 index 00000000..18a5a5fe --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_multiple_accept_test.c @@ -0,0 +1,552 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + +#define notify(v) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 1 +/* Define the counters used in the test application... */ +static void *server1_stack_area; +static void *server2_stack_area; +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; +static TX_SEMAPHORE session_start[4], session_end[4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_multiple_accept_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + { + notify(status); + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + { + notify(status); + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + { + notify(status); + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + { + notify(status); + error_counter++; + } + + server1_stack_area = pointer; + server2_stack_area = pointer + DEMO_STACK_SIZE; + pointer = (void*)((ULONG)server2_stack_area + DEMO_STACK_SIZE); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + status = tx_semaphore_create(&session_start[0], "0", 0); + status += tx_semaphore_create(&session_start[1], "1", 0); + status += tx_semaphore_create(&session_start[2], "2", 0); + status += tx_semaphore_create(&session_start[3], "3", 0); + status = tx_semaphore_create(&session_end[0], "4", 0); + status += tx_semaphore_create(&session_end[1], "5", 0); + status += tx_semaphore_create(&session_end[2], "6", 0); + status += tx_semaphore_create(&session_end[3], "7", 0); + if(status != TX_SUCCESS) + error_counter++; + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + { + notify(status); + error_counter++; + } +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; + int port_number; +} client_info; + +static client_info client_data[4] = { + {0, 0, 12345}, + {0, 0, 12345}, + {0, 0, 12346}, + {0, 0, 12346}, +}; +static ULONG stack_space[4][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[4]; + +static TX_THREAD tcp_server1, tcp_server2; +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + ret = recv(sockfd, buf, sizeof(buf), 0); + if (ret <= 0) + { + error_counter++; + } + + buf[ret] = 0; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || (strncmp(buf, requests[message_id & 3], ret))) + { + error_counter++; + } + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + { + error_counter++; + } + + tx_semaphore_get(&session_end[thread_input], NX_WAIT_FOREVER); + ret = soc_close(sockfd); + if(ret < 0) + { + error_counter++; + } + + return; +} + +static NX_TCP_SOCKET client_socket; + +static void start_tcp_client4(int index) +{ +UINT status; +NX_PACKET *packet_ptr; + + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", NX_IP_NORMAL, + NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, 0); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1,2,3,4), client_data[index].port_number, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + notify(status); + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if(status) + { + notify(status); + error_counter++; + } + + if(client_data[index].port_number == 12345) + status = nx_packet_data_append(packet_ptr, requests[0], strlen(requests[0]), &pool_0, NX_NO_WAIT); + else + status = nx_packet_data_append(packet_ptr, requests[1], strlen(requests[1]), &pool_0, NX_NO_WAIT); + + if(status) + { + notify(status); + error_counter++; + } + + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + + if(status) + { + notify(status); + error_counter++; + } + + status = nx_tcp_socket_receive(&client_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + { + notify(status); + error_counter++; + } + else if(client_data[index].port_number == 12345) + { + if((packet_ptr -> nx_packet_length != strlen(response[0])) || + (strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], packet_ptr -> nx_packet_length))) + error_counter++; + nx_packet_release(packet_ptr); + } + else + { + if((packet_ptr -> nx_packet_length != strlen(response[1])) || + (strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[1], packet_ptr -> nx_packet_length))) + { + notify(status); + error_counter++; + } + + nx_packet_release(packet_ptr); + } + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + if(client_socket.nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&client_socket); + + tx_semaphore_put(&session_end[index]); + + status += nx_tcp_socket_delete(&client_socket); + if(status) + { + notify(status); + error_counter++; + } +} + +static void tcp_server_entry(ULONG); +static void start_tcp_server4(void) +{ +UINT status; + status = tx_thread_create(&tcp_server1, "tcp server1", tcp_server_entry, 12345, + server1_stack_area, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, + TX_AUTO_START); +#if 1 + status += tx_thread_create(&tcp_server2, "tcp server2", tcp_server_entry, 12346, + server2_stack_area, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, + TX_AUTO_START); +#endif + if(status) + { + notify(status); + error_counter++; + } + +} + +static void tcp_server_entry(ULONG param) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i, j, index; +UINT status; +int port = (int)param; + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + { + notify(status); + error_counter++; + } + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(port); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + { + notify(status); + error_counter++; + } + + ret = listen(sockfd, 5); + if(ret < 0) + { + notify(status); + error_counter++; + } + + for(j = 0; j < 2; j++) + { + address_length = sizeof(remote_addr); + + if(port == 12345) + i = 0; + else + i = 1; + + index = 2 * i + j; + tx_semaphore_put(&session_start[index]); + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + { + notify(status); + error_counter++; + } + + if(address_length != sizeof(remote_addr)) + { + notify(status); + error_counter++; + } + + if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + { + notify(status); + error_counter++; + } + + /* Set the client data */ + client_data[index].sockfd = newsock; + client_data[index].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[index], "helper thread", bsd_server_helper_thread_entry, + index, stack_space[index], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + if(status != TX_SUCCESS) + { + notify(status); + error_counter++; + } + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + { + notify(status); + error_counter++; + } + +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + + + printf("NetX Test: Basic BSD TCP Multiple Accept Test............"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + { + notify(status); + error_counter++; + } +#endif + + start_tcp_server4(); + + tx_semaphore_get(&session_start[0], NX_WAIT_FOREVER); + start_tcp_client4(0); + + tx_semaphore_get(&session_start[1], NX_WAIT_FOREVER); + start_tcp_client4(1); + + tx_semaphore_get(&session_start[2], NX_WAIT_FOREVER); + start_tcp_client4(2); + + tx_semaphore_get(&session_start[3], NX_WAIT_FOREVER); + start_tcp_client4(3); + + validate_bsd_structure(); + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_multiple_accept_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Multiple Accept Test............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c b/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c new file mode 100644 index 00000000..773569f9 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c @@ -0,0 +1,1117 @@ +/* This NetX test concentrates on the basic BSD TCP window size when window scaling is used. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-284 */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_TCP_WINDOW_SCALING) && defined(__PRODUCT_NETXDUO__) +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *send_buffer = "Hello World"; +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +#ifdef __PRODUCT_NETXDUO__ +static char large_msg[1000]; +#endif +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_rcvbuf_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} +typedef struct client_info_struct +{ + int sockfd; + int message_id; +} client_info; + +static client_info client_data[NUM_CLIENTS]; +static ULONG stack_space[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread[NUM_CLIENTS]; +#ifdef FEATURE_NX_IPV6 +static ULONG stack_space6[NUM_CLIENTS][DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_THREAD helper_thread6[NUM_CLIENTS]; +#endif +static VOID bsd_server_helper_thread_entry(ULONG thread_input) +{ +int ret; +int sockfd, message_id; +char buf[30]; +int sockaddr_len; +fd_set read_fds, write_fds, except_fds; +struct timeval wait_time; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 remote_address; +#else +struct sockaddr_in remote_address; +#endif + + sockfd = client_data[thread_input].sockfd; + message_id = client_data[thread_input].message_id; + /* Receive data from the client. */ + if(message_id == 2) + { +#ifdef FEATURE_NX_IPV6 + sockaddr_len = sizeof(struct sockaddr_in6); +#else + sockaddr_len = sizeof(struct sockaddr_in); +#endif + ret = recvfrom(sockfd, (char*)buf, sizeof(buf), 0, (struct sockaddr*)&remote_address, &sockaddr_len); + + if(ret < 0) + error_counter++; + if(nx_bsd_socket_array[sockfd - 0x20].nx_bsd_socket_family == AF_INET) + { + if(sockaddr_len != sizeof(struct sockaddr_in)) + error_counter++; + if(((struct sockaddr_in*)&remote_address) -> sin_family != AF_INET) + error_counter++; + if(((struct sockaddr_in*)&remote_address) -> sin_addr.s_addr != htonl(0x01020305)) + error_counter++; + } +#ifdef FEATURE_NX_IPV6 + else if(nx_bsd_socket_array[sockfd - 0x20].nx_bsd_socket_family == AF_INET6) + { + if(sockaddr_len != sizeof(struct sockaddr_in6)) + error_counter++; + if((remote_address.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_address.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_address.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_address.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + } +#endif + } + else + { + + /* Peek message test. */ + ret = recv(sockfd, buf, sizeof(buf), MSG_PEEK); + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + ret = recv(sockfd, buf, sizeof(buf), 0); + } + if(ret <= 0) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[message_id & 3])) || strncmp(buf, requests[message_id & 3], ret)) + error_counter++; + + /* Invoke recvfrom with MSG_DONTWAIT flag. */ + ret = recvfrom(sockfd, (char*)buf, sizeof(buf), MSG_DONTWAIT, (struct sockaddr*)&remote_address, &sockaddr_len); + if(ret >= 0) + error_counter++; + else if((errno != EWOULDBLOCK) || (errno != EAGAIN)) + error_counter++; + + /* Invoke recv with MSG_DONTWAIT flag. */ + ret = recv(sockfd, (char*)buf, sizeof(buf), MSG_DONTWAIT); + if(ret >= 0) + error_counter++; + else if((errno != EWOULDBLOCK) || (errno != EAGAIN)) + error_counter++; + + /* Send a response back. */ + ret = send(sockfd, response[message_id & 3], strlen(response[message_id & 3]), 0); + if(ret != (int)strlen(response[message_id & 3])) + error_counter++; + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + /* Invoke send with MSG_DONTWAIT flag. The message is larger than tx_window. Partial data should be sent. */ + ret = send(sockfd, large_msg, sizeof(large_msg), MSG_DONTWAIT); + if (ret <= 0) + error_counter++; +#endif + + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + FD_ZERO(&except_fds); + FD_SET(sockfd, &read_fds); + FD_SET(sockfd, &write_fds); + FD_SET(sockfd, &except_fds); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + wait_time.tv_sec = 1; + wait_time.tv_usec = 0; + select(sockfd + 1, &read_fds, &write_fds, &except_fds, &wait_time); + if((FD_ISSET(sockfd, &read_fds) && FD_ISSET(sockfd, &write_fds) && FD_ISSET(sockfd, &except_fds)) == 0) + error_counter++; + + tx_semaphore_put(&sema_0); + return; +} + + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 local_addr6; +int port; +int sockfd1; +#endif +int bytes_sent; +int ret; +char buf; +struct sock_winsize option; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = INADDR_ANY; + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + option.winsize = 0x10000; + if(setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &option, sizeof(option)) < 0) + error_counter++; + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Get the port bind to any. */ + port = nx_bsd_socket_array[sockfd - NX_BSD_SOCKFD_START].nx_bsd_socket_tcp_socket -> nx_tcp_socket_port; + + sockfd1 = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd1 < 0) + error_counter++; + + memset(&local_addr6, 0, sizeof(local_addr6)); + local_addr6.sin6_family = AF_INET6; + local_addr6.sin6_port = htons(port); + + /* Bind to the same port. */ + ret = bind(sockfd1, (struct sockaddr*)&local_addr6, sizeof(local_addr6)); + if(ret < 0) + error_counter++; + + ret = soc_close(sockfd1); + if(ret < 0) + error_counter++; +#endif + + /* Call recv before peer orderly shutdown. */ + ret = recv(sockfd, &buf, 1, 0); + if (ret != 0) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + /* Call recv after peer orderly shutdown. */ + ret = recv(sockfd, &buf, 1, 0); + if (ret != 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +struct sock_winsize option; + + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + option.winsize = 0x10000; + if(setsockopt(newsock, SOL_SOCKET, SO_RCVBUF, &option, sizeof(option)) < 0) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin_family != AF_INET) + error_counter++; + else if(local_addr.sin_port != htons(12345)) + error_counter++; + else if(local_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1, 2, 3, 4))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin_family != AF_INET) + error_counter++; + else if(remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) + error_counter++; + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status != TX_SUCCESS) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + + +#ifdef FEATURE_NX_IPV6 +static void test_tcp_client6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr; +int bytes_sent; +int ret; +struct sock_winsize option; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(12); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1.nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1.nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1.nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1.nxd_ip_address.v6[3]); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + option.winsize = 0x10000; + if(setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &option, sizeof(option)) < 0) + error_counter++; + + bytes_sent = send(sockfd, send_buffer, strlen(send_buffer), 0); + + if(bytes_sent != (INT)strlen(send_buffer)) + error_counter++; + + /* Make sure the other side gets the message. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_tcp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int address_length; +int ret; +int newsock; +int i; +UINT status; +struct sock_winsize option; + + sockfd = socket(AF_INET6, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12346); + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* 3 iterations. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + address_length = sizeof(remote_addr); + + newsock = accept(sockfd, (struct sockaddr*)&remote_addr, &address_length); + + if(newsock <= 0) + error_counter++; + + if(address_length != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + option.winsize = 0x10000; + if(setsockopt(newsock, SOL_SOCKET, SO_RCVBUF, &option, sizeof(option)) < 0) + error_counter++; + + address_length = sizeof(local_addr); + ret = getsockname(newsock, (struct sockaddr*)&local_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(local_addr)) + error_counter++; + else if(local_addr.sin6_family != AF_INET6) + error_counter++; + else if(local_addr.sin6_port != htons(12346)) + error_counter++; + else if((local_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip0.nxd_ip_address.v6[0])) || + (local_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip0.nxd_ip_address.v6[1])) || + (local_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip0.nxd_ip_address.v6[2])) || + (local_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip0.nxd_ip_address.v6[3]))) + error_counter++; + + address_length = sizeof(remote_addr); + ret = getpeername(newsock, (struct sockaddr*)&remote_addr, &address_length); + if(ret < 0) + error_counter++; + else if(address_length != sizeof(remote_addr)) + error_counter++; + else if(remote_addr.sin6_family != AF_INET6) + error_counter++; + else if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + + /* Set the client data */ + client_data[i].sockfd = newsock; + client_data[i].message_id = i; + + /* Create a helper thread to handle the new socket. */ + status = tx_thread_create(&helper_thread6[i], "helper thread", bsd_server_helper_thread_entry, + i, stack_space6[i], DEMO_STACK_SIZE, 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status) + error_counter++; + + tx_thread_relinquish(); + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + } +} + +#endif + +static void close_before_accept_test() +{ +int server_fd, client_fd; +int ret; +struct sockaddr_in remote_addr, local_addr; + + /* Setup server socket. */ + server_fd = socket(AF_INET, SOCK_STREAM, 0); + if(server_fd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(server_fd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(server_fd, 5); + if(ret < 0) + error_counter++; + + /* Setup client socket. */ + client_fd = socket(AF_INET, SOCK_STREAM, 0); + if(client_fd < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12345); + remote_addr.sin_addr.s_addr = htonl(0x01020304); + + if(connect(client_fd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + /* Close before calling accept. */ + soc_close(server_fd); + soc_close(client_fd); +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in remote_addr; +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif +int ret; + + + printf("NetX Test: Basic BSD TCP RCVBUF Test....................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = (CHAR)(ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (CHAR)(ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + close_before_accept_test(); + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client4(); + + tx_semaphore_put(&sema_1); + test_tcp_server4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client6(); + + tx_semaphore_put(&sema_1); + test_tcp_server6(); +#endif + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + /* Now open another socket and attempt to connect to the correct remote + host but an unexpected port so we expect an unsuccessful connections. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + if(errno != ECONNREFUSED) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Now open another socket and attempt to connect to the an incorrect + remote host so we expect an unsuccessful connections. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020306); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) >= 0) + error_counter++; + + if(errno != ETIMEDOUT) + error_counter++; + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* After the previous failed connection, make sure we can still open a socket. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static NX_TCP_SOCKET tcp_sockets[NUM_CLIENTS]; +static void multiple_client4(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_client_socket_connect(&tcp_sockets[i], IP_ADDRESS(1, 2, 3, 4), 12345, NX_IP_PERIODIC_RATE); + + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + status = nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + if(status == NX_NOT_CONNECTED || status == NX_DISCONNECT_FAILED) + status = 0; + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status += nx_tcp_client_socket_unbind(&tcp_sockets[i]); + + + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } + + +} + + +#ifdef FEATURE_NX_IPV6 +static void multiple_client6(void) +{ + +int i; +UINT status = NX_SUCCESS; +NX_PACKET *packet_ptr; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_tcp_socket_create(&ip_1, &tcp_sockets[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_sockets[i], NX_ANY_PORT, 0); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nxd_tcp_client_socket_connect(&tcp_sockets[i], &ipv6_address_ip0, 12346, NX_IP_PERIODIC_RATE); + } + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + + /* Send messages to each server */ + for(i = 0; i < NUM_CLIENTS; i++) + { + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, requests[i & 3], strlen(requests[i & 3]), + &pool_0, NX_NO_WAIT); + status += nx_tcp_socket_send(&tcp_sockets[i], packet_ptr, NX_IP_PERIODIC_RATE); + + } + + if(status != NX_SUCCESS) + error_counter++; + + status = NX_SUCCESS; + /* Receive 3 messages. */ + + for(i = 0; i < NUM_CLIENTS; i++) + { + status = nx_tcp_socket_receive(&tcp_sockets[i], &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + continue; + } + + /* Validate the received data. */ + else if(packet_ptr -> nx_packet_length != strlen(response[i & 3])) + error_counter++; + else if(strncmp((char *)packet_ptr -> nx_packet_prepend_ptr, response[i & 3], packet_ptr -> nx_packet_length)) + error_counter++; + nx_packet_release(packet_ptr); + } + + for(i = 0; i < NUM_CLIENTS; i++) + { + + /* Wakeup server thread. */ + tx_semaphore_put(&sema_1); + } + + /* Shutdown the socket. */ + for(i = 0; i < NUM_CLIENTS; i++) + { + + nx_tcp_socket_disconnect(&tcp_sockets[i], 1 * NX_IP_PERIODIC_RATE); + + if(tcp_sockets[i].nx_tcp_socket_bound_next) + status = nx_tcp_client_socket_unbind(&tcp_sockets[i]); + status += nx_tcp_socket_delete(&tcp_sockets[i]); + + if(status != NX_SUCCESS) + error_counter++; + } + +} +#endif + +static void netx_tcp_server(void) +{ +NX_PACKET *packet_ptr; +UINT status; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != strlen(send_buffer))) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&sema_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + + /* Server run first. */ + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + + /* Simulate a multiple client conneting to the same server. */ + multiple_client4(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_put(&sema_0); + netx_tcp_server(); + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + multiple_client6(); +#endif + + /* Client finished. */ + tx_semaphore_put(&sema_0); +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_rcvbuf_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP RCVBUF Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_sendto_recvfrom_test.c b/test/regression/bsd_test/netx_bsd_tcp_sendto_recvfrom_test.c new file mode 100644 index 00000000..2d65b0c1 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_sendto_recvfrom_test.c @@ -0,0 +1,482 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE sema_0; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *send_buffer = "Hello World"; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_sendto_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + if(status) + error_counter++; +} + +static void test_tcp_client4(void) +{ +int sockfd; +struct sockaddr_in remote_addr; +int bytes_sent; +int ret; +char recv_buffer[30]; +int addr_len; + + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020305); + + if(connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)) < 0) + error_counter++; + + /* 1st packet */ + bytes_sent = sendto(sockfd, send_buffer, strlen(send_buffer), 0, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + addr_len = sizeof(remote_addr); + ret = recvfrom(sockfd, recv_buffer, sizeof(recv_buffer), 0, (struct sockaddr*)&remote_addr, &addr_len); + if((addr_len != sizeof(remote_addr)) || + (remote_addr.sin_family != AF_INET) || + (remote_addr.sin_port != htons(12)) || + (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + /* Do a send to with a truncated remote_addr. */ + bytes_sent = sendto(sockfd, send_buffer, strlen(send_buffer), 0, (struct sockaddr*)&remote_addr, sizeof(remote_addr) / 2); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + addr_len = sizeof(remote_addr); + ret = recvfrom(sockfd, recv_buffer, sizeof(recv_buffer), 0, (struct sockaddr*)&remote_addr, &addr_len); + if((addr_len != sizeof(remote_addr)) || + (remote_addr.sin_family != AF_INET) || + (remote_addr.sin_port != htons(12)) || + (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Do a send to with NULL remote_addr. */ + bytes_sent = sendto(sockfd, send_buffer, strlen(send_buffer), 0, (struct sockaddr*)NULL, sizeof(remote_addr) / 2); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + addr_len = sizeof(remote_addr); + ret = recvfrom(sockfd, recv_buffer, sizeof(recv_buffer), 0, (struct sockaddr*)&remote_addr, &addr_len); + if((addr_len != sizeof(remote_addr)) || + (remote_addr.sin_family != AF_INET) || + (remote_addr.sin_port != htons(12)) || + (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Do a send to with incorrect remote_addr. */ + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12); + remote_addr.sin_addr.s_addr = htonl(0x01020306); + bytes_sent = sendto(sockfd, send_buffer, strlen(send_buffer), 0, (struct sockaddr*)NULL, sizeof(remote_addr) ); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + addr_len = sizeof(remote_addr); + ret = recvfrom(sockfd, recv_buffer, sizeof(recv_buffer), 0, (struct sockaddr*)&remote_addr, &addr_len); + if((addr_len != sizeof(remote_addr)) || + (remote_addr.sin_family != AF_INET) || + (remote_addr.sin_port != htons(12)) || + (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + + /* Do a send to with incorrect remote port number. */ + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(13); + remote_addr.sin_addr.s_addr = htonl(0x01020306); + bytes_sent = sendto(sockfd, send_buffer, strlen(send_buffer), 0, (struct sockaddr*)NULL, sizeof(remote_addr) / 2); + + if(bytes_sent != (int)strlen(send_buffer)) + error_counter++; + + addr_len = sizeof(remote_addr); + ret = recvfrom(sockfd, recv_buffer, sizeof(recv_buffer), 0, (struct sockaddr*)&remote_addr, &addr_len); + if((addr_len != sizeof(remote_addr)) || + (remote_addr.sin_family != AF_INET) || + (remote_addr.sin_port != htons(12)) || + (remote_addr.sin_addr.s_addr != htonl(0x01020305))) + error_counter++; + + /* All done */ + + + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + printf("NetX Test: Basic BSD TCP Sendto Recvfrom Test............"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + test_tcp_client4(); + +#ifdef FEATURE_NX_IPV6 + +#if 0 + test_tcp_client6(); +#endif + +#endif + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void netx_tcp_server(void) +{ +NX_PACKET *packet_ptr; +UINT status; +int i; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + for(i = 0; i < 5; i++) + { + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != strlen(send_buffer))) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buffer, strlen(send_buffer))) + error_counter++; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + nx_tcp_socket_delete(&server_socket); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + tx_semaphore_put(&sema_0); + + netx_tcp_server(); + +#ifdef FEATURE_NX_IPV6 +#if 0 + netx_tcp_server(); +#endif +#endif + + /* Client finished. */ + tx_semaphore_put(&sema_0); + +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_sendto_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Sendto Recvfrom Test............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c b/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c new file mode 100644 index 00000000..290a1932 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c @@ -0,0 +1,927 @@ +/* This demoonstrates sharing a port between an IPv4 and IPv6 TCP server socket to send + and receive packets (e.g emulates a socket that can send/receive iPv4 and Ipv6 packets) + using a simulated Ethernet driver. */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_client6; +static TX_THREAD thread_server; +static TX_THREAD thread_server6; +static NX_PACKET_POOL bsd_pool; +static NX_IP bsd_ip_server; +static NX_IP bsd_ip_client; +static NX_TCP_SOCKET client_ipv6_socket; + +static UINT error_counter = 0; + +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define SERVER_PORT 87 + +/* Define some global data. */ +static UINT ipv4_complete = NX_FALSE; + +/* Define thread prototypes. */ + + +static VOID thread_client_entry(ULONG thread_input); +static VOID thread_client6_entry(ULONG thread_input); +static VOID thread_server_entry(ULONG thread_input); +static VOID thread_server6_entry(ULONG thread_input); +VOID _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_servers_share_port_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a BSD packet pool. */ + status = nx_packet_pool_create(&bsd_pool, "NetX BSD Packet Pool", 1516, pointer, 16384); + + pointer = pointer + 16384; + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /********************** Set up the Server IP instance **************************/ + + /* Create a thread for the IPv4 server. */ + status= tx_thread_create(&thread_server, "BSD App IPv4 Server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* jlc TX_AUTO_START */ + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + + /* Create a thread for IPv6 server. */ + status= tx_thread_create(&thread_server6, "BSD App IPv6 Server", thread_server6_entry, 0, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create an IP instance for the BSD Server sockets. */ + status = nx_ip_create(&bsd_ip_server, "NetX BSD Server", SERVER_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_ip_server); + + /* Enable ARP and supply ARP cache memory for BSD */ + status += nx_arp_enable(&bsd_ip_server, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + /* Now initialize BSD IP. */ + status = bsd_initialize (&bsd_ip_server, &bsd_pool, pointer, 2048, 4); + + /* Check for BSD errors. */ + if (status) + { + error_counter++; + } + + pointer = pointer + 2048; + + /********************** Set up the Client **************************/ + + status = nx_ip_create(&bsd_ip_client, "NetX BSD Client", CLIENT_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + + /* Create a thread for IPv4 client. */ + status= tx_thread_create(&thread_client, "BSD App IPpv4 Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START);/* jlc TX_AUTO_START */ + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create a thread for IPv6 client. */ + status= tx_thread_create(&thread_client6, "BSD App IPv6 Client", thread_client6_entry, 0, + pointer, DEMO_STACK_SIZE, + 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_ip_client); + + /* Enable ARP and supply ARP cache memory for BSD */ + status += nx_arp_enable(&bsd_ip_client, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + return; +} + +/* Define the IPv4 server thread */ +void thread_server_entry(ULONG thread_input) +{ + +INT status, sock, sock_tcp_server; +ULONG actual_status; +INT Clientlen; +INT i; +UINT is_set = NX_FALSE; +struct sockaddr_in serverAddr; +struct sockaddr_in ClientAddr; +UINT ipv4_server_complete = NX_FALSE; +INT maxfd; +fd_set master_list, read_ready; +CHAR Server_Rcv_Buffer[100]; + + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); /* Don't let the IPv4 connection finish before IPv6 connection is created. */ + + status = nx_ip_status_check(&bsd_ip_server, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create BSD TCP Socket */ + sock_tcp_server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_server == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the server port and IP address */ + + memset(&serverAddr, 0, sizeof(serverAddr)); + serverAddr.sin_family = AF_INET; + serverAddr.sin_addr.s_addr = htonl(IP_ADDRESS(1,2,3,4)); + serverAddr.sin_port = htons(SERVER_PORT); + + /* Bind this server socket */ + status = bind (sock_tcp_server, (struct sockaddr *) &serverAddr, sizeof(serverAddr)); + + if (status < 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + FD_ZERO(&master_list); + FD_ZERO(&read_ready); + FD_SET(sock_tcp_server,&master_list); + maxfd = sock_tcp_server; + + /* Now listen for any client connections for this server socket */ + status = listen (sock_tcp_server, 5); + if (status < 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* All set to accept client connections */ + /* Loop to create and establish server connections. */ + do + { + + read_ready = master_list; + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 5); /* Allow some time to other threads too */ + + /* Let the underlying TCP stack determine the timeout. */ + status = select(maxfd + 1, &read_ready, 0, 0, 0); + + if ( (status == ERROR) || (status == 0) ) + { + continue; + } + + /* Detected a connection request. */ + is_set = FD_ISSET(sock_tcp_server,&read_ready); + + if(is_set) + { + + Clientlen = sizeof(ClientAddr); + + sock = accept(sock_tcp_server,(struct sockaddr*)&ClientAddr, &Clientlen); + + /* Add this new connection to our master list */ + FD_SET(sock, &master_list); + + if ( sock > maxfd) + { + maxfd = sock; + } + + continue; + } + + /* Check the set of 'ready' sockets, e.g connected to remote host and waiting for + notice of packets received. */ + for (i = 0; i < (maxfd+1); i++) + { + + if (((i+ NX_BSD_SOCKFD_START) != sock_tcp_server) && + (FD_ISSET(i + NX_BSD_SOCKFD_START, &master_list)) && + (FD_ISSET(i + NX_BSD_SOCKFD_START, &read_ready))) + { + + while(1) + { + + status = recv(i + NX_BSD_SOCKFD_START, (VOID *)Server_Rcv_Buffer, 100, 0); + + if (status == ERROR) + { + /* This is a blocking socket. If no data is received, but the connection is still good, + the EAGAIN error is set. If it was a non blocking socket, the EWOULDBLOCK socket + error is set. */ + if (errno == EAGAIN) + { + continue; + } + else if (errno == ENOTCONN) + { + /* If the socket connection is terminated, the socket error will be ENOTCONN. */ + break; + } + else + { + /* Another error has occurred...probably an internal error of some kind + so best to terminate the connection. */ + error_counter++; + break; + } + } + else if (status == 0) + { + + /* If the socket connection is terminated, the socket error will be ENOTCONN. */ + break; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + status = send(i + NX_BSD_SOCKFD_START, "Hello from IPv4\n", strlen("Hello from IPv4\n")+1, 0); + + if (status == ERROR) + { + if (errno == ENOTCONN) + { + + /* If the socket connection is terminated, the socket error will be ENOTCONN. */ + break; + } + else + { + + error_counter++; + break; + } + } + } + + /* Close this socket */ + status = soc_close(i+ NX_BSD_SOCKFD_START); + + if (status == ERROR) + { + + error_counter++; + } + + /* Indicate the IPv4 server socket is closed. */ + ipv4_server_complete = NX_TRUE; + break; + } + } + + /* Loop back to check any next client connection */ + } while(!ipv4_server_complete); + + /* Indicate the IPv4 connection is done. */ + ipv4_complete = NX_TRUE; + + /* Close down our server sockets. */ + status = soc_close(sock_tcp_server); + + if (status == ERROR) + { + + error_counter++; + } + +} + +/* Define the IPv6 server thread */ + +void thread_server6_entry(ULONG thread_input) +{ +INT status, sock6, sock6_tcp_server; +ULONG actual_status; +INT Clientlen; +INT i; +UINT is_set = NX_FALSE; +NXD_ADDRESS ip_address; +struct sockaddr_in6 serverAddr; +struct sockaddr_in6 ClientAddr; +UINT address_index; +UINT ipv6_complete = NX_FALSE; +INT maxfd; +fd_set master_list, read_ready; +CHAR Server_Rcv_Buffer[100]; + + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("NetX Test: BSD TCP Server Socket Shared Port Test........"); + + status = nx_ip_status_check(&bsd_ip_server, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_ip_server); + if((status != NX_SUCCESS) && (status != NX_ALREADY_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_ip_server); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* This assumes we are using the primary network interface (index 0). */ + status = nxd_ipv6_address_set(&bsd_ip_server, 0, NX_NULL, 10, &address_index); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set ip interface address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010db8; + ip_address.nxd_ip_address.v6[1] = 0x0000f101; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 0x101; + + /* Set the host global IP address. We are assuming a 64 + bit prefix here but this can be any value (< 128). */ + status = nxd_ipv6_address_set(&bsd_ip_server, 0, &ip_address, 64, &address_index); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for IPv6 stack to finish DAD process. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create BSD TCP Socket */ + sock6_tcp_server = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); + + if (sock6_tcp_server == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the server port and IP address */ + memset(&serverAddr, 0, sizeof(serverAddr)); + serverAddr.sin6_addr._S6_un._S6_u32[0] = htonl(0x20010db8); + serverAddr.sin6_addr._S6_un._S6_u32[1] = htonl(0xf101); + serverAddr.sin6_addr._S6_un._S6_u32[2] = 0x0; + serverAddr.sin6_addr._S6_un._S6_u32[3] = htonl(0x0101); + serverAddr.sin6_port = htons(SERVER_PORT); + serverAddr.sin6_family = AF_INET6; + + /* Bind this server socket */ + status = bind (sock6_tcp_server, (struct sockaddr *) &serverAddr, sizeof(serverAddr)); + + if (status < 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + FD_ZERO(&master_list); + FD_ZERO(&read_ready); + FD_SET(sock6_tcp_server,&master_list); + maxfd = sock6_tcp_server; + + /* Now listen for any client connections for this server socket */ + status = listen (sock6_tcp_server, 5); + if (status < 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* All set to accept client connections */ + is_set = NX_FALSE; + + /* Loop to create and establish server connections. */ + do + { + + read_ready = master_list; + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 5); /* Allow some time to other threads too */ + + /* Let the underlying TCP stack determine the timeout. */ + status = select(maxfd + 1, &read_ready, 0, 0, 0); + + if ( (status == ERROR) || (status == 0) ) + { + + continue; + } + + /* Detected a connection request. */ + is_set = FD_ISSET(sock6_tcp_server,&read_ready); + + if(is_set) + { + + Clientlen = sizeof(ClientAddr); + + sock6 = accept(sock6_tcp_server,(struct sockaddr*)&ClientAddr, &Clientlen); + + /* Add this new connection to our master list */ + FD_SET(sock6, &master_list); + + if ( sock6 > maxfd) + { + maxfd = sock6; + } + + continue; + } + + /* Check the set of 'ready' sockets, e.g connected to remote host and waiting for + notice of packets received. */ + for (i = 0; i < (maxfd+1); i++) + { + + if (((i+ NX_BSD_SOCKFD_START) != sock6_tcp_server) && + (FD_ISSET(i + NX_BSD_SOCKFD_START, &master_list)) && + (FD_ISSET(i + NX_BSD_SOCKFD_START, &read_ready))) + { + + while(1) + { + + memset(&Server_Rcv_Buffer[0], 0, 100); + status = recv(i + NX_BSD_SOCKFD_START, (VOID *)Server_Rcv_Buffer, 100, 0); + + if ((status == ERROR) || (status == 0)) + { + /* This is a blocking socket. If no data is received, but the connection is still good, + the EAGAIN error is set. If it was a non blocking socket, the EWOULDBLOCK socket + error is set. */ + if (errno == EAGAIN) + { + continue; + } + else if (errno == ENOTCONN) + { + /* If the socket connection is terminated, the socket error will be ENOTCONN. */ + break; + } + else if (status == 0) + { + + break; + } + + else + { + /* Another error has occurred...probably an internal error of some kind + so best to terminate the connection. */ + error_counter++; + break; + } + } + + status = send(i + NX_BSD_SOCKFD_START, "Hello\n", strlen("Hello\n")+1, 0); + + if (status == ERROR) + { + if (errno == ENOTCONN) + { + + /* If the socket connection is terminated, the socket error will be ENOTCONN. */ + break; + } + else + { + + error_counter++; + break; + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + } + + /* Close this socket */ + + status = soc_close(i+ NX_BSD_SOCKFD_START); + ipv6_complete = NX_TRUE; + + if (status == ERROR) + { + + error_counter++; + } + break; + } + + } + + /* Loop back to check any next client connection */ + } while (!ipv6_complete); + + status = soc_close(sock6_tcp_server); + + if (status == ERROR) + { + + error_counter++; + } + + /* Close down our server socket. */ + while (!ipv4_complete) + { + tx_thread_sleep(20); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the IPv6 Client thread. */ + +void thread_client6_entry(ULONG thread_input) +{ + +INT status; +NXD_ADDRESS server_ip_address, ip_address; +NX_PACKET *packet_rcv_ptr, *packet_ptr; +UINT loopcount = 0; +char *requests[2] = {"Request1", "Request2"}; +UINT address_index; + + /* Allow Netx to initialize the driver, also let the server get set up first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_ip_client); + if((status != NX_SUCCESS) && (status != NX_ALREADY_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_ip_client); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set ip interface address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010db8; + ip_address.nxd_ip_address.v6[1] = 0x0000f101; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 0x1235; + + /* Set the host global IP address. We are assuming a 64 + bit prefix here but this can be any value (< 128). */ + status = nxd_ipv6_address_set(&bsd_ip_client, 0, &ip_address, 64, &address_index); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Time for duplicate address check. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set Server IPv6 interface address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + server_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + server_ip_address.nxd_ip_address.v6[2] = 0; + server_ip_address.nxd_ip_address.v6[3] = 0x101; + + status += nx_tcp_socket_create(&bsd_ip_client, &client_ipv6_socket, "Client IPv6 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_client_socket_bind(&client_ipv6_socket, NX_ANY_PORT, 100); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_tcp_client_socket_connect(&client_ipv6_socket, &server_ip_address, SERVER_PORT, 10 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + while(loopcount < 5) + { + + status = nx_packet_allocate(&bsd_pool, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status ) + { + error_counter++; + } + + status = nx_packet_data_append(packet_ptr, requests[1], strlen(requests[1]), + &bsd_pool, NX_NO_WAIT); + if (status ) + { + error_counter++; + } + + status = nx_tcp_socket_send(&client_ipv6_socket, packet_ptr, NX_IP_PERIODIC_RATE); + + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + status = nx_tcp_socket_receive(&client_ipv6_socket, &packet_rcv_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + + error_counter++; + } + else + { + nx_packet_release(packet_rcv_ptr); + } + + loopcount++; + tx_thread_sleep(NX_IP_PERIODIC_RATE / 2); + } + + nx_tcp_socket_disconnect(&client_ipv6_socket, 200); + nx_tcp_socket_delete(&client_ipv6_socket); + + /* All done */ + return; +} + + +/* Define the IPv4 Client thread. */ +void thread_client_entry(ULONG thread_input) +{ + +INT status; +UINT loopcount = 0; +ULONG actual_status; +INT sock_tcp_client; +struct sockaddr_in echoServAddr; +UINT ipv4_client_complete = NX_FALSE; +CHAR Client_Rcv_Buffer[100]; + + /* IPv4 waits for IPv6 DAD protocol */ + tx_thread_sleep(4 * NX_IP_PERIODIC_RATE); + + status = nx_ip_status_check(&bsd_ip_server, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + memset(&echoServAddr, 0, sizeof(echoServAddr)); + echoServAddr.sin_family = AF_INET; + echoServAddr.sin_addr.s_addr = htonl(IP_ADDRESS(1,2,3,4)); + echoServAddr.sin_port = htons(SERVER_PORT); + + /* Now make client connections with the server. */ + while (!ipv4_client_complete) + { + + /* Create BSD TCP Socket */ + sock_tcp_client = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_client == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now connect this client to the server */ + status = connect(sock_tcp_client, (struct sockaddr *)&echoServAddr, sizeof(echoServAddr)); + + /* Check for error. */ + if (status != OK) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now receive the echoed packet from the server */ + while(loopcount < 5) + { + + + status = send(sock_tcp_client, "Hello from Client4", (strlen("Hello from Client4")+1), 0); + + if (status == ERROR) + { + error_counter++; + } + + memset(&Client_Rcv_Buffer[0], 0, 100); + status = recv(sock_tcp_client, (VOID *)Client_Rcv_Buffer, 100, 0); + + if (status < 0) + { + if (errno == EAGAIN) + { + continue; + } + else if (errno == ENOTCONN) + { + + break; + } + else + { + /* Another error has occurred.... */ + error_counter++; + break; + } + } + + loopcount++; + + } + + ipv4_client_complete = NX_TRUE; + + /* close this client socket */ + status = soc_close(sock_tcp_client); + + if (status == ERROR) + { + error_counter++; + } + + } + + /* All done */ + return; +} +#else /* FEATURE_NX_IPV6 */ + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_servers_share_port_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: BSD TCP Server Socket Shared Port Test.....N/A\n"); + + test_control_return(3); + +} + +#endif /* FEATURE_NX_IPV6 */ + + diff --git a/test/regression/bsd_test/netx_bsd_tcp_servers_shared_port_test.c b/test/regression/bsd_test/netx_bsd_tcp_servers_shared_port_test.c new file mode 100644 index 00000000..53bd15fc --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_servers_shared_port_test.c @@ -0,0 +1,598 @@ +/* This demoonstrates sharing a port between an IPv4 and IPv6 TCP server socket to send + and receive packets (e.g emulates a socket that can send/receive iPv4 and Ipv6 packets) + using a simulated Ethernet driver. */ + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) && defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nxd_bsd.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_PACKET_POOL bsd_pool; +static NX_IP bsd_server_ip; +static NX_IP bsd_client_ip; +static NX_TCP_SOCKET client_socket1; +static NX_TCP_SOCKET client_socket2; + +static UINT error_counter = 0; + +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define SERVER_PORT 87 + + +static char *requests[2] = {"Request1", "Request2"}; +static char *responses[2] = {"Response1", "Response2"}; +static UINT spin = NX_TRUE; + +/* Define thread prototypes. */ + +INT HandleClient(INT clientsock); +static VOID thread_client_entry(ULONG thread_input); +static VOID thread_server_entry(ULONG thread_input); +VOID _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_servers_shared_port_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a BSD packet pool. */ + status = nx_packet_pool_create(&bsd_pool, "NetX BSD Packet Pool", 1516, pointer, 16384); + + pointer = pointer + 16384; + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /********************** Set up the Server IP instance **************************/ + + /* Create a thread for server. */ + status= tx_thread_create(&thread_server, "BSD App Server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create an IP instance for the BSD Server. */ + status = nx_ip_create(&bsd_server_ip, "NetX BSD Server", SERVER_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_server_ip); + + /* Enable ARP and supply ARP cache memory for BSD Server Instance */ + status += nx_arp_enable(&bsd_server_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + /* Now initialize BSD Server IP. */ + status = bsd_initialize (&bsd_server_ip, &bsd_pool, pointer, 2048, 4); + + /* Check for BSD errors. */ + if (status) + { + error_counter++; + } + + pointer = pointer + 2048; + + /********************** Set up the Client IP instance **************************/ + + /* Create a thread for client. */ + status= tx_thread_create(&thread_client, "BSD App Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status!= NX_SUCCESS) + { + error_counter++; + } + + /* Create an IP instance for the BSD Client. */ + status = nx_ip_create(&bsd_client_ip, "NetX BSD Client", CLIENT_ADDRESS, 0xFFFFFF00UL, + &bsd_pool, _nx_ram_network_driver, pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&bsd_client_ip); + + /* Enable ARP and supply ARP cache memory for BSD Client Instance */ + status += nx_arp_enable(&bsd_client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + { + error_counter++; + } + + return; +} + + + +void thread_server_entry(ULONG thread_input) +{ + +INT hcstatus, sock, sock6, sock_tcp_server, sock_tcp_server6; +UINT status; +struct sockaddr_in6 echoServAddr6; +struct sockaddr_in echoServAddr; +INT Serverlen; +NXD_ADDRESS ip_address; +UINT address_index; +UINT loopcount = 0; +INT length; +struct sockaddr_in localAddr; +struct sockaddr_in6 localAddr6; + + + printf("NetX Test: Basic BSD TCP Server Socket Shared Port Test............"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 5); + + memset(&echoServAddr, 0, sizeof(echoServAddr)); + memset(&echoServAddr6, 0, sizeof(echoServAddr6)); + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_server_ip); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_server_ip); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set ip_0 interface address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010db8; + ip_address.nxd_ip_address.v6[1] = 0xf101; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 0x1234; + + status = nxd_ipv6_address_set(&bsd_server_ip, 0, NX_NULL, 10, &address_index); + + status |= nxd_ipv6_address_set(&bsd_server_ip, 0, &ip_address, 64, &address_index); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for IPv6 stack to finish DAD process. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create BSD TCP IPv6 Server Socket */ + sock_tcp_server6 = socket( AF_INET6, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_server6 == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + echoServAddr6.sin6_addr._S6_un._S6_u32[0] = htonl(0x20010db8); + echoServAddr6.sin6_addr._S6_un._S6_u32[1] = htonl(0xf101); + echoServAddr6.sin6_addr._S6_un._S6_u32[2] = 0x0; + echoServAddr6.sin6_addr._S6_un._S6_u32[3] = htonl(0x1234); + echoServAddr6.sin6_port = htons(SERVER_PORT); + echoServAddr6.sin6_family = AF_INET6; + + /* Create BSD TCP IPv4 Server Socket */ + sock_tcp_server = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP); + + if (sock_tcp_server == -1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + echoServAddr.sin_family = AF_INET; + echoServAddr.sin_port = htons(SERVER_PORT); + echoServAddr.sin_addr.s_addr = htonl(SERVER_ADDRESS); + + /* Bind the IPv4 and IPv6 server sockets. */ + hcstatus = bind (sock_tcp_server, (struct sockaddr *) &echoServAddr, sizeof(echoServAddr)); + hcstatus |= bind (sock_tcp_server6, (struct sockaddr *) &echoServAddr6, sizeof(echoServAddr6)); + if (hcstatus < 0) + { + test_control_return(1); + } + + /* Now listen for any client connections for these server sockets. */ + hcstatus = listen (sock_tcp_server, 5); + if (hcstatus < 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + hcstatus = listen (sock_tcp_server6, 5); + if (hcstatus < 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* All set to accept client connections */ + + /* Loop to check for client connection requests. */ + /* This assumes the IPv4 Client socket makes a connectin request before the IPv6 socket. */ + + Serverlen = sizeof(echoServAddr); + sock = accept(sock_tcp_server, (struct sockaddr *)&echoServAddr, &Serverlen); + if ((sock == NX_SOC_ERROR) || (sock == NX_BSD_MAX_SOCKETS + NX_BSD_SOCKFD_START - 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + length = sizeof(localAddr); + getsockname(sock_tcp_server, (struct sockaddr *)&localAddr, &length); + if (localAddr.sin_port != htons(SERVER_PORT)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + Serverlen = sizeof(echoServAddr6); + sock6 = accept(sock_tcp_server6, (struct sockaddr *)&echoServAddr6, &Serverlen); + if ((sock6 == NX_SOC_ERROR) || (sock6 == NX_BSD_MAX_SOCKETS + NX_BSD_SOCKFD_START - 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + length = sizeof(localAddr6); + getsockname(sock_tcp_server6, (struct sockaddr *)&localAddr6, &length); + if (localAddr6.sin6_port != htons(SERVER_PORT)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to send and receive IPv4 and IPv6 transmissions. */ + while(loopcount < 5) + { + + hcstatus = HandleClient(sock); + if (hcstatus == ERROR) + { + error_counter++; + } + + hcstatus = HandleClient(sock6); + if (hcstatus == ERROR) + { + error_counter++; + } + + loopcount++; + } + + /* Stop the client thread. */ + spin = NX_FALSE; + + /* Close down our server sockets. */ + soc_close(sock6); + soc_close(sock); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(loopcount != 5) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the Client thread. */ + +void thread_client_entry(ULONG thread_input) +{ + +INT status; +NXD_ADDRESS client_ip_address, server_ip_address; +UINT address_index; +NX_PACKET *packet_ptr4, *packet_ptr3, *packet_ptr2, *packet_ptr; + + + /* Allow Netx to initialize the driver, also let the server get set up first. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&bsd_client_ip); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&bsd_client_ip); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Client IPv6 interface address. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + client_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + client_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + client_ip_address.nxd_ip_address.v6[2] = 0; + client_ip_address.nxd_ip_address.v6[3] = 0x1235; + + status = nxd_ipv6_address_set(&bsd_client_ip, 0, NX_NULL, 10, &address_index); + + status |= nxd_ipv6_address_set(&bsd_client_ip, 0, &client_ip_address, 64, &address_index); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Time for duplicate address check. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set Server IPv6 interface address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + server_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + server_ip_address.nxd_ip_address.v6[2] = 0; + server_ip_address.nxd_ip_address.v6[3] = 0x1234; + + status = nx_tcp_socket_create(&bsd_client_ip, &client_socket1, "Client IPv4 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + status += nx_tcp_socket_create(&bsd_client_ip, &client_socket2, "Client IPv4 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, NX_NULL); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_client_socket_bind(&client_socket1, NX_ANY_PORT, 100); + status += nx_tcp_client_socket_bind(&client_socket2, NX_ANY_PORT, 100); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_client_socket_connect(&client_socket1, SERVER_ADDRESS, SERVER_PORT, 200); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_tcp_client_socket_connect(&client_socket2, &server_ip_address, SERVER_PORT, 300); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + while(spin) + { + + status = nx_packet_allocate(&bsd_pool, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, requests[0], strlen(requests[0]), + &bsd_pool, NX_NO_WAIT); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_socket_send(&client_socket1, packet_ptr, 100); + + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_allocate(&bsd_pool, &packet_ptr2, NX_TCP_PACKET, NX_NO_WAIT); + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr2, requests[1], strlen(requests[1]), + &bsd_pool, NX_NO_WAIT); + if (status ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_tcp_socket_send(&client_socket2, packet_ptr2, 100); + + if (status) + { + nx_packet_release(packet_ptr2); + error_counter++; + } + + status = nx_tcp_socket_receive(&client_socket1, &packet_ptr3, 200); + if(status != NX_SUCCESS) + { + + error_counter++; + } + else + { + nx_packet_release(packet_ptr3); + } + + status = nx_tcp_socket_receive(&client_socket2, &packet_ptr4, 200); + if(status != NX_SUCCESS) + { + + error_counter++; + } + else + { + nx_packet_release(packet_ptr4); + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + nx_tcp_socket_delete(&client_socket1); + nx_tcp_socket_delete(&client_socket2); + + /* All done */ + return; +} + + +INT HandleClient(INT clientsock) +{ + +INT status; +CHAR rcvBuffer[32]; + + + status = recv(clientsock, (VOID *)rcvBuffer, 32, 0); + if (status == ERROR ) + { + return(ERROR); + } + + /* a zero return from a recv() call indicates client is terminated! */ + if (status == 0) + { + + return(ERROR); + } + + /* And echo the same data to the client */ + status = send(clientsock, responses[clientsock % 2], strlen(responses[clientsock % 2]), 0); + + if (status == ERROR ) + { + return(ERROR); + } + + return(NX_SUCCESS); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_servers_shared_port_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Server Socket Shared Port Test............N/A"); + + test_control_return(3); + +} +#endif /* defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) */ + + + + + diff --git a/test/regression/bsd_test/netx_bsd_tcp_two_blocking_test.c b/test/regression/bsd_test/netx_bsd_tcp_two_blocking_test.c new file mode 100644 index 00000000..2153f448 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_two_blocking_test.c @@ -0,0 +1,399 @@ +/* This NetX test concentrates on the basic BSD TCP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), recv(), soc_close(), setsockopt() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define BSD_THREAD_PRIORITY 2 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +static int newsock_1; +static UCHAR loop; +static NX_TCP_SOCKET client_0, client_1; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UCHAR packet_pool_area[(256 + sizeof(NX_PACKET)) * 16]; +static UCHAR recv_buff_0[32]; +static UCHAR recv_buff_1[32]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static char *send_buffer = "Hello World"; +/* Define what the initial system looks like. */ + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_two_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + loop = NX_TRUE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_256, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_256, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, pointer, DEMO_STACK_SIZE, BSD_THREAD_PRIORITY); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd, newsock_0; +struct sockaddr_in local_addr; +int ret; +struct timeval time_0, time_1; + + + printf("NetX Test: Basic BSD TCP Two Blocking Test..............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a server socket. */ + sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + ret = listen(sockfd, 5); + if(ret < 0) + error_counter++; + + /* Let client thread start the connection. */ + tx_semaphore_put(&sema_1); + + /* Accept two connections. */ + newsock_0 = accept(sockfd, (struct sockaddr*)NX_NULL, 0); + if(newsock_0 < 0) + error_counter++; + else + { + +#if 0 + /* Set timeout to 3 seconds. */ + time_0.tv_sec = 3; + time_0.tv_usec = 0; +#else + /* Set timeout to 30 ticks. */ + time_0.tv_sec = 0; + time_0.tv_usec = 30 * NX_MICROSECOND_PER_CPU_TICK; +#endif + setsockopt(newsock_0, SOL_SOCKET, SO_RCVTIMEO, &time_0, sizeof(time_0)); + } + + + newsock_1 = accept(sockfd, (struct sockaddr*)NX_NULL, 0); + if(newsock_1 < 0) + error_counter++; + else + { + +#if 0 + /* Set timeout to 1 second. */ + time_1.tv_sec = 1; + time_1.tv_usec = 0; +#else + /* Set timeout to 10 ticks. */ + time_0.tv_sec = 0; + time_0.tv_usec = 10 * NX_MICROSECOND_PER_CPU_TICK; +#endif + setsockopt(newsock_1, SOL_SOCKET, SO_RCVTIMEO, &time_1, sizeof(time_1)); + } + + /* Let client thread loop send and recv. */ + tx_semaphore_put(&sema_1); + + /* Receive on socket 0. */ + ret = recv(newsock_0, recv_buff_0, sizeof(recv_buff_0), 0); + if((ret >= 0) || (errno != EAGAIN)) + error_counter++; + + /* Close down the server socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + /* Notify to end loop of thread 1. */ + loop = NX_FALSE; + tx_semaphore_get(&sema_0, 1 * NX_IP_PERIODIC_RATE); + + /* Close down the new socket 0. */ + ret = soc_close(newsock_0); + if(ret < 0) + error_counter++; + + /* Close down the new socket 1. */ + soc_close(newsock_1); + + /* Check bsd wrapper. */ + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_0, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Create a socket. */ + status += nx_tcp_socket_create(&ip_1, &client_1, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_0, 12, 1 * NX_IP_PERIODIC_RATE); + status += nx_tcp_client_socket_bind(&client_1, 13, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Wait for server thread first. */ + tx_semaphore_get(&sema_1, 1 * NX_IP_PERIODIC_RATE); + + status = nx_tcp_client_socket_connect(&client_0, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + status += nx_tcp_client_socket_connect(&client_1, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Loop sending and receiving. */ + tx_semaphore_get(&sema_1, 1 * NX_IP_PERIODIC_RATE); + while(loop) + { + + /* Send packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, send_buffer, strlen(send_buffer), &pool_0, NX_NO_WAIT); + status = nx_tcp_socket_send(&client_1, my_packet, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive data. */ + recv(newsock_1, recv_buff_1, sizeof(recv_buff_1), 0); + +#if 0 + /* Sleep 1 second. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); +#else + /* Sleep 100ms. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE / 10); +#endif + } + + nx_tcp_socket_disconnect(&client_0, 1); + nx_tcp_socket_disconnect(&client_1, 1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_0); + status += nx_tcp_client_socket_unbind(&client_1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_0); + status += nx_tcp_socket_delete(&client_1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let server thread go on. */ + tx_semaphore_put(&sema_0); +} + +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_two_blocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP Two Blocking Test...............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_tcp_udp_select_test.c b/test/regression/bsd_test/netx_bsd_tcp_udp_select_test.c new file mode 100644 index 00000000..ac30affe --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_tcp_udp_select_test.c @@ -0,0 +1,413 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET udp_socket; +static NX_TCP_SOCKET tcp_socket; +static TX_SEMAPHORE sema_0; +static TX_SEMAPHORE sema_1; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +static char *requests[2] = {"Request1", "Request2"}; + +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_udp_select_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, pointer, DEMO_STACK_SIZE, BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; + pointer = pointer + DEMO_STACK_SIZE; + + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + status += tx_semaphore_create(&sema_1, "SEMA 1", 0); + if(status) + error_counter++; +} + + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +struct sockaddr_in local_addr; +struct sockaddr_in peer_addr; +int peer_addr_len; +int tcp_sockfd, udp_sockfd, new_sockfd, nfd; +struct timeval tv; +fd_set readfd; +int n, i; +char buffer[20]; + + printf("NetX Test: Basic BSD TCP UDP Select Test................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + /* Open TCP socket. */ + tcp_sockfd = socket(AF_INET, SOCK_STREAM, 0); + if(tcp_sockfd < 0) + error_counter++; + + if(bind(tcp_sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)) < 0) + error_counter++; + + if(listen(tcp_sockfd, 5) < 0) + error_counter++; + + udp_sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(udp_sockfd < 0) + error_counter++; + + if(bind(udp_sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)) < 0) + error_counter++; + + peer_addr_len = sizeof(peer_addr); + tx_semaphore_put(&sema_1); + new_sockfd = accept(tcp_sockfd, (struct sockaddr*)&peer_addr, &peer_addr_len); + + if(new_sockfd < 0) + error_counter++; + +#if 0 + /* Now sleep for a second */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); +#endif + + /* select on both sockets. */ + if(udp_sockfd < new_sockfd) + nfd = new_sockfd + 1; + else + nfd = udp_sockfd + 1; + + tv.tv_sec = 1; + tv.tv_usec = 0; + error_counter += 2; + + for(i = 0; i < 2;) + { + FD_ZERO(&readfd); + FD_SET(new_sockfd, &readfd); + FD_SET(udp_sockfd, &readfd); + n = select(nfd, &readfd, NULL, NULL, &tv); + + if(n <= 0) + { + error_counter++; + break; + } + i += n; + + if(FD_ISSET(new_sockfd, &readfd)) + { + n = recv(new_sockfd, buffer, sizeof(buffer), 0); + if(n < 0) + error_counter++; + else if(n != (int)strlen(requests[1])) + error_counter++; + else if(strncmp(buffer, requests[1], n)) + error_counter++; + else + error_counter--; + + } + if(FD_ISSET(udp_sockfd, &readfd)) + { + peer_addr_len = sizeof(peer_addr); + n = recvfrom(udp_sockfd, buffer, sizeof(buffer), 0, (struct sockaddr*)&peer_addr, &peer_addr_len); + if(n < 0) + error_counter++; + else if(n != (int)strlen(requests[0])) + error_counter++; + else if(strncmp(buffer, requests[0], n)) + error_counter++; + else + error_counter--; + } + } + + soc_close(new_sockfd); + soc_close(tcp_sockfd); + soc_close(udp_sockfd); + + tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE); + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + status = nx_tcp_socket_create(&ip_1, &tcp_socket, "TCP Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + status += nx_tcp_client_socket_bind(&tcp_socket, NX_ANY_PORT, 0); + if(status != NX_SUCCESS) + error_counter++; + + + + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &udp_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + tx_semaphore_get(&sema_1, 5 * NX_IP_PERIODIC_RATE); + status = nx_tcp_client_socket_connect(&tcp_socket, IP_ADDRESS(1,2,3,4), 12345, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&udp_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Send a UDP packet */ + status = nx_udp_socket_send(&udp_socket, packet_ptr, IP_ADDRESS(1,2,3,4), 12345); + if(status) + error_counter++; + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[1], strlen(requests[1])); + + packet_ptr -> nx_packet_length = strlen(requests[1]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + + /* Send a TCP packet */ + status = nx_tcp_socket_send(&tcp_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_udp_socket_unbind(&udp_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&udp_socket); + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&tcp_socket, 1 * NX_IP_PERIODIC_RATE); + status += nx_tcp_client_socket_unbind(&tcp_socket); + status += nx_tcp_socket_delete(&tcp_socket); + + if(status != NX_SUCCESS) + error_counter++; + + tx_semaphore_put(&sema_0); +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_tcp_udp_select_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD TCP UDP Select Test.................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_udp_basic_blocking_test.c b/test/regression/bsd_test/netx_bsd_udp_basic_blocking_test.c new file mode 100644 index 00000000..6538b691 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_basic_blocking_test.c @@ -0,0 +1,501 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; +} + +#ifdef FEATURE_NX_IPV6 +static void test_udp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; + + + sockfd = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12345); + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3])) || + (remote_addr.sin6_port != htons(54321))) + error_counter++; + + /* Validate the data. */ + if((ret != (INT)strlen(requests[1])) || strncmp(buf, requests[1], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[1], strlen(response[1]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[1])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} +#endif /* FEATURE_NX_IPV6 */ + +static void test_udp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; + + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[0])) || strncmp(buf, requests[0], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + + printf("NetX Test: Basic BSD UDP Blocking Test..................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = (char)(ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (char)(ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + test_udp_server4(); + + tx_thread_sleep(3); + +#ifdef FEATURE_NX_IPV6 + test_udp_server6(); +#endif + + + tx_thread_sleep(1); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, IP_ADDRESS(1,2,3,4), 12345); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + tx_thread_sleep(3); + + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[1], strlen(requests[1])); + + packet_ptr -> nx_packet_length = strlen(requests[1]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Send a UDP packet */ + status = nxd_udp_socket_send(&server_socket, packet_ptr, &ipv6_address_ip0, 12345); + if(status) + error_counter++; + + error_counter++; + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[1])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[1], strlen(response[1]))) + error_counter++; + else + error_counter--; + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + +#endif + +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_basic_blocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD UDP Blocking Test...................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_udp_basic_nonblocking_test.c b/test/regression/bsd_test/netx_bsd_udp_basic_nonblocking_test.c new file mode 100644 index 00000000..26bd977d --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_basic_nonblocking_test.c @@ -0,0 +1,568 @@ +/* This NetX test concentrates on the basic BSD UDP blocking operation. */ +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#ifdef FEATURE_NX_IPV6 +#include "nx_icmpv6.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); + +static char *requests[4] = {"Request1", "Request2", "Request3", "Request4"}; +static char *response[4] = {"Response1", "Response2", "Response3", "Response4"}; +static void validate_bsd_structure(void); +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif /* FEATURE_NX_IPV6 */ +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_basic_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable udp processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check BSD init and udp enable status. */ + if (status) + error_counter++; +} + +#ifdef FEATURE_NX_IPV6 +static void test_udp_server6(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +fd_set read_fd; +struct timeval tv; + + + sockfd = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12345); + + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret > 0) + error_counter++; + else + { + /* Check errno */ + if(errno != EWOULDBLOCK) + error_counter++; + } + + /* Select on the socket. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret < 0) + error_counter++; + + /* Call recvfrom again */ + if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + + if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3])) || + (remote_addr.sin6_port != htons(54321))) + error_counter++; + + /* Validate the data. */ + if((ret != (INT)strlen(requests[1])) || strncmp(buf, requests[1], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[1], strlen(response[1]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[1])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +#endif + + +static void test_udp_server4(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +fd_set read_fd; +struct timeval tv; + + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + /* Set the socket to non-blocking mode. */ + if(fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret > 0) + error_counter++; + else + { + /* Check errno */ + if(errno != EWOULDBLOCK) + error_counter++; + } + + /* Select on the socket. */ + FD_ZERO(&read_fd); + FD_SET(sockfd, &read_fd); + + tv.tv_sec = 2; + tv.tv_usec = 0; + + + ret = select(sockfd + 1, &read_fd, NULL, NULL, &tv); + if(ret != 1) + error_counter++; + + if(!FD_ISSET(sockfd, &read_fd)) + error_counter++; + + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret < 0) + error_counter++; + + /* Call recvfrom again */ + if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + + if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1,2,3,5))) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + + /* Validate the data. */ + if((ret != (int)strlen(requests[0])) || strncmp(buf, requests[0], ret)) + error_counter++; + + /* Send a response back. */ + ret = sendto(sockfd, response[0], strlen(response[0]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[0])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +char mac_ip0[6]; +char mac_ip1[6]; +UINT status; +#endif + + printf("NetX Test: Basic BSD UDP Non-Blocking Test..............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; +#endif + + test_udp_server4(); + + tx_thread_sleep(3); + +#ifdef FEATURE_NX_IPV6 + test_udp_server6(); +#endif + tx_thread_sleep(1); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[0], strlen(requests[0])); + + packet_ptr -> nx_packet_length = strlen(requests[0]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, IP_ADDRESS(1,2,3,4), 12345); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[0])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[0], strlen(response[0]))) + error_counter++; + + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + tx_thread_sleep(3); + + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[1], strlen(requests[1])); + + packet_ptr -> nx_packet_length = strlen(requests[1]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Send a UDP packet */ + status = nxd_udp_socket_send(&server_socket, packet_ptr, &ipv6_address_ip0, 12345); + if(status) + error_counter++; + + error_counter++; + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[1])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[1], strlen(response[1]))) + error_counter++; + else + error_counter--; + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + +#endif + +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_basic_nonblocking_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD UDP Non-Blocking Test...............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_udp_bind_connect_test.c b/test/regression/bsd_test/netx_bsd_udp_bind_connect_test.c new file mode 100644 index 00000000..aca76d19 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_bind_connect_test.c @@ -0,0 +1,553 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking bind to a specific address and connect + send operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) + +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#endif +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nx_ipv4.h" +#include "nxd_bsd.h" +#else +#include "nx_ip.h" +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +static TX_SEMAPHORE sema; +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0[3][3]; +static NXD_ADDRESS ipv6_address_ip1[3][3]; +static char *bsd6_msg[3][3] = {{"BSD6_MSG IF0 LLA", "BSD6_MSG IF0 GA0", "MSD6_MSG IF0 GA1"}, + {"BSD6_MSG IF1 LLA", "BSD6_MSG IF1 GA0", "MSD6_MSG IF1 GA1"}, + {"BSD6_MSG IF2 LLA", "BSD6_MSG IF2 GA0", "MSD6_MSG IF2 GA1"}}; +#endif /* FEATURE_NX_IPV6 */ +static char *bsd4_msg[3] = {"BSD4_MSG 0", "BSD4_MSG 1", "MSD4_MSG 2"}; + +static void validate_bsd_structure(void); + +#define IP0_IF0_V4_ADDR IP_ADDRESS(1,2,3,4) +#define IP0_IF1_V4_ADDR IP_ADDRESS(2,2,3,4) +#define IP0_IF2_V4_ADDR IP_ADDRESS(3,2,3,4) + +#define IP1_IF0_V4_ADDR IP_ADDRESS(1,2,3,5) +#define IP1_IF1_V4_ADDR IP_ADDRESS(2,2,3,5) +#define IP1_IF2_V4_ADDR IP_ADDRESS(3,2,3,5) + +#define ITERATIONS 100 +static ULONG ip0_address[3] = {IP0_IF0_V4_ADDR, IP0_IF1_V4_ADDR, IP0_IF2_V4_ADDR}; +static ULONG ip1_address[3] = {IP1_IF0_V4_ADDR, IP1_IF1_V4_ADDR, IP1_IF2_V4_ADDR}; +/* Define what the initial system looks like. */ + +#ifdef __PRODUCT_NETX__ +#define NX_IPV4_HEADER NX_IP_HEADER +#endif + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_bind_connect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP0_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Attach a 2nd interface */ + status += nx_ip_interface_attach(&ip_0, "ip_0_second", IP0_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_0, "ip_0_third", IP0_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP1_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_1, "ip_1_second", IP1_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "ip_1_third", IP1_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema, "test done", 0); + if (status) + error_counter++; +} + + + + +#ifdef FEATURE_NX_IPV6 +static void test_udp6_on_interface_address(int iface, int address) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; + + + sockfd = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_port = htons(12345); + local_addr.sin6_family = AF_INET6; + if(iface != 3) + { + local_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[0]); + local_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[1]); + local_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[2]); + local_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[3]); + } + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1[iface][address].nxd_ip_address.v6[3]); + + remote_addr.sin6_port = htons(12346); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + + ret = send(sockfd, bsd6_msg[iface][address], strlen(bsd6_msg[iface][address]), 0); + if(ret != (INT)strlen(bsd6_msg[iface][address])) + error_counter++; + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + +#endif /* FEATURE_NX_IPV6 */ + +static void test_udp4_on_interface(int i) +{ + +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; + + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = htonl(ip0_address[i]); + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(12346); + remote_addr.sin_addr.s_addr = htonl(ip1_address[i]); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + ret = send(sockfd, bsd4_msg[i], strlen(bsd4_msg[i]), 0); + if(ret != (int)strlen(bsd4_msg[i])) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +static char mac_ip0[6]; +static char mac_ip1[6]; +int i,j; +UINT status; +int addr_index; +#endif +int iface; + + + printf("NetX Test: Basic BSD UDP Bind Connect Send Test.........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + + for(i = 0; i < 3; i++) + { + mac_ip0[0] = (char)(ip_0.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (char)(ip_1.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + for(j = 0; j < 3; j ++) + { + if(j == 0) + { + /* First set up IPv6 linklocal addresses. */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ((mac_ip0[0] | 0x2) << 24) | (mac_ip0[1] << 16) | (mac_ip0[2] << 8) | 0xFF; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = (0xFE << 24) | ((mac_ip0[3] | 0x2) << 16) | (mac_ip0[4] << 8) | mac_ip0[5]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = + ((mac_ip1[0] | 0x2) << 24) | (mac_ip1[1] << 16) | (mac_ip1[2] << 8) | 0xFF; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = + (0xFE << 24) | ((mac_ip1[3] | 0x2) << 16) | (mac_ip1[4] << 8) | mac_ip1[5]; + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 10, NX_NULL); + } + else + { + /* Global Adddress */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ipv6_address_ip0[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = ipv6_address_ip0[i][0].nxd_ip_address.v6[3]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = ipv6_address_ip1[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = ipv6_address_ip1[i][0].nxd_ip_address.v6[3]; + + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 64, NX_NULL); + } + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1[i][j].nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0[i][j].nxd_ip_address.v6, 0, mac_ip0); + } + + } + + + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + + + if(status) + error_counter++; +#endif + + /* Wait for the semaphore to signal the other party is ready. */ + tx_semaphore_get(&sema, 2 * NX_IP_PERIODIC_RATE); + + for(iface = 0; iface < 3; iface++) + { + test_udp4_on_interface(iface); + + tx_semaphore_get(&sema, 2 * NX_IP_PERIODIC_RATE); + +#ifdef FEATURE_NX_IPV6 + for(addr_index = 1; addr_index < 3; addr_index++) + { + + test_udp6_on_interface_address(iface, addr_index); + + tx_semaphore_get(&sema, 2 * NX_IP_PERIODIC_RATE); + } + +#endif + } + + + tx_semaphore_delete(&sema); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void ntest_1_entry(ULONG thread_input) +{ +ULONG actual_status; +UINT status; +UINT iface; +NX_PACKET *packet_ptr; +NX_UDP_SOCKET server_socket; +ULONG peer_ip; +UINT peer_port; +NX_IPV4_HEADER *ipv4_header; +#ifdef FEATURE_NX_IPV6 +NX_IPV6_HEADER *ipv6_header; +UINT addr_index; +NXD_ADDRESS peer6_ip; +#endif + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + if(status) + error_counter++; + + status = nx_udp_socket_bind(&server_socket, 12346, NX_WAIT_FOREVER); + + tx_semaphore_put(&sema); + + + for(iface = 0; iface < 3; iface++) + { + + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + /* Check status... */ + if (status != NX_SUCCESS) + error_counter++; + else + { +#ifdef __PRODUCT_NETXDUO__ + ipv4_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_ip_header; +#else + ipv4_header = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr - 28); +#endif + status = nx_udp_source_extract(packet_ptr, &peer_ip, &peer_port); + if(status != NX_SUCCESS) + error_counter++; + if(peer_ip != ip0_address[iface]) + error_counter++; + if(peer_port != 12345) + error_counter++; + if(ipv4_header -> nx_ip_header_destination_ip != ip1_address[iface]) + error_counter++; + if((packet_ptr -> nx_packet_length != strlen(bsd4_msg[iface])) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd4_msg[iface], packet_ptr -> nx_packet_length))) + error_counter++; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&sema); + +#ifdef FEATURE_NX_IPV6 + for(addr_index = 1; addr_index < 3; addr_index++) + { + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + if(status != NX_SUCCESS) + error_counter++; + else + { + ipv6_header = (NX_IPV6_HEADER*)packet_ptr -> nx_packet_ip_header; + status = nxd_udp_source_extract(packet_ptr, &peer6_ip, &peer_port); + if(status != NX_SUCCESS) + error_counter++; + if((peer6_ip.nxd_ip_version != NX_IP_VERSION_V6) || + (peer6_ip.nxd_ip_address.v6[0] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[0]) || + (peer6_ip.nxd_ip_address.v6[1] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[1]) || + (peer6_ip.nxd_ip_address.v6[2] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[2]) || + (peer6_ip.nxd_ip_address.v6[3] != ipv6_address_ip0[iface][addr_index].nxd_ip_address.v6[3])) + error_counter++; + if((ipv6_header -> nx_ip_header_destination_ip[0] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[0]) || + (ipv6_header -> nx_ip_header_destination_ip[1] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[1]) || + (ipv6_header -> nx_ip_header_destination_ip[2] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[2]) || + (ipv6_header -> nx_ip_header_destination_ip[3] != ipv6_address_ip1[iface][addr_index].nxd_ip_address.v6[3])) + error_counter++; + if(peer_port != 12345) + error_counter++; + + if((packet_ptr -> nx_packet_length != strlen(bsd6_msg[iface][addr_index])) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd6_msg[iface][addr_index], packet_ptr -> nx_packet_length))) + error_counter++; + + nx_packet_release(packet_ptr); + + tx_semaphore_put(&sema); + } + } +#endif + } +} + +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_bind_connect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD UDP Bind Connect Send Test..........N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_udp_bind_test.c b/test/regression/bsd_test/netx_bsd_udp_bind_test.c new file mode 100644 index 00000000..c8c41cfb --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_bind_test.c @@ -0,0 +1,1268 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) + +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static TX_SEMAPHORE netx_sema; +static TX_SEMAPHORE bsd_sema; + +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0[3][3]; +static NXD_ADDRESS ipv6_address_ip1[3][3]; +#endif /* FEATURE_NX_IPV6 */ +static char *requests[4] = {"Request1", "Request22", "Request333", "Request4444"}; +static char *response[4] = {"Response1", "Response22", "Response333", "Response4444"}; +static void validate_bsd_structure(void); + +#define IP0_IF0_V4_ADDR IP_ADDRESS(1,2,3,4) +#define IP0_IF1_V4_ADDR IP_ADDRESS(2,2,3,4) +#define IP0_IF2_V4_ADDR IP_ADDRESS(3,2,3,4) + +#define IP1_IF0_V4_ADDR IP_ADDRESS(1,2,3,5) +#define IP1_IF1_V4_ADDR IP_ADDRESS(2,2,3,5) +#define IP1_IF2_V4_ADDR IP_ADDRESS(3,2,3,5) + +#define ITERATIONS 100 +static ULONG ip0_address[3] = {IP0_IF0_V4_ADDR, IP0_IF1_V4_ADDR, IP0_IF2_V4_ADDR}; +static ULONG ip1_address[3] = {IP1_IF0_V4_ADDR, IP1_IF1_V4_ADDR, IP1_IF2_V4_ADDR}; +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_bind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP0_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Attach a 2nd interface */ + status += nx_ip_interface_attach(&ip_0, "ip_0_second", IP0_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_0, "ip_0_third", IP0_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP1_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_1, "ip_1_second", IP1_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "ip_1_third", IP1_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&netx_sema, "NetX SEMA", 0); + status += tx_semaphore_create(&bsd_sema, "BSD SEMA", 0); + if(status != TX_SUCCESS) + error_counter++; + + + +} + +static int sent_msg_id; +static int sent_if; +#ifdef FEATURE_NX_IPV6 +static int sent_addr; +#endif + + +#ifdef FEATURE_NX_IPV6 +static void test_udp_server6_bind_to_ANY(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +int message_count = 0; + + + sockfd = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12345); + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + error_counter += (ITERATIONS * 2); + + while(message_count < ITERATIONS) + { + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + else if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + else if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1[(message_count / 2) % 3][(message_count & 1) + 1].nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1[(message_count / 2) % 3][(message_count & 1) + 1].nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1[(message_count / 2) % 3][(message_count & 1) + 1].nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1[(message_count / 2) % 3][(message_count & 1) + 1].nxd_ip_address.v6[3])) || + (remote_addr.sin6_port != htons(54321))) + error_counter++; + /* Validate the data. */ + else if((ret != (INT)strlen(requests[message_count & 3])) || strncmp(buf, requests[message_count & 3], ret)) + error_counter++; + else + error_counter--; + + /* Send a response back. */ + ret = sendto(sockfd, response[message_count & 3], strlen(response[message_count & 3]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (INT)strlen(response[message_count & 3])) + error_counter++; + + message_count ++; + } + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_udp6_on_interface_address(int iface, int address, INT reuseaddr) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; + + + sockfd = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + if(reuseaddr) + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(INT)); + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_port = htons(12345); + local_addr.sin6_family = AF_INET6; + if(iface != 3) + { + local_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[0]); + local_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[1]); + local_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[2]); + local_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip0[iface][address].nxd_ip_address.v6[3]); + } + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + else if(addrlen != sizeof(struct sockaddr_in6)) + error_counter++; + else if((remote_addr.sin6_family != AF_INET6) || + (remote_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1[sent_if][sent_addr].nxd_ip_address.v6[0])) || + (remote_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1[sent_if][sent_addr].nxd_ip_address.v6[1])) || + (remote_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1[sent_if][sent_addr].nxd_ip_address.v6[2])) || + (remote_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1[sent_if][sent_addr].nxd_ip_address.v6[3])) || + (remote_addr.sin6_port != htons(54321))) + error_counter++; + /* Make sure the source and the dest are in the same prefix range. */ + else if((iface != 3) && + ((ntohl(remote_addr.sin6_addr._S6_un._S6_u32[0]) != ipv6_address_ip0[iface][address].nxd_ip_address.v6[0]) || + (ntohl(remote_addr.sin6_addr._S6_un._S6_u32[1]) != ipv6_address_ip0[iface][address].nxd_ip_address.v6[1]))) + error_counter++; + /* Validate the data. */ + else if((ret != (INT)strlen(requests[sent_msg_id])) || strncmp(buf, requests[sent_msg_id], ret)) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + + +#endif /* FEATURE_NX_IPV6 */ + +static void test_udp_server4_bind_to_ANY(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +int message_count = 0; + + error_counter += (ITERATIONS * 2); + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + /* Test bind to port 0. */ + local_addr.sin_family = AF_INET; + local_addr.sin_port = 0; + local_addr.sin_addr.s_addr = INADDR_ANY; + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + addrlen = sizeof(local_addr); + ret = getsockname(sockfd, (struct sockaddr*)&local_addr, &addrlen); + if(ret < 0) + error_counter++; + + /* Check whether port is zero. */ + if (local_addr.sin_port == 0) + error_counter++; + soc_close(sockfd); + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + while(message_count < ITERATIONS) + { + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + else if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(ip1_address[message_count % 3])) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + /* Validate the data. */ + else if((ret != (int)strlen(requests[message_count & 3])) || strncmp(buf, requests[message_count & 3], ret)) + error_counter++; + else + error_counter--; + + + /* Send a response back. */ + ret = sendto(sockfd, response[message_count & 3], strlen(response[message_count & 3]), 0, (struct sockaddr*)&remote_addr, addrlen); + if(ret != (int)strlen(response[message_count & 3])) + error_counter++; + message_count ++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 100); + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} + +static void test_udp_server4_bind_to_AF_INET(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +int message_count = 0; + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + while(message_count < 3) + { + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + else if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(ip1_address[sent_if])) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + /* Validate the data. */ + else if((ret != (int)strlen(requests[sent_msg_id])) || strncmp(buf, requests[sent_msg_id], ret)) + error_counter++; + message_count++; + + } + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} +static TX_THREAD client_threads[3]; +static ULONG client_thread_stack_area[3][DEMO_STACK_SIZE / sizeof(ULONG)]; +static void test_udp4_on_interface(int i, INT reuseaddr); + +#ifdef FEATURE_NX_IPV6 +static void test_udp6_on_interface_address(int iface, int address, INT reuseaddr); +static VOID client6_thread_entry(ULONG param) +{ +INT reuseaddr = 1; + + if(param == 0) + test_udp6_on_interface_address((int)param, 1, reuseaddr); + else + test_udp6_on_interface_address((int)param, param, reuseaddr); + + + tx_semaphore_put(&bsd_sema); + +} +#endif + +static VOID client_thread_entry(ULONG param) +{ +INT reuseaddr = 1; + test_udp4_on_interface((int)param, reuseaddr); + + tx_semaphore_put(&bsd_sema); + +} + + + +static void test_udp_bind_to_three_interfaces(int if1, int if2, int if3) +{ +int i; +UINT status; + + /* Wait for the client to be ready. */ + status = tx_semaphore_put(&netx_sema); + + if(status != TX_SUCCESS) + error_counter++; + /* Create 3 threads, each binds to a different interface. */ + tx_thread_create(&client_threads[0], "client thread0", client_thread_entry, if1, + (CHAR*)client_thread_stack_area[0], DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + tx_thread_create(&client_threads[1], "client thread1", client_thread_entry, if2, + (CHAR*)client_thread_stack_area[1], DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + tx_thread_create(&client_threads[2], "client thread2", client_thread_entry, if3, + (CHAR*)client_thread_stack_area[2], DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Wait for all three threads to quite. */ + for(i = 0; i < 3; i++) + { + status = tx_semaphore_get(&bsd_sema, 2 * NX_IP_PERIODIC_RATE); + if(status == TX_NO_INSTANCE) + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 50); + + for(i = 0; i < 3; i++) + status += tx_thread_delete(&client_threads[i]); + if(status) + error_counter++; + +} +#ifdef FEATURE_NX_IPV6 +static void test_udp_bind_to_ipv6_addresses(int if1, int if2, int if3) +{ +int i; +UINT status; + + + status = tx_semaphore_put(&netx_sema); + + if(status != TX_SUCCESS) + error_counter++; + /* Create 3 threads, each binds to a different interface. */ + tx_thread_create(&client_threads[0], "client thread0", client6_thread_entry, if1, + (CHAR*)client_thread_stack_area[0], DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + tx_thread_create(&client_threads[1], "client thread1", client6_thread_entry, if2, + (CHAR*)client_thread_stack_area[1], DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + tx_thread_create(&client_threads[2], "client thread1", client6_thread_entry, if3, + (CHAR*)client_thread_stack_area[2], DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Wait for all three threads to quite. */ + for(i = 0; i < 3; i++) + { + status = tx_semaphore_get(&bsd_sema, NX_IP_PERIODIC_RATE); + if(status == TX_NO_INSTANCE) + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 50); + + for(i = 0; i < 3; i++) + status += tx_thread_delete(&client_threads[i]); + if(status) + error_counter++; + +} +#endif +static void test_udp4_on_interface(int i, INT reuseaddr) +{ + +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; + + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + if(reuseaddr) + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(INT)); + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + if(i == 3) + local_addr.sin_addr.s_addr = htonl(INADDR_ANY); + else + local_addr.sin_addr.s_addr = htonl(ip0_address[i]); + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + else if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(ip1_address[sent_if])) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + /* Make sure the remote address and local address are on the same subnet*/ + else if((i < 3) && ((ntohl(remote_addr.sin_addr.s_addr) & 0xFFFFFF * NX_IP_PERIODIC_RATE) != (ip0_address[i] & 0xFFFFFF * NX_IP_PERIODIC_RATE))) + error_counter++; + /* Validate the data. */ + else if((ret != (int)strlen(requests[sent_msg_id])) || strncmp(buf, requests[sent_msg_id], ret)) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + +} +#define NUM_MESSAGES 5 +static void test_udp4_receive_multiple(int iface) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; +int packet_count; +UINT status; +NX_BSD_SOCKET *bsd_socket_ptr; + + status = tx_semaphore_put(&netx_sema); + + if(status != TX_SUCCESS) + error_counter++; + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + if(iface == 3) + local_addr.sin_addr.s_addr = htonl(INADDR_ANY); + else + local_addr.sin_addr.s_addr = htonl(ip0_address[iface]); + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Sleep for three tick, gives the client a chance to send 10 packets. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE / 20); + + packet_count = 0; + bsd_socket_ptr = &nx_bsd_socket_array[sockfd - NX_BSD_SOCKFD_START]; + while(bsd_socket_ptr -> nx_bsd_socket_received_packet) + { + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); + if(ret <= 0) + error_counter++; + else if(addrlen != sizeof(struct sockaddr_in)) + error_counter++; + else if((remote_addr.sin_family != AF_INET) || + (remote_addr.sin_addr.s_addr != htonl(ip1_address[iface])) || + (remote_addr.sin_port != htons(54321))) + error_counter++; + /* Make sure the remote address and local address are on the same subnet*/ + else if((iface < 3) && ((ntohl(remote_addr.sin_addr.s_addr) & 0xFFFFFF * NX_IP_PERIODIC_RATE) != (ip0_address[iface] & 0xFFFFFF * NX_IP_PERIODIC_RATE))) + error_counter++; + /* Validate the data. */ + else if((ret != (int)strlen(requests[packet_count & 3])) || strncmp(buf, requests[packet_count & 3], ret)) + error_counter++; + else + packet_count ++; + } + + if(packet_count != NUM_MESSAGES) + error_counter++; + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + + +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +static char mac_ip0[6]; +static char mac_ip1[6]; +int j; +UINT status; +#endif +int i; + +INT reuseaddr = 0; + + + printf("NetX Test: Basic BSD UDP Bind Test......................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + + for(i = 0; i < 3; i++) + { + mac_ip0[0] = (char)(ip_0.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (char)(ip_1.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + for(j = 0; j < 3; j ++) + { + if(j == 0) + { + /* First set up IPv6 linklocal addresses. */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ((mac_ip0[0] | 0x2) << 24) | (mac_ip0[1] << 16) | (mac_ip0[2] << 8) | 0xFF; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = (0xFE << 24) | ((mac_ip0[3] | 0x2) << 16) | (mac_ip0[4] << 8) | mac_ip0[5]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = + ((mac_ip1[0] | 0x2) << 24) | (mac_ip1[1] << 16) | (mac_ip1[2] << 8) | 0xFF; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = + (0xFE << 24) | ((mac_ip1[3] | 0x2) << 16) | (mac_ip1[4] << 8) | mac_ip1[5]; + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 10, NX_NULL); + } + else + { + /* Global Adddress */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ipv6_address_ip0[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = ipv6_address_ip0[i][0].nxd_ip_address.v6[3]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = ipv6_address_ip1[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = ipv6_address_ip1[i][0].nxd_ip_address.v6[3]; + + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 64, NX_NULL); + } + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1[i][j].nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0[i][j].nxd_ip_address.v6, 0, mac_ip0); + } + + } + + + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + + + if(status) + error_counter++; +#endif + tx_semaphore_put(&netx_sema); + test_udp_server4_bind_to_ANY(); + +#ifdef FEATURE_NX_IPV6 + tx_semaphore_put(&netx_sema); + test_udp_server6_bind_to_ANY(); +#endif + + /* Make sure a bind to IPv4 Address Family won't received UDP sent to IPv6 address. */ + tx_semaphore_put(&netx_sema); + test_udp_server4_bind_to_AF_INET(); + +#ifdef FEATURE_NX_IPV6 + /* Make sure a bind to IPv6 Address Family won't received UDP sent to IPv4 address. */ + tx_semaphore_put(&netx_sema); + test_udp6_on_interface_address(3, 0, 0); +#endif + + /* Make sure a bind to interface 1 address does not receive UDP sent to interface2 and 3 addresses. */ + for(i = 0; i < 3; i++) + { + tx_semaphore_put(&netx_sema); + test_udp4_on_interface(i, reuseaddr); + +#ifdef FEATURE_NX_IPV6 + /* Make sure a bind to an IPv6 address does not receive UDP sent to another IPv6 address. */ + for(j = 1; j < 3; j++) + { + tx_semaphore_put(&netx_sema); + test_udp6_on_interface_address(i, j, 0); + } + + +#endif + } + + /* Test UDP sockets binding to address1, 2, 3 are able to receive packets according to their + binding information */ + test_udp_bind_to_three_interfaces(0, 1, 2); + + /* Test UDP sockets binding to address1, 3, and another bind to INADDR_ANY. + Traffic to address 1 goes to the INADDR_ANY bind. */ + test_udp_bind_to_three_interfaces(0, 2, 3); + + + /* Test UDP sockets binding to INADDR_ANY, address0, 3. + Traffic to address 1 goes to the INADDR_ANY bind. */ + test_udp_bind_to_three_interfaces(3, 2, 0); + + +#ifdef FEATURE_NX_IPV6 + /* Test UDP sockets binding to 3 different IPv6 addresses */ + test_udp_bind_to_ipv6_addresses(0, 1, 2); + + /* Test UDP sockets binding to 2 different IPv6 addresses and a 3rd one to INADDR_ANY + and be able to catch all. */ + test_udp_bind_to_ipv6_addresses(0, 1, 3); + + test_udp_bind_to_ipv6_addresses(3, 2, 0); + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 10); + +#endif + + test_udp4_receive_multiple(1); + + tx_semaphore_delete(&bsd_sema); + tx_semaphore_delete(&netx_sema); + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +#ifdef FEATURE_NX_IPV6 +static void udp_client6_to_ANY(void) +{ + +UINT status; +NX_PACKET *packet_ptr; +int message_counter = 0; + + status = tx_semaphore_get(&netx_sema, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + while(message_counter < ITERATIONS) + { + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[message_counter & 3], strlen(requests[message_counter & 3])); + + packet_ptr -> nx_packet_length = strlen(requests[message_counter & 3]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Send a UDP packet */ + status = nxd_udp_socket_send(&server_socket, packet_ptr, &ipv6_address_ip0[(message_counter / 2) % 3][(message_counter & 1) + 1], 12345); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Validate the content. */ + if(packet_ptr -> nx_packet_length != strlen(response[message_counter & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[message_counter & 3], strlen(response[message_counter & 3]))) + error_counter++; + else + error_counter--; + nx_packet_release(packet_ptr); + message_counter ++; + } + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; +} +#endif + +static void udp_client_to_AF_INET_AF_INET6(void) +{ + +UINT status; +NX_PACKET *packet_ptr; +int message_count = 0; +int i; +#ifdef FEATURE_NX_IPV6 +int j; +#endif + status = tx_semaphore_get(&netx_sema, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + for(i = 2; i >= 0; i--) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[message_count & 3], strlen(requests[message_count & 3])); + + packet_ptr -> nx_packet_length = strlen(requests[message_count & 3]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + sent_msg_id = message_count & 3; + sent_if = i; + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, ip0_address[i], 12345); + if(status) + error_counter++; + + message_count ++; +#ifdef FEATURE_NX_IPV6 + + for(j = 0; j < 2; j++) + { + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[message_count & 3], strlen(requests[message_count & 3])); + + packet_ptr -> nx_packet_length = strlen(requests[message_count & 3]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + + /* Send a UDP packet */ + sent_msg_id = message_count & 3; + sent_if = i; + sent_addr = j + 1; + status = nxd_udp_socket_send(&server_socket, packet_ptr, &ipv6_address_ip0[i][j + 1], 12345); + if(status) + error_counter++; + message_count ++; + } +#endif + } + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; +} + + +static void udp_client4_to_ANY(void) +{ + +UINT status; +NX_PACKET *packet_ptr; +int message_count = 0; + + + status = tx_semaphore_get(&netx_sema, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + while(message_count < ITERATIONS) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[message_count & 3], strlen(requests[message_count & 3])); + + packet_ptr -> nx_packet_length = strlen(requests[message_count & 3]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, ip0_address[message_count % 3], 12345); + if(status) + error_counter++; + + /* Ready to reaceive a message */ + status = nx_udp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + if(status) + error_counter++; + /* Validate the content. */ + else if(packet_ptr -> nx_packet_length != strlen(response[message_count & 3])) + error_counter++; + else if(strncmp((char*)packet_ptr -> nx_packet_prepend_ptr, response[message_count & 3], strlen(response[message_count & 3]))) + error_counter++; + else + error_counter--; + nx_packet_release(packet_ptr); + + message_count ++; + } + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + + +} + + + +static void udp_client4_to_interface(int iface) +{ + +UINT status; +NX_PACKET *packet_ptr; +int message_count = 0; + + status = tx_semaphore_get(&netx_sema, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + while(message_count < NUM_MESSAGES) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests[message_count & 3], strlen(requests[message_count & 3])); + + packet_ptr -> nx_packet_length = strlen(requests[message_count & 3]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, ip0_address[iface], 12345); + if(status) + error_counter++; + + message_count ++; + } + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + + +} + + + + + + +static void ntest_1_entry(ULONG thread_input) +{ +ULONG actual_status; +UINT status; +UINT i; +#ifdef FEATURE_NX_IPV6 +UINT j; +#endif + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + udp_client4_to_ANY(); + +#ifdef FEATURE_NX_IPV6 + + udp_client6_to_ANY(); + +#endif + + /* Make sure a bind to IPv4 Address Family won't received UDP sent to IPv6 address. */ + udp_client_to_AF_INET_AF_INET6(); + +#ifdef FEATURE_NX_IPV6 + + /* Make sure a bind to IPv6 Address Family won't received UDP sent to IPv4 address. */ + udp_client_to_AF_INET_AF_INET6(); +#endif + + /* Test UDP bind to 3 different interfaces, each with one IPv4, and 2 IPv6 GA. */ + /* So total there are 9 different addresses to test for. */ + for(i = 0; i < 3; i++) + { +#if 0 + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); +#endif + udp_client_to_AF_INET_AF_INET6(); + +#ifdef FEATURE_NX_IPV6 + + /* Make sure a bind to an IPv6 address does not receive UDP sent to another IPv6 address. */ + for(j = 1; j < 3; j++) + { +#if 0 + tx_semaphore_get(&netx_sema); +#endif + udp_client_to_AF_INET_AF_INET6(); + } + +#endif + } + + /* Start testing test_udp_bind_to_three_interfaces(0,1,2);*/ + udp_client_to_AF_INET_AF_INET6(); + + /* Start testing test_udp_bind_to_three_interfaces(0,2,3);*/ + udp_client_to_AF_INET_AF_INET6(); + + /* Start testing test_udp_bind_to_three_interfaces(3, 2,0);*/ + udp_client_to_AF_INET_AF_INET6(); + +#ifdef FEATURE_NX_IPV6 + /* Start testing test_udp_bind_to_ipv6_addresses */ + udp_client_to_AF_INET_AF_INET6(); + + /* Start testing test_udp_bind_to_ipv6_addresses */ + udp_client_to_AF_INET_AF_INET6(); + + + /* Start testing test_udp_bind_to_ipv6_addresses */ + udp_client_to_AF_INET_AF_INET6(); +#endif + udp_client4_to_interface(1); + +} + +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_bind_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD UDP Bind Test.......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_udp_blocking_bidirection_test.c b/test/regression/bsd_test/netx_bsd_udp_blocking_bidirection_test.c new file mode 100644 index 00000000..5576e3be --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_blocking_bidirection_test.c @@ -0,0 +1,680 @@ +/* This NetX test concentrates on the basic BSD UDP blocking operation. */ +/* The BSD APIs involved in this test are: socket(), connect(), send(), soc_close() */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 +#define NUM_MESSAGES 20 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 10 +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG packet_pool_area[(256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 8 / 4]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0; +static NXD_ADDRESS ipv6_address_ip1; +#endif +static char *bsd_send_buffer = "From BSD Test"; +static char *netx_send_buffer = "From Native NetX Test"; +#ifdef FEATURE_NX_IPV6 +static char *bsd_send_buffer6 = "From BSD Test 6"; +static char *netx_send_buffer6 = "From Native NetX Test 6"; +#endif + +static void validate_bsd_structure(void); + +static char *bsd_transmit_v4_thread_stack; +static char *bsd_receive_v4_thread_stack; +static char *netx_transmit_thread_stack; +static char *netx_receive_thread_stack; + + +static TX_THREAD netx_transmit_thread; +static TX_THREAD netx_receive_thread; +static TX_THREAD bsd_transmit_v4_thread; +static TX_THREAD bsd_receive_v4_thread; + + + +#ifdef FEATURE_NX_IPV6 +static char *bsd_transmit_v6_thread_stack; +static char *bsd_receive_v6_thread_stack; + +static TX_THREAD bsd_transmit_v6_thread; +static TX_THREAD bsd_receive_v6_thread; +#endif + +static TX_SEMAPHORE bsd_sema; +static TX_SEMAPHORE netx_sema; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_blocking_bidirection_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, packet_pool_area, sizeof(packet_pool_area)); + + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + netx_transmit_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + netx_receive_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + + bsd_transmit_v4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + bsd_receive_v4_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + +#ifdef FEATURE_NX_IPV6 + bsd_transmit_v6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; + bsd_receive_v6_thread_stack = pointer; + pointer = pointer + DEMO_STACK_SIZE; +#endif + + status = tx_semaphore_create(&netx_sema, "NetX test done", 0); + status += tx_semaphore_create(&bsd_sema, "BSD test done", 0); + if(status != TX_SUCCESS) + error_counter++; +} + +static void transmit_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; +struct sockaddr_in peer_addr; + + + for(i = 0; i < NUM_MESSAGES; i++) + { + + peer_addr.sin_family = AF_INET; + peer_addr.sin_port = htons(12345); + peer_addr.sin_addr.s_addr = htonl(IP_ADDRESS(1, 2, 3, 5)); + + ret = sendto(sockfd, bsd_send_buffer, strlen(bsd_send_buffer), 0, (struct sockaddr*)&peer_addr, sizeof(peer_addr)); + + if(ret != (int)strlen(bsd_send_buffer)) + error_counter++; + + tx_thread_relinquish(); + } + + tx_semaphore_put(&bsd_sema); + +} + +static void receive_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; +char buffer[30]; +struct sockaddr_in peer_addr; +int peer_addr_len; + + + for(i = 0; i < NUM_MESSAGES; i++) + { + peer_addr_len = sizeof(peer_addr); + + ret = recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr*)&peer_addr, &peer_addr_len); + + if(peer_addr_len != sizeof(peer_addr)) + error_counter++; + else if((peer_addr.sin_family != AF_INET) || + (peer_addr.sin_addr.s_addr != htonl(IP_ADDRESS(1, 2, 3, 5)))) + error_counter++; + + if(ret != (int)strlen(netx_send_buffer)) + error_counter++; + else if(strncmp(buffer, netx_send_buffer, ret)) + error_counter++; + + tx_thread_relinquish(); + } + + tx_semaphore_put(&bsd_sema); + +} + +#ifdef FEATURE_NX_IPV6 +static void transmit6_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; +struct sockaddr_in6 peer_address6; + + + + for(i = 0; i < NUM_MESSAGES; i++) + { + + peer_address6.sin6_family = AF_INET6; + peer_address6.sin6_port = htons(12345); + peer_address6.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1.nxd_ip_address.v6[0]); + peer_address6.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1.nxd_ip_address.v6[1]); + peer_address6.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1.nxd_ip_address.v6[2]); + peer_address6.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1.nxd_ip_address.v6[3]); + + ret = sendto(sockfd, bsd_send_buffer6, strlen(bsd_send_buffer6), 0, (struct sockaddr*)&peer_address6, sizeof(peer_address6)); + + if(ret != (INT)strlen(bsd_send_buffer6)) + error_counter++; + + tx_thread_relinquish(); + } + + tx_semaphore_put(&bsd_sema); + +} + +static void receive6_entry(ULONG thread_input) +{ +int sockfd = thread_input; +int ret; +int i; +char buffer[30]; +struct sockaddr_in6 peer_addr; +int peer_addr_len; + + for(i = 0; i < NUM_MESSAGES; i++) + { + peer_addr_len = sizeof(peer_addr); + + ret = recvfrom(sockfd, buffer, sizeof(buffer), 0, (struct sockaddr*)&peer_addr, &peer_addr_len); + + if(peer_addr_len != sizeof(peer_addr)) + error_counter++; + else if((peer_addr.sin6_family != AF_INET6) || + (peer_addr.sin6_addr._S6_un._S6_u32[0] != htonl(ipv6_address_ip1.nxd_ip_address.v6[0])) || + (peer_addr.sin6_addr._S6_un._S6_u32[1] != htonl(ipv6_address_ip1.nxd_ip_address.v6[1])) || + (peer_addr.sin6_addr._S6_un._S6_u32[2] != htonl(ipv6_address_ip1.nxd_ip_address.v6[2])) || + (peer_addr.sin6_addr._S6_un._S6_u32[3] != htonl(ipv6_address_ip1.nxd_ip_address.v6[3]))) + error_counter++; + + + if(ret != (INT)strlen(netx_send_buffer6)) + error_counter++; + else if(strncmp(buffer, netx_send_buffer6, ret)) + error_counter++; + + tx_thread_relinquish(); + } + + tx_semaphore_put(&bsd_sema); + +} + +#endif + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in local_addr; +UINT status; +#ifdef FEATURE_NX_IPV6 +struct sockaddr_in6 local_addr6; +char mac_ip0[6]; +char mac_ip1[6]; +int sockfd6; +INT reuseaddr = 1; +#endif +int ret; + + printf("NetX Test: Basic BSD UDP Blocking Bidirection Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef FEATURE_NX_IPV6 + /* First set up IPv6 addresses. */ + ipv6_address_ip0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip0.nxd_ip_address.v6[3] = 0xfe334456; + + ipv6_address_ip1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_ip1.nxd_ip_address.v6[3] = 0xfe334457; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_ip0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_ip1, 64, NX_NULL); + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + mac_ip0[0] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip0[1] = ip_0.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw >> 8; + mac_ip1[1] = ip_1.nx_ip_interface[0].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw & 0xff; + + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1.nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0.nxd_ip_address.v6, 0, mac_ip0); + + if(status) + error_counter++; + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + tx_semaphore_put(&netx_sema); + + /* Set up UDP socket */ + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd <= 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + + tx_thread_sleep(20); + + /* Create a thread to handle IPv4 UDP receive */ + ret = tx_thread_create(&bsd_transmit_v4_thread, "transmit v4 thread", transmit_entry, sockfd, + bsd_transmit_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + ret += tx_thread_create(&bsd_receive_v4_thread, "receive v4 thread", receive_entry, sockfd, + bsd_receive_v4_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + if(ret != TX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set up UDP socket */ + sockfd6 = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd6 <= 0) + error_counter++; + + setsockopt(sockfd6, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(INT)); + memset(&local_addr6, 0, sizeof(local_addr6)); + local_addr6.sin6_family = AF_INET6; + local_addr6.sin6_port = htons(12345); + + ret = bind(sockfd6, (struct sockaddr*)&local_addr6, sizeof(local_addr6)); + if(ret) + error_counter++; + + /* Create a thread to handle IPv6 UDP receive */ + ret = tx_thread_create(&bsd_transmit_v6_thread, "transmit v6 thread", transmit6_entry, sockfd6, + bsd_transmit_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + ret += tx_thread_create(&bsd_receive_v6_thread, "receive v6 thread", receive6_entry, sockfd6, + bsd_receive_v6_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(ret != TX_SUCCESS) + error_counter++; + +#endif + + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + + /* Close down both sockets. */ +#ifdef FEATURE_NX_IPV6 + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + status = tx_semaphore_get(&bsd_sema, TX_WAIT_FOREVER); + ret = soc_close(sockfd6); +#endif + ret += soc_close(sockfd); + if(ret) + error_counter++; +#ifdef FEATURE_NX_IPV6 + tx_thread_delete(&bsd_transmit_v6_thread); + tx_thread_delete(&bsd_receive_v6_thread); +#endif + + tx_thread_delete(&bsd_transmit_v4_thread); + tx_thread_delete(&bsd_receive_v4_thread); + + if(status) + error_counter++; + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void netx_transmit_entry(ULONG param) +{ +NX_UDP_SOCKET *socket_ptr = (NX_UDP_SOCKET*)param; +int i; +NX_PACKET *packet_ptr; +ULONG status; + + + for(i = 0; i < NUM_MESSAGES; i++) + { + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, netx_send_buffer, strlen(netx_send_buffer), + &pool_0, NX_NO_WAIT); + status += nx_udp_socket_send(socket_ptr, packet_ptr, IP_ADDRESS(1,2,3,4), 12345); + + if(status != NX_SUCCESS) + error_counter++; +#ifdef FEATURE_NX_IPV6 + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(packet_ptr, netx_send_buffer6, strlen(netx_send_buffer6), + &pool_0, NX_NO_WAIT); + status += nxd_udp_socket_send(socket_ptr, packet_ptr, &ipv6_address_ip0, 12345); + + if(status != NX_SUCCESS) + error_counter++; +#endif + + tx_thread_relinquish(); + } + + tx_semaphore_put(&netx_sema); +} + +static void netx_receive_entry(ULONG param) +{ +NX_UDP_SOCKET *socket_ptr = (NX_UDP_SOCKET*)param; +int i; +NX_PACKET *packet_ptr; +ULONG status; +int num_messages; + + num_messages = NUM_MESSAGES; + +#ifdef FEATURE_NX_IPV6 + num_messages += NUM_MESSAGES; +#endif + + for(i = 0; i < num_messages; i++) + { + + /* Receive a UDP message from the socket. */ + status = nx_udp_socket_receive(socket_ptr, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + + if(status) + error_counter++; +#ifdef __PRODUCT_NETXDUO__ + else if(packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) +#endif + { + if(packet_ptr -> nx_packet_length != strlen(bsd_send_buffer)) + error_counter++; + else if(memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd_send_buffer, packet_ptr -> nx_packet_length)) + error_counter++; + } +#ifdef FEATURE_NX_IPV6 + else if(packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) + { + if (packet_ptr -> nx_packet_length != strlen(bsd_send_buffer6)) + error_counter++; + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, bsd_send_buffer6, packet_ptr -> nx_packet_length)) + error_counter++; + } +#endif +#ifdef __PRODUCT_NETXDUO__ + else + error_counter++; +#endif + + nx_packet_release(packet_ptr); + + tx_thread_relinquish(); + } + + tx_semaphore_put(&netx_sema); +} + + + +static void netx_udp_test(void) +{ +NX_UDP_SOCKET udp_socket; +UINT status; + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &udp_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1 * NX_IP_PERIODIC_RATE); + + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_udp_socket_bind(&udp_socket, 12345, NX_WAIT_FOREVER); + if(status) + error_counter++; + + tx_thread_sleep(20); + + status = tx_thread_create(&netx_transmit_thread, "netx transmit thread", netx_transmit_entry, (ULONG)&udp_socket, + netx_transmit_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + status += tx_thread_create(&netx_receive_thread, "netx receive thread", netx_receive_entry, (ULONG)&udp_socket, + netx_receive_thread_stack, DEMO_STACK_SIZE, 2, 2, 1, TX_AUTO_START); + + if(status != TX_SUCCESS) + error_counter++; + + + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + + + tx_thread_delete(&netx_transmit_thread); + tx_thread_delete(&netx_receive_thread); + + /* Unaccept the server socket. */ + status = nx_udp_socket_unbind(&udp_socket); + + status += nx_udp_socket_delete(&udp_socket); + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + + tx_semaphore_get(&netx_sema, TX_WAIT_FOREVER); + netx_udp_test(); + + +} + + +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_blocking_bidirection_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD UDP Blocking Bidirection Test.......N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/bsd_test/netx_bsd_udp_checksum_corrupt_test.c b/test/regression/bsd_test/netx_bsd_udp_checksum_corrupt_test.c new file mode 100644 index 00000000..a287b114 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_checksum_corrupt_test.c @@ -0,0 +1,291 @@ +/* This NetX test concentrates on the BSD UDP socket reject packet with corrupted checksum. */ + + +#include "nx_api.h" +#ifdef NX_BSD_ENABLE +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif +#define DEMO_STACK_SIZE 4096 + +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 2 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +static char *requests = "Request"; +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +static VOID udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_checksum_corrupt_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; +int addrlen; + + printf("NetX Test: BSD UDP Checksum Corrupt Test................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + ip_0.nx_ip_udp_packet_receive = udp_packet_receive; + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = INADDR_ANY; + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + /* Receive data from the client. */ + addrlen = sizeof(remote_addr); + ret = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr*)&remote_addr, &addrlen); +#if !defined(NX_ENABLE_INTERFACE_CAPABILITY) && !defined(NX_DISABLE_UDP_RX_CHECKSUM) + if(ret > 0) + error_counter++; +#endif + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; + + validate_bsd_structure(); +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + status = nx_packet_data_append(packet_ptr, requests, strlen(requests), + &pool_0, NX_WAIT_FOREVER); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, IP_ADDRESS(1,2,3,4), 12345); + if(status) + error_counter++; + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +static VOID udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +USHORT checksum; + + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + checksum = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF; + checksum++; + if (checksum == 0) + checksum++; + udp_header_ptr -> nx_udp_header_word_1 = (udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000) | checksum; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#endif /* NX_BSD_ENABLE */ diff --git a/test/regression/bsd_test/netx_bsd_udp_connect_test.c b/test/regression/bsd_test/netx_bsd_udp_connect_test.c new file mode 100644 index 00000000..abf73212 --- /dev/null +++ b/test/regression/bsd_test/netx_bsd_udp_connect_test.c @@ -0,0 +1,563 @@ +/* This NetX test concentrates on the basic BSD UDP non-blocking operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nx_icmpv6.h" +#include "nxd_bsd.h" +#else +#include "nx_bsd.h" +#endif + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET server_socket; +static ULONG bsd_thread_area[DEMO_STACK_SIZE / sizeof(ULONG)]; +#define BSD_THREAD_PRIORITY 2 +#define NUM_CLIENTS 20 +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void validate_bsd_structure(void); +extern NX_BSD_SOCKET nx_bsd_socket_array[NX_BSD_MAX_SOCKETS]; +extern TX_BLOCK_POOL nx_bsd_socket_block_pool; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_ip0[3][3]; +static NXD_ADDRESS ipv6_address_ip1[3][3]; +#endif /* FEATURE_NX_IPV6 */ +static char *requests_ipv4[3] = {"Request1_ipv4", "Request22_ipv4", "Request333_ipv4"}; +static char *response_ipv4[3] = {"Response1_ipv4", "Response22_ipv4", "Response333_ipv4"}; +#ifdef FEATURE_NX_IPV6 +static char *requests_ipv6[6] = {"Request1_ipv6", "Request22_ipv6", "Request333_ipv6", "Request4444_ipv6", "Request55555_ipv6", "Request666666_ipv6"}; +static char *response_ipv6[6] = {"Response1_ipv6", "Response22_ipv6", "Response333_ipv4", "Request4444_ipv6", "Request55555_ipv6", "Request666666_ipv6"}; +#endif +static void validate_bsd_structure(void); + +#define IP0_IF0_V4_ADDR IP_ADDRESS(1,2,3,4) +#define IP0_IF1_V4_ADDR IP_ADDRESS(2,2,3,4) +#define IP0_IF2_V4_ADDR IP_ADDRESS(3,2,3,4) + +#define IP1_IF0_V4_ADDR IP_ADDRESS(1,2,3,5) +#define IP1_IF1_V4_ADDR IP_ADDRESS(2,2,3,5) +#define IP1_IF2_V4_ADDR IP_ADDRESS(3,2,3,5) + +#define ITERATIONS 100 +static ULONG ip0_address[3] = {IP0_IF0_V4_ADDR, IP0_IF1_V4_ADDR, IP0_IF2_V4_ADDR}; +static ULONG ip1_address[3] = {IP1_IF0_V4_ADDR, IP1_IF1_V4_ADDR, IP1_IF2_V4_ADDR}; +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_connect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2); + pointer = pointer + (256 + sizeof(NX_PACKET)) * (NUM_CLIENTS + 4) * 2; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP0_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Attach a 2nd interface */ + status += nx_ip_interface_attach(&ip_0, "ip_0_second", IP0_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_0, "ip_0_third", IP0_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP1_IF0_V4_ADDR, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_1, "ip_1_second", IP1_IF1_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "ip_1_third", IP1_IF2_V4_ADDR, 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable BSD */ + status += bsd_initialize(&ip_0, &pool_0, (CHAR*)&bsd_thread_area[0], sizeof(bsd_thread_area), BSD_THREAD_PRIORITY); + + /* Check UDP enable and BSD init status. */ + if (status) + error_counter++; +} + +static void test_udp4_connect(void) +{ +int sockfd; +struct sockaddr_in remote_addr, local_addr; +int ret; +char buf[30]; + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + local_addr.sin_family = AF_INET; + local_addr.sin_port = htons(12345); + local_addr.sin_addr.s_addr = htonl(INADDR_ANY); + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin_family = AF_INET; + remote_addr.sin_port = htons(54321); + remote_addr.sin_addr.s_addr = htonl(ip1_address[1]); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + ret = recv(sockfd, buf, sizeof(buf), 0); + + if((ret != (int)strlen(requests_ipv4[1])) || (strncmp(buf, requests_ipv4[1], strlen(requests_ipv4[1])))) + error_counter++; + tx_thread_sleep(1); + ret = send(sockfd, response_ipv4[1], strlen(response_ipv4[1]), 0); + if(ret != (int)strlen(response_ipv4[1])) + error_counter++; + + + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} + +#ifdef FEATURE_NX_IPV6 +static void test_udp6_connect(void) +{ +int sockfd; +struct sockaddr_in6 remote_addr, local_addr; +int ret; +char buf[30]; + + sockfd = socket(AF_INET6, SOCK_DGRAM, 0); + if(sockfd < 0) + error_counter++; + + memset(&local_addr, 0, sizeof(local_addr)); + local_addr.sin6_family = AF_INET6; + local_addr.sin6_port = htons(12345); + + + + ret = bind(sockfd, (struct sockaddr*)&local_addr, sizeof(local_addr)); + if(ret < 0) + error_counter++; + + remote_addr.sin6_family = AF_INET6; + remote_addr.sin6_port = htons(54321); + remote_addr.sin6_addr._S6_un._S6_u32[0] = htonl(ipv6_address_ip1[1][1].nxd_ip_address.v6[0]); + remote_addr.sin6_addr._S6_un._S6_u32[1] = htonl(ipv6_address_ip1[1][1].nxd_ip_address.v6[1]); + remote_addr.sin6_addr._S6_un._S6_u32[2] = htonl(ipv6_address_ip1[1][1].nxd_ip_address.v6[2]); + remote_addr.sin6_addr._S6_un._S6_u32[3] = htonl(ipv6_address_ip1[1][1].nxd_ip_address.v6[3]); + + ret = connect(sockfd, (struct sockaddr*)&remote_addr, sizeof(remote_addr)); + if(ret < 0) + error_counter++; + + ret = recv(sockfd, buf, sizeof(buf), 0); + + if((ret != (INT)strlen(requests_ipv6[3])) || (strncmp(buf, requests_ipv6[3], strlen(requests_ipv6[3])))) + error_counter++; + + ret = send(sockfd, response_ipv6[3], strlen(response_ipv6[3]), 0); + if(ret != (INT)strlen(response_ipv6[3])) + error_counter++; + + /* Close downt he socket. */ + ret = soc_close(sockfd); + if(ret < 0) + error_counter++; +} +#endif +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#ifdef FEATURE_NX_IPV6 +static char mac_ip0[6]; +static char mac_ip1[6]; +UINT status; +int i,j; +#endif + + + printf("NetX Test: Basic BSD UDP Connect Test...................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + + for(i = 0; i < 3; i++) + { + mac_ip0[0] = (char)(ip_0.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip0[1] = ip_0.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip0[2] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip0[3] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip0[4] = (ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip0[5] = ip_0.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + mac_ip1[0] = (char)(ip_1.nx_ip_interface[i].nx_interface_physical_address_msw >> 8); + mac_ip1[1] = ip_1.nx_ip_interface[i].nx_interface_physical_address_msw & 0xFF; + mac_ip1[2] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 24) & 0xff; + mac_ip1[3] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 16) & 0xff; + mac_ip1[4] = (ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw >> 8) & 0xff; + mac_ip1[5] = ip_1.nx_ip_interface[i].nx_interface_physical_address_lsw & 0xff; + + for(j = 0; j < 3; j ++) + { + if(j == 0) + { + /* First set up IPv6 linklocal addresses. */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ((mac_ip0[0] | 0x2) << 24) | (mac_ip0[1] << 16) | (mac_ip0[2] << 8) | 0xFF; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = (0xFE << 24) | ((mac_ip0[3] | 0x2) << 16) | (mac_ip0[4] << 8) | mac_ip0[5]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = + ((mac_ip1[0] | 0x2) << 24) | (mac_ip1[1] << 16) | (mac_ip1[2] << 8) | 0xFF; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = + (0xFE << 24) | ((mac_ip1[3] | 0x2) << 16) | (mac_ip1[4] << 8) | mac_ip1[5]; + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 10, NX_NULL); + } + else + { + /* Global Adddress */ + ipv6_address_ip0[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip0[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip0[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip0[i][j].nxd_ip_address.v6[2] = ipv6_address_ip0[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip0[i][j].nxd_ip_address.v6[3] = ipv6_address_ip0[i][0].nxd_ip_address.v6[3]; + + ipv6_address_ip1[i][j].nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_ip1[i][j].nxd_ip_address.v6[0] = 0x20000000 + i; + ipv6_address_ip1[i][j].nxd_ip_address.v6[1] = j; + ipv6_address_ip1[i][j].nxd_ip_address.v6[2] = ipv6_address_ip1[i][0].nxd_ip_address.v6[2]; + ipv6_address_ip1[i][j].nxd_ip_address.v6[3] = ipv6_address_ip1[i][0].nxd_ip_address.v6[3]; + + + status = nxd_ipv6_address_set(&ip_0, i, &ipv6_address_ip0[i][j], 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, i, &ipv6_address_ip1[i][j], 64, NX_NULL); + } + status += nxd_nd_cache_entry_set(&ip_0, ipv6_address_ip1[i][j].nxd_ip_address.v6, 0, mac_ip1); + status += nxd_nd_cache_entry_set(&ip_1, ipv6_address_ip0[i][j].nxd_ip_address.v6, 0, mac_ip0); + } + + } + + + + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + + + if(status) + error_counter++; +#endif + + test_udp4_connect(); + tx_thread_sleep(3); + +#ifdef FEATURE_NX_IPV6 + + test_udp6_connect(); + + tx_thread_sleep(1); +#endif + + + validate_bsd_structure(); + + if(error_counter) + printf("ERROR!\n"); + else + printf("SUCCESS!\n"); + + if(error_counter) + test_control_return(1); + + test_control_return(0); +} + +static void udp_client_to_AF_INET_AF_INET6(int if_index, int addr_index, int test_case) +{ + +UINT status; +NX_PACKET *packet_ptr; +int i; +#ifdef FEATURE_NX_IPV6 +int j; +#endif + + /* Create a socket. */ + status = nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 10); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to a UDP port. */ + status = nx_udp_socket_bind(&server_socket, 54321, NX_WAIT_FOREVER); + if(status) + error_counter++; + + for(i = 2; i >= 0; i--) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests_ipv4[i], strlen(requests_ipv4[i])); + + packet_ptr -> nx_packet_length = strlen(requests_ipv4[i]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + + /* Send a UDP packet */ + status = nx_udp_socket_send(&server_socket, packet_ptr, ip0_address[i], 12345); + if(status) + error_counter++; + + status = nx_udp_socket_receive(&server_socket, &packet_ptr, 3); + if((test_case == 0) && (if_index == i)) + { + if(status != NX_SUCCESS) + { + error_counter++; + } + else + { + if((packet_ptr -> nx_packet_length != strlen(response_ipv4[1])) || + (strncmp(response_ipv4[1], (char*)packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length))) + error_counter++; + } + } + else if(status == NX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + for(j = 0; j < 2; j++) + { + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Fill in the packet with data */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, requests_ipv6[i * 3 + j], strlen(requests_ipv6[i * 3 + j])); + + packet_ptr -> nx_packet_length = strlen(requests_ipv6[i * 3 + j]); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + + /* Send a UDP packet */ + status = nxd_udp_socket_send(&server_socket, packet_ptr, &ipv6_address_ip0[i][j + 1], 12345); + if(status) + error_counter++; + + status = nx_udp_socket_receive(&server_socket, &packet_ptr, 1); + if((if_index == i) && (j == addr_index)) + { + if(status != NX_SUCCESS) + { + error_counter++; + } + else + { + if((packet_ptr -> nx_packet_length != strlen(response_ipv6[3])) || + (strncmp(response_ipv6[3], (char*)packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length))) + error_counter++; + } + } + + else if(status == NX_SUCCESS) + error_counter++; + + + } +#endif + + } + + status = nx_udp_socket_unbind(&server_socket); + if(status) + error_counter++; + + status = nx_udp_socket_delete(&server_socket); + if(status) + error_counter++; + + + +} + + +static void ntest_1_entry(ULONG thread_input) +{ +ULONG actual_status; +UINT status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(3); + } + + tx_thread_sleep(1); + + udp_client_to_AF_INET_AF_INET6(1, 30, 0); + + tx_thread_sleep(2); + +#ifdef FEATURE_NX_IPV6 + udp_client_to_AF_INET_AF_INET6(1, 0, 1); +#endif + + +} + +static void validate_bsd_structure(void) +{ +int i; + /* Make sure every BSD socket should be free by now. */ + + for(i = 0; i < NX_BSD_MAX_SOCKETS; i++) + { + if(nx_bsd_socket_array[i].nx_bsd_socket_status_flags & NX_BSD_SOCKET_IN_USE) + { + error_counter++; + } + + if(nx_bsd_socket_array[i].nx_bsd_socket_tcp_socket || + nx_bsd_socket_array[i].nx_bsd_socket_udp_socket) + { + error_counter++; + } + } + + /* Make sure all the NX SOCKET control blocks are released. */ + if(nx_bsd_socket_block_pool.tx_block_pool_available != + nx_bsd_socket_block_pool.tx_block_pool_total) + { + error_counter++; + } + + /* Make sure all the sockets are released */ + if(ip_0.nx_ip_tcp_created_sockets_ptr || + ip_0.nx_ip_udp_created_sockets_ptr) + { + error_counter++; + return; + } +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_bsd_udp_connect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Basic BSD UDP Connect Test....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/cloud_test/netx_cloud_api_test.c b/test/regression/cloud_test/netx_cloud_api_test.c new file mode 100644 index 00000000..f68b39f4 --- /dev/null +++ b/test/regression/cloud_test/netx_cloud_api_test.c @@ -0,0 +1,284 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) +#include "nx_cloud.h" + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD test_thread; +static NX_CLOUD cloud; +static UCHAR cloud_stack[2048]; +static NX_CLOUD_MODULE cloud_module; + +/* Define module event. */ +#define NX_CLOUD_MODULE_EVENT 0x10000000u + +/* Define module own events. */ +#define NX_CLOUD_MODULE_EVENT_1 0x00000001 +#define NX_CLOUD_MODULE_EVENT_2 0x00000002 +#define NX_CLOUD_MODULE_EVENT_3 0x00000004 +#define NX_CLOUD_MODULE_EVENT_4 0x00000008 + +static void test_entry(ULONG thread_input); +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "Test thread", test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +void test_entry(ULONG thread_input) +{ + +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: Cloud API Test............................................"); + + /* nx_cloud_create. */ + status = nx_cloud_create(NX_NULL, "Cloud", cloud_stack, 2048, 3); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_create(&cloud, "Cloud", NX_NULL, 2048, 3); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_create(&cloud, "Cloud", cloud_stack, 0, 3); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_create(&cloud, "Cloud", cloud_stack, 2048, TX_MAX_PRIORITIES); + + /* Check status. */ + if (status != NX_OPTION_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_create(&cloud, "Cloud", cloud_stack, 2048, 3); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* nx_cloud_module_register. */ + status = nx_cloud_module_register(NX_NULL, &cloud_module, "Module 1", (NX_CLOUD_COMMON_PERIODIC_EVENT | NX_CLOUD_MODULE_EVENT), cloud_module_event_process, (void *)(&cloud_module)); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_register(&cloud, NX_NULL, "Module 1", (NX_CLOUD_COMMON_PERIODIC_EVENT | NX_CLOUD_MODULE_EVENT), cloud_module_event_process, (void *)(&cloud_module)); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_register(&cloud, &cloud_module, "Module 1", 0, cloud_module_event_process, (void *)(&cloud_module)); + + /* Check status. */ + if (status != NX_CLOUD_MODULE_EVENT_INVALID) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_register(&cloud, &cloud_module, "Module 1", (NX_CLOUD_COMMON_PERIODIC_EVENT | NX_CLOUD_MODULE_EVENT), NX_NULL, (void *)(&cloud_module)); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_register(&cloud, &cloud_module, "Module 1", (NX_CLOUD_COMMON_PERIODIC_EVENT | NX_CLOUD_MODULE_EVENT), cloud_module_event_process, (void *)(&cloud_module)); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* nx_cloud_module_event_set. */ + status = nx_cloud_module_event_set(NX_NULL, NX_CLOUD_MODULE_EVENT_1); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_event_set(&cloud_module, 0); + + /* Check status. */ + if (status != NX_CLOUD_MODULE_EVENT_INVALID) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* nx_cloud_module_event_clear. */ + status = nx_cloud_module_event_clear(NX_NULL, NX_CLOUD_MODULE_EVENT_1); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_event_clear(&cloud_module, 0); + + /* Check status. */ + if (status != NX_CLOUD_MODULE_EVENT_INVALID) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_event_clear(&cloud_module, NX_CLOUD_MODULE_EVENT_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* nx_cloud_module_deregister. */ + status = nx_cloud_module_deregister(NX_NULL, &cloud_module); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_deregister(&cloud, NX_NULL); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_module_deregister(&cloud, &cloud_module); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* nx_cloud_delete. */ + status = nx_cloud_delete(NX_NULL); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_cloud_delete(&cloud); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events) +{ +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Cloud API Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/cloud_test/netx_cloud_basic_test.c b/test/regression/cloud_test/netx_cloud_basic_test.c new file mode 100644 index 00000000..a6fbd696 --- /dev/null +++ b/test/regression/cloud_test/netx_cloud_basic_test.c @@ -0,0 +1,291 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#ifdef __PRODUCT_NETXDUO__ +#include "nx_cloud.h" + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD test_thread; +static NX_CLOUD cloud; +static UCHAR cloud_stack[2048]; +static NX_CLOUD_MODULE cloud_module; +static ULONG cloud_common_periodic_event = 0; +static ULONG cloud_module_event_1 = 0; +static ULONG cloud_module_event_2 = 0; +static ULONG cloud_module_event_3 = 0; +static ULONG cloud_module_event_4 = 0; + +/* Define module event. */ +#define NX_CLOUD_MODULE_EVENT 0x10000000u + +/* Define module own events. */ +#define NX_CLOUD_MODULE_EVENT_1 0x00000001 +#define NX_CLOUD_MODULE_EVENT_2 0x00000002 +#define NX_CLOUD_MODULE_EVENT_3 0x00000004 +#define NX_CLOUD_MODULE_EVENT_4 0x00000008 + +static void test_entry(ULONG thread_input); +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "Test thread", test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +void test_entry(ULONG thread_input) +{ + +UINT status; +ULONG start_time; +ULONG periodic_count; + + + /* Print out test information banner. */ + printf("NetX Test: Cloud Basic Test.........................................."); + + /* Create cloud. */ + status = nx_cloud_create(&cloud, "Cloud", cloud_stack, 2048, 3); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module. */ + status = nx_cloud_module_register(&cloud, &cloud_module, "Module 1", (NX_CLOUD_COMMON_PERIODIC_EVENT | NX_CLOUD_MODULE_EVENT), cloud_module_event_process, (void *)(&cloud_module)); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the time. */ + start_time = tx_time_get(); + + /* Set module event 1. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 1) || (cloud_module_event_2 != 0) || (cloud_module_event_3 != 0) || (cloud_module_event_4 != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set module event 1 and 2. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_1|NX_CLOUD_MODULE_EVENT_2); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 2) || (cloud_module_event_2 != 1) || (cloud_module_event_3 != 0) || (cloud_module_event_4 != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set module event 1 and 2 and 3. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_1|NX_CLOUD_MODULE_EVENT_2|NX_CLOUD_MODULE_EVENT_3); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 3) || (cloud_module_event_2 != 2) || (cloud_module_event_3 != 1) || (cloud_module_event_4 != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set module event 1 and 2 and 3 and 4. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_1|NX_CLOUD_MODULE_EVENT_2|NX_CLOUD_MODULE_EVENT_3|NX_CLOUD_MODULE_EVENT_4); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 4) || (cloud_module_event_2 != 3) || (cloud_module_event_3 != 2) || (cloud_module_event_4 != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set module 2 and 3 and 4. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_2|NX_CLOUD_MODULE_EVENT_3|NX_CLOUD_MODULE_EVENT_4); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 4) || (cloud_module_event_2 != 4) || (cloud_module_event_3 != 3) || (cloud_module_event_4 != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set module 3 and 4. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_3|NX_CLOUD_MODULE_EVENT_4); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 4) || (cloud_module_event_2 != 4) || (cloud_module_event_3 != 4) || (cloud_module_event_4 != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set 4. */ + status = nx_cloud_module_event_set(&cloud_module, NX_CLOUD_MODULE_EVENT_4); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check events. */ + if ((cloud_module_event_1 != 4) || (cloud_module_event_2 != 4) || (cloud_module_event_3 != 4) || (cloud_module_event_4 != 4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for some periodic events. */ + tx_thread_sleep(500); + + /* Get periodic count. */ + periodic_count = (tx_time_get() - start_time) / NX_IP_PERIODIC_RATE; + + /* Check periodic events. */ + if (cloud_common_periodic_event != periodic_count) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete cloud. */ + status = nx_cloud_delete(&cloud); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events) +{ + + /* Process common_events. */ + if (common_events & NX_CLOUD_COMMON_PERIODIC_EVENT) + { + cloud_common_periodic_event++; + } + + /* Process module_own_events. */ + if (module_own_events & NX_CLOUD_MODULE_EVENT_1) + { + cloud_module_event_1++; + } + if (module_own_events & NX_CLOUD_MODULE_EVENT_2) + { + cloud_module_event_2++; + } + if (module_own_events & NX_CLOUD_MODULE_EVENT_3) + { + cloud_module_event_3++; + } + if (module_own_events & NX_CLOUD_MODULE_EVENT_4) + { + cloud_module_event_4++; + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Cloud Basic Test..........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/cloud_test/netx_cloud_module_event_test.c b/test/regression/cloud_test/netx_cloud_module_event_test.c new file mode 100644 index 00000000..4475b46d --- /dev/null +++ b/test/regression/cloud_test/netx_cloud_module_event_test.c @@ -0,0 +1,287 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#ifdef __PRODUCT_NETXDUO__ +#include "nx_cloud.h" + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD test_thread; +static NX_CLOUD cloud; +static UCHAR cloud_stack[2048]; + +typedef struct NX_CLOUD_APP_STRUCT +{ + +NX_CLOUD_MODULE nx_cloud_module; +ULONG nx_cloud_module_event_periodic; +ULONG nx_cloud_module_event_1; +ULONG nx_cloud_module_event_2; +ULONG nx_cloud_module_event_3; +ULONG nx_cloud_module_event_4; +} NX_CLOUD_APP; + +static NX_CLOUD_APP cloud_module[3]; + +typedef struct MODULE_EVENT_STRUCT +{ +ULONG nx_cloud_module_event_1; +ULONG nx_cloud_module_event_2; +ULONG nx_cloud_module_event_3; +ULONG nx_cloud_module_event_4; +} MODULE_EVENT; + +static MODULE_EVENT module_event[3]; + +/* Define module event. */ +#define NX_CLOUD_MODULE_1_EVENT 0x10000000u +#define NX_CLOUD_MODULE_2_EVENT 0x20000000u +#define NX_CLOUD_MODULE_3_EVENT 0x40000000u + +/* Define module own events. */ +#define NX_CLOUD_MODULE_EVENT_1 0x00000001 +#define NX_CLOUD_MODULE_EVENT_2 0x00000002 +#define NX_CLOUD_MODULE_EVENT_3 0x00000004 +#define NX_CLOUD_MODULE_EVENT_4 0x00000008 + +static void test_entry(ULONG thread_input); +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_module_event_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "Test thread", test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +void test_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +UINT j; +UINT module_id; +ULONG module_own_events; +ULONG start_time; +ULONG periodic_count; + + + /* Print out test information banner. */ + printf("NetX Test: Cloud Module Event Test..................................."); + + /* Create cloud. */ + status = nx_cloud_create(&cloud, "Cloud", cloud_stack, 2048, 3); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 1. */ + status = nx_cloud_module_register(&cloud, &cloud_module[0].nx_cloud_module, "Module 1", (NX_CLOUD_COMMON_PERIODIC_EVENT | NX_CLOUD_MODULE_1_EVENT), cloud_module_event_process, (void *)(&cloud_module[0])); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 2. */ + status = nx_cloud_module_register(&cloud, &cloud_module[1].nx_cloud_module, "Module 2", NX_CLOUD_MODULE_1_EVENT, cloud_module_event_process, (void *)(&cloud_module[1])); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 3. */ + status = nx_cloud_module_register(&cloud, &cloud_module[2].nx_cloud_module, "Module 3", (NX_CLOUD_COMMON_PERIODIC_EVENT|NX_CLOUD_MODULE_1_EVENT), cloud_module_event_process, (void *)(&cloud_module[2])); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the time. */ + start_time = tx_time_get(); + + /* Loop to set event. */ + for (i = 0; i < 100; i ++) + { + module_id = rand() % 3; + module_own_events = 0; + if(rand() % 2) + { + module_own_events |= NX_CLOUD_MODULE_EVENT_1; + module_event[module_id].nx_cloud_module_event_1 ++; + } + if(rand() % 2) + { + module_own_events |= NX_CLOUD_MODULE_EVENT_2; + module_event[module_id].nx_cloud_module_event_2 ++; + } + if(rand() % 2) + { + module_own_events |= NX_CLOUD_MODULE_EVENT_3; + module_event[module_id].nx_cloud_module_event_3 ++; + } + if(rand() % 2) + { + module_own_events |= NX_CLOUD_MODULE_EVENT_4; + module_event[module_id].nx_cloud_module_event_4 ++; + } + nx_cloud_module_event_set(&cloud_module[module_id].nx_cloud_module, module_own_events); + + /* Check modules event. */ + for (j = 0; j < 3; j++) + { + if ((cloud_module[j].nx_cloud_module_event_1 != module_event[j].nx_cloud_module_event_1) || + (cloud_module[j].nx_cloud_module_event_2 != module_event[j].nx_cloud_module_event_2) || + (cloud_module[j].nx_cloud_module_event_3 != module_event[j].nx_cloud_module_event_3) || + (cloud_module[j].nx_cloud_module_event_4 != module_event[j].nx_cloud_module_event_4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + tx_thread_sleep(10); + } + + /* Get periodic count. */ + periodic_count = (tx_time_get() - start_time) / NX_IP_PERIODIC_RATE; + + /* Check periodic events. */ + if ((cloud_module[0].nx_cloud_module_event_periodic != periodic_count) || + (cloud_module[1].nx_cloud_module_event_periodic != 0) || + (cloud_module[2].nx_cloud_module_event_periodic != periodic_count)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test module event clear. */ + nx_cloud_module_event_clear(&cloud_module[0].nx_cloud_module, NX_CLOUD_MODULE_EVENT_1); + if (cloud_module[0].nx_cloud_module_event_1 != module_event[0].nx_cloud_module_event_1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 3. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module[2].nx_cloud_module); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 2. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module[1].nx_cloud_module); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 1. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module[0].nx_cloud_module); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete cloud. */ + status = nx_cloud_delete(&cloud); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events) +{ + +NX_CLOUD_APP *cloud_app = (NX_CLOUD_APP*) module_ptr; + + /* Process common_events. */ + if (common_events & NX_CLOUD_COMMON_PERIODIC_EVENT) + { + cloud_app -> nx_cloud_module_event_periodic++; + } + + /* Process module_own_events. */ + if (module_own_events & NX_CLOUD_MODULE_EVENT_1) + { + cloud_app -> nx_cloud_module_event_1++; + } + if (module_own_events & NX_CLOUD_MODULE_EVENT_2) + { + cloud_app -> nx_cloud_module_event_2++; + } + if (module_own_events & NX_CLOUD_MODULE_EVENT_3) + { + cloud_app -> nx_cloud_module_event_3++; + } + if (module_own_events & NX_CLOUD_MODULE_EVENT_4) + { + cloud_app -> nx_cloud_module_event_4++; + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_module_event_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Cloud Module Event Test...................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/cloud_test/netx_cloud_module_register_deregister_test.c b/test/regression/cloud_test/netx_cloud_module_register_deregister_test.c new file mode 100644 index 00000000..74e5fd4e --- /dev/null +++ b/test/regression/cloud_test/netx_cloud_module_register_deregister_test.c @@ -0,0 +1,227 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#ifdef __PRODUCT_NETXDUO__ +#include "nx_cloud.h" + +#define DEMO_STACK_SIZE 4096 + +static TX_THREAD test_thread; +static NX_CLOUD cloud; +static UCHAR cloud_stack[2048]; +static NX_CLOUD_MODULE cloud_module_1; +static NX_CLOUD_MODULE cloud_module_2; +static NX_CLOUD_MODULE cloud_module_3; +static NX_CLOUD_MODULE cloud_module_4; +static NX_CLOUD_MODULE cloud_module_5; + +/* Define module event. */ +#define NX_CLOUD_MODULE_1_EVENT 0x10000000u +#define NX_CLOUD_MODULE_2_EVENT 0x20000000u +#define NX_CLOUD_MODULE_3_EVENT 0x40000000u +#define NX_CLOUD_MODULE_4_EVENT 0x80000000u +#define NX_CLOUD_MODULE_5_EVENT 0x01000000u + +static void test_entry(ULONG thread_input); +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_module_register_deregister_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "Test thread", test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +void test_entry(ULONG thread_input) +{ + +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: Cloud Module Register And Deregister Test................."); + + /* Create cloud. */ + status = nx_cloud_create(&cloud, "Cloud", cloud_stack, 2048, 3); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 1. */ + status = nx_cloud_module_register(&cloud, &cloud_module_1, "Module 1", NX_CLOUD_MODULE_1_EVENT, cloud_module_event_process, (void *)(&cloud_module_1)); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 1 again. */ + status = nx_cloud_module_register(&cloud, &cloud_module_1, "Module 1", NX_CLOUD_MODULE_1_EVENT, cloud_module_event_process, (void *)(&cloud_module_1)); + + /* Check status. */ + if ((status != NX_CLOUD_MODULE_ALREADY_REGISTERED) || (cloud.nx_cloud_modules_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 2. */ + status = nx_cloud_module_register(&cloud, &cloud_module_2, "Module 2", NX_CLOUD_MODULE_2_EVENT, cloud_module_event_process, (void *)(&cloud_module_2)); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 3. */ + status = nx_cloud_module_register(&cloud, &cloud_module_3, "Module 3", NX_CLOUD_MODULE_3_EVENT, cloud_module_event_process, (void *)(&cloud_module_4)); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 4. */ + status = nx_cloud_module_register(&cloud, &cloud_module_4, "Module 4", NX_CLOUD_MODULE_4_EVENT, cloud_module_event_process, (void *)(&cloud_module_4)); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 5. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module_5); + + /* Check status. */ + if ((status != NX_CLOUD_MODULE_NOT_REGISTERED) || (cloud.nx_cloud_modules_count != 4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 2. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module_2); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register cloud module 2 again. */ + status = nx_cloud_module_register(&cloud, &cloud_module_2, "Module 2", NX_CLOUD_MODULE_1_EVENT, cloud_module_event_process, (void *)(&cloud_module_2)); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 1. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module_1); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 4. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module_4); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 3. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module_3); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deregister cloud module 2. */ + status = nx_cloud_module_deregister(&cloud, &cloud_module_2); + + /* Check status. */ + if ((status) || (cloud.nx_cloud_modules_count != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete cloud. */ + status = nx_cloud_delete(&cloud); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void cloud_module_event_process(VOID *module_ptr, ULONG common_events, ULONG module_own_events) +{ +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_cloud_module_register_deregister_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Cloud Module Register And Deregister Test.................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/dhcp_test/netx_dhcp_03_01_01_test.c b/test/regression/dhcp_test/netx_dhcp_03_01_01_test.c new file mode 100644 index 00000000..9f43d26e --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_01_01_test.c @@ -0,0 +1,380 @@ +/* The client broadcasts a DHCPREQUEST message that MUST include the "server identifier" option to indicate which server it has selected. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_offer_flag; +static UINT server_id_flag; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_01_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_01_01 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (server_id_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_offer_flag = 0; + server_id_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; +ULONG server_identifier; +ULONG message_type; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + + /* Make sure in selecting state and dhcpoffer has been received. */ + if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_SELECTING) && (dhcp_offer_flag != 0)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + + /* Get the server identifier type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_OPTION_DHCP_SERVER, + &server_identifier, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if server identifier equal the server ip address. */ + if(server_identifier == (NX_DHCP_SERVER_IP_ADDRESS_0)) + server_id_flag = 1; + else + error_counter++; + + advanced_packet_process_callback = NX_NULL; + } + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPOFFER) + { + dhcp_offer_flag++; + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_01_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_01_01 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_03_01_02_test.c b/test/regression/dhcp_test/netx_dhcp_03_01_02_test.c new file mode 100644 index 00000000..df3a819b --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_01_02_test.c @@ -0,0 +1,335 @@ +/* The 'request IP address' option MUST be set to the value of 'yiaddr' in the DHCPOFFER message from the server. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT flag; +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_01_02_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_01_02 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3* NX_IP_PERIODIC_RATE); + + if((error_counter) || (flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + + /* set the udp packet receive function to mine. */ + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + +} + + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +ULONG yiaddr; +ULONG request_ip_addr; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPOFFER) + { + + /* Get the "request ip address" option value. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_IP_REQ, + &request_ip_addr, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Get yiaddr field value. */ + yiaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 8 + NX_BOOTP_OFFSET_YOUR_IP), 4); + + /* Check wether they are equal. */ + if(request_ip_addr != yiaddr) + error_counter++; + else + flag = 1; + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_01_02_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_01_02 Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_03_01_03_test.c b/test/regression/dhcp_test/netx_dhcp_03_01_03_test.c new file mode 100644 index 00000000..06d32685 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_01_03_test.c @@ -0,0 +1,404 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_offer_flag; +static UINT flag; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_01_03_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_01_03 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_offer_flag = 0; + flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +static ULONG dhcp_discover_bcd_addr; +static ULONG dhcp_discover_secs; +ULONG dhcp_request_bcd_addr; +ULONG dhcp_request_secs; +UINT status; +ULONG message_type; + +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header; +#else +NX_IP_HEADER *ip_header; +#endif +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + if(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_INIT) + { +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; +#endif + /* Get the destination ip address. */ + dhcp_discover_bcd_addr = ip_header -> nx_ip_header_destination_ip; + + /* Get secs field value. */ + dhcp_discover_secs = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_SECS), 2); + } + + /* Make sure in selecting state and dhcpoffer has been received. */ + else if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_SELECTING) && (dhcp_offer_flag != 0)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; +#endif + /* Get the destination ip address. */ + dhcp_request_bcd_addr = ip_header -> nx_ip_header_destination_ip; + + /* Get secs field value. */ + dhcp_request_secs = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_SECS), 2); + + /* Check if the secs and broadcast address are the same as the original DHCPDISCOVER message. */ + if((dhcp_request_bcd_addr == dhcp_discover_bcd_addr) && (dhcp_request_secs == dhcp_discover_secs)) + flag = 1; + else + error_counter++; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPOFFER) + { + dhcp_offer_flag++; + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_01_03_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_01_03 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_03_02_01_test.c b/test/regression/dhcp_test/netx_dhcp_03_02_01_test.c new file mode 100644 index 00000000..e81209b4 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_02_01_test.c @@ -0,0 +1,388 @@ +/* As the client has not received its network address, it MUST NOT fill in the 'ciaddr' field. And servers with knowledge of + * the client's configuration parameters respond with a DHCPACK message to the client. + * rfc 2131, page 18, 3.2 Client-server interaction - resuing a previously allocated network address + * + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define CLIENT_IP_ADDRESS IP_ADDRESS(10,0,0,10) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_ack_flag; +static UINT flag; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_02_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_02_01 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (flag == 0) || (dhcp_ack_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG requested_ip; +UINT skip_discover_message = NX_TRUE; + + dhcp_ack_flag = 0; + flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Set the client IP if the host is configured to do so. */ + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; +ULONG client_ip; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + + /* Get ciaddr value. */ + client_ip = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_IP), 4); + + /* Check if the 'coaddr' field is filled. */ + if(client_ip != 0) + error_counter++; + else + flag = 1; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPACK) + { + dhcp_ack_flag++; + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_02_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_02_01 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_03_02_02_test.c b/test/regression/dhcp_test/netx_dhcp_03_02_02_test.c new file mode 100644 index 00000000..68bbb84d --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_02_02_test.c @@ -0,0 +1,395 @@ +/* If the client's request is invalid, servers SHOULD respond with a DHCPNAK message to the client. + * If 'giaddr' is 0x00 in the DHCPREQUEST message, the server MUST broacast the DHCPNAK message to the 0xffffffff broadcast address + * + * rfc 2131, page 19, 3.2 Client-server interaction - resuing a previously allocated network address + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_ip.h" +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define CLIENT_IP_ADDRESS IP_ADDRESS(100,0,0,10) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_nak_flag; +static UINT dhcp_request_count; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_02_02_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_02_02 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_nak_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG requested_ip; +UINT skip_discover_message = NX_TRUE; + + dhcp_nak_flag = 0; + dhcp_request_count = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Set the client IP if the host is configured to do so. */ + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + + + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; +ULONG gateway_ip; +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header; +#else +NX_IP_HEADER *ip_header; +#endif +ULONG dst_addr; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + dhcp_request_count++; + + /* Get secs giaddr value. */ + gateway_ip = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_GATEWAY_IP), 4); + + if(gateway_ip != 0) + error_counter++; + + } + } + /* sent from server to client. */ + else if((src_dst_port == 0x00430044) && (dhcp_request_count == 1)) + { + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPNACK. */ + if(message_type == NX_DHCP_TYPE_DHCPNACK) + { + dhcp_nak_flag++; + +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; +#endif + /* Get the destination ip address. */ + dst_addr = ip_header -> nx_ip_header_destination_ip; + + if(dst_addr != 0xffffffff) + error_counter++; + } + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + + return NX_TRUE; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_02_02_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_02_02 Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_03_02_03_test.c b/test/regression/dhcp_test/netx_dhcp_03_02_03_test.c new file mode 100644 index 00000000..100f8f84 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_02_03_test.c @@ -0,0 +1,380 @@ +/* If the client's request is invalid, servers SHOULD respond with a DHCPNAK message to the client. + * rfc 2131, page 18, 3.1 Client-server interaction - allocating a network address + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define CLIENT_IP_ADDRESS IP_ADDRESS(100,0,0,10) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_nak_flag; +static UINT dhcp_request_count; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_02_03_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_02_03 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_nak_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG requested_ip; +UINT skip_discover_message = NX_TRUE; + + dhcp_nak_flag = 0; + dhcp_request_count = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Set the client IP if the host is configured to do so. */ + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + dhcp_request_count++; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; + + if(dhcp_request_count == 1) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPNAK. */ + if(message_type == NX_DHCP_TYPE_DHCPNACK) + { + dhcp_nak_flag++; + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_02_03_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_02_03 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_03_04_01_test.c b/test/regression/dhcp_test/netx_dhcp_03_04_01_test.c new file mode 100644 index 00000000..9fde4650 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_04_01_test.c @@ -0,0 +1,367 @@ +/* The servers SHOULD unicast the DHCPACK reply to the address given in the 'ciaddr' filed of the DHCPINFORM message. + * rfc 2131, page 20, 3.4 Obtaining parameters with externally configured network address + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_ip.h" +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define CLIENT_IP_ADDRESS IP_ADDRESS(10,0,0,11) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_ack_flag; +static UINT dhcp_inform_count; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_04_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", CLIENT_IP_ADDRESS, 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_04_01 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_ack_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_ack_flag = 0; + dhcp_inform_count = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if(status) + error_counter++; + + status = nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); + if(status) + error_counter++; + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; + +static ULONG inform_ciaddr; +ULONG ack_dst_addr; + +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header; +#else +NX_IP_HEADER *ip_header; +#endif + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPINFORM) + { + dhcp_inform_count++; + + /* Get ciaddr field value. */ + inform_ciaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_IP), 4); + + } + } + /* Sent from server to client. */ + else if((src_dst_port == 0x00430044) && (dhcp_inform_count == 1)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPNAK. */ + if(message_type == NX_DHCP_TYPE_DHCPACK) + { + dhcp_ack_flag++; + +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; +#endif + /* Get the destination ip address. */ + ack_dst_addr = ip_header -> nx_ip_header_destination_ip; + + NX_CHANGE_ULONG_ENDIAN(ack_dst_addr); + + /* Check if Server unicast the DHCPACK to the address given in the 'ciaddr' field of the DHCPINFORM message. */ + if(ack_dst_addr != inform_ciaddr) + error_counter++; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + + } + + return NX_TRUE; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_04_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_04_01 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_03_05_01_test.c b/test/regression/dhcp_test/netx_dhcp_03_05_01_test.c new file mode 100644 index 00000000..18abd865 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_03_05_01_test.c @@ -0,0 +1,349 @@ +/* If the client includes a list fo parameters in a DHCPDISCOVER message, it MUST include that list in any subsequent DHCPREQUEST messsages. + * rfc 2131, page 21, 3.5 Client parameters in DHCP + * + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#include "nx_ipv4.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_offer_flag; +static UINT dhcp_request_flag; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_05_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 03_05_01 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_request_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_offer_flag = 0; + dhcp_request_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +static ULONG discover_parameters; +ULONG request_parameters; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { + dhcp_offer_flag++; + + /* Get the dhcp parameters. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_OPTION_DHCP_PARAMETERS, + &discover_parameters, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + } + else if((message_type == NX_DHCP_TYPE_DHCPREQUEST) && (dhcp_offer_flag == 1)) + { + dhcp_request_flag++; + + /* Get the dhcp parameters. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_OPTION_DHCP_PARAMETERS, + &request_parameters, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + if(discover_parameters != request_parameters) + error_counter++; + + /* Restore the udp packet receiving function. */ + server_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_03_05_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 03_05_01 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_04_01_01_test.c b/test/regression/dhcp_test/netx_dhcp_04_01_01_test.c new file mode 100644 index 00000000..ec0ac539 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_01_01_test.c @@ -0,0 +1,353 @@ +/* A client that can't receive unicast IP datagrams until its protocol software has been configured with an IP address SHOULD set the BROADCAST + * bit in the 'flags' field to 1 in any DHCPDISCOVER or DHCPREQUEST messages that client sends. + * rfc 2131, page 25, 4.1 Constructing and sending DHCP messages + * + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT discover_flag; +static UINT request_flag; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_01_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_01_01 Test........................................"); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* set the udp packet receive function to mine. */ + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (discover_flag == 0) || (request_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + discover_flag = 0; + request_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + +} + + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +ULONG bcd_flag; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { + /* Get flags field value. */ + bcd_flag = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 8 + NX_BOOTP_OFFSET_FLAGS), 2); + + /* Check wether BROADCAST bit is set to 1. */ + if((bcd_flag& 0x8000) != 0x8000) + error_counter++; + else + discover_flag = 1; + + } + /* Check if the message is a DHCPREQUEST. */ + else if((message_type == NX_DHCP_TYPE_DHCPREQUEST) && (discover_flag == 1)) + { + /* Get flags field value. */ + bcd_flag = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 8 + NX_BOOTP_OFFSET_FLAGS), 2); + + /* Check wether BROADCAST bit is set to 1. */ + if((bcd_flag& 0x8000) != 0x8000) + error_counter++; + else + request_flag = 1; + + /* Restore the udp packet receiving function. */ + server_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_01_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_01_01 Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_04_03_02_01_test.c b/test/regression/dhcp_test/netx_dhcp_04_03_02_01_test.c new file mode 100644 index 00000000..ebadb095 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_03_02_01_test.c @@ -0,0 +1,392 @@ +/* ciaddr' MUST be zero, 'requested IP address' MUST be filled in with the yiaddr value from the chosen DHCPOFFER + * rfc 2131, page 31, 4.3.2 DHCPREQUEST message + * + */ +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_offer_flag; +static UINT dhcp_request_flag; + +static ULONG yiaddr; +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_02_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_03_02_01 Test....................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_request_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_offer_flag = 0; + dhcp_request_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; +ULONG ciaddr; +ULONG requested_ip_addr; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + /* Make sure in selecting state and dhcpoffer has been received. */ + if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_SELECTING) && (dhcp_offer_flag != 0)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + + dhcp_request_flag++; + + /* Get ciaddr field value. */ + ciaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_IP), 4); + + /* ciaddr should be zero. */ + if(ciaddr != 0) + error_counter++; + + /* Get the requested ip address. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_OPTION_DHCP_IP_REQ, + &requested_ip_addr, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + if(requested_ip_addr != yiaddr) + error_counter++; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPOFFER) + { + dhcp_offer_flag++; + + /* Get yiaddr field value. */ + yiaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 8 + NX_BOOTP_OFFSET_YOUR_IP), 4); + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_02_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_03_02_01 Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_04_03_02_02_test.c b/test/regression/dhcp_test/netx_dhcp_04_03_02_02_test.c new file mode 100644 index 00000000..52b81450 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_03_02_02_test.c @@ -0,0 +1,603 @@ +/* DHCPREQUEST generated during RENEWING state: 'server identifier' MUST NOT be filled in, 'requested IP address' option MUST NOT + * be filled in, 'ciaddr' MUST be filled in with client's IP address. + * rfc 2131, page 32, 4.3.2 DHCPREQUEST message + * + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nx_ip.h" +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_request_flag; + +static ULONG ip_src_addr, ip_dest_addr; +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_02_02_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_03_02_02 Test....................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + /* Sleep 10s. */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_request_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_request_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Sleep 10s */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +ULONG src_dst_port; +ULONG ciaddr; +ULONG requested_ip_addr; +ULONG server_identifier; +NX_UDP_HEADER *udp_header_ptr; +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header; +#else +NX_IP_HEADER *ip_header; +#endif + + udp_header_ptr = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + if(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_INIT) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; +#endif + /* Get the sourceand destination ip address. */ + ip_dest_addr = ip_header -> nx_ip_header_destination_ip; + ip_src_addr = ip_header -> nx_ip_header_source_ip; + + NX_CHANGE_ULONG_ENDIAN(ip_dest_addr); + NX_CHANGE_ULONG_ENDIAN(ip_src_addr); + } + + } + + /* Make sure in renewing state. */ + else if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_RENEWING)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + + dhcp_request_flag++; + + /* Get the server id. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_OPTION_DHCP_SERVER, + &server_identifier, (packet_ptr -> nx_packet_length - 20 - 8)); + + /* According to RFC, at this point, the 'server identifier' option MUST NOT be filled. */ + if((status != NX_OPTION_ERROR) || + ((status == NX_SUCCESS) && (server_identifier != 0))) + error_counter++; + + + /* Get the requested ip address. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_OPTION_DHCP_IP_REQ, + &requested_ip_addr, (packet_ptr -> nx_packet_length - 20 - 8)); + + /* According to RFC, at this point, the 'requested ip address' option MUST NOT be filled. */ + if((status != NX_OPTION_ERROR) || + ((status == NX_SUCCESS) && (requested_ip_addr != 0))) + error_counter++; + + /* Get ciaddr field value. */ + ciaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_IP), 4); + + /* According to RFC, at this point , the ciaddr MUST be the client's ip address. */ + if(ciaddr != client_ip.nx_ip_address) + error_counter++; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header_ptr; +ULONG *requested_lease_time; +ULONG checksum; +#if !defined(__PRODUCT_NETXDUO__) +ULONG temp; +ULONG length; +UCHAR *word_ptr; +ULONG packet_length; +ULONG adjusted_packet_length; +NX_PACKET *current_packet; +UCHAR *pad_ptr; +#endif + + udp_header_ptr = (NX_UDP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPDISCOVER. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { + /* change the requested lease time. Because NETX DHCP Client doesn't have an API to set requested lease time.*/ + /* change the lease time to 5s, so that we can get the RENEWING state early. */ + requested_lease_time = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 253); + *requested_lease_time = 0x05000000; +#ifdef __PRODUCT_NETXDUO__ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* compute the checksum. */ + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + &ip_src_addr, + &ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); +#else + + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* First calculate the checksum of the pseudo UDP header that includes the source IP + address, destination IP address, protocol word, and the UDP length. */ + temp = ip_src_addr;; + checksum = (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + checksum += (ip_dest_addr >> NX_SHIFT_BY_16); + checksum += (ip_dest_addr & NX_LOWER_16_MASK); + checksum += (NX_IP_UDP >> NX_SHIFT_BY_16); + checksum += packet_ptr -> nx_packet_length; + + /* Setup the length of the packet checksum. */ + length = packet_ptr -> nx_packet_length; + + /* Initialize the current packet to the input packet pointer. */ + current_packet = packet_ptr; + + /* Loop to calculate the packet's checksum. */ + while (length) + { + /* Calculate the current packet length. */ + packet_length = current_packet -> nx_packet_append_ptr - current_packet -> nx_packet_prepend_ptr; + + /* Make the adjusted packet length evenly divisible by sizeof(ULONG). */ + adjusted_packet_length = ((packet_length + (sizeof(ULONG) - 1))/sizeof(ULONG))*sizeof(ULONG); + + /* Determine if we need to add padding bytes. */ + if (packet_length < adjusted_packet_length) + { + + /* Calculate how many bytes we need to zero at the end of the packet. */ + temp = adjusted_packet_length - packet_length; + + /* Setup temporary pointer to the current packet's append pointer. */ + pad_ptr = current_packet -> nx_packet_append_ptr; + + /* Loop to pad current packet with 0s so we don't have to worry about a partial last word. */ + while(temp) + { + + /* Check for the end of the packet. */ + if (pad_ptr >= current_packet -> nx_packet_data_end) + break; + + /* Write a 0. */ + *pad_ptr++ = 0; + + /* Decrease the pad count. */ + temp--; + } + } + + + /* Setup the pointer to the start of the packet. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + + /* Now loop through the current packet to compute the checksum on this packet. */ + while (adjusted_packet_length) + { + + /* Pickup a whole ULONG. */ + temp = *((ULONG *) word_ptr); + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the long word in the message. */ + NX_CHANGE_ULONG_ENDIAN(temp); + + /* Add upper 16-bits into checksum. */ + checksum = checksum + (temp >> NX_SHIFT_BY_16); + + /* Add lower 16-bits into checksum. */ + checksum = checksum + (temp & NX_LOWER_16_MASK); + + /* Move the word pointer and decrease the length. */ + word_ptr = word_ptr + sizeof(ULONG); + adjusted_packet_length = adjusted_packet_length - sizeof(ULONG); + } + + /* Adjust the checksum length. */ + length = length - packet_length; + + /* Determine if we are at the end of the current packet. */ + if ((length) && (word_ptr >= (UCHAR *) current_packet -> nx_packet_append_ptr) && + (current_packet -> nx_packet_next)) + { + + /* We have crossed the packet boundary. Move to the next packet + structure. */ + current_packet = current_packet -> nx_packet_next; + + /* Setup the new word pointer. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + } + } + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Place the packet in the second word of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | + (~checksum & NX_LOWER_16_MASK); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); +#endif + /* Restore the udp packet receiving function. */ + server_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_02_02_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_03_02_02 Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_04_03_02_03_test.c b/test/regression/dhcp_test/netx_dhcp_04_03_02_03_test.c new file mode 100644 index 00000000..74738aa7 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_03_02_03_test.c @@ -0,0 +1,640 @@ +/* DHCPREQUEST generated during REBINDING state: 'server identifier' MUST NOT be filled in, 'requested IP address' option MUST NOT + * be filled in, 'ciaddr' MUST be filled in with client's IP address. + * rfc 2131, page 32, 4.3.2 DHCPREQUEST message + * + */ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nx_ip.h" +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_ip.h" +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "nx_ram_network_driver_test_1500.h" +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_request_flag; +static UINT dhcp_renew_flag; + +static ULONG ip_src_addr, ip_dest_addr; +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_02_03_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_03_02_03 Test....................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + /* Sleep 20s. */ + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_request_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_request_flag = 0; + dhcp_renew_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Sleep 20s */ + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +ULONG src_dst_port; +ULONG ciaddr; +ULONG requested_ip_addr; +ULONG server_identifier; +NX_UDP_HEADER *udp_header_ptr; +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header; +#else +NX_IP_HEADER *ip_header; +#endif + + udp_header_ptr = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + if(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_INIT) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; +#endif + /* Get the sourceand destination ip address. */ + ip_dest_addr = ip_header -> nx_ip_header_destination_ip; + ip_src_addr = ip_header -> nx_ip_header_source_ip; + } + + } + /* Rebinding state. */ + else if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_RENEWING)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + dhcp_renew_flag = 1; + } + + } + /* rebing state. */ + else if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_REBINDING)) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + + dhcp_request_flag++; + + /* Get the server id. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_OPTION_DHCP_SERVER, + &server_identifier, (packet_ptr -> nx_packet_length - 20 - 8)); + + /* According to RFC, at this point, the 'server identifier' option MUST NOT be filled. */ + if((status != NX_OPTION_ERROR) || + ((status == NX_SUCCESS) && (server_identifier != 0))) + error_counter++; + + + /* Get the requested ip address. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_OPTION_DHCP_IP_REQ, + &requested_ip_addr, (packet_ptr -> nx_packet_length - 20 - 8)); + + /* According to RFC, at this point, the 'requested ip address' option MUST NOT be filled. */ + if((status != NX_OPTION_ERROR) || + ((status == NX_SUCCESS) && (requested_ip_addr != 0))) + error_counter++; + + /* Get ciaddr field value. */ + ciaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_IP), 4); + + /* According to RFC, at this point , the ciaddr MUST be the client's ip address. */ + if(ciaddr != client_ip.nx_ip_address) + error_counter++; + + /* restore the callback to NULL. */ + advanced_packet_process_callback = NX_NULL; + } + } + } + /* server to client. */ + else if(src_dst_port == 0x00430044) + { + /* Make sure this is a ACK respond to the REQUEST sent at renewing state. */ + if(dhcp_renew_flag == 1) + { + /* drop the DHCPACK to let client go to rebing state. */ + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPACK) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header_ptr; +ULONG *requested_lease_time; +ULONG checksum; +#if !defined(__PRODUCT_NETXDUO__) +ULONG temp; +ULONG length; +UCHAR *word_ptr; +ULONG packet_length; +ULONG adjusted_packet_length; +NX_PACKET *current_packet; +UCHAR *pad_ptr; +#endif + + udp_header_ptr = (NX_UDP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { + /* change the requested lease time. Because NETX DHCP Client doesn't have an API to set requested lease time.*/ + /* change the lease time to 5s, so that we can get the RENEWING state early. */ + requested_lease_time = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 253); + *requested_lease_time = 0x05000000; + +#ifdef __PRODUCT_NETXDUO__ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* compute the checksum. */ + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + &ip_src_addr, + &ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + +#else + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* First calculate the checksum of the pseudo UDP header that includes the source IP + address, destination IP address, protocol word, and the UDP length. */ + temp = ip_src_addr; + checksum = (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + checksum += (ip_dest_addr >> NX_SHIFT_BY_16); + checksum += (ip_dest_addr & NX_LOWER_16_MASK); + checksum += (NX_IP_UDP >> NX_SHIFT_BY_16); + checksum += packet_ptr -> nx_packet_length; + + /* Setup the length of the packet checksum. */ + length = packet_ptr -> nx_packet_length; + + /* Initialize the current packet to the input packet pointer. */ + current_packet = packet_ptr; + + /* Loop to calculate the packet's checksum. */ + while (length) + { + /* Calculate the current packet length. */ + packet_length = current_packet -> nx_packet_append_ptr - current_packet -> nx_packet_prepend_ptr; + + /* Make the adjusted packet length evenly divisible by sizeof(ULONG). */ + adjusted_packet_length = ((packet_length + (sizeof(ULONG) - 1))/sizeof(ULONG))*sizeof(ULONG); + + /* Determine if we need to add padding bytes. */ + if (packet_length < adjusted_packet_length) + { + + /* Calculate how many bytes we need to zero at the end of the packet. */ + temp = adjusted_packet_length - packet_length; + + /* Setup temporary pointer to the current packet's append pointer. */ + pad_ptr = current_packet -> nx_packet_append_ptr; + + /* Loop to pad current packet with 0s so we don't have to worry about a partial last word. */ + while(temp) + { + + /* Check for the end of the packet. */ + if (pad_ptr >= current_packet -> nx_packet_data_end) + break; + + /* Write a 0. */ + *pad_ptr++ = 0; + + /* Decrease the pad count. */ + temp--; + } + } + + + /* Setup the pointer to the start of the packet. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + + /* Now loop through the current packet to compute the checksum on this packet. */ + while (adjusted_packet_length) + { + + /* Pickup a whole ULONG. */ + temp = *((ULONG *) word_ptr); + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the long word in the message. */ + NX_CHANGE_ULONG_ENDIAN(temp); + + /* Add upper 16-bits into checksum. */ + checksum = checksum + (temp >> NX_SHIFT_BY_16); + + /* Add lower 16-bits into checksum. */ + checksum = checksum + (temp & NX_LOWER_16_MASK); + + /* Move the word pointer and decrease the length. */ + word_ptr = word_ptr + sizeof(ULONG); + adjusted_packet_length = adjusted_packet_length - sizeof(ULONG); + } + + /* Adjust the checksum length. */ + length = length - packet_length; + + /* Determine if we are at the end of the current packet. */ + if ((length) && (word_ptr >= (UCHAR *) current_packet -> nx_packet_append_ptr) && + (current_packet -> nx_packet_next)) + { + + /* We have crossed the packet boundary. Move to the next packet + structure. */ + current_packet = current_packet -> nx_packet_next; + + /* Setup the new word pointer. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + } + } + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Place the packet in the second word of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | + (~checksum & NX_LOWER_16_MASK); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); +#endif + /* Restore the udp packet receiving function. */ + server_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_02_03_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_03_02_03 Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_04_03_05_01_test.c b/test/regression/dhcp_test/netx_dhcp_04_03_05_01_test.c new file mode 100644 index 00000000..fce440a6 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_03_05_01_test.c @@ -0,0 +1,383 @@ +/* The server responds to a DHCPINFORM message by sending a DHCPACK + * message directly to the address given in the 'ciaddr' field of the + * DHCPINFORM message. The server MUST NOT send a lease expiration time + to the client and SHOULD NOT fill in 'yiaddr'. + * rfc 2131, page 33, 4.3.5 DHCPINFORM message + * + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_ack_flag; +static UINT dhcp_inform_count; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_05_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_03_05_01 Test....................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_inform_count != 1) || (dhcp_ack_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_ack_flag = 0; + dhcp_inform_count = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if(status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if(status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *)&status, 10 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Send DHCP Information message. */ + status = nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); + if(status) + error_counter++; + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; + + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPINFORM) + { + dhcp_inform_count = 1; + + } + } + return NX_TRUE; + +} +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +ULONG lease_time; +ULONG yiaddr; + + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPACK and INFORM has be sent. */ + if((message_type == NX_DHCP_TYPE_DHCPACK) && (dhcp_inform_count == 1)) + { + + dhcp_ack_flag = 1; + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + + /* Get the dhcp lease time. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_OPTION_DHCP_LEASE, + &lease_time, (packet_ptr -> nx_packet_length - 8)); + if((status != NX_OPTION_ERROR) || + ((status == NX_SUCCESS) && (lease_time != 0))) + error_counter++; + + /* Get yiaddr field value. */ + yiaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_YOUR_IP), 4); + if(yiaddr != 0) + error_counter++; + + /* Restore the udp packet receiving function. */ + client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_03_05_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_03_05_01 Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_04_04_01_01_test.c b/test/regression/dhcp_test/netx_dhcp_04_04_01_01_test.c new file mode 100644 index 00000000..caa75594 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_04_01_01_test.c @@ -0,0 +1,350 @@ +/* The client MUST include its hardware address in the 'chaddr' field + * rfc 2131, page 36, 4.4.1 Initialization and allocation of network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#include "nx_ipv4.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +extern ULONG simulated_address_msw; +extern ULONG simulated_address_lsw; + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_discover_flag; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_04_01_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 2); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_04_01_01 Test....................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (dhcp_discover_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_discover_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + /* wait a bit. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header; +ULONG src_dst_port; +ULONG client_hd_addr_msw; +ULONG client_hd_addr_lsw; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ + if(src_dst_port == 0x00440043) + { + if(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_INIT) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPDISCOVER) + { + + dhcp_discover_flag = 1; + + /* Get chaddr field value. */ + client_hd_addr_msw = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_HW), 2); + client_hd_addr_lsw = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_HW + 2), 4); + + if((client_hd_addr_msw != simulated_address_msw) || (client_hd_addr_lsw != simulated_address_lsw)) + error_counter++; + } + } + } + + return NX_TRUE; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_04_01_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_04_01_01 Test................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_04_04_01_02_test.c b/test/regression/dhcp_test/netx_dhcp_04_04_01_02_test.c new file mode 100644 index 00000000..fbe0b264 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_04_04_01_02_test.c @@ -0,0 +1,540 @@ +/* If the 'xid' of an arriving DHCPOFFER message does not match the 'xid' of the most recent DHCPDISCOVER message, + * the DHCPOFFER message must be silently discarded. + * rfc 2131, page 36, 4.4.1 Initialization and allocation of network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nx_ip.h" +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_ip.h" +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT dhcp_offer_flag; +static UINT dhcp_request_flag; + +static ULONG ip_src_addr, ip_dest_addr; +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_04_01_02_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP 04_04_01_02 Test....................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + error_counter++; + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + error_counter++; + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + error_counter++; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + error_counter++; + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* After 5s, check the flags for error xid. */ + if((error_counter) || (dhcp_request_flag != 0) || (dhcp_offer_flag == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + dhcp_offer_flag = 0; + dhcp_request_flag = 0; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + advanced_packet_process_callback = my_packet_process; + client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Wait for DHCP to assign the IP address. */ + do + { + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); + + } while (status != NX_SUCCESS); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +ULONG src_dst_port; +ULONG message_type; +NX_UDP_HEADER *udp_header; + + udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + src_dst_port = udp_header -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + /* client port 68(0x44), server port 67(0x43). packet sent from client to server*/ + if(src_dst_port == 0x00440043) + { + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPREQUEST. */ + if(message_type == NX_DHCP_TYPE_DHCPREQUEST) + { + + /* Update the counter. */ + dhcp_request_flag++; + } + } + + return NX_TRUE; + +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG *xid; +ULONG message_type; +ULONG checksum; +NX_UDP_HEADER *udp_header_ptr; +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header; +#else +NX_IP_HEADER *ip_header; +#endif +#if !defined(__PRODUCT_NETXDUO__) +ULONG temp; +ULONG length; +UCHAR *word_ptr; +ULONG packet_length; +ULONG adjusted_packet_length; +NX_PACKET *current_packet; +UCHAR *pad_ptr; +#endif + + udp_header_ptr = (NX_UDP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get the dhcp message type. */ + status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, + &message_type, (packet_ptr -> nx_packet_length - 8)); + if(status) + error_counter++; + + /* Check if the message is a DHCPOFFER. */ + if(message_type == NX_DHCP_TYPE_DHCPOFFER) + { + dhcp_offer_flag++; + +#ifdef __PRODUCT_NETXDUO__ + ip_header = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr - 20); +#else + ip_header = (NX_IP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr - 20); +#endif + + /* Get the source and destination ip address. */ + ip_dest_addr = ip_header->nx_ip_header_destination_ip; + ip_src_addr = ip_header->nx_ip_header_source_ip; + + /* Change the xid. */ + xid = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 12); + *xid = 0; + +#ifdef __PRODUCT_NETXDUO__ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* compute the checksum. */ + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + &ip_src_addr, + &ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + +#else + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* First calculate the checksum of the pseudo UDP header that includes the source IP + address, destination IP address, protocol word, and the UDP length. */ + temp = ip_src_addr; + checksum = (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + checksum += (ip_dest_addr >> NX_SHIFT_BY_16); + checksum += (ip_dest_addr & NX_LOWER_16_MASK); + checksum += (NX_IP_UDP >> NX_SHIFT_BY_16); + checksum += packet_ptr -> nx_packet_length; + + /* Setup the length of the packet checksum. */ + length = packet_ptr -> nx_packet_length; + + /* Initialize the current packet to the input packet pointer. */ + current_packet = packet_ptr; + + /* Loop to calculate the packet's checksum. */ + while (length) + { + /* Calculate the current packet length. */ + packet_length = current_packet -> nx_packet_append_ptr - current_packet -> nx_packet_prepend_ptr; + + /* Make the adjusted packet length evenly divisible by sizeof(ULONG). */ + adjusted_packet_length = ((packet_length + (sizeof(ULONG) - 1))/sizeof(ULONG))*sizeof(ULONG); + + /* Determine if we need to add padding bytes. */ + if (packet_length < adjusted_packet_length) + { + + /* Calculate how many bytes we need to zero at the end of the packet. */ + temp = adjusted_packet_length - packet_length; + + /* Setup temporary pointer to the current packet's append pointer. */ + pad_ptr = current_packet -> nx_packet_append_ptr; + + /* Loop to pad current packet with 0s so we don't have to worry about a partial last word. */ + while(temp) + { + + /* Check for the end of the packet. */ + if (pad_ptr >= current_packet -> nx_packet_data_end) + break; + + /* Write a 0. */ + *pad_ptr++ = 0; + + /* Decrease the pad count. */ + temp--; + } + } + + + /* Setup the pointer to the start of the packet. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + + /* Now loop through the current packet to compute the checksum on this packet. */ + while (adjusted_packet_length) + { + + /* Pickup a whole ULONG. */ + temp = *((ULONG *) word_ptr); + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the long word in the message. */ + NX_CHANGE_ULONG_ENDIAN(temp); + + /* Add upper 16-bits into checksum. */ + checksum = checksum + (temp >> NX_SHIFT_BY_16); + + /* Add lower 16-bits into checksum. */ + checksum = checksum + (temp & NX_LOWER_16_MASK); + + /* Move the word pointer and decrease the length. */ + word_ptr = word_ptr + sizeof(ULONG); + adjusted_packet_length = adjusted_packet_length - sizeof(ULONG); + } + + /* Adjust the checksum length. */ + length = length - packet_length; + + /* Determine if we are at the end of the current packet. */ + if ((length) && (word_ptr >= (UCHAR *) current_packet -> nx_packet_append_ptr) && + (current_packet -> nx_packet_next)) + { + + /* We have crossed the packet boundary. Move to the next packet + structure. */ + current_packet = current_packet -> nx_packet_next; + + /* Setup the new word pointer. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + } + } + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Place the packet in the second word of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | + (~checksum & NX_LOWER_16_MASK); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); +#endif + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_04_04_01_02_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP 04_04_01_02 Test................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_basic_restore_test.c b/test/regression/dhcp_test/netx_dhcp_basic_restore_test.c new file mode 100644 index 00000000..39449b28 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_basic_restore_test.c @@ -0,0 +1,409 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_DHCP_CLIENT_RESTORE_STATE) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_basic_restore_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Basic Restore Test..................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; +NX_DHCP_CLIENT_RECORD client_record; +ULONG gateway_address = 0; +ULONG restore_gateway_address = 0xff; + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + +#ifdef __PRODUCT_NETXDUO__ + /* Store the gateway address. */ + status = nx_ip_gateway_address_get(&client_ip, &gateway_address); + if (status) + error_counter++; +#endif + + /* Get the record for restoring. */ + status = nx_dhcp_client_get_record(&dhcp_client, &client_record); + if (status) + error_counter++; + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + +#ifdef __PRODUCT_NETXDUO__ + /* Check if gateway address is cleared. */ + status = nx_ip_gateway_address_get(&client_ip, &restore_gateway_address); + if (!status) + error_counter++; +#endif + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + + /* Resotr the client record. */ + status = nx_dhcp_client_restore_record(&dhcp_client, &client_record, 600); + if (status) + error_counter++; + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + +#ifdef __PRODUCT_NETXDUO__ + /* Check if the gateway address is retored. */ + status = nx_ip_gateway_address_get(&client_ip, &restore_gateway_address); + if (status || gateway_address != restore_gateway_address) + error_counter++; +#endif + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_basic_restore_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Basic Restore Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_basic_test.c b/test/regression/dhcp_test/netx_dhcp_basic_test.c new file mode 100644 index 00000000..211ea524 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_basic_test.c @@ -0,0 +1,407 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Basic Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Basic Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_activate_interfaces_test.c b/test/regression/dhcp_test/netx_dhcp_client_activate_interfaces_test.c new file mode 100644 index 00000000..e6318731 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_activate_interfaces_test.c @@ -0,0 +1,871 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_RECORDS >= 2. + There are two DHCP Client threads that independently activate the DHCP Client on + the primary or secondary interface. When they reach the bound state, each interface Client + deactivates the DHCP Client process and the DHCP Client goes back to the NOT STARTED state. + + There is one server thread handling DHCP Client messages on both interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +static ULONG dhcp_xid = 0; + + +/* Define the ThreadX, NetX object control blocks... */ + +static UINT state_changes = 0; +static NX_UDP_SOCKET server_socket; +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; +static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ + + +static char offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response0_size = 300; + +static char offer_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +static char ack_response1[300] = { + +//0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_activate_interfaces_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server_ip, "Server Second interface", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + if (status) + error_counter++; + + + /* Set up the Client. */ + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 7*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 7*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, " Client IP ", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client Second interface", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT actual_status; + + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Activate Interfaces Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Clear the unicast flag on all interfaces. */ + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + + /* Set the client IP if the host is configured to do so. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_interface_state_change1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ + status = nx_dhcp_interface_start(&dhcp_client, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable DHCP feature on the second interface. */ + status = nx_dhcp_interface_enable(&dhcp_client, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start DHCP feature on the second interface. */ + status = nx_dhcp_interface_start(&dhcp_client, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for address resolution for first interface. */ + status = nx_ip_interface_status_check(&client_ip, 0, NX_IP_ADDRESS_RESOLVED, (ULONG *)&actual_status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the record state. */ + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for address resolution for second interface. */ + status = nx_ip_interface_status_check(&client_ip, 1, NX_IP_ADDRESS_RESOLVED, (ULONG *)&actual_status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the record state. */ + if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now stop the DHCP Client 0. */ + status = nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify the DHCP CLient is not enabled on the primary interface. */ + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now stop the DHCP Client 0. */ + status = nx_dhcp_interface_disable(&dhcp_client, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify the DHCP CLient is not enabled on the primary interface. */ + if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check error_counter. */ + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the Primary DHCP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k, pkt_number; + + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + i = 0; + j = 0; + k = 0; + pkt_number = 0; + + /* Wait for Client requests */ + while (i < (2 * NUM_RESPONSES)) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + UINT source_port; + ULONG source_ip_address; + UINT protocol; + UINT iface_index; + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + + nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + /* Release the packet. */ + nx_packet_release(my_packet); + + if (iface_index == 0) + { + pkt_number = j; + + } + else + { + pkt_number = k; + + } + + status = nx_dhcp_response_packet_send(&server_socket, 68, pkt_number, iface_index); + + if (iface_index == 0) + j++; + else + k++; + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); +} + +static void dhcp_test_initialize() +{ + + + /* Set up server responses on the primary interface. */ + dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; + dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; + + dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; + dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; + + /* Set up server responses on the secondary interface. */ + dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; + +} + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ + +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + if (iface_index == 0) + { + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, + dhcp_response0[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; + } + else if (iface_index == 1) + { + + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, + dhcp_response1[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; + } + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); +#else + response_packet_ptr_ptr = &response_packet; + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + + /* Check the status. */ + if (status) + { + + error_counter++; + + nx_packet_release(response_packet); + } + + return status; +} + +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + state_changes++;; + return; +} + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR *work_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +NX_PACKET *packet_copy; + + + /* Is this a DHCP packet e.g. not an ARP packet? */ + if (packet_ptr -> nx_packet_length < 200) + { + /* Maybe an ARP packet. let the RAM driver deal with it */ + return NX_TRUE; + } + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334459) + { + interface_index = 1; + } + else + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the packet mac address, set the packet interface based on the mac address */ + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + if (ip_ptr == &server_ip) + { + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_ip_packet_receive(&server_ip, packet_copy); + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + +ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_activate_interfaces_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Activate Interfaces Test......................N/A!\n"); + test_control_return(3); +} +#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) */ + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c b/test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c new file mode 100644 index 00000000..d2b83540 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c @@ -0,0 +1,1033 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_INTERFACES >= 2. + There are two DHCP Client threads that are switching from manual to DHCP CLient address + mode, and switch from activated to deactivated. There is one server thread checking + for DHCP Client messages on primary and secondary interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#include "nx_arp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#if (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + + + +/* Define the ThreadX, NetX object control blocks... */ + +static NX_UDP_SOCKET server_socket; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; + +static UINT probe0 = NX_FALSE; +static UINT probe1 = NX_FALSE; +static UINT bound0 = NX_FALSE; +static UINT bound1 = NX_FALSE; +static UINT decline0 = NX_FALSE; +static UINT decline1 = NX_FALSE; + +/* Define the NetX DHCP object control block. */ +static NX_DHCP dhcp_client; +static ULONG dhcp_xid; + + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; +static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); +static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); +static UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address); + + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ + + +static char offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response0_size = 300; + +static char offer_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +static char ack_response1[300] = { + + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_arp_probe_fail_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server_ip, "Server secondary IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + if (status) + error_counter++; + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 12*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client secondary IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp"); + + if (status) + error_counter++; + + /* Keep track of interface DHCP Client state changes. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); + + if (status) + error_counter++; + + return; +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT time_keeper; + + + tx_thread_sleep(10); + + status = nx_dhcp_interface_enable(&dhcp_client, 1); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start DHCP on all enabled interfaces. */ + status = nx_dhcp_start(&dhcp_client); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ + time_keeper = 0; + + while((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) && + (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND)) + { + tx_thread_sleep(100); + time_keeper += 100; + if (time_keeper > 1000) + { + break; + } + } + + if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE) || (decline0 == NX_TRUE)) + { + error_counter++; + } + + /* Now stop the DHCP Client 0. */ + nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Verify the DHCP CLient is not enabled on the primary interface. */ + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) + { + error_counter++; + } + + /* Wait a bit for DHCP Client internally to decline the IP address. */ + tx_thread_sleep(30); + + if ((probe1 != NX_TRUE) || (decline1 != NX_TRUE) || (bound1 == NX_TRUE)) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) + { + error_counter++; + } + + client_running = NX_FALSE; + +} + + +/* Define the DHCP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k, pkt_number; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test......"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + i = 0; + j = 0; + k = 0; + pkt_number = 0; + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Wait for Client requests */ + while ( i < (2*NUM_RESPONSES)) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + UINT source_port; + ULONG source_ip_address; + UINT protocol; + UINT iface_index; + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + /* Release the packet. */ + nx_packet_release(my_packet); + + if (iface_index == 0) + { + pkt_number = j; + + } + else + { + pkt_number = k; + + } + + status = nx_dhcp_response_packet_send(&server_socket, 68, pkt_number, iface_index); + + if (iface_index == 0) + j++; + else + k++; + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Set up a scenario to respond to Client ARP Probes on interface 1 */ + while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_ADDRESS_PROBING) + tx_thread_sleep(20); + + /* While the DHCP Client is in probe mode, send a conflict response. */ + status = send_arp_reply(&server_ip, 1, dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_ip_address); + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Wait for the client to terminate the connection. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + +static void dhcp_test_initialize() +{ + + + /* Set up server responses on the primary interface. */ + dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; + dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; + + dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; + dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; + + /* Set up server responses on the secondary interface. */ + dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; + +} + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ + +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + if (iface_index == 0) + { + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, + dhcp_response0[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; + } + else if (iface_index == 1) + { + + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, + dhcp_response1[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; + } + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); +#else + response_packet_ptr_ptr = &response_packet; + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + + /* Check the status. */ + if (status) + { + + error_counter++; + + nx_packet_release(response_packet); + } + + return status; +} + + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + +UCHAR *work_ptr; +ULONG *message_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +ULONG sender_physical_lsw; +NX_PACKET *packet_copy; + + + /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet + prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ + if (packet_ptr -> nx_packet_length < 200) + { + + message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (sender_physical_lsw == 0x22334458) + { + interface_index = 0; + } + else if (sender_physical_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ + { + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the packet mac address, set the packet interface based on the mac address */ + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + if (packet_ptr -> nx_packet_length > 200) + { + + if (ip_ptr == &server_ip) + { + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_ip_packet_receive(&server_ip, packet_copy); + } + } + else + { + + if (ip_ptr == &server_ip) + { + _nx_arp_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_arp_packet_receive(&server_ip, packet_copy); + } + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + + +ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + + if (iface_index == 0) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_INIT) + { + /* Check if the Client has been reset to to INIT + after reaching the ARP probe state. This should not happen. */ + if (probe0 == NX_TRUE) + { + error_counter++; + } + } + } + else if (iface_index == 1) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe1 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound1 = NX_TRUE; + + /* This should not happen. */ + error_counter++; + } + else if (new_state == NX_DHCP_STATE_INIT) + { + /* Check if the Client has been reset to to INIT + after reaching the ARP probe state. */ + if (probe1 == NX_TRUE) + { + decline1 = NX_TRUE; + } + } + } + else + error_counter++; + + return; +} + + +UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG *message_ptr; +NX_IP_DRIVER driver_request; +NX_INTERFACE *nx_interface; +ULONG lsw, msw; + + + /* Allocate a packet to build the ARP message in. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &packet_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); + if (status != NX_SUCCESS) + { + + /* Error getting packet, so just get out! */ + return status; + } + + /* Stamp the packet with the outgoing interface information, which is the server primary interface. */ + nx_interface = &(ip_ptr -> nx_ip_interface[iface_index]); + + /* Store the probe address on the Client. */ + client_ip.nx_ip_interface[iface_index].nx_interface_ip_probe_address = probe_address;; + //nx_interface -> nx_interface_ip_probe_address = probe_address; + + packet_ptr -> nx_packet_ip_interface = nx_interface; + + /* Build the ARP request packet. */ + + /* Setup the size of the ARP message. */ + packet_ptr -> nx_packet_length = NX_ARP_MESSAGE_SIZE; + + /* Setup the append pointer to the end of the message. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ARP_MESSAGE_SIZE; + + /* Setup the pointer to the message area. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Write the Hardware type into the message. */ + *message_ptr = (ULONG)(NX_ARP_HARDWARE_TYPE << 16) | (NX_ARP_PROTOCOL_TYPE); + *(message_ptr + 1) = (ULONG)(NX_ARP_HARDWARE_SIZE << 24) | (NX_ARP_PROTOCOL_SIZE << 16) | + NX_ARP_OPTION_REQUEST; + + /* Sender mac address. Note this is a phone MAC address from 'another' host on the network. */ + msw = 0x000c; + lsw = 0xf17dcaa6; + + *(message_ptr+2) = (ULONG) (msw << 16) |(lsw >> 16); + /* Rest of sender mac address,upper bytes of sender address */ + *(message_ptr + 3) = (ULONG)((lsw << 16) | (probe_address >> 16)); + + /* Target mac address */ + msw = 0x11; + lsw = 0x22334458; + + *(message_ptr+4) = (probe_address /* sender IP address */ << 16) | (msw & NX_LOWER_16_MASK); + *(message_ptr+5) = lsw; + + /* Target address */ + *(message_ptr+6) = (ULONG) 0x0; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Send the ARP request to the driver. */ + driver_request.nx_ip_driver_ptr = ip_ptr; + driver_request.nx_ip_driver_command = NX_LINK_ARP_SEND; + driver_request.nx_ip_driver_packet = packet_ptr; + driver_request.nx_ip_driver_physical_address_msw = 0xFFFFUL; + driver_request.nx_ip_driver_physical_address_lsw = 0xFFFFFFFFUL; + driver_request.nx_ip_driver_interface = nx_interface; + (nx_interface -> nx_interface_link_driver_entry) (&driver_request); + + return NX_SUCCESS; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_arp_probe_fail_multiple_interface_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test........N/A\n"); + test_control_return(3); +} +#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) */ + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c new file mode 100644 index 00000000..1d9e1917 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c @@ -0,0 +1,1077 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Required: NX_MAX_PHYSICAL_INTERFACES = 2 and NX_DHCP_CLIENT_MAX_INTERFACES = 1. + There are two DHCP Client threads that are switching from manual to DHCP CLient address + mode, and switch from activated to deactivated. There is one server thread checking + for DHCP Client messages on primary and secondary interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT); +#ifndef NX_DISABLE_IPV4 +#include "nx_arp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + + + +/* Define the ThreadX, NetX object control blocks... */ + +static NX_UDP_SOCKET server0_socket; +static TX_THREAD client0_thread; +static TX_THREAD client1_thread; +static TX_THREAD server0_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server0_ip; + +static UINT probe0 = NX_FALSE; +static UINT probe1 = NX_FALSE; +static UINT bound0 = NX_FALSE; +static UINT bound1 = NX_FALSE; +static UINT decline0 = NX_FALSE; +static UINT decline1 = NX_FALSE; + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; +static ULONG dhcp_xid; + + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; +static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client0_running = NX_TRUE; +static UINT client1_running = NX_TRUE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +static void server0_thread_entry(ULONG thread_input); +static void client0_thread_entry(ULONG thread_input); +static void client1_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); +static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); +static UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address); + + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ + + +static char offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response0_size = 300; + +static char offer_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +static char ack_response1[300] = { + + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_arpprobe_fail_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server0_thread, "Server 0 thread ", server0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server0_ip, + "Server 0 IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server0_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server0_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server0_ip); + + if (status) + error_counter++; + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client0_thread, "Client 0", client0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the secondary client thread. */ + status = tx_thread_create(&client1_thread, "Client 1", client1_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 12*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + + if (status) + error_counter++; + + /* Keep track of interface DHCP Client state changes. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); + + if (status) + error_counter++; + + return; +} + + +/* Define the DHCP client thread. */ + +void client0_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT time_keeper; + + + tx_thread_sleep(10); + + /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ + status = nx_dhcp_interface_start(&dhcp_client, 0); + if (status != NX_SUCCESS) + { + error_counter++; + } + + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ + time_keeper = 0; + + while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(10); + time_keeper += 10; + if (time_keeper > 1000) + { + break; + } + } + + if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE) || (decline0 == NX_TRUE)) + { + error_counter++; + } + + /* Now stop the DHCP Client 0. */ + nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Verify the DHCP CLient is not enabled on the primary interface. */ + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) + { + error_counter++; + } + client0_running = NX_FALSE; + +} + +void client1_thread_entry(ULONG thread_input) +{ + +UINT status; + + + tx_thread_sleep(10); + + if (NX_DHCP_CLIENT_MAX_RECORDS != 2) + { + error_counter++; + } + + status = nx_dhcp_interface_enable(&dhcp_client, 1); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + status = nx_dhcp_interface_start(&dhcp_client, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + UINT time_keeper = 0; + while(probe1 == NX_FALSE) + { + tx_thread_sleep(20); + time_keeper += 20; + if (time_keeper > 1000) + { + break; + } + } + + /* Wait a bit for DHCP Clien to decline the IP address. */ + tx_thread_sleep(50); + + if ((probe1 != NX_TRUE) || (decline1 != NX_TRUE) || (bound1 == NX_TRUE)) + { + error_counter++; + } + + } + + if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) + { + error_counter++; + } + + client1_running = NX_FALSE; + +} + +/* Define the Primary DHCP server thread. */ +void server0_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k, pkt_number; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test........"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server0_ip, &server0_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server0_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + i = 0; + j = 0; + k = 0; + pkt_number = 0; + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Wait for Client requests */ + while ( i < (2*NUM_RESPONSES)) + { + + status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + UINT source_port; + ULONG source_ip_address; + UINT protocol; + UINT iface_index; + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + /* Release the packet. */ + nx_packet_release(my_packet); + + if (iface_index == 0) + { + pkt_number = j; + + } + else + { + pkt_number = k; + + } + + status = nx_dhcp_response_packet_send(&server0_socket, 68, pkt_number, iface_index); + + if (iface_index == 0) + j++; + else + k++; + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Set up a scenario to respond to Client ARP Probes on interface 1 */ + while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_ADDRESS_PROBING) + tx_thread_sleep(20); + + /* While the DHCP Client is in probe mode, send a conflict response. */ + status = send_arp_reply(&server0_ip, 1, dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_ip_address); + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Wait for the client to terminate the connection. */ + while((client0_running == NX_TRUE) || (client1_running == NX_TRUE)) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server0_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + +static void dhcp_test_initialize() +{ + + + /* Set up server responses on the primary interface. */ + dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; + dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; + + dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; + dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; + + /* Set up server responses on the secondary interface. */ + dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; + +} + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ + +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + if (iface_index == 0) + { + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, + dhcp_response0[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; + } + else if (iface_index == 1) + { + + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, + dhcp_response1[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; + } + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); +#else + response_packet_ptr_ptr = &response_packet; + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + + /* Check the status. */ + if (status) + { + + error_counter++; + + nx_packet_release(response_packet); + } + + return status; +} + + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + +UCHAR *work_ptr; +ULONG *message_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +ULONG sender_physical_lsw; +NX_PACKET *packet_copy; + + + /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet + prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ + if (packet_ptr -> nx_packet_length < 200) + { + + message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (sender_physical_lsw == 0x22334458) + { + interface_index = 0; + } + else if (sender_physical_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ + { + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the packet mac address, set the packet interface based on the mac address */ + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + if (packet_ptr -> nx_packet_length > 200) + { + + if (ip_ptr == &server0_ip) + { + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_ip_packet_receive(&server0_ip, packet_copy); + } + } + else + { + + if (ip_ptr == &server0_ip) + { + _nx_arp_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_arp_packet_receive(&server0_ip, packet_copy); + } + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + + +ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + + if (iface_index == 0) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_INIT) + { + /* Check if the Client has been reset to to INIT + after reaching the ARP probe state. This should not happen. */ + if (probe0 == NX_TRUE) + { + error_counter++; + } + } + } + else if (iface_index == 1) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe1 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound1 = NX_TRUE; + + /* This should not happen. */ + error_counter++; + } + else if (new_state == NX_DHCP_STATE_INIT) + { + /* Check if the Client has been reset to to INIT + after reaching the ARP probe state. */ + if (probe1 == NX_TRUE) + { + decline1 = NX_TRUE; + } + } + } + else + error_counter++; + + return; +} + + +UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG *message_ptr; +NX_IP_DRIVER driver_request; +NX_INTERFACE *nx_interface; +ULONG lsw, msw; + + + /* Allocate a packet to build the ARP message in. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &packet_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); + if (status != NX_SUCCESS) + { + + /* Error getting packet, so just get out! */ + return status; + } + + /* Stamp the packet with the outgoing interface information, which is the server primary interface. */ + nx_interface = &(ip_ptr -> nx_ip_interface[iface_index]); + + /* Store the probe address on the Client. */ + client_ip.nx_ip_interface[iface_index].nx_interface_ip_probe_address = probe_address;; + //nx_interface -> nx_interface_ip_probe_address = probe_address; + + packet_ptr -> nx_packet_ip_interface = nx_interface; + + /* Build the ARP request packet. */ + + /* Setup the size of the ARP message. */ + packet_ptr -> nx_packet_length = NX_ARP_MESSAGE_SIZE; + + /* Setup the append pointer to the end of the message. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ARP_MESSAGE_SIZE; + + /* Setup the pointer to the message area. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Write the Hardware type into the message. */ + *message_ptr = (ULONG)(NX_ARP_HARDWARE_TYPE << 16) | (NX_ARP_PROTOCOL_TYPE); + *(message_ptr + 1) = (ULONG)(NX_ARP_HARDWARE_SIZE << 24) | (NX_ARP_PROTOCOL_SIZE << 16) | + NX_ARP_OPTION_REQUEST; + + /* Sender mac address. Note this is a phone MAC address from 'another' host on the network. */ + msw = 0x000c; + lsw = 0xf17dcaa6; + + *(message_ptr+2) = (ULONG) (msw << 16) |(lsw >> 16); + /* Rest of sender mac address,upper bytes of sender address */ + *(message_ptr + 3) = (ULONG)((lsw << 16) | (probe_address >> 16)); + + /* Target mac address */ + msw = 0x11; + lsw = 0x22334458; + + *(message_ptr+4) = (probe_address /* sender IP address */ << 16) | (msw & NX_LOWER_16_MASK); + *(message_ptr+5) = lsw; + + /* Target address */ + *(message_ptr+6) = (ULONG) 0x0; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Send the ARP request to the driver. */ + driver_request.nx_ip_driver_ptr = ip_ptr; + driver_request.nx_ip_driver_command = NX_LINK_ARP_SEND; + driver_request.nx_ip_driver_packet = packet_ptr; + driver_request.nx_ip_driver_physical_address_msw = 0xFFFFUL; + driver_request.nx_ip_driver_physical_address_lsw = 0xFFFFFFFFUL; + driver_request.nx_ip_driver_interface = nx_interface; + (nx_interface -> nx_interface_link_driver_entry) (&driver_request); + + return NX_SUCCESS; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_arpprobe_fail_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test..........N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c new file mode 100644 index 00000000..8ab50348 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c @@ -0,0 +1,702 @@ +/* Testing the multiple interface DHCP Client */ + +/* Test with NX_DHCP_CLIENT_SEND_ARP_PROBE enabled on the DHCP Client. Only using + one interface at present. To get this to work with a RAM driver, the 'DHCP server' + assigns its own address to the DHCP Client. When the Client sends the ARP probe + the server will automatically respond. On receiving this ARP message, the Client + IP stores it in its table. On the next expiration between sending probes, the Client + checks the ARP table, finds this entry and declares the IP address is not unique. + It sends a DECLINE message and start again in the INIT state. */ + + // jlc to do + // need to add a way to confirm DECLINE is sent e.g. add declines_recvd to the struct? + // need a way to 'stop' the client test. Right now it spins endlessly. + // test on NetX DUo 5.11 with the new ARP send probe/handle conflict logic + + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +/* Define the ThreadX, NetX object control blocks... */ + +NX_UDP_SOCKET server_socket; +TX_THREAD client_thread; +TX_THREAD server_thread; +NX_PACKET_POOL client_pool; +NX_PACKET_POOL server_pool; +NX_IP client_ip; +NX_IP server_ip; + + +/* Define the NetX FTP object control block. */ +NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 3 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_FALSE; +static UINT state_changes[2] = {0,0}; +static UINT renews[2] = {0,0}; +static UINT rebinds[2] = {0,0}; +static UINT bounds[2] = {0,0}; + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +void server_thread_entry(ULONG thread_input); +void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number); +static void dhcp_test_initialize(); +static UINT send_arp_reply(NX_DHCP *dhcp_ptr, UINT iface_index); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); +static void dhcp_interface_state_change0(NX_DHCP *dhcp_ptr, UCHAR new_state); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +static char offer_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* {.....T. */ +0x58, 0xAD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* ........ 192.2.2.1*/ +//0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ '192.2.2.247*/ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +static char ack_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* {.....T. */ +0x58, 0xAD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* ........ */ +//0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + +// this isn't used but just leave it here. +static char arp_response[60] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x57, // dest +0x00, 0x0c, 0xf1, 0x7d, 0xca, 0xa6, // source +0x08, 0x06, +0x00, 0x01, +0x08, 0x00, +0x06, 0x04, 0x00, 0x02, +0x00, 0x0c, 0xf1, 0x7d, 0xca, 0xa6, // source mac - who cares, someone else +0xc0, 0x02, 0x02, 0xF7, // source IP - node who owns IP address already +0x00, 0x11, 0x22, 0x33, 0x44, 0x57, // target mac - dhcp client mac +0x00, 0x00, 0x00, 0x0, // target IP - should be zeroes? +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .\...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +static int arp_response_size = 60; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_cilent_arpprobe_fails_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + + + /* Let the server set up. */ + tx_thread_sleep(30); + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + tx_thread_sleep(20); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + status = nx_dhcp_interface_state_change_notify(&dhcp_client, 0, dhcp_interface_state_change0); + if (status) + error_counter++; + status = nx_dhcp_interface_state_change_notify(&dhcp_client, 1, dhcp_interface_state_change1); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + while(client_running == NX_FALSE) + { + tx_thread_sleep(100); + } + + // jlc add status_interface check on IP address + // then wait for ****; + // if declines != 1; error + // if state != INIT/SELECTING error + +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test1............\n"); // jlc remove the \n + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES) + { + + if (i <= 1) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + else + { + printf("\nRECVd %dth packet\n", i); + + /* Release the packet. */ + nx_packet_release(my_packet); + + printf("Server sending response back. \n"); + status = nx_dhcp_response_packet_send(&server_socket, 68, i); + } + } + else + { + + /* Wait for the dhcp client to start the ARP probe process. */ + while (dhcp_client.nx_dhcp_interface[0].nx_dhcp_probe_count == 0) + tx_thread_sleep(10); + printf("Owner should send the Probe reply\n"); + } + + /* Check status. */ + if (status) + { + + printf("ERROR8!\n"); + error_counter++; + } + + + /* Advance the index for the next response. */ + i++; + } + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + + + printf("All done, waiting for client to go away\n"); + + /* Wait for the client to terminate the connection. */ + while(client_running != NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void dhcp_test_initialize() +{ + + +/* Download data responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; + + dhcp_response[2].dhcp_response_pkt_data = &arp_response[0]; + dhcp_response[2].dhcp_response_pkt_size = arp_response_size ; + +} + + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + printf("Sending %dth response\n", packet_number); + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nx_udp_socket_send(server_socket, response_packet, 0xFFFFFFFF, 68); + + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +UINT send_arp_reply(NX_DHCP *dhcp_ptr, UINT iface_index) +{ + +UINT status; +NX_PACKET *request_ptr; +ULONG *message_ptr; +NX_IP_DRIVER driver_request; +NX_IP *ip_ptr; +NX_INTERFACE *dhcp_interface; +ULONG lsw, msw, sender_ip_address; + + ip_ptr = dhcp_ptr -> nx_dhcp_ip_ptr; + + /* Allocate a packet to build the ARP message in. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &request_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); + if (status != NX_SUCCESS) + { + + /* Error getting packet, so just get out! */ + return status; + } + /* Stamp the packet with the outgoing interface information. */ + dhcp_interface = &(ip_ptr -> nx_ip_interface[iface_index]); + request_ptr -> nx_packet_ip_interface = dhcp_interface; + + /* Build the ARP request packet. */ + + /* Setup the size of the ARP message. */ + request_ptr -> nx_packet_length = 28; + + /* Setup the append pointer to the end of the message. */ + request_ptr -> nx_packet_append_ptr = request_ptr -> nx_packet_prepend_ptr + 28; + + /* Setup the pointer to the message area. */ + message_ptr = (ULONG *) request_ptr -> nx_packet_prepend_ptr; + + /* Write the Hardware type into the message. */ + *message_ptr = (ULONG) (1 << 16) | (0x08); + *(message_ptr+1) = (ULONG) (6 << 24) | (4 << 16) | 2; + /* Sender mac address */ + msw = 0x0c; + lsw = 0xf17dcaa6; + *(message_ptr+2) = (ULONG) (msw << 16) |(lsw >> 16); + + /* Rest of sender mac address and sender IP address */ + sender_ip_address = dhcp_ptr -> nx_dhcp_interface[iface_index].nx_dhcp_ip_address; + *(message_ptr+3) = (ULONG) ((lsw << 16) | (sender_ip_address >> 16)); + + /* Target mac address */ + msw = 0x11; + lsw = 0x22334457; + *(message_ptr+4) = (msw << 16) |(lsw >> 16); + *(message_ptr+4) = (sender_ip_address << 16) | (msw & NX_LOWER_16_MASK); + *(message_ptr+5) = lsw; + + /* Target address */ + *(message_ptr+6) = (ULONG) 0x0; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Send the ARP request to the driver. */ + driver_request.nx_ip_driver_ptr = ip_ptr; + driver_request.nx_ip_driver_command = NX_LINK_ARP_SEND; + driver_request.nx_ip_driver_packet = request_ptr; + driver_request.nx_ip_driver_physical_address_msw = 0xFFFFUL; + driver_request.nx_ip_driver_physical_address_lsw = 0xFFFFFFFFUL; + driver_request.nx_ip_driver_interface = dhcp_interface; + (dhcp_interface -> nx_interface_link_driver_entry) (&driver_request); + + return NX_SUCCESS; +} + +// jlc this does not get called. Is that correct behavior? +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + dhcp_interface_state_change0(dhcp_ptr, new_state); +} + +void dhcp_interface_state_change0(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + +UINT dhcp_state; + + dhcp_state = (UINT)new_state; + + + /* Increment state changes counter. */ + state_changes[0]++; + + if (dhcp_state == NX_DHCP_STATE_RENEWING) + { + renews[0]++; + } + else if (dhcp_state == NX_DHCP_STATE_REBINDING) + { + rebinds[0]++; + } + else if (dhcp_state == NX_DHCP_STATE_BOUND) + { + bounds[0]++; + } + + return; +} + + +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + +UINT dhcp_state; + + dhcp_state = (UINT)new_state; + + + /* Increment state changes counter. */ + state_changes[1]++; + + if (dhcp_state == NX_DHCP_STATE_RENEWING) + { + renews[1]++; + } + else if (dhcp_state == NX_DHCP_STATE_REBINDING) + { + rebinds[1]++; + } + else if (dhcp_state == NX_DHCP_STATE_BOUND) + { + bounds[1]++; + } + + return; +} + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c new file mode 100644 index 00000000..90366e09 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c @@ -0,0 +1,950 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Required: NX_MAX_PHYSICAL_INTERFACES = 2 and NX_DHCP_CLIENT_MAX_INTERFACES = 1. + There are two DHCP Client threads that are switching from manual to DHCP CLient address + mode, and switch from activated to deactivated. There is one server thread checking + for DHCP Client messages on primary and secondary interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT); +#ifndef NX_DISABLE_IPV4 +#include "nx_arp.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + + + +/* Define the ThreadX, NetX object control blocks... */ + +static NX_UDP_SOCKET server0_socket; +static TX_THREAD client0_thread; +static TX_THREAD client1_thread; +static TX_THREAD server0_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server0_ip; + +static UINT probe0 = NX_FALSE; +static UINT probe1 = NX_FALSE; +static UINT bound0 = NX_FALSE; +static UINT bound1 = NX_FALSE; + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; +static ULONG dhcp_xid; + + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; +static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client0_running = NX_TRUE; +static UINT client1_running = NX_TRUE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +static void server0_thread_entry(ULONG thread_input); +static void client0_thread_entry(ULONG thread_input); +static void client1_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); +static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); + + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ + + +static char offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response0_size = 300; + +static char offer_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +static char ack_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server0_thread, "Server 0 thread ", server0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server0_ip, + "Server 0 IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server0_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server0_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server0_ip); + + if (status) + error_counter++; + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client0_thread, "Client 0", client0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the secondary client thread. */ + status = tx_thread_create(&client1_thread, "Client 1", client1_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 12*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + + if (status) + error_counter++; + + /* Keep track of interface DHCP Client state changes. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); + + if (status) + error_counter++; + + return; +} + + +/* Define the DHCP client thread. */ + +void client0_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT time_keeper; + + + tx_thread_sleep(10); + + /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ + status = nx_dhcp_interface_start(&dhcp_client, 0); + if (status != NX_SUCCESS) + { + error_counter++; + } + + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ + time_keeper = 0; + + while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(10); + time_keeper += 10; + if (time_keeper > 1000) + { + break; + } + } + + if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE)) + { + error_counter++; + } + + /* Now stop the DHCP Client 0. */ + nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Verify the DHCP CLient is not enabled on the primary interface. */ + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) + { + error_counter++; + } + client0_running = NX_FALSE; + +} + +void client1_thread_entry(ULONG thread_input) +{ + +UINT status; + + + tx_thread_sleep(10); + + if (NX_DHCP_CLIENT_MAX_RECORDS != 2) + { + error_counter++; + } + + status = nx_dhcp_interface_enable(&dhcp_client, 1); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + status = nx_dhcp_interface_start(&dhcp_client, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + UINT time_keeper = 0; + while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(20); + time_keeper += 20; + if (time_keeper > 1000) + { + break; + } + } + + if ((probe1 != NX_TRUE) || (bound1 != NX_TRUE)) + { + error_counter++; + } + + /* Now disable DHCP Client 1 activity. This reinitializes the Client too. */ + status = nx_dhcp_interface_disable(&dhcp_client, 1); + if (status) + { + error_counter++; + } + } + + if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) + { + error_counter++; + } + client1_running = NX_FALSE; +} + +/* Define the Primary DHCP server thread. */ +void server0_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k, pkt_number; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server0_ip, &server0_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server0_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + i = 0; + j = 0; + k = 0; + pkt_number = 0; + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Wait for Client requests */ + while ( i < (2*NUM_RESPONSES)) + { + + status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + UINT source_port; + ULONG source_ip_address; + UINT protocol; + UINT iface_index; + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + /* Release the packet. */ + nx_packet_release(my_packet); + + if (iface_index == 0) + { + pkt_number = j; + + } + else + { + pkt_number = k; + + } + + status = nx_dhcp_response_packet_send(&server0_socket, 68, pkt_number, iface_index); + + if (iface_index == 0) + j++; + else + k++; + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while((client0_running == NX_TRUE) || (client1_running == NX_TRUE)) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server0_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + +static void dhcp_test_initialize() +{ + + + /* Set up server responses on the primary interface. */ + dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; + dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; + + dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; + dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; + + /* Set up server responses on the secondary interface. */ + dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; + +} + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ + +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + if (iface_index == 0) + { + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, + dhcp_response0[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; + } + else if (iface_index == 1) + { + + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, + dhcp_response1[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; + } + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); +#else + response_packet_ptr_ptr = &response_packet; + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + + /* Check the status. */ + if (status) + { + + error_counter++; + + nx_packet_release(response_packet); + } + + return status; +} + + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + +UCHAR *work_ptr; +ULONG *message_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +ULONG sender_physical_lsw; +NX_PACKET *packet_copy; + + + /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet + prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ + if (packet_ptr -> nx_packet_length < 200) + { + + message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (sender_physical_lsw == 0x22334458) + { + interface_index = 0; + } + else if (sender_physical_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ + { + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the packet mac address, set the packet interface based on the mac address */ + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + if (packet_ptr -> nx_packet_length > 200) + { + + if (ip_ptr == &server0_ip) + { + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_ip_packet_receive(&server0_ip, packet_copy); + } + } + else + { + + if (ip_ptr == &server0_ip) + { + _nx_arp_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_arp_packet_receive(&server0_ip, packet_copy); + } + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + +ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + + if (iface_index == 0) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound0 = NX_TRUE; + } + } + else if (iface_index == 1) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe1 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound1 = NX_TRUE; + } + } + else + error_counter++; + + return; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test...............N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c new file mode 100644 index 00000000..b1bdbd19 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c @@ -0,0 +1,949 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Required: NX_MAX_PHYSICAL_INTERFACES = 2 and NX_DHCP_CLIENT_MAX_INTERFACES = 1. + There are two DHCP Client threads that are switching from manual to DHCP CLient address + mode, and switch from activated to deactivated. There is one server thread checking + for DHCP Client messages on primary and secondary interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT); +#ifndef NX_DISABLE_IPV4 +#include "nx_arp.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + + + +/* Define the ThreadX, NetX object control blocks... */ + +static NX_UDP_SOCKET server0_socket; +static TX_THREAD client0_thread; +static TX_THREAD client1_thread; +static TX_THREAD server0_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server0_ip; + +static UINT probe0 = NX_FALSE; +static UINT probe1 = NX_FALSE; +static UINT bound0 = NX_FALSE; +static UINT bound1 = NX_FALSE; + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; +static ULONG dhcp_xid; + + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; +static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client0_running = NX_TRUE; +static UINT client1_running = NX_TRUE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +static void server0_thread_entry(ULONG thread_input); +static void client0_thread_entry(ULONG thread_input); +static void client1_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); +static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); + + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ + + +static char offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response0_size = 300; + +static char offer_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +static char ack_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server0_thread, "Server 0 thread ", server0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server0_ip, + "Server 0 IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server0_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server0_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server0_ip); + + if (status) + error_counter++; + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client0_thread, "Client 0", client0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the secondary client thread. */ + status = tx_thread_create(&client1_thread, "Client 1", client1_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 12*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + + if (status) + error_counter++; + + /* Keep track of interface DHCP Client state changes. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); + + if (status) + error_counter++; + + return; +} + + +/* Define the DHCP client thread. */ + +void client0_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT time_keeper; + + + tx_thread_sleep(10); + + /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ + status = nx_dhcp_interface_start(&dhcp_client, 0); + if (status != NX_SUCCESS) + { + error_counter++; + } + + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ + time_keeper = 0; + + while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(10); + time_keeper += 10; + if (time_keeper > 1000) + { + break; + } + } + + if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE)) + { + error_counter++; + } + + /* Now stop the DHCP Client 0. */ + nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Verify the DHCP CLient is not enabled on the primary interface. */ + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) + { + error_counter++; + } + client0_running = NX_FALSE; + +} + +void client1_thread_entry(ULONG thread_input) +{ + +UINT status; + + + tx_thread_sleep(10); + + if (NX_DHCP_CLIENT_MAX_RECORDS != 2) + { + error_counter++; + } + + status = nx_dhcp_interface_enable(&dhcp_client, 1); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + status = nx_dhcp_interface_start(&dhcp_client, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + UINT time_keeper = 0; + while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(20); + time_keeper += 20; + if (time_keeper > 1000) + { + break; + } + } + + if ((probe1 != NX_TRUE) || (bound1 != NX_TRUE)) + { + error_counter++; + } + + /* Now disable DHCP Client 1 activity. This reinitializes the Client too. */ + status = nx_dhcp_interface_disable(&dhcp_client, 1); + if (status) + { + error_counter++; + } + } + + if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) + { + error_counter++; + } + client1_running = NX_FALSE; +} + +/* Define the Primary DHCP server thread. */ +void server0_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k, pkt_number; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server0_ip, &server0_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server0_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + i = 0; + j = 0; + k = 0; + pkt_number = 0; + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Wait for Client requests */ + while ( i < (2*NUM_RESPONSES)) + { + + status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + UINT source_port; + ULONG source_ip_address; + UINT protocol; + UINT iface_index; + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + /* Release the packet. */ + nx_packet_release(my_packet); + + if (iface_index == 0) + { + pkt_number = j; + + } + else + { + pkt_number = k; + + } + + status = nx_dhcp_response_packet_send(&server0_socket, 68, pkt_number, iface_index); + + if (iface_index == 0) + j++; + else + k++; + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while((client0_running == NX_TRUE) || (client1_running == NX_TRUE)) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server0_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + +static void dhcp_test_initialize() +{ + + + /* Set up server responses on the primary interface. */ + dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; + dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; + + dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; + dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; + + /* Set up server responses on the secondary interface. */ + dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; + +} + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ + +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + if (iface_index == 0) + { + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, + dhcp_response0[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; + } + else if (iface_index == 1) + { + + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, + dhcp_response1[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; + } + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); +#else + response_packet_ptr_ptr = &response_packet; + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + + /* Check the status. */ + if (status) + { + + error_counter++; + + nx_packet_release(response_packet); + } + + return status; +} + + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + +UCHAR *work_ptr; +ULONG *message_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +ULONG sender_physical_lsw; +NX_PACKET *packet_copy; + + + /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet + prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ + if (packet_ptr -> nx_packet_length < 200) + { + + message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); + + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); + + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (sender_physical_lsw == 0x22334458) + { + interface_index = 0; + } + else if (sender_physical_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ + { + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334459) + { + interface_index = 1; + } + else + { + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + } + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the packet mac address, set the packet interface based on the mac address */ + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + if (packet_ptr -> nx_packet_length > 200) + { + + if (ip_ptr == &server0_ip) + { + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_ip_packet_receive(&server0_ip, packet_copy); + } + } + else + { + + if (ip_ptr == &server0_ip) + { + _nx_arp_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_arp_packet_receive(&server0_ip, packet_copy); + } + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + +ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + + if (iface_index == 0) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound0 = NX_TRUE; + } + } + else if (iface_index == 1) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + probe1 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound1 = NX_TRUE; + } + } + else + error_counter++; + + return; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test...............N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c new file mode 100644 index 00000000..60a65219 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c @@ -0,0 +1,614 @@ +/* Testing the multiple interface DHCP Client. NX_DHCP_CLIENT_MAX_RECORDS should be set to 2. */ + +/* Test with NX_DHCP_CLIENT_SEND_ARP_PROBE enabled on the DHCP Client. Only using + interface 1 at present (primary interface is disabled for DHCP). The Client sends + three ARP probes without a conflict response ARP packet. It proceeds to the BOUND state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 2098 +#define PACKET_PAYLOAD 1518 + +/* Define the ThreadX, NetX object control blocks... */ + +NX_UDP_SOCKET server_socket; +TX_THREAD client_thread; +TX_THREAD server_thread; +NX_PACKET_POOL client_pool; +NX_PACKET_POOL server_pool; +NX_IP client_ip; +NX_IP server_ip; + + +/* Define the NetX DHCP object control block. */ +NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + +static UINT state_changes[2] = {0,0}; +static UINT bounds[2] = {0,0}; + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +void server_thread_entry(ULONG thread_input); +void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +static char offer_response[300] = { +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xf0, 0x1c, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xb4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ '192.2.2.247*/ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +static char ack_response[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xf0, 0x1c, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xb4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_cilent_arpprobe_succeeds_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 5*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 5*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT time_keeper = 0; + + /* Let the server set up. */ + tx_thread_sleep(10); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + /* Register state change variable. */ + status = nx_dhcp_interface_enable(&dhcp_client, 1); + status |= nx_dhcp_interface_disable(&dhcp_client, 0); + if (status) + error_counter++; + + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change1); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_interface_start(&dhcp_client, 1); + if (status) + error_counter++; + + /* Put an upper limit on wait for achieving the bound state. */ + while((dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) && + (time_keeper < 1000)) + { + time_keeper += 100; + tx_thread_sleep(100); + } + + if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + error_counter++; + } + + if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) + { + error_counter++; + } + + client_running = NX_FALSE; + + return; +} + + +/* Define the helper DHCP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES) + { + + if (i <= 1) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + + status = nx_dhcp_response_packet_send(&server_socket, 68, i, 0); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + } + else + { + + /* Wait for the dhcp client to start the ARP probe process. */ + while (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_probe_count == 0) + tx_thread_sleep(10); + + } + + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void dhcp_test_initialize() +{ + + /* Set up server responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ +UINT status; +NX_PACKET *response_packet; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; + +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); + +#else + + response_packet_ptr_ptr = &response_packet; + + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + /* Check the status. */ + if (status) + { + nx_packet_release(response_packet); + error_counter++; + } + + return status; +} + + +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + +UINT dhcp_state; + + dhcp_state = (UINT)new_state; + + + /* Increment state changes counter. */ + state_changes[1]++; + + if (dhcp_state == NX_DHCP_STATE_BOUND) + { + bounds[1]++; + } + + return; +} + + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR *work_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +NX_PACKET *packet_copy; + + + /* Is this a DHCP packet e.g. not an ARP packet? */ + if (packet_ptr -> nx_packet_length < 200) + { + /* Maybe an ARP packet. let the RAM driver deal with it */ + return NX_TRUE; + } + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (ip_ptr == &client_ip) + { + if (packet_client_mac_lsw == 0x22334457) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 1; + } + else + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + } + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the IP instance and packet mac address, set the packet interface */ + + if (ip_ptr == &server_ip) + { + + packet_copy -> nx_packet_ip_interface = &(client_ip.nx_ip_interface[1]); + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + _nx_ip_packet_receive(&server_ip, packet_copy); + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_decline_test.c b/test/regression/dhcp_test/netx_dhcp_client_decline_test.c new file mode 100644 index 00000000..846fc74c --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_decline_test.c @@ -0,0 +1,999 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Interface 0 stays bound; interface 1 declines the IP address and tries + again at the INIT state to get a unique IP address. + + Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_INTERFACES >= 2. + Also NX_DHCP_CLIENT_SEND_ARP_PROBE must be enabled. Requires longer timeout in regression + test netxtestcontrol. + + There is one server thread handling DHCP Client messages on both interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + + +#if (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +static ULONG dhcp_xid = 0; +static UINT bound0 = NX_FALSE; +static UINT arp_probe0 = NX_FALSE; +static UINT init0 = NX_FALSE; + + +/* Define the ThreadX, NetX object control blocks... */ + +static UINT state_changes = 0; +static NX_UDP_SOCKET server_socket; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define DHCP0_NUM_RESPONSES 4 +#define DHCP1_NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response0[DHCP0_NUM_RESPONSES]; +static DHCP_RESPONSE dhcp_response1[DHCP1_NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ + + +static char offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response0_size = 300; + +static char offer_response1[300] = { + +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +static char ack_response1[300] = { + +//0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#ifdef __PRODUCT_NETXDUO__ +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, +#else +0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, +#endif +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + +static char second_offer_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int second_offer_response0_size = 300; + +/* Frame (342 bytes) */ +static char second_ack_response0[300] = { + +0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int second_ack_response0_size = 300; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_decline_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server Thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + if (status) + error_counter++; + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 7*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 7*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client IP ", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + return; +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT time_keeper; + + + tx_thread_sleep(10); + + /* Register state change variable. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_dhcp_interface_enable(&dhcp_client, 1); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start DHCP on all interfaces. */ + status = nx_dhcp_start(&dhcp_client); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if ((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) || + (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + time_keeper = 0; + + /* Wait for the ARP probe state... */ + while(!arp_probe0) + { + + /* SHould not go directly to the BOUND state. */ + if (bound0) + { + printf("ERROR5!\n"); + test_control_return(1); + + } + + tx_thread_sleep(15); + time_keeper += 15; + if (time_keeper > 2000) + { + break; + } + } + + /* If it is in the ARP probe state, decline the IP address independently of the DHCP CLient*/ + if (arp_probe0) + { + + status = nx_dhcp_interface_decline(&dhcp_client, 0); + + if (status == NX_SUCCESS) + { + + /* Wait for the decline action to reset the DHCP CLient. */ + tx_thread_sleep(20); + + if (!init0) + { + printf("ERROR3!\n"); + test_control_return(1); + } + else + { + + /* Now wait for the DHCP Client to be bound. */ + time_keeper = 0; + while(!bound0) + { + tx_thread_sleep(100); + time_keeper += 100; + if (time_keeper > 2000) + { + break; + } + } + + if (bound0 != NX_TRUE) + { + printf("ERROR2!\n"); + test_control_return(1); + } + } + } + } + else + { + printf("ERROR1!\n"); + test_control_return(1); + } + + + time_keeper = 0; + + while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(100); + time_keeper += 100; + if (time_keeper > 1500) + { + break; + } + } + + if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + printf("ERROR4!\n"); + test_control_return(1); + } + + /* Now disable DHCP Client 1 activity. This reinitializes the Client too. */ + status = nx_dhcp_interface_disable(&dhcp_client, 1); + if (status) + { + printf("ERROR7!\n"); + test_control_return(1); + } + + client_running = NX_FALSE; + +} + + +/* Define the Primary DHCP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k, pkt_number; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Decline Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR6!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + i = 0; + j = 0; + k = 0; + pkt_number = 0; + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Wait for Client requests */ + while ( i < (DHCP0_NUM_RESPONSES + DHCP1_NUM_RESPONSES + 1)) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + UINT source_port; + ULONG source_ip_address; + UINT protocol; + UINT iface_index; + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + /* Release the packet. */ + nx_packet_release(my_packet); + + if (iface_index == 0) + { + pkt_number = j; + + } + else + { + pkt_number = k; + } + + + /* This is the decline message. The server + does not respond to this. */ + if ((iface_index == 0) && (j == 2) && (i == 4)) + { + i++; + continue; + } + + status = nx_dhcp_response_packet_send(&server_socket, 68, pkt_number, iface_index); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if (iface_index == 0) + j++; + else + k++; + } + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR5!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + +static void dhcp_test_initialize() +{ + + + /* Set up server responses on the primary interface. */ + dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; + dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; + + dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; + dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; + + dhcp_response0[2].dhcp_response_pkt_data = &second_offer_response0[0]; + dhcp_response0[2].dhcp_response_pkt_size = second_offer_response0_size ; + + dhcp_response0[3].dhcp_response_pkt_data = &second_ack_response0[0]; + dhcp_response0[3].dhcp_response_pkt_size = second_ack_response0_size ; + + + /* Set up server responses on the secondary interface. */ + dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; + +} + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) +{ + +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#else +ULONG ip_address; +NX_PACKET **response_packet_ptr_ptr; +#endif + +#ifdef __PRODUCT_NETXDUO__ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; +#else + ip_address = 0xFFFFFFFF; +#endif + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + if (iface_index == 0) + { + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, + dhcp_response0[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; + } + else if (iface_index == 1) + { + + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, + dhcp_response1[packet_number].dhcp_response_pkt_size); + + response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; + } + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); +#else + response_packet_ptr_ptr = &response_packet; + status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); +#endif + + /* Check the status. */ + if (status) + { + + error_counter++; + + nx_packet_release(response_packet); + } + + return status; +} + +void dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + + if (iface_index == 0) + { + + if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) + { + arp_probe0 = NX_TRUE; + } + else if ((arp_probe0 == NX_TRUE) && (new_state== NX_DHCP_STATE_INIT)) + { + init0 = NX_TRUE; + } + else if (new_state == NX_DHCP_STATE_BOUND) + { + bound0 = NX_TRUE; + } + } + + state_changes++; + + return; +} + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR *work_ptr; +UINT interface_index; +UINT packet_client_mac_lsw; +NX_PACKET *packet_copy; + + + /* Is this a DHCP packet e.g. not an ARP packet? */ + if (packet_ptr -> nx_packet_length < 200) + { + /* Maybe an ARP packet. let the RAM driver deal with it */ + return NX_TRUE; + } + + /* Set work_ptr. */ +#ifdef __PRODUCT_NETXDUO__ + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#else + work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; +#endif + /* Pickup the target MAC address in the DHCP message. */ + packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | + (((ULONG)work_ptr[3]) << 16) | + (((ULONG)work_ptr[4]) << 8) | + ((ULONG)work_ptr[5]); + + /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ + if (packet_client_mac_lsw == 0x22334458) + { + interface_index = 0; + } + else if (packet_client_mac_lsw == 0x22334459) + { + interface_index = 1; + } + else + /* Don't know what this packet is. Let DHCP Client handle it. */ + return NX_TRUE; + + /* Copy to a new packet and drop the original packet. */ + nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); + + /* Based on the packet mac address, set the packet interface based on the mac address */ + packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); + + if (ip_ptr == &server_ip) + { + _nx_ip_packet_receive(&client_ip, packet_copy); + } + else + { + _nx_ip_packet_receive(&server_ip, packet_copy); + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + +ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_decline_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Decline Test..................................N/A!\n"); + test_control_return(3); +} +#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) */ + + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c b/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c new file mode 100644 index 00000000..075cf74e --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c @@ -0,0 +1,561 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is a test of the default DHCP Client configuration; one interface (primary interface) is configured. + Required: NX_MAX_PHYSICAL_INTERFACES and NX_DHCP_CLIENT_MAX_INTERFACES = 1. */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +//#define REQUEST_CLIENT_IP +#ifdef REQUEST_CLIENT_IP +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,1,1,66) +UINT skip_discover_message = NX_TRUE; +#endif + +/* Define the ThreadX, NetX object control blocks... */ + +NX_UDP_SOCKET server_socket; +TX_THREAD client_thread; +TX_THREAD server_thread; +NX_PACKET_POOL client_pool; +NX_PACKET_POOL server_pool; +NX_IP client_ip; +NX_IP server_ip; + + +/* Define the NetX FTP object control block. */ +NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_FALSE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +void server_thread_entry(ULONG thread_input); +void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +static char offer_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9d, /* {.....T. */ +0x58, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +#ifdef REQUEST_CLIENT_IP +0x00, 0x00, 0xc0, 0x01, 0x01, 0x43, 0xc0, 0x01, /* ........ */ +#else +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +#endif +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +static char ack_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9d, /* {.....T. */ +0x58, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +#ifdef REQUEST_CLIENT_IP +0x00, 0x00, 0xc0, 0x01, 0x01, 0x43, 0xc0, 0x01, /* ........ */ +#else +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +#endif +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_interface_0_only_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,1,1,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, " Client0 IP Instance", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +#endif + + tx_thread_sleep(20); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + + /* Set the client IP if the host is configured to do so. */ + if (status) + error_counter++; + +#ifdef REQUEST_CLIENT_IP + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + //status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_interface_state_change1); + //if (status) + // error_counter++; + + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(100); + } + + status = nx_dhcp_stop(&dhcp_client); + if (status) + error_counter++; + + tx_thread_sleep(20); + + status = nx_ip_address_set(&client_ip, IP_ADDRESS(192,1,1,99), 0xFFFFFF00); + if (status) + error_counter++; +} + + +/* Define the helper DHCP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Interface 0 Only Test.........................\n"); // jlc remove the \n + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES) + { + +#ifdef REQUEST_CLIENT_IP + if (skip_discover_message == NX_TRUE) + { + i = 1; + } +#endif + + if (i <= 1) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + else + { + printf("\nRECVd %dth packet\n", i); + + /* Release the packet. */ + nx_packet_release(my_packet); + + printf("Server sending response back. \n"); + status = nx_dhcp_response_packet_send(&server_socket, 68, i); + } + } + else + { + +#ifdef NX_DHCP_CLIENT_SEND_ARP_PROBE + /* Wait for the dhcp client to start the ARP probe process. */ + while (dhcp_client.nx_dhcp_interface[1].nx_dhcp_probe_count == 0) + tx_thread_sleep(10); +#endif + + printf("No one should send a Probe reply\n"); + } + + /* Check status. */ + if (status) + { + + printf("ERROR8!\n"); + error_counter++; + } + + + /* Advance the index for the next response. */ + i++; + } + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + + + printf("All done, waiting for client to go away\n"); + + /* Wait for the client to terminate the connection. */ + while(client_running != NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void dhcp_test_initialize() +{ + + +/* Download data responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; +} + + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; +NXD_ADDRESS ip_address; + + + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; + + printf("Sending %dth response\n", packet_number); + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, 0); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +UINT state_changes = 0; +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + state_changes++; + + return; +} + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c b/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c new file mode 100644 index 00000000..82427832 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c @@ -0,0 +1,595 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is a test of the DHCP Client running on only one interface (secondary interface). + Required: NX_MAX_PHYSICAL_INTERFACES >= 2 NX_DHCP_CLIENT_MAX_INTERFACES = 1. */ + + + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +#define REQUEST_CLIENT_IP +#ifdef REQUEST_CLIENT_IP +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,1,1,66) +UINT skip_discover_message = NX_TRUE; +#endif + +/* Define the ThreadX, NetX object control blocks... */ + +NX_UDP_SOCKET server_socket; +TX_THREAD client_thread; +TX_THREAD server_thread; +NX_PACKET_POOL client_pool; +NX_PACKET_POOL server_pool; +NX_IP client_ip; +NX_IP server_ip; + + +/* Define the NetX DHCP object control block. */ +NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_FALSE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +void server_thread_entry(ULONG thread_input); +void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +static char offer_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xF0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +#ifdef REQUEST_CLIENT_IP +0x00, 0x00, 0xc0, 0x01, 0x01, 0x43, 0xc0, 0x01, /* ........ */ +#else +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +#endif +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +static char ack_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xF0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +#ifdef REQUEST_CLIENT_IP +0x00, 0x00, 0xc0, 0x01, 0x01, 0x43, 0xc0, 0x01, /* ........ */ +#else +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +#endif +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_cilent_interface_1_only_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&server_ip, "Client1 IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, " Client0 IP Instance", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +#endif + + tx_thread_sleep(20); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + + /* Set the client IP if the host is configured to do so. */ + if (status) + error_counter++; + +#ifdef REQUEST_CLIENT_IP + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_interface_state_change1); + if (status) + error_counter++; + + /* Note that we call this after setting the request IP, stage change notify and clear broadcast services. + DHCP CLient defaults these to the primary interface unless the dhcp interface has been set. + If this host is configured for multiple interfaces, this call will reset these attributes on + both interfaces. */ + status = nx_dhcp_set_interface_index(&dhcp_client, 1); + if (status) + error_counter++; + + /* Try using the multi-interface method to start the client. */ + status = _nx_dhcp_multi_interface_start(&dhcp_client); + if (status != NX_DHCP_NOT_FOR_SINGLE_INTERFACES) + error_counter++; + + /* Start the DHCP Client using the single DHCP Client interface method. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + while(dhcp_client.nx_dhcp_interface[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(100); + } + + /* This should release the IP address for the secondary interface. */ + nx_dhcp_release(&dhcp_client); + + /* Try to use the multiple interface method to stop the Client. */ + status = nx_dhcp_client_interface_deactivate(&dhcp_client, 1); + if (status != NX_DHCP_NOT_FOR_SINGLE_INTERFACES) + { + error_counter++; + } + + status = nx_dhcp_stop(&dhcp_client); + + tx_thread_sleep(40); + + /* Manually set IP address on secondary interface */ + status = nx_ip_interface_address_set(&client_ip, 1, IP_ADDRESS(192,1,1,66), 0xFFFFFF00); + if (status) + error_counter++; + +} + + +/* Define the helper DHCP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Interface 1 Only Test...........................\n"); // jlc remove the \n + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES) + { + +#ifdef REQUEST_CLIENT_IP + if (skip_discover_message == NX_TRUE) + { + i = 1; + } +#endif + if (i <= 1) + { + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + else + { + printf("\nRECVd %dth packet\n", i); + + /* Release the packet. */ + nx_packet_release(my_packet); + + printf("Server sending response back. \n"); + status = nx_dhcp_response_packet_send(&server_socket, 68, i); + } + } + else + { + +#ifdef NX_DHCP_CLIENT_SEND_ARP_PROBE + /* Wait for the dhcp client to start the ARP probe process. */ + while (dhcp_client.nx_dhcp_interface[1].nx_dhcp_probe_count == 0) + tx_thread_sleep(10); +#endif + + printf("No one should send a Probe reply\n"); + } + + /* Check status. */ + if (status) + { + + printf("ERROR8!\n"); + error_counter++; + } + + + /* Advance the index for the next response. */ + i++; + } + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + + + printf("All done, waiting for client to go away\n"); + + /* Wait for the client to terminate the connection. */ + while(client_running != NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void dhcp_test_initialize() +{ + + +/* Download data responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; + + +} + + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; +NXD_ADDRESS ip_address; + + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; + + + printf("Sending %dth response\n", packet_number); + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, 1); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + +//UINT dhcp_state; + + //dhcp_state = (UINT)new_state; + + + return; +} + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_interface_order_test.c b/test/regression/dhcp_test/netx_dhcp_client_interface_order_test.c new file mode 100644 index 00000000..d10ea65c --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_interface_order_test.c @@ -0,0 +1,260 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_RECORDS >= 2. + There are two DHCP Client threads that independently activate the DHCP Client on + the primary or secondary interface. When they reach the bound state, each interface Client + deactivates the DHCP Client process and the DHCP Client goes back to the NOT STARTED state. + + There is one server thread handling DHCP Client messages on both interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + + +/* Define the ThreadX, NetX object control blocks... */ + +static UINT state_changes = 0; +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT discover_counter = 0; + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); +static void client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_interface_order_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the Client. */ + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 7*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 7*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, " Client IP ", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Interface Order Test.........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the advanced callback to ensure broadcast packets are routed correctly. */ + advanced_packet_process_callback = my_dhcp_process_bc_callback; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Clear the unicast flag on all interfaces. */ + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + + /* Set the client IP if the host is configured to do so. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable DHCP feature on the second interface. */ + status = nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable DHCP feature on the second interface. */ + status = nx_dhcp_interface_enable(&dhcp_client, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable DHCP feature on the second interface. */ + status = nx_dhcp_interface_enable(&dhcp_client, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start DHCP feature on the second interface. */ + status = nx_dhcp_interface_start(&dhcp_client, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for Discover. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check error_counter. */ + if ((error_counter) || (discover_counter == 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + + /* Is this a DHCP packet e.g. not an ARP packet? */ + if (packet_ptr -> nx_packet_length < 200) + { + /* Maybe an ARP packet. let the RAM driver deal with it */ + return NX_TRUE; + } + + /* Check the interface index. */ + if (packet_ptr -> nx_packet_ip_interface != &ip_ptr -> nx_ip_interface[0]) + error_counter++; + + /* Update the counter. */ + discover_counter++; + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_interface_order_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Client Interface Order Test..........................N/A!\n"); + test_control_return(3); +} +#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) */ + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_ip_mutex_test.c b/test/regression/dhcp_test/netx_dhcp_client_ip_mutex_test.c new file mode 100644 index 00000000..317a7133 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_ip_mutex_test.c @@ -0,0 +1,192 @@ +/* Testing the multiple interface DHCP Client */ + +/* This is the DHCP Client that will run on both interfaces independently. + Interface 0 stays bound; interface 1 declines the IP address and tries + again at the INIT state to get a unique IP address. + + Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_INTERFACES >= 2. + Also NX_DHCP_CLIENT_SEND_ARP_PROBE must be enabled. Requires longer timeout in regression + test netxtestcontrol. + + There is one server thread handling DHCP Client messages on both interfaces. +*/ + + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +/* Define the ThreadX, NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; + +/* Define the counters used in the demo application... */ +static UINT error_counter = 0; + +/* Replace the 'ram' driver with your Ethernet driver. */ +static void client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(NX_IP_DRIVER *driver_req_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_ip_mutex_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0x00, &client_pool, _nx_ram_network_driver_256, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; +} + + +/* Define the DHCP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + + printf("NetX Test: DHCP Client IP Mutex Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Start DHCP on all interfaces. */ + status = nx_dhcp_start(&dhcp_client); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for sending the first discovery message. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + +#ifndef NX_DISABLE_UDP_INFO + /* Check if send out discovery message. */ + if (client_ip.nx_ip_udp_packets_sent == 0) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_UDP_INFO */ + + /* Check if DHCP Thread did not release the IP mutex. */ + if (client_ip.nx_ip_protection.tx_mutex_owner == &dhcp_client.nx_dhcp_thread) + { + error_counter++; + } + + /* Release the mutex again before call test_control_cleanup */ + dhcp_client.nx_dhcp_thread.tx_thread_owned_mutex_list = NX_NULL; + client_ip.nx_ip_protection.tx_mutex_owner = &client_thread; + tx_mutex_put(&client_ip.nx_ip_protection); + + /* Check for error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_ip_mutex_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client IP Mutex Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_ntp_option_test.c b/test/regression/dhcp_test/netx_dhcp_client_ntp_option_test.c new file mode 100644 index 00000000..2c7fea20 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_ntp_option_test.c @@ -0,0 +1,537 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_UDP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT test_done = NX_FALSE; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +typedef struct DHCP_RESPONSE_STRUCT +{ + UCHAR *dhcp_response_pkt_data; + UINT dhcp_response_pkt_size; +} DHCP_RESPONSE; + +static DHCP_RESPONSE dhcp_response[2]; + +/* Frame (342 bytes) */ +static unsigned char offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0xc0, /* Sc5..6.. */ +0xa8, 0x02, 0x01, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ...3.... */ +0xfe, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ........ */ +0x04, 0xc0, 0xa8, 0x02, 0x01, 0x06, 0x04, 0xc0, /* ........ */ +0xa8, 0x02, 0x01, 0x2a, 0x04, 0x7c, 0x6c, 0x14, /* ...*.|l. */ +0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char ack[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0xc0, /* Sc5..6.. */ +0xa8, 0x02, 0x01, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ...3.... */ +0xfe, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ........ */ +0x04, 0xc0, 0xa8, 0x02, 0x01, 0x06, 0x04, 0xc0, /* ........ */ +0xa8, 0x02, 0x01, 0x2a, 0x04, 0x7c, 0x6c, 0x14, /* ...*.|l. */ +0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_ntp_option_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +UINT index; +NX_PACKET *my_packet; +UCHAR *option_ptr; +UINT option_size; + + printf("NetX Test: DHCP Client NTP Option test..............................."); + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&server_ip, 0, 0x00000015, 0x5d021e0f, NX_TRUE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + server_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000015; + server_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x5d021e0f; +#endif + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dhcp_response[0].dhcp_response_pkt_data = (char*)offer; + dhcp_response[0].dhcp_response_pkt_size = sizeof(offer); + dhcp_response[1].dhcp_response_pkt_data = ack; + dhcp_response[1].dhcp_response_pkt_size = sizeof(ack); + + /* Wait for Client requests (DISCOVER and REQEUST). */ + for (i = 0; i < 2; i++) + { + + /* Receive DHCP message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Check if there is NTP in parameter request list. */ + option_ptr = dhcp_search_buffer(my_packet -> nx_packet_prepend_ptr, NX_DHCP_OPTION_DHCP_PARAMETERS, my_packet -> nx_packet_length); + + /* Check if found the parameter request option. */ + if (option_ptr == NX_NULL) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + option_size = (UINT)*option_ptr; + option_ptr++; + + /* Check if there is NTP. */ + for (index = 0; index < option_size; index ++) + { + if (*(option_ptr + index) == NX_DHCP_OPTION_NTP_SVR) + { + break; + } + } + + if (index >= option_size) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send response. */ + status = nx_dhcp_response_packet_send(&server_socket, i); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Wait for test done. */ + while(test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG ntp_server_address; +UINT ntp_server_address_size = 4; + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&client_ip, 0, 0x00000011, 0x22334457, NX_TRUE); + + /* Check for errors. */ + if (status) + { + error_counter++; + } +#else + client_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000011; + client_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x22334457; +#endif + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + error_counter++; + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Request NTP. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status) + { + error_counter++; + } + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + /* Wait for DHCP to assign the IP address. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Retrieve NTP server address. */ + status = nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, NX_DHCP_OPTION_NTP_SVR, (UCHAR *)(&ntp_server_address), + &ntp_server_address_size); + + /* Check status. */ + if ((status) || (ntp_server_address_size != 4) || (ntp_server_address != IP_ADDRESS(124, 108, 20, 1))) + { + error_counter++; + } + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + test_done = NX_TRUE; + + return; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data + (14 + 20 + 8), + dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8)); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8); + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Fake the transaction id. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = 0x2233446f; + + /* Send the packet. */ + status = nx_udp_socket_send(server_socket_ptr, response_packet, IP_ADDRESS(255, 255, 255, 255), NX_DHCP_CLIENT_UDP_PORT); + + /* Check the status. */ + if (status) + { + nx_packet_release(response_packet); + } + + return status; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_ntp_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client NTP Option test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_client_nxe_api_test.c b/test/regression/dhcp_test/netx_dhcp_client_nxe_api_test.c new file mode 100644 index 00000000..75d98b5b --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_nxe_api_test.c @@ -0,0 +1,299 @@ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) +static NX_IP ip_0; +static NX_DHCP dhcp_client; +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +ULONG stack_area[100]; + +static void error_checking_test(void); +extern volatile ULONG _tx_thread_system_state; +extern TX_THREAD *_tx_thread_current_ptr; +extern TX_THREAD _tx_timer_thread; + +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +static CHAR *pointer; + + printf("NetX Test: DHCP Client Error Checking Test.........................."); + + /* Create an IP instance for the DHCP Client. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + nx_ip_create(&ip_0, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, pointer, 2048, 1); + + + _tx_thread_system_state = 0; + error_checking_test(); + _tx_thread_system_state = 1; + error_checking_test(); + _tx_thread_system_state = 0; + _tx_thread_current_ptr = TX_NULL; + error_checking_test(); + _tx_thread_current_ptr = &_tx_timer_thread; + error_checking_test(); + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +static void error_checking_test(void) +{ + + +UINT status; +UCHAR buf[4]; +ULONG val_ulong; + + /* Test _nxe_dhcp_create */ + _nxe_dhcp_create(0, 0, NX_NULL); + ip_0.nx_ip_id = 0; + _nxe_dhcp_create(0, &ip_0, NX_NULL); + ip_0.nx_ip_id = NX_IP_ID; + _nxe_dhcp_create(0, &ip_0, NX_NULL); + + + /* Test _nxe_dhcp_clear_broadcast_flag */ + _nxe_dhcp_clear_broadcast_flag(NX_NULL, 0); + + /* Test _nxe_dhcp_interface_clear_broadcast_flag */ + _nxe_dhcp_interface_clear_broadcast_flag(NX_NULL, 0, 0); + _nxe_dhcp_interface_clear_broadcast_flag(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES, 0); + + + /* Test _nxe_dhcp_packet_pool_set */ + _nxe_dhcp_packet_pool_set(&dhcp_client, NX_NULL); + _nxe_dhcp_packet_pool_set(NX_NULL, NX_NULL); + pool_1.nx_packet_pool_payload_size = 0; + _nxe_dhcp_packet_pool_set(&dhcp_client, &pool_1); + + /* Test _nxe_dhcp_reinitialize */ + _nxe_dhcp_reinitialize(NX_NULL); + + /* Test _nxe_dhcp_interface_reinitialize */ + _nxe_dhcp_interface_reinitialize(NX_NULL, 0); + _nxe_dhcp_interface_reinitialize(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + + /* This one shall fail at "NX_THREADS_ONLY_CALLER_CHECKING */ + _nxe_dhcp_interface_reinitialize(&dhcp_client, 0); + + /* Test _nxe_dhcp_request_client_ip */ + _nxe_dhcp_request_client_ip(NX_NULL, 0, 0); + _nxe_dhcp_request_client_ip(&dhcp_client, NX_BOOTP_NO_ADDRESS, 0); + + /* Test _nxe_dhcp_interface_request_client_ip */ + _nxe_dhcp_interface_request_client_ip(NX_NULL, 0, 0, 0); + _nxe_dhcp_interface_request_client_ip(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES, 0, 0); + + /* Test _nxe_dhcp_delete */ + _nxe_dhcp_delete(NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_delete(&dhcp_client); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_delete(&dhcp_client); + + /* Test _nxe_dhcp_force_renew */ + _nxe_dhcp_force_renew(NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_force_renew(&dhcp_client); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_force_renew(&dhcp_client); + + /* Test _nxe_dhcp_interface_force_renew */ + _nxe_dhcp_interface_force_renew(NX_NULL, 0); + _nxe_dhcp_interface_force_renew(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + + /* Test _nxe_dhcp_decline */ + _nxe_dhcp_decline(NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_decline(&dhcp_client); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_decline(&dhcp_client); + + + /* Test _nxe_dhcp_interface_decline */ + _nxe_dhcp_interface_decline(NX_NULL, 0); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_interface_decline(&dhcp_client, 0); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_interface_decline(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + _nxe_dhcp_interface_decline(&dhcp_client, 0); + + /* Test _nxe_dhcp_release */ + _nxe_dhcp_release(NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_release(&dhcp_client); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_release(&dhcp_client); + + /* _nxe_dhcp_interface_release */ + _nxe_dhcp_interface_release(NX_NULL, 0); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_interface_release(&dhcp_client, 0); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_interface_release(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + _nxe_dhcp_interface_release(&dhcp_client, 0); + + /* Test _nxe_dhcp_start */ + _nxe_dhcp_start(NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_start(&dhcp_client); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_start(&dhcp_client); + + /* Test _nxe_dhcp_interface_start */ + _nxe_dhcp_interface_start(NX_NULL, 0); + _nxe_dhcp_interface_start(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + _nxe_dhcp_interface_start(&dhcp_client, 0); + + /* Test _nxe_dhcp_interface_enable */ + _nxe_dhcp_interface_enable(NX_NULL, 0); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_interface_enable(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + + + /* Test _nxe_dhcp_interface_disable */ + _nxe_dhcp_interface_disable(NX_NULL, 0); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_interface_disable(&dhcp_client, 0); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_interface_disable(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + + /* Test _nxe_dhcp_state_change_notify */ + _nxe_dhcp_state_change_notify(NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_state_change_notify(&dhcp_client, NX_NULL); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_state_change_notify(&dhcp_client, NX_NULL); + + /* _nxe_dhcp_interface_state_change_notify */ + _nxe_dhcp_interface_state_change_notify(NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_interface_state_change_notify(&dhcp_client, NX_NULL); + + /* Test _nxe_dhcp_stop */ +// nx_dhcp_create(&dhcp_client, &ip_0, "dhcp_client"); + _nxe_dhcp_stop(NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_stop(&dhcp_client); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_stop(&dhcp_client); +// nx_dhcp_delete(&dhcp_client); + + + /* Test _nxe_dhcp_interface_stop */ + _nxe_dhcp_interface_stop(NX_NULL, 0); + _nxe_dhcp_interface_stop(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + _nxe_dhcp_interface_stop(&dhcp_client, 0); + + /* Test _nxe_dhcp_user_option_retrieve */ + _nxe_dhcp_user_option_retrieve(NX_NULL, 0, NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_user_option_retrieve(&dhcp_client, 0, NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_user_option_retrieve(&dhcp_client, 0, NX_NULL, NX_NULL); + _nxe_dhcp_user_option_retrieve(&dhcp_client, 0, buf, NX_NULL); + status = sizeof(buf); + _nxe_dhcp_user_option_retrieve(&dhcp_client, 0, buf, &status); + + /* Test _nxe_dhcp_user_option_request */ + _nxe_dhcp_user_option_request(NX_NULL, 0); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_user_option_request(&dhcp_client, 0); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_user_option_request(&dhcp_client, 0); + + /* Test _nxe_dhcp_interface_user_option_retrieve */ + _nxe_dhcp_interface_user_option_retrieve(NX_NULL, 0, 0, NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + _nxe_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, NX_NULL, NX_NULL); + _nxe_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, buf, NX_NULL); + _nxe_dhcp_interface_user_option_retrieve(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES, 0, buf, &status); + _nxe_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, buf, &status); + + /* Test _nxe_dhcp_user_option_convert */ + _nxe_dhcp_user_option_convert(NX_NULL); + + /* Test _nxe_dhcp_user_option_add_callback_set */ + _nxe_dhcp_user_option_add_callback_set(NX_NULL, NX_NULL); + dhcp_client.nx_dhcp_id = 0; + _nxe_dhcp_user_option_add_callback_set(&dhcp_client, NX_NULL); + + /* Test _nxe_dhcp_server_address_get */ + _nxe_dhcp_server_address_get(NX_NULL, NX_NULL); + _nxe_dhcp_server_address_get(&dhcp_client, NX_NULL); + _nxe_dhcp_server_address_get(&dhcp_client, &val_ulong); + + /* Test _nxe_dhcp_interface_server_address_get */ + _nxe_dhcp_interface_server_address_get(NX_NULL, 0, NX_NULL); + _nxe_dhcp_interface_server_address_get(&dhcp_client, 0, NX_NULL); + _nxe_dhcp_interface_server_address_get(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES, &val_ulong); + _nxe_dhcp_interface_server_address_get(&dhcp_client, 0, &val_ulong); + + + /* Test _nxe_dhcp_set_interface_index */ + _nxe_dhcp_set_interface_index(NX_NULL, 0); + _nxe_dhcp_set_interface_index(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES); + + /* Test _nxe_dhcp_send_request */ + _nxe_dhcp_send_request(NX_NULL, 0); + _nxe_dhcp_send_request(&dhcp_client, 0); + _nxe_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPFORCERENEW + 1); + + /* Test _nxe_dhcp_interface_send_request*/ + nx_dhcp_interface_send_request(NX_NULL, 0, 0); + nx_dhcp_interface_send_request(&dhcp_client, NX_MAX_PHYSICAL_INTERFACES + 1, 0); + nx_dhcp_interface_send_request(&dhcp_client, 0, 0); + + dhcp_client.nx_dhcp_id = NX_DHCP_ID; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +static CHAR *pointer; + + printf("NetX Test: DHCP Client Error Checking Test..........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_client_parameter_request_test.c b/test/regression/dhcp_test/netx_dhcp_client_parameter_request_test.c new file mode 100644 index 00000000..7fd08e0c --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_parameter_request_test.c @@ -0,0 +1,390 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_UDP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; +static UINT test_done = NX_FALSE; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_parameter_request_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +UINT index; +NX_PACKET *my_packet; +UCHAR *option_ptr; +UINT option_size; + + printf("NetX Test: DHCP Client Parameter Request Test........................"); + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive DHCP message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Check if there is NTP in parameter request list. */ + option_ptr = dhcp_search_buffer(my_packet -> nx_packet_prepend_ptr, NX_DHCP_OPTION_DHCP_PARAMETERS, my_packet -> nx_packet_length); + + /* Check if found the parameter request option. */ + if (option_ptr == NX_NULL) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + option_size = (UINT)*option_ptr; + option_ptr++; + + /* Check if option size is correct. */ + if (option_size != 3 + NX_DHCP_CLIENT_MAX_USER_REQUEST_PARAMETER) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the default option. */ + if ((*(option_ptr) != NX_DHCP_OPTION_SUBNET_MASK) || + (*(option_ptr + 1) != NX_DHCP_OPTION_GATEWAYS) || + (*(option_ptr + 2) != NX_DHCP_OPTION_DNS_SVR)) + { + printf("ERROR!\n"); + test_control_return(1); + } + option_ptr += 3; + + /* Check the user option. */ + for (index = 0; index < NX_DHCP_CLIENT_MAX_USER_REQUEST_PARAMETER; index ++) + { + if (*(option_ptr + index) != NX_DHCP_OPTION_NTP_SVR + index) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Wait for test done. */ + while(test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + error_counter++; + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add default option: subnet mask. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_SUBNET_MASK); + if (status != NX_DUPLICATED_ENTRY) + { + error_counter++; + } + + /* Add default option: gateway. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_GATEWAYS); + if (status != NX_DUPLICATED_ENTRY) + { + error_counter++; + } + + /* Add default option: dns. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_DNS_SVR); + if (status != NX_DUPLICATED_ENTRY) + { + error_counter++; + } + + /* Try to add NTP server option. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status) + { + error_counter++; + } + + /* Try to add NTP server option again. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status != NX_DUPLICATED_ENTRY) + { + error_counter++; + } + + /* Loop to fill in the array. */ + for (i = 0; i < NX_DHCP_CLIENT_MAX_USER_REQUEST_PARAMETER - 1; i++) + { + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR + i + 1); + if (status) + { + error_counter++; + } + } + + /* Try to add one more. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR + i + 1); + if (status != NX_NO_MORE_ENTRIES) + { + error_counter++; + } + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + /* Let client sends out at least one message. */ + while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_discoveries_sent == 0) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + test_done = NX_TRUE; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_parameter_request_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Parameter Request Test........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_client_secondary_interface_test.c b/test/regression/dhcp_test/netx_dhcp_client_secondary_interface_test.c new file mode 100644 index 00000000..c94b6180 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_secondary_interface_test.c @@ -0,0 +1,609 @@ +/* Testing the multiple interface DHCP Client */ + +/* This test checks that the DHCP Client can run on the secondary interface, + only using the nx_dhcp_set_interface_index for backward compatibility. + + Set MAX PHYSICAL INTERFACES to 2, NX_DHCP_CLIENT_MAX_INTERFACES to 1 + and run the demo. + */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + + +extern void test_control_return(UINT); + + +#if (NX_MAX_PHYSICAL_INTERFACES >= 2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + + +/* Define the ThreadX, NetX object control blocks... */ + +static NX_UDP_SOCKET server_socket; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +/* Define the NetX FTP object control block. */ +static NX_DHCP dhcp_client; +static UINT bound0 = NX_FALSE; +static UINT bound1 = NX_FALSE; + +static ULONG dhcp_xid = 0; + + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ +static char offer_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xF0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +static char ack_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xF0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +//0x00, 0x00, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_secondary_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", PACKET_PAYLOAD, + pointer , PACKET_PAYLOAD*6); + + pointer = pointer + (PACKET_PAYLOAD*6); + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&server_ip, "Client1 IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 10*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 10*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, " Client0 IP Instance", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the DHCP client thread. */ + +static void client_thread_entry(ULONG thread_input) +{ + +UINT status, actual_status; +UINT time_keeper = 0; + + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 5); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Register state change callbacks. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); + if (status) + error_counter++; + + /* Only interface 1 should be active! */ + status = nx_dhcp_set_interface_index(&dhcp_client, 1); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + while(bound1 != NX_TRUE) + { + + time_keeper += 100; + tx_thread_sleep(NX_IP_PERIODIC_RATE); + if (time_keeper >= 1000) + { + error_counter++; + break; + } + } + + if ((bound1 != NX_TRUE) || (bound0 == NX_TRUE)) + { + error_counter++; + } + + /* Verify interface 0 does not have a valid IP address. */ + status = nx_ip_interface_status_check(&client_ip, 0, NX_IP_ADDRESS_RESOLVED, (ULONG *) &actual_status, NX_NO_WAIT); + + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Verify interface 1 has a valid IP address. */ + status = nx_ip_interface_status_check(&client_ip, 1, NX_IP_ADDRESS_RESOLVED, (ULONG *) &actual_status, NX_NO_WAIT); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + client_running = NX_FALSE; + nx_dhcp_release(&dhcp_client); + +} + + +/* Define the helper FTP server thread. */ +static void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Secondary Interface Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES) + { + + if (i <= 1) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + else + { + + dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); + + /* Release the packet. */ + nx_packet_release(my_packet); + + status = nx_dhcp_response_packet_send(&server_socket, 68, i); + } + } + + /* Check status. */ + if (status) + { + + error_counter++; + } + + + /* Advance the index for the next response. */ + i++; + } + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Wait for the client thread to terminate. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void dhcp_test_initialize() +{ + + +/* Download data responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; +} + + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; +UCHAR *work_ptr; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + + /* Now replace the XID in the server message with what we know is the Client XID. */ + work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); + NX_CHANGE_ULONG_ENDIAN(dhcp_xid); + memcpy(work_ptr, (void const *)(&dhcp_xid), 4); + + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + + /* Send the packet with the correct port. */ + status = nx_udp_socket_interface_send(server_socket_ptr, response_packet, 0xFFFFFFFF, 68, 1); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +static void dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) +{ + + if (iface_index == 0) + { + if (new_state == NX_DHCP_STATE_BOUND) + { + bound0 = NX_TRUE; + } + } + else + { + if (new_state == NX_DHCP_STATE_BOUND) + { + bound1 = NX_TRUE; + } + + } + return; +} + + +static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_secondary_interface_test_application_define(void * first_unused_memory) +#endif +{ + + printf("NetX Test: DHCP Client Secondary Interface Test......................N/A!\n"); + test_control_return(3); +} +#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) */ + + + + + + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_send_with_zero_source_address_test.c b/test/regression/dhcp_test/netx_dhcp_client_send_with_zero_source_address_test.c new file mode 100644 index 00000000..f521c999 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_send_with_zero_source_address_test.c @@ -0,0 +1,217 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "tx_timer.h" +#include "tx_thread.h" +#include "tx_mutex.h" +#include "tx_event_flags.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; +static NX_DHCP dhcp_client2; +static NX_DHCP dhcp_client3; +static ULONG dhcp_your_address = 0; +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_send_with_zero_source_address_test_applicaiton_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + return; +} + +static UINT dhcp_user_option_add_with_long_length(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length) +{ + *user_option_length = 1100; + + return NX_TRUE; +} + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ +void client_thread_entry(ULONG thread_input) +{ +UINT status; +ULONG i; + + printf("NetX Test: DHCP Client Send with Zero Source Address Test........................................"); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + +#ifdef REQUEST_CLIENT_IP + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + + nx_dhcp_start(&dhcp_client); +#endif + + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + + /* test _nx_dhcp_client_send_with_zero_source_address*/ + client_ip.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + client_ip.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPDISCOVER); + client_ip.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPDISCOVER); + dhcp_client.nx_dhcp_ip_ptr->nx_ip_id = NX_IP_ID; + nx_ip_fragment_enable(dhcp_client.nx_dhcp_ip_ptr); + client_ip.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + client_ip.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + nx_dhcp_user_option_add_callback_set(&dhcp_client, dhcp_user_option_add_with_long_length); + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPDISCOVER); + dhcp_client.nx_dhcp_socket.nx_udp_socket_fragment_enable = NX_FRAGMENT_OKAY; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPDISCOVER); + dhcp_client.nx_dhcp_socket.nx_udp_socket_fragment_enable = NX_DONT_FRAGMENT; + + /* Use this for loop to test the corner case when the computed checksum is 0 + in function _nx_dhcp_client_send_with_zero_source_address */ + for (i = 0; i < 60000; i++) + { + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_ip_address = i; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPDISCOVER); + } + + nx_dhcp_interface_stop(&dhcp_client, 0); + nx_dhcp_delete(&dhcp_client); + + printf("SUCCESS!\n"); + test_control_return(0); + return; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_send_with_zero_source_address_test_applicaiton_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Client Send with Zero Source Address Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_server_source_port_test.c b/test/regression/dhcp_test/netx_dhcp_client_server_source_port_test.c new file mode 100644 index 00000000..51ef54a6 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_server_source_port_test.c @@ -0,0 +1,414 @@ +/* This NetX test concentrates on the DHCP operation to verify the DHCP server source port + is excluded from DHCP Client validation checks. Further the NetX /NetX Duo packet processing + should forward packets for the UDP socket bound to 68 without requiring the source port + be 67. */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ +static void client_thread_entry(ULONG thread_input); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* DCHP Unicast Interaction Message. */ + + +/* Frame (342 bytes) DHCP Offer. The server source port is modified from 67 to 83 in the OFFER + and REPLY packets for testing purposed. */ +static const unsigned char pkt2[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x50, /* .."3DV.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x79, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %y...... */ +0x00, 0x1c, 0x00, 0x53, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xdb, 0x11, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .!...."3 */ +0x44, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x1c, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Frame (342 bytes) DHCP ACK */ +static const unsigned char pkt4[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x50, /* .."3DV.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x79, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %y...... */ +0x00, 0x1c, 0x00, 0x53, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xd8, 0x10, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* . ...."3 */ +0x44, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x1c, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +ULONG dhcp_get_data_local(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_server_source_port_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG client_ip_address; +ULONG client_ip_network_mask; + + + printf("NetX Test: DHCP Client Server Source Port Test......................."); + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Clear the broadcast flag. */ + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IP address. */ + status = nx_ip_address_get(&client_ip, &client_ip_address, &client_ip_network_mask); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IP address. */ + if ((client_ip_address != IP_ADDRESS(10, 0, 0, 28)) || + (client_ip_network_mask != IP_ADDRESS(255, 255, 255, 0))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stopping the DHCP client. */ + status = nx_dhcp_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* All done. Return resources to NetX and ThreadX. */ + status = nx_dhcp_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UINT status; +ULONG dhcp_xid; +NX_PACKET *my_packet; + + /* Is this a DHCP packet e.g. not an ARP packet? */ + if (packet_ptr -> nx_packet_length < 328) + { + /* Maybe an ARP packet. let the RAM driver deal with it */ + return NX_TRUE; + } + + /* Update the packet counter. */ + packet_counter ++; + + /* Check the packet counter. */ + if (packet_counter == 1) + { + + /* Receive the DHCP Discover message. */ + + /* Send DHCP Offer message. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return NX_TRUE; + } + + /* Write the DHCP Offer message. */ + my_packet -> nx_packet_length = sizeof(pkt2) - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt2 + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + } + else if (packet_counter == 2) + { + + /* Receive the DHCP Request message, */ + + /* Send DHCP ACK message. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return NX_TRUE; + } + + /* Write the DHCP ACK message. */ + my_packet -> nx_packet_length = sizeof(pkt4) - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt4 + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + } + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_data_local(my_packet -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_XID, 4); + + /* Replace the XID. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = dhcp_xid; + + /* Receive the packet. */ + _nx_ip_packet_deferred_receive(ip_ptr, my_packet); + + return NX_TRUE; +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_server_source_port_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Server Source Port Test.......................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c b/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c new file mode 100644 index 00000000..e3168c3c --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c @@ -0,0 +1,586 @@ +/* Testing the multiple interface DHCP Client */ + +/* Test the DHCP CLient with 2 physical interfaces, set NX_DHCP_CLIENT_MAX_INTERFACES = 1 + and run the demo. It sets several attributes (request IP, skip discovery message, + set state change callback, before setting the interface to 1. The DHCP Client should + transfer those attributes to the new active interface, and clear them on the old interface.*/ + + // jlc to do + // confirm BOUND state is achieved + // test on a real network to verify probe timeouts are correct. + // need a way to 'stop' the client test. Right now it spins endlessly. + + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +#define REQUEST_CLIENT_IP +#ifdef REQUEST_CLIENT_IP +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,1,1,66) +#endif + +/* Define the ThreadX, NetX object control blocks... */ + +NX_UDP_SOCKET server_socket; +TX_THREAD client_thread; +TX_THREAD server_thread; +NX_PACKET_POOL client_pool; +NX_PACKET_POOL server_pool; +NX_IP client_ip; +NX_IP server_ip; + + +/* Define the NetX FTP object control block. */ +NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 2 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_FALSE; + + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +void server_thread_entry(ULONG thread_input); +void client_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number); +static void dhcp_test_initialize(); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 + because there are four entities (server 2 interfaces, client 2 interfaces + and the ram driver increases the MAC sequentially starting from + 11 22 33 44 56. */ +static char offer_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xF0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +#ifdef REQUEST_CLIENT_IP +0x00, 0x00, 0xc0, 0x01, 0x01, 0x43, 0xc0, 0x01, /* ........ */ +#else +0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ +#endif +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +static char ack_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xF0, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +#ifdef REQUEST_CLIENT_IP +0x00, 0x00, 0xc0, 0x01, 0x01, 0x43, 0xc0, 0x01, /* ........ */ +#else +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +#endif +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_cilent_special_attributes_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the DHCP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&server_ip, "Client1 IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, " Client0 IP Instance", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + tx_thread_sleep(20); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + + /* Set the client IP if the host is configured to do so. */ + if (status) + error_counter++; + +#ifdef REQUEST_CLIENT_IP + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_interface_state_change1); + if (status) + error_counter++; + + /* Note that we call this after setting the stage change notify and clear broadcast service. + DHCP CLient defaults these to the primary interface unless the dhcp interface has been set. + If this host is configured for multiple interfaces, this call will reset these attributes on + both interfaces. */ + status = nx_dhcp_set_interface_index(&dhcp_client, 1); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + while(dhcp_client.nx_dhcp_interface[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) + { + tx_thread_sleep(100); + } + + nx_dhcp_release(&dhcp_client); + + // jlc add status_interface check on IP address + // then wait for ****; + // if declines != 1; error + // if state != INIT/SELECTING error + +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test1............\n"); // jlc remove the \n + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES) + { + + if (i <= 1) + { + + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + else + { + printf("\nRECVd %dth packet\n", i); + + /* Release the packet. */ + nx_packet_release(my_packet); + + printf("Server sending response back. \n"); + status = nx_dhcp_response_packet_send(&server_socket, 68, i); + } + } + else + { + +#ifdef NX_DHCP_CLIENT_SEND_ARP_PROBE + /* Wait for the dhcp client to start the ARP probe process. */ + while (dhcp_client.nx_dhcp_interface[1].nx_dhcp_probe_count == 0) + tx_thread_sleep(10); +#endif + + printf("No one should send a Probe reply\n"); + } + + /* Check status. */ + if (status) + { + + printf("ERROR8!\n"); + error_counter++; + } + + + /* Advance the index for the next response. */ + i++; + } + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + /* Should get one more message from the Client, a DECLINE message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERRO7R!\n"); + error_counter++; + } + + + printf("All done, waiting for client to go away\n"); + + /* Wait for the client to terminate the connection. */ + while(client_running != NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void dhcp_test_initialize() +{ + + +/* Download data responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; + + +} + + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; +NXD_ADDRESS ip_address; + + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; + + + printf("Sending %dth response\n", packet_number); + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, 1); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + +//UINT dhcp_state; + + //dhcp_state = (UINT)new_state; + + + return; +} + + diff --git a/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c b/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c new file mode 100644 index 00000000..194e17a3 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c @@ -0,0 +1,858 @@ +/* Test the DHCP CLient with 2 physical interfaces, set NX_DHCP_CLIENT_MAX_INTERFACES = 2 + and run the demo. Note because of limitations of the ram driver there is some + code in nx_dhcp_received_data_process in the nxd_dhcp_client.c to switch + packets that should be stamped for the secondary interface. Note to that DHCP Client + is modified in nx_dhcp_start() to set the XID arbitrarily. This simply facilitates + using the server responses (using "C arrays" from a real packet trace).*/ + + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + + +#define DEMO_STACK_SIZE 4096 +#define PACKET_PAYLOAD 1518 + +extern NX_PACKET *packet_copy; // jlc ram testing + +/* Define the ThreadX, NetX object control blocks... */ + +NX_UDP_SOCKET server_socket0; +TX_THREAD server_thread0; +TX_THREAD client_thread0; +NX_PACKET_POOL client_pool; +NX_PACKET_POOL server_pool; +NX_IP client_ip; +NX_IP server_ip0; + + +/* Define the NetX FTP object control block. */ +NX_DHCP dhcp_client; + +typedef struct DHCP_RESPONSE_STRUCT +{ + char *dhcp_response_pkt_data; + int dhcp_response_pkt_size; +} DHCP_RESPONSE; + +#define NUM_RESPONSES 7 // offer, ack, ack for renew for both interfaces + // set to 7 to include an additional ack for rebind request on interface 0 +static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_running = NX_FALSE; +static UINT state_changes[2] = {0,0}; +static UINT renews[2] = {0,0}; +static UINT rebinds[2] = {0,0}; +static UINT bounds[2] = {0,0}; + +#define SERVER_PORT 67 + + +/* Replace the 'ram' driver with your Ethernet driver. */ +extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); + +void server0_thread_entry(ULONG thread_input); +void client0_thread_entry(ULONG thread_input); + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *socket_ptr, UINT port, INT packet_number, UINT iface_index); +static void dhcp_test_initialize(); + +static void dhcp_interface_state_change0(NX_DHCP *dhcp_ptr, UCHAR new_state); +static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); + +extern void test_control_return(UINT); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +char offer_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* {.....T. */ +0x58, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response_size = 300; + +/* Frame (342 bytes) */ +char ack_response[300] = { + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* {.....T. */ +0x58, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response_size = 300; + + +/* Frame (342 bytes) */ +static char renew_response[300] = { + + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* :.....T. */ +0x58, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf8, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x05, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int renew_response_size = 300; + +/* Frame (342 bytes) */ +static char rebind_response[300] = { + + +0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* g.....T. */ +0x58, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0xf9, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x07, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +static int rebind_response_size = 300; + + +/* Responses from server on interface 1 */ + +char offer_response1[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xf0, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ +0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ +0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ +0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ +0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int offer_response1_size = 300; + +/* Frame (342 bytes) */ +char ack_response1[300] = { + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* {.....T. */ +0xf0, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int ack_response1_size = 300; + + +/* Frame (342 bytes) */ +static char renew_response1[300] = { + + +0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, /* :.....T. */ +0xf0, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x01, 0x01, 0xf8, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ +0x05, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ +0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ +0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ +0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int renew_response1_size = 300; + + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_cilent_two_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main server thread. */ + status = tx_thread_create(&server_thread0, "Server0 thread ", server0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip0, + "Server IP", + IP_ADDRESS(192,2,2,1), + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + status = nx_ip_interface_attach(&server_ip0, "Server1 interface", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip0); + if (status) + error_counter++; + + /* Set up the Client. */ + + /* Create the main client thread. */ + status = tx_thread_create(&client_thread0, "Client thread ", client0_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the client. */ + status = nx_ip_create(&client_ip, "Client0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&client_ip, "Client1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Enable ARP and supply ARP cache memory for the Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + nx_udp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the main DHCP client thread. */ +void client0_thread_entry(ULONG thread_input) +{ + +UINT status; + + tx_thread_sleep(20); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); + if (status) + error_counter++; + + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; + + /* Register state change variable. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, 0, dhcp_interface_state_change0); + if (status) + error_counter++; + + + /* Register state change variable. */ + status = nx_dhcp_interface_state_change_notify(&dhcp_client, 1, dhcp_interface_state_change1); + if (status) + error_counter++; + + printf("Start the client\n\n"); + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + while(client_running == NX_FALSE) + { + tx_thread_sleep(100); + } + + // jlc add status_interface check on IP address + // then wait for ****; if renews[0] != 1; error + // then wait for expire, and ***; if rebounds != 1 error + +} + +/* Define the helper DHCP server thread on interface 0. */ +void server0_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, j, k; + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client Two Interface Test............................\n"); // jlc remove the \n + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip0, &server_socket0, "Server0 socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_udp_socket_bind(&server_socket0, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + dhcp_test_initialize(); + i = 0; + j = 4; // index into array of responses to send from interface server 1 + k = 0; // count of packets received on interface 1 + + /* Wait for Client requests */ + //while (i < 3) // Reduce this to see client packet retransmissions + while (i < NUM_RESPONSES) // jlc this let's the DHCP protocol complete. + { + + status = nx_udp_socket_receive(&server_socket0, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERRO7R on 0!\n"); + error_counter++; + } + else + { + + ULONG source_ip_address; + UINT protocol; + UINT source_port; + UINT iface_index; + + UCHAR *work_ptr = my_packet -> nx_packet_prepend_ptr + 4; + ULONG *id = (ULONG *)work_ptr; + + NX_CHANGE_ULONG_ENDIAN(*id); + + status = nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); + + if ((iface_index == 1) && (*id != 0x2a3ef01d)) + { + /* This packet is really intended for the server on the primary interface. */ + my_packet -> nx_packet_ip_interface = &(server_ip0.nx_ip_interface[0]); + iface_index = 0; + } + else if ((iface_index == 0) && (*id != 0x319d58a2)) + { + /* This packet is really intended for server on secondary interface. */ + my_packet -> nx_packet_ip_interface = &(server_ip0.nx_ip_interface[1]); + iface_index = 1; + } + + /* Is this packet from the client on interface 1? */ + if (*id == 0x2a3ef01d) + { + +// do this silliness to drop server packets +if (i != 1) +{ +////////// + + /* Yes, make sure to send it out on interface 1. */ + printf("Server 1 got %dth packet. Send %d packet back\n", k, j-4); + status = nx_dhcp_response_packet_send(&server_socket0, 68, j, 1); +} + j++; + k++; + + } + else + { +if (i != 1) +{ + printf("Server 0 got %dth packet\n", i); + status = nx_dhcp_response_packet_send(&server_socket0, 68, i, 0); +} + i++; + } + nx_packet_release(my_packet); + } + } + + printf("0: All done, waiting for client 0 to go away\n"); + + /* Wait for the client to terminate the connection. */ + while(client_running != NX_TRUE) + tx_thread_sleep(20); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&server_socket0); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + + + +static void dhcp_test_initialize() +{ + + +/* Download data responses */ + dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; + dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; + + dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; + dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; + + dhcp_response[2].dhcp_response_pkt_data = &renew_response[0]; + dhcp_response[2].dhcp_response_pkt_size = renew_response_size ; + + dhcp_response[3].dhcp_response_pkt_data = &rebind_response[0]; + dhcp_response[3].dhcp_response_pkt_size = rebind_response_size ; + + /* Server on second interface */ + + dhcp_response[4].dhcp_response_pkt_data = &offer_response1[0]; + dhcp_response[4].dhcp_response_pkt_size = offer_response1_size ; + + dhcp_response[5].dhcp_response_pkt_data = &ack_response1[0]; + dhcp_response[5].dhcp_response_pkt_size = ack_response1_size ; + + dhcp_response[6].dhcp_response_pkt_data = &renew_response1[0]; + dhcp_response[6].dhcp_response_pkt_size = renew_response1_size ; + +} + + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket0, UINT port, INT packet_number, UINT iface_index) +{ +UINT status; +NX_PACKET *response_packet; +UINT local_index; + + local_index = packet_number; + if (iface_index == 1) + { + local_index = packet_number - 4; + } + printf("Server %d sends %dth response\n", iface_index, local_index); + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, + dhcp_response[packet_number].dhcp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + if (iface_index == 0) + { + + + /* Set driver callback function. */ + //advanced_packet_process_callback = advanced_packet_process; + + /* Send the packet with the correct port. */ + status = nx_udp_socket_send(server_socket0, response_packet, 0xFFFFFFFF, 68); + } + else + { + + /* Send the packet with the correct port. */ + //status = nx_udp_socket_send(&server_socket1, response_packet, 0xFFFFFFFF, 68); + NXD_ADDRESS temp; + temp.nxd_ip_version = NX_IP_VERSION_V4; + temp.nxd_ip_address.v4 = 0xFFFFFFFF; + status = nxd_udp_socket_source_send(server_socket0, response_packet, &temp, 68, 1); + } + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + + +void dhcp_interface_state_change0(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + +UINT dhcp_state; + + dhcp_state = (UINT)new_state; + + + /* Increment state changes counter. */ + state_changes[0]++; + + if (dhcp_state == NX_DHCP_STATE_RENEWING) + { + renews[0]++; + } + else if (dhcp_state == NX_DHCP_STATE_REBINDING) + { + rebinds[0]++; + } + else if (dhcp_state == NX_DHCP_STATE_BOUND) + { + bounds[0]++; + } + + return; +} + + +void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + +UINT dhcp_state; + + dhcp_state = (UINT)new_state; + + + /* Increment state changes counter. */ + state_changes[1]++; + + if (dhcp_state == NX_DHCP_STATE_RENEWING) + { + renews[1]++; + } + else if (dhcp_state == NX_DHCP_STATE_REBINDING) + { + rebinds[1]++; + } + else if (dhcp_state == NX_DHCP_STATE_BOUND) + { + bounds[1]++; + } + + return; +} + diff --git a/test/regression/dhcp_test/netx_dhcp_clone_function.c b/test/regression/dhcp_test/netx_dhcp_clone_function.c new file mode 100644 index 00000000..b681df35 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_clone_function.c @@ -0,0 +1,125 @@ + +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + + +UINT dhcp_get_option_value(UCHAR *bootp_message, UINT option, ULONG *value, UINT length) +{ + +UCHAR *data; + + + /* Find the option. */ + if ((option != NX_DHCP_OPTION_PAD) && (option != NX_DHCP_OPTION_END)) + { + + /* Search the buffer for the option. */ + data = dhcp_search_buffer(bootp_message, option, length); + + /* Check to see if the option was found. */ + if (data != NX_NULL) + { + + /* Check for the proper size. */ + if (*data > 4) + { + + /* Check for the gateway option. */ + if (option == NX_DHCP_OPTION_GATEWAYS) + { + + /* Pickup the first gateway address. */ + *value = dhcp_get_data(data + 1, 4); + + /* For now, just disregard any additional gateway addresses. */ + return(NX_SUCCESS); + } + else + { + + /* Invalid size, return error. */ + return(NX_SIZE_ERROR); + } + } + else + { + + /* Get the actual value. */ + *value = dhcp_get_data(data + 1, *data); + return(NX_SUCCESS); + } + } + } + + /* Return an error if not found. */ + return(NX_OPTION_ERROR); +} +UCHAR *dhcp_search_buffer(UCHAR *bootp_message, UINT option, UINT length) +{ + +UCHAR *data; +UINT i; + + + /* Setup buffer pointer. */ + data = &bootp_message[NX_BOOTP_OFFSET_OPTIONS]; + i = NX_BOOTP_OFFSET_OPTIONS; + + /* Search as long as there are valid options. */ + while (i < length) + { + + /* Simply skip any padding */ + if (*data == NX_DHCP_OPTION_PAD) + { + + data++; + i++; + } + + /* On a match, return a pointer to the size. */ + else if (*data == option) + { + + /* Return a pointer to the option size byte. */ + return(data + 1); + } + + /* Otherwise skip the option by adding the size to the pointer. */ + else + { + + UINT size = *(++data); + + /* skip the data plus the size byte */ + data += size + 1; + i += size + 1; + } + } + + /* Return NULL to indicate the option was not found. */ + return(NX_NULL); +} +ULONG dhcp_get_data(UCHAR *data, UINT size) +{ + +ULONG value = 0; + + + /* Process the data retrieval request. */ + while (size-- > 0) + { + + /* Build return value. */ + value = (value << 8) | *data++; + } + + /* Return value. */ + return(value); +} diff --git a/test/regression/dhcp_test/netx_dhcp_clone_function.h b/test/regression/dhcp_test/netx_dhcp_clone_function.h new file mode 100644 index 00000000..2695be88 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_clone_function.h @@ -0,0 +1,6 @@ +#include "nx_api.h" + +/* Declare the function. */ +UINT dhcp_get_option_value(UCHAR *bootp_message, UINT option, ULONG *value, UINT length); +UCHAR *dhcp_search_buffer(UCHAR *bootp_message, UINT option, UINT length); +ULONG dhcp_get_data(UCHAR *data, UINT size); diff --git a/test/regression/dhcp_test/netx_dhcp_coverage_test.c b/test/regression/dhcp_test/netx_dhcp_coverage_test.c new file mode 100644 index 00000000..418228a8 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_coverage_test.c @@ -0,0 +1,907 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#include "tx_timer.h" +#include "tx_thread.h" +#include "tx_mutex.h" +#include "tx_event_flags.h" + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define DHCP_TEST_LONG_NAME "dhcp_client_make_the_string_length_exceed_255_to_test_the_corner_case_in_function \ + netx_dhcp_send_request_internal__________________________________________________ \ + _________________________________________________________________________________ \ + _________________________________________________________________________________ \ + _________________________________________________________________________________ \ + _________________________________________________________________________________ \ + _________________________________________________________________________________ \ + _________________________________________________________________________________" + +#define NX_DHCP_OPTION_ARP_TIMEOUT 35 + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; +static NX_DHCP dhcp_client2; +static NX_DHCP dhcp_client3; +static ULONG dhcp_your_address = 0; + +/* Frame (342 bytes) */ +static unsigned char option_message[60] = { +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet Mask */ +0x36, 0x04, 0xe0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0xff, 0xff, 0xff, 0xff, /* IP address lease time */ +0x03, 0x04, 0xc0, 0x02, 0x00, 0x00, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0x3a, 0x04, 0xff, 0xff, 0xff, 0xff, /* Renewal time */ +0x3b, 0x04, 0xff, 0xff, 0xff, 0xff, /* Rebind time */ +0x23, 0x04, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0xff, 0x00, 0x00 +}; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +extern VOID _nx_dhcp_packet_process(NX_DHCP *dhcp_ptr, NX_DHCP_INTERFACE_RECORD *interface_record, NX_PACKET *packet_ptr); +extern UINT _nx_dhcp_packet_pool_set(NX_DHCP *dhcp_ptr, NX_PACKET_POOL *packet_pool_ptr); +extern UINT _nx_dhcp_decline(NX_DHCP *dhcp_ptr); +/* Define thread prototypes. */ + +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_coverage_test_applicaiton_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + return; +} + +static void state_change_cb(NX_DHCP *dhcp_ptr, UCHAR state) +{ + return; +} + +static UINT dhcp_user_option_add_with_false_return(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length) +{ + return NX_FALSE; +} + +static UINT dhcp_user_option_add(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length) +{ + *user_option_length = 301; + + return NX_TRUE; +} + +static void interface_state_change_cb(NX_DHCP *dhcp_ptr, UINT iface, UCHAR state) +{ + return; +} + +static NX_PACKET * create_dhcp_packet(int length) +{ + NX_PACKET* packet_ptr; +#ifdef __PRODUCT_NETXDUO__ + nx_packet_allocate(&client_pool, &packet_ptr, NX_IPv4_UDP_PACKET, NX_NO_WAIT); +#else + nx_packet_allocate(&client_pool, &packet_ptr, NX_UDP_PACKET, NX_NO_WAIT); +#endif +#ifdef __PRODUCT_NETXDUO__ + packet_ptr->nx_packet_ip_version = NX_IP_VERSION_V4; +#endif + packet_ptr->nx_packet_queue_next = NX_NULL; + packet_ptr->nx_packet_length = length; +#ifdef __PRODUCT_NETXDUO__ + packet_ptr->nx_packet_address.nx_packet_interface_ptr = &client_ip.nx_ip_interface[0]; +#else + packet_ptr->nx_packet_ip_interface = &client_ip.nx_ip_interface[0]; +#endif +#ifdef __PRODUCT_NETXDUO__ + packet_ptr->nx_packet_ip_header = packet_ptr->nx_packet_prepend_ptr - sizeof(NX_IPV4_HEADER); +#endif + packet_ptr->nx_packet_append_ptr += packet_ptr->nx_packet_length; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_XID] = ((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid) >> 24) & 0xFF; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_XID + 1] = ((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid) >> 16) & 0xFF; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_XID + 2] = ((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid) >> 8) & 0xFF; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_XID + 3] = (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid) & 0xFF; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW] = 0; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 1] = 0x11; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 2] = 0x22; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 3] = 0x33; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 4] = 0x44; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 5] = 0x56; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_YOUR_IP] = dhcp_your_address >> 24; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_YOUR_IP + 1] = (dhcp_your_address >> 16) & 0xFF ; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_YOUR_IP + 2] = (dhcp_your_address >> 8) & 0xFF; + packet_ptr->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_YOUR_IP + 3] = dhcp_your_address & 0xFF; + + dhcp_client.nx_dhcp_socket.nx_udp_socket_receive_head = packet_ptr; + dhcp_client.nx_dhcp_socket.nx_udp_socket_receive_count++; + packet_ptr->nx_packet_prepend_ptr -=8; + packet_ptr->nx_packet_length += 8; + return(packet_ptr); + +} + +static NX_PACKET * build_dhcp_packet(int length, UCHAR option_type, UCHAR val_len, UCHAR val) +{ + NX_PACKET *my_packet; + + my_packet = create_dhcp_packet(length); + my_packet->nx_packet_prepend_ptr[8+NX_BOOTP_OFFSET_OPTIONS]=option_type; + my_packet->nx_packet_prepend_ptr[8+NX_BOOTP_OFFSET_OPTIONS+1]=val_len; + my_packet->nx_packet_prepend_ptr[8+NX_BOOTP_OFFSET_OPTIONS+2]=val; + + return(my_packet); +} + +extern VOID _nx_dhcp_timeout_process(NX_DHCP* dhcp_ptr); +extern TX_THREAD _tx_timer_thread; +/* Define the test threads. */ +void client_thread_entry(ULONG thread_input) +{ +ULONG current_system_state; +TX_THREAD *current_thread_ptr; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG long_val; +ULONG payload_size = 0; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +#endif + +TX_TIMER *timer_ptr; +TX_MUTEX *mutex_ptr; +TX_THREAD *thread_ptr; +TX_EVENT_FLAGS_GROUP *event_flags; +NX_PACKET *my_packet = NX_NULL; + printf("NetX Test: DHCP coverage Test........................................"); + + /* Force timer create to fail. */ + timer_ptr = _tx_timer_created_ptr; + _tx_timer_created_ptr = &dhcp_client.nx_dhcp_timer; + _tx_timer_created_count++; + + /* Create the DHCP instance. */ + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + + /* Restore the timer structure. */ + _tx_timer_created_ptr = timer_ptr; + _tx_timer_created_count--; + + /* Force mutex create to fail. */ + mutex_ptr = _tx_mutex_created_ptr; + _tx_mutex_created_ptr = &dhcp_client.nx_dhcp_mutex; + _tx_mutex_created_count++; + /* Create the DHCP instance. */ + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + + /* Restore mutex. */ + _tx_mutex_created_ptr = mutex_ptr; + _tx_mutex_created_count--; + + /* Force Thread create to fail.*/ + thread_ptr = _tx_thread_created_ptr; + _tx_thread_created_ptr = &dhcp_client.nx_dhcp_thread; + _tx_thread_created_count++; + /* Create the DHCP instance. */ + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + + /* Restore thread list. */ + _tx_thread_created_ptr = thread_ptr; + _tx_thread_created_count--; + + /* Force event flag create to fail */ + event_flags = _tx_event_flags_created_ptr; + _tx_event_flags_created_count ++; + _tx_event_flags_created_ptr = &dhcp_client.nx_dhcp_events; + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + + + /* Restore event flasg */ + _tx_event_flags_created_ptr = event_flags; + _tx_event_flags_created_count--; + + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + /* Test nx_dhcp_interface_clear_broadcast_flag */ + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_clear_broadcast_flag(&dhcp_client, 0, 0); + + /* Enable one record */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_interface_index = 0; + nx_dhcp_interface_clear_broadcast_flag(&dhcp_client, 0, 0); + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + /* Cover _nx_dhcp_packet_pool_set */ + nx_dhcp_packet_pool_set(&dhcp_client, NX_NULL); + _nx_dhcp_packet_pool_set(&dhcp_client, NX_NULL); + nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); +#endif + + /* Cover _nxe_dhcp_reinitialize */ + nx_dhcp_reinitialize(&dhcp_client); + + /* Cover nx_dhcp_interface_reinitialize */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_reinitialize(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + nx_dhcp_interface_reinitialize(&dhcp_client, 0); + + + /* Cover nx_dhcp_(interface_)request_client_ip */ + nx_dhcp_request_client_ip(&dhcp_client, 1, 0); + nx_dhcp_interface_request_client_ip(&dhcp_client, 0, 1, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_request_client_ip(&dhcp_client, 1, 0); + nx_dhcp_interface_request_client_ip(&dhcp_client, 0, 1, 0); + + + /* Cover nx_dhcp_force_renew */ + dhcp_client.nx_dhcp_id = NX_DHCP_ID; + nx_dhcp_force_renew(&dhcp_client); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + nx_dhcp_force_renew(&dhcp_client); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_force_renew(&dhcp_client); + + /* Cover nx_dhcp_interface_force_renew */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + dhcp_client.nx_dhcp_state_change_callback = state_change_cb; + dhcp_client.nx_dhcp_interface_state_change_callback = interface_state_change_cb; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + + /* Cover _nx_dhcp_update_renewal_timeout through calling nx_dhcp_interface_force_renew */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_rebind_time = 8000; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_renewal_time = 1000; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + + /* Cover the static function _nx_dhcp_send_request_interval through calling API functions */ + payload_size = dhcp_client.nx_dhcp_packet_pool_ptr->nx_packet_pool_payload_size; + dhcp_client.nx_dhcp_packet_pool_ptr->nx_packet_pool_payload_size = 0; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + dhcp_client.nx_dhcp_packet_pool_ptr->nx_packet_pool_payload_size = payload_size; + dhcp_client.nx_dhcp_name = DHCP_TEST_LONG_NAME; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + dhcp_client.nx_dhcp_name = "dhcp_client"; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_ip_address = NX_BOOTP_BC_ADDRESS; + nx_dhcp_interface_force_renew(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_server_ip = NX_BOOTP_BC_ADDRESS; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPREQUEST); + dhcp_client.nx_dhcp_name = NULL; + nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); + dhcp_client.nx_dhcp_name = DHCP_TEST_LONG_NAME; + nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); + nx_dhcp_user_option_add_callback_set(&dhcp_client, dhcp_user_option_add_with_false_return); + nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); + dhcp_client.nx_dhcp_name = DHCP_TEST_LONG_NAME; + nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPDISCOVER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_ip_address = 1; + nx_dhcp_decline(&dhcp_client); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_ip_address = NX_BOOTP_BC_ADDRESS; + nx_dhcp_decline(&dhcp_client); + nx_dhcp_user_option_add_callback_set(&dhcp_client, dhcp_user_option_add); + nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); + + /* Cover nx_dhcp_decline */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_decline(&dhcp_client); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_decline(&dhcp_client); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_decline(&dhcp_client); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_decline(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_interface_decline(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + dhcp_client.nx_dhcp_state_change_callback = NX_NULL; + dhcp_client.nx_dhcp_interface_state_change_callback = NX_NULL; + nx_dhcp_interface_decline(&dhcp_client, 0); + + /* Test _nx_dhcp_release */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_release(&dhcp_client); + + /* Test nx_dhcp_interface_start */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_start(&dhcp_client, 0); + + /* Test nx_dhcp_interface_release */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_release(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_interface_release(&dhcp_client, 0); + dhcp_client.nx_dhcp_state_change_callback = state_change_cb; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_interface_release(&dhcp_client, 0); + + /* Test nx_dhcp_interface_stop */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_stop(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_NOT_STARTED; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + nx_dhcp_interface_stop(&dhcp_client, 0); + + /* Test nx_dhcp_user_option_retrieve*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + buffer_size = sizeof(buffer); + nx_dhcp_user_option_retrieve(&dhcp_client, 0, buffer, &buffer_size); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + buffer_size = sizeof(buffer); + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, buffer, &buffer_size); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + buffer_size = sizeof(buffer); + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, buffer, &buffer_size); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, buffer, &buffer_size); + buffer_size = 1; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_options_size = 4; + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0, buffer, &buffer_size); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_options_buffer[0] = 1; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_options_buffer[1] = 2; + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 1, buffer, &buffer_size); + buffer_size = 4; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_options_buffer[0] = 0xFF; + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 0xFF, buffer, &buffer_size); + + /* Test _nx_dhcp_search_buffer through nx_dhcp_interface_user_option_retrieve */ + dhcp_client.nx_dhcp_interface_record->nx_dhcp_options_buffer[0] = 1; + dhcp_client.nx_dhcp_interface_record->nx_dhcp_options_buffer[1] = 5; + dhcp_client.nx_dhcp_interface_record->nx_dhcp_options_size = 4; + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, 1, buffer, &buffer_size); + memcpy(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_options_buffer, option_message, 60); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_options_size = 60; + nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, NX_DHCP_OPTION_ARP_TIMEOUT, buffer, &buffer_size); + + /* Test _nx_dhcp_interface_disable*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_disable(&dhcp_client, 0); + + /* Test _nx_dhcp_user_option_retrieve*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_user_option_retrieve(&dhcp_client, 0, NX_NULL, NX_NULL); + + /* Test nx_dhcp_user_option_convert*/ + long_val = nx_dhcp_user_option_convert(buffer); + + /* Test nx_dhcp_send_request*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_send_request(&dhcp_client, 1); + + /* Test nx_dhcp_interface_send_request*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_send_request(&dhcp_client, 0, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPRELEASE); + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPDECLINE); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_NOT_STARTED; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_interface_send_request(&dhcp_client, 0, NX_DHCP_TYPE_DHCPACK); + + /*Test nx_dhcp_server_address_get*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_server_address_get(&dhcp_client, &long_val); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_server_address_get(&dhcp_client, &long_val); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_server_address_get(&dhcp_client, &long_val); + + /* Test nx_dhcp_interface_server_address_get*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + nx_dhcp_interface_server_address_get(&dhcp_client, 0, &long_val); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND; + nx_dhcp_interface_server_address_get(&dhcp_client, 0, &long_val); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOUND - 1; + nx_dhcp_interface_server_address_get(&dhcp_client, 0, &long_val); + + /* Test DHCP delete */ + current_system_state = _tx_thread_system_state; + _tx_thread_system_state = 1; + nx_dhcp_delete(&dhcp_client); + _tx_thread_system_state = current_system_state; + current_thread_ptr = _tx_thread_current_ptr; + _tx_thread_current_ptr = TX_NULL; + nx_dhcp_delete(&dhcp_client); + _tx_thread_current_ptr = &_tx_timer_thread; + nx_dhcp_delete(&dhcp_client); + _tx_thread_current_ptr = current_thread_ptr; + nx_dhcp_delete(&dhcp_client); + + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + nx_dhcp_create(&dhcp_client2, &client_ip, "dhcp_client2"); + nx_dhcp_create(&dhcp_client3, &client_ip, "dhcp_client3"); + + nx_dhcp_delete(&dhcp_client); + nx_dhcp_delete(&dhcp_client2); + nx_dhcp_delete(&dhcp_client3); + + + current_system_state = _tx_thread_system_state; + _tx_thread_system_state = 1; + nx_dhcp_force_renew(&dhcp_client); + _tx_thread_system_state = current_system_state; + current_thread_ptr = _tx_thread_current_ptr; + _tx_thread_current_ptr = TX_NULL; + nx_dhcp_force_renew(&dhcp_client); + _tx_thread_current_ptr = &_tx_timer_thread; + nx_dhcp_force_renew(&dhcp_client); + _tx_thread_current_ptr = current_thread_ptr; + nx_dhcp_force_renew(&dhcp_client); + nx_dhcp_delete(&dhcp_client); + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + /* Force nx_dhcp_start to fail. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_FALSE; + + /* Start the DHCP Client. */ + nx_dhcp_start(&dhcp_client); + + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_BOOT; + /* Start the DHCP Client. */ + nx_dhcp_start(&dhcp_client); + + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = 0; + dhcp_client.nx_dhcp_socket.nx_udp_socket_bind_in_progress = _tx_thread_current_ptr; + /* Start the DHCP Client. */ + nx_dhcp_start(&dhcp_client); + dhcp_client.nx_dhcp_socket.nx_udp_socket_bind_in_progress = TX_NULL; + dhcp_client.nx_dhcp_thread.tx_thread_id = 0; + nx_dhcp_start(&dhcp_client); + dhcp_client.nx_dhcp_thread.tx_thread_id = TX_THREAD_ID; + dhcp_client.nx_dhcp_timer.tx_timer_id = 0; + nx_dhcp_start(&dhcp_client); + dhcp_client.nx_dhcp_timer.tx_timer_id = TX_TIMER_ID; + nx_dhcp_delete(&dhcp_client); + + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + + /* Test nx_dhcp_interface_enable */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_interface_index = 0; + nx_dhcp_interface_enable(&dhcp_client, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_interface_index = 1; +#if(NX_MAX_PHYSICAL_INTERFACES > 1) + dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_interface_index = 2; +#endif + nx_dhcp_interface_enable(&dhcp_client, 0); + nx_dhcp_delete(&dhcp_client); + + /* Test nx_dhcp_packet_process */ + nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + nx_dhcp_start(&dhcp_client); + dhcp_client.nx_dhcp_socket.nx_udp_socket_disable_checksum = NX_TRUE; + +#ifndef NX_ENABLE_INTERFACE_CAPABILITY + /* Inject a packet that causes nx_udp_packet_info_extract() to fail. */ + my_packet = create_dhcp_packet(30); +#ifdef __PRODUCT_NETXDUO__ + my_packet->nx_packet_ip_version = 0; +#endif + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Now test nx_dhcp_packet_process, test failures on the 1st check. */ + my_packet = create_dhcp_packet(30); +#ifdef __PRODUCT_NETXDUO__ + my_packet->nx_packet_ip_version = NX_IP_VERSION_V4; +#endif + dhcp_client.nx_dhcp_socket.nx_udp_socket_receive_head = my_packet; + dhcp_client.nx_dhcp_socket.nx_udp_socket_receive_count++; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); +#endif + + /* Attempt to cause the DHCP internal packet allocate to fail.*/ + { + UINT status; + NX_PACKET* packet1, * packet2, * packet3, * packet4, * packet5; +#ifdef __PRODUCT_NETXDUO__ + status = nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet1, NX_IPv4_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet2, NX_IPv4_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet3, NX_IPv4_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet4, NX_IPv4_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet5, NX_IPv4_UDP_PACKET, NX_NO_WAIT); +#else + status = nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet1, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet2, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet3, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet4, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_allocate(dhcp_client.nx_dhcp_packet_pool_ptr, &packet5, NX_UDP_PACKET, NX_NO_WAIT); +#endif + + my_packet = create_dhcp_packet(1000); + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + nx_packet_release(packet1); nx_packet_release(packet2); nx_packet_release(packet3); nx_packet_release(packet4); nx_packet_release(packet5); + + } + + /* Attemp to send a bigger packet to test the case incoming packet bigger than DHCP packets.*/ + my_packet = create_dhcp_packet(1000); + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + my_packet = create_dhcp_packet(400); + my_packet->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 1] = 2; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + my_packet = create_dhcp_packet(400); + my_packet->nx_packet_prepend_ptr[NX_BOOTP_OFFSET_CLIENT_HW + 5] = 0x55; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + { + build_dhcp_packet(400, 0, 0, 0); + /* intentionally set incorrect state.*/ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_ADDRESS_PROBING + 1; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + } + { + build_dhcp_packet(400, 0, 0, 0); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + } + { + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPOFFER+1); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + } + { + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_your_address = 0; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + + dhcp_your_address = 0xFFFFFFFF; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0x7F010001; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0x80010001; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0xC0010100; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + } + { + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_SERVER, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REBINDING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REBINDING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0x10203040; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REBINDING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPNACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REBINDING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPRELEASE); + + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REBINDING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + } + + { + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_SERVER, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_RENEWING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_RENEWING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0x10203040; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_RENEWING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPNACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_RENEWING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPRELEASE); + + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_RENEWING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + } + + { + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_SERVER, 1, NX_DHCP_TYPE_DHCPOFFER); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + dhcp_your_address = 0x10203040; + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPNACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPRELEASE); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPNACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_timeout = 1; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + + + build_dhcp_packet(400, NX_DHCP_OPTION_DHCP_TYPE, 1, NX_DHCP_TYPE_DHCPNACK); + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_renewal_time = NX_IP_PERIODIC_RATE + 1; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_RECEIVE_EVENT, TX_OR); + tx_thread_sleep(1); + } + + { + NX_DHCP_INTERFACE_RECORD *interface_record = &dhcp_client.nx_dhcp_interface_record[0]; + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_INIT; + interface_record->nx_dhcp_ip_address = 1; + interface_record->nx_dhcp_skip_discovery = NX_FALSE; + interface_record->nx_dhcp_rtr_interval = 1; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_SELECTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_REQUESTING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_ADDRESS_PROBING; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_RENEWING; + interface_record->nx_dhcp_rtr_interval = 2; + interface_record->nx_dhcp_renewal_remain_time = 1; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_RENEWING; + interface_record->nx_dhcp_rtr_interval = 2; + interface_record->nx_dhcp_renewal_remain_time = 7; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_REBINDING; + interface_record->nx_dhcp_rtr_interval = 2; + interface_record->nx_dhcp_rebind_remain_time = 1; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = NX_DHCP_STATE_REBINDING; + interface_record->nx_dhcp_rtr_interval = 2; + interface_record->nx_dhcp_rebind_remain_time = 10; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + interface_record->nx_dhcp_record_valid = NX_TRUE; + interface_record->nx_dhcp_timeout = 1; + interface_record->nx_dhcp_state = 0xFF; + interface_record->nx_dhcp_rtr_interval = 2; + interface_record->nx_dhcp_renewal_remain_time = 3; + tx_event_flags_set(&dhcp_client.nx_dhcp_events, NX_DHCP_CLIENT_TIMER_EVENT, TX_OR); + tx_thread_sleep(1); + + } + + printf("SUCCESS!\n"); + test_control_return(0); + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_coverage_test_applicaiton_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Coverage Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_delete_test.c b/test/regression/dhcp_test/netx_dhcp_delete_test.c new file mode 100644 index 00000000..18990056 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_delete_test.c @@ -0,0 +1,425 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static NX_IP client_dummy1_ip; +static NX_DHCP dhcp_client_dummy1; +static NX_IP client_dummy2_ip; +static NX_DHCP dhcp_client_dummy2; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_delete_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Delete Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + + /* Create 2 Dummy DHCP instances to test the corner case of _nx_dhcp_delete */ + client_dummy1_ip.nx_ip_id = NX_IP_ID; + status = nx_dhcp_create(&dhcp_client_dummy1, &client_dummy1_ip, "dhcp_client_dummy1"); + if (status) + error_counter++; + client_dummy2_ip.nx_ip_id = NX_IP_ID; + status = nx_dhcp_create(&dhcp_client_dummy2, &client_dummy2_ip, "dhcp_client_dummy2"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* Set the value to test the corner case when _nx_dhcp_created_ptr != dhcp_ptr and dhcp_previous -> nx_dhcp_created_next */ + dhcp_client_dummy1.nx_dhcp_created_next = NX_NULL; + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_delete_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Delete Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_enable_test.c b/test/regression/dhcp_test/netx_dhcp_enable_test.c new file mode 100644 index 00000000..c380f18b --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_enable_test.c @@ -0,0 +1,419 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_enable_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Enable Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Now stop the DHCP Client 0. */ + status = nx_dhcp_interface_disable(&dhcp_client, 0); + if (status) + error_counter++; + + for (UINT i = 0; i < NX_DHCP_CLIENT_MAX_RECORDS; i++) + { + dhcp_client.nx_dhcp_interface_record[i].nx_dhcp_record_valid = NX_TRUE; + dhcp_client.nx_dhcp_interface_record[i].nx_dhcp_interface_index = 1; + } + nx_dhcp_interface_enable(&dhcp_client, 0); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_enable_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Enable Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_extract_information_test.c b/test/regression/dhcp_test/netx_dhcp_extract_information_test.c new file mode 100644 index 00000000..d4f0f781 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_extract_information_test.c @@ -0,0 +1,1034 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define DHCP_RESPONSE_TEST_CASE_NUM 11 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_UDP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT test_done = NX_FALSE; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +typedef struct DHCP_RESPONSE_STRUCT +{ + UCHAR *dhcp_response_pkt_data; + UINT dhcp_response_pkt_size; +} DHCP_RESPONSE; + +static DHCP_RESPONSE dhcp_response[DHCP_RESPONSE_TEST_CASE_NUM]; + +/* Frame (342 bytes) */ +static unsigned char first_bad_offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, /* Subnet Mask */ +0x36, 0x04, 0x00, 0x00, 0x00, 0x00, /* Server identifier */ +0x33, 0x04, 0xff, 0xff, 0xff, 0xff, /* IP address lease time */ +0x03, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Router */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char second_bad_offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet Mask */ +0x36, 0x04, 0xe0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0xff, 0xff, 0xff, 0xff, /* IP address lease time */ +0x03, 0x04, 0xc0, 0x02, 0x00, 0x00, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0x3a, 0x04, 0xff, 0xff, 0xff, 0xff, /* Renewal time */ +0x3b, 0x04, 0xff, 0xff, 0xff, 0xff, /* Rebind time */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00 +}; + +/* Frame (665 bytes) */ +static unsigned char first_good_offer[665] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet Mask */ +0x36, 0x04, 0x80, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0xff, 0xff, 0xff, 0xff, /* IP address lease time */ +0x03, 0x04, 0xc0, 0x01, 0x00, 0x00, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0x3a, 0x04, 0xff, 0xff, 0xff, 0xff, /* Renewal time */ +0x3b, 0x04, 0x00, 0xff, 0xff, 0xff, /* Rebind time */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +}; + +/* Frame (342 bytes) */ +static unsigned char first_ack[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ......c. */ +0x63, 0x82, 0x53, 0x63, /* ........ */ +0x35, 0x01, 0x05, /* ........ */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0x00, 0x00, 0x1b, 0xfe, /* IP address lease time */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, +0x03, 0x04, 0x80, 0x01, 0x00, 0x00, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* ........ */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char second_good_offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet Mask */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0x00, 0x00, 0x00, 0x01, /* IP address lease time */ +0x03, 0x04, 0xe0, 0x01, 0x00, 0x00, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0x3a, 0x04, 0x00, 0x00, 0xff, 0xff, /* Renewal time */ +0x3b, 0x04, 0xff, 0xff, 0xff, 0xff, /* Rebind time */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00 +}; + +/* Frame (342 bytes) */ +static unsigned char second_ack[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ......c. */ +0x63, 0x82, 0x53, 0x63, /* ........ */ +0x35, 0x01, 0x05, /* ........ */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0x00, 0x00, 0x1b, 0xfe, /* IP address lease time */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, +0x03, 0x04, 0x00, 0x00, 0x00, 0x00, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* ........ */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char third_good_offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet Mask */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0x00, 0x00, 0xff, 0xff, /* IP address lease time */ +0x03, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Router */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0x3b, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char third_ack[665] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ......c. */ +0x63, 0x82, 0x53, 0x63, /* ........ */ +0x35, 0x01, 0x05, /* ........ */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0x00, 0x00, 0x1b, 0xfe, /* IP address lease time */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, +0x03, 0x04, 0xe0, 0x01, 0x02, 0x03, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* ........ */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +}; + +/* Frame (342 bytes) */ +static unsigned char offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, /* DHCP message type */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, /* Subnet Mask */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0xff, 0xff, 0xff, 0xff, /* IP address lease time */ +0x03, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Router */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* NTP server */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char ack[665] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ......c. */ +0x63, 0x82, 0x53, 0x63, /* ........ */ +0x35, 0x01, 0x05, /* ........ */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* Server identifier */ +0x33, 0x04, 0x00, 0x00, 0x1b, 0xfe, /* IP address lease time */ +0x01, 0x04, 0xff, 0xff, 0xff, 0x00, +0x03, 0x04, 0xc0, 0x01, 0x02, 0x03, /* Router/gateway */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* ........ */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_extract_information_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +UINT index; +NX_PACKET *my_packet; +UCHAR *option_ptr; +UINT option_size; + + printf("NetX Test: DHCP Extract Information test..............................."); + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&server_ip, 0, 0x00000015, 0x5d021e0f, NX_TRUE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + server_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000015; + server_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x5d021e0f; +#endif + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dhcp_response[0].dhcp_response_pkt_data = (char*)first_bad_offer; + dhcp_response[0].dhcp_response_pkt_size = sizeof(first_bad_offer); + dhcp_response[1].dhcp_response_pkt_data = (char*)second_bad_offer; + dhcp_response[1].dhcp_response_pkt_size = sizeof(second_bad_offer); + dhcp_response[2].dhcp_response_pkt_data = (char*)first_good_offer; + dhcp_response[2].dhcp_response_pkt_size = sizeof(first_good_offer); + dhcp_response[3].dhcp_response_pkt_data = first_ack; + dhcp_response[3].dhcp_response_pkt_size = sizeof(first_ack); + dhcp_response[4].dhcp_response_pkt_data = (char*)second_good_offer; + dhcp_response[4].dhcp_response_pkt_size = sizeof(second_good_offer); + dhcp_response[5].dhcp_response_pkt_data = second_ack; + dhcp_response[5].dhcp_response_pkt_size = sizeof(second_ack); + dhcp_response[6].dhcp_response_pkt_data = (char*)third_good_offer; + dhcp_response[6].dhcp_response_pkt_size = sizeof(third_good_offer); + dhcp_response[7].dhcp_response_pkt_data = (char*)third_good_offer; + dhcp_response[7].dhcp_response_pkt_size = sizeof(third_good_offer); + dhcp_response[8].dhcp_response_pkt_data = third_ack; + dhcp_response[8].dhcp_response_pkt_size = sizeof(third_ack); + dhcp_response[9].dhcp_response_pkt_data = (char*)offer; + dhcp_response[9].dhcp_response_pkt_size = sizeof(offer); + dhcp_response[10].dhcp_response_pkt_data = ack; + dhcp_response[10].dhcp_response_pkt_size = sizeof(ack); + + /* Wait for Client requests (DISCOVER and REQEUST). */ + for (i = 0; i < DHCP_RESPONSE_TEST_CASE_NUM; i++) + { + + /* Receive DHCP message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send response. */ + status = nx_dhcp_response_packet_send(&server_socket, i); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Wait for test done. */ + while(test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +ULONG ntp_server_address; +UINT ntp_server_address_size = 4; + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&client_ip, 0, 0x00000011, 0x22334457, NX_TRUE); + + /* Check for errors. */ + if (status) + { + error_counter++; + } +#else + client_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000011; + client_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x22334457; +#endif + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + error_counter++; + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + for (i = 0; i < DHCP_RESPONSE_TEST_CASE_NUM-4; i++) + { + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + tx_thread_sleep(8 * NX_IP_PERIODIC_RATE); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + } + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + test_done = NX_TRUE; + + return; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data + (14 + 20 + 8), + dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8)); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8); + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Fake the transaction id. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = 0x2233446f; + + /* Send the packet. */ + status = nx_udp_socket_send(server_socket_ptr, response_packet, IP_ADDRESS(255, 255, 255, 255), NX_DHCP_CLIENT_UDP_PORT); + + /* Check the status. */ + if (status) + { + nx_packet_release(response_packet); + } + + return status; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_extract_information_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP extract information test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_get_option_value_test.c b/test/regression/dhcp_test/netx_dhcp_get_option_value_test.c new file mode 100644 index 00000000..8a42ddc5 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_get_option_value_test.c @@ -0,0 +1,544 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_UDP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT test_done = NX_FALSE; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +typedef struct DHCP_RESPONSE_STRUCT +{ + UCHAR *dhcp_response_pkt_data; + UINT dhcp_response_pkt_size; +} DHCP_RESPONSE; + +static DHCP_RESPONSE dhcp_response[2]; + +/* Frame (342 bytes) */ +static unsigned char offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ......c. */ +0x63, 0x82, 0x53, 0x63, /* Magic cookie */ +0x35, 0x01, 0x02, 0x00, /* ........ */ +0x36, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* ........ */ +0x33, 0x04, 0x00, 0x00, 0x1b, 0xfe, /* ........ */ +0x01, 0x05, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, /* ........ */ +0x03, 0x05, 0xc0, 0xa8, 0x02, 0x01, 0x00, 0x00, /* Gateway with addtional addresses */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server with too long address */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, +0x00, 0xff, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* Frame (342 bytes) */ +static unsigned char ack[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ......c. */ +0x63, 0x82, 0x53, 0x63, +0x00, +0x35, 0x01, 0x05, 0x36, 0x04, 0xc0, +0xa8, 0x02, 0x01, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ........ */ +0xfe, +0x01, 0x05, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, /* ........ */ +0x03, 0x05, 0xc0, 0xa8, 0x02, 0x01, 0x00, 0x00, /* Gateway with addtional addresses */ +0x06, 0x04, 0xc0, 0xa8, 0x02, 0x01, /* DNS server with too long address */ +0x2a, 0x04, 0x7c, 0x6c, 0x14, 0x01, /* ........ */ +0x00, 0xff, /* End */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_get_option_value_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +UINT index; +NX_PACKET *my_packet; +UCHAR *option_ptr; +UINT option_size; + + printf("NetX Test: DHCP get option value test..............................."); + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&server_ip, 0, 0x00000015, 0x5d021e0f, NX_TRUE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + server_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000015; + server_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x5d021e0f; +#endif + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dhcp_response[0].dhcp_response_pkt_data = (char*)offer; + dhcp_response[0].dhcp_response_pkt_size = sizeof(offer); + dhcp_response[1].dhcp_response_pkt_data = ack; + dhcp_response[1].dhcp_response_pkt_size = sizeof(ack); + + /* Wait for Client requests (DISCOVER and REQEUST). */ + for (i = 0; i < 2; i++) + { + + /* Receive DHCP message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Check if there is NTP in parameter request list. */ + option_ptr = dhcp_search_buffer(my_packet -> nx_packet_prepend_ptr, NX_DHCP_OPTION_DHCP_PARAMETERS, my_packet -> nx_packet_length); + + /* Check if found the parameter request option. */ + if (option_ptr == NX_NULL) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + option_size = (UINT)*option_ptr; + option_ptr++; + + /* Check if there is NTP. */ + for (index = 0; index < option_size; index ++) + { + if (*(option_ptr + index) == NX_DHCP_OPTION_NTP_SVR) + { + break; + } + } + + if (index >= option_size) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send response. */ + status = nx_dhcp_response_packet_send(&server_socket, i); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Wait for test done. */ + while(test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG ntp_server_address; +UINT ntp_server_address_size = 4; + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&client_ip, 0, 0x00000011, 0x22334457, NX_TRUE); + + /* Check for errors. */ + if (status) + { + error_counter++; + } +#else + client_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000011; + client_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x22334457; +#endif + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + error_counter++; + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Request NTP. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status) + { + error_counter++; + } + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + /* Wait for DHCP to assign the IP address. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Retrieve NTP server address. */ + status = nx_dhcp_interface_user_option_retrieve(&dhcp_client, 0, NX_DHCP_OPTION_NTP_SVR, (UCHAR *)(&ntp_server_address), + &ntp_server_address_size); + + /* Check status. */ + if ((status) || (ntp_server_address_size != 4) || (ntp_server_address != IP_ADDRESS(124, 108, 20, 1))) + { + error_counter++; + } + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + test_done = NX_TRUE; + + return; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data + (14 + 20 + 8), + dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8)); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8); + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Fake the transaction id. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = 0x2233446f; + + /* Send the packet. */ + status = nx_udp_socket_send(server_socket_ptr, response_packet, IP_ADDRESS(255, 255, 255, 255), NX_DHCP_CLIENT_UDP_PORT); + + /* Check the status. */ + if (status) + { + nx_packet_release(response_packet); + } + + return status; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_get_option_value_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP get option value test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_multiple_instances_test.c b/test/regression/dhcp_test/netx_dhcp_multiple_instances_test.c new file mode 100644 index 00000000..358108f7 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_multiple_instances_test.c @@ -0,0 +1,525 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define NX_DHCP_SERVER_IP_ADDRESS_1 IP_ADDRESS(192,168,0,1) +#define START_IP_ADDRESS_LIST_1 IP_ADDRESS(192,168,0,10) +#define END_IP_ADDRESS_LIST_1 IP_ADDRESS(192,168,0,19) + +#define NX_DHCP_SUBNET_MASK_1 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_1 IP_ADDRESS(192,168,0,1) +#define NX_DHCP_DNS_SERVER_1 IP_ADDRESS(192,168,0,1) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool_0; +static NX_PACKET_POOL client_pool_1; +static NX_IP client_ip_0; +static NX_IP client_ip_1; +static NX_DHCP dhcp_client_0; +static NX_DHCP dhcp_client_1; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool_0; +static NX_PACKET_POOL server_pool_1; +static NX_IP server_ip_0; +static NX_IP server_ip_1; +static NX_DHCP_SERVER dhcp_server_0; +static NX_DHCP_SERVER dhcp_server_1; + +static ULONG client_pool_stack_0[NX_PACKET_POOL_SIZE / sizeof(ULONG)]; +static ULONG client_pool_stack_1[NX_PACKET_POOL_SIZE / sizeof(ULONG)]; + +static ULONG server_pool_stack_0[NX_PACKET_POOL_SIZE / sizeof(ULONG)]; +static ULONG server_pool_stack_1[NX_PACKET_POOL_SIZE / sizeof(ULONG)]; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void my_udp_packet_receive(NX_IP* ip_ptr, NX_PACKET* packet_ptr); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT* driver_req); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_multiple_instances_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool0. */ + status = nx_packet_pool_create(&client_pool_0, "NetX Main Packet Pool", 1024, client_pool_stack_0, sizeof(client_pool_stack_0)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the client packet pool1. */ + status = nx_packet_pool_create(&client_pool_1, "NetX Main Packet Pool", 1024, client_pool_stack_1, sizeof(client_pool_stack_1)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool0. */ + status = nx_packet_pool_create(&server_pool_0, "NetX Main Packet Pool", 1024, server_pool_stack_0, sizeof(server_pool_stack_0)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool1. */ + status = nx_packet_pool_create(&server_pool_1, "NetX Main Packet Pool", 1024, server_pool_stack_1, sizeof(server_pool_stack_1)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip_0, "DHCP Client 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool_0, _nx_ram_network_driver_512, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip_1, "DHCP Client 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip_0, "DHCP Server 0", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool_0, _nx_ram_network_driver_512, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip_1, "DHCP Server 1", NX_DHCP_SERVER_IP_ADDRESS_1, 0xFFFFFF00UL, &server_pool_1, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip_1, (void*)pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip_1, (void*)pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip_0); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip_1); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip_0); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip_1); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT addresses_added; + + printf("NetX Test: NetX DHCP Multiple Instances Test........................."); + + /* Change udp receive function to my routine. */ + client_ip_0.nx_ip_udp_packet_receive = my_udp_packet_receive; + client_ip_1.nx_ip_udp_packet_receive = my_udp_packet_receive; + server_ip_0.nx_ip_udp_packet_receive = my_udp_packet_receive; + server_ip_1.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Create the DHCP Server 0. */ + status = nx_dhcp_server_create(&dhcp_server_0, &server_ip_0, pointer, DEMO_STACK_SIZE, + "DHCP Server 0", &server_pool_0); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server_0, 0, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server_0, 0, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server_0); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + /* Create the DHCP Server 1. */ + status = nx_dhcp_server_create(&dhcp_server_1, &server_ip_1, pointer, DEMO_STACK_SIZE, + "DHCP Server 1", &server_pool_1); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server_1, 0, START_IP_ADDRESS_LIST_1, + END_IP_ADDRESS_LIST_1, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server_1, 0, NX_DHCP_SUBNET_MASK_1, + NX_DHCP_DEFAULT_GATEWAY_1, NX_DHCP_DNS_SERVER_1); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server_1); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address_0; +ULONG network_address_0; +ULONG ip_address_1; +ULONG network_address_1; + + /* Create the DHCP instance 0. */ + status = nx_dhcp_create(&dhcp_client_0, &client_ip_0, "dhcp_client_0"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client_0, &client_pool_0); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Start the DHCP Client 0. */ + status = nx_dhcp_start(&dhcp_client_0); + if (status) + error_counter++; + + /* Create the DHCP instance 1. */ + status = nx_dhcp_create(&dhcp_client_1, &client_ip_1, "dhcp_client_1"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client_1, &client_pool_1); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Start the DHCP Client 1. */ + status = nx_dhcp_start(&dhcp_client_1); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip_0, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip_1, NX_IP_ADDRESS_RESOLVED, (ULONG*)&status, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Check the IP address. */ + status = nx_ip_address_get(&client_ip_0, &ip_address_0, &network_address_0); + status += nx_ip_address_get(&client_ip_1, &ip_address_1, &network_address_1); + + /* Check status. */ + if ((status) || (ip_address_0 != START_IP_ADDRESS_LIST_0) || (ip_address_1 != START_IP_ADDRESS_LIST_1)) + error_counter++; + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip_0, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, sizeof(message), &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip_1, NX_DHCP_SERVER_IP_ADDRESS_1, (CHAR*)message, sizeof(message), &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Clean up. */ + nx_dhcp_stop(&dhcp_client_0); + nx_dhcp_delete(&dhcp_client_0); + nx_dhcp_stop(&dhcp_client_1); + nx_dhcp_delete(&dhcp_client_1); + + return; +} + +static void my_udp_packet_receive(NX_IP* ip_ptr, NX_PACKET* packet_ptr) +{ +UCHAR* source_address_ptr; +ULONG source_address_msw; +ULONG source_address_lsw; + + /* Get the source mac address. */ + source_address_ptr = packet_ptr->nx_packet_prepend_ptr - 20 - 8; + source_address_msw = ((*source_address_ptr) << 8) | (*(source_address_ptr + 1)); + source_address_lsw = (*(source_address_ptr + 2) << 24) | (*(source_address_ptr + 3) << 16) | (*(source_address_ptr + 4) << 8) | (*(source_address_ptr + 5)); + + /* Rules: + client_ip_0 only receives data from server_ip_0; + server_ip_1 only receives data from client_ip_0; + client_ip_1 only receives data from server_ip_1; + server_ip_1 only receives data from client_ip_1; + */ + + if (((ip_ptr == &client_ip_0) && + ((source_address_msw == server_ip_0.nx_ip_interface[0].nx_interface_physical_address_msw) && + ((source_address_lsw == server_ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw)))) || + ((ip_ptr == &server_ip_0) && + ((source_address_msw == client_ip_0.nx_ip_interface[0].nx_interface_physical_address_msw) && + ((source_address_lsw == client_ip_0.nx_ip_interface[0].nx_interface_physical_address_lsw)))) || + ((ip_ptr == &client_ip_1) && + ((source_address_msw == server_ip_1.nx_ip_interface[0].nx_interface_physical_address_msw) && + ((source_address_lsw == server_ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw)))) || + ((ip_ptr == &server_ip_1) && + ((source_address_msw == client_ip_1.nx_ip_interface[0].nx_interface_physical_address_msw) && + ((source_address_lsw == client_ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw))))) + { + _nx_udp_packet_receive(ip_ptr, packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_multiple_instances_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Multiple Instances Test.........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_packet_process_test.c b/test/regression/dhcp_test/netx_dhcp_packet_process_test.c new file mode 100644 index 00000000..347903ab --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_packet_process_test.c @@ -0,0 +1,459 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_UDP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT test_done = NX_FALSE; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +typedef struct DHCP_RESPONSE_STRUCT +{ + UCHAR *dhcp_response_pkt_data; + UINT dhcp_response_pkt_size; +} DHCP_RESPONSE; + +static DHCP_RESPONSE dhcp_response[3]; + +/* Frame (342 bytes) */ +static unsigned char offer[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Do...... */ +0x00, 0x00, 0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0xc0, /* Sc5..6.. */ +0xa8, 0x02, 0x01, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ...3.... */ +0xfe, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ........ */ +0x04, 0xc0, 0xa8, 0x02, 0x01, 0x06, 0x04, 0xc0, /* ........ */ +0xa8, 0x02, 0x01, 0x2a, 0x04, 0x7c, 0x6c, 0x14, /* ...*.|l. */ +0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_ntp_option_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +UINT index; +NX_PACKET *my_packet; +UCHAR *option_ptr; +UINT option_size; + + printf("NetX Test: DHCP Client NTP Option test..............................."); + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&server_ip, 0, 0x00000015, 0x5d021e0f, NX_TRUE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + server_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000015; + server_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x5d021e0f; +#endif + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dhcp_response[0].dhcp_response_pkt_data = (char*)offer; + dhcp_response[0].dhcp_response_pkt_size = sizeof(offer); + dhcp_response[1].dhcp_response_pkt_data = offer; + dhcp_response[1].dhcp_response_pkt_size = sizeof(offer); + dhcp_response[2].dhcp_response_pkt_data = offer; + dhcp_response[2].dhcp_response_pkt_size = sizeof(offer); + + /* Wait for Client requests (DISCOVER and REQEUST). */ + for (i = 0; i < 3; i++) + { + + /* Receive DHCP message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send response. */ + status = nx_dhcp_response_packet_send(&server_socket, i); + + switch (i) + { + case 0: + client_pool.nx_packet_pool_available = NX_FALSE; + break; + case 1: + client_pool.nx_packet_pool_available = NX_TRUE; + dhcp_client.nx_dhcp_ip_ptr->nx_ip_interface[0].nx_interface_physical_address_msw = 17; + dhcp_client.nx_dhcp_ip_ptr->nx_ip_interface[0].nx_interface_physical_address_lsw = 123456; + break; + case 2: + dhcp_client.nx_dhcp_ip_ptr->nx_ip_interface[0].nx_interface_physical_address_msw = 18; + break; + default: + break; + } + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Wait for test done. */ + while(test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +ULONG ntp_server_address; +UINT ntp_server_address_size = 4; + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&client_ip, 0, 0x00000011, 0x22334457, NX_TRUE); + + /* Check for errors. */ + if (status) + { + error_counter++; + } +#else + client_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000011; + client_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x22334457; +#endif + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + error_counter++; + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Request NTP. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status) + { + error_counter++; + } + + for (i = 0; i < 2; i++) + { + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + } + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + test_done = NX_TRUE; + + return; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data + (14 + 20 + 8), + dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8)); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8); + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Fake the transaction id. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = 0x2233446f; + + /* Send the packet. */ + status = nx_udp_socket_send(server_socket_ptr, response_packet, IP_ADDRESS(255, 255, 255, 255), NX_DHCP_CLIENT_UDP_PORT); + + /* Check the status. */ + if (status) + { + nx_packet_release(response_packet); + } + + return status; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_client_ntp_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP Client NTP Option test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_reinitialize_test.c b/test/regression/dhcp_test/netx_dhcp_reinitialize_test.c new file mode 100644 index 00000000..631a8cff --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_reinitialize_test.c @@ -0,0 +1,425 @@ +/* The test in this file references the test in netx_dhcp_basic_test.c + The introduced difference by this file is to test the special case when the + gateway ip addressed is cleared before calling nx_dhcp_interface_reinitialize, + purposing to meet the 100% coverage for _nx_dhcp_interface_reinitialize +*/ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_reinitialize_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Reinitialize Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Change the value to test the corner case for the static function _nx_dhcp_update_timeout */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_rtr_interval = 6500; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* Call function nx_ip_gateway_address_clear to test the special case when + the return status of nx_ip_gateway_address_get becomes not NX_SUCCESS*/ + tx_thread_sleep(NX_IP_PERIODIC_RATE); +#ifdef __PRODUCT_NETXDUO__ + nx_ip_gateway_address_clear(dhcp_client.nx_dhcp_ip_ptr); +#else + nx_ip_gateway_address_set(dhcp_client.nx_dhcp_ip_ptr, 0UL); +#endif + nx_dhcp_reinitialize(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_reinitialize_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Reinitialize Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_release_test.c b/test/regression/dhcp_test/netx_dhcp_release_test.c new file mode 100644 index 00000000..544b4952 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_release_test.c @@ -0,0 +1,419 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_release_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +static void interface_state_change_cb(NX_DHCP *dhcp_ptr, UINT iface, UCHAR state) +{ + /* Change the state to test the corner case for _nx_dhcp_interface_release */ + dhcp_ptr->nx_dhcp_interface_record->nx_dhcp_state = NX_DHCP_STATE_FORCERENEW; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Release Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Test the corner case when the state is changed by the callback function */ + dhcp_client.nx_dhcp_interface_state_change_callback = interface_state_change_cb; + nx_dhcp_release(&dhcp_client); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_release_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Release Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_send_request_internal_test.c b/test/regression/dhcp_test/netx_dhcp_send_request_internal_test.c new file mode 100644 index 00000000..1301b012 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_send_request_internal_test.c @@ -0,0 +1,615 @@ +/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP + * broadcast address as the original DHCPDISCOVER message. + * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address + */ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_dhcp_clone_function.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_ipv4.h" +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +#define SERVER_RESPONSE_NUM 3 + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_UDP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +static UINT test_done = NX_FALSE; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +typedef struct DHCP_RESPONSE_STRUCT +{ + UCHAR *dhcp_response_pkt_data; + UINT dhcp_response_pkt_size; +} DHCP_RESPONSE; + +static DHCP_RESPONSE dhcp_response[SERVER_RESPONSE_NUM]; + +/* Frame (342 bytes) */ +static unsigned char offer1[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0xc0, 0xa8, 0x02, 0xc5, /* ciaddr */ +0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0xa8, /* Sc5..6.. */ +0x02, 0x01, 0x05, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ...3.... */ +0xfe, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ........ */ +0x04, 0xa8, 0x02, 0x01, 0x02, 0x3a, 0x04, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x3b, 0x04, 0x00, 0x00, 0x01, /* ...*.|l. */ +0x02, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char offer2[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ].....E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* v....... */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xb0, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0xc0, 0xa8, 0x02, 0xc5, /* ciaddr */ +0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* "3DW.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0xa8, /* Sc5..6.. */ +0x02, 0x01, 0x05, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ...3.... */ +0xfe, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ........ */ +0x04, 0xa8, 0x02, 0x01, 0x02, 0x06, 0x04, 0xc0, /* ........ */ +0xa8, 0x02, 0x01, 0x2a, 0x04, 0x7c, 0x6c, 0x14, /* ...*.|l. */ +0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static unsigned char ack[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x15, /* ........ */ +0x5d, 0x02, 0x1e, 0x0f, 0x08, 0x00, 0x45, 0x10, /* ........ */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* ........ */ +0x76, 0xec, 0xc0, 0xa8, 0x02, 0x01, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ........ */ +0xad, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* ........ */ +0x44, 0x6f, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0xc0, 0xa8, 0x02, 0xc5, /* ciaddr */ +0xc0, 0xa8, 0x02, 0xc5, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0xff, /* Sc5..6.. */ +0xff, 0xff, 0xff, 0x33, 0x04, 0x00, 0x00, 0x1b, /* ...3.... */ +0xfe, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ........ */ +0x04, 0xff, 0xff, 0xff, 0x00, 0x06, 0x04, 0xc0, /* ........ */ +0xa8, 0x02, 0x01, 0x2a, 0x04, 0x7c, 0x6c, 0x14, /* ...*.|l. */ +0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_send_request_internal_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i = 0; +UINT index; +NX_PACKET *my_packet; +UCHAR *option_ptr; +UINT option_size; + + printf("NetX Test: DHCP send request internal test..............................."); + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&server_ip, 0, 0x00000015, 0x5d021e0f, NX_TRUE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + server_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000015; + server_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x5d021e0f; +#endif + + /* Create a socket as the server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dhcp_response[0].dhcp_response_pkt_data = (char*)offer1; + dhcp_response[0].dhcp_response_pkt_size = sizeof(offer1); + dhcp_response[1].dhcp_response_pkt_data = (char*)offer2; + dhcp_response[1].dhcp_response_pkt_size = sizeof(offer2); + dhcp_response[2].dhcp_response_pkt_data = ack; + dhcp_response[2].dhcp_response_pkt_size = sizeof(ack); + + /* Wait for Client requests (DISCOVER and REQEUST). */ + for (i = 0; i < SERVER_RESPONSE_NUM; i++) + { + + /* Receive DHCP message. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 1000); + + /* Check status. */ + if (status) + { + // printf("ERROR!\n"); + // test_control_return(1); + } + else + { + + /* Check if there is NTP in parameter request list. */ + option_ptr = dhcp_search_buffer(my_packet -> nx_packet_prepend_ptr, NX_DHCP_OPTION_DHCP_PARAMETERS, my_packet -> nx_packet_length); + + /* Check if found the parameter request option. */ + if (option_ptr == NX_NULL) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + option_size = (UINT)*option_ptr; + option_ptr++; + + /* Check if there is NTP. */ + for (index = 0; index < option_size; index ++) + { + if (*(option_ptr + index) == NX_DHCP_OPTION_NTP_SVR) + { + break; + } + } + + if (index >= option_size) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send response. */ + status = nx_dhcp_response_packet_send(&server_socket, i); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Wait for test done. */ + while(test_done == NX_FALSE) + { + tx_thread_sleep(100); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG ntp_server_address; +UINT ntp_server_address_size = 4; + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&client_ip, 0, 0x00000011, 0x22334457, NX_TRUE); + + /* Check for errors. */ + if (status) + { + error_counter++; + } +#else + client_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000011; + client_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x22334457; +#endif + + /* Create the DHCP instance. for the test with NULL dhcp name */ + status = nx_dhcp_create(&dhcp_client, &client_ip, NULL); + if (status) + { + error_counter++; + } + + /* Set the ip address to NX_BOOTP_BC_ADDRESS to test the corner case */ + dhcp_client.nx_dhcp_interface_record->nx_dhcp_ip_address = NX_BOOTP_BC_ADDRESS; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Request NTP. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status) + { + error_counter++; + } + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + tx_thread_sleep(500); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + /* Create the DHCP instance. for the test with a normal short name */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "Short DHCP Name"); + if (status) + { + error_counter++; + } + + /* Set the ip address to NX_BOOTP_BC_ADDRESS to test the corner case */ + dhcp_client.nx_dhcp_interface_record->nx_dhcp_ip_address = NX_BOOTP_BC_ADDRESS; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Request NTP. */ + status = nx_dhcp_user_option_request(&dhcp_client, NX_DHCP_OPTION_NTP_SVR); + if (status) + { + error_counter++; + } + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + error_counter++; + } + + tx_thread_sleep(500); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + test_done = NX_TRUE; + + return; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data + (14 + 20 + 8), + dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8)); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size - (14 + 20 + 8); + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Fake the transaction id. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = 0x2233446f; + + /* Send the packet. */ + status = nx_udp_socket_send(server_socket_ptr, response_packet, IP_ADDRESS(255, 255, 255, 255), NX_DHCP_CLIENT_UDP_PORT); + + /* Check the status. */ + if (status) + { + nx_packet_release(response_packet); + } + + return status; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_send_request_internal_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP send request internal test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_server_improper_term_test.c b/test/regression/dhcp_test/netx_dhcp_server_improper_term_test.c new file mode 100644 index 00000000..53d0bcd2 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_server_improper_term_test.c @@ -0,0 +1,518 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,2) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,5) + + +typedef struct DHCP_TEST_STRUCT +{ + char *dhcp_test_pkt_data; + int dhcp_test_pkt_size; +} DHCP_TEST; + +#define CLIENT_MSG_COUNT 2 +static DHCP_TEST dhcp_test[CLIENT_MSG_COUNT]; +UINT client_complete = NX_FALSE; + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; +static NX_UDP_SOCKET client_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *client_socket, UINT packet_number); +static void dhcp_test_initialize(); + +/* Frame (366 bytes) */ +static char discover[366] = { +0x01, 0x01, /* .C.4.... */ +0x06, 0x00, 0x42, 0x2a, 0x4c, 0xf5, 0x00, 0x00, /* ..B*L... */ +0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x80, 0x86, 0xf2, 0x83, 0x15, 0xd5, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x63, 0x82, 0x53, 0x63, 0x35, 0x01, /* ..c.Sc5. */ +0x01, 0x3d, 0x07, 0x01, 0x80, 0x86, 0xf2, 0x83, /* .=...... */ +0x15, 0xd5, 0x0c, 0x06, 0x57, 0x59, 0x2d, 0x50, /* ....WY-P */ +0x53, 0x54, 0x3c, 0x08, 0x4d, 0x53, 0x46, 0x54, /* ST<.MSFT */ +0x20, 0x35, 0x2e, 0x30, 0x37, 0x0c, 0x01, 0x0f, /* 5.07... */ +0x03, 0x06, 0x2c, 0x2e, 0x2f, 0x1f, 0x21, 0x79, /* ..,./.!y */ +0xf9, 0x2b, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, /* .+...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static int discover_size = 304; + +/* Frame (385 bytes) */ +static char request[385] = { +0x01, 0x01, /* .C.GO... */ +0x06, 0x00, 0x42, 0x2a, 0x4c, 0xf5, 0x04, 0x00, /* ..B*L... */ +0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x80, 0x86, 0xf2, 0x83, 0x15, 0xd5, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x63, 0x82, 0x53, 0x63, 0x35, 0x01, /* ..c.Sc5. */ +0x03, 0x3d, 0x07, 0x01, 0x80, 0x86, 0xf2, 0x83, /* .=...... */ +0x15, 0xd5, 0x32, 0x04, 0x0a, 0x00, 0x00, 0x02, /* ..2..... */ +0x36, 0x04, 0x0a, 0x00, 0x00, 0x01, 0x0c, 0x06, /* 6....... */ +0x57, 0x59, 0x2d, 0x50, 0x53, 0x54, 0x51, 0x14, /* WY-PSTQ. */ +0x00, 0x00, 0x00, 0x57, 0x59, 0x2d, 0x50, 0x53, /* ...WY-PS */ +0x54, 0x2e, 0x66, 0x63, 0x69, 0x2e, 0x73, 0x6d, /* T.fci.sm */ +0x69, 0x2e, 0x61, 0x64, 0x3c, 0x08, 0x4d, 0x53, /* i.ad<.MS */ +0x46, 0x54, 0x20, 0x35, 0x2e, 0x30, 0x37, 0x0c, /* FT 5.07. */ +0x01, 0x0f, 0x03, 0x06, 0x2c, 0x2e, 0x2f, 0x1f, /* ....,./. */ +0x21, 0x79, 0xf9, 0x2b, 0x00, 0x00, 0x00, 0x01, /* !y.+.... */ +0x00 /* . */ +}; + +static int request_size = 323; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_improper_term_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, + _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, + _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Server Improper Termination Test....................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 4) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + while(!client_complete) + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Check that the server did not receive a valid request */ + if (dhcp_server.nx_dhcp_requests_received > 0) + { + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +/* This thread task simulates DHCP Client sending requests. */ +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT i; +ULONG actual_status; +UINT status; + + + /* Check for earlier errors. */ + if(error_counter) + { + client_complete = NX_TRUE; + return; + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 4 seconds to finish DAD. */ + tx_thread_sleep(4 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Load up the Client messages. */ + dhcp_test_initialize(); + + status = nx_udp_socket_create(&client_ip, &client_socket, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&client_socket, 68, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Act as the DHCP Client to send DHCP discover and request packets. */ + for (i = 0; i < CLIENT_MSG_COUNT; i++ ) + { + + /* Send the DHCP client packet. */ + status = nx_dhcp_response_packet_send(&client_socket, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + if (i == 1) + { + + /* This is correct. The Client should not get a message because the server rejected the request packet. */ + } + else /* i == 0*/ + { + /* There should be a response to the discovery message, so this is an error. */ + error_counter++; + continue; + } + + } + else + { + nx_packet_release(my_packet); + } + + } + + status = nx_udp_socket_unbind(&client_socket); + + /* Delete the UDP socket. */ + status |= nx_udp_socket_delete(&client_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + client_complete = NX_TRUE; +} + + +static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *client_socket, UINT packet_number) +{ + +UINT status; +NX_PACKET *client_packet; + + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&client_pool, &client_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(client_packet -> nx_packet_prepend_ptr, 0, (client_packet -> nx_packet_data_end - client_packet -> nx_packet_prepend_ptr)); + + /* Write the DHCP Client messages into the packet payload! */ + memcpy(client_packet -> nx_packet_prepend_ptr, + dhcp_test[packet_number].dhcp_test_pkt_data, + dhcp_test[packet_number].dhcp_test_pkt_size); + + /* Adjust the write pointer. */ + client_packet -> nx_packet_length = dhcp_test[packet_number].dhcp_test_pkt_size; + client_packet -> nx_packet_append_ptr = client_packet -> nx_packet_prepend_ptr + client_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(client_socket, client_packet, IP_ADDRESS(255,255,255,255), 67); + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(client_packet); + } + + return status; +} + +static void dhcp_test_initialize() +{ + dhcp_test[0].dhcp_test_pkt_data = &discover[0]; + dhcp_test[0].dhcp_test_pkt_size = discover_size; + dhcp_test[1].dhcp_test_pkt_data = &request[0]; + dhcp_test[1].dhcp_test_pkt_size = request_size; + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_improper_term_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Server Improper Termination Test................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_server_options_test.c b/test/regression/dhcp_test/netx_dhcp_server_options_test.c new file mode 100644 index 00000000..fbd510be --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_server_options_test.c @@ -0,0 +1,391 @@ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_DISABLE_UDP_RX_CHECKSUM) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(192, 168, 3, 8) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(192, 168, 3, 11) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(192, 168, 3,20) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(192, 168, 3, 8) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(192, 168, 3, 8) + +/* Define the ThreadX and NetX object control blocks... */ +static NX_PACKET_POOL client_pool; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG resposner_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + + + +/* Frame (342 bytes) DHCP DISCOVER Read overflow. */ +static const unsigned char pkt1[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x08, 0x00, 0x45, 0x00, /* ...i..E. */ +0x01, 0x48, 0x00, 0x01, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x39, 0xa5, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* 9....... */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x83, 0x9e, 0x01, 0x01, 0x06, 0x00, 0x00, 0xf6, /* ........ */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x37, 0x3c, 0x00, 0x00, 0x00, 0x00, /* Sc5..=.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .P...i.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* CW-9WDPJ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* V1-GA1<. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* MSFT 5.0 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7.....,. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* /.!y.+.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Frame (342 bytes) DHCP DISCOVER Write overflow. */ +static const unsigned char pkt2[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x08, 0x00, 0x45, 0x00, /* ...i..E. */ +0x01, 0x48, 0x00, 0x01, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x39, 0xa5, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* 9....... */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x83, 0x9e, 0x01, 0x01, 0x06, 0x00, 0x00, 0xf6, /* ........ */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x37, 0x14, 0x35, 0x35, 0x35, 0x35, /* Sc5..=.. */ +0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, /* .P...i.. */ +0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, /* CW-9WDPJ */ +0x56, 0x31, 0x2d, 0x47, 0x41, 0x31, 0x3c, 0x08, /* V1-GA1<. */ +0x4d, 0x53, 0x46, 0x54, 0x20, 0x35, 0x2e, 0x30, /* MSFT 5.0 */ +0x37, 0x0c, 0x01, 0x0f, 0x03, 0x06, 0x2c, 0x2e, /* 7.....,. */ +0x2f, 0x1f, 0x21, 0x79, 0xf9, 0x2b, 0xff, 0x00, /* /.!y.+.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) DHCP DISCOVER Endless loop. */ +static const unsigned char pkt3[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x08, 0x00, 0x45, 0x00, /* ...i..E. */ +0x01, 0x48, 0x00, 0x01, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x39, 0xa5, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* 9....... */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x83, 0x9e, 0x01, 0x01, 0x06, 0x00, 0x00, 0xf6, /* ........ */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x37, 0x01, 0x37, 0x3d, 0x07, 0x01, /* Sc5..=.. */ +0x00, 0x50, 0xb6, 0x07, 0xa1, 0x69, 0x0c, 0x0e, /* .P...i.. */ +0x43, 0x57, 0x2d, 0x39, 0x57, 0x44, 0x50, 0x4a, /* CW-9WDPJ */ +0x56, 0x31, 0x2d, 0x47, 0x41, 0x31, 0x3c, 0x08, /* V1-GA1<. */ +0x4d, 0x53, 0x46, 0x54, 0x20, 0x35, 0x2e, 0x30, /* MSFT 5.0 */ +0x37, 0x0c, 0x01, 0x0f, 0x03, 0x06, 0x2c, 0x2e, /* 7.....,. */ +0x2f, 0x1f, 0x21, 0x79, 0xf9, 0x2b, 0xff, 0x00, /* /.!y.+.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static const UCHAR *test_packet[] = {pkt1, pkt2, pkt3}; +static UINT test_packet_size[] = {sizeof(pkt1), sizeof(pkt2), sizeof(pkt3)}; +static UINT test_count = sizeof(test_packet_size) / sizeof(UINT); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_options_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + memset(pointer, 53, NX_PACKET_POOL_SIZE); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; +NX_PACKET *my_packet; +UINT i; + + printf("NetX Test: DHCP Server Options Test.................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + for (i = 0; i < test_count; i++) + { + /* Send the DHCP DISCOVER packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if (status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet->nx_packet_prepend_ptr, &test_packet[i][14], test_packet_size[i] - 14); + my_packet->nx_packet_length = test_packet_size[i] - 14; + my_packet->nx_packet_append_ptr = my_packet->nx_packet_prepend_ptr + test_packet_size[i] - 14; + + /* Directly receive the DHCP DISCOVER packet. */ + _nx_ip_packet_deferred_receive(&server_ip, my_packet); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if ((i == 0) && (dhcp_server.client_records[0].nx_dhcp_client_option_count)) + { + error_counter++; + } + + if ((i == 1) && (dhcp_server.client_records[1].nx_dhcp_client_state == 53)) + { + error_counter++; + } + + nx_dhcp_clear_client_record(&dhcp_server, &(dhcp_server.client_records[0])); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_options_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Server Options Test..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_server_second_interface_test.c b/test/regression/dhcp_test/netx_dhcp_server_second_interface_test.c new file mode 100644 index 00000000..e57740ef --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_server_second_interface_test.c @@ -0,0 +1,552 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && (NX_MAX_PHYSICAL_INTERFACES >= 2) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(1,0,0,1) +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) + +#define NX_DHCP_SERVER_IP_ADDRESS_1 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_1 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_1 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_1 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_1 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_1 IP_ADDRESS(10,0,0,1) + +#define NX_DHCP_INTERFACE_INDEX 1 + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; +static CHAR offer_packet = NX_FALSE; +static CHAR ack_packet = NX_FALSE; +static CHAR test_done = NX_FALSE; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Note that the MAC address of Client is 00:11:22:33:44:56. + the MAC address of Server is 00:11:22:33:44:57. */ + +/* Frame (342 bytes) */ +static const unsigned char pkt1[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x01, 0x48, 0x00, 0x01, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0xf9, 0xa4, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x59, 0x2a, 0x01, 0x01, 0x06, 0x00, 0x22, 0x33, /* Y*...."3 */ +0x44, 0x6e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x01, 0x33, 0x04, 0xff, /* Sc5..3.. */ +0xff, 0xff, 0xff, 0x0c, 0x0b, 0x64, 0x68, 0x63, /* .....dhc */ +0x70, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, /* p_client */ +0x37, 0x03, 0x01, 0x03, 0x06, 0xff, 0x00, 0x00, /* 7....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static const unsigned char pkt2[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x48, 0x00, 0x01, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0xef, 0xa3, 0x0a, 0x00, 0x00, 0x01, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xbd, 0x6f, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .o...."3 */ +0x44, 0x6e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x0a, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x01, 0x04, 0xff, 0xff, 0xff, /* ........ */ +0x00, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x01, 0x06, /* ........ */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0x33, 0x04, 0x00, /* .....3.. */ +0x00, 0x27, 0x10, 0x3a, 0x04, 0x00, 0x00, 0x13, /* .'.:.... */ +0x88, 0x3b, 0x04, 0x00, 0x00, 0x22, 0x2e, 0xff, /* .;...".. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static const unsigned char pkt3[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x01, 0x48, 0x00, 0x02, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0xf9, 0xa3, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0xdf, 0x49, 0x01, 0x01, 0x06, 0x00, 0x22, 0x33, /* .I...."3 */ +0x44, 0x6e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x03, 0x0c, 0x0b, 0x64, /* Sc5....d */ +0x68, 0x63, 0x70, 0x5f, 0x63, 0x6c, 0x69, 0x65, /* hcp_clie */ +0x6e, 0x74, 0x32, 0x04, 0x0a, 0x00, 0x00, 0x0a, /* nt2..... */ +0x36, 0x04, 0x0a, 0x00, 0x00, 0x01, 0x37, 0x03, /* 6.....7. */ +0x01, 0x03, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static const unsigned char pkt4[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x48, 0x00, 0x02, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0xef, 0xa2, 0x0a, 0x00, 0x00, 0x01, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xba, 0x6f, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .o...."3 */ +0x44, 0x6e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x0a, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x01, 0x04, 0xff, 0xff, 0xff, /* ........ */ +0x00, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x01, 0x06, /* ........ */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0x33, 0x04, 0x00, /* .....3.. */ +0x00, 0x27, 0x10, 0x3a, 0x04, 0x00, 0x00, 0x13, /* .'.:.... */ +0x88, 0x3b, 0x04, 0x00, 0x00, 0x22, 0x2e, 0xff, /* .;...".. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_second_interface_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, NX_DHCP_SUBNET_MASK_0, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Attach the second interface. */ + status = nx_ip_interface_attach(&server_ip, "DHCP Server Secondary Interface", NX_DHCP_SERVER_IP_ADDRESS_1, NX_DHCP_SUBNET_MASK_1, _nx_ram_network_driver_1500); + + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT addresses_added; + + NX_PARAMETER_NOT_USED(thread_input); + + printf("NetX Test: NetX DHCP Server Second Interface Test...................."); + + advanced_packet_process_callback = my_packet_process; + +#ifdef __PRODUCT_NETXDUO__ + /* Update the MAC address. */ + status = nx_ip_interface_physical_address_set(&server_ip, 0, 0x00000011, 0x22334455, NX_TRUE); + status += nx_ip_interface_physical_address_set(&server_ip, 1, 0x00000011, 0x22334457, NX_TRUE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + server_ip.nx_ip_interface[0].nx_interface_physical_address_msw = 0x00000011; + server_ip.nx_ip_interface[0].nx_interface_physical_address_lsw = 0x22334455; + + server_ip.nx_ip_interface[1].nx_interface_physical_address_msw = 0x00000011; + server_ip.nx_ip_interface[1].nx_interface_physical_address_lsw = 0x22334457; + +#endif + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Load the assignable DHCP IP addresses. */ + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, NX_DHCP_INTERFACE_INDEX, START_IP_ADDRESS_LIST_1, + END_IP_ADDRESS_LIST_1, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, NX_DHCP_INTERFACE_INDEX, NX_DHCP_SUBNET_MASK_1, + NX_DHCP_DEFAULT_GATEWAY_1, NX_DHCP_DNS_SERVER_1); + + /* Check for errors setting network parameters. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if ((error_counter != 0) || (offer_packet != NX_TRUE) || (ack_packet != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *discover_packet; + + NX_PARAMETER_NOT_USED(thread_input); + + /* Allocate a Discover packet. */ + status = nx_packet_allocate(&server_pool, &discover_packet, NX_UDP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Append the data. */ + status = nx_packet_data_append(discover_packet, (void *)&pkt1[14], (sizeof(pkt1) - 14), &server_pool, NX_NO_WAIT); + + if (status) + { + error_counter++; + } + + /* Set the interface. */ + discover_packet -> nx_packet_ip_interface = &server_ip.nx_ip_interface[1]; + + /* Call API to receive the packet. */ + _nx_ip_packet_receive(&server_ip, discover_packet); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +NX_PACKET *request_packet; + + NX_PARAMETER_NOT_USED(ip_ptr); + NX_PARAMETER_NOT_USED(operation_ptr); + NX_PARAMETER_NOT_USED(delay_ptr); + + /* Check the packet interface. */ + if (packet_ptr -> nx_packet_ip_interface == &server_ip.nx_ip_interface[1]) + { + + /* Check the offer_packet flag. */ + if (offer_packet == NX_FALSE) + { + + /* Compare the packet. */ + if ((packet_ptr -> nx_packet_length == sizeof(pkt2) - 14) && + (memcmp(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], packet_ptr -> nx_packet_length) == 0)) + { + offer_packet = NX_TRUE; + + /* Allocate a Request packet. */ + status = nx_packet_allocate(&server_pool, &request_packet, NX_UDP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Append the data. */ + status = nx_packet_data_append(request_packet, (void *)&pkt3[14], sizeof(pkt3) - 14, &server_pool, NX_NO_WAIT); + + if (status) + { + error_counter++; + } + + /* Set the interface. */ + request_packet -> nx_packet_ip_interface = &server_ip.nx_ip_interface[1]; + + /* Call API to receive the packet. */ + _nx_ip_packet_receive(&server_ip, request_packet); + } + } + else + { + + /* Compare the packet. */ + if ((packet_ptr -> nx_packet_length == sizeof(pkt4) - 14) && + (memcmp(packet_ptr -> nx_packet_prepend_ptr, &pkt4[14], packet_ptr -> nx_packet_length) == 0)) + { + ack_packet = NX_TRUE; + } + } + } + + nx_packet_release(packet_ptr); + return NX_FALSE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_second_interface_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Server Second Interface Test....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_server_small_packet_payload_test.c b/test/regression/dhcp_test/netx_dhcp_server_small_packet_payload_test.c new file mode 100644 index 00000000..cda5e1ee --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_server_small_packet_payload_test.c @@ -0,0 +1,327 @@ +/* In _nx_dhcp_server_packet_process(), the orginal logic is to check the incoming packet length, update the incoming packet length, then copy the incomping packet data. + It will casue out of bound write. */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 +#define NX_SERVER_PACKET_SIZE NX_DHCP_MINIMUM_PACKET_PAYLOAD +#define NX_SERVER_PACKET_POOL_SIZE ((NX_DHCP_MINIMUM_PACKET_PAYLOAD + sizeof(NX_PACKET)) * 2) + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static ULONG server_pool_stack[NX_SERVER_PACKET_POOL_SIZE / sizeof(ULONG)]; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); +static UINT dhcp_user_option_add(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_small_packet_payload_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", NX_SERVER_PACKET_SIZE, (UCHAR *)server_pool_stack, sizeof(server_pool_stack)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Server Small Packet Payload.........................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + /* Let's DHCP server receive one packet packet. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check if the memory of server ip is over overwritten. */ + if ((server_ip.nx_ip_id != NX_IP_ID)) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Set callback function to add user options. */ + status = nx_dhcp_user_option_add_callback_set(&dhcp_client, dhcp_user_option_add); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Let's DHCP client send one packet. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + +/* In DHCP client, data size is 267, then fill in more data: NX_BOOT_BUFFER_SIZE - 267 - 1 (END Option) */ +UINT dhcp_user_option_add(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length) +{ + + /* Update the option length. */ + *user_option_length = NX_BOOT_BUFFER_SIZE - 267 - 1; + return(NX_TRUE); +} + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_small_packet_payload_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP Server Small Packet Payload..........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_server_test.c b/test/regression/dhcp_test/netx_dhcp_server_test.c new file mode 100644 index 00000000..e8aecf6e --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_server_test.c @@ -0,0 +1,525 @@ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_UDP_TX_CHECKSUM) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(192, 168, 3, 8) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(192, 168, 3, 11) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(192, 168, 3,20) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(192, 168, 3, 8) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(192, 168, 3, 8) + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG resposner_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Frame (342 bytes) DHCP DISCOVER */ +static const unsigned char pkt1[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x08, 0x00, 0x45, 0x00, /* ...i..E. */ +0x01, 0x48, 0x00, 0x01, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x39, 0xa5, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* 9....... */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x83, 0x9e, 0x01, 0x01, 0x06, 0x00, 0x00, 0xf6, /* ........ */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x01, 0x3d, 0x07, 0x01, /* Sc5..=.. */ +0x00, 0x50, 0xb6, 0x07, 0xa1, 0x69, 0x0c, 0x0e, /* .P...i.. */ +0x43, 0x57, 0x2d, 0x39, 0x57, 0x44, 0x50, 0x4a, /* CW-9WDPJ */ +0x56, 0x31, 0x2d, 0x47, 0x41, 0x31, 0x3c, 0x08, /* V1-GA1<. */ +0x4d, 0x53, 0x46, 0x54, 0x20, 0x35, 0x2e, 0x30, /* MSFT 5.0 */ +0x37, 0x0c, 0x01, 0x0f, 0x03, 0x06, 0x2c, 0x2e, /* 7.....,. */ +0x2f, 0x1f, 0x21, 0x79, 0xf9, 0x2b, 0xff, 0x00, /* /.!y.+.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) DHCP OFFER */ +static const unsigned char pkt2[342] = { +0x00, 0x50, 0xb6, 0x07, 0xa1, 0x69, 0x00, 0x08, /* .P...i.. */ +0xee, 0x03, 0x6a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* ..j...E. */ +0x01, 0x48, 0x00, 0x01, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0x72, 0x40, 0xc0, 0xa8, 0x03, 0x08, 0xc0, 0xa8, /* r@...... */ +0x03, 0x0b, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0x54, 0xf8, 0x02, 0x01, 0x06, 0x00, 0x00, 0xf6, /* T....... */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0xa8, 0x03, 0x0b, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0xc0, /* Sc5..6.. */ +0xa8, 0x03, 0x08, 0x01, 0x04, 0xff, 0xff, 0xff, /* ........ */ +0x00, 0x03, 0x04, 0xc0, 0xa8, 0x03, 0x08, 0x06, /* ........ */ +0x04, 0xc0, 0xa8, 0x03, 0x08, 0x33, 0x04, 0x00, /* .....3.. */ +0x00, 0x27, 0x10, 0x3a, 0x04, 0x00, 0x00, 0x13, /* .'.:.... */ +0x88, 0x3b, 0x04, 0x00, 0x00, 0x22, 0x2e, 0xff, /* .;...".. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (379 bytes) DHCP REQUEST */ +static const unsigned char pkt3[379] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x08, 0x00, 0x45, 0x00, /* ...i..E. */ +0x01, 0x6d, 0x00, 0x02, 0x00, 0x00, 0x80, 0x11, /* .m...... */ +0x39, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* 9....... */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x59, /* ...D.C.Y */ +0x4d, 0x72, 0x01, 0x01, 0x06, 0x00, 0x00, 0xf6, /* Mr...... */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x03, 0x3d, 0x07, 0x01, /* Sc5..=.. */ +0x00, 0x50, 0xb6, 0x07, 0xa1, 0x69, 0x32, 0x04, /* .P...i2. */ +0xc0, 0xa8, 0x03, 0x0b, 0x36, 0x04, 0xc0, 0xa8, /* ....6... */ +0x03, 0x08, 0x0c, 0x0e, 0x43, 0x57, 0x2d, 0x39, /* ....CW-9 */ +0x57, 0x44, 0x50, 0x4a, 0x56, 0x31, 0x2d, 0x47, /* WDPJV1-G */ +0x41, 0x31, 0x51, 0x1e, 0x00, 0x00, 0x00, 0x43, /* A1Q....C */ +0x57, 0x2d, 0x39, 0x57, 0x44, 0x50, 0x4a, 0x56, /* W-9WDPJV */ +0x31, 0x2d, 0x47, 0x41, 0x31, 0x2e, 0x54, 0x54, /* 1-GA1.TT */ +0x50, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x63, /* PGroup.c */ +0x6f, 0x6d, 0x3c, 0x08, 0x4d, 0x53, 0x46, 0x54, /* om<.MSFT */ +0x20, 0x35, 0x2e, 0x30, 0x37, 0x0c, 0x01, 0x0f, /* 5.07... */ +0x03, 0x06, 0x2c, 0x2e, 0x2f, 0x1f, 0x21, 0x79, /* ..,./.!y */ +0xf9, 0x2b, 0xff /* .+. */ +}; + +/* Frame (342 bytes) DHCP ACK */ +static const unsigned char pkt4[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x08, /* ........ */ +0xee, 0x03, 0x6a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* ..j...E. */ +0x01, 0x48, 0x00, 0x02, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0x72, 0x3f, 0xc0, 0xa8, 0x03, 0x08, 0xc0, 0xa8, /* r?...... */ +0x03, 0x0b, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0x51, 0xf8, 0x02, 0x01, 0x06, 0x00, 0x00, 0xf6, /* Q....... */ +0x16, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0xa8, 0x03, 0x0b, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xb6, 0x07, 0xa1, 0x69, 0x00, 0x00, 0x00, 0x00, /* ...i.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0xc0, /* Sc5..6.. */ +0xa8, 0x03, 0x08, 0x01, 0x04, 0xff, 0xff, 0xff, /* ........ */ +0x00, 0x03, 0x04, 0xc0, 0xa8, 0x03, 0x08, 0x06, /* ........ */ +0x04, 0xc0, 0xa8, 0x03, 0x08, 0x33, 0x04, 0x00, /* .....3.. */ +0x00, 0x27, 0x10, 0x3a, 0x04, 0x00, 0x00, 0x13, /* .'.:.... */ +0x88, 0x3b, 0x04, 0x00, 0x00, 0x22, 0x2e, 0xff, /* .;...".. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Server Test.........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if ((error_counter) || (resposner_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Send the DHCP DISCOVER packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Set the callback function to process the DHCP Message packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + my_packet -> nx_packet_length = sizeof(pkt1) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(pkt1) - 14; + + /* Directly receive the DHCP DISCOVER packet. */ + _nx_ip_packet_deferred_receive(&server_ip, my_packet); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +NX_PACKET *my_packet; + + if ((ip_ptr == &server_ip) && (packet_ptr ->nx_packet_length >= 300)) + { + + resposner_counter ++; + + if (resposner_counter == 1) + { + + /* Check the DHCP OFFER. */ +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + /* Skip IP id when it is random. */ + if (memcmp(packet_ptr ->nx_packet_prepend_ptr, &pkt2[14], 4) || + memcmp(packet_ptr ->nx_packet_prepend_ptr + 6, &pkt2[20], 4) || + memcmp(packet_ptr ->nx_packet_prepend_ptr + 12, &pkt2[26], sizeof(pkt2) - 26)) +#else + if (memcmp(packet_ptr ->nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) -14)) +#endif + error_counter ++; + + /* Send the DHCP REQUEST. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + my_packet -> nx_packet_length = sizeof(pkt3) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(pkt3) - 14; + + /* Directly receive the DHCP REQUEST packet. */ + _nx_ip_packet_deferred_receive(&server_ip, my_packet); + } + else if (resposner_counter == 2) + { + + /* Check the DHCP ACK. */ +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + /* Skip IP id when it is random. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, &pkt4[14], 4) || + memcmp(packet_ptr -> nx_packet_prepend_ptr + 6, &pkt4[20], 4) || + memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, &pkt4[26], sizeof(pkt4) - 26)) +#else + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, &pkt4[14], sizeof(pkt4) -14)) +#endif + error_counter ++; + } ; + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_server_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: DHCP Server Test..........................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_skip_discover_test.c b/test/regression/dhcp_test/netx_dhcp_skip_discover_test.c new file mode 100644 index 00000000..172e6783 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_skip_discover_test.c @@ -0,0 +1,398 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) +#define CLIENT_IP_ADDRESS IP_ADDRESS(10,0,0,15) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ + +#define REQUEST_CLIENT_IP + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); +static VOID my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_skip_discover_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Skip Discover Test..................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Change the pointer function to check user options. */ + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; +ULONG requested_ip; +UINT skip_discover_message = NX_TRUE; + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Set the client IP if the host is configured to do so. */ + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + +VOID my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UCHAR *server_id = NX_NULL; + + /* Search the Class ID option. */ + server_id = dhcp_search_buffer((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_OPTION_DHCP_SERVER, (packet_ptr -> nx_packet_length - 8)); + + /* Check if have the Class ID option. */ + if (server_id != NX_NULL) + error_counter++; + + /* Call the actual function to receive the UDP packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_skip_discover_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Skip Discover Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_start_test.c b/test/regression/dhcp_test/netx_dhcp_start_test.c new file mode 100644 index 00000000..219a75a4 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_start_test.c @@ -0,0 +1,419 @@ +/* This test reference the netx_dhcp_basic_test.c, with extra test on the corner + of function _nx_dhcp_interface_start which checks that condition when the + return status of tx_thread_resume is TX_SUSPEND_LIFTED */ + +#include "tx_api.h" +#include "nx_api.h" +#include "tx_thread.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_start_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Start Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Force the return status of tx_thread_resume to be TX_SUSPEND_LIFTED, which + is a corner case tested in function _nx_dhcp_interface_start */ + dhcp_client.nx_dhcp_thread.tx_thread_delayed_suspend = TX_TRUE; + dhcp_client.nx_dhcp_thread.tx_thread_state = TX_SLEEP; + status = nx_dhcp_start(&dhcp_client); + dhcp_client.nx_dhcp_thread.tx_thread_delayed_suspend = TX_FALSE; + dhcp_client.nx_dhcp_thread.tx_thread_state = TX_READY; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_start_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Start Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_stop_test.c b/test/regression/dhcp_test/netx_dhcp_stop_test.c new file mode 100644 index 00000000..0768c2d5 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_stop_test.c @@ -0,0 +1,419 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + +/* If defined, the host requests a (previous) client IP address. */ +/* +#define REQUEST_CLIENT_IP +*/ + +/* If defined the client requests to jump to the boot state and skip the DISCOVER message. + If REQUEST_CLIENT_IP is not defined, this has no effect. */ +/* +#define SKIP_DISCOVER_MESSAGE +*/ + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_stop_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +static void interface_state_change_cb(NX_DHCP *dhcp_ptr, UINT iface, UCHAR state) +{ + /* change the state to cover the corner case in _nx_dhcp_interface_stop */ + dhcp_ptr->nx_dhcp_interface_record->nx_dhcp_state = NX_DHCP_STATE_FORCERENEW; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + printf("NetX Test: DHCP Stop Test..........................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) +static UINT packet_filter_extended(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if ((direction == NX_IP_PACKET_OUT) && + ((packet_ptr -> nx_packet_ip_header == NX_NULL) || + (packet_ptr -> nx_packet_ip_header_length == 0))) + { + error_counter++; + } + return(NX_SUCCESS); +} +#endif + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR buffer[4]; +UINT buffer_size = 4; +ULONG *long_ptr; + +#ifdef REQUEST_CLIENT_IP +ULONG requested_ip; +UINT skip_discover_message = NX_FALSE; +#endif + + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_IP_PACKET_FILTER) + client_ip.nx_ip_packet_filter_extended = packet_filter_extended; +#endif + + /* Set the client IP if the host is configured to do so. */ +#ifdef REQUEST_CLIENT_IP + + requested_ip = (ULONG)CLIENT_IP_ADDRESS; + + /* Request a specific IP address using the DHCP client address option. */ + status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); + if (status) + error_counter++; + +#endif + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the DNS Server address. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DNS_SVR, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the DNS address. */ + if (*long_ptr != NX_DHCP_DNS_SERVER_0) + error_counter++; + } + else + { + error_counter++; + } + + /* Get the lease time value. */ + status = nx_dhcp_user_option_retrieve(&dhcp_client, NX_DHCP_OPTION_DHCP_LEASE, buffer, &buffer_size); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Set the pointer. */ + long_ptr = (ULONG *)(buffer); + + /* Check the lease time value. */ + if (*long_ptr != NX_DHCP_DEFAULT_LEASE_TIME) + error_counter++; + } + else + { + error_counter++; + } + + length = sizeof(message); + + /* Send pings to another host on the network... */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Set the callback to test the corner case in function _nx_dhcp_interface_stop + when nx_dhcp_interface_state_change_callback is available */ + dhcp_client.nx_dhcp_interface_state_change_callback = interface_state_change_cb; + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + /* Increment state changes counter. */ + state_changes++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_stop_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Stop Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcp_unicast_test.c b/test/regression/dhcp_test/netx_dhcp_unicast_test.c new file mode 100644 index 00000000..e1c34f40 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_unicast_test.c @@ -0,0 +1,486 @@ +/* This NetX test concentrates on the DHCP Unicast operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#else +#include "nx_dhcp.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ +static void client_thread_entry(ULONG thread_input); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* DCHP Unicast Interaction Message. */ + +#if 0 +/* Frame (342 bytes) DHCP Discover */ +static const unsigned char pkt1[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x01, 0x48, 0x00, 0x01, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0xf9, 0xa4, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x37, 0x87, 0x01, 0x01, 0x06, 0x00, 0x22, 0x33, /* 7....."3 */ +0x44, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x01, 0x33, 0x04, 0xff, /* Sc5..3.. */ +0xff, 0xff, 0xff, 0x0c, 0x10, 0x4e, 0x65, 0x74, /* .....Net */ +0x58, 0x5f, 0x44, 0x48, 0x43, 0x50, 0x5f, 0x43, /* X_DHCP_C */ +0x6c, 0x69, 0x65, 0x6e, 0x74, 0x37, 0x03, 0x01, /* lient7.. */ +0x03, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (342 bytes) DHCP Offer*/ +static const unsigned char pkt2[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x50, /* .."3DV.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x79, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %y...... */ +0x00, 0x1c, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xdb, 0x21, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .!...."3 */ +0x44, 0x6e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x1c, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (342 bytes) DHCP Request */ +static const unsigned char pkt3[342] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x01, 0x48, 0x00, 0x02, 0x40, 0x00, 0x80, 0x11, /* .H..@... */ +0xf9, 0xa3, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0x00, 0x44, 0x00, 0x43, 0x01, 0x34, /* ...D.C.4 */ +0x14, 0x3d, 0x01, 0x01, 0x06, 0x00, 0x22, 0x33, /* .=...."3 */ +0x44, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x03, 0x0c, 0x10, 0x4e, /* Sc5....N */ +0x65, 0x74, 0x58, 0x5f, 0x44, 0x48, 0x43, 0x50, /* etX_DHCP */ +0x5f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x32, /* _Client2 */ +0x04, 0x0a, 0x00, 0x00, 0x1c, 0x36, 0x04, 0x0a, /* .....6.. */ +0x00, 0x00, 0x01, 0x37, 0x03, 0x01, 0x03, 0x06, /* ...7.... */ +0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (342 bytes) DHCP Offer */ +static const unsigned char pkt4[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x50, /* .."3DV.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x79, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %y...... */ +0x00, 0x1c, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xd8, 0x20, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* . ...."3 */ +0x44, 0x6e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, /* Dn...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x1c, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x00, 0x00, 0x00, /* "3DV.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_unicast_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG client_ip_address; +ULONG client_ip_network_mask; + + + printf("NetX Test: DHCP Unicast Test........................................."); + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Clear the broadcast flag. */ + status = nx_dhcp_clear_broadcast_flag(&dhcp_client, NX_TRUE); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IP address. */ + status = nx_ip_address_get(&client_ip, &client_ip_address, &client_ip_network_mask); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IP address. */ + if ((client_ip_address != IP_ADDRESS(10, 0, 0, 28)) || + (client_ip_network_mask != IP_ADDRESS(255, 255, 255, 0))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stopping the DHCP client. */ + status = nx_dhcp_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* All done. Return resources to NetX and ThreadX. */ + status = nx_dhcp_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UINT status; +ULONG dhcp_xid; +NX_PACKET *my_packet; + + /* Is this a DHCP packet e.g. not an ARP packet? */ + if (packet_ptr -> nx_packet_length < 328) + { + /* Maybe an ARP packet. let the RAM driver deal with it */ + return NX_TRUE; + } + + /* Update the packet counter. */ + packet_counter ++; + + /* Check the packet counter. */ + if (packet_counter == 1) + { + + /* Receive the DHCP Discover message. */ + + /* Send DHCP Offer message. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return NX_TRUE; + } + + /* Write the DHCP Offer message. */ + my_packet -> nx_packet_length = sizeof(pkt2) - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt2 + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + } + else if (packet_counter == 2) + { + + /* Receive the DHCP Request message, */ + + /* Send DHCP ACK message. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return NX_TRUE; + } + + /* Write the DHCP ACK message. */ + my_packet -> nx_packet_length = sizeof(pkt4) - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt4 + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + } + + /* Get the XID of DHCP message from DHCP Server. */ + dhcp_xid = dhcp_get_data(my_packet -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_XID, 4); + + /* Replace the XID. */ + dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_xid = dhcp_xid; + + /* Receive the packet. */ + _nx_ip_packet_deferred_receive(ip_ptr, my_packet); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_unicast_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCP Unicast Test....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_user_option_add_test.c b/test/regression/dhcp_test/netx_dhcp_user_option_add_test.c new file mode 100644 index 00000000..dd440a60 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcp_user_option_add_test.c @@ -0,0 +1,393 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcp_client.h" +#include "nxd_dhcp_server.h" +#else +#include "nx_dhcp.h" +#include "nx_dhcp_server.h" +#endif +#include "netx_dhcp_clone_function.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) +#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) +#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) + +#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) +#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) +#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) + + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_DHCP dhcp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCP_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG state_changes; +static ULONG error_counter; +static CHAR *pointer; + +static UCHAR message[50] = "My Ping Request!" ; + + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); +static UINT dhcp_user_option_add(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length); +static VOID my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_user_option_add_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Client. */ + status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index; +UINT addresses_added; + + NX_PARAMETER_NOT_USED(thread_input); + + printf("NetX Test: DHCP User Option Add Test................................."); + + /* Create the DHCP Server. */ + status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, + "DHCP Server", &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors creating the DHCP Server. */ + if (status) + error_counter++; + + /* Load the assignable DHCP IP addresses for the first interface. */ + iface_index = 0; + + status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, + END_IP_ADDRESS_LIST_0, &addresses_added); + + /* Check for errors creating the list. */ + if (status) + { + error_counter++; + } + + /* Verify all the addresses were added to the list. */ + if (addresses_added != 10) + { + error_counter++; + } + + status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, + NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); + + /* Check for errors setting network parameters. */ + if (status) + { + error_counter++; + } + + /* Change the pointer function to check user options. */ + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start DHCP Server task. */ + status = nx_dhcp_server_start(&dhcp_server); + + /* Check for errors starting up the DHCP server. */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +UINT length; + + +/* Define the test threads. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + NX_PARAMETER_NOT_USED(thread_input); + + /* Create the DHCP instance. */ + status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); + if (status) + error_counter++; + +#ifdef NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL + status = nx_dhcp_packet_pool_set(&dhcp_client, &client_pool); + if (status) + error_counter++; +#endif /* NX_DHCP_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Register state change variable. */ + status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); + if (status) + error_counter++; + + /* Set callback function to add user options. */ + status = nx_dhcp_user_option_add_callback_set(&dhcp_client, dhcp_user_option_add); + if (status) + error_counter++; + + /* Start the DHCP Client. */ + status = nx_dhcp_start(&dhcp_client); + if (status) + error_counter++; + + /* Check for address resolution. */ + status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Send pings to another host on the network. */ + status = nx_icmp_ping(&client_ip, NX_DHCP_SERVER_IP_ADDRESS_0, (CHAR *)message, length, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Stopping the DHCP client. */ + nx_dhcp_stop(&dhcp_client); + + /* All done. Return resources to NetX and ThreadX. */ + nx_dhcp_delete(&dhcp_client); + + return; +} + + +void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) +{ + + NX_PARAMETER_NOT_USED(dhcp_ptr); + NX_PARAMETER_NOT_USED(new_state); + + /* Increment state changes counter. */ + state_changes++; + + return; +} + +UINT dhcp_user_option_add(NX_DHCP *dhcp_ptr, UINT iface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length) +{ + +CHAR vendor_class_id[] = "VENDORINFO"; /* Vendor Information. */ + + NX_PARAMETER_NOT_USED(dhcp_ptr); + NX_PARAMETER_NOT_USED(iface_index); + NX_PARAMETER_NOT_USED(message_type); + + /* Application can check if add options into the packet by iface_index and message_type. + message_type are defined in header file, such as: NX_DHCP_TYPE_DHCPDISCOVER. */ + + /* Add Vendor Class ID option refer to RFC2132. */ + + /* Check if have enough space for this option. */ + if (*user_option_length < (strlen(vendor_class_id) + 2)) + return(NX_FALSE); + + /* Set the option code. */ + *user_option_ptr = 60; + + /* Set the option length. */ + *(user_option_ptr + 1) = (UCHAR)strlen(vendor_class_id); + + /* Set the option value (Vendor class id). */ + memcpy((user_option_ptr + 2), vendor_class_id, strlen(vendor_class_id)); + + /* Update the option length. */ + *user_option_length = (strlen(vendor_class_id) + 2); + return(NX_TRUE); +} + +VOID my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UCHAR *vendor_class_id = NX_NULL; + + /* Search the Class ID option. */ + vendor_class_id = dhcp_search_buffer((packet_ptr -> nx_packet_prepend_ptr + 8), 60, (packet_ptr -> nx_packet_length - 8)); + + /* Check if have the Class ID option. */ + if (vendor_class_id == NX_NULL) + error_counter++; + + /* Skip the length. */ + vendor_class_id++; + + /* Check the class id. */ + if(memcmp(vendor_class_id, "VENDORINFO", 10)) + error_counter++; + + /* Call the actual function to receive the UDP packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcp_user_option_add_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DHCP User Option Add Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcpv6_basic_test.c b/test/regression/dhcp_test/netx_dhcpv6_basic_test.c new file mode 100644 index 00000000..aaa20681 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_basic_test.c @@ -0,0 +1,567 @@ +/* This is a small demo of the NetX Duo DHCPv6 Client and Server for the high-performance + NetX Duo stack. */ + +#include +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) +#include "nxd_dhcpv6_client.h" +#include "nxd_dhcpv6_server.h" + +#define DEMO_STACK_SIZE 2048 +#define NX_DHCPV6_THREAD_STACK_SIZE 2048 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_IP client_ip; +static NX_IP server_ip; + +/* Define the Client and Server instances. */ + +static NX_DHCPV6 dhcp_client; +static NX_DHCPV6_SERVER dhcp_server; + +/* Define the error counter used in the demo application... */ +static ULONG error_counter; +static CHAR *pointer; + +static NXD_ADDRESS server_address; +static NXD_ADDRESS dns_ipv6_address; +static NXD_ADDRESS start_ipv6_address; +static NXD_ADDRESS end_ipv6_address; + + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + + +/* Define some DHCPv6 parameters. */ + +#define DHCPV6_IANA_ID 0xC0DEDBAD +#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE +#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_REFERRED_LIFETIME NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_VALID_LIFETIME NX_DHCPV6_INFINITE_LEASE + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the Client thread. */ + status = tx_thread_create(&thread_client, "Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create the Server thread. */ + status = tx_thread_create(&thread_server, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a Client IP instance. */ + status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a Server IP instance. */ + status = nx_ip_create(&server_ip, "Server IP", IP_ADDRESS(1, 2, 3, 4), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic for sending DHCPv6 messages. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Check for IPv6 enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the ICMPv6 services. */ + status = nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the fragment feature. */ + status = nx_ip_fragment_enable(&client_ip); + status += nx_ip_fragment_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the Client host application thread. */ + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS dns_address; +ULONG prefix_length; +UINT interface_index; +ULONG T1, T2, preferred_lifetime, valid_lifetime; +UINT address_count; +UINT address_index; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 Basic Test........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Establish the link local address for the host. The RAM driver creates + a virtual MAC address of 0x1122334456. */ + status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL); + + /* Let NetX Duo and the network driver get initialized. Also give the server time to get set up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client", &pool_0, pointer, NX_DHCPV6_THREAD_STACK_SIZE, + NX_NULL, NX_NULL); + pointer = pointer + NX_DHCPV6_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. + + Note that if this host had already been assigned in IPv6 lease, it + would have to use the assigned T1 and T2 values in loading the DHCPv6 + client with an IANA block. + */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, DHCPV6_T1, DHCPV6_T2); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Starting up the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* If the host also want to get the option message, set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Now, the host send the solicit message to get the IPv6 address and other options from the DHCPv6 server. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for get the IPv6 address and do the duplicate address detection. */ + tx_thread_sleep(6 * NX_IP_PERIODIC_RATE); + + /* Get the valid IPv6 address count which the DHCPv6 server assigned . */ + status = nx_dhcpv6_get_valid_ip_address_count(&dhcp_client, &address_count); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address, preferred lifetime and valid lifetime according to the address index. */ + address_index = 0; + status = nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_client, address_index, &ipv6_address, &preferred_lifetime, &valid_lifetime); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address. */ + if ((ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 address. */ + if ((prefix_length != 64) || (interface_index != 0) || + (ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP address lease time. + Note, This API only applies to one IA. */ + status = nx_dhcpv6_get_lease_time_data(&dhcp_client, &T1, &T2, &preferred_lifetime, &valid_lifetime); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((T1 != NX_DHCPV6_DEFAULT_T1_TIME) || + (T2 != NX_DHCPV6_DEFAULT_T2_TIME) || + (preferred_lifetime != NX_DHCPV6_DEFAULT_PREFERRED_TIME) || + (valid_lifetime != NX_DHCPV6_DEFAULT_VALID_TIME)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the DNS Server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 DNS address. */ + if ((dns_address.nxd_ip_version != dns_ipv6_address.nxd_ip_version) || + (dns_address.nxd_ip_address.v6[0] != dns_ipv6_address.nxd_ip_address.v6[0]) || + (dns_address.nxd_ip_address.v6[1] != dns_ipv6_address.nxd_ip_address.v6[1]) || + (dns_address.nxd_ip_address.v6[2] != dns_ipv6_address.nxd_ip_address.v6[2]) || + (dns_address.nxd_ip_address.v6[3] != dns_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping the DHCPv6 Server. */ + status = nxd_icmp_ping(&client_ip, &server_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the address. */ + status = nx_dhcpv6_request_release(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for release the IPv6 address. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the Client task. */ + status = nx_dhcpv6_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the DHCPv6 client. */ + status = nx_dhcpv6_client_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the test server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +ULONG duid_time; +UINT addresses_added; + + /* Set the IPv6 address of DHCPv6 Server. */ + server_address.nxd_ip_version = NX_IP_VERSION_V6 ; + server_address.nxd_ip_address.v6[0] = 0x20010db8; + server_address.nxd_ip_address.v6[1] = 0xf101; + server_address.nxd_ip_address.v6[2] = 0x00000000; + server_address.nxd_ip_address.v6[3] = 0x00000101; + + /* Set the link local and global addresses. */ + status = nxd_ipv6_address_set(&server_ip, 0, NX_NULL, 10, NULL); + status += nxd_ipv6_address_set(&server_ip, 0, &server_address, 64, NULL); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Validate the link local and global addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Server. */ + status = nx_dhcpv6_server_create(&dhcp_server, &server_ip, "DHCPv6 Server", &pool_0, pointer, NX_DHCPV6_SERVER_THREAD_STACK_SIZE, NX_NULL, NX_NULL); + pointer += NX_DHCPV6_SERVER_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the DNS IPv6 server address. */ + dns_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + dns_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + dns_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + dns_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + dns_ipv6_address.nxd_ip_address.v6[3] = 0x00000107; + + status = nx_dhcpv6_create_dns_address(&dhcp_server, &dns_ipv6_address); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Note: For DUID types that do not require time, the 'duid_time' input can be left at zero. + The DUID_TYPE and HW_TYPE are configurable options that are user defined in nx_dhcpv6_server.h. */ + + /* Set the DUID time as the start of the millenium. */ + duid_time = SECONDS_SINCE_JAN_1_2000_MOD_32; + status = nx_dhcpv6_set_server_duid(&dhcp_server, + NX_DHCPV6_SERVER_DUID_TYPE, NX_DHCPV6_SERVER_HW_TYPE, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_msw, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_lsw, + duid_time); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 start address. */ + start_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + start_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + start_ipv6_address.nxd_ip_address.v6[1] = 0x00000f101; + start_ipv6_address.nxd_ip_address.v6[2] = 0x0; + start_ipv6_address.nxd_ip_address.v6[3] = 0x00000110; + + /* Set the IPv6 end address. */ + end_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + end_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + end_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + end_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + end_ipv6_address.nxd_ip_address.v6[3] = 0x00000120; + + /* Set the IPv6 address range. */ + status = nx_dhcpv6_create_ip_address_range(&dhcp_server, &start_ipv6_address, &end_ipv6_address, &addresses_added); + + /* Check for errors. */ + if ((status) || (addresses_added != 16)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the NetX DHCPv6 server! */ + status = nx_dhcpv6_server_start(&dhcp_server); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_basic_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 Basic Test.........................................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/dhcp_test/netx_dhcpv6_client_process_server_duid_test.c b/test/regression/dhcp_test/netx_dhcpv6_client_process_server_duid_test.c new file mode 100644 index 00000000..180aa242 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_client_process_server_duid_test.c @@ -0,0 +1,399 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +#define DEMO_STACK_SIZE 2048 +#define DHCPV6_IANA_ID 0xc0dedbad + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static CHAR *pointer; +static ULONG error_counter; + +static UCHAR solicit = NX_FALSE; +static UCHAR request = NX_FALSE; +static ULONG server_identifier; +static ULONG server_identifier_length; +static ULONG server_duid_type; +static ULONG server_hardware_type; +static ULONG server_msw; +static ULONG server_lsw; + +/* Define thread prototypes. */ + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT _nx_dhcpv6_utility_get_block_option_length(UCHAR *buffer_ptr, ULONG *option, ULONG *length); + +/* Frame (118 bytes) Solicit */ +static unsigned char pkt1[118] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, /* 33...... */ +0xa3, 0xc7, 0x1c, 0xf6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x40, 0x11, 0x40, 0xfe, 0x80, /* ...@.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, /* ........ */ +0xa3, 0xff, 0xfe, 0xc7, 0x1c, 0xf6, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x40, 0xc2, 0x19, 0x01, 0xdc, /* .#.@.... */ +0x5d, 0x45, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ]E...... */ +0x00, 0x01, 0x5a, 0xcd, 0x54, 0xc7, 0x00, 0x80, /* ..Z.T... */ +0xa3, 0xc7, 0x1c, 0xf6, 0x00, 0x03, 0x00, 0x0c, /* ........ */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ +0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (178 bytes) Advertise */ +static unsigned char pkt2[178] = { +0x00, 0x80, 0xa3, 0xc7, 0x1c, 0xf6, 0xec, 0x08, /* ........ */ +0x6b, 0x93, 0x70, 0xde, 0x86, 0xdd, 0x60, 0x00, /* k.p...`. */ +0x00, 0x00, 0x00, 0x7c, 0x11, 0x40, 0xfe, 0x80, /* ...|.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x08, /* ........ */ +0x6b, 0xff, 0xfe, 0x93, 0x70, 0xde, 0xfe, 0x80, /* k...p... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, /* ........ */ +0xa3, 0xff, 0xfe, 0xc7, 0x1c, 0xf6, 0xd3, 0x98, /* ........ */ +0x02, 0x22, 0x00, 0x7c, 0xd9, 0x80, 0x02, 0xdc, /* .".|.... */ +0x5d, 0x45, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ]E...... */ +0x00, 0x01, 0x5a, 0xcd, 0x54, 0xc7, 0x00, 0x80, /* ..Z.T... */ +0xa3, 0xc7, 0x1c, 0xf6, 0x00, 0x02, 0x00, 0x0a, /* ........ */ +0x00, 0x03, 0x00, 0x01, 0xec, 0x08, 0x6b, 0x93, /* ......k. */ +0x70, 0xde, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* p....(.. */ +0xdb, 0xad, 0x00, 0x00, 0xa8, 0xc0, 0x00, 0x01, /* ........ */ +0x0e, 0x00, 0x00, 0x05, 0x00, 0x18, 0x12, 0x34, /* .......4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, /* ........ */ +0x51, 0x80, 0x00, 0x01, 0x51, 0x80, 0x00, 0x17, /* Q...Q... */ +0x00, 0x20, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* . .4.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02 /* .. */ +}; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_client_process_server_duid_test_application_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 Client Process Server Duid Test...................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the new physical address. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, 0x00000080, 0xa3c71cf6, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, NX_DHCPV6_HW_TYPE_IEEE_802, 0x5acd54c7); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the DNS Server option. */ + status = nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the SNTP Server option. */ + status = nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the Time Zone option. */ + status = nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the Domain Search List option. */ + status = nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the call back function. */ + packet_process_callback = my_packet_process; + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Request the IPv6 address. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for Advertise. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check the error counter. */ + if ((error_counter) || (solicit != NX_TRUE) || (request != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG received_message_type; +NX_PACKET *response_packet; +UINT status; +NX_IPV6_HEADER *ip_header; + + /* Update the prepend to point DHCPv6 message, IPv6 header, UDP header. */ + packet_ptr -> nx_packet_prepend_ptr += (40 + 8); + + /* Extract the message type which should be the first byte. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr, 1, &received_message_type); + + /* Check for an illegal message type. */ + if ((received_message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) && (solicit == NX_FALSE)) + { + + solicit = NX_TRUE; + + /* Send DHCPv6 Server Advertise response. */ + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_RECEIVE_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + + /* Relase the packet. */ + nx_packet_release(packet_ptr); + return(NX_FALSE); + } + + response_packet -> nx_packet_prepend_ptr += 2; + response_packet -> nx_packet_append_ptr += 2; + + /* Write the DHCPv6 Server response messages into the packet payload! */ + status = nx_packet_data_append(response_packet, pkt2, sizeof(pkt2), &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + nx_packet_release(response_packet); + return(NX_FALSE); + } + + /* Set the packet version. */ + response_packet -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Set the IP header pointer. */ + response_packet -> nx_packet_ip_header = response_packet -> nx_packet_prepend_ptr + 14; + ip_header = (NX_IPV6_HEADER *)(response_packet -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + /* Update the data pointer UDP + DHCPv6 message. */ + response_packet -> nx_packet_prepend_ptr += 54; + response_packet -> nx_packet_length -= 54; + + /* Set the packet interface. */ + response_packet -> nx_packet_address.nx_packet_ipv6_address_ptr = &ip_0.nx_ipv6_address[0]; + + dhcp_client.nx_dhcpv6_message_hdr.nx_message_xid = 0xdc5d45; + + /* Receive the DHCPv6 Server response. */ + _nx_udp_packet_receive(ip_ptr, response_packet); + + } + else if((received_message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) && (request == NX_FALSE)) + { + + /* Skip the DHCPv6 header. Type and Transaction ID. */ + packet_ptr -> nx_packet_prepend_ptr += 4; + + /* Skip the Client Identifier. */ + packet_ptr -> nx_packet_prepend_ptr += 18; + + /* Skip the Elapsed time. */ + packet_ptr -> nx_packet_prepend_ptr += 6; + + /* Extract the server identifier. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr, 2, &server_identifier); + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 2, 2, &server_identifier_length); + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 4, 2, &server_duid_type); + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 6, 2, &server_hardware_type); + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 2, &server_msw); + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 10, 4, &server_lsw); + + /* Check the server identifier. */ + if ((server_identifier == 2) && (server_identifier_length == 10) && + (server_duid_type == 3) && (server_hardware_type == 1) && + (server_msw == 0x0000ec08) && (server_lsw == 0x6b9370de)) + request = NX_TRUE; + } + + /* Relase the packet. */ + nx_packet_release(packet_ptr); + + return(NX_FALSE); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_client_process_server_duid_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 Client Process Server Duid Test....................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcpv6_extended_api_test.c b/test/regression/dhcp_test/netx_dhcpv6_extended_api_test.c new file mode 100644 index 00000000..0d1bf9a3 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_extended_api_test.c @@ -0,0 +1,592 @@ +/* This is a small demo of the NetX Duo DHCPv6 Client and Server for the high-performance + NetX Duo stack. */ + +#include +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) +#include "nxd_dhcpv6_client.h" +#include "nxd_dhcpv6_server.h" + +#define DEMO_STACK_SIZE 2048 +#define NX_DHCPV6_THREAD_STACK_SIZE 2048 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_IP client_ip; +static NX_IP server_ip; + +/* Define the Client and Server instances. */ + +static NX_DHCPV6 dhcp_client; +static NX_DHCPV6_SERVER dhcp_server; + +/* Define the error counter used in the demo application... */ +static ULONG error_counter; +static CHAR *pointer; + +static NXD_ADDRESS server_address; +static NXD_ADDRESS dns_ipv6_address; +static NXD_ADDRESS start_ipv6_address; +static NXD_ADDRESS end_ipv6_address; +static ULONG handler_extended_counter; + + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); +static void dhcpv6_option_request_handler_extended(struct NX_DHCPV6_SERVER_STRUCT* dhcpv6_server_ptr, UINT option_request, UCHAR* buffer_ptr, UINT* index, UINT buffer_size); + + +/* Define some DHCPv6 parameters. */ + +#define DHCPV6_IANA_ID 0xC0DEDBAD +#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE +#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_REFERRED_LIFETIME NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_VALID_LIFETIME NX_DHCPV6_INFINITE_LEASE + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_extended_api_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the Client thread. */ + status = tx_thread_create(&thread_client, "Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create the Server thread. */ + status = tx_thread_create(&thread_server, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a Client IP instance. */ + status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a Server IP instance. */ + status = nx_ip_create(&server_ip, "Server IP", IP_ADDRESS(1, 2, 3, 4), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic for sending DHCPv6 messages. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Check for IPv6 enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the ICMPv6 services. */ + status = nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the fragment feature. */ + status = nx_ip_fragment_enable(&client_ip); + status += nx_ip_fragment_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the Client host application thread. */ + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS dns_address; +ULONG prefix_length; +UINT interface_index; +ULONG T1, T2, preferred_lifetime, valid_lifetime; +UINT address_count; +UINT address_index; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 Extended API Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Establish the link local address for the host. The RAM driver creates + a virtual MAC address of 0x1122334456. */ + status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL); + + /* Let NetX Duo and the network driver get initialized. Also give the server time to get set up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client", &pool_0, pointer, NX_DHCPV6_THREAD_STACK_SIZE, + NX_NULL, NX_NULL); + pointer = pointer + NX_DHCPV6_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. + + Note that if this host had already been assigned in IPv6 lease, it + would have to use the assigned T1 and T2 values in loading the DHCPv6 + client with an IANA block. + */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, DHCPV6_T1, DHCPV6_T2); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Starting up the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* If the host also want to get the option message, set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Now, the host send the solicit message to get the IPv6 address and other options from the DHCPv6 server. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for get the IPv6 address and do the duplicate address detection. */ + tx_thread_sleep(6 * NX_IP_PERIODIC_RATE); + + /* Get the valid IPv6 address count which the DHCPv6 server assigned . */ + status = nx_dhcpv6_get_valid_ip_address_count(&dhcp_client, &address_count); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address, preferred lifetime and valid lifetime according to the address index. */ + address_index = 0; + status = nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_client, address_index, &ipv6_address, &preferred_lifetime, &valid_lifetime); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address. */ + if ((ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 address. */ + if ((prefix_length != 64) || (interface_index != 0) || + (ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP address lease time. + Note, This API only applies to one IA. */ + status = nx_dhcpv6_get_lease_time_data(&dhcp_client, &T1, &T2, &preferred_lifetime, &valid_lifetime); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((T1 != NX_DHCPV6_DEFAULT_T1_TIME) || + (T2 != NX_DHCPV6_DEFAULT_T2_TIME) || + (preferred_lifetime != NX_DHCPV6_DEFAULT_PREFERRED_TIME) || + (valid_lifetime != NX_DHCPV6_DEFAULT_VALID_TIME)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the DNS Server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 DNS address. */ + if ((dns_address.nxd_ip_version != dns_ipv6_address.nxd_ip_version) || + (dns_address.nxd_ip_address.v6[0] != dns_ipv6_address.nxd_ip_address.v6[0]) || + (dns_address.nxd_ip_address.v6[1] != dns_ipv6_address.nxd_ip_address.v6[1]) || + (dns_address.nxd_ip_address.v6[2] != dns_ipv6_address.nxd_ip_address.v6[2]) || + (dns_address.nxd_ip_address.v6[3] != dns_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping the DHCPv6 Server. */ + status = nxd_icmp_ping(&client_ip, &server_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the address. */ + status = nx_dhcpv6_request_release(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for release the IPv6 address. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the Client task. */ + status = nx_dhcpv6_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the DHCPv6 client. */ + status = nx_dhcpv6_client_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (!handler_extended_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the test server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +ULONG duid_time; +UINT addresses_added; + + /* Set the IPv6 address of DHCPv6 Server. */ + server_address.nxd_ip_version = NX_IP_VERSION_V6 ; + server_address.nxd_ip_address.v6[0] = 0x20010db8; + server_address.nxd_ip_address.v6[1] = 0xf101; + server_address.nxd_ip_address.v6[2] = 0x00000000; + server_address.nxd_ip_address.v6[3] = 0x00000101; + + /* Set the link local and global addresses. */ + status = nxd_ipv6_address_set(&server_ip, 0, NX_NULL, 10, NULL); + status += nxd_ipv6_address_set(&server_ip, 0, &server_address, 64, NULL); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Validate the link local and global addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Server. */ + status = nx_dhcpv6_server_create(&dhcp_server, &server_ip, "DHCPv6 Server", &pool_0, pointer, NX_DHCPV6_SERVER_THREAD_STACK_SIZE, NX_NULL, NX_NULL); + pointer += NX_DHCPV6_SERVER_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set extended hanlder for option request. */ + status = nx_dhcpv6_server_option_request_handler_set(&dhcp_server, dhcpv6_option_request_handler_extended); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the DNS IPv6 server address. */ + dns_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + dns_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + dns_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + dns_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + dns_ipv6_address.nxd_ip_address.v6[3] = 0x00000107; + + status = nx_dhcpv6_create_dns_address(&dhcp_server, &dns_ipv6_address); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Note: For DUID types that do not require time, the 'duid_time' input can be left at zero. + The DUID_TYPE and HW_TYPE are configurable options that are user defined in nx_dhcpv6_server.h. */ + + /* Set the DUID time as the start of the millenium. */ + duid_time = SECONDS_SINCE_JAN_1_2000_MOD_32; + status = nx_dhcpv6_set_server_duid(&dhcp_server, + NX_DHCPV6_SERVER_DUID_TYPE, NX_DHCPV6_SERVER_HW_TYPE, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_msw, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_lsw, + duid_time); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 start address. */ + start_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + start_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + start_ipv6_address.nxd_ip_address.v6[1] = 0x00000f101; + start_ipv6_address.nxd_ip_address.v6[2] = 0x0; + start_ipv6_address.nxd_ip_address.v6[3] = 0x00000110; + + /* Set the IPv6 end address. */ + end_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + end_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + end_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + end_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + end_ipv6_address.nxd_ip_address.v6[3] = 0x00000120; + + /* Set the IPv6 address range. */ + status = nx_dhcpv6_create_ip_address_range(&dhcp_server, &start_ipv6_address, &end_ipv6_address, &addresses_added); + + /* Check for errors. */ + if ((status) || (addresses_added != 16)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the NetX DHCPv6 server! */ + status = nx_dhcpv6_server_start(&dhcp_server); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void dhcpv6_option_request_handler_extended(struct NX_DHCPV6_SERVER_STRUCT* dhcpv6_server_ptr, UINT option_request, UCHAR* buffer_ptr, UINT* index, UINT buffer_size) +{ + handler_extended_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_extended_api_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 Extended API Test..................................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/dhcp_test/netx_dhcpv6_packet_loss_test.c b/test/regression/dhcp_test/netx_dhcpv6_packet_loss_test.c new file mode 100644 index 00000000..ee785198 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_packet_loss_test.c @@ -0,0 +1,1106 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined (FEATURE_NX_IPV6) && defined(NX_ENABLE_INTERFACE_CAPABILITY) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +#define DEMO_STACK_SIZE 2048 +#define DHCPV6_IANA_ID 0x165c19da + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static CHAR *pointer; +static ULONG error_counter; + +static UCHAR bound_flag = NX_FALSE; +static UCHAR renew_flag = NX_FALSE; + +/* Define thread prototypes. */ + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static VOID dhcpv6_server_packet_response(UINT transaction_id, UINT packet_index); +static VOID dhcpv6_state_change_notify(NX_DHCPV6 *dhcpv6_ptr, UINT old_state, UINT new_state); + +#if 0 + /* Frame (130 bytes) */ +static const unsigned char pkt1[130] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x4c, 0x11, 0x40, 0xfe, 0x80, /* ...L.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x4c, 0x15, 0x8e, 0x01, 0xcb, /* .#.L.... */ +0x5d, 0x95, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ]....... */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, 0x00, 0x0c, /* .nW..... */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x00, /* .\...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, /* ...'.... */ +0x4d, 0x79, 0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, /* My-Devic */ +0x65, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0x17, /* e....... */ +0x00, 0x27 /* .' */ +}; +#endif + +/* Frame (198 bytes) */ +static const unsigned char pkt2[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x80, 0xb1, 0x02, 0xcb, /* ."...... */ +0x5d, 0x95, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ]....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt3[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x81, 0xe5, 0x02, 0xcb, /* ."...... */ +0x5d, 0x95, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ]....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +#if 0 +/* Frame (176 bytes) */ +static const unsigned char pkt4[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0x84, 0x9b, 0x03, 0x22, /* .#.z..." */ +0x2c, 0x93, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ,....... */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; +#endif + +/* Frame (198 bytes) */ +static const unsigned char pkt5[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0xad, 0x5c, 0x07, 0x22, /* ."...\." */ +0x2c, 0x93, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ,....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt6[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0xae, 0x90, 0x07, 0x22, /* ."....." */ +0x2c, 0x93, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ,....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +#if 0 +/* Frame (176 bytes) */ +static const unsigned char pkt7[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0xf9, 0x6f, 0x05, 0x2f, /* .#.z.o./ */ +0xb5, 0xb1, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; +#endif + +/* Frame (198 bytes) */ +static const unsigned char pkt8[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x24, 0x31, 0x07, 0x2f, /* ."..$1./ */ +0xb5, 0xb1, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt9[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x25, 0x65, 0x07, 0x2f, /* ."..%e./ */ +0xb5, 0xb1, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +#if 0 +/* Frame (176 bytes) */ +static const unsigned char pkt10[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0xf9, 0x6f, 0x05, 0x2f, /* .#.z.o./ */ +0xb5, 0xb1, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt11[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x24, 0x31, 0x07, 0x2f, /* ."..$1./ */ +0xb5, 0xb1, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt12[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x25, 0x65, 0x07, 0x2f, /* ."..%e./ */ +0xb5, 0xb1, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (176 bytes) */ +static const unsigned char pkt13[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0x68, 0xf3, 0x05, 0x76, /* .#.zh..v */ +0x45, 0xe7, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt14[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x93, 0xb4, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt15[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x94, 0xe8, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (176 bytes) */ +static const unsigned char pkt16[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0x68, 0xf3, 0x05, 0x76, /* .#.zh..v */ +0x45, 0xe7, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt17[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x93, 0xb4, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt18[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x94, 0xe8, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (176 bytes) */ +static const unsigned char pkt19[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0x68, 0xf3, 0x05, 0x76, /* .#.zh..v */ +0x45, 0xe7, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt20[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x93, 0xb4, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt21[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x94, 0xe8, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (176 bytes) */ +static const unsigned char pkt22[176] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0xaa, 0xab, /* 33...... */ +0xac, 0x6e, 0x57, 0xdd, 0x86, 0xdd, 0x60, 0x00, /* .nW...`. */ +0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0xff, 0x02, /* ...nW... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x7a, 0x68, 0xf3, 0x05, 0x76, /* .#.zh..v */ +0x45, 0xe7, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, 0xaa, 0xab, /* .....&.. */ +0xac, 0x6e, 0x57, 0xdd, 0x00, 0x08, 0x00, 0x02, /* .nW..... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x03, 0x00, 0x28, /* k..z...( */ +0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, 0x00, 0x1e, /* .\...... */ +0x00, 0x00, 0x00, 0x30, 0x00, 0x05, 0x00, 0x18, /* ...0.... */ +0x12, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .4...... */ +0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, 0xaf, 0x72, /* .Z...|.r */ +0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x78, /* ...<...x */ +0x00, 0x27, 0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, /* .'....My */ +0x2d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, /* -Device. */ +0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x27 /* .......' */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt23[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x50, /* ...nW..P */ +0xda, 0xc6, 0x5a, 0x48, 0x86, 0xdd, 0x60, 0x00, /* ..ZH..`. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0x12, 0x34, /* .....@.4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x93, 0xb4, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; + +/* Frame (198 bytes) */ +static const unsigned char pkt24[198] = { +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x1f, /* ...nW... */ +0x9e, 0x5b, 0x74, 0x02, 0x86, 0xdd, 0x6e, 0x00, /* .[t...n. */ +0x00, 0x00, 0x00, 0x90, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1f, /* ........ */ +0x9e, 0xff, 0xfe, 0x5b, 0x74, 0x02, 0xfe, 0x80, /* ...[t... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xab, /* ........ */ +0xac, 0xff, 0xfe, 0x6e, 0x57, 0xdd, 0x02, 0x23, /* ...nW..# */ +0x02, 0x22, 0x00, 0x90, 0x94, 0xe8, 0x07, 0x76, /* .".....v */ +0x45, 0xe7, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* E....... */ +0x00, 0x01, 0x0f, 0xf4, 0x76, 0x42, 0x00, 0x09, /* ....vB.. */ +0x6b, 0x07, 0xa3, 0x7a, 0x00, 0x01, 0x00, 0x0e, /* k..z.... */ +0x00, 0x01, 0x00, 0x01, 0x99, 0x0a, 0xb5, 0x26, /* .......& */ +0xaa, 0xab, 0xac, 0x6e, 0x57, 0xdd, 0x00, 0x03, /* ...nW... */ +0x00, 0x28, 0x16, 0x5c, 0x19, 0xda, 0x00, 0x00, /* .(.\.... */ +0x00, 0x1e, 0x00, 0x00, 0x00, 0x30, 0x00, 0x05, /* .....0.. */ +0x00, 0x18, 0x12, 0x34, 0x00, 0x00, 0x00, 0x00, /* ...4.... */ +0x00, 0x00, 0x0b, 0x5a, 0xbe, 0xb5, 0x9e, 0x7c, /* ...Z...| */ +0xaf, 0x72, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* .r...<.. */ +0x00, 0x78, 0x00, 0x17, 0x00, 0x20, 0x12, 0x34, /* .x... .4 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x27, /* .......' */ +0x00, 0x0c, 0x00, 0x09, 0x4d, 0x79, 0x2d, 0x44, /* ....My-D */ +0x65, 0x76, 0x69, 0x63, 0x65, 0x00 /* evice. */ +}; +#endif + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_packet_loss_test_application_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 Packet Loss Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the new physical address. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, 0x0000aaab, 0xac6e57dd, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, dhcpv6_state_change_notify, NX_NULL); + pointer += 2048; + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, NX_DHCPV6_HW_TYPE_IEEE_802, 0x990ab526); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the DNS Server option. */ + status = nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the DHCPv6 Client FQDN option. + operation: NX_DHCPV6_CLIENT_DESIRES_UPDATE_AAAA_RR DHCPv6 Client choose to updating the FQDN-to-IPv6 address mapping for FQDN and address(es) used by the client. + NX_DHCPV6_CLIENT_DESIRES_SERVER_DO_DNS_UPDATE DHCPv6 Client choose to updating the FQDN-to-IPv6 address mapping for FQDN and address(es) used by the client to the server. + NX_DHCPV6_CLIENT_DESIRES_NO_SERVER_DNS_UPDATE DHCPv6 Client choose to request that the server perform no DNS updatest on its behalf. */ + status = nx_dhcpv6_request_option_FQDN(&dhcp_client, "DHCPv6-Client", NX_DHCPV6_CLIENT_DESIRES_UPDATE_AAAA_RR); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the call back function. */ + packet_process_callback = my_packet_process; + + /* Check the available packet. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Request the IPv6 address. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 40s to detect requesting and renewing operation. */ + tx_thread_sleep(40 * NX_IP_PERIODIC_RATE); + + /* Check the available packet. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the error counter. */ + if ((error_counter) || (bound_flag != NX_TRUE) || (renew_flag != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +ULONG received_message_type; +ULONG transaction_id; + + /* Update the prepend to point DHCPv6 message, IPv6 header, UDP header. */ + packet_ptr -> nx_packet_prepend_ptr += (40 + 8); + + /* Extract the message type which should be the first byte. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr, 1, &received_message_type); + + /* Parse the transaction ID. */ + _nx_dhcpv6_utility_get_data((packet_ptr -> nx_packet_prepend_ptr + 1), 3, &transaction_id); + + /* Check for an illegal message type. */ + if (received_message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + + /* Send DHCPv6 Server Advertise response. */ + dhcpv6_server_packet_response(transaction_id, 2); + dhcpv6_server_packet_response(transaction_id, 3); + + } + else if(received_message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Send DHCPv6 Server Reply response. */ + dhcpv6_server_packet_response(transaction_id, 5); + dhcpv6_server_packet_response(transaction_id, 6); + } + else if (received_message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) + { + /* Send DHCPv6 Server Reply response. */ + dhcpv6_server_packet_response(transaction_id, 8); + dhcpv6_server_packet_response(transaction_id, 9); + } + + /* Relase the packet. */ + nx_packet_release(packet_ptr); + + /* Return success. */ + return(NX_SUCCESS); +} +static VOID dhcpv6_server_packet_response(UINT transaction_id, UINT packet_index) +{ +UINT status; +NX_PACKET *response_packet; +UCHAR *data_ptr; +UINT data_size; +UINT offset; +ULONG message_type; +ULONG message_word; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Check the index. */ + if (packet_index == 2) + { + data_ptr = (UCHAR *)pkt2; + } + else if (packet_index == 3) + { + data_ptr = (UCHAR *)pkt3; + } + else if (packet_index == 5) + { + data_ptr = (UCHAR *)pkt5; + } + else if (packet_index == 6) + { + data_ptr = (UCHAR *)pkt6; + } + else if (packet_index == 8) + { + data_ptr = (UCHAR *)pkt8; + } + else if (packet_index == 9) + { + data_ptr = (UCHAR *)pkt9; + } + else + { + + error_counter ++; + return; + } + + /* Set the data size. */ + data_size = 198; + + /* Set the offset(physical header + IPv6 header). */ + offset = 14 + 40; + + /* Write the DHCPv6 Server response messages into the packet payload! */ + status = nx_packet_data_append(response_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the packet version. */ + response_packet -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Set the IP header pointer. */ + response_packet -> nx_packet_ip_header = response_packet -> nx_packet_prepend_ptr + 14; + + /* Update the data pointer tp UDP + DHCPv6 message. */ + response_packet -> nx_packet_prepend_ptr += offset; + response_packet -> nx_packet_length -= offset; + + /* Extract the message type which should be the first byte. */ + _nx_dhcpv6_utility_get_data(response_packet -> nx_packet_prepend_ptr + 8, 1, &message_type); + + /* Clear memory to make the message header. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add the message type and transaction ID as the DHCPv6 header fields. */ + message_word = ((ULONG)message_type << 24); + + /* Set the transaction ID. */ + message_word |= (((ULONG)(0x0ffffff)) & (transaction_id)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Copy the message header to the packet buffer. */ + memcpy(response_packet -> nx_packet_prepend_ptr + 8, &message_word, 4); + + /* Set the packet interface. */ + response_packet -> nx_packet_address.nx_packet_ipv6_address_ptr = &ip_0.nx_ipv6_address[0]; + + /* Set the interface capablility flag to disable the UDP checksum check, (simplify operation)*/ + ip_0.nx_ipv6_address[0].nxd_ipv6_address_attached -> nx_interface_capability_flag |= NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM; + + /* Receive the DHCPv6 Server response. */ + _nx_udp_packet_receive(&ip_0, response_packet); + + return; +} +/* This is the notification from the DHCPv6 Client task that it has changed + state in the DHCPv6 protocol, for example getting assigned an IPv6 lease and + achieving the bound state or an IPv6 lease expires and being reset to + the init state. +*/ +static VOID dhcpv6_state_change_notify(NX_DHCPV6 *dhcpv6_ptr, UINT old_state, UINT new_state) +{ + + + /* Check if the Client has been assigned an IPv6 lease. */ + if ((old_state == NX_DHCPV6_STATE_SENDING_REQUEST) && (new_state == NX_DHCPV6_STATE_BOUND_TO_ADDRESS)) + { + + /* Update the flag. */ + bound_flag = NX_TRUE; + + /* Check the available packet. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + } + + /* Check if the Client has been assigned an IPv6 lease. */ + if ((old_state == NX_DHCPV6_STATE_SENDING_RENEW) && (new_state == NX_DHCPV6_STATE_BOUND_TO_ADDRESS)) + { + + /* Update the flag. */ + renew_flag = NX_TRUE; + + /* Check the available packet. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_packet_loss_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 Packet Loss Test...................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/dhcp_test/netx_dhcpv6_server_ia_options_test.c b/test/regression/dhcp_test/netx_dhcpv6_server_ia_options_test.c new file mode 100644 index 00000000..7a8e7cfe --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_server_ia_options_test.c @@ -0,0 +1,699 @@ +/* This tests dhcpv6 server process ia options from the client. */ + +#include +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_udp.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dhcpv6_server.h" + +#define DEMO_STACK_SIZE 2048 +#define NX_DHCPV6_THREAD_STACK_SIZE 2048 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_IP client_ip; +static NX_IP server_ip; + +/* Define the Client and Server instances. */ + +static NX_DHCPV6 dhcp_client; +static NX_DHCPV6_SERVER dhcp_server; + +/* Define the error counter used in the demo application... */ +static ULONG error_counter; +static CHAR *pointer; + +static NXD_ADDRESS server_address; +static NXD_ADDRESS dns_ipv6_address; +static NXD_ADDRESS start_ipv6_address; +static NXD_ADDRESS end_ipv6_address; + + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +/* Optionally substitute your Ethernet driver here. */ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define some DHCPv6 parameters. */ + +#define DHCPV6_IANA_ID 0xC0DEDBAD +#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE +#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_REFERRED_LIFETIME NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_VALID_LIFETIME NX_DHCPV6_INFINITE_LEASE + +#define TEST_VALID_LIFETIME 0x1770 +#define TEST_PREFERRED_LIFETIME 0x0BB8 + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_server_ia_options_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the Client thread. */ + status = tx_thread_create(&thread_client, "Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create the Server thread. */ + status = tx_thread_create(&thread_server, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a Client IP instance. */ + status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a Server IP instance. */ + status = nx_ip_create(&server_ip, "Server IP", IP_ADDRESS(1, 2, 3, 4), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic for sending DHCPv6 messages. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Check for IPv6 enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the ICMPv6 services. */ + status = nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the fragment feature. */ + status = nx_ip_fragment_enable(&client_ip); + status += nx_ip_fragment_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the Client host application thread. */ + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS dns_address; +ULONG prefix_length; +UINT interface_index; +ULONG T1, T2, preferred_lifetime, valid_lifetime; +UINT address_count; +UINT address_index; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 Server IA Options Test........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Establish the link local address for the host. The RAM driver creates + a virtual MAC address of 0x1122334456. */ + status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL); + + /* Let NetX Duo and the network driver get initialized. Also give the server time to get set up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client", &pool_0, pointer, NX_DHCPV6_THREAD_STACK_SIZE, + NX_NULL, NX_NULL); + pointer = pointer + NX_DHCPV6_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. + + Note that if this host had already been assigned in IPv6 lease, it + would have to use the assigned T1 and T2 values in loading the DHCPv6 + client with an IANA block. + */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, DHCPV6_T1, DHCPV6_T2); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Starting up the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* If the host also want to get the option message, set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Set the callback function to process the Message packet from DHCPv6 Server. */ + advanced_packet_process_callback = my_packet_process; + + /* Now, the host send the solicit message to get the IPv6 address and other options from the DHCPv6 server. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for get the IPv6 address and do the duplicate address detection. */ + tx_thread_sleep(6 * NX_IP_PERIODIC_RATE); + + /* Get the valid IPv6 address count which the DHCPv6 server assigned . */ + status = nx_dhcpv6_get_valid_ip_address_count(&dhcp_client, &address_count); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address, preferred lifetime and valid lifetime according to the address index. */ + address_index = 0; + status = nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_client, address_index, &ipv6_address, &preferred_lifetime, &valid_lifetime); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address. */ + if ((ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 address. */ + if ((prefix_length != 64) || (interface_index != 0) || + (ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP address lease time. + Note, This API only applies to one IA. */ + status = nx_dhcpv6_get_lease_time_data(&dhcp_client, &T1, &T2, &preferred_lifetime, &valid_lifetime); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((T1 != NX_DHCPV6_DEFAULT_T1_TIME) || + (T2 != NX_DHCPV6_DEFAULT_T2_TIME) || + (preferred_lifetime != NX_DHCPV6_DEFAULT_PREFERRED_TIME) || + (valid_lifetime != NX_DHCPV6_DEFAULT_VALID_TIME)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the DNS Server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 DNS address. */ + if ((dns_address.nxd_ip_version != dns_ipv6_address.nxd_ip_version) || + (dns_address.nxd_ip_address.v6[0] != dns_ipv6_address.nxd_ip_address.v6[0]) || + (dns_address.nxd_ip_address.v6[1] != dns_ipv6_address.nxd_ip_address.v6[1]) || + (dns_address.nxd_ip_address.v6[2] != dns_ipv6_address.nxd_ip_address.v6[2]) || + (dns_address.nxd_ip_address.v6[3] != dns_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now, send the confirm message. */ + status = nx_dhcpv6_request_confirm(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for release the IPv6 address. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * 6); + + /* Release the address. */ + status = nx_dhcpv6_request_release(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for release the IPv6 address. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the Client task. */ + status = nx_dhcpv6_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the DHCPv6 client. */ + status = nx_dhcpv6_client_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the test server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +ULONG duid_time; +UINT addresses_added; + + /* Set the IPv6 address of DHCPv6 Server. */ + server_address.nxd_ip_version = NX_IP_VERSION_V6 ; + server_address.nxd_ip_address.v6[0] = 0x20010db8; + server_address.nxd_ip_address.v6[1] = 0xf101; + server_address.nxd_ip_address.v6[2] = 0x00000000; + server_address.nxd_ip_address.v6[3] = 0x00000101; + + /* Set the link local and global addresses. */ + status = nxd_ipv6_address_set(&server_ip, 0, NX_NULL, 10, NULL); + status += nxd_ipv6_address_set(&server_ip, 0, &server_address, 64, NULL); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Validate the link local and global addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Server. */ + status = nx_dhcpv6_server_create(&dhcp_server, &server_ip, "DHCPv6 Server", &pool_0, pointer, NX_DHCPV6_SERVER_THREAD_STACK_SIZE, NX_NULL, NX_NULL); + pointer += NX_DHCPV6_SERVER_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the DNS IPv6 server address. */ + dns_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + dns_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + dns_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + dns_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + dns_ipv6_address.nxd_ip_address.v6[3] = 0x00000107; + + status = nx_dhcpv6_create_dns_address(&dhcp_server, &dns_ipv6_address); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Note: For DUID types that do not require time, the 'duid_time' input can be left at zero. + The DUID_TYPE and HW_TYPE are configurable options that are user defined in nx_dhcpv6_server.h. */ + + /* Set the DUID time as the start of the millenium. */ + duid_time = SECONDS_SINCE_JAN_1_2000_MOD_32; + status = nx_dhcpv6_set_server_duid(&dhcp_server, + NX_DHCPV6_SERVER_DUID_TYPE, NX_DHCPV6_SERVER_HW_TYPE, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_msw, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_lsw, + duid_time); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 start address. */ + start_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + start_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + start_ipv6_address.nxd_ip_address.v6[1] = 0x00000f101; + start_ipv6_address.nxd_ip_address.v6[2] = 0x0; + start_ipv6_address.nxd_ip_address.v6[3] = 0x00000110; + + /* Set the IPv6 end address. */ + end_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + end_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + end_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + end_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + end_ipv6_address.nxd_ip_address.v6[3] = 0x00000120; + + /* Set the IPv6 address range. */ + status = nx_dhcpv6_create_ip_address_range(&dhcp_server, &start_ipv6_address, &end_ipv6_address, &addresses_added); + + /* Check for errors. */ + if ((status) || (addresses_added != 16)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the NetX DHCPv6 server! */ + status = nx_dhcpv6_server_start(&dhcp_server); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR message_type; +UCHAR reserved[3]; +static UINT confirm_sent = NX_FALSE; + + + /* Check the IP. */ + if (ip_ptr == &client_ip) + { + + /* Get the message type. */ + message_type = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 8); + + /* Check if it is CONFIRM message from DHCPv6 client. */ + if (message_type == NX_DHCPV6_MESSAGE_TYPE_CONFIRM) + { + confirm_sent = NX_TRUE; + } + } + if (ip_ptr == &server_ip) + { + + /* Get the message type. */ + message_type = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 8); + + /* Check if it is REPLY message from DHCPv6 server. */ + if (message_type == NX_DHCPV6_MESSAGE_TYPE_REPLY) + { + if (confirm_sent == NX_TRUE) + { + confirm_sent = NX_FALSE; + + if (dhcp_server.nx_dhcpv6_clients[0].nx_dhcpv6_ia.nx_valid_lifetime == TEST_VALID_LIFETIME) + { + return(NX_FALSE); + } + + if (dhcp_server.nx_dhcpv6_clients[0].nx_dhcpv6_ia.nx_preferred_lifetime == TEST_PREFERRED_LIFETIME) + { + return(NX_FALSE); + } + } + } + } + + return(NX_TRUE); +} + +void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +ULONG message_type; +NX_UDP_HEADER *udp_header_ptr; +ULONG *requested_lease_time; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG *ip_src_addr = NX_NULL; +ULONG *ip_dest_addr = NX_NULL; + + + udp_header_ptr = (NX_UDP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get the message type. */ + message_type = *(packet_ptr -> nx_packet_prepend_ptr + 8); + + /* Check if the message is a CONFIRM. */ + if (message_type == NX_DHCPV6_MESSAGE_TYPE_CONFIRM) + { + + /* Force change the valid lifetime and preferred lifetime. */ + *(packet_ptr -> nx_packet_prepend_ptr + 74) = 0x0B; + *(packet_ptr -> nx_packet_prepend_ptr + 75) = 0xB8; + *(packet_ptr -> nx_packet_prepend_ptr + 78) = 0x17; + *(packet_ptr -> nx_packet_prepend_ptr + 79) = 0x70; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* compute the checksum. */ + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Restore the udp packet receiving function. */ + server_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_server_ia_options_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 Server IA Options Test...............................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/dhcp_test/netx_dhcpv6_server_iana_test.c b/test/regression/dhcp_test/netx_dhcpv6_server_iana_test.c new file mode 100644 index 00000000..ea845ee9 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_server_iana_test.c @@ -0,0 +1,352 @@ +/* Verify DHCPv6 Server can correctly process IANA option in DHCPv6 Solicit message. */ + +/* Procedure + 1.Memset the packet pool. + 2.Create DHCPv6 Server. + 3.Inject DHCPv6 Solicit message. + 4.Check if receive DHCPv6 Advertise message from DHCPv6 Server. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 +#include "nxd_dhcpv6_server.h" + + +#define DEMO_STACK_SIZE 4096 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_DHCPV6_SERVER dhcp_server; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR advertise_message_count = 0; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void server_thread_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define some DHCPv6 parameters. */ + +#define DHCPV6_IANA_ID 0xC0DEDBAD +#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE +#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_REFERRED_LIFETIME NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_VALID_LIFETIME NX_DHCPV6_INFINITE_LEASE + +static NXD_ADDRESS server_address; +static NXD_ADDRESS dns_ipv6_address; +static NXD_ADDRESS start_ipv6_address; +static NXD_ADDRESS end_ipv6_address; +static ULONG client_address[4]; +static CHAR mac[6]; + + +/* Frame (342 bytes) DHCPv6 Solicit, IANA is filled in the last option. */ +static const unsigned char pkt1[118] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x08, 0x00, /* 33...... */ +0x27, 0xdf, 0x0b, 0xb2, 0x86, 0xdd, 0x60, 0x0c, /* '.....`. */ +0x28, 0xf6, 0x00, 0x40, 0x11, 0x01, 0xfe, 0x80, /* (..@.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, /* ........ */ +0x27, 0xff, 0xfe, 0xdf, 0x0b, 0xb2, 0xff, 0x02, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x40, 0xb2, 0x37, 0x01, 0xdd, /* .#.@.7.. */ +0xf3, 0x3a, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .:...... */ +0x00, 0x01, 0x20, 0xec, 0x65, 0xde, 0x08, 0x00, /* .. .e... */ +0x27, 0xdf, 0x0b, 0xb2, 0x00, 0x06, 0x00, 0x08, /* '....... */ +0x00, 0x17, 0x00, 0x18, 0x00, 0x27, 0x00, 0x1f, /* .....'.. */ +0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x0c, 0x27, 0xdf, 0x0b, 0xb2, 0x00, 0x00, /* ..'..... */ +0x0e, 0x10, 0x00, 0x00, 0x15, 0x18 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_server_iana_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Clear the memory value. */ + memset(pointer, 0, NX_PACKET_POOL_SIZE); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance for the DHCP Server. */ + status = nx_ip_create(&server_ip, "DHCP Server", IP_ADDRESS(10, 0, 0, 1), 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable the IPv6 services. */ + status = nxd_ipv6_enable(&server_ip); + + /* Check for IPv6 enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nxd_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + return; +} + +/* Define the test threads. */ + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +ULONG duid_time; +UINT addresses_added; +NX_PACKET *my_packet; + + printf("NetX Test: NetX DHCPv6 Server IANA Test.............................."); + + /* Set the IPv6 address of DHCPv6 Server. */ + server_address.nxd_ip_version = NX_IP_VERSION_V6 ; + server_address.nxd_ip_address.v6[0] = 0x20010db8; + server_address.nxd_ip_address.v6[1] = 0xf101; + server_address.nxd_ip_address.v6[2] = 0x00000000; + server_address.nxd_ip_address.v6[3] = 0x00000101; + + /* Set the link local and global addresses. */ + status = nxd_ipv6_address_set(&server_ip, 0, NX_NULL, 10, NULL); + status += nxd_ipv6_address_set(&server_ip, 0, &server_address, 64, NULL); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ND Cache for DHCPv6 Client. */ + client_address[0] = 0xfe800000; + client_address[1] = 0x00000000; + client_address[2] = 0x0a0027ff; + client_address[3] = 0xfedf0bb2; + mac[0] = 0x08; + mac[1] = 0x00; + mac[2] = 0x27; + mac[3] = 0xdf; + mac[4] = 0x0b; + mac[5] = 0xb2; + status = nxd_nd_cache_entry_set(&server_ip, client_address, 0, mac); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Validate the link local and global addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Server. */ + status = nx_dhcpv6_server_create(&dhcp_server, &server_ip, "DHCPv6 Server", &server_pool, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the DNS IPv6 server address. */ + dns_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + dns_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + dns_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + dns_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + dns_ipv6_address.nxd_ip_address.v6[3] = 0x00000107; + + status = nx_dhcpv6_create_dns_address(&dhcp_server, &dns_ipv6_address); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Note: For DUID types that do not require time, the 'duid_time' input can be left at zero. + The DUID_TYPE and HW_TYPE are configurable options that are user defined in nx_dhcpv6_server.h. */ + + /* Set the DUID time as the start of the millenium. */ + duid_time = SECONDS_SINCE_JAN_1_2000_MOD_32; + status = nx_dhcpv6_set_server_duid(&dhcp_server, + NX_DHCPV6_SERVER_DUID_TYPE, NX_DHCPV6_SERVER_HW_TYPE, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_msw, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_lsw, + duid_time); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 start address. */ + start_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + start_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + start_ipv6_address.nxd_ip_address.v6[1] = 0x00000f101; + start_ipv6_address.nxd_ip_address.v6[2] = 0x0; + start_ipv6_address.nxd_ip_address.v6[3] = 0x00000110; + + /* Set the IPv6 end address. */ + end_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + end_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + end_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + end_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + end_ipv6_address.nxd_ip_address.v6[3] = 0x00000120; + + /* Set the IPv6 address range. */ + status = nx_dhcpv6_create_ip_address_range(&dhcp_server, &start_ipv6_address, &end_ipv6_address, &addresses_added); + + /* Check for errors. */ + if ((status) || (addresses_added != 16)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the NetX DHCPv6 server! */ + status = nx_dhcpv6_server_start(&dhcp_server); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the DHCP DISCOVER packet. */ + status = nx_packet_allocate(&server_pool, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Set the callback function to process the Message packet from DHCPv6 Server. */ + advanced_packet_process_callback = my_packet_process; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + my_packet -> nx_packet_length = sizeof(pkt1) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(pkt1) - 14; + + /* Directly receive the DHCP DISCOVER packet. */ + _nx_ip_packet_deferred_receive(&server_ip, my_packet); + + /* Check if receive the advertise message. */ + if (advertise_message_count != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); + + return; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR message_type; + + + /* Check the IP. */ + if (ip_ptr == &server_ip) + { + + /* Get the message type. */ + message_type = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 8); + + /* Check if it is Advertise message from DHCPv6 Server. */ + if (message_type == NX_DHCPV6_MESSAGE_TYPE_ADVERTISE) + { + + /* Yes, receive the advertise message. */ + advertise_message_count ++; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_server_iana_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NetX DHCPv6 Server IANA Test..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcpv6_server_process_repeated_msgs_test.c b/test/regression/dhcp_test/netx_dhcpv6_server_process_repeated_msgs_test.c new file mode 100644 index 00000000..01ffde00 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_server_process_repeated_msgs_test.c @@ -0,0 +1,771 @@ +/* This is a small demo of the NetX Duo DHCPv6 Client and Server for the high-performance + NetX Duo stack. */ + +#include +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_udp.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dhcpv6_server.h" + +#define DEMO_STACK_SIZE 2048 +#define NX_DHCPV6_THREAD_STACK_SIZE 2048 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_IP client_ip; +static NX_IP server_ip; + +/* Define the Client and Server instances. */ + +static NX_DHCPV6 dhcp_client; +static NX_DHCPV6_SERVER dhcp_server; + +/* Define the error counter used in the demo application... */ +static ULONG error_counter; +static CHAR *pointer; +static UCHAR advertise_message_count = 0; +static UCHAR reply_message_count = 0; + +static NXD_ADDRESS server_address; +static NXD_ADDRESS dns_ipv6_address; +static NXD_ADDRESS start_ipv6_address; +static NXD_ADDRESS end_ipv6_address; + +static UCHAR client_xid[3] = {0, 0, 0}; +static UCHAR server_xid[3] = {0, 0, 0}; + + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +/******** Optionally substitute your Ethernet driver here. ***********/ + +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define some DHCPv6 parameters. */ + +#define DHCPV6_IANA_ID 0xC0DEDBAD +#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE +#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_REFERRED_LIFETIME NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_VALID_LIFETIME NX_DHCPV6_INFINITE_LEASE + +/* Define the cycle times for repeating the test. */ +#define TEST_REPEATING_CYCLE 2 + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_server_process_repeated_msg_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the Client thread. */ + status = tx_thread_create(&thread_client, "Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create the Server thread. */ + status = tx_thread_create(&thread_server, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a Client IP instance. */ + status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a Server IP instance. */ + status = nx_ip_create(&server_ip, "Server IP", IP_ADDRESS(1, 2, 3, 4), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic for sending DHCPv6 messages. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Check for IPv6 enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the ICMPv6 services. */ + status = nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the fragment feature. */ + status = nx_ip_fragment_enable(&client_ip); + status += nx_ip_fragment_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the Client host application thread. */ + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS dns_address; +ULONG prefix_length; +UINT interface_index; +ULONG T1, T2, preferred_lifetime, valid_lifetime; +UINT address_count; +UINT address_index; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 Server Process Repeated Msg Test........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Establish the link local address for the host. The RAM driver creates + a virtual MAC address of 0x1122334456. */ + status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL); + + /* Let NetX Duo and the network driver get initialized. Also give the server time to get set up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client", &pool_0, pointer, NX_DHCPV6_THREAD_STACK_SIZE, + NX_NULL, NX_NULL); + pointer = pointer + NX_DHCPV6_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. + + Note that if this host had already been assigned in IPv6 lease, it + would have to use the assigned T1 and T2 values in loading the DHCPv6 + client with an IANA block. + */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, DHCPV6_T1, DHCPV6_T2); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Starting up the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* If the host also want to get the option message, set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Set the callback function to process the Message packet from DHCPv6 Server. */ + advanced_packet_process_callback = my_packet_process; + + /* Now, the host send the solicit message to get the IPv6 address and other options from the DHCPv6 server. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for get the IPv6 address and do the duplicate address detection. */ + tx_thread_sleep(6 * NX_IP_PERIODIC_RATE); + + /* Get the valid IPv6 address count which the DHCPv6 server assigned . */ + status = nx_dhcpv6_get_valid_ip_address_count(&dhcp_client, &address_count); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address, preferred lifetime and valid lifetime according to the address index. */ + address_index = 0; + status = nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_client, address_index, &ipv6_address, &preferred_lifetime, &valid_lifetime); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address. */ + if ((ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 address. */ + if ((prefix_length != 64) || (interface_index != 0) || + (ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP address lease time. + Note, This API only applies to one IA. */ + status = nx_dhcpv6_get_lease_time_data(&dhcp_client, &T1, &T2, &preferred_lifetime, &valid_lifetime); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((T1 != NX_DHCPV6_DEFAULT_T1_TIME) || + (T2 != NX_DHCPV6_DEFAULT_T2_TIME) || + (preferred_lifetime != NX_DHCPV6_DEFAULT_PREFERRED_TIME) || + (valid_lifetime != NX_DHCPV6_DEFAULT_VALID_TIME)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the DNS Server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 DNS address. */ + if ((dns_address.nxd_ip_version != dns_ipv6_address.nxd_ip_version) || + (dns_address.nxd_ip_address.v6[0] != dns_ipv6_address.nxd_ip_address.v6[0]) || + (dns_address.nxd_ip_address.v6[1] != dns_ipv6_address.nxd_ip_address.v6[1]) || + (dns_address.nxd_ip_address.v6[2] != dns_ipv6_address.nxd_ip_address.v6[2]) || + (dns_address.nxd_ip_address.v6[3] != dns_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + for (UINT i = 0; i < TEST_REPEATING_CYCLE; i++) + { + + /* Now, send the confirm message multiple-times. */ + status = nx_dhcpv6_request_confirm(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for get the IPv6 address and do the duplicate address detection. */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + } + + /* Check reply message count so far: */ + if (reply_message_count != 3) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the address. */ + status = nx_dhcpv6_request_release(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for release the IPv6 address. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the Client task. */ + status = nx_dhcpv6_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the DHCPv6 client. */ + status = nx_dhcpv6_client_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the test server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +ULONG duid_time; +UINT addresses_added; + + /* Set the IPv6 address of DHCPv6 Server. */ + server_address.nxd_ip_version = NX_IP_VERSION_V6 ; + server_address.nxd_ip_address.v6[0] = 0x20010db8; + server_address.nxd_ip_address.v6[1] = 0xf101; + server_address.nxd_ip_address.v6[2] = 0x00000000; + server_address.nxd_ip_address.v6[3] = 0x00000101; + + /* Set the link local and global addresses. */ + status = nxd_ipv6_address_set(&server_ip, 0, NX_NULL, 10, NULL); + status += nxd_ipv6_address_set(&server_ip, 0, &server_address, 64, NULL); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Validate the link local and global addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Server. */ + status = nx_dhcpv6_server_create(&dhcp_server, &server_ip, "DHCPv6 Server", &pool_0, pointer, NX_DHCPV6_SERVER_THREAD_STACK_SIZE, NX_NULL, NX_NULL); + pointer += NX_DHCPV6_SERVER_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the DNS IPv6 server address. */ + dns_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + dns_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + dns_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + dns_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + dns_ipv6_address.nxd_ip_address.v6[3] = 0x00000107; + + status = nx_dhcpv6_create_dns_address(&dhcp_server, &dns_ipv6_address); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Note: For DUID types that do not require time, the 'duid_time' input can be left at zero. + The DUID_TYPE and HW_TYPE are configurable options that are user defined in nx_dhcpv6_server.h. */ + + /* Set the DUID time as the start of the millenium. */ + duid_time = SECONDS_SINCE_JAN_1_2000_MOD_32; + status = nx_dhcpv6_set_server_duid(&dhcp_server, + NX_DHCPV6_SERVER_DUID_TYPE, NX_DHCPV6_SERVER_HW_TYPE, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_msw, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_lsw, + duid_time); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 start address. */ + start_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + start_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + start_ipv6_address.nxd_ip_address.v6[1] = 0x00000f101; + start_ipv6_address.nxd_ip_address.v6[2] = 0x0; + start_ipv6_address.nxd_ip_address.v6[3] = 0x00000110; + + /* Set the IPv6 end address. */ + end_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + end_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + end_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + end_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + end_ipv6_address.nxd_ip_address.v6[3] = 0x00000120; + + /* Set the IPv6 address range. */ + status = nx_dhcpv6_create_ip_address_range(&dhcp_server, &start_ipv6_address, &end_ipv6_address, &addresses_added); + + /* Check for errors. */ + if ((status) || (addresses_added != 16)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the NetX DHCPv6 server! */ + status = nx_dhcpv6_server_start(&dhcp_server); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR message_type; +static UCHAR last_client_message_type; +static UCHAR confirm_msg_cnt = 0; +NX_UDP_HEADER *udp_header_ptr; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; + + + /* Get the message type. */ + message_type = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 8); + switch (message_type) + { + + case NX_DHCPV6_MESSAGE_TYPE_SOLICIT: + case NX_DHCPV6_MESSAGE_TYPE_REQUEST: + case NX_DHCPV6_MESSAGE_TYPE_RELEASE: + { + if (ip_ptr != &client_ip) + { + return(NX_FALSE); + } + + /* Store the message type for server reply message to know. */ + last_client_message_type = message_type; + + /* Get the xid. */ + client_xid[0] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 9); + client_xid[1] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 10); + client_xid[2] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 11); + + break; + } + + case NX_DHCPV6_MESSAGE_TYPE_CONFIRM: + { + if (ip_ptr != &client_ip) + { + return(NX_FALSE); + } + + /* Store the message type for server reply message to know. */ + last_client_message_type = message_type; + + /* Get the xid. */ + client_xid[0] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 9); + client_xid[1] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 10); + client_xid[2] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 11); + + /* Increase the sent confirm msg number, and hack the second msg. */ + confirm_msg_cnt++; + if (confirm_msg_cnt == 2) + { + + // /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Modify the elapse time. */ + *(packet_ptr -> nx_packet_prepend_ptr + 8 + 26) = 0x01; + *(packet_ptr -> nx_packet_prepend_ptr + 8 + 27) = 0x02; + + /* Compute the checksum. */ + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + break; + } + + /* Check if it is Advertise message from DHCPv6 Server. */ + case NX_DHCPV6_MESSAGE_TYPE_ADVERTISE: + { + if (ip_ptr != &server_ip) + { + return(NX_FALSE); + } + + /* Get the xid. */ + server_xid[0] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 9); + server_xid[1] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 10); + server_xid[2] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 11); + + /* Compare the server xid with previous client xid. */ + if (memcmp(client_xid, server_xid, 3)) + { + return(NX_FALSE); + } + + /* Yes, add the count for advertise message. */ + advertise_message_count++; + break; + } + + case NX_DHCPV6_MESSAGE_TYPE_REPLY: + { + if (ip_ptr != &server_ip) + { + return(NX_FALSE); + } + + /* Get the xid. */ + server_xid[0] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 9); + server_xid[1] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 10); + server_xid[2] = *(packet_ptr -> nx_packet_prepend_ptr + 40 + 11); + + /* Compare the server xid with previous client xid. */ + if (memcmp(client_xid, server_xid, 3)) + { + return(NX_FALSE); + } + + if (last_client_message_type == NX_DHCPV6_MESSAGE_TYPE_CONFIRM) + { + if (confirm_msg_cnt >= 2) + { + if (dhcp_server.nx_dhcpv6_clients[0].nx_dhcpv6_elapsed_time.nx_session_time == 0) + { + return(NX_FALSE); + } + } + } + + /* Yes, add the count for next time to send reply message. */ + reply_message_count++; + break; + } + + default: + { + break; + } + } + + return(NX_TRUE); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_server_process_repeated_msg_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 Server Process Repeated Msg Test.........................................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/dhcp_test/netx_dhcpv6_user_option_add_test.c b/test/regression/dhcp_test/netx_dhcpv6_user_option_add_test.c new file mode 100644 index 00000000..b2d8ef91 --- /dev/null +++ b/test/regression/dhcp_test/netx_dhcpv6_user_option_add_test.c @@ -0,0 +1,710 @@ +/* This tests adding user class option. */ + +#include +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) +#include "nxd_dhcpv6_client.h" +#include "nxd_dhcpv6_server.h" + +#define DEMO_STACK_SIZE 2048 +#define NX_DHCPV6_THREAD_STACK_SIZE 2048 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 8) + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static TX_THREAD thread_client; +static TX_THREAD thread_server; +static NX_IP client_ip; +static NX_IP server_ip; + +/* Define the Client and Server instances. */ + +static NX_DHCPV6 dhcp_client; +static NX_DHCPV6_SERVER dhcp_server; + +/* Define the error counter used in the demo application... */ +static ULONG error_counter; +static CHAR *pointer; + +static NXD_ADDRESS server_address; +static NXD_ADDRESS dns_ipv6_address; +static NXD_ADDRESS start_ipv6_address; +static NXD_ADDRESS end_ipv6_address; + + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); +extern VOID _nx_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define some DHCPv6 parameters. */ + +#define DHCPV6_IANA_ID 0xC0DEDBAD +#define DHCPV6_T1 NX_DHCPV6_INFINITE_LEASE +#define DHCPV6_T2 NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_REFERRED_LIFETIME NX_DHCPV6_INFINITE_LEASE +#define NX_DHCPV6_VALID_LIFETIME NX_DHCPV6_INFINITE_LEASE + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_user_option_add_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the Client thread. */ + status = tx_thread_create(&thread_client, "Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create the Server thread. */ + status = tx_thread_create(&thread_server, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a Client IP instance. */ + status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0, 0, 0, 0), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create a Server IP instance. */ + status = nx_ip_create(&server_ip, "Server IP", IP_ADDRESS(1, 2, 3, 4), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic for sending DHCPv6 messages. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Check for IPv6 enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the ICMPv6 services. */ + status = nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable the fragment feature. */ + status = nx_ip_fragment_enable(&client_ip); + status += nx_ip_fragment_enable(&server_ip); + + /* Check for ICMP enable errors. */ + if (status) + { + error_counter++; + } +} + + +static CHAR user_class[] = "USERCLASS"; +static UINT user_class_len = sizeof(user_class) - 1; +static USHORT user_class_code = 15; + +UINT dhcpv6_user_option_add(NX_DHCPV6 *dhcpv6_ptr, UINT interface_index, UINT message_type, UCHAR *user_option_ptr, UINT *user_option_length) +{ + + NX_PARAMETER_NOT_USED(dhcpv6_ptr); + NX_PARAMETER_NOT_USED(interface_index); + NX_PARAMETER_NOT_USED(message_type); + + /* Application can check if add options into the packet by interface_index and message_type. + message_type are defined in header file, such as: NX_DHCPV6_MESSAGE_TYPE_SOLICIT. */ + + /* Add user class option refer to RFC8415. */ + /* The format of the User Class option is: + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | OPTION_USER_CLASS | option-len | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + . . + . user-class-data . + . . + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + The data area of the User Class option MUST contain one or more + instances of user-class-data information. Each instance of + user-class-data is formatted as follows: + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+ + | user-class-len | opaque-data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+ + + The user-class-len field is 2 octets long and specifies the length of + the opaque user-class-data in network byte order. + */ + + /* Check if have enough space for this option. */ + if (*user_option_length < (user_class_len + 6)) + return(NX_FALSE); + + /* Set the option code. */ + *user_option_ptr = (UCHAR)(user_class_code >> 8); + *(user_option_ptr + 1) = (UCHAR)user_class_code; + + /* Set the option length. */ + *(user_option_ptr + 2) = (UCHAR)((user_class_len + 2) >> 8); + *(user_option_ptr + 3) = (UCHAR)(user_class_len + 2); + + /* Set the user class length, which is the total length of the user class data filed. */ + *(user_option_ptr + 4) = (UCHAR)((user_class_len + 2) >> 8); + *(user_option_ptr + 5) = (UCHAR)(user_class_len + 2); + + /* Set the option value. */ + memcpy((user_option_ptr + 6), user_class, user_class_len); + + /* Update the option length. */ + *user_option_length = (user_class_len + 6); + return(NX_TRUE); +} + +VOID my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +UCHAR *user_class_ptr = NX_NULL; +UCHAR *dhcpv6_option_ptr = NX_NULL; +UINT index, status; +ULONG option_length = 0, option_code = 0; + + /* Update index to the options. */ + index = 8 + 4; + dhcpv6_option_ptr = packet_ptr -> nx_packet_prepend_ptr + index; + + /* Search the user class option. */ + while (index + 4 <= packet_ptr -> nx_packet_length) + { + + /* Get the option code and length of data of the current option block. */ + status = _nx_dhcpv6_utility_get_block_option_length(dhcpv6_option_ptr, &option_code, &option_length); + + /* Check that the block data is valid. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + /* Check if option data is in the packet. */ + if ((dhcpv6_option_ptr + 4 + option_length) > packet_ptr -> nx_packet_append_ptr) + { + error_counter++; + break; + } + + if (option_code == user_class_code) + { + user_class_ptr = dhcpv6_option_ptr; + break; + } + + /* Move to the next top level option. */ + dhcpv6_option_ptr += option_length + 4; + + /* Keep track of how far into the packet we have parsed. */ + index += option_length + 4; + } + + /* Check if have the user class option. */ + if (user_class_ptr == NX_NULL || option_length != (user_class_len + 2)) + { + error_counter++; + } + else + { + /* Skip the option header. */ + user_class_ptr += 4; + + /* Check the user class length. */ + status = _nx_dhcpv6_utility_get_data(user_class_ptr, 2, &option_length); + if (status || (option_length != (user_class_len + 2))) + error_counter++; + + /* Skip the user class length filed. */ + user_class_ptr += 2; + + /* Check the user class option. */ + if(memcmp(user_class_ptr, user_class, user_class_len)) + error_counter++; + } + + /* Call the actual function to receive the UDP packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} + +/* Define the Client host application thread. */ + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS dns_address; +ULONG prefix_length; +UINT interface_index; +ULONG T1, T2, preferred_lifetime, valid_lifetime; +UINT address_count; +UINT address_index; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: DHCPv6 User Option Add Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Establish the link local address for the host. The RAM driver creates + a virtual MAC address of 0x1122334456. */ + status = nxd_ipv6_address_set(&client_ip, 0, NX_NULL, 10, NULL); + + /* Let NetX Duo and the network driver get initialized. Also give the server time to get set up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &client_ip, "DHCPv6 Client", &pool_0, pointer, NX_DHCPV6_THREAD_STACK_SIZE, + NX_NULL, NX_NULL); + pointer = pointer + NX_DHCPV6_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. + + Note that if this host had already been assigned in IPv6 lease, it + would have to use the assigned T1 and T2 values in loading the DHCPv6 + client with an IANA block. + */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, DHCPV6_T1, DHCPV6_T2); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set callback function to add user options. */ + status = nx_dhcpv6_user_option_add_callback_set(&dhcp_client, dhcpv6_user_option_add); + if (status) + error_counter++; + + /* Starting up the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* If the host also want to get the option message, set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Now, the host send the solicit message to get the IPv6 address and other options from the DHCPv6 server. */ + status = nx_dhcpv6_request_solicit(&dhcp_client); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for get the IPv6 address and do the duplicate address detection. */ + tx_thread_sleep(6 * NX_IP_PERIODIC_RATE); + + /* Get the valid IPv6 address count which the DHCPv6 server assigned . */ + status = nx_dhcpv6_get_valid_ip_address_count(&dhcp_client, &address_count); + + /* Check for errors. */ + if ((status) || (address_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address, preferred lifetime and valid lifetime according to the address index. */ + address_index = 0; + status = nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_client, address_index, &ipv6_address, &preferred_lifetime, &valid_lifetime); + + /* Check for errors. */ + if ((status) || + (preferred_lifetime != NX_DHCPV6_DEFAULT_PREFERRED_TIME) || + (valid_lifetime != NX_DHCPV6_DEFAULT_VALID_TIME)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address. */ + if ((ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 address. */ + if ((prefix_length != 64) || (interface_index != 0) || + (ipv6_address.nxd_ip_version != start_ipv6_address.nxd_ip_version) || + (ipv6_address.nxd_ip_address.v6[0] != start_ipv6_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != start_ipv6_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != start_ipv6_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != start_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP address lease time. + Note, This API only applies to one IA. */ + status = nx_dhcpv6_get_lease_time_data(&dhcp_client, &T1, &T2, &preferred_lifetime, &valid_lifetime); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((T1 != NX_DHCPV6_DEFAULT_T1_TIME) || + (T2 != NX_DHCPV6_DEFAULT_T2_TIME) || + (preferred_lifetime != NX_DHCPV6_DEFAULT_PREFERRED_TIME) || + (valid_lifetime != NX_DHCPV6_DEFAULT_VALID_TIME)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the DNS Server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_address); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the IPv6 DNS address. */ + if ((dns_address.nxd_ip_version != dns_ipv6_address.nxd_ip_version) || + (dns_address.nxd_ip_address.v6[0] != dns_ipv6_address.nxd_ip_address.v6[0]) || + (dns_address.nxd_ip_address.v6[1] != dns_ipv6_address.nxd_ip_address.v6[1]) || + (dns_address.nxd_ip_address.v6[2] != dns_ipv6_address.nxd_ip_address.v6[2]) || + (dns_address.nxd_ip_address.v6[3] != dns_ipv6_address.nxd_ip_address.v6[3])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping the DHCPv6 Server. */ + status = nxd_icmp_ping(&client_ip, &server_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the address. */ + status = nx_dhcpv6_request_release(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for release the IPv6 address. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Get the IPv6 address by DHCPv6 API. */ + status = nx_dhcpv6_get_IP_address(&dhcp_client, &ipv6_address); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address by NetX Duo API. */ + status = nxd_ipv6_address_get(&client_ip, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Stop the Client task. */ + status = nx_dhcpv6_stop(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the DHCPv6 client. */ + status = nx_dhcpv6_client_delete(&dhcp_client); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the test server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +ULONG duid_time; +UINT addresses_added; + + /* Set the IPv6 address of DHCPv6 Server. */ + server_address.nxd_ip_version = NX_IP_VERSION_V6 ; + server_address.nxd_ip_address.v6[0] = 0x20010db8; + server_address.nxd_ip_address.v6[1] = 0xf101; + server_address.nxd_ip_address.v6[2] = 0x00000000; + server_address.nxd_ip_address.v6[3] = 0x00000101; + + /* Set the link local and global addresses. */ + status = nxd_ipv6_address_set(&server_ip, 0, NX_NULL, 10, NULL); + status += nxd_ipv6_address_set(&server_ip, 0, &server_address, 64, NULL); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Validate the link local and global addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create the DHCPv6 Server. */ + status = nx_dhcpv6_server_create(&dhcp_server, &server_ip, "DHCPv6 Server", &pool_0, pointer, NX_DHCPV6_SERVER_THREAD_STACK_SIZE, NX_NULL, NX_NULL); + pointer += NX_DHCPV6_SERVER_THREAD_STACK_SIZE; + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the DNS IPv6 server address. */ + dns_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + dns_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + dns_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + dns_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + dns_ipv6_address.nxd_ip_address.v6[3] = 0x00000107; + + status = nx_dhcpv6_create_dns_address(&dhcp_server, &dns_ipv6_address); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Note: For DUID types that do not require time, the 'duid_time' input can be left at zero. + The DUID_TYPE and HW_TYPE are configurable options that are user defined in nx_dhcpv6_server.h. */ + + /* Set the DUID time as the start of the millenium. */ + duid_time = SECONDS_SINCE_JAN_1_2000_MOD_32; + status = nx_dhcpv6_set_server_duid(&dhcp_server, + NX_DHCPV6_SERVER_DUID_TYPE, NX_DHCPV6_SERVER_HW_TYPE, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_msw, + dhcp_server.nx_dhcpv6_ip_ptr -> nx_ip_arp_physical_address_lsw, + duid_time); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 start address. */ + start_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + start_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + start_ipv6_address.nxd_ip_address.v6[1] = 0x00000f101; + start_ipv6_address.nxd_ip_address.v6[2] = 0x0; + start_ipv6_address.nxd_ip_address.v6[3] = 0x00000110; + + /* Set the IPv6 end address. */ + end_ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + end_ipv6_address.nxd_ip_address.v6[0] = 0x20010db8; + end_ipv6_address.nxd_ip_address.v6[1] = 0x0000f101; + end_ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + end_ipv6_address.nxd_ip_address.v6[3] = 0x00000120; + + /* Set the IPv6 address range. */ + status = nx_dhcpv6_create_ip_address_range(&dhcp_server, &start_ipv6_address, &end_ipv6_address, &addresses_added); + + /* Check for errors. */ + if ((status) || (addresses_added != 16)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Change the pointer function to check user options. */ + server_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; + + /* Start the NetX DHCPv6 server! */ + status = nx_dhcpv6_server_start(&dhcp_server); + + /* Check for errors. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dhcpv6_user_option_add_test_application_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: DHCPv6 User Option Add Test...............................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/dns_test/netx_dns_abnormal_packet_test.c b/test/regression/dns_test/netx_dns_abnormal_packet_test.c new file mode 100644 index 00000000..26c0dce0 --- /dev/null +++ b/test/regression/dns_test/netx_dns_abnormal_packet_test.c @@ -0,0 +1,533 @@ +/* This NetX test reading overflow when processing abnormal packet. */ + +/* Invalid name string */ +static unsigned char invalid_response_0[] = { +0x1C, 0x1A, 0xDF, 0xB0, 0x2F, 0x0A, 0x74, 0xB6, +0xB6, 0x40, 0x93, 0x2D, 0x08, 0x00, 0x45, 0x00, +0x00, 0x69, 0x72, 0x5D, 0x00, 0x00, 0x40, 0x11, +0x80, 0xA6, 0xC0, 0xA8, 0x01, 0xFE, 0xC0, 0xA8, +0x04, 0x32, 0x00, 0x35, 0xC8, 0xE1, 0x00, 0x55, +0x4C, 0x59, 0x88, 0xCC, 0x81, 0x80, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, +0x6C, 0x69, 0x65, 0x6E, 0x74, 0x73, 0x34, 0x06, +0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x03, 0x63, +0x6F, 0x6D, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0, +0x0C, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, +0xC3, 0x00, 0x0C, 0x37, 0x63, 0x6C, 0x69, 0x65, +0x6E, 0x74, 0x73, 0x01, 0x6C, 0xC0, 0x15, 0xC0, +0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, +0x2C, 0x00, 0x04, 0xAC, 0xD9, 0x03, 0xCE +}; + +/* Invalid name string */ +static unsigned char invalid_response_1[] = { +0x1C, 0x1A, 0xDF, 0xB0, 0x2F, 0x0A, 0x74, 0xB6, +0xB6, 0x40, 0x93, 0x2D, 0x08, 0x00, 0x45, 0x00, +0x00, 0x69, 0x72, 0x5D, 0x00, 0x00, 0x40, 0x11, +0x80, 0xA6, 0xC0, 0xA8, 0x01, 0xFE, 0xC0, 0xA8, +0x04, 0x32, 0x00, 0x35, 0xC8, 0xE1, 0x00, 0x55, +0x4C, 0x59, 0x88, 0xCC, 0x81, 0x80, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, +0x6C, 0x69, 0x65, 0x6E, 0x74, 0x73, 0x34, 0x06, +0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x03, 0x63, +0x6F, 0x6D, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0, +0x0C, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, +0xC3, 0x00, 0x0C, 0x37, 0x63, 0x6C, 0x69, 0x65, +0x6E, 0x74, 0x73, 0x01, 0x6C, 0xC0, 0x15, 0xC0, +0x4C, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, +0x2C, 0x00, 0x04, 0xAC, 0xD9, 0x03, 0xC0 +}; + +/* Invalid name string */ +static unsigned char invalid_response_2[] = { +0x1C, 0x1A, 0xDF, 0xB0, 0x2F, 0x0A, 0x74, 0xB6, +0xB6, 0x40, 0x93, 0x2D, 0x08, 0x00, 0x45, 0x00, +0x00, 0x69, 0x72, 0x5D, 0x00, 0x00, 0x40, 0x11, +0x80, 0xA6, 0xC0, 0xA8, 0x01, 0xFE, 0xC0, 0xA8, +0x04, 0x32, 0x00, 0x35, 0xC8, 0xE1, 0x00, 0x55, +0x4C, 0x59, 0x88, 0xCC, 0x81, 0x80, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, +0x6C, 0x69, 0x65, 0x6E, 0x74, 0x73, 0x34, 0x06, +0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x03, 0x63, +0x6F, 0x6D, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0, +0x0C, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, +0xC3, 0x00, 0x0C, 0x37, 0x63, 0x6C, 0x69, 0x65, +0x6E, 0x74, 0x73, 0x01, 0x6C, 0xC0, 0x15, 0xC0, +0x4B, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, +0x2C, 0x00, 0x04, 0xAC, 0xD9, 0x01, 0x01 +}; + +/* Invalid IP address */ +static unsigned char invalid_response_3[] = +{ +0x1C, 0x1A, 0xDF, 0xB0, 0x2F, 0x0A, 0x74, 0xB6, +0xB6, 0x40, 0x93, 0x2D, 0x08, 0x00, 0x45, 0x00, +0x00, 0x69, 0x72, 0x5D, 0x00, 0x00, 0x40, 0x11, +0x80, 0xA6, 0xC0, 0xA8, 0x01, 0xFE, 0xC0, 0xA8, +0x04, 0x32, 0x00, 0x35, 0xC8, 0xE1, 0x00, 0x55, +0x4C, 0x59, 0x88, 0xCC, 0x81, 0x80, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, +0x6C, 0x69, 0x65, 0x6E, 0x74, 0x73, 0x34, 0x06, +0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x03, 0x63, +0x6F, 0x6D, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0, +0x0C, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, +0xC3, 0x00, 0x0C, 0x07, 0x63, 0x6C, 0x69, 0x65, +0x6E, 0x74, 0x73, 0x01, 0x6C, 0xC0, 0x15, 0xC0, +0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, +0x2C, 0x00, 0x04, 0xAC, 0xD9, 0x03 +}; + +/* Valid response */ +static unsigned char valid_response[] = +{ +0x1C, 0x1A, 0xDF, 0xB0, 0x2F, 0x0A, 0x74, 0xB6, +0xB6, 0x40, 0x93, 0x2D, 0x08, 0x00, 0x45, 0x00, +0x00, 0x69, 0x72, 0x5D, 0x00, 0x00, 0x40, 0x11, +0x80, 0xA6, 0xC0, 0xA8, 0x01, 0xFE, 0xC0, 0xA8, +0x04, 0x32, 0x00, 0x35, 0xC8, 0xE1, 0x00, 0x55, +0x4C, 0x59, 0x88, 0xCC, 0x81, 0x80, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, +0x6C, 0x69, 0x65, 0x6E, 0x74, 0x73, 0x34, 0x06, +0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x03, 0x63, +0x6F, 0x6D, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0, +0x0C, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, +0xC3, 0x00, 0x0C, 0x07, 0x63, 0x6C, 0x69, 0x65, +0x6E, 0x74, 0x73, 0x01, 0x6C, 0xC0, 0x15, 0xC0, +0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, +0x2C, 0x00, 0x04, 0xAC, 0xD9, 0x03, 0xCE +}; + +static unsigned char invalid_response_txt[] = +{ +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x00, 0x96, 0xc1, 0xa0, 0x00, 0x00, 0x40, 0x11, +0x36, 0xfc, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xc1, 0x8b, 0x00, 0x82, +0xec, 0x71, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, +0x6d, 0x00, 0x00, 0x10, 0x00, 0x01, 0xc0, 0x0c, +0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x0e, 0x10, +0x00, 0x52, 0x52, 0x76, 0x3d, 0x73, 0x70, 0x66, +0x31, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, +0x65, 0x3a, 0x5f, 0x6e, 0x65, 0x74, 0x62, 0x6c, +0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x6f, +0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x20, +0x69, 0x70, 0x34, 0x3a, 0x32, 0x31, 0x36, 0x2e, +0x37, 0x33, 0x2e, 0x39, 0x33, 0x2e, 0x37, 0x30, +0x2f, 0x33, 0x31, 0x20, 0x69, 0x70, 0x34, 0x3a, +0x32, 0x31, 0x36, 0x2e, 0x37, 0x33, 0x2e, 0x39, +0x33, 0x2e, 0x37, 0x32, 0x2f, 0x33, 0x31, 0x20, +0x7e, 0x61, 0x6c, 0x6c +}; + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + +static NX_UDP_SOCKET server_socket; +static NX_DNS client_dns; + + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +static UCHAR pool_buffer[8192] = {0}; +static UCHAR record_buffer[500]; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pool_buffer, 8192); + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(192, 168, 100, 98), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(192, 168, 100, 2), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +ULONG host_ip_address; +UINT i; +UINT test_num; + + /* Print out some test information banners. */ + printf("NetX Test: DNS Abnormal Packet Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, IP_ADDRESS(192, 168, 100, 2)); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + client_dns.nx_dns_retries = 1; + +#ifdef NX_DNS_CACHE_ENABLE + test_num = 4; +#else + test_num = 1; +#endif + + for (i = 0; i < test_num; i++) + { + status = nx_dns_host_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &host_ip_address, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status == NX_SUCCESS) + { + error_counter++; + } + } + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + status = nx_dns_host_text_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], sizeof(record_buffer), NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status == NX_SUCCESS) + { + error_counter++; + } +#endif + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; +NX_PACKET *response_packet; +UCHAR *invalid_responses[] = +{ +#ifdef NX_DNS_CACHE_ENABLE + invalid_response_0, + invalid_response_1, + invalid_response_2, +#endif + invalid_response_3, +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + invalid_response_txt, +#endif +}; +UINT invalid_responses_len[] = +{ +#ifdef NX_DNS_CACHE_ENABLE + sizeof(invalid_response_0), + sizeof(invalid_response_1), + sizeof(invalid_response_2), +#endif + sizeof(invalid_response_3), +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + sizeof(invalid_response_txt), +#endif +}; +UCHAR *response_ptr; +UINT response_len; +UINT i; +UINT test_num = sizeof(invalid_responses_len) / sizeof(UINT); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + + /* Act as the DNS server to receive the DNS query and send the DNS response. */ + + for (i = 0; i < test_num; i ++) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS transmit ID. */ + if (i == 1) + { + client_dns.nx_dns_transmit_id = 0xc00c; + nx_dns_transmit_id = client_dns.nx_dns_transmit_id; + } + else + { + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + } + + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + response_ptr = invalid_responses[i]; + response_len = invalid_responses_len[i]; + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_ptr + DNS_START_OFFSET, response_len - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = response_len - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet, IP_ADDRESS(192, 168, 100, 98), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + return; + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_abnormal_packet_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Abnormal Packet Test..................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/netx_dns_coverage_test.c b/test/regression/dns_test/netx_dns_coverage_test.c new file mode 100644 index 00000000..a8d10499 --- /dev/null +++ b/test/regression/dns_test/netx_dns_coverage_test.c @@ -0,0 +1,146 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#include "tx_mutex.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) +#define validate_expected_status(status,expected_status) if (expected_status != status) {printf("%s,%d: ERROR!",__FILE__, __LINE__);test_control_return(1);} + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD client_thread; +static NX_IP client_ip; +static NX_DNS client_dns; +static NX_PACKET_POOL pool_0; +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif +static TX_MUTEX *mutex_ptr; + +#define DNS_SERVER_ADDRESS IP_ADDRESS(10,0,0,1) + +static CHAR *pointer; +static UINT status; +static ULONG error_counter = 0; + +/* Define thread prototypes. */ + +static void client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_coverage_test_application_define(void *first_unused_memory) +#endif +{ + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&client_thread, "client thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + + /* Create an IP instance. */ + nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(10, 0, 0, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP traffic. */ + nx_udp_enable(&client_ip); +} + + + +/* Define the test thread. */ +static void client_thread_entry(ULONG thread_input) +{ + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + /* creates a packet pool that has payloads that are too small. */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", 1, pointer, NX_DNS_PACKET_POOL_SIZE - 1); + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + if (status) + { + error_counter++; + } + + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + if (status != NX_DNS_PARAM_ERROR) + { + error_counter++; + } +#endif + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Force mutex create to fail. */ + mutex_ptr = _tx_mutex_created_ptr; + _tx_mutex_created_ptr = &client_dns.nx_dns_mutex; + _tx_mutex_created_count++; + + /* Attempt to create the DNS instance. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + if (status != TX_MUTEX_ERROR) + { + error_counter++; + } + + /* Restore mutex. */ + _tx_mutex_created_ptr = mutex_ptr; + _tx_mutex_created_count--; +#endif + + /* Check the error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_coverage_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Coverage Test.........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dns_test/netx_dns_fake_response_test.c b/test/regression/dns_test/netx_dns_fake_response_test.c new file mode 100644 index 00000000..c421daf8 --- /dev/null +++ b/test/regression/dns_test/netx_dns_fake_response_test.c @@ -0,0 +1,386 @@ +/* This NetX test concentrates on the basic DNS operation. Fake response test. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#ifndef NX_DISABLE_IPV4 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + +static NX_UDP_SOCKET server_socket; +static NX_DNS client_dns; + + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static UINT dns_query_port_1 = 0; +static UINT dns_query_port_2 = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_fake_response_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(192, 168, 100, 98), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(192, 168, 100, 2), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UCHAR record_buffer[64]; +UINT record_count; +ULONG *ipv4_address_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: DNS Fake Response Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, IP_ADDRESS(192, 168, 100, 2)); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send query. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, NX_IP_PERIODIC_RATE); + ipv4_address_ptr = (ULONG *)record_buffer; + + /* Check status. */ + if ((status) || + (*ipv4_address_ptr != IP_ADDRESS(74,125,224,194))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send query again. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +extern char response_a_google_com_pkt[]; +extern int response_a_google_com_pkt_size; +extern char response_a_berkley_edu_pkt[]; +extern int response_a_berkley_edu_pkt_size; + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; +NX_PACKET *response_packet; +UCHAR *response_data; +UINT response_data_size; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + for (UINT i = 0; i < 2; i++) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + if (i == 0) + { + dns_query_port_1 = port; + } + else + { + dns_query_port_2 = port; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + if (i == 0) + { + response_data = response_a_google_com_pkt; + response_data_size = response_a_google_com_pkt_size; + } + else + { + response_data = response_a_berkley_edu_pkt; + response_data_size = response_a_berkley_edu_pkt_size; + } + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_data + DNS_START_OFFSET, response_data_size - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = response_data_size - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet, IP_ADDRESS(192, 168, 100, 98), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + return; + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_fake_response_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Fake Response Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/netx_dns_function_test.c b/test/regression/dns_test/netx_dns_function_test.c new file mode 100644 index 00000000..65fb4190 --- /dev/null +++ b/test/regression/dns_test/netx_dns_function_test.c @@ -0,0 +1,1612 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_UDP_SOCKET server_socket; + +static NX_DNS client_dns; + +#define DNS_SERVER_ADDRESS IP_ADDRESS(10,0,0,1) + +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS address_ipv4_0; +static NXD_ADDRESS address_ipv4_1; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_ipv6_0; +static NXD_ADDRESS address_ipv6_1; +#endif +#endif + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG notify_calls = 0; + +static UCHAR record_buffer[500]; +static UINT record_count; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); + +/* DNS Tests. */ +static void dns_test_initialize(); +static void dns_a_type_test(); + +#ifdef __PRODUCT_NETXDUO__ +static void dns_aaaa_type_test(); +#endif /* __PRODUCT_NETXDUO__ */ + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES +static void dns_a_cname_type_test(); +static void dns_mx_type_test(); +static void dns_mx_a_type_test(); +static void dns_cname_type_test(); +static void dns_ns_a_type_test(); +static void dns_srv_type_test(); +static void dns_txt_type_test(); +static void dns_soa_type_test(); +#endif + +/* DNS retransmit test. */ +static void dns_retransmit_test(); + +/* Send DNS response. */ +static UINT nx_dns_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, USHORT nx_dns_transmit_id, UINT packet_number); + +extern char response_a_google_com_pkt[246]; +extern int response_a_google_com_pkt_size; + +extern char response_a_berkley_edu_pkt[88]; +extern int response_a_berkley_edu_pkt_size; + +extern char response_aaaa_berkley_edu_pkt[100]; +extern int response_aaaa_berkley_edu_pkt_size; + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + +extern char response_a_cname_www_npr_org_pkt[119]; +extern int response_a_cname_www_npr_org_pkt_size; + +extern char response_mx_google_com_pkt[178]; +extern int response_mx_google_com_pkt_size; + +extern char response_mx_a_google_com_pkt[258]; +extern int response_mx_a_google_com_pkt_size; + +extern char response_mx_a_berkley_edu_pkt[107]; +extern int response_mx_a_berkley_edu_pkt_size; + +extern char response_cname_www_baidu_com_pkt[100]; +extern int response_cname_www_baidu_com_pkt_size; + +extern char response_ns_a_ti_com_pkt[349]; +extern int response_ns_a_ti_com_pkt_size; + +extern char response_srv_google_com_pkt[373]; +extern int response_srv_google_com_pkt_size; + +extern char response_txt_google_com_pkt[373]; +extern int response_txt_google_com_pkt_size; + +extern char response_soa_google_com_pkt[120]; +extern int response_soa_google_com_pkt_size; + +#endif + +typedef struct DNS_TEST_STRUCT +{ + char *dns_test_pkt_data; + int dns_test_pkt_size; +} DNS_TEST; + +#define test_count 19 +static DNS_TEST dns_test[test_count]; + +extern ULONG test_control_successful_tests; +extern ULONG test_control_failed_tests; + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_function_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(10, 0, 0, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(10, 0, 0, 1), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if (status) + { + error_counter++; + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add a then remove ipv4 DNS servers, check for max entries as well */ + for (int i = 0; i < (NX_DNS_MAX_SERVERS); i++) + { + status = nx_dns_server_add(&client_dns, IP_ADDRESS(10,1,1,i)); + if (status) + { + error_counter++; + } + } + + status = nx_dns_server_add(&client_dns, IP_ADDRESS(10,1,1,NX_DNS_MAX_SERVERS)); + if (status != NX_NO_MORE_ENTRIES) + { + error_counter++; + } + + /* check size when we are at max entries. */ + UINT size = 0; + status = nx_dns_get_serverlist_size(&client_dns, &size); + if (status != NX_SUCCESS || size != 5) + { + error_counter++; + } + + for (int i = 0; i < (NX_DNS_MAX_SERVERS); i++) + { + status = nx_dns_server_remove(&client_dns, IP_ADDRESS(10,1,1,i)); + if (status) + { + error_counter++; + } + } + +#ifdef __PRODUCT_NETXDUO__ + /* Add one IPv4 server address. */ + address_ipv4_0.nxd_ip_address.v4 = IP_ADDRESS(1,1,1,1); + address_ipv4_0.nxd_ip_version = NX_IP_VERSION_V4; + status = nxd_dns_server_add(&client_dns,&address_ipv4_0); + if (status) + { + error_counter++; + } + + /* Add an other IPv4 server address to the Client list. */ + address_ipv4_1.nxd_ip_address.v4 = IP_ADDRESS(10,1,1,1); + address_ipv4_1.nxd_ip_version = NX_IP_VERSION_V4; + status = nxd_dns_server_add(&client_dns, &address_ipv4_1); + if (status) + { + error_counter++; + } + +#ifdef FEATURE_NX_IPV6 + /* Add one IPv6 server address. */ + address_ipv6_0.nxd_ip_address.v6[0] = 13; + address_ipv6_0.nxd_ip_address.v6[1] = 13; + address_ipv6_0.nxd_ip_address.v6[2] = 13; + address_ipv6_0.nxd_ip_address.v6[3] = 13; + address_ipv6_0.nxd_ip_version = NX_IP_VERSION_V6; + status = nxd_dns_server_add(&client_dns, &address_ipv6_0); + if (status) + { + error_counter++; + } + + /* Add an other IPv6 server address to the Client list. */ + address_ipv6_1.nxd_ip_address.v6[0] = 14; + address_ipv6_1.nxd_ip_address.v6[1] = 14; + address_ipv6_1.nxd_ip_address.v6[2] = 14; + address_ipv6_1.nxd_ip_address.v6[3] = 14; + address_ipv6_1.nxd_ip_version = NX_IP_VERSION_V6; + status = nxd_dns_server_add(&client_dns, &address_ipv6_1); + if (status) + { + error_counter++; + } +#endif + + /* Check duplicate server logic */ + status = nxd_dns_server_add(&client_dns, &address_ipv4_1); + if (status != NX_DNS_DUPLICATE_ENTRY) + { + error_counter++; + } + +#ifdef FEATURE_NX_IPV6 + status = nxd_dns_server_add(&client_dns, &address_ipv6_1); + if (status != NX_DNS_DUPLICATE_ENTRY) + { + error_counter++; + } +#endif + + /* check for size less than max entries. */ + status = nx_dns_get_serverlist_size(&client_dns, &size); +#ifdef FEATURE_NX_IPV6 + if (status != NX_SUCCESS || size != 4) +#else + if (status != NX_SUCCESS || size != 2) +#endif + { + error_counter++; + } + + ULONG get_ipv4_address; +#ifdef FEATURE_NX_IPV6 + /* use nx api for IPv6 address. */ + status = nx_dns_server_get(&client_dns, 2, &get_ipv4_address); + if (status != NX_DNS_INVALID_ADDRESS_TYPE) + { + error_counter++; + } +#endif + + /* try getting address outside of bounds. */ + status = nx_dns_server_get(&client_dns, NX_DNS_MAX_SERVERS, &get_ipv4_address); + if (status != NX_DNS_PARAM_ERROR) { + error_counter++; + } + + /* try getting from index that is not set. */ + status = nx_dns_server_get(&client_dns, 4, &get_ipv4_address); + if (status != NX_DNS_SERVER_NOT_FOUND) + { + error_counter++; + } + + /* these should work. */ + status = nx_dns_server_get(&client_dns, 0, &get_ipv4_address); + if (status != NX_SUCCESS || get_ipv4_address != IP_ADDRESS(1,1,1,1)) + { + error_counter++; + } + + status = nx_dns_server_get(&client_dns, 1, &get_ipv4_address); + if (status != NX_SUCCESS || get_ipv4_address != IP_ADDRESS(10,1,1,1)) + { + error_counter++; + } + +#ifdef FEATURE_NX_IPV6 + NXD_ADDRESS get_ipv6_address; + status = nxd_dns_server_get(&client_dns, 2, &get_ipv6_address); + if (status != NX_SUCCESS || !CHECK_IPV6_ADDRESSES_SAME(&get_ipv6_address.nxd_ip_address.v6[0], &address_ipv6_0.nxd_ip_address.v6[0])) + { + error_counter++; + } + + /* Check for an address that does not exist. */ + address_ipv6_0.nxd_ip_address.v6[0] = 1; + address_ipv6_0.nxd_ip_address.v6[1] = 2; + address_ipv6_0.nxd_ip_address.v6[2] = 3; + address_ipv6_0.nxd_ip_address.v6[3] = 4; + status = nxd_dns_server_remove(&client_dns, &address_ipv6_0); + if (status != NX_DNS_SERVER_NOT_FOUND) + { + error_counter++; + } + + /* Remove an ipv6 that does exist. */ + status = nxd_dns_server_remove(&client_dns, &address_ipv6_1); + if (status != NX_SUCCESS) + { + error_counter++; + } +#endif + status = nx_dns_server_remove_all(&client_dns); + if (status != NX_SUCCESS) + { + error_counter++; + } +#endif + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, DNS_SERVER_ADDRESS); + if (status) + { + error_counter++; + } + + status = nx_dns_get_serverlist_size(&client_dns, &size); + if (status != NX_SUCCESS || size != 1) + { + error_counter++; + } + + /* The DNS test initialize. */ + dns_test_initialize(); + + /* Test the DNS A type function. */ + dns_a_type_test(); + + /* DNS retransmit test. */ + dns_retransmit_test(); + +#ifdef __PRODUCT_NETXDUO__ + /* Test the DNS AAAA type function. */ + dns_aaaa_type_test(); +#endif + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + + /* Test the DNS A + CNAME type function. */ + dns_a_cname_type_test(); + + /* Test the DNS MX type function. */ + dns_mx_type_test(); + + /* Test the DNS MX type with addtional A type function. */ + dns_mx_a_type_test(); + + /* Test the DNS CNAME type function. */ + dns_cname_type_test(); + + /* Test the DNS NS type with addtional A type function. */ + dns_ns_a_type_test(); + + /* Test the DNS SRV type. */ + dns_srv_type_test(); + + /* Test the DNS SRV type. */ + dns_txt_type_test(); + + /* Test the DNS SOA type. */ + dns_soa_type_test(); + +#endif + + status = nx_dns_delete(&client_dns); + + if (status) + { + error_counter++; + } + + test_control_return(0xdeadbeef); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +UINT i; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Act as the DNS server to receive the DNS query and send the DNS response. */ + for (i = 0; i < test_count; i++ ) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* If the Test the DNS client retransmission.*/ + if((i == 4) || (i == 5)) + { + nx_packet_release(my_packet); + continue; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + status = nx_dns_response_packet_send(&server_socket, port, nx_dns_transmit_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_dns_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, USHORT nx_dns_transmit_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; +UCHAR *data_ptr; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the DNS response messages into the packet payload! */ + dns_test[packet_number].dns_test_pkt_data += DNS_START_OFFSET; + memcpy(response_packet -> nx_packet_prepend_ptr, dns_test[packet_number].dns_test_pkt_data, dns_test[packet_number].dns_test_pkt_size - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dns_test[packet_number].dns_test_pkt_size - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(server_socket, response_packet, IP_ADDRESS(10, 0, 0, 10), port); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +static void dns_test_initialize() +{ + + /* DNS A type test. */ + dns_test[0].dns_test_pkt_data = &response_a_google_com_pkt[0]; + dns_test[0].dns_test_pkt_size = response_a_google_com_pkt_size; + dns_test[1].dns_test_pkt_data = &response_a_google_com_pkt[0]; + dns_test[1].dns_test_pkt_size = response_a_google_com_pkt_size; + dns_test[2].dns_test_pkt_data = &response_a_berkley_edu_pkt[0]; + dns_test[2].dns_test_pkt_size = response_a_berkley_edu_pkt_size; + dns_test[3].dns_test_pkt_data = &response_a_berkley_edu_pkt[0]; + dns_test[3].dns_test_pkt_size = response_a_berkley_edu_pkt_size; + + /* DNS retransmit test. */ + dns_test[4].dns_test_pkt_data = &response_a_berkley_edu_pkt[0]; + dns_test[4].dns_test_pkt_size = response_a_berkley_edu_pkt_size; + dns_test[5].dns_test_pkt_data = &response_a_berkley_edu_pkt[0]; + dns_test[5].dns_test_pkt_size = response_a_berkley_edu_pkt_size; + dns_test[6].dns_test_pkt_data = &response_a_berkley_edu_pkt[0]; + dns_test[6].dns_test_pkt_size = response_a_berkley_edu_pkt_size; + +#ifdef __PRODUCT_NETXDUO__ + +#ifdef FEATURE_NX_IPV6 + /* DNS A type test. */ + dns_test[7].dns_test_pkt_data = &response_aaaa_berkley_edu_pkt[0]; + dns_test[7].dns_test_pkt_size = response_aaaa_berkley_edu_pkt_size; + dns_test[8].dns_test_pkt_data = &response_aaaa_berkley_edu_pkt[0]; + dns_test[8].dns_test_pkt_size = response_aaaa_berkley_edu_pkt_size; + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + + /* DNS extended type test. */ + dns_test[9].dns_test_pkt_data = &response_a_cname_www_npr_org_pkt[0]; + dns_test[9].dns_test_pkt_size = response_a_cname_www_npr_org_pkt_size; + dns_test[10].dns_test_pkt_data = &response_a_cname_www_npr_org_pkt[0]; + dns_test[10].dns_test_pkt_size = response_a_cname_www_npr_org_pkt_size; + dns_test[11].dns_test_pkt_data = &response_mx_google_com_pkt[0]; + dns_test[11].dns_test_pkt_size = response_mx_google_com_pkt_size; + dns_test[12].dns_test_pkt_data = &response_mx_a_google_com_pkt[0]; + dns_test[12].dns_test_pkt_size = response_mx_a_google_com_pkt_size; + dns_test[13].dns_test_pkt_data = &response_mx_a_berkley_edu_pkt[0]; + dns_test[13].dns_test_pkt_size = response_mx_a_berkley_edu_pkt_size; + dns_test[14].dns_test_pkt_data = &response_cname_www_baidu_com_pkt[0]; + dns_test[14].dns_test_pkt_size = response_cname_www_baidu_com_pkt_size; + dns_test[15].dns_test_pkt_data = &response_ns_a_ti_com_pkt[0]; + dns_test[15].dns_test_pkt_size = response_ns_a_ti_com_pkt_size; + dns_test[16].dns_test_pkt_data = &response_srv_google_com_pkt[0]; + dns_test[16].dns_test_pkt_size = response_srv_google_com_pkt_size; + dns_test[17].dns_test_pkt_data = &response_txt_google_com_pkt[0]; + dns_test[17].dns_test_pkt_size = response_txt_google_com_pkt_size; + dns_test[18].dns_test_pkt_data = &response_soa_google_com_pkt[0]; + dns_test[18].dns_test_pkt_size = response_soa_google_com_pkt_size; +#endif /* NX_DNS_ENABLE_EXTENDED_RR_TYPES */ + +#else /* FEATURE_NX_IPV6 */ + + /* DNS A type test. */ + dns_test[7].dns_test_pkt_data = &response_aaaa_berkley_edu_pkt[0]; + dns_test[7].dns_test_pkt_size = response_aaaa_berkley_edu_pkt_size; + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + + /* DNS extended type test. */ + dns_test[8].dns_test_pkt_data = &response_a_cname_www_npr_org_pkt[0]; + dns_test[8].dns_test_pkt_size = response_a_cname_www_npr_org_pkt_size; + dns_test[9].dns_test_pkt_data = &response_a_cname_www_npr_org_pkt[0]; + dns_test[9].dns_test_pkt_size = response_a_cname_www_npr_org_pkt_size; + dns_test[10].dns_test_pkt_data = &response_mx_google_com_pkt[0]; + dns_test[10].dns_test_pkt_size = response_mx_google_com_pkt_size; + dns_test[11].dns_test_pkt_data = &response_mx_a_google_com_pkt[0]; + dns_test[11].dns_test_pkt_size = response_mx_a_google_com_pkt_size; + dns_test[12].dns_test_pkt_data = &response_mx_a_berkley_edu_pkt[0]; + dns_test[12].dns_test_pkt_size = response_mx_a_berkley_edu_pkt_size; + dns_test[13].dns_test_pkt_data = &response_cname_www_baidu_com_pkt[0]; + dns_test[13].dns_test_pkt_size = response_cname_www_baidu_com_pkt_size; + dns_test[14].dns_test_pkt_data = &response_ns_a_ti_com_pkt[0]; + dns_test[14].dns_test_pkt_size = response_ns_a_ti_com_pkt_size; + dns_test[15].dns_test_pkt_data = &response_srv_google_com_pkt[0]; + dns_test[15].dns_test_pkt_size = response_srv_google_com_pkt_size; + dns_test[16].dns_test_pkt_data = &response_txt_google_com_pkt[0]; + dns_test[16].dns_test_pkt_size = response_txt_google_com_pkt_size; + dns_test[17].dns_test_pkt_data = &response_soa_google_com_pkt[0]; + dns_test[17].dns_test_pkt_size = response_soa_google_com_pkt_size; +#endif /* NX_DNS_ENABLE_EXTENDED_RR_TYPES */ +#endif /* FEATURE_NX_IPV6 */ + +#else /* __PRODUCT_NETXDUO__ */ + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + + /* DNS extended type test. */ + dns_test[7].dns_test_pkt_data = &response_a_cname_www_npr_org_pkt[0]; + dns_test[7].dns_test_pkt_size = response_a_cname_www_npr_org_pkt_size; + dns_test[8].dns_test_pkt_data = &response_a_cname_www_npr_org_pkt[0]; + dns_test[8].dns_test_pkt_size = response_a_cname_www_npr_org_pkt_size; + dns_test[9].dns_test_pkt_data = &response_mx_google_com_pkt[0]; + dns_test[9].dns_test_pkt_size = response_mx_google_com_pkt_size; + dns_test[10].dns_test_pkt_data = &response_mx_a_google_com_pkt[0]; + dns_test[10].dns_test_pkt_size = response_mx_a_google_com_pkt_size; + dns_test[11].dns_test_pkt_data = &response_mx_a_berkley_edu_pkt[0]; + dns_test[11].dns_test_pkt_size = response_mx_a_berkley_edu_pkt_size; + dns_test[12].dns_test_pkt_data = &response_cname_www_baidu_com_pkt[0]; + dns_test[12].dns_test_pkt_size = response_cname_www_baidu_com_pkt_size; + dns_test[13].dns_test_pkt_data = &response_ns_a_ti_com_pkt[0]; + dns_test[13].dns_test_pkt_size = response_ns_a_ti_com_pkt_size; + dns_test[14].dns_test_pkt_data = &response_srv_google_com_pkt[0]; + dns_test[14].dns_test_pkt_size = response_srv_google_com_pkt_size; + dns_test[15].dns_test_pkt_data = &response_txt_google_com_pkt[0]; + dns_test[15].dns_test_pkt_size = response_txt_google_com_pkt_size; + dns_test[16].dns_test_pkt_data = &response_soa_google_com_pkt[0]; + dns_test[16].dns_test_pkt_size = response_soa_google_com_pkt_size; +#endif /* NX_DNS_ENABLE_EXTENDED_RR_TYPES */ + +#endif /* __PRODUCT_NETXDUO__ */ +} + +static void dns_a_type_test() +{ +ULONG host_ip_address; +ULONG *ipv4_address_ptr1; +ULONG *ipv4_address_ptr2; +ULONG *ipv4_address_ptr3; +ULONG *ipv4_address_ptr4; +ULONG *ipv4_address_ptr5; +ULONG *ipv4_address_ptr6; +ULONG *ipv4_address_ptr7; +ULONG *ipv4_address_ptr8; +ULONG *ipv4_address_ptr9; +ULONG *ipv4_address_ptr10; +ULONG *ipv4_address_ptr11; + + /* Test the A type with the old API,(google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A Type Google Com Old API Record Singer Addr Test....."); + + /* Secd dns query, and record the single host ip address. */ + status = nx_dns_host_by_name_get(&client_dns, (UCHAR *)"google.com", &host_ip_address, 4 * NX_IP_PERIODIC_RATE); + + /* Check status and compare the host ip address. */ + if (status || host_ip_address != IP_ADDRESS(74,125,224,194)) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + + /* Test the A type with the new API,(google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A Type Google Com New API Record Multi Addr Test......"); + + /* Test the A type NetX(new API) to process the multiple address. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + ipv4_address_ptr1 = (ULONG *)record_buffer; + ipv4_address_ptr2 = (ULONG *)(record_buffer + 4); + ipv4_address_ptr3 = (ULONG *)(record_buffer + 8); + ipv4_address_ptr4 = (ULONG *)(record_buffer + 12); + ipv4_address_ptr5 = (ULONG *)(record_buffer + 16); + ipv4_address_ptr6 = (ULONG *)(record_buffer + 20); + ipv4_address_ptr7 = (ULONG *)(record_buffer + 24); + ipv4_address_ptr8 = (ULONG *)(record_buffer + 28); + ipv4_address_ptr9 = (ULONG *)(record_buffer + 32); + ipv4_address_ptr10 = (ULONG *)(record_buffer + 36); + ipv4_address_ptr11 = (ULONG *)(record_buffer + 40); + + /* Check status and compare the host ip address. */ + if (status || (record_count != 11) || + (*ipv4_address_ptr1 != IP_ADDRESS(74,125,224,194)) || + (*ipv4_address_ptr2 != IP_ADDRESS(74,125,224,195)) || + (*ipv4_address_ptr3 != IP_ADDRESS(74,125,224,196)) || + (*ipv4_address_ptr4 != IP_ADDRESS(74,125,224,197)) || + (*ipv4_address_ptr5 != IP_ADDRESS(74,125,224,198)) || + (*ipv4_address_ptr6 != IP_ADDRESS(74,125,224,199)) || + (*ipv4_address_ptr7 != IP_ADDRESS(74,125,224,200)) || + (*ipv4_address_ptr8 != IP_ADDRESS(74,125,224,201)) || + (*ipv4_address_ptr9 != IP_ADDRESS(74,125,224,206)) || + (*ipv4_address_ptr10 != IP_ADDRESS(74,125,224,192))|| + (*ipv4_address_ptr11 != IP_ADDRESS(74,125,224,193))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + + /* Test the A type with the old API,(berkeley.edu.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A Type Berkley Edu Old API Record Singer Addr Test...."); + + /* Secd dns query, and record the single host ip address. */ + status = nx_dns_host_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &host_ip_address, 4 * NX_IP_PERIODIC_RATE); + + /* Check status and compare the host ip address. */ + if (status || host_ip_address != IP_ADDRESS(169,229,216,200)) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + + /* Test the A type with the new API,(berkeley.edu.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A Type Berkley Edu New API Record Multi Addr Test....."); + + /* Test the A type NetX(new API) to process the multiple address. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + ipv4_address_ptr1 = (ULONG *)record_buffer; + + /* Check status and compare the host ip address. */ + if (status || (record_count != 1) || + (*ipv4_address_ptr1 != IP_ADDRESS(169,229,216,200))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + +static void dns_retransmit_test() +{ +ULONG *ipv4_address_ptr1; + + /* Test DNS Query retransmission the A type with the new API,(berkeley.edu.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A Type Berkley Edu New API Retransmission Test........"); + + /* Test the A type NetX(new API) to process the multiple address. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &record_buffer[0], 500, &record_count, 2 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + ipv4_address_ptr1 = (ULONG *)record_buffer; + + /* Check status and compare the host ip address. */ + if (status || (record_count != 1) || + (*ipv4_address_ptr1 != IP_ADDRESS(169,229,216,200))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + +#ifdef __PRODUCT_NETXDUO__ +static void dns_aaaa_type_test() +{ + +NX_DNS_IPV6_ADDRESS *ipv6_address_ptr; + +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS host_ipduo_address; +#endif + +#ifdef FEATURE_NX_IPV6 + /* Test the AAAA type with the old API,(berkeley.edu.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS AAAA Type Berkley Edu Old API Record Singer Addr Test."); + + /* Secd DNS AAAA query, and record the single host ip address. */ + status = nxd_dns_host_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &host_ipduo_address, 4 * NX_IP_PERIODIC_RATE, NX_IP_VERSION_V6); + + /* Check status and compare the host ip address. */ + if (status || + host_ipduo_address.nxd_ip_address.v6[0] != 0x2607f140 || + host_ipduo_address.nxd_ip_address.v6[1] != 0x00000081 || + host_ipduo_address.nxd_ip_address.v6[2] != 0x00000000 || + host_ipduo_address.nxd_ip_address.v6[3] != 0x0000000f) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } +#endif + + /* Test the A type with the new API,(berkeley.edu.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS AAAA Type Berkley Edu New API Record Multi Addr Test.."); + + /* Test the AAAA type NetX Duo(new API) to process the multiple address. */ + status = nxd_dns_ipv6_address_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &record_buffer[0], 200, &record_count, 4 * NX_IP_PERIODIC_RATE); + + ipv6_address_ptr = (NX_DNS_IPV6_ADDRESS *)record_buffer; + + /* Check the record buffer. */ + /* Check status and compare the host ip address. */ + if (status || record_count != 1 || + (*ipv6_address_ptr).ipv6_address[0] != 0x2607f140 || + (*ipv6_address_ptr).ipv6_address[1] != 0x00000081 || + (*ipv6_address_ptr).ipv6_address[2] != 0x00000000 || + (*ipv6_address_ptr).ipv6_address[3] != 0x0000000f) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } +} +#endif /* __PRODUCT_NETXDUO__ */ + + +#ifdef NX_DNS_ENABLE_EXTENDED_RR_TYPES + +static void dns_a_cname_type_test() +{ +ULONG host_ip_address; +ULONG *ipv4_address_ptr1; + + /* Test the A type with the old API,(google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A CNAME Type Www Npr Org Old API Test................."); + + /* Secd dns query, and record the single host ip address. */ + status = nx_dns_host_by_name_get(&client_dns, (UCHAR *)"www.npr.org", &host_ip_address, 4 * NX_IP_PERIODIC_RATE); + + /* Check status and compare the host ip address. */ + if (status || host_ip_address != IP_ADDRESS(216,35,221,76)) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + + /* Test the A type with the new API,(google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS A CNAME Type Www Npr Org New API Test................."); + + /* Test the A type NetX(new API) to process the multiple address. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"www.npr.org", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + ipv4_address_ptr1 = (ULONG *)record_buffer; + + /* Check status and compare the host ip address. */ + if (status || (record_count != 1) || + (*ipv4_address_ptr1 != IP_ADDRESS(216,35,221,76))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + +static void dns_mx_type_test() +{ + +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr1; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr2; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr3; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr4; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr5; + + /* Test the MX type (google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS MX Type Google Com New API Record Multi MX Test......."); + + /* Secd DNS MX query, and record the multiple mail exchange info. */ + status = nx_dns_domain_mail_exchange_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + + /* Check the record buffer. */ + nx_dns_mx_entry_ptr1 = (NX_DNS_MX_ENTRY *)record_buffer; + nx_dns_mx_entry_ptr2 = (NX_DNS_MX_ENTRY *)(record_buffer + sizeof(NX_DNS_MX_ENTRY)); + nx_dns_mx_entry_ptr3 = (NX_DNS_MX_ENTRY *)(record_buffer + (2 * sizeof(NX_DNS_MX_ENTRY))); + nx_dns_mx_entry_ptr4 = (NX_DNS_MX_ENTRY *)(record_buffer + (3 * sizeof(NX_DNS_MX_ENTRY))); + nx_dns_mx_entry_ptr5 = (NX_DNS_MX_ENTRY *)(record_buffer + (4 * sizeof(NX_DNS_MX_ENTRY))); + + /* Check status and compare the host ip address. */ + if (status || record_count != 5) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr1 -> nx_dns_mx_preference != 50 || + memcmp(nx_dns_mx_entry_ptr1 -> nx_dns_mx_hostname_ptr, "alt4.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr1 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr2 -> nx_dns_mx_preference != 30 || + memcmp(nx_dns_mx_entry_ptr2 -> nx_dns_mx_hostname_ptr, "alt2.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr2 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr3 -> nx_dns_mx_preference != 10 || + memcmp(nx_dns_mx_entry_ptr3 -> nx_dns_mx_hostname_ptr, "aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr3 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr4 -> nx_dns_mx_preference != 20 || + memcmp(nx_dns_mx_entry_ptr4 -> nx_dns_mx_hostname_ptr, "alt1.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr4 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr5 -> nx_dns_mx_preference != 40 || + memcmp(nx_dns_mx_entry_ptr5 -> nx_dns_mx_hostname_ptr, "alt3.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr5 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + + + +static void dns_mx_a_type_test() +{ + +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr1; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr2; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr3; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr4; +NX_DNS_MX_ENTRY *nx_dns_mx_entry_ptr5; + + /* Test the MX&A type (google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS MX&A Type Google Com New API Record Multi MX Test....."); + + /* Secd DNS MX query, and record the multiple mail exchange info. */ + status = nx_dns_domain_mail_exchange_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + + /* Check the record buffer. */ + nx_dns_mx_entry_ptr1 = (NX_DNS_MX_ENTRY *)record_buffer; + nx_dns_mx_entry_ptr2 = (NX_DNS_MX_ENTRY *)(record_buffer + sizeof(NX_DNS_MX_ENTRY)); + nx_dns_mx_entry_ptr3 = (NX_DNS_MX_ENTRY *)(record_buffer + (2 * sizeof(NX_DNS_MX_ENTRY))); + nx_dns_mx_entry_ptr4 = (NX_DNS_MX_ENTRY *)(record_buffer + (3 * sizeof(NX_DNS_MX_ENTRY))); + nx_dns_mx_entry_ptr5 = (NX_DNS_MX_ENTRY *)(record_buffer + (4 * sizeof(NX_DNS_MX_ENTRY))); + + /* Check status and compare the host ip address. */ + if (status || record_count != 5) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr1 -> nx_dns_mx_preference != 20 || + nx_dns_mx_entry_ptr1 -> nx_dns_mx_ipv4_address != IP_ADDRESS(209,85,225,26) || + memcmp(nx_dns_mx_entry_ptr1 -> nx_dns_mx_hostname_ptr, "alt1.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr1 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr2 -> nx_dns_mx_preference != 30 || + nx_dns_mx_entry_ptr2 -> nx_dns_mx_ipv4_address != IP_ADDRESS(74,125,130,26) || + memcmp(nx_dns_mx_entry_ptr2 -> nx_dns_mx_hostname_ptr, "alt2.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr2 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr3 -> nx_dns_mx_preference != 40 || + nx_dns_mx_entry_ptr3 -> nx_dns_mx_ipv4_address != IP_ADDRESS(173,194,76,26) || + memcmp(nx_dns_mx_entry_ptr3 -> nx_dns_mx_hostname_ptr, "alt3.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr3 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr4 -> nx_dns_mx_preference != 50 || + nx_dns_mx_entry_ptr4 -> nx_dns_mx_ipv4_address != IP_ADDRESS(173,194,73,26) || + memcmp(nx_dns_mx_entry_ptr4 -> nx_dns_mx_hostname_ptr, "alt4.aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr4 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr5 -> nx_dns_mx_preference != 10 || + nx_dns_mx_entry_ptr5 -> nx_dns_mx_ipv4_address != IP_ADDRESS(173,194,79,26) || + memcmp(nx_dns_mx_entry_ptr5 -> nx_dns_mx_hostname_ptr, "aspmx.l.google.com", strlen((const char*)(nx_dns_mx_entry_ptr5 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + + /* Test the MX&A type (berkeley.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS MX&A Type Berkley Com New API Record Multi MX Test...."); + + /* Secd DNS MX query, and record the multiple mail exchange info. */ + status = nx_dns_domain_mail_exchange_get(&client_dns, (UCHAR *)"berkeley.edu", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + nx_dns_mx_entry_ptr1 = (NX_DNS_MX_ENTRY *)record_buffer; + + /* Check status and compare the host ip address. */ + if (status || record_count != 1) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_mx_entry_ptr1 -> nx_dns_mx_preference != 10 || + nx_dns_mx_entry_ptr1 -> nx_dns_mx_ipv4_address != IP_ADDRESS(169,229,218,141) || + memcmp(nx_dns_mx_entry_ptr1 -> nx_dns_mx_hostname_ptr, "mx.berkeley.edu", strlen((const char*)(nx_dns_mx_entry_ptr1 -> nx_dns_mx_hostname_ptr)))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + + +static void dns_cname_type_test() +{ + + /* Test the CNAME type (mail.baidu.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS CNAME Type Www Baidu Com New API Record Cname Test...."); + + /* Secd DNS CNAME query, and record the cname info. */ + status = nx_dns_cname_get(&client_dns, (UCHAR *)"www.baidu.com", &record_buffer[0], 500, 4 * NX_IP_PERIODIC_RATE); + + /* Check status and compare the host ip address. */ + if (status || + memcmp(record_buffer, "www.a.shifen.com", strlen((const char*)(&record_buffer[0])))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + +static void dns_ns_a_type_test() +{ + +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr1; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr2; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr3; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr4; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr5; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr6; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr7; +NX_DNS_NS_ENTRY *nx_dns_ns_entry_ptr8; + + /* Test the NS&A type (ti.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS NS&A Type Ti Com New API Record Multi NS Test........."); + + /* Secd DNS NS query, and record the multiple name server info. */ + status = nx_dns_domain_name_server_get(&client_dns, (UCHAR *)"ti.com", &record_buffer[0], 200, &record_count, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + nx_dns_ns_entry_ptr1 = (NX_DNS_NS_ENTRY *)record_buffer; + nx_dns_ns_entry_ptr2 = (NX_DNS_NS_ENTRY *)(record_buffer + sizeof(NX_DNS_NS_ENTRY)); + nx_dns_ns_entry_ptr3 = (NX_DNS_NS_ENTRY *)(record_buffer + (2 * sizeof(NX_DNS_NS_ENTRY))); + nx_dns_ns_entry_ptr4 = (NX_DNS_NS_ENTRY *)(record_buffer + (3 * sizeof(NX_DNS_NS_ENTRY))); + nx_dns_ns_entry_ptr5 = (NX_DNS_NS_ENTRY *)(record_buffer + (4 * sizeof(NX_DNS_NS_ENTRY))); + nx_dns_ns_entry_ptr6 = (NX_DNS_NS_ENTRY *)(record_buffer + (5 * sizeof(NX_DNS_NS_ENTRY))); + nx_dns_ns_entry_ptr7 = (NX_DNS_NS_ENTRY *)(record_buffer + (6 * sizeof(NX_DNS_NS_ENTRY))); + nx_dns_ns_entry_ptr8 = (NX_DNS_NS_ENTRY *)(record_buffer + (7 * sizeof(NX_DNS_NS_ENTRY))); + + /* Check status and compare the host ip address. */ + if (status || record_count != 8) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr8 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(64,95,61,4) || + memcmp(nx_dns_ns_entry_ptr8 -> nx_dns_ns_hostname_ptr, "ns-c.pnap.net", strlen((const char*)(nx_dns_ns_entry_ptr8 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr7 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(64,94,123,4) || + memcmp(nx_dns_ns_entry_ptr7 -> nx_dns_ns_hostname_ptr, "ns-a.pnap.net", strlen((const char*)(nx_dns_ns_entry_ptr7 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr6 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(192,94,94,43) || + memcmp(nx_dns_ns_entry_ptr6 -> nx_dns_ns_hostname_ptr, "ns2.ti.com", strlen((const char*)(nx_dns_ns_entry_ptr6 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr5 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(192,94,94,42) || + memcmp(nx_dns_ns_entry_ptr5 -> nx_dns_ns_hostname_ptr, "ns.ti.com", strlen((const char*)(nx_dns_ns_entry_ptr5 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr4 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(198,47,26,151) || + memcmp(nx_dns_ns_entry_ptr4 -> nx_dns_ns_hostname_ptr, "ns4.ti.com", strlen((const char*)(nx_dns_ns_entry_ptr4 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr3 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(198,47,26,150) || + memcmp(nx_dns_ns_entry_ptr3 -> nx_dns_ns_hostname_ptr, "ns3.ti.com", strlen((const char*)(nx_dns_ns_entry_ptr3 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr2 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(64,94,123,36) || + memcmp(nx_dns_ns_entry_ptr2 -> nx_dns_ns_hostname_ptr, "ns-b.pnap.net", strlen((const char*)(nx_dns_ns_entry_ptr2 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_ns_entry_ptr1 -> nx_dns_ns_ipv4_address!= IP_ADDRESS(64,95,61,36) || + memcmp(nx_dns_ns_entry_ptr1 -> nx_dns_ns_hostname_ptr, "ns-d.pnap.net", strlen((const char*)(nx_dns_ns_entry_ptr1 -> nx_dns_ns_hostname_ptr)))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } +} + + +static void dns_srv_type_test() +{ + +NX_DNS_SRV_ENTRY *nx_dns_srv_entry_ptr1; +NX_DNS_SRV_ENTRY *nx_dns_srv_entry_ptr2; +NX_DNS_SRV_ENTRY *nx_dns_srv_entry_ptr3; +NX_DNS_SRV_ENTRY *nx_dns_srv_entry_ptr4; +NX_DNS_SRV_ENTRY *nx_dns_srv_entry_ptr5; + + /* Test the SRV type (google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS SRV Type Google Com New API Record Multi service Test."); + + /* Secd DNS SRV query, and record the multiple service info. */ + status = nx_dns_domain_service_get(&client_dns, (UCHAR *)"_xmpp-client._tcp.google.com", &record_buffer[0], 500, &record_count, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + nx_dns_srv_entry_ptr1 = (NX_DNS_SRV_ENTRY *)record_buffer; + nx_dns_srv_entry_ptr2 = (NX_DNS_SRV_ENTRY *)(record_buffer + sizeof(NX_DNS_SRV_ENTRY)); + nx_dns_srv_entry_ptr3 = (NX_DNS_SRV_ENTRY *)(record_buffer + (2 * sizeof(NX_DNS_SRV_ENTRY))); + nx_dns_srv_entry_ptr4 = (NX_DNS_SRV_ENTRY *)(record_buffer + (3 * sizeof(NX_DNS_SRV_ENTRY))); + nx_dns_srv_entry_ptr5 = (NX_DNS_SRV_ENTRY *)(record_buffer + (4 * sizeof(NX_DNS_SRV_ENTRY))); + + /* Check status and compare the host ip address. */ + if (status || record_count != 5) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_srv_entry_ptr1 -> nx_dns_srv_port_number != 5222 || + nx_dns_srv_entry_ptr1 -> nx_dns_srv_priority != 20 || + nx_dns_srv_entry_ptr1 -> nx_dns_srv_weight != 0 || + memcmp(nx_dns_srv_entry_ptr1 -> nx_dns_srv_hostname_ptr, "alt3.xmpp.l.google.com", strlen((const char*)(nx_dns_srv_entry_ptr1 -> nx_dns_srv_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_srv_entry_ptr2 -> nx_dns_srv_port_number != 5222 || + nx_dns_srv_entry_ptr2 -> nx_dns_srv_priority != 20 || + nx_dns_srv_entry_ptr2 -> nx_dns_srv_weight != 0 || + memcmp(nx_dns_srv_entry_ptr2 -> nx_dns_srv_hostname_ptr, "alt1.xmpp.l.google.com", strlen((const char*)(nx_dns_srv_entry_ptr2 -> nx_dns_srv_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_srv_entry_ptr3 -> nx_dns_srv_port_number != 5222 || + nx_dns_srv_entry_ptr3 -> nx_dns_srv_priority != 20 || + nx_dns_srv_entry_ptr3 -> nx_dns_srv_weight != 0 || + memcmp(nx_dns_srv_entry_ptr3 -> nx_dns_srv_hostname_ptr, "alt4.xmpp.l.google.com", strlen((const char*)(nx_dns_srv_entry_ptr3 -> nx_dns_srv_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_srv_entry_ptr4 -> nx_dns_srv_port_number != 5222 || + nx_dns_srv_entry_ptr4 -> nx_dns_srv_priority != 5 || + nx_dns_srv_entry_ptr4 -> nx_dns_srv_weight != 0 || + memcmp(nx_dns_srv_entry_ptr4 -> nx_dns_srv_hostname_ptr, "xmpp.l.google.com", strlen((const char*)(nx_dns_srv_entry_ptr4 -> nx_dns_srv_hostname_ptr)))) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_srv_entry_ptr5 -> nx_dns_srv_port_number != 5222 || + nx_dns_srv_entry_ptr5 -> nx_dns_srv_priority != 20 || + nx_dns_srv_entry_ptr5 -> nx_dns_srv_weight != 0 || + memcmp(nx_dns_srv_entry_ptr5 -> nx_dns_srv_hostname_ptr, "alt2.xmpp.l.google.com", strlen((const char*)(nx_dns_srv_entry_ptr5 -> nx_dns_srv_hostname_ptr)))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + + +static void dns_txt_type_test() +{ + + /* Test the TXT type (google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS TXT Type Google Com New API Record Txt Test..........."); + + /* Secd DNS CNAME query, and record the cname info. */ + status = nx_dns_host_text_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 500, 4 * NX_IP_PERIODIC_RATE); + + /* Check status and compare the host ip address. */ + if (status || + memcmp(record_buffer, "v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all", strlen((const char*)(&record_buffer[0])))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + + +static void dns_soa_type_test() +{ + +NX_DNS_SOA_ENTRY *nx_dns_soa_entry_ptr; + + /* Test the SOA type (google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS SOA Type Google Com New API Record start of zone Test."); + + /* Secd DNS SRV query, and record the multiple service info. */ + status = nx_dns_authority_zone_start_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 100, 4 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + nx_dns_soa_entry_ptr = (NX_DNS_SOA_ENTRY *)record_buffer; + + /* Check status and compare the host ip address. */ + if (status) + { + error_counter++; + } + + /* Check the all mail exchange info. */ + if(nx_dns_soa_entry_ptr -> nx_dns_soa_serial != 2012090400 || + nx_dns_soa_entry_ptr -> nx_dns_soa_refresh != 2 * 60 * 60 || + nx_dns_soa_entry_ptr -> nx_dns_soa_retry != 30 * 60 || + nx_dns_soa_entry_ptr -> nx_dns_soa_expire != 14 * 24 * 60 * 60 || + nx_dns_soa_entry_ptr -> nx_dns_soa_minmum != 5 * 60 || + memcmp( nx_dns_soa_entry_ptr -> nx_dns_soa_host_mname_ptr, "ns1.google.com", strlen((const char*)(nx_dns_soa_entry_ptr -> nx_dns_soa_host_mname_ptr))) || + memcmp( nx_dns_soa_entry_ptr -> nx_dns_soa_host_rname_ptr, "dns-admin.google.com", strlen((const char*)(nx_dns_soa_entry_ptr -> nx_dns_soa_host_rname_ptr)))) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + +} + +#endif +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_function_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Function Test.........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dns_test/netx_dns_invalid_name_unencode_test.c b/test/regression/dns_test/netx_dns_invalid_name_unencode_test.c new file mode 100644 index 00000000..9c0e8127 --- /dev/null +++ b/test/regression/dns_test/netx_dns_invalid_name_unencode_test.c @@ -0,0 +1,407 @@ +/* This NetX test concentrates on the basic DNS operation. Unencode invalid string. */ + +/* Frame (125 bytes) */ +static unsigned char invalid_ptr_response_0[125] = { +0xf4, 0x8e, 0x38, 0xa3, 0xab, 0xf6, 0x8c, 0xec, /* ..8..... */ +0x4b, 0x68, 0xd1, 0xfe, 0x08, 0x00, 0x45, 0x00, /* Kh....E. */ +0x00, 0x6f, 0x1a, 0x9a, 0x40, 0x00, 0x40, 0x11, /* .o..@.@. */ +0xd6, 0x2e, 0xc0, 0xa8, 0x64, 0x02, 0xc0, 0xa8, /* ....d... */ +0x64, 0x62, 0x00, 0x35, 0xef, 0x67, 0x00, 0x5b, /* db.5.g.[ */ +0x7e, 0xb5, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, /* ~....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x31, /* .......1 */ +0x34, 0x03, 0x32, 0x30, 0x33, 0x02, 0x35, 0x38, /* 4.203.58 */ +0x03, 0x32, 0x31, 0x36, 0x07, 0x69, 0x6e, 0x2d, /* .216.in- */ +0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, 0x70, /* addr.arp */ +0x61, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x02, 0x31, /* a......1 */ +0x34, 0x03, 0x32, 0x30, 0x33, 0x02, 0x35, 0x38, /* 4.203.58 */ +0x03, 0x32, 0x31, 0x36, 0x07, 0x69, 0x6e, 0x2d, /* .216.in- */ +0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, 0x70, /* addr.arp */ +0x61, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* a....... */ +0x95, 0x04, 0x00, 0x01, 0x00 /* ..... */ +}; + +/* Frame-2 (128 bytes) */ +static unsigned char invalid_ptr_response_1[128] = { +0xf4, 0x8e, 0x38, 0xa3, 0xab, 0xf6, 0x8c, 0xec, /* ..8..... */ +0x4b, 0x68, 0xd1, 0xfe, 0x08, 0x00, 0x45, 0x00, /* Kh....E. */ +0x00, 0x6f, 0x1a, 0x9a, 0x40, 0x00, 0x40, 0x11, /* .o..@.@. */ +0xd6, 0x2e, 0xc0, 0xa8, 0x64, 0x02, 0xc0, 0xa8, /* ....d... */ +0x64, 0x62, 0x00, 0x35, 0xef, 0x67, 0x00, 0x5b, /* db.5.g.[ */ +0x7e, 0xb5, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, /* ~....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x31, /* .......1 */ +0x34, 0x03, 0x32, 0x30, 0x33, 0x02, 0x35, 0x38, /* 4.203.58 */ +0x03, 0x32, 0x31, 0x36, 0x07, 0x69, 0x6e, 0x2d, /* .216.in- */ +0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, 0x70, /* addr.arp */ +0x61, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x02, 0x31, /* a......1 */ +0x34, 0x03, 0x32, 0x30, 0x33, 0x02, 0x35, 0x38, /* 4.203.58 */ +0x03, 0x32, 0x31, 0x36, 0x07, 0x69, 0x6e, 0x2d, /* .216.in- */ +0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, 0x70, /* addr.arp */ +0x61, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* a....... */ +0x95, 0x04, 0x00, 0x01, 0xc0, 0x54, 0xc0, 0x52 /* ..... */ +}; + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#ifndef NX_DISABLE_IPV4 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + +static NX_UDP_SOCKET server_socket; +static NX_DNS client_dns; + + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_invalid_name_unencode_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(192, 168, 100, 98), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(192, 168, 100, 2), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UCHAR host_name[300]; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: DNS Invalid Name Unencode Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, IP_ADDRESS(192, 168, 100, 2)); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + host_name[0] = '.'; + host_name[1] = '.'; + host_name[2] = '.'; + host_name[3] = '.'; + + for (i = 0; i < 2; i++) { + /* Send DNS PTR query, response invalid name. */ + status = nx_dns_host_by_address_get(&client_dns, IP_ADDRESS(216, 58, 203, 14), &host_name[4], 256, NX_IP_PERIODIC_RATE); + + /* Sleep 1s to check if crash. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; +NX_PACKET *response_packet[2]; +UINT i; +UCHAR *invalid_ptr_response; +UINT response_len; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + + /* Act as the DNS server to receive the DNS query and send the DNS response. */ + for (i = 0; i < 2; i++) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet[i], NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + if (i == 0) + { + invalid_ptr_response = invalid_ptr_response_0; + response_len = 125; + } else { + invalid_ptr_response = invalid_ptr_response_1; + response_len = 128; + } + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet[i] -> nx_packet_prepend_ptr, invalid_ptr_response + DNS_START_OFFSET, response_len - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet[i] -> nx_packet_length = response_len - DNS_START_OFFSET; + response_packet[i] -> nx_packet_append_ptr = response_packet[i] -> nx_packet_prepend_ptr + response_packet[i] -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet[i] -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet[i], IP_ADDRESS(192, 168, 100, 98), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet[i]); + return; + } + + } + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_invalid_name_unencode_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Invalid Name Unencode Test............................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/netx_dns_invalid_resource_get_test.c b/test/regression/dns_test/netx_dns_invalid_resource_get_test.c new file mode 100644 index 00000000..c3b5fdc8 --- /dev/null +++ b/test/regression/dns_test/netx_dns_invalid_resource_get_test.c @@ -0,0 +1,428 @@ +/* This NetX test concentrates on DNS operation with invalid resource in DNS response packet. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif + +extern char invalid_response_ptr_0[119]; +extern UINT invalid_response_size_0; +extern char invalid_response_ptr_1[119]; +extern UINT invalid_response_size_1; +extern char invalid_response_ptr_2[119]; +extern UINT invalid_response_size_2; +extern char invalid_response_ptr_3[119]; +extern UINT invalid_response_size_3; + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_UDP_SOCKET server_socket; + +static NX_DNS client_dns; + +#define DNS_SERVER_ADDRESS IP_ADDRESS(10,0,0,1) + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG notify_calls = 0; + +static UCHAR record_buffer[500]; +static UINT record_count; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); + +/* DNS Tests. */ +static void dns_test_initialize(); + +/* Send DNS response. */ +static UINT nx_dns_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, USHORT nx_dns_transmit_id, UINT packet_number); + +/* Send DNS query. */ +static UINT nx_dns_query_packet_send(); + +typedef struct DNS_TEST_STRUCT +{ + char *dns_test_pkt_data; + UINT dns_test_pkt_size; +} DNS_TEST; + +#define test_count 4 +static DNS_TEST dns_test[test_count]; + +extern ULONG test_control_successful_tests; +extern ULONG test_control_failed_tests; + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_invalid_resource_get_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(10, 0, 0, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(10, 0, 0, 1), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT i; + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if (status) + { + error_counter++; + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, DNS_SERVER_ADDRESS); + if (status) + { + error_counter++; + } + + /* The DNS test initialize. */ + dns_test_initialize(); + + printf("Begin test\n"); + nx_dns_query_packet_send(); + + test_control_return(0xdeadbeef); +} + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +UINT i; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Act as the DNS server to receive the DNS query and send the DNS response. */ + for (i = 0; i < test_count; i++ ) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + status = nx_dns_response_packet_send(&server_socket, port, nx_dns_transmit_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_dns_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, USHORT nx_dns_transmit_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; +UCHAR *data_ptr; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the DNS response messages into the packet payload! */ + dns_test[packet_number].dns_test_pkt_data += DNS_START_OFFSET; + memcpy(response_packet -> nx_packet_prepend_ptr, dns_test[packet_number].dns_test_pkt_data, dns_test[packet_number].dns_test_pkt_size - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = dns_test[packet_number].dns_test_pkt_size - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(server_socket, response_packet, IP_ADDRESS(10, 0, 0, 10), port); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} + +static UINT nx_dns_query_packet_send() +{ +UINT status; +UINT i; + + for (i = 0; i < test_count; i++) + { + printf("NetX Test: DNS Test [%u] with invalid resource in response ........", i); + + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"berkeley.edu", &record_buffer[0], 500, &record_count, 2 * NX_IP_PERIODIC_RATE); + + /* Check the record buffer. */ + if (!status) + { + error_counter++; + } + + /* Printf the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + } + return 0; +} + +static void dns_test_initialize() +{ + dns_test[0].dns_test_pkt_data = &invalid_response_ptr_2[0]; + dns_test[0].dns_test_pkt_size = invalid_response_size_2; + + dns_test[1].dns_test_pkt_data = &invalid_response_ptr_1[0]; + dns_test[1].dns_test_pkt_size = invalid_response_size_1; + + dns_test[2].dns_test_pkt_data = &invalid_response_ptr_2[0]; + dns_test[2].dns_test_pkt_size = invalid_response_size_2; + + dns_test[3].dns_test_pkt_data = &invalid_response_ptr_3[0]; + dns_test[3].dns_test_pkt_size = invalid_response_size_3; + + return; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_invalid_resource_get_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Invalid Resource Get Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/dns_test/netx_dns_non_blocking_a_test.c b/test/regression/dns_test/netx_dns_non_blocking_a_test.c new file mode 100644 index 00000000..57551580 --- /dev/null +++ b/test/regression/dns_test/netx_dns_non_blocking_a_test.c @@ -0,0 +1,420 @@ +/* This NetX test concentrates on the basic DNS operation. Non-blocking test. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#ifndef NX_DISABLE_IPV4 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_SEMAPHORE semaphore; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + +static NX_UDP_SOCKET server_socket; +static NX_DNS client_dns; + + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void _nx_dns_udp_receive_notify(NX_UDP_SOCKET *socket_ptr); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_non_blocking_a_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(192, 168, 100, 98), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(192, 168, 100, 2), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UCHAR record_buffer[64]; +UINT record_count; +ULONG *ipv4_address_ptr1; +ULONG *ipv4_address_ptr2; +ULONG *ipv4_address_ptr3; +ULONG *ipv4_address_ptr4; +ULONG *ipv4_address_ptr5; +ULONG *ipv4_address_ptr6; +ULONG *ipv4_address_ptr7; +ULONG *ipv4_address_ptr8; +ULONG *ipv4_address_ptr9; +ULONG *ipv4_address_ptr10; +ULONG *ipv4_address_ptr11; + + /* Print out some test information banners. */ + printf("NetX Test: DNS Non Blocking A Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the test control semaphore. */ + tx_semaphore_create(&semaphore, "DNS Non Blocking", 0); + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, IP_ADDRESS(192, 168, 100, 2)); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the UDP socket receive callback function. */ + nx_udp_socket_receive_notify(&(client_dns.nx_dns_socket), _nx_dns_udp_receive_notify); + + /* Send query. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_IN_PROGRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the semaphore. */ + status = tx_semaphore_get(&semaphore, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != TX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the response. */ + status = _nx_dns_response_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the record buffer. */ + ipv4_address_ptr1 = (ULONG *)record_buffer; + ipv4_address_ptr2 = (ULONG *)(record_buffer + 4); + ipv4_address_ptr3 = (ULONG *)(record_buffer + 8); + ipv4_address_ptr4 = (ULONG *)(record_buffer + 12); + ipv4_address_ptr5 = (ULONG *)(record_buffer + 16); + ipv4_address_ptr6 = (ULONG *)(record_buffer + 20); + ipv4_address_ptr7 = (ULONG *)(record_buffer + 24); + ipv4_address_ptr8 = (ULONG *)(record_buffer + 28); + ipv4_address_ptr9 = (ULONG *)(record_buffer + 32); + ipv4_address_ptr10 = (ULONG *)(record_buffer + 36); + ipv4_address_ptr11 = (ULONG *)(record_buffer + 40); + + /* Check status and compare the host ip address. */ + if ((record_count != 11) || + (*ipv4_address_ptr1 != IP_ADDRESS(74,125,224,194)) || + (*ipv4_address_ptr2 != IP_ADDRESS(74,125,224,195)) || + (*ipv4_address_ptr3 != IP_ADDRESS(74,125,224,196)) || + (*ipv4_address_ptr4 != IP_ADDRESS(74,125,224,197)) || + (*ipv4_address_ptr5 != IP_ADDRESS(74,125,224,198)) || + (*ipv4_address_ptr6 != IP_ADDRESS(74,125,224,199)) || + (*ipv4_address_ptr7 != IP_ADDRESS(74,125,224,200)) || + (*ipv4_address_ptr8 != IP_ADDRESS(74,125,224,201)) || + (*ipv4_address_ptr9 != IP_ADDRESS(74,125,224,206)) || + (*ipv4_address_ptr10 != IP_ADDRESS(74,125,224,192))|| + (*ipv4_address_ptr11 != IP_ADDRESS(74,125,224,193))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +extern char response_a_google_com_pkt[]; +extern int response_a_google_com_pkt_size; + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; +NX_PACKET *response_packet; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_a_google_com_pkt + DNS_START_OFFSET, response_a_google_com_pkt_size - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = response_a_google_com_pkt_size - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet, IP_ADDRESS(192, 168, 100, 98), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + return; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} + +static void _nx_dns_udp_receive_notify(NX_UDP_SOCKET *socket_ptr) +{ + + NX_PARAMETER_NOT_USED(socket_ptr); + tx_semaphore_put(&semaphore); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_non_blocking_a_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Non Blocking A Test...................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/netx_dns_nxe_api_test.c b/test/regression/dns_test/netx_dns_nxe_api_test.c new file mode 100644 index 00000000..100d10a7 --- /dev/null +++ b/test/regression/dns_test/netx_dns_nxe_api_test.c @@ -0,0 +1,261 @@ +/* NetX DNS Client API error tests. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* DNS Client Error Checking Test. */ +static void error_checking_test(void); + +static NX_IP ip_0; +static NX_DNS dns_0; +static UCHAR temp_uchar; +static UINT temp_uint; +static ULONG temp_ulong; +static USHORT temp_ushort; +static USHORT temp_ushort2; // we need a second ushort to make sure this one is not 32 bit aligned + +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS address_0; +#endif + +extern volatile ULONG _tx_thread_system_state; +extern TX_THREAD *_tx_thread_current_ptr; +extern TX_THREAD _tx_timer_thread; + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: DNS Client Error Checking Test..........................\n"); + + static CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_checking_test(); + + printf("SUCCESS!\n"); + test_control_return(0); +} + +#define validate_expected_status(status,expected_status) if (expected_status != status) {printf("%s,%d: ERROR!",__FILE__, __LINE__);test_control_return(1);} + + +static void nxe_dns_server_add_remove_error_check_test(NX_DNS *dns_ptr, ULONG server_address, UINT expected_status) +{ + //_nxe_dns_server_add(NX_DNS *dns_ptr, ULONG server_address) + validate_expected_status(_nxe_dns_server_add(dns_ptr, server_address), expected_status); + + //_nxe_dns_server_remove(NX_DNS *dns_ptr, ULONG server_address) + validate_expected_status(_nxe_dns_server_remove(dns_ptr, server_address), expected_status); + + //_nxe_dns_server_remove_all(NX_DNS *dns_ptr) + if (expected_status != NX_DNS_BAD_ADDRESS_ERROR) { + validate_expected_status(_nxe_dns_server_remove_all(dns_ptr), expected_status); + } +} + +#ifdef __PRODUCT_NETXDUO__ +static void nxde_address_error_checks() { + dns_0.nx_dns_id = NX_DNS_ID; + address_0.nxd_ip_version = NX_NULL; + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_DNS_PARAM_ERROR); + + address_0.nxd_ip_version = 0x1; + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_DNS_INVALID_ADDRESS_TYPE); + validate_expected_status(_nxde_dns_server_remove(&dns_0, &address_0), NX_DNS_INVALID_ADDRESS_TYPE); + + address_0.nxd_ip_version = NX_IP_VERSION_V4; + address_0.nxd_ip_address.v4 = 0; + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_DNS_BAD_ADDRESS_ERROR); + validate_expected_status(_nxde_dns_server_remove(&dns_0, &address_0), NX_DNS_BAD_ADDRESS_ERROR); + +#ifdef FEATURE_NX_IPV6 + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0; + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_DNS_BAD_ADDRESS_ERROR); + validate_expected_status(_nxde_dns_server_remove(&dns_0, &address_0), NX_DNS_BAD_ADDRESS_ERROR); +#endif +} +#endif + +static void nx_dns_id_calls(void) +{ + validate_expected_status(_nxe_dns_delete(&dns_0), NX_CALLER_ERROR); + nxe_dns_server_add_remove_error_check_test(&dns_0, 1, NX_CALLER_ERROR); + validate_expected_status(_nxe_dns_get_serverlist_size(&dns_0, &temp_uint), NX_CALLER_ERROR); + validate_expected_status(_nxe_dns_server_get(&dns_0, 0, &temp_ulong), NX_CALLER_ERROR); + validate_expected_status(_nxe_dns_host_by_name_get(&dns_0, &temp_uchar, &temp_ulong, 1), NX_CALLER_ERROR); + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ulong, 1, &temp_uint, 1), NX_CALLER_ERROR); + validate_expected_status(_nxe_dns_host_by_address_get(&dns_0, 1, &temp_uchar, 1, 1), NX_CALLER_ERROR); +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ulong, 1, &temp_uint, 1), NX_CALLER_ERROR); + validate_expected_status(_nxde_dns_host_by_address_get(&dns_0, &address_0, &temp_uchar, 1, 1), NX_CALLER_ERROR); + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 13; + address_0.nxd_ip_address.v6[1] = 14; + address_0.nxd_ip_address.v6[2] = 13; + address_0.nxd_ip_address.v6[3] = 14; + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_CALLER_ERROR); +#endif + address_0.nxd_ip_version = NX_IP_VERSION_V4; + address_0.nxd_ip_address.v4 = 1314; + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_CALLER_ERROR); + validate_expected_status(_nxde_dns_server_remove(&dns_0, &address_0), NX_CALLER_ERROR); + validate_expected_status(_nxde_dns_server_get(&dns_0, 0, &address_0), NX_CALLER_ERROR); + validate_expected_status(_nxde_dns_host_by_name_get(&dns_0, &temp_uchar, &address_0, 0, 1), NX_CALLER_ERROR); +#endif +} + +static void error_checking_test(void) +{ + validate_expected_status(_nxe_dns_create(NX_NULL, NX_NULL, NX_NULL), NX_PTR_ERROR); + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + validate_expected_status(_nxe_dns_packet_pool_set(NX_NULL, NX_NULL), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_packet_pool_set(&dns_0, NX_NULL), NX_PTR_ERROR); +#endif + + validate_expected_status(_nxe_dns_delete(NX_NULL), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_get_serverlist_size(NX_NULL, NX_NULL), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_server_get(NX_NULL, 0, NX_NULL), NX_PTR_ERROR); + nxe_dns_server_add_remove_error_check_test(NX_NULL, 1, NX_PTR_ERROR); + + validate_expected_status(_nxe_dns_host_by_name_get(NX_NULL, NX_NULL, NX_NULL, 1), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_host_by_name_get(&dns_0, NX_NULL, NX_NULL, 1), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_host_by_name_get(&dns_0, &temp_uchar, NX_NULL, 1), NX_PTR_ERROR); + + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(NX_NULL, &temp_uchar, (void*)&temp_ulong, 1, &temp_uint, 1), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(&dns_0, NX_NULL, (void*)&temp_ulong, 1, &temp_uint, 1), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(&dns_0, &temp_uchar, NX_NULL, 1, &temp_uint, 1), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ulong, 1, NX_NULL, 1), NX_PTR_ERROR); + + validate_expected_status(_nxe_dns_host_by_address_get(NX_NULL, 1, &temp_uchar, 1, 1), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_host_by_address_get(&dns_0, 1, NX_NULL, 1, 1), NX_PTR_ERROR); + +#ifdef __PRODUCT_NETXDUO__ + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(NX_NULL, &temp_uchar, (void*)&temp_ulong, 1, &temp_uint, 1), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(&dns_0, NX_NULL, (void*)&temp_ulong, 1, &temp_uint, 1), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(&dns_0, &temp_uchar, NX_NULL, 1, &temp_uint, 1), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ulong, 1, NX_NULL, 1), NX_PTR_ERROR); + + + validate_expected_status(_nxde_dns_host_by_address_get(NX_NULL, &address_0, &temp_uchar, 1, 1), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_host_by_address_get(&dns_0, NX_NULL, &temp_uchar, 1, 1), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_host_by_address_get(&dns_0, &address_0, NX_NULL, 1, 1), NX_PTR_ERROR); + + validate_expected_status(_nxde_dns_server_add(NX_NULL, &address_0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_server_add(&dns_0, NX_NULL), NX_PTR_ERROR); + + validate_expected_status(_nxde_dns_server_remove(NX_NULL, &address_0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_server_remove(&dns_0, NX_NULL), NX_PTR_ERROR); + + validate_expected_status(_nxde_dns_server_get(NX_NULL, 0, &address_0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_server_get(&dns_0, 0, NX_NULL), NX_PTR_ERROR); + + //_nxde_dns_host_by_name_get(NX_DNS *dns_ptr, UCHAR *host_name, NXD_ADDRESS *host_address_ptr, ULONG wait_option, UINT lookup_type) + validate_expected_status(_nxde_dns_host_by_name_get(NX_NULL, &temp_uchar, &address_0, 0, 0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_host_by_name_get(&dns_0, NX_NULL, &address_0, 0, 0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_host_by_name_get(&dns_0, &temp_uchar, NX_NULL, 0, 0), NX_PTR_ERROR); + nxde_address_error_checks(); +#endif + + ip_0.nx_ip_id = 0; + validate_expected_status(_nxe_dns_create(NX_NULL, &ip_0, NX_NULL), NX_PTR_ERROR); + + ip_0.nx_ip_id = NX_IP_ID; + validate_expected_status(_nxe_dns_create(NX_NULL, &ip_0, NX_NULL), NX_PTR_ERROR); + + dns_0.nx_dns_id = NX_DNS_ID; + + validate_expected_status(_nxe_dns_host_by_address_get(&dns_0, 0, &temp_uchar, 1, 1), NX_DNS_PARAM_ERROR); + validate_expected_status(_nxe_dns_host_by_address_get(&dns_0, 1, &temp_uchar, 0, 1), NX_DNS_PARAM_ERROR); + +#ifdef __PRODUCT_NETXDUO__ + validate_expected_status(_nxde_dns_host_by_address_get(&dns_0, &address_0, &temp_uchar, 0, 1), NX_DNS_PARAM_ERROR); +#endif + + validate_expected_status(_nxe_dns_create(&dns_0, &ip_0, NX_NULL), NX_PTR_ERROR); + + // Alignment check tests + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ushort2 - 1, 1, &temp_uint, 1), NX_PTR_ERROR); +#ifdef __PRODUCT_NETXDUO__ + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ushort2 - 1, 1, &temp_uint, 1), NX_PTR_ERROR); +#endif + + nxe_dns_server_add_remove_error_check_test(&dns_0, 0, NX_DNS_BAD_ADDRESS_ERROR); + validate_expected_status(_nxe_dns_get_serverlist_size(&dns_0, NX_NULL), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_server_get(&dns_0, 0, NX_NULL), NX_PTR_ERROR); + + // apis that require requires nx_dns_id == NX_DNS_ID for the thread state tests + _tx_thread_system_state = 1; + nx_dns_id_calls(); + + _tx_thread_system_state = 0; + _tx_thread_current_ptr = TX_NULL; + nx_dns_id_calls(); + + _tx_thread_current_ptr = &_tx_timer_thread; + nx_dns_id_calls(); + +#ifdef __PRODUCT_NETXDUO__ + validate_expected_status(_nxde_dns_host_by_name_get(&dns_0, &temp_uchar, &address_0, 0, 0), NX_DNS_PARAM_ERROR); +#endif + + dns_0.nx_dns_id = 0; + validate_expected_status(_nxe_dns_delete(&dns_0), NX_PTR_ERROR); + nxe_dns_server_add_remove_error_check_test(&dns_0, 1, NX_PTR_ERROR); + validate_expected_status(_nxe_dns_get_serverlist_size(&dns_0, 0), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_server_get(&dns_0, 0, NX_NULL), NX_PTR_ERROR); + validate_expected_status(_nxe_dns_host_by_name_get(&dns_0, &temp_uchar, &temp_ulong, 1), NX_DNS_PARAM_ERROR); + validate_expected_status(_nxe_dns_ipv4_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ulong, 1, &temp_uint, 1), NX_DNS_PARAM_ERROR); + validate_expected_status(_nxe_dns_host_by_address_get(&dns_0, 1, &temp_uchar, 1, 1), NX_DNS_PARAM_ERROR); +#ifdef __PRODUCT_NETXDUO__ + validate_expected_status(_nxde_dns_ipv6_address_by_name_get(&dns_0, &temp_uchar, (void*)&temp_ulong, 1, &temp_uint, 1), NX_DNS_PARAM_ERROR); + validate_expected_status(_nxde_dns_host_by_address_get(&dns_0, &address_0, &temp_uchar, 1, 1), NX_DNS_PARAM_ERROR); + validate_expected_status(_nxde_dns_server_add(&dns_0, &address_0), NX_DNS_PARAM_ERROR); + validate_expected_status(_nxde_dns_server_remove(&dns_0, &address_0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_server_get(&dns_0, 0, &address_0), NX_PTR_ERROR); + validate_expected_status(_nxde_dns_host_by_name_get(&dns_0, &temp_uchar, &address_0, 0, 1), NX_DNS_PARAM_ERROR); +#endif + + // apis that require requires nx_dns_id == 0 for the thread state tests + _tx_thread_system_state = 1; + validate_expected_status(_nxe_dns_create(&dns_0, &ip_0, NX_NULL), NX_CALLER_ERROR); + + _tx_thread_system_state = 0; + _tx_thread_current_ptr = TX_NULL; + validate_expected_status(_nxe_dns_create(&dns_0, &ip_0, NX_NULL), NX_CALLER_ERROR); + + _tx_thread_current_ptr = &_tx_timer_thread; + validate_expected_status(_nxe_dns_create(&dns_0, &ip_0, NX_NULL), NX_CALLER_ERROR); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_api_error_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: DNS Client Error Checking Test.......................N/A\n"); + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/dns_test/netx_dns_packet_double_release_test.c b/test/regression/dns_test/netx_dns_packet_double_release_test.c new file mode 100644 index 00000000..3edcf0e6 --- /dev/null +++ b/test/regression/dns_test/netx_dns_packet_double_release_test.c @@ -0,0 +1,351 @@ +/* This NetX test concentrates on the basic DNS operation. Packet double release. */ + +#include "tx_api.h" +#include "tx_timer.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) && !defined (NX_DISABLE_PACKET_INFO) + +#define DEMO_STACK_SIZE 2048 +#define NX_PACKET_SIZE 1536 +#define NX_PACKET_POOL_SIZE ((NX_PACKET_SIZE + sizeof(NX_PACKET)) * 32) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + +static NX_UDP_SOCKET server_socket; +static NX_DNS client_dns; + + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG pool_stack[NX_PACKET_POOL_SIZE / sizeof(ULONG)]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void _nx_dns_udp_receive_notify(NX_UDP_SOCKET *socket_ptr); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_packet_double_release_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PACKET_SIZE, pool_stack, NX_PACKET_POOL_SIZE); + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(192, 168, 100, 98), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(192, 168, 100, 2), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UCHAR record_buffer[64]; +UINT record_count; + + /* Print out some test information banners. */ + printf("NetX Test: DNS Packet Double Free Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, IP_ADDRESS(192, 168, 100, 2)); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send query. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, 1); + + /* Check status, ID mismatch. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check if there is invalid packet release. */ + if (pool_0.nx_packet_pool_invalid_releases) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check errors. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +extern char response_a_google_com_pkt[]; +extern int response_a_google_com_pkt_size; + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +NX_PACKET *response_packet; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + tx_thread_resume(&thread_0); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Send the DNS response packet. */ + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_a_google_com_pkt + DNS_START_OFFSET, response_a_google_com_pkt_size - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = response_a_google_com_pkt_size - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + _tx_timer_system_clock++; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet, IP_ADDRESS(192, 168, 100, 98), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + return; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_packet_double_release_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Packet Double Free Test...............................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/netx_dns_request_a_response_cname_a_smtp_live_com_test.c b/test/regression/dns_test/netx_dns_request_a_response_cname_a_smtp_live_com_test.c new file mode 100644 index 00000000..b35819d2 --- /dev/null +++ b/test/regression/dns_test/netx_dns_request_a_response_cname_a_smtp_live_com_test.c @@ -0,0 +1,433 @@ +/* This NetX test concentrates on the basic DNS operation. Request: smtp.live.com A, Response: CNAME + A*/ + +/* +Frame 4: 294 bytes on wire (2352 bits), 294 bytes captured (2352 bits) on interface 0 +Ethernet II, Src: IntelCor_0e:3d:f4 (00:1b:21:0e:3d:f4), Dst: Lantroni_98:00:26 (00:80:a3:98:00:26) +Internet Protocol Version 4, Src: 172.19.1.1, Dst: 172.19.100.172 +User Datagram Protocol, Src Port: 53 (53), Dst Port: 30005 (30005) +Domain Name System (response) + [Request In: 3] + [Time: 0.000331000 seconds] + Transaction ID: 0x486a + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 2 + Authority RRs: 4 + Additional RRs: 4 + Queries + smtp.live.com: type A, class IN + Answers + smtp.live.com: type CNAME, class IN, cname smtp.glbdns2.microsoft.com + Name: smtp.live.com + Type: CNAME (Canonical NAME for an alias) (5) + Class: IN (0x0001) + Time to live: 3000 + Data length: 25 + CNAME: smtp.glbdns2.microsoft.com + smtp.glbdns2.microsoft.com: type A, class IN, addr 65.55.163.152 + Name: smtp.glbdns2.microsoft.com + Type: A (Host Address) (1) + Class: IN (0x0001) + Time to live: 16 + Data length: 4 + Address: 65.55.163.152 + Authoritative nameservers + microsoft.com: type NS, class IN, ns ns3.msft.net + microsoft.com: type NS, class IN, ns ns4.msft.net + microsoft.com: type NS, class IN, ns ns1.msft.net + microsoft.com: type NS, class IN, ns ns2.msft.net + Additional records + ns2.msft.net: type A, class IN, addr 208.84.2.53 + ns2.msft.net: type AAAA, class IN, addr 2620:0:32::53 + ns4.msft.net: type A, class IN, addr 208.76.45.53 + ns4.msft.net: type AAAA, class IN, addr 2620:0:37::53 + +*/ + +/* Frame (294 bytes) */ +char response_cname_a[294] = { +0x00, 0x80, 0xa3, 0x98, 0x00, 0x26, 0x00, 0x1b, /* .....&.. */ +0x21, 0x0e, 0x3d, 0xf4, 0x08, 0x00, 0x45, 0x00, /* !.=...E. */ +0x01, 0x18, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, /* ....@.@. */ +0x7c, 0x01, 0xac, 0x13, 0x01, 0x01, 0xac, 0x13, /* |....... */ +0x64, 0xac, 0x00, 0x35, 0x75, 0x35, 0x01, 0x04, /* d..5u5.. */ +0xdc, 0xb6, 0x48, 0x6a, 0x81, 0x80, 0x00, 0x01, /* ..Hj.... */ +0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x04, 0x73, /* .......s */ +0x6d, 0x74, 0x70, 0x04, 0x6c, 0x69, 0x76, 0x65, /* mtp.live */ +0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, /* .com.... */ +0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x0b, 0xb8, 0x00, 0x19, 0x04, 0x73, 0x6d, /* ......sm */ +0x74, 0x70, 0x07, 0x67, 0x6c, 0x62, 0x64, 0x6e, /* tp.glbdn */ +0x73, 0x32, 0x09, 0x6d, 0x69, 0x63, 0x72, 0x6f, /* s2.micro */ +0x73, 0x6f, 0x66, 0x74, 0xc0, 0x16, 0xc0, 0x2b, /* soft...+ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, /* ........ */ +0x00, 0x04, 0x41, 0x37, 0xa3, 0x98, 0xc0, 0x38, /* ..A7...8 */ +0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28, 0x8b, /* ......(. */ +0x00, 0x0e, 0x03, 0x6e, 0x73, 0x33, 0x04, 0x6d, /* ...ns3.m */ +0x73, 0x66, 0x74, 0x03, 0x6e, 0x65, 0x74, 0x00, /* sft.net. */ +0xc0, 0x38, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, /* .8...... */ +0x28, 0x8b, 0x00, 0x06, 0x03, 0x6e, 0x73, 0x34, /* (....ns4 */ +0xc0, 0x64, 0xc0, 0x38, 0x00, 0x02, 0x00, 0x01, /* .d.8.... */ +0x00, 0x00, 0x28, 0x8b, 0x00, 0x06, 0x03, 0x6e, /* ..(....n */ +0x73, 0x31, 0xc0, 0x64, 0xc0, 0x38, 0x00, 0x02, /* s1.d.8.. */ +0x00, 0x01, 0x00, 0x00, 0x28, 0x8b, 0x00, 0x06, /* ....(... */ +0x03, 0x6e, 0x73, 0x32, 0xc0, 0x64, 0xc0, 0x9e, /* .ns2.d.. */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x63, 0x63, /* ......cc */ +0x00, 0x04, 0xd0, 0x54, 0x02, 0x35, 0xc0, 0x9e, /* ...T.5.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x01, 0x63, 0x63, /* ......cc */ +0x00, 0x10, 0x26, 0x20, 0x00, 0x00, 0x00, 0x32, /* ..& ...2 */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x53, 0xc0, 0x7a, 0x00, 0x01, 0x00, 0x01, /* .S.z.... */ +0x00, 0x00, 0x1d, 0x92, 0x00, 0x04, 0xd0, 0x4c, /* .......L */ +0x2d, 0x35, 0xc0, 0x7a, 0x00, 0x1c, 0x00, 0x01, /* -5.z.... */ +0x00, 0x00, 0x1d, 0x92, 0x00, 0x10, 0x26, 0x20, /* ......& */ +0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, /* ...7.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x53 /* .....S */ +}; + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_UDP_SOCKET server_socket; + +static NX_DNS client_dns; + +#define DNS_SERVER_ADDRESS IP_ADDRESS(172,19,1,1) + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_request_a_response_cname_a_smtp_live_com_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(172, 19, 100, 172), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(172, 19, 1, 1), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +NXD_ADDRESS ip_address; + + /* Test the A type with the new API,(google.com.) */ + /* Print out some test information banners. */ + printf("NetX Test: DNS Request A Response CNAME+A smtp.live.com Test........."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, DNS_SERVER_ADDRESS); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Secd dns query, and record the single host ip address. */ + status = nxd_dns_host_by_name_get(&client_dns, (UCHAR *)"smtp.live.com", &ip_address, 4 * NX_IP_PERIODIC_RATE, NX_IP_VERSION_V4); + + /* Check status and compare the host ip address. */ + if (status || (ip_address.nxd_ip_address.v4 != IP_ADDRESS(65, 55, 163, 152))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; +NX_PACKET *response_packet; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Act as the DNS server to receive the DNS query and send the DNS response. */ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_cname_a + DNS_START_OFFSET, sizeof(response_cname_a) - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = sizeof(response_cname_a) - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet, IP_ADDRESS(172, 19, 100, 172), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + return; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_request_a_response_cname_a_smtp_live_com_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Request A Response CNAME+A smtp.live.com Test.........N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/netx_dns_source_port_test.c b/test/regression/dns_test/netx_dns_source_port_test.c new file mode 100644 index 00000000..888f5182 --- /dev/null +++ b/test/regression/dns_test/netx_dns_source_port_test.c @@ -0,0 +1,375 @@ +/* This NetX test concentrates on the basic DNS operation. Non-blocking test. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dns.h" +#else +#include "nx_dns.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#ifndef NX_DISABLE_IPV4 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP client_ip; +static NX_IP server_ip; + +static NX_UDP_SOCKET server_socket; +static NX_DNS client_dns; + + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL +NX_PACKET_POOL client_pool; +#endif + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static UINT dns_query_port_1 = 0; +static UINT dns_query_port_2 = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define DNS_START_OFFSET (14 + 20 + 8) + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_source_port_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the DNS main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 8192); + pointer = pointer + 8192; + +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Create the packet pool for the DNS Client to send packets. + + If the DNS Client is configured for letting the host application create + the DNS packet pool, (see NX_DNS_CLIENT_USER_CREATE_PACKET_POOL option), see + nx_dns_create() for guidelines on packet payload size and pool size. + packet traffic for NetX Duo processes. + */ + status = nx_packet_pool_create(&client_pool, "DNS Client Packet Pool", NX_DNS_PACKET_PAYLOAD, pointer, NX_DNS_PACKET_POOL_SIZE); + + pointer = pointer + NX_DNS_PACKET_POOL_SIZE; + + /* Check for pool creation error. */ + if (status) + return; +#endif + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "NetX IP Instance 0", IP_ADDRESS(192, 168, 100, 98), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "NetX IP Instance 1", IP_ADDRESS(192, 168, 100, 2), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&client_ip); + status += nx_udp_enable(&server_ip); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UCHAR record_buffer[64]; +UINT record_count; + + /* Print out some test information banners. */ + printf("NetX Test: DNS Source Port Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a DNS instance for the Client. Note this function will create + the DNS Client packet pool for creating DNS message packets intended + for querying its DNS server. */ + status = nx_dns_create(&client_dns, &client_ip, (UCHAR *)"DNS Client"); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Is the DNS client configured for the host application to create the pecket pool? */ +#ifdef NX_DNS_CLIENT_USER_CREATE_PACKET_POOL + + /* Yes, use the packet pool created above which has appropriate payload size + for DNS messages. */ + status = nx_dns_packet_pool_set(&client_dns, &client_pool); + + /* Check for set DNS packet pool error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif /* NX_DNS_CLIENT_USER_CREATE_PACKET_POOL */ + + /* Add an IPv4 server address to the Client list. */ + status = nx_dns_server_add(&client_dns, IP_ADDRESS(192, 168, 100, 2)); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send query. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send query again. */ + status = nx_dns_ipv4_address_by_name_get(&client_dns, (UCHAR *)"google.com", &record_buffer[0], 64, &record_count, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the port. */ + if (dns_query_port_1 == dns_query_port_2) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +extern char response_a_google_com_pkt[]; +extern int response_a_google_com_pkt_size; + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT port; +USHORT nx_dns_transmit_id; +UCHAR *data_ptr; +NX_PACKET *response_packet; + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&server_socket, 53, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + for (UINT i = 0; i < 2; i++) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Get the DNS client UDP port. */ + status = nx_udp_packet_info_extract(my_packet, NX_NULL, NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + if (i == 0) + { + dns_query_port_1 = port; + } + else + { + dns_query_port_2 = port; + } + + /* Get the DNS transmit ID. */ + data_ptr = my_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + nx_dns_transmit_id = *data_ptr++; + nx_dns_transmit_id = (USHORT)((nx_dns_transmit_id << 8) | *data_ptr); + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the DNS response packet. */ + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_a_google_com_pkt + DNS_START_OFFSET, response_a_google_com_pkt_size - DNS_START_OFFSET); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = response_a_google_com_pkt_size - DNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Update the DNS transmit ID. */ + data_ptr = response_packet -> nx_packet_prepend_ptr + NX_DNS_ID_OFFSET; + *data_ptr++ = (UCHAR)(nx_dns_transmit_id >> 8); + *data_ptr = (UCHAR)nx_dns_transmit_id; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(&server_socket, response_packet, IP_ADDRESS(192, 168, 100, 98), port); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + return; + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Let the DNS threads execute. */ + tx_thread_relinquish(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dns_source_port_test_application_define(void *first_unused_memory) +#endif + +{ + + /* Print out test information banner. */ + printf("NetX Test: DNS Source Port Test......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/dns_test/response_a_berkley_edu.c b/test/regression/dns_test/response_a_berkley_edu.c new file mode 100644 index 00000000..5aad00bb --- /dev/null +++ b/test/regression/dns_test/response_a_berkley_edu.c @@ -0,0 +1,44 @@ +/* +No. Time Source Destination Protocol Length Info + 130 168.629156 192.2.2.1 192.2.2.240 DNS 88 Standard query response 0x0002 A 169.229.216.200 + +Frame 130: 88 bytes on wire (704 bits), 88 bytes captured (704 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: Dell_8e:ec:b5 (d4:be:d9:8e:ec:b5) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.240 (192.2.2.240) +User Datagram Protocol, Src Port: domain (53), Dst Port: 55271 (55271) +Domain Name System (response) + [Request In: 129] + [Time: 0.000138000 seconds] + Transaction ID: 0x0002 + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 1 + Authority RRs: 0 + Additional RRs: 0 + Queries + Answers + berkeley.edu: type A, class IN, addr 169.229.216.200 + Name: berkeley.edu + Type: A (Host address) + Class: IN (0x0001) + Time to live: 4 minutes, 59 seconds + Data length: 4 + Addr: 169.229.216.200 (169.229.216.200) +*/ + +/* Frame (88 bytes) */ +char response_a_berkley_edu_pkt[88] = { +0xd4, 0xbe, 0xd9, 0x8e, 0xec, 0xb5, 0x00, 0xe0, /* ........ */ +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* .Ez...E. */ +0x00, 0x4a, 0x4d, 0xc2, 0x00, 0x00, 0x80, 0x11, /* .JM..... */ +0x67, 0xeb, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* g....... */ +0x02, 0xf0, 0x00, 0x35, 0xd7, 0xe7, 0x00, 0x36, /* ...5...6 */ +0x43, 0xf5, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, /* C....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x62, /* .......b */ +0x65, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x79, 0x03, /* erkeley. */ +0x65, 0x64, 0x75, 0x00, 0x00, 0x01, 0x00, 0x01, /* edu..... */ +0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x01, 0x2b, 0x00, 0x04, 0xa9, 0xe5, 0xd8, 0xc8 /* .+...... */ +}; + +int response_a_berkley_edu_pkt_size = 88; diff --git a/test/regression/dns_test/response_a_cname_www_npr_org.c b/test/regression/dns_test/response_a_cname_www_npr_org.c new file mode 100644 index 00000000..25e09ea7 --- /dev/null +++ b/test/regression/dns_test/response_a_cname_www_npr_org.c @@ -0,0 +1,57 @@ +/* +No. Time Source Destination Protocol Length Info +8 1.404839 192.2.2.1 192.2.2.66 DNS 119 Yes Standard query response 0x261c CNAME www.npr.cotcdb.net A 216.35.221.76 + +Frame 8: 119 bytes on wire (952 bits), 119 bytes captured (952 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: 00:cf:54:85:c3:01 (00:cf:54:85:c3:01) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.66 (192.2.2.66) +User Datagram Protocol, Src Port: domain (53), Dst Port: 30000 (30000) +Domain Name System (response) + Request In: 5 + Time: 0.010296000 seconds + Transaction ID: 0x261c + Flags: 0x8180 (Standard query response, No error) + Questions: 1 + Answer RRs: 2 + Authority RRs: 0 + Additional RRs: 0 + Queries + www.npr.org: type A, class IN + Name: www.npr.org + Type: A (Host address) + Class: IN (0x0001) + Answers + www.npr.org: type CNAME, class IN, cname www.npr.cotcdb.net + Name: www.npr.org + Type: CNAME (Canonical name for an alias) + Class: IN (0x0001) + Time to live: 49 seconds + Data length: 20 + Primaryname: www.npr.cotcdb.net + www.npr.cotcdb.net: type A, class IN, addr 216.35.221.76 + Name: www.npr.cotcdb.net + Type: A (Host address) + Class: IN (0x0001) + Time to live: 1 minute, 22 seconds + Data length: 4 + Addr: 216.35.221.76 (216.35.221.76) +*/ + +char response_a_cname_www_npr_org_pkt[119] = { +0x00, 0xcf, 0x54, 0x85, 0xc3, 0x01, 0x00, 0xe0, +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, +0x00, 0x69, 0x7c, 0xa7, 0x00, 0x00, 0x80, 0x11, +0x39, 0x95, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, +0x02, 0x42, 0x00, 0x35, 0x75, 0x30, 0x00, 0x55, +0x39, 0x0f, 0x26, 0x1c, 0x81, 0x80, 0x00, 0x01, +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, +0x77, 0x77, 0x03, 0x6e, 0x70, 0x72, 0x03, 0x6f, +0x72, 0x67, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, +0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, +0x31, 0x00, 0x14, 0x03, 0x77, 0x77, 0x77, 0x03, +0x6e, 0x70, 0x72, 0x06, 0x63, 0x6f, 0x74, 0x63, +0x64, 0x62, 0x03, 0x6e, 0x65, 0x74, 0x00, 0xc0, +0x29, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, +0x52, 0x00, 0x04, 0xd8, 0x23, 0xdd, 0x4c }; + +int response_a_cname_www_npr_org_pkt_size = sizeof(response_a_cname_www_npr_org_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_a_google_com.c b/test/regression/dns_test/response_a_google_com.c new file mode 100644 index 00000000..bfd547be --- /dev/null +++ b/test/regression/dns_test/response_a_google_com.c @@ -0,0 +1,134 @@ +/* +No. Time Source Destination Protocol Length Info + 54 82.002033 192.2.2.1 192.2.2.240 DNS 246 Standard query response 0x0002 A 74.125.224.194 A 74.125.224.195 A 74.125.224.196 A 74.125.224.197 A 74.125.224.198 A 74.125.224.199 A 74.125.224.200 A 74.125.224.201 A 74.125.224.206 A 74.125.224.192 A 74.125.224.193 + +Frame 54: 246 bytes on wire (1968 bits), 246 bytes captured (1968 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: Dell_8e:ec:b5 (d4:be:d9:8e:ec:b5) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.240 (192.2.2.240) +User Datagram Protocol, Src Port: domain (53), Dst Port: 52427 (52427) +Domain Name System (response) + [Request In: 53] + [Time: 0.015609000 seconds] + Transaction ID: 0x0002 + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 11 + Authority RRs: 0 + Additional RRs: 0 + Queries + Answers + google.com: type A, class IN, addr 74.125.224.194 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.194 (74.125.224.194) + google.com: type A, class IN, addr 74.125.224.195 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.195 (74.125.224.195) + google.com: type A, class IN, addr 74.125.224.196 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.196 (74.125.224.196) + google.com: type A, class IN, addr 74.125.224.197 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.197 (74.125.224.197) + google.com: type A, class IN, addr 74.125.224.198 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.198 (74.125.224.198) + google.com: type A, class IN, addr 74.125.224.199 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.199 (74.125.224.199) + google.com: type A, class IN, addr 74.125.224.200 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.200 (74.125.224.200) + google.com: type A, class IN, addr 74.125.224.201 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.201 (74.125.224.201) + google.com: type A, class IN, addr 74.125.224.206 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.206 (74.125.224.206) + google.com: type A, class IN, addr 74.125.224.192 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.192 (74.125.224.192) + google.com: type A, class IN, addr 74.125.224.193 + Name: google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 2 minutes, 22 seconds + Data length: 4 + Addr: 74.125.224.193 (74.125.224.193) +*/ + +/* Frame (246 bytes) */ +char response_a_google_com_pkt[246] = { +0xd4, 0xbe, 0xd9, 0x8e, 0xec, 0xb5, 0x00, 0xe0, /* ........ */ +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* .Ez...E. */ +0x00, 0xe8, 0x4b, 0x83, 0x00, 0x00, 0x80, 0x11, /* ..K..... */ +0x69, 0x8c, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* i....... */ +0x02, 0xf0, 0x00, 0x35, 0xcc, 0xcb, 0x00, 0xd4, /* ...5.... */ +0xf5, 0x39, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, /* .9...... */ +0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, /* .......g */ +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, /* oogle.co */ +0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, 0x0c, /* m....... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc2, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc3, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc4, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc5, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc6, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc7, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc8, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc9, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xce, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc0, 0xc0, 0x0c, /* ..J}.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, /* ........ */ +0x00, 0x04, 0x4a, 0x7d, 0xe0, 0xc1 /* ..J}.. */ +}; + +int response_a_google_com_pkt_size = 246; diff --git a/test/regression/dns_test/response_aaaa_berkley_edu.c b/test/regression/dns_test/response_aaaa_berkley_edu.c new file mode 100644 index 00000000..374a5dbc --- /dev/null +++ b/test/regression/dns_test/response_aaaa_berkley_edu.c @@ -0,0 +1,46 @@ +/* +No. Time Source Destination Protocol Length Info + 132 168.635407 192.2.2.1 192.2.2.240 DNS 100 Standard query response 0x0003 AAAA 2607:f140:0:81::f + +Frame 132: 100 bytes on wire (800 bits), 100 bytes captured (800 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: Dell_8e:ec:b5 (d4:be:d9:8e:ec:b5) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.240 (192.2.2.240) +User Datagram Protocol, Src Port: domain (53), Dst Port: 55272 (55272) +Domain Name System (response) + [Request In: 131] + [Time: 0.000208000 seconds] + Transaction ID: 0x0003 + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 1 + Authority RRs: 0 + Additional RRs: 0 + Queries + Answers + berkeley.edu: type AAAA, class IN, addr 2607:f140:0:81::f + Name: berkeley.edu + Type: AAAA (IPv6 address) + Class: IN (0x0001) + Time to live: 59 minutes, 53 seconds + Data length: 16 + Addr: 2607:f140:0:81::f +*/ + +/* Frame (100 bytes) */ +char response_aaaa_berkley_edu_pkt[100] = { +0xd4, 0xbe, 0xd9, 0x8e, 0xec, 0xb5, 0x00, 0xe0, /* ........ */ +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* .Ez...E. */ +0x00, 0x56, 0x4d, 0xc3, 0x00, 0x00, 0x80, 0x11, /* .VM..... */ +0x67, 0xde, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* g....... */ +0x02, 0xf0, 0x00, 0x35, 0xd7, 0xe8, 0x00, 0x42, /* ...5...B */ +0xa1, 0x91, 0x00, 0x03, 0x81, 0x80, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x62, /* .......b */ +0x65, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x79, 0x03, /* erkeley. */ +0x65, 0x64, 0x75, 0x00, 0x00, 0x1c, 0x00, 0x01, /* edu..... */ +0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x0e, 0x09, 0x00, 0x10, 0x26, 0x07, 0xf1, 0x40, /* ....&..@ */ +0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x0f /* .... */ +}; + +int response_aaaa_berkley_edu_pkt_size = 100; diff --git a/test/regression/dns_test/response_cname_mail_baidu_com.c b/test/regression/dns_test/response_cname_mail_baidu_com.c new file mode 100644 index 00000000..6b24affc --- /dev/null +++ b/test/regression/dns_test/response_cname_mail_baidu_com.c @@ -0,0 +1,48 @@ +/* +No. Time Source Destination Protocol Length Info +165 19.285254000 192.168.0.1 192.168.0.105 DNS 100 Standard query response 0x0002 CNAME www.a.shifen.com + +Frame 165: 100 bytes on wire (800 bits), 100 bytes captured (800 bits) +Ethernet II, Src: TendaTec_60:4b:46 (c8:3a:35:60:4b:46), Dst: Dell_33:c1:bd (18:03:73:33:c1:bd) +Internet Protocol Version 4, Src: 192.168.0.1 (192.168.0.1), Dst: 192.168.0.105 (192.168.0.105) +User Datagram Protocol, Src Port: domain (53), Dst Port: 50976 (50976) +Domain Name System (response) + Request In: 164 + Time: 0.036077000 seconds + Transaction ID: 0x0002 + Flags: 0x8180 (Standard query response, No error) + Questions: 1 + Answer RRs: 1 + Authority RRs: 0 + Additional RRs: 0 + Queries + www.baidu.com: type CNAME, class IN + Name: www.baidu.com + Type: CNAME (Canonical name for an alias) + Class: IN (0x0001) + Answers + www.baidu.com: type CNAME, class IN, cname www.a.shifen.com + Name: www.baidu.com + Type: CNAME (Canonical name for an alias) + Class: IN (0x0001) + Time to live: 8 minutes, 7 seconds + Data length: 15 + Primaryname: www.a.shifen.com +*/ + +char response_cname_www_baidu_com_pkt[100] = { +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x00, 0x56, 0xa6, 0x10, 0x00, 0x00, 0x40, 0x11, +0x52, 0xcc, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xc7, 0x20, 0x00, 0x42, +0x1b, 0x3d, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, +0x77, 0x77, 0x05, 0x62, 0x61, 0x69, 0x64, 0x75, +0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x05, 0x00, +0x01, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, +0x00, 0x01, 0xe7, 0x00, 0x0f, 0x03, 0x77, 0x77, +0x77, 0x01, 0x61, 0x06, 0x73, 0x68, 0x69, 0x66, +0x65, 0x6e, 0xc0, 0x16 }; + +int response_cname_www_baidu_com_pkt_size = sizeof(response_cname_www_baidu_com_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_mx_a_berkley_edu.c b/test/regression/dns_test/response_mx_a_berkley_edu.c new file mode 100644 index 00000000..a514649a --- /dev/null +++ b/test/regression/dns_test/response_mx_a_berkley_edu.c @@ -0,0 +1,57 @@ +/* +No. Time Source Destination Protocol Length Info + 108 142.849657 192.2.2.1 192.2.2.240 DNS 107 Standard query response 0x0002 MX 10 mx.berkeley.edu + +Frame 108: 107 bytes on wire (856 bits), 107 bytes captured (856 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: Dell_8e:ec:b5 (d4:be:d9:8e:ec:b5) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.240 (192.2.2.240) +User Datagram Protocol, Src Port: domain (53), Dst Port: 50825 (50825) +Domain Name System (response) + [Request In: 107] + [Time: 0.000166000 seconds] + Transaction ID: 0x0002 + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 1 + Authority RRs: 0 + Additional RRs: 1 + Queries + Answers + berkeley.edu: type MX, class IN, preference 10, mx mx.berkeley.edu + Name: berkeley.edu + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 59 minutes, 53 seconds + Data length: 7 + Preference: 10 + Mail exchange: mx.berkeley.edu + Additional records + mx.berkeley.edu: type A, class IN, addr 169.229.218.141 + Name: mx.berkeley.edu + Type: A (Host address) + Class: IN (0x0001) + Time to live: 59 minutes, 57 seconds + Data length: 4 + Addr: 169.229.218.141 (169.229.218.141) + +*/ + +/* Frame (107 bytes) */ +char response_mx_a_berkley_edu_pkt[107] = { +0xd4, 0xbe, 0xd9, 0x8e, 0xec, 0xb5, 0x00, 0xe0, /* ........ */ +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* .Ez...E. */ +0x00, 0x5d, 0x4d, 0x47, 0x00, 0x00, 0x80, 0x11, /* .]MG.... */ +0x68, 0x53, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* hS...... */ +0x02, 0xf0, 0x00, 0x35, 0xc6, 0x89, 0x00, 0x49, /* ...5...I */ +0x90, 0x53, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, /* .S...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x62, /* .......b */ +0x65, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x79, 0x03, /* erkeley. */ +0x65, 0x64, 0x75, 0x00, 0x00, 0x0f, 0x00, 0x01, /* edu..... */ +0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x0e, 0x09, 0x00, 0x07, 0x00, 0x0a, 0x02, 0x6d, /* .......m */ +0x78, 0xc0, 0x0c, 0xc0, 0x2c, 0x00, 0x01, 0x00, /* x...,... */ +0x01, 0x00, 0x00, 0x0e, 0x0d, 0x00, 0x04, 0xa9, /* ........ */ +0xe5, 0xda, 0x8d /* ... */ +}; + +int response_mx_a_berkley_edu_pkt_size = 107; \ No newline at end of file diff --git a/test/regression/dns_test/response_mx_a_google_com.c b/test/regression/dns_test/response_mx_a_google_com.c new file mode 100644 index 00000000..67191ca5 --- /dev/null +++ b/test/regression/dns_test/response_mx_a_google_com.c @@ -0,0 +1,135 @@ +/* +No. Time Source Destination Protocol Length Info + 50 57.439998 192.2.2.1 192.2.2.240 DNS 258 Standard query response 0x0003 MX 20 alt1.aspmx.l.google.com MX 30 alt2.aspmx.l.google.com MX 40 alt3.aspmx.l.google.com MX 50 alt4.aspmx.l.google.com MX 10 aspmx.l.google.com + +Frame 50: 258 bytes on wire (2064 bits), 258 bytes captured (2064 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: Dell_8e:ec:b5 (d4:be:d9:8e:ec:b5) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.240 (192.2.2.240) +User Datagram Protocol, Src Port: domain (53), Dst Port: 52423 (52423) +Domain Name System (response) + [Request In: 49] + [Time: 0.221586000 seconds] + Transaction ID: 0x0003 + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 5 + Authority RRs: 0 + Additional RRs: 5 + Queries + Answers + google.com: type MX, class IN, preference 20, mx alt1.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 9 minutes, 59 seconds + Data length: 17 + Preference: 20 + Mail exchange: alt1.aspmx.l.google.com + google.com: type MX, class IN, preference 30, mx alt2.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 9 minutes, 59 seconds + Data length: 9 + Preference: 30 + Mail exchange: alt2.aspmx.l.google.com + google.com: type MX, class IN, preference 40, mx alt3.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 9 minutes, 59 seconds + Data length: 9 + Preference: 40 + Mail exchange: alt3.aspmx.l.google.com + google.com: type MX, class IN, preference 50, mx alt4.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 9 minutes, 59 seconds + Data length: 9 + Preference: 50 + Mail exchange: alt4.aspmx.l.google.com + google.com: type MX, class IN, preference 10, mx aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 9 minutes, 59 seconds + Data length: 4 + Preference: 10 + Mail exchange: aspmx.l.google.com + Additional records + alt1.aspmx.l.google.com: type A, class IN, addr 209.85.225.26 + Name: alt1.aspmx.l.google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 1 minute, 50 seconds + Data length: 4 + Addr: 209.85.225.26 (209.85.225.26) + alt2.aspmx.l.google.com: type A, class IN, addr 74.125.130.26 + Name: alt2.aspmx.l.google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 30 seconds + Data length: 4 + Addr: 74.125.130.26 (74.125.130.26) + alt3.aspmx.l.google.com: type A, class IN, addr 173.194.76.26 + Name: alt3.aspmx.l.google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 4 minutes, 53 seconds + Data length: 4 + Addr: 173.194.76.26 (173.194.76.26) + alt4.aspmx.l.google.com: type A, class IN, addr 173.194.73.26 + Name: alt4.aspmx.l.google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 4 minutes, 53 seconds + Data length: 4 + Addr: 173.194.73.26 (173.194.73.26) + aspmx.l.google.com: type A, class IN, addr 173.194.79.26 + Name: aspmx.l.google.com + Type: A (Host address) + Class: IN (0x0001) + Time to live: 4 minutes, 52 seconds + Data length: 4 + Addr: 173.194.79.26 (173.194.79.26) +*/ + +/* Frame (258 bytes) */ +char response_mx_a_google_com_pkt[258] = { +0xd4, 0xbe, 0xd9, 0x8e, 0xec, 0xb5, 0x00, 0xe0, /* ........ */ +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, /* .Ez...E. */ +0x00, 0xf4, 0x4a, 0x8d, 0x00, 0x00, 0x80, 0x11, /* ..J..... */ +0x6a, 0x76, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* jv...... */ +0x02, 0xf0, 0x00, 0x35, 0xcc, 0xc7, 0x00, 0xe0, /* ...5.... */ +0x30, 0x39, 0x00, 0x03, 0x81, 0x80, 0x00, 0x01, /* 09...... */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x06, 0x67, /* .......g */ +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, /* oogle.co */ +0x6d, 0x00, 0x00, 0x0f, 0x00, 0x01, 0xc0, 0x0c, /* m....... */ +0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x57, /* .......W */ +0x00, 0x11, 0x00, 0x14, 0x04, 0x61, 0x6c, 0x74, /* .....alt */ +0x31, 0x05, 0x61, 0x73, 0x70, 0x6d, 0x78, 0x01, /* 1.aspmx. */ +0x6c, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0f, 0x00, /* l....... */ +0x01, 0x00, 0x00, 0x02, 0x57, 0x00, 0x09, 0x00, /* ....W... */ +0x1e, 0x04, 0x61, 0x6c, 0x74, 0x32, 0xc0, 0x2f, /* ..alt2./ */ +0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x02, 0x57, 0x00, 0x09, 0x00, 0x28, 0x04, 0x61, /* .W...(.a */ +0x6c, 0x74, 0x33, 0xc0, 0x2f, 0xc0, 0x0c, 0x00, /* lt3./... */ +0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x57, 0x00, /* ......W. */ +0x09, 0x00, 0x32, 0x04, 0x61, 0x6c, 0x74, 0x34, /* ..2.alt4 */ +0xc0, 0x2f, 0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, /* ./...... */ +0x00, 0x00, 0x02, 0x57, 0x00, 0x04, 0x00, 0x0a, /* ...W.... */ +0xc0, 0x2f, 0xc0, 0x2a, 0x00, 0x01, 0x00, 0x01, /* ./.*.... */ +0x00, 0x00, 0x00, 0x6e, 0x00, 0x04, 0xd1, 0x55, /* ...n...U */ +0xe1, 0x1a, 0xc0, 0x47, 0x00, 0x01, 0x00, 0x01, /* ...G.... */ +0x00, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x4a, 0x7d, /* ......J} */ +0x82, 0x1a, 0xc0, 0x5c, 0x00, 0x01, 0x00, 0x01, /* ...\.... */ +0x00, 0x00, 0x01, 0x25, 0x00, 0x04, 0xad, 0xc2, /* ...%.... */ +0x4c, 0x1a, 0xc0, 0x71, 0x00, 0x01, 0x00, 0x01, /* L..q.... */ +0x00, 0x00, 0x01, 0x25, 0x00, 0x04, 0xad, 0xc2, /* ...%.... */ +0x49, 0x1a, 0xc0, 0x86, 0x00, 0x01, 0x00, 0x01, /* I....... */ +0x00, 0x00, 0x01, 0x24, 0x00, 0x04, 0xad, 0xc2, /* ...$.... */ +0x4f, 0x1a /* O. */ +}; + +int response_mx_a_google_com_pkt_size = 258; diff --git a/test/regression/dns_test/response_mx_google_com.c b/test/regression/dns_test/response_mx_google_com.c new file mode 100644 index 00000000..c1996ac6 --- /dev/null +++ b/test/regression/dns_test/response_mx_google_com.c @@ -0,0 +1,89 @@ +/* +No. Time Source Destination Protocol Length Info +42 2.441991000 192.168.0.1 192.168.0.105 DNS 178 Standard query response 0x0002 MX 40 alt3.aspmx.l.google.com MX 30 alt2.aspmx.l.google.com MX 10 aspmx.l.google.com MX 20 alt1.aspmx.l.google.com MX 50 alt4.aspmx.l.google.com + +Frame 171: 178 bytes on wire (1424 bits), 178 bytes captured (1424 bits) +Ethernet II, Src: TendaTec_60:4b:46 (c8:3a:35:60:4b:46), Dst: Dell_33:c1:bd (18:03:73:33:c1:bd) +Internet Protocol Version 4, Src: 192.168.0.1 (192.168.0.1), Dst: 192.168.0.105 (192.168.0.105) +User Datagram Protocol, Src Port: domain (53), Dst Port: 53738 (53738) +Domain Name System (response) + Request In: 164 + Time: 0.037374000 seconds + Transaction ID: 0x0002 + Flags: 0x8180 (Standard query response, No error) + Questions: 1 + Answer RRs: 5 + Authority RRs: 0 + Additional RRs: 0 + Queries + google.com: type MX, class IN + Answers + google.com: type MX, class IN, preference 50, mx alt4.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 10 minutes + Data length: 17 + Preference: 50 + Mail exchange: alt4.aspmx.l.google.com + google.com: type MX, class IN, preference 30, mx alt2.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 10 minutes + Data length: 9 + Preference: 30 + Mail exchange: alt2.aspmx.l.google.com + google.com: type MX, class IN, preference 10, mx aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 10 minutes + Data length: 4 + Preference: 10 + Mail exchange: aspmx.l.google.com + google.com: type MX, class IN, preference 20, mx alt1.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 10 minutes + Data length: 9 + Preference: 20 + Mail exchange: alt1.aspmx.l.google.com + google.com: type MX, class IN, preference 40, mx alt3.aspmx.l.google.com + Name: google.com + Type: MX (Mail exchange) + Class: IN (0x0001) + Time to live: 10 minutes + Data length: 9 + Preference: 40 + Mail exchange: alt3.aspmx.l.google.com +*/ + +char response_mx_google_com_pkt[178] = { +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x00, 0xa4, 0x98, 0xa1, 0x00, 0x00, 0x40, 0x11, +0x5f, 0xed, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xd1, 0xea, 0x00, 0x90, +0x68, 0x6a, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, +0x6d, 0x00, 0x00, 0x0f, 0x00, 0x01, 0xc0, 0x0c, +0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, +0x00, 0x11, 0x00, 0x32, 0x04, 0x61, 0x6c, 0x74, +0x34, 0x05, 0x61, 0x73, 0x70, 0x6d, 0x78, 0x01, +0x6c, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0f, 0x00, +0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x09, 0x00, +0x1e, 0x04, 0x61, 0x6c, 0x74, 0x32, 0xc0, 0x2f, +0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, +0x02, 0x58, 0x00, 0x04, 0x00, 0x0a, 0xc0, 0x2f, +0xc0, 0x0c, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x00, +0x02, 0x58, 0x00, 0x09, 0x00, 0x14, 0x04, 0x61, +0x6c, 0x74, 0x31, 0xc0, 0x2f, 0xc0, 0x0c, 0x00, +0x0f, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, +0x09, 0x00, 0x28, 0x04, 0x61, 0x6c, 0x74, 0x33, +0xc0, 0x2f +}; + +int response_mx_google_com_pkt_size = sizeof(response_mx_google_com_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_ns_a_ti_com.c b/test/regression/dns_test/response_ns_a_ti_com.c new file mode 100644 index 00000000..bef59036 --- /dev/null +++ b/test/regression/dns_test/response_ns_a_ti_com.c @@ -0,0 +1,95 @@ +/* +No. Time Source Destination Protocol Length Info + 30 51.227025 192.2.2.1 192.2.2.240 DNS 349 Standard query response NS ns-d.pnap.net NS ns-b.pnap.net NS ns3.ti.com NS ns4.ti.com NS ns.ti.com NS ns2.ti.com NS ns-a.pnap.net NS ns-c.pnap.net + +Frame 30: 349 bytes on wire (2792 bits), 349 bytes captured (2792 bits) +Ethernet II, Src: TyanComp_45:7a:c6 (00:e0:81:45:7a:c6), Dst: Dell_8e:ec:b5 (d4:be:d9:8e:ec:b5) +Internet Protocol Version 4, Src: 192.2.2.1 (192.2.2.1), Dst: 192.2.2.240 (192.2.2.240) +User Datagram Protocol, Src Port: domain (53), Dst Port: 53051 (53051) +Domain Name System (response) + [Request In: 29] + [Time: 0.000192000 seconds] + Transaction ID: 0x0002 + Flags: 0x8180 (Standard query response, No error) + 1... .... .... .... = Response: Message is a response + .000 0... .... .... = Opcode: Standard query (0) + .... .0.. .... .... = Authoritative: Server is not an authority for domain + .... ..0. .... .... = Truncated: Message is not truncated + .... ...1 .... .... = Recursion desired: Do query recursively + .... .... 1... .... = Recursion available: Server can do recursive queries + .... .... .0.. .... = Z: reserved (0) + .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server + .... .... ...0 .... = Non-authenticated data: Unacceptable + .... .... .... 0000 = Reply code: No error (0) + Questions: 1 + Answer RRs: 8 + Authority RRs: 0 + Additional RRs: 8 + Queries + Answers + ti.com: type NS, class IN, ns ns-d.pnap.net + ti.com: type NS, class IN, ns ns-b.pnap.net + ti.com: type NS, class IN, ns ns3.ti.com + ti.com: type NS, class IN, ns ns4.ti.com + ti.com: type NS, class IN, ns ns.ti.com + ti.com: type NS, class IN, ns ns2.ti.com + ti.com: type NS, class IN, ns ns-a.pnap.net + ti.com: type NS, class IN, ns ns-c.pnap.net + Additional records + ns-d.pnap.net: type A, class IN, addr 64.95.61.36 + ns-b.pnap.net: type A, class IN, addr 64.94.123.36 + ns3.ti.com: type A, class IN, addr 198.47.26.150 + ns4.ti.com: type A, class IN, addr 198.47.26.151 + ns.ti.com: type A, class IN, addr 192.94.94.42 + ns2.ti.com: type A, class IN, addr 192.94.94.43 + ns-a.pnap.net: type A, class IN, addr 64.94.123.4 + ns-c.pnap.net: type A, class IN, addr 64.95.61.4 +*/ + +char response_ns_a_ti_com_pkt[349] = { +0xd4, 0xbe, 0xd9, 0x8e, 0xec, 0xb5, 0x00, 0xe0, +0x81, 0x45, 0x7a, 0xc6, 0x08, 0x00, 0x45, 0x00, +0x01, 0x4f, 0x0f, 0xb4, 0x00, 0x00, 0x80, 0x11, +0xa4, 0xf4, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, +0x02, 0xf0, 0x00, 0x35, 0xcf, 0x3b, 0x01, 0x3b, +0xe8, 0x68, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x02, 0x74, +0x69, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x02, +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, +0x00, 0x00, 0x78, 0x39, 0x00, 0x0f, 0x04, 0x6e, +0x73, 0x2d, 0x64, 0x04, 0x70, 0x6e, 0x61, 0x70, +0x03, 0x6e, 0x65, 0x74, 0x00, 0xc0, 0x0c, 0x00, +0x02, 0x00, 0x01, 0x00, 0x00, 0x78, 0x39, 0x00, +0x07, 0x04, 0x6e, 0x73, 0x2d, 0x62, 0xc0, 0x29, +0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, +0x78, 0x39, 0x00, 0x06, 0x03, 0x6e, 0x73, 0x33, +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, +0x00, 0x00, 0x78, 0x39, 0x00, 0x06, 0x03, 0x6e, +0x73, 0x34, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x02, +0x00, 0x01, 0x00, 0x00, 0x78, 0x39, 0x00, 0x05, +0x02, 0x6e, 0x73, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, +0x02, 0x00, 0x01, 0x00, 0x00, 0x78, 0x39, 0x00, +0x06, 0x03, 0x6e, 0x73, 0x32, 0xc0, 0x0c, 0xc0, +0x0c, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x78, +0x39, 0x00, 0x07, 0x04, 0x6e, 0x73, 0x2d, 0x61, +0xc0, 0x29, 0xc0, 0x0c, 0x00, 0x02, 0x00, 0x01, +0x00, 0x00, 0x78, 0x39, 0x00, 0x07, 0x04, 0x6e, +0x73, 0x2d, 0x63, 0xc0, 0x29, 0xc0, 0x24, 0x00, +0x01, 0x00, 0x01, 0x00, 0x00, 0x77, 0x7d, 0x00, +0x04, 0x40, 0x5f, 0x3d, 0x24, 0xc0, 0x3f, 0x00, +0x01, 0x00, 0x01, 0x00, 0x00, 0x96, 0x12, 0x00, +0x04, 0x40, 0x5e, 0x7b, 0x24, 0xc0, 0x52, 0x00, +0x01, 0x00, 0x01, 0x00, 0x01, 0x49, 0xf4, 0x00, +0x04, 0xc6, 0x2f, 0x1a, 0x96, 0xc0, 0x64, 0x00, +0x01, 0x00, 0x01, 0x00, 0x01, 0x49, 0xf4, 0x00, +0x04, 0xc6, 0x2f, 0x1a, 0x97, 0xc0, 0x76, 0x00, +0x01, 0x00, 0x01, 0x00, 0x01, 0x49, 0xf4, 0x00, +0x04, 0xc0, 0x5e, 0x5e, 0x2a, 0xc0, 0x87, 0x00, +0x01, 0x00, 0x01, 0x00, 0x01, 0x49, 0xf4, 0x00, +0x04, 0xc0, 0x5e, 0x5e, 0x2b, 0xc0, 0x99, 0x00, +0x01, 0x00, 0x01, 0x00, 0x00, 0x76, 0xe1, 0x00, +0x04, 0x40, 0x5e, 0x7b, 0x04, 0xc0, 0xac, 0x00, +0x01, 0x00, 0x01, 0x00, 0x00, 0x47, 0x46, 0x00, +0x04, 0x40, 0x5f, 0x3d, 0x04 }; + +int response_ns_a_ti_com_pkt_size = sizeof(response_ns_a_ti_com_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_soa_google_com.c b/test/regression/dns_test/response_soa_google_com.c new file mode 100644 index 00000000..0ef29260 --- /dev/null +++ b/test/regression/dns_test/response_soa_google_com.c @@ -0,0 +1,54 @@ +/* +No. Time Source Destination Protocol Length Info +18 4.207289000 192.168.0.1 192.168.0.105 DNS 120 Yes Standard query response 0x0002 SOA ns1.google.com + +Frame 18: 120 bytes on wire (960 bits), 120 bytes captured (960 bits) +Ethernet II, Src: TendaTec_60:4b:46 (c8:3a:35:60:4b:46), Dst: Dell_33:c1:bd (18:03:73:33:c1:bd) +Internet Protocol Version 4, Src: 192.168.0.1 (192.168.0.1), Dst: 192.168.0.105 (192.168.0.105) +User Datagram Protocol, Src Port: domain (53), Dst Port: 55808 (55808) +Domain Name System (response) + Request In: 17 + Time: 0.081002000 seconds + Transaction ID: 0x0002 + Flags: 0x8180 (Standard query response, No error) + Questions: 1 + Answer RRs: 1 + Authority RRs: 0 + Additional RRs: 0 + Queries + google.com: type SOA, class IN + Answers + google.com: type SOA, class IN, mname ns1.google.com + Name: google.com + Type: SOA (Start of zone of authority) + Class: IN (0x0001) + Time to live: 11 hours, 56 minutes, 51 seconds + Data length: 38 + Primary name server: ns1.google.com + Responsible authority's mailbox: dns-admin.google.com + Serial number: 2012090400 + Refresh interval: 2 hours + Retry interval: 30 minutes + Expiration limit: 14 days + Minimum TTL: 5 minutes +*/ + +char response_soa_google_com_pkt[120] = { +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x00, 0x6a, 0x5c, 0x34, 0x00, 0x00, 0x40, 0x11, +0x9c, 0x94, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xda, 0x00, 0x00, 0x56, +0x1b, 0x90, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, +0x6d, 0x00, 0x00, 0x06, 0x00, 0x01, 0xc0, 0x0c, +0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0xa8, 0x03, +0x00, 0x26, 0x03, 0x6e, 0x73, 0x31, 0xc0, 0x0c, +0x09, 0x64, 0x6e, 0x73, 0x2d, 0x61, 0x64, 0x6d, +0x69, 0x6e, 0xc0, 0x0c, 0x77, 0xee, 0x10, 0x20, +0x00, 0x00, 0x1c, 0x20, 0x00, 0x00, 0x07, 0x08, +0x00, 0x12, 0x75, 0x00, 0x00, 0x00, 0x01, 0x2c +}; + +int response_soa_google_com_pkt_size = sizeof(response_soa_google_com_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_srv_google_com.c b/test/regression/dns_test/response_srv_google_com.c new file mode 100644 index 00000000..d7427f90 --- /dev/null +++ b/test/regression/dns_test/response_srv_google_com.c @@ -0,0 +1,122 @@ +/* +No. Time Source Destination Protocol Length Info +10 2.964289000 192.168.0.1 192.168.0.105 DNS 293 Yes Standard query response 0x0002 SRV 5 0 5222 xmpp.l.google.com SRV 20 0 5222 alt3.xmpp.l.google.com SRV 20 0 5222 alt2.xmpp.l.google.com SRV 20 0 5222 alt4.xmpp.l.google.com SRV 20 0 5222 alt1.xmpp.l.google.com + +Frame 10: 293 bytes on wire (2344 bits), 293 bytes captured (2344 bits) +Ethernet II, Src: TendaTec_60:4b:46 (c8:3a:35:60:4b:46), Dst: Dell_33:c1:bd (18:03:73:33:c1:bd) +Internet Protocol Version 4, Src: 192.168.0.1 (192.168.0.1), Dst: 192.168.0.105 (192.168.0.105) +User Datagram Protocol, Src Port: domain (53), Dst Port: 49903 (49903) +Domain Name System (response) + Request In: 9 + Time: 0.064681000 seconds + Transaction ID: 0x0002 + Flags: 0x8180 (Standard query response, No error) + Questions: 1 + Answer RRs: 5 + Authority RRs: 0 + Additional RRs: 0 + Queries + _xmpp-client._tcp.google.com: type SRV, class IN + Answers + _xmpp-client._tcp.google.com: type SRV, class IN, priority 20, weight 0, port 5222, target alt3.xmpp.l.google.com + Service: xmpp-client + Protocol: tcp + Name: google.com + Type: SRV (Service location) + Class: IN (0x0001) + Time to live: 14 minutes, 33 seconds + Data length: 30 + Priority: 20 + Weight: 0 + Port: 5222 + Target: alt3.xmpp.l.google.com + _xmpp-client._tcp.google.com: type SRV, class IN, priority 20, weight 0, port 5222, target alt1.xmpp.l.google.com + Service: xmpp-client + Protocol: tcp + Name: google.com + Type: SRV (Service location) + Class: IN (0x0001) + Time to live: 14 minutes, 33 seconds + Data length: 30 + Priority: 20 + Weight: 0 + Port: 5222 + Target: alt1.xmpp.l.google.com + _xmpp-client._tcp.google.com: type SRV, class IN, priority 20, weight 0, port 5222, target alt4.xmpp.l.google.com + Service: xmpp-client + Protocol: tcp + Name: google.com + Type: SRV (Service location) + Class: IN (0x0001) + Time to live: 14 minutes, 33 seconds + Data length: 30 + Priority: 20 + Weight: 0 + Port: 5222 + Target: alt4.xmpp.l.google.com + _xmpp-client._tcp.google.com: type SRV, class IN, priority 5, weight 0, port 5222, target xmpp.l.google.com + Service: xmpp-client + Protocol: tcp + Name: google.com + Type: SRV (Service location) + Class: IN (0x0001) + Time to live: 14 minutes, 33 seconds + Data length: 25 + Priority: 5 + Weight: 0 + Port: 5222 + Target: xmpp.l.google.com + _xmpp-client._tcp.google.com: type SRV, class IN, priority 20, weight 0, port 5222, target alt2.xmpp.l.google.com + Service: xmpp-client + Protocol: tcp + Name: google.com + Type: SRV (Service location) + Class: IN (0x0001) + Time to live: 14 minutes, 33 seconds + Data length: 30 + Priority: 20 + Weight: 0 + Port: 5222 + Target: alt2.xmpp.l.google.com +*/ + +char response_srv_google_com_pkt[293] = { +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x01, 0x17, 0xbe, 0x7e, 0x00, 0x00, 0x40, 0x11, +0x39, 0x9d, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xe1, 0xf6, 0x01, 0x03, +0x6f, 0x26, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, +0x78, 0x6d, 0x70, 0x70, 0x2d, 0x63, 0x6c, 0x69, +0x65, 0x6e, 0x74, 0x04, 0x5f, 0x74, 0x63, 0x70, +0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, +0x63, 0x6f, 0x6d, 0x00, 0x00, 0x21, 0x00, 0x01, +0xc0, 0x0c, 0x00, 0x21, 0x00, 0x01, 0x00, 0x00, +0x03, 0x84, 0x00, 0x1e, 0x00, 0x14, 0x00, 0x00, +0x14, 0x66, 0x04, 0x61, 0x6c, 0x74, 0x33, 0x04, +0x78, 0x6d, 0x70, 0x70, 0x01, 0x6c, 0x06, 0x67, +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, +0x6d, 0x00, 0xc0, 0x0c, 0x00, 0x21, 0x00, 0x01, +0x00, 0x00, 0x03, 0x84, 0x00, 0x1e, 0x00, 0x14, +0x00, 0x00, 0x14, 0x66, 0x04, 0x61, 0x6c, 0x74, +0x31, 0x04, 0x78, 0x6d, 0x70, 0x70, 0x01, 0x6c, +0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, +0x63, 0x6f, 0x6d, 0x00, 0xc0, 0x0c, 0x00, 0x21, +0x00, 0x01, 0x00, 0x00, 0x03, 0x84, 0x00, 0x1e, +0x00, 0x14, 0x00, 0x00, 0x14, 0x66, 0x04, 0x61, +0x6c, 0x74, 0x34, 0x04, 0x78, 0x6d, 0x70, 0x70, +0x01, 0x6c, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, +0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0xc0, 0x0c, +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x03, 0x84, +0x00, 0x19, 0x00, 0x05, 0x00, 0x00, 0x14, 0x66, +0x04, 0x78, 0x6d, 0x70, 0x70, 0x01, 0x6c, 0x06, +0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, +0x6f, 0x6d, 0x00, 0xc0, 0x0c, 0x00, 0x21, 0x00, +0x01, 0x00, 0x00, 0x03, 0x84, 0x00, 0x1e, 0x00, +0x14, 0x00, 0x00, 0x14, 0x66, 0x04, 0x61, 0x6c, +0x74, 0x32, 0x04, 0x78, 0x6d, 0x70, 0x70, 0x01, +0x6c, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, +0x03, 0x63, 0x6f, 0x6d, 0x00 }; + +int response_srv_google_com_pkt_size = sizeof(response_srv_google_com_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_txt_google_com.c b/test/regression/dns_test/response_txt_google_com.c new file mode 100644 index 00000000..f8386365 --- /dev/null +++ b/test/regression/dns_test/response_txt_google_com.c @@ -0,0 +1,53 @@ +/* +No. Time Source Destination Protocol Length Info +237 10.385804000 192.168.0.1 192.168.0.105 DNS 164 Yes Standard query response 0x0002 TXT + +Frame 237: 164 bytes on wire (1312 bits), 164 bytes captured (1312 bits) +Ethernet II, Src: TendaTec_60:4b:46 (c8:3a:35:60:4b:46), Dst: Dell_33:c1:bd (18:03:73:33:c1:bd) +Internet Protocol Version 4, Src: 192.168.0.1 (192.168.0.1), Dst: 192.168.0.105 (192.168.0.105) +User Datagram Protocol, Src Port: domain (53), Dst Port: 49547 (49547) +Domain Name System (response) + Request In: 236 + Time: 0.117301000 seconds + Transaction ID: 0x0002 + Flags: 0x8180 (Standard query response, No error) + Questions: 1 + Answer RRs: 1 + Authority RRs: 0 + Additional RRs: 0 + Queries + google.com: type TXT, class IN + Answers + google.com: type TXT, class IN + Name: google.com + Type: TXT (Text strings) + Class: IN (0x0001) + Time to live: 1 hour + Data length: 82 + Text: v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all +*/ + +char response_txt_google_com_pkt[293] = { +0x18, 0x03, 0x73, 0x33, 0xc1, 0xbd, 0xc8, 0x3a, +0x35, 0x60, 0x4b, 0x46, 0x08, 0x00, 0x45, 0x00, +0x00, 0x96, 0xc1, 0xa0, 0x00, 0x00, 0x40, 0x11, +0x36, 0xfc, 0xc0, 0xa8, 0x00, 0x01, 0xc0, 0xa8, +0x00, 0x69, 0x00, 0x35, 0xc1, 0x8b, 0x00, 0x82, +0xec, 0x71, 0x00, 0x02, 0x81, 0x80, 0x00, 0x01, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, +0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, +0x6d, 0x00, 0x00, 0x10, 0x00, 0x01, 0xc0, 0x0c, +0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x0e, 0x10, +0x00, 0x52, 0x51, 0x76, 0x3d, 0x73, 0x70, 0x66, +0x31, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, +0x65, 0x3a, 0x5f, 0x6e, 0x65, 0x74, 0x62, 0x6c, +0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x67, 0x6f, 0x6f, +0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x20, +0x69, 0x70, 0x34, 0x3a, 0x32, 0x31, 0x36, 0x2e, +0x37, 0x33, 0x2e, 0x39, 0x33, 0x2e, 0x37, 0x30, +0x2f, 0x33, 0x31, 0x20, 0x69, 0x70, 0x34, 0x3a, +0x32, 0x31, 0x36, 0x2e, 0x37, 0x33, 0x2e, 0x39, +0x33, 0x2e, 0x37, 0x32, 0x2f, 0x33, 0x31, 0x20, +0x7e, 0x61, 0x6c, 0x6c }; + +int response_txt_google_com_pkt_size = sizeof(response_txt_google_com_pkt); \ No newline at end of file diff --git a/test/regression/dns_test/response_with_invalid_resource.c b/test/regression/dns_test/response_with_invalid_resource.c new file mode 100644 index 00000000..e626fd08 --- /dev/null +++ b/test/regression/dns_test/response_with_invalid_resource.c @@ -0,0 +1,103 @@ +/* A valid DNS response packet + +00000000: 1c1a dfb0 2f0a 74b6 b640 932d 0800 4500 ..../.t..@.-..E. +00000010: 0069 725d 0000 4011 80a6 c0a8 01fe c0a8 .ir]..@......... +00000020: 0432 0035 c8e1 0055 4c59 88cc 8180 0001 .2.5...ULY...... +00000030: 0002 0000 0000 0863 6c69 656e 7473 3406 .......clients4. +00000040: 676f 6f67 6c65 0363 6f6d 0000 0100 01c0 google.com...... +00000050: 0c00 0500 0100 0000 c300 0c07 636c 6965 ............clie +00000060: 6e74 7301 6cc0 15c0 3100 0100 0100 0001 nts.l...1....... +00000070: 2c00 04ac d903 ce ,...... + +Domain Name System (response) + Transaction ID: 0x88cc + Flags: 0x8180 Standard query response, No error + Questions: 1 + Answer RRs: 2 + Authority RRs: 0 + Additional RRs: 0 + Queries + clients4.google.com: type A, class IN + Name: clients4.google.com + [Name Length: 19] + [Label Count: 3] + Type: A (Host Address) (1) + Class: IN (0x0001) + Answers + clients4.google.com: type CNAME, class IN, cname clients.l.google.com + Name: clients4.google.com + Type: CNAME (Canonical NAME for an alias) (5) + Class: IN (0x0001) + Time to live: 195 (3 minutes, 15 seconds) + Data length: 12 + CNAME: clients.l.google.com + clients.l.google.com: type A, class IN, addr 172.217.3.206 + Name: clients.l.google.com + Type: A (Host Address) (1) + Class: IN (0x0001) + Time to live: 300 (5 minutes) + Data length: 4 + Address: 172.217.3.206 + [Unsolicited: True] + +*/ + +/* Invalid response packet 0 */ +/* where CNAME lableSize 0xc0 (the 80th Byte) is changed to 0x3e, + which leads to name buffer OOB in _nx_dns_name_size_calculate(), then is detected.*/ +char invalid_response_ptr_0[119] = { + 0x1c, 0x1a, 0xdf, 0xb0, 0x2f, 0x0a, 0x74, 0xb6, 0xb6, 0x40, 0x93, 0x2d, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x69, 0x72, 0x5d, 0x00, 0x00, 0x40, 0x11, 0x80, 0xa6, 0xc0, 0xa8, 0x01, 0xfe, 0xc0, 0xa8, + 0x04, 0x32, 0x00, 0x35, 0xc8, 0xe1, 0x00, 0x55, 0x4c, 0x59, 0x88, 0xcc, 0x81, 0x80, 0x00, 0x01, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x34, 0x06, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0x3e, + 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x0c, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x01, 0x6c, 0xc0, 0x15, 0xc0, 0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x04, 0xac, 0xd9, 0x03, 0xce +}; +unsigned int invalid_response_size_0 = 119; + +/* Invalid response packet 1 */ +/* where question lableSize 0x08 (the 55th byte) is changed to 0x3e, + which leads to name buffer OOB in _nx_dns_name_size_calculate(), then is detected.*/ +char invalid_response_ptr_1[119] = { + 0x1c, 0x1a, 0xdf, 0xb0, 0x2f, 0x0a, 0x74, 0xb6, 0xb6, 0x40, 0x93, 0x2d, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x69, 0x72, 0x5d, 0x00, 0x00, 0x40, 0x11, 0x80, 0xa6, 0xc0, 0xa8, 0x01, 0xfe, 0xc0, 0xa8, + 0x04, 0x32, 0x00, 0x35, 0xc8, 0xe1, 0x00, 0x55, 0x4c, 0x59, 0x88, 0xcc, 0x81, 0x80, 0x00, 0x01, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x34, 0x06, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0x3e, + 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x0c, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x01, 0x6c, 0xc0, 0x15, 0xc0, 0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x04, 0xac, 0xd9, 0x03, 0xce +}; +unsigned int invalid_response_size_1 = 119; + +/* Invalid response packet 2 */ +/* where A address lableSize 0xc0 (the 104th Byte) is changed to 0x0d, the 117th Byte is changed to 0, + which leads to buffer OOB in _nx_dns_resource_type_get(), then is detected. */ +char invalid_response_ptr_2[119] = { + 0x1c, 0x1a, 0xdf, 0xb0, 0x2f, 0x0a, 0x74, 0xb6, 0xb6, 0x40, 0x93, 0x2d, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x69, 0x72, 0x5d, 0x00, 0x00, 0x40, 0x11, 0x80, 0xa6, 0xc0, 0xa8, 0x01, 0xfe, 0xc0, 0xa8, + 0x04, 0x32, 0x00, 0x35, 0xc8, 0xe1, 0x00, 0x55, 0x4c, 0x59, 0x88, 0xcc, 0x81, 0x80, 0x00, 0x01, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x34, 0x06, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, + 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x0c, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x01, 0x6c, 0xc0, 0x15, 0x0d, 0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, + 0x2c, 0x00, 0x04, 0xac, 0x00, 0x00, 0xce +}; +unsigned int invalid_response_size_2 = 119; + +/* Invalid response packet 3 */ +/* where the last 7 Bytes are deleted, + which leads to buffer OOB in _nx_dns_resource_data_length_get(), then is detected.*/ +char invalid_response_ptr_3[112] = { + 0x1c, 0x1a, 0xdf, 0xb0, 0x2f, 0x0a, 0x74, 0xb6, 0xb6, 0x40, 0x93, 0x2d, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x69, 0x72, 0x5d, 0x00, 0x00, 0x40, 0x11, 0x80, 0xa6, 0xc0, 0xa8, 0x01, 0xfe, 0xc0, 0xa8, + 0x04, 0x32, 0x00, 0x35, 0xc8, 0xe1, 0x00, 0x55, 0x4c, 0x59, 0x88, 0xcc, 0x81, 0x80, 0x00, 0x01, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x34, 0x06, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0, + 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x0c, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x01, 0x6c, 0xc0, 0x15, 0xc0, 0x31, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 +}; +unsigned int invalid_response_size_3 = 112; + diff --git a/test/regression/ftp_test/netx_ftp_access_control_commands_01_test.c b/test/regression/ftp_test/netx_ftp_access_control_commands_01_test.c new file mode 100644 index 00000000..bf3e1345 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_access_control_commands_01_test.c @@ -0,0 +1,317 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG username_counter = 0; +static ULONG flag = 0; +static UINT test_done = NX_FALSE; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_01_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + + +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + flag = 1; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands User 01 Test..........."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) && ( username_counter != 1 )) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (flag != 1)) + { + if(!memcmp(message,"USER name",9)) + username_counter++; + + /* Deal packets with default routing. */ + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* When ftp client connect the ftp server, increase the flage to make sure the "User" packet is the first packet we get. */ + if(flag) + flag++; + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_01_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands User 01 Test...........N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_access_control_commands_02_test.c b/test/regression/ftp_test/netx_ftp_access_control_commands_02_test.c new file mode 100644 index 00000000..78e0a9a6 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_access_control_commands_02_test.c @@ -0,0 +1,322 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG username_counter = 0; +static ULONG passwd_counter = 0; +static UINT test_done = NX_FALSE; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_02_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + + +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands Pass Test.............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) && ( username_counter != 1 ) && ( passwd_counter != 1 )) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; +static int flag = 0; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check the packet is a SYN one. */ + if(*message == 'U') + { + if(!memcmp(message,"USER name",9)) + { + username_counter++; + flag = 0; + } + } + /* Check if the PASSWORD command must be immediately preceded by the user name command. */ + else if (*message == 'P' && flag == 1) + { + if(!memcmp(message,"PASS password",13)) + passwd_counter++; + + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + /* Deal packets with default routing. */ + + flag ++; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_02_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands Pass Test..............N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_access_control_commands_03_test.c b/test/regression/ftp_test/netx_ftp_access_control_commands_03_test.c new file mode 100644 index 00000000..d603e15a --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_access_control_commands_03_test.c @@ -0,0 +1,487 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG logg_in_counter = 0; +static UINT test_done = NX_FALSE; + + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_03_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + + +UINT status; +NX_PACKET *my_packet; +NX_PACKET *data_packet; +ULONG data_port; +ULONG control_port; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + control_port = ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + memcpy(my_packet -> nx_packet_prepend_ptr, "USER name1", 10); + + *(my_packet -> nx_packet_prepend_ptr + 10) = 13; + *(my_packet -> nx_packet_prepend_ptr + 11) = 10; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 12; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 12; + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(my_packet->nx_packet_prepend_ptr,"33",2)) + error_counter++; + else + { + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + + memcpy(my_packet -> nx_packet_prepend_ptr, "PASS password1", 14); + *(my_packet -> nx_packet_prepend_ptr + 14) = 13; + *(my_packet -> nx_packet_prepend_ptr + 15) = 10; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 16; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 16; + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Check if the transfer parameters has been changed */ + if(ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port != control_port) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + } + } + + + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &data_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(data_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + data_packet -> nx_packet_length = 28; + data_packet -> nx_packet_append_ptr = data_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, data_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + data_port = ftp_client.nx_ftp_client_data_port; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + memcpy(my_packet -> nx_packet_prepend_ptr, "USER name2", 10); + + *(my_packet -> nx_packet_prepend_ptr + 10) = 13; + *(my_packet -> nx_packet_prepend_ptr + 11) = 10; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 12; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 12; + + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(my_packet->nx_packet_prepend_ptr,"33",2)) + error_counter++; + else + { + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + memcpy(my_packet -> nx_packet_prepend_ptr, "PASS password2", 14); + *(my_packet -> nx_packet_prepend_ptr + 14) = 13; + *(my_packet -> nx_packet_prepend_ptr + 15) = 10; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 16; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 16; + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + nx_packet_release(my_packet); + + /* Check if the transfer parameters has been changed */ + if((ftp_client.nx_ftp_client_data_port != data_port) && (ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port != control_port)) + error_counter++; + } + } + + nx_packet_release(data_packet); + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if ((status != 0) && (status != NX_NOT_BOUND)) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if ((status != 0) && (status != NX_NOT_CONNECTED)) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +CHAR type; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands User 03 Test..........."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTP Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check if the transfer parameter has been changed. */ + type = ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_transfer_type; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check if it has flushed the old user, passwd */ + if((memcmp(ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_username,"name1",5)) || (memcmp(ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_password,"password1",9))) + error_counter++; + + /* Check if the transfer parameter has been changed. */ + if(type != ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_transfer_type) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check if the transfer parameter has been changed. */ + if(type != ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_transfer_type) + error_counter++; + + /* Check if it has flushed the old user, passwd */ + if((memcmp(ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_username,"name2",5)) || (memcmp(ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_password,"password2",9))) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) && ( logg_in_counter != 3 )) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if(!memcmp(message,"230 Logged in",13)) + logg_in_counter++; + + if(logg_in_counter == 3) + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_03_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands User 03 Test...........N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_access_control_commands_04_test.c b/test/regression/ftp_test/netx_ftp_access_control_commands_04_test.c new file mode 100644 index 00000000..ada3a8af --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_access_control_commands_04_test.c @@ -0,0 +1,381 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG cdup_counter = 0; +static ULONG success_counter = 0; +static UINT test_done = NX_FALSE; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_04_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + + +UINT status; +NX_PACKET *my_packet; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + + nx_ftp_client_directory_create(&ftp_client,"/abc", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_directory_default_set(&ftp_client, "/abc" , NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "CDUP ", 5); + + *(my_packet -> nx_packet_prepend_ptr + 5) = 13; + *(my_packet -> nx_packet_prepend_ptr + 6) = 10; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 7; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 7; + + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Do the clean job */ + nx_packet_release(my_packet); + + nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands CDUP Test.............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) && ( success_counter != 2 ) && (cdup_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (*message == 'C')) + { + + if(!memcmp(message,"CDUP ",5)) + { + cdup_counter++; + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if(!memcmp(message,"250 \"/abc\" set successfully",26)) + success_counter++; + + else if(!memcmp(message,"250 \"/\" set successfully",23)) + { + success_counter++; + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_access_control_commands_04_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Access Control Commands CDUP Test..............N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_basic_test.c b/test/regression/ftp_test/netx_ftp_basic_test.c new file mode 100644 index 00000000..6c053c01 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_basic_test.c @@ -0,0 +1,339 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Re-create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Now open the same file for reading. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Basic Test............................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* OK to restart the ftp Server. */ + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Basic Test............................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_client_buffer_overflow_test.c b/test/regression/ftp_test/netx_ftp_client_buffer_overflow_test.c new file mode 100644 index 00000000..f7130db2 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_buffer_overflow_test.c @@ -0,0 +1,402 @@ +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#else +#include "nx_ftp_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_LOOPBACK_INTERFACE) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_PAYLOAD 1536 + + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static NX_TCP_SOCKET server_socket; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + +/* Define the NetX FTP object control block. */ + +static NX_FTP_CLIENT ftp_client; + + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_thread_done = NX_FALSE; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(127,0,0,1) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define SERVER_PORT 21 +#define SERVER_PASSIVE_PORT1 21017 +#define SERVER_PASSIVE_PORT2 21018 + + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, ULONG packet_type, UCHAR *data, UINT data_size); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* There are for logging in */ +static UCHAR welcome_220_response_1[27] = { +0x32, 0x32, 0x30, 0x2d, 0x4d, 0x69, 0x63, 0x72, /* 220-Micr */ +0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x46, 0x54, /* osoft FT */ +0x50, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, /* PServic */ +0x65, 0x0d, 0x0a /* e.. */ +}; + +static UINT welcome_220_response_1_size = 27; + +static UCHAR welcome_220_response_2[21] = { +0x32, 0x32, 0x30, 0x20, 0x57, 0x69, 0x6e, 0x68, /* 220 Winh */ +0x6f, 0x73, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x20, /* ost.com */ +0x46, 0x54, 0x50, 0x0d, 0x0a /* FTP.. */ +}; + +static UINT welcome_220_response_2_size = 21; + +static UCHAR password_request_331[23] = { +0x33, 0x33, 0x31, 0x20, 0x50, 0x61, 0x73, 0x73, /* 331 Pass */ +0x77, 0x6f, 0x72, 0x64, 0x20, 0x72, 0x65, 0x71, /* word req */ +0x75, 0x69, 0x72, 0x65, 0x64, 0x0d, 0x0a /* uired.. */ +}; + +static UINT password_request_331_size = 23; + +static UCHAR logged_in_230_response[21] = { +0x32, 0x33, 0x30, 0x20, 0x55, 0x73, 0x65, 0x72, /* 230 User */ +0x20, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x64, 0x20, /* logged */ +0x69, 0x6e, 0x2e, 0x0d, 0x0a /* in... */ +}; + +static UINT logged_in_230_response_size = 21; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_buffer_overflow_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main FTP server thread. */ + status = tx_thread_create(&server_thread, "FTP Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + + /* Set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, DEMO_STACK_SIZE, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable TCP for client IP instance. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Let the server set up. */ + tx_thread_sleep(20); + + NX_PARAMETER_NOT_USED(thread_input); + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Now connect with the NetX FTP (IPv4) server on the control socket. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "equenet0_alpha1", "29Pi2A792N", 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Delete the FTP client. */ + nx_ftp_client_disconnect(&ftp_client, 0); + nx_ftp_client_delete(&ftp_client); + + client_thread_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Buffer Overflow Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket as the FTP server. */ + status = nx_tcp_socket_create(&client_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the FTP control port. */ + status = nx_tcp_server_socket_listen(&client_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Send welcome response. */ + if (nx_ftp_response_packet_send(&server_socket, (client_pool.nx_packet_pool_payload_size - welcome_220_response_1_size) & 0xFFFFFFFC, + welcome_220_response_1, welcome_220_response_1_size)) + { + error_counter++; + } + + if (nx_ftp_response_packet_send(&server_socket, (client_pool.nx_packet_pool_payload_size - welcome_220_response_2_size) & 0xFFFFFFFC, + welcome_220_response_2, welcome_220_response_2_size)) + { + error_counter++; + } + + /* Receive USER request message. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status) || (memcmp(my_packet ->nx_packet_prepend_ptr, "USER equenet0_alpha1", sizeof("USER equenet0_alpha1") - 1))) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Send password required message. */ + if (nx_ftp_response_packet_send(&server_socket, (client_pool.nx_packet_pool_payload_size - password_request_331_size) & 0xFFFFFFFC, + password_request_331, password_request_331_size)) + { + error_counter++; + } + + /* Receive PASS request message. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status) || (memcmp(my_packet ->nx_packet_prepend_ptr, "PASS 29Pi2A792N", sizeof("USER 29Pi2A792N") - 1))) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Send logged in message. */ + if (nx_ftp_response_packet_send(&server_socket, (client_pool.nx_packet_pool_payload_size - password_request_331_size) & 0xFFFFFFFC, + logged_in_230_response, logged_in_230_response_size)) + { + error_counter++; + } + + /* Wait for client thread. */ + while (client_thread_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_socket_disconnect(&server_socket, 0); + nx_tcp_socket_delete(&server_socket); + + /* Make sure the packet pool is not corrupted. */ + while (client_pool.nx_packet_pool_available) + { + if (nx_packet_allocate(&client_pool, &my_packet, 0, NX_NO_WAIT) || + (my_packet -> nx_packet_pool_owner != &client_pool)) + { + + error_counter++; + break; + } + } + + /* Check for error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; + + return; + +} + +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, ULONG packet_type, UCHAR *data, UINT data_size) +{ + +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&client_pool, &response_packet, packet_type, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, data, data_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = data_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_buffer_overflow_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Buffer Overflow Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_client_file_write_fail_test.c b/test/regression/ftp_test/netx_ftp_client_file_write_fail_test.c new file mode 100644 index 00000000..9a9829a5 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_file_write_fail_test.c @@ -0,0 +1,1026 @@ +/* This is a small demo of NetX FTP on the high-performance NetX TCP/IP stack. This demo + relies on ThreadX, NetX, and FileX to show a simple file transfer from the client + to the server and a directory listing get using passive file transfer (PASV). */ + + + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#else +#include "nx_ftp_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_PAYLOAD 1518 + + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET server_socket_passive; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control block. */ +static NX_FTP_CLIENT ftp_client; + +typedef struct FTP_RESPONSE_STRUCT +{ + char *ftp_response_pkt_data; + int ftp_response_pkt_size; +} FTP_RESPONSE; + +#define NUM_RESPONSES 10 +static FTP_RESPONSE ftp_response[NUM_RESPONSES]; + +#define LOGIN_RESPONSES 3 +static FTP_RESPONSE ftp_login[LOGIN_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; + +/* Define the memory area for the FileX RAM disk. */ + +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; +static UCHAR zero_data_buffer[4096]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define SERVER_PORT 21 +#define SERVER_PASSIVE_PORT1 21017 +#define SERVER_PASSIVE_PORT2 21018 + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern VOID _fx_ram_driver(FX_MEDIA *media_ptr); + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static void ftp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* There are for logging in */ +static char welcome_220_response[21] = { +0x32, 0x32, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 220 .... */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int welcome_220_response_size = 21; + +static char password_request_331[17] = { +0x33, 0x33, 0x31, 0x20, /* 331 .... */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int password_request_331_size = 17; + +static char logged_in_230_response[13] = { +0x32, 0x33, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 230 .... */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int logged_in_230_response_size = 13; + + +/* These are for downloading information. */ +static char cwd_250_response[23] = { +0x32, 0x35, /* D0v...25 */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int cwd_250_response_size = 23; + + +static char pasv_nlst_227_response[43] = { +0x32, 0x32, /* D.r...22 */ +0x37, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 7 Enteri */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x35, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv_nlst_227_response_size = 43; + +static char nlst_complete_150_response[48] = { +0x31, 0x35, /* D.....15 */ +0x30, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x6e, /* 0 Openin */ +0x61, 0x6e, 0x65, 0x74, 0x0d, 0x0a /* anet.. */ +}; + +static int nlst_complete_150_response_size = 48; + +static char server_nlst_download1_response[57] = { +0x74, 0x79, /* ...R..ty */ +0x70, 0x65, 0x3d, 0x63, 0x64, 0x69, 0x72, 0x3b, /* pe=cdir; */ +0x73, 0x69, 0x7a, 0x65, 0x3d, 0x30, 0x3b, 0x6d, /* size=0;m */ +0x6f, 0x64, 0x69, 0x66, 0x79, 0x3d, 0x32, 0x30, /* odify=20 */ +0x31, 0x36, 0x30, 0x37, 0x30, 0x32, 0x30, 0x30, /* 16070200 */ +0x63, 0x64, 0x65, 0x66, 0x6c, 0x6d, 0x70, 0x3b, /* cdeflmp; */ +0x20, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x5c, /* \Users\ */ +0x6a, 0x61, 0x6e, 0x65, 0x74, 0x0d, 0x0a /* janet.. */ +}; + +static int server_nlst_download1_response_size = 57; + + +static char nlst_complete_226_response[24] = { +0x32, 0x32, /* C.:P..22 */ +0x36, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 6 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int nlst_complete_226_response_size = 24; + +static char type_I_200_response[19] = { +0x32, 0x30, /* D.z...20 */ +0x30, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20, 0x73, /* 0 Type s */ +0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x49, 0x0d, /* et to I. */ +0x0a /* . */ +}; + +static int type_I_200_response_size = 19; + +static char pasv2_227_response[49] = { +0x32, 0x32, /* D.qN..22 */ +0x37, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 7 Enteri */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x36, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv2_227_response_size = 49; + +static char stor_150_response[30] = { +0x31, 0x35, /* C.....15 */ +0x30, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x6e, /* 0 Openin */ +0x67, 0x20, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, /* g BINARY */ +0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, /* connect */ +0x70, 0x6c, 0x0d, 0x0a /* pl.. */ +}; + +static int stor_150_response_size = 30; + +static char download_complete_226_response[24] = { +0x32, 0x32, /* C.:P..22 */ +0x36, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 6 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int download_complete_226_response_size = 24; + +static char quit_221_response[24] = { +0x32, 0x32, /* 221 .... */ +0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 1 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int quit_221_response_size = 24; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_file_write_fail_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main FTP server thread. */ + status = tx_thread_create(&server_thread, "FTP Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 1!\n"); + test_control_return(1); + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "FTP Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + { + printf("ERROR 2!\n"); + test_control_return(1); + } + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "FTP Server IP", + FTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + { + printf("ERROR 3!\n"); + test_control_return(1); + } + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 4!\n"); + test_control_return(1); + } + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", PACKET_PAYLOAD, pointer, 20*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 5!\n"); + test_control_return(1); + } + + pointer = pointer + 20*PACKET_PAYLOAD; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, DEMO_STACK_SIZE, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 6!\n"); + test_control_return(1); + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable TCP for client IP instance. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT packets_sent = 0; +UINT status; + + /* Let the server set up. */ + tx_thread_sleep(20); + + NX_PARAMETER_NOT_USED(thread_input); + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Now connect with the NetX FTP (IPv4) server on the control socket. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "User", "password", 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Set directory to /Users/Test. This does not require the PASV command. */ + status = nx_ftp_client_directory_default_set(&ftp_client, "\\Users\\Test", 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Get directory listing (NLST) ; this is where the Client sends the PASV command and opens another data socket .*/ + status = nx_ftp_client_directory_listing_get(&ftp_client, "", &my_packet, 3 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + status = nx_ftp_client_directory_listing_continue(&ftp_client, &recv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + + if (status == NX_FTP_END_OF_LISTING) + break; + + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_LISTING) + { + error_counter++; + } + + /* Request a file downloaded. This sends PASV and STOR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "socket_tcp_client_recv2.pl", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + + /* Allocate an FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + break; + } + + if (packets_sent < 2) + { + + /* Write ABCs into the packet payload */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + } + else + { + + /* Append data larger than TCP window size to trigger a failure during file write. */ + status = nx_packet_data_append(my_packet, zero_data_buffer, sizeof(zero_data_buffer), &client_pool, NX_NO_WAIT); + } + + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_NO_WAIT); + packets_sent++; + + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + } while ((status == NX_SUCCESS) && (packets_sent < 3)); + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Delete the FTP client. */ + nx_ftp_client_delete(&ftp_client); +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: FTP File Write Fail Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + error_counter++; + } + + /* Create a TCP socket as the FTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a secondary TCP socket as the FTP server passive mode connection. Do not bind a port yet */ + status = nx_tcp_socket_create(&server_ip, &server_socket_passive, "Passive Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Bind the TCP socket to the FTP control port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + ftp_test_initialize(); + + /* Let the client log in */ + + for (i = 0; i < LOGIN_RESPONSES; i++) + { + + status = nx_ftp_login_packet_send(&server_socket, 80, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if (i != 2) + { + + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } + + /* This is responding to CWD */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 0); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is responding to PASV */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80,1); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PASSIVE_PORT1, &server_socket_passive, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket_passive, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is NLST command after passive connection set up */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 2); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_ftp_response_packet_send(&server_socket_passive, 80, 3); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_disconnect(&(server_socket_passive), 100); + nx_tcp_server_socket_unaccept(&server_socket_passive); + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PASSIVE_PORT1); + + status = nx_ftp_response_packet_send(&server_socket, 80, 4); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the second TYPE command (TYPE I) */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the second PASV request. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 6); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PASSIVE_PORT2, &server_socket_passive, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. We are assuming the server uses the same IP address, + although on real FTP servers this is not necessarily the case. */ + status = nx_tcp_server_socket_accept(&server_socket_passive, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is responding to the STOR command. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + status = nx_ftp_response_packet_send(&server_socket, 80, 7); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the file data packet */ + status = nx_tcp_socket_receive(&server_socket_passive, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* this is the second data packet */ + status = nx_tcp_socket_receive(&server_socket_passive, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 8); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_disconnect(&(server_socket_passive), 100); + nx_tcp_server_socket_unaccept(&server_socket_passive); + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PASSIVE_PORT2); + + + /* this is the QUIT command. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 9); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disconnect and delete the TCP socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 100); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_delete(&server_socket); + + /* Check invalid packet release count. */ + if (client_pool.nx_packet_pool_invalid_releases != 0) + { + error_counter++; + } + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; + + return; + +} + + +static void ftp_test_initialize() +{ + +/* Logging in responses */ + + ftp_login[0].ftp_response_pkt_data = &welcome_220_response[0]; + ftp_login[0].ftp_response_pkt_size = welcome_220_response_size ; + + ftp_login[1].ftp_response_pkt_data = &password_request_331[0]; + ftp_login[1].ftp_response_pkt_size = password_request_331_size ; + + ftp_login[2].ftp_response_pkt_data = &logged_in_230_response[0]; + ftp_login[2].ftp_response_pkt_size = logged_in_230_response_size ; + +/* Download data responses */ + ftp_response[0].ftp_response_pkt_data = &cwd_250_response[0]; + ftp_response[0].ftp_response_pkt_size = cwd_250_response_size ; + + + ftp_response[1].ftp_response_pkt_data = &pasv_nlst_227_response[0]; + ftp_response[1].ftp_response_pkt_size = pasv_nlst_227_response_size ; + + ftp_response[2].ftp_response_pkt_data = &nlst_complete_150_response[0]; + ftp_response[2].ftp_response_pkt_size = nlst_complete_150_response_size ; + + ftp_response[3].ftp_response_pkt_data = &server_nlst_download1_response[0]; + ftp_response[3].ftp_response_pkt_size = server_nlst_download1_response_size ; + + ftp_response[4].ftp_response_pkt_data = &nlst_complete_226_response[0]; + ftp_response[4].ftp_response_pkt_size = nlst_complete_226_response_size ; + + + ftp_response[5].ftp_response_pkt_data = &type_I_200_response[0]; + ftp_response[5].ftp_response_pkt_size = type_I_200_response_size ; + + ftp_response[6].ftp_response_pkt_data = &pasv2_227_response[0]; + ftp_response[6].ftp_response_pkt_size = pasv2_227_response_size ; + + ftp_response[7].ftp_response_pkt_data = &stor_150_response[0]; + ftp_response[7].ftp_response_pkt_size = stor_150_response_size ; + + ftp_response[8].ftp_response_pkt_data = &download_complete_226_response[0]; + ftp_response[8].ftp_response_pkt_size = download_complete_226_response_size ; + + ftp_response[9].ftp_response_pkt_data = &quit_221_response[0]; + ftp_response[9].ftp_response_pkt_size = quit_221_response_size ; +} + + + +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *login_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &login_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(login_packet -> nx_packet_prepend_ptr, ftp_login[packet_number].ftp_response_pkt_data, + ftp_login[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + login_packet -> nx_packet_length = ftp_login[packet_number].ftp_response_pkt_size; + login_packet -> nx_packet_append_ptr = login_packet -> nx_packet_prepend_ptr + login_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, login_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(login_packet); + + return status; +} + + +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, ftp_response[packet_number].ftp_response_pkt_data, + ftp_response[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = ftp_response[packet_number].ftp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_file_write_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP File Write Fail Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_client_invalid_username_password_length_test.c b/test/regression/ftp_test/netx_ftp_client_invalid_username_password_length_test.c new file mode 100644 index 00000000..1755076c --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_invalid_username_password_length_test.c @@ -0,0 +1,293 @@ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; +static UINT data_control_counter; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; +static CHAR invalid_username[2048]; +static CHAR invalid_password[2048]; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_invalid_username_password_length_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + + data_control_counter = 0; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Set the username. */ + for (i = 0; i < 2048; i++) + invalid_username[i] = 'u'; + + /* Now using invalid username to connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, invalid_username, "password", NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_FTP_FAILED) + error_counter++; + + /* Set the username. */ + for (i = 0; i < 2048; i++) + invalid_password[i] = 'p'; + + /* Now using invalid username to connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "username", invalid_password, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_FTP_FAILED) + error_counter++; + + status = nx_ftp_client_delete(&ftp_client); + if(status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Invalid Username Password Length Test.........."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_invalid_username_password_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Invalid Username Password Length Test..........N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_client_multiple_connection_responses_test.c b/test/regression/ftp_test/netx_ftp_client_multiple_connection_responses_test.c new file mode 100644 index 00000000..f185f795 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_multiple_connection_responses_test.c @@ -0,0 +1,426 @@ +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#else +#include "nx_ftp_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_PAYLOAD 1518 + + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET server_socket_passive; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; + +/* Define the NetX FTP object control block. */ + +static NX_FTP_CLIENT ftp_client; + + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; +static UINT client_thread_done = NX_FALSE; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define SERVER_PORT 21 +#define SERVER_PASSIVE_PORT1 21017 +#define SERVER_PASSIVE_PORT2 21018 + + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UCHAR *data, UINT data_size); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* There are for logging in */ +static UCHAR welcome_220_response_1[27] = { +0x32, 0x32, 0x30, 0x2d, 0x4d, 0x69, 0x63, 0x72, /* 220-Micr */ +0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x46, 0x54, /* osoft FT */ +0x50, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, /* PServic */ +0x65, 0x0d, 0x0a /* e.. */ +}; + +static UINT welcome_220_response_1_size = 27; + +static UCHAR welcome_220_response_2[21] = { +0x32, 0x32, 0x30, 0x20, 0x57, 0x69, 0x6e, 0x68, /* 220 Winh */ +0x6f, 0x73, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x20, /* ost.com */ +0x46, 0x54, 0x50, 0x0d, 0x0a /* FTP.. */ +}; + +static UINT welcome_220_response_2_size = 21; + +static UCHAR password_request_331[23] = { +0x33, 0x33, 0x31, 0x20, 0x50, 0x61, 0x73, 0x73, /* 331 Pass */ +0x77, 0x6f, 0x72, 0x64, 0x20, 0x72, 0x65, 0x71, /* word req */ +0x75, 0x69, 0x72, 0x65, 0x64, 0x0d, 0x0a /* uired.. */ +}; + +static UINT password_request_331_size = 23; + +static UCHAR logged_in_230_response[21] = { +0x32, 0x33, 0x30, 0x20, 0x55, 0x73, 0x65, 0x72, /* 230 User */ +0x20, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x64, 0x20, /* logged */ +0x69, 0x6e, 0x2e, 0x0d, 0x0a /* in... */ +}; + +static UINT logged_in_230_response_size = 21; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_multiple_connection_response_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main FTP server thread. */ + status = tx_thread_create(&server_thread, "FTP Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "FTP Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "FTP Server IP", + FTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, DEMO_STACK_SIZE, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable TCP for client IP instance. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Let the server set up. */ + tx_thread_sleep(20); + + NX_PARAMETER_NOT_USED(thread_input); + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Now connect with the NetX FTP (IPv4) server on the control socket. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "equenet0_alpha1", "29Pi2A792N", 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Delete the FTP client. */ + nx_ftp_client_disconnect(&ftp_client, 0); + nx_ftp_client_delete(&ftp_client); + + client_thread_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Multiple Connection Response Test.............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket as the FTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a secondary TCP socket as the FTP server passive mode connection. Do not bind a port yet */ + status = nx_tcp_socket_create(&server_ip, &server_socket_passive, "Passive Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Bind the TCP socket to the FTP control port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Send welcome response. */ + if (nx_ftp_response_packet_send(&server_socket, welcome_220_response_1, welcome_220_response_1_size)) + { + error_counter++; + } + if (nx_ftp_response_packet_send(&server_socket, welcome_220_response_2, welcome_220_response_2_size)) + { + error_counter++; + } + + /* Receive USER request message. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status) || (memcmp(my_packet ->nx_packet_prepend_ptr, "USER equenet0_alpha1", sizeof("USER equenet0_alpha1") - 1))) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Send password required message. */ + if (nx_ftp_response_packet_send(&server_socket, password_request_331, password_request_331_size)) + { + error_counter++; + } + + /* Receive PASS request message. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status) || (memcmp(my_packet ->nx_packet_prepend_ptr, "PASS 29Pi2A792N", sizeof("USER 29Pi2A792N") - 1))) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Send logged in message. */ + if (nx_ftp_response_packet_send(&server_socket, logged_in_230_response, logged_in_230_response_size)) + { + error_counter++; + } + + /* Wait for client thread. */ + while (client_thread_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_socket_disconnect(&server_socket, 0); + nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; + + return; + +} + +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UCHAR *data, UINT data_size) +{ + +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, data, data_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = data_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_multiple_connection_response_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Multiple Connection Response Test..............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_client_packet_leak_test.c b/test/regression/ftp_test/netx_ftp_client_packet_leak_test.c new file mode 100644 index 00000000..3ce89cb3 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_packet_leak_test.c @@ -0,0 +1,358 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Check packet leak. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Check packet leak. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Check packet leak. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; + + /* Get directory listing (NLST). */ + status = nx_ftp_client_directory_listing_get(&ftp_client, "", &my_packet, 200); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + + do + { + /* Receive the next data packet. */ + status = nx_ftp_client_directory_listing_continue(&ftp_client, &my_packet, 200); + if (status == NX_SUCCESS) + { + nx_packet_release(my_packet); + } + + /* Check if this is the end of the download. */ + if (status == NX_FTP_END_OF_LISTING) + break; + + } while (status == NX_SUCCESS); + + /* Check packet leak. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Check packet leak. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Packet Leak Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* OK to restart the ftp Server. */ + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Client Packet Leak Test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_client_pasv_denied.c b/test/regression/ftp_test/netx_ftp_client_pasv_denied.c new file mode 100644 index 00000000..0f7be20c --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_pasv_denied.c @@ -0,0 +1,670 @@ +/* This is a small demo of NetX FTP on the high-performance NetX TCP/IP stack. This demo + relies on ThreadX, NetX, and FileX to show a simple directory listing get from the client + in passive mode transfer, except the server refuses the passive mode request. */ + + + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#else +#include "nx_ftp_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_PAYLOAD 1518 + + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET server_socket_passive; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control block. */ +static NX_FTP_CLIENT ftp_client; + +typedef struct FTP_RESPONSE_STRUCT +{ + char *ftp_response_pkt_data; + int ftp_response_pkt_size; +} FTP_RESPONSE; + +#define NUM_RESPONSES 4 +static FTP_RESPONSE ftp_response[NUM_RESPONSES]; + +#define LOGIN_RESPONSES 3 +static FTP_RESPONSE ftp_login[LOGIN_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; + + +/* Define the memory area for the FileX RAM disk. */ + +UCHAR ram_disk_memory[32000]; +UCHAR ram_disk_sector_cache[512]; + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define SERVER_PORT 21 +#define SERVER_PASSIVE_PORT1 21017 +#define SERVER_PASSIVE_PORT2 21018 + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +VOID _fx_ram_driver(FX_MEDIA *media_ptr); + + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static void ftp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* There are for logging in */ +static char welcome_220_response[21] = { +0x32, 0x32, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 220 ... */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int welcome_220_response_size = 21; + +static char password_request_331[17] = { +0x33, 0x33, 0x31, 0x20, /* 331 ... */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int password_request_331_size = 17; + +static char logged_in_230_response[13] = { +0x32, 0x33, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 230 ... */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int logged_in_230_response_size = 13; + + +/* These are for downloading information. */ +static char cwd_250_response[23] = { +0x32, 0x35, /* D0v...25 */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int cwd_250_response_size = 23; + +static char pasv_nlst_500_response[43] = { +0x35, 0x30, /* D.r...50 */ +0x30, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 0 Denied */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x35, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv_nlst_500_response_size = 43; + + +static char quit_221_response[24] = { +0x32, 0x32, /* 221 .... */ +0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 1 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int quit_221_response_size = 24; + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_pasv_denied_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main FTP server thread. */ + status = tx_thread_create(&server_thread, "FTP Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "FTP Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "FTP Server IP", + FTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 25*PACKET_PAYLOAD; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, DEMO_STACK_SIZE, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable TCP for client IP instance. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Let the server set up. */ + tx_thread_sleep(20); + + NX_PARAMETER_NOT_USED(thread_input); + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Now connect with the NetX FTP (IPv4) server on the control socket. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "User", "password", 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Set directory to /Users/Self. This does not require the PASV command. */ + status = nx_ftp_client_directory_default_set(&ftp_client, "\\Users\\Self", 100); + + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Get directory listing (NLST) ; this is where the Client sends the PASV command and opens another data socket .*/ + status = nx_ftp_client_directory_listing_get(&ftp_client, "", &my_packet, 100); + + /* The server refuses the PASV request so this should not succeed! */ + if (status == NX_SUCCESS) + { + + error_counter++; + } + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Delete the FTP client. */ + nx_ftp_client_delete(&ftp_client); + +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: FTP Passive Mode Transfer PASV Refused Test..............."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket as the FTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a secondary TCP socket as the FTP server passive mode connection. Do not bind a port yet */ + status = nx_tcp_socket_create(&server_ip, &server_socket_passive, "Passive Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Bind the TCP socket to the FTP control port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + ftp_test_initialize(); + + /* Let the client log in */ + + for (i = 0; i < LOGIN_RESPONSES; i++) + { + + status = nx_ftp_login_packet_send(&server_socket, 80, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if (i != 2) + { + + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + } + + /* this is CWD */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Respond to CWD command. */ + status = nx_ftp_response_packet_send(&server_socket, 80, 0); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the PASV request*/ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 1); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the QUIT command. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 2); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(&server_socket); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; + + return; + +} + + +static void ftp_test_initialize() +{ + +/* Logging in responses */ + + ftp_login[0].ftp_response_pkt_data = &welcome_220_response[0]; + ftp_login[0].ftp_response_pkt_size = welcome_220_response_size ; + + ftp_login[1].ftp_response_pkt_data = &password_request_331[0]; + ftp_login[1].ftp_response_pkt_size = password_request_331_size ; + + ftp_login[2].ftp_response_pkt_data = &logged_in_230_response[0]; + ftp_login[2].ftp_response_pkt_size = logged_in_230_response_size ; + +/* Download data responses */ + ftp_response[0].ftp_response_pkt_data = &cwd_250_response[0]; + ftp_response[0].ftp_response_pkt_size = cwd_250_response_size ; + + ftp_response[1].ftp_response_pkt_data = &pasv_nlst_500_response[0]; + ftp_response[1].ftp_response_pkt_size = pasv_nlst_500_response_size ; + + ftp_response[2].ftp_response_pkt_data = &quit_221_response[0]; + ftp_response[2].ftp_response_pkt_size = quit_221_response_size ; + + +} + + + +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *login_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &login_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(login_packet -> nx_packet_prepend_ptr, ftp_login[packet_number].ftp_response_pkt_data, + ftp_login[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + login_packet -> nx_packet_length = ftp_login[packet_number].ftp_response_pkt_size; + login_packet -> nx_packet_append_ptr = login_packet -> nx_packet_prepend_ptr + login_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, login_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(login_packet); + + return status; +} + + +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ + +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, ftp_response[packet_number].ftp_response_pkt_data, + ftp_response[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = ftp_response[packet_number].ftp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_pasv_denied_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Passive Mode Transfer PASV Refused Test...............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_client_pasv_file_read_test.c b/test/regression/ftp_test/netx_ftp_client_pasv_file_read_test.c new file mode 100644 index 00000000..376383a0 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_pasv_file_read_test.c @@ -0,0 +1,987 @@ +/* This is a small demo of NetX FTP on the high-performance NetX TCP/IP stack. This demo + relies on ThreadX, NetX, and FileX to show a simple file transfer from the server + to client, and a directory listing get, in passive transfer mode (PASV). */ + + + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#else +#include "nx_ftp_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_PAYLOAD 1518 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET server_socket_passive; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control block. */ +static NX_FTP_CLIENT ftp_client; + +typedef struct FTP_RESPONSE_STRUCT +{ + char *ftp_response_pkt_data; + int ftp_response_pkt_size; +} FTP_RESPONSE; + +#define NUM_RESPONSES 11 +static FTP_RESPONSE ftp_response[NUM_RESPONSES]; + +#define LOGIN_RESPONSES 3 +static FTP_RESPONSE ftp_login[LOGIN_RESPONSES]; + +/* Define the counters used in the demo application... */ +static UINT error_counter = 0; + +/* Define the memory area for the FileX RAM disk. */ + +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define SERVER_PORT 21 +#define SERVER_PASSIVE_PORT1 21017 +#define SERVER_PASSIVE_PORT2 21018 + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +VOID _fx_ram_driver(FX_MEDIA *media_ptr); + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static void ftp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* There are for logging in */ +static char welcome_220_response[21] = { +0x32, 0x32, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 220 ... */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int welcome_220_response_size = 21; + +static char password_request_331[17] = { +0x33, 0x33, 0x31, 0x20, /* 331 ... */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int password_request_331_size = 17; + +static char logged_in_230_response[13] = { +0x32, 0x33, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 230 ... */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int logged_in_230_response_size = 13; + + +/* These are for downloading information. */ +static char cwd_250_response[23] = { +0x32, 0x35, /* D0v...25 */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int cwd_250_response_size = 23; + + +static char pasv_nlst_227_response[43] = { +0x32, 0x32, /* D.r...22 */ +0x37, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 7 Enteri */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x35, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv_nlst_227_response_size = 43; + +static char nlst_complete_150_response[48] = { +0x31, 0x35, /* D.....15 */ +0x30, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x6e, /* 0 Openin */ +0x61, 0x6e, 0x65, 0x74, 0x0d, 0x0a /* anet.. */ +}; + +static int nlst_complete_150_response_size = 48; + +static char server_nlst_download1_response[57] = { +0x74, 0x79, /* ...R..ty */ +0x70, 0x65, 0x3d, 0x63, 0x64, 0x69, 0x72, 0x3b, /* pe=cdir; */ +0x73, 0x69, 0x7a, 0x65, 0x3d, 0x30, 0x3b, 0x6d, /* size=0;m */ +0x6f, 0x64, 0x69, 0x66, 0x79, 0x3d, 0x32, 0x30, /* odify=20 */ +0x31, 0x36, 0x30, 0x37, 0x30, 0x32, 0x30, 0x30, /* 16070200 */ +0x63, 0x64, 0x65, 0x66, 0x6c, 0x6d, 0x70, 0x3b, /* cdeflmp; */ +0x20, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x5c, /* \Users\ */ +0x6a, 0x61, 0x6e, 0x65, 0x74, 0x0d, 0x0a /* janet.. */ +}; + +static int server_nlst_download1_response_size = 57; + + +static char nlst_complete_226_response[24] = { +0x32, 0x32, /* C.:P..22 */ +0x36, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 6 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int nlst_complete_226_response_size = 24; + +static char type_I_200_response[19] = { +0x32, 0x30, /* D.z...20 */ +0x30, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20, 0x73, /* 0 Type s */ +0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x49, 0x0d, /* et to I. */ +0x0a /* . */ +}; + +static int type_I_200_response_size = 19; + +static char pasv2_227_response[49] = { +0x32, 0x32, /* D.qN..22 */ +0x37, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 7 Enteri */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x36, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv2_227_response_size = 49; + +static char retr_150_response[30] = { +0x31, 0x35, /* C.....15 */ +0x30, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x6e, /* 0 Openin */ +0x67, 0x20, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, /* g BINARY */ +0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, /* connect */ +0x70, 0x6c, 0x0d, 0x0a /* pl.. */ +}; + +static int retr_150_response_size = 30; + +static char download_file[49] = { +0x23, 0x20, /* ...X..# */ +0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, /* Create a */ +0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, /* client */ +0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x74, /* socket t */ +0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x54, /* o make T */ +0x6f, 0x73, 0x65, 0x28, 0x24, 0x73, 0x6f, 0x63, /* ose($soc */ +0x6b, 0x20, 0x29, 0x3b, 0x3b, 0x0d, 0x0a /* k );;.. */ +}; + +static int download_file_size = 49; + +static char download_complete_226_response[24] = { +0x32, 0x32, /* C.:P..22 */ +0x36, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 6 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int download_complete_226_response_size = 24; + + +static char quit_221_response[24] = { +0x32, 0x32, /* 221 .... */ +0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 1 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int quit_221_response_size = 24; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_pasv_file_read_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main FTP server thread. */ + status = tx_thread_create(&server_thread, "FTP Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "FTP Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "FTP Server IP", + FTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", PACKET_PAYLOAD, pointer, 8*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + 8*PACKET_PAYLOAD; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, DEMO_STACK_SIZE, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable TCP for client IP instance. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT status; + + /* Let the server set up. */ + tx_thread_sleep(20); + + NX_PARAMETER_NOT_USED(thread_input); + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Now connect with the NetX FTP (IPv4) server on the control socket. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "User", "Password", 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Set directory to /Users/Test. This does not require the PASV command. */ + status = nx_ftp_client_directory_default_set(&ftp_client, "\\Users\\Test", 200); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Get directory listing (MLSD) ; this is where the Client sends the PASV command and opens another data socket .*/ + status = nx_ftp_client_directory_listing_get(&ftp_client, "", &my_packet, 300); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + nx_packet_release(my_packet); + + do + { + status = nx_ftp_client_directory_listing_continue(&ftp_client, &recv_packet_ptr, 200); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + + if (status == NX_FTP_END_OF_LISTING) + break; + + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_LISTING) + { + error_counter++; + } + + /* Request a file downloaded. This sends PASV and RETR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "test_script.pl", NX_FTP_OPEN_FOR_READ, 500); + + if (status != NX_SUCCESS) + { + + error_counter++; + } + + do + { + status = nx_ftp_client_file_read(&ftp_client, &recv_packet_ptr, 500); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_FILE) + { + error_counter++; + } + + /* This does not send a command. The data socket is closed and the client state set to CONNECTED. + The server initiates closing the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: FTP Passive Mode Transfer File Read Test.................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket as the FTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a secondary TCP socket as the FTP server passive mode connection. Do not bind a port yet */ + status = nx_tcp_socket_create(&server_ip, &server_socket_passive, "Passive Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the FTP control port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + ftp_test_initialize(); + + /* Let the client log in */ + + for (i = 0; i < LOGIN_RESPONSES; i++) + { + + status = nx_ftp_login_packet_send(&server_socket, 80, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if (i != 2) + { + + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + } + + /* this is responding to CWD */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 0); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is responding to PASV */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 1); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PASSIVE_PORT1, &server_socket_passive, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. We are assuming the server uses the same IP address, + although on real FTP servers this is not necessarily the case. */ + status = nx_tcp_server_socket_accept(&server_socket_passive, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is NLST command after passive connection set up */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 2); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_ftp_response_packet_send(&server_socket_passive, 80, 3); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_disconnect(&(server_socket_passive), 100); + nx_tcp_server_socket_unaccept(&server_socket_passive); + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PASSIVE_PORT1); + + status = nx_ftp_response_packet_send(&server_socket, 80, 4); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the second TYPE command (TYPE I) */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is responding to the second PASV */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 6); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PASSIVE_PORT2, &server_socket_passive, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. We are assuming the server uses the same IP address, + although on real FTP servers this is not necessarily the case. */ + status = nx_tcp_server_socket_accept(&server_socket_passive, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the RETR command */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 7); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Download the file. */ + + status = nx_ftp_response_packet_send(&server_socket_passive, 80, 8); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 9); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_disconnect(&(server_socket_passive), 100); + nx_tcp_server_socket_unaccept(&server_socket_passive); + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PASSIVE_PORT2); + + /* this is the QUIT command */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 10); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disconnect the server. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void ftp_test_initialize() +{ + +/* Logging in responses */ + + ftp_login[0].ftp_response_pkt_data = &welcome_220_response[0]; + ftp_login[0].ftp_response_pkt_size = welcome_220_response_size ; + + ftp_login[1].ftp_response_pkt_data = &password_request_331[0]; + ftp_login[1].ftp_response_pkt_size = password_request_331_size ; + + ftp_login[2].ftp_response_pkt_data = &logged_in_230_response[0]; + ftp_login[2].ftp_response_pkt_size = logged_in_230_response_size ; + +/* Download data responses */ + ftp_response[0].ftp_response_pkt_data = &cwd_250_response[0]; + ftp_response[0].ftp_response_pkt_size = cwd_250_response_size ; + + ftp_response[1].ftp_response_pkt_data = &pasv_nlst_227_response[0]; + ftp_response[1].ftp_response_pkt_size = pasv_nlst_227_response_size ; + + ftp_response[2].ftp_response_pkt_data = &nlst_complete_150_response[0]; + ftp_response[2].ftp_response_pkt_size = nlst_complete_150_response_size ; + + ftp_response[3].ftp_response_pkt_data = &server_nlst_download1_response[0]; + ftp_response[3].ftp_response_pkt_size = server_nlst_download1_response_size ; + + ftp_response[4].ftp_response_pkt_data = &nlst_complete_226_response[0]; + ftp_response[4].ftp_response_pkt_size = nlst_complete_226_response_size ; + + ftp_response[5].ftp_response_pkt_data = &type_I_200_response[0]; + ftp_response[5].ftp_response_pkt_size = type_I_200_response_size ; + + ftp_response[6].ftp_response_pkt_data = &pasv2_227_response[0]; + ftp_response[6].ftp_response_pkt_size = pasv2_227_response_size ; + + ftp_response[7].ftp_response_pkt_data = &retr_150_response[0]; + ftp_response[7].ftp_response_pkt_size = retr_150_response_size ; + + ftp_response[8].ftp_response_pkt_data = &download_file[0]; + ftp_response[8].ftp_response_pkt_size = download_file_size ; + + ftp_response[9].ftp_response_pkt_data = &download_complete_226_response[0]; + ftp_response[9].ftp_response_pkt_size = download_complete_226_response_size ; + + ftp_response[10].ftp_response_pkt_data = &quit_221_response[0]; + ftp_response[10].ftp_response_pkt_size = quit_221_response_size ; + +} + + + +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *login_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &login_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(login_packet -> nx_packet_prepend_ptr, ftp_login[packet_number].ftp_response_pkt_data, + ftp_login[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + login_packet -> nx_packet_length = ftp_login[packet_number].ftp_response_pkt_size; + login_packet -> nx_packet_append_ptr = login_packet -> nx_packet_prepend_ptr + login_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, login_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(login_packet); + + return status; +} + + +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, ftp_response[packet_number].ftp_response_pkt_data, + ftp_response[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = ftp_response[packet_number].ftp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_pasv_file_read_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Passive Mode Transfer File Read Test..................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_client_pasv_file_write_test.c b/test/regression/ftp_test/netx_ftp_client_pasv_file_write_test.c new file mode 100644 index 00000000..3dd74158 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_client_pasv_file_write_test.c @@ -0,0 +1,1008 @@ +/* This is a small demo of NetX FTP on the high-performance NetX TCP/IP stack. This demo + relies on ThreadX, NetX, and FileX to show a simple file transfer from the client + to the server and a directory listing get using passive file transfer (PASV). */ + + + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#else +#include "nx_ftp_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_PAYLOAD 1518 + + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET server_socket_passive; +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control block. */ +static NX_FTP_CLIENT ftp_client; + +typedef struct FTP_RESPONSE_STRUCT +{ + char *ftp_response_pkt_data; + int ftp_response_pkt_size; +} FTP_RESPONSE; + +#define NUM_RESPONSES 10 +static FTP_RESPONSE ftp_response[NUM_RESPONSES]; + +#define LOGIN_RESPONSES 3 +static FTP_RESPONSE ftp_login[LOGIN_RESPONSES]; + +/* Define the counters used in the demo application... */ + +static UINT error_counter = 0; + +/* Define the memory area for the FileX RAM disk. */ + +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define SERVER_PORT 21 +#define SERVER_PASSIVE_PORT1 21017 +#define SERVER_PASSIVE_PORT2 21018 + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern VOID _fx_ram_driver(FX_MEDIA *media_ptr); + +static void server_thread_entry(ULONG thread_input); +static void client_thread_entry(ULONG thread_input); +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); +static void ftp_test_initialize(); + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* There are for logging in */ +static char welcome_220_response[21] = { +0x32, 0x32, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 220 .... */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int welcome_220_response_size = 21; + +static char password_request_331[17] = { +0x33, 0x33, 0x31, 0x20, /* 331 .... */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int password_request_331_size = 17; + +static char logged_in_230_response[13] = { +0x32, 0x33, 0x30, 0x20, 0x44, 0x20, 0x63, 0x6f, /* 230 .... */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int logged_in_230_response_size = 13; + + +/* These are for downloading information. */ +static char cwd_250_response[23] = { +0x32, 0x35, /* D0v...25 */ +0x30, 0x20, 0x43, 0x57, 0x44, 0x20, 0x63, 0x6f, /* 0 CWD co */ +0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x75, /* mmand su */ +0x65, 0x74, 0x29, 0x0d, 0x0a /* et).. */ +}; + +static int cwd_250_response_size = 23; + + +static char pasv_nlst_227_response[43] = { +0x32, 0x32, /* D.r...22 */ +0x37, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 7 Enteri */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x35, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv_nlst_227_response_size = 43; + +static char nlst_complete_150_response[48] = { +0x31, 0x35, /* D.....15 */ +0x30, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x6e, /* 0 Openin */ +0x61, 0x6e, 0x65, 0x74, 0x0d, 0x0a /* anet.. */ +}; + +static int nlst_complete_150_response_size = 48; + +static char server_nlst_download1_response[57] = { +0x74, 0x79, /* ...R..ty */ +0x70, 0x65, 0x3d, 0x63, 0x64, 0x69, 0x72, 0x3b, /* pe=cdir; */ +0x73, 0x69, 0x7a, 0x65, 0x3d, 0x30, 0x3b, 0x6d, /* size=0;m */ +0x6f, 0x64, 0x69, 0x66, 0x79, 0x3d, 0x32, 0x30, /* odify=20 */ +0x31, 0x36, 0x30, 0x37, 0x30, 0x32, 0x30, 0x30, /* 16070200 */ +0x63, 0x64, 0x65, 0x66, 0x6c, 0x6d, 0x70, 0x3b, /* cdeflmp; */ +0x20, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x5c, /* \Users\ */ +0x6a, 0x61, 0x6e, 0x65, 0x74, 0x0d, 0x0a /* janet.. */ +}; + +static int server_nlst_download1_response_size = 57; + + +static char nlst_complete_226_response[24] = { +0x32, 0x32, /* C.:P..22 */ +0x36, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 6 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int nlst_complete_226_response_size = 24; + +static char type_I_200_response[19] = { +0x32, 0x30, /* D.z...20 */ +0x30, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20, 0x73, /* 0 Type s */ +0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x49, 0x0d, /* et to I. */ +0x0a /* . */ +}; + +static int type_I_200_response_size = 19; + +static char pasv2_227_response[49] = { +0x32, 0x32, /* D.qN..22 */ +0x37, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x69, /* 7 Enteri */ +0x6e, 0x67, 0x20, 0x50, 0x61, 0x73, 0x73, 0x69, /* ng Passi */ +0x76, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x20, /* ve Mode */ +0x28, 0x31, 0x2c, 0x32, 0x2c, 0x33, 0x2c, 0x34, /* (1,2,3,4 */ +0x2c, 0x38, 0x32, 0x2c, 0x32, 0x36, 0x29, 0x0d, /* ,82,25)*/ +0x0a /* ... */ +}; + +static int pasv2_227_response_size = 49; + +static char stor_150_response[30] = { +0x31, 0x35, /* C.....15 */ +0x30, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x69, 0x6e, /* 0 Openin */ +0x67, 0x20, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, /* g BINARY */ +0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, /* connect */ +0x70, 0x6c, 0x0d, 0x0a /* pl.. */ +}; + +static int stor_150_response_size = 30; + +static char download_complete_226_response[24] = { +0x32, 0x32, /* C.:P..22 */ +0x36, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 6 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int download_complete_226_response_size = 24; + +static char quit_221_response[24] = { +0x32, 0x32, /* 221 .... */ +0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, /* 1 Transf */ +0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, /* er compl */ +0x65, 0x74, 0x65, 0x2e, 0x0d, 0x0a /* ete... */ +}; + +static int quit_221_response_size = 24; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_pasv_file_write_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Set up the FTP Server. */ + + /* Create the main FTP server thread. */ + status = tx_thread_create(&server_thread, "FTP Server thread ", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 1!\n"); + test_control_return(1); + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "FTP Server Packet Pool", 700, + pointer , 700*10); + + pointer = pointer + 700*10; + if (status) + { + printf("ERROR 2!\n"); + test_control_return(1); + } + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "FTP Server IP", + FTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + { + printf("ERROR 3!\n"); + test_control_return(1); + } + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + + /* Set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 4!\n"); + test_control_return(1); + } + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", PACKET_PAYLOAD, pointer, 8*PACKET_PAYLOAD); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 5!\n"); + test_control_return(1); + } + + pointer = pointer + 8*PACKET_PAYLOAD; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1024, pointer, DEMO_STACK_SIZE, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR 6!\n"); + test_control_return(1); + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 1024; + + /* Enable TCP for client IP instance. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + + return; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT packets_sent = 0; +UINT status; + + /* Let the server set up. */ + tx_thread_sleep(20); + + NX_PARAMETER_NOT_USED(thread_input); + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Now connect with the NetX FTP (IPv4) server on the control socket. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "User", "password", 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Set directory to /Users/Test. This does not require the PASV command. */ + status = nx_ftp_client_directory_default_set(&ftp_client, "\\Users\\Test", 200); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Get directory listing (NLST) ; this is where the Client sends the PASV command and opens another data socket .*/ + status = nx_ftp_client_directory_listing_get(&ftp_client, "", &my_packet, 300); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + status = nx_ftp_client_directory_listing_continue(&ftp_client, &recv_packet_ptr, 200); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + + if (status == NX_FTP_END_OF_LISTING) + break; + + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_LISTING) + { + error_counter++; + } + + /* Request a file downloaded. This sends PASV and STOR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "socket_tcp_client_recv2.pl", NX_FTP_OPEN_FOR_WRITE, 100); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + + /* Allocate an FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + error_counter++; + break; + } + + /* Write ABCs into the packet payload */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + status = nx_ftp_client_file_write(&ftp_client, my_packet, 500); + packets_sent++; + + if (status != NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + } while ((status == NX_SUCCESS) && (packets_sent < 2)); + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Delete the FTP client. */ + nx_ftp_client_delete(&ftp_client); +} + + +/* Define the helper FTP server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: FTP Passive Mode Transfer File Write Test................."); + + /* Check for earlier error. */ + if(error_counter) + { + error_counter++; + } + + /* Create a TCP socket as the FTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a secondary TCP socket as the FTP server passive mode connection. Do not bind a port yet */ + status = nx_tcp_socket_create(&server_ip, &server_socket_passive, "Passive Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Bind the TCP socket to the FTP control port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + ftp_test_initialize(); + + /* Let the client log in */ + + for (i = 0; i < LOGIN_RESPONSES; i++) + { + + status = nx_ftp_login_packet_send(&server_socket, 80, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if (i != 2) + { + + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + } + + /* This is responding to CWD */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 0); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is responding to PASV */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80,1); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PASSIVE_PORT1, &server_socket_passive, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket_passive, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is NLST command after passive connection set up */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 2); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_ftp_response_packet_send(&server_socket_passive, 80, 3); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_disconnect(&(server_socket_passive), 100); + nx_tcp_server_socket_unaccept(&server_socket_passive); + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PASSIVE_PORT1); + + status = nx_ftp_response_packet_send(&server_socket, 80, 4); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the second TYPE command (TYPE I) */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the second PASV request. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 6); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PASSIVE_PORT2, &server_socket_passive, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. We are assuming the server uses the same IP address, + although on real FTP servers this is not necessarily the case. */ + status = nx_tcp_server_socket_accept(&server_socket_passive, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is responding to the STOR command. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + status = nx_ftp_response_packet_send(&server_socket, 80, 7); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* this is the file data packet */ + status = nx_tcp_socket_receive(&server_socket_passive, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* this is the second data packet */ + status = nx_tcp_socket_receive(&server_socket_passive, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 8); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_disconnect(&(server_socket_passive), 100); + nx_tcp_server_socket_unaccept(&server_socket_passive); + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PASSIVE_PORT2); + + + /* this is the QUIT command. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + status = nx_ftp_response_packet_send(&server_socket, 80, 9); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disconnect and delete the TCP socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 100); + + /* Check status. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_delete(&server_socket); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; + + return; + +} + + +static void ftp_test_initialize() +{ + +/* Logging in responses */ + + ftp_login[0].ftp_response_pkt_data = &welcome_220_response[0]; + ftp_login[0].ftp_response_pkt_size = welcome_220_response_size ; + + ftp_login[1].ftp_response_pkt_data = &password_request_331[0]; + ftp_login[1].ftp_response_pkt_size = password_request_331_size ; + + ftp_login[2].ftp_response_pkt_data = &logged_in_230_response[0]; + ftp_login[2].ftp_response_pkt_size = logged_in_230_response_size ; + +/* Download data responses */ + ftp_response[0].ftp_response_pkt_data = &cwd_250_response[0]; + ftp_response[0].ftp_response_pkt_size = cwd_250_response_size ; + + + ftp_response[1].ftp_response_pkt_data = &pasv_nlst_227_response[0]; + ftp_response[1].ftp_response_pkt_size = pasv_nlst_227_response_size ; + + ftp_response[2].ftp_response_pkt_data = &nlst_complete_150_response[0]; + ftp_response[2].ftp_response_pkt_size = nlst_complete_150_response_size ; + + ftp_response[3].ftp_response_pkt_data = &server_nlst_download1_response[0]; + ftp_response[3].ftp_response_pkt_size = server_nlst_download1_response_size ; + + ftp_response[4].ftp_response_pkt_data = &nlst_complete_226_response[0]; + ftp_response[4].ftp_response_pkt_size = nlst_complete_226_response_size ; + + + ftp_response[5].ftp_response_pkt_data = &type_I_200_response[0]; + ftp_response[5].ftp_response_pkt_size = type_I_200_response_size ; + + ftp_response[6].ftp_response_pkt_data = &pasv2_227_response[0]; + ftp_response[6].ftp_response_pkt_size = pasv2_227_response_size ; + + ftp_response[7].ftp_response_pkt_data = &stor_150_response[0]; + ftp_response[7].ftp_response_pkt_size = stor_150_response_size ; + + ftp_response[8].ftp_response_pkt_data = &download_complete_226_response[0]; + ftp_response[8].ftp_response_pkt_size = download_complete_226_response_size ; + + ftp_response[9].ftp_response_pkt_data = &quit_221_response[0]; + ftp_response[9].ftp_response_pkt_size = quit_221_response_size ; +} + + + +static UINT nx_ftp_login_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *login_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &login_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(login_packet -> nx_packet_prepend_ptr, ftp_login[packet_number].ftp_response_pkt_data, + ftp_login[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + login_packet -> nx_packet_length = ftp_login[packet_number].ftp_response_pkt_size; + login_packet -> nx_packet_append_ptr = login_packet -> nx_packet_prepend_ptr + login_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, login_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(login_packet); + + return status; +} + + +static UINT nx_ftp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the FTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, ftp_response[packet_number].ftp_response_pkt_data, + ftp_response[packet_number].ftp_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = ftp_response[packet_number].ftp_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_client_pasv_file_write_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Passive Mode Transfer File Write Test.................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_commands_characters_test.c b/test/regression/ftp_test/netx_ftp_commands_characters_test.c new file mode 100644 index 00000000..09cf55c5 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_commands_characters_test.c @@ -0,0 +1,377 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG up_counter = 0; +static ULONG low_counter = 0; +static ULONG command_success_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_commands_characters_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + status = nx_ftp_client_directory_create(&ftp_client,"/abc", NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "Mkd /def", 8); + + *(my_packet -> nx_packet_prepend_ptr + 8) = 13; + *(my_packet -> nx_packet_prepend_ptr + 9) = 10; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 10; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 10; + + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /* Wait for response from the FTP server. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &my_packet, NX_IP_PERIODIC_RATE/2); + /* Determine if a packet was not received. */ + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + status = nx_ftp_client_directory_default_set(&ftp_client, "/abc" ,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + status = nx_ftp_client_directory_default_set(&ftp_client, "/def" ,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Commands Characters Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || (up_counter != 1) || (low_counter != 1) || (command_success_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *message == 'M' ) + { + + if(!memcmp(message,"MKD /abc ",8)) + up_counter++; + else if(!memcmp(message,"Mkd /def ",8)) + { + low_counter++; + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((packet_ptr -> nx_packet_length > 23) && (!memcmp(message,"200",3))) + command_success_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_commands_characters_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Commands Characters Test..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_commands_replys_test.c b/test/regression/ftp_test/netx_ftp_commands_replys_test.c new file mode 100644 index 00000000..ab3e3dc9 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_commands_replys_test.c @@ -0,0 +1,444 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UCHAR command_counter[7]; +static UCHAR reply_counter[7]; +static ULONG reply_specified = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_commands_replys_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR *temp; +UINT i; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "NOOP ",5); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 5; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 5; + + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /* Wait for response from the FTP server. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &my_packet, NX_IP_PERIODIC_RATE/2); + /* Determine if a packet was not received. */ + if (status) + error_counter++; + else + { + /*Check if the reply is defined to contain the 3-digit code, followed by Space, followed by one line of text */ + temp = my_packet->nx_packet_prepend_ptr; + if ((*temp >= '0' && *temp <= '9') && + (*(temp + 1) >= '0' && *(temp + 1) <= '9') && + (*(temp + 2) >= '0' && *(temp + 2) <= '9') && + (*(temp +3) == ' ') && + (*(temp + 4) >= 65 && *(temp + 4) <= 122)) + reply_specified++; + } + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Now open the same file for reading. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + for(i = 0;i < 7; i++) + { + if((command_counter[i] != NX_TRUE) || (reply_counter[i] != NX_TRUE)) + error_counter++; + } + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Reply Standard and Minimum Implementation Test........"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || (reply_specified != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check if our host can accept these commands*/ + if(!memcmp(message,"USER ",5)) + command_counter[0] = NX_TRUE; + else if(!memcmp(message,"PORT ",5)) + command_counter[1] = NX_TRUE; + else if(!memcmp(message,"TYPE ",5)) + command_counter[2] = NX_TRUE; + else if(!memcmp(message,"RETR ",5)) + command_counter[3] = NX_TRUE; + else if(!memcmp(message,"STOR ",5)) + command_counter[4] = NX_TRUE; + else if(!memcmp( message,"NOOP ",5)) + command_counter[5] = NX_TRUE; + else if(!memcmp( message,"QUIT",4)) + command_counter[6] = NX_TRUE; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check if our host can accept these commands successfully*/ + if(!memcmp(message,"230 Logged in",13)) + reply_counter[0] = NX_TRUE; + else if(!memcmp(message,"200 Port set",12)) + reply_counter[1] = NX_TRUE; + else if(!memcmp(message,"200 Type Binary",15)) + reply_counter[2] = NX_TRUE; + else if(!memcmp(message,"250 File Sent",13)) + reply_counter[3] = NX_TRUE; + else if(!memcmp(message,"250 File Written ",16)) + reply_counter[4] = NX_TRUE; + else if(!memcmp( message,"200 NOOP Success",16)) + reply_counter[5] = NX_TRUE; + else if(!memcmp( message,"221 Logging Off",15)) + reply_counter[6] = NX_TRUE; + /* Check if any command cause a wrong reply information*/ + else if (*message == '5' && *(message + 3) == ' ') + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_commands_replys_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Reply Standard and Minimum Implementation Test........N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_control_connection_test.c b/test/regression/ftp_test/netx_ftp_control_connection_test.c new file mode 100644 index 00000000..e5f1bc74 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_control_connection_test.c @@ -0,0 +1,294 @@ +/* No.5 The control connection is used for the transfer of commands. + rfc959, page 9, 3. DATA TRANSFER FUNCTIONS */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_control_connection_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* If after closing the client data socket we can also successfully transfer FTP commands, then we can make sure that the The control connection is used for the transfer of commands.*/ + status = nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_data_socket), NX_IP_PERIODIC_RATE); + if(status != NX_NOT_CONNECTED && status != NX_SUCCESS) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Control Connection Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_control_connection_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Control Connection Test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_data_connection_test.c b/test/regression/ftp_test/netx_ftp_data_connection_test.c new file mode 100644 index 00000000..07bcdfbf --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_data_connection_test.c @@ -0,0 +1,367 @@ +/* No.4 Files are transferred only via the data connection. + rfc959, page 9, 3. DATA TRANSFER FUNCTIONS */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; +static UINT data_control_counter; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_data_connection_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + + data_control_counter = 0; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Now open the same file for reading. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + data_control_counter++; + nx_packet_release(my_packet); + } + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* If after closing the client data socket we can also successfully transfer FTP commands, then we can make sure that the The control connection is used for the transfer of commands.*/ + status = nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_data_socket), NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_data_socket)); + /* Check for error. */ + if(status) + error_counter++; + + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&ftp_client.nx_ftp_client_data_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the data socket connection we can find that we cannot successfully transfer the files. */ + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status == NX_NOT_BOUND) + data_control_counter++; + else + { + nx_packet_release(my_packet); + } + + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Data Connection Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter != 0) || (data_control_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_data_connection_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Data Connection Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_disconnection_event_test.c b/test/regression/ftp_test/netx_ftp_disconnection_event_test.c new file mode 100644 index 00000000..34517904 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_disconnection_event_test.c @@ -0,0 +1,312 @@ +/* Clent sends NLST and disconnets data socket. */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_disconnection_event_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT packets_sent = 0; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Send NLST command. The direcotory doesn't exist, should returen error and disconnect the data socket. */ + status = nx_ftp_client_directory_listing_get(&ftp_client, "/test", &recv_packet_ptr, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + { + error_counter++; + nx_packet_release(recv_packet_ptr); + } + + /* Let server processing disconnetion event. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Resume server thread. */ + tx_thread_resume(&server_thread); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Resume server thread. */ + tx_thread_resume(&server_thread); +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Disconnection Evnet Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + /* Only 4 control sockets should exist, all the data sockets need to be deleted. */ + if (server_ip.nx_ip_tcp_created_sockets_count > 4) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + /* Only 4 control sockets should exist, all the data sockets need to be deleted. */ + if (server_ip.nx_ip_tcp_created_sockets_count > 4) + error_counter++; + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_disconnection_event_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Disconnection Event Test..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_establish_data_connection_03_test.c b/test/regression/ftp_test/netx_ftp_establish_data_connection_03_test.c new file mode 100644 index 00000000..b8e6a62b --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_establish_data_connection_03_test.c @@ -0,0 +1,422 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG port_change_counter = 0; +static ULONG data_port_default = 0; +static UINT data_port = 0; +static UINT server_not_change_count = 0; +static NX_PACKET *my_packet; +static UCHAR buffer_ptr[30] = " "; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_03_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + data_port_default = ftp_client.nx_ftp_client_data_port; + + /* Pickup the next free port for the data socket. */ + if (ftp_client.nx_ftp_client_data_port >= NX_MAX_PORT) + { + + status = nx_tcp_free_port_find(ftp_client.nx_ftp_client_ip_ptr, + ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port, &data_port); + + if (data_port <= ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port) + { + + status = NX_NO_FREE_PORTS; + } + } + else + { + + /* Try to increment the data port by one. */ + status = nx_tcp_free_port_find(ftp_client.nx_ftp_client_ip_ptr, + ftp_client.nx_ftp_client_data_port + 2, &data_port); + + if (data_port <= ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port) + { + + status = nx_tcp_free_port_find(ftp_client.nx_ftp_client_ip_ptr, + ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port, &data_port); + + if (data_port <= ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_port) + { + + status = NX_NO_FREE_PORTS; + } + } + } + + if(status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + /* Let the Server change the port */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if(ftp_client.nx_ftp_client_data_port == data_port_default) + server_not_change_count++; + + nx_packet_release(my_packet); + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if ((status != 0) && (status != NX_FTP_EXPECTED_2XX_CODE)) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_address; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Change Default Port Test......................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&server_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + ip_address = ftp_server.nx_ftp_server_ip_ptr->nx_ip_address; + + buffer_ptr[0] = (UCHAR)'P'; + buffer_ptr[1] = (UCHAR)'O'; + buffer_ptr[2] = (UCHAR)'R'; + buffer_ptr[3] = (UCHAR)'T'; + buffer_ptr[4] = (UCHAR)' '; + + buffer_ptr[5] = (UCHAR)('0' + (ip_address >> 24)/100); + buffer_ptr[6] = (UCHAR)('0' + ((ip_address >> 24)/10)%10); + buffer_ptr[7] = (UCHAR)('0' + (ip_address >> 24)%10); + buffer_ptr[8] = ','; + + buffer_ptr[9] = (UCHAR)('0' + ((ip_address >> 16) & 0xFF)/100); + buffer_ptr[10] = (UCHAR)('0' + (((ip_address >> 16) & 0xFF)/10)%10); + buffer_ptr[11] = (UCHAR)('0' + ((ip_address >> 16) & 0xFF)%10); + buffer_ptr[12] = (UCHAR)','; + + buffer_ptr[13] = (UCHAR)('0' + ((ip_address >> 8) & 0xFF)/100); + buffer_ptr[14] = (UCHAR)('0' + (((ip_address >> 8) & 0xFF)/10)%10); + buffer_ptr[15] = (UCHAR)('0' + ((ip_address >> 8) & 0xFF)%10); + buffer_ptr[16] = (UCHAR)','; + + buffer_ptr[17] = (UCHAR)('0' + (ip_address & 0xFF)/100); + buffer_ptr[18] = (UCHAR)('0' + ((ip_address & 0xFF)/10)%10); + buffer_ptr[19] = (UCHAR)('0' + (ip_address & 0xFF)%10); + buffer_ptr[20] = (UCHAR)','; + + buffer_ptr[21] = (UCHAR)('0' + (data_port >> 8)/100); + buffer_ptr[22] = (UCHAR)('0' + ((data_port >> 8)/10)%10); + buffer_ptr[23] = (UCHAR)('0' + ((data_port >> 8)%10)); + buffer_ptr[24] = ','; + + buffer_ptr[25] = (UCHAR)('0' + (data_port & 255)/100); + buffer_ptr[26] = (UCHAR)('0' + ((data_port & 255)/10)%10); + buffer_ptr[27] = (UCHAR)('0' + ((data_port & 255)%10)); + + /* Set the CR/LF. */ + buffer_ptr[28] = 13; + buffer_ptr[29] = 10; + + + + /* Change the port to the one we found.. */ + memcpy(my_packet -> nx_packet_prepend_ptr, buffer_ptr, 30); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 30; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 30; + + status = nx_tcp_socket_send(&ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_control_socket, my_packet, NX_IP_PERIODIC_RATE/2); + if(status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || (server_not_change_count != 1) || (port_change_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (*message == 'P') && (*(message+1) == 'O')) + { + if(!memcmp(message,buffer_ptr,28)) + port_change_counter++; + + /* Deal packets with default routing. */ + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_03_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Change Default Port Test.......................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/ftp_test/netx_ftp_establish_data_connection_05_test.c b/test/regression/ftp_test/netx_ftp_establish_data_connection_05_test.c new file mode 100644 index 00000000..633409e6 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_establish_data_connection_05_test.c @@ -0,0 +1,303 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG control_disconnect_counter = 0; +static ULONG server_disconnect_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_05_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Make a situation that the control connection is closed legally */ + nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_control_socket), NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_control_socket)); + if (status) + error_counter++; + + if(ftp_client.nx_ftp_client_control_socket.nx_tcp_socket_state == NX_TCP_CLOSED) + control_disconnect_counter++; + + if(ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + server_disconnect_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Close Data Connection 05 Test.................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || (control_disconnect_counter != 1) || (server_disconnect_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_05_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Close Data Connection 05 Test..................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_establish_data_connection_06_test.c b/test/regression/ftp_test/netx_ftp_establish_data_connection_06_test.c new file mode 100644 index 00000000..c9236e4a --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_establish_data_connection_06_test.c @@ -0,0 +1,337 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG eof_counter = 0; +static UINT test_done = NX_FALSE; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_06_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Now open the same file for reading. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_FTP_END_OF_FILE) + { + eof_counter++; + } + else + error_counter++; + + if(ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + error_counter++; + + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Close Data Connection 06 Test.................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter !=0) && ( eof_counter == 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_06_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Close Data Connection 06 Test..................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_establish_data_connection_08_test.c b/test/regression/ftp_test/netx_ftp_establish_data_connection_08_test.c new file mode 100644 index 00000000..ce852f94 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_establish_data_connection_08_test.c @@ -0,0 +1,340 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG server_reply_counter = 0; +static UINT test_done = NX_FALSE; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_08_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + if(ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Close Data Connection 08 Test.................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) && ( server_reply_counter != 1 )) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (*message >= '0') && (*(message) <= '9')) + { + if((!memcmp(message,"250",3)) || (!memcmp(message,"226",3)) ) + server_reply_counter++; + + /* Deal packets with default routing. */ + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_establish_data_connection_08_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Close Data Connection 08 Test..................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_ipv6_epsv_test.c b/test/regression/ftp_test/netx_ftp_ipv6_epsv_test.c new file mode 100644 index 00000000..a0f131cf --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_ipv6_epsv_test.c @@ -0,0 +1,467 @@ +/* Clent sends EPSV twice. */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_RESET_DISCONNECT) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define NetX Duo IP address for the NetX Duo FTP Server and Client. */ +static NXD_ADDRESS server_ip_address; +static NXD_ADDRESS client_ip_address; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login6(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, NXD_ADDRESS *client_ipduo_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout6(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, NXD_ADDRESS *client_ipduo_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_ipv6_epsv_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nxd_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login6, server_logout6); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Next set the NetX Duo FTP Server and Client addresses. */ + server_ip_address.nxd_ip_address.v6[3] = 0x105; + server_ip_address.nxd_ip_address.v6[2] = 0x0; + server_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + server_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + + client_ip_address.nxd_ip_address.v6[3] = 0x101; + client_ip_address.nxd_ip_address.v6[2] = 0x0; + client_ip_address.nxd_ip_address.v6[1] = 0x0000f101; + client_ip_address.nxd_ip_address.v6[0] = 0x20010db8; + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT status; +UINT iface_index, address_index; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Here's where we make the FTP Client IPv6 enabled. */ + status = nxd_ipv6_enable(&client_ip); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + status = nxd_icmp_enable(&client_ip); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Set the Client link local and global addresses. */ + iface_index = 0; + + /* This assumes we are using the primary network interface (index 0). */ + status = nxd_ipv6_address_set(&client_ip, iface_index, NX_NULL, 10, &address_index); + + /* Check for link local address set error. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Set the host global IP address. We are assuming a 64 + bit prefix here but this can be any value (< 128). */ + status = nxd_ipv6_address_set(&client_ip, iface_index, &client_ip_address, 64, &address_index); + + /* Check for global address set error. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Let NetX Duo validate the addresses. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nxd_ftp_client_connect(&ftp_client, &server_ip_address, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* This sends EPSV commands and opens data socket. */ + _nx_ftp_client_passive_transfer_setup(&ftp_client, NX_IP_PERIODIC_RATE); + nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_data_socket), NX_NO_WAIT); + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_data_socket)); + + /* Request a file downloaded. This sends EPSV and STOR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, 100); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Allocate an FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the packet payload */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + status = nx_ftp_client_file_write(&ftp_client, my_packet, 500); + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Request a file downloaded. This sends EPSV and RETR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, 100); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + status = nx_ftp_client_file_read(&ftp_client, &recv_packet_ptr, 500); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_FILE) + { + error_counter++; + } + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Resume server thread. */ + tx_thread_resume(&server_thread); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + if (((UINT)packet_ptr -> nx_packet_prepend_ptr & 0x3) != 0) + { + error_counter++; + } + + return(NX_TRUE); +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +UINT iface_index, address_index; + + /* Print out test information banner. */ + printf("NetX Test: FTP IPv6 EPSV Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + packet_process_callback = my_packet_process; + + /* Here's where we make the FTP server IPv6 enabled. */ + status = nxd_ipv6_enable(&server_ip); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + status = nxd_icmp_enable(&server_ip); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Set the link local address with the host MAC address. */ + iface_index = 0; + + /* This assumes we are using the primary network interface (index 0). */ + status = nxd_ipv6_address_set(&server_ip, iface_index, NX_NULL, 10, &address_index); + + /* Check for link local address set error. */ + if (status) + { + error_counter++; + } + + /* Set the host global IP address. We are assuming a 64 + bit prefix here but this can be any value (< 128). */ + status = nxd_ipv6_address_set(&server_ip, iface_index, &server_ip_address, 64, &address_index); + + /* Check for global address set error. */ + if (status) + { + error_counter++; + } + + /* Wait while NetX Duo validates the link local and global address. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + /* Only 4 control sockets should exist, all the data sockets need to be deleted. */ + if (server_ip.nx_ip_tcp_created_sockets_count > 4) + error_counter++; + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login6(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, NXD_ADDRESS *client_ipduo_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout6(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, NXD_ADDRESS *client_ipduo_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_ipv6_epsv_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP IPv6 EPSV Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_parse_ipv6_address_test.c b/test/regression/ftp_test/netx_ftp_parse_ipv6_address_test.c new file mode 100644 index 00000000..32534225 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_parse_ipv6_address_test.c @@ -0,0 +1,118 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if defined(FEATURE_NX_IPV6) + +#define DEMO_STACK_SIZE 4096 + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; + +static TX_THREAD test_thread; +static void thread_test_entry(ULONG thread_input); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_parse_ipv6_address_test_application_define(void *first_unused_memory) +#endif +{ + +UCHAR *pointer; + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "FTP test thread", thread_test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the helper FTP server thread. */ +void thread_test_entry(ULONG thread_input) +{ +UINT i; +UINT status; +UCHAR *buffer_ptr; +UCHAR valid_buffer[100]; + + + /* Print out test information banner. */ + printf("NetX Test: FTP Parse IPv6 Address Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + memset(valid_buffer, 0xFF, sizeof(valid_buffer)); + + /* Invalid colons 1. */ + buffer_ptr = "1:2:3:4:5:6:7:8:9:10"; + status = _nx_ftp_utility_parse_IPv6_address(buffer_ptr, 21, (NXD_ADDRESS *)(&valid_buffer)); + if (status != NX_FTP_INVALID_ADDRESS) + error_counter++; + + /* Invalid conlons 2. */ + buffer_ptr = "1:2:3:4:5:6::8:9:10"; + status = _nx_ftp_utility_parse_IPv6_address(buffer_ptr, 20, (NXD_ADDRESS *)(&valid_buffer)); + if (status != NX_FTP_INVALID_ADDRESS) + error_counter++; + + /* Invalid conlons 3. */ + buffer_ptr = "1:2:3::4:5:6:7:8"; + status = _nx_ftp_utility_parse_IPv6_address(buffer_ptr, 17, (NXD_ADDRESS *)(&valid_buffer)); + if (status != NX_FTP_INVALID_ADDRESS) + error_counter++; + + /* Check write overflow. */ + for (i = sizeof(NXD_ADDRESS); i < sizeof(valid_buffer); i++) + { + if (valid_buffer[i] != 0xFF) + { + error_counter++; + break; + } + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_parse_ipv6_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Parse IPv6 Address Test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_pasv_port_test.c b/test/regression/ftp_test/netx_ftp_pasv_port_test.c new file mode 100644 index 00000000..3e8733a4 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_pasv_port_test.c @@ -0,0 +1,321 @@ +/* Clent sends PASV and format of IP address and port in the response. */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_pasv_port_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UCHAR buffer[] = "227 Entering Passive Mode (1,2,3,4,192,0).\r\n"; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* This sends PASV commands and opens data socket. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write QUIT into the packet payload */ + memcpy(my_packet -> nx_packet_prepend_ptr, "PASV\r\n", 6); + my_packet -> nx_packet_length = 6; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 6; + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(my_packet); + } + + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &recv_packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + } + else + { + + /* Check if the format of IP address and port are correct. */ + if ((recv_packet_ptr -> nx_packet_length != (sizeof(buffer) - 1)) || + (memcmp(recv_packet_ptr -> nx_packet_prepend_ptr, buffer, sizeof(buffer) - 1) != 0)) + { + error_counter++; + } + + nx_packet_release(recv_packet_ptr); + } + + /* Disconnect the FTP client. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Resume server thread. */ + tx_thread_resume(&server_thread); +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP PASV Port Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_pasv_port_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP PASV Port Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_pasv_stor_test.c b/test/regression/ftp_test/netx_ftp_pasv_stor_test.c new file mode 100644 index 00000000..874e4588 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_pasv_stor_test.c @@ -0,0 +1,489 @@ +/* Test steps: + 1. Client sends STOR in passive mode; + 2. Client connects data socket and sends data; + 3. Client disconnects data socket; + 4. Client receives the response of STOR; + */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_pasv_stor_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT status; +UCHAR *buffer_ptr; +UINT data_port; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* This sends TYPE commands. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + memcpy(my_packet -> nx_packet_prepend_ptr, "TYPE I\r\n", 8); + my_packet -> nx_packet_length = 8; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Check response for PASV. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &recv_packet_ptr, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + buffer_ptr = recv_packet_ptr -> nx_packet_prepend_ptr; + if ((recv_packet_ptr -> nx_packet_length < 3) || (buffer_ptr[0] != '2')) + { + error_counter++; + } + nx_packet_release(recv_packet_ptr); + } + + /* This sends PASV commands. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + memcpy(my_packet -> nx_packet_prepend_ptr, "PASV\r\n", 6); + my_packet -> nx_packet_length = 6; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Check response for PASV. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &recv_packet_ptr, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + buffer_ptr = recv_packet_ptr -> nx_packet_prepend_ptr; + if ((recv_packet_ptr -> nx_packet_length < 3) || (buffer_ptr[0] != '2') || (buffer_ptr[1] != '2') || (buffer_ptr[2] != '7')) + { + error_counter++; + } + nx_packet_release(recv_packet_ptr); + } + +#ifdef __PRODUCT_NETXDUO__ + ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = FTP_SERVER_ADDRESS; +#else + ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_connect_ip = FTP_SERVER_ADDRESS; +#endif /* __PRODUCT_NETXDUO__ */ + data_port = ftp_server.nx_ftp_server_data_port - 1; + + /* This sends STOR commands. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + memcpy(my_packet -> nx_packet_prepend_ptr, "STOR test.txt\r\n", 15); + my_packet -> nx_packet_length = 15; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Bind the client data socket to any port. */ + status = nx_tcp_client_socket_bind((&ftp_client.nx_ftp_client_data_socket), NX_ANY_PORT, NX_IP_PERIODIC_RATE); + /* Check for an error. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Now connect to the IP address and port the server asked us to. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tcp_client_socket_connect(&(ftp_client.nx_ftp_client_data_socket), + &(ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_connect_ip), + data_port, NX_IP_PERIODIC_RATE); +#else + status = nx_tcp_client_socket_connect(&(ftp_client.nx_ftp_client_data_socket), + ftp_client.nx_ftp_client_data_socket.nx_tcp_socket_connect_ip, + data_port, NX_IP_PERIODIC_RATE); +#endif /* __PRODUCT_NETXDUO__ */ + + /* Check for an error. */ + if (status != NX_SUCCESS) + { + error_counter++; + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_data_socket)); + } + + /* Allocate an FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_data_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect the data socket. */ + _nx_ftp_client_data_socket_cleanup(&ftp_client, 50); + + /* Check response for STOR. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &recv_packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + buffer_ptr = recv_packet_ptr -> nx_packet_prepend_ptr; + if ((recv_packet_ptr -> nx_packet_length < 3) || (buffer_ptr[0] != '1')) + { + error_counter++; + } + nx_packet_release(recv_packet_ptr); + } + + /* Check response for file write. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &recv_packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + buffer_ptr = recv_packet_ptr -> nx_packet_prepend_ptr; + if ((recv_packet_ptr -> nx_packet_length < 3) || (buffer_ptr[0] != '2')) + { + error_counter++; + } + nx_packet_release(recv_packet_ptr); + } + + if (error_counter) + { + tx_thread_resume(&server_thread); + return; + } + + /* Check if file is stored in server. */ + /* Request a file downloaded. This sends PASV and RETR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, 100); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + status = nx_ftp_client_file_read(&ftp_client, &recv_packet_ptr, 500); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_FILE) + { + error_counter++; + } + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Resume server thread. */ + tx_thread_resume(&server_thread); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + if (((UINT)packet_ptr -> nx_packet_prepend_ptr & 0x3) != 0) + { + error_counter++; + } + + return(NX_TRUE); +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP PASV STOR Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + packet_process_callback = my_packet_process; + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_pasv_stor_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP PASV STOR Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_pasv_twice_test.c b/test/regression/ftp_test/netx_ftp_pasv_twice_test.c new file mode 100644 index 00000000..31a1fb65 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_pasv_twice_test.c @@ -0,0 +1,414 @@ +/* Clent sends PASV twice. */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_pasv_twice_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet, *recv_packet_ptr; +UINT packets_sent = 0; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Enable passive mode. */ + status = nx_ftp_client_passive_mode_set(&ftp_client, NX_TRUE); + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* This sends PASV commands and opens data socket. */ + _nx_ftp_client_passive_transfer_setup(&ftp_client, NX_IP_PERIODIC_RATE); + nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_data_socket), NX_NO_WAIT); + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_data_socket)); + + /* Request a file downloaded. This sends PASV and STOR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, 100); + if (status != NX_SUCCESS) + { + error_counter++; + } + + + /* Allocate an FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the packet payload */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + status = nx_ftp_client_file_write(&ftp_client, my_packet, 500); + packets_sent++; + + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Request a file downloaded. This sends PASV and RETR commands and opens another data socket. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, 100); + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + status = nx_ftp_client_file_read(&ftp_client, &recv_packet_ptr, 500); + if (status == NX_SUCCESS) + { + nx_packet_release(recv_packet_ptr); + } + } while (status == NX_SUCCESS); + + /* Check for complete download. */ + if (status != NX_FTP_END_OF_FILE) + { + error_counter++; + } + + /* This does not send a command. The data port is closed and the client state set to CONNECTED. + The server initiates closing the data socket connection. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + tx_thread_resume(&server_thread); + + /* This sends PASV commands and opens data socket. */ + _nx_ftp_client_passive_transfer_setup(&ftp_client, NX_IP_PERIODIC_RATE); + nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_data_socket), NX_NO_WAIT); + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_data_socket)); + + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write QUIT into the packet payload */ + memcpy(my_packet -> nx_packet_prepend_ptr, "QUIT\r\n", 6); + my_packet -> nx_packet_length = 6; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 6; + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Wait for response from the FTP server. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &recv_packet_ptr, NX_IP_PERIODIC_RATE); + + /* Determine if a packet was not received. */ + if (status) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Disconnect from the server. */ + ftp_client.nx_ftp_client_state = NX_FTP_STATE_NOT_CONNECTED; + nx_tcp_socket_disconnect(&(ftp_client.nx_ftp_client_control_socket), NX_NO_WAIT); + nx_tcp_client_socket_unbind(&(ftp_client.nx_ftp_client_control_socket)); + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Resume server thread. */ + tx_thread_resume(&server_thread); +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP PASV Twice Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + /* Only 4 control sockets should exist, all the data sockets need to be deleted. */ + if (server_ip.nx_ip_tcp_created_sockets_count > 4) + error_counter++; + + /* Wait for test. */ + tx_thread_suspend(&server_thread); + + /* Only 4 control sockets should exist, all the data sockets need to be deleted. */ + if (server_ip.nx_ip_tcp_created_sockets_count > 4) + error_counter++; + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_pasv_twice_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP PASV Twice Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_rst_test.c b/test/regression/ftp_test/netx_ftp_rst_test.c new file mode 100644 index 00000000..f74ee0a2 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_rst_test.c @@ -0,0 +1,338 @@ +/* This case tests the FTP server on handling RST packet. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-235 + */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include +#include +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + + + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; +static TX_THREAD test_threads[NX_FTP_MAX_CLIENTS]; +static NX_TCP_SOCKET test_sockets[NX_FTP_MAX_CLIENTS]; +static UINT run_count[NX_FTP_MAX_CLIENTS]; +static UCHAR test_thread_stack[NX_FTP_MAX_CLIENTS][DEMO_STACK_SIZE]; +static TX_SEMAPHORE sema_0; + +/* Define FTP objects. */ + +static NX_FTP_SERVER ftp_server; +static FX_MEDIA ram_disk; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +static UINT data_received; +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _fx_ram_driver(FX_MEDIA *media_ptr); + + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_rst_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &ip_server, &ram_disk, pointer, DEMO_STACK_SIZE, &pool_server, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +static void thread_test_entry(ULONG thread_input) +{ +NX_TCP_SOCKET *socket_ptr = &test_sockets[thread_input]; +UINT status; +UINT i; + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_client, socket_ptr, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + for (i = 0; i < LOOP; i++) + { + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(socket_ptr, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + status = nx_tcp_client_socket_connect(socket_ptr, SERVER_ADDRESS, NX_FTP_SERVER_CONTROL_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + nx_tcp_socket_disconnect(socket_ptr, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(socket_ptr); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + run_count[thread_input]++; + } + + nx_tcp_socket_delete(socket_ptr); + tx_semaphore_put(&sema_0); +} + +/* Define the Server thread. */ +static void thread_server_entry(ULONG thread_input) +{ + +UINT i; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP RST Test.............................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + run_count[i] = 0; + tx_thread_create(&test_threads[i], "Test thread", thread_test_entry, i, + test_thread_stack[i], DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (tx_semaphore_get(&sema_0, 30 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + break; + } + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (run_count[i] != LOOP) + { + error_counter++; + } + } + + status = nx_ftp_server_stop(&ftp_server); + if (status) + error_counter++; + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_rst_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: FTP RST Test..............................................N/A\n"); + test_control_return(3); +} +#endif + + diff --git a/test/regression/ftp_test/netx_ftp_server_abnormal_packet_test.c b/test/regression/ftp_test/netx_ftp_server_abnormal_packet_test.c new file mode 100644 index 00000000..eab6f20e --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_server_abnormal_packet_test.c @@ -0,0 +1,349 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +extern VOID _nx_ftp_server_command_present(NX_TCP_SOCKET *control_socket_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +static UCHAR valid_buffer[4]; +static UCHAR *valid_data_ptr = NX_NULL; +static VOID tcp_receive_callback(NX_TCP_SOCKET *tcp_socket) +{ +NX_PACKET *packet_ptr = tcp_socket -> nx_tcp_socket_receive_queue_head; +UCHAR *buffer_ptr; + + _nx_ftp_server_command_present(tcp_socket); + + if (!packet_ptr) + return; + + buffer_ptr = packet_ptr -> nx_packet_prepend_ptr; + if (buffer_ptr[20] == 'C') + { + + /* Move payload to the end of the packet. */ + memmove(packet_ptr -> nx_packet_data_end - packet_ptr -> nx_packet_length, buffer_ptr, packet_ptr -> nx_packet_length); + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_end - packet_ptr -> nx_packet_length; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_end; + valid_data_ptr = packet_ptr -> nx_packet_data_end; + memcpy(valid_buffer, valid_data_ptr, sizeof(valid_buffer)); + } +} + +/* Define the FTP client thread. */ +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UCHAR *buffer_ptr; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate packet. */ + status = _nx_ftp_client_packet_allocate(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + ftp_server.nx_ftp_server_client_list[0].nx_ftp_client_request_control_socket.nx_tcp_receive_callback = tcp_receive_callback; + buffer_ptr = my_packet -> nx_packet_prepend_ptr; + + /* Build "CDUP" message. */ + buffer_ptr[0] = 'C'; + buffer_ptr[1] = 'D'; + buffer_ptr[2] = 'U'; + buffer_ptr[3] = 'P'; + buffer_ptr[4] = ' '; + + /* Set the packet length. */ + my_packet -> nx_packet_length = 5; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Send the packet. */ + status = nx_tcp_socket_send(&(ftp_client.nx_ftp_client_control_socket), my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(my_packet); + error_counter++; + test_done = NX_TRUE; + return; + } + + /* Wait for response from the FTP server. */ + status = nx_tcp_socket_receive(&(ftp_client.nx_ftp_client_control_socket), &my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + + /* Check if the buffer was modified. */ + if (valid_data_ptr) + { + if (memcmp(valid_buffer, valid_data_ptr, sizeof(valid_buffer)) != 0) + error_counter++; + } + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Abnormal Packet Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* OK to restart the ftp Server. */ + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Abnormal Packet Test...........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_server_dangling_pointer_test.c b/test/regression/ftp_test/netx_ftp_server_dangling_pointer_test.c new file mode 100644 index 00000000..d09dc458 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_server_dangling_pointer_test.c @@ -0,0 +1,351 @@ +/* This test case focus on a bug that nx_ftp_client_request_packet will be released multiple times in NX_FTP_QUIT command process. */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_INFO) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_TCP_SOCKET client_socket; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT send_data(CHAR *data); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_dangling_pinter_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "FTP Client Socket", NX_IP_NORMAL, + NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 512, NX_NULL, NX_NULL); + if (status) + error_counter++; + + for (i = 0; i <= NX_FTP_MAX_CLIENTS; i++) + { + + /* Bind to any port. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_NO_WAIT); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_tcp_client_socket_connect(&client_socket, FTP_SERVER_ADDRESS, NX_FTP_SERVER_CONTROL_PORT, + NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = send_data("USER aaa\n"); + if (status) + error_counter++; + + status = send_data("PASS aaa\n"); + if (status) + error_counter++; + + if (i != NX_FTP_MAX_CLIENTS) + { + status = send_data("TYPE I\n"); + if (status) + error_counter++; + + status = send_data("STOR 1.txt\n"); + if (status) + error_counter++; + + status = send_data("RNFR 1.txt\n"); + if (status) + error_counter++; + } + + status = send_data("QUIT\n"); + if (status) + error_counter++; + + /* Disconnect from the server. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&client_socket); + } + + /* Cleanup the socket. */ + nx_tcp_client_socket_unbind(&client_socket); + nx_tcp_socket_delete(&client_socket); + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Dangling Pointer Test.........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* OK to restart the ftp Server. */ + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + /* Make sure there is no invalid release. */ + if (server_pool.nx_packet_pool_invalid_releases) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT send_data(CHAR *data) +{ +UINT status; +NX_PACKET *packet_ptr; + + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + return(status); + + status = nx_packet_data_append(packet_ptr, data, strlen(data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(packet_ptr); + return(status); + } + + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(packet_ptr); + return(status); + } + + /* Return success. */ + return(NX_SUCCESS); +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_dangling_pinter_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Dangling Pointer Test..........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_server_invalid_month_crash_test.c b/test/regression/ftp_test/netx_ftp_server_invalid_month_crash_test.c new file mode 100644 index 00000000..7d5f3297 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_server_invalid_month_crash_test.c @@ -0,0 +1,740 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "fx_system.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT ftp_client_directory_listing_get(NX_FTP_CLIENT *ftp_client_ptr, CHAR *directory_path, + NX_PACKET **packet_ptr, ULONG wait_option); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT ftp_server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT ftp_server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_invalid_month_crash_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + ftp_server_login, ftp_server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status, date; +ULONG packet_size = 0; + + + /* Make filex crashed. */ + date = _fx_system_date; + _fx_system_date = 0; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Fix the mistake. */ + _fx_system_date = date; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test1.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Send LIST command to get directory listing. */ + status = ftp_client_directory_listing_get(&ftp_client, "", &my_packet, 200); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + packet_size += my_packet -> nx_packet_length; + nx_packet_release(my_packet); + } + do + { + /* Receive the next data packet. */ + status = nx_ftp_client_directory_listing_continue(&ftp_client, &my_packet, 200); + if (status == NX_SUCCESS) + { + packet_size += my_packet -> nx_packet_length; + nx_packet_release(my_packet); + } + } while (status == NX_SUCCESS); + + /* Check the packet size. */ + if (packet_size != 61) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Invalid Month Crash Test......................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* OK to restart the ftp Server. */ + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT ftp_server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT ftp_server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + + +/* Send LIST command. */ +static UINT ftp_client_directory_listing_get(NX_FTP_CLIENT *ftp_client_ptr, CHAR *directory_path, + NX_PACKET **packet_ptr, ULONG wait_option) +{ + +UINT i; +UINT data_port; +#ifndef NX_DISABLE_IPV4 +ULONG ip_address; +#endif /* NX_DISABLE_IPV4 */ +UCHAR *buffer_ptr; +NX_PACKET *new_packet_ptr; +UINT status; + + + /* Set packet pointer to NULL. */ + *packet_ptr = NX_NULL; + + /* Ensure the client is the proper state for directory listing request. */ + if (ftp_client_ptr -> nx_ftp_client_state != NX_FTP_STATE_CONNECTED) + return(NX_FTP_NOT_CONNECTED); + + /* Transfer the data in active transfer mode. */ + /* Pickup the next free port for the data socket. */ + nx_tcp_free_port_find(ftp_client_ptr -> nx_ftp_client_ip_ptr, + ftp_client_ptr -> nx_ftp_client_control_socket.nx_tcp_socket_port, &data_port); + + /* Start listening on the data port. */ + status = nx_tcp_server_socket_listen(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port, + &(ftp_client_ptr -> nx_ftp_client_data_socket), 5, 0); + + /* Determine if the listen is successful. */ + if (status) + { + + /* Return error. */ + return(status); + } + + /* Allocate a packet for sending the PORT command. */ + status = _nx_ftp_client_packet_allocate(ftp_client_ptr, &new_packet_ptr, wait_option); + + /* Determine if the packet allocation was successful. */ + if (status) + { + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Return error. */ + return(status); + } + + /* We have a packet, setup pointer to the buffer area. */ + buffer_ptr = new_packet_ptr -> nx_packet_prepend_ptr; + +#ifdef __PRODUCT_NETXDUO__ + if (ftp_client_ptr -> nx_ftp_client_control_socket.nx_tcp_socket_connect_ip.nxd_ip_version == NX_IP_VERSION_V6) + { +#ifndef FEATURE_NX_IPV6 + return NX_NOT_ENABLED; +#else + CHAR ipduo_buffer[NX_FTP_IPV6_ADDRESS_BUFSIZE]; + UINT index; + UINT ipduo_size; + + /* EPRT command: EPRT |2|1080::8:800:200C:417A|5282| + RFC2428, Section2, Page3. */ + + buffer_ptr[0] = 'E'; + buffer_ptr[1] = 'P'; + buffer_ptr[2] = 'R'; + buffer_ptr[3] = 'T'; + buffer_ptr[4] = ' '; + buffer_ptr[5] = '|'; + buffer_ptr[6] = '2'; + buffer_ptr[7] = '|'; + + /* Convert the PORT command ipv6 address and port number format to ascii text. */ + + /* Clear our scratch buffer. */ + memset(&ipduo_buffer[0], 0, NX_FTP_IPV6_ADDRESS_BUFSIZE); + + /* Convert the IPv6 address to text. */ + status = _nx_ftp_utility_convert_IPv6_to_ascii(&(ftp_client_ptr -> nx_ftp_client_control_socket), + &ipduo_buffer[0], NX_FTP_IPV6_ADDRESS_BUFSIZE, &ipduo_size); + + /* Append to the packet buffer . */ + memcpy(&buffer_ptr[8], ipduo_buffer, ipduo_size); + + /* Update the index past the IPv6 address. */ + index = 8 + ipduo_size; + + /* Add the required space character. */ + buffer_ptr[index++] = '|'; + + /* Clear the scratch buffer again. */ + memset(&ipduo_buffer[0], 0, NX_FTP_IPV6_ADDRESS_BUFSIZE); + + /* Convert the preferred port to ascii. */ + status = _nx_ftp_utility_convert_portnumber_ascii(data_port, &ipduo_buffer[0], &ipduo_size); + + /* Append to the packet buffer. */ + memcpy(&buffer_ptr[index], ipduo_buffer, ipduo_size); + + /* Update the index past the port. */ + index += ipduo_size; + + /* Add the required space character. */ + buffer_ptr[index++] = '|'; + + /* Set the CR/LF. */ + buffer_ptr[index++] = 13; + buffer_ptr[index++] = 10; + + /* Null terminate the string. */ + buffer_ptr[index] = 0; + + /* Set the packet length. */ + new_packet_ptr -> nx_packet_length = strlen((const char *)buffer_ptr); +#endif /* FEATURE_NX_IPV6*/ + } + else +#endif /* __PRODUCT_NETXDUO__ */ + { + +#ifdef NX_DISABLE_IPV4 + return NX_NOT_ENABLED; +#else + /* Pickup the IP address of this IP instance. */ + ip_address = (ftp_client_ptr -> nx_ftp_client_ip_ptr) -> nx_ip_address; + + /* Now build the IP and port number FTP message. */ + buffer_ptr[0] = (UCHAR)'P'; + buffer_ptr[1] = (UCHAR)'O'; + buffer_ptr[2] = (UCHAR)'R'; + buffer_ptr[3] = (UCHAR)'T'; + buffer_ptr[4] = (UCHAR)' '; + + buffer_ptr[5] = (UCHAR)('0' + (ip_address >> 24)/100); + buffer_ptr[6] = (UCHAR)('0' + ((ip_address >> 24)/10)%10); + buffer_ptr[7] = (UCHAR)('0' + (ip_address >> 24)%10); + buffer_ptr[8] = ','; + + buffer_ptr[9] = (UCHAR)('0' + ((ip_address >> 16) & 0xFF)/100); + buffer_ptr[10] = (UCHAR)('0' + (((ip_address >> 16) & 0xFF)/10)%10); + buffer_ptr[11] = (UCHAR)('0' + ((ip_address >> 16) & 0xFF)%10); + buffer_ptr[12] = (UCHAR)','; + + buffer_ptr[13] = (UCHAR)('0' + ((ip_address >> 8) & 0xFF)/100); + buffer_ptr[14] = (UCHAR)('0' + (((ip_address >> 8) & 0xFF)/10)%10); + buffer_ptr[15] = (UCHAR)('0' + ((ip_address >> 8) & 0xFF)%10); + buffer_ptr[16] = (UCHAR)','; + + buffer_ptr[17] = (UCHAR)('0' + (ip_address & 0xFF)/100); + buffer_ptr[18] = (UCHAR)('0' + ((ip_address & 0xFF)/10)%10); + buffer_ptr[19] = (UCHAR)('0' + (ip_address & 0xFF)%10); + buffer_ptr[20] = (UCHAR)','; + + buffer_ptr[21] = (UCHAR)('0' + (data_port >> 8)/100); + buffer_ptr[22] = (UCHAR)('0' + ((data_port >> 8)/10)%10); + buffer_ptr[23] = (UCHAR)('0' + ((data_port >> 8)%10)); + buffer_ptr[24] = ','; + + buffer_ptr[25] = (UCHAR)('0' + (data_port & 255)/100); + buffer_ptr[26] = (UCHAR)('0' + ((data_port & 255)/10)%10); + buffer_ptr[27] = (UCHAR)('0' + ((data_port & 255)%10)); + + /* Set the CR/LF. */ + buffer_ptr[28] = 13; + buffer_ptr[29] = 10; + + /* Set the packet length. */ + new_packet_ptr -> nx_packet_length = 30; +#endif /* NX_DISABLE_IPV4 */ + } + + /* Setup the packet append pointer. */ + new_packet_ptr -> nx_packet_append_ptr = new_packet_ptr -> nx_packet_prepend_ptr + new_packet_ptr -> nx_packet_length; + + /* Send the PORT message. */ + status = nx_tcp_socket_send(&(ftp_client_ptr -> nx_ftp_client_control_socket), new_packet_ptr, wait_option); + + /* Determine if the send was unsuccessful. */ + if (status) + { + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Return error. */ + return(status); + } + + /* Wait for response from the FTP server. */ + status = nx_tcp_socket_receive(&(ftp_client_ptr -> nx_ftp_client_control_socket), &new_packet_ptr, wait_option); + + /* Determine if a packet was not received. */ + if (status) + { + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Unable to send PORT command to FTP server. */ + return(status); + } + +#ifndef NX_DISABLE_PACKET_CHAIN + if (new_packet_ptr -> nx_packet_next) + { + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Return. */ + return(NX_INVALID_PACKET); + } +#endif /* NX_DISABLE_PACKET_CHAIN */ + + /* We have a packet, setup pointer to the buffer area. */ + buffer_ptr = new_packet_ptr -> nx_packet_prepend_ptr; + + /* Check for 2xx message, signaling the IP/port was received properly. */ + if (buffer_ptr[0] != '2') + { + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Unable to send PORT command to FTP server. */ + return(NX_FTP_EXPECTED_2XX_CODE); + } + + /* Now build the actual NLST request. */ + buffer_ptr[0] = 'L'; + buffer_ptr[1] = 'I'; + buffer_ptr[2] = 'S'; + buffer_ptr[3] = 'T'; + buffer_ptr[4] = ' '; + + /* Copy the directory path into the buffer. */ + for(i = 0; directory_path[i]; i++) + { + + /* Copy character of directory path. */ + buffer_ptr[5+i] = (UCHAR)directory_path[i]; + } + + /* Insert the CR/LF. */ + buffer_ptr[5+i] = 13; + buffer_ptr[5+i+1] = 10; + + /* Setup the length of the packet. */ + new_packet_ptr -> nx_packet_length = i + 7; + + /* Setup the packet append pointer. */ + new_packet_ptr -> nx_packet_append_ptr = new_packet_ptr -> nx_packet_prepend_ptr + new_packet_ptr -> nx_packet_length; + + /* Send the LIST message. */ + status = nx_tcp_socket_send(&(ftp_client_ptr -> nx_ftp_client_control_socket), new_packet_ptr, wait_option); + + /* Determine if the send was unsuccessful. */ + if (status) + { + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Return error. */ + return(status); + } + + /* Now wait for the data connection to connect. */ + status = nx_tcp_server_socket_accept(&(ftp_client_ptr -> nx_ftp_client_data_socket), wait_option); + + /* Determine if the accept was unsuccessful. */ + if (status) + { + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Return error. */ + return(status); + } + + /* Now wait for response from the FTP server control port. */ + status = nx_tcp_socket_receive(&(ftp_client_ptr -> nx_ftp_client_control_socket), &new_packet_ptr, wait_option); + + /* Determine if a packet was not received. */ + if (status) + { + + /* Unaccept the on the data port. */ + nx_tcp_server_socket_unaccept(&(ftp_client_ptr -> nx_ftp_client_data_socket)); + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Error in NLST request to FTP server. */ + return(status); + } + + /* We have a packet, setup pointer to the buffer area. */ + buffer_ptr = new_packet_ptr -> nx_packet_prepend_ptr; + + /* Check for 1xx message, signaling the data port was connected properly and ready for + transfer. */ + if (buffer_ptr[0] != '1') + { + + /* Unaccept the on the data port. */ + nx_tcp_server_socket_unaccept(&(ftp_client_ptr -> nx_ftp_client_data_socket)); + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Error in NLST request to FTP server. */ + return(NX_FTP_EXPECTED_1XX_CODE); + } + + /* Release the last packet. */ + nx_packet_release(new_packet_ptr); + + /* Now read a listing packet from the data socket. */ + status = nx_tcp_socket_receive(&(ftp_client_ptr -> nx_ftp_client_data_socket), packet_ptr, wait_option); + + /* Determine if an error occurred. */ + if (status) + { + + /* Unaccept the on the data port. */ + nx_tcp_server_socket_unaccept(&(ftp_client_ptr -> nx_ftp_client_data_socket)); + + /* Stop listening on the data port. */ + nx_tcp_server_socket_unlisten(ftp_client_ptr -> nx_ftp_client_ip_ptr, data_port); + + /* Map all unsuccessful status to error. */ + return(status); + } + + /* Return success to caller. */ + return(NX_SUCCESS); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_invalid_month_crash_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Invalid Month Crash Test.......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ftp_test/netx_ftp_server_list_command_test.c b/test/regression/ftp_test/netx_ftp_server_list_command_test.c new file mode 100644 index 00000000..bfee4265 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_server_list_command_test.c @@ -0,0 +1,535 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define DEMO_DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT ftp_client_directory_listing_get(NX_FTP_CLIENT *ftp_client_ptr, CHAR *directory_path, + NX_PACKET **packet_ptr, ULONG wait_option); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_list_command_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Set the data as 04/02/2021. */ + fx_system_date_set(2021, 4, 2); + + /* Set the time as 08:05:30. */ + fx_system_time_set(8, 5, 30); + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, DEMO_DATA, sizeof(DEMO_DATA)); /* Use case of memcpy is verified. */ + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = sizeof(DEMO_DATA); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(DEMO_DATA); + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Get directory listing (NLST). */ + status = ftp_client_directory_listing_get(&ftp_client, "", &my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + /* Check the data. */ + if (memcmp(my_packet -> nx_packet_prepend_ptr, "-rw-rw-rw- 1 owner group 28 APR 02 08:05 test.txt\r\n", my_packet -> nx_packet_length)) + { + error_counter++; + } + nx_packet_release(my_packet); + } + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server LIST Command Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(1); + + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT ftp_client_directory_listing_get(NX_FTP_CLIENT *ftp_client_ptr, CHAR *directory_path, + NX_PACKET **packet_ptr, ULONG wait_option) +{ + +UINT i; +UCHAR *buffer_ptr; +NX_PACKET *new_packet_ptr; +UINT status; + + + /* Set packet pointer to NULL. */ + *packet_ptr = NX_NULL; + + /* Ensure the client is the proper state for directory listing request. */ + if (ftp_client_ptr -> nx_ftp_client_state != NX_FTP_STATE_CONNECTED) + return(NX_FTP_NOT_CONNECTED); + + /* Transfer the data in active transfer mode. */ + status = _nx_ftp_client_active_transfer_setup(ftp_client_ptr, wait_option); + + /* Determine if set up successful. */ + if (status) + { + return(status); + } + + /* Allocate a packet for sending the NLST command. */ + status = _nx_ftp_client_packet_allocate(ftp_client_ptr, &new_packet_ptr, wait_option); + + /* Determine if the packet allocation was successful. */ + if (status != NX_SUCCESS) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Return error. */ + return(status); + } + + /* Check if out of boundary. */ + if ((UINT)(new_packet_ptr -> nx_packet_data_end - new_packet_ptr -> nx_packet_prepend_ptr) < 7) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Set the error status. */ + return(NX_FTP_FAILED); + } + + /* We have a packet, setup pointer to the buffer area. */ + buffer_ptr = new_packet_ptr -> nx_packet_prepend_ptr; + + /* Now build the actual LIST request. */ + buffer_ptr[0] = 'L'; + buffer_ptr[1] = 'I'; + buffer_ptr[2] = 'S'; + buffer_ptr[3] = 'T'; + buffer_ptr[4] = ' '; + + /* Copy the directory path into the buffer. */ + for(i = 0; directory_path[i]; i++) + { + + /* Check if out of boundary. */ + if ((i + 7) >= (UINT)(new_packet_ptr -> nx_packet_data_end - new_packet_ptr -> nx_packet_prepend_ptr)) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Set the error status. */ + return(NX_FTP_FAILED); + } + + /* Copy character of directory path. */ + buffer_ptr[5+i] = (UCHAR)directory_path[i]; + } + + /* Insert the CR/LF. */ + buffer_ptr[5+i] = 13; + buffer_ptr[5+i+1] = 10; + + /* Setup the length of the packet. */ + new_packet_ptr -> nx_packet_length = i + 7; + + /* Setup the packet append pointer. */ + new_packet_ptr -> nx_packet_append_ptr = new_packet_ptr -> nx_packet_prepend_ptr + new_packet_ptr -> nx_packet_length; + + /* Send the NLST message. */ + status = nx_tcp_socket_send(&(ftp_client_ptr -> nx_ftp_client_control_socket), new_packet_ptr, wait_option); + + /* Determine if the send was unsuccessful. */ + if (status) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Return error. */ + return(status); + } + + /* Check if enable passive mode. */ + if (ftp_client_ptr -> nx_ftp_client_passive_transfer_enabled == NX_FALSE) + { + + /* Now wait for the data connection to connect. */ + status = nx_tcp_server_socket_accept(&(ftp_client_ptr -> nx_ftp_client_data_socket), wait_option); + + /* Determine if the accept was unsuccessful. */ + if (status) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Return error. */ + return(status); + } + } + + /* Now wait for response from the FTP server control port. */ + status = nx_tcp_socket_receive(&(ftp_client_ptr -> nx_ftp_client_control_socket), &new_packet_ptr, wait_option); + + /* Determine if a packet was not received. */ + if (status) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Error in NLST request to FTP server. */ + return(status); + } + + /* We have a packet, setup pointer to the buffer area. */ + buffer_ptr = new_packet_ptr -> nx_packet_prepend_ptr; + + /* Check for 1xx message, signaling the data port was connected properly and ready for + transfer. */ + if ((new_packet_ptr -> nx_packet_length < 3) || (buffer_ptr[0] != '1')) + { + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Release the packet. */ + nx_packet_release(new_packet_ptr); + + /* Error in NLST request to FTP server. */ + return(NX_FTP_EXPECTED_1XX_CODE); + } + + /* Release the last packet. */ + nx_packet_release(new_packet_ptr); + + /* Now read a listing packet from the data socket. */ + status = nx_tcp_socket_receive(&(ftp_client_ptr -> nx_ftp_client_data_socket), packet_ptr, wait_option); + + /* Determine if an error occurred. */ + if (status) + { + + /* Map all unsuccessful status to error. */ + return(status); + } + + /* Cleanup data socket. */ + _nx_ftp_client_data_socket_cleanup(ftp_client_ptr, wait_option); + + /* Return staus to caller. */ + return(status); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_list_command_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server LIST Command Test..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_server_mss_too_small_test.c b/test/regression/ftp_test/netx_ftp_server_mss_too_small_test.c new file mode 100644 index 00000000..59479d14 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_server_mss_too_small_test.c @@ -0,0 +1,452 @@ +/* This test case focus on a bug while processing NX_FTP_NLST, TCP MSS less than length of filename would cause integer underflow. */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static TX_THREAD data_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET data_socket; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +static CHAR command_buffer[1024]; +static UINT delay_close = NX_NO_WAIT; + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void data_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT send_data(CHAR *data); +static VOID tcp_listen_callback(NX_TCP_SOCKET *socket_ptr, UINT port); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_mss_too_small_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create FTP data thread. */ + status = tx_thread_create(&data_thread, "FTP Data thread ", data_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 16384); + pointer = pointer + 16384; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 320, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "FTP Client Socket", NX_IP_NORMAL, + NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 512, NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Bind to any port. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_NO_WAIT); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_tcp_client_socket_connect(&client_socket, FTP_SERVER_ADDRESS, NX_FTP_SERVER_CONTROL_PORT, + NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = send_data("USER aaa\n"); + if (status) + error_counter++; + + status = send_data("PASS aaa\n"); + if (status) + error_counter++; + + status = send_data("TYPE I\n"); + if (status) + error_counter++; + + status = send_data("PORT 1,2,3,5,0,255\r"); + if (status) + error_counter++; + + for (i = 0; i < 10; i++) + { + + /* Initialize command buffer. */ + strncpy(command_buffer, "STOR 1", 6); + memset(command_buffer + 6, '0' + i, 200); + command_buffer[206] = '\0'; + strncat(command_buffer, ".txt\n", 6); + + status = send_data(command_buffer); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + delay_close = NX_IP_PERIODIC_RATE; + status = send_data("NLST /\0"); + if (status) + error_counter++; + + /* Disconnect from the server. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&client_socket); + + /* Cleanup the socket. */ + nx_tcp_client_socket_unbind(&client_socket); + nx_tcp_socket_delete(&client_socket); + + /* Set the flag. */ + test_done = NX_TRUE; +} + +/* Define the FTP data thread. */ + +void data_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Create an FTP data socket. */ + status = nx_tcp_socket_create(&client_ip, &data_socket, "FTP Data Socket", NX_IP_NORMAL, + NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 512, NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Set MSS to 100. */ + status = nx_tcp_socket_mss_set(&data_socket, 100); + + /* Listen to port 255. */ + status = nx_tcp_server_socket_listen(&client_ip, 255, &data_socket, 5, NX_NULL); + if (status) + error_counter++; + + while (test_done == NX_FALSE) + { + + /* Loop to accept connection. */ + status = nx_tcp_server_socket_accept(&data_socket, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, "data", sizeof("data") - 1, &client_pool, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + status = nx_tcp_socket_send(&data_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + if (delay_close) + { + tx_thread_sleep(delay_close); + delay_close = NX_NO_WAIT; + } + + nx_tcp_socket_disconnect(&data_socket, NX_IP_PERIODIC_RATE); + + status = nx_tcp_server_socket_unaccept(&data_socket); + if (status) + error_counter++; + + status = nx_tcp_server_socket_relisten(&client_ip, 255, &data_socket); + if (status) + error_counter++; + } +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server MSS Too Small Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* OK to restart the ftp Server. */ + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + /* Make sure there is no invalid release. */ + if (server_pool.nx_packet_pool_invalid_releases) + error_counter++; + + /* Make sure the packet pool is not corrupted. */ + while (server_pool.nx_packet_pool_available) + { + if (nx_packet_allocate(&server_pool, &my_packet, 0, NX_NO_WAIT) || + (my_packet -> nx_packet_pool_owner != &server_pool)) + { + + error_counter++; + break; + } + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT send_data(CHAR *data) +{ +UINT status; +NX_PACKET *packet_ptr; + + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + return(status); + + status = nx_packet_data_append(packet_ptr, data, strlen(data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(packet_ptr); + return(status); + } + + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(packet_ptr); + return(status); + } + + /* Return success. */ + return(NX_SUCCESS); +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_server_mss_too_small_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server MSS Too Small Test.............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_service_commands_RETR_STOR_test.c b/test/regression/ftp_test/netx_ftp_service_commands_RETR_STOR_test.c new file mode 100644 index 00000000..141d7b82 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_service_commands_RETR_STOR_test.c @@ -0,0 +1,379 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_IP client_ip_2; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG retr_counter = 0; +static ULONG stor_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define FTP_CLIENT_2_ADDRESS IP_ADDRESS(1,2,3,6) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_RETR_STOR_test_application_define(void *first_unused_memory) +#endif +{ +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip_2, "NetX Client IP Instance", FTP_CLIENT_2_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip_2); + if (status) + error_counter++; + + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Now open the same file for reading. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(my_packet->nx_packet_prepend_ptr,"ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + } + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command RETR STOR rest ......................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter != 0) || (retr_counter != 1) || (stor_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && ((*(message) == 'R') || *(message) == 'S')) + { + if(!memcmp(message,"STOR test.txt",13)) + stor_counter++; + + else if(!memcmp(message,"RETR test.txt",13)) + { + retr_counter++; + /* Deal packets with default routing. */ + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_RETR_STOR_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command RETR STOR rest .......................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_service_commands_dele_test.c b/test/regression/ftp_test/netx_ftp_service_commands_dele_test.c new file mode 100644 index 00000000..fb76202d --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_service_commands_dele_test.c @@ -0,0 +1,396 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG dele_counter = 0; +static ULONG fail_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_dele_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a File. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_file_delete(&ftp_client,"test.txt",NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a File. */ + status = nx_ftp_client_file_open(&ftp_client, "/test1.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_file_delete(&ftp_client,"/test1.txt",NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + error_counter++; + + status = nx_ftp_client_file_open(&ftp_client, "/test1.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Disconnect from the server. */ + nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command DELE Test ............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || ( dele_counter != 2 ) || (fail_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == 'D') + { + if(!memcmp(message,"DELE test.txt",13)) + dele_counter++; + else if(!memcmp(message,"DELE /test1.txt",15)) + { + dele_counter++; + /* Deal packets with default routing. */ + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == '5') + { + if(!memcmp(message,"550 File Open Fail",18)) + fail_counter++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_dele_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command DELE Test ............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c b/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c new file mode 100644 index 00000000..36e23dae --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c @@ -0,0 +1,423 @@ +/* This file tests that a failed fx_file_write() operation results in a 550 error message + back to the FTP Client from the Server. The first file is small enough there is enough + memory in the FileX ram disk space so it should succeed. The second file is large enough + there is not enough ram disk space available so it should fail. Further, the test + checks that there are two STOR commands received by the FTP server as part of the + requirements for successful outcome. + + Note that the ram_disk_memory is much smaller than the typical FileX demo (only 3200 bytes) + and the number of sectors is reduced from 256 to 25. */ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG stor_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ + + +#define BIG_SEND 4300 +#define NOT_SO_BIG_SEND 1600 + +UCHAR buffer[BIG_SEND]; +#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 10) +ULONG client_packet_pool_area[NX_PACKET_POOL_SIZE/4 + 4]; +ULONG server_packet_pool_area[NX_PACKET_POOL_SIZE/4 + 4]; +ULONG client_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; +ULONG server_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; +ULONG client_arp_space_area[512 / sizeof(ULONG)]; +ULONG server_arp_space_area[512 / sizeof(ULONG)]; + +static UCHAR ram_disk_memory[3200]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_file_write_test_application_define(void *first_unused_memory) +#endif +{ +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 1536, (ULONG*)(((int)server_packet_pool_area + 15) & ~15) , NX_PACKET_POOL_SIZE); + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1500, + (UCHAR*)server_ip_thread_stack, + sizeof(server_ip_thread_stack), + 1); + + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *)server_arp_space_area, sizeof(server_arp_space_area)); + + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "Client Packet Pool", 1536, (ULONG*)(((int)client_packet_pool_area + 15) & ~15) , NX_PACKET_POOL_SIZE); + + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1500, + (UCHAR*)client_ip_thread_stack, + sizeof(client_ip_thread_stack), + 1); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *)client_arp_space_area, sizeof(client_arp_space_area)); + + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ +NX_PACKET *my_packet; +UINT status; +UINT i; +UCHAR c; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 25, /* Total sectors */ // jlc restore to 24 + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + c = 0x20; + for (i = 0; i < BIG_SEND; i++) + { + buffer[i] = c; + c++; + if (c == 0x7E) + { + c = 0x20; + } + } + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Open a smaller FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test_2.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Add data to the packet. */ + status = nx_packet_data_append(my_packet, &buffer[0], NOT_SO_BIG_SEND, &client_pool, 200); + + /* Check status. */ + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, 10*NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* The FTP Client should have received an 250 message from the FTP server, so status should be SUCCESS. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + + /* Open a bigger FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Add data to the packet. */ + status = nx_packet_data_append(my_packet, &buffer[0], BIG_SEND, &client_pool, 200); + + /* Check status. */ + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, 10*NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + + /* The FTP Client should have received an error message from the FTP server, so status should be an error. */ + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command file write test ......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTP Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter != 0) || (stor_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (*(message) == 'S')) + { + + if(!memcmp(message,"STOR test.txt",13)) + { + + stor_counter++; + } + if(!memcmp(message,"STOR test_2.txt",15)) + { + + stor_counter++; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_file_write_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: FTP Service Command file write test ......................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_PACKET_CHAIN */ diff --git a/test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c b/test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c new file mode 100644 index 00000000..e9dcc5e9 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c @@ -0,0 +1,424 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG mkd_counter = 0; +static ULONG rmd_counter = 0; +static ULONG dir_fail_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_m_d_dir_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_directory_create(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + status = nx_ftp_client_directory_create(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /*To ensure the making dir successfully*/ + status = nx_ftp_client_directory_default_set(&ftp_client, "/abc" ,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_directory_default_set(&ftp_client, "/def" ,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + status = nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); + if (status != NX_FTP_EXPECTED_2XX_CODE) + error_counter++; + + status = nx_ftp_client_directory_default_set(&ftp_client, "/" ,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + status = nx_ftp_client_directory_delete(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /*Check the response when deleting a dir deleted.*/ + status = nx_ftp_client_file_delete(&ftp_client, "/abc/test.txt",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + status = nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + + /*Check if the two dir have been successfully deleted. */ + status = nx_ftp_client_directory_default_set(&ftp_client, "/abc" ,NX_IP_PERIODIC_RATE/2); + if (status == NX_SUCCESS) + error_counter++; + + status = nx_ftp_client_directory_default_set(&ftp_client, "/def" ,NX_IP_PERIODIC_RATE/2); + if (status == NX_SUCCESS) + error_counter++; + + status = nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); + if (status != NX_FTP_EXPECTED_2XX_CODE) + error_counter++; + + status = nx_ftp_client_directory_delete(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); + if (status != NX_FTP_EXPECTED_2XX_CODE) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Service Commands make dele dir Test............"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || ( rmd_counter != 2 ) || (mkd_counter != 2) || (dir_fail_counter != 5)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + + if(!memcmp(message,"MKD /abc ",8) || !memcmp(message,"MKD def ",7)) + mkd_counter++; + else if(!memcmp(message,"RMD /abc ",8)) + rmd_counter++; + else if (!memcmp(message,"RMD def ",7)) + { + rmd_counter++; + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == '5') + { + + if(!memcmp(message,"550 Delete Directory Fail",25) || !memcmp(message,"550 Change Dir Fail",19)) + dir_fail_counter++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_m_d_dir_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Server Service Commands make dele dir Test............N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_service_commands_nlist_test.c b/test/regression/ftp_test/netx_ftp_service_commands_nlist_test.c new file mode 100644 index 00000000..a651ce99 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_service_commands_nlist_test.c @@ -0,0 +1,433 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG fail_counter = 0; +static ULONG nlist_counter = 0; +static ULONG type_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_nlist_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +UCHAR buffer_list[26]; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_directory_create(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + status = nx_ftp_client_directory_create(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + /* Create a File. */ + status = nx_ftp_client_file_open(&ftp_client, "test1.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a File. */ + status = nx_ftp_client_file_open(&ftp_client, "/abc/test2.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_directory_create(&ftp_client,"cpp",NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + buffer_list[0] = '.'; + buffer_list[1] = 13; + buffer_list[2] = 10; + buffer_list[3] = '.'; + buffer_list[4] = '.'; + buffer_list[5] = 13; + buffer_list[6] = 10; + buffer_list[7] = 't'; + buffer_list[8] = 'e'; + buffer_list[9] = 's'; + buffer_list[10] = 't'; + buffer_list[11] = '2'; + buffer_list[12] = '.'; + buffer_list[13] = 't'; + buffer_list[14] = 'x'; + buffer_list[15] = 't'; + + status = nx_ftp_client_directory_listing_get(&ftp_client,"/abc",&my_packet,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + else if(memcmp(buffer_list,my_packet->nx_packet_prepend_ptr,15)) + error_counter++; + + status = nx_ftp_client_directory_listing_continue(&ftp_client,&my_packet,NX_IP_PERIODIC_RATE/2); + if (status != NX_FTP_END_OF_LISTING) + error_counter++; + + memcpy(buffer_list,"abc",3); + buffer_list[3] = 13; + buffer_list[4] = 10; + memcpy(buffer_list + 5,"def",3); + buffer_list[8] = 13; + buffer_list[9] = 10; + memcpy(buffer_list + 10,"test1.txt",9); + buffer_list[19] = 13; + buffer_list[20] = 10; + memcpy(buffer_list + 21,"cpp",3); + buffer_list[24] = 13; + buffer_list[25] = 10; + + status = nx_ftp_client_directory_listing_get(&ftp_client,"",&my_packet,NX_IP_PERIODIC_RATE/2); + if (status) + error_counter++; + else if(memcmp(my_packet->nx_packet_prepend_ptr,buffer_list,25)) + error_counter++; + + status = nx_ftp_client_directory_listing_continue(&ftp_client,&my_packet,NX_IP_PERIODIC_RATE/2); + if (status != NX_FTP_END_OF_LISTING) + error_counter++; + + + status = nx_ftp_client_directory_listing_get(&ftp_client,"/ /abc",&my_packet,NX_IP_PERIODIC_RATE/2); + if (status == NX_SUCCESS) + error_counter++; + + status = nx_ftp_client_directory_listing_continue(&ftp_client,&my_packet,NX_IP_PERIODIC_RATE/2); + if (status != NX_FTP_EXPECTED_2XX_CODE) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command NLIST Test ..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || ( nlist_counter != 1 ) || (fail_counter != 1) || (type_counter >= 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_PSH_BIT ) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) ) + { + if(*message == 'T') + { + if(*(message + 5) == 'A' || *(message + 5) == 'E') + type_counter++; + } + else if(*message == 'N') + { + if (!memcmp(message,"NLST /abc",9)) + nlist_counter++; + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == '5') + { + if(!memcmp(message,"550 List bad Directory",18)) + { + fail_counter++; + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_nlist_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command NLIST Test ...........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_service_commands_rename_test.c b/test/regression/ftp_test/netx_ftp_service_commands_rename_test.c new file mode 100644 index 00000000..99ff8b2d --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_service_commands_rename_test.c @@ -0,0 +1,414 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static ULONG rename_counter = 0; +static ULONG fail_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + + +/* Define server login/logout functions. These are stubs for functions that would +validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_rename_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a File. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_ftp_client_file_rename(&ftp_client,"test.txt","test1.txt",NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; + + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + error_counter++; + + status = nx_ftp_client_file_open(&ftp_client, "test1.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(my_packet->nx_packet_prepend_ptr,"ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command Rename Test .........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || ( rename_counter != 2 ) || (fail_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_PSH_BIT ) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) ) + { + if(*(message) == 'R') + { + if(!memcmp(message,"RNFR test.txt",13)) + { + if(rename_counter == 0) + rename_counter++; + } + else if(!memcmp(message,"RNTO test1.txt",14)) + { + if(rename_counter == 1) + { + rename_counter++; + /* Deal packets with default routing. */ + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + else + rename_counter = 3; + } + } + else if (rename_counter) + rename_counter++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == '5') + { + if(!memcmp(message,"550 File Open Fail",18)) + { + fail_counter++; + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_service_commands_rename_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP Service Command Rename Test ..........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_two_listen_test.c b/test/regression/ftp_test/netx_ftp_two_listen_test.c new file mode 100644 index 00000000..15461c72 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_two_listen_test.c @@ -0,0 +1,314 @@ +/* This case tests the FTP server on handling two session listen situation. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-238 + */ +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include +#include +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + + + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; +static NX_TCP_SOCKET test_sockets[3]; +static TX_SEMAPHORE sema_0; + +/* Define FTP objects. */ + +static NX_FTP_SERVER ftp_server; +static FX_MEDIA ram_disk; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +static UINT data_received; +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _fx_ram_driver(FX_MEDIA *media_ptr); + + + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_two_listen_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &ip_server, &ram_disk, pointer, DEMO_STACK_SIZE, &pool_server, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +/* Define the Server thread. */ +static void thread_server_entry(ULONG thread_input) +{ + +UINT i; +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: FTP Two Listen Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* OK to start the ftp Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + /* Initialize test sockets. */ + for (i = 0; i < sizeof(test_sockets) / sizeof(NX_TCP_SOCKET); i++) + { + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_client, &test_sockets[i], "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&test_sockets[i], NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + } + + /* Connect to Telnet server. */ + status = nx_tcp_client_socket_connect(&test_sockets[0], SERVER_ADDRESS, NX_FTP_SERVER_CONTROL_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + /* Send data to Telnet server. */ + nx_packet_allocate(&pool_client, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + nx_packet_data_append(packet_ptr, "PASS 1234\r\n", 11, &pool_client, NX_NO_WAIT); + nx_tcp_socket_send(&test_sockets[0], packet_ptr, NX_NO_WAIT); + + /* Disconnect immediately. */ + nx_tcp_socket_disconnect(&test_sockets[0], NX_IP_PERIODIC_RATE); + + if (tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + } + + /* Let another two sockets connect to Telnet server without block. */ + nx_tcp_client_socket_connect(&test_sockets[1], SERVER_ADDRESS, NX_FTP_SERVER_CONTROL_PORT, NX_NO_WAIT); + nx_tcp_client_socket_connect(&test_sockets[2], SERVER_ADDRESS, NX_FTP_SERVER_CONTROL_PORT, NX_NO_WAIT); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the state of sockets is ESTABLISHED. */ + if (test_sockets[1].nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + error_counter++; + } + if (test_sockets[2].nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + error_counter++; + } + + status = nx_ftp_server_stop(&ftp_server); + status += nx_ftp_server_delete(&ftp_server); + if (status) + error_counter++; + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + tx_semaphore_put(&sema_0); + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_two_listen_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: FTP Two Listen Test.......................................N/A\n"); + test_control_return(3); +} +#endif + + diff --git a/test/regression/ftp_test/netx_ftp_user_data_type_test.c b/test/regression/ftp_test/netx_ftp_user_data_type_test.c new file mode 100644 index 00000000..3b8dbf32 --- /dev/null +++ b/test/regression/ftp_test/netx_ftp_user_data_type_test.c @@ -0,0 +1,362 @@ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_ftp_client.h" +#include "nxd_ftp_server.h" +#else +#include "nx_ftp_client.h" +#include "nx_ftp_server.h" +#endif +#include "nx_tcp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + + +/* Define the NetX FTP object control blocks. */ +static NX_FTP_CLIENT ftp_client; +static NX_FTP_SERVER ftp_server; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; +static UINT test_done = NX_FALSE; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; +static UINT type_counter = 0;; +static UINT sp_counter = 0; +static UINT client_counter = 0; + +#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, + CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, + ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, + UINT heads, UINT sectors_per_track); + +/* Define the FileX and NetX driver entry functions. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define server login/logout functions. These are stubs for functions that would + validate a client login request. */ +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_user_data_type_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the packet pool for the FTP Server. */ + status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create the IP instance for the FTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the FTP server. */ + status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, + server_login, server_logout); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Now set up the FTP Client. */ + + /* Create the main FTP client thread. */ + status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE ; + if (status) + error_counter++; + + /* Create a packet pool for the FTP client. */ + status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status) + error_counter++; + + /* Create an IP instance for the FTP client. */ + status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP for client IP instance. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + +/* Define the FTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = _fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check status. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + if (status) + error_counter++; + + /* Create an FTP client. */ + status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); + if (status) + error_counter++; + + /* Now connect with the NetX FTP (IPv4) server. */ + status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Open a FTP file for writing. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + + /* Allocate a FTP packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write the packet to the file test.txt. */ + status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Close the file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Now open the same file for reading. */ + status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Read the file. */ + status = nx_ftp_client_file_read(&ftp_client, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Close this file. */ + status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disconnect from the server. */ + status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Delete the FTP client. */ + status = nx_ftp_client_delete(&ftp_client); + if (status) + error_counter++; + + /* Set the flag. */ + test_done = NX_TRUE; +} + + +/* Define the helper FTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: FTP User Data Type Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the FTPv6 Server. */ + status = nx_ftp_server_start(&ftp_server); + if (status) + error_counter++; + + server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; + + /* Wait for test. */ + while(test_done == NX_FALSE) + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_ftp_server_delete(&ftp_server); + if(status) + error_counter++; + + if((error_counter) || (type_counter != 1) || (client_counter != 1) || (sp_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) +{ + /* Always return success. */ + return(NX_SUCCESS); +} + +void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +UCHAR *message; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + message = packet_ptr -> nx_packet_prepend_ptr + 20; + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (*message == 'T')) + { + /* Check if The parameters are separated by a */ + if((!memcmp(message,"TYPE",4)) && (*(message + 4) == ' ')) + sp_counter++; + + /* Check if the default Type is "I' (which means the ASCII) */ + if(*(message + 5) == 'I') + { + type_counter++; + client_counter++; + } + /* Deal packets with default routing. */ + server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ftp_user_data_type_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: FTP User Data Type Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_basic_authenticate_test.c b/test/regression/http_test/netx_http_basic_authenticate_test.c new file mode 100644 index 00000000..769204e6 --- /dev/null +++ b/test/regression/http_test/netx_http_basic_authenticate_test.c @@ -0,0 +1,443 @@ +/* This case tests the basic authentication, + * name:password is the correct account + * name2:password is the wrong account + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static TX_SEMAPHORE server_start; +static TX_SEMAPHORE client_stop; + + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_HTTP_BASIC_AUTHENTICATE); +} + +static UINT authentication_check_extended(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, + CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + *name_length = 4; + *password_length = 8; + *realm_length = 18; + + /* Request basic authentication. */ + return(NX_HTTP_BASIC_AUTHENTICATE); +} + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_basic_authenticate_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, authentication_check, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + tx_semaphore_create(&server_start, "server start", 0); + tx_semaphore_create(&client_stop, "client stop", 0); +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/client_test.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Basic authentication, name = "name", passwd = "password". */ +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "name", "password", 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "name", "password", 50); +#endif + + /* Should pass the authentication. */ + if(status) + error_counter++; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + if (status) + error_counter++; + + /* Basic Authentication, name = "name2", passwd = "password". */ +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "name2", "password", 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "name2", "password", 50); +#endif + + /* Shouldn't pass the authentication. */ + if(status != NX_HTTP_AUTHENTICATION_ERROR) + error_counter++; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + if (status) + error_counter++; + + /* Basic Authentication, name = "name", passwd = "". */ +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "name", "", 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "name", "", 50); +#endif + + /* Shouldn't pass the authentication. */ + if(status != NX_HTTP_AUTHENTICATION_ERROR) + error_counter++; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + tx_semaphore_put(&client_stop); + tx_semaphore_get(&server_start, NX_WAIT_FOREVER); + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + if (status) + error_counter++; + + /* Basic Authentication, name = "name2", passwd = "password". */ +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "name", "password", 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "name", "password", 50); +#endif + + /* Should pass the authentication. */ + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Basic Athentication Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_semaphore_get(&client_stop, NX_WAIT_FOREVER); + + status = nx_http_server_authentication_check_set(&my_server, authentication_check_extended); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_basic_authenticate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Basic Athentication Test.............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/http_test/netx_http_basic_test.c b/test/regression/http_test/netx_http_basic_test.c new file mode 100644 index 00000000..27aa8a3a --- /dev/null +++ b/test/regression/http_test/netx_http_basic_test.c @@ -0,0 +1,439 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_HTTP_BASIC_AUTHENTICATE); +} + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, authentication_check, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/client_test.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Now GET the test file */ + +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "name", "password", 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "name", "password", 50); +#endif /* USE_DUO */ + + if(status) + error_counter++; + + while (1) + { + status = nx_http_client_get_packet(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_HTTP_GET_DONE) + break; + + if (status) + error_counter++; + else + nx_packet_release(recv_packet); + } + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start_extended(&my_client, &server_ip_address, "/client_test_extended.htm", 25, + "name", 4, "password", 8, 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start_extended(&my_client, HTTP_SERVER_ADDRESS, "/client_test_extended.htm", 25, + "name", 4, "password", 8, 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Now GET the test file */ + +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start_extended(&my_client, &server_ip_address, + "/client_test_extended.htm", 25, NX_NULL, 0, "name", 4, "password", 8, 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start_extended(&my_client, HTTP_SERVER_ADDRESS, "/client_test_extended.htm", 25, + NX_NULL, 0, "name", 4, "password", 8, 50); +#endif /* USE_DUO */ + + if(status) + error_counter++; + + while (1) + { + status = nx_http_client_get_packet(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_HTTP_GET_DONE) + break; + + if (status) + error_counter++; + else + nx_packet_release(recv_packet); + } + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Basic Test..........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + /* Restart HTTP server. */ + status = nx_http_server_stop(&my_server); + status += nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Basic Test...........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/http_test/netx_http_client_change_connect_port_test.c b/test/regression/http_test/netx_http_client_change_connect_port_test.c new file mode 100644 index 00000000..5e69d7f1 --- /dev/null +++ b/test/regression/http_test/netx_http_client_change_connect_port_test.c @@ -0,0 +1,681 @@ +/* This case tests the ability of the HTTP Client to change ports it connects to the server on at + runtime. It initially makes a PUT request and based on server information it receives, it . + changes the connect port from the default 80 to 85. . + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#else +#include "nx_http_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define SERVER_PORT 80 +#define SECONDARY_SERVER_PORT 85 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static void http_test_initialize(); +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); + + +static char PUT_firstreply[202] = { +0x48, 0x54, /* HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x32, /* TP/1.1 2 */ +0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x44, /* 00 OK..D */ +0x61, 0x74, 0x65, 0x3a, 0x20, 0x54, 0x75, 0x65, /* ate: Tue */ +0x2c, 0x20, 0x32, 0x34, 0x20, 0x4d, 0x61, 0x79, /* , 24 May */ +0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x32, 0x33, /* 2016 23 */ +0x3a, 0x32, 0x36, 0x3a, 0x35, 0x34, 0x20, 0x47, /* :26:54 G */ +0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65, 0x72, 0x76, /* MT..Serv */ +0x65, 0x72, 0x3a, 0x20, 0x4d, 0x61, 0x6b, 0x6f, /* er: Mako */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6e, /* Server.n */ +0x65, 0x74, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* et..Cont */ +0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, /* ent-Type */ +0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, /* : text/h */ +0x74, 0x6d, 0x6c, 0x3b, 0x20, 0x63, 0x68, 0x61, /* tml; cha */ +0x72, 0x73, 0x65, 0x74, 0x3d, 0x75, 0x74, 0x66, /* rset=utf */ +0x2d, 0x38, 0x0d, 0x0a, 0x43, 0x61, 0x63, 0x68, /* -8..Cach */ +0x65, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, /* e-Contro */ +0x6c, 0x3a, 0x20, 0x6e, 0x6f, 0x2d, 0x73, 0x74, /* l: no-st */ +0x6f, 0x72, 0x65, 0x2c, 0x20, 0x6e, 0x6f, 0x2d, /* ore, no- */ +0x63, 0x61, 0x63, 0x68, 0x65, 0x2c, 0x20, 0x6d, /* cache, m */ +0x75, 0x73, 0x74, 0x2d, 0x72, 0x65, 0x76, 0x61, /* ust-reva */ +0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2c, 0x20, /* lidate, */ +0x6d, 0x61, 0x78, 0x2d, 0x61, 0x67, 0x65, 0x3d, /* max-age= */ +0x30, 0x0d, 0x0a, 0x4b, 0x65, 0x65, 0x70, 0x2d, /* 0..Keep- */ +0x41, 0x6c, 0x69, 0x76, 0x65, 0x3a, 0x20, 0x43, /* Alive: C */ +0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x0d, 0x0a /* lose.... */ +}; + +static int PUT_firstreply_size = 202; + + +static char GET_firstreply[638] = { +0x48, 0x54, /* HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x32, /* TP/1.1 2 */ +0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x43, /* 00 OK..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* ontent-T */ +0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, /* ype: tex */ +0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3b, 0x20, /* t/html; */ +0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, /* charset= */ +0x75, 0x74, 0x66, 0x2d, 0x38, 0x0d, 0x0a, 0x43, /* utf-8..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, /* ontent-L */ +0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34, /* ength: 4 */ +0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, /* ..Connec */ +0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, /* tion: cl */ +0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x53, 0x74, 0x61, /* ose..Sta */ +0x74, 0x75, 0x73, 0x3a, 0x20, 0x32, 0x30, 0x30, /* tus: 200 */ +0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x58, 0x2d, 0x46, /* OK..X-F */ +0x72, 0x61, 0x6d, 0x65, 0x2d, 0x4f, 0x70, 0x74, /* rame-Opt */ +0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x41, 0x4c, /* ions: AL */ +0x4c, 0x4f, 0x57, 0x41, 0x4c, 0x4c, 0x0d, 0x0a, /* LOWALL.. */ +0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x43, /* Access-C */ +0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x41, /* ontrol-A */ +0x6c, 0x6c, 0x6f, 0x77, 0x2d, 0x4f, 0x72, 0x69, /* llow-Ori */ +0x67, 0x69, 0x6e, 0x3a, 0x20, 0x2a, 0x0d, 0x0a, /* gin: *.. */ +0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x43, /* Access-C */ +0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x41, /* ontrol-A */ +0x6c, 0x6c, 0x6f, 0x77, 0x2d, 0x4d, 0x65, 0x74, /* llow-Met */ +0x68, 0x6f, 0x64, 0x73, 0x3a, 0x20, 0x47, 0x45, /* hods: GE */ +0x54, 0x2c, 0x20, 0x50, 0x4f, 0x53, 0x54, 0x2c, /* T, POST, */ +0x20, 0x50, 0x55, 0x54, 0x2c, 0x20, 0x4f, 0x50, /* PUT, OP */ +0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2c, 0x20, 0x44, /* TIONS, D */ +0x45, 0x4c, 0x45, 0x54, 0x45, 0x2c, 0x20, 0x50, /* ELETE, P */ +0x41, 0x54, 0x43, 0x48, 0x0d, 0x0a, 0x41, 0x63, /* ATCH..Ac */ +0x63, 0x65, 0x73, 0x73, 0x2d, 0x43, 0x6f, 0x6e, /* cess-Con */ +0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x41, 0x6c, 0x6c, /* trol-All */ +0x6f, 0x77, 0x2d, 0x48, 0x65, 0x61, 0x64, 0x65, /* ow-Heade */ +0x72, 0x73, 0x3a, 0x20, 0x6f, 0x72, 0x69, 0x67, /* rs: orig */ +0x69, 0x6e, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x74, /* in, cont */ +0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, /* ent-type */ +0x2c, 0x20, 0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, /* , X-Requ */ +0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57, 0x69, /* ested-Wi */ +0x74, 0x68, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, /* th..Acce */ +0x73, 0x73, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x72, /* ss-Contr */ +0x6f, 0x6c, 0x2d, 0x4d, 0x61, 0x78, 0x2d, 0x41, /* ol-Max-A */ +0x67, 0x65, 0x3a, 0x20, 0x31, 0x38, 0x30, 0x30, /* ge: 1800 */ +0x0d, 0x0a, 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, /* ..ETag: */ +0x22, 0x36, 0x30, 0x35, 0x39, 0x38, 0x32, 0x38, /* "6059828 */ +0x32, 0x63, 0x65, 0x36, 0x38, 0x32, 0x38, 0x66, /* 2ce6828f */ +0x36, 0x38, 0x35, 0x34, 0x35, 0x34, 0x64, 0x66, /* 685454df */ +0x66, 0x39, 0x62, 0x35, 0x65, 0x66, 0x34, 0x66, /* f9b5ef4f */ +0x64, 0x22, 0x0d, 0x0a, 0x43, 0x61, 0x63, 0x68, /* d"..Cach */ +0x65, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, /* e-Contro */ +0x6c, 0x3a, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x61, /* l: max-a */ +0x67, 0x65, 0x3d, 0x30, 0x2c, 0x20, 0x70, 0x72, /* ge=0, pr */ +0x69, 0x76, 0x61, 0x74, 0x65, 0x2c, 0x20, 0x6d, /* ivate, m */ +0x75, 0x73, 0x74, 0x2d, 0x72, 0x65, 0x76, 0x61, /* ust-reva */ +0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x0d, 0x0a, /* lidate.. */ +0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, /* X-Reques */ +0x74, 0x2d, 0x49, 0x64, 0x3a, 0x20, 0x30, 0x30, /* t-Id: 00 */ +0x63, 0x61, 0x64, 0x31, 0x30, 0x36, 0x2d, 0x61, /* cad106-a */ +0x32, 0x34, 0x35, 0x2d, 0x34, 0x61, 0x39, 0x34, /* 245-4a94 */ +0x2d, 0x39, 0x61, 0x39, 0x36, 0x2d, 0x35, 0x31, /* -9a96-51 */ +0x37, 0x37, 0x66, 0x62, 0x61, 0x64, 0x34, 0x62, /* 77fbad4b */ +0x35, 0x64, 0x0d, 0x0a, 0x58, 0x2d, 0x52, 0x75, /* 5d..X-Ru */ +0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x20, 0x30, /* ntime: 0 */ +0x2e, 0x36, 0x34, 0x33, 0x37, 0x35, 0x30, 0x0d, /* .643750. */ +0x0a, 0x58, 0x2d, 0x50, 0x6f, 0x77, 0x65, 0x72, /* .X-Power */ +0x65, 0x64, 0x2d, 0x42, 0x79, 0x3a, 0x20, 0x50, /* ed-By: P */ +0x68, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x50, /* husion P */ +0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, /* assenger */ +0x20, 0x34, 0x2e, 0x30, 0x2e, 0x35, 0x37, 0x0d, /* 4.0.57. */ +0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x54, /* .Date: T */ +0x75, 0x65, 0x2c, 0x20, 0x32, 0x34, 0x20, 0x4d, /* ue, 24 M */ +0x61, 0x79, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, /* ay 2016 */ +0x32, 0x33, 0x3a, 0x32, 0x36, 0x3a, 0x33, 0x31, /* 23:26:31 */ +0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65, /* GMT..Se */ +0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x6e, 0x67, /* rver: ng */ +0x69, 0x6e, 0x78, 0x2f, 0x31, 0x2e, 0x39, 0x2e, /* inx/1.9. */ +0x33, 0x20, 0x2b, 0x20, 0x50, 0x68, 0x75, 0x73, /* 3 + Phus */ +0x69, 0x6f, 0x6e, 0x20, 0x50, 0x61, 0x73, 0x73, /* ion Pass */ +0x65, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x34, 0x2e, /* enger 4. */ +0x30, 0x2e, 0x35, 0x37, 0x0d, 0x0a, 0x0d, 0x0a, /* 0.57.... */ +0x36, 0x38, 0x2e, 0x32 /* 68.2 */ +}; + +static int GET_firstreply_size = 638; + + +typedef struct HTTP_RESPONSE_STRUCT +{ + char *http_response_pkt_data; + int http_response_pkt_size; +} HTTP_RESPONSE; + + +static HTTP_RESPONSE http_response[2]; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (800) +#define CLIENT_PACKET_POOL_SIZE ((CLIENT_PACKET_SIZE + sizeof(NX_PACKET)) * 4) +ULONG client_packet_pool_area[CLIENT_PACKET_POOL_SIZE/4 + 4]; + +static TX_THREAD client_thread; +static NX_HTTP_CLIENT my_client; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter = 0; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (800) +#define SERVER_PACKET_POOL_SIZE ((SERVER_PACKET_SIZE + sizeof(NX_PACKET)) * 4) +ULONG server_packet_pool_area[SERVER_PACKET_POOL_SIZE/4 + 4]; + +/* Define the IP thread stack areas. */ + +ULONG server_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; +ULONG client_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; + +/* Define the ARP cache areas. */ + +ULONG server_arp_space_area[512 / sizeof(ULONG)]; +ULONG client_arp_space_area[512 / sizeof(ULONG)]; + + + +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static CHAR *pointer; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_client_change_connect_port_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + status = tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer , SERVER_PACKET_POOL_SIZE); + + pointer = pointer + SERVER_PACKET_POOL_SIZE; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "HTTP Server IP", + HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_POOL_SIZE); + + pointer = pointer + CLIENT_PACKET_POOL_SIZE; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; + + /* wait for the server to set up */ + tx_thread_sleep(20); + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + { + + error_counter++; + } + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + if (status != FX_SUCCESS) + { + + error_counter++; + } + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1460); + if (status) + { + + error_counter++; + } + + /* Upload the 1st file to the server domain. */ +#ifdef __PRODUCT_NETXDUO__ + + status = nxd_http_client_put_start(&my_client, &server_ip_address, "http://www.abc.com/client_test.htm", + "name", "password", 103, 3 * NX_IP_PERIODIC_RATE); +#else + + status = nx_http_client_put_start(&my_client, server_ip_address, "http://www.abc.com/client_test.htm", + "name", "password", 103, 3 * NX_IP_PERIODIC_RATE); +#endif + + if (status) + { + + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + { + + error_counter++; + } + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + + + error_counter++; + } + + /* Based on information from the Server we need to connect on a different port. */ + status = nx_http_client_set_connect_port(&my_client, SECONDARY_SERVER_PORT); + + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Need a sleep to let the 'server' thread listen on the new port. */ + tx_thread_sleep(10); + + /* Send the 1st GET request to the server. */ +#ifdef __PRODUCT_NETXDUO__ + + status = nxd_http_client_get_start(&my_client, &server_ip_address, "http://www.abc.com/client_test.htm", + NX_NULL, 0, "name", "password", 100); +#else + + status = nx_http_client_get_start(&my_client, server_ip_address, "http://www.abc.com/client_test.htm", + NX_NULL, 0, "name", "password", 100); +#endif /* USE_DUO */ + + if(status) + { + + error_counter++; + } + + status = nx_http_client_delete(&my_client); + if(status) + { + + error_counter++; + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Client Change Connect Port Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + test_control_return(1); + } + + /* Create a TCP socket act as the HTTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Bind the TCP socket to the default HTTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Load up the server 'responses'. */ + http_test_initialize(); + + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Receive another TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + tx_thread_sleep(20); + + /* Send the TCP response packet. */ + status = nx_http_response_packet_send(&server_socket, 80, 0); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + nx_tcp_socket_disconnect(&server_socket, 500); + + + /* Unaccept the server socket. */ + nx_tcp_server_socket_unaccept(&server_socket); + + nx_tcp_server_socket_unlisten(&server_ip, SERVER_PORT); + + /* Listen on the alternative server port. */ + status = nx_tcp_server_socket_listen(&server_ip, SECONDARY_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + + error_counter++; + } + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + tx_thread_sleep(10); + + /* Send the TCP response packet. */ + nx_http_response_packet_send(&server_socket, 80, 1); + + + /* Wait for the client to terminate the connection. */ + tx_thread_sleep(20); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void http_test_initialize() +{ + + http_response[0].http_response_pkt_data = &PUT_firstreply[0]; + http_response[0].http_response_pkt_size = PUT_firstreply_size; + + http_response[1].http_response_pkt_data = &GET_firstreply[0]; + http_response[1].http_response_pkt_size = GET_firstreply_size; + +} + + +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + error_counter++; + } + + /* Write the HTTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, http_response[packet_number].http_response_pkt_data, + http_response[packet_number].http_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = http_response[packet_number].http_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + + nx_packet_release(response_packet); + } + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_client_change_connect_port_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Client Change Connect Port Test......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_delete_basic_test.c b/test/regression/http_test/netx_http_delete_basic_test.c new file mode 100644 index 00000000..aa035d37 --- /dev/null +++ b/test/regression/http_test/netx_http_delete_basic_test.c @@ -0,0 +1,390 @@ +/* This case tests basic DELETE function. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* This is a HTTP get packet captured by wireshark. DELETE index.html*/ +static char pkt[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ +0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ +0x00, 0x81, 0x00, 0x21, 0x40, 0x00, 0x80, 0x06, /* ...!@... */ +0x78, 0x21, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* x!...i.. */ +0x00, 0x7b, 0xc1, 0x4b, 0x00, 0x50, 0x40, 0x81, /* .{.K.P@. */ +0xf0, 0x40, 0x77, 0x7f, 0x23, 0xc7, 0x50, 0x18, /* .@w.#.P. */ +0xfa, 0xf0, 0xf0, 0x51, 0x00, 0x00, 0x44, 0x45, /* ...Q..DE */ +0x4c, 0x45, 0x54, 0x45, 0x20, 0x2f, 0x69, 0x6e, /* LETE /in */ +0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* dex.htm */ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, /* HTTP/1.1 */ +0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, /* ..User-A */ +0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, /* gent: cu */ +0x72, 0x6c, 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, /* rl/7.32. */ +0x30, 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, /* 0..Host: */ +0x20, 0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, /* 192.168 */ +0x2e, 0x30, 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, /* .0.123.. */ +0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, /* Accept: */ +0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a /* */ +}; + + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_delete_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write DELETE packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Delete Basic Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_delete_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Delete Basic Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_digest_authenticate_test.c b/test/regression/http_test/netx_http_digest_authenticate_test.c new file mode 100644 index 00000000..6f021a2b --- /dev/null +++ b/test/regression/http_test/netx_http_digest_authenticate_test.c @@ -0,0 +1,528 @@ +/* This case tests digest authentication. + HA1 = MD5("name:NetX Duo HTTP demo:password") + = 01bb2595c9221423951ee86f3573b465 + HA2 = MD5("GET:/index.htm") + = d4b1da8c7955d2e98bc56ffc93003b44 + Response = MD5("01bb2595c9221423951ee86f3573b465: + nonce: + 00000001:0a4f113b:auth: + d4b1da8c7955d2e98bc56ffc93003b44") + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_HTTP_DIGEST_ENABLE) + +#include "../web_test/http_digest_authentication.c" + + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static TX_SEMAPHORE server_start; +static TX_SEMAPHORE client_stop; + + +static UINT authentication_check(NX_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +static UINT authentication_check_extended(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, + CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length); + +static CHAR nonce_buffer[NX_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR temp_nonce_buffer[NX_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR response_buffer[32 + 1]; +static NX_MD5 client_md5data; + +static char pkt[] = { +0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* GET /index.htm */ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, /* HTTP/1.1.. */ +}; + +static UINT test_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_digest_authenticate_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + tx_semaphore_create(&server_start, "server start", 0); + tx_semaphore_create(&client_stop, "client stop", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + for (test_count = 0; test_count < 2; test_count++) + { + tx_semaphore_get(&server_start, NX_WAIT_FOREVER); + + /* Bind the client socket. */ + status = nx_tcp_client_socket_bind(&(my_client.nx_http_client_socket), NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check status of the bind. */ + if (status) + error_counter++; + + /* Connect to the HTTP server. */ +#ifdef __PRODUCT_NETXDUO__ + + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&(my_client.nx_http_client_socket), &server_ip_address, + my_client.nx_http_client_connect_port, NX_WAIT_FOREVER); +#else + /* Invoke the NetX (IPv4 only) connection call. */ + status = nx_tcp_client_socket_connect(&(my_client.nx_http_client_socket), server_ip_address, + my_client.nx_http_client_connect_port, NX_WAIT_FOREVER); +#endif + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Send the request. */ + status = nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&(my_client.nx_http_client_socket), &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + else + { + status = http_nonce_retrieve(recv_packet, nonce_buffer); + if (status) + error_counter++; + nx_packet_release(recv_packet); + + /* Check if the nonce is regenerated. */ + if (test_count == 0) + { + memcpy(temp_nonce_buffer, nonce_buffer, sizeof(nonce_buffer)); + } + else + { + if (memcmp(temp_nonce_buffer, nonce_buffer, sizeof(nonce_buffer)) == 0) + { + error_counter++; + } + } + } + + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "password", nonce_buffer, "GET", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Disconnect and unbind the socket. */ + nx_tcp_socket_disconnect(&(my_client.nx_http_client_socket), NX_HTTP_CLIENT_TIMEOUT); + nx_tcp_client_socket_unbind(&(my_client.nx_http_client_socket)); + + /* Bind the client socket. */ + status = nx_tcp_client_socket_bind(&(my_client.nx_http_client_socket), NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check status of the bind. */ + if (status) + error_counter++; + + /* Connect to the HTTP server. */ +#ifdef __PRODUCT_NETXDUO__ + + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&(my_client.nx_http_client_socket), &server_ip_address, + my_client.nx_http_client_connect_port, NX_WAIT_FOREVER); +#else + /* Invoke the NetX (IPv4 only) connection call. */ + status = nx_tcp_client_socket_connect(&(my_client.nx_http_client_socket), server_ip_address, + my_client.nx_http_client_connect_port, NX_WAIT_FOREVER); +#endif + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + + /* Build the Authorization header. */ + nx_packet_data_append(send_packet, "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, nonce_buffer, NX_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + nx_packet_data_append(send_packet, "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Now send the packet to the HTTP server. */ + status = nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&(my_client.nx_http_client_socket), &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + if (test_count == 0) + { + /* Check the status, If authentication success , it should be 200. */ + if ((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + } + else + { + /* Check the status, If authentication fail , it should be 401. */ + if ((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + } + + nx_packet_release(recv_packet); + } + + /* Disconnect and unbind the socket. */ + nx_tcp_socket_disconnect(&(my_client.nx_http_client_socket), NX_HTTP_CLIENT_TIMEOUT); + nx_tcp_client_socket_unbind(&(my_client.nx_http_client_socket)); + + tx_semaphore_put(&client_stop); + } + + status = nx_http_client_delete(&my_client); + if (status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT digest_authenticate_callback(NX_HTTP_SERVER *server_ptr, CHAR *name_ptr, + CHAR *realm_ptr, CHAR *password_ptr, CHAR *method, + CHAR *authorization_uri, CHAR *authorization_nc, + CHAR *authorization_cnonce) +{ + + if (memcmp(authorization_nc, "00000001", 8) != 0) + { + return 1; + } + + if (test_count == 0) + { + /* Test authentication success. */ + return 0; + } + else + { + /* Test authentication fail. */ + return 1; + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Digest Authenticate Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if (status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + server_stack, sizeof(server_stack), &server_pool, authentication_check, NX_NULL); + if (status) + error_counter++; + + nx_http_server_digest_authenticate_notify_set(&my_server, digest_authenticate_callback); + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); + tx_semaphore_get(&client_stop, NX_WAIT_FOREVER); + + status = nx_http_server_authentication_check_set(&my_server, authentication_check_extended); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request digest authentication. */ + return(NX_HTTP_DIGEST_AUTHENTICATE); +} + +static UINT authentication_check_extended(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, + CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + *name_length = 4; + *password_length = 8; + *realm_length = 18; + + /* Request digest authentication. */ + return(NX_HTTP_DIGEST_AUTHENTICATE); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_digest_authenticate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Digest Authenticate Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/http_test/netx_http_digest_authenticate_timeout_test.c b/test/regression/http_test/netx_http_digest_authenticate_timeout_test.c new file mode 100644 index 00000000..d99a8abb --- /dev/null +++ b/test/regression/http_test/netx_http_digest_authenticate_timeout_test.c @@ -0,0 +1,531 @@ +/* This case tests digest authentication. + HA1 = MD5("name:NetX Duo HTTP demo:Placeholderpassword") + = 01bb2595c9221423951ee86f3573b465 + HA2 = MD5("GET:/index.htm") + = d4b1da8c7955d2e98bc56ffc93003b44 + Response = MD5("01bb2595c9221423951ee86f3573b465: + nonce: + 00000001:0a4f113b:auth: + d4b1da8c7955d2e98bc56ffc93003b44") + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_HTTP_DIGEST_ENABLE) + +#include "../web_test/http_digest_authentication.c" + + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NX_TCP_SOCKET client_socket[NX_HTTP_SERVER_NONCE_MAX + 1]; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static TX_SEMAPHORE server_start; +static TX_SEMAPHORE client_stop; + +static UINT authentication_check(NX_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); + +static CHAR nonce_buffer[NX_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR temp_nonce_buffer[NX_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR response_buffer[32 + 1]; +static NX_MD5 client_md5data; + +static char pkt[] = { +0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* GET /index.htm */ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, /* HTTP/1.1.. */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_digest_authenticate_timeout_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + tx_semaphore_create(&server_start, "server start", 0); + tx_semaphore_create(&client_stop, "client stop", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *send_packet[NX_HTTP_SERVER_NONCE_MAX + 1]; +NX_PACKET *recv_packet; +CHAR *buffer_ptr; +INT i; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + tx_semaphore_get(&server_start, NX_WAIT_FOREVER); + + for (i = 0; i < NX_HTTP_SERVER_NONCE_MAX + 1; i++) + { + + /* Create an HTTP client instance. */ + status = nx_tcp_socket_create(&client_ip, &client_socket[i], "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the client socket. */ + status = nx_tcp_client_socket_bind(&client_socket[i], NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check status of the bind. */ + if (status) + error_counter++; + + /* Connect to the HTTP server. */ +#ifdef __PRODUCT_NETXDUO__ + + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&client_socket[i], &server_ip_address, + NX_HTTP_SERVER_PORT, NX_WAIT_FOREVER); +#else + /* Invoke the NetX (IPv4 only) connection call. */ + status = nx_tcp_client_socket_connect(&client_socket[i], server_ip_address, + NX_HTTP_SERVER_PORT, NX_WAIT_FOREVER); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet[i], pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_tcp_socket_send(&client_socket[i], send_packet[i], NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[i], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + else + { + + if (i == NX_HTTP_SERVER_NONCE_MAX) + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + /* Check the status, no nonce entry, it should be 200. */ + if ((buffer_ptr[9] != '5') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + + /* Discconect. */ + nx_tcp_socket_disconnect(&client_socket[i], NX_NO_WAIT); + + /* Sleep for the allocated nonce to be timed out. */ + tx_thread_sleep(NX_HTTP_SERVER_NONCE_TIMEOUT + NX_IP_PERIODIC_RATE); + + /* Reconnect to HTTP server. */ +#ifdef __PRODUCT_NETXDUO__ + + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&client_socket[i], &server_ip_address, + NX_HTTP_SERVER_PORT, NX_WAIT_FOREVER); +#else + /* Invoke the NetX (IPv4 only) connection call. */ + status = nx_tcp_client_socket_connect(&client_socket[i], server_ip_address, + NX_HTTP_SERVER_PORT, NX_WAIT_FOREVER); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet[i], pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_tcp_socket_send(&client_socket[i], send_packet[i], NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[i], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } + + /* Retrieve the nonce. */ + status = http_nonce_retrieve(recv_packet, nonce_buffer); + if (status) + error_counter++; + + nx_packet_release(recv_packet); + } + + /* Calculate the response. */ + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "Placeholderpassword", nonce_buffer, "GET", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet[i], pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + + /* Build the Authorization header. */ + nx_packet_data_append(send_packet[i], "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], nonce_buffer, NX_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + nx_packet_data_append(send_packet[i], "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + nx_tcp_socket_disconnect(&client_socket[i], NX_NO_WAIT); + } + + for (i = NX_HTTP_SERVER_NONCE_MAX; i >= 0; i--) + { + + /* Reconnect to the HTTP server. */ +#ifdef __PRODUCT_NETXDUO__ + + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&client_socket[i], &server_ip_address, + NX_HTTP_SERVER_PORT, NX_WAIT_FOREVER); +#else + /* Invoke the NetX (IPv4 only) connection call. */ + status = nx_tcp_client_socket_connect(&client_socket[i], server_ip_address, + NX_HTTP_SERVER_PORT, NX_WAIT_FOREVER); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Now send the packet to the HTTP server. */ + status = nx_tcp_socket_send(&client_socket[i], send_packet[i], NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[i], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + if (i == 0) + { + /* This nonce is timed out, the response should be 401. */ + if ((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + } + else + { + /* Check the status, If authentication success , it should be 200. */ + if ((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + } + + nx_packet_release(recv_packet); + } + + /* Disconnect and unbind the socket. */ + status = nx_tcp_socket_disconnect(&client_socket[i], NX_HTTP_CLIENT_TIMEOUT); + status += nx_tcp_client_socket_unbind(&client_socket[i]); + status += nx_tcp_socket_delete(&client_socket[i]); + if (status) + error_counter++; + } + + tx_semaphore_put(&client_stop); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Digest Authenticate Timeout Test....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if (status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + server_stack, sizeof(server_stack), &server_pool, authentication_check, NX_NULL); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "Placeholderpassword"; + *realm = "NetX Duo HTTP demo"; + + /* Request digest authentication. */ + return(NX_HTTP_DIGEST_AUTHENTICATE); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_digest_authenticate_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Digest Authenticate Timeout Test.....................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/http_test/netx_http_get_content_length_test.c b/test/regression/http_test/netx_http_get_content_length_test.c new file mode 100644 index 00000000..9e05ab43 --- /dev/null +++ b/test/regression/http_test/netx_http_get_content_length_test.c @@ -0,0 +1,615 @@ +/* This case tests the get content length task which should allow zero or more white + spaces between field name (Content-Length) and value. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static void http_test_initialize(); +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); + + +char get_response_packet[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x34, 0x31, 0x35, /* gth: 415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +int get_response_size = 130; + +char get_response_packet_nospace[129] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x34, 0x31, 0x35, /* gth:415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +int get_response_packet_nospace_size = 129; + +char get_response_packet_3spaces[132] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x20, 0x34, 0x31, 0x35, /* gth: 415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; +int get_response_packet_3spaces_size = 132; + +char get_response_packet_nolength[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x20, 0x20, /* gth: */ +0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* ..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +int get_response_packet_nolength_size = 130; + +char get_response_packet_nolength_400[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, /* TP/1.0 4 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x20, 0x20, /* gth: */ +0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* ..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +int get_response_packet_nolength_400_size = 130; + +#define RESPONSE_COUNT 5 + +typedef struct HTTP_RESPONSE_STRUCT +{ + char *http_response_pkt_data; + int http_response_pkt_size; +} HTTP_RESPONSE; + + +static HTTP_RESPONSE http_response[RESPONSE_COUNT]; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; +static UINT client_received_response = NX_FALSE; +static UINT server_start = NX_FALSE; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_get_content_length_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +UINT i; + + /* wait for the server to set up */ + tx_thread_sleep(50); + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + if (status != FX_SUCCESS) + error_counter++; + + /* Open four client connections, to test the response to Get Start. */ + for (i = 0; i < RESPONSE_COUNT; i++) + { + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + while(!server_start) + tx_thread_sleep(10); + + /* Send a series of get requests to the Server, testing the ability to find Content-Length data + with different formats, including the last test where the response is missing the length. */ + + #ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "", "", 2 * NX_IP_PERIODIC_RATE); + #else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "", "", 2 * NX_IP_PERIODIC_RATE); + #endif + + if (status && (i < 3)) + { + error_counter++; + } + else if ((i >= 3) && (status == NX_SUCCESS)) + { + error_counter++; + } + + server_start = NX_FALSE; + client_received_response = NX_TRUE; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + } + + if (client_pool.nx_packet_pool_invalid_releases) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Get Content-Length Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the HTTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the IP port. */ + status = nx_tcp_server_socket_listen(&server_ip, 80, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + http_test_initialize(); + + /* Act as the HTTP server to receive the Client query and send the HTTP server response. */ + for (i = 0; i < RESPONSE_COUNT; i++ ) + { + + server_start = NX_TRUE; + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + client_received_response = NX_FALSE; + + /* Send the TCP response packet. */ + status = nx_http_response_packet_send(&server_socket, 80, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if (i < 3) + { + while(!client_received_response) + tx_thread_sleep(10); + } + + /* Done with SMTP connection. Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + error_counter++; + } + + if (i >= 3) + { + while(!client_received_response) + tx_thread_sleep(10); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unbind the UDP socket. */ + status = nx_tcp_server_socket_relisten(&server_ip, 80, &server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unbind the UDP socket. */ + status = nx_tcp_server_socket_unlisten(&server_ip, 80); + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } +} + + +static void http_test_initialize() +{ + + http_response[0].http_response_pkt_data = &get_response_packet[0]; + http_response[0].http_response_pkt_size = get_response_size; + + http_response[1].http_response_pkt_data = &get_response_packet_nospace[0]; + http_response[1].http_response_pkt_size = get_response_packet_nospace_size; + + http_response[2].http_response_pkt_data = &get_response_packet_3spaces[0]; + http_response[2].http_response_pkt_size = get_response_packet_3spaces_size; + + http_response[3].http_response_pkt_data = &get_response_packet_nolength[0]; + http_response[3].http_response_pkt_size = get_response_packet_nolength_size; + + http_response[4].http_response_pkt_data = &get_response_packet_nolength_400[0]; + http_response[4].http_response_pkt_size = get_response_packet_nolength_400_size; + +} + + +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the HTTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, http_response[packet_number].http_response_pkt_data, + http_response[packet_number].http_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = http_response[packet_number].http_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 200); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_get_content_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Get Content-Length Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_get_contentlength_packetleak_test.c b/test/regression/http_test/netx_http_get_contentlength_packetleak_test.c new file mode 100644 index 00000000..8099aa57 --- /dev/null +++ b/test/regression/http_test/netx_http_get_contentlength_packetleak_test.c @@ -0,0 +1,646 @@ +/* This case tests the get content length task which should allow zero or more white + spaces between field name (Content-Length) and value. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 +#define SERVER_PORT 80 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static void http_test_initialize(); +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); + + +static char get_response_packet_nolabel[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x53, 0x6f, 0x6e, /* 00 ..XXn */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x34, 0x31, 0x35, /* gth: 415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +static int get_response_nolabel_size = 130; + + +static char get_response_packet_nolength[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x20, 0x20, /* gth: */ +0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* ..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +static int get_response_packet_nolength_size = 130; + +static char get_response_ok_packet[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x31, 0x30, /* gth: 10 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0e, 0x0a, 0x0d, 0x0b, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0e, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0b, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0e, 0x0b, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +static int get_response_ok_size = 130; + +static char get_response_bad_packet[202] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x31, 0x35, /* gth: 15 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0e, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0e, 0x0b, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0e, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0e, /* .. */ +0x0b, 0x0d, 0x0b, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0e, 0x0a, /* /head>.. */ +0x0d, 0x0b, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ + +}; + +static int get_response_bad_size = 202; + +#define RESPONSE_COUNT 4 + +typedef struct HTTP_RESPONSE_STRUCT +{ + char *http_response_pkt_data; + int http_response_pkt_size; +} HTTP_RESPONSE; + + +static HTTP_RESPONSE http_response[RESPONSE_COUNT]; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 1) +#define CLIENT_PACKET_POOL_SIZE ((CLIENT_PACKET_SIZE + sizeof(NX_PACKET)) * 5) +ULONG client_packet_pool_area[CLIENT_PACKET_POOL_SIZE/4 + 4]; + +static TX_THREAD client_thread; +static NX_HTTP_CLIENT my_client; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter; +static UINT client_received_response = NX_FALSE; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 1) +#define SERVER_PACKET_POOL_SIZE ((SERVER_PACKET_SIZE + sizeof(NX_PACKET)) * 5) +ULONG server_packet_pool_area[SERVER_PACKET_POOL_SIZE/4 + 4]; + +/* Define the IP thread stack areas. */ + +ULONG server_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; +ULONG client_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; + +/* Define the ARP cache areas. */ + +ULONG server_arp_space_area[512 / sizeof(ULONG)]; +ULONG client_arp_space_area[512 / sizeof(ULONG)]; + + + +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_get_contentlength_packetleak_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, (ULONG*)(((int)server_packet_pool_area + 15) & ~15) , SERVER_PACKET_POOL_SIZE); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "HTTP Server IP", + HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + (UCHAR*)server_ip_thread_stack, + sizeof(server_ip_thread_stack), + 1); + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *)server_arp_space_area, sizeof(server_arp_space_area)); + + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, (ULONG*)(((int)client_packet_pool_area + 15) & ~15) , CLIENT_PACKET_POOL_SIZE); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + (UCHAR*)client_ip_thread_stack, + sizeof(client_ip_thread_stack), + 1); + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *)client_arp_space_area, sizeof(client_arp_space_area)); + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *recv_packet; +UINT i; +UINT previously_available = 0; + + /* wait for the server to set up */ + tx_thread_sleep(50); + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + if (status != FX_SUCCESS) + error_counter++; + + /* Open four client connections, to test the response to Get Start. */ + for (i = 0; i < 3; i++) + { + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + if (status) + error_counter++; + + previously_available = client_pool.nx_packet_pool_available; + + /* Send a series of get requests to the Server, testing the ability to find Content-Length data + with different formats, including the last test where the response is missing the length. */ + +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/client_test.htm", NX_NULL, 0, "", "", 50); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/client_test.htm", + NX_NULL, 0, "", "",50); +#endif + + if (status != NX_SUCCESS) + { + if (client_pool.nx_packet_pool_available != previously_available) + { + error_counter++; + } + + } + else /* get start does not fail, we request a GET packet*/ + { + + tx_thread_sleep(10); + previously_available = client_pool.nx_packet_pool_available; + + status = nx_http_client_get_packet(&my_client, &recv_packet, 200); + + if (status != NX_SUCCESS) + { + if (client_pool.nx_packet_pool_available != previously_available) + { + error_counter++; + } + } + } + + client_received_response = NX_TRUE; + tx_thread_sleep(50); + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + } + + client_received_response = NX_TRUE; + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, test_count; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Get Content Length Packet Leak Test.................."); + + /* Check for earlier error. */ + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the HTTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the IP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + http_test_initialize(); + + test_count = 2; + + /* Act as the HTTP server to receive the Client query and send the HTTP server response. */ + for (i = 0; i < test_count; i++ ) + { + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Send the TCP response packet. */ + status = nx_http_response_packet_send(&server_socket, 80, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + while(!client_received_response) + tx_thread_sleep(50); + + client_received_response = NX_FALSE; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unbind the UDP socket. */ + status = nx_tcp_server_socket_relisten(&server_ip, SERVER_PORT, &server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 30 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status ) + { + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + + /* Send the TCP response packet. */ + status = nx_http_response_packet_send(&server_socket, 80, 2); + + /* Check status. */ + if (status) + { + error_counter++; + + } + + /* Give Client a chance to process previous packet. */ + tx_thread_sleep(50); + + /* Send the fourth server response packet. */ + status = nx_http_response_packet_send(&server_socket, 80, 3); + + /* Check status. */ + if (status) + { + error_counter++; + } + + while(!client_received_response) + tx_thread_sleep(50); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unbind the TCP socket. */ + status = nx_tcp_server_socket_unlisten(&server_ip, SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; + +} + + +static void http_test_initialize() +{ + + http_response[0].http_response_pkt_data = &get_response_packet_nolabel[0]; + http_response[0].http_response_pkt_size = get_response_nolabel_size; + + http_response[1].http_response_pkt_data = &get_response_packet_nolength[0]; + http_response[1].http_response_pkt_size = get_response_packet_nolength_size; + + http_response[2].http_response_pkt_data = &get_response_ok_packet[0]; + http_response[2].http_response_pkt_size = get_response_ok_size; + + http_response[3].http_response_pkt_data = &get_response_bad_packet[0]; + http_response[3].http_response_pkt_size = get_response_bad_size; + +} + + +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the HTTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, http_response[packet_number].http_response_pkt_data, + http_response[packet_number].http_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = http_response[packet_number].http_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 200); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_get_contentlength_packetleak_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Get Content Length Packet Leak Test..................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_get_put_referred_URI_test.c b/test/regression/http_test/netx_http_get_put_referred_URI_test.c new file mode 100644 index 00000000..1e594ebb --- /dev/null +++ b/test/regression/http_test/netx_http_get_put_referred_URI_test.c @@ -0,0 +1,629 @@ +/* This case tests the ability of the HTTP Client to accept a URI resource string that does not + designate a root directory based file location. If the string begins with an HTTP: or HTTPS: (not . + case sensitive) the HTTP Client will send the string as is. (Note this does not guarantee the HTTP server . + will forward to the referred location.) Otherwise the URI is processed as if it is root directory based, . + and a leading forward slash '/' is appended if one is missing. . + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#else +#include "nx_http_client.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define SERVER_PORT 80 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static void http_test_initialize(); +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number); + + +static char PUT_firstreply[202] = { +0x48, 0x54, /* HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x32, /* TP/1.1 2 */ +0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x44, /* 00 OK..D */ +0x61, 0x74, 0x65, 0x3a, 0x20, 0x54, 0x75, 0x65, /* ate: Tue */ +0x2c, 0x20, 0x32, 0x34, 0x20, 0x4d, 0x61, 0x79, /* , 24 May */ +0x20, 0x32, 0x30, 0x31, 0x36, 0x20, 0x32, 0x33, /* 2016 23 */ +0x3a, 0x32, 0x36, 0x3a, 0x35, 0x34, 0x20, 0x47, /* :26:54 G */ +0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65, 0x72, 0x76, /* MT..Serv */ +0x65, 0x72, 0x3a, 0x20, 0x4d, 0x61, 0x6b, 0x6f, /* er: Mako */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6e, /* Server.n */ +0x65, 0x74, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* et..Cont */ +0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, /* ent-Type */ +0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, /* : text/h */ +0x74, 0x6d, 0x6c, 0x3b, 0x20, 0x63, 0x68, 0x61, /* tml; cha */ +0x72, 0x73, 0x65, 0x74, 0x3d, 0x75, 0x74, 0x66, /* rset=utf */ +0x2d, 0x38, 0x0d, 0x0a, 0x43, 0x61, 0x63, 0x68, /* -8..Cach */ +0x65, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, /* e-Contro */ +0x6c, 0x3a, 0x20, 0x6e, 0x6f, 0x2d, 0x73, 0x74, /* l: no-st */ +0x6f, 0x72, 0x65, 0x2c, 0x20, 0x6e, 0x6f, 0x2d, /* ore, no- */ +0x63, 0x61, 0x63, 0x68, 0x65, 0x2c, 0x20, 0x6d, /* cache, m */ +0x75, 0x73, 0x74, 0x2d, 0x72, 0x65, 0x76, 0x61, /* ust-reva */ +0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2c, 0x20, /* lidate, */ +0x6d, 0x61, 0x78, 0x2d, 0x61, 0x67, 0x65, 0x3d, /* max-age= */ +0x30, 0x0d, 0x0a, 0x4b, 0x65, 0x65, 0x70, 0x2d, /* 0..Keep- */ +0x41, 0x6c, 0x69, 0x76, 0x65, 0x3a, 0x20, 0x43, /* Alive: C */ +0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x0d, 0x0a /* lose.... */ +}; + +static int PUT_firstreply_size = 202; + + +static char GET_firstreply[638] = { +0x48, 0x54, /* HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x32, /* TP/1.1 2 */ +0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x43, /* 00 OK..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* ontent-T */ +0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, /* ype: tex */ +0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3b, 0x20, /* t/html; */ +0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, /* charset= */ +0x75, 0x74, 0x66, 0x2d, 0x38, 0x0d, 0x0a, 0x43, /* utf-8..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, /* ontent-L */ +0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34, /* ength: 4 */ +0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, /* ..Connec */ +0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, /* tion: cl */ +0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x53, 0x74, 0x61, /* ose..Sta */ +0x74, 0x75, 0x73, 0x3a, 0x20, 0x32, 0x30, 0x30, /* tus: 200 */ +0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x58, 0x2d, 0x46, /* OK..X-F */ +0x72, 0x61, 0x6d, 0x65, 0x2d, 0x4f, 0x70, 0x74, /* rame-Opt */ +0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x41, 0x4c, /* ions: AL */ +0x4c, 0x4f, 0x57, 0x41, 0x4c, 0x4c, 0x0d, 0x0a, /* LOWALL.. */ +0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x43, /* Access-C */ +0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x41, /* ontrol-A */ +0x6c, 0x6c, 0x6f, 0x77, 0x2d, 0x4f, 0x72, 0x69, /* llow-Ori */ +0x67, 0x69, 0x6e, 0x3a, 0x20, 0x2a, 0x0d, 0x0a, /* gin: *.. */ +0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x43, /* Access-C */ +0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x41, /* ontrol-A */ +0x6c, 0x6c, 0x6f, 0x77, 0x2d, 0x4d, 0x65, 0x74, /* llow-Met */ +0x68, 0x6f, 0x64, 0x73, 0x3a, 0x20, 0x47, 0x45, /* hods: GE */ +0x54, 0x2c, 0x20, 0x50, 0x4f, 0x53, 0x54, 0x2c, /* T, POST, */ +0x20, 0x50, 0x55, 0x54, 0x2c, 0x20, 0x4f, 0x50, /* PUT, OP */ +0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2c, 0x20, 0x44, /* TIONS, D */ +0x45, 0x4c, 0x45, 0x54, 0x45, 0x2c, 0x20, 0x50, /* ELETE, P */ +0x41, 0x54, 0x43, 0x48, 0x0d, 0x0a, 0x41, 0x63, /* ATCH..Ac */ +0x63, 0x65, 0x73, 0x73, 0x2d, 0x43, 0x6f, 0x6e, /* cess-Con */ +0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x41, 0x6c, 0x6c, /* trol-All */ +0x6f, 0x77, 0x2d, 0x48, 0x65, 0x61, 0x64, 0x65, /* ow-Heade */ +0x72, 0x73, 0x3a, 0x20, 0x6f, 0x72, 0x69, 0x67, /* rs: orig */ +0x69, 0x6e, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x74, /* in, cont */ +0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, /* ent-type */ +0x2c, 0x20, 0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, /* , X-Requ */ +0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57, 0x69, /* ested-Wi */ +0x74, 0x68, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, /* th..Acce */ +0x73, 0x73, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x72, /* ss-Contr */ +0x6f, 0x6c, 0x2d, 0x4d, 0x61, 0x78, 0x2d, 0x41, /* ol-Max-A */ +0x67, 0x65, 0x3a, 0x20, 0x31, 0x38, 0x30, 0x30, /* ge: 1800 */ +0x0d, 0x0a, 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, /* ..ETag: */ +0x22, 0x36, 0x30, 0x35, 0x39, 0x38, 0x32, 0x38, /* "6059828 */ +0x32, 0x63, 0x65, 0x36, 0x38, 0x32, 0x38, 0x66, /* 2ce6828f */ +0x36, 0x38, 0x35, 0x34, 0x35, 0x34, 0x64, 0x66, /* 685454df */ +0x66, 0x39, 0x62, 0x35, 0x65, 0x66, 0x34, 0x66, /* f9b5ef4f */ +0x64, 0x22, 0x0d, 0x0a, 0x43, 0x61, 0x63, 0x68, /* d"..Cach */ +0x65, 0x2d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, /* e-Contro */ +0x6c, 0x3a, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x61, /* l: max-a */ +0x67, 0x65, 0x3d, 0x30, 0x2c, 0x20, 0x70, 0x72, /* ge=0, pr */ +0x69, 0x76, 0x61, 0x74, 0x65, 0x2c, 0x20, 0x6d, /* ivate, m */ +0x75, 0x73, 0x74, 0x2d, 0x72, 0x65, 0x76, 0x61, /* ust-reva */ +0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x0d, 0x0a, /* lidate.. */ +0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, /* X-Reques */ +0x74, 0x2d, 0x49, 0x64, 0x3a, 0x20, 0x30, 0x30, /* t-Id: 00 */ +0x63, 0x61, 0x64, 0x31, 0x30, 0x36, 0x2d, 0x61, /* cad106-a */ +0x32, 0x34, 0x35, 0x2d, 0x34, 0x61, 0x39, 0x34, /* 245-4a94 */ +0x2d, 0x39, 0x61, 0x39, 0x36, 0x2d, 0x35, 0x31, /* -9a96-51 */ +0x37, 0x37, 0x66, 0x62, 0x61, 0x64, 0x34, 0x62, /* 77fbad4b */ +0x35, 0x64, 0x0d, 0x0a, 0x58, 0x2d, 0x52, 0x75, /* 5d..X-Ru */ +0x6e, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x20, 0x30, /* ntime: 0 */ +0x2e, 0x36, 0x34, 0x33, 0x37, 0x35, 0x30, 0x0d, /* .643750. */ +0x0a, 0x58, 0x2d, 0x50, 0x6f, 0x77, 0x65, 0x72, /* .X-Power */ +0x65, 0x64, 0x2d, 0x42, 0x79, 0x3a, 0x20, 0x50, /* ed-By: P */ +0x68, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x50, /* husion P */ +0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, /* assenger */ +0x20, 0x34, 0x2e, 0x30, 0x2e, 0x35, 0x37, 0x0d, /* 4.0.57. */ +0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x54, /* .Date: T */ +0x75, 0x65, 0x2c, 0x20, 0x32, 0x34, 0x20, 0x4d, /* ue, 24 M */ +0x61, 0x79, 0x20, 0x32, 0x30, 0x31, 0x36, 0x20, /* ay 2016 */ +0x32, 0x33, 0x3a, 0x32, 0x36, 0x3a, 0x33, 0x31, /* 23:26:31 */ +0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65, /* GMT..Se */ +0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x6e, 0x67, /* rver: ng */ +0x69, 0x6e, 0x78, 0x2f, 0x31, 0x2e, 0x39, 0x2e, /* inx/1.9. */ +0x33, 0x20, 0x2b, 0x20, 0x50, 0x68, 0x75, 0x73, /* 3 + Phus */ +0x69, 0x6f, 0x6e, 0x20, 0x50, 0x61, 0x73, 0x73, /* ion Pass */ +0x65, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x34, 0x2e, /* enger 4. */ +0x30, 0x2e, 0x35, 0x37, 0x0d, 0x0a, 0x0d, 0x0a, /* 0.57.... */ +0x36, 0x38, 0x2e, 0x32 /* 68.2 */ +}; + +static int GET_firstreply_size = 638; + + +typedef struct HTTP_RESPONSE_STRUCT +{ + char *http_response_pkt_data; + int http_response_pkt_size; +} HTTP_RESPONSE; + + +static HTTP_RESPONSE http_response[2]; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (800) +#define CLIENT_PACKET_POOL_SIZE ((CLIENT_PACKET_SIZE + sizeof(NX_PACKET)) * 4) +ULONG client_packet_pool_area[CLIENT_PACKET_POOL_SIZE/4 + 4]; + +static TX_THREAD client_thread; +static NX_HTTP_CLIENT my_client; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter = 0; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (800) +#define SERVER_PACKET_POOL_SIZE ((SERVER_PACKET_SIZE + sizeof(NX_PACKET)) * 4) +ULONG server_packet_pool_area[SERVER_PACKET_POOL_SIZE/4 + 4]; + +/* Define the IP thread stack areas. */ + +ULONG server_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; +ULONG client_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; + +/* Define the ARP cache areas. */ + +ULONG server_arp_space_area[512 / sizeof(ULONG)]; +ULONG client_arp_space_area[512 / sizeof(ULONG)]; + + + +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static CHAR *pointer; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_get_put_referred_URI_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + status = tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer , SERVER_PACKET_POOL_SIZE); + + pointer = pointer + SERVER_PACKET_POOL_SIZE; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "HTTP Server IP", + HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_POOL_SIZE); + + pointer = pointer + CLIENT_PACKET_POOL_SIZE; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; + + /* wait for the server to set up */ + tx_thread_sleep(20); + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1460); + if (status) + error_counter++; + + /* Upload the 1st file to the server domain. */ +#ifdef __PRODUCT_NETXDUO__ + + status = nxd_http_client_put_start(&my_client, &server_ip_address, "http://www.abc.com/client_test.htm", + "name", "password", 103, 3 * NX_IP_PERIODIC_RATE); +#else + + status = nx_http_client_put_start(&my_client, server_ip_address, "http://www.abc.com/client_test.htm", + "name", "password", 103, 3 * NX_IP_PERIODIC_RATE); +#endif + + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + { + error_counter++; + } + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + error_counter++; + } + + tx_thread_sleep(10); + + /* Send the 1st GET request to the server. */ +#ifdef __PRODUCT_NETXDUO__ + + status = nxd_http_client_get_start(&my_client, &server_ip_address, "http://www.abc.com/client_test.htm", + NX_NULL, 0, "name", "password", 100); +#else + + status = nx_http_client_get_start(&my_client, server_ip_address, "http://www.abc.com/client_test.htm", + NX_NULL, 0, "name", "password", 100); +#endif /* USE_DUO */ + + if(status) + { + error_counter++; + } + + nx_http_client_delete(&my_client); + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: HTTP GET PUT Referred URI Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the HTTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the IP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + http_test_initialize(); + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Receive another TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + tx_thread_sleep(20); + + /* Send the TCP response packet. */ + nx_http_response_packet_send(&server_socket, 80, 0); + + nx_tcp_socket_disconnect(&server_socket, 500); + + /* Unaccept the server socket. */ + nx_tcp_server_socket_unaccept(&server_socket); + + nx_tcp_server_socket_relisten(&server_ip, SERVER_PORT, &server_socket); + + /* Wait for a 2nd connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + tx_thread_sleep(10); + + /* Send the TCP response packet. */ + nx_http_response_packet_send(&server_socket, 80, 1); + + /* Wait for the client to terminate the connection. */ + tx_thread_sleep(20); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +static void http_test_initialize() +{ + + http_response[0].http_response_pkt_data = &PUT_firstreply[0]; + http_response[0].http_response_pkt_size = PUT_firstreply_size; + + http_response[1].http_response_pkt_data = &GET_firstreply[0]; + http_response[1].http_response_pkt_size = GET_firstreply_size; + +} + + +static UINT nx_http_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, INT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the HTTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, http_response[packet_number].http_response_pkt_data, + http_response[packet_number].http_response_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = http_response[packet_number].http_response_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + nx_packet_release(response_packet); + + return status; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_get_put_referred_URI_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP GET PUT Referred URI Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_head_basic_test.c b/test/regression/http_test/netx_http_head_basic_test.c new file mode 100644 index 00000000..c0a085ab --- /dev/null +++ b/test/regression/http_test/netx_http_head_basic_test.c @@ -0,0 +1,390 @@ +/* This case tests basic HEAD method. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* This is a HTTP get packet captured by wireshark. HEAD index.html*/ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0x7f, 0x0f, 0xef, 0x40, 0x00, 0x80, 0x06, /* ....@... */ + 0x68, 0x55, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* hU...i.. */ + 0x00, 0x7b, 0xcf, 0xf1, 0x00, 0x50, 0x64, 0x0c, /* .{...Pd. */ + 0x11, 0x41, 0x77, 0x7f, 0x23, 0xc7, 0x50, 0x18, /* .Aw.#.P. */ + 0xfa, 0xf0, 0xf8, 0x68, 0x00, 0x00, 0x48, 0x45, /* ...h..HE */ + 0x41, 0x44, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, /* AD /inde */ + 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, /* x.htm HT */ + 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, /* TP/1.1.. */ + 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, /* User-Age */ + 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, /* nt: curl */ + 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, /* /7.32.0. */ + 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, /* .Host: 1 */ + 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, /* 92.168.0 */ + 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, /* .123..Ac */ + 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, /* cept: */ + 0x2a, 0x0d, 0x0a, 0x0d, 0x0a /* *.... */ +}; + + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_head_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write HEAD packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Head Basic Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_head_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Head Basic Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_if_modified_since_test.c b/test/regression/http_test/netx_http_if_modified_since_test.c new file mode 100644 index 00000000..5c91897a --- /dev/null +++ b/test/regression/http_test/netx_http_if_modified_since_test.c @@ -0,0 +1,464 @@ +/* This case tests filed If-Modified-field. + * if the requested variant has not been modified since the time specified in this field, + * an entity will not be returned from the server; instead, a 304 (not modified) response + * will be returned without any message-body. + * + * In this case, client get the index.htm with If-Modified-Since = 20130101, and index.htm is + * modified on 2013...., So server should send 304. + * */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + + +#if defined(WIN32) || defined(__linux__) +#include +#include +#include +#endif /* defined(WIN32) || defined(__linux__) */ + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + + +/* Frame (190 bytes) */ +/* This is a HTTP get packet captured by wireshark. If-Modified-since = 20130101 .*/ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0xb0, 0x09, 0xb8, 0x40, 0x00, 0x80, 0x06, /* ....@... */ + 0x6e, 0x5b, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* n[...i.. */ + 0x00, 0x7b, 0xc4, 0x77, 0x00, 0x50, 0x51, 0x6d, /* .{.w.PQm */ + 0xbc, 0x22, 0x77, 0x7f, 0x23, 0xc7, 0x50, 0x18, /* ."w.#.P. */ + 0xfa, 0xf0, 0x20, 0x9c, 0x00, 0x00, 0x47, 0x45, /* .. ...GE */ + 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, /* T /index */ + 0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, /* .htm HTT */ + 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, /* P/1.1..U */ + 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, /* ser-Agen */ + 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, /* t: curl/ */ + 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, /* 7.32.0.. */ + 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, /* Host: 19 */ + 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, /* 2.168.0. */ + 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, /* 123..Acc */ + 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, /* ept: */ + 0x0d, 0x0a, 0x49, 0x66, 0x2d, 0x4d, 0x6f, 0x64, /* ..If-Mod */ + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x53, 0x69, /* ified-Si */ + 0x6e, 0x63, 0x65, 0x3a, 0x20, 0x54, 0x75, 0x65, /* nce: Tue */ + 0x2c, 0x20, 0x30, 0x31, 0x20, 0x4a, 0x61, 0x6e, /* , 01 Jan */ + 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x30, 0x30, /* 2013 00 */ + 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x20, 0x47, /* :00:00 G */ + 0x4d, 0x54, 0x0d, 0x0a, 0x0d, 0x0a /* MT.... */ +}; + + + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +#if defined(WIN32) || defined(__linux__) +static VOID get_gmt(NX_HTTP_SERVER_DATE *now); +static UINT cache_info_get(CHAR *resource, UINT *max_age, NX_HTTP_SERVER_DATE *last_modified); +#endif + + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_if_modified_since_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +#if defined(WIN32) || defined(__linux__) + nx_http_server_gmt_callback_set(&my_server, get_gmt); + nx_http_server_cache_info_callback_set(&my_server, cache_info_get); +#endif /* WIN32 || __linux__ */ + +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write If-Mdified-since Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 304. */ + if((buffer_ptr[9] != '3') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '4')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP If Modified Since Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} + + +#if defined(WIN32) || defined(__linux__) +VOID get_gmt(NX_HTTP_SERVER_DATE *now) +{ +time_t rawtime; +struct tm *timeinfo; + + time (&rawtime); + timeinfo = gmtime(&rawtime); + + now -> nx_http_server_day = timeinfo -> tm_mday; + now -> nx_http_server_month = timeinfo -> tm_mon; + now -> nx_http_server_year = timeinfo -> tm_year + 1900; + now -> nx_http_server_hour = timeinfo -> tm_hour; + now -> nx_http_server_minute = timeinfo -> tm_min; + now -> nx_http_server_second = timeinfo -> tm_sec; + now -> nx_http_server_weekday = timeinfo -> tm_wday; + + +} + + +UINT cache_info_get(CHAR *resource, UINT *max_age, NX_HTTP_SERVER_DATE *last_modified) +{ + *max_age = 315360000; + + /* 0130101 */ + last_modified -> nx_http_server_day = 1; + last_modified -> nx_http_server_month = 0; + last_modified -> nx_http_server_year = 113 + 1900; /* 2013 */ + last_modified -> nx_http_server_hour = 0; + last_modified -> nx_http_server_minute = 0; + last_modified -> nx_http_server_second = 0; + last_modified -> nx_http_server_weekday = 2; + + return NX_TRUE; +} +#endif /* WIN32 || __linux__ */ + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_if_modified_since_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP If Modified Since Test...............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_multipart_fragment_test.c b/test/regression/http_test/netx_http_multipart_fragment_test.c new file mode 100644 index 00000000..fdbf8381 --- /dev/null +++ b/test/regression/http_test/netx_http_multipart_fragment_test.c @@ -0,0 +1,599 @@ +/* This case tests whether HTTP server can work well with multipart/form-data. + * server packet size 800 + * client packet size 1400 + * pkt size is bigger than 1500 to cause client/server fragmentation. + */ + +/* Here is the packet content. */ +/* +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example" + +testtest(repeat 49 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example2" + +test2test2(repeat 35 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example3" + +test3test3(repeat 39 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example4" + +test4test4(repeat 51times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example5" + +test5(repeat 54times) +------------------------------4ebf00fbcf09-- +*/ + +/* length1 = 196, + * length2 = 175, + * length3 = 195, + * length4 = 205 + * length5 = 220. + * */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" + +extern void test_control_return(UINT); +#if defined(NX_HTTP_MULTIPART_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 + +/* This is a HTTP get packet captured by wireshark. HEAD index.html*/ +static char pkt[] = { + 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2f, 0x20, 0x48, /* POST / H */ + 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, /* TTP/1.1. */ + 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, /* .User-Ag */ + 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, /* ent: cur */ + 0x6c, 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, /* l/7.32.0 */ + 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, /* ..Host: */ + 0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, /* 192.168. */ + 0x30, 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, /* 0.123..A */ + 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, /* ccept: * */ + 0x2f, 0x2a, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* *..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, /* ent-Type */ + 0x3a, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* : multip */ + 0x61, 0x72, 0x74, 0x2f, 0x66, 0x6f, 0x72, 0x6d, /* art/form */ + 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, 0x62, /* -data; b */ + 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x3d, /* oundary= */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, /* t-Length */ + 0x3a, 0x20, 0x31, 0x35, 0x32, 0x31, 0x0d, 0x0a, /* : 1521.. */ + 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x3a, 0x20, /* Expect: */ + 0x31, 0x30, 0x30, 0x2d, 0x63, 0x6f, 0x6e, 0x74, /* 100-cont */ + 0x69, 0x6e, 0x75, 0x65, 0x0d, 0x0a, 0x0d, 0x0a, /* inue.... */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, /* e"....te */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* st..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x32, 0x22, 0x0d, /* ample2". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* t2..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x33, 0x22, 0x0d, /* ample3". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x33, /* ...test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x0d, 0x0a, /* 3test3.. */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x34, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, /* e4"....t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x0d, 0x0a, 0x2d, 0x2d, /* est4..-- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, /* t-Dispos */ + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, /* ition: f */ + 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, /* orm-data */ + 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, /* ; name=" */ + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x35, /* example5 */ + 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, /* "....tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* 5..----- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, 0x66, /* -4ebf00f */ + 0x62, 0x63, 0x66, 0x30, 0x39, 0x2d, 0x2d, 0x0d, /* bcf09--. */ + 0x0a /* . */ +}; + + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT my_get_notify(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE 1400 + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE 800 + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +static UINT multipart_flag; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_multipart_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, my_get_notify); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + multipart_flag = 0; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write HEAD packet into the packet payload. */ + status = nx_packet_data_append(my_packet, pkt, sizeof(pkt), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (multipart_flag != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Multipart Fragment Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} + +UINT my_get_notify(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ + +ULONG offset, total_length; +ULONG length; +UCHAR buffer[1440]; +UINT count = 0; +UINT status; +NX_PACKET *response_pkt; + + /* Process multipart data. */ + if(request_type == NX_HTTP_SERVER_POST_REQUEST) + { + while(nx_http_server_get_entity_header(server_ptr, &packet_ptr, buffer, sizeof(buffer)) == NX_SUCCESS) + { + + multipart_flag = 1; + + /* Send the result. */ + total_length = 0; + count++; + + while(nx_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, &length) == NX_SUCCESS) + { + /* Print content data. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer, length, &length); + buffer[length] = 0; + total_length += length; + } + + /* Check the data length. */ + if((count == 1) && (total_length != 196)) + error_counter++; + else if((count == 2) && (total_length != 175)) + error_counter++; + else if((count == 3) && (total_length != 195)) + error_counter++; + else if((count == 4) && (total_length != 205)) + error_counter++; + else if((count == 5) && (total_length != 220)) + error_counter++; + + } + + /* Generate HTTP header. */ + status = nx_http_server_callback_generate_response_header(server_ptr, &response_pkt, NX_HTTP_STATUS_OK, 800, "text/html", "Server: NetXDuo HTTP 5.3\r\n"); + if(status == NX_SUCCESS) + { + if(nx_http_server_callback_packet_send(server_ptr, response_pkt)) + nx_packet_release(response_pkt); + } + else + error_counter++; + } + else + return NX_SUCCESS; + + return(NX_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_multipart_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: HTTP Multipart Fragment Test..............................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/http_test/netx_http_multipart_underflow_test.c b/test/regression/http_test/netx_http_multipart_underflow_test.c new file mode 100644 index 00000000..b35bffe2 --- /dev/null +++ b/test/regression/http_test/netx_http_multipart_underflow_test.c @@ -0,0 +1,614 @@ +/* This case tests whether HTTP server can work well with multipart/form-data. + * server packet size 800 + * client packet size 1400 + * pkt size is bigger than 1500 to cause client/server fragmentation. + */ + +/* Here is the packet content. */ +/* First two bytes of Content-Disposition is replaced with CRLF */ +/* +------------------------------4ebf00fbcf09 + +ntent-Disposition: form-data; name="example" + +testtest(repeat 49 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example2" + +test2test2(repeat 35 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example3" + +test3test3(repeat 39 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example4" + +test4test4(repeat 51times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example5" + +test5(repeat 54times) +------------------------------4ebf00fbcf09-- +*/ + +/* length1 = 196, + * length2 = 175, + * length3 = 195, + * length4 = 205 + * length5 = 220. + * */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" + +extern void test_control_return(UINT); +#if defined(NX_HTTP_MULTIPART_ENABLE) && !defined(NX_DISABLE_IPV4) +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 + +/* This is a HTTP get packet captured by wireshark. HEAD index.html*/ +static char pkt[] = { + 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2f, 0x20, 0x48, /* POST / H */ + 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, /* TTP/1.1. */ + 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, /* .User-Ag */ + 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, /* ent: cur */ + 0x6c, 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, /* l/7.32.0 */ + 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, /* ..Host: */ + 0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, /* 192.168. */ + 0x30, 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, /* 0.123..A */ + 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, /* ccept: * */ + 0x2f, 0x2a, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* *..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, /* ent-Type */ + 0x3a, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* : multip */ + 0x61, 0x72, 0x74, 0x2f, 0x66, 0x6f, 0x72, 0x6d, /* art/form */ + 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, 0x62, /* -data; b */ + 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x3d, /* oundary= */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, /* t-Length */ + 0x3a, 0x20, 0x31, 0x35, 0x32, 0x31, 0x0d, 0x0a, /* : 1521.. */ + 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x3a, 0x20, /* Expect: */ + 0x31, 0x30, 0x30, 0x2d, 0x63, 0x6f, 0x6e, 0x74, /* 100-cont */ + 0x69, 0x6e, 0x75, 0x65, 0x0d, 0x0a, 0x0d, 0x0a, /* inue.... */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x0d, 0x0a, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, /* e"....te */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* st..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x32, 0x22, 0x0d, /* ample2". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* t2..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x33, 0x22, 0x0d, /* ample3". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x33, /* ...test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x0d, 0x0a, /* 3test3.. */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x34, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, /* e4"....t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x0d, 0x0a, 0x2d, 0x2d, /* est4..-- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, /* t-Dispos */ + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, /* ition: f */ + 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, /* orm-data */ + 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, /* ; name=" */ + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x35, /* example5 */ + 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, /* "....tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* 5..----- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, 0x66, /* -4ebf00f */ + 0x62, 0x63, 0x66, 0x30, 0x39, 0x2d, 0x2d, 0x0d, /* bcf09--. */ + 0x0a /* . */ +}; + + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT my_get_notify(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE 1400 + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE 800 + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +static UINT multipart_flag; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_multipart_underflow_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, my_get_notify); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + multipart_flag = 0; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write HEAD packet into the packet payload. */ + status = nx_packet_data_append(my_packet, pkt, sizeof(pkt), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if((error_counter) || (multipart_flag != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Multipart Underflow Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} + +UINT my_get_notify(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ + +ULONG offset, total_length; +ULONG length; +UCHAR buffer[1440]; +UINT count = 0; +UINT status; +NX_PACKET *response_pkt; + + /* Set first 5 bytes to 0. */ + buffer[0] = 0xFF; + buffer[1] = 0xFF; + buffer[2] = 0xFF; + buffer[3] = 0xFF; + buffer[4] = 0xFF; + + /* Process multipart data. */ + if(request_type == NX_HTTP_SERVER_POST_REQUEST) + { + while(nx_http_server_get_entity_header(server_ptr, &packet_ptr, buffer + 5, sizeof(buffer) - 5) == NX_SUCCESS) + { + if ((buffer[0] & buffer[1] & buffer[2] & buffer[3] & buffer[4]) != 0xFF) + { + + /* Detected underflow. */ + error_counter++; + } + + multipart_flag = 1; + + /* Send the result. */ + total_length = 0; + count++; + + while(nx_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, &length) == NX_SUCCESS) + { + /* Print content data. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer + 5, length, &length); + buffer[length + 5] = 0; + total_length += length; + } + + /* Check the data length. */ + /* if((count == 1) && (total_length != 196)) + error_counter++; */ + if((count == 2) && (total_length != 175)) + error_counter++; + else if((count == 3) && (total_length != 195)) + error_counter++; + else if((count == 4) && (total_length != 205)) + error_counter++; + else if((count == 5) && (total_length != 220)) + error_counter++; + + } + + /* Generate HTTP header. */ + status = nx_http_server_callback_generate_response_header(server_ptr, &response_pkt, NX_HTTP_STATUS_OK, 800, "text/html", "Server: NetXDuo HTTP 5.3\r\n"); + if(status == NX_SUCCESS) + { + if(nx_http_server_callback_packet_send(server_ptr, response_pkt)) + nx_packet_release(response_pkt); + } + else + error_counter++; + } + else + return NX_SUCCESS; + + return(NX_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_multipart_underflow_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: HTTP Multipart Underflow Test.............................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/http_test/netx_http_post_basic_test.c b/test/regression/http_test/netx_http_post_basic_test.c new file mode 100644 index 00000000..2a8f1a3f --- /dev/null +++ b/test/regression/http_test/netx_http_post_basic_test.c @@ -0,0 +1,464 @@ +/* This case tests basic post method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* This is a HTTP get packet captured by wireshark. POST AAAAAAAAAA*/ +static char pkt[] = { + 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2f, 0x69, 0x6e, /* POST /in */ + 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* dex.htm */ + 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, /* HTTP/1.1 */ + 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, /* ..User-A */ + 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, /* gent: cu */ + 0x72, 0x6c, 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, /* rl/7.32. */ + 0x30, 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, /* 0..Host: */ + 0x20, 0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, /* 192.168 */ + 0x2e, 0x30, 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, /* .0.123.. */ + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, /* Accept: */ + 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* */ + 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ + 0x67, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x0d, /* gth: 10. */ + 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, /* .Content */ + 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, /* -Type: a */ + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ + 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x77, 0x77, 0x77, /* on/x-www */ + 0x2d, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x75, 0x72, /* -form-ur */ + 0x6c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, /* lencoded */ + 0x0d, 0x0a, 0x0d, 0x0a, 0x41, 0x41, 0x41, 0x41, /* ....AAAA */ + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 /* AAAAAA */ +}; + + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +static UINT my_get_notify(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_post_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, my_get_notify); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Now GET the test file */ + +#ifdef __PRODUCT_NETXDUO__ + + /* Use the 'duo' service to send a GET request to the server (can use IPv4 or IPv6 addresses). */ + status = nxd_http_client_get_start(&my_client, &server_ip_address, + "/index.htm", NX_NULL, 0, "name", "password", NX_IP_PERIODIC_RATE); +#else + + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + status = nx_http_client_get_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + NX_NULL, 0, "name", "password", NX_IP_PERIODIC_RATE); +#endif /* USE_DUO */ + + if(status) + error_counter++; + + while (1) + { + status = nx_http_client_get_packet(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_HTTP_GET_DONE) + break; + + if (status) + error_counter++; + else + nx_packet_release(recv_packet); + } + + status = nx_http_client_delete(&my_client); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write POST packet into the packet payload. */ + status = nx_packet_data_append(my_packet, pkt, sizeof(pkt), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Post Basic Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} + + +/* Test extended functions. */ +UINT my_get_notify(NX_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ + +UINT status; +NX_PACKET *response_pkt; +UCHAR data[] = "hello"; + + /* Process multipart data. */ + if (request_type == NX_HTTP_SERVER_GET_REQUEST) + { + + /* Generate HTTP header. */ + status = nx_http_server_callback_generate_response_header_extended(server_ptr, &response_pkt, NX_HTTP_STATUS_OK, sizeof(NX_HTTP_STATUS_OK) - 1, sizeof(data) - 1, "text/html", 9, "Server: NetXDuo HTTP 5.3\r\n", 26); + if (status == NX_SUCCESS) + { + if (nx_http_server_callback_packet_send(server_ptr, response_pkt)) + nx_packet_release(response_pkt); + } + else + error_counter++; + + status = nx_http_server_callback_data_send(server_ptr, data, sizeof(data) - 1); + if (status) + error_counter++; + } + else if (request_type == NX_HTTP_SERVER_POST_REQUEST) + { + status = nx_http_server_callback_response_send_extended(server_ptr, NX_HTTP_STATUS_OK, sizeof(NX_HTTP_STATUS_OK) - 1, "Server: NetXDuo HTTP 5.3\r\n", 26, NX_NULL, 0); + if (status) + error_counter++; + } + else + return NX_SUCCESS; + + return(NX_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_post_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Post Basic Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_request_in_multiple_packets_test.c b/test/regression/http_test/netx_http_request_in_multiple_packets_test.c new file mode 100644 index 00000000..c4656796 --- /dev/null +++ b/test/regression/http_test/netx_http_request_in_multiple_packets_test.c @@ -0,0 +1,452 @@ +/* This case tests the ability of the HTTP server to process HTTP request string in multiple packets. + * Packet1. GET / HTTP/1.0 + * Packet2. CR + * Packet3. LF + * Packet4. CR + * Packet5. LF + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +extern void test_control_return(UINT); +#ifndef NX_DISABLE_IPV4 +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_PORT 80 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT error_counter = 0; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (800) +#define CLIENT_PACKET_POOL_SIZE ((CLIENT_PACKET_SIZE + sizeof(NX_PACKET)) * 16) +ULONG client_packet_pool_area[CLIENT_PACKET_POOL_SIZE/4 + 4]; + +static TX_THREAD client_thread; +static NX_HTTP_CLIENT my_client; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (800) +#define SERVER_PACKET_POOL_SIZE ((SERVER_PACKET_SIZE + sizeof(NX_PACKET)) * 16) +ULONG server_packet_pool_area[SERVER_PACKET_POOL_SIZE/4 + 4]; + +static TX_THREAD server_thread; +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +/* Define the IP thread stack areas. */ + +ULONG server_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; +ULONG client_ip_thread_stack[2 * 1024 / sizeof(ULONG)]; + +/* Define the ARP cache areas. */ + +ULONG server_arp_space_area[512 / sizeof(ULONG)]; +ULONG client_arp_space_area[512 / sizeof(ULONG)]; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static CHAR *pointer; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_request_in_multiple_packets_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + status = tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer , SERVER_PACKET_POOL_SIZE); + + pointer = pointer + SERVER_PACKET_POOL_SIZE; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "HTTP Server IP", + HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_POOL_SIZE); + + pointer = pointer + CLIENT_PACKET_POOL_SIZE; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, DEMO_STACK_SIZE, 1); + + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + /* wait for the server to set up */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1460); + if (status) + error_counter++; + + /* Upload the 1st file to the server domain. */ +#ifdef __PRODUCT_NETXDUO__ + + status = nxd_http_client_put_start(&my_client, &server_ip_address, "http://www.abc.com/client_test.htm", + "name", "password", 103, 3 * NX_IP_PERIODIC_RATE); +#else + + status = nx_http_client_put_start(&my_client, server_ip_address, "http://www.abc.com/client_test.htm", + "name", "password", 103, 3 * NX_IP_PERIODIC_RATE); +#endif + + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + { + error_counter++; + } + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + error_counter++; + } + + + /* Bind the socket. */ + if (nx_tcp_client_socket_bind(&(my_client.nx_http_client_socket), NX_ANY_PORT, NX_WAIT_FOREVER)) + { + error_counter++; + } + + /* Connect to server. */ + if (nx_tcp_client_socket_connect(&(my_client.nx_http_client_socket), HTTP_SERVER_ADDRESS, + my_client.nx_http_client_connect_port, NX_IP_PERIODIC_RATE)) + { + error_counter++; + } + + /* Build simple request. */ + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + nx_packet_data_append(send_packet, "GET / HTTP/1.0", 14, + &client_pool, NX_WAIT_FOREVER); + if (nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_IP_PERIODIC_RATE)) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + nx_packet_data_append(send_packet, "\r", 1, + &client_pool, NX_WAIT_FOREVER); + if (nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_IP_PERIODIC_RATE)) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + nx_packet_data_append(send_packet, "\n", 1, + &client_pool, NX_WAIT_FOREVER); + if (nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_IP_PERIODIC_RATE)) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + nx_packet_data_append(send_packet, "\r", 1, + &client_pool, NX_WAIT_FOREVER); + if (nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_IP_PERIODIC_RATE)) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + nx_packet_data_append(send_packet, "\n", 1, + &client_pool, NX_WAIT_FOREVER); + if (nx_tcp_socket_send(&(my_client.nx_http_client_socket), send_packet, NX_IP_PERIODIC_RATE)) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Receive response from HTTP server. */ + if (nx_tcp_socket_receive(&(my_client.nx_http_client_socket), &recv_packet, NX_IP_PERIODIC_RATE)) + { + error_counter++; + } + else + { + nx_packet_release(recv_packet); + } + + /* wait for the server to set up */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + nx_http_client_delete(&my_client); + nx_http_server_stop(&my_server); + nx_http_server_delete(&my_server); + + /* Verify no packet is leak. */ + if ((client_pool.nx_packet_pool_total != client_pool.nx_packet_pool_available) || + (server_pool.nx_packet_pool_total != server_pool.nx_packet_pool_available)) + { + error_counter++; + } + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Request in Multiple Packets Test....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + { + error_counter++; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_request_in_multiple_packets_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: HTTP Request in Multiple Packets Test.....................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_server_type_retrieve_test.c b/test/regression/http_test/netx_http_server_type_retrieve_test.c new file mode 100644 index 00000000..a3fca24e --- /dev/null +++ b/test/regression/http_test/netx_http_server_type_retrieve_test.c @@ -0,0 +1,190 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_server.h" +#else +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; + + +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_server_type_retrieve_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +UCHAR type[20]; +UINT type_length; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Server Type Retrieve Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Type is "text/html", should return 9. */ + type_length = nx_http_server_type_get(&my_server, "test.htm", type); + if (type_length != 9) + error_counter++; + type_length = nx_http_server_type_get_extended(&my_server, "test.htm", 8, type, sizeof(type)); + if (type_length != 9) + error_counter++; + + /* The max size of destination string is not enough, should return 0. */ + type_length = nx_http_server_type_get_extended(&my_server, "test.htm", 8, type, 9); + if (type_length != 0) + error_counter++; + + /* Type is default "text/plain", should return 10. */ + type_length = nx_http_server_type_get(&my_server, "test.xml", type); + if (type_length != 10) + error_counter++; + type_length = nx_http_server_type_get_extended(&my_server, "test.xml", 8, type, sizeof(type)); + if (type_length != 10) + error_counter++; + + /* The max size of destination string is not enough, should return 0. */ + type_length = nx_http_server_type_get_extended(&my_server, "test.xml", 8, type, 5); + if (type_length != 0) + error_counter++; + + /* Type is default "text/plain", should return 10. */ + type_length = nx_http_server_type_get(&my_server, "test", type); + if (type_length != 10) + error_counter++; + type_length = nx_http_server_type_get_extended(&my_server, "test", 4, type, sizeof(type)); + if (type_length != 10) + error_counter++; + + /* The max size of destination string is not enough, should return 0. */ + type_length = nx_http_server_type_get_extended(&my_server, "test", 4, type, 5); + if (type_length != 0) + error_counter++; + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_server_type_retrieve_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Server Type Retrieve Test............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/http_test/netx_http_status_400_test.c b/test/regression/http_test/netx_http_status_400_test.c new file mode 100644 index 00000000..56e7d352 --- /dev/null +++ b/test/regression/http_test/netx_http_status_400_test.c @@ -0,0 +1,406 @@ +/* + 1. If Request-URIis an absoluteURI, the host is part of the Request-URI. Any Host header + field value in the request MUST be ignored. + 2. If the Request-URIis not an absoluteURI, and the request includes a Hostheader field, + the host is determined by the Hostheader field value. + 3. If the host as determined by rule 1 or 2 is not a valid host on the server, the response + MUST be a 400 (Bad Request) error message. + + Change Host field value from 192.168.0.123 to 192.168.0.120 .*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* This is a HTTP get packet captured by wireshark. + * curl 192.168.0.123 + * 123: pkt[120] = 0x31, pkt[121] = 0x32, pkt[122] = 0x33 + * 122: pkt[120] = 0x31, pkt[121] = 0x32, pkt[122] = 0x32 + * */ +static char pkt[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ +0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ +0x00, 0x7e, 0x0b, 0xd2, 0x40, 0x00, 0x80, 0x06, /* .~..@... */ +0x6c, 0x73, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* ls...i.. */ +0x00, 0x7b, 0xca, 0x95, 0x00, 0x50, 0x66, 0x2b, /* .{...Pf+ */ +0xe7, 0x60, 0xb6, 0xa2, 0xe6, 0xf3, 0x50, 0x18, /* .`....P. */ +0xfa, 0xf0, 0x59, 0x33, 0x00, 0x00, 0x47, 0x45, /* ..Y3..GE */ +0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, /* T /index */ +0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, /* .htm HTT */ +0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, /* P/1.1..U */ +0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, /* ser-Agen */ +0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, /* t: curl/ */ +0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, /* 7.32.0.. */ +0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, /* Host: 19 */ +0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, /* 2.168.0. */ +0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, /* 123..Acc */ +0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, /* ept: */ +0x0d, 0x0a, 0x0d, 0x0a /* .... */ + +}; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; + +static UINT error_counter; +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +static NXD_ADDRESS client_ip_address; +#else +static ULONG server_ip_address; +static ULONG client_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_status_400_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = HTTP_CLIENT_ADDRESS; + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; + client_ip_address = HTTP_CLIENT_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *buffer_ptr; +NX_PACKET *recv_packet; +NX_PACKET *send_packet; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Change '3' to '2' .*/ + pkt[122] = '2'; + + /* Write Aet packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Status 400 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_status_400_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Status 400 Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_status_404_test.c b/test/regression/http_test/netx_http_status_404_test.c new file mode 100644 index 00000000..f02cff6a --- /dev/null +++ b/test/regression/http_test/netx_http_status_404_test.c @@ -0,0 +1,392 @@ +/* If Tthe server has not found anything matching the Request-URI. + * 404 should be sent. */ + +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; +static unsigned char media_memory[512]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* This is a HTTP get packet captured by wireshark. + * curl 192.168.0.123/aaa.index + * */ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0x7c, 0x3a, 0xff, 0x40, 0x00, 0x80, 0x06, /* .|:.@... */ + 0x3d, 0x48, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* =H...i.. */ + 0x00, 0x7b, 0xcb, 0xef, 0x00, 0x50, 0x4d, 0x7b, /* .{...PM{ */ + 0x22, 0xf0, 0xcf, 0xed, 0x46, 0xa4, 0x50, 0x18, /* "...F.P. */ + 0xfa, 0xf0, 0x2e, 0x84, 0x00, 0x00, 0x47, 0x45, /* ......GE */ + 0x54, 0x20, 0x2f, 0x61, 0x61, 0x61, 0x2e, 0x68, /* T /aaa.h */ + 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, /* tm HTTP/ */ + 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x73, 0x65, /* 1.1..Use */ + 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, /* r-Agent: */ + 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, 0x37, 0x2e, /* curl/7. */ + 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x48, 0x6f, /* 32.0..Ho */ + 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32, 0x2e, /* st: 192. */ + 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31, 0x32, /* 168.0.12 */ + 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, /* 3..Accep */ + 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, /* t: */ + 0x0d, 0x0a /* .. */ +}; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_HTTP_CLIENT my_client; +static NX_IP client_ip; + +static UINT error_counter; +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +static NXD_ADDRESS client_ip_address; +#else +static ULONG server_ip_address; +static ULONG client_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_status_404_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = HTTP_CLIENT_ADDRESS; + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; + client_ip_address = HTTP_CLIENT_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *buffer_ptr; +NX_PACKET *recv_packet; +NX_PACKET *send_packet; + + /* Format the RAM disk - the memory for the RAM disk was setup in + tx_application_define above. This must be set up before the client(s) start + sending requests. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + media_memory, /* Media buffer pointer */ + sizeof(media_memory), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check the media format status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); + + /* Check the media open status. */ + if (status != FX_SUCCESS) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + + /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ + status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#else + + /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ + status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", + "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if(status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write Aet packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '4')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Status 404 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_status_404_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Status 404 Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/http_test/netx_http_status_501_test.c b/test/regression/http_test/netx_http_status_501_test.c new file mode 100644 index 00000000..c62a5d70 --- /dev/null +++ b/test/regression/http_test/netx_http_status_501_test.c @@ -0,0 +1,315 @@ +/* If the method is unrecognized or not implemented by the origin server, + * should repond 501. + * change GET to AET to build a unrecognized method packet. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_http_client.h" +#include "nxd_http_server.h" +#else +#include "nx_http_client.h" +#include "nx_http_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR *ram_disk_memory; +static FX_MEDIA ram_disk; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +/* This is a HTTP get packet captured by wireshark. + * curl 192.168.0.123 + * GET: pkt[54] = 0x47, pkt[55] = 0x45, pkt[56] = 0x54 + * AET: pkt[54] = 'A' , pkt[55] = 0x45, pkt[56] = 0x54 + * */ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0x75, 0x47, 0x4a, 0x40, 0x00, 0x80, 0x06, /* .uGJ@... */ + 0x31, 0x04, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* 1....i.. */ + 0x00, 0x7b, 0xe8, 0xeb, 0x00, 0x50, 0xe5, 0x59, /* .{...P.Y */ + 0x56, 0x32, 0x41, 0xf1, 0x07, 0xf0, 0x50, 0x18, /* V2A...P. */ + 0xfa, 0xf0, 0x65, 0x69, 0x00, 0x00, 0x47, 0x45, /* ..ei..GE */ + 0x54, 0x20, 0x2f, 0x20, 0x48, 0x54, 0x54, 0x50, /* T / HTTP */ + 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x73, /* /1.1..Us */ + 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, /* er-Agent */ + 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, 0x37, /* : curl/7 */ + 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x48, /* .32.0..H */ + 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32, /* ost: 192 */ + 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31, /* .168.0.1 */ + 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, /* 23..Acce */ + 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, /* pt: */ + 0x0a, 0x0d, 0x0a /* ... */ +}; + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; + +static UINT error_counter; +static NX_TCP_SOCKET client_socket; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +static NXD_ADDRESS client_ip_address; +#else +static ULONG server_ip_address; +static ULONG client_ip_address; +#endif + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_status_501_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Set up the server's IPv4 address here. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = HTTP_CLIENT_ADDRESS; + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; + client_ip_address = HTTP_CLIENT_ADDRESS; +#endif + + /* Create the HTTP Server. */ + status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, + pointer, 2048, &server_pool, NX_NULL, NX_NULL); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Save the memory pointer for the RAM disk. */ + ram_disk_memory = pointer; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *buffer_ptr; +NX_PACKET *recv_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Change 'G' to 'A' .*/ + pkt[54] = 'A'; + + /* Write Aet packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '5') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + + nx_packet_release(recv_packet); + } + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: HTTP Status 501 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* OK to start the HTTP Server. */ + status = nx_http_server_start(&my_server); + if(status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_http_server_delete(&my_server); + if(status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_status_501_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Status 501 Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/capture/_http._tcp.c b/test/regression/mdns_test/capture/_http._tcp.c new file mode 100644 index 00000000..445c4975 --- /dev/null +++ b/test/regression/mdns_test/capture/_http._tcp.c @@ -0,0 +1,59 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + diff --git a/test/regression/mdns_test/capture/_http._tcp.pcapng b/test/regression/mdns_test/capture/_http._tcp.pcapng new file mode 100644 index 00000000..0e0611c4 Binary files /dev/null and b/test/regression/mdns_test/capture/_http._tcp.pcapng differ diff --git a/test/regression/mdns_test/capture/_pdl-datastream._tcp.c b/test/regression/mdns_test/capture/_pdl-datastream._tcp.c new file mode 100644 index 00000000..c4b60be4 --- /dev/null +++ b/test/regression/mdns_test/capture/_pdl-datastream._tcp.c @@ -0,0 +1,131 @@ +/* Frame (86 bytes) */ +static const unsigned char pkt1[86] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x48, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .H..@... */ +0xd9, 0xb7, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x34, /* .......4 */ +0x03, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .,...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* l..... */ +}; + +/* Frame (496 bytes) */ +static const unsigned char pkt2[496] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x01, 0xe2, 0x77, 0x3a, 0x00, 0x00, 0xff, 0x11, /* ..w:.... */ +0xa1, 0x28, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .(...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xce, /* ........ */ +0xee, 0x32, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .2...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, /* w...rout */ +0x65, 0x72, 0xc0, 0x21, 0x00, 0x01, 0x80, 0x01, /* er.!.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x04, 0xc0, 0x32, 0x00, 0x21, 0x80, 0x01, /* ...2.!.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, /* ...x.... */ +0x00, 0x00, 0x23, 0x8c, 0xc0, 0x41, 0xc0, 0x32, /* ..#..A.2 */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x01, 0x4e, 0x09, 0x74, 0x78, 0x74, 0x76, 0x65, /* .N.txtve */ +0x72, 0x73, 0x3d, 0x31, 0x05, 0x6e, 0x6f, 0x74, /* rs=1.not */ +0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, 0x61, /* e=.qtota */ +0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, 0x6f, /* l=1.prio */ +0x72, 0x69, 0x74, 0x79, 0x3d, 0x31, 0x30, 0x11, /* rity=10. */ +0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ty=Canon */ +0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, 0x64, /* MF4570d */ +0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, /* w.produc */ +0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* t=(Canon */ +0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* MF4500w */ +0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, 0x70, /* ).pdl=ap */ +0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* plicatio */ +0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, /* n/octet- */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, 0x61, /* stream*a */ +0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, 0x3d, /* dminurl= */ +0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x72, /* http://r */ +0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, 0x6f, /* outer.lo */ +0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, 0x77, /* cal./t_w */ +0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x67, /* elcom.cg */ +0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x46, /* i.usb_MF */ +0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x27, /* G=Canon' */ +0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, 0x3d, /* usb_MDL= */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, 0x46, /* Canon MF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, 0x65, /* 4500w Se */ +0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, 0x46, /* ries (UF */ +0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, 0x0d, /* RII LT). */ +0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, /* transpar */ +0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, 0x69, /* ent=F.Bi */ +0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, 0x54, /* nary=F.T */ +0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, 0x6f, /* BCP=F.Co */ +0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, 0x6f, /* lor=F.Co */ +0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, 0x44, /* pies=T.D */ +0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, 0x0d, /* uplex=T. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, 0x73, /* PaperCus */ +0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, 0x69, /* tom=T.Bi */ +0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, 0x6c, /* nd=F.Col */ +0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, 0x53, /* late=T.S */ +0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, 0x74, /* ort=T.St */ +0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, 0x50, /* aple=F.P */ +0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, 0x50, /* unch=F.P */ +0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, 0x3d, /* aperMax= */ +0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, 0x34 /* legal-A4 */ +}; + +/* Frame (165 bytes) */ +static const unsigned char pkt3[165] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x97, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .g...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x83, /* ........ */ +0x26, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &3...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* l......_ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x29, 0x0c, 0x43, 0x61, 0x6e, /* ...).Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, /* w._pdl-d */ +0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, /* atastrea */ +0x6d, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* m._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +/* Frame (165 bytes) */ +static const unsigned char pkt4[165] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x97, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x66, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .f...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x83, /* ........ */ +0x26, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &5...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* l......_ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x91, 0x00, 0x29, 0x0c, 0x43, 0x61, 0x6e, /* ...).Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, /* w._pdl-d */ +0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, /* atastrea */ +0x6d, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* m._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + diff --git a/test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng b/test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng new file mode 100644 index 00000000..a6f33f69 Binary files /dev/null and b/test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng differ diff --git a/test/regression/mdns_test/capture/_printer._tcp.c b/test/regression/mdns_test/capture/_printer._tcp.c new file mode 100644 index 00000000..c4fa12a6 --- /dev/null +++ b/test/regression/mdns_test/capture/_printer._tcp.c @@ -0,0 +1,125 @@ +/* Frame (79 bytes) */ +static const unsigned char pkt1[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x41, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .A..@... */ +0xd9, 0xbe, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xc5, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (497 bytes) */ +static const unsigned char pkt2[497] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x01, 0xe3, 0x77, 0x9c, 0x00, 0x00, 0xff, 0x11, /* ..w..... */ +0xa0, 0xc5, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xcf, /* ........ */ +0x46, 0x4d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FM...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, /* 0w...rou */ +0x74, 0x65, 0x72, 0xc0, 0x1a, 0x00, 0x01, 0x80, /* ter..... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x04, 0xc0, 0x2b, 0x00, 0x21, 0x80, /* ....+.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x02, 0x03, 0xc0, 0x3a, 0xc0, /* ......:. */ +0x2b, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* +....... */ +0x94, 0x01, 0x56, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..V.txtv */ +0x65, 0x72, 0x73, 0x3d, 0x31, 0x07, 0x72, 0x70, /* ers=1.rp */ +0x3d, 0x61, 0x75, 0x74, 0x6f, 0x05, 0x6e, 0x6f, /* =auto.no */ +0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ +0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ +0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x32, 0x30, /* ority=20 */ +0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ +0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ +0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ +0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ +0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ +0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ +0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ +0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ +0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ +0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ +0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ +0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ +0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ +0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ +0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ +0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ +0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ +0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ +0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ +0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ +0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ +0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ +0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ +0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ +0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ +0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ +0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ +0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ +0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ +0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ +0x34 /* 4 */ +}; + +/* Frame (144 bytes) */ +static const unsigned char pkt3[144] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x82, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x7c, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .|...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6e, /* .......n */ +0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .<...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, /* al...... */ +0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, /* _printer */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x22, 0x0c, 0x43, /* .....".C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0x08, 0x5f, 0x70, 0x72, 0x69, /* 00w._pri */ +0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, /* nter._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (144 bytes) */ +static const unsigned char pkt4[144] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x82, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x7b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .{...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6e, /* .......n */ +0x18, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .>...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, /* al...... */ +0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, /* _printer */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x22, 0x0c, 0x43, /* .....".C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0x08, 0x5f, 0x70, 0x72, 0x69, /* 00w._pri */ +0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, /* nter._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + diff --git a/test/regression/mdns_test/capture/_printer._tcp.pcapng b/test/regression/mdns_test/capture/_printer._tcp.pcapng new file mode 100644 index 00000000..0515f836 Binary files /dev/null and b/test/regression/mdns_test/capture/_printer._tcp.pcapng differ diff --git a/test/regression/mdns_test/capture/_smb._tcp.c b/test/regression/mdns_test/capture/_smb._tcp.c new file mode 100644 index 00000000..cfe4fe11 --- /dev/null +++ b/test/regression/mdns_test/capture/_smb._tcp.c @@ -0,0 +1,102 @@ +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ +0xd9, 0xc2, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xb3, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (332 bytes) */ +static const unsigned char pkt2[332] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x01, 0x3e, 0x09, 0x17, 0x00, 0x00, 0xff, 0x11, /* .>...... */ +0x0f, 0x8f, 0xc0, 0xa8, 0x00, 0x65, 0xe0, 0x00, /* .....e.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */ +0x56, 0xdc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* V....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ +0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */ +0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */ +0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */ +0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */ +0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */ +0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ +0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */ +0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */ +0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */ +0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */ +0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */ +0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x65, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..e.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x.. */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */ +0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */ +0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */ +0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */ +0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */ +0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */ +0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */ +0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */ +0x40, 0x00, 0x00, 0x08 /* @... */ +}; + +/* Frame (129 bytes) */ +static const unsigned char pkt3[129] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x73, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ +0xd9, 0x8b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ +0x9d, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x1b, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + +/* Frame (129 bytes) */ +static const unsigned char pkt4[129] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x73, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ +0xd9, 0x8a, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ +0x9d, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x1b, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + diff --git a/test/regression/mdns_test/capture/_smb._tcp.pcapng b/test/regression/mdns_test/capture/_smb._tcp.pcapng new file mode 100644 index 00000000..33092eb7 Binary files /dev/null and b/test/regression/mdns_test/capture/_smb._tcp.pcapng differ diff --git a/test/regression/mdns_test/capture/address_change.c b/test/regression/mdns_test/capture/address_change.c new file mode 100644 index 00000000..bcc439ac --- /dev/null +++ b/test/regression/mdns_test/capture/address_change.c @@ -0,0 +1,346 @@ +/* Frame (269 bytes) */ +static const unsigned char pkt1[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt3[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt4[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt5[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt6[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (171 bytes) */ +static const unsigned char pkt7[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x9d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x0a, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .....C.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0xee, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* ......B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, /* .x.....C */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x40 /* ..@ */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt8[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x2a, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .*...C.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb8, 0x73, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .s...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, 0x0b, /* x.....C. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt9[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x29, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .)...C.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb8, 0x73, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .s...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, 0x0b, /* x.....C. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + diff --git a/test/regression/mdns_test/capture/address_change.pcapng b/test/regression/mdns_test/capture/address_change.pcapng new file mode 100644 index 00000000..3f91b89f Binary files /dev/null and b/test/regression/mdns_test/capture/address_change.pcapng differ diff --git a/test/regression/mdns_test/capture/announcement_in_multiple_packets.c b/test/regression/mdns_test/capture/announcement_in_multiple_packets.c new file mode 100644 index 00000000..2f5f64f3 --- /dev/null +++ b/test/regression/mdns_test/capture/announcement_in_multiple_packets.c @@ -0,0 +1,1935 @@ +/* Frame (1425 bytes) */ +static const unsigned char pkt1[1425] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x83, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ +0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ +0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (420 bytes) */ +static const unsigned char pkt2[420] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x96, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x17, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ +0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00 /* d... */ +}; + +/* Frame (1425 bytes) */ +static const unsigned char pkt3[1425] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x83, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ +0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ +0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (420 bytes) */ +static const unsigned char pkt4[420] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x96, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x15, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ +0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00 /* d... */ +}; + +/* Frame (1425 bytes) */ +static const unsigned char pkt5[1425] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x83, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x27, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .'...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ +0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ +0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (420 bytes) */ +static const unsigned char pkt6[420] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x96, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x13, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ +0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00 /* d... */ +}; + +/* Frame (1510 bytes) */ +static const unsigned char pkt7[1510] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xd8, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xd0, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ +0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* Frame (1512 bytes) */ +static const unsigned char pkt8[1512] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xda, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ +0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (119 bytes) */ +static const unsigned char pkt9[119] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x69, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ +0x90, 0x3d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .=...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ +0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + +/* Frame (1510 bytes) */ +static const unsigned char pkt10[1510] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xd8, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ +0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* Frame (1512 bytes) */ +static const unsigned char pkt11[1512] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xda, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xca, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ +0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (119 bytes) */ +static const unsigned char pkt12[119] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x69, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ +0x90, 0x3a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .:...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ +0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + +/* Frame (1510 bytes) */ +static const unsigned char pkt13[1510] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xd8, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xca, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ +0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* Frame (1512 bytes) */ +static const unsigned char pkt14[1512] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xda, 0x00, 0x0e, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ +0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (119 bytes) */ +static const unsigned char pkt15[119] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x69, 0x00, 0x0f, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ +0x90, 0x37, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .7...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ +0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + diff --git a/test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng b/test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng new file mode 100644 index 00000000..64e3fd72 Binary files /dev/null and b/test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng differ diff --git a/test/regression/mdns_test/capture/case_insensitivity.c b/test/regression/mdns_test/capture/case_insensitivity.c new file mode 100644 index 00000000..f60cf40d --- /dev/null +++ b/test/regression/mdns_test/capture/case_insensitivity.c @@ -0,0 +1,36 @@ +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3f, 0x3d, 0x61, 0x00, 0x00, 0xff, 0x11, /* .?=a.... */ +0xdc, 0x3e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .>...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x45, /* RMMDNSTE */ +0x53, 0x54, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* ST.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt2[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x2c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .,...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb9, 0x74, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .t...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + diff --git a/test/regression/mdns_test/capture/case_insensitivity.pcapng b/test/regression/mdns_test/capture/case_insensitivity.pcapng new file mode 100644 index 00000000..5b5b9cad Binary files /dev/null and b/test/regression/mdns_test/capture/case_insensitivity.pcapng differ diff --git a/test/regression/mdns_test/capture/client_passive.c b/test/regression/mdns_test/capture/client_passive.c new file mode 100644 index 00000000..23c5714e --- /dev/null +++ b/test/regression/mdns_test/capture/client_passive.c @@ -0,0 +1,209 @@ +/* Frame (134 bytes) */ +static const unsigned char pkt1[134] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ +0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ +0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (134 bytes) */ +static const unsigned char pkt2[134] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ +0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ +0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (134 bytes) */ +static const unsigned char pkt3[134] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ +0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ +0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt4[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt5[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt6[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt7[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0x6e, 0xb6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* n....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0xc0, 0x23, 0xc0, 0x34, 0x00, 0x0c, 0x00, /* p.#.4... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x11, /* ........ */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0xc0, 0x34, 0xc0, 0x4d, 0x00, 0x21, 0x80, /* r.4.M.!. */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x23, 0xc0, 0x73, /* untu.#.s */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x73, 0x00, 0x01, 0x80, 0x01, /* .y.s.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0xc0, 0x4d, 0x00, 0x10, 0x80, 0x01, /* .i.M.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ....... */ +}; + +/* Frame (107 bytes) */ +static const unsigned char pkt8[107] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x5d, 0x13, 0xc0, 0x00, 0x00, 0xff, 0x11, /* .]...... */ +0x06, 0x28, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .(...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x49, /* .......I */ +0x79, 0x60, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* y`...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0xc0, 0x23 /* p.# */ +}; + diff --git a/test/regression/mdns_test/capture/client_passive.pcapng b/test/regression/mdns_test/capture/client_passive.pcapng new file mode 100644 index 00000000..d9878160 Binary files /dev/null and b/test/regression/mdns_test/capture/client_passive.pcapng differ diff --git a/test/regression/mdns_test/capture/command.txt b/test/regression/mdns_test/capture/command.txt new file mode 100644 index 00000000..6751f595 --- /dev/null +++ b/test/regression/mdns_test/capture/command.txt @@ -0,0 +1,4 @@ +service avahi-daemon stop +service avahi-daemon restart +mzclient -a IPv4 -t _smb._tcp +for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 ; do { mzclient -p "_http._tcp 80 $i Simple Web Server Test For Multiple Packets"& } ; done; diff --git a/test/regression/mdns_test/capture/continuous_query.c b/test/regression/mdns_test/capture/continuous_query.c new file mode 100644 index 00000000..92506de4 --- /dev/null +++ b/test/regression/mdns_test/capture/continuous_query.c @@ -0,0 +1,122 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x7e, 0xd1, 0x00, 0x00, 0xff, 0x11, /* ..~..... */ +0x9a, 0xe8, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt4[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt5[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x8d, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt6[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x85, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + diff --git a/test/regression/mdns_test/capture/continuous_query.pcapng b/test/regression/mdns_test/capture/continuous_query.pcapng new file mode 100644 index 00000000..4c880dbe Binary files /dev/null and b/test/regression/mdns_test/capture/continuous_query.pcapng differ diff --git a/test/regression/mdns_test/capture/continuous_query_a.c b/test/regression/mdns_test/capture/continuous_query_a.c new file mode 100644 index 00000000..275318db --- /dev/null +++ b/test/regression/mdns_test/capture/continuous_query_a.c @@ -0,0 +1,30 @@ +/* Frame (79 bytes) */ +static const unsigned char pkt1[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x41, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .A..@... */ +0x90, 0xaf, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xf0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .X...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x5f, 0x30, 0x05, 0x6c, 0x6f, 0x63, /* st_0.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01 /* al..... */ +}; + +/* Frame (89 bytes) */ +static const unsigned char pkt2[89] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x4b, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .K..@... */ +0x90, 0x5d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .]...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x37, /* .......7 */ +0xad, 0x78, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x5f, 0x30, 0x05, 0x6c, 0x6f, 0x63, /* st_0.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42 /* B */ +}; + diff --git a/test/regression/mdns_test/capture/continuous_query_a.pcapng b/test/regression/mdns_test/capture/continuous_query_a.pcapng new file mode 100644 index 00000000..67deab8e Binary files /dev/null and b/test/regression/mdns_test/capture/continuous_query_a.pcapng differ diff --git a/test/regression/mdns_test/capture/continuous_query_unique_answer.c b/test/regression/mdns_test/capture/continuous_query_unique_answer.c new file mode 100644 index 00000000..2e20a36b --- /dev/null +++ b/test/regression/mdns_test/capture/continuous_query_unique_answer.c @@ -0,0 +1,53 @@ +/* Frame (85 bytes) */ +static const unsigned char pkt1[85] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x47, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .G..@... */ +0x90, 0x61, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .a...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x33, /* .......3 */ +0xd8, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01 /* ..... */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0xff, 0x17, 0x8d, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x01, 0x51, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .Q...l.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x67, 0xea, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* g....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, /* x....... */ +0xbd, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ +0x2d, 0x50, 0x43, 0xc0, 0x20, 0xc0, 0x0c, 0x00, /* -PC. ... */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x23, 0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, /* #.netbio */ +0x73, 0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, /* s=CHENBO */ +0x2d, 0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, /* -PC.doma */ +0x69, 0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, /* in=WORKG */ +0x52, 0x4f, 0x55, 0x50, 0xc0, 0x37, 0x00, 0x01, /* ROUP.7.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6c, 0xc0, 0x37, 0x00, 0x1c, /* ...l.7.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, /* .......1 */ +0xc0, 0x37, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* .7...... */ +0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, /* .....YDy */ +0xe1, 0x0a, 0xd7, 0xf4, 0xc0, 0x37, 0x00, 0x2f, /* .....7./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x37, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, /* .7..@... */ +0xc0, 0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .../.... */ +0x00, 0x78, 0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, /* .x...... */ +0x00, 0x00, 0x80, 0x00, 0x40 /* ....@ */ +}; + diff --git a/test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng b/test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng new file mode 100644 index 00000000..eee3768c Binary files /dev/null and b/test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng differ diff --git a/test/regression/mdns_test/capture/dns_sd_query.c b/test/regression/mdns_test/capture/dns_sd_query.c new file mode 100644 index 00000000..f42cc196 --- /dev/null +++ b/test/regression/mdns_test/capture/dns_sd_query.c @@ -0,0 +1,351 @@ +/* Frame (88 bytes) */ +static const unsigned char pkt1[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x4a, 0x58, 0x5c, 0x00, 0x00, 0xff, 0x11, /* .JX\.... */ +0xc1, 0x3e, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .>...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xa2, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt2[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4a, 0x02, 0xe1, 0x00, 0x00, 0xff, 0x11, /* .J...... */ +0xcd, 0xc4, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xb4, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt3[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0x5c, 0x1e, 0xf3, 0x00, 0x00, 0xff, 0x11, /* .\...... */ +0xfa, 0x92, 0xc0, 0xa8, 0x00, 0x67, 0xe0, 0x00, /* .....g.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x0a, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (114 bytes) */ +static const unsigned char pkt4[114] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ +0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ +0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (160 bytes) */ +static const unsigned char pkt5[160] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x92, 0x17, 0x39, 0x00, 0x00, 0xff, 0x11, /* ...9.... */ +0x02, 0x7a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .z...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ +0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ +0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ +}; + +/* Frame (219 bytes) */ +static const unsigned char pkt6[219] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0xcd, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x23, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .#...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb9, /* ........ */ +0x69, 0x6d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* im...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .#...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x65, 0xc0, 0x41, 0xc0, /* teste.A. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x64, 0xc0, 0x41, 0xc0, 0x0c, 0x00, 0x0c, /* td.A.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, /* ._testc. */ +0x41, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* A....... */ +0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x62, 0xc0, 0x41, 0xc0, 0x0c, /* estb.A.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x61, 0xc0, 0x41 /* a.A */ +}; + +/* Frame (212 bytes) */ +static const unsigned char pkt7[212] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0xc6, 0x58, 0x8e, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ +0xc0, 0x90, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ +0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x93, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ +0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x0f, /* ........ */ +0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ +0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ +0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ +0x00, 0x11, 0x94, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ +0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0xc0, 0x3f /* tp.? */ +}; + +/* Frame (225 bytes) */ +static const unsigned char pkt8[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xd3, 0x02, 0xe2, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xcd, 0x3a, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .:...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x1b, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .:...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ +0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ +0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ +0x47 /* G */ +}; + +/* Frame (212 bytes) */ +static const unsigned char pkt9[212] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0xc6, 0x58, 0xcf, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ +0xc0, 0x4f, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .O...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ +0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x90, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ +0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x12, 0x0f, /* ........ */ +0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ +0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ +0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ +0x00, 0x11, 0x91, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ +0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0xc0, 0x3f /* tp.? */ +}; + +/* Frame (225 bytes) */ +static const unsigned char pkt10[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xd3, 0x02, 0xe3, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xcd, 0x39, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .9...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x21, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* !F...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ +0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ +0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ +0x47 /* G */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt11[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x59, 0x32, 0x00, 0x00, 0xff, 0x11, /* .ZY2.... */ +0xbf, 0x58, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .X...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0xa3, 0x5f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ._...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x64, 0x03, 0x31, 0x30, 0x30, /* ...d.100 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (136 bytes) */ +static const unsigned char pkt12[136] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7a, 0x02, 0xe4, 0x00, 0x00, 0xff, 0x11, /* .z...... */ +0xcd, 0x91, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x66, /* .......f */ +0x82, 0x29, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .)...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x02, 0x01, 0x32, 0x01, 0x30, /* .....2.0 */ +0x01, 0x30, 0x02, 0x31, 0x30, 0x07, 0x69, 0x6e, /* .0.10.in */ +0x2d, 0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, /* -addr.ar */ +0x70, 0x61, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* pa...... */ +0x00, 0x00, 0x78, 0x00, 0x02, 0xc0, 0x0c, 0xc0, /* ..x..... */ +0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x05, 0xc0, 0x0c, 0x00, 0x01, 0x40 /* x......@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt13[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x59, 0xc5, 0x00, 0x00, 0xff, 0x11, /* .EY..... */ +0xbf, 0xda, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt14[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x02, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0xcd, 0xc5, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0x95, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .L...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + diff --git a/test/regression/mdns_test/capture/dns_sd_query.pcapng b/test/regression/mdns_test/capture/dns_sd_query.pcapng new file mode 100644 index 00000000..1b1d5f04 Binary files /dev/null and b/test/regression/mdns_test/capture/dns_sd_query.pcapng differ diff --git a/test/regression/mdns_test/capture/duplicate_question_suppression.c b/test/regression/mdns_test/capture/duplicate_question_suppression.c new file mode 100644 index 00000000..9d020109 --- /dev/null +++ b/test/regression/mdns_test/capture/duplicate_question_suppression.c @@ -0,0 +1,182 @@ + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt2[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt3[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc0, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt4[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xbf, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt5[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0xe6, 0x7f, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x33, 0x3a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* 3:...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt6[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + + +/* Frame (135 bytes) */ +static const unsigned char pkt7[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + + +/* Frame (135 bytes) */ +static const unsigned char pkt8[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + + +/* Frame (76 bytes) */ +static const unsigned char pkt9[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + + +/* Frame (135 bytes) */ +static const unsigned char pkt10[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x81, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1,...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x78, 0x00, 0x1f, /* .....x.. */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; \ No newline at end of file diff --git a/test/regression/mdns_test/capture/error_response.pcapng b/test/regression/mdns_test/capture/error_response.pcapng new file mode 100644 index 00000000..74c0e330 Binary files /dev/null and b/test/regression/mdns_test/capture/error_response.pcapng differ diff --git a/test/regression/mdns_test/capture/ipv6_query.c b/test/regression/mdns_test/capture/ipv6_query.c new file mode 100644 index 00000000..6f9a8d10 --- /dev/null +++ b/test/regression/mdns_test/capture/ipv6_query.c @@ -0,0 +1,68 @@ +/* Frame (96 bytes) */ +static const unsigned char pkt1[96] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0xfe, 0x80, /* ...*.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x2a, 0x68, 0xc4, 0x00, 0x00, /* ...*h... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (185 bytes) */ +static const unsigned char pkt2[185] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* 33...... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x86, 0xdd, 0x60, 0x00, /* ..z...`. */ +0x00, 0x00, 0x00, 0x83, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1e, /* ........ */ +0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, 0xff, 0x02, /* ....z... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x83, 0x30, 0x75, 0x00, 0x00, /* ....0u.. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, /* .......C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, /* 00w...ro */ +0x75, 0x74, 0x65, 0x72, 0xc0, 0x17, 0x00, 0x1c, /* uter.... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x1e, 0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, /* ......z. */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (155 bytes) */ +static const unsigned char pkt3[155] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x65, 0x11, 0xff, 0xfe, 0x80, /* ...e.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x65, 0x6c, 0xde, 0x00, 0x00, /* ...el... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x1f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* w._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + diff --git a/test/regression/mdns_test/capture/ipv6_query.pcapng b/test/regression/mdns_test/capture/ipv6_query.pcapng new file mode 100644 index 00000000..b2be51f4 Binary files /dev/null and b/test/regression/mdns_test/capture/ipv6_query.pcapng differ diff --git a/test/regression/mdns_test/capture/known_answer_suppression.c b/test/regression/mdns_test/capture/known_answer_suppression.c new file mode 100644 index 00000000..86a664f4 --- /dev/null +++ b/test/regression/mdns_test/capture/known_answer_suppression.c @@ -0,0 +1,101 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x87, 0x82, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x92, 0x37, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .7...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt4[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x92, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt5[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + diff --git a/test/regression/mdns_test/capture/known_answer_suppression.pcapng b/test/regression/mdns_test/capture/known_answer_suppression.pcapng new file mode 100644 index 00000000..d84451bd Binary files /dev/null and b/test/regression/mdns_test/capture/known_answer_suppression.pcapng differ diff --git a/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c b/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c new file mode 100644 index 00000000..064ff449 --- /dev/null +++ b/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c @@ -0,0 +1,172 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt2[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt3[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt4[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt5[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt6[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt7[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt8[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + diff --git a/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng b/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng new file mode 100644 index 00000000..c77212ef Binary files /dev/null and b/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng differ diff --git a/test/regression/mdns_test/capture/known_answer_suppression_response.c b/test/regression/mdns_test/capture/known_answer_suppression_response.c new file mode 100644 index 00000000..4c22c6f6 --- /dev/null +++ b/test/regression/mdns_test/capture/known_answer_suppression_response.c @@ -0,0 +1,82 @@ +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x01, 0x81, 0x00, 0x00, 0xff, 0x11, /* .=...... */ +0x11, 0x81, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (373 bytes) */ +static const unsigned char pkt2[373] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x67, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .g..@... */ +0x8f, 0x40, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .@...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x53, /* .......S */ +0xf4, 0x39, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .9...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x24, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* $.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40 /* ....@ */ +}; + +/* Frame (101 bytes) */ +static const unsigned char pkt3[101] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x57, 0x01, 0x82, 0x00, 0x00, 0xff, 0x11, /* .W...... */ +0x11, 0x66, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .f...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ +0x10, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ +}; + diff --git a/test/regression/mdns_test/capture/known_answer_suppression_response.pcapng b/test/regression/mdns_test/capture/known_answer_suppression_response.pcapng new file mode 100644 index 00000000..e5ec8872 Binary files /dev/null and b/test/regression/mdns_test/capture/known_answer_suppression_response.pcapng differ diff --git a/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c b/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c new file mode 100644 index 00000000..4439693a --- /dev/null +++ b/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c @@ -0,0 +1,26 @@ +/* Frame (171 bytes) */ +static const unsigned char pkt1[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x9d, 0x1e, 0x02, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xf4, 0x9f, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ +0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ +0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + diff --git a/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng b/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng new file mode 100644 index 00000000..12f971b9 Binary files /dev/null and b/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng differ diff --git a/test/regression/mdns_test/capture/multiple_questions_per_query.c b/test/regression/mdns_test/capture/multiple_questions_per_query.c new file mode 100644 index 00000000..076ea0e1 --- /dev/null +++ b/test/regression/mdns_test/capture/multiple_questions_per_query.c @@ -0,0 +1,68 @@ +/* Frame (103 bytes) */ +static const unsigned char pkt1[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ +0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ +}; + +/* Frame (103 bytes) */ +static const unsigned char pkt2[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ +0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ +}; + +/* Frame (103 bytes) */ +static const unsigned char pkt3[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ +0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ +}; + +/* Frame (103 bytes) */ +static const unsigned char pkt4[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ +0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ +}; + diff --git a/test/regression/mdns_test/capture/multiple_questions_per_query.pcapng b/test/regression/mdns_test/capture/multiple_questions_per_query.pcapng new file mode 100644 index 00000000..e19858a4 Binary files /dev/null and b/test/regression/mdns_test/capture/multiple_questions_per_query.pcapng differ diff --git a/test/regression/mdns_test/capture/one_shot_query.c b/test/regression/mdns_test/capture/one_shot_query.c new file mode 100644 index 00000000..81ca06ab --- /dev/null +++ b/test/regression/mdns_test/capture/one_shot_query.c @@ -0,0 +1,86 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt2[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0xf0, 0xbc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt3[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2d, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* -....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, /* .....d.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt4[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2d, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* -....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, /* .....d.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + diff --git a/test/regression/mdns_test/capture/one_shot_query.pcapng b/test/regression/mdns_test/capture/one_shot_query.pcapng new file mode 100644 index 00000000..e2b6395c Binary files /dev/null and b/test/regression/mdns_test/capture/one_shot_query.pcapng differ diff --git a/test/regression/mdns_test/capture/probing_conflict.c b/test/regression/mdns_test/capture/probing_conflict.c new file mode 100644 index 00000000..95e3f484 --- /dev/null +++ b/test/regression/mdns_test/capture/probing_conflict.c @@ -0,0 +1,280 @@ +/* Frame (225 bytes) */ +static const unsigned char pkt1[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xd3, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd5, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x13, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .w...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x0f, 0x53, 0x69, 0x6d, /* .....Sim */ +0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x53, 0x65, /* pleWebSe */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0f, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x14, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31 /* 1 */ +}; + +/* Frame (235 bytes) */ +static const unsigned char pkt2[235] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbc, 0x39, 0x02, 0x08, 0x00, 0x45, 0x00, /* /.9...E. */ +0x00, 0xdd, 0x05, 0x71, 0x00, 0x00, 0xff, 0x11, /* ...q.... */ +0xca, 0xa2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc9, /* ........ */ +0x3d, 0x40, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* =@...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x0f, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ +0x50, 0x43, 0xc0, 0x27, 0xc0, 0x0c, 0x00, 0x10, /* PC.'.... */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, /* ........ */ +0x09, 0x5b, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* .[paper= */ +0x41, 0x34, 0x0b, 0x56, 0x65, 0x72, 0x73, 0x69, /* A4.Versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x5d, 0xc0, 0x3e, /* on=01].> */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x01, 0xc0, 0x3e, /* .......> */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x93, 0x9d, 0xaa, 0xda, 0xe3, /* ........ */ +0xea, 0xba, 0xc0, 0x3e, 0x00, 0x2f, 0x80, 0x01, /* ...>./.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0xc0, 0x3e, /* ...x...> */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0xc0, 0x0c, /* ..@..... */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt3[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xdf, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc8, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ +0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ +0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt4[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xdf, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ +0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ +0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt5[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xdf, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ +0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ +0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (261 bytes) */ +static const unsigned char pkt6[261] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xf7, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ +0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +/* Frame (261 bytes) */ +static const unsigned char pkt7[261] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xf7, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xac, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ +0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +/* Frame (261 bytes) */ +static const unsigned char pkt8[261] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xf7, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xab, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ +0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + diff --git a/test/regression/mdns_test/capture/probing_conflict.pcapng b/test/regression/mdns_test/capture/probing_conflict.pcapng new file mode 100644 index 00000000..38fb0f1b Binary files /dev/null and b/test/regression/mdns_test/capture/probing_conflict.pcapng differ diff --git a/test/regression/mdns_test/capture/probing_conflict_any_type.c b/test/regression/mdns_test/capture/probing_conflict_any_type.c new file mode 100644 index 00000000..27928f8a --- /dev/null +++ b/test/regression/mdns_test/capture/probing_conflict_any_type.c @@ -0,0 +1,139 @@ +/* Frame (132 bytes) */ +static const unsigned char pkt1[132] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x76, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* .v..@... */ +0x90, 0x38, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .8...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x62, /* .......b */ +0xce, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42 /* ...B */ +}; + +/* Frame (166 bytes) */ +static const unsigned char pkt2[166] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x98, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x58, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .X...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x84, /* ........ */ +0x43, 0x43, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* CC...... */ +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, /* ...x.... */ +0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, 0x75, /* ...P.ubu */ +0x6e, 0x74, 0x75, 0xc0, 0x23, 0xc0, 0x3a, 0x00, /* ntu.#.:. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, /* ...).... */ +0x8d, 0xc0, 0x3a, 0x00, 0x01, 0x80, 0x01, 0x00, /* ..:..... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x01, 0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (132 bytes) */ +static const unsigned char pkt3[132] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x76, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .v..@... */ +0x90, 0x37, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .7...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x62, /* .......b */ +0xce, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42 /* ...B */ +}; + +/* Frame (132 bytes) */ +static const unsigned char pkt4[132] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x76, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .v..@... */ +0x90, 0x36, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .6...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x62, /* .......b */ +0xce, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42 /* ...B */ +}; + +/* Frame (98 bytes) */ +static const unsigned char pkt5[98] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x54, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .T..@... */ +0x90, 0x57, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .W...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x40, /* .......@ */ +0x13, 0xc0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ +0x00, 0x42 /* .B */ +}; + +/* Frame (98 bytes) */ +static const unsigned char pkt6[98] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x54, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .T..@... */ +0x90, 0x56, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .V...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x40, /* .......@ */ +0x13, 0xc0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ +0x00, 0x42 /* .B */ +}; + +/* Frame (98 bytes) */ +static const unsigned char pkt7[98] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x54, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .T..@... */ +0x90, 0x55, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .U...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x40, /* .......@ */ +0x13, 0xc0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ +0x00, 0x42 /* .B */ +}; + diff --git a/test/regression/mdns_test/capture/probing_conflict_any_type.pcapng b/test/regression/mdns_test/capture/probing_conflict_any_type.pcapng new file mode 100644 index 00000000..5ae65956 Binary files /dev/null and b/test/regression/mdns_test/capture/probing_conflict_any_type.pcapng differ diff --git a/test/regression/mdns_test/capture/query_and_response_chaos.c b/test/regression/mdns_test/capture/query_and_response_chaos.c new file mode 100644 index 00000000..6fe446b2 --- /dev/null +++ b/test/regression/mdns_test/capture/query_and_response_chaos.c @@ -0,0 +1,2034 @@ +/* Frame (83 bytes) */ +static const unsigned char pkt1[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x44, 0x8b, 0x00, 0x00, 0xff, 0x11, /* .ED..... */ +0xd5, 0x0e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt2[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x11, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xe9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt3[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x90, 0x44, 0x8c, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ +0xd4, 0xc2, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0xa7, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x80, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x80, 0x01, /* ........ */ +0xc0, 0x0c, 0x00, 0xff, 0x80, 0x01, 0xc0, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt4[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x0a, 0x12, 0x00, 0x00, 0xff, 0x11, /* .L...... */ +0x08, 0xe1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x9b, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .p...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x80, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt5[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x90, 0x44, 0x8d, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ +0xd4, 0xc1, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0x27, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* '0...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, /* ........ */ +0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt6[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x0a, 0x13, 0x00, 0x00, 0xff, 0x11, /* .L...... */ +0x08, 0xe0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt7[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x90, 0x44, 0x91, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ +0xd4, 0xbd, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0x27, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* '0...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, /* ........ */ +0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt8[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x0a, 0x14, 0x00, 0x00, 0xff, 0x11, /* .L...... */ +0x08, 0xdf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt9[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x44, 0x93, 0x00, 0x00, 0xff, 0x11, /* .ZD..... */ +0xd3, 0xf1, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt10[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x15, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xac, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt11[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x44, 0x95, 0x00, 0x00, 0xff, 0x11, /* .ED..... */ +0xd5, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt12[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x16, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xe4, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt13[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x44, 0xab, 0x00, 0x00, 0xff, 0x11, /* .ZD..... */ +0xd3, 0xd9, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt14[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x17, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xaa, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt15[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x45, 0x28, 0x00, 0x00, 0xff, 0x11, /* .ZE(.... */ +0xd3, 0x5c, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .\...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt16[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x18, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xa9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt17[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x45, 0x29, 0x00, 0x00, 0xff, 0x11, /* .EE).... */ +0xd4, 0x70, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .p...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt18[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x19, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xe1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt19[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x45, 0x51, 0x00, 0x00, 0xff, 0x11, /* .ZEQ.... */ +0xd3, 0x33, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .3...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt20[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x1a, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xa7, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt21[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x45, 0x75, 0x00, 0x00, 0xff, 0x11, /* .EEu.... */ +0xd4, 0x24, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .$...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt22[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x1b, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xdf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt23[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x4a, 0x45, 0x7a, 0x00, 0x00, 0xff, 0x11, /* .JEz.... */ +0xd4, 0x1a, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xfd, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt24[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4a, 0x0a, 0x1c, 0x00, 0x00, 0xff, 0x11, /* .J...... */ +0x08, 0xd9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xf6, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt25[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0x5c, 0x78, 0x77, 0x00, 0x00, 0xff, 0x11, /* .\xw.... */ +0xa1, 0x09, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .....l.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x0a, 0xe9, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (114 bytes) */ +static const unsigned char pkt26[114] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ +0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ +0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (113 bytes) */ +static const unsigned char pkt27[113] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x63, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .c..@... */ +0xd9, 0xd1, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4f, /* .......O */ +0x64, 0xfc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* d....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x13, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, /* sh._tcp. */ +0x23 /* # */ +}; + +/* Frame (126 bytes) */ +static const unsigned char pkt28[126] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x70, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .p..@... */ +0xd9, 0xc3, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5c, /* .......\ */ +0x3e, 0x43, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* >C...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* p.#..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ +0x5f, 0x72, 0x66, 0x62, 0xc0, 0x3a /* _rfb.: */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt29[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x50, 0x45, 0x7e, 0x00, 0x00, 0xff, 0x11, /* .PE~.... */ +0xd4, 0x10, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x60, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* `....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0c, 0x5f, 0x77, 0x6f, 0x72, /* ...._wor */ +0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* kstation */ +0xc0, 0x11, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt30[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x50, 0x0a, 0x1d, 0x00, 0x00, 0xff, 0x11, /* .P...... */ +0x08, 0xd2, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x5a, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ZA...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0c, 0x5f, 0x77, 0x6f, 0x72, /* ...._wor */ +0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* kstation */ +0xc0, 0x11, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (332 bytes) */ +static const unsigned char pkt31[332] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x01, 0x3e, 0x78, 0x7d, 0x00, 0x00, 0xff, 0x11, /* .>x}.... */ +0xa0, 0x21, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .!...l.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */ +0x4f, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* O....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ +0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */ +0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */ +0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */ +0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */ +0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */ +0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ +0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */ +0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */ +0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */ +0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */ +0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */ +0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x6c, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..l.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x.. */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */ +0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */ +0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */ +0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */ +0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */ +0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */ +0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */ +0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */ +0x40, 0x00, 0x00, 0x08 /* @... */ +}; + +/* Frame (242 bytes) */ +static const unsigned char pkt32[242] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0xe4, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x62, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* .b...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xd0, /* ........ */ +0xa0, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, /* 1.server */ +0x2d, 0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, /* -HP-Z210 */ +0x2d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, /* -Worksta */ +0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, /* tion [e8 */ +0x3a, 0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, /* :39:35:4 */ +0x34, 0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, /* 4:fe:d4] */ +0xc0, 0x0c, 0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, /* .../.... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, /* ........ */ +0x2f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* /.!..... */ +0x78, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, /* x.#..... */ +0x09, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, /* ..server */ +0x2d, 0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, /* -HP-Z210 */ +0x2d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, /* -Worksta */ +0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x1e, 0xc0, 0x7f, /* tion.... */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xea, 0x39, 0x35, 0xff, 0xfe, 0x44, /* ...95..D */ +0xfe, 0xd4, 0xc0, 0x7f, 0x00, 0x01, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x02 /* .. */ +}; + +/* Frame (228 bytes) */ +static const unsigned char pkt33[228] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xd6, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x5e, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* .^...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc2, /* ........ */ +0x8a, 0x5a, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .Z...... */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x2a, 0x27, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* *'catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, 0x61, /* -3010 [a */ +0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, /* 4:1f:72: */ +0x35, 0x33, 0x3a, 0x39, 0x62, 0x3a, 0x63, 0x36, /* 53:9b:c6 */ +0x5d, 0xc0, 0x0c, 0xc0, 0x2f, 0x00, 0x10, 0x80, /* ].../... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x2f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* ./.!.... */ +0x00, 0x78, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x09, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x1e, /* x-3010.. */ +0xc0, 0x78, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* .x...... */ +0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ +0x00, 0x00, 0x00, 0x00, 0xa6, 0x1f, 0x72, 0xff, /* ......r. */ +0xfe, 0x53, 0x9b, 0xc6, 0xc0, 0x78, 0x00, 0x01, /* .S...x.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x14 /* .... */ +}; + +/* Frame (206 bytes) */ +static const unsigned char pkt34[206] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xc0, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x75, 0xc0, 0xa8, 0x00, 0x13, 0xe0, 0x00, /* .u...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xac, /* ........ */ +0x17, 0x94, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, /* EL [a4:1 */ +0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, /* f:72:53: */ +0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, 0x0c, /* a0:f7].. */ +0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ./...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, /* ....../. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x08, /* ........ */ +0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x45, 0x4c, /* catro-EL */ +0xc0, 0x1e, 0xc0, 0x6d, 0x00, 0x1c, 0x80, 0x01, /* ...m.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, 0x01, /* ...x.. . */ +0x0d, 0xa8, 0x80, 0x08, 0x01, 0x27, 0x02, 0x0c, /* .....'.. */ +0x29, 0xff, 0xfe, 0xe5, 0x16, 0x93, 0xc0, 0x6d, /* )......m */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x13 /* ...... */ +}; + +/* Frame (160 bytes) */ +static const unsigned char pkt35[160] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x92, 0x67, 0xcc, 0x00, 0x00, 0xff, 0x11, /* ..g..... */ +0xb1, 0xe6, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ +0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ +0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ +}; + +/* Frame (222 bytes) */ +static const unsigned char pkt36[222] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xd0, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x63, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* .c...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbc, /* ........ */ +0x27, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* '....... */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x27, 0x24, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* '$dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, /* 10 [a4:1 */ +0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, /* f:72:53: */ +0x39, 0x32, 0x3a, 0x61, 0x36, 0x5d, 0xc0, 0x0c, /* 92:a6].. */ +0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ./...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, /* ....../. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x10, /* ........ */ +0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* dc-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0xc0, 0x1e, 0xc0, 0x75, 0x00, 0x1c, 0x80, 0x01, /* ...u.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1f, /* ........ */ +0x72, 0xff, 0xfe, 0x53, 0x92, 0xa6, 0xc0, 0x75, /* r..S...u */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x15 /* ...... */ +}; + +/* Frame (202 bytes) */ +static const unsigned char pkt37[202] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x6a, 0x2e, 0x7a, 0x08, 0x00, 0x45, 0x00, /* )j.z..E. */ +0x00, 0xbc, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x11, 0xc0, 0xa8, 0x00, 0x7b, 0xe0, 0x00, /* .....{.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xa8, /* ........ */ +0x1d, 0xc5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ +0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ +0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ +0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x2f, /* :7a].../ */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, 0x21, 0x80, /* ..../.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x09, 0x06, 0x75, 0x62, /* ......ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x1e, 0xc0, 0x6b, /* untu...k */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x6a, /* ....)..j */ +0x2e, 0x7a, 0xc0, 0x6b, 0x00, 0x01, 0x80, 0x01, /* .z.k.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x7b /* .{ */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt38[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x50, 0x45, 0x81, 0x00, 0x00, 0xff, 0x11, /* .PE..... */ +0xd4, 0x0d, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x75, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* u....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x18, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt39[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x50, 0x0a, 0x1e, 0x00, 0x00, 0xff, 0x11, /* .P...... */ +0x08, 0xd1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x6f, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* o^...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x18, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (163 bytes) */ +static const unsigned char pkt40[163] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x95, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x9f, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x81, /* ........ */ +0xd2, 0x1f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, /* ........ */ +0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, /* .catro-O */ +0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, /* ptiPlex- */ +0x33, 0x30, 0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x2e, /* 3010.... */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc0, 0x2e, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1c, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x16, 0x13, 0x63, 0x61, /* ......ca */ +0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x1d /* 0.. */ +}; + +/* Frame (141 bytes) */ +static const unsigned char pkt41[141] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x7f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0xb6, 0xc0, 0xa8, 0x00, 0x13, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6b, /* .......k */ +0x96, 0xe5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ +0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x45, /* .catro-E */ +0x4c, 0xc0, 0x0c, 0xc0, 0x2e, 0x00, 0x10, 0x80, /* L....... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x2e, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* ...!.... */ +0x00, 0x78, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x16, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0xc0, 0x1d /* -EL.. */ +}; + +/* Frame (250 bytes) */ +static const unsigned char pkt42[250] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xec, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x47, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* .G...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xd8, /* ........ */ +0x88, 0xc6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, /* 10...(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..(.!... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x16, 0xa8, 0x10, 0x64, 0x63, 0x2d, 0x4f, /* ....dc-O */ +0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, /* ptiPlex- */ +0x33, 0x30, 0x31, 0x30, 0xc0, 0x17, 0x0b, 0x5f, /* 3010..._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0xc0, 0x12, 0x00, 0x0c, 0x00, 0x01, /* sh...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x13, 0x10, 0x64, /* .......d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ +0x84, 0xc0, 0x9c, 0x00, 0x10, 0x80, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x9c, /* ........ */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, /* ........ */ +0xc0, 0x71 /* .q */ +}; + +/* Frame (97 bytes) */ +static const unsigned char pkt43[97] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x53, 0x45, 0x84, 0x00, 0x00, 0xff, 0x11, /* .SE..... */ +0xd4, 0x07, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3f, /* .......? */ +0x9a, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, 0x6c, /* ...._pdl */ +0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, /* -datastr */ +0x65, 0x61, 0x6d, 0xc0, 0x11, 0x00, 0x0c, 0x00, /* eam..... */ +0x01 /* . */ +}; + +/* Frame (97 bytes) */ +static const unsigned char pkt44[97] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x53, 0x0a, 0x1f, 0x00, 0x00, 0xff, 0x11, /* .S...... */ +0x08, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3f, /* .......? */ +0x94, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .7...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, 0x6c, /* ...._pdl */ +0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, /* -datastr */ +0x65, 0x61, 0x6d, 0xc0, 0x11, 0x00, 0x0c, 0x00, /* eam..... */ +0x01 /* . */ +}; + +/* Frame (173 bytes) */ +static const unsigned char pkt45[173] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x9f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x94, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x8b, /* ........ */ +0x10, 0xea, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x0c, 0xc0, 0x27, 0x00, 0x10, 0x80, /* 0...'... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x27, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .'.!.... */ +0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x17, 0x0c, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x16 /* 010.. */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt46[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x41, 0x45, 0x8a, 0x00, 0x00, 0xff, 0x11, /* .AE..... */ +0xd4, 0x13, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xc4, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt47[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x41, 0x0a, 0x20, 0x00, 0x00, 0xff, 0x11, /* .A. .... */ +0x08, 0xde, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (562 bytes) */ +static const unsigned char pkt48[562] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x02, 0x24, 0x67, 0xcd, 0x00, 0x00, 0xff, 0x11, /* .$g..... */ +0xb0, 0x53, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .S...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x10, /* ........ */ +0x25, 0xc3, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* %....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0xc0, 0x0c, 0x05, 0x5f, 0x68, 0x74, 0x74, /* w..._htt */ +0x70, 0xc0, 0x1c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p....... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x41, 0x06, 0x72, 0x6f, 0x75, /* 0w.A.rou */ +0x74, 0x65, 0x72, 0xc0, 0x21, 0x00, 0x01, 0x80, /* ter.!... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x04, 0xc0, 0x32, 0x00, 0x21, 0x80, /* ....2.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x23, 0x8c, 0xc0, 0x62, 0xc0, /* ...#..b. */ +0x32, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* 2....... */ +0x94, 0x01, 0x4e, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..N.txtv */ +0x65, 0x72, 0x73, 0x3d, 0x31, 0x05, 0x6e, 0x6f, /* ers=1.no */ +0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ +0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ +0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x31, 0x30, /* ority=10 */ +0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ +0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ +0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ +0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ +0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ +0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ +0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ +0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ +0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ +0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ +0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ +0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ +0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ +0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ +0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ +0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ +0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ +0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ +0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ +0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ +0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ +0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ +0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ +0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ +0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ +0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ +0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ +0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ +0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ +0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ +0x34, 0xc0, 0x53, 0x00, 0x21, 0x80, 0x01, 0x00, /* 4.S.!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x62, 0xc0, 0x53, 0x00, /* ..P.b.S. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x01, 0x00 /* .. */ +}; + +/* Frame (468 bytes) */ +static const unsigned char pkt49[468] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0xc6, 0x45, 0x95, 0x00, 0x00, 0xff, 0x11, /* ..E..... */ +0xd2, 0x83, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xb2, /* ........ */ +0x11, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0b, 0x5f, 0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, /* ._udisks */ +0x2d, 0x73, 0x73, 0x68, 0xc0, 0x33, 0x00, 0x0c, /* -ssh.3.. */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x33, 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, /* .3...... */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x02, 0xc0, 0x2e, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0xc0, /* ation.3. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x50, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..P..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ +0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, 0xc0, 0x0c, /* _rfb.3.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x12, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, /* ..._pdl- */ +0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, /* datastre */ +0x61, 0x6d, 0xc0, 0x33, 0xc0, 0x0c, 0x00, 0x0c, /* am.3.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ +0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, /* ._printe */ +0x72, 0xc0, 0x33, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* r.3..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, 0x13, /* ........ */ +0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, /* catro-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, /* 010.>.>. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x45, 0x4c, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* EL.>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x13, /* ........ */ +0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* .dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x3e, 0xc0, 0x50, 0x00, 0x0c, 0x00, /* 0.>.P... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, /* ......*' */ +0x64, 0x63, 0x27, 0x73, 0x20, 0x72, 0x65, 0x6d, /* dc's rem */ +0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x6b, /* ote desk */ +0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x64, /* top on d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ +0x50, 0xc0, 0x50, 0x00, 0x0c, 0x00, 0x01, 0x00, /* P.P..... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x50 /* 0w.P */ +}; + +/* Frame (468 bytes) */ +static const unsigned char pkt50[468] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x01, 0xc6, 0x0a, 0x21, 0x00, 0x00, 0xff, 0x11, /* ...!.... */ +0x07, 0x58, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .X...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xb2, /* ........ */ +0x0b, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* .9...... */ +0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0b, 0x5f, 0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, /* ._udisks */ +0x2d, 0x73, 0x73, 0x68, 0xc0, 0x33, 0x00, 0x0c, /* -ssh.3.. */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x33, 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, /* .3...... */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x02, 0xc0, 0x2e, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0xc0, /* ation.3. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x50, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..P..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ +0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, 0xc0, 0x0c, /* _rfb.3.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x12, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, /* ..._pdl- */ +0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, /* datastre */ +0x61, 0x6d, 0xc0, 0x33, 0xc0, 0x0c, 0x00, 0x0c, /* am.3.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ +0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, /* ._printe */ +0x72, 0xc0, 0x33, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* r.3..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, 0x13, /* ........ */ +0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, /* catro-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, /* 010.>.>. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x45, 0x4c, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* EL.>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x13, /* ........ */ +0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* .dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x3e, 0xc0, 0x50, 0x00, 0x0c, 0x00, /* 0.>.P... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, /* ......*' */ +0x64, 0x63, 0x27, 0x73, 0x20, 0x72, 0x65, 0x6d, /* dc's rem */ +0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x6b, /* ote desk */ +0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x64, /* top on d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ +0x50, 0xc0, 0x50, 0x00, 0x0c, 0x00, 0x01, 0x00, /* P.P..... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x50 /* 0w.P */ +}; + +/* Frame (447 bytes) */ +static const unsigned char pkt51[447] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0xb1, 0x45, 0x9f, 0x00, 0x00, 0xff, 0x11, /* ..E..... */ +0xd2, 0x8e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x9d, /* ........ */ +0x79, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* yH...... */ +0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, /* ...._rfb */ +0xc0, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, 0x19, /* stream.. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, /* .......1 */ +0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, /* .server- */ +0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, /* HP-Z210- */ +0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* Workstat */ +0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, /* ion [e8: */ +0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, /* 39:35:44 */ +0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, /* :fe:d4]. */ +0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, 0x63, 0x61, /* ....*'ca */ +0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, /* 0 [a4:1f */ +0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, /* :72:53:9 */ +0x62, 0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, /* b:c6]... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, /* o-EL [a4 */ +0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, /* :1f:72:5 */ +0x33, 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, /* 3:a0:f7] */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x27, 0x24, 0x64, /* .....'$d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, /* ex-3010 */ +0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, /* [a4:1f:7 */ +0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, /* 2:53:92: */ +0x61, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, /* a6]..... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ +0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ +0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ +0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x29, /* :7a]...) */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x29, 0xc0, 0x34, 0x00, 0x0c, /* 10.).4.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x34 /* 4500w.4 */ +}; + +/* Frame (447 bytes) */ +static const unsigned char pkt52[447] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x01, 0xb1, 0x0a, 0x22, 0x00, 0x00, 0xff, 0x11, /* ...".... */ +0x07, 0x6c, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .l...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x9d, /* ........ */ +0x72, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* r....... */ +0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, /* ...._rfb */ +0xc0, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, 0x19, /* stream.. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, /* .......1 */ +0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, /* .server- */ +0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, /* HP-Z210- */ +0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* Workstat */ +0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, /* ion [e8: */ +0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, /* 39:35:44 */ +0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, /* :fe:d4]. */ +0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, 0x63, 0x61, /* ....*'ca */ +0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, /* 0 [a4:1f */ +0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, /* :72:53:9 */ +0x62, 0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, /* b:c6]... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, /* o-EL [a4 */ +0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, /* :1f:72:5 */ +0x33, 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, /* 3:a0:f7] */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x27, 0x24, 0x64, /* .....'$d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, /* ex-3010 */ +0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, /* [a4:1f:7 */ +0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, /* 2:53:92: */ +0x61, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, /* a6]..... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ +0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ +0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ +0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x29, /* :7a]...) */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x29, 0xc0, 0x34, 0x00, 0x0c, /* 10.).4.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x34 /* 4500w.4 */ +}; + +/* Frame (497 bytes) */ +static const unsigned char pkt53[497] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x01, 0xe3, 0x67, 0xce, 0x00, 0x00, 0xff, 0x11, /* ..g..... */ +0xb0, 0x93, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xcf, /* ........ */ +0x46, 0x4d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FM...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, /* 0w...rou */ +0x74, 0x65, 0x72, 0xc0, 0x1a, 0x00, 0x01, 0x80, /* ter..... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x04, 0xc0, 0x2b, 0x00, 0x21, 0x80, /* ....+.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x02, 0x03, 0xc0, 0x3a, 0xc0, /* ......:. */ +0x2b, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* +....... */ +0x94, 0x01, 0x56, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..V.txtv */ +0x65, 0x72, 0x73, 0x3d, 0x31, 0x07, 0x72, 0x70, /* ers=1.rp */ +0x3d, 0x61, 0x75, 0x74, 0x6f, 0x05, 0x6e, 0x6f, /* =auto.no */ +0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ +0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ +0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x32, 0x30, /* ority=20 */ +0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ +0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ +0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ +0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ +0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ +0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ +0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ +0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ +0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ +0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ +0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ +0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ +0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ +0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ +0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ +0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ +0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ +0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ +0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ +0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ +0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ +0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ +0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ +0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ +0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ +0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ +0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ +0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ +0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ +0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ +0x34 /* 4 */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt54[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x45, 0xa1, 0x00, 0x00, 0xff, 0x11, /* .ZE..... */ +0xd2, 0xe3, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt55[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x23, 0x00, 0x00, 0xff, 0x11, /* .~.#.... */ +0x08, 0x9e, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt56[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x5c, 0x45, 0xa5, 0x00, 0x00, 0xff, 0x11, /* .\E..... */ +0xd3, 0xdd, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x7b, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* {....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x0c /* .. */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt57[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x5c, 0x0a, 0x24, 0x00, 0x00, 0xff, 0x11, /* .\.$.... */ +0x08, 0xbf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x75, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* u-...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x0c /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt58[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x03, 0x44, 0x45, 0xac, 0x00, 0x00, 0xff, 0x11, /* .DE..... */ +0xd0, 0xee, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0xfa, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* .n...... */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x90, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x91, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x91, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x91, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x92, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt59[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x03, 0x44, 0x0a, 0x25, 0x00, 0x00, 0xff, 0x11, /* .D.%.... */ +0x05, 0xd6, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0xf3, 0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* ........ */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x90, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x91, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x91, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x91, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x92, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt60[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x03, 0x44, 0x45, 0xd0, 0x00, 0x00, 0xff, 0x11, /* .DE..... */ +0xd0, 0xca, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0x81, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* ........ */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x87, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x88, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x88, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x88, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x89, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt61[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x03, 0x44, 0x0a, 0x26, 0x00, 0x00, 0xff, 0x11, /* .D.&.... */ +0x05, 0xd5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0x7b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* {....... */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x87, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x88, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x88, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x88, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x89, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + diff --git a/test/regression/mdns_test/capture/query_and_response_chaos.pcapng b/test/regression/mdns_test/capture/query_and_response_chaos.pcapng new file mode 100644 index 00000000..3231ae0e Binary files /dev/null and b/test/regression/mdns_test/capture/query_and_response_chaos.pcapng differ diff --git a/test/regression/mdns_test/capture/query_and_response_v6.c b/test/regression/mdns_test/capture/query_and_response_v6.c new file mode 100644 index 00000000..1c5add67 --- /dev/null +++ b/test/regression/mdns_test/capture/query_and_response_v6.c @@ -0,0 +1,99 @@ +/* Frame (96 bytes) */ +static const unsigned char pkt1[96] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0xec, 0x17, /* 33...... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x86, 0xdd, 0x60, 0x00, /* /.....`. */ +0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0x20, 0x01, /* ...*.. . */ +0x0d, 0xb1, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x2a, 0xb0, 0x29, 0x00, 0x00, /* ...*.).. */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt2[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0xa2, 0xa8, 0x00, 0x00, /* ........ */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, 0x41, /* ...d...A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, /* cal..ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, /* ....B.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, /* ...."..3 */ +0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* DW.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, /* ....x... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, /* l...@... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x0b, 0x41, 0x52, /* on=01.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (122 bytes) */ +static const unsigned char pkt3[122] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0xec, 0x17, /* 33...... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x86, 0xdd, 0x60, 0x00, /* /.....`. */ +0x00, 0x00, 0x00, 0x44, 0x11, 0xff, 0x20, 0x01, /* ...D.. . */ +0x0d, 0xb1, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x44, 0x6e, 0x5c, 0x00, 0x00, /* ...Dn\.. */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x64, 0x00, 0x0e, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0xc0, 0x0c /* .. */ +}; + diff --git a/test/regression/mdns_test/capture/query_and_response_v6.pcapng b/test/regression/mdns_test/capture/query_and_response_v6.pcapng new file mode 100644 index 00000000..a43980a9 Binary files /dev/null and b/test/regression/mdns_test/capture/query_and_response_v6.pcapng differ diff --git a/test/regression/mdns_test/capture/query_during_probing_1.c b/test/regression/mdns_test/capture/query_during_probing_1.c new file mode 100644 index 00000000..272c4fbf --- /dev/null +++ b/test/regression/mdns_test/capture/query_during_probing_1.c @@ -0,0 +1,240 @@ +/* Frame (226 bytes) */ +static const unsigned char pkt1[226] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xd4, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xda, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ +0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00 /* .. */ +}; + +/* Frame (226 bytes) */ +static const unsigned char pkt2[226] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xd4, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ +0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00 /* .. */ +}; + +/* Frame (226 bytes) */ +static const unsigned char pkt3[226] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xd4, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ +0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00 /* .. */ +}; + +/* Frame (338 bytes) */ +static const unsigned char pkt4[338] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x44, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ +0x8f, 0x67, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .g...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ +0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (338 bytes) */ +static const unsigned char pkt5[338] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x44, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ +0x8f, 0x66, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .f...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ +0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (338 bytes) */ +static const unsigned char pkt6[338] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x44, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ +0x8f, 0x65, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .e...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ +0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + diff --git a/test/regression/mdns_test/capture/query_during_probing_1.pcapng b/test/regression/mdns_test/capture/query_during_probing_1.pcapng new file mode 100644 index 00000000..d2f41774 Binary files /dev/null and b/test/regression/mdns_test/capture/query_during_probing_1.pcapng differ diff --git a/test/regression/mdns_test/capture/query_during_probing_2.c b/test/regression/mdns_test/capture/query_during_probing_2.c new file mode 100644 index 00000000..ae03bb09 --- /dev/null +++ b/test/regression/mdns_test/capture/query_during_probing_2.c @@ -0,0 +1,56 @@ +/* Frame (86 bytes) */ +static const unsigned char pkt1[86] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x48, 0x00, 0xf6, 0x00, 0x00, 0xff, 0x11, /* .H...... */ +0x12, 0x01, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x34, /* .......4 */ +0x9a, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .e...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01, /* cal..!.. */ +0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01 /* ...... */ +}; + +/* Frame (289 bytes) */ +static const unsigned char pkt2[289] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x13, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x95, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xff, /* ........ */ +0x12, 0xde, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* B.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, /* ...x...A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x40, 0x04, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40 /* @ */ +}; + diff --git a/test/regression/mdns_test/capture/query_during_probing_2.pcapng b/test/regression/mdns_test/capture/query_during_probing_2.pcapng new file mode 100644 index 00000000..3dcc9558 Binary files /dev/null and b/test/regression/mdns_test/capture/query_during_probing_2.pcapng differ diff --git a/test/regression/mdns_test/capture/query_rr_a.c b/test/regression/mdns_test/capture/query_rr_a.c new file mode 100644 index 00000000..fae6bf8f --- /dev/null +++ b/test/regression/mdns_test/capture/query_rr_a.c @@ -0,0 +1,42 @@ +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3f, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* .?..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0x51, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Qo...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (77 bytes) */ +static const unsigned char pkt2[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3f, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .?..@... */ +0x90, 0x91, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0x51, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Qo...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (77 bytes) */ +static const unsigned char pkt3[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3f, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .?..@... */ +0x90, 0x90, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0x51, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Qo...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + diff --git a/test/regression/mdns_test/capture/query_rr_a.pcapng b/test/regression/mdns_test/capture/query_rr_a.pcapng new file mode 100644 index 00000000..218922e0 Binary files /dev/null and b/test/regression/mdns_test/capture/query_rr_a.pcapng differ diff --git a/test/regression/mdns_test/capture/query_rr_timeout.c b/test/regression/mdns_test/capture/query_rr_timeout.c new file mode 100644 index 00000000..d5146e29 --- /dev/null +++ b/test/regression/mdns_test/capture/query_rr_timeout.c @@ -0,0 +1,83 @@ +/* Frame (108 bytes) */ +static const unsigned char pkt1[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x5e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x4a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .J...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x1e, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, /* ocal..!. */ +0x01, 0x04, 0x74, 0x65, 0x73, 0x74, 0x05, 0x5f, /* ..test._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x00, 0x01 /* .... */ +}; + +/* Frame (171 bytes) */ +static const unsigned char pkt2[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x9d, 0x02, 0xa0, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x10, 0x02, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ +0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ +0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + +/* Frame (81 bytes) */ +static const unsigned char pkt3[81] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x43, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .C..@... */ +0x90, 0x64, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .d...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2f, /* ......./ */ +0x0d, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, /* ocal..!. */ +0x01 /* . */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt4[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x90, 0x02, 0xa1, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x10, 0x0e, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0xa0, 0x5c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .\...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ +0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ +0xc0, 0x33, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* .3...... */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x07, 0x0a, /* .x...... */ +0xc0, 0x33, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .3./.... */ +0x00, 0x78, 0x00, 0x05, 0xc0, 0x33, 0x00, 0x01, /* .x...3.. */ +0x40, 0xc0, 0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, /* @.../... */ +0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, 0x0c, 0x00, /* ..x..... */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + diff --git a/test/regression/mdns_test/capture/query_rr_timeout.pcapng b/test/regression/mdns_test/capture/query_rr_timeout.pcapng new file mode 100644 index 00000000..428723a5 Binary files /dev/null and b/test/regression/mdns_test/capture/query_rr_timeout.pcapng differ diff --git a/test/regression/mdns_test/capture/query_start_stop.c b/test/regression/mdns_test/capture/query_start_stop.c new file mode 100644 index 00000000..14823a6e --- /dev/null +++ b/test/regression/mdns_test/capture/query_start_stop.c @@ -0,0 +1,110 @@ +/* Frame (90 bytes) */ +static const unsigned char pkt1[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x4c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .L..@... */ +0x90, 0x5c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .\...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x46, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* F....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01 /* .. */ +}; + +/* Frame (199 bytes) */ +static const unsigned char pkt2[199] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xb9, 0x1d, 0xbb, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xf4, 0xca, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xa5, /* ........ */ +0x3b, 0x23, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ;#...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, /* ........ */ +0x04, 0x74, 0x65, 0x73, 0x74, 0xc0, 0x1a, 0x08, /* .test... */ +0x43, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, /* Catro-PC */ +0xc0, 0x25, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* .%...... */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x07, 0x0a, /* .x...... */ +0xc0, 0x36, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .6.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x3d, 0xc0, 0x36, 0x00, 0x10, /* .P.=.6.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc0, 0x3d, 0x00, 0x2f, 0x80, 0x01, 0x00, /* ..=./... */ +0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, 0x3d, 0x00, /* ..x...=. */ +0x01, 0x40, 0xc0, 0x36, 0x00, 0x2f, 0x80, 0x01, /* .@.6./.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, 0x36, /* ...x...6 */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + +/* Frame (155 bytes) */ +static const unsigned char pkt3[155] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8d, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x1a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x79, /* .......y */ +0xd4, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .~...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0x04, 0x5f, 0x73, 0x75, 0x62, /* ter._sub */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x17, 0x04, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + +/* Frame (81 bytes) */ +static const unsigned char pkt4[81] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x43, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .C..@... */ +0x90, 0x63, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .c...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2f, /* ......./ */ +0x2f, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* /....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01 /* . */ +}; + +/* Frame (171 bytes) */ +static const unsigned char pkt5[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x9d, 0x1d, 0xbc, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xf4, 0xe5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ +0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ +0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + diff --git a/test/regression/mdns_test/capture/query_start_stop.pcapng b/test/regression/mdns_test/capture/query_start_stop.pcapng new file mode 100644 index 00000000..78975aa4 Binary files /dev/null and b/test/regression/mdns_test/capture/query_start_stop.pcapng differ diff --git a/test/regression/mdns_test/capture/query_with_tc.c b/test/regression/mdns_test/capture/query_with_tc.c new file mode 100644 index 00000000..0b1a5aea --- /dev/null +++ b/test/regression/mdns_test/capture/query_with_tc.c @@ -0,0 +1,658 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0x6a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .j...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (1437 bytes) */ +static const unsigned char pkt2[1437] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x05, 0x8f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x61, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .a...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x7b, /* .......{ */ +0x26, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* &....... */ +0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* .,....._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x31, 0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, /* .1.01 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, 0x80, /* s...(... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, /* .P.ubunt */ +0x75, 0xc0, 0x17, 0xc0, 0x78, 0x00, 0x1c, 0x80, /* u...x... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, /* ....x... */ +0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, 0x8d, 0xc0, /* .)...... */ +0x78, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* x....... */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x01, 0xc0, /* x....... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x31, 0x36, 0x20, 0x53, /* ..1.16 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc0, 0xb9, 0x00, 0x10, /* ts...... */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc0, 0xb9, 0x00, 0x21, 0x80, 0x01, 0x00, /* ....!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, 0x6d, /* 1.15 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0xc0, 0x0c, 0xc1, 0x17, 0x00, 0x10, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc1, /* ........ */ +0x17, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ +0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc1, 0x75, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* .u...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc1, 0x75, 0x00, /* ......u. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ +0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x38, /* ....1.08 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc1, 0xd3, /* kets.... */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc1, 0xd3, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x31, 0x34, 0x20, 0x53, /* ..1.14 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc2, 0x31, 0x00, 0x10, /* ts...1.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc2, 0x31, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..1.!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x31, 0x32, 0x20, 0x53, 0x69, 0x6d, /* 1.12 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0xc0, 0x0c, 0xc2, 0x8f, 0x00, 0x10, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc2, /* ........ */ +0x8f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ +0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x31, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 11 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc2, 0xed, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc2, 0xed, 0x00, /* ........ */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ +0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x39, /* ....1.09 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc3, 0x4b, /* kets...K */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc3, 0x4b, 0x00, 0x21, 0x80, /* ....K.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x31, 0x30, 0x20, 0x53, /* ..1.10 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc3, 0xa9, 0x00, 0x10, /* ts...... */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc3, 0xa9, 0x00, 0x21, 0x80, 0x01, 0x00, /* ....!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, 0x6d, /* 1.07 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0xc0, 0x0c, 0xc4, 0x07, 0x00, 0x10, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc4, /* ........ */ +0x07, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ +0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc4, 0x65, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* .e...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc4, 0x65, 0x00, /* ......e. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ +0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x36, /* ....1.06 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc4, 0xc3, /* kets.... */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc4, 0xc3, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x30, 0x34, 0x20, 0x53, /* ..1.04 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc5, 0x21, 0x00, 0x10, /* ts...!.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc5, 0x21, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..!.!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78 /* ..P.x */ +}; + +/* Frame (265 bytes) */ +static const unsigned char pkt3[265] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0xfb, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xf5, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe7, /* ........ */ +0x83, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x31, 0x2e, 0x30, 0x32, 0x20, 0x53, 0x69, /* .1.02 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, 0x80, /* s...(... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, /* .P.ubunt */ +0x75, 0xc0, 0x17, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* u....... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc0, 0x8d, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x8d, 0x00, /* ........ */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78 /* x */ +}; + +/* Frame (1471 bytes) */ +static const unsigned char pkt4[1471] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xb1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xf6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ +0xd6, 0x19, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ +0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x93, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ +0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (147 bytes) */ +static const unsigned char pkt5[147] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x85, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x21, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .!...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ +0xae, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + +/* Frame (1471 bytes) */ +static const unsigned char pkt6[1471] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xb1, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xf4, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ +0xe4, 0x29, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* .)...... */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, /* ......A. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, /* ......A. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (147 bytes) */ +static const unsigned char pkt7[147] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x85, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x1f, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ +0xae, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* . ...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + diff --git a/test/regression/mdns_test/capture/query_with_tc.pcapng b/test/regression/mdns_test/capture/query_with_tc.pcapng new file mode 100644 index 00000000..0aaa1c21 Binary files /dev/null and b/test/regression/mdns_test/capture/query_with_tc.pcapng differ diff --git a/test/regression/mdns_test/capture/responder_cooperating.c b/test/regression/mdns_test/capture/responder_cooperating.c new file mode 100644 index 00000000..efaf70d8 --- /dev/null +++ b/test/regression/mdns_test/capture/responder_cooperating.c @@ -0,0 +1,52 @@ +/* Frame (88 bytes) */ +static const unsigned char pkt1[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4a, 0x09, 0xaa, 0x00, 0x00, 0xff, 0x11, /* .J...... */ +0x09, 0x4b, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .K...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xf6, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (112 bytes) */ +static const unsigned char pkt2[112] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x62, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .b..@... */ +0x90, 0x46, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .F...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4e, /* .......N */ +0x17, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (113 bytes) */ +static const unsigned char pkt3[113] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x63, 0x09, 0xab, 0x00, 0x00, 0xff, 0x11, /* .c...... */ +0x09, 0x31, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .1...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4f, /* .......O */ +0x36, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 64...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, /* tp._tcp. */ +0x23 /* # */ +}; + diff --git a/test/regression/mdns_test/capture/responder_cooperating.pcapng b/test/regression/mdns_test/capture/responder_cooperating.pcapng new file mode 100644 index 00000000..4b814d29 Binary files /dev/null and b/test/regression/mdns_test/capture/responder_cooperating.pcapng differ diff --git a/test/regression/mdns_test/capture/responder_cooperating_2.c b/test/regression/mdns_test/capture/responder_cooperating_2.c new file mode 100644 index 00000000..f9f41260 --- /dev/null +++ b/test/regression/mdns_test/capture/responder_cooperating_2.c @@ -0,0 +1,54 @@ +/* Frame (87 bytes) */ +static const unsigned char pkt1[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x49, 0x0a, 0x5b, 0x00, 0x00, 0xff, 0x11, /* .I.[.... */ +0x08, 0x9b, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0xd3, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01 /* al..!.. */ +}; + +/* Frame (277 bytes) */ +static const unsigned char pkt2[277] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x07, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xa1, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xf3, /* ........ */ +0x9d, 0x88, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x24, 0x0b, 0x41, 0x52, /* ..x.$.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* @.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ +0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .B.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, /* ....x... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x40 /* l...@ */ +}; + diff --git a/test/regression/mdns_test/capture/responder_cooperating_2.pcapng b/test/regression/mdns_test/capture/responder_cooperating_2.pcapng new file mode 100644 index 00000000..808b3344 Binary files /dev/null and b/test/regression/mdns_test/capture/responder_cooperating_2.pcapng differ diff --git a/test/regression/mdns_test/capture/response_a.c b/test/regression/mdns_test/capture/response_a.c new file mode 100644 index 00000000..3338061c --- /dev/null +++ b/test/regression/mdns_test/capture/response_a.c @@ -0,0 +1,99 @@ +/* Frame (110 bytes) */ +static const unsigned char pkt1[110] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x60, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .`..@... */ +0x90, 0x70, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .p...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......L */ +0xd6, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* ...... */ +}; + +/* Frame (110 bytes) */ +static const unsigned char pkt2[110] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x60, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .`..@... */ +0x90, 0x6f, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .o...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......L */ +0xd6, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* ...... */ +}; + +/* Frame (110 bytes) */ +static const unsigned char pkt3[110] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x60, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .`..@... */ +0x90, 0x6e, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .n...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......L */ +0xd6, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* ...... */ +}; + +/* Frame (87 bytes) */ +static const unsigned char pkt4[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x49, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ +0x90, 0x84, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0x9d, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ +}; + +/* Frame (87 bytes) */ +static const unsigned char pkt5[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x49, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ +0x90, 0x83, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0x9d, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ +}; + +/* Frame (87 bytes) */ +static const unsigned char pkt6[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x49, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ +0x90, 0x82, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0x9d, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ +}; + diff --git a/test/regression/mdns_test/capture/response_a.pcapng b/test/regression/mdns_test/capture/response_a.pcapng new file mode 100644 index 00000000..86a96f79 Binary files /dev/null and b/test/regression/mdns_test/capture/response_a.pcapng differ diff --git a/test/regression/mdns_test/capture/response_aggregation.c b/test/regression/mdns_test/capture/response_aggregation.c new file mode 100644 index 00000000..2d235909 --- /dev/null +++ b/test/regression/mdns_test/capture/response_aggregation.c @@ -0,0 +1,182 @@ +/* Frame (140 bytes) */ +static const unsigned char pkt1[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x01, 0x4c, 0x00, 0x00, 0xff, 0x11, /* .~.L.... */ +0x11, 0x75, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .u...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt2[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x41, 0x01, 0x4d, 0x00, 0x00, 0xff, 0x11, /* .A.M.... */ +0x11, 0xb1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt3[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x41, 0x01, 0x4e, 0x00, 0x00, 0xff, 0x11, /* .A.N.... */ +0x11, 0xb0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (75 bytes) */ +static const unsigned char pkt4[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x01, 0x4f, 0x00, 0x00, 0xff, 0x11, /* .=.O.... */ +0x11, 0xb3, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (632 bytes) */ +static const unsigned char pkt5[632] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x02, 0x6a, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .j..@... */ +0x8e, 0x3e, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .>...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x56, /* .......V */ +0x66, 0x0b, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* f....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x21, 0x0b, 0x41, 0x52, /* ..d.!.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* t._print */ +0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* er._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x08, 0x5f, /* NSTest._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* st._prin */ +0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ter._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x08, 0x5f, /* NSTest._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x28, 0x0b, 0x41, 0x52, /* ..x.(.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* t._print */ +0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* er._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x0b, 0x41, 0x52, /* ....@.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x0b, 0x41, 0x52, /* .d....AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x24, 0x0b, 0x41, 0x52, 0x4d, /* .x.$.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .......@ */ +}; + +/* Frame (101 bytes) */ +static const unsigned char pkt6[101] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x57, 0x01, 0x50, 0x00, 0x00, 0xff, 0x11, /* .W.P.... */ +0x11, 0x98, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ +0x10, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ +}; + +/* Frame (105 bytes) */ +static const unsigned char pkt7[105] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x5b, 0x01, 0x51, 0x00, 0x00, 0xff, 0x11, /* .[.Q.... */ +0x11, 0x93, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x47, /* .......G */ +0x26, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x00, 0x0e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* c...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0xc0, /* DNSTest. */ +0x0c /* . */ +}; + diff --git a/test/regression/mdns_test/capture/response_aggregation.pcapng b/test/regression/mdns_test/capture/response_aggregation.pcapng new file mode 100644 index 00000000..a22ca99e Binary files /dev/null and b/test/regression/mdns_test/capture/response_aggregation.pcapng differ diff --git a/test/regression/mdns_test/capture/response_in_multiple_packets.c b/test/regression/mdns_test/capture/response_in_multiple_packets.c new file mode 100644 index 00000000..c59b4397 --- /dev/null +++ b/test/regression/mdns_test/capture/response_in_multiple_packets.c @@ -0,0 +1,470 @@ +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x06, 0x3f, 0x00, 0x00, 0xff, 0x11, /* .=.?.... */ +0x0c, 0xc3, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (1497 bytes) */ +static const unsigned char pkt2[1497] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xcb, 0x00, 0x1d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xb7, /* ........ */ +0x44, 0x6c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Dl...... */ +0x00, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* l.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st3._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* l.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st7._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* al.._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* ..test12 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t13._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x05, /* ...d.... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, /* test1._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* @.test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st3._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t4._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* ..test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, /* test5._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (1490 bytes) */ +static const unsigned char pkt3[1490] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xc4, 0x00, 0x1e, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xb0, /* ........ */ +0x12, 0x0c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* .@.test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t7._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, 0x04, /* ..test8. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* l..test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, 0x73, /* d....tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, /* est10._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, /* ..test10 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, /* st11._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, 0x04, /* .test11. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* @.test12 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, /* ...d.... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, /* test12._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* ..test12 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00 /* l. */ +}; + +/* Frame (154 bytes) */ +static const unsigned char pkt4[154] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8c, 0x00, 0x1f, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x04, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x78, /* .......x */ +0xef, 0x93, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x31, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 14._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt5[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x01, 0x5a, 0x06, 0x40, 0x00, 0x00, 0xff, 0x11, /* .Z.@.... */ +0x0b, 0xa5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x9e, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .#...... */ +0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0xc0, 0x0c, 0xc0, /* test1... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x32, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 2....... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x33, 0xc0, 0x0c, 0xc0, /* test3... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x34, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 4....... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x35, 0xc0, 0x0c, 0xc0, /* test5... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x36, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 6....... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0xc0, 0x0c, 0xc0, /* test7... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x38, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 8....... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x39, 0xc0, 0x0c, 0xc0, /* test9... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x09, 0x06, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, /* 10...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x09, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, 0xc0, /* .test11. */ +0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x00, 0x64, 0x00, 0x09, 0x06, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x31, 0x32, 0xc0, 0x0c, 0xc0, 0x0c, /* st12.... */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x09, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 3....... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x09, 0x06, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0xc0, 0x0c /* test14.. */ +}; + diff --git a/test/regression/mdns_test/capture/response_in_multiple_packets.pcapng b/test/regression/mdns_test/capture/response_in_multiple_packets.pcapng new file mode 100644 index 00000000..142ad0b7 Binary files /dev/null and b/test/regression/mdns_test/capture/response_in_multiple_packets.pcapng differ diff --git a/test/regression/mdns_test/capture/response_interval.c b/test/regression/mdns_test/capture/response_interval.c new file mode 100644 index 00000000..da6c3385 --- /dev/null +++ b/test/regression/mdns_test/capture/response_interval.c @@ -0,0 +1,85 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3e, 0x01, 0x16, 0x00, 0x00, 0xff, 0x11, /* .>...... */ +0x11, 0xeb, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x26, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &/...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt2[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x28, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .(...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0xbf, 0xcd, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* B.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, /* ...x...A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, /* ...@.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x14, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* 1.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt3[102] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x58, 0x01, 0x17, 0x00, 0x00, 0xff, 0x11, /* .X...... */ +0x11, 0xd0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x44, /* .......D */ +0xe4, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, /* .....d.. */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0xc0, 0x0c /* Test.. */ +}; + diff --git a/test/regression/mdns_test/capture/response_interval.pcapng b/test/regression/mdns_test/capture/response_interval.pcapng new file mode 100644 index 00000000..9c60b1cf Binary files /dev/null and b/test/regression/mdns_test/capture/response_interval.pcapng differ diff --git a/test/regression/mdns_test/capture/response_interval_2.c b/test/regression/mdns_test/capture/response_interval_2.c new file mode 100644 index 00000000..01f3f0ae --- /dev/null +++ b/test/regression/mdns_test/capture/response_interval_2.c @@ -0,0 +1,520 @@ +/* Frame (269 bytes) */ +static const unsigned char pkt1[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt3[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt4[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt5[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt6[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt7[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x01, 0x25, 0x00, 0x00, 0xff, 0x11, /* .E.%.... */ +0x11, 0xd5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt8[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x01, 0x26, 0x00, 0x00, 0xff, 0x11, /* .L.&.... */ +0x11, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x9b, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .p...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x80, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt9[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x01, 0x27, 0x00, 0x00, 0xff, 0x11, /* .L.'.... */ +0x11, 0xcc, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt10[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x01, 0x28, 0x00, 0x00, 0xff, 0x11, /* .L.(.... */ +0x11, 0xcb, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt11[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x01, 0x29, 0x00, 0x00, 0xff, 0x11, /* .~.).... */ +0x11, 0x98, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt12[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x01, 0x2a, 0x00, 0x00, 0xff, 0x11, /* .E.*.... */ +0x11, 0xd0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt13[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x01, 0x2b, 0x00, 0x00, 0xff, 0x11, /* .~.+.... */ +0x11, 0x96, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt14[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x01, 0x2c, 0x00, 0x00, 0xff, 0x11, /* .~.,.... */ +0x11, 0x95, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt15[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x01, 0x2d, 0x00, 0x00, 0xff, 0x11, /* .E.-.... */ +0x11, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt16[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x50, 0x01, 0x2e, 0x00, 0x00, 0xff, 0x11, /* .P...... */ +0x11, 0xc1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0xa4, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01, /* cal..!.. */ +0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01 /* ...... */ +}; + +/* Frame (340 bytes) */ +static const unsigned char pkt17[340] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x46, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .F..@... */ +0x8f, 0x62, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .b...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x32, /* .......2 */ +0xa4, 0x76, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .v...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* =01.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x16, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x40, 0x0b, /* cal...@. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, /* ....x.%. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt18[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x01, 0x2f, 0x00, 0x00, 0xff, 0x11, /* .~./.... */ +0x11, 0x92, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + diff --git a/test/regression/mdns_test/capture/response_interval_2.pcapng b/test/regression/mdns_test/capture/response_interval_2.pcapng new file mode 100644 index 00000000..3fbeaf81 Binary files /dev/null and b/test/regression/mdns_test/capture/response_interval_2.pcapng differ diff --git a/test/regression/mdns_test/capture/response_no_delay.c b/test/regression/mdns_test/capture/response_no_delay.c new file mode 100644 index 00000000..a50db771 --- /dev/null +++ b/test/regression/mdns_test/capture/response_no_delay.c @@ -0,0 +1,36 @@ +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3f, 0x48, 0x48, 0x00, 0x00, 0xff, 0x11, /* .?HH.... */ +0xd1, 0x57, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .W...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt2[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x2c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .,...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb9, 0x74, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .t...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + diff --git a/test/regression/mdns_test/capture/response_no_delay.pcapng b/test/regression/mdns_test/capture/response_no_delay.pcapng new file mode 100644 index 00000000..a079a034 Binary files /dev/null and b/test/regression/mdns_test/capture/response_no_delay.pcapng differ diff --git a/test/regression/mdns_test/capture/response_to_address_query.c b/test/regression/mdns_test/capture/response_to_address_query.c new file mode 100644 index 00000000..2e680bd5 --- /dev/null +++ b/test/regression/mdns_test/capture/response_to_address_query.c @@ -0,0 +1,42 @@ +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3f, 0x5c, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .?\..... */ +0xbc, 0xba, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (186 bytes) */ +static const unsigned char pkt2[186] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xac, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xf9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x98, /* ........ */ +0x17, 0x2c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .,...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ +0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x22, 0xff, /* ......". */ +0xfe, 0x33, 0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, /* .3DW.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x19, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, /* cal...@. */ +0x00, 0x08 /* .. */ +}; + diff --git a/test/regression/mdns_test/capture/response_to_address_query.pcapng b/test/regression/mdns_test/capture/response_to_address_query.pcapng new file mode 100644 index 00000000..d1ba5af3 Binary files /dev/null and b/test/regression/mdns_test/capture/response_to_address_query.pcapng differ diff --git a/test/regression/mdns_test/capture/response_with_tc.c b/test/regression/mdns_test/capture/response_with_tc.c new file mode 100644 index 00000000..48089f81 --- /dev/null +++ b/test/regression/mdns_test/capture/response_with_tc.c @@ -0,0 +1,110 @@ +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (554 bytes) */ +static const unsigned char pkt2[554] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x02, 0x1c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8e, 0x8c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x08, /* ........ */ +0x00, 0x93, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x16, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x40, 0x2e, /* cal...@. */ +0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x2e, 0x30, 0x33, 0x20, 0x53, /* al..03 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x2e, /* ...d.... */ +0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x48, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .H.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (137 bytes) */ +static const unsigned char pkt3[137] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x7b, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .{..@... */ +0x90, 0x75, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .u...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x67, /* .......g */ +0xcf, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x31, /* .....d.1 */ +0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .03 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, /* Packets. */ +0x0c /* . */ +}; + diff --git a/test/regression/mdns_test/capture/response_with_tc.pcapng b/test/regression/mdns_test/capture/response_with_tc.pcapng new file mode 100644 index 00000000..3a38cf5b Binary files /dev/null and b/test/regression/mdns_test/capture/response_with_tc.pcapng differ diff --git a/test/regression/mdns_test/capture/rr_timeout.c b/test/regression/mdns_test/capture/rr_timeout.c new file mode 100644 index 00000000..0911d7ca --- /dev/null +++ b/test/regression/mdns_test/capture/rr_timeout.c @@ -0,0 +1,87 @@ +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3d, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ +0x90, 0x93, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0x66, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* f....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (185 bytes) */ +static const unsigned char pkt2[185] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0xab, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x45, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .E...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x97, /* ........ */ +0xa2, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x14, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0xc0, 0x0c, 0xc0, 0x27, 0x00, /* ver...'. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x01, 0x00, 0xc0, 0x27, 0x00, 0x21, 0x80, 0x01, /* ...'.!.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, /* ...x.... */ +0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, 0x75, /* ...P.ubu */ +0x6e, 0x74, 0x75, 0xc0, 0x16, 0xc0, 0x5a, 0x00, /* ntu...Z. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, /* ...).... */ +0x8d, 0xc0, 0x5a, 0x00, 0x01, 0x80, 0x01, 0x00, /* ..Z..... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x01 /* . */ +}; + +/* Frame (129 bytes) */ +static const unsigned char pkt3[129] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x73, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ +0x90, 0x5c, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .\...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ +0x92, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x00, 0x01, 0x06, 0x75, 0x62, /* ..!...ub */ +0x75, 0x6e, 0x74, 0x75, 0x05, 0x6c, 0x6f, 0x63, /* untu.loc */ +0x61, 0x6c, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x06, /* al...... */ +0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x05, 0x6c, /* ubuntu.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x00, /* ocal.... */ +0x01 /* . */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt4[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x90, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x60, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .`...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0x3e, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* >....... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, /* .......u */ +0x62, 0x75, 0x6e, 0x74, 0x75, 0x05, 0x6c, 0x6f, /* buntu.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ +0x00, 0x01, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* ...Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x04, 0x5f, 0x69, 0x70, /* rver._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x13, /* p._tcp.. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, /* ........ */ +0x29, 0xff, 0xfe, 0x01, 0xd4, 0x8d /* )..... */ +}; + diff --git a/test/regression/mdns_test/capture/rr_timeout.pcapng b/test/regression/mdns_test/capture/rr_timeout.pcapng new file mode 100644 index 00000000..f90a5d44 Binary files /dev/null and b/test/regression/mdns_test/capture/rr_timeout.pcapng differ diff --git a/test/regression/mdns_test/capture/send_goodbye.c b/test/regression/mdns_test/capture/send_goodbye.c new file mode 100644 index 00000000..d25e2b6c --- /dev/null +++ b/test/regression/mdns_test/capture/send_goodbye.c @@ -0,0 +1,229 @@ +/* Frame (153 bytes) */ +static const unsigned char pkt1[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8b, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x23, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .#...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xc0, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, /* .....x.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00 /* . */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8b, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x22, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* ."...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xc0, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, /* .....x.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00 /* . */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt3[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8b, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x21, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .!...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xc0, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, /* .....x.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00 /* . */ +}; + +/* Frame (295 bytes) */ +static const unsigned char pkt4[295] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x19, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x92, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x05, /* ........ */ +0xea, 0x95, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, /* .....ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* ....pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (295 bytes) */ +static const unsigned char pkt5[295] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x19, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x91, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x05, /* ........ */ +0xea, 0x95, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, /* .....ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* ....pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (295 bytes) */ +static const unsigned char pkt6[295] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x19, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x90, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x05, /* ........ */ +0xea, 0x95, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, /* .....ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* ....pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt7[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xdf, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0xdf, 0xc3, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + diff --git a/test/regression/mdns_test/capture/send_goodbye.pcapng b/test/regression/mdns_test/capture/send_goodbye.pcapng new file mode 100644 index 00000000..87451e94 Binary files /dev/null and b/test/regression/mdns_test/capture/send_goodbye.pcapng differ diff --git a/test/regression/mdns_test/capture/server_announcement.c b/test/regression/mdns_test/capture/server_announcement.c new file mode 100644 index 00000000..bd89e7e6 --- /dev/null +++ b/test/regression/mdns_test/capture/server_announcement.c @@ -0,0 +1,282 @@ +/* Frame (321 bytes) */ +static const unsigned char pkt1[321] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x33, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* .3..@... */ +0x8f, 0x9e, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x1f, /* ........ */ +0xe5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* .&...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, 0x70, /* .d...pap */ +0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ +0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + +/* Frame (87 bytes) */ +static const unsigned char pkt2[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x49, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ +0x90, 0x87, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0xa1, 0x99, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ +}; + +/* Frame (321 bytes) */ +static const unsigned char pkt3[321] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x33, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .3..@... */ +0x8f, 0x9c, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x1f, /* ........ */ +0xe5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* .&...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, 0x70, /* .d...pap */ +0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ +0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + +/* Frame (87 bytes) */ +static const unsigned char pkt4[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x49, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ +0x90, 0x85, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0xa1, 0x99, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ +}; + +/* Frame (321 bytes) */ +static const unsigned char pkt5[321] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x33, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .3..@... */ +0x8f, 0x9a, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x1f, /* ........ */ +0xe5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* .&...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, 0x70, /* .d...pap */ +0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ +0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + +/* Frame (87 bytes) */ +static const unsigned char pkt6[87] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x49, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ +0x90, 0x83, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ +0xa1, 0x99, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ +}; + +/* Frame (234 bytes) */ +static const unsigned char pkt7[234] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xdc, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xee, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc8, /* ........ */ +0xf5, 0x0e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 1.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, /* ..d...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00 /* l. */ +}; + +/* Frame (234 bytes) */ +static const unsigned char pkt8[234] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xdc, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xed, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc8, /* ........ */ +0xf5, 0x0e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 1.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, /* ..d...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00 /* l. */ +}; + +/* Frame (234 bytes) */ +static const unsigned char pkt9[234] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xdc, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xec, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc8, /* ........ */ +0xf5, 0x0e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 1.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, /* ..d...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00 /* l. */ +}; + diff --git a/test/regression/mdns_test/capture/server_announcement.pcapng b/test/regression/mdns_test/capture/server_announcement.pcapng new file mode 100644 index 00000000..bab8e0ac Binary files /dev/null and b/test/regression/mdns_test/capture/server_announcement.pcapng differ diff --git a/test/regression/mdns_test/capture/server_announcement_v6.c b/test/regression/mdns_test/capture/server_announcement_v6.c new file mode 100644 index 00000000..579ad334 --- /dev/null +++ b/test/regression/mdns_test/capture/server_announcement_v6.c @@ -0,0 +1,327 @@ +/* Frame (334 bytes) */ +static const unsigned char pkt1[334] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ +0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ +0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ +0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ +}; + +/* Frame (334 bytes) */ +static const unsigned char pkt2[334] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ +0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ +0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ +0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ +}; + +/* Frame (334 bytes) */ +static const unsigned char pkt3[334] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ +0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ +0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ +0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt4[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ +0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt5[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ +0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt6[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ +0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + diff --git a/test/regression/mdns_test/capture/server_announcement_v6.pcapng b/test/regression/mdns_test/capture/server_announcement_v6.pcapng new file mode 100644 index 00000000..33ac4663 Binary files /dev/null and b/test/regression/mdns_test/capture/server_announcement_v6.pcapng differ diff --git a/test/regression/mdns_test/capture/server_announcement_with_txt.c b/test/regression/mdns_test/capture/server_announcement_with_txt.c new file mode 100644 index 00000000..378822c4 --- /dev/null +++ b/test/regression/mdns_test/capture/server_announcement_with_txt.c @@ -0,0 +1,276 @@ +/* Frame (269 bytes) */ +static const unsigned char pkt1[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt3[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt4[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt5[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt6[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + diff --git a/test/regression/mdns_test/capture/server_announcement_with_txt.pcapng b/test/regression/mdns_test/capture/server_announcement_with_txt.pcapng new file mode 100644 index 00000000..ee60fff2 Binary files /dev/null and b/test/regression/mdns_test/capture/server_announcement_with_txt.pcapng differ diff --git a/test/regression/mdns_test/capture/server_interface_reset.c b/test/regression/mdns_test/capture/server_interface_reset.c new file mode 100644 index 00000000..7289bd9d --- /dev/null +++ b/test/regression/mdns_test/capture/server_interface_reset.c @@ -0,0 +1,628 @@ +/* Frame (287 bytes) */ +static const unsigned char pkt1[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x9d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt2[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x9c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt3[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x9b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt4[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x0d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt5[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x0c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt6[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x0b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (288 bytes) */ +static const unsigned char pkt7[288] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x12, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x96, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfe, /* ........ */ +0x8f, 0x3f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .?...... */ +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, /* ......B. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x00, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, /* .....pap */ +0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ +0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x00, 0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, /* ...$.Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt8[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x96, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt9[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x95, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt10[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x94, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt11[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x06, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt12[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x05, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt13[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x04, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + diff --git a/test/regression/mdns_test/capture/server_interface_reset.pcapng b/test/regression/mdns_test/capture/server_interface_reset.pcapng new file mode 100644 index 00000000..d4c77d98 Binary files /dev/null and b/test/regression/mdns_test/capture/server_interface_reset.pcapng differ diff --git a/test/regression/mdns_test/mdns_address_change_test.c b/test/regression/mdns_test/mdns_address_change_test.c new file mode 100644 index 00000000..04ee3e81 --- /dev/null +++ b/test/regression/mdns_test/mdns_address_change_test.c @@ -0,0 +1,382 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (269 bytes) */ +static const unsigned char pkt1[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt3[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt4[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt5[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt6[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (171 bytes) */ +static const unsigned char pkt7[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x9d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x0a, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .....C.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0xee, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* ......B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, /* .x.....C */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x40 /* ..@ */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt8[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x2a, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .*...C.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb8, 0x73, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .s...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, 0x0b, /* x.....C. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt9[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x29, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .)...C.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb8, 0x73, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .s...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, 0x0b, /* x.....C. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_address_change[] = { + {TITLE, "Address change", 14, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* Wait the probing and announcement. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt5), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt6), 2}, + + /* Change ipv4 address. */ + {MDNS_SET_IPV4_ADDRESS, NX_NULL, IP_ADDRESS(10, 0, 0, 67), 0}, + + /* Check the announcement of address. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt7[0], sizeof(pkt7), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt9[0], sizeof(pkt9), 2}, + + /* Change ipv4 address. */ + {MDNS_SET_IPV4_ADDRESS, NX_NULL, IP_ADDRESS(10, 0, 0, 66), 0}, +}; + +int mdns_address_change_size = sizeof(mdns_address_change) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_announcement_in_multiple_packets_test.c b/test/regression/mdns_test/mdns_announcement_in_multiple_packets_test.c new file mode 100644 index 00000000..de0169d9 --- /dev/null +++ b/test/regression/mdns_test/mdns_announcement_in_multiple_packets_test.c @@ -0,0 +1,2000 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (1425 bytes) */ +static const unsigned char pkt1[1425] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x83, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ +0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ +0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (420 bytes) */ +static const unsigned char pkt2[420] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x96, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x17, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ +0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00 /* d... */ +}; + +/* Frame (1425 bytes) */ +static const unsigned char pkt3[1425] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x83, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ +0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ +0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (420 bytes) */ +static const unsigned char pkt4[420] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x96, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x15, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ +0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00 /* d... */ +}; + +/* Frame (1425 bytes) */ +static const unsigned char pkt5[1425] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x83, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x27, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .'...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ +0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ +0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (420 bytes) */ +static const unsigned char pkt6[420] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x96, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x13, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ +0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00 /* d... */ +}; + +/* Frame (1510 bytes) */ +static const unsigned char pkt7[1510] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xd8, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xd0, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ +0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* Frame (1512 bytes) */ +static const unsigned char pkt8[1512] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xda, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ +0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (119 bytes) */ +static const unsigned char pkt9[119] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x69, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ +0x90, 0x3d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .=...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ +0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + +/* Frame (1510 bytes) */ +static const unsigned char pkt10[1510] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xd8, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ +0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* Frame (1512 bytes) */ +static const unsigned char pkt11[1512] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xda, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xca, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ +0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (119 bytes) */ +static const unsigned char pkt12[119] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x69, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ +0x90, 0x3a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .:...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ +0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + +/* Frame (1510 bytes) */ +static const unsigned char pkt13[1510] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xd8, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xca, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ +0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* Frame (1512 bytes) */ +static const unsigned char pkt14[1512] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xda, 0x00, 0x0e, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ +0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ +0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (119 bytes) */ +static const unsigned char pkt15[119] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x69, 0x00, 0x0f, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ +0x90, 0x37, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .7...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ +0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + + +static MDNS_SERVICE mdns_service1 = {"test1", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service2 = {"test2", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service3 = {"test3", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service4 = {"test4", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service5 = {"test5", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service6 = {"test6", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service7 = {"test7", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service8 = {"test8", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service9 = {"test9", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service10 = {"test10", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service11 = {"test11", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service12 = {"test12", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service13 = {"test13", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service14 = {"test14", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_announcement_in_multiple_packets[] = { + {TITLE, "Announcement in multiple packets", 32, 0}, + + /* Add a service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service1, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service2, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service3, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service4, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service5, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service6, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service7, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service8, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service9, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service10, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service11, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service12, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service13, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service14, 0, 0}, + + /* Wait for the probings. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt5), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt6), 1}, + + /* Wait for the announcements. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt7[0], sizeof(pkt7), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt9[0], sizeof(pkt9), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt10[0], sizeof(pkt10), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt11[0], sizeof(pkt11), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt12[0], sizeof(pkt12), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt13[0], sizeof(pkt13), 2}, + {MDNS_CHECK_DATA_V4, (char*)&pkt14[0], sizeof(pkt14), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt15[0], sizeof(pkt15), 1}, +}; + +int mdns_announcement_in_multiple_packets_size = sizeof(mdns_announcement_in_multiple_packets) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_basic_ipv6_announcement_test.c b/test/regression/mdns_test/mdns_basic_ipv6_announcement_test.c new file mode 100644 index 00000000..e1857921 --- /dev/null +++ b/test/regression/mdns_test/mdns_basic_ipv6_announcement_test.c @@ -0,0 +1,364 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (334 bytes) */ +static const unsigned char pkt1[334] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ +0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ +0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ +0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ +}; + +/* Frame (334 bytes) */ +static const unsigned char pkt2[334] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ +0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ +0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ +0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ +}; + +/* Frame (334 bytes) */ +static const unsigned char pkt3[334] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ +0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ +0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ +0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt4[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ +0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt5[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ +0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt6[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ +0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_basic_ipv6_announcement[] = { + {TITLE, "Basic IPv6 announcement", 23, 0}, + + /* Add link local address. */ + {MDNS_LLA_ADD, NX_NULL, 0x00000011, 0x22334457}, + {WAIT, NX_NULL, 0, 5}, + + /* Recreate mDNS. */ + {MDNS_RECREATE, "ARMMDNSTest", 0, 0}, + + /* Add service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* Check probing and announcement. */ + {MDNS_CHECK_DATA_V6, (char*)&pkt1[0], sizeof(pkt1), 1}, + {MDNS_CHECK_DATA_V6, (char*)&pkt2[0], sizeof(pkt2), 1}, + {MDNS_CHECK_DATA_V6, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_CHECK_DATA_V6, (char*)&pkt4[0], sizeof(pkt4), 1}, + {MDNS_CHECK_DATA_V6, (char*)&pkt5[0], sizeof(pkt5), 1}, + {MDNS_CHECK_DATA_V6, (char*)&pkt6[0], sizeof(pkt6), 2}, + + /* Delete link local address. */ + {MDNS_LLA_DELETE, NX_NULL, 0, 0}, +}; + +int mdns_basic_ipv6_announcement_size = sizeof(mdns_basic_ipv6_announcement) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_basic_ipv6_query_test.c b/test/regression/mdns_test/mdns_basic_ipv6_query_test.c new file mode 100644 index 00000000..1a404c63 --- /dev/null +++ b/test/regression/mdns_test/mdns_basic_ipv6_query_test.c @@ -0,0 +1,104 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" +/* Frame (96 bytes) */ +static const unsigned char pkt1[96] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0xfe, 0x80, /* ...*.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x2a, 0x68, 0xc4, 0x00, 0x00, /* ...*h... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (185 bytes) */ +static const unsigned char pkt2[185] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* 33...... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x86, 0xdd, 0x60, 0x00, /* ..z...`. */ +0x00, 0x00, 0x00, 0x83, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1e, /* ........ */ +0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, 0xff, 0x02, /* ....z... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x83, 0x30, 0x75, 0x00, 0x00, /* ....0u.. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, /* .......C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, /* 00w...ro */ +0x75, 0x74, 0x65, 0x72, 0xc0, 0x17, 0x00, 0x1c, /* uter.... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x1e, 0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, /* ......z. */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (155 bytes) */ +static const unsigned char pkt3[155] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x65, 0x11, 0xff, 0xfe, 0x80, /* ...e.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x65, 0x6c, 0xde, 0x00, 0x00, /* ...el... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x1f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* w._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_basic_ipv6_query[] = { + {TITLE, "Basic IPv6 query", 16, 0}, + + /* Add link local address. */ + {MDNS_LLA_ADD, NX_NULL, 0x00000011, 0x22334456}, + {WAIT, NX_NULL, 0, 5}, + + /* Recreate mDNS. */ + {MDNS_RECREATE, "ARMMDNSTest-0", 0, 0}, + + /* Add query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check query. */ + {MDNS_CHECK_DATA_V6, (char*)&pkt1[0], sizeof(pkt1), 3}, + + /* Inject response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check query with known-answer. */ + {MDNS_CHECK_DATA_V6, (char*)&pkt3[0], sizeof(pkt3), 3}, + + /* Delete link local address. */ + {MDNS_LLA_DELETE, NX_NULL, 0, 0}, +}; + +int mdns_basic_ipv6_query_size = sizeof(mdns_basic_ipv6_query) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_basic_ipv6_response_test.c b/test/regression/mdns_test/mdns_basic_ipv6_response_test.c new file mode 100644 index 00000000..8ab30330 --- /dev/null +++ b/test/regression/mdns_test/mdns_basic_ipv6_response_test.c @@ -0,0 +1,141 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (96 bytes) */ +static const unsigned char pkt1[96] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0xec, 0x17, /* 33...... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x86, 0xdd, 0x60, 0x00, /* /.....`. */ +0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0x20, 0x01, /* ...*.. . */ +0x0d, 0xb1, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x2a, 0xb0, 0x29, 0x00, 0x00, /* ...*.).. */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (466 bytes) */ +static const unsigned char pkt2[466] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ +0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x01, 0x9c, 0xa2, 0xa8, 0x00, 0x00, /* ........ */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, 0x41, /* ...d...A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, /* cal..ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, /* ....B.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, /* ...."..3 */ +0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* DW.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, /* ....x... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, /* l...@... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x0b, 0x41, 0x52, /* on=01.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (122 bytes) */ +static const unsigned char pkt3[122] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0xec, 0x17, /* 33...... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x86, 0xdd, 0x60, 0x00, /* /.....`. */ +0x00, 0x00, 0x00, 0x44, 0x11, 0xff, 0x20, 0x01, /* ...D.. . */ +0x0d, 0xb1, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x44, 0x6e, 0x5c, 0x00, 0x00, /* ...Dn\.. */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x64, 0x00, 0x0e, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0xc0, 0x0c /* .. */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_basic_ipv6_response[] = { + {TITLE, "Basic IPv6 response", 19, 0}, + + /* Add link local address. */ + {MDNS_LLA_ADD, NX_NULL, 0x00000011, 0x22334457}, + {WAIT, NX_NULL, 0, 5}, + + /* Recreate mDNS. */ + {MDNS_RECREATE, "ARMMDNSTest", 0, 0}, + + /* Add service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject query. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Check response. */ + {MDNS_CHECK_DATA_V6, (char*)&pkt2[0], sizeof(pkt2), 3}, + + /* Inject query. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* No response is expected. */ + {N_CHECK, NX_NULL, 0, 1}, + + /* Delete link local address. */ + {MDNS_LLA_DELETE, NX_NULL, 0, 0}, +}; + +int mdns_basic_ipv6_response_size = sizeof(mdns_basic_ipv6_response) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_case_insensitivity_test.c b/test/regression/mdns_test/mdns_case_insensitivity_test.c new file mode 100644 index 00000000..6c4f2e69 --- /dev/null +++ b/test/regression/mdns_test/mdns_case_insensitivity_test.c @@ -0,0 +1,58 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3f, 0x3d, 0x61, 0x00, 0x00, 0xff, 0x11, /* .?=a.... */ +0xdc, 0x3e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .>...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0xba, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x45, /* RMMDNSTE */ +0x53, 0x54, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* ST.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt2[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x2c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .,...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb9, 0x74, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .t...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + + +MDNS_TEST_SEQ mdns_case_insensitivity[] = { + {TITLE, "Case-insensitivity", 18, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a query with upper-case name. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, +}; + +int mdns_case_insensitivity_size = sizeof(mdns_case_insensitivity) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_client_passive_test.c b/test/regression/mdns_test/mdns_client_passive_test.c new file mode 100644 index 00000000..271ad60b --- /dev/null +++ b/test/regression/mdns_test/mdns_client_passive_test.c @@ -0,0 +1,244 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (134 bytes) */ +static const unsigned char pkt1[134] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ +0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ +0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (134 bytes) */ +static const unsigned char pkt2[134] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ +0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ +0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (134 bytes) */ +static const unsigned char pkt3[134] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ +0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ +0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ +0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt4[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt5[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt6[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Frame (223 bytes) */ +static const unsigned char pkt7[223] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0x6e, 0xb6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* n....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0xc0, 0x23, 0xc0, 0x34, 0x00, 0x0c, 0x00, /* p.#.4... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x11, /* ........ */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0xc0, 0x34, 0xc0, 0x4d, 0x00, 0x21, 0x80, /* r.4.M.!. */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x23, 0xc0, 0x73, /* untu.#.s */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x73, 0x00, 0x01, 0x80, 0x01, /* .y.s.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0xc0, 0x4d, 0x00, 0x10, 0x80, 0x01, /* .i.M.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ....... */ +}; + +/* Frame (107 bytes) */ +static const unsigned char pkt8[107] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x5d, 0x13, 0xc0, 0x00, 0x00, 0xff, 0x11, /* .]...... */ +0x06, 0x28, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .(...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x49, /* .......I */ +0x79, 0x60, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* y`...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0xc0, 0x23 /* p.# */ +}; + +MDNS_RR_DATA mdns_rr_data[] = { + {"Simple Web Server", "_http._tcp", "local"}, +}; + +MDNS_TEST_SEQ mdns_client_passive[] = { + {TITLE, "Client passive", 14, 0}, + + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 0, 0}, + {INJECT, (char*)&pkt4[0], sizeof(pkt4), 0}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 6, 0}, + {MDNS_CHECK_RR_DATA, (char*)mdns_rr_data, 1, 0}, + {INJECT, (char*)&pkt5[0], sizeof(pkt5), 0}, + {INJECT, (char*)&pkt6[0], sizeof(pkt6), 0}, + {MDNS_CHECK_RR_DATA, (char*)mdns_rr_data, 1, 0}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 6, 0}, + {INJECT, (char*)&pkt7[0], sizeof(pkt7), 0}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 6, 0}, + {WAIT, NX_NULL, 0, 1}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 2, 0}, + {INJECT, (char*)&pkt8[0], sizeof(pkt8), 0}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 3, 0}, +}; + +int mdns_client_passive_size = sizeof(mdns_client_passive) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_continuous_query_interval_test.c b/test/regression/mdns_test/mdns_continuous_query_interval_test.c new file mode 100644 index 00000000..220b2fbe --- /dev/null +++ b/test/regression/mdns_test/mdns_continuous_query_interval_test.c @@ -0,0 +1,174 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x7e, 0xd1, 0x00, 0x00, 0xff, 0x11, /* ..~..... */ +0x9a, 0xe8, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt4[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt5[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x8d, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt6[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x85, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_continuous_query_interval[] = { + {TITLE, "Continuous query interval", 25, 0}, + + /* Waiting for probing and announcing. */ + {WAIT, NX_NULL, 0, 5}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Check the first query. */ + /* Interval between 20-120ms. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 5, 7}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check query with known answer. */ + /* The first two queries MUST be at least one second. */ + /* Interval 1s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 3, 100}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Interval 2s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt3), 2}, + {MDNS_TIMER_CHECK, NX_NULL, 3, 200}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Interval 4s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt3), 4}, + {MDNS_TIMER_CHECK, NX_NULL, 3, 400}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Interval 8s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt3), 8}, + {MDNS_TIMER_CHECK, NX_NULL, 3, 800}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, +}; + +int mdns_continuous_query_interval_size = sizeof(mdns_continuous_query_interval) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_continuous_query_test.c b/test/regression/mdns_test/mdns_continuous_query_test.c new file mode 100644 index 00000000..a981f089 --- /dev/null +++ b/test/regression/mdns_test/mdns_continuous_query_test.c @@ -0,0 +1,150 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x7e, 0xd1, 0x00, 0x00, 0xff, 0x11, /* ..~..... */ +0x9a, 0xe8, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt4[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt5[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x8d, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt6[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x85, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_continuous_query[] = { + {TITLE, "Continuous query", 16, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check query. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Inject response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check query with known answer. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt3), 2}, + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt3), 4}, + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt3), 8}, +}; + +int mdns_continuous_query_size = sizeof(mdns_continuous_query) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_continuous_query_unique_answer_test.c b/test/regression/mdns_test/mdns_continuous_query_unique_answer_test.c new file mode 100644 index 00000000..4e72ce74 --- /dev/null +++ b/test/regression/mdns_test/mdns_continuous_query_unique_answer_test.c @@ -0,0 +1,84 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (85 bytes) */ +static const unsigned char pkt1[85] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x47, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .G..@... */ +0x90, 0x61, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .a...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x33, /* .......3 */ +0xd8, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01 /* ..... */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0xff, 0x17, 0x8d, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x01, 0x51, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .Q...l.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x67, 0xea, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* g....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, /* x....... */ +0xbd, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ +0x2d, 0x50, 0x43, 0xc0, 0x20, 0xc0, 0x0c, 0x00, /* -PC. ... */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x23, 0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, /* #.netbio */ +0x73, 0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, /* s=CHENBO */ +0x2d, 0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, /* -PC.doma */ +0x69, 0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, /* in=WORKG */ +0x52, 0x4f, 0x55, 0x50, 0xc0, 0x37, 0x00, 0x01, /* ROUP.7.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6c, 0xc0, 0x37, 0x00, 0x1c, /* ...l.7.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, /* .......1 */ +0xc0, 0x37, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* .7...... */ +0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, /* .....YDy */ +0xe1, 0x0a, 0xd7, 0xf4, 0xc0, 0x37, 0x00, 0x2f, /* .....7./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x37, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, /* .7..@... */ +0xc0, 0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .../.... */ +0x00, 0x78, 0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, /* .x...... */ +0x00, 0x00, 0x80, 0x00, 0x40 /* ....@ */ +}; + +static MDNS_QUERY_INFO mdns_query = {"Chenbo-PC", "_smb._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_continuous_query_unique_answer[] = { + {TITLE, "Continuous query unique answer", 30, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* No more queries are expected. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 2}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + + /* Since we have known a unique answer, no more queries are expected. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 2}, +}; + +int mdns_continuous_query_unique_answer_size = sizeof(mdns_continuous_query_unique_answer) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_dns_sd_query_test.c b/test/regression/mdns_test/mdns_dns_sd_query_test.c new file mode 100644 index 00000000..eb0f0c7f --- /dev/null +++ b/test/regression/mdns_test/mdns_dns_sd_query_test.c @@ -0,0 +1,386 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "netx_mdns_test.h" + +/* Frame (88 bytes) */ +static const unsigned char pkt1[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x4a, 0x58, 0x5c, 0x00, 0x00, 0xff, 0x11, /* .JX\.... */ +0xc1, 0x3e, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .>...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xa2, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt2[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4a, 0x02, 0xe1, 0x00, 0x00, 0xff, 0x11, /* .J...... */ +0xcd, 0xc4, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xb4, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt3[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0x5c, 0x1e, 0xf3, 0x00, 0x00, 0xff, 0x11, /* .\...... */ +0xfa, 0x92, 0xc0, 0xa8, 0x00, 0x67, 0xe0, 0x00, /* .....g.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x0a, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (114 bytes) */ +static const unsigned char pkt4[114] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ +0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ +0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (160 bytes) */ +static const unsigned char pkt5[160] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x92, 0x17, 0x39, 0x00, 0x00, 0xff, 0x11, /* ...9.... */ +0x02, 0x7a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .z...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ +0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ +0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ +}; + +/* Frame (219 bytes) */ +static const unsigned char pkt6[219] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0xcd, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x23, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .#...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb9, /* ........ */ +0x69, 0x6d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* im...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .#...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x65, 0xc0, 0x41, 0xc0, /* teste.A. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x64, 0xc0, 0x41, 0xc0, 0x0c, 0x00, 0x0c, /* td.A.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, /* ._testc. */ +0x41, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* A....... */ +0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x62, 0xc0, 0x41, 0xc0, 0x0c, /* estb.A.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x61, 0xc0, 0x41 /* a.A */ +}; + +/* Frame (212 bytes) */ +static const unsigned char pkt7[212] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0xc6, 0x58, 0x8e, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ +0xc0, 0x90, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ +0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x93, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ +0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x0f, /* ........ */ +0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ +0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ +0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ +0x00, 0x11, 0x94, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ +0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0xc0, 0x3f /* tp.? */ +}; + +/* Frame (225 bytes) */ +static const unsigned char pkt8[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xd3, 0x02, 0xe2, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xcd, 0x3a, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .:...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x1b, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .:...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ +0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ +0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ +0x47 /* G */ +}; + +/* Frame (212 bytes) */ +static const unsigned char pkt9[212] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0xc6, 0x58, 0xcf, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ +0xc0, 0x4f, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .O...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ +0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x90, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ +0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x12, 0x0f, /* ........ */ +0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ +0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ +0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ +0x00, 0x11, 0x91, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ +0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0xc0, 0x3f /* tp.? */ +}; + +/* Frame (225 bytes) */ +static const unsigned char pkt10[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xd3, 0x02, 0xe3, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xcd, 0x39, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .9...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x21, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* !F...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ +0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ +0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ +0x47 /* G */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt11[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x59, 0x32, 0x00, 0x00, 0xff, 0x11, /* .ZY2.... */ +0xbf, 0x58, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .X...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0xa3, 0x5f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ._...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x64, 0x03, 0x31, 0x30, 0x30, /* ...d.100 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (136 bytes) */ +static const unsigned char pkt12[136] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7a, 0x02, 0xe4, 0x00, 0x00, 0xff, 0x11, /* .z...... */ +0xcd, 0x91, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x66, /* .......f */ +0x82, 0x29, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .)...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x02, 0x01, 0x32, 0x01, 0x30, /* .....2.0 */ +0x01, 0x30, 0x02, 0x31, 0x30, 0x07, 0x69, 0x6e, /* .0.10.in */ +0x2d, 0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, /* -addr.ar */ +0x70, 0x61, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* pa...... */ +0x00, 0x00, 0x78, 0x00, 0x02, 0xc0, 0x0c, 0xc0, /* ..x..... */ +0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x05, 0xc0, 0x0c, 0x00, 0x01, 0x40 /* x......@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt13[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x59, 0xc5, 0x00, 0x00, 0xff, 0x11, /* .EY..... */ +0xbf, 0xda, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt14[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x02, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0xcd, 0xc5, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0x95, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .L...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, NX_NULL, NX_NULL}; + +MDNS_TEST_SEQ mdns_dns_sd_query[] = { + {TITLE, "DNS-SD query", 12, 0}, + + /* Wait 5 seconds. */ + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Add query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check query. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 3}, + + /* Inject response. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + {INJECT, (char*)&pkt4[0], sizeof(pkt4), 0}, + {INJECT, (char*)&pkt5[0], sizeof(pkt5), 0}, + {INJECT, (char*)&pkt6[0], sizeof(pkt6), 0}, + + /* Check RR count. */ + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 10, 0}, +}; + +int mdns_dns_sd_query_size = sizeof(mdns_dns_sd_query) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_dns_sd_response_test.c b/test/regression/mdns_test/mdns_dns_sd_response_test.c new file mode 100644 index 00000000..6688e6eb --- /dev/null +++ b/test/regression/mdns_test/mdns_dns_sd_response_test.c @@ -0,0 +1,381 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (88 bytes) */ +static const unsigned char pkt1[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x4a, 0x58, 0x5c, 0x00, 0x00, 0xff, 0x11, /* .JX\.... */ +0xc1, 0x3e, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .>...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xa2, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt2[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4a, 0x02, 0xe1, 0x00, 0x00, 0xff, 0x11, /* .J...... */ +0xcd, 0xc4, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xb4, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt3[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0x5c, 0x1e, 0xf3, 0x00, 0x00, 0xff, 0x11, /* .\...... */ +0xfa, 0x92, 0xc0, 0xa8, 0x00, 0x67, 0xe0, 0x00, /* .....g.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x0a, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (114 bytes) */ +static const unsigned char pkt4[114] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ +0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ +0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (160 bytes) */ +static const unsigned char pkt5[160] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x92, 0x17, 0x39, 0x00, 0x00, 0xff, 0x11, /* ...9.... */ +0x02, 0x7a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .z...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ +0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ +0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ +}; + +/* Frame (219 bytes) */ +static const unsigned char pkt6[219] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0xcd, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x23, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .#...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb9, /* ........ */ +0x69, 0x6d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* im...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .#...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x65, 0xc0, 0x41, 0xc0, /* teste.A. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x64, 0xc0, 0x41, 0xc0, 0x0c, 0x00, 0x0c, /* td.A.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, /* ._testc. */ +0x41, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* A....... */ +0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x62, 0xc0, 0x41, 0xc0, 0x0c, /* estb.A.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x61, 0xc0, 0x41 /* a.A */ +}; + +/* Frame (212 bytes) */ +static const unsigned char pkt7[212] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0xc6, 0x58, 0x8e, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ +0xc0, 0x90, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ +0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x93, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ +0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x0f, /* ........ */ +0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ +0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ +0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ +0x00, 0x11, 0x94, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ +0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0xc0, 0x3f /* tp.? */ +}; + +/* Frame (225 bytes) */ +static const unsigned char pkt8[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xd3, 0x02, 0xe2, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xcd, 0x3a, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .:...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x1b, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .:...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ +0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ +0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ +0x47 /* G */ +}; + +/* Frame (212 bytes) */ +static const unsigned char pkt9[212] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0xc6, 0x58, 0xcf, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ +0xc0, 0x4f, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .O...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ +0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x90, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ +0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x12, 0x0f, /* ........ */ +0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ +0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ +0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ +0x00, 0x11, 0x91, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ +0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0xc0, 0x3f /* tp.? */ +}; + +/* Frame (225 bytes) */ +static const unsigned char pkt10[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xd3, 0x02, 0xe3, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xcd, 0x39, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .9...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x21, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* !F...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ +0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ +0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ +0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ +0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ +0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ +0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x09, /* ........ */ +0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ +0x47 /* G */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt11[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x59, 0x32, 0x00, 0x00, 0xff, 0x11, /* .ZY2.... */ +0xbf, 0x58, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .X...d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0xa3, 0x5f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ._...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x64, 0x03, 0x31, 0x30, 0x30, /* ...d.100 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (136 bytes) */ +static const unsigned char pkt12[136] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7a, 0x02, 0xe4, 0x00, 0x00, 0xff, 0x11, /* .z...... */ +0xcd, 0x91, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x66, /* .......f */ +0x82, 0x29, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .)...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x02, 0x01, 0x32, 0x01, 0x30, /* .....2.0 */ +0x01, 0x30, 0x02, 0x31, 0x30, 0x07, 0x69, 0x6e, /* .0.10.in */ +0x2d, 0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, /* -addr.ar */ +0x70, 0x61, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* pa...... */ +0x00, 0x00, 0x78, 0x00, 0x02, 0xc0, 0x0c, 0xc0, /* ..x..... */ +0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x05, 0xc0, 0x0c, 0x00, 0x01, 0x40 /* x......@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt13[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x59, 0xc5, 0x00, 0x00, 0xff, 0x11, /* .EY..... */ +0xbf, 0xda, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt14[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x02, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0xcd, 0xc5, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0x95, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .L...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +static MDNS_SERVICE mdns_service = {"Simple Web Server", "_workstation._tcp", NX_NULL, "paper=A4;version=01", 4500, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_dns_sd_response[] = { + {TITLE, "DNS-SD response", 15, 0}, + + /* Add service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* Wait 5 seconds. */ + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, +}; + +int mdns_dns_sd_response_size = sizeof(mdns_dns_sd_response) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_duplicate_answer_suppression_test.c b/test/regression/mdns_test/mdns_duplicate_answer_suppression_test.c new file mode 100644 index 00000000..78cb7bd4 --- /dev/null +++ b/test/regression/mdns_test/mdns_duplicate_answer_suppression_test.c @@ -0,0 +1,96 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x01, 0x81, 0x00, 0x00, 0xff, 0x11, /* .=...... */ +0x11, 0x81, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (110 bytes) */ +static const unsigned char pkt2[110] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x60, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .g..@... */ +0x90, 0x47, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .@...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......S */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .9...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local... */ +}; + +/* Frame (110 bytes) */ +static const unsigned char pkt3[110] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x60, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .g..@... */ +0x90, 0x47, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .@...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......S */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .9...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local... */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_ipp._tcp", NX_NULL, NX_NULL, 4500, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_duplicate_answer_suppression[] = { + {TITLE, "Duplicate answer suppression", 28, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject query. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Check response. */ + {MDNS_CHECK_ANY_V4, NX_NULL, MDNS_FLAG_RESPONSE, 1}, + + {WAIT, NX_NULL, 0, 3}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject query and response. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* No response should be received. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_RESPONSE, 1}, + + {WAIT, NX_NULL, 0, 3}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject query and response. The TTL in response is 100 which is less than 101. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* Expect a response. */ + {MDNS_CHECK_ANY_V4, NX_NULL, MDNS_FLAG_RESPONSE, 1} +}; + +int mdns_duplicate_answer_suppression_size = sizeof(mdns_duplicate_answer_suppression) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_duplicate_question_suppression_test.c b/test/regression/mdns_test/mdns_duplicate_question_suppression_test.c new file mode 100644 index 00000000..232fa983 --- /dev/null +++ b/test/regression/mdns_test/mdns_duplicate_question_suppression_test.c @@ -0,0 +1,251 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt2[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt2_1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xac, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x80, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt3[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc0, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt4[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xbf, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt5[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0xe6, 0x7f, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x33, 0x3a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* 3:...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt6[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + + +/* Frame (135 bytes) */ +static const unsigned char pkt7[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + + +/* Frame (135 bytes) */ +static const unsigned char pkt8[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + + +/* Frame (76 bytes) */ +static const unsigned char pkt9[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + + +/* Frame (135 bytes) */ +static const unsigned char pkt10[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x81, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1,...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x78, 0x00, 0x1f, /* .....x.. */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_duplicate_question_suppression[] = { + {TITLE, "Duplicate question suppression", 30, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check query. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Inject a duplicate question. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* The query after 1 seconds should not be sent. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + + /* Inject a duplicate question with QU set. It doesn't affact the query. */ + {INJECT, (char*)&pkt2_1[0], sizeof(pkt2_1), 0}, + + /* Inject a duplicate question with known answer. */ + /* It should not affect queriy. */ + {INJECT, (char*)&pkt7[0], sizeof(pkt7), 0}, + + /* Interval 2s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 2}, + + /* Inject response. */ + {INJECT, (char*)&pkt5[0], sizeof(pkt5), 0}, + + /* Check query with known answer. */ + /* Interval 4s. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt6[0], sizeof(pkt6), 3}, + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt6), 1}, + + /* Inject a duplicate question. */ + {INJECT, (char*)&pkt9[0], sizeof(pkt9), 0}, + + /* Check query with known answer. */ + /* Interval 8s. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 7}, + {MDNS_CHECK_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 1}, +}; + +int mdns_duplicate_question_suppression_size = sizeof(mdns_duplicate_question_suppression) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_known_answer_ignored_test.c b/test/regression/mdns_test/mdns_known_answer_ignored_test.c new file mode 100644 index 00000000..7c4c807b --- /dev/null +++ b/test/regression/mdns_test/mdns_known_answer_ignored_test.c @@ -0,0 +1,193 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt2[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt3[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt4[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt5[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt6[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt7[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt8[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +MDNS_TEST_SEQ mdns_known_answer_ignored[] = { + {TITLE, "Known answer ignored", 20, 0}, + + /* Inject the query with known answer. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* No RR should be stored. */ + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 0, 0} +}; + +int mdns_known_answer_ignored_size = sizeof(mdns_known_answer_ignored) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_known_answer_suppression_query_half_ttl_test.c b/test/regression/mdns_test/mdns_known_answer_suppression_query_half_ttl_test.c new file mode 100644 index 00000000..9feec32c --- /dev/null +++ b/test/regression/mdns_test/mdns_known_answer_suppression_query_half_ttl_test.c @@ -0,0 +1,201 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt2[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt3[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt4[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt5[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (108 bytes) */ +static const unsigned char pkt6[108] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ +0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ +0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ +0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0xc0, 0x0c /* er.. */ +}; + +/* Frame (76 bytes) */ +static const unsigned char pkt7[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (255 bytes) */ +static const unsigned char pkt8[255] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_known_answer_suppression_query_half_ttl[] = { + {TITLE, "Known answer suppression query half TTL", 39, 0}, + + /* Add a query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check the query. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Inject the response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check the query that past half TTL. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 32}, +}; + +int mdns_known_answer_suppression_query_half_ttl_size = sizeof(mdns_known_answer_suppression_query_half_ttl) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_known_answer_suppression_query_test.c b/test/regression/mdns_test/mdns_known_answer_suppression_query_test.c new file mode 100644 index 00000000..922c7bfd --- /dev/null +++ b/test/regression/mdns_test/mdns_known_answer_suppression_query_test.c @@ -0,0 +1,139 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x87, 0x82, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0x92, 0x37, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .7...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt4[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x92, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt5[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_known_answer_suppression_query[] = { + {TITLE, "Known answer suppression query", 30, 0}, + + /* Add a query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check the query. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Inject the response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check the query with known answer. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 2}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + + /* Add a query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* Check the query with known answer. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, +}; + +int mdns_known_answer_suppression_query_size = sizeof(mdns_known_answer_suppression_query) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_known_answer_suppression_response_test.c b/test/regression/mdns_test/mdns_known_answer_suppression_response_test.c new file mode 100644 index 00000000..8dc9209f --- /dev/null +++ b/test/regression/mdns_test/mdns_known_answer_suppression_response_test.c @@ -0,0 +1,145 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x01, 0x81, 0x00, 0x00, 0xff, 0x11, /* .=...... */ +0x11, 0x81, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (373 bytes) */ +static const unsigned char pkt2[373] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x67, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .g..@... */ +0x8f, 0x40, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .@...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x53, /* .......S */ +0xf4, 0x39, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .9...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x24, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* $.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40 /* ....@ */ +}; + +/* Frame (101 bytes) */ +static const unsigned char pkt3[101] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x57, 0x01, 0x82, 0x00, 0x00, 0xff, 0x11, /* .W...... */ +0x11, 0x66, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .f...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ +0x10, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ +}; + +/* Frame (101 bytes) */ +static const unsigned char pkt4[101] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x57, 0x01, 0x82, 0x00, 0x00, 0xff, 0x11, /* .W...... */ +0x11, 0x66, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .f...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x0e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_known_answer_suppression_response[] = { + {TITLE, "Known answer suppression response", 33, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Queries with known answer. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* No responses are expected. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + + /* Query only. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Check response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 2}, + + /* Queries with known answer. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* No responses are expected. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + + /* Queries with known answer. The TTL is less than half of the local RR. */ + {INJECT, (char*)&pkt4[0], sizeof(pkt4), 0}, + + /* Expect a response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 2}, +}; + +int mdns_known_answer_suppression_response_size = sizeof(mdns_known_answer_suppression_response) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_known_answer_suppression_unique_test.c b/test/regression/mdns_test/mdns_known_answer_suppression_unique_test.c new file mode 100644 index 00000000..0899e05e --- /dev/null +++ b/test/regression/mdns_test/mdns_known_answer_suppression_unique_test.c @@ -0,0 +1,55 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (171 bytes) */ +static const unsigned char pkt1[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x9d, 0x1e, 0x02, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xf4, 0x9f, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ +0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ +0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + +static MDNS_QUERY_INFO mdns_query = {"test", "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_known_answer_suppression_unique[] = { + {TITLE, "Known answer suppression unique", 31, 0}, + + /* Waiting for host name probing and announcing. */ + {WAIT, NX_NULL, 0, 5}, + + /* Inject one service. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + {DUMP, NX_NULL, 0, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + + /* No queries are expected. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 2}, +}; + +int mdns_known_answer_suppression_unique_size = sizeof(mdns_known_answer_suppression_unique) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_multiple_questions_per_query_test.c b/test/regression/mdns_test/mdns_multiple_questions_per_query_test.c new file mode 100644 index 00000000..d8116d6d --- /dev/null +++ b/test/regression/mdns_test/mdns_multiple_questions_per_query_test.c @@ -0,0 +1,41 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (103 bytes) */ +static const unsigned char pkt1[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ +0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ +0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ +0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ +}; + +static MDNS_QUERY_INFO mdns_query1 = {NX_NULL, "_test1._tcp", NX_NULL}; +static MDNS_QUERY_INFO mdns_query2 = {NX_NULL, "_test2._tcp", NX_NULL}; +static MDNS_QUERY_INFO mdns_query3 = {NX_NULL, "_test3._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_multiple_questions_per_query[] = { + {TITLE, "Multiple questions per query", 28, 0}, + + {MDNS_QUERY, (char*)&mdns_query1, 0, 0}, + {MDNS_QUERY, (char*)&mdns_query2, 0, 0}, + {MDNS_QUERY, (char*)&mdns_query3, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 2}, +}; + +int mdns_multiple_questions_per_query_size = sizeof(mdns_multiple_questions_per_query) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_poof_test.c b/test/regression/mdns_test/mdns_poof_test.c new file mode 100644 index 00000000..90986d05 --- /dev/null +++ b/test/regression/mdns_test/mdns_poof_test.c @@ -0,0 +1,103 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xa1, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x01, 0x2a, 0x00, 0x00, 0xff, 0x11, /* ...*.... */ +0x18, 0x90, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (103 bytes) */ +static const unsigned char pkt3[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0xd9, 0x86, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0x48, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* HP...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x0c /* 4500w.. */ +}; + +/* Frame (103 bytes) */ +static const unsigned char pkt4[103] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ +0xd9, 0x86, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ +0x48, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* HP...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x0c /* 4500w.. */ +}; + +MDNS_TEST_SEQ mdns_poof[] = { + {TITLE, "Passive observation of failures", 31, 0}, + + /* Inject a response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* 4 RRs are received. */ + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 4, 0}, + + /* Inject two queries. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Wait more than 10 seconds. */ + {WAIT, NX_NULL, 0, 11}, + + /* Check whether the RR is deleted. */ + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 3, 0}, +}; + +int mdns_poof_size = sizeof(mdns_poof) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_probing_conflict_test.c b/test/regression/mdns_test/mdns_probing_conflict_test.c new file mode 100644 index 00000000..31aa883e --- /dev/null +++ b/test/regression/mdns_test/mdns_probing_conflict_test.c @@ -0,0 +1,321 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (225 bytes) */ +static const unsigned char pkt1[225] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xd3, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd5, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ +0x13, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .w...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0xff, 0x00, 0x01, 0x0f, 0x53, 0x69, 0x6d, /* .....Sim */ +0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x53, 0x65, /* pleWebSe */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0f, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x14, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31 /* 1 */ +}; + +/* Frame (235 bytes) */ +static const unsigned char pkt2[235] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbc, 0x39, 0x02, 0x08, 0x00, 0x45, 0x00, /* /.9...E. */ +0x00, 0xdd, 0x05, 0x71, 0x00, 0x00, 0xff, 0x11, /* ...q.... */ +0xca, 0xa2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc9, /* ........ */ +0x3d, 0x40, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* =@...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x0f, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ +0x50, 0x43, 0xc0, 0x27, 0xc0, 0x0c, 0x00, 0x10, /* PC.'.... */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, /* ........ */ +0x09, 0x5b, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* .[paper= */ +0x41, 0x34, 0x0b, 0x56, 0x65, 0x72, 0x73, 0x69, /* A4.Versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x5d, 0xc0, 0x3e, /* on=01].> */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x01, 0xc0, 0x3e, /* .......> */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xc0, 0x93, 0x9d, 0xaa, 0xda, 0xe3, /* ........ */ +0xea, 0xba, 0xc0, 0x3e, 0x00, 0x2f, 0x80, 0x01, /* ...>./.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0xc0, 0x3e, /* ...x...> */ +0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0xc0, 0x0c, /* ..@..... */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt3[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xdf, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc8, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ +0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ +0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt4[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xdf, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ +0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ +0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (237 bytes) */ +static const unsigned char pkt5[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xdf, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ +0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ +0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ +0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ +0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (261 bytes) */ +static const unsigned char pkt6[261] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xf7, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ +0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +/* Frame (261 bytes) */ +static const unsigned char pkt7[261] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xf7, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xac, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ +0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +/* Frame (261 bytes) */ +static const unsigned char pkt8[261] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0xf7, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xab, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ +0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ +0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ +0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ +0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + + +static MDNS_SERVICE mdns_service = {"SimpleWebServer", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_probing_conflict[] = { + {TITLE, "Probing conflict", 16, 0}, + + /* Wait 5 seconds. */ + {WAIT, NX_NULL, 0, 5}, + + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* Wait the first probing. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Inject response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Expect probing with other name. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + + /* Set callback state. */ + {MDNS_SET_PROBING_CALLBACK_STATE, NX_NULL, NX_MDNS_LOCAL_SERVICE_REGISTERED_SUCCESS, 0}, + + /* Wait 3 seconds. */ + {WAIT, NX_NULL, 0, 3}, + + /* Check callback invoked. */ + {MDNS_CHECK_PROBING_CALLBACK_INVOKED, NX_NULL, 0, 1}, +}; + +int mdns_probing_conflict_size = sizeof(mdns_probing_conflict) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_and_response_chaos_test.c b/test/regression/mdns_test/mdns_query_and_response_chaos_test.c new file mode 100644 index 00000000..002d7561 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_and_response_chaos_test.c @@ -0,0 +1,2113 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (83 bytes) */ +static const unsigned char pkt1[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x44, 0x8b, 0x00, 0x00, 0xff, 0x11, /* .ED..... */ +0xd5, 0x0e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt2[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x11, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xe9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt3[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x90, 0x44, 0x8c, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ +0xd4, 0xc2, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0xa7, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x80, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x80, 0x01, /* ........ */ +0xc0, 0x0c, 0x00, 0xff, 0x80, 0x01, 0xc0, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt4[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x0a, 0x12, 0x00, 0x00, 0xff, 0x11, /* .L...... */ +0x08, 0xe1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x9b, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .p...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x80, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt5[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x90, 0x44, 0x8d, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ +0xd4, 0xc1, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0x27, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* '0...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, /* ........ */ +0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt6[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x0a, 0x13, 0x00, 0x00, 0xff, 0x11, /* .L...... */ +0x08, 0xe0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (158 bytes) */ +static const unsigned char pkt7[158] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x90, 0x44, 0x91, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ +0xd4, 0xbd, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ +0x27, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* '0...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, /* ........ */ +0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ +0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ +}; + +/* Frame (90 bytes) */ +static const unsigned char pkt8[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4c, 0x0a, 0x14, 0x00, 0x00, 0xff, 0x11, /* .L...... */ +0x08, 0xdf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ +0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x07, 0x0a /* .. */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt9[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x44, 0x93, 0x00, 0x00, 0xff, 0x11, /* .ZD..... */ +0xd3, 0xf1, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt10[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x15, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xac, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt11[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x44, 0x95, 0x00, 0x00, 0xff, 0x11, /* .ED..... */ +0xd5, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt12[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x16, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xe4, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt13[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x44, 0xab, 0x00, 0x00, 0xff, 0x11, /* .ZD..... */ +0xd3, 0xd9, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt14[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x17, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xaa, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt15[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x45, 0x28, 0x00, 0x00, 0xff, 0x11, /* .ZE(.... */ +0xd3, 0x5c, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .\...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt16[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x18, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xa9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt17[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x45, 0x29, 0x00, 0x00, 0xff, 0x11, /* .EE).... */ +0xd4, 0x70, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .p...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt18[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x19, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xe1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt19[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x45, 0x51, 0x00, 0x00, 0xff, 0x11, /* .ZEQ.... */ +0xd3, 0x33, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .3...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt20[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x1a, 0x00, 0x00, 0xff, 0x11, /* .~...... */ +0x08, 0xa7, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt21[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x45, 0x45, 0x75, 0x00, 0x00, 0xff, 0x11, /* .EEu.... */ +0xd4, 0x24, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .$...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (83 bytes) */ +static const unsigned char pkt22[83] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x45, 0x0a, 0x1b, 0x00, 0x00, 0xff, 0x11, /* .E...... */ +0x08, 0xdf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ +0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ +0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt23[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x4a, 0x45, 0x7a, 0x00, 0x00, 0xff, 0x11, /* .JEz.... */ +0xd4, 0x1a, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xfd, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (88 bytes) */ +static const unsigned char pkt24[88] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x4a, 0x0a, 0x1c, 0x00, 0x00, 0xff, 0x11, /* .J...... */ +0x08, 0xd9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ +0xf6, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt25[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x00, 0x5c, 0x78, 0x77, 0x00, 0x00, 0xff, 0x11, /* .\xw.... */ +0xa1, 0x09, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .....l.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x0a, 0xe9, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (114 bytes) */ +static const unsigned char pkt26[114] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ +0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ +0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0xc0, 0x23 /* .# */ +}; + +/* Frame (113 bytes) */ +static const unsigned char pkt27[113] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x63, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .c..@... */ +0xd9, 0xd1, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4f, /* .......O */ +0x64, 0xfc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* d....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x13, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, /* sh._tcp. */ +0x23 /* # */ +}; + +/* Frame (126 bytes) */ +static const unsigned char pkt28[126] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x70, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .p..@... */ +0xd9, 0xc3, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5c, /* .......\ */ +0x3e, 0x43, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* >C...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* p.#..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ +0x5f, 0x72, 0x66, 0x62, 0xc0, 0x3a /* _rfb.: */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt29[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x50, 0x45, 0x7e, 0x00, 0x00, 0xff, 0x11, /* .PE~.... */ +0xd4, 0x10, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x60, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* `....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0c, 0x5f, 0x77, 0x6f, 0x72, /* ...._wor */ +0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* kstation */ +0xc0, 0x11, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt30[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x50, 0x0a, 0x1d, 0x00, 0x00, 0xff, 0x11, /* .P...... */ +0x08, 0xd2, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x5a, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ZA...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0c, 0x5f, 0x77, 0x6f, 0x72, /* ...._wor */ +0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* kstation */ +0xc0, 0x11, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (332 bytes) */ +static const unsigned char pkt31[332] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x01, 0x3e, 0x78, 0x7d, 0x00, 0x00, 0xff, 0x11, /* .>x}.... */ +0xa0, 0x21, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .!...l.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */ +0x4f, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* O....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ +0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */ +0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */ +0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */ +0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */ +0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */ +0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ +0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */ +0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */ +0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */ +0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */ +0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */ +0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x6c, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..l.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x.. */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */ +0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */ +0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */ +0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */ +0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */ +0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */ +0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */ +0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */ +0x40, 0x00, 0x00, 0x08 /* @... */ +}; + +/* Frame (242 bytes) */ +static const unsigned char pkt32[242] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ +0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ +0x00, 0xe4, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x62, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* .b...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xd0, /* ........ */ +0xa0, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, /* 1.server */ +0x2d, 0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, /* -HP-Z210 */ +0x2d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, /* -Worksta */ +0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, /* tion [e8 */ +0x3a, 0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, /* :39:35:4 */ +0x34, 0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, /* 4:fe:d4] */ +0xc0, 0x0c, 0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, /* .../.... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, /* ........ */ +0x2f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* /.!..... */ +0x78, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, /* x.#..... */ +0x09, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, /* ..server */ +0x2d, 0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, /* -HP-Z210 */ +0x2d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, /* -Worksta */ +0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x1e, 0xc0, 0x7f, /* tion.... */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xea, 0x39, 0x35, 0xff, 0xfe, 0x44, /* ...95..D */ +0xfe, 0xd4, 0xc0, 0x7f, 0x00, 0x01, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x02 /* .. */ +}; + +/* Frame (228 bytes) */ +static const unsigned char pkt33[228] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xd6, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x5e, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* .^...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc2, /* ........ */ +0x8a, 0x5a, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .Z...... */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x2a, 0x27, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* *'catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, 0x61, /* -3010 [a */ +0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, /* 4:1f:72: */ +0x35, 0x33, 0x3a, 0x39, 0x62, 0x3a, 0x63, 0x36, /* 53:9b:c6 */ +0x5d, 0xc0, 0x0c, 0xc0, 0x2f, 0x00, 0x10, 0x80, /* ].../... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x2f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* ./.!.... */ +0x00, 0x78, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x09, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x1e, /* x-3010.. */ +0xc0, 0x78, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* .x...... */ +0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ +0x00, 0x00, 0x00, 0x00, 0xa6, 0x1f, 0x72, 0xff, /* ......r. */ +0xfe, 0x53, 0x9b, 0xc6, 0xc0, 0x78, 0x00, 0x01, /* .S...x.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x14 /* .... */ +}; + +/* Frame (206 bytes) */ +static const unsigned char pkt34[206] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xc0, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x75, 0xc0, 0xa8, 0x00, 0x13, 0xe0, 0x00, /* .u...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xac, /* ........ */ +0x17, 0x94, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, /* EL [a4:1 */ +0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, /* f:72:53: */ +0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, 0x0c, /* a0:f7].. */ +0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ./...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, /* ....../. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x08, /* ........ */ +0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x45, 0x4c, /* catro-EL */ +0xc0, 0x1e, 0xc0, 0x6d, 0x00, 0x1c, 0x80, 0x01, /* ...m.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, 0x01, /* ...x.. . */ +0x0d, 0xa8, 0x80, 0x08, 0x01, 0x27, 0x02, 0x0c, /* .....'.. */ +0x29, 0xff, 0xfe, 0xe5, 0x16, 0x93, 0xc0, 0x6d, /* )......m */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x13 /* ...... */ +}; + +/* Frame (160 bytes) */ +static const unsigned char pkt35[160] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x92, 0x67, 0xcc, 0x00, 0x00, 0xff, 0x11, /* ..g..... */ +0xb1, 0xe6, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ +0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ +0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ +}; + +/* Frame (222 bytes) */ +static const unsigned char pkt36[222] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xd0, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x63, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* .c...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbc, /* ........ */ +0x27, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* '....... */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x27, 0x24, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* '$dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, /* 10 [a4:1 */ +0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, /* f:72:53: */ +0x39, 0x32, 0x3a, 0x61, 0x36, 0x5d, 0xc0, 0x0c, /* 92:a6].. */ +0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ./...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, /* ....../. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x10, /* ........ */ +0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* dc-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0xc0, 0x1e, 0xc0, 0x75, 0x00, 0x1c, 0x80, 0x01, /* ...u.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1f, /* ........ */ +0x72, 0xff, 0xfe, 0x53, 0x92, 0xa6, 0xc0, 0x75, /* r..S...u */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x00, 0x15 /* ...... */ +}; + +/* Frame (202 bytes) */ +static const unsigned char pkt37[202] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x6a, 0x2e, 0x7a, 0x08, 0x00, 0x45, 0x00, /* )j.z..E. */ +0x00, 0xbc, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x11, 0xc0, 0xa8, 0x00, 0x7b, 0xe0, 0x00, /* .....{.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xa8, /* ........ */ +0x1d, 0xc5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ +0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ +0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ +0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x2f, /* :7a].../ */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, 0x21, 0x80, /* ..../.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x09, 0x06, 0x75, 0x62, /* ......ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x1e, 0xc0, 0x6b, /* untu...k */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x6a, /* ....)..j */ +0x2e, 0x7a, 0xc0, 0x6b, 0x00, 0x01, 0x80, 0x01, /* .z.k.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x7b /* .{ */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt38[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x50, 0x45, 0x81, 0x00, 0x00, 0xff, 0x11, /* .PE..... */ +0xd4, 0x0d, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x75, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* u....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x18, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt39[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x50, 0x0a, 0x1e, 0x00, 0x00, 0xff, 0x11, /* .P...... */ +0x08, 0xd1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0x6f, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* o^...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x18, 0x00, 0x0c, 0x00, 0x01 /* ...... */ +}; + +/* Frame (163 bytes) */ +static const unsigned char pkt40[163] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x95, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x9f, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x81, /* ........ */ +0xd2, 0x1f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, /* ........ */ +0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, /* .catro-O */ +0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, /* ptiPlex- */ +0x33, 0x30, 0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x2e, /* 3010.... */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc0, 0x2e, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1c, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x16, 0x13, 0x63, 0x61, /* ......ca */ +0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x1d /* 0.. */ +}; + +/* Frame (141 bytes) */ +static const unsigned char pkt41[141] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x7f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0xb6, 0xc0, 0xa8, 0x00, 0x13, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6b, /* .......k */ +0x96, 0xe5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ +0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x45, /* .catro-E */ +0x4c, 0xc0, 0x0c, 0xc0, 0x2e, 0x00, 0x10, 0x80, /* L....... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x2e, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* ...!.... */ +0x00, 0x78, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x16, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0xc0, 0x1d /* -EL.. */ +}; + +/* Frame (250 bytes) */ +static const unsigned char pkt42[250] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0xec, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x47, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* .G...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xd8, /* ........ */ +0x88, 0xc6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, /* 10...(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..(.!... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x16, 0xa8, 0x10, 0x64, 0x63, 0x2d, 0x4f, /* ....dc-O */ +0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, /* ptiPlex- */ +0x33, 0x30, 0x31, 0x30, 0xc0, 0x17, 0x0b, 0x5f, /* 3010..._ */ +0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ +0x73, 0x68, 0xc0, 0x12, 0x00, 0x0c, 0x00, 0x01, /* sh...... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x13, 0x10, 0x64, /* .......d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ +0x84, 0xc0, 0x9c, 0x00, 0x10, 0x80, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x9c, /* ........ */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, /* ........ */ +0xc0, 0x71 /* .q */ +}; + +/* Frame (97 bytes) */ +static const unsigned char pkt43[97] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x53, 0x45, 0x84, 0x00, 0x00, 0xff, 0x11, /* .SE..... */ +0xd4, 0x07, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3f, /* .......? */ +0x9a, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, 0x6c, /* ...._pdl */ +0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, /* -datastr */ +0x65, 0x61, 0x6d, 0xc0, 0x11, 0x00, 0x0c, 0x00, /* eam..... */ +0x01 /* . */ +}; + +/* Frame (97 bytes) */ +static const unsigned char pkt44[97] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x53, 0x0a, 0x1f, 0x00, 0x00, 0xff, 0x11, /* .S...... */ +0x08, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3f, /* .......? */ +0x94, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .7...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, 0x6c, /* ...._pdl */ +0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, /* -datastr */ +0x65, 0x61, 0x6d, 0xc0, 0x11, 0x00, 0x0c, 0x00, /* eam..... */ +0x01 /* . */ +}; + +/* Frame (173 bytes) */ +static const unsigned char pkt45[173] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ +0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x00, 0x9f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x94, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x8b, /* ........ */ +0x10, 0xea, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x0c, 0xc0, 0x27, 0x00, 0x10, 0x80, /* 0...'... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x27, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .'.!.... */ +0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x17, 0x0c, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x16 /* 010.. */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt46[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x41, 0x45, 0x8a, 0x00, 0x00, 0xff, 0x11, /* .AE..... */ +0xd4, 0x13, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xc4, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt47[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x41, 0x0a, 0x20, 0x00, 0x00, 0xff, 0x11, /* .A. .... */ +0x08, 0xde, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (562 bytes) */ +static const unsigned char pkt48[562] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x02, 0x24, 0x67, 0xcd, 0x00, 0x00, 0xff, 0x11, /* .$g..... */ +0xb0, 0x53, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .S...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x10, /* ........ */ +0x25, 0xc3, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* %....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0xc0, 0x0c, 0x05, 0x5f, 0x68, 0x74, 0x74, /* w..._htt */ +0x70, 0xc0, 0x1c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p....... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x41, 0x06, 0x72, 0x6f, 0x75, /* 0w.A.rou */ +0x74, 0x65, 0x72, 0xc0, 0x21, 0x00, 0x01, 0x80, /* ter.!... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x04, 0xc0, 0x32, 0x00, 0x21, 0x80, /* ....2.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x23, 0x8c, 0xc0, 0x62, 0xc0, /* ...#..b. */ +0x32, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* 2....... */ +0x94, 0x01, 0x4e, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..N.txtv */ +0x65, 0x72, 0x73, 0x3d, 0x31, 0x05, 0x6e, 0x6f, /* ers=1.no */ +0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ +0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ +0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x31, 0x30, /* ority=10 */ +0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ +0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ +0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ +0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ +0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ +0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ +0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ +0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ +0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ +0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ +0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ +0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ +0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ +0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ +0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ +0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ +0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ +0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ +0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ +0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ +0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ +0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ +0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ +0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ +0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ +0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ +0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ +0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ +0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ +0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ +0x34, 0xc0, 0x53, 0x00, 0x21, 0x80, 0x01, 0x00, /* 4.S.!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x62, 0xc0, 0x53, 0x00, /* ..P.b.S. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x01, 0x00 /* .. */ +}; + +/* Frame (468 bytes) */ +static const unsigned char pkt49[468] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0xc6, 0x45, 0x95, 0x00, 0x00, 0xff, 0x11, /* ..E..... */ +0xd2, 0x83, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xb2, /* ........ */ +0x11, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* ........ */ +0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0b, 0x5f, 0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, /* ._udisks */ +0x2d, 0x73, 0x73, 0x68, 0xc0, 0x33, 0x00, 0x0c, /* -ssh.3.. */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x33, 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, /* .3...... */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x02, 0xc0, 0x2e, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0xc0, /* ation.3. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x50, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..P..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ +0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, 0xc0, 0x0c, /* _rfb.3.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x12, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, /* ..._pdl- */ +0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, /* datastre */ +0x61, 0x6d, 0xc0, 0x33, 0xc0, 0x0c, 0x00, 0x0c, /* am.3.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ +0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, /* ._printe */ +0x72, 0xc0, 0x33, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* r.3..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, 0x13, /* ........ */ +0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, /* catro-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, /* 010.>.>. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x45, 0x4c, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* EL.>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x13, /* ........ */ +0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* .dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x3e, 0xc0, 0x50, 0x00, 0x0c, 0x00, /* 0.>.P... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, /* ......*' */ +0x64, 0x63, 0x27, 0x73, 0x20, 0x72, 0x65, 0x6d, /* dc's rem */ +0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x6b, /* ote desk */ +0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x64, /* top on d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ +0x50, 0xc0, 0x50, 0x00, 0x0c, 0x00, 0x01, 0x00, /* P.P..... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x50 /* 0w.P */ +}; + +/* Frame (468 bytes) */ +static const unsigned char pkt50[468] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x01, 0xc6, 0x0a, 0x21, 0x00, 0x00, 0xff, 0x11, /* ...!.... */ +0x07, 0x58, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .X...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xb2, /* ........ */ +0x0b, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* .9...... */ +0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0b, 0x5f, 0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, /* ._udisks */ +0x2d, 0x73, 0x73, 0x68, 0xc0, 0x33, 0x00, 0x0c, /* -ssh.3.. */ +0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0xc0, 0x33, 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, /* .3...... */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x02, 0xc0, 0x2e, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0xc0, /* ation.3. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x50, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..P..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ +0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, 0xc0, 0x0c, /* _rfb.3.. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x12, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, /* ..._pdl- */ +0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, /* datastre */ +0x61, 0x6d, 0xc0, 0x33, 0xc0, 0x0c, 0x00, 0x0c, /* am.3.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ +0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, /* ._printe */ +0x72, 0xc0, 0x33, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* r.3..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, 0x13, /* ........ */ +0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, /* catro-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, /* 010.>.>. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x45, 0x4c, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* EL.>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x13, /* ........ */ +0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* .dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x3e, 0xc0, 0x50, 0x00, 0x0c, 0x00, /* 0.>.P... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, /* ......*' */ +0x64, 0x63, 0x27, 0x73, 0x20, 0x72, 0x65, 0x6d, /* dc's rem */ +0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x6b, /* ote desk */ +0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x64, /* top on d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ +0x50, 0xc0, 0x50, 0x00, 0x0c, 0x00, 0x01, 0x00, /* P.P..... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x50 /* 0w.P */ +}; + +/* Frame (447 bytes) */ +static const unsigned char pkt51[447] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0xb1, 0x45, 0x9f, 0x00, 0x00, 0xff, 0x11, /* ..E..... */ +0xd2, 0x8e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x9d, /* ........ */ +0x79, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* yH...... */ +0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, /* ...._rfb */ +0xc0, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, 0x19, /* stream.. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, /* .......1 */ +0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, /* .server- */ +0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, /* HP-Z210- */ +0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* Workstat */ +0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, /* ion [e8: */ +0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, /* 39:35:44 */ +0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, /* :fe:d4]. */ +0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, 0x63, 0x61, /* ....*'ca */ +0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, /* 0 [a4:1f */ +0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, /* :72:53:9 */ +0x62, 0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, /* b:c6]... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, /* o-EL [a4 */ +0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, /* :1f:72:5 */ +0x33, 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, /* 3:a0:f7] */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x27, 0x24, 0x64, /* .....'$d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, /* ex-3010 */ +0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, /* [a4:1f:7 */ +0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, /* 2:53:92: */ +0x61, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, /* a6]..... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ +0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ +0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ +0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x29, /* :7a]...) */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x29, 0xc0, 0x34, 0x00, 0x0c, /* 10.).4.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x34 /* 4500w.4 */ +}; + +/* Frame (447 bytes) */ +static const unsigned char pkt52[447] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x01, 0xb1, 0x0a, 0x22, 0x00, 0x00, 0xff, 0x11, /* ...".... */ +0x07, 0x6c, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .l...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x9d, /* ........ */ +0x72, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* r....... */ +0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ +0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ +0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, /* ...._rfb */ +0xc0, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, 0x19, /* stream.. */ +0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, /* .......1 */ +0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, /* .server- */ +0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, /* HP-Z210- */ +0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* Workstat */ +0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, /* ion [e8: */ +0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, /* 39:35:44 */ +0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, /* :fe:d4]. */ +0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, 0x63, 0x61, /* ....*'ca */ +0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, /* 0 [a4:1f */ +0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, /* :72:53:9 */ +0x62, 0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, /* b:c6]... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, /* o-EL [a4 */ +0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, /* :1f:72:5 */ +0x33, 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, /* 3:a0:f7] */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x27, 0x24, 0x64, /* .....'$d */ +0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ +0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, /* ex-3010 */ +0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, /* [a4:1f:7 */ +0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, /* 2:53:92: */ +0x61, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, /* a6]..... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ +0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ +0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ +0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x29, /* :7a]...) */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x29, 0xc0, 0x34, 0x00, 0x0c, /* 10.).4.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x34 /* 4500w.4 */ +}; + +/* Frame (497 bytes) */ +static const unsigned char pkt53[497] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x01, 0xe3, 0x67, 0xce, 0x00, 0x00, 0xff, 0x11, /* ..g..... */ +0xb0, 0x93, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xcf, /* ........ */ +0x46, 0x4d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FM...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, /* 0w...rou */ +0x74, 0x65, 0x72, 0xc0, 0x1a, 0x00, 0x01, 0x80, /* ter..... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x04, 0xc0, 0x2b, 0x00, 0x21, 0x80, /* ....+.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x02, 0x03, 0xc0, 0x3a, 0xc0, /* ......:. */ +0x2b, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* +....... */ +0x94, 0x01, 0x56, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..V.txtv */ +0x65, 0x72, 0x73, 0x3d, 0x31, 0x07, 0x72, 0x70, /* ers=1.rp */ +0x3d, 0x61, 0x75, 0x74, 0x6f, 0x05, 0x6e, 0x6f, /* =auto.no */ +0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ +0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ +0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x32, 0x30, /* ority=20 */ +0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ +0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ +0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ +0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ +0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ +0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ +0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ +0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ +0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ +0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ +0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ +0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ +0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ +0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ +0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ +0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ +0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ +0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ +0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ +0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ +0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ +0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ +0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ +0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ +0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ +0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ +0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ +0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ +0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ +0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ +0x34 /* 4 */ +}; + +/* Frame (360 bytes) */ +static const unsigned char pkt54[360] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x01, 0x5a, 0x45, 0xa1, 0x00, 0x00, 0xff, 0x11, /* .ZE..... */ +0xd2, 0xe3, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ +0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ +0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ +0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ +0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ +0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ +0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ +0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ +0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ +0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ +0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ +0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ +0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ +0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ +}; + +/* Frame (140 bytes) */ +static const unsigned char pkt55[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x0a, 0x23, 0x00, 0x00, 0xff, 0x11, /* .~.#.... */ +0x08, 0x9e, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt56[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x5c, 0x45, 0xa5, 0x00, 0x00, 0xff, 0x11, /* .\E..... */ +0xd3, 0xdd, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x7b, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* {....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x0c /* .. */ +}; + +/* Frame (106 bytes) */ +static const unsigned char pkt57[106] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x5c, 0x0a, 0x24, 0x00, 0x00, 0xff, 0x11, /* .\.$.... */ +0x08, 0xbf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ +0x75, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* u-...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x0c /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt58[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x03, 0x44, 0x45, 0xac, 0x00, 0x00, 0xff, 0x11, /* .DE..... */ +0xd0, 0xee, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0xfa, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* .n...... */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x90, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x91, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x91, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x91, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x92, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt59[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x03, 0x44, 0x0a, 0x25, 0x00, 0x00, 0xff, 0x11, /* .D.%.... */ +0x05, 0xd6, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0xf3, 0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* ........ */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x90, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x91, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x91, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x91, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x92, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt60[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x03, 0x44, 0x45, 0xd0, 0x00, 0x00, 0xff, 0x11, /* .DE..... */ +0xd0, 0xca, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0x81, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* ........ */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x87, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x88, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x88, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x88, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x89, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + +/* Frame (850 bytes) */ +static const unsigned char pkt61[850] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x03, 0x44, 0x0a, 0x26, 0x00, 0x00, 0xff, 0x11, /* .D.&.... */ +0x05, 0xd5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ +0x7b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* {....... */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ +0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ +0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ +0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ +0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ +0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ +0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ +0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ +0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ +0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ +0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ +0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ +0x00, 0x11, 0x87, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, /* ........ */ +0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ +0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x88, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0c, 0x09, /* ........ */ +0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ +0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x31, 0x2e, /* ......1. */ +0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ +0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ +0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ +0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ +0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ +0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ +0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ +0x11, 0x88, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ +0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ +0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ +0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ +0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ +0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ +0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ +0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ +0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ +0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ +0x00, 0x11, 0x88, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ +0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ +0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ +0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ +0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ +0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1d, /* ........ */ +0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ +0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ +0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ +0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ +0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ +0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ +0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ +0x88, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ +0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ +0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ +0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ +0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ +0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ +0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ +0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ +0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ +0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ +0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, 0x0c, /* ........ */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ +0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ +0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ +0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ +0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ +0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ +0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ +0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ +0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x89, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ +0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ +0xc0, 0x90 /* .. */ +}; + + +MDNS_TEST_SEQ mdns_query_and_response_chaos[] = { + {TITLE, "Query and response", 18, 0}, + + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + {INJECT, (char*)&pkt4[0], sizeof(pkt4), 0}, + {INJECT, (char*)&pkt5[0], sizeof(pkt5), 0}, + {INJECT, (char*)&pkt6[0], sizeof(pkt6), 0}, + {INJECT, (char*)&pkt7[0], sizeof(pkt7), 0}, + {INJECT, (char*)&pkt8[0], sizeof(pkt8), 0}, + {INJECT, (char*)&pkt9[0], sizeof(pkt9), 0}, + {INJECT, (char*)&pkt10[0], sizeof(pkt10), 0}, + {INJECT, (char*)&pkt11[0], sizeof(pkt11), 0}, + {INJECT, (char*)&pkt12[0], sizeof(pkt12), 0}, + {INJECT, (char*)&pkt13[0], sizeof(pkt13), 0}, + {INJECT, (char*)&pkt14[0], sizeof(pkt14), 0}, + {INJECT, (char*)&pkt15[0], sizeof(pkt15), 0}, + {INJECT, (char*)&pkt16[0], sizeof(pkt16), 0}, + {INJECT, (char*)&pkt17[0], sizeof(pkt17), 0}, + {INJECT, (char*)&pkt18[0], sizeof(pkt18), 0}, + {INJECT, (char*)&pkt19[0], sizeof(pkt19), 0}, + {INJECT, (char*)&pkt20[0], sizeof(pkt20), 0}, + {INJECT, (char*)&pkt21[0], sizeof(pkt21), 0}, + {INJECT, (char*)&pkt22[0], sizeof(pkt22), 0}, + {INJECT, (char*)&pkt23[0], sizeof(pkt23), 0}, + {INJECT, (char*)&pkt24[0], sizeof(pkt24), 0}, + {INJECT, (char*)&pkt25[0], sizeof(pkt25), 0}, + {INJECT, (char*)&pkt26[0], sizeof(pkt26), 0}, + {INJECT, (char*)&pkt27[0], sizeof(pkt27), 0}, + {INJECT, (char*)&pkt28[0], sizeof(pkt28), 0}, + {INJECT, (char*)&pkt29[0], sizeof(pkt29), 0}, + {INJECT, (char*)&pkt30[0], sizeof(pkt30), 0}, + {INJECT, (char*)&pkt31[0], sizeof(pkt31), 0}, + {INJECT, (char*)&pkt32[0], sizeof(pkt32), 0}, + {INJECT, (char*)&pkt33[0], sizeof(pkt33), 0}, + {INJECT, (char*)&pkt34[0], sizeof(pkt34), 0}, + {INJECT, (char*)&pkt35[0], sizeof(pkt35), 0}, + {INJECT, (char*)&pkt36[0], sizeof(pkt36), 0}, + {INJECT, (char*)&pkt37[0], sizeof(pkt37), 0}, + {INJECT, (char*)&pkt38[0], sizeof(pkt38), 0}, + {INJECT, (char*)&pkt39[0], sizeof(pkt39), 0}, + {INJECT, (char*)&pkt40[0], sizeof(pkt40), 0}, + {INJECT, (char*)&pkt41[0], sizeof(pkt41), 0}, + {INJECT, (char*)&pkt42[0], sizeof(pkt42), 0}, + {INJECT, (char*)&pkt43[0], sizeof(pkt43), 0}, + {INJECT, (char*)&pkt44[0], sizeof(pkt44), 0}, + {INJECT, (char*)&pkt45[0], sizeof(pkt45), 0}, + {INJECT, (char*)&pkt46[0], sizeof(pkt46), 0}, + {INJECT, (char*)&pkt47[0], sizeof(pkt47), 0}, + {INJECT, (char*)&pkt48[0], sizeof(pkt48), 0}, + {INJECT, (char*)&pkt49[0], sizeof(pkt49), 0}, + {INJECT, (char*)&pkt50[0], sizeof(pkt50), 0}, + {INJECT, (char*)&pkt51[0], sizeof(pkt51), 0}, + {INJECT, (char*)&pkt52[0], sizeof(pkt52), 0}, + {INJECT, (char*)&pkt53[0], sizeof(pkt53), 0}, + {INJECT, (char*)&pkt54[0], sizeof(pkt54), 0}, + {INJECT, (char*)&pkt55[0], sizeof(pkt55), 0}, + {INJECT, (char*)&pkt56[0], sizeof(pkt56), 0}, + {INJECT, (char*)&pkt57[0], sizeof(pkt57), 0}, + {INJECT, (char*)&pkt58[0], sizeof(pkt58), 0}, + {INJECT, (char*)&pkt59[0], sizeof(pkt59), 0}, + {INJECT, (char*)&pkt60[0], sizeof(pkt60), 0}, + {INJECT, (char*)&pkt61[0], sizeof(pkt61), 0}, + {WAIT, NX_NULL, 0, 5}, +}; + +int mdns_query_and_response_chaos_size = sizeof(mdns_query_and_response_chaos) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_during_probing_test.c b/test/regression/mdns_test/mdns_query_during_probing_test.c new file mode 100644 index 00000000..c478cb37 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_during_probing_test.c @@ -0,0 +1,337 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (226 bytes) */ +static const unsigned char pkt1[226] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xd4, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xda, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ +0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00 /* .. */ +}; + +/* Frame (226 bytes) */ +static const unsigned char pkt2[226] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xd4, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ +0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00 /* .. */ +}; + +/* Frame (226 bytes) */ +static const unsigned char pkt3[226] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xd4, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ +0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00 /* .. */ +}; + +/* Frame (338 bytes) */ +static const unsigned char pkt4[338] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x44, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ +0x8f, 0x67, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .g...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ +0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (338 bytes) */ +static const unsigned char pkt5[338] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x44, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ +0x8f, 0x66, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .f...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ +0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (338 bytes) */ +static const unsigned char pkt6[338] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x44, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ +0x8f, 0x65, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .e...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ +0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt7[86] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x48, 0x00, 0xf6, 0x00, 0x00, 0xff, 0x11, /* .H...... */ +0x12, 0x01, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x34, /* .......4 */ +0x9a, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .e...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01, /* cal..!.. */ +0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01 /* ...... */ +}; + +/* Frame (289 bytes) */ +static const unsigned char pkt8[289] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x13, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x95, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xff, /* ........ */ +0x12, 0xde, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* B.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, /* ...x...A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x40, 0x04, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40 /* @ */ +}; + + + +static MDNS_SERVICE mdns_service = {"test", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_query_during_probing[] = { + {TITLE, "Query during probing", 20, 0}, + + /* Add a service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* Wait for the first probing. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Inject a query. */ + {INJECT, (char*)&pkt7[0], sizeof(pkt7), 0}, + + /* No response is expected. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 1}, + + /* Wait probing and announcement finish. */ + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt7[0], sizeof(pkt7), 0}, + + /* A response is expected. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 1}, +}; + +int mdns_query_during_probing_size = sizeof(mdns_query_during_probing) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_http_tcp_test.c b/test/regression/mdns_test/mdns_query_http_tcp_test.c new file mode 100644 index 00000000..2fdbc5c5 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_http_tcp_test.c @@ -0,0 +1,91 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (153 bytes) */ +static const unsigned char pkt2[153] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (135 bytes) */ +static const unsigned char pkt3[135] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ +0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ +0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ +0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_query_http_tcp[] = { + {TITLE, "Query _http._tcp", 16, 0}, + + /* Add a query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + + /* Set callback for mask 2. */ + {MDNS_SET_SERVICE_CALLBACK, (UCHAR*)2, NX_MDNS_PEER_SERVICE_RECEIVED, 0}, + + /* Inject a response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check query with known answer. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 5}, + + /* Check callback invoked. */ + {MDNS_SET_SERVICE_CALLBACK_STATE, NX_NULL, 0, 3}, +}; + +int mdns_query_http_tcp_size = sizeof(mdns_query_http_tcp) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_pdl_datastram_tcp_test.c b/test/regression/mdns_test/mdns_query_pdl_datastram_tcp_test.c new file mode 100644 index 00000000..1635f348 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_pdl_datastram_tcp_test.c @@ -0,0 +1,153 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (86 bytes) */ +static const unsigned char pkt1[86] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x48, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .H..@... */ +0xd9, 0xb7, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x34, /* .......4 */ +0x03, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .,...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* l..... */ +}; + +/* Frame (496 bytes) */ +static const unsigned char pkt2[496] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x01, 0xe2, 0x77, 0x3a, 0x00, 0x00, 0xff, 0x11, /* ..w:.... */ +0xa1, 0x28, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .(...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xce, /* ........ */ +0xee, 0x32, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .2...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, /* w...rout */ +0x65, 0x72, 0xc0, 0x21, 0x00, 0x01, 0x80, 0x01, /* er.!.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x04, 0xc0, 0x32, 0x00, 0x21, 0x80, 0x01, /* ...2.!.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, /* ...x.... */ +0x00, 0x00, 0x23, 0x8c, 0xc0, 0x41, 0xc0, 0x32, /* ..#..A.2 */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x01, 0x4e, 0x09, 0x74, 0x78, 0x74, 0x76, 0x65, /* .N.txtve */ +0x72, 0x73, 0x3d, 0x31, 0x05, 0x6e, 0x6f, 0x74, /* rs=1.not */ +0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, 0x61, /* e=.qtota */ +0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, 0x6f, /* l=1.prio */ +0x72, 0x69, 0x74, 0x79, 0x3d, 0x31, 0x30, 0x11, /* rity=10. */ +0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ty=Canon */ +0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, 0x64, /* MF4570d */ +0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, /* w.produc */ +0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* t=(Canon */ +0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* MF4500w */ +0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, 0x70, /* ).pdl=ap */ +0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* plicatio */ +0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, /* n/octet- */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, 0x61, /* stream*a */ +0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, 0x3d, /* dminurl= */ +0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x72, /* http://r */ +0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, 0x6f, /* outer.lo */ +0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, 0x77, /* cal./t_w */ +0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x67, /* elcom.cg */ +0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x46, /* i.usb_MF */ +0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x27, /* G=Canon' */ +0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, 0x3d, /* usb_MDL= */ +0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, 0x46, /* Canon MF */ +0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, 0x65, /* 4500w Se */ +0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, 0x46, /* ries (UF */ +0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, 0x0d, /* RII LT). */ +0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, /* transpar */ +0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, 0x69, /* ent=F.Bi */ +0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, 0x54, /* nary=F.T */ +0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, 0x6f, /* BCP=F.Co */ +0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, 0x6f, /* lor=F.Co */ +0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, 0x44, /* pies=T.D */ +0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, 0x0d, /* uplex=T. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, 0x73, /* PaperCus */ +0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, 0x69, /* tom=T.Bi */ +0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, 0x6c, /* nd=F.Col */ +0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, 0x53, /* late=T.S */ +0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, 0x74, /* ort=T.St */ +0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, 0x50, /* aple=F.P */ +0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, 0x50, /* unch=F.P */ +0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, 0x3d, /* aperMax= */ +0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, 0x34 /* legal-A4 */ +}; + +/* Frame (165 bytes) */ +static const unsigned char pkt3[165] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x97, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .g...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x83, /* ........ */ +0x26, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &3...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* l......_ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x29, 0x0c, 0x43, 0x61, 0x6e, /* ...).Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, /* w._pdl-d */ +0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, /* atastrea */ +0x6d, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* m._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +/* Frame (165 bytes) */ +static const unsigned char pkt4[165] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x97, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x66, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .f...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x83, /* ........ */ +0x26, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &5...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* l......_ */ +0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ +0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x91, 0x00, 0x29, 0x0c, 0x43, 0x61, 0x6e, /* ...).Can */ +0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ +0x77, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, /* w._pdl-d */ +0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, /* atastrea */ +0x6d, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* m._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_pdl-datastream._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_query_pdl_datastream_tcp[] = { + {TITLE, "Query _pdl-datastream._tcp", 26, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 5}, +}; + +int mdns_query_pdl_datastream_tcp_size = sizeof(mdns_query_pdl_datastream_tcp) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_printer_tcp_test.c b/test/regression/mdns_test/mdns_query_printer_tcp_test.c new file mode 100644 index 00000000..908c3466 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_printer_tcp_test.c @@ -0,0 +1,146 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" +/* Frame (79 bytes) */ +static const unsigned char pkt1[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x41, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .A..@... */ +0xd9, 0xbe, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xc5, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (497 bytes) */ +static const unsigned char pkt2[497] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x01, 0xe3, 0x77, 0x9c, 0x00, 0x00, 0xff, 0x11, /* ..w..... */ +0xa0, 0xc5, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xcf, /* ........ */ +0x46, 0x4d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FM...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ +0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ +0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, /* 0w...rou */ +0x74, 0x65, 0x72, 0xc0, 0x1a, 0x00, 0x01, 0x80, /* ter..... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x04, 0xc0, 0x2b, 0x00, 0x21, 0x80, /* ....+.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x02, 0x03, 0xc0, 0x3a, 0xc0, /* ......:. */ +0x2b, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* +....... */ +0x94, 0x01, 0x56, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..V.txtv */ +0x65, 0x72, 0x73, 0x3d, 0x31, 0x07, 0x72, 0x70, /* ers=1.rp */ +0x3d, 0x61, 0x75, 0x74, 0x6f, 0x05, 0x6e, 0x6f, /* =auto.no */ +0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ +0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ +0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x32, 0x30, /* ority=20 */ +0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ +0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ +0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ +0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ +0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ +0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ +0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ +0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ +0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ +0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ +0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ +0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ +0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ +0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ +0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ +0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ +0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ +0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ +0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ +0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ +0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ +0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ +0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ +0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ +0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ +0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ +0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ +0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ +0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ +0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ +0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ +0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ +0x34 /* 4 */ +}; + +/* Frame (144 bytes) */ +static const unsigned char pkt3[144] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x82, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x7c, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .|...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6e, /* .......n */ +0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .<...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, /* al...... */ +0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, /* _printer */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x22, 0x0c, 0x43, /* .....".C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0x08, 0x5f, 0x70, 0x72, 0x69, /* 00w._pri */ +0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, /* nter._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (144 bytes) */ +static const unsigned char pkt4[144] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x82, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x7b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .{...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6e, /* .......n */ +0x18, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .>...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, /* al...... */ +0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, /* _printer */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x22, 0x0c, 0x43, /* .....".C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0x08, 0x5f, 0x70, 0x72, 0x69, /* 00w._pri */ +0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, /* nter._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_printer._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_query_printer_tcp[] = { + {TITLE, "Query _printer._tcp", 19, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 5}, +}; + +int mdns_query_printer_tcp_size = sizeof(mdns_query_printer_tcp) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_rr_timeout_test.c b/test/regression/mdns_test/mdns_query_rr_timeout_test.c new file mode 100644 index 00000000..f692e650 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_rr_timeout_test.c @@ -0,0 +1,148 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3d, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ +0x90, 0x93, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0x66, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* f....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (276 bytes) */ +static const unsigned char pkt2[276] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x01, 0x06, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x1c, 0xc0, 0xa8, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xf2, /* ........ */ +0x15, 0xc4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x23, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* #.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ver._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, /* cal..Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x04, 0x5f, /* Server._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x15, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x90, 0x07, /* ........ */ +0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x31, 0x05, /* ubuntu1. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* x...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x07, /* sion=01. */ +0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x31, 0x05, /* ubuntu1. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x00, 0x1f /* .... */ +}; + +/* Frame (75 bytes) */ +static const unsigned char pkt3[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3d, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ +0x90, 0x93, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0x66, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* f....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_ipp._tcp", NX_NULL}; +#define resonable_error 10 + +MDNS_TEST_SEQ mdns_query_rr_timeout[] = { + {TITLE, "RR timeout", 10, 0}, + + /* Waiting for probing and announcing. */ + {WAIT, NX_NULL, 0, 5}, + + /* Add query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + + /* Inject a response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* TTL is 120s. */ + /* Issue a query at 80%, 85%, 90%, 95% of the record lifetime. */ + {WAIT, NX_NULL, 0, 95}, + {DUMP, NX_NULL, 0, 0}, + + /* Check data. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 10}, + + /* Check timer in range 96~99s (80%-82%). */ + {MDNS_TIMER_CHECK, NX_NULL, 150 + resonable_error, 9750}, + {DUMP, NX_NULL, 0, 0}, + + /* Check data. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 10}, + + /* Check timer in range 102~105 (85%-87%). */ + {MDNS_TIMER_CHECK, NX_NULL, 150 + resonable_error, 10350}, + {DUMP, NX_NULL, 0, 0}, + + /* Check data. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 10}, + + /* Check timer in range 108~111 (90%-92%). */ + {MDNS_TIMER_CHECK, NX_NULL, 150 + resonable_error, 10950}, + {DUMP, NX_NULL, 0, 0}, + + /* Check data. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 10}, + + /* Check timer in range 114~117 (95%-97%). */ + {MDNS_TIMER_CHECK, NX_NULL, 150 + resonable_error, 11550}, + + /* The record should be deleted. */ + {WAIT, NX_NULL, 0, 7}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 0, 0}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* No cache maintenance is expected. */ + {MDNS_REJECT_ANY_V4, NX_NULL, 0, 120}, + + /* The record should be deleted. */ + {WAIT, NX_NULL, 0, 2}, + {MDNS_CHECK_RR_COUNT_REMOTE, NX_NULL, 0, 0}, +}; + +int mdns_query_rr_timeout_size = sizeof(mdns_query_rr_timeout) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_smb_tcp_test.c b/test/regression/mdns_test/mdns_query_smb_tcp_test.c new file mode 100644 index 00000000..971e4294 --- /dev/null +++ b/test/regression/mdns_test/mdns_query_smb_tcp_test.c @@ -0,0 +1,123 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x3d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ +0xd9, 0xc2, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xb3, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (332 bytes) */ +static const unsigned char pkt2[332] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ +0x01, 0x3e, 0x09, 0x17, 0x00, 0x00, 0xff, 0x11, /* .>...... */ +0x0f, 0x8f, 0xc0, 0xa8, 0x00, 0x65, 0xe0, 0x00, /* .....e.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */ +0x56, 0xdc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* V....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ +0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */ +0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */ +0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */ +0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */ +0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ +0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */ +0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ +0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */ +0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */ +0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */ +0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */ +0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */ +0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ +0xa8, 0x00, 0x65, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..e.v... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x.. */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */ +0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */ +0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */ +0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */ +0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */ +0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */ +0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */ +0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */ +0x40, 0x00, 0x00, 0x08 /* @... */ +}; + +/* Frame (129 bytes) */ +static const unsigned char pkt3[129] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x73, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ +0xd9, 0x8b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ +0x9d, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x1b, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + +/* Frame (129 bytes) */ +static const unsigned char pkt4[129] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ +0x00, 0x73, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ +0xd9, 0x8a, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ +0x9d, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x1b, 0x09, 0x43, /* .......C */ +0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ +0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00 /* . */ +}; + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_smb._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_query_smb_tcp[] = { + {TITLE, "Query _smb._tcp", 15, 0}, + + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 5}, +}; + +int mdns_query_smb_tcp_size = sizeof(mdns_query_smb_tcp) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_start_stop_test.c b/test/regression/mdns_test/mdns_query_start_stop_test.c new file mode 100644 index 00000000..4e85dd1b --- /dev/null +++ b/test/regression/mdns_test/mdns_query_start_stop_test.c @@ -0,0 +1,189 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (90 bytes) */ +static const unsigned char pkt1[90] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x4c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .L..@... */ +0x90, 0x5c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .\...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ +0x46, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* F....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01 /* .. */ +}; + +/* Frame (199 bytes) */ +static const unsigned char pkt2[199] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0xb9, 0x1d, 0xbb, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xf4, 0xca, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xa5, /* ........ */ +0x3b, 0x23, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ;#...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, /* ........ */ +0x04, 0x74, 0x65, 0x73, 0x74, 0xc0, 0x1a, 0x08, /* .test... */ +0x43, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, /* Catro-PC */ +0xc0, 0x25, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* .%...... */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x07, 0x0a, /* .x...... */ +0xc0, 0x36, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .6.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x3d, 0xc0, 0x36, 0x00, 0x10, /* .P.=.6.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc0, 0x3d, 0x00, 0x2f, 0x80, 0x01, 0x00, /* ..=./... */ +0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, 0x3d, 0x00, /* ..x...=. */ +0x01, 0x40, 0xc0, 0x36, 0x00, 0x2f, 0x80, 0x01, /* .@.6./.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, 0x36, /* ...x...6 */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ +}; + +/* Frame (155 bytes) */ +static const unsigned char pkt3[155] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8d, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x1a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x79, /* .......y */ +0xd4, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .~...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ +0x74, 0x65, 0x72, 0x04, 0x5f, 0x73, 0x75, 0x62, /* ter._sub */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x17, 0x04, 0x74, 0x65, 0x73, /* .....tes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + +/* Frame (81 bytes) */ +static const unsigned char pkt4[81] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x43, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .C..@... */ +0x90, 0x63, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .c...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2f, /* ......./ */ +0x2f, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* /....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ +0x01 /* . */ +}; + +/* Frame (171 bytes) */ +static const unsigned char pkt5[171] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x9d, 0x1d, 0xbc, 0x00, 0x00, 0xff, 0x11, /* ........ */ +0xf4, 0xe5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ +0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ +0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ +0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ +0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ +0x80, 0x00, 0x40 /* ..@ */ +}; + +static MDNS_QUERY_INFO mdns_query_0 = {"test", "_http._tcp", NX_NULL}; +static MDNS_QUERY_INFO mdns_query_1 = {NX_NULL, "_http._tcp", "_printer"}; + +MDNS_TEST_SEQ mdns_query_start_stop[] = { + {TITLE, "Query start and stop", 20, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Add a query*/ + {MDNS_QUERY, (char*)&mdns_query_0, 0, 0}, + + /* Check the query packet. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 5}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + + /* Reject any queries. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 5}, + + /* Add a query*/ + {MDNS_QUERY, (char*)&mdns_query_0, 0, 0}, + + /* Check the query packet. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 5}, + + /* Inject a response. */ + {INJECT, (char*)&pkt5[0], sizeof(pkt5), 0}, + + /* Reject any queries. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 5}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + + + /* Add a query*/ + {MDNS_QUERY, (char*)&mdns_query_1, 0, 0}, + + /* Check the query packet. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + + /* Reject any queries. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 5}, + + /* Add a query*/ + {MDNS_QUERY, (char*)&mdns_query_1, 0, 0}, + + /* Check the query packet. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + + /* Inject a response. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + + /* Check the query packet with known answer. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 5}, + + /* Delete the query. */ + {MDNS_QUERY_DELETE, NX_NULL, 0, 0}, + + /* Reject any queries. */ + {MDNS_REJECT_ANY_V4, NX_NULL, MDNS_FLAG_QUERY, 5}, + +}; + +int mdns_query_start_stop_size = sizeof(mdns_query_start_stop) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_query_with_tc_test.c b/test/regression/mdns_test/mdns_query_with_tc_test.c new file mode 100644 index 00000000..cb777fbb --- /dev/null +++ b/test/regression/mdns_test/mdns_query_with_tc_test.c @@ -0,0 +1,691 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0x6a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .j...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (1437 bytes) */ +static const unsigned char pkt2[1437] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x05, 0x8f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x61, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .a...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x7b, /* .......{ */ +0x26, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* &....... */ +0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* .,....._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x31, 0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, /* .1.01 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, 0x80, /* s...(... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, /* .P.ubunt */ +0x75, 0xc0, 0x17, 0xc0, 0x78, 0x00, 0x1c, 0x80, /* u...x... */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, /* ....x... */ +0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, 0x8d, 0xc0, /* .)...... */ +0x78, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* x....... */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x01, 0xc0, /* x....... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x31, 0x36, 0x20, 0x53, /* ..1.16 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc0, 0xb9, 0x00, 0x10, /* ts...... */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc0, 0xb9, 0x00, 0x21, 0x80, 0x01, 0x00, /* ....!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, 0x6d, /* 1.15 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0xc0, 0x0c, 0xc1, 0x17, 0x00, 0x10, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc1, /* ........ */ +0x17, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ +0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc1, 0x75, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* .u...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc1, 0x75, 0x00, /* ......u. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ +0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x38, /* ....1.08 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc1, 0xd3, /* kets.... */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc1, 0xd3, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x31, 0x34, 0x20, 0x53, /* ..1.14 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc2, 0x31, 0x00, 0x10, /* ts...1.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc2, 0x31, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..1.!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x31, 0x32, 0x20, 0x53, 0x69, 0x6d, /* 1.12 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0xc0, 0x0c, 0xc2, 0x8f, 0x00, 0x10, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc2, /* ........ */ +0x8f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ +0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x31, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 11 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc2, 0xed, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc2, 0xed, 0x00, /* ........ */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ +0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x39, /* ....1.09 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc3, 0x4b, /* kets...K */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc3, 0x4b, 0x00, 0x21, 0x80, /* ....K.!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x31, 0x30, 0x20, 0x53, /* ..1.10 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc3, 0xa9, 0x00, 0x10, /* ts...... */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc3, 0xa9, 0x00, 0x21, 0x80, 0x01, 0x00, /* ....!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x31, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, 0x6d, /* 1.07 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0xc0, 0x0c, 0xc4, 0x07, 0x00, 0x10, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc4, /* ........ */ +0x07, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ +0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc4, 0x65, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* .e...... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc4, 0x65, 0x00, /* ......e. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ +0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x36, /* ....1.06 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc4, 0xc3, /* kets.... */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x01, 0x00, 0xc4, 0xc3, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x94, 0x00, 0x31, 0x2e, 0x30, 0x34, 0x20, 0x53, /* ..1.04 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0xc0, 0x0c, 0xc5, 0x21, 0x00, 0x10, /* ts...!.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0xc5, 0x21, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..!.!... */ +0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0xc0, 0x78 /* ..P.x */ +}; + +/* Frame (265 bytes) */ +static const unsigned char pkt3[265] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0xfb, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xf5, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe7, /* ........ */ +0x83, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x31, 0x2e, 0x30, 0x32, 0x20, 0x53, 0x69, /* .1.02 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, 0x80, /* s...(... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, /* .P.ubunt */ +0x75, 0xc0, 0x17, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* u....... */ +0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ +0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ +0xc0, 0x8d, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x8d, 0x00, /* ........ */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ +0x78 /* x */ +}; + +/* Frame (1471 bytes) */ +static const unsigned char pkt4[1471] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xb1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xf6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ +0xd6, 0x19, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ +0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x93, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ +0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (147 bytes) */ +static const unsigned char pkt5[147] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x85, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x21, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .!...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ +0xae, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + +/* Frame (1471 bytes) */ +static const unsigned char pkt6[1471] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xb1, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xf4, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ +0xe4, 0x29, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* .)...... */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, /* ......A. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x91, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, /* ......A. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ +0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (147 bytes) */ +static const unsigned char pkt7[147] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x85, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x1f, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ +0xae, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* . ...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + + + +static MDNS_QUERY_INFO mdns_query = {NX_NULL, "_http._tcp", NX_NULL}; + +MDNS_TEST_SEQ mdns_query_with_tc[] = { + {TITLE, "Query with TC", 13, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Add a query. */ + {MDNS_QUERY, (char*)&mdns_query, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 5}, + + /* Inject responses. */ + {INJECT, (char*)&pkt2[0], sizeof(pkt2), 0}, + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* Check query with TC bit. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 5}, + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt5), 5}, +}; + +int mdns_query_with_tc_size = sizeof(mdns_query_with_tc) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_response_aggregation_test.c b/test/regression/mdns_test/mdns_response_aggregation_test.c new file mode 100644 index 00000000..d3079aad --- /dev/null +++ b/test/regression/mdns_test/mdns_response_aggregation_test.c @@ -0,0 +1,216 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (140 bytes) */ +static const unsigned char pkt1[140] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x7e, 0x01, 0x4c, 0x00, 0x00, 0xff, 0x11, /* .~.L.... */ +0x11, 0x75, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .u...... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ +0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ +0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ +0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ +0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ +0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ +0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ +0x0c, 0x00, 0x01, 0x40 /* ...@ */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt2[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x41, 0x01, 0x4d, 0x00, 0x00, 0xff, 0x11, /* .A.M.... */ +0x11, 0xb1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (79 bytes) */ +static const unsigned char pkt3[79] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x41, 0x01, 0x4e, 0x00, 0x00, 0xff, 0x11, /* .A.N.... */ +0x11, 0xb0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ +0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ +}; + +/* Frame (75 bytes) */ +static const unsigned char pkt4[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x01, 0x4f, 0x00, 0x00, 0xff, 0x11, /* .=.O.... */ +0x11, 0xb3, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (632 bytes) */ +static const unsigned char pkt5[632] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x02, 0x6a, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .j..@... */ +0x8e, 0x3e, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .>...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x56, /* .......V */ +0x66, 0x0b, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* f....... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x21, 0x0b, 0x41, 0x52, /* ..d.!.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* t._print */ +0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* er._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x08, 0x5f, /* NSTest._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* st._prin */ +0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ter._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x08, 0x5f, /* NSTest._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x28, 0x0b, 0x41, 0x52, /* ..x.(.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* t._print */ +0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* er._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x0b, 0x41, 0x52, /* ....@.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x0b, 0x41, 0x52, /* .d....AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x24, 0x0b, 0x41, 0x52, 0x4d, /* .x.$.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .......@ */ +}; + +/* Frame (101 bytes) */ +static const unsigned char pkt6[101] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x57, 0x01, 0x50, 0x00, 0x00, 0xff, 0x11, /* .W.P.... */ +0x11, 0x98, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ +0x10, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ +}; + +/* Frame (105 bytes) */ +static const unsigned char pkt7[105] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x5b, 0x01, 0x51, 0x00, 0x00, 0xff, 0x11, /* .[.Q.... */ +0x11, 0x93, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x47, /* .......G */ +0x26, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ +0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ +0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x63, 0x00, 0x0e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* c...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0xc0, /* DNSTest. */ +0x0c /* . */ +}; + +static MDNS_SERVICE mdns_service_0 = {"ARMMDNSTest", "_printer._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service_1 = {"ARMMDNSTest", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + + +MDNS_TEST_SEQ mdns_response_aggregation[] = { + {TITLE, "Response aggregation", 20, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service_0, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service_1, 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject two queries. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 0}, + + /* Sleep 10ms. */ + {MDNS_WAIT_TICK, NX_NULL, 0, 1}, + + {INJECT, (char*)&pkt4[0], sizeof(pkt4), 0}, + + /* Check response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt5), 2}, +}; + +int mdns_response_aggregation_size = sizeof(mdns_response_aggregation) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_response_in_multiple_packets_test.c b/test/regression/mdns_test/mdns_response_in_multiple_packets_test.c new file mode 100644 index 00000000..4ea66210 --- /dev/null +++ b/test/regression/mdns_test/mdns_response_in_multiple_packets_test.c @@ -0,0 +1,479 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (75 bytes) */ +static const unsigned char pkt1[75] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3d, 0x06, 0x3f, 0x00, 0x00, 0xff, 0x11, /* .=.?.... */ +0x0c, 0xc3, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ +0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01 /* ... */ +}; + +/* Frame (1497 bytes) */ +static const unsigned char pkt2[1497] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xcb, 0x00, 0x1d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xb7, /* ........ */ +0x44, 0x6c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Dl...... */ +0x00, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* l.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st3._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* l.._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ +0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st7._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, /* d...test */ +0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* al.._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ +0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* ..test12 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ +0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t13._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, /* ....d... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, /* ..x...AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x05, /* ...d.... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, /* test1._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ +0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x01, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* @.test3. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ +0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st3._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ +0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ +0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t4._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* ..test4. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, /* test5._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00 /* . */ +}; + +/* Frame (1490 bytes) */ +static const unsigned char pkt3[1490] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xc4, 0x00, 0x1e, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xb0, /* ........ */ +0x12, 0x0c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x05, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x01, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ +0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ +0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* .@.test7 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t7._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ +0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ +0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ +0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, 0x04, /* ..test8. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* l..test9 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, 0x73, /* d....tes */ +0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ +0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ +0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ +0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ +0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ +0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, /* est10._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, /* ..test10 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ +0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, /* st11._ip */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, 0x04, /* .test11. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ +0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ +0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* @.test12 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ +0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ +0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, /* ...d.... */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, /* test12._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* ..test12 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ +0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ +0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ +0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ +0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ +0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ +0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00 /* l. */ +}; + +/* Frame (154 bytes) */ +static const unsigned char pkt4[154] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x8c, 0x00, 0x1f, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x04, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x78, /* .......x */ +0xef, 0x93, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ +0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ +0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, /* x...test */ +0x31, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 14._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + + +static MDNS_SERVICE mdns_service1 = {"test1", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service2 = {"test2", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service3 = {"test3", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service4 = {"test4", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service5 = {"test5", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service6 = {"test6", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service7 = {"test7", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service8 = {"test8", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service9 = {"test9", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service10 = {"test10", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service11 = {"test11", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service12 = {"test12", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service13 = {"test13", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; +static MDNS_SERVICE mdns_service14 = {"test14", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_response_in_multiple_packets[] = { + {TITLE, "Response in multiple packets", 28, 0}, + + /* Add a service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service1, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service2, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service3, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service4, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service5, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service6, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service7, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service8, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service9, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service10, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service11, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service12, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service13, 0, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service14, 0, 0}, + + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a query packet. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Wait for the response in multiple packets. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, +}; + +int mdns_response_in_multiple_packets_size = sizeof(mdns_response_in_multiple_packets) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_response_interval_test.c b/test/regression/mdns_test/mdns_response_interval_test.c new file mode 100644 index 00000000..e5d22999 --- /dev/null +++ b/test/regression/mdns_test/mdns_response_interval_test.c @@ -0,0 +1,275 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1_1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x3e, 0x01, 0x16, 0x00, 0x00, 0xff, 0x11, /* .>...... */ +0x11, 0xeb, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0x26, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &/...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt1_2[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x28, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .(...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0xbf, 0xcd, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* B.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, /* ...x...A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, /* ...@.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x14, 0x08, 0x70, 0x61, /* ..d...pa */ +0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ +0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ +0x31, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* 1.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2_1[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (94 bytes) */ +static const unsigned char pkt2_16[94] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ +0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ +0x00, 0x50, 0x01, 0x2e, 0x00, 0x00, 0xff, 0x11, /* .P...... */ +0x11, 0xc1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ +0xa4, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01, /* cal..!.. */ +0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01 /* ...... */ +}; + +/* Frame (340 bytes) */ +static const unsigned char pkt2_17[340] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x46, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .F..@... */ +0x8f, 0x62, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .b...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x32, /* .......2 */ +0xa4, 0x76, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .v...... */ +0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* =01.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x16, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x40, 0x0b, /* cal...@. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, /* ....x.%. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_response_interval[] = { + {TITLE, "Response interval", 17, 0}, + + /* Add service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt1_1[0], sizeof(pkt1_1), 0}, + + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1_2[0], sizeof(pkt1_2), 1}, + + /* Check timer in range 20~120ms. */ + {MDNS_TIMER_CHECK, NX_NULL, 5, 7}, + + /* Wait 5 seconds. */ + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt1_1[0], sizeof(pkt1_1), 0}, + + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1_2[0], sizeof(pkt1_2), 1}, + + /* Check timer in range 20~120ms. */ + {MDNS_TIMER_CHECK, NX_NULL, 5, 7}, + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject a query immediately. */ + {INJECT, (char*)&pkt1_1[0], sizeof(pkt1_1), 0}, + + /* It MUST NOT answer in one second. */ + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1_2[0], sizeof(pkt1_2), 2}, + + /* Check timer in range 1s~. */ + {MDNS_TIMER_CHECK, NX_NULL, 100, 200}, + + /* Wait 5 seconds. */ + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt1_1[0], sizeof(pkt1_1), 0}, + + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1_2[0], sizeof(pkt1_2), 1}, + + /* Check timer in range 20~120ms. */ + {MDNS_TIMER_CHECK, NX_NULL, 5, 7}, + + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt2_16[0], sizeof(pkt2_16), 0}, + + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2_17[0], sizeof(pkt2_17), 1}, + + /* Check timer in range 0~10ms. Resonable error is 30ms. */ + {MDNS_TIMER_MAX_CHECK, NX_NULL, 0, 1 + 3}, + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Inject a probing immediately. */ + {INJECT, (char*)&pkt2_1[0], sizeof(pkt2_1), 0}, + + /* It MUST answer at least 250ms. */ + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2_17[0], sizeof(pkt2_17), 1}, + + /* Check timer in range 250~. */ + {MDNS_TIMER_CHECK, NX_NULL, 75, 100}, +}; + +int mdns_response_interval_size = sizeof(mdns_response_interval) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_response_no_delay_test.c b/test/regression/mdns_test/mdns_response_no_delay_test.c new file mode 100644 index 00000000..7abdf579 --- /dev/null +++ b/test/regression/mdns_test/mdns_response_no_delay_test.c @@ -0,0 +1,65 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3f, 0x48, 0x48, 0x00, 0x00, 0xff, 0x11, /* .?HH.... */ +0xd1, 0x57, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .W...j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0x9a, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (138 bytes) */ +static const unsigned char pkt2[138] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x7c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ +0x90, 0x2c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .,...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ +0xb9, 0x74, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .t...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40 /* .@ */ +}; + +MDNS_TEST_SEQ mdns_response_no_delay[] = { + {TITLE, "Response no delay", 17, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a query. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Reset timer. */ + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Check the response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + + /* Check timer in range 0~10ms. Resonable error is 30ms. */ + {MDNS_TIMER_MAX_CHECK, NX_NULL, 0, 1 + 3}, +}; + +int mdns_response_no_delay_size = sizeof(mdns_response_no_delay) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_response_to_address_query_test.c b/test/regression/mdns_test/mdns_response_to_address_query_test.c new file mode 100644 index 00000000..61252cdb --- /dev/null +++ b/test/regression/mdns_test/mdns_response_to_address_query_test.c @@ -0,0 +1,72 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (77 bytes) */ +static const unsigned char pkt1[77] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3f, 0x5c, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .?\..... */ +0xbc, 0xba, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ +0x9a, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ +}; + +/* Frame (186 bytes) */ +static const unsigned char pkt2[186] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xac, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xf9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x98, /* ........ */ +0x17, 0x2c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .,...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ +0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x22, 0xff, /* ......". */ +0xfe, 0x33, 0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, /* .3DW.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x19, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, /* cal...@. */ +0x00, 0x08 /* .. */ +}; + +MDNS_TEST_SEQ mdns_response_to_address_query[] = { + {TITLE, "Response to address query", 25, 0}, + + /* Add link local address. */ + {MDNS_LLA_ADD, NX_NULL, 0x00000011, 0x22334457}, + {WAIT, NX_NULL, 0, 5}, + + /* Recreate mDNS. */ + {MDNS_RECREATE, "ARMMDNSTest", 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject query. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0}, + + /* Check response. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, +}; + +int mdns_response_to_address_query_size = sizeof(mdns_response_to_address_query) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_response_with_tc_test.c b/test/regression/mdns_test/mdns_response_with_tc_test.c new file mode 100644 index 00000000..de5a4e30 --- /dev/null +++ b/test/regression/mdns_test/mdns_response_with_tc_test.c @@ -0,0 +1,341 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (76 bytes) */ +static const unsigned char pkt1[76] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Frame (554 bytes) */ +static const unsigned char pkt2[554] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x02, 0x1c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8e, 0x8c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x08, /* ........ */ +0x00, 0x93, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ +0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x16, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x40, 0x2e, /* cal...@. */ +0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x2e, 0x30, 0x33, 0x20, 0x53, /* al..03 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x2e, /* ...d.... */ +0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ +0x00, 0x48, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .H.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ +0x00, 0x40 /* .@ */ +}; + +/* Frame (1471 bytes) */ +static const unsigned char pkt3[1471] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0xb1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8a, 0xf6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ +0xd6, 0x19, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ +0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ +0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x93, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ +0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ +0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ +0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ +0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ +0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ +0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ +0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ +0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ +0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ +0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ +0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ +0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ +0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ +0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ +0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ +0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ +0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ +0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ +0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ +0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ +0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ +0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ +0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ +0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ +0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ +0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ +0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ +0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ +0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ +0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ +}; + +/* Frame (147 bytes) */ +static const unsigned char pkt4[147] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x85, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x21, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .!...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ +0xae, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ +0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ +0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ +0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ +0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ +0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00 /* al. */ +}; + + +static MDNS_SERVICE mdns_service = {"03 Simple Web Server Test For Multiple Packets", "_http._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +MDNS_TEST_SEQ mdns_response_with_tc[] = { + {TITLE, "Response with TC", 16, 0}, + + /* Add a service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Inject a query packet. */ + {INJECT, (char*)&pkt1[0], sizeof(pkt1), 1}, + + /* Check the response packet. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + + /* Inject a query packet with TC bit set. */ + {INJECT, (char*)&pkt3[0], sizeof(pkt3), 1}, + + /* Wait 390ms. */ + {MDNS_WAIT_TICK, NX_NULL, NX_NULL, 39}, + + /* Inject the known answer packet. */ + {INJECT, (char*)&pkt4[0], sizeof(pkt4), 1}, + + /* Check no response packet. */ + {MDNS_REJECT_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 3}, +}; + +int mdns_response_with_tc_size = sizeof(mdns_response_with_tc) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_server_announcement_with_txt_test.c b/test/regression/mdns_test/mdns_server_announcement_with_txt_test.c new file mode 100644 index 00000000..4226e475 --- /dev/null +++ b/test/regression/mdns_test/mdns_server_announcement_with_txt_test.c @@ -0,0 +1,328 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (269 bytes) */ +static const unsigned char pkt1[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt2[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (269 bytes) */ +static const unsigned char pkt3[269] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ +0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ +0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ +0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt4[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt5[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +/* Frame (398 bytes) */ +static const unsigned char pkt6[398] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ +0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + +#define resonable_error 5 + +MDNS_TEST_SEQ mdns_server_announcement_with_txt[] = { + {TITLE, "Server announcement with TXT", 28, 0}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* The first probing. Interval between 0~260ms. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 13 + resonable_error, 13 + resonable_error}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* The second probing. Interval between 0~260ms. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 13 + resonable_error, 13 + resonable_error}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* The third probing. Interval between 0~260ms. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 13 + resonable_error, 13 + resonable_error}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Check announcement. Interval between 0~260ms. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 13 + resonable_error, 13 + resonable_error}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Check announcement. Interval 1s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt5), 1}, + {MDNS_TIMER_CHECK, NX_NULL, 3 + resonable_error, 100}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, + + /* Check announcement. Interval 2s. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt6), 2}, + {MDNS_TIMER_CHECK, NX_NULL, 3 + resonable_error, 200}, + {MDNS_TIMER_RESET, NX_NULL, 0, 0}, +}; + +int mdns_server_announcement_with_txt_size = sizeof(mdns_server_announcement_with_txt) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_server_interface_reset.c b/test/regression/mdns_test/mdns_server_interface_reset.c new file mode 100644 index 00000000..4b7b2f49 --- /dev/null +++ b/test/regression/mdns_test/mdns_server_interface_reset.c @@ -0,0 +1,670 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (287 bytes) */ +static const unsigned char pkt1[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x9d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt2[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x9c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt3[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x9b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt4[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x0d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt5[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x0c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt6[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x0b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (288 bytes) */ +static const unsigned char pkt7[288] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x12, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x96, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfe, /* ........ */ +0x8f, 0x3f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .?...... */ +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, /* ......B. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x00, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, /* .....pap */ +0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ +0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ +0x00, 0x00, 0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, /* ...$.Sim */ +0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ +0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt8[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x96, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt9[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x95, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (287 bytes) */ +static const unsigned char pkt10[287] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x11, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x94, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ +0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ +0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ +0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt11[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x06, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt12[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x05, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +/* Frame (428 bytes) */ +static const unsigned char pkt13[428] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x9e, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0x04, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ +0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ +0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ +0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ +0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ +0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ +0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ +0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ +0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ +0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ +0x00, 0x80, 0x00, 0x40 /* ...@ */ +}; + +static MDNS_SERVICE mdns_service = {"Simple Web Server", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + + +MDNS_TEST_SEQ mdns_server_interface_reset[] = { + {TITLE, "Server interface reset", 22, 0}, + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + + /* Check probing and announcement. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt1[0], sizeof(pkt1), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt3[0], sizeof(pkt3), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt4[0], sizeof(pkt4), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt5[0], sizeof(pkt5), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt6[0], sizeof(pkt6), 2}, + + /* Disable the interface. */ + {MDNS_INTERFACE_DISABLE, NX_NULL, 0, 0}, + {MDNS_CHECK_DATA_V4, (char*)&pkt7[0], sizeof(pkt7), 1}, + + /* Enable the interface. */ + {MDNS_INTERFACE_ENABLE, NX_NULL, 0, 0}, + + /* Check probing and announcement. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt8[0], sizeof(pkt8), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt9[0], sizeof(pkt9), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt10[0], sizeof(pkt10), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt11[0], sizeof(pkt11), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt12[0], sizeof(pkt12), 1}, + {MDNS_CHECK_DATA_V4, (char*)&pkt13[0], sizeof(pkt13), 2}, +}; + +int mdns_server_interface_reset_size = sizeof(mdns_server_interface_reset) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/mdns_test/mdns_server_send_goodbye_test.c b/test/regression/mdns_test/mdns_server_send_goodbye_test.c new file mode 100644 index 00000000..6e30d6a8 --- /dev/null +++ b/test/regression/mdns_test/mdns_server_send_goodbye_test.c @@ -0,0 +1,62 @@ + +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ + +#include "netx_mdns_test.h" + +/* Frame (237 bytes) */ +static const unsigned char pkt7[237] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xdf, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xc9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x49, 0x59, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* IY...... */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, /* ........ */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0b, /* ........ */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + +static MDNS_SERVICE mdns_service = {"ARMMDNSTest", "_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0}; + + +MDNS_TEST_SEQ mdns_server_send_goodbye[] = { + {TITLE, "Server send goodbye", 19, 0}, + + /* Add a service. */ + {MDNS_SERVICE_ADD, (char*)&mdns_service, 0, 0}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + /* Delete all services. */ + {MDNS_SERVICE_DELETE, (char*)&mdns_service, 0, 0}, + + /* Check for the goodbye packet. */ + {MDNS_CHECK_DATA_V4, (char*)&pkt7[0], sizeof(pkt7), 1}, +}; + +int mdns_server_send_goodbye_size = sizeof(mdns_server_send_goodbye) / sizeof(MDNS_TEST_SEQ); + +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/mdns_test/mdns_test_setup.docx b/test/regression/mdns_test/mdns_test_setup.docx new file mode 100644 index 00000000..0be0f8b2 Binary files /dev/null and b/test/regression/mdns_test/mdns_test_setup.docx differ diff --git a/test/regression/mdns_test/netx_mdns_announcement_repeat_test.c b/test/regression/mdns_test/netx_mdns_announcement_repeat_test.c new file mode 100644 index 00000000..daf016e5 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_announcement_repeat_test.c @@ -0,0 +1,498 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_system.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define TOLERANCE 10 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Define the timer parameters. */ +static UINT t; +static UINT p; +static UINT k; +static UINT retrans_interval; +static UINT period_interval; +static UINT max_time; + +/* Define the transmit count. */ +static UINT retransmit_count; +static UINT cycle_count; + +static UINT last_tick; +static UCHAR first_packet; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_announcement_repeat_test(void *first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: MDNS Announcement Repeat Test............................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for host name register. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + /* Test default timer parameters. */ + t = 100; + p = 1; + k = 1; + retrans_interval = 0; + period_interval = 0xFFFFFFFF; + max_time = 3; + retransmit_count = p; + cycle_count = max_time; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 5 seconds for service announcement. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Change time parameter t from 100 to 200. */ + /* Test default timer parameters. */ + t = 200; + p = 1; + k = 1; + retrans_interval = 0; + period_interval = 0xFFFFFFFF; + max_time = 3; + retransmit_count = p; + cycle_count = max_time; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 10 seconds for service announcement. */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Change time parameter p from 1 to 2. */ + /* Test default timer parameters. */ + t = 100; + p = 2; + k = 1; + retrans_interval = 0; + period_interval = 0xFFFFFFFF; + max_time = 3; + retransmit_count = p; + cycle_count = max_time; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 5 seconds for service announcement. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Change time parameter k from 1 to 2. */ + /* Test default timer parameters. */ + t = 100; + p = 1; + k = 2; + retrans_interval = 0; + period_interval = 0xFFFFFFFF; + max_time = 3; + retransmit_count = p; + cycle_count = max_time; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 10 seconds for service announcement. */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Change time parameter p from 1 to 2, retrans_interval from 0 to 100. */ + /* Test default timer parameters. */ + t = 100; + p = 2; + k = 1; + retrans_interval = 100; + period_interval = 0xFFFFFFFF; + max_time = 3; + retransmit_count = p; + cycle_count = max_time; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 10 seconds for service announcement. */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Change time parameter max time from 3 to 5. */ + /* Test default timer parameters. */ + t = 100; + p = 1; + k = 1; + retrans_interval = 0; + period_interval = 0xFFFFFFFF; + max_time = 5; + retransmit_count = p; + cycle_count = max_time; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 20 seconds for service announcement. */ + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Change time parameter period_interval from forever to 100, max_time from 3 to forever. */ + /* Test default timer parameters. */ + t = 100; + p = 1; + k = 1; + retrans_interval = 0; + period_interval = 100; + max_time = 0xFF; + retransmit_count = p; + cycle_count = 300; + first_packet = NX_TRUE; + nx_mdns_service_announcement_timing_set(&mdns_0, t, p, k, retrans_interval, period_interval, max_time); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add a service. */ + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 310 seconds for service announcement. */ + tx_thread_sleep(310 * NX_IP_PERIODIC_RATE); + + /* Check whether all packets are transmitted. */ + if(retransmit_count || cycle_count) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + nx_mdns_service_delete(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Sleep 1 seconds for goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *pointer; +UINT current_tick; +UINT expected_tick_diff; +UINT i; +UINT base; + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Get flag. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 30; + + /* Check whether this packet is the announcement. */ + if(((*pointer << 8) + *(pointer + 1)) == (NX_MDNS_RESPONSE_FLAG | NX_MDNS_AA_FLAG)) + { + + /* It is an announcement packet. */ + current_tick = tx_time_get(); + + if(first_packet == NX_FALSE) + { + + /* Check the timer interval. */ + if((p - retransmit_count > 0) && retransmit_count) + { + + /* The packet is retransmitted in one cycle. */ + expected_tick_diff = retrans_interval; + } + else + { + + /* The packet is retransmitted in a new cycle. */ + expected_tick_diff = t; + base = 1 << k; + for(i = (max_time - cycle_count); i > 1; i--) + { + expected_tick_diff *= base; + + /* Whether the max interval reaches. */ + if(expected_tick_diff >= period_interval) + { + expected_tick_diff = period_interval; + break; + } + } + } + + /* Check time interval. */ + if(((int)((current_tick - last_tick) - expected_tick_diff) > TOLERANCE) || + ((int)(expected_tick_diff - (current_tick - last_tick)) > TOLERANCE)) + error_counter++; + } + else + first_packet = NX_FALSE; + + /* Store the current tick. */ + last_tick = current_tick; + + /* Update the count. */ + if(retransmit_count) + retransmit_count--; + if(retransmit_count == 0) + { + if(cycle_count) + cycle_count--; + if(cycle_count) + retransmit_count = p; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_announcement_repeat_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Announcement Repeat Test.............................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_SERVER */ diff --git a/test/regression/mdns_test/netx_mdns_bad_packet_test.c b/test/regression/mdns_test/netx_mdns_bad_packet_test.c new file mode 100644 index 00000000..f199ca7b --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_bad_packet_test.c @@ -0,0 +1,623 @@ +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_MDNS_DISABLE_SERVER +#include "nxd_mdns.h" +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +static VOID cache_full_notify(NX_MDNS *mdns_ptr, UINT state, UINT cache_tye); + +/* Bad packet 1: pointer pass the end of the packet. */ +static unsigned char bad_packet1[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x7f, /* ........ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Bad packet 2: pointer points to itself. */ +static unsigned char bad_packet2[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x0c, /* ........ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Bad packet 3: pointer points to another pointer that + points back to the first pointer. */ +static unsigned char bad_packet3[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x0e, /* ........ */ +0xc0, 0x0c, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* ..tp._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Bad packet 4 */ +static unsigned char bad_packet4[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, /* ........ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Bad packet 5, for _nx_mdns_txt_string_decode. */ +static unsigned char bad_packet5[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x05, 0x8a, 0x00, 0x1f, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8b, 0x06, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x76, /* .......x */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x74, /* .......t */ +0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, /* .....d.. */ +0x09, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ +0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x3f, 0x3f, /* ........ */ +}; + +static UCHAR packet_pool[1048576]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_bad_packet_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + memset(packet_pool, 0x3b, sizeof(packet_pool)); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, packet_pool, sizeof(packet_pool)); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +UCHAR loop; + + printf("NetX Test: MDNS Bad Packet Test......................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link local address. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, 0x00000011, 0x22334456, NX_TRUE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a MDNS instance. */ + current_buffer_size = 2048; + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, 88, buffer + current_buffer_size, 8, NX_NULL); + pointer += DEMO_STACK_SIZE; + + /* Cache notify test. */ + status = _nx_mdns_cache_notify_set(&mdns_0, cache_full_notify); + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for probing and announcing. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + for (loop = 112; loop < 254; loop++) + { + bad_packet1[55] = loop; + + /* Inject bad packets. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 16, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet1, bad_packet1 + 14, sizeof(bad_packet1) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet1 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet1); + } + + /* Inject bad packet 2. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 16, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet1, bad_packet2 + 14, sizeof(bad_packet2) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet1 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet1); + + + /* Inject bad packet 3. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 16, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet1, bad_packet3 + 14, sizeof(bad_packet3) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet1 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet1); + + + /* Inject bad packet 4. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 16, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet1, bad_packet4 + 14, sizeof(bad_packet4) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet1 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet1); + + + nx_mdns_disable(&mdns_0, 0); + nx_mdns_delete(&mdns_0); + + current_buffer_size = 2048; + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer += DEMO_STACK_SIZE; + + /* Cache notify test. */ + status = _nx_mdns_cache_notify_set(&mdns_0, cache_full_notify); + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Inject bad packet 5. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 16, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet1, bad_packet5 + 14, sizeof(bad_packet5) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet1 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet1); + + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID cache_full_notify(NX_MDNS *mdns_ptr, UINT state, UINT cache_type) +{ + + /* The response packet is malformed and should not be added to the cache. */ + printf("ERROR!\n"); + test_control_return(1); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_bad_packet_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Bad Packet Test......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_buffer_size_test.c b/test/regression/mdns_test/netx_mdns_buffer_size_test.c new file mode 100644 index 00000000..cab2a7f1 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_buffer_size_test.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_buffer_size_test(void *first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, (ULONG)(pointer + DEMO_STACK_SIZE), + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +CHAR *pointer = (CHAR*)thread_input; +NX_MDNS_RR *rr; + + printf("NetX Test: MDNS Buffer Size Test....................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + for(current_buffer_size = 8; current_buffer_size < 1000; current_buffer_size += 60) + { + + /* Create */ + nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + +#ifndef NX_MDNS_DISABLE_SERVER + /* Use local buffer. */ + nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Use remote buffer. */ + nx_mdns_service_continuous_query(&mdns_0, "_printer", "_tcp.local", NX_NULL); + + /* Wait two seconds for probing and announcement. */ + tx_thread_sleep(200); + + /* Delete the query. */ + nx_mdns_service_query_stop(&mdns_0, "_printer", "_tcp.local", NX_NULL); +#endif /* NX_MDNS_DISABLE_CLIENT */ + +#ifndef NX_MDNS_DISABLE_SERVER + nx_mdns_service_delete(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL); +#endif /* NX_MDNS_DISABLE_SERVER */ + + /* Delete the mDNS. */ + nx_mdns_delete(&mdns_0); + + /* Wait one second for goodbye packets sent. */ + tx_thread_sleep(100); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_buffer_size_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Buffer Size Test.....................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_create_delete_test.c b/test/regression/mdns_test/netx_mdns_create_delete_test.c new file mode 100644 index 00000000..a9f6fd82 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_create_delete_test.c @@ -0,0 +1,212 @@ +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_create_delete_test(void *first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, (ULONG)(pointer + DEMO_STACK_SIZE), + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +CHAR *pointer = (CHAR*)thread_input; +UINT i; + + printf("NetX Test: MDNS Create Delete Test..................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set pointer. */ + pointer = (CHAR*)thread_input; + + /* Create */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + +#ifndef NX_DISABLE_ERROR_CHECKING + + /* Create 5 times to check whether system crashes. */ + for(i = 0; i < 5; i++) + { + + /* Since it has been created, it should not been created again. */ + if(nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL) == NX_SUCCESS) + error_counter++; + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_mdns_delete(&mdns_0); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + +#ifndef NX_DISABLE_ERROR_CHECKING + + /* Delete 5 times to check whether system crashes. */ + for(i = 0; i < 5; i++) + { + + /* Since it has been deleted, it should not been deleted again. */ + if(nx_mdns_delete(&mdns_0) == NX_SUCCESS) + error_counter++; + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* Sleep 5 seconds then delete. */ + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + tx_thread_sleep(500); + status += nx_mdns_delete(&mdns_0); + + /* Loop 5 times to create and delete. */ + for(i = 0; i < 5; i++) + { + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + status += nx_mdns_delete(&mdns_0); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_create_delete_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Create Delete Test...................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_domain_name_test.c b/test/regression/mdns_test/netx_mdns_domain_name_test.c new file mode 100644 index 00000000..017d7e5a --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_domain_name_test.c @@ -0,0 +1,284 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR *current_domain; +static USHORT current_flag; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_domain_name_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: MDNS Domain Name Test....................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + +#ifndef NX_MDNS_DISABLE_SERVER + /* Add services with default domain 'local'. */ + current_flag = (NX_MDNS_RESPONSE_FLAG | NX_MDNS_AA_FLAG); + NX_CHANGE_USHORT_ENDIAN(current_flag); + current_domain = "local"; + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep 2 seconds. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Add services with specified domain 'home'. */ + current_domain = "home.local"; + + /* Set the domain. */ + status = nx_mdns_domain_name_set(&mdns_0, current_domain); + + nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_printer._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); +#endif /* NX_MDNS_DISABLE_SERVER */ + + /* Sleep 5 seconds. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Query on 'local' domain. */ + current_flag = NX_MDNS_QUERY_FLAG; + NX_CHANGE_USHORT_ENDIAN(current_flag); + current_domain = "local"; + + /* Set the domain. */ + status = nx_mdns_domain_name_set(&mdns_0, current_domain); + + /* Start to query. */ + nx_mdns_service_continuous_query(&mdns_0, NX_NULL, "_workstation._tcp", NX_NULL); + + /* Sleep 5 seconds. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Stop querying. */ + nx_mdns_service_query_stop(&mdns_0, NX_NULL, "_workstation._tcp", NX_NULL); + + /* Query on 'home' domain. */ + current_domain = "home.local"; + + /* Set the domain. */ + status = nx_mdns_domain_name_set(&mdns_0, current_domain); + + /* Start to query. */ + nx_mdns_service_continuous_query(&mdns_0, NX_NULL, "_workstation._tcp", NX_NULL); + + /* Sleep 5 seconds. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Stop querying. */ + nx_mdns_service_query_stop(&mdns_0, NX_NULL, "_workstation._tcp", NX_NULL); + + current_domain = "local"; + + /* Set the domain. */ + status = nx_mdns_domain_name_set(&mdns_0, current_domain); +#endif /* NX_MDNS_DISABLE_CLIENT */ + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *string, *domain; +USHORT flag; +UCHAR *pointer; +UINT domain_length = strlen(current_domain); + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Get flag. */ + flag = *((USHORT*)(packet_ptr -> nx_packet_prepend_ptr + 30)); + + /* Check whether this packet is the one need to verify. */ + if(flag != current_flag) + return NX_TRUE; + + string = packet_ptr -> nx_packet_prepend_ptr + 40; + + /* Find start position of domain. */ + for(domain = string + strlen(string) - 1; domain >= string; domain--) + { + domain_length--; + if(domain_length == 0) + break; + + /* Convert to dot. */ + if(*domain < 64) + *domain = '.'; + } + + if(*domain < 64) + domain++; + + if(strcmp(domain, current_domain)) + error_counter++; + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_domain_name_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Domain Name Test.....................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_interface_test.c b/test/regression/mdns_test/netx_mdns_interface_test.c new file mode 100644 index 00000000..684548c6 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_interface_test.c @@ -0,0 +1,253 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_data[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ +0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ +0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +static void check_empty_buffer(UCHAR *buffer_ptr, ULONG buffer_size, UCHAR expect_empty); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_interface_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + printf("NetX Test: MDNS Interface Test......................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 1); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject mDNS response to primary interface of ip_0. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, 100); + status += nx_packet_data_append(my_packet, mdns_data + 14, sizeof(mdns_data) - 14, &pool_0, 100); + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if(status) + error_counter++; + + /* Sleep one second to then check whether it is received. */ + tx_thread_sleep(100); + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_TRUE); + + /* Enable secondary interface for ip_0. */ + nx_mdns_disable(&mdns_0, 1); + nx_mdns_enable(&mdns_0, 0); + + /* Inject mDNS response to primary interface of ip_0. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, 100); + status += nx_packet_data_append(my_packet, mdns_data + 14, sizeof(mdns_data) - 14, &pool_0, 100); + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if(status) + error_counter++; + + /* Sleep one second to then check whether it is received. */ + tx_thread_sleep(100); + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_FALSE); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void check_empty_buffer(UCHAR *buffer_ptr, ULONG buffer_size, UCHAR expect_empty) +{ + +ULONG *tail, *head; + + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + + /* Check head. */ + head = (ULONG*)buffer_ptr; + if((*head == (ULONG)(head + 1)) && (expect_empty == NX_FALSE)) + error_counter++; + else if((*head != (ULONG)(head + 1)) && (expect_empty == NX_TRUE)) + error_counter++; + + /* Check tail. */ + tail = (ULONG*)buffer_ptr + (buffer_size >> 2) - 1; + if((tail == (ULONG*)(*tail)) && (expect_empty == NX_FALSE)) + error_counter++; + else if((tail != (ULONG*)(*tail)) && (expect_empty == NX_TRUE)) + error_counter++; + + tx_mutex_put(&mdns_0.nx_mdns_mutex); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_interface_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Interface Test.......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_internal_function_test.c b/test/regression/mdns_test/netx_mdns_internal_function_test.c new file mode 100644 index 00000000..8e74982c --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_internal_function_test.c @@ -0,0 +1,1182 @@ +#include "tx_api.h" +#include "nx_api.h" +#include + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1[5]; +static TX_THREAD ntest_2[5]; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static TX_SEMAPHORE sema_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; +static ULONG buffer_org_head; +static ULONG buffer_org_tail; +static ULONG free_buffer_size; +static UINT cache_state; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); +static void check_empty_buffer(UCHAR *buffer_ptr, UINT buffer_size); +static void empty_buffer_init(UCHAR *buffer_ptr, UINT buffer_size); +static VOID cache_full_notify(NX_MDNS *mdns_ptr, UINT state, UINT cache_tye); + +extern UINT _nx_mdns_cache_add_resource_record(NX_MDNS *mdns_ptr, UINT cache_type, NX_MDNS_RR *record_ptr, NX_MDNS_RR **insert_ptr, UCHAR *is_present, UINT interface_index); +extern UINT _nx_mdns_cache_delete_resource_record(NX_MDNS *mdns_ptr, UINT cache_type, NX_MDNS_RR *record_ptr); +extern UINT _nx_mdns_cache_add_string(NX_MDNS *mdns_ptr, UINT cache_type, VOID *string_ptr, UINT string_len, VOID **insert_ptr, UCHAR find_string, UCHAR add_name); +extern UINT _nx_mdns_cache_delete_string(NX_MDNS *mdns_ptr, UINT cache_type, VOID *string_ptr, UINT string_len); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_internal_function_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create semaphore. */ + status = tx_semaphore_create(&sema_0, "SEMA 0", 0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, (ULONG)(pointer + DEMO_STACK_SIZE), + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +CHAR *pointer = (CHAR*)thread_input; +UINT i; +NX_MDNS_RR *last_inserted; +NX_MDNS_RR *inserted[3]; +ULONG head; +NX_MDNS_RR rr[3]; +UCHAR *last_inserted_string; +CHAR test_string[32]; +UCHAR *inserted_strings[4]; +CHAR *test_strings[] = {"First", "Second", "Third", "M"}; +ULONG tail; +NX_MDNS_RR peer_rr; +UINT rr_count; +UCHAR *insert_ptr[30]; +CHAR *cache_string[] = { + "Hello0", + "World0", + "Hello world0", + "Hello world00", + "Hello world000", + "Hello world0000", + "Hello world00000", + "Hello world000000", + "Hello world0000000", + "Hello world00000000", + "Hello world000000000", + "Hello world0000000000", + "Hello world00000000000", + "Hello world000000000000", + "Hello world0000000000000", + "Hello world00000000000000", + "Hello world000000000000000", + "Hello world0000000000000000", + "Hello world00000000000000000", + "Hello world00000000000000000000000000000000000000000000000000000000000000000111111111111111111111122222222222222"}; + + + printf("NetX Test: MDNS Internal Function Test..............................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set pointer. */ + pointer = (CHAR*)thread_input; + + + /**********************************************************/ + /* Test Local and Peer cache notify */ + /**********************************************************/ + + /* Create a MDNS instance. */ + memset(buffer, 0xFF, BUFFER_SIZE); + current_buffer_size = 512; + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Cache notify test. */ + status = _nx_mdns_cache_notify_set(&mdns_0, cache_full_notify); + + /* Check status. */ + if(status) + error_counter++; + +#ifndef NX_MDNS_DISABLE_SERVER + /* Test the local buffer full notify. */ + /* Loop to add string to local buffer until full. */ + i = 0; + while(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE) == NX_SUCCESS) + { + i++; + } + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Deleted the strings. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, insert_ptr[0], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, insert_ptr[2], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, insert_ptr[4], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, insert_ptr[6], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, insert_ptr[8], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 2) + error_counter++; +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Test the peer buffer full notify. */ + /* Loop to add string to local buffer until full. */ + i = 0; + while(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, + cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE) == NX_SUCCESS) + { + i++; + } + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Deleted the strings. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, insert_ptr[0], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, insert_ptr[2], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, insert_ptr[4], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, insert_ptr[6], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 1) + error_counter++; + + /* Delete the string. */ + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, insert_ptr[8], 0); + + /* Add the string. */ + _nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, cache_string[i], strlen(cache_string[i]), (VOID **)&insert_ptr[i], NX_FALSE, NX_TRUE); + + /* Check the cache state. */ + if (cache_state != 2) + error_counter++; +#endif /* NX_MDNS_DISABLE_CLIENT */ + + /* Delet the MDNS instance. */ + _nx_mdns_delete(&mdns_0); + +#ifndef NX_MDNS_DISABLE_SERVER + /**********************************************************/ + /* Cache String Test */ + /**********************************************************/ + + /* Basic string test. */ + /* Initialize the buffer. */ + current_buffer_size = 512; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer, current_buffer_size); + + /* Create 5 threads to test string functions. */ + for(i = 0; i < 5; i++) + { + tx_thread_create(&ntest_2[i], "thread 2", ntest_2_entry, i + 1, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + } + + /* Wait until all threads finish. */ + for(i = 0; i < 5; i++) + { + if(tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + break; + } + } + + check_empty_buffer(buffer, current_buffer_size); + _nx_mdns_delete(&mdns_0); +#endif /* NX_MDNS_DISABLE_SERVER */ + + +#ifndef NX_MDNS_DISABLE_CLIENT + /**********************************************************/ + /* Function Test */ + /**********************************************************/ + + /* Initialize random. */ + srand((UINT)time(0)); + + /* Basic RR test. */ + /* Create a MDNS instance. */ + current_buffer_size = 512; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer + current_buffer_size, current_buffer_size); + + /* Create 5 threads to test string functions. */ + for(i = 0; i < 5; i++) + { + tx_thread_create(&ntest_1[i], "thread 1", ntest_1_entry, i + 1, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + } + + /* Wait until all threads finish. */ + for(i = 0; i < 5; i++) + { + if(tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + break; + } + } + + check_empty_buffer(buffer + current_buffer_size, current_buffer_size); + _nx_mdns_delete(&mdns_0); +#endif /* NX_MDNS_DISABLE_CLIENT */ + + +#ifndef NX_MDNS_DISABLE_SERVER + /**********************************************************/ + /* Local Cache RR Test */ + /**********************************************************/ + + /* RR full test. */ + /* Initialize the buffer. */ + current_buffer_size = BUFFER_SIZE >> 1; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer, current_buffer_size); + + /* Loop to add resource record to local buffer until full. */ + i = 0; + memset(&rr[0], 0, sizeof(NX_MDNS_RR)); + do + { + rr[0].nx_mdns_rr_name = (UCHAR *)"test"; + rr[0].nx_mdns_rr_type = NX_MDNS_RR_TYPE_A; + rr[0].nx_mdns_rr_class = (USHORT)i; + rr[0].nx_mdns_rr_ttl = i; + rr[0].nx_mdns_rr_rdata_length = (USHORT)i; + rr[0].nx_mdns_rr_timer_count = 0; + rr[0].nx_mdns_rr_retransmit_count = (UCHAR)(i + 1); + rr[0].nx_mdns_rr_state = NX_MDNS_RR_STATE_VALID; + i++; + }while(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + &rr[0], &last_inserted, NX_NULL, 0) == NX_SUCCESS); + + i--; + + /* HEAD and TAIL take 4 bytes each. */ + if(i != (free_buffer_size / sizeof(NX_MDNS_RR))) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != i) + error_counter++; + if(mdns_0.nx_mdns_local_string_count != 0) + error_counter++; + if(mdns_0.nx_mdns_local_string_bytes != 0) + error_counter++; + + /* Delete all inserted resource records. */ + while(i > 0) + { + + /* Add it again. */ + i--; + rr[0].nx_mdns_rr_name = (UCHAR *)"test"; + rr[0].nx_mdns_rr_type = NX_MDNS_RR_TYPE_A; + rr[0].nx_mdns_rr_class = (USHORT)i; + rr[0].nx_mdns_rr_ttl = i; + rr[0].nx_mdns_rr_rdata_length = (USHORT)i; + rr[0].nx_mdns_rr_timer_count = 0; + rr[0].nx_mdns_rr_retransmit_count = (UCHAR)(i + 1); + rr[0].nx_mdns_rr_state = NX_MDNS_RR_STATE_VALID; + + if(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + &rr[0], &last_inserted, NX_NULL, 0)) + { + + /* No error is expected. */ + error_counter++; + break; + } + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != i + 1) + error_counter++; + + if(_nx_mdns_cache_delete_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, last_inserted)) + { + + /* No error is expected. */ + error_counter++; + break; + } + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != i) + error_counter++; + } + + check_empty_buffer(buffer, current_buffer_size); + _nx_mdns_delete(&mdns_0); + + + /* RR middle usage test. */ + /* Initialize the buffer. */ + current_buffer_size = BUFFER_SIZE >> 1; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer, current_buffer_size); + + /* Initialize RRs. */ + memset(&rr, 0, sizeof(rr)); + for(i = 0; i < 3; i++) + { + rr[i].nx_mdns_rr_name = (UCHAR *)"test"; + rr[i].nx_mdns_rr_type = NX_MDNS_RR_TYPE_A; + rr[i].nx_mdns_rr_class = (USHORT)i; + rr[i].nx_mdns_rr_ttl = i; + rr[i].nx_mdns_rr_rdata_length = (USHORT)i; + rr[i].nx_mdns_rr_timer_count = 0; + rr[i].nx_mdns_rr_retransmit_count = (UCHAR)(i + 1); + rr[i].nx_mdns_rr_state = NX_MDNS_RR_STATE_VALID; + } + + /* Add two RRs. */ + if(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, &rr[0], &inserted[0], NX_NULL, 0)) + error_counter++; + + if(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, &rr[1], &inserted[1], NX_NULL, 0)) + error_counter++; + + /* Store HEAD. */ + head = *((ULONG*)buffer); + + /* Delete the first resource record. */ + if(_nx_mdns_cache_delete_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted[0])) + error_counter++; + + /* Add the third RR. */ + if(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, &rr[2], &inserted[2], NX_NULL, 0)) + error_counter++; + + /* Check HEAD. */ + if(head != *((ULONG*)buffer)) + error_counter++; + + /* Delete all RRs. */ + if(_nx_mdns_cache_delete_resource_record(&mdns_0,NX_MDNS_CACHE_TYPE_LOCAL, inserted[1])) + error_counter++; + if(_nx_mdns_cache_delete_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted[2])) + error_counter++; + + check_empty_buffer(buffer, current_buffer_size); + _nx_mdns_delete(&mdns_0); +#endif /* NX_MDNS_DISABLE_SERVER */ + + +#ifndef NX_MDNS_DISABLE_CLIENT + /**********************************************************/ + /* Peer Cache RR Test */ + /**********************************************************/ + + /* Create a MDNS instance. */ + memset(buffer, 0xFF, BUFFER_SIZE); + current_buffer_size = 512; + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Enable the MDNS function. */ + _nx_mdns_enable(&mdns_0, 0); + + /* Loop to add resource record to peer buffer. */ + memset(&peer_rr, 0, sizeof(NX_MDNS_RR)); + for (i = 0; i < 100; i++) + { + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, "test", strlen("test"), (VOID **)&(peer_rr.nx_mdns_rr_name), NX_FALSE, NX_TRUE)) + error_counter++; + peer_rr.nx_mdns_rr_type = NX_MDNS_RR_TYPE_A; + peer_rr.nx_mdns_rr_class = (USHORT)i; + peer_rr.nx_mdns_rr_ttl = i; + peer_rr.nx_mdns_rr_rdata_length = (USHORT)i; + peer_rr.nx_mdns_rr_timer_count = 0; + peer_rr.nx_mdns_rr_retransmit_count = (UCHAR)(i + 1); + peer_rr.nx_mdns_rr_state = NX_MDNS_RR_STATE_VALID; + if (_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, + &peer_rr, &last_inserted, NX_NULL, 0)) + error_counter++; + + rr_count = (current_buffer_size - mdns_0.nx_mdns_peer_string_bytes - 2 * sizeof(ULONG)) / sizeof(NX_MDNS_RR); + if (i > (rr_count - 1)) + { + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != rr_count) + error_counter++; + } + else + { + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != i + 1) + error_counter++; + } + } + + if(_nx_mdns_cache_delete_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, last_inserted)) + { + + /* No error is expected. */ + error_counter++; + } + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != (rr_count - 1)) + error_counter++; + + /* Disable the MDNS function. */ + _nx_mdns_disable(&mdns_0, 0); + + /* Delet the MDNS instance. */ + _nx_mdns_delete(&mdns_0); +#endif /* NX_MDNS_DISABLE_CLIENT */ + + +#ifndef NX_MDNS_DISABLE_SERVER + /* String full test. */ + /* Initialize the buffer. */ + current_buffer_size = BUFFER_SIZE >> 1; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer, current_buffer_size); + /* Loop to add string to local buffer until full. */ + i = 0; + sprintf(test_string, "%.15d", i); + while(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_string, 15, (VOID **)&last_inserted_string, NX_FALSE, NX_TRUE) == NX_SUCCESS) + { + i++; + sprintf(test_string, "%.15d", i); + } + + /* HEAD and TAIL take 4 bytes each. Each string take 5 extra bytes. */ + if(i != (free_buffer_size / 20)) + error_counter++; + + /* HEAD and TAIL take 4 bytes each. Each string take 5 extra bytes. */ + if(i != (free_buffer_size / 20)) + error_counter++; + + if(mdns_0.nx_mdns_local_rr_count != 0) + error_counter++; + if(mdns_0.nx_mdns_local_string_count != i) + error_counter++; + if(mdns_0.nx_mdns_local_string_bytes != i * 20) + error_counter++; + /* Delete all inserted strings. */ + while(i > 0) + { + + /* Add it again. */ + sprintf(test_string, "%.15d", i - 1); + + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_string, 15, (VOID **)&last_inserted_string, NX_FALSE, NX_TRUE)) + { + + /* No error is expected. */ + error_counter++; + break; + } + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_string_count != i) + error_counter++; + if(mdns_0.nx_mdns_local_string_bytes != i * 20) + error_counter++; + + /* Delete the string twice. */ + if(_nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, last_inserted_string, 0)) + { + + /* No error is expected. */ + error_counter++; + break; + } + if(_nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, last_inserted_string, 0)) + { + + /* No error is expected. */ + error_counter++; + break; + } + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_string_count != (i - 1)) + error_counter++; + if(mdns_0.nx_mdns_local_string_bytes != (i - 1) * 20) + error_counter++; + + i--; + } + + check_empty_buffer(buffer, current_buffer_size); + + _nx_mdns_delete(&mdns_0); + +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + + /* String full test. */ + /* Initialize the buffer. */ + current_buffer_size = BUFFER_SIZE >> 1; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer + current_buffer_size, current_buffer_size); + + /* Loop to add string to peer buffer until full. */ + i = 0; + sprintf(test_string, "%.15d", i); + while(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, + test_string, 15, (VOID **)&last_inserted_string, NX_FALSE, NX_TRUE) == NX_SUCCESS) + { + i++; + sprintf(test_string, "%.15d", i); + } + + /* HEAD and TAIL take 4 bytes each. Each string take 5 extra bytes. */ + if(i != (free_buffer_size / 20)) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != 0) + error_counter++; + if(mdns_0.nx_mdns_peer_string_count != i) + error_counter++; + if(mdns_0.nx_mdns_peer_string_bytes != i * 20) + error_counter++; + + /* Delete all inserted strings. */ + while(i > 0) + { + + /* Add it again. */ + sprintf(test_string, "%.15d", i - 1); + + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, + test_string, 15, (VOID **)&last_inserted_string, NX_FALSE, NX_TRUE)) + { + + /* No error is expected. */ + error_counter++; + break; + } + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_string_count != i) + error_counter++; + if(mdns_0.nx_mdns_peer_string_bytes != i * 20) + error_counter++; + + /* Delete the string twice. */ + if(_nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, last_inserted_string, 0)) + { + + /* No error is expected. */ + error_counter++; + break; + } + if(_nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, last_inserted_string, 0)) + { + + /* No error is expected. */ + error_counter++; + break; + } + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_string_count != (i - 1)) + error_counter++; + if(mdns_0.nx_mdns_peer_string_bytes != (i - 1) * 20) + error_counter++; + + i--; + } + + check_empty_buffer(buffer + current_buffer_size, current_buffer_size); + + _nx_mdns_delete(&mdns_0); +#endif /* NX_MDNS_DISABLE_CLIENT */ + + +#ifndef NX_MDNS_DISABLE_SERVER + /* String middle usage. */ + /* Initialize the buffer. */ + current_buffer_size = 512; + memset(buffer, 0xFF, BUFFER_SIZE); + status = _nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + empty_buffer_init(buffer, current_buffer_size); + + /* Insert 3 strings. */ + for(i = 0; i < 3; i++) + { + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_strings[i], strlen(test_strings[i]), (VOID **)&inserted_strings[i], NX_FALSE, NX_TRUE)) + { + + /* No error is expected. */ + error_counter++; + break; + } + } + + /* Store TAIL. */ + tail = *((ULONG*)buffer + (current_buffer_size >> 2) - 1); + + /* Delete the string in middle. */ + if(_nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted_strings[1], 0)) + error_counter++; + + /* Insert a string that is less than deleted one. */ + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_strings[i], strlen(test_strings[i]), (VOID **)&inserted_strings[i], NX_FALSE, NX_TRUE)) + error_counter++; + + /* Check TAIL. */ + if(tail != *((ULONG*)buffer + (current_buffer_size >> 2) - 1)) + error_counter++; + + /* Deleted all strings. */ + for(i = 0; i < 4; i++) + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted_strings[i], 0); + + check_empty_buffer(buffer, current_buffer_size); + _nx_mdns_delete(&mdns_0); +#endif /* NX_MDNS_DISABLE_SERVER */ + + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ +CHAR *test_strings[] = { + "1", + "a", + "b", + "c", + "MDNS", + "Hello world0", + "Hello world1", + "Hello world1 Hello", + "Hello hello Hello", + "Hello Hello Hello Hello", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", +}; +UINT string_count= sizeof(test_strings) / sizeof(CHAR*); +INT loop_count = 1000; +UINT add_count; +NX_MDNS_RR rr[5]; +NX_MDNS_RR *inserted_rr[5]; +UCHAR *inserted_strings[5]; +UINT index; + + + + /* Loop 1000 times to add and delete strings */ + while(loop_count > 0) + { + if ((loop_count == 0x00000232) && + (thread_input == 1)) + thread_input = thread_input; + + if ((loop_count == 0x00000235) && + (thread_input == 5)) + thread_input = thread_input; + + /* Initialize variables. */ + add_count = 0; + memset(rr, 0, sizeof(rr)); + memset(inserted_strings, 0, sizeof(inserted_strings)); + memset(inserted_rr, 0, sizeof(inserted_strings)); + + /* Insert records. */ + while(add_count < thread_input) + { + + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + if(add_count & 1) + { + + /* Insert same RR when add_count is odd. */ + memcpy(&rr[add_count], &rr[add_count - 1], sizeof(NX_MDNS_RR)); + if(rr[add_count].nx_mdns_rr_name) + { + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_strings[index], strlen(test_strings[index]), (VOID **)&rr[add_count].nx_mdns_rr_name, NX_FALSE, NX_TRUE) == NX_SUCCESS) + { + inserted_strings[add_count] = rr[add_count].nx_mdns_rr_name; + + /* Insert rr. */ + if(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + &rr[add_count], &inserted_rr[add_count], NX_NULL, 0)) + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted_strings[add_count], 0); + + } + } + } + else + { + index = rand() % string_count; + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_strings[index], strlen(test_strings[index]), (VOID **)&rr[add_count].nx_mdns_rr_name, NX_FALSE, NX_TRUE) == NX_SUCCESS) + { + + /* Set random values. */ + inserted_strings[add_count] = rr[add_count].nx_mdns_rr_name; + rr[add_count].nx_mdns_rr_type = NX_MDNS_RR_TYPE_A; + rr[add_count].nx_mdns_rr_class = (USHORT)thread_input; + rr[add_count].nx_mdns_rr_ttl = add_count + 100; + rr[add_count].nx_mdns_rr_rdata_length = rand() % 0xFFFF; + rr[add_count].nx_mdns_rr_timer_count = 0; + rr[add_count].nx_mdns_rr_retransmit_count = (UCHAR)(rand() % 0xFFFF); + rr[add_count].nx_mdns_rr_state = NX_MDNS_RR_STATE_VALID; + + /* Insert rr. */ + if(_nx_mdns_cache_add_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + &rr[add_count], &inserted_rr[add_count], NX_NULL, 0)) + _nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted_strings[add_count], 0); + + } + } + + add_count++; + loop_count--; + tx_mutex_put(&mdns_0.nx_mdns_mutex); + tx_thread_relinquish(); + + } + + /* Delete all inserted strings and records. */ + while(add_count--) + { + + /* No error is expected. */ + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + if ((inserted_rr[add_count]) && (inserted_rr[add_count] -> nx_mdns_rr_name)) + { + _nx_mdns_cache_delete_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted_rr[add_count]); + } + tx_mutex_put(&mdns_0.nx_mdns_mutex); + tx_thread_relinquish(); + } + } + tx_semaphore_put(&sema_0); + +} + + +static void ntest_2_entry(ULONG thread_input) +{ +CHAR *test_strings[] = { + "1", + "a", + "b", + "c", + "MDNS", + "Hello world0", + "Hello world1", + "Hello world1 Hello", + "Hello hello Hello", + "Hello Hello Hello Hello", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", +}; +UINT string_count= sizeof(test_strings) / sizeof(CHAR*); +INT loop_count = 1000; +UINT add_count; +UCHAR *inserted_strings[5]; +UINT index; + + /* Loop 1000 times to add and delete strings */ + while(loop_count > 0) + { + + /* Initialize variables. */ + add_count = 0; + memset(inserted_strings, 0, sizeof(inserted_strings)); + + /* Insert strings. */ + while(add_count < thread_input) + { + index = rand() % string_count; + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + if(_nx_mdns_cache_add_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, + test_strings[index], strlen(test_strings[index]), (VOID **)&inserted_strings[add_count], NX_FALSE, NX_TRUE)) + { + + /* Only the last string exceed the buffer. */ + if(index != (string_count - 1)) + { + tx_mutex_put(&mdns_0.nx_mdns_mutex); + error_counter++; + tx_semaphore_put(&sema_0); + return; + } + } + else + { + add_count++; + loop_count--; + } + tx_mutex_put(&mdns_0.nx_mdns_mutex); + tx_thread_relinquish(); + } + + /* Delete all inserted strings. */ + while(add_count--) + { + + /* No error is expected. */ + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + if(_nx_mdns_cache_delete_string(&mdns_0, NX_MDNS_CACHE_TYPE_LOCAL, inserted_strings[add_count], 0)) + { + tx_mutex_put(&mdns_0.nx_mdns_mutex); + error_counter++; + tx_semaphore_put(&sema_0); + return; + } + tx_mutex_put(&mdns_0.nx_mdns_mutex); + tx_thread_relinquish(); + } + } + + tx_semaphore_put(&sema_0); +} + + +VOID cache_full_notify(NX_MDNS *mdns_ptr, UINT state, UINT cache_type) +{ + + switch(state) + { + case NX_MDNS_CACHE_STATE_FULL: + { + + cache_state = 1; + break; + } + case NX_MDNS_CACHE_STATE_FRAGMENTED: + { + cache_state = 2; + break; + } + default: + { + cache_state = 0; + break; + } + } +} + +static void check_empty_buffer(UCHAR *buffer_ptr, UINT buffer_size) +{ + +ULONG *tail, *head; +UINT i; + + /* Check the head of buffer. */ + head = (ULONG*)buffer_ptr; + if(*head != buffer_org_head) + error_counter++; + + /* Check the tail of buffer. */ + /* Since all strings are deleted, tail should pointer to the end of buffer. */ + tail = (ULONG*)buffer_ptr + (buffer_size >> 2) - 1; + if(*tail != buffer_org_tail) + error_counter++; + + /* Check buffer overflow. */ + for(i = (buffer_size << 1); i < buffer_size; i++) + { + if(buffer_ptr[i] != 0xFF) + { + error_counter++; + break; + } + } +} + +static void empty_buffer_init(UCHAR *buffer_ptr, UINT buffer_size) +{ +ULONG *tail, *head; + + head = (ULONG*)buffer_ptr; + buffer_org_head = *head; + + tail = (ULONG*)buffer_ptr + (buffer_size >> 2) - 1; + buffer_org_tail = *tail; + + free_buffer_size = buffer_org_tail - buffer_org_head; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_internal_function_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Internal Function Test...............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_ipv6_string_test.c b/test/regression/mdns_test/netx_mdns_ipv6_string_test.c new file mode 100644 index 00000000..f5f7db3c --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_ipv6_string_test.c @@ -0,0 +1,429 @@ +#include "tx_api.h" +#include "nx_api.h" +#include + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 && !defined NX_MDNS_DISABLE_CLIENT && defined NX_MDNS_ENABLE_IPV6 +#include "nxd_mdns.h" +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern UINT _nx_mdns_cache_add_string(NX_MDNS *mdns_ptr, UINT cache_type, VOID *string_ptr, UINT string_len, VOID **insert_ptr, UCHAR find_string, UCHAR add_name); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); +extern UINT _nx_mdns_cache_delete_resource_record(NX_MDNS *mdns_ptr, UINT cache_type, NX_MDNS_RR *record_ptr); + +/* Frame (185 bytes) */ +static unsigned char response1[185] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* 33...... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x86, 0xdd, 0x60, 0x00, /* ..z...`. */ +0x00, 0x00, 0x00, 0x83, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1e, /* ........ */ +0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, 0xff, 0x02, /* ....z... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x83, 0x30, 0x75, 0x00, 0x00, /* ....0u.. */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, /* .......C */ +0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ +0x30, 0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, /* 00w...ro */ +0x75, 0x74, 0x65, 0x72, 0xc0, 0x17, 0x00, 0x1c, /* uter.... */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ +0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x02, 0x1e, 0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, /* ......z. */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + +/* Frame (126 bytes) */ +static unsigned char response2[126] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x15, /* 33...... */ +0x5d, 0x64, 0x17, 0x05, 0x86, 0xdd, 0x60, 0x02, /* ]d....`. */ +0xe9, 0x46, 0x00, 0x48, 0x11, 0xff, 0x20, 0x01, /* .F.H.. . */ +0x04, 0x70, 0xf4, 0xde, 0x30, 0x00, 0x00, 0x00, /* .p..0... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ +0x14, 0xe9, 0x00, 0x48, 0x63, 0xa9, 0x00, 0x00, /* ...Hc... */ +0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* ..._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, /* ..._smb. */ +0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23 /* _tcp.# */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_ipv6_string_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + status = nxd_ipv6_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_MDNS_RR *p; +ULONG *head; +ULONG *tail; +ULONG temp_tail; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_MDNS_RR *ptr = NX_NULL; +NX_MDNS_RR *aaaa = NX_NULL; +NX_MDNS_RR *srv = NX_NULL; +NX_MDNS_RR *txt = NX_NULL; +NX_MDNS_RR *dns_sd_ptr = NX_NULL; +UINT dns_sd_ptr_string_len = 0; + + + printf("NetX Test: MDNS IPv6 String Test....................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link local address. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, 0x00000011, 0x22334456, NX_TRUE); + status += nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a MDNS instance. */ + current_buffer_size = 2048; + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer += DEMO_STACK_SIZE; + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for probing and announcing. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject two packet to store the response in peer cache. + If the IPv6 address is added into cache as string, + The logic for deleting string in _nx_mdns_cache_delete_string() is incorrect. + For example, + Step1. Add ipv6_address_string (0x000080fe, ...). into cache. + Step2. Add string1 into cache.The strings in cache are string1, ipv6_address_string. + Step3. Delete string1 from cache. + After step3, the ipv6_address_string may also be deleted in some case since string_len = strlen(string_ptr), cnt are 0. */ + + /* Inject mDNS response1 to primary interface of ip_0. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 16, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet1, response1 + 14, sizeof(response1) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet1 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet1); + + /* After process this packet, the IPv6 address string in cache is the last string . */ + + + /* Inject mDNS response2 to primary interface of ip_0. */ + status = nx_packet_allocate(&pool_0, &my_packet2, 16, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the data. */ + status = nx_packet_data_append(my_packet2, response2 + 14, sizeof(response2) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface and receive the packet. */ + my_packet2 -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet2); + + /* After process this packet, the dns PTR string in cache is after IPv6 address string. */ + + + /* Wait for process response. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + head = (ULONG*)mdns_0.nx_mdns_peer_service_cache; + tail = (ULONG*)(*head); + + /* Delete TXT resource record. */ + for (p = (NX_MDNS_RR*)(head + 1); (ULONG*)p < tail; p++) + { + + /* Check the entry type. */ + if (p -> nx_mdns_rr_state == NX_MDNS_RR_STATE_INVALID) + continue; + + /* Check the type. */ + if (p -> nx_mdns_rr_type == NX_MDNS_RR_TYPE_PTR) + { + if (memcmp(p -> nx_mdns_rr_name, "_services._dns-sd._udp.local", strlen("_services._dns-sd._udp.local"))) + ptr = p; + else + dns_sd_ptr = p; + } + else if (p -> nx_mdns_rr_type == NX_MDNS_RR_TYPE_AAAA) + aaaa = p; + else if (p -> nx_mdns_rr_type == NX_MDNS_RR_TYPE_SRV) + srv = p; + else if (p -> nx_mdns_rr_type == NX_MDNS_RR_TYPE_TXT) + txt = p; + } + + /* Check the rr count (PTR, AAAA, SRV, TXT, dns-sd PTR). */ + if ((mdns_0.nx_mdns_peer_rr_count != 5) || + (ptr == NX_NULL) || + (aaaa == NX_NULL) || + (srv == NX_NULL) || + (txt == NX_NULL) || + (dns_sd_ptr == NX_NULL)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check dns PTR info. */ + if ((memcmp(dns_sd_ptr -> nx_mdns_rr_name, "_services._dns-sd._udp.local", strlen("_services._dns-sd._udp.local"))) || + (memcmp(dns_sd_ptr -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_ptr.nx_mdns_rr_ptr_name, "_smb._tcp.local", strlen("_smb._tcp.local")))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the string tail info. */ + tail = (ULONG*)mdns_0.nx_mdns_peer_service_cache + (mdns_0.nx_mdns_peer_service_cache_size >> 2) - 1; + temp_tail = (ULONG)(*tail); + + /* The tail should be dns-sd PTR string. */ + if (dns_sd_ptr -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_ptr.nx_mdns_rr_ptr_name != (UCHAR*)(*tail)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compute the string length. */ + dns_sd_ptr_string_len = ((strlen((const char*)dns_sd_ptr -> nx_mdns_rr_name) & 0xFFFFFFFC) + 8) & 0xFFFFFFFF; + dns_sd_ptr_string_len += ((strlen((const char*)dns_sd_ptr -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_ptr.nx_mdns_rr_ptr_name) & 0xFFFFFFFC) + 8) & 0xFFFFFFFF; + + /* Check the string length. */ + if (dns_sd_ptr_string_len != 56) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the TXT info. */ + if (memcmp(txt -> nx_mdns_rr_name, "CanonMF4500w._http._tcp.local", strlen("CanonMF4500w._http._tcp.local"))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check SRV info. */ + if ((memcmp(srv -> nx_mdns_rr_name, "CanonMF4500w._http._tcp.local", strlen("CanonMF4500w._http._tcp.local"))) || + (memcmp(srv -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_srv.nx_mdns_rr_srv_target, "router.local", strlen("router.local"))) || + (srv -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_srv.nx_mdns_rr_srv_port != 80) || + (srv -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_srv.nx_mdns_rr_srv_priority != 0) || + (srv -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_srv.nx_mdns_rr_srv_weights != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check AAAA info. */ + if ((memcmp(aaaa -> nx_mdns_rr_name, "router.local", strlen("router.local"))) || + (aaaa -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_aaaa.nx_mdns_rr_aaaa_address[0] != 0xfe800000) || + (aaaa -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_aaaa.nx_mdns_rr_aaaa_address[1] != 0x00000000) || + (aaaa -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_aaaa.nx_mdns_rr_aaaa_address[2] != 0x021e8fff)|| + (aaaa -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_aaaa.nx_mdns_rr_aaaa_address[3] != 0xfeb17ad4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check PTR info. */ + if ((memcmp(ptr -> nx_mdns_rr_name, "_http._tcp.local", strlen("_http._tcp.local"))) || + (memcmp(ptr -> nx_mdns_rr_rdata.nx_mdns_rr_rdata_ptr.nx_mdns_rr_ptr_name, "CanonMF4500w._http._tcp.local", strlen("CanonMF4500w._http._tcp.local")))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete dns-sd PTR record. */ + _nx_mdns_cache_delete_resource_record(&mdns_0, NX_MDNS_CACHE_TYPE_PEER, dns_sd_ptr); + + /* Check the string tail info. */ + tail = (ULONG*)mdns_0.nx_mdns_peer_service_cache + (mdns_0.nx_mdns_peer_service_cache_size >> 2) - 1; + + /* The tail should be dns PTR string. */ + if (*tail != temp_tail + dns_sd_ptr_string_len) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_ipv6_string_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS IPv6 String Test.....................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_local_cache_continuous_query_test.c b/test/regression/mdns_test/netx_mdns_local_cache_continuous_query_test.c new file mode 100644 index 00000000..ea07621f --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_local_cache_continuous_query_test.c @@ -0,0 +1,298 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static CHAR host_registered = NX_FALSE; +static CHAR service_registered = NX_FALSE; +static CHAR query_received; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID probing_notify(struct NX_MDNS_STRUCT *mdns_ptr, UCHAR *name, UINT state); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_local_cache_continuous_query_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 0, 31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + + NX_PARAMETER_NOT_USED(thread_input); + + printf("NetX Test: MDNS Local Cache Continuous Query Test...................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR*)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, probing_notify); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for host probing. */ + while(host_registered == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Add a service. */ + if(nx_mdns_service_add(&mdns_0, (UCHAR*)"test", (UCHAR *)"_http._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for service probing. */ + while(service_registered == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Initialize the query received. */ + query_received = 0; + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Start one-shot query. */ + if(nx_mdns_service_continuous_query(&mdns_0, NX_NULL, (UCHAR*)"_http._tcp", NX_NULL)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for query. */ + while(query_received == 0) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *packet_pointer; +USHORT mdns_flags; +USHORT question_count; +USHORT answer_count; + + + + NX_PARAMETER_NOT_USED(ip_ptr); + NX_PARAMETER_NOT_USED(operation_ptr); + NX_PARAMETER_NOT_USED(delay_ptr); + + /* Get protocol. */ + packet_pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*packet_pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + packet_pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*packet_pointer << 8) + *(packet_pointer + 1)) != 5353) || + (((*(packet_pointer + 2) << 8) + *(packet_pointer + 3)) != 5353)) + return NX_TRUE; + + /* Point to mDNS message. */ + packet_pointer = packet_ptr -> nx_packet_prepend_ptr + 28; + + /* Extract the message type which should be the first byte. */ + mdns_flags = NX_MDNS_GET_USHORT_DATA(packet_pointer + NX_MDNS_FLAGS_OFFSET); + + /* Check whether this packet is the query. */ + if(mdns_flags != NX_MDNS_QUERY_FLAG) + return NX_TRUE; + + /* Increase the query count. */ + query_received++; + + /* Get the question count. */ + question_count = NX_MDNS_GET_USHORT_DATA(packet_pointer + NX_MDNS_QDCOUNT_OFFSET); + + /* Determine if we have any 'answers' to our DNS query. */ + answer_count = NX_MDNS_GET_USHORT_DATA(packet_pointer + NX_MDNS_ANCOUNT_OFFSET); + + /* Check the question count and answer count. */ + if ((question_count != 1) || (answer_count != 1)) + error_counter++; + + return NX_TRUE; +} + +static VOID probing_notify(struct NX_MDNS_STRUCT *mdns_ptr, UCHAR *name, UINT state) +{ + + NX_PARAMETER_NOT_USED(mdns_ptr); + NX_PARAMETER_NOT_USED(name); + + switch(state) + { + case NX_MDNS_LOCAL_SERVICE_REGISTERED_SUCCESS: + { + service_registered = NX_TRUE; + break; + } + case NX_MDNS_LOCAL_SERVICE_REGISTERED_FAILURE: + { + service_registered = NX_FALSE; + break; + } + case NX_MDNS_LOCAL_HOST_REGISTERED_SUCCESS: + { + host_registered = NX_TRUE; + break; + } + case NX_MDNS_LOCAL_HOST_REGISTERED_FAILURE: + { + host_registered = NX_FALSE; + break; + } + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_local_cache_continuous_query_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Local Cache Continuous Query Test....................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ + diff --git a/test/regression/mdns_test/netx_mdns_local_cache_one_shot_query_test.c b/test/regression/mdns_test/netx_mdns_local_cache_one_shot_query_test.c new file mode 100644 index 00000000..548af151 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_local_cache_one_shot_query_test.c @@ -0,0 +1,204 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 + +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static NX_MDNS_SERVICE service_instance; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_local_cache_one_shot_query_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192,168,0,31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: MDNS Local Cache One Shot Query Test......................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add service to send probing. */ + nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL, (CHAR *)"paper=A4", 4500, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep two seconds for probing. */ + tx_thread_sleep(200); + + /* One shot query. The answer is in local cache. */ + status = nx_mdns_service_one_shot_query(&mdns_0, "ARMMDNSTest", "_ipp._tcp", NX_NULL, &service_instance, 1); + + if(status) + error_counter++; + else + { + + /* Check every field. */ + if(service_instance.interface_index != 0) + error_counter++; + if(strcmp(service_instance.service_domain, "local") != 0) + error_counter++; + if(strcmp(service_instance.service_host, "NETX-MDNS.local") != 0) + error_counter++; + if(service_instance.service_ipv4 != IP_ADDRESS(192,168,0,31)) + error_counter++; + if(strcmp(service_instance.service_name, "ARMMDNSTest") != 0) + error_counter++; + if(service_instance.service_port != 80) + error_counter++; + if(service_instance.service_priority != 0) + error_counter++; + if(strcmp(service_instance.service_text, "paper=A4") != 0) + error_counter++; + if(service_instance.service_text_valid == NX_FALSE) + error_counter++; + if(strcmp(service_instance.service_type, "_ipp._tcp") != 0) + error_counter++; + if(service_instance.service_weight != 0) + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_local_cache_one_shot_query_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Local Cache One Shot Query Test......................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ diff --git a/test/regression/mdns_test/netx_mdns_multiple_answers_test.c b/test/regression/mdns_test/netx_mdns_multiple_answers_test.c new file mode 100644 index 00000000..7ca11d6d --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_multiple_answers_test.c @@ -0,0 +1,262 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static ULONG answer_received; +static UCHAR mdns_data[] = +{ +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ +0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ +0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ +0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ +0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01 /* .... */ +}; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static NX_PACKET *current_packet; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_multiple_answers_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NXD_ADDRESS address; + + printf("NetX Test: MDNS Multiple Answers Test................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create two services. */ + status = nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + status += nx_mdns_service_add(&mdns_0, (CHAR *)"Simple Web Server", (CHAR *)"_http._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + if(status) + error_counter++; + + /* Sleep 5 seconds for probing and announcement. */ + tx_thread_sleep(500); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Reset the counter. */ + answer_received = 0; + + /* Send MULTICAST address. */ + address.nxd_ip_version = NX_IP_VERSION_V4; + address.nxd_ip_address.v4 = NX_MDNS_IPV4_MULTICAST_ADDRESS; + + /* Allocate a query packet. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data + 42, sizeof(mdns_data) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&mdns_0.nx_mdns_socket, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check received answers. */ + tx_thread_sleep(100); + if(answer_received != 2) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR *pointer; + + if(packet_ptr == current_packet) + { + + /* Inject it to IP layer. */ + packet_ptr -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + return NX_FALSE; + } + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Get flag. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 30; + + /* Check whether this packet is the response. */ + if(((*pointer << 8) + *(pointer + 1)) != (NX_MDNS_RESPONSE_FLAG | NX_MDNS_AA_FLAG)) + { + + /* It is not a response packet. */ + return NX_TRUE; + } + + /* Get the answer RRs. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 34; + answer_received = (*pointer << 8) + *(pointer + 1); + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_multiple_answers_test(void *first_unused_memory) +#endif +{ + + printf("NetX Test: MDNS Multiple Answers Test................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_SERVER */ diff --git a/test/regression/mdns_test/netx_mdns_name_test.c b/test/regression/mdns_test/netx_mdns_name_test.c new file mode 100644 index 00000000..d98b402e --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_name_test.c @@ -0,0 +1,217 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; +static UCHAR name_buffer[100]; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +static VOID build_name(UINT length); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_name_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +ULONG name_length; + + printf("NetX Test: MDNS Name Test............................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, mdns_stack, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + nx_mdns_enable(&mdns_0, 0); + + /* Test max length instance name, (NX_MDNS_LABEL_MAX - 4). */ + name_length = (NX_MDNS_LABEL_MAX - 4); + build_name(name_length); + +#ifndef NX_MDNS_DISABLE_SERVER + /* Total length is 59. */ + status += nx_mdns_service_add(&mdns_0, name_buffer, (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Total length is 59. */ + status += nx_mdns_service_continuous_query(&mdns_0, name_buffer, "_ipp._tcp", NX_NULL); +#endif /* NX_MDNS_DISABLE_CLIENT */ + + /* Check status. */ + if(status) + error_counter++; + + /* Test strings exceed max length, (NX_MDNS_LABEL_MAX - 4) + 1. */ + name_length = (NX_MDNS_LABEL_MAX - 4) + 1; + build_name(name_length); + +#ifndef NX_DISABLE_ERROR_CHECKING +#ifndef NX_MDNS_DISABLE_SERVER + /* Total length is 60. */ + status = nx_mdns_service_add(&mdns_0, name_buffer, (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Check status. */ + if(!status) + error_counter++; +#endif /* NX_MDNS_DISABLE_SERVER */ +#endif /* NX_DISABLE_ERROR_CHECKING */ + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Total length is 60. */ + status = nx_mdns_service_continuous_query(&mdns_0, name_buffer, "_ipp._tcp", NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +#endif /* NX_MDNS_DISABLE_CLIENT */ + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static VOID build_name(UINT length) +{ + +UINT i; + + /* Add lower case character. */ + for(i = 1; i <= length; i++) + { + if(i % 64 == 0 ) + name_buffer[i - 1] = '.'; + else + name_buffer[i - 1] = 'a' + i % 26; + } + + name_buffer[i] = 0; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_name_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Name Test............................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_one_shot_query_test.c b/test/regression/mdns_test/netx_mdns_one_shot_query_test.c new file mode 100644 index 00000000..5a11370d --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_one_shot_query_test.c @@ -0,0 +1,284 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static CHAR mdns_data[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ +0xf0, 0xbc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ +0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ +0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ +0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ +0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ +0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ +0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ +0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ +0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ +}; + +static UINT query_received; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_one_shot_query_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 0, 31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_MDNS_SERVICE service; + + printf("NetX Test: MDNS One Shot Query Test.................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for probing and announcement. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Initialize the query received. */ + query_received = 0; + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Start one-shot query. */ + if(nx_mdns_service_one_shot_query(&mdns_0, NX_NULL, "_http._tcp", NX_NULL, &service, 5 * NX_IP_PERIODIC_RATE)) + error_counter++; + + /* Sleep 5 seconds and check whether more queries are sent. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start one-shot query. */ + if(nx_mdns_service_one_shot_query(&mdns_0, NX_NULL, "_http._tcp", NX_NULL, &service, 5 * NX_IP_PERIODIC_RATE)) + error_counter++; + + /* Sleep 1 second and check whether more queries are sent. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *pointer; +NX_PACKET *my_packet; +UINT status; + + + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Get flag. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 30; + + /* Check whether this packet is the query. */ + if(((*pointer << 8) + *(pointer + 1)) != NX_MDNS_QUERY_FLAG) + return NX_TRUE; + + query_received++; + + /* Do not reply response for the first two queries. */ + if(query_received < 3) + return NX_TRUE; + + /* Only one query is expected. */ + if(query_received > 3) + { + error_counter++; + return NX_TRUE; + } + else + { + + /* Inject a response packet for the third query. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, 100); + status += nx_packet_data_append(my_packet, mdns_data + 14, sizeof(mdns_data) - 14, &pool_0, 100); + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_one_shot_query_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS One Shot Query Test..................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ + diff --git a/test/regression/mdns_test/netx_mdns_peer_service_change_notify_test.c b/test/regression/mdns_test/netx_mdns_peer_service_change_notify_test.c new file mode 100644 index 00000000..94ef76cb --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_peer_service_change_notify_test.c @@ -0,0 +1,381 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Frame (350 bytes) */ +static unsigned char response[350] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x32, 0x5e, 0x5b, 0x58, 0x08, 0x00, 0x45, 0x00, /* 2^[X..E. */ +0x01, 0x50, 0x52, 0x05, 0x40, 0x00, 0xff, 0x11, /* .PR.@... */ +0x22, 0xed, 0xc0, 0xa8, 0x64, 0x06, 0xe0, 0x00, /* "...d... */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x3c, /* .......< */ +0x54, 0x86, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* T....... */ +0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0c, 0x09, 0x44, 0x75, 0x6e, 0x63, 0x68, /* ...Dunch */ +0x75, 0x61, 0x6e, 0x67, 0xc0, 0x0c, 0xc0, 0x28, /* uang...( */ +0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0xaa, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, /* ...vendo */ +0x72, 0x3d, 0x53, 0x79, 0x6e, 0x6f, 0x6c, 0x6f, /* r=Synolo */ +0x67, 0x79, 0x0c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, /* gy.model */ +0x3d, 0x44, 0x53, 0x32, 0x31, 0x36, 0x6a, 0x14, /* =DS216j. */ +0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3d, 0x31, /* serial=1 */ +0x36, 0x36, 0x30, 0x4e, 0x4e, 0x4e, 0x35, 0x34, /* 660NNN54 */ +0x34, 0x34, 0x30, 0x33, 0x0f, 0x76, 0x65, 0x72, /* 4403.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6a, /* sion_maj */ +0x6f, 0x72, 0x3d, 0x36, 0x0f, 0x76, 0x65, 0x72, /* or=6.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6e, /* sion_min */ +0x6f, 0x72, 0x3d, 0x30, 0x12, 0x76, 0x65, 0x72, /* or=0.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x75, 0x69, /* sion_bui */ +0x6c, 0x64, 0x3d, 0x37, 0x33, 0x39, 0x33, 0x0f, /* ld=7393. */ +0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x6f, /* admin_po */ +0x72, 0x74, 0x3d, 0x35, 0x30, 0x30, 0x30, 0x16, /* rt=5000. */ +0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x61, /* secure_a */ +0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x6f, 0x72, /* dmin_por */ +0x74, 0x3d, 0x35, 0x30, 0x30, 0x31, 0x1d, 0x6d, /* t=5001.m */ +0x61, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, /* ac_addre */ +0x73, 0x73, 0x3d, 0x30, 0x30, 0x3a, 0x31, 0x31, /* ss=00:11 */ +0x3a, 0x33, 0x32, 0x3a, 0x35, 0x65, 0x3a, 0x35, /* :32:5e:5 */ +0x62, 0x3a, 0x35, 0x38, 0xc0, 0x28, 0x00, 0x21, /* b:58.(.! */ +0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x12, /* .....x.. */ +0x00, 0x00, 0x00, 0x00, 0x13, 0x88, 0x09, 0x44, /* .......D */ +0x75, 0x6e, 0x63, 0x68, 0x75, 0x61, 0x6e, 0x67, /* unchuang */ +0xc0, 0x17, 0xc0, 0xfc, 0x00, 0x1c, 0x80, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, 0x01, /* ...x.. . */ +0x04, 0x70, 0xf4, 0xde, 0x30, 0x00, 0x02, 0x11, /* .p..0... */ +0x32, 0xff, 0xfe, 0x5e, 0x5b, 0x58, 0xc0, 0xfc, /* 2..^[X.. */ +0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x04, 0xc0, 0xa8, 0x64, 0x06 /* ....d. */ +}; +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static CHAR host_registered = NX_FALSE; +static CHAR serivce_received = 0; +static CHAR serivce_updated = 0; +static CHAR serivce_deleted = 0; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +static VOID probing_notify(struct NX_MDNS_STRUCT *mdns_ptr, UCHAR *name, UINT state); +static VOID service_change_notify(NX_MDNS *mdns_ptr, NX_MDNS_SERVICE *service_ptr, UINT state); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_peer_service_change_notify_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; +NX_MDNS_SERVICE service_instance; + + NX_PARAMETER_NOT_USED(thread_input); + + printf("NetX Test: MDNS Peer Service Change Notify Test......................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject mDNS response to primary interface of ip_0. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, response + 14, sizeof(response) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Sleep 1s. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the flag. */ + if ((serivce_received != 0) || (serivce_updated !=0) || (serivce_deleted !=0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Service lookup. */ + status = nx_mdns_service_lookup(&mdns_0, NX_NULL, (UCHAR *)"_http._tcp", NX_NULL, 0, &service_instance); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the service info. */ + if ((strcmp((const char*)service_instance.service_name, (const char*)"Dunchuang")) || + (strcmp((const char*)service_instance.service_type, (const char*)"_http._tcp"))|| + (strcmp((const char*)service_instance.service_domain, (const char*)"local"))|| + (strcmp((const char*)service_instance.service_host, (const char*)"Dunchuang.local"))|| + (service_instance.service_text_valid != 1) || + (service_instance.service_port != 5000) || + (service_instance.service_weight != 0) || + (service_instance.service_priority != 0) || + (service_instance.service_ipv4 != 0xc0a86406) || + (service_instance.service_ipv6[0][0] != 0x20010470) || + (service_instance.service_ipv6[0][1] != 0xf4de3000) || + (service_instance.service_ipv6[0][2] != 0x021132ff) || + (service_instance.service_ipv6[0][3] != 0xfe5e5b58)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the cache. */ + status = nx_mdns_peer_cache_clear(&mdns_0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the serivce change notify for _http. */ + status = nx_mdns_service_notify_set(&mdns_0, 0x02, service_change_notify); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject mDNS response to primary interface of ip_0. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, response + 14, sizeof(response) - 14, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the flag. */ + if ((serivce_received == 0) || (serivce_updated == 0) || (serivce_deleted != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Service lookup. */ + status = nx_mdns_service_lookup(&mdns_0, NX_NULL, (UCHAR *)"_http._tcp", NX_NULL, 0, &service_instance); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the service info. */ + if ((strcmp((const char*)service_instance.service_name, (const char*)"Dunchuang")) || + (strcmp((const char*)service_instance.service_type, (const char*)"_http._tcp"))|| + (strcmp((const char*)service_instance.service_domain, (const char*)"local"))|| + (strcmp((const char*)service_instance.service_host, (const char*)"Dunchuang.local"))|| + (service_instance.service_text_valid != 1) || + (service_instance.service_port != 5000) || + (service_instance.service_weight != 0) || + (service_instance.service_priority != 0) || + (service_instance.service_ipv4 != 0xc0a86406) || + (service_instance.service_ipv6[0][0] != 0x20010470) || + (service_instance.service_ipv6[0][1] != 0xf4de3000) || + (service_instance.service_ipv6[0][2] != 0x021132ff) || + (service_instance.service_ipv6[0][3] != 0xfe5e5b58)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID service_change_notify(NX_MDNS *mdns_ptr, NX_MDNS_SERVICE *service_ptr, UINT state) +{ + + NX_PARAMETER_NOT_USED(mdns_ptr); + NX_PARAMETER_NOT_USED(service_ptr); + + switch(state) + { + case NX_MDNS_PEER_SERVICE_RECEIVED: + { + serivce_received++; + break; + } + case NX_MDNS_PEER_SERVICE_UPDATED: + { + serivce_updated++; + break; + } + case NX_MDNS_PEER_SERVICE_DELETED: + { + serivce_deleted++; + break; + } + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_peer_service_change_notify_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Peer Service Change Notify Test......................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_ram_test.c b/test/regression/mdns_test/netx_mdns_ram_test.c new file mode 100644 index 00000000..7507c877 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_ram_test.c @@ -0,0 +1,299 @@ +#include "nx_api.h" +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "netx_mdns_test.h" + +#define DEMO_STACK_SIZE 2048 +#define LOCAL_BUFFER_SIZE 5120 +#define PEER_BUFFER_SIZE 5120 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR local_buffer[LOCAL_BUFFER_SIZE]; +static UCHAR peer_buffer[PEER_BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the test threads. */ +extern MDNS_TEST_SEQ mdns_response_with_tc[]; +extern MDNS_TEST_SEQ mdns_query_with_tc[]; +extern MDNS_TEST_SEQ mdns_announcement_in_multiple_packets[]; +extern MDNS_TEST_SEQ mdns_response_in_multiple_packets[]; +extern MDNS_TEST_SEQ mdns_address_change[]; +extern MDNS_TEST_SEQ mdns_case_insensitivity[]; +extern MDNS_TEST_SEQ mdns_poof[]; +extern MDNS_TEST_SEQ mdns_query_during_probing[]; +extern MDNS_TEST_SEQ mdns_server_interface_reset[]; +extern MDNS_TEST_SEQ mdns_server_send_goodbye[]; +extern MDNS_TEST_SEQ mdns_dns_sd_query[]; +extern MDNS_TEST_SEQ mdns_dns_sd_response[]; +extern MDNS_TEST_SEQ mdns_server_announcement_with_txt[]; +extern MDNS_TEST_SEQ mdns_probing_conflict[]; +extern MDNS_TEST_SEQ mdns_response_no_delay[]; +extern MDNS_TEST_SEQ mdns_response_interval[]; +extern MDNS_TEST_SEQ mdns_response_aggregation[]; +extern MDNS_TEST_SEQ mdns_known_answer_ignored[]; +extern MDNS_TEST_SEQ mdns_known_answer_suppression_query[]; +extern MDNS_TEST_SEQ mdns_known_answer_suppression_query_half_ttl[]; +extern MDNS_TEST_SEQ mdns_known_answer_suppression_response[]; +extern MDNS_TEST_SEQ mdns_known_answer_suppression_unique[]; +extern MDNS_TEST_SEQ mdns_duplicate_question_suppression[]; +extern MDNS_TEST_SEQ mdns_duplicate_answer_suppression[]; +extern MDNS_TEST_SEQ mdns_one_shot_query[]; +extern MDNS_TEST_SEQ mdns_continuous_query[]; +extern MDNS_TEST_SEQ mdns_continuous_query_a[]; +extern MDNS_TEST_SEQ mdns_continuous_query_unique_answer[]; +extern MDNS_TEST_SEQ mdns_continuous_query_interval[]; +extern MDNS_TEST_SEQ mdns_query_start_stop[]; +extern MDNS_TEST_SEQ mdns_query_http_tcp[]; +extern MDNS_TEST_SEQ mdns_query_pdl_datastream_tcp[]; +extern MDNS_TEST_SEQ mdns_query_printer_tcp[]; +extern MDNS_TEST_SEQ mdns_query_smb_tcp[]; +extern MDNS_TEST_SEQ mdns_query_and_response_chaos[]; +extern MDNS_TEST_SEQ mdns_multiple_questions_per_query[]; +extern MDNS_TEST_SEQ mdns_basic_ipv6_query[]; +extern MDNS_TEST_SEQ mdns_basic_ipv6_response[]; +extern MDNS_TEST_SEQ mdns_basic_ipv6_announcement[]; +extern MDNS_TEST_SEQ mdns_response_to_address_query[]; +extern MDNS_TEST_SEQ mdns_client_passive[]; +extern MDNS_TEST_SEQ mdns_client_passive_02[]; +extern MDNS_TEST_SEQ mdns_query_rr_timeout[]; + +extern int mdns_response_with_tc_size; +extern int mdns_query_with_tc_size; +extern int mdns_announcement_in_multiple_packets_size; +extern int mdns_response_in_multiple_packets_size; +extern int mdns_address_change_size; +extern int mdns_case_insensitivity_size; +extern int mdns_poof_size; +extern int mdns_query_during_probing_size; +extern int mdns_server_interface_reset_size; +extern int mdns_server_send_goodbye_size; +extern int mdns_dns_sd_query_size; +extern int mdns_dns_sd_response_size; +extern int mdns_server_announcement_with_txt_size; +extern int mdns_probing_conflict_size; +extern int mdns_response_no_delay_size; +extern int mdns_response_interval_size; +extern int mdns_response_aggregation_size; +extern int mdns_known_answer_ignored_size; +extern int mdns_known_answer_suppression_query_size; +extern int mdns_known_answer_suppression_query_half_ttl_size; +extern int mdns_known_answer_suppression_response_size; +extern int mdns_known_answer_suppression_unique_size; +extern int mdns_duplicate_question_suppression_size; +extern int mdns_duplicate_answer_suppression_size; +extern int mdns_one_shot_query_size; +extern int mdns_continuous_query_size; +extern int mdns_continuous_query_a_size; +extern int mdns_continuous_query_unique_answer_size; +extern int mdns_continuous_query_interval_size; +extern int mdns_query_start_stop_size; +extern int mdns_query_http_tcp_size; +extern int mdns_query_pdl_datastream_tcp_size; +extern int mdns_query_printer_tcp_size; +extern int mdns_query_smb_tcp_size; +extern int mdns_query_and_response_chaos_size; +extern int mdns_multiple_questions_per_query_size; +extern int mdns_basic_ipv6_query_size; +extern int mdns_basic_ipv6_response_size; +extern int mdns_basic_ipv6_announcement_size; +extern int mdns_response_to_address_query_size; +extern int mdns_client_passive_size; +extern int mdns_client_passive_size_02; +extern int mdns_query_rr_timeout_size; + +static MDNS_TEST_SUITE test_suite[] = +{ + +#ifndef NX_MDNS_DISABLE_SERVER + {&mdns_address_change[0], &mdns_address_change_size}, + {&mdns_case_insensitivity[0], &mdns_case_insensitivity_size}, + {&mdns_query_during_probing[0], &mdns_query_during_probing_size}, + {&mdns_server_interface_reset[0], &mdns_server_interface_reset_size}, + {&mdns_server_send_goodbye[0], &mdns_server_send_goodbye_size}, + {&mdns_dns_sd_response[0], &mdns_dns_sd_response_size}, + {&mdns_probing_conflict[0], &mdns_probing_conflict_size}, + {&mdns_server_announcement_with_txt[0], &mdns_server_announcement_with_txt_size}, + {&mdns_response_no_delay[0], &mdns_response_no_delay_size}, + {&mdns_response_interval[0], &mdns_response_interval_size}, + {&mdns_response_aggregation[0], &mdns_response_aggregation_size}, + {&mdns_response_with_tc[0], &mdns_response_with_tc_size}, + {&mdns_known_answer_suppression_response[0], &mdns_known_answer_suppression_response_size}, + {&mdns_known_answer_suppression_unique[0], &mdns_known_answer_suppression_unique_size}, + {&mdns_duplicate_answer_suppression[0], &mdns_duplicate_answer_suppression_size}, +#if (NX_PHYSICAL_HEADER < 48) /* If the header is too large, the RRs in one packet will be different with the message captured. */ + {&mdns_announcement_in_multiple_packets[0], &mdns_announcement_in_multiple_packets_size}, +#endif +#ifdef NX_MDNS_ENABLE_IPV6 + {&mdns_response_in_multiple_packets[0], &mdns_response_in_multiple_packets_size}, + {&mdns_basic_ipv6_response[0], &mdns_basic_ipv6_response_size}, + {&mdns_basic_ipv6_announcement[0], &mdns_basic_ipv6_announcement_size}, + {&mdns_response_to_address_query[0], &mdns_response_to_address_query_size}, +#endif /* NX_MDNS_ENABLE_IPV6 */ +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + {&mdns_poof[0], &mdns_poof_size}, + {&mdns_dns_sd_query[0], &mdns_dns_sd_query_size}, + {&mdns_known_answer_ignored[0], &mdns_known_answer_ignored_size}, + {&mdns_known_answer_suppression_query[0], &mdns_known_answer_suppression_query_size}, + {&mdns_known_answer_suppression_query_half_ttl[0], &mdns_known_answer_suppression_query_half_ttl_size}, + {&mdns_duplicate_question_suppression[0], &mdns_duplicate_question_suppression_size}, + {&mdns_continuous_query[0], &mdns_continuous_query_size}, + {&mdns_continuous_query_unique_answer[0], &mdns_continuous_query_unique_answer_size}, + {&mdns_continuous_query_interval[0], &mdns_continuous_query_interval_size}, + {&mdns_query_start_stop[0], &mdns_query_start_stop_size}, + {&mdns_query_http_tcp[0], &mdns_query_http_tcp_size}, + {&mdns_query_pdl_datastream_tcp[0], &mdns_query_pdl_datastream_tcp_size}, + {&mdns_query_printer_tcp[0], &mdns_query_printer_tcp_size}, + {&mdns_query_smb_tcp[0], &mdns_query_smb_tcp_size}, + {&mdns_query_and_response_chaos[0], &mdns_query_and_response_chaos_size}, + {&mdns_query_with_tc[0], &mdns_query_with_tc_size}, + {&mdns_query_rr_timeout[0], &mdns_query_rr_timeout_size}, + {&mdns_multiple_questions_per_query[0], &mdns_multiple_questions_per_query_size}, + {&mdns_client_passive[0], &mdns_client_passive_size}, +#ifdef NX_MDNS_ENABLE_IPV6 + {&mdns_basic_ipv6_query[0], &mdns_basic_ipv6_query_size}, +#endif /* NX_MDNS_ENABLE_IPV6 */ +#endif /* NX_MDNS_DISABLE_CLIENT */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_ram_test_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*32); + pointer = pointer + 1536*32; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(10, 0, 0, 66), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + /* Enable igmp processing for IP Instance 0. */ + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + +#if defined FEATURE_NX_IPV6 && defined NX_ENABLE_IPV6_MULTICAST + /* Enable IPv6 processing for IP Instance 0. */ + status = nxd_ipv6_enable(&ip_0); +#endif /* FEATURE_NX_IPV6 && NX_ENABLE_IPV6_MULTICAST */ + + /* Check status. */ + if(status) + error_counter++; + +} + +static void thread_0_entry(ULONG thread_input) +{ +int num_suite; +int i; + + num_suite = sizeof(test_suite) / sizeof(MDNS_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + + /* Create mDNS. */ + if(nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, mdns_stack, DEMO_STACK_SIZE, "ARMMDNSTest", + local_buffer, LOCAL_BUFFER_SIZE, peer_buffer, PEER_BUFFER_SIZE, netx_mdns_probing_notify)) + error_counter++; + + /* Make sure the service probing and host probing in one packet for some test cases. */ + mdns_0.nx_mdns_first_probing_delay = NX_MDNS_PROBING_TIMER_COUNT; + + /* Enable interface. */ + if(nx_mdns_enable(&mdns_0, 0)) + error_counter++; + + /* Run test case. */ + if(test_suite[i].test_case) + netx_mdns_run_test_case(&ip_0, &mdns_0, test_suite[i].test_case, *(test_suite[i].test_case_size)); + + /* Delete mDNS. */ + if(nx_mdns_delete(&mdns_0)) + error_counter++; + } + + test_control_return(0xdeadbeef); +} +#endif /* __PRODUCT_NETXDUO__ && !NX_DISABLE_IPV4 */ diff --git a/test/regression/mdns_test/netx_mdns_read_overflow_test.c b/test/regression/mdns_test/netx_mdns_read_overflow_test.c new file mode 100644 index 00000000..0c6ca152 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_read_overflow_test.c @@ -0,0 +1,406 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR type[256]; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +static CHAR invalid_data_1[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x6a, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static CHAR invalid_data_2[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x6d, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x01, 0xc0, 0x28, 0x00 /* . */ +}; + +static CHAR invalid_data_3[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0C, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x6e, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0xc0, 0x28, 0x00, /* . */ +}; + +static unsigned char invalid_data_4[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ +0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ +0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ +0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ +0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ +0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ +0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ +0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ +0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ +0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ +0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x64, 0x00, 0x1e, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ +0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ +0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 +}; + +static unsigned char invalid_data_5[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x5f, 0x30, 0x05, 0x6c, 0x6f, 0x63, /* st_0.loc */ +0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ +0x42 /* B */ +}; + +static unsigned char invalid_data_6[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x41, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x5f, 0x30, 0x05, 0x6c, 0x6f, 0x63, /* st_0.loc */ +0x61, 0x6c, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, /* ...."..3 */ +0x44, 0x57, +}; + +static CHAR mdns_data[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_read_overflow_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192,168,0,31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +#define MDNS_START_OFFSET (34) + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *response_packet; +UCHAR *invalid_responses[] = +{ + invalid_data_1, + invalid_data_2, + invalid_data_3, + invalid_data_4, + invalid_data_5, + invalid_data_6, +}; +UINT invalid_responses_len[] = +{ + sizeof(invalid_data_1), + sizeof(invalid_data_2), + sizeof(invalid_data_3), + sizeof(invalid_data_4), + sizeof(invalid_data_5), + sizeof(invalid_data_6), +}; +UCHAR *response_ptr; +UINT response_len; +UINT i; +UINT test_num = sizeof(invalid_responses_len) / sizeof(UINT); +NX_IPV4_HEADER *ip_header_ptr; +UCHAR test_tail_len[] = +{ + 15, 3, 2, 11, 2, 2, +}; + + printf("NetX Test: MDNS Read Overflow Test..................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + nx_udp_socket_checksum_disable(&(mdns_0.nx_mdns_socket)); + + /* Send test packet. */ + for (i = 0; i < test_num; i ++) + { + + nx_mdns_peer_cache_clear(&mdns_0); + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &response_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + response_ptr = invalid_responses[i]; + response_len = invalid_responses_len[i]; + + /* Write the DNS response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, response_ptr, response_len); + response_len -= test_tail_len[i]; + + ip_header_ptr = (NX_IPV4_HEADER *)(response_packet -> nx_packet_prepend_ptr + 14); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + response_packet -> nx_packet_ip_header = response_packet -> nx_packet_prepend_ptr + 14; + + /* Adjust the write pointer. */ + response_packet -> nx_packet_prepend_ptr += MDNS_START_OFFSET; + response_packet -> nx_packet_length = response_len - MDNS_START_OFFSET; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + response_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + + /* Send the UDP packet with the correct port. */ + _nx_udp_packet_receive(&ip_0, response_packet); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if ((i < 3 && mdns_0.nx_mdns_peer_rr_count == 0x04) || + (i == 3 && mdns_0.nx_mdns_peer_rr_count == 0x03) || + (i == 4 && mdns_0.nx_mdns_peer_rr_count == 0x01) || + (i == 5 && mdns_0.nx_mdns_peer_rr_count == 0x01)) + { + error_counter++; + } + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_read_overflow_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Read Overflow Test...................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ diff --git a/test/regression/mdns_test/netx_mdns_responder_cooperating_test.c b/test/regression/mdns_test/netx_mdns_responder_cooperating_test.c new file mode 100644 index 00000000..e7288df0 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_responder_cooperating_test.c @@ -0,0 +1,431 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_query; +static UCHAR mdns_response; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; + +/* A DNS-SD response + rdata: "_http._tcp.local" + TTL: 4500 */ +/* Frame (112 bytes) */ +static UCHAR mdns_data_1[] = +{ +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0x62, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .b..@... */ +0x90, 0x46, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .F...B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4e, /* .......N */ +0x17, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ +0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ +0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ +0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ +0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ +}; + +/* A service response + Service: "ARMMDNSTest._ipp._tcp.local" + type: SRV + TTL: 120 */ +static UCHAR mdns_data_2[] = +{ +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x07, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xa1, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xf3, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* A service response + Service: "ARMMDNSTest._ipp._tcp.local" + type: SRV + TTL: 60 */ +static UCHAR mdns_data_3[] = +{ +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x07, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xa1, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xf3, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + +/* A service response + Service: "ARMMDNSTest._ipp._tcp.local" + type: SRV + TTL: 59 */ +static UCHAR mdns_data_4[] = +{ +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x01, 0x07, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xa1, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xf3, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x3b, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static NX_PACKET *current_packet; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_responder_cooperating_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NXD_ADDRESS address; + + printf("NetX Test: MDNS Responder Cooperating Test..........................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Send MULTICAST address. */ + address.nxd_ip_version = NX_IP_VERSION_V4; + address.nxd_ip_address.v4 = NX_MDNS_IPV4_MULTICAST_ADDRESS; + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, mdns_stack, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + nx_mdns_enable(&mdns_0, 0); + + + /* Create a service. */ + status += nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Sleep 5 seconds for probing and announcement. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Reset counter. */ + mdns_query = 0; + mdns_response = 0; + + /* Inject a RR with same name(_services._dns-sd._udp), rrtype(PTR) and rrclass(1), but different rdata(_http._tcp.local). */ + /* Allocate a packet and add data with mDNS response. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data_1 + 42, sizeof(mdns_data_1) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&mdns_0.nx_mdns_socket, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check whether any mDNS packet is sent. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* For shared RR, no action is required. */ + if(mdns_query || mdns_response) + error_counter++; + + + /* Reset counter. */ + mdns_query = 0; + mdns_response = 0; + + /* Inject a RR with the same name(ARMMDNSTest._ipp._tcp), rrtype(SRV) and rrclass(1), but different rdata(ARMMDNSTest.local). */ + /* Allocate a packet and add data with mDNS response. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data_2 + 42, sizeof(mdns_data_2) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&mdns_0.nx_mdns_socket, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check whether any mDNS packet is sent. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* For unique RR, probing and announcing are required. */ + if((mdns_query != 3) || (mdns_response == 0)) + error_counter++; + + /* Delete the service. */ + nx_mdns_service_delete(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Delete mdns. */ + nx_mdns_delete(&mdns_0); + + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, mdns_stack, DEMO_STACK_SIZE, "ARMMDNSTest", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + nx_mdns_enable(&mdns_0, 0); + + + /* Create a service with the same name, rrtype and rrclass and rdata. */ + /* The received TTL is at least half the true TTL from local RR. */ + status += nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 120, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Sleep 5 seconds for probing and announcement. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Reset counter. */ + mdns_query = 0; + mdns_response = 0; + + /* Inject a RR with the same name(ARMMDNSTest._ipp._tcp), rrtype(SRV) and rrclass(1) and rdata(ARMMDNSTest.local). */ + /* The received TTL(60) is at least half the true TTL(120) from local RR. */ + /* Allocate a packet and add data with mDNS response. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data_3 + 42, sizeof(mdns_data_3) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&mdns_0.nx_mdns_socket, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check whether any mDNS packet is sent. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* No action is required. */ + if(mdns_query || mdns_response) + error_counter++; + + + /* Reset counter. */ + mdns_query = 0; + mdns_response = 0; + + /* Inject a RR with the same name(ARMMDNSTest._ipp._tcp), rrtype(SRV) and rrclass(1) and rdata(ARMMDNSTest.local). */ + /* The received TTL(59) is at least half the true TTL(120) from local RR. */ + /* Allocate a packet and add data with mDNS response. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data_4 + 42, sizeof(mdns_data_4) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&mdns_0.nx_mdns_socket, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check whether any mDNS packet is sent. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Response is required. */ + if(mdns_query || (mdns_response == 0)) + error_counter++; + + /* Delete the service. */ + nx_mdns_service_delete(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR *pointer; + + if(packet_ptr == current_packet) + { + + /* It is a packet need to inject. */ + /* Inject it to IP layer. */ + packet_ptr -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + return NX_FALSE; + } + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Get flag. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 30; + + /* Check whether this packet is the response. */ + if(((*pointer << 8) + *(pointer + 1)) == (NX_MDNS_RESPONSE_FLAG | NX_MDNS_AA_FLAG)) + mdns_response++; + else + mdns_query++; + + return NX_TRUE; + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_responder_cooperating_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Responder Cooperating Test...........................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_SERVER */ + diff --git a/test/regression/mdns_test/netx_mdns_response_with_question_test.c b/test/regression/mdns_test/netx_mdns_response_with_question_test.c new file mode 100644 index 00000000..c90b9690 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_response_with_question_test.c @@ -0,0 +1,255 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_data[] = +{ + 0x00, 0x00, 0x84, 0x00, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, + 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, 0x5f, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, + 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, + 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, + 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, + 0x77, 0xc0, 0x0c +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static NX_PACKET *current_packet; +static ULONG response_received; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_response_with_question_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + response_received = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NXD_ADDRESS address; + + printf("NetX Test: MDNS Response With Question Test.........................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add a service. */ + status += nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_printer._tcp", NX_NULL, "paper=A4;version=01", 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Sleep 5 seconds for probing and announcement. */ + tx_thread_sleep(500); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Send MULTICAST address. */ + address.nxd_ip_version = NX_IP_VERSION_V4; + address.nxd_ip_address.v4 = NX_MDNS_IPV4_MULTICAST_ADDRESS; + + /* Allocate a packet and add data with mDNS response with question. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data, sizeof(mdns_data), &pool_0, 100); + status += nxd_udp_socket_send(&mdns_0.nx_mdns_socket, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check whether RR is stored. */ + tx_thread_sleep(100); + + if(mdns_0.nx_mdns_peer_rr_count != 1) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || response_received) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *pointer; + + if(packet_ptr == current_packet) + { + + /* It is a response packet. */ + /* Inject it to IP layer. */ + packet_ptr -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + return NX_FALSE; + } + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Get flag. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 30; + + /* Check whether this packet is the response. */ + if(((*pointer << 8) + *(pointer + 1)) == (NX_MDNS_RESPONSE_FLAG | NX_MDNS_AA_FLAG)) + response_received = 1; + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_response_with_question_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Response With Question Test..........................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_SERVER */ diff --git a/test/regression/mdns_test/netx_mdns_run_test_case.c b/test/regression/mdns_test/netx_mdns_run_test_case.c new file mode 100644 index 00000000..56b689d4 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_run_test_case.c @@ -0,0 +1,829 @@ +#include "tx_api.h" +#include "nx_api.h" + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +#include "netx_mdns_test.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#endif /* FEATURE_NX_IPV6 */ + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define MAX_PACKET_SIZE 1600 + +/* Define the ThreadX and NetX object control blocks... */ + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +extern void test_control_return(UINT status); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT in_cleanup_process; +static TX_MUTEX pkt_capture_mutex; +static TX_SEMAPHORE pkt_count_sem; +static int pkt_capture_flag = 0; +static NX_PACKET *assemble_pkt; +static UCHAR assemble_pkt_data[MAX_PACKET_SIZE]; +static UINT fragment_cnt = 0; +static UINT service_callback_invoked; +static UINT service_callback_state; +static UINT probing_callback_invoked; +static UINT probing_callback_state; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; + + +static NX_PACKET *incoming_pkts = NX_NULL; +static NX_PACKET *incoming_pkts_tail = NX_NULL; + +static VOID service_change_notify(NX_MDNS *mdns_ptr, NX_MDNS_SERVICE *service_ptr, UINT state) +{ + + /* Check state. */ + if(service_callback_state == state) + service_callback_invoked++; +} + +static void perform_check(char *pkt_data, int pkt_size, int timeout) +{ +UINT status; +NX_PACKET *current_pkt; +ULONG start_time, current_time, time_remaining; + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + if(status == NX_SUCCESS) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if(current_pkt) + { + + /* A packet has been queued. Examine the content of the packet. */ + if(((pkt_size - 14) != current_pkt -> nx_packet_length) || + (memcmp(pkt_data + 14, current_pkt -> nx_packet_prepend_ptr, current_pkt -> nx_packet_length) != 0)) + { + /* Not a match. */ + + /* Compute new timeout value. */ + current_time = tx_time_get(); + time_remaining = timeout - (current_time - start_time); + if(time_remaining > 0x80000000) + { + /* Underflow */ + time_remaining = 0; + error_counter = 1; + } + nx_packet_release(current_pkt); + continue; + } + else + { + /* Packet is a match. Get out of this CHECK state. */ + time_remaining = 0; + nx_packet_release(current_pkt); + continue; + } + } + } + else + { + /* Timeout */ + error_counter = 1; + time_remaining = 0; + } + } +} + +static void decode_mdns_data(ULONG *current_len, CHAR **org_data) +{ +CHAR *character = *org_data; +CHAR compressed = NX_FALSE; +UINT labelSize; + + /* As long as we haven't found a zero terminating label */ + while(*character != '\0') + { + + labelSize = *character++; + + /* Is this a compression pointer or a count. */ + if(labelSize <= NX_MDNS_LABEL_MAX) + { + + *(assemble_pkt_data + *current_len) = *(character - 1); + *current_len = *current_len + 1; + + /* Simple count, check for space and copy the label. */ + while(labelSize > 0) + { + + *(assemble_pkt_data + *current_len) = *character++; + *current_len = *current_len + 1; + labelSize--; + } + } + else if((labelSize & NX_MDNS_COMPRESS_MASK) == NX_MDNS_COMPRESS_VALUE) + { + + /* This is a pointer, just adjust the source. */ + if(compressed == NX_FALSE) + *org_data = character + 1; + compressed = NX_TRUE; + character = assemble_pkt_data + ((labelSize & NX_MDNS_LABEL_MAX) << 8) + *character; + } + else + { + + /* Not defined, just fail */ + return; + } + } + + /* Null terminate name. */ + *(assemble_pkt_data + *current_len) = '\0'; + *current_len = *current_len + 1; + + if(compressed == NX_FALSE) + *org_data = character + 1; +} + +static void perform_check_mdns_data(char *pkt_data, int pkt_size, int timeout, int cmd) +{ +UINT status; +NX_PACKET *current_pkt; +ULONG start_time, current_time, time_remaining; +ULONG offset, assemble_len; +USHORT question_cnt; +USHORT answer_cnt; +USHORT tmp; +USHORT type; +USHORT data_len; +UCHAR *data_len_ptr; +UCHAR expect_pkt; + + /* Calculate offset. */ + if((cmd == MDNS_CHECK_DATA_V4) || (cmd == MDNS_REJECT_DATA_V4)) + offset = 28; + else + offset = 48; + + /* Whether this packet is expected. */ + if((cmd == MDNS_REJECT_DATA_V4) || (cmd == MDNS_REJECT_DATA_V6)) + expect_pkt = NX_FALSE; + else + expect_pkt = NX_TRUE; + + /* Copy DNS header. */ + memcpy(assemble_pkt_data, pkt_data + 14 + offset, 12); + assemble_len = 12; + pkt_data += (26 + offset); + + /* Get counts of question and answer. */ + question_cnt = *((USHORT*)(assemble_pkt_data + 4)); + NX_CHANGE_USHORT_ENDIAN(question_cnt); + answer_cnt = *((USHORT*)(assemble_pkt_data + 6)); + NX_CHANGE_USHORT_ENDIAN(answer_cnt); + tmp = *((USHORT*)(assemble_pkt_data + 8)); + NX_CHANGE_USHORT_ENDIAN(tmp); + answer_cnt += tmp; + tmp = *((USHORT*)(assemble_pkt_data + 10)); + NX_CHANGE_USHORT_ENDIAN(tmp); + answer_cnt += tmp; + + /* Decode questions. */ + while(question_cnt) + { + decode_mdns_data(&assemble_len, &pkt_data); + + /* Copy fixed data. */ + memcpy(assemble_pkt_data + assemble_len, pkt_data, 4); + assemble_len += 4; + pkt_data += 4; + + question_cnt--; + } + + /* Decode answers. */ + while(answer_cnt) + { + decode_mdns_data(&assemble_len, &pkt_data); + + /* Get type. */ + type = *pkt_data; + type = (type << 8) + *(pkt_data + 1); + + /* Copy fixed data. */ + memcpy(assemble_pkt_data + assemble_len, pkt_data, 10); + assemble_len += 10; + pkt_data += 10; + + /* Get data length pointer. */ + data_len_ptr = assemble_pkt_data + assemble_len - 2; + + if((type == NX_MDNS_RR_TYPE_PTR) || + (type == NX_MDNS_RR_TYPE_SRV)) + { + + /* Need decode. */ + if(type == NX_MDNS_RR_TYPE_SRV) + { + + /* The first 6 bytes of SRV are fixed. */ + memcpy(assemble_pkt_data + assemble_len, pkt_data, 6); + assemble_len += 6; + pkt_data += 6; + } + + decode_mdns_data(&assemble_len, &pkt_data); + + /* Calculate decoded data length. */ + data_len = (USHORT)(assemble_pkt_data + assemble_len - data_len_ptr) - 2; + *((USHORT*)data_len_ptr) = data_len; + NX_CHANGE_USHORT_ENDIAN(*((USHORT*)data_len_ptr)); + } + else + { + + /* Nothing to decode. */ + data_len = (*data_len_ptr << 8) | *(data_len_ptr + 1); + memcpy(assemble_pkt_data + assemble_len, pkt_data, data_len); + assemble_len += data_len; + pkt_data += data_len; + } + + answer_cnt--; + } + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + if(status == NX_SUCCESS) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if(current_pkt) + { + + /* A packet has been queued. Examine the content of the packet. */ + if((assemble_len != current_pkt -> nx_packet_length - offset) || + (memcmp(assemble_pkt_data, current_pkt -> nx_packet_prepend_ptr + offset, assemble_len) != 0)) + { + /* Not a match. */ + + /* Compute new timeout value. */ + current_time = tx_time_get(); + time_remaining = timeout - (current_time - start_time); + if((time_remaining > 0x80000000) && (expect_pkt == NX_TRUE)) + { + /* Underflow */ + time_remaining = 0; + error_counter = 1; + } + nx_packet_release(current_pkt); + continue; + } + else + { + /* Packet is a match. Get out of this CHECK state. */ + time_remaining = 0; + nx_packet_release(current_pkt); + + if(expect_pkt == NX_FALSE) + error_counter = 1; + continue; + } + } + } + else + { + /* Timeout */ + if(expect_pkt == NX_TRUE) + error_counter = 1; + time_remaining = 0; + } + } +} + +static void perform_check_mdns_any(int pkt_size, int timeout, int cmd) +{ +UINT status; +NX_PACKET *current_pkt; +ULONG start_time, current_time, time_remaining; +ULONG offset; +USHORT target_flags = pkt_size; +USHORT pkt_flags; +USHORT src_port, dst_port; +UCHAR expect_pkt; + + /* Calculate offset. */ + if((cmd == MDNS_CHECK_ANY_V4) || (cmd == MDNS_REJECT_ANY_V4)) + offset = 20; + else + offset = 40; + + /* Whether this packet is expected. */ + if((cmd == MDNS_REJECT_ANY_V4) || (cmd == MDNS_REJECT_ANY_V6)) + expect_pkt = NX_FALSE; + else + expect_pkt = NX_TRUE; + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + if(status == NX_SUCCESS) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if(current_pkt) + { + + /* Get UDP port. */ + src_port = *((USHORT*)(current_pkt -> nx_packet_prepend_ptr + offset)); + dst_port = *((USHORT*)(current_pkt -> nx_packet_prepend_ptr + offset + 2)); + + /* Change endian. */ + NX_CHANGE_USHORT_ENDIAN(src_port); + NX_CHANGE_USHORT_ENDIAN(dst_port); + + /* Get flags in packet. */ + pkt_flags = *((USHORT*)(current_pkt -> nx_packet_prepend_ptr + offset + 10)); + + /* Change endian. */ + NX_CHANGE_USHORT_ENDIAN(pkt_flags); + + /* A packet has been queued. Examine the content of the packet. */ + if((src_port != 5353) || + (dst_port != 5353) || + (pkt_flags != target_flags)) + { + /* Not a match. */ + + /* Compute new timeout value. */ + current_time = tx_time_get(); + time_remaining = timeout - (current_time - start_time); + if((time_remaining > 0x80000000) && (expect_pkt == NX_TRUE)) + { + /* Underflow */ + time_remaining = 0; + error_counter = 1; + } + nx_packet_release(current_pkt); + continue; + } + else + { + /* Packet is a match. Get out of this CHECK state. */ + time_remaining = 0; + nx_packet_release(current_pkt); + + if(expect_pkt == NX_FALSE) + error_counter = 1; + continue; + } + } + } + else + { + /* Timeout */ + if(expect_pkt == NX_TRUE) + error_counter = 1; + time_remaining = 0; + } + } +} + +static void perform_mdns_rr_check(NX_MDNS *mdns_ptr, int pkt_size, int cmd) +{ + +ULONG *head; +NX_MDNS_RR *p; +UCHAR *record_buffer; +UINT buffer_size; +UINT rr_count; + + tx_mutex_get(&mdns_ptr -> nx_mdns_mutex, TX_WAIT_FOREVER); + + /* Get buffer. */ + if(cmd == MDNS_CHECK_RR_COUNT_REMOTE) + { + record_buffer = mdns_ptr -> nx_mdns_peer_service_cache; + buffer_size = mdns_ptr -> nx_mdns_peer_service_cache_size; + } + else + { + record_buffer = mdns_ptr -> nx_mdns_local_service_cache; + buffer_size = mdns_ptr -> nx_mdns_local_service_cache_size; + } + + rr_count = 0; + + /* Get head. */ + head = (ULONG*)record_buffer; + head = (ULONG*)(*head); + + /* Loop to find record. */ + for(p = (NX_MDNS_RR*)((ULONG*)record_buffer + 1); (ULONG*)p < head; p++) + { + + /* Check whether the resource record is valid. */ + if ((p -> nx_mdns_rr_state == NX_MDNS_RR_STATE_VALID) || + (p -> nx_mdns_rr_state == NX_MDNS_RR_STATE_DELETE)) + rr_count++; + } + + if(pkt_size != rr_count) + error_counter = 1; + + tx_mutex_put(&mdns_ptr -> nx_mdns_mutex); +} + + +#ifndef NX_MDNS_DISABLE_CLIENT +static void perform_mdns_rr_data_check(NX_MDNS *mdns_ptr, char *pkt_data, int pkt_size) +{ +MDNS_RR_DATA *rr_data_ptr = (MDNS_RR_DATA*)pkt_data; +UCHAR *buffer = assemble_pkt_data; +UINT index = 0; +NX_MDNS_SERVICE service; + + /* Loop to check RR data. */ + while(pkt_size > 0) + { + + /* Get service by type and domain. */ + if(nx_mdns_service_lookup(mdns_ptr, NX_NULL, rr_data_ptr -> mdns_rr_data_type, NX_NULL, index, &service)) + error_counter++; + else + { + index++; + + /* Check name fileds. */ + if(strcmp(service.service_name, rr_data_ptr -> mdns_rr_data_name)) + error_counter++; + } + + pkt_size--; + rr_data_ptr++; + } +} +#endif /* NX_MDNS_DISABLE_CLIENT */ + + +static void inject_packet(NX_IP *ip_ptr, char *pkt_data, int pkt_size) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + + /* Mark the packet as IPv6 */ + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V6; + + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(ip_ptr, my_packet); + +} + +static void dump_packets(void) +{ + + NX_PACKET *tmp_pkt; + + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + tmp_pkt = incoming_pkts; + + while(tmp_pkt) + { + tx_semaphore_get(&pkt_count_sem, 0); + incoming_pkts = tmp_pkt -> nx_packet_queue_next; + nx_packet_release(tmp_pkt); + tmp_pkt = incoming_pkts; + } + incoming_pkts = NX_NULL; + + tx_mutex_put(&pkt_capture_mutex); +} + +void netx_mdns_probing_notify(struct NX_MDNS_STRUCT *mdns_ptr, UCHAR *name, UINT state) +{ + + + /* Check state. */ + if(probing_callback_state == state) + probing_callback_invoked++; +} + +extern ULONG test_control_successful_tests; +extern ULONG test_control_failed_tests; +void netx_mdns_run_test_case(NX_IP *ip_ptr, NX_MDNS *mdns_ptr, MDNS_TEST_SEQ *test_case, int test_case_size) +{ + +int steps; +int i; +MDNS_SERVICE *mdns_service; +MDNS_QUERY_INFO *query; +ULONG current_time; +ULONG v4_address; + + /* Init the semaphore and mutex. */ + tx_mutex_create(&pkt_capture_mutex, "TAHI PKT CAPTURE", 0); + tx_semaphore_create(&pkt_count_sem, "TAHI_PKT COUNT SEM", 0); + + + packet_process_callback = packet_process; + + in_cleanup_process = 0; + error_counter = 0; + service_callback_state = 0; + service_callback_invoked = 0; + for(steps = 0; steps < test_case_size; steps++) + { + /* If error has occured, skip all the test steps and start the cleanup process. */ + if(error_counter && !in_cleanup_process) + { + if(test_case[steps].command != CLEANUP) + continue; + } + + switch(test_case[steps].command) + { + case CLEANUP: + /* This is a marker. Nothing needs to be done here. */ + in_cleanup_process = 1; + continue; + + case TITLE: + printf("NetX Test: MDNS %s TEST", test_case[steps].pkt_data); + + /* Align the output. */ + for (i = test_case[steps].pkt_size; i <= 47; i++) + printf("."); + + /* Set the flag to queue up packets. */ + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + pkt_capture_flag = 1; + tx_mutex_put(&pkt_capture_mutex); + break; + case INJECT: + inject_packet(ip_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size); + break; + case WAIT: + tx_thread_sleep(test_case[steps].timeout * NX_IP_PERIODIC_RATE); + break; + case MDNS_WAIT_TICK: + tx_thread_sleep(test_case[steps].timeout * NX_IP_PERIODIC_RATE / 100); + break; + case CHECK: + perform_check(test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + NX_MDNS_TIMER_COUNT_RANGE); + break; + case MDNS_SET_IPV4_ADDRESS: + nx_ip_address_set(ip_ptr, test_case[steps].pkt_size, 0xFF000000); + break; +#if defined FEATURE_NX_IPV6 && defined NX_ENABLE_IPV6_MULTICAST + case MDNS_LLA_ADD: + nx_ip_interface_physical_address_set(ip_ptr, 0, test_case[steps].pkt_size, test_case[steps].timeout, NX_TRUE); + nxd_ipv6_address_set(ip_ptr, 0, NX_NULL, 10, NX_NULL); + break; + case MDNS_LLA_DELETE: + nxd_ipv6_address_delete(ip_ptr, 0); + break; +#endif /* FEATURE_NX_IPV6 && NX_ENABLE_IPV6_MULTICAST */ + case MDNS_CHECK_DATA_V4: + case MDNS_CHECK_DATA_V6: + case MDNS_REJECT_DATA_V4: + case MDNS_REJECT_DATA_V6: + perform_check_mdns_data(test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + NX_MDNS_TIMER_COUNT_RANGE, test_case[steps].command); + break; + case MDNS_CHECK_ANY_V4: + case MDNS_CHECK_ANY_V6: + case MDNS_REJECT_ANY_V4: + case MDNS_REJECT_ANY_V6: + perform_check_mdns_any(test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + NX_MDNS_TIMER_COUNT_RANGE, test_case[steps].command); + break; +#ifndef NX_MDNS_DISABLE_CLIENT + case MDNS_QUERY: + query = (MDNS_QUERY_INFO *)test_case[steps].pkt_data; + nx_mdns_service_continuous_query(mdns_ptr, query -> name, query -> type, query -> sub_type); + break; + case MDNS_QUERY_HOST_ADDRESS: + nx_mdns_host_address_get(mdns_ptr, test_case[steps].pkt_data, &v4_address, NX_NULL, test_case[steps].timeout* NX_IP_PERIODIC_RATE); + break; + case MDNS_QUERY_DELETE: + nx_mdns_service_query_stop(mdns_ptr, query -> name, query -> type, query -> sub_type); + break; + case MDNS_SET_SERVICE_CALLBACK_STATE: + service_callback_state = test_case[steps].pkt_size; + service_callback_invoked = test_case[steps].timeout; + break; + case MDNS_SET_SERVICE_CALLBACK: + service_callback_state = test_case[steps].pkt_size; + service_callback_invoked = test_case[steps].timeout; + nx_mdns_service_notify_set(mdns_ptr, (ULONG)test_case[steps].pkt_data, service_change_notify); + break; + case MDNS_CHECK_SERVICE_CALLBACK_INVOKED: + if(service_callback_invoked != test_case[steps].timeout) + error_counter++; + break; + case MDNS_CHECK_RR_DATA: + perform_mdns_rr_data_check(mdns_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size); + break; +#endif /* NX_MDNS_DISABLE_CLIENT */ +#ifndef NX_MDNS_DISABLE_SERVER + case MDNS_SERVICE_DELETE: + mdns_service = (MDNS_SERVICE*)test_case[steps].pkt_data; + nx_mdns_service_delete(mdns_ptr, mdns_service -> name, mdns_service -> type, mdns_service -> sub_type); + break; + case MDNS_SERVICE_ADD: + mdns_service = (MDNS_SERVICE*)test_case[steps].pkt_data; + nx_mdns_service_add(mdns_ptr, mdns_service -> name, mdns_service -> type, mdns_service -> sub_type, mdns_service -> txt, + mdns_service -> ttl, mdns_service -> priority, mdns_service -> weights, mdns_service -> port, + mdns_service -> set, mdns_service -> if_index); + break; +#endif /* NX_MDNS_DISABLE_SERVER */ + case MDNS_SET_PROBING_CALLBACK_STATE: + probing_callback_state = test_case[steps].pkt_size; + probing_callback_invoked = test_case[steps].timeout; + break; + case MDNS_CHECK_PROBING_CALLBACK_INVOKED: + if(probing_callback_invoked != test_case[steps].timeout) + error_counter++; + break; + case MDNS_TIMER_RESET: + tx_time_set(0); + break; + case MDNS_TIMER_CHECK: + current_time = tx_time_get(); + if((current_time < (ULONG)((test_case[steps].timeout - test_case[steps].pkt_size) * NX_IP_PERIODIC_RATE / 100)) || + (current_time > (ULONG)((test_case[steps].timeout + test_case[steps].pkt_size) * NX_IP_PERIODIC_RATE / 100))) + error_counter++; + break; + case MDNS_TIMER_MAX_CHECK: + current_time = tx_time_get(); + if(current_time > (ULONG)(test_case[steps].timeout * NX_IP_PERIODIC_RATE / 100)) + error_counter++; + break; + case MDNS_INTERFACE_DISABLE: + nx_mdns_disable(mdns_ptr, 0); + break; + case MDNS_INTERFACE_ENABLE: + nx_mdns_enable(mdns_ptr, 0); + break; + case MDNS_RECREATE: + { + NX_PACKET_POOL *pool_ptr = mdns_ptr -> nx_mdns_packet_pool_ptr; + UCHAR *local_buffer = mdns_ptr -> nx_mdns_local_service_cache; + UCHAR *remote_buffer = mdns_ptr -> nx_mdns_peer_service_cache; + UINT local_buffer_size = mdns_ptr -> nx_mdns_local_service_cache_size; + UINT remote_buffer_size = mdns_ptr -> nx_mdns_peer_service_cache_size; + + nx_mdns_delete(mdns_ptr); + nx_mdns_create(mdns_ptr, ip_ptr, pool_ptr, 2, mdns_stack, DEMO_STACK_SIZE, + test_case[steps].pkt_data, local_buffer, local_buffer_size, remote_buffer, remote_buffer_size, netx_mdns_probing_notify); + nx_mdns_enable(mdns_ptr, 0); + + }break; + case MDNS_CHECK_RR_COUNT_REMOTE: + case MDNS_CHECK_RR_COUNT_LOCAL: + perform_mdns_rr_check(mdns_ptr, test_case[steps].pkt_size, test_case[steps].command); + break; + case DUMP: + dump_packets(); + break; + default: + break; + } + } + /* Set the flag to queue up packets. */ + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + pkt_capture_flag = 0; + packet_process_callback = NX_NULL; + tx_mutex_put(&pkt_capture_mutex); + dump_packets(); + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + tx_mutex_delete(&pkt_capture_mutex); + tx_semaphore_delete(&pkt_count_sem); +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + if(pkt_capture_flag == 0) + { + nx_packet_release(packet_ptr); + tx_mutex_put(&pkt_capture_mutex); + return NX_NULL; + } + + if(incoming_pkts == NX_NULL) + { + incoming_pkts = packet_ptr; + } + else + { + incoming_pkts_tail -> nx_packet_queue_next = packet_ptr; + } + incoming_pkts_tail = packet_ptr; + + packet_ptr -> nx_packet_queue_next = NX_NULL; + + tx_mutex_put(&pkt_capture_mutex); + + tx_semaphore_put(&pkt_count_sem); + + return NX_NULL; +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_second_interface_test.c b/test/regression/mdns_test/netx_mdns_second_interface_test.c new file mode 100644 index 00000000..516afd80 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_second_interface_test.c @@ -0,0 +1,282 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined NX_DISABLE_IPV4 && !defined NX_MDNS_DISABLE_SERVER && !defined NX_MDNS_DISABLE_CLIENT +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static CHAR host_registered = NX_FALSE; +static CHAR service_registered = NX_FALSE; +static CHAR packet_count = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID probing_notify(NX_MDNS *mdns_ptr, UCHAR *name, UINT state); + + +/* Define service. */ + +#define SERVICE_INSTANCE_NAME "NETXDUO_MDNS_Test1" +#define SERVICE_TYPE_HTTP "_http._tcp" +#define SERVICE_SUB_TYPE_NULL NX_NULL +#define SERVICE_TXT_NULL NX_NULL +#define SERVICE_TTL 120 +#define SERVICE_PRIORITY 0 +#define SERVICE_WEIGHTS 0 +#define SERVICE_PORT 80 + +#define SERVICE_TYPE_IPP "_ipp._tcp" + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_second_interface_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + /* Enable IGMP processing for both IP instances. */ + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "mDNS Client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + + NX_PARAMETER_NOT_USED(thread_input); + + printf("NetX Test: MDNS Second Interface Test................................"); + + /* Check early error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + advanced_packet_process_callback = my_packet_process; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_interface_status_check(&ip_0, 1, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, (UCHAR *)"NETX-MDNS-CLIENT", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, probing_notify); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 1); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register service. */ + status = nx_mdns_service_add(&mdns_0, (UCHAR *)SERVICE_INSTANCE_NAME, (UCHAR *)SERVICE_TYPE_HTTP, SERVICE_SUB_TYPE_NULL, + SERVICE_TXT_NULL, SERVICE_TTL, (USHORT)SERVICE_PRIORITY, (USHORT)SERVICE_WEIGHTS, + (USHORT)SERVICE_PORT, NX_TRUE, 1); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for host register and service register. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((packet_count == 0) || (host_registered != NX_TRUE) || (service_registered != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset packet count. */ + packet_count = 0; + + /* Perform mDNS continuous query. */ + status = nx_mdns_service_continuous_query(&mdns_0, NX_NULL, (UCHAR *)SERVICE_TYPE_IPP, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Determine if the test was successful. */ + if((error_counter) || (packet_count == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + + NX_PARAMETER_NOT_USED(delay_ptr); + + /* Check the packet interface. */ + if (packet_ptr -> nx_packet_address.nx_packet_interface_ptr != &ip_ptr -> nx_ip_interface[1]) + error_counter++; + + packet_count++; + + *operation_ptr = NX_NULL; + return NX_TRUE; +} + +static VOID probing_notify(struct NX_MDNS_STRUCT *mdns_ptr, UCHAR *name, UINT state) +{ + + NX_PARAMETER_NOT_USED(mdns_ptr); + NX_PARAMETER_NOT_USED(name); + + switch(state) + { + case NX_MDNS_LOCAL_SERVICE_REGISTERED_SUCCESS: + { + service_registered = NX_TRUE; + break; + } + case NX_MDNS_LOCAL_SERVICE_REGISTERED_FAILURE: + { + service_registered = NX_FALSE; + break; + } + case NX_MDNS_LOCAL_HOST_REGISTERED_SUCCESS: + { + host_registered = NX_TRUE; + break; + } + case NX_MDNS_LOCAL_HOST_REGISTERED_FAILURE: + { + + host_registered = NX_FALSE; + break; + } + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_second_interface_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Second Interface Test................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_service_add_delete_test.c b/test/regression/mdns_test/netx_mdns_service_add_delete_test.c new file mode 100644 index 00000000..6106b610 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_service_add_delete_test.c @@ -0,0 +1,399 @@ +#include "tx_api.h" +#include "nx_api.h" +#include +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_service_add_delete_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, (ULONG)(pointer + DEMO_STACK_SIZE), + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +CHAR *pointer = (CHAR*)thread_input; + + printf("NetX Test: MDNS Service Add And Delete Test.........................."); + + /* Initialize random. */ + srand((UINT)time(0)); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set pointer. */ + pointer = (CHAR*)thread_input; + + /* Initialize the buffer. */ + current_buffer_size = BUFFER_SIZE >> 1; + memset(buffer, 0xFF, BUFFER_SIZE); + + /* Create a MDNS instance. */ + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer += DEMO_STACK_SIZE; + + /* Check status. */ + if(status) + error_counter++; + + /*********************************************************/ + /* Delete the service when the MDNS function is disable. */ + /*********************************************************/ + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST1", (UCHAR *)"_ipp._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Add duplicate service. */ + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST1", (UCHAR *)"_ipp._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status == NX_SUCCESS) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 5) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST2", (UCHAR *)"_ipp._tcp", "_http", "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 10) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST3", (UCHAR *)"_http._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 15) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST4", (UCHAR *)"_smb._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 20) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST5", (UCHAR *)"_smb._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 24) + error_counter++; + + /* Delete the service when the MDNS function is disable. */ + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST1", (UCHAR *)"_ipp._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 20) + error_counter++; + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST2", (UCHAR *)"_ipp._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 14) + error_counter++; + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST3", (UCHAR *)"_http._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 9) + error_counter++; + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST4", (UCHAR *)"_smb._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 5) + error_counter++; + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST5", (UCHAR *)"_smb._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 0) + error_counter++; + + + /*********************************************************/ + /* Delete the service when the MDNS function is enable. */ + /*********************************************************/ + + /* Enable the MDNS function. */ + nx_mdns_enable(&mdns_0, 0); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 2) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST1", (UCHAR *)"_ipp._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 7) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST2", (UCHAR *)"_ipp._tcp", "_http", "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 12) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST3", (UCHAR *)"_http._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 17) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST4", (UCHAR *)"_smb._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 22) + error_counter++; + + status = nx_mdns_service_add(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST5", (UCHAR *)"_smb._tcp", NX_NULL, "paper=A4;version=01", 120, 0, 0, 8080, NX_MDNS_RR_SET_UNIQUE, 0); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 26) + error_counter++; + + /* Delete the service when the MDNS function is enable. */ + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST1", (UCHAR *)"_ipp._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Wait for sending the goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 22) + error_counter++; + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST2", (UCHAR *)"_ipp._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Disable the MDNS function. */ + nx_mdns_disable(&mdns_0, 0); + + /* Enable the MDNS function. */ + nx_mdns_enable(&mdns_0, 0); + + /* Wait for sending the goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 16) + error_counter++; + + /* Disable the MDNS function. */ + nx_mdns_disable(&mdns_0, 0); + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST3", (UCHAR *)"_http._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 11) + error_counter++; + + /* Enable the MDNS function. */ + nx_mdns_enable(&mdns_0, 0); + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST4", (UCHAR *)"_smb._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Wait for sending the goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 7) + error_counter++; + + status = nx_mdns_service_delete(&mdns_0, (UCHAR *)"NETXDUO_MDNS_TEST5", (UCHAR *)"_smb._tcp", NX_NULL); + + if(status) + error_counter++; + + /* Wait for sending the goodbye. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 2) + error_counter++; + + /* Disable the MDNS function. */ + nx_mdns_disable(&mdns_0, 0); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_service_add_delete_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Service Add And Delete Test..........................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/mdns_test/netx_mdns_service_lookup_test.c b/test/regression/mdns_test/netx_mdns_service_lookup_test.c new file mode 100644 index 00000000..fa450a9c --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_service_lookup_test.c @@ -0,0 +1,271 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR type[256]; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static CHAR mdns_data[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ +0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ +0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ +0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ +0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ +0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ +0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ +0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ +0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ +0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ +0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ +0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ +0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ +0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ +0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ +0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ +0x00 /* . */ +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_service_lookup_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192,168,0,31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; +NX_MDNS_SERVICE service; +UINT i; +ULONG ipv4_address; + + printf("NetX Test: MDNS Service Lookup Test.................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject a response packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, 100); + status += nx_packet_data_append(my_packet, mdns_data + 14, sizeof(mdns_data) - 14, &pool_0, 100); + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if(status) + error_counter++; + + /* The service name is CanonMF4500w._http._tcp.local. */ + if(nx_mdns_service_lookup(&mdns_0, NX_NULL, "_http._tcp", NX_NULL, 0, &service) == NX_SUCCESS) + { + if(strcmp(service.service_name, "CanonMF4500w")) + error_counter++; + if(strcmp(service.service_type, "_http._tcp")) + error_counter++; + if(strcmp(service.service_domain, "local")) + error_counter++; + } + else + error_counter++; + + /* Look by wrong type. */ + if(nx_mdns_service_lookup(&mdns_0, NX_NULL, "_http1._tcp", NX_NULL, 0, &service) == NX_SUCCESS) + error_counter++; + + /* Look by wrong index. */ + for(i = 1; i < 1000; i++) + { + if(nx_mdns_service_lookup(&mdns_0, NX_NULL, "_http._tcp", NX_NULL, i, &service) == NX_SUCCESS) + error_counter++; + } + + /* Look by name and type. */ + if(nx_mdns_service_lookup(&mdns_0, "CanonMF4500w", "_http._tcp", NX_NULL, 0, &service) == NX_SUCCESS) + { + if(strcmp(service.service_name, "CanonMF4500w")) + error_counter++; + if(strcmp(service.service_type, "_http._tcp")) + error_counter++; + if(strcmp(service.service_domain, "local")) + error_counter++; + } + else + error_counter++; + + /* Look by wrong name. */ + if(nx_mdns_service_lookup(&mdns_0, "CanonMF4500w1", "_http._tcp", NX_NULL, 0, &service) == NX_SUCCESS) + error_counter++; + + /* Look by wrong index. */ + for(i = 1; i < 1000; i++) + { + if(nx_mdns_service_lookup(&mdns_0, "CanonMF4500w", "_http._tcp", NX_NULL, i, &service) == NX_SUCCESS) + error_counter++; + } + + /* Look all services. */ + if(nx_mdns_service_lookup(&mdns_0, NX_NULL, NX_NULL, NX_NULL, 0, &service) == NX_SUCCESS) + { + if(strcmp(service.service_name, "CanonMF4500w")) + error_counter++; + if(strcmp(service.service_type, "_http._tcp")) + error_counter++; + if(strcmp(service.service_domain, "local")) + error_counter++; + } + else + error_counter++; + + /* Look by wrong index. */ + for(i = 1; i < 1000; i++) + { + if(nx_mdns_service_lookup(&mdns_0, NX_NULL, NX_NULL, NX_NULL, i, &service) == NX_SUCCESS) + error_counter++; + } + + /* Check IPv4 address. */ + if(nx_mdns_host_address_get(&mdns_0, "router.local", &ipv4_address, NX_NULL, NX_NO_WAIT) == NX_SUCCESS) + { + if(ipv4_address != IP_ADDRESS(192, 168, 0, 4)) + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_service_lookup_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Service Lookup Test..................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ diff --git a/test/regression/mdns_test/netx_mdns_source_address_test.c b/test/regression/mdns_test/netx_mdns_source_address_test.c new file mode 100644 index 00000000..2831433a --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_source_address_test.c @@ -0,0 +1,299 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_1; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; +static UCHAR mdns_data[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x58, 0x08, 0x00, 0x45, 0x00, +0x00, 0xd1, 0x00, 0x01, 0x00, 0x00, 0x80, 0x11, +0x31, 0x0f, 0x01, 0x02, 0x03, 0x05, 0x02, 0x02, +0x03, 0x04, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, +0x5f, 0xe5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ +0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ +0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ +0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ +0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ +0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ +0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ +0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ +0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ +0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ +0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ +0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ +0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ +0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ +0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ +0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ +0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ +0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ +0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ +0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ +}; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +static void check_empty_buffer(UCHAR *buffer_ptr, ULONG buffer_size, UCHAR expect_empty); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_source_address_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; +NXD_ADDRESS address; + + printf("NetX Test: MDNS Source Address Test.................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set callback function pointer to discard the probing and annoucning packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to the IP port. */ + status += nx_udp_socket_bind(&socket_1, 5353, TX_WAIT_FOREVER); + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, mdns_stack, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + nx_mdns_enable(&mdns_0, 0); + nx_mdns_enable(&mdns_0, 1); + + /* Inject mDNS response from 1.2.3.5 to 2.2.3.4. This packet MUST be rejected. */ + /* Secion 11, page 38, RFC 6762. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, 100); + status += nx_packet_data_append(my_packet, mdns_data + 14, sizeof(mdns_data) - 14, &pool_0, 100); + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[1]; + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if(status) + error_counter++; + + /* Sleep one second to then check whether it is received. */ + tx_thread_sleep(100); + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_TRUE); + nx_mdns_delete(&mdns_0); + + /* Initialize the buffer. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, mdns_stack, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + nx_mdns_enable(&mdns_0, 0); + nx_mdns_enable(&mdns_0, 1); + + /* Send unicase response. */ + address.nxd_ip_version = NX_IP_VERSION_V4; + address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 4); + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(my_packet, mdns_data + 42, sizeof(mdns_data) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&socket_1, my_packet, &address, 5353); + + /* Check status. */ + if(status) + error_counter++; + + /* Sleep one second to then check whether it is received. */ + tx_thread_sleep(100); + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_FALSE); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void check_empty_buffer(UCHAR *buffer_ptr, ULONG buffer_size, UCHAR expect_empty) +{ + +ULONG *tail, *head; + + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + + /* Check head. */ + head = (ULONG*)buffer_ptr; + if((*head == (ULONG)(head + 1)) && (expect_empty == NX_FALSE)) + error_counter++; + else if((*head != (ULONG)(head + 1)) && (expect_empty == NX_TRUE)) + error_counter++; + + /* Check tail. */ + tail = (ULONG*)buffer_ptr + (buffer_size >> 2) - 1; + if((tail == (ULONG*)(*tail)) && (expect_empty == NX_FALSE)) + error_counter++; + else if((tail != (ULONG*)(*tail)) && (expect_empty == NX_TRUE)) + error_counter++; + + tx_mutex_put(&mdns_0.nx_mdns_mutex); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; + + ip_header_ptr = (NX_IPV4_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + /* Check the destination address. */ + if (ip_header_ptr -> nx_ip_header_destination_ip == NX_MDNS_IPV4_MULTICAST_ADDRESS) + { + + /* Discard probing and annoucning message to avoid affecting test. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + return(NX_TRUE); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_source_address_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Source Address Test..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_source_port_test.c b/test/regression/mdns_test/netx_mdns_source_port_test.c new file mode 100644 index 00000000..f505cb0c --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_source_port_test.c @@ -0,0 +1,249 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_UDP_SOCKET socket_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_data[] = +{ +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xc8, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x90, 0x02, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb4, /* ........ */ +0x5a, 0xe8, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Z....... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x04, 0x5f, /* ......._ */ +0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ +0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ +0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ +0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ +0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ +0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ +0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ +0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ +0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ +0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ +0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ +0x00, 0x00, 0x64, 0x00, 0x01, 0x00 /* ..d... */ +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static NX_PACKET *current_packet; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_source_port_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NXD_ADDRESS address; +NX_MDNS_SERVICE service; + + + printf("NetX Test: MDNS Source Port Test....................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to the IP port. */ + status += nx_udp_socket_bind(&socket_0, 53, TX_WAIT_FOREVER); + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Send MULTICAST address. */ + address.nxd_ip_version = NX_IP_VERSION_V4; + address.nxd_ip_address.v4 = NX_MDNS_IPV4_MULTICAST_ADDRESS; + + /* Allocate a packet and add data with mDNS response. */ + status = nx_packet_allocate(&pool_0, ¤t_packet, NX_IPv4_UDP_PACKET, 100); + status += nx_packet_data_append(current_packet, mdns_data + 42, sizeof(mdns_data) - 42, &pool_0, 100); + status += nxd_udp_socket_send(&socket_0, current_packet, &address, 5353); + current_packet = NX_NULL; + + if(status) + error_counter++; + + /* Sleep one second and check whether RR is stored. */ + /* Multicast DNS implementations MUST silently ignore any + Multicast DNS responses they receive where the source UDP port is not 5353. */ + tx_thread_sleep(100); + + if(nx_mdns_service_lookup(&mdns_0, NX_NULL, NX_NULL, NX_NULL, 0, &service) == NX_SUCCESS) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + if(packet_ptr == current_packet) + { + + /* It is a response packet. */ + /* Inject it to IP layer. */ + packet_ptr -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + return NX_FALSE; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_source_port_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Source Port Test.....................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ diff --git a/test/regression/mdns_test/netx_mdns_test.h b/test/regression/mdns_test/netx_mdns_test.h new file mode 100644 index 00000000..c236271a --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_test.h @@ -0,0 +1,145 @@ +#ifndef _NETX_MDNS_TEST_H_ +#define _NETX_MDNS_TEST_H_ + + +#include "tx_api.h" +#include "nx_api.h" + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_mdns.h" + +#ifndef NX_MDNS_RR_SET_UNIQUE +#define NX_MDNS_RR_SET_UNIQUE 0 +#endif + +/* Define the test command. */ +/* basic command. */ +#define TITLE 1 /* This entry contains the name of the test. */ +#define INJECT 2 /* This entry contains packet that needs to be injected into the system.*/ +#define CHECK 3 /* This entry contains packet that needs to be matched. */ +#define WAIT 4 /* This entry is to place a wait. */ +#define DUMP 5 /* This entry flushes the incoming packet queue. */ +#define CLEANUP 6 /* This is a marker, indicating the beginning sequeuence of cleanup procedure. */ +#define N_CHECK 7 /* This entry contains packet that do not want to be received. */ + +#ifdef NX_IPSEC_ENABLE +#define D_CHECK 8 /* This entry contains packet that needs to be matched after decryption. */ +#define ASSEMBLE 9 /* This entry contains packet that needs to be assembled. */ +#define AD_CHECK 10 /* This entry contains packet that needs to be assembled and be matched after decryption. */ +#define TD_CHECK 11 /* This entry contains packet that needs to be matched after decryption which is tunneled. */ +#endif + +#define NS 12 /* NS packet. */ +#define NA 13 /* NA packet. */ +#define RS 14 /* RS packet. */ +#define ER 15 /* ECHO REPLY packet. */ +#define CLEAN_HOP_LIMIT 16 /* This is a marker, indicating the hop limit should be initial to 0xff. */ +#define NS_UNSPEC 17 /* This is a marker, indicating the NS is being check. */ +#define CHECK_V6REQUEST 18 /* This is a marker, indicating the ping6_request has been send. */ +#define REBOOT 19 /* This is a marker, indicating the reboot process. */ + +/*mDNS command. */ +#define MDNS_CHECK_DATA_V4 0x50 /* This entry contains packet that needs to be matched by IPv4 UDP data. */ +#define MDNS_CHECK_DATA_V6 0x51 /* This entry contains packet that needs to be matched by IPv6 UDP data. */ +#define MDNS_CHECK_RR_COUNT_REMOTE 0x52 /* This entry checks remote resource record count. */ +#define MDNS_CHECK_RR_COUNT_LOCAL 0x53 /* This entry checks local resource record count. */ +#define MDNS_CHECK_RR_DATA 0x54 /* This entry checks local resource record data. */ +#define MDNS_CHECK_ANY_V4 0x55 /* This entry contains packet that needs to be matched by IPv4 mDNS data. */ +#define MDNS_CHECK_ANY_V6 0x56 /* This entry contains packet that needs to be matched by IPv6 mDNS data. */ +#define MDNS_CHECK_PROBING_CALLBACK_INVOKED 0x57 /* This entry checks the value of probing callback invoked. */ +#define MDNS_CHECK_SERVICE_CALLBACK_INVOKED 0x58 /* This entry checks the value of callback invoked. */ +#define MDNS_REJECT_DATA_V4 0x59 /* This entry contains packet that is not expected matched by IPv4 UDP data. */ +#define MDNS_REJECT_DATA_V6 0x5A /* This entry contains packet that is not expected matched by IPv6 UDP data. */ +#define MDNS_REJECT_ANY_V4 0x5B /* This entry contains packet that is not expected matched by IPv4 mDNS data. */ +#define MDNS_REJECT_ANY_V6 0x5C /* This entry contains packet that is not expected matched by IPv6 mDNS data. */ +#define MDNS_SET_IPV4_ADDRESS 0x5D /* This entry sets the ipv4 address. */ +#define MDNS_SET_SERVICE_CALLBACK 0x5E /* This entry sets the service callback function. */ +#define MDNS_SET_SERVICE_CALLBACK_STATE 0x5F /* This entry sets the callback state. */ +#define MDNS_SET_PROBING_CALLBACK_STATE 0x60 /* This entry sets the probing state. */ +#define MDNS_TIMER_RESET 0x61 /* This entry resets the timer. */ +#define MDNS_TIMER_CHECK 0x62 /* This entry checks the timer. */ +#define MDNS_TIMER_MAX_CHECK 0x63 /* This entry checks the max timer. */ +#define MDNS_QUERY 0x64 /* This entry adds query to mDNS. */ +#define MDNS_QUERY_ONESHOT 0x65 /* This entry adds one-shot query to mDNS. */ +#define MDNS_QUERY_DELETE 0x66 /* This entry deletes query to mDNS. */ +#define MDNS_QUERY_HOST_ADDRESS 0x67 /* This entry adds query to mDNS. */ +#define MDNS_SERVICE_ADD 0x68 /* This entry adds a service to mDNS. */ +#define MDNS_SERVICE_DELETE 0x69 /* This entry deletes all services to mDNS. */ +#define MDNS_INTERFACE_DISABLE 0x6A /* This entry disable interface. */ +#define MDNS_INTERFACE_ENABLE 0x6B /* This entry enable interface. */ +#define MDNS_LLA_ADD 0x6C /* This entry adds link local address. */ +#define MDNS_LLA_DELETE 0x6D /* This entry deletes link local address. */ +#define MDNS_RECREATE 0x6F /* This entry deletes and creates mdns instance. */ +#define MDNS_WAIT_TICK 0x70 /* This entry sleep specified ticks. */ + + +#define MDNS_FLAG_QUERY 0x0000 /* Define flag for standard query. */ +#define MDNS_FLAG_RESPONSE 0x8400 /* Define flag for standard query response, No error. */ + + +typedef struct MDNS_TEST_SEQ_struct +{ + /* The command. Only INJECT and CHECK carries valid pkt_data and pkt_size. */ + int command; + + /* Only INJECT and CHECK carries valid pkt_data and pkt_size. */ + /* For TITLE, pkt_data carries a const string, which is used as the name of the test case. */ + char *pkt_data; + int pkt_size; + + /* Used for CHECK and WAIT. */ + /* WAIT command: wait this amount of time. */ + /* CHECK command: during the timeout period, check any incoming packets against the pkt_data in this entry. */ + int timeout; + + /*Used in D_CHECK to lookup the sa */ + /* Next layer protocol*/ + UCHAR protocol; + + /* Used when the next layer protocol is UDP*/ + ULONG src_port; + ULONG dst_port; + + /*Used when the next layer protocol is ICMP or ICMPv6*/ + UINT option; +} MDNS_TEST_SEQ; + +typedef struct MDNS_TEST_SUITE_struct +{ + MDNS_TEST_SEQ *test_case; + int *test_case_size; +} MDNS_TEST_SUITE; + +typedef struct MDNS_RR_DATA_STRUCT +{ + char *mdns_rr_data_name; + char *mdns_rr_data_type; + char *mdns_rr_data_domain_name; +}MDNS_RR_DATA; + +typedef struct MDNS_SERVICE_STRUCT +{ + char *name; + char *type; + char *sub_type; + UCHAR *txt; + ULONG ttl; + USHORT priority; + USHORT weights; + USHORT port; + UCHAR set; + UINT if_index; +}MDNS_SERVICE; + +typedef struct MDNS_QUERY_INFO_STRUCT +{ + char *name; + char *type; + char *sub_type; +}MDNS_QUERY_INFO; + +void netx_mdns_run_test_case(NX_IP *ip_ptr, NX_MDNS *mdns_ptr, MDNS_TEST_SEQ *test_case, int test_case_size); +void netx_mdns_probing_notify(struct NX_MDNS_STRUCT *mdns_ptr, UCHAR *name, UINT state); + +#endif /* __PRODUCT_NETXDUO__ */ +#endif diff --git a/test/regression/mdns_test/netx_mdns_ttl_test.c b/test/regression/mdns_test/netx_mdns_ttl_test.c new file mode 100644 index 00000000..9643e7ed --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_ttl_test.c @@ -0,0 +1,225 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static UCHAR warning; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_ttl_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + warning = NX_FALSE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192,168,0,31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: MDNS TTL Test............................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increase error_counter incase packets are not received. */ + error_counter++; + + /* Set callback function pointer. */ + advanced_packet_process_callback = my_packet_process; + + /* Add service to send probing. */ + nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(warning == NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR ttl; +UCHAR *pointer; + + /* Get protocol. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 9; + + /* Check UDP packets only. */ + if(*pointer != NX_PROTOCOL_UDP) + return NX_TRUE; + + /* Get port. */ + pointer = packet_ptr -> nx_packet_prepend_ptr + 20; + + /* Check UDP port 5353 only. */ + if((((*pointer << 8) + *(pointer + 1)) != 5353) || + (((*(pointer + 2) << 8) + *(pointer + 3)) != 5353)) + return NX_TRUE; + + /* Packets received. */ + error_counter--; + + /* Get TTL. */ + ttl = *(packet_ptr -> nx_packet_prepend_ptr + 8); + + /* All Multicast DNS responses SHOULD be sent with IP TTL set to 255. */ + /* Section 11, page 38, RFC 6762. */ + if(ttl == 255) + warning = NX_FALSE; + else + warning = NX_TRUE; + + /* Set callback function pointer. */ + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_ttl_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS TTL Test.............................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_SERVER */ diff --git a/test/regression/mdns_test/netx_mdns_two_buffer_test.c b/test/regression/mdns_test/netx_mdns_two_buffer_test.c new file mode 100644 index 00000000..6d81975d --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_two_buffer_test.c @@ -0,0 +1,304 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static UCHAR mdns_stack[DEMO_STACK_SIZE]; +static ULONG buffer_org_head; +static ULONG buffer_org_tail; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); +static void check_empty_buffer(UCHAR *buffer_ptr, ULONG buffer_size, UCHAR expect_empty); +static void empty_buffer_init(); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_two_buffer_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192,168,0,31), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, (ULONG)(pointer + DEMO_STACK_SIZE), + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +CHAR *pointer = (CHAR*)thread_input; + + printf("NetX Test: MDNS Two Buffer Test......................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set pointer. */ + pointer = (CHAR*)thread_input; + /* Create */ + current_buffer_size = 160; + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + empty_buffer_init(); + +#ifndef NX_MDNS_DISABLE_SERVER + /* Buffer is too small to add a service. */ + nx_mdns_service_add(&mdns_0, (CHAR *)"ARMMDNSTest", (CHAR *)"_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Check local buffer. It must be empty. */ + check_empty_buffer(buffer, current_buffer_size, NX_TRUE); + + if(mdns_0.nx_mdns_local_rr_count != 0) + error_counter++; +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Check remote buffer. It must be empty. */ + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_TRUE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != 0) + error_counter++; +#endif /* NX_MDNS_DISABLE_CLIENT */ + + /* Delete */ + nx_mdns_delete(&mdns_0); + + /* Initialize the buffer. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* Enable mDNS. */ + nx_mdns_enable(&mdns_0, 0); + + empty_buffer_init(); + +#ifndef NX_MDNS_DISABLE_SERVER + /* Use local buffer. */ + nx_mdns_service_add(&mdns_0, "ARMMDNSTest", "_ipp._tcp", NX_NULL, NX_NULL, 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Check local buffer. It must not be empty. */ + check_empty_buffer(buffer, current_buffer_size, NX_FALSE); + + /* Delete the service. */ + nx_mdns_service_delete(&mdns_0, "ARMMDNSTest", "_ipp._tcp", NX_NULL); + + /* Sleep 1 second for goodbye packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check local buffer. It must be empty. */ + check_empty_buffer(buffer, current_buffer_size, NX_TRUE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_local_rr_count != 2) + error_counter++; +#endif /* NX_MDNS_DISABLE_SERVER */ + +#ifndef NX_MDNS_DISABLE_CLIENT + /* Check remote buffer. It must be empty. */ + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_TRUE); + + if(mdns_0.nx_mdns_peer_rr_count != 0) + error_counter++; + + /* Use remote buffer. */ + nx_mdns_service_continuous_query(&mdns_0, NX_NULL, "_printer._tcp", NX_NULL); + + /* Check local buffer. It must be empty. */ + check_empty_buffer(buffer, current_buffer_size, NX_TRUE); + + /* Check remote buffer. It must be empty. */ + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_FALSE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != 1) + error_counter++; + + /* Clear the peer cache. */ + nx_mdns_peer_cache_clear(&mdns_0); + + /* Check local buffer. It must be empty. */ + check_empty_buffer(buffer, current_buffer_size, NX_TRUE); + + /* Check remote buffer. It must be empty. */ + check_empty_buffer(buffer + current_buffer_size, current_buffer_size, NX_TRUE); + + /* Check mdns information. */ + if(mdns_0.nx_mdns_peer_rr_count != 0) + error_counter++; +#endif /* NX_MDNS_DISABLE_CLIENT */ + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void check_empty_buffer(UCHAR *buffer_ptr, ULONG buffer_size, UCHAR expect_empty) +{ + +ULONG *tail, *head; +ULONG expected_head, expected_tail; + + tx_mutex_get(&mdns_0.nx_mdns_mutex, TX_WAIT_FOREVER); + + head = (ULONG*)buffer_ptr; + tail = (ULONG*)buffer_ptr + (buffer_size >> 2) - 1; + + /* Get expected head and tail. */ + if(buffer_ptr == buffer) + { + expected_head = buffer_org_head; + expected_tail = buffer_org_tail; + } + else + { + expected_head = (ULONG)(head + 1); + expected_tail = (ULONG)tail; + } + + /* Check head. */ + if((*head == expected_head) && (expect_empty == NX_FALSE)) + error_counter++; + else if((*head != expected_head) && (expect_empty == NX_TRUE)) + error_counter++; + + /* Check tail. */ + if((*tail == expected_tail) && (expect_empty == NX_FALSE)) + error_counter++; + else if((*tail != expected_tail) && (expect_empty == NX_TRUE)) + error_counter++; + + tx_mutex_put(&mdns_0.nx_mdns_mutex); +} + +static void empty_buffer_init() +{ +ULONG *tail, *head; + + head = (ULONG*)buffer; + buffer_org_head = *head; + + tail = (ULONG*)buffer + (current_buffer_size >> 2) - 1; + buffer_org_tail = *tail; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_two_buffer_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS Two Buffer Test......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/mdns_test/netx_mdns_txt_notation_test.c b/test/regression/mdns_test/netx_mdns_txt_notation_test.c new file mode 100644 index 00000000..f756af7b --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_txt_notation_test.c @@ -0,0 +1,225 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_CLIENT && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static CHAR *txt = "paper=A4;version=01"; +static CHAR mdns_data[] = { +0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ +0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ +0x00, 0xdf, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ +0x8f, 0xec, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ +0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ +0x81, 0x17, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ +0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ +0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ +0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ +0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ +0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ +0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ +0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ +0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ +0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ +0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ +0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ +0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ +0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ +0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ +0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_txt_notation_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_MDNS_SERVICE service; +NX_PACKET *my_packet; + + printf("NetX Test: MDNS TXT Notation Test...................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject a response with TXT. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, 100); + status += nx_packet_data_append(my_packet, mdns_data + 14, sizeof(mdns_data) - 14, &pool_0, 100); + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if(status) + error_counter++; + + /* Sleep one second. */ + tx_thread_sleep(100); + + /* Lookup service. */ + status = nx_mdns_service_lookup(&mdns_0, NX_NULL, "_http._tcp", NX_NULL, 0, &service); + + /* Check RR and TXT. */ + if(status) + error_counter++; + else if(service.service_text == NX_NULL) + error_counter++; + else if(strcmp(service.service_text, txt)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_txt_notation_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS TXT Notation Test....................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_CLIENT */ diff --git a/test/regression/mdns_test/netx_mdns_txt_test.c b/test/regression/mdns_test/netx_mdns_txt_test.c new file mode 100644 index 00000000..c6b3bf58 --- /dev/null +++ b/test/regression/mdns_test/netx_mdns_txt_test.c @@ -0,0 +1,189 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && !defined NX_MDNS_DISABLE_SERVER && !defined NX_DISABLE_IPV4 +#include "nxd_mdns.h" + +#define DEMO_STACK_SIZE 2048 +#define BUFFER_SIZE 10240 +#define LOCAL_FULL_SERVICE_COUNT 16 +#define PEER_FULL_SERVICE_COUNT 16 +#define PEER_PARTIAL_SERVICE_COUNT 32 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the NetX MDNS object control blocks. */ + +static NX_MDNS mdns_0; +static UCHAR buffer[BUFFER_SIZE]; +static ULONG current_buffer_size; +static CHAR *test_strings[] = { + + /* Total length 255. */ + "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTU=12345678", + + /* Total length 256. */ + "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTU=123456789" +}; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_txt_test(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Create the test thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, NX_NULL, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: MDNS TXT Test............................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create mDNS. */ + current_buffer_size = (BUFFER_SIZE >> 1); + status = nx_mdns_create(&mdns_0, &ip_0, &pool_0, 2, pointer, DEMO_STACK_SIZE, "NETX-MDNS", + buffer, current_buffer_size, buffer + current_buffer_size, current_buffer_size, NX_NULL); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable mDNS. */ + status = nx_mdns_enable(&mdns_0, 0); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add services. */ + /* The TXT length is 255. */ + status = nx_mdns_service_add(&mdns_0, "test", (CHAR *)"_ipp._tcp", NX_NULL, test_strings[0], 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Check status. */ + if(status) + error_counter++; + +#ifndef NX_DISABLE_ERROR_CHECKING + /* The TXT length is 256. */ + status = nx_mdns_service_add(&mdns_0, "test1", (CHAR *)"_ipp._tcp", NX_NULL, test_strings[1], 100, 0, 0, 80, NX_MDNS_RR_SET_UNIQUE, 0); + + /* Check status. */ + if(!status) + error_counter++; +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mdns_txt_test(void *first_unused_memory) +#endif +{ + printf("NetX Test: MDNS TXT Test.............................................N/A\n"); + test_control_return(3); +} +#endif /* NX_MDNS_DISABLE_SERVER */ diff --git a/test/regression/mqtt_test/netx_mqtt_api_test.c b/test/regression/mqtt_test/netx_mqtt_api_test.c new file mode 100644 index 00000000..a1206e74 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_api_test.c @@ -0,0 +1,318 @@ +/* This NetX test concentrates on the basic IP operation. */ + +#include "nxd_mqtt_client.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *ip_0_memory_ptr; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern ULONG simulated_address_msw; +extern ULONG simulated_address_lsw; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create IP instances. */ + ip_0_memory_ptr = pointer; + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + + + +/* Define the test threads. */ +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static NXD_MQTT_CLIENT my_client; +static ULONG mqtt_stack_space[DEMO_STACK_SIZE / sizeof(ULONG)]; +static ULONG client_memory; +static void ntest_0_entry(ULONG thread_input) +{ +NXD_ADDRESS server_ip; + +UINT status; +UCHAR message[4]; + + /* Print out test information banner. */ + printf("NetX Test: MQTT API Test ............................................"); + + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test MQTT_CLIENT control block being NULL */ + status = nxd_mqtt_client_create(NX_NULL, NX_NULL, NX_NULL, 0, &ip_0, &pool_0, mqtt_stack_space, sizeof(mqtt_stack_space), MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test IP control block being NULL */ + status = nxd_mqtt_client_create(&my_client, NX_NULL, NX_NULL, 0, /* &ip_0*/NX_NULL, &pool_0, mqtt_stack_space, sizeof(mqtt_stack_space), MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test packet_pool control block being NULL */ + status = nxd_mqtt_client_create(&my_client, NX_NULL, NX_NULL, 0, &ip_0, NX_NULL/*&pool_0*/, mqtt_stack_space, sizeof(mqtt_stack_space), MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test stack space being NULL */ + status = nxd_mqtt_client_create(&my_client, NX_NULL, NX_NULL, 0, &ip_0, &pool_0, NX_NULL/*mqtt_stack_space*/, sizeof(mqtt_stack_space), MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test stack size being 0 */ + status = nxd_mqtt_client_create(&my_client, NX_NULL, NX_NULL, 0, &ip_0, &pool_0, mqtt_stack_space, 0, MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test ip_id != NX_IP_ID */ + ip_0.nx_ip_id = 0; + status = nxd_mqtt_client_create(&my_client, NX_NULL, NX_NULL, 0, &ip_0, &pool_0, mqtt_stack_space, sizeof(mqtt_stack_space), MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + ip_0.nx_ip_id = NX_IP_ID; + + /* Test client connect API. */ + server_ip.nxd_ip_version = 4; + /* Test MQTT_CLIENT control block being NULL */ + status = nxd_mqtt_client_connect(NX_NULL, &server_ip, NXD_MQTT_PORT, 0, 0, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test server_ip being NULL */ + status = nxd_mqtt_client_connect(&my_client, NX_NULL, NXD_MQTT_PORT, 0, 0, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test invalid port number */ + status = nxd_mqtt_client_connect(&my_client, &server_ip, 0, 0, 0, 0); + if(status != NX_INVALID_PORT) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test invalid IP version number */ + server_ip.nxd_ip_version = 3; + status = nxd_mqtt_client_connect(&my_client, &server_ip, NXD_MQTT_PORT, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Restore the IP version number */ + server_ip.nxd_ip_version = 6; + + /* Test invalid username/password combination. */ + status = nxd_mqtt_client_login_set(&my_client, NX_NULL, 8, NX_NULL, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test invalid username/password combination. */ + status = nxd_mqtt_client_login_set(&my_client, NX_NULL, 0, NX_NULL, 8); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test invalid client_ptr. */ + status = nxd_mqtt_client_login_set(NX_NULL, NX_NULL, 0, NX_NULL, 8); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* MQTT 5.10sp4: The following test was removed because MQTT shall + allow user name being set and password not being set. */ +#if 0 + status = nxd_mqtt_client_login_set(&my_client, "username", 8, NX_NULL, 0); + if (status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + + /* Validate nxd_mqtt_client_publish */ + status = nxd_mqtt_client_publish(NX_NULL, "topic", 5, "message", 7, 0, 0, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate topic name */ + status = nxd_mqtt_client_publish(&my_client, NX_NULL, 5, "message", 7, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nxd_mqtt_client_publish(&my_client, "topic", 0, "message", 7, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate message length. */ + status = nxd_mqtt_client_publish(&my_client, "topic", 5, "message", 0, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate message empty and non-zero length. */ + status = nxd_mqtt_client_publish(&my_client, "topic", 5, NX_NULL, 2, 0, 0, 0); + if(status != NXD_MQTT_NOT_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate message empty and zero length. */ + status = nxd_mqtt_client_publish(&my_client, "topic", 5, NX_NULL, 0, 0, 0, 0); + if(status != NXD_MQTT_NOT_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate QoS value. */ + status = nxd_mqtt_client_publish(&my_client, "topic", 5, "message", 7, 0, 4, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + + /* Validate nxd_mqtt_client_subscribe. */ + status = nxd_mqtt_client_subscribe(NX_NULL, "topic", 5, 0); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + status = nxd_mqtt_client_subscribe(&my_client, NX_NULL, 5, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_subscribe(&my_client, "topic", 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_subscribe(&my_client, "topic", 5, 3); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* validate nxd_mqtt_client_unsubscribe. */ + status = nxd_mqtt_client_unsubscribe(NX_NULL, "topic", 5); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + status = nxd_mqtt_client_unsubscribe(&my_client, NX_NULL, 5); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_unsubscribe(&my_client, "topic", 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + + /* Validate nxd_mqtt_client_receive_notify_set. */ + status = nxd_mqtt_client_receive_notify_set(NX_NULL, NX_NULL); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate nxd_mqtt_client_receive_notify_set. */ + status = nxd_mqtt_client_receive_notify_set(&my_client, NX_NULL); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate nxd_mqtt_client_disconnect_notify_set NULL client_ptr behavior. */ + status = nxd_mqtt_client_disconnect_notify_set(NX_NULL, NX_NULL); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate nxd_mqtt_client_disconnect */ + status = nxd_mqtt_client_disconnect(NX_NULL); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate nxd_mqtt_client_delete */ + status = nxd_mqtt_client_delete(NX_NULL); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate nxd_mqtt_client_message_get. */ + status = nxd_mqtt_client_message_get(NX_NULL, NX_NULL, 0, NX_NULL, message, sizeof(message), NX_NULL); + if(status != NX_PTR_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_message_get(&my_client, NX_NULL, 0, NX_NULL, NX_NULL, 0, NX_NULL); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nxd_mqtt_client_message_get(&my_client, NX_NULL, 0, NX_NULL, message, sizeof(message), NX_NULL); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_will_message_set(NX_NULL, NX_NULL, 0, NX_NULL, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nxd_mqtt_client_will_message_set(&my_client, NX_NULL, 2, NX_NULL, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nxd_mqtt_client_will_message_set(&my_client, "ab", 0, NX_NULL, 0, 0, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nxd_mqtt_client_will_message_set(&my_client, "Ab", 2, NX_NULL, 0, 0, 4); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_will_message_set(&my_client, "Ab", 2, NX_NULL, 0, 2, 0); + if(status != NXD_MQTT_INVALID_PARAMETER) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} diff --git a/test/regression/mqtt_test/netx_mqtt_branch_test.c b/test/regression/mqtt_test/netx_mqtt_branch_test.c new file mode 100644 index 00000000..b33a2418 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_branch_test.c @@ -0,0 +1,398 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "tx_mutex.h" +#include "tx_thread.h" +#include "tx_timer.h" +#include "tx_event_flags.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_2; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static NXD_MQTT_CLIENT *client_ptr_test; +static UCHAR *client_memory; +static UCHAR *client_memory_test; +static CHAR *stack_ptr; +static CHAR *stack_ptr_test; +static UCHAR filler_data[PACKET_SIZE] = { 0 }; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_branch_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + status = tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a packet pool for test create. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance for test create. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 3), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + // status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; + + /* Make room for create test client memory and control block. */ + pointer += sizeof(NXD_MQTT_CLIENT); + + stack_ptr_test = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory_test = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr_test = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +/* Define the test threads. */ +/* This thread sets up MQTT client and performs multiple branch tests on different APIs. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Branch Test ......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NXD_MQTT_CLOUD_ENABLE + /* Test create internal mutex already created. */ + TX_MUTEX* old_mutex_create_ptr = _tx_mutex_created_ptr; + _tx_mutex_created_ptr = &(client_ptr_test -> nxd_mqtt_protection); + status = nxd_mqtt_client_create(client_ptr_test, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_2, &pool_1, + stack_ptr_test, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory_test, CLIENT_MEMORY_SIZE); + if(status != NXD_MQTT_INTERNAL_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + _tx_mutex_created_ptr = old_mutex_create_ptr; + + /* Test create internal thread already created. */ + TX_THREAD* old_thread_create_ptr = _tx_thread_created_ptr; + _tx_thread_created_ptr = &(client_ptr_test -> nxd_mqtt_thread); + status = nxd_mqtt_client_create(client_ptr_test, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_2, &pool_1, + stack_ptr_test, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory_test, CLIENT_MEMORY_SIZE); + if(status != NXD_MQTT_INTERNAL_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + _tx_thread_created_ptr = old_thread_create_ptr; + + + /* Test create internal event flags already created. */ + TX_EVENT_FLAGS_GROUP* old_event_flags_create_ptr = _tx_event_flags_created_ptr; + _tx_event_flags_created_ptr = &(client_ptr_test -> nxd_mqtt_events); + status = nxd_mqtt_client_create(client_ptr_test, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_2, &pool_1, + stack_ptr_test, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory_test, CLIENT_MEMORY_SIZE); + if(status != NXD_MQTT_INTERNAL_ERROR) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + _tx_event_flags_created_ptr = old_event_flags_create_ptr; +#endif + + /* Create client for following tests. */ + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set client state to connected. */ + client_ptr -> nxd_mqtt_client_state = NXD_MQTT_CLIENT_STATE_CONNECTED; + + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + QoS = 1; + + /* Test invalid mutex ptr on login_set. */ + client_ptr -> nxd_mqtt_client_mutex_ptr -> tx_mutex_id = 0; + status = nxd_mqtt_client_login_set(client_ptr, "test_user", 10, "test_pass", 10); + if(status != NXD_MQTT_MUTEX_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + client_ptr -> nxd_mqtt_client_mutex_ptr->tx_mutex_id = TX_MUTEX_ID; + + /* Test invalid mutex ptr on sub_unsub. */ + client_ptr -> nxd_mqtt_client_mutex_ptr -> tx_mutex_id = 0; + status = nxd_mqtt_client_subscribe(client_ptr, "topic", 6, 0); + if(status != NXD_MQTT_MUTEX_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + client_ptr -> nxd_mqtt_client_mutex_ptr->tx_mutex_id = TX_MUTEX_ID; + + /* Validate sub_unsub packet_allocate behavior. */ + ULONG temp_payload_size = client_ptr -> nxd_mqtt_client_packet_pool_ptr -> nx_packet_pool_payload_size; + client_ptr -> nxd_mqtt_client_packet_pool_ptr -> nx_packet_pool_payload_size = 0; + status = nxd_mqtt_client_subscribe(client_ptr, "topic", 6, 0); + if(status != NXD_MQTT_PACKET_POOL_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + client_ptr -> nxd_mqtt_client_packet_pool_ptr -> nx_packet_pool_payload_size = temp_payload_size; + + /* Validate client_connect tx_mutex_get behavior. */ + client_ptr -> nxd_mqtt_client_mutex_ptr -> tx_mutex_id = 0; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, NX_IP_PERIODIC_RATE); + if(status != NXD_MQTT_MUTEX_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + client_ptr -> nxd_mqtt_client_mutex_ptr->tx_mutex_id = TX_MUTEX_ID; + + /* Validate client_connect client already connected behavior. */ + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, NX_IP_PERIODIC_RATE); + if(status != NXD_MQTT_ALREADY_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + // /* Validate client_connect client connecting behavior. */ + client_ptr -> nxd_mqtt_client_state = NXD_MQTT_CLIENT_STATE_CONNECTING; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, NX_IP_PERIODIC_RATE); + if(status != NXD_MQTT_CONNECTING) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + // /* Validate client_connect client not idle behavior. */ + client_ptr -> nxd_mqtt_client_state = NXD_MQTT_CLIENT_STATE_INITIALIZE; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, NX_IP_PERIODIC_RATE); + if(status != NXD_MQTT_INVALID_STATE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + // /* Set client state to idle for remaining connect tests. */ + client_ptr -> nxd_mqtt_client_state = NXD_MQTT_CLIENT_STATE_IDLE; + + /* Validate socket_connect NX_IN_PROGRESS */ + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, NX_IP_PERIODIC_RATE); + if(status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + // /* Validate socket_connect NOT NX_SUCCESS */ + UINT old_tcp_socket_state = client_ptr -> nxd_mqtt_client_socket . nx_tcp_socket_state; + client_ptr -> nxd_mqtt_client_socket . nx_tcp_socket_state = NX_TCP_SYN_SENT; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, NX_IP_PERIODIC_RATE); + if(status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + // /* Validate wait option == 0 behavior and tcp_client_socket_connect not NX_SUCCUSS && not NX_IN_PROGRESS. */ + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, 0); + if(status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Reset tcp socket state for remaining tests. */ + client_ptr -> nxd_mqtt_client_socket . nx_tcp_socket_state = old_tcp_socket_state; + + /* Validate wait option == 0 NX_IN_PROGRESS behavior. */ +#ifdef NX_SECURE_ENABLE + client_ptr -> nxd_mqtt_client_use_tls = 1; +#endif + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, keepalive_value, + cleansession_value, 0); + if(status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + \ No newline at end of file diff --git a/test/regression/mqtt_test/netx_mqtt_connack_error_test.c b/test/regression/mqtt_test/netx_mqtt_connack_error_test.c new file mode 100644 index 00000000..5e1840cd --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connack_error_test.c @@ -0,0 +1,487 @@ +/* MQTT connect test. This test case validates MQTT client process error CONNACK. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connack_error_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connack Error Test .................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + +#ifndef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_ERROR_NOT_AUTHORIZED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + + if (status != NXD_MQTT_ERROR_NOT_AUTHORIZED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 5; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} \ No newline at end of file diff --git a/test/regression/mqtt_test/netx_mqtt_connect_auth_empty_test.c b/test/regression/mqtt_test/netx_mqtt_connect_auth_empty_test.c new file mode 100644 index 00000000..93fcee40 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_auth_empty_test.c @@ -0,0 +1,655 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static CHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_auth_empty_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 24, 24, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 23, 23, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +UINT keepalive_value; +UINT cleansession_value; +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Authentication Empty Test...................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifndef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_ERROR_NOT_AUTHORIZED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_login_set(client_ptr, "", 0, "", 0); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_disconnect(client_ptr); + + /* Make sure the connection fails but TCP connnection successes. */ + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_COMMUNICATION_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_ERROR_NOT_AUTHORIZED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_login_set(client_ptr, "", 0, "", 0); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_disconnect(client_ptr); + + /* Make sure the connection fails but TCP connnection successes. */ + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_COMMUNICATION_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + tx_semaphore_put(&semaphore_client_stop); + } + + status += nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UCHAR *buf; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xF; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xF); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with error */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 5; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + tx_thread_sleep(1); + } +#endif + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + if ((status != NX_SUCCESS) && (status != NX_CONNECTION_PENDING)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the connect message. */ + + /* Byte 8 flag: username and password should be set. */ + content[9] |= 0xC0; + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xFF; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xFF); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + buf = content + sizeof(fixed_header) + 2 + strlen(CLIENT_ID); + *buf = 0; + *(buf + 1) = 0; + buf = buf + 2; + *buf = 0; + *(buf + 1) = 0; + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID) + 4); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, content[1] + 2)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[3] = 0; + byte[4] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + tx_thread_sleep(1); + + /* Disconnect. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_auth_test.c b/test/regression/mqtt_test/netx_mqtt_connect_auth_test.c new file mode 100644 index 00000000..78ed25bc --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_auth_test.c @@ -0,0 +1,663 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define USERNAME "username" +#define PASSWORD "password" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static CHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_auth_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 24, 24, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 23, 23, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +UINT keepalive_value; +UINT cleansession_value; +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Authentication Test ........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifndef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_ERROR_NOT_AUTHORIZED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_login_set(client_ptr, USERNAME, strlen(USERNAME), PASSWORD, strlen(PASSWORD)); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_disconnect(client_ptr); + + /* Make sure the connection fails but TCP connnection successes. */ + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_COMMUNICATION_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_ERROR_NOT_AUTHORIZED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_login_set(client_ptr, USERNAME, strlen(USERNAME), PASSWORD, strlen(PASSWORD)); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_disconnect(client_ptr); + + /* Make sure the connection fails but TCP connnection successes. */ + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_COMMUNICATION_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + tx_semaphore_put(&semaphore_client_stop); + } + + status += nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UCHAR *buf; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xF; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xF); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with error */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 5; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + tx_thread_sleep(1); + } +#endif + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + if ((status != NX_SUCCESS) && (status != NX_CONNECTION_PENDING)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the connect message. */ + + /* Byte 8 flag: username and password should be set. */ + content[9] |= 0xC0; + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xFF; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xFF); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + buf = content + sizeof(fixed_header) + 2 + strlen(CLIENT_ID); + *buf = (strlen(USERNAME) >> 8) & 0xFF; + *(buf + 1) = (strlen(USERNAME)) & 0xFF; + memcpy(buf + 2, USERNAME, strlen(USERNAME)); + buf = buf + 2 + strlen(USERNAME); + *buf = (strlen(PASSWORD) >> 8) & 0xFF; + *(buf + 1) = (strlen(PASSWORD)) & 0xFF; + memcpy(buf + 2, PASSWORD, strlen(PASSWORD)); + + + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID) + 4 + strlen(USERNAME) + strlen(PASSWORD)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, content[1] + 2)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[3] = 0; + byte[4] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + tx_thread_sleep(1); + + /* Disconnect. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_non_block_2_test.c b/test/regression/mqtt_test/netx_mqtt_connect_non_block_2_test.c new file mode 100644 index 00000000..017f785c --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_non_block_2_test.c @@ -0,0 +1,489 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_EXTENDED_NOTIFY_SUPPORT +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 4 +#else +#define TEST_LOOP 2 +#endif + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG connected = NX_FALSE; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +static void mqtt_connect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr, UINT status, VOID *context); +static void mqtt_disconnect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_non_block_2_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UCHAR content[100]; +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Non Block Test 2............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + client_ptr -> nxd_mqtt_connect_notify = mqtt_connect_notify; + nxd_mqtt_client_disconnect_notify_set(client_ptr, mqtt_disconnect_notify); + + for (i = 0; i < TEST_LOOP; i++) + { + + if (i < 2) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, 0); + +#ifndef NXD_MQTT_REQUIRE_TLS + if (status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, 0); + + if (status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i < 2) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + + if (i % 2 == 0) + { + + /* Response with SUCCESS */ + byte[3] = 0; + } + else + { + + /* Response with ERROR */ + byte[3] = 3; + } + + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i < 2) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + if (i % 2 == 0) + { + + /* Check connected flag. */ + if (connected == NX_FALSE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (connected == NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nxd_mqtt_client_disconnect(client_ptr); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void mqtt_connect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr, UINT status, VOID *context) +{ + + /* Check status. */ + if (status == NXD_MQTT_SUCCESS) + { + connected = NX_TRUE; + } +} + +static void mqtt_disconnect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr) +{ + + /* Check status. */ + connected = NX_FALSE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_non_block_2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Non Block Test 2.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_non_block_test.c b/test/regression/mqtt_test/netx_mqtt_connect_non_block_test.c new file mode 100644 index 00000000..79fc24cc --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_non_block_test.c @@ -0,0 +1,526 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_EXTENDED_NOTIFY_SUPPORT +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG connected = NX_FALSE; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +static void mqtt_connect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr, UINT status, VOID *context); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_non_block_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Non Block Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + client_ptr-> nxd_mqtt_connect_notify = mqtt_connect_notify; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, 0); + +#ifndef NXD_MQTT_REQUIRE_TLS + if (status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, 0); + + if (status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + { + + /* Wait for connecting. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check connected flag. */ + if (connected == NX_FALSE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + } + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + + +static void mqtt_connect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr, UINT status, VOID *context) +{ + + /* Check status. */ + if (status == NXD_MQTT_SUCCESS) + { + connected = NX_TRUE; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_non_block_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Non Block Test...............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_packet_send_failure_test.c b/test/regression/mqtt_test/netx_mqtt_connect_packet_send_failure_test.c new file mode 100644 index 00000000..ef7d1c95 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_packet_send_failure_test.c @@ -0,0 +1,383 @@ +/* MQTT connect packet send test. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 1 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +static UCHAR filler_data[PACKET_SIZE] = { 0 }; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_packet_send_failure_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Packet Send Failure Test ........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + /* Validate invalid length behavior. */ + client_ptr -> nxd_mqtt_client_will_topic = "hacker_topic\r\n"; + client_ptr -> nxd_mqtt_client_will_topic_length = 127 * 127 * 127 * 127; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Post test cleanup... */ + client_ptr -> nxd_mqtt_client_will_topic = ""; + client_ptr -> nxd_mqtt_client_will_topic_length = 0; + } + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +// #ifdef NXD_MQTT_REQUIRE_TLS +// if (i == 1) +// #endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + + tx_thread_sleep(1); + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} \ No newline at end of file diff --git a/test/regression/mqtt_test/netx_mqtt_connect_test.c b/test/regression/mqtt_test/netx_mqtt_connect_test.c new file mode 100644 index 00000000..608284be --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_test.c @@ -0,0 +1,507 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +static UINT disconnect_notify_called = 0; + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static VOID disconnect_notify(NXD_MQTT_CLIENT *client_ptr); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Test ........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + nxd_mqtt_client_disconnect_notify_set(client_ptr, disconnect_notify); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + +#ifndef NXD_MQTT_REQUIRE_TLS + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + /* Verify disconnect callback function. */ + if (disconnect_notify_called == 0) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +static VOID disconnect_notify(NXD_MQTT_CLIENT *client_ptr) +{ + disconnect_notify_called++; +} \ No newline at end of file diff --git a/test/regression/mqtt_test/netx_mqtt_connect_v6_test.c b/test/regression/mqtt_test/netx_mqtt_connect_v6_test.c new file mode 100644 index 00000000..4c2d79a0 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_v6_test.c @@ -0,0 +1,555 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +#define DEMO_STACK_SIZE 2048 + + +#define NUM_PACKETS 30 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; +static UCHAR pool_area[PACKET_POOL_SIZE]; + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define PRIMARY_INTERFACE 0 + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_v6_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + +UINT ip0_primary_linklocal_address_index; +UINT ip0_primary_global_address_index; + + +UINT ip1_primary_linklocal_address_index; +UINT ip1_primary_global_address_index; + + +NXD_ADDRESS ip_address; +//NXD_ADDRESS ip1_primary_global_address; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pool_area, PACKET_POOL_SIZE); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + nxd_ipv6_enable(&ip_0); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable IPv6 */ + nxd_ipv6_enable(&ip_1); + + + /* Set IPv6 address on ip_1. */ + + /* Set ip_0 primary link local address. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, NX_NULL, 10, &ip0_primary_linklocal_address_index); + if (status) + error_counter++; + + /* Set ip_1 primary link local address. */ + status = nxd_ipv6_address_set(&ip_1, PRIMARY_INTERFACE, NX_NULL, 10, &ip1_primary_linklocal_address_index); + if (status) + error_counter++; + + + + /* Set ip_0 primary interface global address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010000; + ip_address.nxd_ip_address.v6[1] = 0; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 4; + + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &ip_address, 64, &ip0_primary_global_address_index); + + if (status) + error_counter++; + + /* Set ip_1 primary interface global address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010000; + ip_address.nxd_ip_address.v6[1] = 0; + ip_address.nxd_ip_address.v6[2] = 0; + ip_address.nxd_ip_address.v6[3] = 5; + + status = nxd_ipv6_address_set(&ip_1, PRIMARY_INTERFACE, &ip_address, 64, &ip1_primary_global_address_index); + + if (status) + error_counter++; + + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect V6 Test ....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait 5 seconds for the IP thread to finish its initilization and + for the IPv6 stack to finish DAD process. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + error_counter++; + tx_thread_sleep(1); + + server_address.nxd_ip_version = 6; + server_address.nxd_ip_address.v6[0] = 0x20010000; + server_address.nxd_ip_address.v6[1] = 0; + server_address.nxd_ip_address.v6[2] = 0; + server_address.nxd_ip_address.v6[3] = 5; + + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifndef NXD_MQTT_REQUIRE_TLS + if (status) + error_counter++; +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + error_counter++; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + + if (status) + error_counter++; + } +#endif + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + /* Accept a connection from client socket. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE * 2); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + error_counter++; + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + error_counter++; + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + error_counter++; + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + error_counter++; + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + error_counter++; + + tx_thread_sleep(1); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_will_message_test.c b/test/regression/mqtt_test/netx_mqtt_connect_will_message_test.c new file mode 100644 index 00000000..8efad1c6 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_will_message_test.c @@ -0,0 +1,525 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_will_message_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +#define WILL_TOPIC "topic" +#define WILL_MESSAGE "message" +static UINT will_QoS = 1; +static UINT will_retain = 1; + +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Will Message Test ..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + /* Set will topic with Will topic with message. */ + status = nxd_mqtt_client_will_message_set(client_ptr, WILL_TOPIC, strlen(WILL_TOPIC), WILL_MESSAGE, + strlen(WILL_MESSAGE), will_retain, will_QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifndef NXD_MQTT_REQUIRE_TLS + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +int index; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xff; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xff); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + index = sizeof(fixed_header) + 2 + strlen(CLIENT_ID); + + /* Append Will Topic and Will Mesage. */ + content[index] = (strlen(WILL_TOPIC) >> 8) & 0xFF; + content[index + 1] = (strlen(WILL_TOPIC)) & 0xFF; + memcpy(content + index + 2, WILL_TOPIC, strlen(WILL_TOPIC)); + + index = index + 2 + strlen(WILL_TOPIC); + + content[index] = (strlen(WILL_MESSAGE) >> 8) & 0xFF; + content[index + 1] = (strlen(WILL_MESSAGE)) & 0xFF; + memcpy(content + index + 2, WILL_MESSAGE, strlen(WILL_MESSAGE)); + index = index + 2 + strlen(WILL_MESSAGE); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID) + strlen(WILL_MESSAGE) + strlen(WILL_TOPIC) + 4); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + if (will_retain) + content[9] = content[9] | (1 << 5); + + /* Set the QoS value. */ + content[9] = content[9] | (will_QoS << 3); + + /* Set the will flag. */ + content[9] = content[9] | (1 << 2); + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, index)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_will_topic_only_test.c b/test/regression/mqtt_test/netx_mqtt_connect_will_topic_only_test.c new file mode 100644 index 00000000..0aa84b31 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_will_topic_only_test.c @@ -0,0 +1,527 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_will_topic_only_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +#define WILL_TOPIC "topic" +#define WILL_MESSAGE "message" +static UINT will_QoS = 1; +static UINT will_retain = 1; + +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Will Topic Only Test ........................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + /* Test again with no will message, no Will RETAIN flag, and QoS set to 0 */ + will_retain = 0; + will_QoS = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + /* Set will topic with Will topic with message. */ + status = nxd_mqtt_client_will_message_set(client_ptr, WILL_TOPIC, strlen(WILL_TOPIC), NX_NULL, + 0, will_retain, will_QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifndef NXD_MQTT_REQUIRE_TLS + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +int index; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xff; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xff); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + index = sizeof(fixed_header) + 2 + strlen(CLIENT_ID); + + /* Append Will Topic and Will Mesage. */ + content[index] = (strlen(WILL_TOPIC) >> 8) & 0xFF; + content[index + 1] = (strlen(WILL_TOPIC)) & 0xFF; + memcpy(content + index + 2, WILL_TOPIC, strlen(WILL_TOPIC)); + + index = index + 2 + strlen(WILL_TOPIC); + content[index++] = 0; + content[index++] = 0; + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID) + strlen(WILL_TOPIC) + 2 + 2); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + if (will_retain) + content[9] = content[9] | (1 << 5); + + /* Set the QoS value. */ + content[9] = content[9] | (will_QoS << 3); + + /* Set the will flag. */ + content[9] = content[9] | (1 << 2); + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, index)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_connect_with_auth_will_test.c b/test/regression/mqtt_test/netx_mqtt_connect_with_auth_will_test.c new file mode 100644 index 00000000..1c8737b6 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_connect_with_auth_will_test.c @@ -0,0 +1,553 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define USERNAME "username" +#define PASSWORD "password" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define WILL_TOPIC "topic" +#define WILL_MESSAGE "message" +static UINT will_QoS = 1; +static UINT will_retain = 1; + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static CHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_connect_auth_will_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 24, 24, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 23, 23, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +UINT keepalive_value; +UINT cleansession_value; +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Connect Authentication And Will Test................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_mqtt_client_login_set(client_ptr, USERNAME, strlen(USERNAME), PASSWORD, strlen(PASSWORD)); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set will topic with Will topic with message. */ + status = nxd_mqtt_client_will_message_set(client_ptr, WILL_TOPIC, strlen(WILL_TOPIC), WILL_MESSAGE, + strlen(WILL_MESSAGE), will_retain, will_QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifndef NXD_MQTT_REQUIRE_TLS + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UCHAR *buf; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xF; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xF); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Byte 8 flag: username and password should be set. */ + content[9] |= 0xC0; + + if (will_retain) + content[9] = content[9] | (1 << 5); + + /* Set the QoS value. */ + content[9] = content[9] | (will_QoS << 3); + + /* Set the will flag. */ + content[9] = content[9] | (1 << 2); + + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xFF; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xFF); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + buf = content + sizeof(fixed_header) + 2 + strlen(CLIENT_ID); + *buf = (strlen(WILL_TOPIC) >> 8) & 0xFF; + *(buf + 1) = (strlen(WILL_TOPIC)) & 0xFF; + memcpy(buf + 2, WILL_TOPIC, strlen(WILL_TOPIC)); + + buf += (2 + strlen(WILL_TOPIC)); + *buf = (strlen(WILL_MESSAGE) >> 8) & 0xFF; + *(buf + 1) = (strlen(WILL_MESSAGE)) & 0xFF; + memcpy(buf + 2, WILL_MESSAGE, strlen(WILL_MESSAGE)); + + buf += (2 + strlen(WILL_MESSAGE)); + + *buf = (strlen(USERNAME) >> 8) & 0xFF; + *(buf + 1) = (strlen(USERNAME)) & 0xFF; + memcpy(buf + 2, USERNAME, strlen(USERNAME)); + buf = buf + 2 + strlen(USERNAME); + *buf = (strlen(PASSWORD) >> 8) & 0xFF; + *(buf + 1) = (strlen(PASSWORD)) & 0xFF; + memcpy(buf + 2, PASSWORD, strlen(PASSWORD)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID) + 4 + strlen(USERNAME) + strlen(PASSWORD)); + /* Add will topic and will message. */ + content[1] += strlen(WILL_MESSAGE) + strlen(WILL_TOPIC) + 4; + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, content[1] + 2)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with success */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[3] = 0; + byte[4] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_keepalive_test.c b/test/regression/mqtt_test/netx_mqtt_keepalive_test.c new file mode 100644 index 00000000..5b30cc20 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_keepalive_test.c @@ -0,0 +1,656 @@ +/* MQTT connect test. This test case validates MQTT client keepalive feature. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_keepalive_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT connection_flag_value; +static UINT QoS; +static UINT retain; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Keepalive Test ......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 1; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + QoS = 1; + retain = 0; + + if (i == 0) + { + /* Sleep for 60 ticks */ + tx_thread_sleep(60); + } + + /* Issue a subscribe command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE1, strlen(MESSAGE1), retain, QoS, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Sleep for 150 ticks, expect MQTT PINGREQ */ + tx_thread_sleep(150); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT publish_time; +UINT ping_time; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 100); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + publish_time = tx_time_get(); + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE1, strlen(MESSAGE1)); + byte += strlen(MESSAGE1); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + } + } + + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 100); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + ping_time = tx_time_get(); + if ((packet_ptr->nx_packet_prepend_ptr[0] == 0xc0) && (packet_ptr->nx_packet_prepend_ptr[1] == 0)) + { + /* This is the ping message. */ + if ((ping_time - publish_time) > (keepalive_value * TX_TIMER_TICKS_PER_SECOND)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_prepend_ptr[1] = 0x00; + packet_ptr->nx_packet_length = 2; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 2; + } +#endif + packet_ptr->nx_packet_prepend_ptr[0] = 0xD0; + + /* Validate that ping was sent. */ + if (client_ptr->nxd_mqtt_ping_not_responded != NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* response with pingresp. */ + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + } + + tx_thread_sleep(1); + + if (client_ptr->nxd_mqtt_ping_not_responded == NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_keepalive_timeout_test.c b/test/regression/mqtt_test/netx_mqtt_keepalive_timeout_test.c new file mode 100644 index 00000000..e4c5ec59 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_keepalive_timeout_test.c @@ -0,0 +1,641 @@ +/* MQTT connect test. This test case validates MQTT client keepalive feature. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +static int client_disconnected = 0; + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_keepalive_timeout_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT connection_flag_value; +static UINT QoS; +static UINT retain; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Keepalive Timeout Test .............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + for (i = 0; i < TEST_LOOP; i++) + { + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 1; + cleansession_value = 0; + client_disconnected = 0; + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + QoS = 1; + retain = 0; + + if (i == 0) + { + /* Sleep for 60 ticks */ + tx_thread_sleep(60); + } + + /* Issue a subscribe command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE1, strlen(MESSAGE1), retain, QoS, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Sleep for 150 ticks, expect MQTT PINGREQ */ + tx_thread_sleep(150); + + if (client_disconnected == 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + + +static void ntest_1_disconnect_callback(NX_TCP_SOCKET *server_socket_ptr) +{ + + client_disconnected = 1; + + +} +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT publish_time; +UINT ping_time; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, ntest_1_disconnect_callback); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 100); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + publish_time = tx_time_get(); + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + } + /* Fill in the message being pulished. */ + + memcpy(byte, MESSAGE1, strlen(MESSAGE1)); + byte += strlen(MESSAGE1); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + } + } + + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 100); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + ping_time = tx_time_get(); + if ((packet_ptr->nx_packet_prepend_ptr[0] == 0xc0) && (packet_ptr->nx_packet_prepend_ptr[1] == 0)) + { + /* This is the ping message. */ + if ((ping_time - publish_time) > (keepalive_value * TX_TIMER_TICKS_PER_SECOND)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Validate that ping was sent. */ + if (client_ptr->nxd_mqtt_ping_not_responded != NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* In this test the server does not send a pingresp. This should force the client to + timeout and closes the connection. */ + + + if (client_ptr->nxd_mqtt_ping_not_responded == NX_FALSE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(50); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_multiple_receive_test.c b/test/regression/mqtt_test/netx_mqtt_multiple_receive_test.c new file mode 100644 index 00000000..7ad46fdb --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_multiple_receive_test.c @@ -0,0 +1,751 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC "topic" +#define MESSAGE_QOS0 "MESSAGE_QOS0" +#define MESSAGE_QOS1 "MESSAGE_QOS11" +#define MESSAGE_QOS2 "MESSAGE_QOS222" + +static UINT packet_identifier = 0xbeef; + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +//NXD_MQTT_CLIENT my_client; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_multiple_receive_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + //client_ptr = &my_client; + +} + + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +static UINT keepalive_value; +static UINT cleansession_value; +#define DEMO_TIMER_EVENT 1 +#define DEMO_MESSAGE_EVENT 2 +#define DEMO_ALL_EVENTS 3 + +TX_EVENT_FLAGS_GROUP mqtt_app_flag; + +static VOID my_notify_func(NXD_MQTT_CLIENT* client_ptr, UINT number_of_messages) +{ + + tx_event_flags_set(&mqtt_app_flag, DEMO_MESSAGE_EVENT, TX_OR); + return; + +} + +static UCHAR topic[100], message[100]; +#define MQTT_CLIENT_THREAD_PRIORITY 2 +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +ULONG events; +UINT topic_length, message_length; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Multiple Receive Test................................"); + + status = tx_event_flags_create(&mqtt_app_flag, "my app event"); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + status = nxd_mqtt_client_receive_notify_set(client_ptr, my_notify_func); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (topic_length != strlen(TOPIC) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS0)) || + strncmp(message, MESSAGE_QOS0, message_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (topic_length != strlen(TOPIC) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS1)) || + strncmp(message, MESSAGE_QOS1, message_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#if 0 + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((topic_length != strlen(TOPIC)) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS2)) || + strncmp(message, MESSAGE_QOS2, message_length)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + /* Check for error. */ + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT index = 0; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(50); + + /* Send a publish message with QoS 0 */ + if (i == 0) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x30; + + index = 2; + byte[index++] = ((strlen(TOPIC)) >> 8) & 0xFF; + byte[index++] = (strlen(TOPIC)) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + + index += strlen(TOPIC); + + memcpy(byte + index, MESSAGE_QOS0, strlen(MESSAGE_QOS0)); + index += strlen(MESSAGE_QOS0); + + byte[1] = index - 2; + packet_ptr->nx_packet_length = index; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + index; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(5); + /* We dont expect anything back for QoS 0. */ + + /* Send a publish message with QoS 1 */ + if (i == 0) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x32; + + index = 2; + byte[index++] = (strlen(TOPIC) >> 8) & 0xFF; + byte[index++] = strlen(TOPIC) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + + index += strlen(TOPIC); + byte[index++] = packet_identifier >> 8; + byte[index++] = packet_identifier & 0xFF; + + memcpy(byte + index, MESSAGE_QOS1, strlen(MESSAGE_QOS1)); + index += strlen(MESSAGE_QOS1); + + byte[1] = index - 2; + packet_ptr->nx_packet_length = index; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + index; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBBACK */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 50); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBBACK */ + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + if (packet_ptr->nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((byte[0] != 0x40) || (byte[1] != 2) || (byte[2] != (packet_identifier >> 8)) || (byte[3] != (packet_identifier & 0xFF))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* All deon, release the packet. */ + status = nx_packet_release(packet_ptr); + + /* Increment the packet id */ + packet_identifier++; + +#if 0 + /* Send a publish message with QoS 2 */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x34; + + index = 2; + byte[index++] = (strlen(TOPIC) >> 8) & 0xFF; + byte[index++] = strlen(TOPIC) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + + index += strlen(TOPIC); + byte[index++] = packet_identifier >> 8; + byte[index++] = packet_identifier & 0xFF; + + memcpy(byte + index, MESSAGE_QOS2, strlen(MESSAGE_QOS2)); + index += strlen(MESSAGE_QOS2); + + byte[1] = index - 2; + packet_ptr->nx_packet_length = index; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + index; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBBACK */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + if (packet_ptr->nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((byte[0] != 0x50) || (byte[1] != 2) || (byte[2] != (packet_identifier >> 8)) || (byte[3] != (packet_identifier & 0xFF))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Respond with PUBREL */ + byte[0] = 0x60; + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBCOMP */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + if (packet_ptr->nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((byte[0] != 0x70) || (byte[1] != 2) || (byte[2] != (packet_identifier >> 8)) || (byte[3] != (packet_identifier & 0xFF))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* All deon, release the packet. */ + status = nx_packet_release(packet_ptr); + +#endif + + tx_thread_sleep(10); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_not_connected_test.c b/test/regression/mqtt_test/netx_mqtt_not_connected_test.c new file mode 100644 index 00000000..2d6454a6 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_not_connected_test.c @@ -0,0 +1,160 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_not_connected_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +#define TOPIC "topic" +#define MESSAGE "message" +static UINT keepalive_value; +static UINT cleansession_value; +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Not Connect Test ...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + status = nxd_mqtt_client_publish(client_ptr, TOPIC, strlen(TOPIC), MESSAGE, strlen(MESSAGE), 0, 0, 1); + if(status != NXD_MQTT_NOT_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC, strlen(TOPIC), 0); + if(status != NXD_MQTT_NOT_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + status = nxd_mqtt_client_unsubscribe(client_ptr, TOPIC, strlen(TOPIC)); + if(status != NXD_MQTT_NOT_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + diff --git a/test/regression/mqtt_test/netx_mqtt_null_password_test.c b/test/regression/mqtt_test/netx_mqtt_null_password_test.c new file mode 100644 index 00000000..de4a0b92 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_null_password_test.c @@ -0,0 +1,147 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_null_password_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + + tx_thread_resume(&ntest_0); + +} + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; + + /* Print out test information banner. */ + printf("NetX Test: MQTT NULL Password Test .................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nxd_mqtt_client_login_set(client_ptr, "username", 8, NX_NULL, 0); + if (status != NX_SUCCESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + diff --git a/test/regression/mqtt_test/netx_mqtt_packet_leak_test.c b/test/regression/mqtt_test/netx_mqtt_packet_leak_test.c new file mode 100644 index 00000000..e0ad23aa --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_packet_leak_test.c @@ -0,0 +1,554 @@ +/* This test case tests the packet leak issue when MQTT client received invalid packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_packet_leak_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Packet Leak Test ...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + QoS = 1; + + /* Issue a subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC1, strlen(TOPIC1), QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Check packet leak. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the subscribe message. */ + byte = content; + *byte++ = 0x82; /* Subscribe */ + byte++; /* Skip the length field. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + /* Fill in the QoS byte. */ + byte += strlen(TOPIC1); + *byte++ = QoS & 0x3; + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT subscribe request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + /* Set length to an invalid value. */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x90; + byte[1] = 0x04; + byte[2] = content[2]; + byte[3] = content[3]; + byte[4] = QoS & 0x3; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 5; + packet_ptr->nx_packet_length = 5; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(5); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_publish_non_zero_packet_id_test.c b/test/regression/mqtt_test/netx_mqtt_publish_non_zero_packet_id_test.c new file mode 100644 index 00000000..d6193788 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_publish_non_zero_packet_id_test.c @@ -0,0 +1,815 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" +#define MESSAGE2 "message2" +#define MESSAGE3 "message3" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_publish_non_zero_packet_id_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT connection_flag_value; +static UINT QoS; +static UINT retain; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Publish Non-Zero Packet ID Test ....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + memset(client_ptr, 0, sizeof(NXD_MQTT_CLIENT)); + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + QoS = 1; + retain = 0; + /* Issue a publish command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE1, strlen(MESSAGE1), retain, QoS, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set packet id 0xFFFF */ + client_ptr->nxd_mqtt_client_packet_identifier = 0xffff; + + /* Issue a publish command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE2, strlen(MESSAGE2), retain, QoS, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Issue a publish command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE3, strlen(MESSAGE3), retain, QoS, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +//static UCHAR fixed_header[] = {0x80, 0x00, /* MQTT Control Packet Type, remaining length */ +// 0x00, 0x00}; /* Packet identifier, MSB, and LSB */ + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /*************************** 1st PUBLISH Message ****************************/ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + + if (packet_id == 0) + { + printf("1st pubilsh: packet_id is zero.\n"); + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE1, strlen(MESSAGE1)); + byte += strlen(MESSAGE1); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + + /*************************** 2nd PUBLISH Message ****************************/ + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + + if (packet_id != 0xFFFF) + { + printf("2nd pubilsh: packet_id is not 0xFFFF.\n"); + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE2, strlen(MESSAGE2)); + byte += strlen(MESSAGE2); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + + /*************************** 3rd PUBLISH Message ****************************/ + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + + if (packet_id == 0) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE3, strlen(MESSAGE3)); + byte += strlen(MESSAGE3); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /*************************** End of Test ************************************/ + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_publish_packet_chain_test.c b/test/regression/mqtt_test/netx_mqtt_publish_packet_chain_test.c new file mode 100644 index 00000000..0b11c9f4 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_publish_packet_chain_test.c @@ -0,0 +1,431 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); + +#if !defined(NXD_MQTT_REQUIRE_TLS) + +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC_LEN 256 +#define MESSAGE_LEN 256 +#define CLIENT_MEMORY_SIZE 1024 +#define PACKET_BUFFER_SIZE 1024 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 32 +#define PACKET_SIZE 128 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +static TX_SEMAPHORE semaphore_server_received; +static TX_SEMAPHORE semaphore_client_sent; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +static UCHAR *packet_buffer; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_publish_packet_chain_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_received, "semaphore server received", 0); + tx_semaphore_create(&semaphore_client_sent, "semaphore client sent", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + packet_buffer = pointer; + pointer += PACKET_BUFFER_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +static UINT retain; +static UCHAR *topic; +static UCHAR *message; + +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; +NX_PACKET *temp_packets[NUM_PACKETS]; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Publish Packet Chain Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + error_counter++; + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + topic = packet_buffer; + message = packet_buffer + TOPIC_LEN; + + for (i = 0; i < TOPIC_LEN; i++) + { + topic[i] = i & 0xff; + message[i] = 0xff - (i & 0xff); + } + + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + QoS = 1; + retain = 0; + + for (i = 0 ; i < NUM_PACKETS - 2; i++) + { + status = nx_packet_allocate(&pool_0, &(temp_packets[i]), NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + break; + } + } + + /* Fail to append topic. */ + status = nxd_mqtt_client_publish(client_ptr, topic, TOPIC_LEN, message, MESSAGE_LEN, retain, QoS, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_INTERNAL_ERROR) + error_counter++; + + /* Fail to append QOS. */ + status = nxd_mqtt_client_publish(client_ptr, topic, 195, message, MESSAGE_LEN, retain, QoS, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_INTERNAL_ERROR) + error_counter++; + + /* Fail to append message. */ + status = nxd_mqtt_client_publish(client_ptr, topic, 66, message, MESSAGE_LEN, retain, QoS, NX_IP_PERIODIC_RATE); + if (status != NXD_MQTT_INTERNAL_ERROR) + error_counter++; + + for (i = 0 ; i < NUM_PACKETS - 2; i++) + { + nx_packet_release(temp_packets[i]); + } + + /* Issue a subscribe command. */ + status = nxd_mqtt_client_publish(client_ptr, topic, TOPIC_LEN, message, MESSAGE_LEN, retain, QoS, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_semaphore_put(&semaphore_client_sent); + + tx_semaphore_get(&semaphore_server_received, NX_WAIT_FOREVER); + + nxd_mqtt_client_disconnect(client_ptr); + + nxd_mqtt_client_delete(client_ptr); + + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT len, packet_len; +UCHAR control_header; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_sleep(1); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } + else + { + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + packet_ptr = NX_NULL; + packet_len = 0; + + tx_semaphore_get(&semaphore_client_sent, NX_WAIT_FOREVER); + + while (1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + if (status) + break; + + nx_packet_data_retrieve(packet_ptr, packet_buffer + packet_len, (ULONG *)&len); + packet_len += len; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&semaphore_server_received); + + /* Check the publish message. */ + + control_header = 0x30 | (packet_buffer[0] & 0x0F); /* Publish */ + len = 1 + 2 + 2 + TOPIC_LEN; /* Control header 1 + remaining length 2 + topic length 2 + topic */ + + for (i = 0 ; i < TOPIC_LEN; i++) + { + if (packet_buffer[5 + i] != (i & 0xff)) + { + error_counter++; + break; + } + } + + if (((control_header & 6) >> 1) != 0) + { + packet_id = packet_buffer[len];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_buffer[len + 1];/* Fill in packet ID MSB. */ + len += 2; + } + + /* Check the message being pulished. */ + for (i = 0 ; i < MESSAGE_LEN; i++) + { + if (packet_buffer[len + i] != (0xff - (i & 0xff))) + { + error_counter++; + break; + } + } + + len += MESSAGE_LEN; + + /* Fill in the QoS and Retain information. */ + control_header = control_header & 0xF8; + control_header = control_header | (QoS << 1); + if (retain) + control_header = control_header | 1; + + /* Now validate message length */ + if (packet_len != len) + error_counter++; + + /* Validate the MQTT publish request. */ + if (packet_buffer[0] != control_header) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_publish_packet_chain_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Publish Packet Chain Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/mqtt_test/netx_mqtt_publish_qos0_test.c b/test/regression/mqtt_test/netx_mqtt_publish_qos0_test.c new file mode 100644 index 00000000..b9065e2f --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_publish_qos0_test.c @@ -0,0 +1,582 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_publish_QoS0_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT connection_flag_value; +static UINT QoS; +static UINT retain; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Publish QoS 0 Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + error_counter++; + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + error_counter++; + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + error_counter++; + + QoS = 0; + retain = 0; + + /* Issue a publish command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE1, strlen(MESSAGE1), retain, QoS, 1); + if (status) + error_counter++; + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +//static UCHAR fixed_header[] = {0x80, 0x00, /* MQTT Control Packet Type, remaining length */ +// 0x00, 0x00}; /* Packet identifier, MSB, and LSB */ + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + error_counter++; + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + error_counter++; + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + error_counter++; + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + error_counter++; + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + error_counter++; + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE1, strlen(MESSAGE1)); + byte += strlen(MESSAGE1); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + error_counter++; + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + error_counter++; + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + error_counter++; + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + error_counter++; + } + + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + diff --git a/test/regression/mqtt_test/netx_mqtt_publish_qos1_test.c b/test/regression/mqtt_test/netx_mqtt_publish_qos1_test.c new file mode 100644 index 00000000..4d160c5e --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_publish_qos1_test.c @@ -0,0 +1,580 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_publish_QoS1_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT connection_flag_value; +static UINT QoS; +static UINT retain; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Publish QoS 1 Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + error_counter++; + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + error_counter++; + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + if (status) + error_counter++; + + QoS = 1; + retain = 0; + /* Issue a subscribe command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE1, strlen(MESSAGE1), retain, QoS, 1); + if (status) + error_counter++; + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +//static UCHAR fixed_header[] = {0x80, 0x00, /* MQTT Control Packet Type, remaining length */ +// 0x00, 0x00}; /* Packet identifier, MSB, and LSB */ + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + error_counter++; + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + error_counter++; + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + error_counter++; + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + error_counter++; + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + error_counter++; + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr->nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if (((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr->nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr->nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ = ((packet_id >> 8) & 0xFF); + *byte++ = (packet_id & 0xFF); + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE1, strlen(MESSAGE1)); + byte += strlen(MESSAGE1); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if (retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + error_counter++; + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + error_counter++; + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + error_counter++; + } +#endif + + if (((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + } + if (((content[0] & 0x6) >> 1) != 0) + { + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + error_counter++; + } + + + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + diff --git a/test/regression/mqtt_test/netx_mqtt_publish_qos2_test.c b/test/regression/mqtt_test/netx_mqtt_publish_qos2_test.c new file mode 100644 index 00000000..5211d539 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_publish_qos2_test.c @@ -0,0 +1,363 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_publish_QoS2_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +static UINT retain; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Publish QoS 2 Test .................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + error_counter++; + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, 5); +#ifndef NXD_MQTT_REQUIRE_TLS + if(status) + error_counter++; + + QoS = 2; + retain = 0; + /* Issue a subscribe command. */ + status = nxd_mqtt_client_publish(client_ptr, TOPIC1, strlen(TOPIC1), MESSAGE1, strlen(MESSAGE1), retain, QoS, 2); + if(status) + error_counter++; + + tx_thread_sleep(10); +#else + if(status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + nxd_mqtt_client_disconnect(client_ptr); + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(1); + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Response with Connect SUCCESS */ + byte = packet_ptr -> nx_packet_prepend_ptr ; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 4; + packet_ptr -> nx_packet_length = 4; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if(status) + error_counter++; + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + if(status) + error_counter++; + + /* construct the publish message. */ + byte = content; + *byte++ = 0x30 | ((*(packet_ptr -> nx_packet_prepend_ptr) & 0x0F)); /* Publish */ + byte++; /* Skip the length field. */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + if(((content[0] & 6) >> 1) != 0) + { + packet_id = packet_ptr -> nx_packet_prepend_ptr[byte - content];/* Fill in packet ID MSB. */ + packet_id = (packet_id << 8) | packet_ptr -> nx_packet_prepend_ptr[byte - content + 1];/* Fill in packet ID MSB. */ + *byte++ += ((packet_id >> 8) & 0xFF ); + *byte++ += (packet_id & 0xFF); + } + /* Fill in the message being pulished. */ + memcpy(byte, MESSAGE1, strlen(MESSAGE1)); + byte += strlen(MESSAGE1); + + /* Fill in the QoS and Retain information. */ + content[0] = content[0] & 0xF8; + content[0] = content[0] | (QoS << 1); + if(retain) + content[0] = content[0] | 1; + + + /* Now validate message length */ + if(packet_ptr -> nx_packet_length != (byte - content)) + error_counter++; + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr -> nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT pubish request. */ + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, content, packet_ptr -> nx_packet_length)) + error_counter++; + + if(((content[0] & 0x6) >> 1) == 1) + { + /* QoS 1: Respond with PUBACK */ + byte = packet_ptr -> nx_packet_prepend_ptr ; + byte[0] = 0x40; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 4; + packet_ptr -> nx_packet_length = 4; + } + if(((content[0] & 0x6) >> 1) == 2) + { + byte = packet_ptr -> nx_packet_prepend_ptr ; + byte[0] = 0x50; + byte[1] = 0x02; + byte[2] = (packet_id >> 8) & 0xFF; + byte[3] = packet_id & 0xFF; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 4; + packet_ptr -> nx_packet_length = 4; + } + if(((content[0] & 0x6) >> 1) != 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if(status) + error_counter++; + } + + /* Now expect PUBREL */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 10); + if(status) + error_counter++; + + byte = packet_ptr -> nx_packet_prepend_ptr; + if((byte[0] != 0x60) || (byte[1] != 2) || (byte[2] != ((packet_id >> 8) & 0xFF)) || (byte[3] != (packet_id & 0xFF))) + error_counter++; + + /* Response with PUBCOMP*/ + byte[0] = 0x70; + + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + error_counter++; + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + diff --git a/test/regression/mqtt_test/netx_mqtt_receive_qos0_test.c b/test/regression/mqtt_test/netx_mqtt_receive_qos0_test.c new file mode 100644 index 00000000..8d042fec --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_receive_qos0_test.c @@ -0,0 +1,587 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC "topic" +#define MESSAGE_QOS0 "MESSAGE_QOS0" +#define MESSAGE_QOS1 "MESSAGE_QOS11" +#define MESSAGE_QOS2 "MESSAGE_QOS222" + +static UINT packet_identifier = 0xbeef; +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +//NXD_MQTT_CLIENT my_client; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_receive_QoS0_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + //client_ptr = &my_client; + +} + + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +static UINT keepalive_value; +static UINT cleansession_value; +#define DEMO_TIMER_EVENT 1 +#define DEMO_MESSAGE_EVENT 2 +#define DEMO_ALL_EVENTS 3 + +TX_EVENT_FLAGS_GROUP mqtt_app_flag; + +static VOID my_notify_func(NXD_MQTT_CLIENT* client_ptr, UINT number_of_messages) +{ + + tx_event_flags_set(&mqtt_app_flag, DEMO_MESSAGE_EVENT, TX_OR); + return; + +} + +static UCHAR topic[100], message[100]; + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +ULONG events; +UINT topic_length, message_length; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Receive QoS 0 Test .................................."); + + status = tx_event_flags_create(&mqtt_app_flag, "my app event"); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + status = nxd_mqtt_client_receive_notify_set(client_ptr, my_notify_func); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (topic_length != strlen(TOPIC) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS0)) || + strncmp(message, MESSAGE_QOS0, message_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + /* Check for error. */ + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT index = 0; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(50); + + /* Send a publish message with QoS 0 */ + if (i == 0) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x30; + + index = 2; + byte[index++] = ((strlen(TOPIC)) >> 8) & 0xFF; + byte[index++] = (strlen(TOPIC)) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + + index += strlen(TOPIC); + + memcpy(byte + index, MESSAGE_QOS0, strlen(MESSAGE_QOS0)); + index += strlen(MESSAGE_QOS0); + + byte[1] = index - 2; + packet_ptr->nx_packet_length = index; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + index; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(5); + /* We dont expect anything back for QoS 0. */ + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_receive_qos1_test.c b/test/regression/mqtt_test/netx_mqtt_receive_qos1_test.c new file mode 100644 index 00000000..97bb7d99 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_receive_qos1_test.c @@ -0,0 +1,606 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC "topic" +#define MESSAGE_QOS0 "MESSAGE_QOS0" +#define MESSAGE_QOS1 "MESSAGE_QOS11" +#define MESSAGE_QOS2 "MESSAGE_QOS222" + +static UINT packet_identifier = 0xbeef; + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +//NXD_MQTT_CLIENT my_client; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_receive_QoS1_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + //client_ptr = &my_client; + +} + + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +static UINT keepalive_value; +static UINT cleansession_value; +#define DEMO_TIMER_EVENT 1 +#define DEMO_MESSAGE_EVENT 2 +#define DEMO_ALL_EVENTS 3 + +TX_EVENT_FLAGS_GROUP mqtt_app_flag; + +static VOID my_notify_func(NXD_MQTT_CLIENT* client_ptr, UINT number_of_messages) +{ + + tx_event_flags_set(&mqtt_app_flag, DEMO_MESSAGE_EVENT, TX_OR); + return; + +} + +UCHAR mqtt_memory[8192]; +static UCHAR topic[100], message[100]; + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +ULONG events; +UINT topic_length, message_length; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Receive QoS 1 Test .................................."); + + status = tx_event_flags_create(&mqtt_app_flag, "my app event"); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + status = nxd_mqtt_client_receive_notify_set(client_ptr, my_notify_func); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (topic_length != strlen(TOPIC) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS1)) || + strncmp(message, MESSAGE_QOS1, message_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + /* Check for error. */ + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +UCHAR *byte; +NX_PACKET *packet_ptr; +UINT index = 0; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(50); + + /* Send a publish message with QoS 1 */ + if (i == 0) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x32; + + index = 2; + byte[index++] = (strlen(TOPIC) >> 8) & 0xFF; + byte[index++] = strlen(TOPIC) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + + index += strlen(TOPIC); + byte[index++] = packet_identifier >> 8; + byte[index++] = packet_identifier & 0xFF; + + memcpy(byte + index, MESSAGE_QOS1, strlen(MESSAGE_QOS1)); + index += strlen(MESSAGE_QOS1); + + byte[1] = index - 2; + packet_ptr->nx_packet_length = index; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + index; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBBACK */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 50); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBBACK */ + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr->nx_packet_prepend_ptr; + if (packet_ptr->nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((byte[0] != 0x40) || (byte[1] != 2) || (byte[2] != (packet_identifier >> 8)) || (byte[3] != (packet_identifier & 0xFF))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* All deon, release the packet. */ + status = nx_packet_release(packet_ptr); + + tx_thread_sleep(5); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_receive_qos2_test.c b/test/regression/mqtt_test/netx_mqtt_receive_qos2_test.c new file mode 100644 index 00000000..8293a5a5 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_receive_qos2_test.c @@ -0,0 +1,410 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC "topic" +#define MESSAGE_QOS0 "MESSAGE_QOS0" +#define MESSAGE_QOS1 "MESSAGE_QOS11" +#define MESSAGE_QOS2 "MESSAGE_QOS222" + +static UINT packet_identifier = 0xbeef; + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef CTEST +static +#else /* CTEST */ +extern +#endif /* CTEST */ +UCHAR mqtt_memory[8192]; +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +//NXD_MQTT_CLIENT my_client; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_receive_QoS2_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + //client_ptr = &my_client; + +} + + + +static UINT keepalive_value; +static UINT cleansession_value; +#define DEMO_TIMER_EVENT 1 +#define DEMO_MESSAGE_EVENT 2 +#define DEMO_ALL_EVENTS 3 + +TX_EVENT_FLAGS_GROUP mqtt_app_flag; + +static VOID my_notify_func(NXD_MQTT_CLIENT* client_ptr, UINT number_of_messages) +{ + + tx_event_flags_set(&mqtt_app_flag, DEMO_MESSAGE_EVENT, TX_OR); + return; + +} + +static UCHAR topic[100], message[100]; + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +ULONG events; +UINT topic_length, message_length; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Receive QoS 2 Test .................................."); + + status = tx_event_flags_create(&mqtt_app_flag, "my app event"); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + status = nxd_mqtt_client_receive_notify_set(client_ptr, my_notify_func); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, 5); +#ifndef NXD_MQTT_REQUIRE_TLS + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + if ((topic_length != strlen(TOPIC)) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS2)) || + strncmp(message, MESSAGE_QOS2, message_length)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + nx_packet_release(packet_ptr); + + tx_thread_sleep(3); +#else + if(status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + + nxd_mqtt_client_disconnect(client_ptr); + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + /* Check for error. */ + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT index = 0; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_resume(&ntest_0); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if(cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Response with SUCCESS */ + byte = packet_ptr -> nx_packet_prepend_ptr ; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 4; + packet_ptr -> nx_packet_length = 4; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(50); + + /* Send a publish message with QoS 2 */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr -> nx_packet_prepend_ptr; + byte[0] = 0x34; + + index = 2; + byte[index++] = (strlen(TOPIC) >> 8)&0xFF; + byte[index++] = strlen(TOPIC) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + + index += strlen(TOPIC); + byte[index++] = packet_identifier >> 8; + byte[index++] = packet_identifier & 0xFF; + + byte[index++] = ((strlen(MESSAGE_QOS2)) >> 8) & 0xFF; + byte[index++] = (strlen(MESSAGE_QOS2)) & 0xFF; + + memcpy(byte + index, MESSAGE_QOS2, strlen(MESSAGE_QOS2)); + index += strlen(MESSAGE_QOS2); + + byte[1] = index - 2; + packet_ptr -> nx_packet_length = index; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + index; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBBACK */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr -> nx_packet_prepend_ptr; + if(packet_ptr -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if((byte[0] != 0x50) || (byte[1] != 2) || (byte[2] != (packet_identifier >> 8)) || (byte[3] != (packet_identifier & 0xFF))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Respond with PUBREL */ + byte[0] = 0x60; + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect PUBCOMP */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + byte = packet_ptr -> nx_packet_prepend_ptr; + if(packet_ptr -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if((byte[0] != 0x70) || (byte[1] != 2) || (byte[2] != (packet_identifier >> 8)) || (byte[3] != (packet_identifier & 0xFF))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* All deon, release the packet. */ + status = nx_packet_release(packet_ptr); + + + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_receive_span_test.c b/test/regression/mqtt_test/netx_mqtt_receive_span_test.c new file mode 100644 index 00000000..6632ac75 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_receive_span_test.c @@ -0,0 +1,619 @@ +/* MQTT receive test. This test case validates MQTT message span multple packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC "topic" +#define MESSAGE_QOS0 "MESSAGE_QOS0" +#define MESSAGE_QOS1 "MESSAGE_QOS11" +#define MESSAGE_QOS2 "MESSAGE_QOS222" + +static UINT packet_identifier = 0xbeef; +UCHAR mqtt_memory[8192]; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void publish_mqtt_message(UINT i, UCHAR *data, UINT size); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +//NXD_MQTT_CLIENT my_client; +static UCHAR *stack_ptr; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_receive_span_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + //client_ptr = &my_client; + +} + + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +static UINT keepalive_value; +static UINT cleansession_value; +#define DEMO_TIMER_EVENT 1 +#define DEMO_MESSAGE_EVENT 2 +#define DEMO_ALL_EVENTS 3 + +TX_EVENT_FLAGS_GROUP mqtt_app_flag; + +static VOID my_notify_func(NXD_MQTT_CLIENT* client_ptr, UINT number_of_messages) +{ + + tx_event_flags_set(&mqtt_app_flag, DEMO_MESSAGE_EVENT, TX_OR); + return; + +} + +static UCHAR topic[100], message[100]; + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +ULONG events; +UINT topic_length, message_length; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Receive Span Test...................................."); + + status = tx_event_flags_create(&mqtt_app_flag, "my app event"); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, + mqtt_memory, sizeof(mqtt_memory)); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + status = nxd_mqtt_client_receive_notify_set(client_ptr, my_notify_func); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (topic_length != strlen(TOPIC) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS0)) || + strncmp(message, MESSAGE_QOS0, message_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for another incoming message. */ + tx_event_flags_get(&mqtt_app_flag, DEMO_ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + status = nxd_mqtt_client_message_get(client_ptr, topic, sizeof(topic), &topic_length, message, sizeof(message), &message_length); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if (topic_length != strlen(TOPIC) || strncmp(TOPIC, topic, topic_length) || (message_length != strlen(MESSAGE_QOS0)) || + strncmp(message, MESSAGE_QOS0, message_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + /* Check for error. */ + +static UCHAR content[100]; + +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +UCHAR *byte; +NX_PACKET *packet_ptr; +UINT index = 0; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + + /* construct the connect message. */ + memcpy(content, fixed_header, sizeof(fixed_header)); + /* Append client ID */ + content[sizeof(fixed_header)] = (strlen(CLIENT_ID) >> 8) & 0xf; + content[sizeof(fixed_header) + 1] = (strlen(CLIENT_ID) & 0xf); + memcpy(content + sizeof(fixed_header) + 2, CLIENT_ID, strlen(CLIENT_ID)); + + content[1] = (UCHAR)(sizeof(fixed_header) + strlen(CLIENT_ID)); + + /* Fill in the connection_flag, keepalive, and cleansession flags. */ + content[10] = keepalive_value >> 8; + content[11] = keepalive_value & 0xFF; + if (cleansession_value) + content[9] = content[9] | 2; + + /* Validate the MQTT connect request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, sizeof(fixed_header) + strlen(CLIENT_ID))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(50); + + /* Construct MQTT message. */ + byte = content; + byte[0] = 0x30; + index = 2; + byte[index++] = ((strlen(TOPIC)) >> 8) & 0xFF; + byte[index++] = (strlen(TOPIC)) & 0xFF; + memcpy(byte + index, TOPIC, strlen(TOPIC)); + index += strlen(TOPIC); + memcpy(byte + index, MESSAGE_QOS0, strlen(MESSAGE_QOS0)); + index += strlen(MESSAGE_QOS0); + byte[1] = index - 2; + + /* Duplicate MQTT message. */ + memcpy(byte + index, byte, index); + + /* 1. Send fixed_header field. */ + publish_mqtt_message(i, content, 1); + + /* 2. Send length field. */ + publish_mqtt_message(i, content + 1, 1); + + /* 3. Send another byte. */ + publish_mqtt_message(i, content + 2, 1); + + /* 4. Send remaining bytes of first message plus one bytes of second message. */ + publish_mqtt_message(i, content + 3, index - 2); + + /* 5. Send remaining bytes of second message. */ + publish_mqtt_message(i, content + index + 1, index - 1); + + tx_thread_sleep(5); + /* We dont expect anything back for QoS 0. */ + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +static void publish_mqtt_message(UINT i, UCHAR *data, UINT size) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Send a publish message with QoS 0 */ + if (i == 0) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + memcpy(packet_ptr->nx_packet_prepend_ptr, data, size); + packet_ptr->nx_packet_length = size; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + size; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +} diff --git a/test/regression/mqtt_test/netx_mqtt_remaining_length_test.c b/test/regression/mqtt_test/netx_mqtt_remaining_length_test.c new file mode 100644 index 00000000..fa55a600 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_remaining_length_test.c @@ -0,0 +1,210 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" + +extern UINT _nxd_mqtt_read_remaining_length(NX_PACKET *packet_ptr, UINT *remaining_length, ULONG *offset); +extern UINT _nxd_mqtt_client_set_fixed_header(NXD_MQTT_CLIENT *client_ptr, NX_PACKET *packet_ptr, UCHAR control_header, UINT length, UINT wait_option); + +static ULONG error_counter; +extern void test_control_return(UINT status); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef CTEST +void test_application_define(void * first_unused_memory) +#else /* CTEST */ +void netx_mqtt_remaining_length_test(void * first_unused_memory) +#endif /* CTEST */ +{ +CHAR *pointer; +NX_PACKET_POOL pool_0; +NXD_MQTT_CLIENT *client_ptr; +NX_PACKET *packet_ptr; +UINT status; +UINT remaining_length; +ULONG offset; +int i; +UCHAR *byte; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Remaining Length Test ..............................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + pointer = pointer + PACKET_POOL_SIZE; + + client_ptr = (NXD_MQTT_CLIENT *)pointer; + client_ptr -> nxd_mqtt_client_packet_pool_ptr = &pool_0; + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Test set function, remaining length <= 127 */ + for(i = 1; i < 128; i++) + { + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + packet_ptr->nx_packet_next = 0; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, i, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 2) || ((*(packet_ptr -> nx_packet_prepend_ptr + 1)) != i)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += i; + packet_ptr->nx_packet_append_ptr += i; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != i) || (offset != 2)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /* test 128 */ + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, 128, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 3) || + ((*(packet_ptr -> nx_packet_prepend_ptr + 1) != 0x80) && (*(packet_ptr -> nx_packet_prepend_ptr + 2) != 0x01))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += 128; + packet_ptr->nx_packet_append_ptr += 128; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != 128) || (offset != 3)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* test 16383 */ + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, 16383, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 3) || + ((*(packet_ptr -> nx_packet_prepend_ptr + 1) != 0xFF) && (*(packet_ptr -> nx_packet_prepend_ptr + 2) != 0x7F))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += 16383; + packet_ptr->nx_packet_append_ptr += 16383; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != 16383) || (offset != 3)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* test 16384 */ + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, 16384, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 4) || + ((*(packet_ptr -> nx_packet_prepend_ptr + 1) != 0x80) && (*(packet_ptr -> nx_packet_prepend_ptr + 2) != 0x80)) && + ((*(packet_ptr -> nx_packet_prepend_ptr + 3) != 0x01))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += 16384; + packet_ptr->nx_packet_append_ptr += 16384; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != 16384) || (offset != 4)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* test 2 097 151 */ + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, 2097151, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 4) || + ((*(packet_ptr -> nx_packet_prepend_ptr + 1) != 0xFF) && (*(packet_ptr -> nx_packet_prepend_ptr + 2) != 0xFF)) && + ((*(packet_ptr -> nx_packet_prepend_ptr + 3) != 0x7f))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += 2097151; + packet_ptr->nx_packet_append_ptr += 2097151; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != 2097151) || (offset != 4)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* test 2 097 152 */ + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, 2097152, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 5) || + ((*(packet_ptr -> nx_packet_prepend_ptr + 1) != 0x80) && (*(packet_ptr -> nx_packet_prepend_ptr + 2) != 0x80)) && + ((*(packet_ptr -> nx_packet_prepend_ptr + 3) != 0x80)) && ((*(packet_ptr -> nx_packet_prepend_ptr + 4) != 0x1))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += 2097152; + packet_ptr->nx_packet_append_ptr += 2097152; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != 2097152) || (offset != 5)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* test 268 435 455 */ + packet_ptr->nx_packet_length = 0; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr; + memset(packet_ptr->nx_packet_prepend_ptr, 0, 10); + status = _nxd_mqtt_client_set_fixed_header(client_ptr, packet_ptr, 0, 268435455, NX_WAIT_FOREVER); + /* Verify the value. */ + if((status != 0) || (packet_ptr -> nx_packet_length != 5) || + ((*(packet_ptr -> nx_packet_prepend_ptr + 1) != 0xff) && (*(packet_ptr -> nx_packet_prepend_ptr + 2) != 0xff)) && + ((*(packet_ptr -> nx_packet_prepend_ptr + 3) != 0xff)) && ((*(packet_ptr -> nx_packet_prepend_ptr + 4) != 0x7f))) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + packet_ptr->nx_packet_length += 268435455; + packet_ptr->nx_packet_append_ptr += 268435455; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if((status != 0) || (remaining_length != 268435455) || (offset != 5)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Test for invalid length */ + packet_ptr->nx_packet_length = 6; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 6; + + byte = packet_ptr -> nx_packet_prepend_ptr + 1; + *byte = 0x80; byte++; + *byte = 0x80; byte++; + *byte = 0x80; byte++; + *byte = 0x80; byte++; + *byte = 0x7f; byte++; + status = _nxd_mqtt_read_remaining_length(packet_ptr, &remaining_length, &offset); + if(status == 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr); + + nx_packet_pool_delete(&pool_0); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} diff --git a/test/regression/mqtt_test/netx_mqtt_subscribe_non_zero_packet_id_test.c b/test/regression/mqtt_test/netx_mqtt_subscribe_non_zero_packet_id_test.c new file mode 100644 index 00000000..d3c1d0dc --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_subscribe_non_zero_packet_id_test.c @@ -0,0 +1,723 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_subscribe_non_zero_packet_id_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Subscribe Non-Zero Packet ID Test ..................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + memset(client_ptr, 0, sizeof(NXD_MQTT_CLIENT)); + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + QoS = 1; + /* Issue the 1st subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC1, strlen(TOPIC1), QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Force packet ID to be 0xFFFF */ + client_ptr->nxd_mqtt_client_packet_identifier = 0xffff; + + /* Issue the 2nd subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC1, strlen(TOPIC1), QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Issue the 3rd subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC1, strlen(TOPIC1), QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /*************************** Test 1st subscribe message *******************************/ + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the subscribe message. */ + byte = content; + *byte++ = 0x82; /* Subscribe */ + byte++; /* Skip the length field. */ + packet_id = (packet_ptr->nx_packet_prepend_ptr[2] << 8) + (packet_ptr->nx_packet_prepend_ptr[3]); + + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + /* Fill in the QoS byte. */ + byte += strlen(TOPIC1); + *byte++ = QoS & 0x3; + + if (packet_id == 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x90; + byte[1] = 0x03; + byte[2] = content[2]; + byte[3] = content[3]; + byte[4] = QoS & 0x3; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 5; + packet_ptr->nx_packet_length = 5; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + + /*************************** Test 2nd subscribe message *******************************/ + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 50); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the subscribe message. */ + byte = content; + *byte++ = 0x82; /* Subscribe */ + byte++; /* Skip the length field. */ + packet_id = (packet_ptr->nx_packet_prepend_ptr[2] << 8) + (packet_ptr->nx_packet_prepend_ptr[3]); + + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + /* Fill in the QoS byte. */ + byte += strlen(TOPIC1); + *byte++ = QoS & 0x3; + + if (packet_id != 0xFFFF) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x90; + byte[1] = 0x03; + byte[2] = content[2]; + byte[3] = content[3]; + byte[4] = QoS & 0x3; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 5; + packet_ptr->nx_packet_length = 5; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + + + /*************************** Test 3rd subscribe message *******************************/ + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the subscribe message. */ + byte = content; + *byte++ = 0x82; /* Subscribe */ + byte++; /* Skip the length field. */ + packet_id = (packet_ptr->nx_packet_prepend_ptr[2] << 8) + (packet_ptr->nx_packet_prepend_ptr[3]); + + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + + if (packet_id == 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + /* Fill in the QoS byte. */ + byte += strlen(TOPIC1); + *byte++ = QoS & 0x3; + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x90; + byte[1] = 0x03; + byte[2] = content[2]; + byte[3] = content[3]; + byte[4] = QoS & 0x3; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 5; + packet_ptr->nx_packet_length = 5; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + + + + + /*************************** End of the Test ******************************************/ + + tx_thread_sleep(5); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_subscribe_packet_chain_test.c b/test/regression/mqtt_test/netx_mqtt_subscribe_packet_chain_test.c new file mode 100644 index 00000000..608e3976 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_subscribe_packet_chain_test.c @@ -0,0 +1,393 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); + +#if !defined(NXD_MQTT_REQUIRE_TLS) + +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC_LEN 256 +#define CLIENT_MEMORY_SIZE 1024 +#define PACKET_BUFFER_SIZE 1024 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 32 +#define PACKET_SIZE 128 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +static TX_SEMAPHORE semaphore_server_received; +static TX_SEMAPHORE semaphore_client_sent; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +static UCHAR *packet_buffer; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_subscribe_packet_chain_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_received, "semaphore server received", 0); + tx_semaphore_create(&semaphore_client_sent, "semaphore client sent", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + packet_buffer = pointer; + pointer += PACKET_BUFFER_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT connection_flag_value; +static UINT QoS; +static UCHAR *topic; + +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Subscribe Packet Chain Test.........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + error_counter++; + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + topic = packet_buffer; + + for (i = 0; i < TOPIC_LEN; i++) + { + topic[i] = i & 0xff; + } + + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + QoS = 1; + +#if 0 +NX_PACKET *temp_packets[NUM_PACKETS]; + + for (i = 0 ; i < NUM_PACKETS - 2; i++) + { + status = nx_packet_allocate(&pool_0, &(temp_packets[i]), NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + break; + } + } + + /* Fail to append topic. */ + status = nxd_mqtt_client_subscribe(client_ptr, topic, TOPIC_LEN, QoS); + if (status != NXD_MQTT_PACKET_POOL_FAILURE) + error_counter++; + + for (i = 0 ; i < NUM_PACKETS - 2; i++) + { + nx_packet_release(temp_packets[i]); + } +#endif + + /* Issue a subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, topic, TOPIC_LEN, QoS); + if (status) + error_counter++; + + tx_semaphore_put(&semaphore_client_sent); + + tx_semaphore_get(&semaphore_server_received, NX_WAIT_FOREVER); + + nxd_mqtt_client_disconnect(client_ptr); + + nxd_mqtt_client_delete(client_ptr); + + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT len, packet_len; +UCHAR control_header; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_sleep(1); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } + else + { + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + packet_ptr = NX_NULL; + packet_len = 0; + + tx_semaphore_get(&semaphore_client_sent, NX_WAIT_FOREVER); + + while (1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + if (status) + break; + + nx_packet_data_retrieve(packet_ptr, packet_buffer + packet_len, (ULONG *)&len); + packet_len += len; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&semaphore_server_received); + + /* Check the subscribe message. */ + + control_header = 0x82; /* Subscribe */ + len = 1 + 2 + 2 + 2 + TOPIC_LEN + 1; /* Control header 1 + remaining length 2 + packet ID 2 + topic length 2 + topic + QoS 1 */ + + for (i = 0 ; i < TOPIC_LEN; i++) + { + if (packet_buffer[7 + i] != (i & 0xff)) + { + error_counter++; + break; + } + } + + /* Now validate message length */ + if (packet_len != len) + error_counter++; + + /* Validate the MQTT subscribe request. */ + if ((packet_buffer[0] != control_header) || (packet_buffer[packet_len -1] != (QoS & 0x3))) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_subscribe_packet_chain_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Subscribe Packet Chain Test..........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/mqtt_test/netx_mqtt_subscribe_test.c b/test/regression/mqtt_test/netx_mqtt_subscribe_test.c new file mode 100644 index 00000000..3df64568 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_subscribe_test.c @@ -0,0 +1,595 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_subscribe_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Subscribe Test ......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + QoS = 1; + + /* Issue a subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC1, strlen(TOPIC1), QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +//static UCHAR fixed_header[] = {0x80, 0x00, /* MQTT Control Packet Type, remaining length */ +// 0x00, 0x00}; /* Packet identifier, MSB, and LSB */ + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the subscribe message. */ + byte = content; + *byte++ = 0x82; /* Subscribe */ + byte++; /* Skip the length field. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + /* Fill in the QoS byte. */ + byte += strlen(TOPIC1); + *byte++ = QoS & 0x3; + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT subscribe request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x90; + byte[1] = 0x03; + byte[2] = content[2]; + byte[3] = content[3]; + byte[4] = QoS & 0x3; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 5; + packet_ptr->nx_packet_length = 5; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#if 0 + /* Expect Unsub */ + tx_thread_sleep(1); + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the unsubscribe message. */ + byte = content; + *byte++ = 0xA0; /* Unsubscribe */ + byte++; /* Skip the length field. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT unsubscribe request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0xb0; + byte[1] = 0x02; + byte[2] = content[2]; + byte[3] = content[3]; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + tx_thread_sleep(5); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_testcontrol.c b/test/regression/mqtt_test/netx_mqtt_testcontrol.c new file mode 100644 index 00000000..a483b5db --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_testcontrol.c @@ -0,0 +1,506 @@ +/* This is the test control routine the NetX TCP/IP stack. All tests are dispatched from this routine. */ + +#include "tx_api.h" +#include "nx_api.h" +#include +#include +#include "nx_ram_network_driver_test_1500.h" + +/* +#define NETXTEST_TIMEOUT_DISABLE +*/ + +#define TEST_STACK_SIZE 4096 + +/* 1 minute. */ +#define TEST_TIMEOUT_LOW (60 * NX_IP_PERIODIC_RATE) +/* 15 minutes. */ +#define TEST_TIMEOUT_MID (900 * NX_IP_PERIODIC_RATE) +/* 120 minutes. */ +#define TEST_TIMEOUT_HIGH (7200 * NX_IP_PERIODIC_RATE) + +/* Define the test control ThreadX objects... */ + +TX_THREAD test_control_thread; +#ifndef NETXTEST_TIMEOUT_DISABLE +TX_SEMAPHORE test_control_sema; +#endif + +/* Define the test control global variables. */ + +ULONG test_control_return_status; +ULONG test_control_successful_tests; +ULONG test_control_failed_tests; +ULONG test_control_warning_tests; +ULONG test_control_na_tests; + +/* Remember the start of free memory. */ + +UCHAR *test_free_memory_ptr; + +extern volatile UINT _tx_thread_preempt_disable; + +/* Define test entry pointer type. */ + +typedef struct TEST_ENTRY_STRUCT +{ + VOID (*test_entry)(void *); + UINT timeout; +} TEST_ENTRY; + + +/* Define the prototypes for the test entry points. */ +void netx_mqtt_api_test_application_define(void*); +void netx_mqtt_client_connect_application_define(void*); +void netx_mqtt_client_connect_packet_send_failure_application_define(void*); +void netx_mqtt_client_connect_v6_application_define(void*); +void netx_mqtt_client_connect_non_block_application_define(void*); +void netx_mqtt_client_connect_non_block_2_application_define(void*); +void netx_mqtt_client_connect_auth_application_define(void*); +void netx_mqtt_client_connect_auth_empty_application_define(void*); +void netx_mqtt_client_null_password_application_define(void *); +void netx_mqtt_client_subscribe_application_define(void*); +void netx_mqtt_client_unsubscribe_application_define(void*); +void netx_mqtt_client_publish_QoS0_application_define(void *); +void netx_mqtt_client_publish_QoS1_application_define(void *); +void netx_mqtt_client_publish_QoS2_application_define(void *); +void netx_mqtt_client_receive_QoS0_application_define(void *); +void netx_mqtt_client_receive_QoS1_application_define(void *); +void netx_mqtt_client_receive_QoS2_application_define(void *); +void netx_mqtt_client_connect_will_message_application_define(void *); +void netx_mqtt_client_connect_auth_will_application_define(void *); +void netx_mqtt_client_connect_will_topic_only_application_define(void *); +void netx_mqtt_not_connected_application_define(void *); +void netx_mqtt_client_keepalive_application_define(void*); +void netx_mqtt_client_keepalive_timeout_application_define(void*); +void netx_mqtt_client_multiple_receive_application_define(void*); +void netx_mqtt_remaining_length_test(void *); +void netx_mqtt_client_publish_non_zero_packet_id_application_define(void*); +void netx_mqtt_client_subscribe_non_zero_packet_id_application_define(void*); +void netx_mqtt_client_packet_leak_application_define(void *); +void netx_mqtt_client_receive_span_application_define(void *first_unused_memory); +void netx_mqtt_client_publish_packet_chain_application_define(void *); +void netx_mqtt_client_subscribe_packet_chain_application_define(void *); +void netx_mqtt_client_connack_error_application_define(void *); +void netx_mqtt_client_branch_application_define(void *); +void netx_mqtt_websocket_non_block_test_application_define(void *); +void netx_mqtt_websocket_block_test_application_define(void *); +#ifdef CTEST +void test_application_define(void *); +#endif + + +/* Define the array of test entry points. */ + +TEST_ENTRY test_control_tests[] = +{ +#ifdef CTEST + {test_application_define, TEST_TIMEOUT_LOW}, +#else /* CTEST */ + {netx_mqtt_remaining_length_test, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_receive_QoS0_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_receive_QoS1_application_define, TEST_TIMEOUT_LOW}, + /*{netx_mqtt_client_receive_QoS2_application_define, TEST_TIMEOUT_LOW},*/ + {netx_mqtt_client_publish_QoS0_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_publish_QoS1_application_define, TEST_TIMEOUT_LOW}, + /* {netx_mqtt_client_publish_QoS2_application_define, TEST_TIMEOUT_LOW}, */ + {netx_mqtt_client_subscribe_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_unsubscribe_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_auth_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_auth_empty_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_v6_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_non_block_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_non_block_2_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_null_password_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_will_message_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_will_topic_only_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connect_auth_will_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_not_connected_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_keepalive_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_keepalive_timeout_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_multiple_receive_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_publish_non_zero_packet_id_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_subscribe_non_zero_packet_id_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_packet_leak_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_receive_span_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_publish_packet_chain_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_subscribe_packet_chain_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_connack_error_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_client_branch_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_websocket_non_block_test_application_define, TEST_TIMEOUT_LOW}, + {netx_mqtt_websocket_block_test_application_define, TEST_TIMEOUT_LOW}, +#endif /* CTEST */ + + {TX_NULL, TEST_TIMEOUT_LOW}, +}; + +/* Define thread prototypes. */ + +void test_control_thread_entry(ULONG thread_input); +void test_control_return(UINT status); +void test_control_cleanup(void); +void _nx_ram_network_driver_reset(void); + +/* Define necessary external references. */ + +#ifdef __ghs +extern TX_MUTEX __ghLockMutex; +#endif + +extern TX_TIMER *_tx_timer_created_ptr; +extern ULONG _tx_timer_created_count; +#ifndef TX_TIMER_PROCESS_IN_ISR +extern TX_THREAD _tx_timer_thread; +#endif +extern TX_THREAD *_tx_thread_created_ptr; +extern ULONG _tx_thread_created_count; +extern TX_SEMAPHORE *_tx_semaphore_created_ptr; +extern ULONG _tx_semaphore_created_count; +extern TX_QUEUE *_tx_queue_created_ptr; +extern ULONG _tx_queue_created_count; +extern TX_MUTEX *_tx_mutex_created_ptr; +extern ULONG _tx_mutex_created_count; +extern TX_EVENT_FLAGS_GROUP *_tx_event_flags_created_ptr; +extern ULONG _tx_event_flags_created_count; +extern TX_BYTE_POOL *_tx_byte_pool_created_ptr; +extern ULONG _tx_byte_pool_created_count; +extern TX_BLOCK_POOL *_tx_block_pool_created_ptr; +extern ULONG _tx_block_pool_created_count; + +extern NX_PACKET_POOL * _nx_packet_pool_created_ptr; +extern ULONG _nx_packet_pool_created_count; +extern NX_IP * _nx_ip_created_ptr; +extern ULONG _nx_ip_created_count; + +/* Define main entry point. */ + +int main() +{ + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); + + + return 0; +} + +//#define TEST_FREE_MEMORY_POOL_SIZE (100 * 1024) +//static ULONG test_free_memory_pool[TEST_FREE_MEMORY_POOL_SIZE / sizeof(ULONG)]; +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + UCHAR *pointer; + + /* Setup a pointer to the first unused memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the test control thread. */ + tx_thread_create(&test_control_thread, "test control thread", test_control_thread_entry, 0, + pointer, TEST_STACK_SIZE, + 0, 0, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + TEST_STACK_SIZE; + +#ifndef NETXTEST_TIMEOUT_DISABLE + /* Create the test control semaphore. */ + tx_semaphore_create(&test_control_sema, "Test control semaphore", 0); +#endif + + /* Remember the free memory pointer. */ + //test_free_memory_ptr = (UCHAR*)test_free_memory_pool; + test_free_memory_ptr = pointer; +} + +/* Define the test control thread. This thread is responsible for dispatching all of the +tests in the ThreadX test suite. */ + +void test_control_thread_entry(ULONG thread_input) +{ + UINT i; + + /* Loop to process all tests... */ + i = 0; + while (test_control_tests[i].test_entry != TX_NULL) + { + + /* Dispatch the test. */ + (test_control_tests[i++].test_entry)(test_free_memory_ptr); + + if (test_control_return_status != 3) + { + +#ifdef NETXTEST_TIMEOUT_DISABLE + /* Suspend control test to allow test to run. */ + tx_thread_suspend(&test_control_thread); +#else + if(tx_semaphore_get(&test_control_sema, test_control_tests[i - 1].timeout)) + { + + /* Test case timeouts. */ + printf("ERROR!\n"); + test_control_failed_tests++; + + } +#endif + } + else + test_control_return_status = 0; + + /* Test finished, cleanup in preparation for the next test. */ + test_control_cleanup(); + fflush(stdout); + } + + /* Finished with all tests, print results and return! */ + printf("**** Testing Complete ****\n"); + printf("**** Test Summary: Tests Passed: %lu Tests Warning: %lu Tests Failed: %lu\n", test_control_successful_tests, test_control_warning_tests, test_control_failed_tests); +#if 0 + fclose(stream); +#endif +#ifdef BATCH_TEST + exit(test_control_failed_tests); +#endif + + +} + +void test_control_return(UINT status) +{ + UINT old_posture = TX_INT_ENABLE; + + /* Save the status in a global. */ + test_control_return_status = status; + + /* Ensure interrupts are enabled. */ + old_posture = tx_interrupt_control(TX_INT_ENABLE); + + /* Determine if it was successful or not. */ + if((status == 1) || (_tx_thread_preempt_disable) || (old_posture == TX_INT_DISABLE)) + test_control_failed_tests++; + else if(status == 2) + test_control_warning_tests++; + else if(status == 0) + test_control_successful_tests++; + else if(status == 3) + test_control_na_tests++; + +#ifdef NETXTEST_TIMEOUT_DISABLE + /* Resume the control thread to fully exit the test. */ + tx_thread_resume(&test_control_thread); +#else + if(test_control_return_status != 3) + tx_semaphore_put(&test_control_sema); +#endif +} + +void test_control_cleanup(void) +{ + TX_MUTEX *mutex_ptr; + TX_THREAD *thread_ptr; + + /* Clean timer used by RAM driver. */ + _nx_ram_network_driver_timer_clean(); + + /* Delete all IP instances. */ + while (_nx_ip_created_ptr) + { + + /* Delete all UDP sockets. */ + while (_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr) + { + + /* Make sure the UDP socket is unbound. */ + nx_udp_socket_unbind(_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr); + } + + /* Delete all TCP sockets. */ + while (_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr) + { + + /* Disconnect. */ + nx_tcp_socket_disconnect(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr, NX_NO_WAIT); + + /* Make sure the TCP client socket is unbound. */ + nx_tcp_client_socket_unbind(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + + /* Make sure the TCP server socket is unaccepted. */ + nx_tcp_server_socket_unaccept(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + } + + /* Clear all listen requests. */ + while (_nx_ip_created_ptr -> nx_ip_tcp_active_listen_requests) + { + + /* Make sure the TCP server socket is unlistened. */ + nx_tcp_server_socket_unlisten(_nx_ip_created_ptr, (_nx_ip_created_ptr -> nx_ip_tcp_active_listen_requests) -> nx_tcp_listen_port); + } + + /* Delete the IP instance. */ + nx_ip_delete(_nx_ip_created_ptr); + } + + /* Delete all the packet pools. */ + while (_nx_packet_pool_created_ptr) + { + nx_packet_pool_delete(_nx_packet_pool_created_ptr); + } + + /* Reset the RAM driver. */ + _nx_ram_network_driver_reset(); + + /* Delete all queues. */ + while(_tx_queue_created_ptr) + { + + /* Delete queue. */ + tx_queue_delete(_tx_queue_created_ptr); + } + + /* Delete all semaphores. */ + while(_tx_semaphore_created_ptr) + { +#ifndef NETXTEST_TIMEOUT_DISABLE + if(_tx_semaphore_created_ptr != &test_control_sema) + { + + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr); + } + else if(_tx_semaphore_created_count == 1) + break; + else + { + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr -> tx_semaphore_created_next); + } +#else + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr); +#endif + } + + /* Delete all event flag groups. */ + while(_tx_event_flags_created_ptr) + { + + /* Delete event flag group. */ + tx_event_flags_delete(_tx_event_flags_created_ptr); + } + + /* Delete all byte pools. */ + while(_tx_byte_pool_created_ptr) + { + + /* Delete byte pool. */ + tx_byte_pool_delete(_tx_byte_pool_created_ptr); + } + + /* Delete all block pools. */ + while(_tx_block_pool_created_ptr) + { + + /* Delete block pool. */ + tx_block_pool_delete(_tx_block_pool_created_ptr); + } + + /* Delete all timers. */ + while(_tx_timer_created_ptr) + { + + /* Deactivate timer. */ + tx_timer_deactivate(_tx_timer_created_ptr); + + /* Delete timer. */ + tx_timer_delete(_tx_timer_created_ptr); + } + + /* Delete all mutexes (except for system mutex). */ + while(_tx_mutex_created_ptr) + { + + /* Setup working mutex pointer. */ + mutex_ptr = _tx_mutex_created_ptr; + +#ifdef __ghs + + /* Determine if the mutex is the GHS system mutex. If so, don't delete! */ + if(mutex_ptr == &__ghLockMutex) + { + + /* Move to next mutex. */ + mutex_ptr = mutex_ptr -> tx_mutex_created_next; + } + + /* Determine if there are no more mutexes to delete. */ + if(_tx_mutex_created_count == 1) + break; +#endif + + /* Delete mutex. */ + tx_mutex_delete(mutex_ptr); + } + + /* Delete all threads, except for timer thread, and test control thread. */ + while (_tx_thread_created_ptr) + { + + /* Setup working pointer. */ + thread_ptr = _tx_thread_created_ptr; + +#ifdef TX_TIMER_PROCESS_IN_ISR + + /* Determine if there are more threads to delete. */ + if(_tx_thread_created_count == 1) + break; + + /* Determine if this thread is the test control thread. */ + if(thread_ptr == &test_control_thread) + { + + /* Move to the next thread pointer. */ + thread_ptr = thread_ptr -> tx_thread_created_next; + } +#else + + /* Determine if there are more threads to delete. */ + if(_tx_thread_created_count == 2) + break; + + /* Move to the thread not protected. */ + while ((thread_ptr == &_tx_timer_thread) || (thread_ptr == &test_control_thread)) + { + + /* Yes, move to the next thread. */ + thread_ptr = thread_ptr -> tx_thread_created_next; + } +#endif + + /* First terminate the thread to ensure it is ready for deletion. */ + tx_thread_terminate(thread_ptr); + + /* Delete the thread. */ + tx_thread_delete(thread_ptr); + } + + /* At this point, only the test control thread and the system timer thread and/or mutex should still be + in the system. */ + + +} + +void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number) +{ + *error_counter = (*error_counter) + 1; + + printf("Error: File %s:%d\n", filename, line_number); + + + +} diff --git a/test/regression/mqtt_test/netx_mqtt_transmit_queue_depth_test.c b/test/regression/mqtt_test/netx_mqtt_transmit_queue_depth_test.c new file mode 100644 index 00000000..419dc0fc --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_transmit_queue_depth_test.c @@ -0,0 +1,360 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); + +#if !defined(NXD_MQTT_REQUIRE_TLS) && defined(NXD_MQTT_MAXIMUM_TRANSMIT_QUEUE_DEPTH) + +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC_LEN 256 +#define MESSAGE_LEN 256 +#define CLIENT_MEMORY_SIZE 1024 +#define PACKET_BUFFER_SIZE 1024 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 128 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +static TX_SEMAPHORE semaphore_server_received; +static TX_SEMAPHORE semaphore_client_sent; +static UCHAR pool_area[PACKET_POOL_SIZE]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +static UCHAR *packet_buffer; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_transmit_queue_depth_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_received, "semaphore server received", 0); + tx_semaphore_create(&semaphore_client_sent, "semaphore client sent", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pool_area, PACKET_POOL_SIZE); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + packet_buffer = pointer; + pointer += PACKET_BUFFER_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +static UINT retain; +static UCHAR *topic; +static UCHAR *message; + +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Transmit Queue Depth Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + error_counter++; + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + topic = packet_buffer; + message = packet_buffer + TOPIC_LEN; + + for (i = 0; i < TOPIC_LEN; i++) + { + topic[i] = i & 0xff; + message[i] = 0xff - (i & 0xff); + } + + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + QoS = 1; + retain = 0; + + /* Send telemetry to fill the transmit queue. */ + for (i = 0 ; i < NXD_MQTT_MAXIMUM_TRANSMIT_QUEUE_DEPTH; i++) + { + + /* Send telemetry */ + status = nxd_mqtt_client_publish(client_ptr, topic, TOPIC_LEN, message, MESSAGE_LEN, retain, QoS, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + } + + /* Send telemetry */ + status = nxd_mqtt_client_publish(client_ptr, topic, TOPIC_LEN, message, MESSAGE_LEN, retain, QoS, 5 * NX_IP_PERIODIC_RATE); + if (status == NXD_MQTT_SUCCESS) + error_counter++; + + tx_semaphore_put(&semaphore_client_sent); + + tx_semaphore_get(&semaphore_server_received, NX_WAIT_FOREVER); + + nxd_mqtt_client_disconnect(client_ptr); + + nxd_mqtt_client_delete(client_ptr); + + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +USHORT packet_id; +UINT len, packet_len; +UCHAR control_header; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_sleep(1); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } + else + { + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + packet_ptr = NX_NULL; + packet_len = 0; + + tx_semaphore_get(&semaphore_client_sent, NX_WAIT_FOREVER); + + while (1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + if (status) + break; + + nx_packet_release(packet_ptr); + } + + tx_semaphore_put(&semaphore_server_received); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_transmit_queue_depth_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Transmit Queue Depth Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/mqtt_test/netx_mqtt_unsubscribe_test.c b/test/regression/mqtt_test/netx_mqtt_unsubscribe_test.c new file mode 100644 index 00000000..005193d8 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_unsubscribe_test.c @@ -0,0 +1,626 @@ +/* MQTT connect test. This test case validates MQTT client connect without username/password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_ID "1234" +#define TOPIC1 "topic1" +#define MESSAGE1 "message1" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 2 +#else +#define TEST_LOOP 1 +#endif + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + + +/* Define what the initial system looks like. */ +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *client_memory; +static CHAR *stack_ptr; +#define CLIENT_MEMORY_SIZE 1024 +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_client_unsubscribe_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 23,23, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 23, 23, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + + client_memory = pointer; + pointer += CLIENT_MEMORY_SIZE; + + client_ptr = (NXD_MQTT_CLIENT*)pointer; +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +static UINT QoS; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Unsubscribe Test ...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, client_memory, CLIENT_MEMORY_SIZE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i == 0) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); +#ifdef NXD_MQTT_REQUIRE_TLS + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_semaphore_put(&semaphore_client_stop); + continue; +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_IP_PERIODIC_RATE); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + QoS = 1; + /* Issue a subscribe command. */ + status = nxd_mqtt_client_subscribe(client_ptr, TOPIC1, strlen(TOPIC1), QoS); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Issue an unsubscribe command. */ + status = nxd_mqtt_client_unsubscribe(client_ptr, TOPIC1, strlen(TOPIC1)); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + tx_thread_sleep(1); + + nxd_mqtt_client_disconnect(client_ptr); + + tx_semaphore_put(&semaphore_client_stop); + } + + nxd_mqtt_client_delete(client_ptr); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; + +//static UCHAR fixed_header[] = {0x80, 0x00, /* MQTT Control Packet Type, remaining length */ +// 0x00, 0x00}; /* Packet identifier, MSB, and LSB */ + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *byte; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + //tx_thread_sleep(1); + if (i == 0) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i == 1) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with Connect SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x20; + byte[1] = 0x02; + byte[2] = 0; + byte[3] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the subscribe message. */ + byte = content; + *byte++ = 0x82; /* Subscribe */ + byte++; /* Skip the length field. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + /* Fill in the QoS byte. */ + byte += strlen(TOPIC1); + *byte++ = QoS & 0x3; + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT subscribe request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0x90; + byte[1] = 0x03; + byte[2] = content[2]; + byte[3] = content[3]; + byte[4] = QoS & 0x3; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 5; + packet_ptr->nx_packet_length = 5; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect Unsub */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 50); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Expect Unsub */ + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* construct the unsubscribe message. */ + byte = content; + *byte++ = 0xA2; /* Unsubscribe */ + byte++; /* Skip the length field. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[2];/* Fill in packet ID MSB. */ + *byte++ = packet_ptr->nx_packet_prepend_ptr[3];/* Fill in packet ID LSB. */ + /* Fill in subscribe topic length MSB and LSB */ + *byte++ = (strlen(TOPIC1) >> 8) & 0xFF; + *byte++ = strlen(TOPIC1) & 0xFF; + /* Fill in the topic string. */ + memcpy(byte, TOPIC1, strlen(TOPIC1)); + byte += strlen(TOPIC1); + + /* Now validate message length */ + if (packet_ptr->nx_packet_length != (byte - content)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Fill in the remaining length field. */ + content[1] = (packet_ptr->nx_packet_length - 2) & 0xFF; + + /* Validate the MQTT unsubscribe request. */ + if (memcmp(packet_ptr->nx_packet_prepend_ptr, content, packet_ptr->nx_packet_length)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + byte = packet_ptr->nx_packet_prepend_ptr; + byte[0] = 0xb0; + byte[1] = 0x02; + byte[2] = content[2]; + byte[3] = content[3]; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 4; + packet_ptr->nx_packet_length = 4; + + if (i == 0) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, 1); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Disconnect. */ + tx_thread_sleep(1); + +#ifdef NX_SECURE_ENABLE + if (i == 1) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + diff --git a/test/regression/mqtt_test/netx_mqtt_websocket_block_test.c b/test/regression/mqtt_test/netx_mqtt_websocket_block_test.c new file mode 100644 index 00000000..bcc445f1 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_websocket_block_test.c @@ -0,0 +1,739 @@ +/* MQTT over websocket connect test. This test case validates MQTT client connect over websocket in blocking mode. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +#include "nx_websocket_client.h" +#include "nx_sha1.h" + +extern void test_control_return(UINT status); +#if defined(NXD_MQTT_OVER_WEBSOCKET) + +/* Define the ThreadX and NetX object control blocks... */ +#define DEMO_STACK_SIZE 2048 +#define CLIENT_ID "1234" +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define HOST_NAME "test.host.org" +#define TEST_CONNECT_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" +#define TEST_CONNECT_GUID_SIZE (sizeof(TEST_CONNECT_GUID) - 1) +#define TEST_CONNECT_DIGEST_SIZE 21 /* The length of SHA-1 hash is 20 bytes, with 1 extra byte for base64 encode calculation */ +#define TEST_CONNECT_KEY_SIZE 32 /* Make it larger than the minimum length (28 bytes )for the encoded key */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +static UCHAR connect_key[TEST_CONNECT_KEY_SIZE]; +static UINT connect_key_size; + +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 4 +#else +#define TEST_LOOP 2 +#endif + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_websocket_block_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Websocket Block Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((status = nxd_mqtt_client_websocket_set(client_ptr, (UCHAR *)HOST_NAME, sizeof(HOST_NAME) - 1, (UCHAR *)"/mqtt", sizeof("/mqtt") - 1))) + { + printf("Error setting MQTT websocket: 0x%02x\r\n", status); + return; + } + + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i < 2) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, NX_WAIT_FOREVER); + +#ifndef NXD_MQTT_REQUIRE_TLS + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, NX_WAIT_FOREVER); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + { + nxd_mqtt_client_disconnect(client_ptr); + } + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, /* HTTP/1.1 101 Swi */ +0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, /* tching Protocols */ +0x0d, 0x0a, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, 0x57, 0x65, 0x62, 0x53, 0x6f, /* ..Upgrade: WebSo */ +0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, /* cket..Connection */ +0x3a, 0x20, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, 0x53, 0x65, 0x63, 0x2d, 0x57, /* : Upgrade..Sec-W */ +0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, /* ebSocket-Accept: */ +0x20, 0x64, 0x4f, 0x32, 0x68, 0x36, 0x5a, 0x4c, 0x46, 0x33, 0x71, 0x54, 0x74, 0x4d, 0x48, 0x7a, /* dO2h6ZLF3qTtMHz */ +0x47, 0x4b, 0x69, 0x59, 0x76, 0x53, 0x52, 0x45, 0x57, 0x6a, 0x76, 0x55, 0x3d, 0x0d, 0x0a, 0x53, /* GKiYvSREWjvU=..S */ +0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2d, 0x50, 0x72, 0x6f, /* ec-WebSocket-Pro */ +0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, 0x6d, 0x71, 0x74, 0x74, 0x0d, 0x0a, 0x0d, 0x0a, /* tocol: mqtt.... */ +}; + + +static UINT _server_connect_response_process(NX_PACKET *packet_ptr) +{ +UCHAR *buffer_ptr; +UINT offset = 0; +UCHAR *field_name; +UINT field_name_length; +UCHAR *field_value; +UINT field_value_length; +NX_SHA1 SH; +UCHAR digest[TEST_CONNECT_DIGEST_SIZE]; + + buffer_ptr = packet_ptr -> nx_packet_prepend_ptr; + + /* Skip over the first Command line (GET /xxx HTTP/1.1\r\n). */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && + (*buffer_ptr != '\r') && (*(buffer_ptr + 1) != '\n')) + { + buffer_ptr++; + offset++; + } + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Skip over the first Host line (Host: xxx\r\n). */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && + (*buffer_ptr != '\r') && (*(buffer_ptr + 1) != '\n')) + { + buffer_ptr++; + offset++; + } + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Loop until we find the "cr,lf,cr,lf" token. */ + while (((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != 0)) + { + + /* Check for the token. This signals a blank line, which also + specifies the start of the content. */ + if ((*buffer_ptr == '\r') && + (*(buffer_ptr + 1) == '\n')) + { + + /* Adjust the offset. */ + offset = offset + 2; + break; + } + + /* We haven't seen the so we are still processing header data. + Extract the field name and it's value. */ + field_name = buffer_ptr; + field_name_length = 0; + + /* Look for the ':' that separates the field name from its value. */ + while(*buffer_ptr != ':') + { + buffer_ptr++; + field_name_length++; + } + offset += field_name_length; + + /* Skip ':'. */ + buffer_ptr++; + offset++; + + /* Now skip over white space. */ + while ((buffer_ptr < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr == ' ')) + { + buffer_ptr++; + offset++; + } + + /* Now get the field value. */ + field_value = buffer_ptr; + field_value_length = 0; + + /* Loop until we see a . */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != '\r') && (*(buffer_ptr+1) != '\n')) + { + buffer_ptr++; + field_value_length++; + } + offset += field_value_length; + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Check the upgrade. */ + if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Upgrade", sizeof("Upgrade") - 1) == NX_SUCCESS) + { + if (_nx_websocket_client_name_compare((UCHAR *)field_value, field_value_length, (UCHAR *)"websocket", sizeof("websocket") - 1)) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + } + else if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Connection", sizeof("Connection") - 1) == NX_SUCCESS) + { + if (_nx_websocket_client_name_compare((UCHAR *)field_value, field_value_length, (UCHAR *)"Upgrade", sizeof("Upgrade") - 1)) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + } + else if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Sec-WebSocket-Key", sizeof("Sec-WebSocket-Key") - 1) == NX_SUCCESS) + { + + /* Calculate the SHA-1 hash of the concatenation of the client key and the Globally Unique Identifier (GUID) + Referenced in RFC 6455, Section 1.3, Page 6 */ + _nx_sha1_initialize(&SH); + _nx_sha1_update(&SH, field_value, field_value_length); + _nx_sha1_update(&SH, (UCHAR*)TEST_CONNECT_GUID, TEST_CONNECT_GUID_SIZE); + _nx_sha1_digest_calculate(&SH, digest); + + /* Set the last extra byte of the digest to be zero, since the function _nx_utility_base64_encode will use this byte for calculation */ + digest[20] = 0; + + /* Encode the hash and compare it with the field value from the server. */ + _nx_utility_base64_encode(digest, (TEST_CONNECT_DIGEST_SIZE - 1), connect_key, TEST_CONNECT_KEY_SIZE, &connect_key_size); + } + } + + /* Check if the all fields are processed. */ + if (offset != packet_ptr -> nx_packet_length) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + + return(NX_SUCCESS); +} + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *buffer_ptr; +UINT i, j; +UINT length; +UINT packet_count; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + + /* Receive websocket connect. */ + if (i < 2) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Get connect_key. */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[97], connect_key, 28); + nx_packet_release(packet_ptr); + + if (i % 2 == 0) + { + packet_count = 1; + } + else + { + packet_count = 3; + } + + buffer_ptr = server_switch_101; + for (j = 0; j < packet_count; j++) + { + + if ((packet_count == 3) && (j < 2)) + { + length = 50; + } + else + { + length = sizeof(server_switch_101) - 50 * j; + } + + if (i < 2) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#ifdef NX_SECURE_ENABLE + else + { + + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Append response 101. */ + status = nx_packet_data_append(packet_ptr, buffer_ptr, length, &pool_0, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Send websocket connect response. */ + if (i < 2) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + buffer_ptr += length; + } + + /* Receive MQTT connect. */ + if (i < 2) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + buffer_ptr = packet_ptr->nx_packet_prepend_ptr; + buffer_ptr[0] = 0x82; + buffer_ptr[1] = 0x04; + buffer_ptr[2] = 0x20; + buffer_ptr[3] = 0x02; + buffer_ptr[4] = 0; + buffer_ptr[5] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 6; + packet_ptr->nx_packet_length = 6; + + if (i < 2) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_websocket_block_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Websocket Block Test.................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/mqtt_test/netx_mqtt_websocket_non_block_test.c b/test/regression/mqtt_test/netx_mqtt_websocket_non_block_test.c new file mode 100644 index 00000000..300cfd96 --- /dev/null +++ b/test/regression/mqtt_test/netx_mqtt_websocket_non_block_test.c @@ -0,0 +1,762 @@ +/* MQTT over websocket connect test. This test case validates MQTT client connect over websocket in non-blocking mode. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nxd_mqtt_client.h" +#include "nx_websocket_client.h" +#include "nx_sha1.h" + +extern void test_control_return(UINT status); +#if defined(NX_ENABLE_EXTENDED_NOTIFY_SUPPORT) && defined(NXD_MQTT_OVER_WEBSOCKET) + +/* Define the ThreadX and NetX object control blocks... */ +#define DEMO_STACK_SIZE 2048 +#define CLIENT_ID "1234" +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define HOST_NAME "test.host.org" +#define TEST_CONNECT_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" +#define TEST_CONNECT_GUID_SIZE (sizeof(TEST_CONNECT_GUID) - 1) +#define TEST_CONNECT_DIGEST_SIZE 21 /* The length of SHA-1 hash is 20 bytes, with 1 extra byte for base64 encode calculation */ +#define TEST_CONNECT_KEY_SIZE 32 /* Make it larger than the minimum length (28 bytes )for the encoded key */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET server_socket; + + +static UCHAR connect_key[TEST_CONNECT_KEY_SIZE]; +static UINT connect_key_size; + +static NXD_MQTT_CLIENT *client_ptr; +static UCHAR *stack_ptr; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG connected = NX_FALSE; + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#define TEST_LOOP 4 +#else +#define TEST_LOOP 2 +#endif + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); +static void mqtt_connect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr, UINT status, VOID *context); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_websocket_non_block_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + stack_ptr = pointer; + pointer += DEMO_STACK_SIZE; + client_ptr = (NXD_MQTT_CLIENT*)pointer; + +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NXD_MQTT_CLIENT* client_ptr, NX_SECURE_TLS_SESSION* tls_session, + NX_SECURE_X509_CERT* certificate, NX_SECURE_X509_CERT* trusted_certificate) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif + +#define MQTT_CLIENT_THREAD_PRIORITY 2 +static UINT keepalive_value; +static UINT cleansession_value; +/* Define the test threads. */ +/* This thread sets up MQTT client and makes a connect request without username/password. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS server_address; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: MQTT Websocket Non Block Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_mqtt_client_create(client_ptr, "my client", CLIENT_ID, strlen(CLIENT_ID), &ip_0, &pool_0, + stack_ptr, DEMO_STACK_SIZE, MQTT_CLIENT_THREAD_PRIORITY, NX_NULL, 0); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + if ((status = nxd_mqtt_client_websocket_set(client_ptr, (UCHAR *)HOST_NAME, sizeof(HOST_NAME) - 1, (UCHAR *)"/mqtt", sizeof("/mqtt") - 1))) + { + printf("Error setting MQTT websocket: 0x%02x\r\n", status); + return; + } + + tx_thread_sleep(1); + + server_address.nxd_ip_version = 4; + server_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + keepalive_value = 0; + cleansession_value = 0; + + client_ptr-> nxd_mqtt_connect_notify = mqtt_connect_notify; + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + if (i < 2) + { + status = nxd_mqtt_client_connect(client_ptr, &server_address, NXD_MQTT_PORT, + keepalive_value, cleansession_value, 0); + +#ifndef NXD_MQTT_REQUIRE_TLS + if (status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#else + if (status != NXD_MQTT_CONNECT_FAILURE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif + } +#ifdef NX_SECURE_ENABLE + else + { + status = nxd_mqtt_client_secure_connect(client_ptr, &server_address, NXD_MQTT_PORT, + client_tls_setup, + keepalive_value, cleansession_value, 0); + + if (status != NX_IN_PROGRESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + { + + /* Wait for connecting. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check connected flag. */ + if (connected == NX_FALSE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nxd_mqtt_client_disconnect(client_ptr); + } + + tx_semaphore_put(&semaphore_client_stop); + } + nxd_mqtt_client_delete(client_ptr); + + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UCHAR content[100]; +static UCHAR fixed_header[] = {0x10, 0x00, 0x00, 0x04, 'M', 'Q', 'T', 'T', 0x4, 0x0, 0x0, 0x0}; +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, /* HTTP/1.1 101 Swi */ +0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, /* tching Protocols */ +0x0d, 0x0a, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, 0x57, 0x65, 0x62, 0x53, 0x6f, /* ..Upgrade: WebSo */ +0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, /* cket..Connection */ +0x3a, 0x20, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, 0x53, 0x65, 0x63, 0x2d, 0x57, /* : Upgrade..Sec-W */ +0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, /* ebSocket-Accept: */ +0x20, 0x64, 0x4f, 0x32, 0x68, 0x36, 0x5a, 0x4c, 0x46, 0x33, 0x71, 0x54, 0x74, 0x4d, 0x48, 0x7a, /* dO2h6ZLF3qTtMHz */ +0x47, 0x4b, 0x69, 0x59, 0x76, 0x53, 0x52, 0x45, 0x57, 0x6a, 0x76, 0x55, 0x3d, 0x0d, 0x0a, 0x53, /* GKiYvSREWjvU=..S */ +0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2d, 0x50, 0x72, 0x6f, /* ec-WebSocket-Pro */ +0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, 0x6d, 0x71, 0x74, 0x74, 0x0d, 0x0a, 0x0d, 0x0a, /* tocol: mqtt.... */ +}; + + +static UINT _server_connect_response_process(NX_PACKET *packet_ptr) +{ +UCHAR *buffer_ptr; +UINT offset = 0; +UCHAR *field_name; +UINT field_name_length; +UCHAR *field_value; +UINT field_value_length; +NX_SHA1 SH; +UCHAR digest[TEST_CONNECT_DIGEST_SIZE]; + + buffer_ptr = packet_ptr -> nx_packet_prepend_ptr; + + /* Skip over the first Command line (GET /xxx HTTP/1.1\r\n). */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && + (*buffer_ptr != '\r') && (*(buffer_ptr + 1) != '\n')) + { + buffer_ptr++; + offset++; + } + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Skip over the first Host line (Host: xxx\r\n). */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && + (*buffer_ptr != '\r') && (*(buffer_ptr + 1) != '\n')) + { + buffer_ptr++; + offset++; + } + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Loop until we find the "cr,lf,cr,lf" token. */ + while (((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != 0)) + { + + /* Check for the token. This signals a blank line, which also + specifies the start of the content. */ + if ((*buffer_ptr == '\r') && + (*(buffer_ptr + 1) == '\n')) + { + + /* Adjust the offset. */ + offset = offset + 2; + break; + } + + /* We haven't seen the so we are still processing header data. + Extract the field name and it's value. */ + field_name = buffer_ptr; + field_name_length = 0; + + /* Look for the ':' that separates the field name from its value. */ + while(*buffer_ptr != ':') + { + buffer_ptr++; + field_name_length++; + } + offset += field_name_length; + + /* Skip ':'. */ + buffer_ptr++; + offset++; + + /* Now skip over white space. */ + while ((buffer_ptr < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr == ' ')) + { + buffer_ptr++; + offset++; + } + + /* Now get the field value. */ + field_value = buffer_ptr; + field_value_length = 0; + + /* Loop until we see a . */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != '\r') && (*(buffer_ptr+1) != '\n')) + { + buffer_ptr++; + field_value_length++; + } + offset += field_value_length; + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Check the upgrade. */ + if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Upgrade", sizeof("Upgrade") - 1) == NX_SUCCESS) + { + if (_nx_websocket_client_name_compare((UCHAR *)field_value, field_value_length, (UCHAR *)"websocket", sizeof("websocket") - 1)) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + } + else if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Connection", sizeof("Connection") - 1) == NX_SUCCESS) + { + if (_nx_websocket_client_name_compare((UCHAR *)field_value, field_value_length, (UCHAR *)"Upgrade", sizeof("Upgrade") - 1)) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + } + else if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Sec-WebSocket-Key", sizeof("Sec-WebSocket-Key") - 1) == NX_SUCCESS) + { + + /* Calculate the SHA-1 hash of the concatenation of the client key and the Globally Unique Identifier (GUID) + Referenced in RFC 6455, Section 1.3, Page 6 */ + _nx_sha1_initialize(&SH); + _nx_sha1_update(&SH, field_value, field_value_length); + _nx_sha1_update(&SH, (UCHAR*)TEST_CONNECT_GUID, TEST_CONNECT_GUID_SIZE); + _nx_sha1_digest_calculate(&SH, digest); + + /* Set the last extra byte of the digest to be zero, since the function _nx_utility_base64_encode will use this byte for calculation */ + digest[20] = 0; + + /* Encode the hash and compare it with the field value from the server. */ + _nx_utility_base64_encode(digest, (TEST_CONNECT_DIGEST_SIZE - 1), connect_key, TEST_CONNECT_KEY_SIZE, &connect_key_size); + } + } + + /* Check if the all fields are processed. */ + if (offset != packet_ptr -> nx_packet_length) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + + return(NX_SUCCESS); +} + +/* This thread acts as MQTT server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UCHAR *buffer_ptr; +UINT i, j; +UINT length; +UINT packet_count; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, NXD_MQTT_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + tx_thread_resume(&ntest_0); + + for (i = 0; i < TEST_LOOP; i++) + { + + tx_semaphore_put(&semaphore_server_start); + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + status = nx_secure_tls_session_start(&tls_server_session, &server_socket, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + tx_thread_sleep(1); + + /* Receive websocket connect. */ + if (i < 2) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Get connect_key. */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[97], connect_key, 28); + nx_packet_release(packet_ptr); + + if (i % 2 == 0) + { + packet_count = 1; + } + else + { + packet_count = 3; + } + + buffer_ptr = server_switch_101; + for (j = 0; j < packet_count; j++) + { + + if ((packet_count == 3) && (j < 2)) + { + length = 50; + } + else + { + length = sizeof(server_switch_101) - 50 * j; + } + + if (i < 2) + { + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#ifdef NX_SECURE_ENABLE + else + { + + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Append response 101. */ + status = nx_packet_data_append(packet_ptr, buffer_ptr, length, &pool_0, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Send websocket connect response. */ + if (i < 2) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + buffer_ptr += length; + } + + /* Receive MQTT connect. */ + if (i < 2) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + } +#endif + + if (status) + { +#ifdef NXD_MQTT_REQUIRE_TLS + if (i >= 2) +#endif + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + { + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + nx_packet_release(packet_ptr); + status = nx_secure_tls_packet_allocate(&tls_server_session, &pool_0, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } +#endif + + /* Response with SUCCESS */ + buffer_ptr = packet_ptr->nx_packet_prepend_ptr; + buffer_ptr[0] = 0x82; + buffer_ptr[1] = 0x04; + buffer_ptr[2] = 0x20; + buffer_ptr[3] = 0x02; + buffer_ptr[4] = 0; + buffer_ptr[5] = 0; + + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + 6; + packet_ptr->nx_packet_length = 6; + + if (i < 2) + { + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_IP_PERIODIC_RATE); + } +#ifdef NX_SECURE_ENABLE + else + { + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + } +#endif + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + if (i >= 2) + { + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); + } +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Prepare to accept another connection. */ + status = nx_tcp_server_socket_relisten(&ip_1, NXD_MQTT_PORT, &server_socket); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + +#ifdef NX_SECURE_ENABLE + /* Delete the session. */ + nx_secure_tls_session_delete(&tls_server_session); +#endif + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, NXD_MQTT_PORT); + + /* Check for error. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + + +static void mqtt_connect_notify(struct NXD_MQTT_CLIENT_STRUCT *client_ptr, UINT status, VOID *context) +{ + + /* Check status. */ + if (status == NXD_MQTT_SUCCESS) + { + connected = NX_TRUE; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_mqtt_websocket_non_block_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: MQTT Websocket Non Block Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c b/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c new file mode 100644 index 00000000..fb83e00a --- /dev/null +++ b/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c @@ -0,0 +1,554 @@ + +/* This NetX test concentrates on the NAT TCP operation and + the NX_NAT_NON_TCP_SESSION_TIMEOUT and NX_NAT_TCP_SESSION_TIMEOUT + expirations. This test verifies the entries are removed when + the table checks for expired entries. + + Note that NX_NAT_ENABLE_REPLACEMENT is not necessary for this test. + +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_nat.h" + +extern void test_control_return(UINT status); + +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) + + +#define DEMO_STACK_SIZE 2048 + +static UINT error_counter = 0; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET tcp_socket; +NX_UDP_SOCKET udp_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. Should be 5 entries. */ +#define NX_NAT_ENTRY_CACHE_SIZE 148 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +#define CONNECT_PEER_PORT 0x89 +#define CONNECT_LOCAL_PORT 0x69 + +/* Set up counters */ +static UINT found_entries = 0; +static UINT removed_entries = 0; +static UINT time_lapse = 0; + +/* This is based on the NAT Non TCP Session default timeout of 120 ticks + and TCP Session timeout of 300 ticks for regression testing. */ +#define TIME_SLICE 25 + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define thread prototypes. */ +static void thread_client_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_entry_removed_after_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the first client thread. */ + tx_thread_create(&thread_client, "client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&local_ip); + status += nx_icmp_enable(&local_ip); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void thread_client_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +UINT peer_port; +UINT local_port; +UINT found; +NX_PACKET *my_packet; +UINT time_to_search; +NX_NAT_TRANSLATION_ENTRY search_entry; +NX_NAT_TRANSLATION_ENTRY *entry_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: NAT Remove Expired_Entries Test.............................\n"); + + /* Check error status on set up. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + /* Create a TCP local socket. */ + status = nx_tcp_socket_create(&local_ip, &tcp_socket, "TCP Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP local socket. */ + status = nx_udp_socket_create(&local_ip, &udp_socket, "UDP Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + peer_port = CONNECT_PEER_PORT; + local_port = CONNECT_LOCAL_PORT; + + /* Iterate enough time for all three entries to expire. */ + for (i = 0; i < 8; i++) + { + + /* Check if we have found 3 expired entries in the NAT table. */ + if (found_entries == 3) + { + break; + } + + /* Fill up NAT table for 4 different entries. */ + + if ((i == 1) || (i == 0)) + { + + /* Bind the UDP socket to a new local port. */ + status = nx_udp_socket_bind(&udp_socket, local_port, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + error_counter++; + break; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + error_counter++; + break; + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet to a different peer port. */ + status = nx_udp_socket_send(&udp_socket, my_packet, NX_NAT_EXTERNAL_HOST, peer_port); + + /* Check status. */ + if (status) + { + + error_counter++; + break; + } + + status = nx_udp_socket_unbind(&udp_socket); + + /* Check status. */ + if (status) + { + + error_counter++; + break; + } + + tx_thread_sleep(2*TIME_SLICE); + + } + else if (i == 2) + { + + /* Bind the socket to the next highest local port from the last entry in the table. */ + status = nx_tcp_client_socket_bind(&tcp_socket, local_port, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Attempt to connect the socket to the external host on a destination port higher than the last entry in the table. */ + status = nx_tcp_client_socket_connect(&tcp_socket, NX_NAT_EXTERNAL_HOST, peer_port, TIME_SLICE); // jlc use symbols + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&tcp_socket); + + /* Check for error. */ + if (status) + { + /* If an error, abort test. */ + error_counter++; + break; + } + + tx_thread_sleep(TIME_SLICE); + + } + else + { + + /* Just wait for another entry to expire. */ + tx_thread_sleep(2*TIME_SLICE); + + } + + /* Check if we have an entry timeout */ + time_lapse = tx_time_get(); + time_to_search = NX_TRUE; + + /* Check if the TCP entry has expired. */ + if (time_lapse >= ((2*TIME_SLICE)*2 + NX_NAT_TCP_SESSION_TIMEOUT)) + { + /* The TCP entry should have expired. */ + search_entry.protocol = NX_PROTOCOL_TCP; + search_entry.local_port = CONNECT_LOCAL_PORT+2; + search_entry.peer_port = CONNECT_PEER_PORT+2; + } + /* Check if the second UDP entry has expired. Ignore if it has already + expired and been removed.*/ + else if ((time_lapse >= (2*TIME_SLICE + NX_NAT_NON_TCP_SESSION_TIMEOUT) && + found_entries == 1)) + { + + /* Second UDP entry should be expired. */ + search_entry.protocol = NX_PROTOCOL_UDP; + search_entry.local_port = CONNECT_LOCAL_PORT+1; + search_entry.peer_port = CONNECT_PEER_PORT+1; + } + + /* Check if the first UDP entry has expired. Ignore if it + has already expired and been removed. */ + else if ((time_lapse > NX_NAT_NON_TCP_SESSION_TIMEOUT) && + (found_entries == 0)) + { + + /* First TCP entry should be expired. */ + search_entry.protocol = NX_PROTOCOL_UDP; + search_entry.local_port = CONNECT_LOCAL_PORT; + search_entry.peer_port = CONNECT_PEER_PORT; + } + else + { + + /* No entries expired in this loop iteration. */ + time_to_search = NX_FALSE; + } + + /* Do we expect an entry expiration*/ + if (time_to_search) + { + + /* Yes, search for this entry in the table. */ + + /* Fill in the rest of the record with addresses. */ + search_entry.local_ip_address = NX_NAT_LOCAL_HOST1; + search_entry.peer_ip_address = NX_NAT_EXTERNAL_HOST; + + /* Get the start of the NAT list of dynamic entries. */ + entry_ptr = nat_server.nx_nat_dynamic_active_entry_head; + + found = NX_FALSE; + + /* Search the whole table until a match is found. */ + while (entry_ptr) + { + + /* Do sender and entry protocols match? */ + if ((search_entry.protocol == entry_ptr -> protocol) && + (search_entry.peer_ip_address == entry_ptr -> peer_ip_address) && + (search_entry.peer_port == entry_ptr -> peer_port) && + (search_entry.local_ip_address == entry_ptr -> local_ip_address) && + (search_entry.local_port == entry_ptr -> local_port)) + { + + /* We have a matching entry. */ + found_entries++; + found = NX_TRUE; + break; + } + + entry_ptr = entry_ptr -> next_entry_ptr; + } + + /* If not found, the test failed. */ + if (!found) + { + error_counter++; + break; + } + + /* Send a ping so we force NAT to check the table for expired entries. */ + nx_icmp_ping(&local_ip, NX_NAT_EXTERNAL_HOST + i, "ABC", 3, &my_packet, 1); + + /* Get the start of the NAT list of dynamic entries. */ + entry_ptr = nat_server.nx_nat_dynamic_active_entry_head; + + found = NX_FALSE; + + /* Search the table again to verify the entry is removed. */ + while (entry_ptr) + { + + /* Do search and entry protocols match? */ + if ((search_entry.protocol == entry_ptr -> protocol) && + (search_entry.peer_ip_address == entry_ptr -> peer_ip_address) && + (search_entry.peer_port == entry_ptr -> peer_port) && + (search_entry.local_ip_address == entry_ptr -> local_ip_address) && + (search_entry.local_port == entry_ptr -> local_port)) + { + + /* We have a matching entry. */ + found = NX_TRUE; + break; + } + + entry_ptr = entry_ptr -> next_entry_ptr; + } + + /* If found, the test failed, the entry was not removed. */ + if (found) + { + error_counter++; + break; + } + else + { + removed_entries++; + } + } + + if (i < 3) + { + + /* Increment the connection port only if we are still adding entries. */ + local_port ++; + peer_port ++; + } + } + + /* All three of the original UDP and TCP entries should have been found removed. */ + while (found_entries < 3) + { + error_counter++; + } + + /* Final check on error status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_entry_removed_after_timeout_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT Remove Expired_Entries Test...........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_icmp_test.c b/test/regression/nat_test/netx_nat_icmp_test.c new file mode 100644 index 00000000..243c7219 --- /dev/null +++ b/test/regression/nat_test/netx_nat_icmp_test.c @@ -0,0 +1,492 @@ + +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_PACKET_POOL nat_packet_pool; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_icmp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_icmp_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UINT error_counter = 0; +UCHAR *pointer; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ICMP. */ + nx_icmp_enable(&nat_ip); + nx_icmp_enable(&local_ip); + nx_icmp_enable(&external_ip); + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: NAT ICMP Processing Test.................................."); + + /* Local IP ping NAT Local address. */ + status = nx_icmp_ping(&local_ip, NX_NAT_LOCAL_IPADR, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&local_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 0) || (nat_server.forwarded_packets_sent != 0) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Local IP ping External Host address. */ + status = nx_icmp_ping(&local_ip, NX_NAT_EXTERNAL_HOST, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&local_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 0) || (nat_server.forwarded_packets_sent != 0) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* External IP ping NAT External address. */ + status = nx_icmp_ping(&external_ip, NX_NAT_EXTERNAL_IPADR, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&external_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 0) || (nat_server.forwarded_packets_sent != 0) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + /* Local IP ping External Host address. */ + status = nx_icmp_ping(&local_ip, NX_NAT_EXTERNAL_HOST, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&local_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 3) || (ping_responses_received != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 2) || (nat_server.forwarded_packets_sent != 2) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* External IP ping NAT External address. */ + status = nx_icmp_ping(&external_ip, NX_NAT_EXTERNAL_IPADR, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&external_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 2) || (ping_responses_received != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 3) || (nat_server.forwarded_packets_sent != 2) ||(nat_server.forwarded_packets_dropped != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Calling NAT API to preload a static entry. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_icmp, NX_NAT_LOCAL_HOST1, 0, 0, NX_PROTOCOL_ICMP); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* External IP ping NAT External address. */ + status = nx_icmp_ping(&external_ip, NX_NAT_EXTERNAL_IPADR, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&external_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 3) || (ping_responses_received != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 5) || (nat_server.forwarded_packets_sent != 4) ||(nat_server.forwarded_packets_dropped != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_icmp_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT ICMP Processing Test..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_invalid_header_test.c b/test/regression/nat_test/netx_nat_invalid_header_test.c new file mode 100644 index 00000000..0b59d57e --- /dev/null +++ b/test/regression/nat_test/netx_nat_invalid_header_test.c @@ -0,0 +1,489 @@ + +/* This NetX test concentrates on the UCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_UDP_SOCKET local_socket; +NX_UDP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_udp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_invalid_header_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP instance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP instance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP instance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&nat_ip); + status += nx_udp_enable(&local_ip); + status += nx_udp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: NAT Invalid Header Test..................................."); + + /* Create a UDP local socket. */ + status = nx_udp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port 0x88. */ + status = nx_udp_socket_bind(&local_socket, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP External socket. */ + status = nx_udp_socket_create(&external_ip, &external_socket, "External Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Bind the UDP socket to the IP port 0x89. */ + status = nx_udp_socket_bind(&external_socket, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + advanced_packet_process_callback = packet_process; + + /***********************************************************************/ + /* External Socket sends udp packet to Local Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&external_socket, my_packet, NX_NAT_EXTERNAL_IPADR, 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP local socket. */ + status = nx_udp_socket_unbind(&local_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP Local socket. */ + status = nx_udp_socket_delete(&local_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP external socket. */ + status = nx_udp_socket_unbind(&external_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP external socket. */ + status = nx_udp_socket_delete(&external_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check invalid packet release. */ + if (nat_packet_pool.nx_packet_pool_invalid_releases != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_IPV4_HEADER *ip_header_ptr; +ULONG ip_header_length; +ULONG checksum; +ULONG val; + + if ((ip_ptr != &external_ip) || (packet_ptr -> nx_packet_length < 30)) + { + + /* Not the target packet. */ + return NX_TRUE; + } + + /* Trim the packet length to be less than UDP header. */ + /* Adjust the append pointer and length. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 27; + packet_ptr -> nx_packet_length = 27; + + /* Get the IPv4 header. */ + ip_header_ptr = (NX_IPV4_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + ip_header_ptr -> nx_ip_header_word_0 = ((ip_header_ptr -> nx_ip_header_word_0) & 0xFFFF0000) | 27; + ip_header_length = ((ip_header_ptr -> nx_ip_header_word_0 & NX_IP_LENGTH_MASK) >> 24) * sizeof(ULONG); + + /* Clear the checksum. */ + ip_header_ptr -> nx_ip_header_word_2 &= 0xFFFF0000; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + ip_header_length, + /* IPv4 header checksum does not use src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_invalid_header_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT Invalid Header Test...................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_tcp_fragment_test.c b/test/regression/nat_test/netx_nat_tcp_fragment_test.c new file mode 100644 index 00000000..4f60019d --- /dev/null +++ b/test/regression/nat_test/netx_nat_tcp_fragment_test.c @@ -0,0 +1,671 @@ + +/* This NetX test concentrates on the TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined (NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET local_socket; +NX_TCP_SOCKET external_socket; + +static UCHAR message[1024]; +static UCHAR buffer[1024]; + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_256, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_512); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_256, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_512, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status += nx_tcp_enable(&local_ip); + status += nx_tcp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Enable the fragment function. */ + status = nx_ip_fragment_enable(&nat_ip); + status += nx_ip_fragment_enable(&local_ip); + status += nx_ip_fragment_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +UINT data_size = 0; +ULONG bytes_copied; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: NAT TCP Fragment Processing Test.........................."); + + /* Clear the message. */ + for (i = 0; i < 1024; i ++) + message[i] = (UCHAR)rand(); + + /* Create a TCP local socket. */ + status = nx_tcp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port 0x88. */ + status = nx_tcp_client_socket_bind(&local_socket, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends tcp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&local_socket, NX_NAT_EXTERNAL_HOST, 0x89, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&local_socket, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &message[0], 400); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 400; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 400; + + /* Send the TCP packet. */ + status = nx_tcp_socket_send(&local_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Suspend thread to let peer socket receive the data. */ + tx_thread_suspend(&thread_0); + + /***********************************************************************/ + /* Local Socket receives the tcp packet from External Socket */ + /***********************************************************************/ + /* Loop to receive TCP message from the socket. */ + while(1) + { + + /* Receive packet. */ + status = nx_tcp_socket_receive(&local_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + + /* Retrieve the data. */ + status = nx_packet_data_retrieve(my_packet, &buffer[data_size], &bytes_copied); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the data size. */ + data_size += bytes_copied; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + else + { + break; + } + } + + /* Check for data size. */ + if (data_size != 800) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compare the data. */ + if (memcmp(buffer, &message[0], 800)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&local_socket, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +UINT data_size = 0; +ULONG bytes_copied; +NX_PACKET *my_packet; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&external_ip, &external_socket, "External Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket receives the tcp packet from Local Socket */ + /***********************************************************************/ + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&external_ip, 0x89, &external_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&external_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to receive TCP message from the socket. */ + while(1) + { + + /* Receive packet. */ + status = nx_tcp_socket_receive(&external_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + + /* Retrieve the data. */ + status = nx_packet_data_retrieve(my_packet, &buffer[data_size], &bytes_copied); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the data size. */ + data_size += bytes_copied; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + else + { + break; + } + } + + /* Check for data size. */ + if (data_size != 400) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compare the data. */ + if (memcmp(buffer, &message[0], 400)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Resume thread 0 to receive data. */ + tx_thread_resume(&thread_0); + + /***********************************************************************/ + /* External Socket sends tcp packet to Local Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &message[0], 800); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 800; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 800; + + /* Send the TCP packet. */ + status = nx_tcp_socket_send(&external_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&external_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&external_ip, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT TCP Fragment Processing Test..........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_tcp_port_test.c b/test/regression/nat_test/netx_nat_tcp_port_test.c new file mode 100644 index 00000000..186c7cdb --- /dev/null +++ b/test/regression/nat_test/netx_nat_tcp_port_test.c @@ -0,0 +1,639 @@ + +/* This NetX test concentrates on the TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET local_socket; +NX_TCP_SOCKET nat_socket; +NX_TCP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp1; +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp2; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_port_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status += nx_tcp_enable(&local_ip); + status += nx_tcp_enable(&nat_ip); + status += nx_tcp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + + /* Print out test information banner. */ + printf("NetX Test: NAT TCP Port Processing Test.............................."); + + /* Create a TCP socket for NAT IP instance. */ + status = nx_tcp_socket_create(&nat_ip, &nat_socket, "NAT Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port as NX_NAT_START_TCP_PORT. */ + status = nx_tcp_client_socket_bind(&nat_socket, NX_NAT_START_TCP_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Preload a NAT entry with same external TCP port of NAT socket. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_tcp1, NX_NAT_LOCAL_HOST1, NX_NAT_START_TCP_PORT, NX_NAT_START_TCP_PORT, NX_PROTOCOL_TCP); + + /* Check status. */ + if (status != NX_NAT_PORT_UNAVAILABLE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Preload a NAT entry with different external TCP port of NAT socket. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_tcp1, NX_NAT_LOCAL_HOST1, NX_NAT_START_TCP_PORT - 1, NX_NAT_START_TCP_PORT, NX_PROTOCOL_TCP); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Preload a NAT entry with same external TCP port of NAT entry. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_tcp2, NX_NAT_LOCAL_HOST1, NX_NAT_START_TCP_PORT - 1, NX_NAT_START_TCP_PORT, NX_PROTOCOL_TCP); + + /* Check status. */ + if (status != NX_NAT_PORT_UNAVAILABLE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the inbound entry. */ + status = nx_nat_inbound_entry_delete(&nat_server, &server_inbound_entry_tcp1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP local socket. */ + status = nx_tcp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port 0x88. */ + status = nx_tcp_client_socket_bind(&local_socket, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends tcp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&local_socket, NX_NAT_EXTERNAL_HOST, 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&local_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the TCP packet. */ + status = nx_tcp_socket_send(&local_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&local_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&local_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 8) || (nat_server.forwarded_packets_sent != 8) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG peer_ip_address; +ULONG peer_port; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&external_ip, &external_socket, "External Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&external_ip, 0x89, &external_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&external_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the peer socket port. */ + status = nx_tcp_socket_peer_info_get(&external_socket, &peer_ip_address, &peer_port); + + /* Check status. */ + if ((status) || (peer_ip_address != NX_NAT_EXTERNAL_IPADR) || (peer_port != NX_NAT_START_TCP_PORT + 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&external_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&external_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&external_ip, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_port_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT TCP Port Processing Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_tcp_port_test2.c b/test/regression/nat_test/netx_nat_tcp_port_test2.c new file mode 100644 index 00000000..d1abaa7c --- /dev/null +++ b/test/regression/nat_test/netx_nat_tcp_port_test2.c @@ -0,0 +1,640 @@ + +/* This NetX test concentrates on the TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET local_socket; +NX_TCP_SOCKET nat_socket; +NX_TCP_SOCKET nat_socket_1; +NX_TCP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp1; +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp2; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_port_test2_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status += nx_tcp_enable(&local_ip); + status += nx_tcp_enable(&nat_ip); + status += nx_tcp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + + /* Print out test information banner. */ + printf("NetX Test: NAT TCP Port Processing Test2............................."); + + /* Preload a NAT entry. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_tcp1, NX_NAT_LOCAL_HOST1, NX_NAT_START_TCP_PORT, NX_NAT_START_TCP_PORT, NX_PROTOCOL_TCP); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket for NAT IP instance. */ + status = nx_tcp_socket_create(&nat_ip, &nat_socket, "NAT Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port as NX_NAT_START_TCP_PORT. */ + status = nx_tcp_client_socket_bind(&nat_socket, NX_NAT_START_TCP_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_PORT_UNAVAILABLE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port as NX_NAT_START_TCP_PORT. */ + status = nx_tcp_client_socket_bind(&nat_socket, NX_NAT_START_TCP_PORT + 1, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&nat_ip, &nat_socket_1, "NAT Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&nat_ip, NX_NAT_START_TCP_PORT, &nat_socket_1, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_DUPLICATE_LISTEN) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP local socket. */ + status = nx_tcp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port 0x88. */ + status = nx_tcp_client_socket_bind(&local_socket, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends tcp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&local_socket, NX_NAT_EXTERNAL_HOST, 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&local_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the TCP packet. */ + status = nx_tcp_socket_send(&local_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&local_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&local_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 8) || (nat_server.forwarded_packets_sent != 8) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG peer_ip_address; +ULONG peer_port; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&external_ip, &external_socket, "External Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&external_ip, 0x89, &external_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&external_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the peer socket port. */ + status = nx_tcp_socket_peer_info_get(&external_socket, &peer_ip_address, &peer_port); + + /* Check status. */ + if ((status) || (peer_ip_address != NX_NAT_EXTERNAL_IPADR) || (peer_port != NX_NAT_START_TCP_PORT + 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&external_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&external_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&external_ip, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_port_test2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT TCP Port Processing Test2.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_tcp_remove_oldest_udp_entry_test.c b/test/regression/nat_test/netx_nat_tcp_remove_oldest_udp_entry_test.c new file mode 100644 index 00000000..38bcb820 --- /dev/null +++ b/test/regression/nat_test/netx_nat_tcp_remove_oldest_udp_entry_test.c @@ -0,0 +1,618 @@ + +/* This NetX test concentrates on the NAT TCP operation and + NX_NAT_ENABLE_REPLACMENT feature. This test creates five + test cases where the NAT table is manually filled in with a variety of + non TCP and TCP entries. The non TCP response timeouts use the standard NAT timeout + defined by NX_NAT_NON_TCP_SESSION_TIMEOUT. The TCP timeouts use the extended timeout + NX_NAT_TCP_SESSION_TIMEOUT. None of the entries should timeout. + + Once the table is filled, the TCP client attempts to make a connection on a + new port to an external host (we don't create the TCP server). + The outbound SYN packet will require an entry for this outbound packet. + + The success case is if NAT removes the oldest non TCP entry and inerts the new + TCP entry at the head of the list. + + Each test case varies with respect to where the oldest entry is to verify + that the removal of the link leaves the remaining entries properly linked + and the NAT available list parameters updated. + +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_nat.h" + +extern void test_control_return(UINT status); + +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && defined NX_NAT_ENABLE_REPLACMENT + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static UINT error_counter = 0; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET local_socket; +NX_TCP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT table size large enough for 5 entries. */ +#define NX_NAT_ENTRY_CACHE_SIZE 148 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +#define CONNECT_PEER_PORT 0x89 +#define CONNECT_LOCAL_PORT 0x69 + +static void *dynamic_cache_ptr; +static UINT dynamic_entries; + + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static UINT add_nat_entry(UINT protocol, ULONG local_ip_address , ULONG peer_ip_address , UINT local_port, UINT peer_port, ULONG response_timeout, UINT timestamp); + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_remove_oldest_udp_entry_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the first client thread. */ + tx_thread_create(&thread_client, "client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&local_ip); + status += nx_icmp_enable(&local_ip); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + dynamic_cache_ptr = (void **) pointer; + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void thread_client_entry(ULONG thread_input) +{ + +UINT status; +UINT temp1, temp2, oldest_local_port; +UINT i, j; +ULONG timeout = NX_NAT_NON_TCP_SESSION_TIMEOUT; +UINT peer_port; +UINT local_port; +ULONG local_ip_address; +ULONG peer_ip_address; +UINT protocol; +UINT timestamp; +UINT found; +NX_NAT_TRANSLATION_ENTRY search_entry; +NX_NAT_TRANSLATION_ENTRY *entry_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: NAT TCP Remove Oldest UDP Entry Test........................"); + + /* Check error status on set up. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + /* Create a TCP local socket. */ + status = nx_tcp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + temp1 = tx_time_get(); + for (j = 0; j < 4; j++) + { + + /* Fill up NAT table for 4 different test cases. */ + + /* Starting parameters for entries we will add directly: */ + timeout = NX_NAT_NON_TCP_SESSION_TIMEOUT; + protocol= NX_PROTOCOL_TCP; + peer_port = CONNECT_PEER_PORT; + local_port = CONNECT_LOCAL_PORT; + peer_ip_address = NX_NAT_EXTERNAL_IPADR; + local_ip_address = NX_NAT_LOCAL_HOST1; + + /* Add 5 entries to the table for each test case. */ + for (i = 0; i < 5; i++) + { + + switch (j) + { + + case 0: + /* Oldest UDP entry the next entry after the dynamic list head. */ + { + if ((i != 2) && (i != 4)) + { + /* Add a few long timeouts. */ + timeout = NX_NAT_NON_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_UDP; + timestamp = 10 - i; + } + else + { + timeout = NX_NAT_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_TCP; + timestamp = i; + } + + /* Oldest_entry = 3; */ + if (i == 3) + { + oldest_local_port = local_port; + } + + break; + } + case 1: + /* Oldest UDP entry is the tail of the dynamic list */ + { + if ((i != 2) && (i != 4)) + { + /* Add a few long timeouts. */ + timeout = NX_NAT_NON_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_UDP; + timestamp = i; + } + else + { + timeout = NX_NAT_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_TCP; + timestamp = 10 - i; + } + + /* Oldest_entry = 0; */ + if (i == 0) + { + oldest_local_port = local_port; + } + /* Now add in the elapsed time. */ + timestamp += temp2 - temp1; + + break; + } + case 2: + /* Oldest UDP entry is the head of the dynamic list */ + { + if ((i != 2) && (i != 4)) + { + /* Add a few long timeouts. */ + timeout = NX_NAT_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_TCP; + timestamp = i; + } + else + { + timeout = NX_NAT_NON_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_UDP; + timestamp = 10 - i; + } + + /* Oldest_entry = 4; */ + if (i == 4) + { + oldest_local_port = local_port; + } + /* Now add in the elapsed time. */ + timestamp += temp2 - temp1; + + break; + } + case 3: + /* Oldest UDP entry is in the middle of the list */ + { + + if ((i != 2) && (i != 3)) + { + /* Add a few long timeouts. */ + timeout = NX_NAT_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_TCP; + timestamp = i; + } + else + { + timeout = NX_NAT_NON_TCP_SESSION_TIMEOUT; + protocol = NX_PROTOCOL_UDP; + + /* Throw in an ICMP entry. */ + if (i == 2) + { + protocol = NX_PROTOCOL_ICMP; + } + + timestamp = 10 - i; + } + + /* Oldest_entry = 3; */ + if (i == 3) + { + oldest_local_port = local_port; + } + + /* Now add in the elapsed time. */ + timestamp += temp2 - temp1; + break; + } + default: + { + break; + } + } + + status = add_nat_entry(protocol, local_ip_address , peer_ip_address , local_port, peer_port, timeout, timestamp); + if (status) + { + error_counter++; + } + + local_port ++; + peer_port ++; + } + + /* Make sure our timestamps are less than the current time! */ + tx_thread_sleep(50); + + /* Assign separate ports for another TCP Connection */ + local_port += 100; + peer_port += 100; + + /* Bind the socket to a local port. */ + status = nx_tcp_client_socket_bind(&local_socket, local_port, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Attempt to connect the socket to the external host on a destination port higher than the last entry in the table. */ + status = nx_tcp_client_socket_connect(&local_socket, NX_NAT_EXTERNAL_HOST, peer_port, 20); + + /* Create the translation record to find in the NAT table. This should + correspond to the TCP connection attemp (SYN packet outbound). */ + memset(&search_entry, 0, sizeof(NX_NAT_TRANSLATION_ENTRY)); + search_entry.protocol = NX_PROTOCOL_TCP; + search_entry.local_ip_address = NX_NAT_LOCAL_HOST1; + search_entry.peer_ip_address = NX_NAT_EXTERNAL_HOST; + search_entry.local_port = local_port; + search_entry.peer_port = peer_port; + + /* Get the start of the NAT list of dynamic entries. */ + entry_ptr = nat_server.nx_nat_dynamic_active_entry_head; + + found = NX_FALSE; + + /* Search the whole table until a match is found. */ + while (entry_ptr) + { + + /* Check if the oldest UDP entry has been removed. */ + if ((entry_ptr -> local_port == oldest_local_port) && (entry_ptr -> protocol == NX_PROTOCOL_UDP)) + { + error_counter++; + } + + /* Do sender and entry protocols match? */ + if ((search_entry.protocol == entry_ptr -> protocol) && + (search_entry.peer_ip_address == entry_ptr -> peer_ip_address) && + (search_entry.peer_port == entry_ptr -> peer_port) && + (search_entry.local_ip_address == entry_ptr -> local_ip_address) && + (search_entry.local_port == entry_ptr -> local_port)) + { + + /* We have a matching entry. */ + found = NX_TRUE; + } + + entry_ptr = entry_ptr -> next_entry_ptr; + } + + /* If not found, the test failed. */ + if (!found) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&local_socket); + + /* Check for error. */ + if (status) + { + + /* If an error, abort test. */ + error_counter++; + break; + } + + /* Check the active and available list parameters */ + if ((nat_server.nx_nat_dynamic_available_entry_head != NX_NULL) || + (nat_server.nx_nat_dynamic_available_entries != 0) || + (nat_server.nx_nat_dynamic_active_entries != 5)) + { + error_counter++; + } + + /* Clear the NAT table and table counters. */ + + /* Clear the entry cache. */ + memset((void *) dynamic_cache_ptr, 0, NX_NAT_ENTRY_CACHE_SIZE); + + /* Pickup starting address of the available entry list. */ + entry_ptr = (NX_NAT_TRANSLATION_ENTRY *) dynamic_cache_ptr; + + /* Determine how many NAT daynamic entries will fit in this cache area. */ + dynamic_entries = NX_NAT_ENTRY_CACHE_SIZE / sizeof(NX_NAT_TRANSLATION_ENTRY); + + /* Initialize the pointers of available NAT entries. */ + for (i = 0; i < (dynamic_entries - 1); i++) + { + /* Setup each entry to point to the next entry. */ + entry_ptr -> next_entry_ptr = entry_ptr + 1; + entry_ptr ++; + } + + /* Setup the head pointers of the available and dynamic (active) lists in the NAT Device. */ + nat_server.nx_nat_dynamic_available_entry_head = (NX_NAT_TRANSLATION_ENTRY *) dynamic_cache_ptr; + nat_server.nx_nat_dynamic_active_entry_head = NX_NULL; + nat_server.nx_nat_dynamic_available_entries = dynamic_entries; + nat_server.nx_nat_dynamic_active_entries = 0; + nat_server.nx_nat_static_active_entries = 0; + + temp2 = tx_time_get(); + + } /* Try the next test case */ + + /* Final check on error status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT external_port = 20000; + +static UINT add_nat_entry(UINT protocol, ULONG local_ip_address , ULONG peer_ip_address , UINT local_port, UINT peer_port, ULONG response_timeout, UINT timestamp) +{ + +NX_NAT_TRANSLATION_ENTRY *insert_entry_ptr; + + + external_port++; + + /* Get one available entry. */ + insert_entry_ptr = (nat_server.nx_nat_dynamic_available_entry_head); + + /* Update the entry head. */ + nat_server.nx_nat_dynamic_available_entry_head = insert_entry_ptr -> next_entry_ptr; + + /* Initialize the allocated memory to NULL. */ + memset(insert_entry_ptr, 0, sizeof(NX_NAT_TRANSLATION_ENTRY)); + + /* Assign the entry attributes. */ + insert_entry_ptr -> protocol = protocol; + insert_entry_ptr -> local_ip_address = local_ip_address; + insert_entry_ptr -> peer_ip_address = peer_ip_address; + insert_entry_ptr -> local_port = local_port; + insert_entry_ptr -> external_port = external_port; + insert_entry_ptr -> peer_port = peer_port; + insert_entry_ptr -> response_timeout = response_timeout; + + /* Set the entry timestamp. */ + insert_entry_ptr -> response_timestamp = timestamp; + + /* Set entry type to dynamically created. */ + insert_entry_ptr -> translation_type = NX_NAT_DYNAMIC_ENTRY; + + /* Update the table counters. */ + nat_server.nx_nat_dynamic_active_entries ++; + nat_server.nx_nat_dynamic_available_entries --; + + /* Add this entry onto the table entry list. */ + insert_entry_ptr -> next_entry_ptr = nat_server.nx_nat_dynamic_active_entry_head; + nat_server.nx_nat_dynamic_active_entry_head = insert_entry_ptr; + + return NX_SUCCESS; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_remove_oldest_udp_entry_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT TCP Remove Oldest UDP Entry Test......................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_tcp_test1.c b/test/regression/nat_test/netx_nat_tcp_test1.c new file mode 100644 index 00000000..90187752 --- /dev/null +++ b/test/regression/nat_test/netx_nat_tcp_test1.c @@ -0,0 +1,560 @@ + +/* This NetX test concentrates on the TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET local_socket; +NX_TCP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_test1_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status += nx_tcp_enable(&local_ip); + status += nx_tcp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + + /* Print out test information banner. */ + printf("NetX Test: NAT TCP Processing Test1.................................."); + + /* Create a TCP local socket. */ + status = nx_tcp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port 0x88. */ + status = nx_tcp_client_socket_bind(&local_socket, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&local_socket, NX_NAT_EXTERNAL_HOST, 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + /***********************************************************************/ + /* Local Socket sends tcp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&local_socket, NX_NAT_EXTERNAL_HOST, 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&local_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the TCP packet. */ + status = nx_tcp_socket_send(&local_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&local_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&local_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 8) || (nat_server.forwarded_packets_sent != 8) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&external_ip, &external_socket, "External Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket receives the tcp packet from Local Socket */ + /***********************************************************************/ + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&external_ip, 0x89, &external_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&external_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&external_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&external_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&external_ip, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_test1_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT TCP Processing Test1..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_tcp_test2.c b/test/regression/nat_test/netx_nat_tcp_test2.c new file mode 100644 index 00000000..6e963230 --- /dev/null +++ b/test/regression/nat_test/netx_nat_tcp_test2.c @@ -0,0 +1,573 @@ + +/* This NetX test concentrates on the TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_TCP_SOCKET local_socket; +NX_TCP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_tcp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_test2_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable TCP traffic. */ + status += nx_tcp_enable(&local_ip); + status += nx_tcp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + + /* Print out test information banner. */ + printf("NetX Test: NAT TCP Processing Test2.................................."); + + /* Create a TCP external socket. */ + status = nx_tcp_socket_create(&external_ip, &external_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket to the IP port 0x89. */ + status = nx_tcp_client_socket_bind(&external_socket, 0x89, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&external_socket, NX_NAT_EXTERNAL_IPADR, 0x88, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&external_socket, NX_NAT_EXTERNAL_IPADR, 0x88, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Calling NAT API to preload a static entry. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_tcp, NX_NAT_LOCAL_HOST1, 0x88, 0x88, NX_PROTOCOL_TCP); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends tcp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&external_socket, NX_NAT_EXTERNAL_IPADR, 0x88, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&external_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the TCP packet. */ + status = nx_tcp_socket_send(&external_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&external_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&external_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&external_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&local_ip, &local_socket, "External Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket receives the tcp packet from External Socket */ + /***********************************************************************/ + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&local_ip, 0x88, &local_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&local_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&local_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&local_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&local_ip, 0x88); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&local_socket); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_tcp_test2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT TCP Processing Test2..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_udp_fragment_test.c b/test/regression/nat_test/netx_nat_udp_fragment_test.c new file mode 100644 index 00000000..d426f346 --- /dev/null +++ b/test/regression/nat_test/netx_nat_udp_fragment_test.c @@ -0,0 +1,545 @@ + +/* This NetX test concentrates on the UCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined (NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_UDP_SOCKET local_socket; +NX_UDP_SOCKET external_socket; + +static UCHAR message[1024]; +static UCHAR buffer[1024]; + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_udp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_udp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_256, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_512); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_256, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_512, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&nat_ip); + status += nx_udp_enable(&local_ip); + status += nx_udp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Enable the fragment function. */ + status = nx_ip_fragment_enable(&nat_ip); + status += nx_ip_fragment_enable(&local_ip); + status += nx_ip_fragment_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: NAT UDP Fragment Processing Test.........................."); + + /* Create a UDP local socket. */ + status = nx_udp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port 0x88. */ + status = nx_udp_socket_bind(&local_socket, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP External socket. */ + status = nx_udp_socket_create(&external_ip, &external_socket, "External Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port 0x89. */ + status = nx_udp_socket_bind(&external_socket, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the message. */ + for (i = 0; i < 1024; i ++) + message[i] = (UCHAR)rand(); + + /***********************************************************************/ + /* Local Socket sends udp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &message[0], 400); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 400; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 400; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&local_socket, my_packet, NX_NAT_EXTERNAL_HOST, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Calling NAT API to preload a static entry. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_udp, NX_NAT_LOCAL_HOST1, 0x88, 0x88, NX_PROTOCOL_UDP); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket sends udp packet to Local Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &message[0], 800); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 800; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 800; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&external_socket, my_packet, NX_NAT_EXTERNAL_IPADR, 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG bytes_copied; +NX_PACKET *my_packet; + + + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&external_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status != NX_SUCCESS) || (my_packet -> nx_packet_length != 400)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Retrieve the data. */ + status = nx_packet_data_retrieve(my_packet, buffer, &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || (bytes_copied != 400)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compare the data. */ + if (memcmp(buffer, &message[0], 400)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket receives the udp packet from External Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&local_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status != NX_SUCCESS) || (my_packet ->nx_packet_length != 800)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Retrieve the data. */ + status = nx_packet_data_retrieve(my_packet, buffer, &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || (bytes_copied != 800)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compare the data. */ + if (memcmp(buffer, &message[0], 800)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_udp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT UDP Fragment Processing Test..........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_udp_port_test.c b/test/regression/nat_test/netx_nat_udp_port_test.c new file mode 100644 index 00000000..f733a8d4 --- /dev/null +++ b/test/regression/nat_test/netx_nat_udp_port_test.c @@ -0,0 +1,630 @@ + +/* This NetX test concentrates on the UCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_UDP_SOCKET local_socket; +NX_UDP_SOCKET nat_socket; +NX_UDP_SOCKET external_socket; +NX_UDP_SOCKET test_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_udp1; +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_udp2; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_udp_port_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&nat_ip); + status += nx_udp_enable(&local_ip); + status += nx_udp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out test information banner. */ + printf("NetX Test: NAT UDP Port Processing Test.............................."); + + /* Create a UDP local socket. */ + status = nx_udp_socket_create(&nat_ip, &nat_socket, "NAT Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port as NX_NAT_START_UDP_PORT. */ + status = nx_udp_socket_bind(&nat_socket, NX_NAT_START_UDP_PORT, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Preload a NAT entry with same external UDP port of local socket. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_udp1, NX_NAT_LOCAL_HOST1, NX_NAT_START_UDP_PORT, NX_NAT_START_UDP_PORT, NX_PROTOCOL_UDP); + + /* Check status. */ + if (status != NX_NAT_PORT_UNAVAILABLE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Preload a NAT entry with different external UDP port of local socket. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_udp1, NX_NAT_LOCAL_HOST1, NX_NAT_START_UDP_PORT - 1, NX_NAT_START_UDP_PORT, NX_PROTOCOL_UDP); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Preload a NAT entry with same external UDP port of NAT entry1. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_udp2, NX_NAT_LOCAL_HOST1, NX_NAT_START_UDP_PORT - 1, NX_NAT_START_UDP_PORT, NX_PROTOCOL_UDP); + + /* Check status. */ + if (status != NX_NAT_PORT_UNAVAILABLE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a UDP test socket. */ + status = nx_udp_socket_create(&nat_ip, &test_socket, "TEST Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the same external UDP port of NAT entry 1. NX_NAT_START_UDP_PORT - 1. */ + status = nx_udp_socket_bind(&test_socket, NX_NAT_START_UDP_PORT - 1, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_PORT_UNAVAILABLE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the test socket. */ + status = nx_udp_socket_delete(&test_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the inbound entry. */ + status = nx_nat_inbound_entry_delete(&nat_server, &server_inbound_entry_udp1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP local socket. */ + status = nx_udp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port 0x88. */ + status = nx_udp_socket_bind(&local_socket, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP External socket. */ + status = nx_udp_socket_create(&external_ip, &external_socket, "External Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Bind the UDP socket to the IP port 0x89. */ + status = nx_udp_socket_bind(&external_socket, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends udp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&local_socket, my_packet, NX_NAT_EXTERNAL_HOST, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 1) || (nat_server.forwarded_packets_sent != 1) ||(nat_server.forwarded_packets_dropped != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Get UDP Local socket information. */ + status = nx_udp_socket_info_get(&local_socket, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 1) || (bytes_sent != 28) || (packets_received != 0) || (bytes_received != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Check status. */ + if ((receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP nat socket. */ + status = nx_udp_socket_unbind(&nat_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP nat socket. */ + status = nx_udp_socket_delete(&nat_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP local socket. */ + status = nx_udp_socket_unbind(&local_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP Local socket. */ + status = nx_udp_socket_delete(&local_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP external socket. */ + status = nx_udp_socket_unbind(&external_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP external socket. */ + status = nx_udp_socket_delete(&external_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG peer_ip_address; +UINT peer_port; + + + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&external_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the peer socket port. */ + status = nx_udp_source_extract(my_packet, &peer_ip_address, &peer_port); + + /* Check status. */ + if ((status) || (peer_ip_address != NX_NAT_EXTERNAL_IPADR) || (peer_port != NX_NAT_START_TCP_PORT + 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_udp_port_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT UDP Port Processing Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/nat_test/netx_nat_udp_test.c b/test/regression/nat_test/netx_nat_udp_test.c new file mode 100644 index 00000000..cee0324c --- /dev/null +++ b/test/regression/nat_test/netx_nat_udp_test.c @@ -0,0 +1,817 @@ + +/* This NetX test concentrates on the UCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined NX_NAT_ENABLE && defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) +#include "nx_nat.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +/* Set up the NAT components. */ + +/* Create a NAT instance, packet pool and translation table. */ + +NX_PACKET_POOL nat_packet_pool; +NX_NAT_DEVICE nat_server; +NX_IP nat_ip; +NX_IP local_ip; +NX_IP external_ip; +NX_UDP_SOCKET local_socket; +NX_UDP_SOCKET external_socket; + + +/* Configure the NAT network parameters. */ + +/* Set NetX IP packet pool packet size. This should be less than the Maximum Transmit Unit (MTU) of + the driver (allow enough room for the Ethernet header plus padding bytes for frame alignment). */ +#define NX_NAT_PACKET_SIZE 1536 + + +/* Set the size of the NAT IP packet pool. */ +#define NX_NAT_PACKET_POOL_SIZE (NX_NAT_PACKET_SIZE * 10) + +/* Set NetX IP helper thread stack size. */ +#define NX_NAT_IP_THREAD_STACK_SIZE 2048 + +/* Set the server IP thread priority */ +#define NX_NAT_IP_THREAD_PRIORITY 2 + +/* Set ARP cache size of a NAT ip instance. */ +#define NX_NAT_ARP_CACHE_SIZE 1024 + +/* Set NAT entries memory size. */ +#define NX_NAT_ENTRY_CACHE_SIZE 1024 + +/* Define NAT IP addresses, local host private IP addresses and external host IP address. */ +#define NX_NAT_LOCAL_IPADR (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_HOST1 (IP_ADDRESS(192, 168, 2, 3)) +#define NX_NAT_LOCAL_HOST2 (IP_ADDRESS(192, 168, 2, 10)) +#define NX_NAT_LOCAL_GATEWAY (IP_ADDRESS(192, 168, 2, 1)) +#define NX_NAT_LOCAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) +#define NX_NAT_EXTERNAL_IPADR (IP_ADDRESS(192, 168, 0, 10)) +#define NX_NAT_EXTERNAL_HOST (IP_ADDRESS(192, 168, 0, 100)) +#define NX_NAT_EXTERNAL_GATEWAY (IP_ADDRESS(192, 168, 0, 1)) +#define NX_NAT_EXTERNAL_NETMASK (IP_ADDRESS(255, 255, 255, 0)) + +/* Create NAT structures for preloading NAT tables with static + entries for local server hosts. */ +NX_NAT_TRANSLATION_ENTRY server_inbound_entry_udp; + +/* Set up generic network driver for demo program. */ +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_udp_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; +UINT error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Setup the pointer to unallocated memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create NAT packet pool. */ + status = nx_packet_pool_create(&nat_packet_pool, "NAT Packet Pool", + NX_NAT_PACKET_SIZE, pointer, + NX_NAT_PACKET_POOL_SIZE); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_PACKET_POOL_SIZE; + + /* Check status. */ + if (status) + return; + + /* Create IP instances for NAT server (global network) */ + status = nx_ip_create(&nat_ip, "NAT IP Instance", NX_NAT_EXTERNAL_IPADR, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the private interface(private network). */ + status += nx_ip_interface_attach(&nat_ip, "Private Interface", NX_NAT_LOCAL_IPADR, NX_NAT_LOCAL_NETMASK, _nx_ram_network_driver_1500); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for Local network IP instance */ + status = nx_ip_create(&local_ip, "Local IP Instance", NX_NAT_LOCAL_HOST1, NX_NAT_LOCAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create IP instances for external network IP instance */ + status = nx_ip_create(&external_ip, "External IP Instance", NX_NAT_EXTERNAL_HOST, NX_NAT_EXTERNAL_NETMASK, + &nat_packet_pool, _nx_ram_network_driver_1500, pointer, + NX_NAT_IP_THREAD_STACK_SIZE, NX_NAT_IP_THREAD_PRIORITY); + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_IP_THREAD_STACK_SIZE; + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for NAT IP instance. */ + status = nx_ip_gateway_address_set(&nat_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for Local IP instance. */ + status = nx_ip_gateway_address_set(&local_ip, NX_NAT_LOCAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Set the global network gateway for External IP instance. */ + status = nx_ip_gateway_address_set(&external_ip, NX_NAT_EXTERNAL_GATEWAY); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + + /* Enable ARP and supply ARP cache memory for NAT IP isntance. */ + status = nx_arp_enable(&nat_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for Local IP isntance. */ + status = nx_arp_enable(&local_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable ARP and supply ARP cache memory for External IP isntance. */ + status = nx_arp_enable(&external_ip, (void **) pointer, + NX_NAT_ARP_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ARP_CACHE_SIZE; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&nat_ip); + status += nx_udp_enable(&local_ip); + status += nx_udp_enable(&external_ip); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Create a NetX NAT server and cache with a global interface index. */ + status = nx_nat_create(&nat_server, &nat_ip, 0, pointer, NX_NAT_ENTRY_CACHE_SIZE); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Update pointer to unallocated (free) memory. */ + pointer = pointer + NX_NAT_ENTRY_CACHE_SIZE; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out test information banner. */ + printf("NetX Test: NAT UDP Processing Test..................................."); + + /* Create a UDP local socket. */ + status = nx_udp_socket_create(&local_ip, &local_socket, "Local Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port 0x88. */ + status = nx_udp_socket_bind(&local_socket, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP External socket. */ + status = nx_udp_socket_create(&external_ip, &external_socket, "External Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Bind the UDP socket to the IP port 0x89. */ + status = nx_udp_socket_bind(&external_socket, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends udp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&local_socket, my_packet, NX_NAT_EXTERNAL_HOST, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket sends udp packet to Local Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&external_socket, my_packet, NX_NAT_EXTERNAL_IPADR, 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the NAT service. */ + nx_nat_enable(&nat_server); + + /***********************************************************************/ + /* Local Socket sends udp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&local_socket, my_packet, NX_NAT_EXTERNAL_HOST, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket sends udp packet to Local Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&external_socket, my_packet, NX_NAT_EXTERNAL_IPADR, 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Calling NAT API to preload a static entry. */ + status = nx_nat_inbound_entry_create(&nat_server, &server_inbound_entry_udp, NX_NAT_LOCAL_HOST1, 0x88, 0x88, NX_PROTOCOL_UDP); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket sends udp packet to External Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&local_socket, my_packet, NX_NAT_EXTERNAL_HOST, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* External Socket sends udp packet to Local Socket */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&nat_packet_pool, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&external_socket, my_packet, NX_NAT_EXTERNAL_IPADR, 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Check the NAT forwarded count. */ +#ifndef NX_DISABLE_NAT_INFO + if ((nat_server.forwarded_packets_received != 4) || (nat_server.forwarded_packets_sent != 3) ||(nat_server.forwarded_packets_dropped != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Get UDP Local socket information. */ + status = nx_udp_socket_info_get(&local_socket, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 3) || (bytes_sent != 3 * 28) || (packets_received != 1) || (bytes_received != 1 * 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Check status. */ + if ((receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP external socket information. */ + status = nx_udp_socket_info_get(&external_socket, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 3) || (bytes_sent != 3 * 28) || (packets_received != 2) || (bytes_received != 2 * 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Check status. */ + if ((receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP local socket. */ + status = nx_udp_socket_unbind(&local_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP Local socket. */ + status = nx_udp_socket_delete(&local_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP external socket. */ + status = nx_udp_socket_unbind(&external_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP external socket. */ + status = nx_udp_socket_delete(&external_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&external_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket receives the udp packet from External Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&local_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&external_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket receives the udp packet from External Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&local_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + /***********************************************************************/ + /* External Socket receives the udp packet from Local Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&external_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Local Socket receives the udp packet from External Socket */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&local_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nat_udp_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NAT UDP Processing Test...................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_101_17_test.c b/test/regression/netxduo_test/netx_101_17_test.c new file mode 100644 index 00000000..01e4b788 --- /dev/null +++ b/test/regression/netxduo_test/netx_101_17_test.c @@ -0,0 +1,282 @@ +/* 101.17 IW,the initial value of cwnd, MUST be less than or equal to 4*SMSS bytes and MUST NOT be more than 4 segments. */ +/* Page 4, RFC 5681. */ + +/* Procedure + 1.Connection successfully + 2.To check if sender's CWND > 2 * MSS */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#define DEMO_STACK_SIZE 2048 +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_101_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 101.17 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if((client_socket.nx_tcp_socket_tx_window_congestion > 4 * client_socket.nx_tcp_socket_connect_mss) || + (server_socket.nx_tcp_socket_tx_window_congestion > 4 * server_socket.nx_tcp_socket_connect_mss)) + { + error_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_101_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 101.17 Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_101_18_test.c b/test/regression/netxduo_test/netx_101_18_test.c new file mode 100644 index 00000000..51283af8 --- /dev/null +++ b/test/regression/netxduo_test/netx_101_18_test.c @@ -0,0 +1,398 @@ +/* 101.18 During slow start, a TCP increments cwnd by at most SMSS bytes for each ACK received that acknowledges new data. */ + +/* Procedure + 1.Connection successfully + 2.When receiving an ACK packet check if CWND <= present_cwnd + SMSS */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "----------abcdefgh20----------ABCDEFGH40----------klmnopqr60----------KLMNOPQR80--------------------" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; + +/* Save the original cwnd.. */ +static ULONG congestion_window; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_101_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_101_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Check whether the ACK packet is received. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_101_18; + + /* Save the original cwnd. */ + congestion_window = client_socket.nx_tcp_socket_tx_window_congestion; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 60, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Let the thread sleep for 1 second to wait for the ACK packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + congestion_window = client_socket.nx_tcp_socket_tx_window_congestion; + + /* Create the second tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG, 55, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Let the thread sleep for 1 second to wait for the ACK packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 2) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 101.18 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((packet_ptr -> nx_packet_length == 60) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, MSG, 60))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Let the thread sleep for 1 second to wait for the ACK packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((packet_ptr -> nx_packet_length == 55) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, MSG, 55))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Let the thread sleep for 1 second to wait for the ACK packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_101_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_counter++; + + /* Check whether the TCP increments cwnd by at most SMSS bytes for each ACK received that cumulatively acknowledges new data. */ + if(client_socket.nx_tcp_socket_tx_window_congestion > (congestion_window + client_socket.nx_tcp_socket_connect_mss)) + error_counter++; + + if(ack_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_101_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 101.18 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_102_18_test.c b/test/regression/netxduo_test/netx_102_18_test.c new file mode 100644 index 00000000..fcf2325e --- /dev/null +++ b/test/regression/netxduo_test/netx_102_18_test.c @@ -0,0 +1,325 @@ +/* 102.18 The TCP output routine never sends more than cwnd if cwnd less than the receiver's advertised window. */ + +/* Procedure + 1.Connect + 2.Client sends a packet with 100 length to server + 3.Server should receive two packet, one with 88 data and another with 12 data + (client's MSS is 88, advertised window is 100) */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG congestion_window; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + congestion_window = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +char *msg = MSG; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + client_socket.nx_tcp_socket_tx_window_congestion = server_socket.nx_tcp_socket_rx_window_last_sent - 10; + + congestion_window = client_socket.nx_tcp_socket_tx_window_congestion; + + + /* Allocate packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, msg, congestion_window+20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.18 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, NX_IP_PERIODIC_RATE)) + { + /* Check the length of the packet received. */ + if(rcv_packet_ptr->nx_packet_length <= congestion_window) + data_packet_counter++; + else + error_counter++; + } + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.18 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_102_19_test.c b/test/regression/netxduo_test/netx_102_19_test.c new file mode 100644 index 00000000..5f2bdf34 --- /dev/null +++ b/test/regression/netxduo_test/netx_102_19_test.c @@ -0,0 +1,309 @@ +/* 102.19 The TCP output routine never sends more than receiver's advertised window if receiver's advertised window less than the cwnd. */ + +/* Procedure + 1.Connect + 2.Client sends a packet with 100 length to Server + 3.Client should not send the packet out(client's MSS is 88, advertised window is 80) */ + +/* Question + If the packet length is bigger than advertised window, it will wait until advertised window is bigger than or equal to the packet length */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.19 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_rx_window_last_sent > server_socket.nx_tcp_socket_tx_window_congestion) + client_socket.nx_tcp_socket_rx_window_last_sent = server_socket.nx_tcp_socket_tx_window_congestion - 10; + + /* Allocate packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, client_socket.nx_tcp_socket_rx_window_last_sent + 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_NO_WAIT); + + if(status != NX_WINDOW_OVERFLOW) + error_counter++; + else + nx_packet_release(my_packet); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 80, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.19 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_102_20_test.c b/test/regression/netxduo_test/netx_102_20_test.c new file mode 100644 index 00000000..1588ca09 --- /dev/null +++ b/test/regression/netxduo_test/netx_102_20_test.c @@ -0,0 +1,451 @@ +/* 102.20 When congestion occurs, one-half of the current window size is saved in ssthresh. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; +static ULONG seq_number; +static ULONG ack_counter; +static ULONG duplicate_ack_counter; +static ULONG is_set; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_102_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_102_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + seq_number = 0; + duplicate_ack_counter = 0; + is_set = NX_FALSE; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.20 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_102_20; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_102_20; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG+20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet3, MSG+40, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet4, MSG+60, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + while(!(status = nx_tcp_socket_receive(&client_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE))) + { + + if((packet_ptr -> nx_packet_length == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (MSG + data_packet_counter * 20), 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 4) || (duplicate_ack_counter != 3) || (is_set != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_102_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + if((packet_ptr -> nx_packet_length-40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr+40, MSG, 20))) + { + if(server_socket.nx_tcp_socket_timeout_retries == 0) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + seq_number = tcp_header_ptr -> nx_tcp_sequence_number; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + else if(server_socket.nx_tcp_socket_timeout_retries == 1) + { + if((server_socket.nx_tcp_socket_tx_slow_start_threshold == server_socket.nx_tcp_socket_tx_outstanding_bytes / 2) || (server_socket.nx_tcp_socket_tx_slow_start_threshold == server_socket.nx_tcp_socket_connect_mss * 2)) + is_set = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + } + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_102_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr ->nx_tcp_acknowledgment_number == seq_number) + duplicate_ack_counter++; + + if(duplicate_ack_counter == 3) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.20 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_102_21_test.c b/test/regression/netxduo_test/netx_102_21_test.c new file mode 100644 index 00000000..698bb35a --- /dev/null +++ b/test/regression/netxduo_test/netx_102_21_test.c @@ -0,0 +1,451 @@ +/* 102.21 When congestion occurs, one-half of the current window size, but at least 2 segments is saved in ssthresh. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; +static ULONG seq_number; +static ULONG ack_counter; +static ULONG duplicate_ack_counter; +static ULONG is_set; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_102_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_102_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + seq_number = 0; + duplicate_ack_counter = 0; + is_set = NX_FALSE; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.21 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_102_21; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_102_21; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG+20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet3, MSG+40, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet4, MSG+60, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + while(!(status = nx_tcp_socket_receive(&client_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE))) + { + + if((packet_ptr -> nx_packet_length == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (MSG + data_packet_counter * 20), 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 4) || (duplicate_ack_counter != 3) || (is_set != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_102_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + if((packet_ptr -> nx_packet_length-40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr+40, MSG, 20))) + { + if(server_socket.nx_tcp_socket_timeout_retries == 0) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + seq_number = tcp_header_ptr -> nx_tcp_sequence_number; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + else if(server_socket.nx_tcp_socket_timeout_retries == 1) + { + if((server_socket.nx_tcp_socket_tx_slow_start_threshold == server_socket.nx_tcp_socket_tx_outstanding_bytes / 2) || (server_socket.nx_tcp_socket_tx_slow_start_threshold >= server_socket.nx_tcp_socket_connect_mss * 2)) + is_set = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + } + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_102_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr ->nx_tcp_acknowledgment_number == seq_number) + duplicate_ack_counter++; + + if(duplicate_ack_counter == 3) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.21 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_102_22_test.c b/test/regression/netxduo_test/netx_102_22_test.c new file mode 100644 index 00000000..685629ce --- /dev/null +++ b/test/regression/netxduo_test/netx_102_22_test.c @@ -0,0 +1,348 @@ +/* 102.22 Upon a timeout cwnd MUST be set to no more than the loss window, LW, which equals 1 full-sized segment (regardless of the value of IW). */ + +/* Procedure + 1. Connection. + 2. Client sends a data packet to Server. + 3. Drop the packet. + 4. Client starts congestion, after Server receives the packet, check cwnd <= mss. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG is_set; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_102_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_22_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_set = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_102_22; + + /* Allocate packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Let the client socket sleep for 1 second to wait for the retransmittion. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1) || (is_set != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.22 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Waiting for client socket retransmit the packet in 5 seconds. */ + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + if(!status) + { + /* Check the length and data of the packet received. */ + if((rcv_packet_ptr->nx_packet_length == 20) && !(memcmp(rcv_packet_ptr->nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + } + else + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static UINT my_packet_process_102_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + /* Check if it is a data packet. */ + if((packet_ptr->nx_packet_length == 60) && !(memcmp(packet_ptr->nx_packet_prepend_ptr + 40, MSG, 20))) + { + if(client_socket.nx_tcp_socket_timeout_retries == 0) + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + else if(client_socket.nx_tcp_socket_timeout_retries == 1) + { + if(client_socket.nx_tcp_socket_tx_window_congestion <= client_socket.nx_tcp_socket_connect_mss) + is_set = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + } + } + + return NX_TRUE; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_22_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.22 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_102_23_test.c b/test/regression/netxduo_test/netx_102_23_test.c new file mode 100644 index 00000000..bb7f842b --- /dev/null +++ b/test/regression/netxduo_test/netx_102_23_test.c @@ -0,0 +1,400 @@ +/* 102.23 Slow start continues until TCP is halfway to where it was when congestion occurred. */ + +/* Procedure + 1. Connection. + 2. Client sends a data packet. + 3. Server receives the packet and replies an ACK packet. + 4. Check cwnd += min(N, MSS). N is acked bytes. + 5. Client sends a data packet again. + 6. Set ssthresh = cwnd - 10. + 7. Server starts congestion, after receives the packet, check cwnd = cwnd + MSS * MSS / cwnd. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; +static ULONG ack_number_1; +static ULONG ack_number_2; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_102_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_23_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +ULONG cwnd; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.23 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 3000, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_102_23; + + /* Record the value of cwnd. */ + cwnd = server_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Record the tx_sequence. */ + ack_number_1 = server_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Check whether the cwnd = cwnd + MSS. */ + if((ack_counter != 1) || (server_socket.nx_tcp_socket_tx_window_congestion != 20 + cwnd)) + error_counter++; + + /* Let server congestion. */ + server_socket.nx_tcp_socket_tx_slow_start_threshold = server_socket.nx_tcp_socket_tx_window_congestion - 10; + + /* Record the value of cwnd. */ + cwnd = server_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ack_number_2 = server_socket.nx_tcp_socket_tx_sequence; + + /* Send the second packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Check whether the cwnd = cwnd + SMSS*SMSS/ cwnd. */ + if((ack_counter != 2) || (server_socket.nx_tcp_socket_tx_window_congestion != server_socket.nx_tcp_socket_connect_mss * server_socket.nx_tcp_socket_connect_mss / cwnd + cwnd)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 3000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, 5 * NX_IP_PERIODIC_RATE)) + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 2) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_102_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if((tcp_header_ptr ->nx_tcp_acknowledgment_number == (ack_number_1 + 20)) || (tcp_header_ptr ->nx_tcp_acknowledgment_number == (ack_number_2 + 20))) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(ack_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_23_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 102.23 Test......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_102_24_test.c b/test/regression/netxduo_test/netx_102_24_test.c new file mode 100644 index 00000000..2a4e36e7 --- /dev/null +++ b/test/regression/netxduo_test/netx_102_24_test.c @@ -0,0 +1,360 @@ +/* 102.24 Formula commonly used to update cwnd during congestion avoidance is cwnd += SMSS*SMSS/ cwnd executed on every incoming non-duplicate ACK. */ + +/* Procedure + 1. Connection. + 2. Set ssthresh = cwnd - 10. + 3. Client sends a data packet. + 4. Server starts congestion, after receives the packet, check cwnd = cwnd + MSS * MSS / cwnd. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +static void my_tcp_packet_receive_102_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_24_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter =0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG cwnd; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client congestion. */ + client_socket.nx_tcp_socket_tx_slow_start_threshold = client_socket.nx_tcp_socket_tx_window_congestion - 10; + + /* Record the value of client socket's cwnd. */ + cwnd = client_socket.nx_tcp_socket_tx_window_congestion; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_102_24; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check whether the cwnd = cwnd + MSS * MSS / cwnd. */ + if((ack_counter != 1) || (client_socket.nx_tcp_socket_tx_window_congestion != client_socket.nx_tcp_socket_connect_mss2 / cwnd + cwnd)) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.24 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 28) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 28))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_102_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + if(client_socket.nx_tcp_socket_duplicated_ack_received == 0) + ack_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_24_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 102.24 Test......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_102_25_test.c b/test/regression/netxduo_test/netx_102_25_test.c new file mode 100644 index 00000000..388cbe63 --- /dev/null +++ b/test/regression/netxduo_test/netx_102_25_test.c @@ -0,0 +1,399 @@ +/* 102.25 The increase in cwnd should be at most one segment each round-trip time (regardless how many ACKs are received in that RTT). */ + +/* Procedure + 1. Connection. + 2. Client sends a data packet. + 3. Server receives the packet and replies an ACK packet. + 4. Check cwnd <= cwnd + MSS. + 5. Client sends a data packet again. + 6. Set ssthresh = cwnd - 10. + 7. Server starts congestion, after receives the packet, check cwnd <= cwnd + MSS. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; +static ULONG ack_number_1; +static ULONG ack_number_2; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_102_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_25_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +ULONG cwnd; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 102.25 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_102_25; + + /* Record the value of cwnd. */ + cwnd = server_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Record the tx_sequence. */ + ack_number_1 = server_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the cwnd <= cwnd + MSS. */ + if((ack_counter != 1) || (server_socket.nx_tcp_socket_tx_window_congestion > server_socket.nx_tcp_socket_connect_mss + cwnd)) + error_counter++; + + /* Let server congestion. */ + server_socket.nx_tcp_socket_tx_slow_start_threshold = server_socket.nx_tcp_socket_tx_window_congestion - 10; + + /* Record the value of cwnd. */ + cwnd = server_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ack_number_2 = server_socket.nx_tcp_socket_tx_sequence; + + /* Send the second packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the cwnd <= cwnd + MSS. */ + if((ack_counter != 2) || (server_socket.nx_tcp_socket_tx_window_congestion > server_socket.nx_tcp_socket_connect_mss + cwnd)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, 5 * NX_IP_PERIODIC_RATE)) + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 2) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_102_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if((tcp_header_ptr ->nx_tcp_acknowledgment_number == (ack_number_1 + 20)) || (tcp_header_ptr ->nx_tcp_acknowledgment_number == (ack_number_2 + 20))) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(ack_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_102_25_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 102.25 Test......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_103_17_test.c b/test/regression/netxduo_test/netx_103_17_test.c new file mode 100644 index 00000000..9aa12396 --- /dev/null +++ b/test/regression/netxduo_test/netx_103_17_test.c @@ -0,0 +1,482 @@ +/* 103.17 After receiving 3 duplicate ACKs, TCP performs a retransmission of missing segment, without waiting for retransmission timer to expire. */ + +/* Procedure +1. Client connect with Server. +2. Client send segment to Server. +3. Drop it in the driver. +4. Client sends three segments. +5. Client retransmits the first segment. +6. Server receives the segment and check the segments data. +7. Disconnect. +8. Print the result. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_packet.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG seq_number; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_103_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_103_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_103_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + seq_number = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 103.17 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_103_17; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_103_17; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG+20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet3, MSG+40, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet4, MSG+60, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Check receive queue of client is not ready. */ + if (client_socket.nx_tcp_socket_receive_queue_head) + { + + /* No packet is ready since the first packet is dropped. */ + if (client_socket.nx_tcp_socket_receive_queue_head -> nx_packet_queue_next == ((NX_PACKET*)NX_PACKET_READY)) + { + error_counter++; + } + } + else + { + + /* Packet out of order should be in queue. */ + error_counter++; + } + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + if(ack_counter != 3) + error_counter++; + + /* Check receive queue of client is ready. */ + if (client_socket.nx_tcp_socket_receive_queue_head) + { + + /* Packet is ready since the fast retransmit is performed. */ + if (client_socket.nx_tcp_socket_receive_queue_head -> nx_packet_queue_next != ((NX_PACKET*)NX_PACKET_READY)) + { + error_counter++; + } + } + else + { + + /* Packet out of order should be in queue. */ + error_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(status = nx_tcp_socket_receive(&client_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE))) + { + + if((packet_ptr -> nx_packet_length == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (MSG + data_packet_counter * 20), 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 4) || (ack_counter != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_103_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + if((packet_ptr -> nx_packet_length-40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr+40, MSG, 20))) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + seq_number = tcp_header_ptr -> nx_tcp_sequence_number; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + advanced_packet_process_callback = NULL; + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_103_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr ->nx_tcp_acknowledgment_number == seq_number) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(ack_counter == 3) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_103_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 103.17 Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_104_17_test.c b/test/regression/netxduo_test/netx_104_17_test.c new file mode 100644 index 00000000..315f4bcc --- /dev/null +++ b/test/regression/netxduo_test/netx_104_17_test.c @@ -0,0 +1,459 @@ +/* 104.17 When next ACK arrives that acknowledges previously unacknowledged data, set cwnd to ssthresh (the value set in step 2). This is termed `'deflating' the window. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG seq_number; +static ULONG ack_counter; +static ULONG duplicate_ack_counter; +static ULONG ssthresh; +static ULONG cwnd; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_104_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_104_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_104_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + seq_number = 0; + ack_counter = 0; + duplicate_ack_counter = 0; + ssthresh = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 104.17 Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_104_17; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_104_17; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG+20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet3, MSG+40, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet4, MSG+60, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + ssthresh = server_socket.nx_tcp_socket_tx_outstanding_bytes / 2; + if(ssthresh < 2 * server_socket.nx_tcp_socket_connect_mss) + ssthresh = 2 * server_socket.nx_tcp_socket_connect_mss; + + cwnd = server_socket.nx_tcp_socket_tx_window_congestion; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if(ack_counter == 1) + { + /* Check whether the cwnd += SMSS*SMSS/ cwnd or cwnd = mss + ssthresh, but cwnd shall never exceed the advertised window. */ + if((server_socket.nx_tcp_socket_tx_window_congestion != server_socket.nx_tcp_socket_connect_mss2 / cwnd + cwnd) && (server_socket.nx_tcp_socket_tx_window_congestion != ssthresh + server_socket.nx_tcp_socket_connect_mss) && + (server_socket.nx_tcp_socket_tx_window_congestion != server_socket.nx_tcp_socket_tx_window_advertised)) + error_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + while(!(status = nx_tcp_socket_receive(&client_socket, &packet_ptr, NX_IP_PERIODIC_RATE))) + { + + if((packet_ptr -> nx_packet_length == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (MSG + data_packet_counter * 20), 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 4) || (duplicate_ack_counter != 3) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_104_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + if((packet_ptr -> nx_packet_length-40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr+40, MSG, 20))) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + seq_number = tcp_header_ptr -> nx_tcp_sequence_number; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + advanced_packet_process_callback = NULL; + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_104_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr ->nx_tcp_acknowledgment_number == seq_number) + duplicate_ack_counter++; + else + { + ack_counter++; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_104_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 104.17 Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_106_17_test.c b/test/regression/netxduo_test/netx_106_17_test.c new file mode 100644 index 00000000..2073ad9a --- /dev/null +++ b/test/regression/netxduo_test/netx_106_17_test.c @@ -0,0 +1,396 @@ +/* 12.18:TCP MUST be able to receive MSS option in SYN segment and calculate the effective send segment size appropriately. */ + +/* Procedure +1.Connect +2.Server_socket's connect_MSS should equal client_socket's MSS.(client_socket's MSS = 88, server_socket's MSS = 1460) +3. A packet should be intercepted by function my_tcp_packet_receive_106_17 which is sent from client socket to server socket. +4. Check: the packet should be a SYN packet, increment the syn_counter. Whether or not calling the defaulted packet receiving function. +5. Check if all of the packets we have catched can connected to the my_packet we send*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + +static TX_THREAD ntest_1; +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_1; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_counter; +static ULONG packet_length_106_17; +static ULONG mss_option_106_17; + + +static UCHAR rcv_buffer[200]; +static UINT rcv_length; + + +/* Define thread prototypes. */ + +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_106_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_106_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_counter = 0; + packet_length_106_17 = 0; + mss_option_106_17 = 0; + rcv_length = 0; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512*16); + pointer = pointer + 512*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_106_17; + + packet_length_106_17 = server_socket.nx_tcp_socket_connect_mss + 20; + mss_option_106_17 = server_socket.nx_tcp_socket_connect_mss; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, MSG, packet_length_106_17, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG bytes_copied; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 106.17 Test......................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(nx_tcp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE))) + { + /*Check if the packet is fragmented by TCP layer.*/ + if(my_packet -> nx_packet_length > mss_option_106_17) + error_counter++; + + /* Retrieve data from packet to the receive buffer. */ + status = nx_packet_data_retrieve(my_packet, &rcv_buffer[rcv_length], &bytes_copied); + if(status) + error_counter++; + + rcv_length += bytes_copied; + } + + /*Check if the content which connected by all the received packets is the data_106_17 sent from the client socket*/ + if(!memcmp(rcv_buffer, MSG, packet_length_106_17)) + data_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status += nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter !=0) || (data_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT my_packet_process_106_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#else +NX_IP_HEADER *ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + if((packet_ptr -> nx_packet_length) > 40) + { + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /*Check if the packet is fragmented by IP layer.*/ + if(!(ip_header_ptr -> nx_ip_header_word_1 & NX_IP_FRAGMENT_MASK)) + { + /*Check if the packet is fragmented by TCP layer*/ + if(packet_ptr -> nx_packet_length > (mss_option_106_17 + 40)) + error_counter++; + } + else + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + } + else + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + return NX_TRUE; +} + + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_106_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 106.17 Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_10_23_01_test.c b/test/regression/netxduo_test/netx_10_23_01_test.c new file mode 100644 index 00000000..d327602c --- /dev/null +++ b/test/regression/netxduo_test/netx_10_23_01_test.c @@ -0,0 +1,363 @@ +/* 10.23.01 TCP, in LISTEN state, Send RST message when recieved a FIN + ACK. */ + +/* Procedure + 1.When the Server has been on the LISTEN state, Client sends a FIN to Server + 2.Check if the state has been changed. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG fin_counter; +static ULONG rst_for_fin_ack; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_10_23_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_10_23_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_10_23_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_23_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_10_23_01; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_23_01; + + tx_thread_suspend(&ntest_0); + + if((fin_counter != 1) || (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE)) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.23.01 Test...................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_23_01_2; + + /* Send FIN packet. */ + _nx_tcp_packet_send_fin(&client_socket, client_socket.nx_tcp_socket_tx_sequence); + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + tx_thread_resume(&ntest_0); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (rst_counter != 1) || (fin_counter != 1) || (rst_for_fin_ack != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_10_23_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_10_23_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_10_23_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check the fin counter. */ + if(fin_counter == 1) + { + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + rst_for_fin_ack ++; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_23_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.23.01 Test....................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_10_23_02_test.c b/test/regression/netxduo_test/netx_10_23_02_test.c new file mode 100644 index 00000000..dd0db165 --- /dev/null +++ b/test/regression/netxduo_test/netx_10_23_02_test.c @@ -0,0 +1,444 @@ +/* 10.23.02 TCP, in CLOSED, Send RST for FIN +ACK, in SYN-SENT state, ignore the FIN+ACK.. */ + +/* Procedure + 1.When the Client has been on the CLOSED , Server sends a FIN + ACK to Client + 2.When the Client has been on the SYN_SENT, Server sends a FIN + ACK to Client. + 3.Check if the state has been changed. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG syn_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_10_23_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_10_23_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_10_23_02_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_23_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + syn_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_10_23_02; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_23_02; + + tx_thread_resume(&ntest_1); + + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + tx_thread_resume(&ntest_1); + + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Let the client socket disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (rst_counter != 1) || (syn_counter != 1) || (fin_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.23.02 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_23_02_2; + + /* Send FIN packet. */ + _nx_tcp_packet_send_fin(&server_socket, server_socket.nx_tcp_socket_tx_sequence); + + tx_thread_suspend(&ntest_1); + + /* Send FIN packet. */ + _nx_tcp_packet_send_fin(&server_socket, server_socket.nx_tcp_socket_tx_sequence); + + tx_thread_suspend(&ntest_1); + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + + /* Let the server socket disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_10_23_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +#endif + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + + if (fin_counter) + rst_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) + { + syn_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (fin_counter == 1)) + { + /* Modify the acknowledgement number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + tcp_header_ptr -> nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_tx_sequence; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &server_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &server_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_10_23_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + fin_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(fin_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_10_23_02_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + if(fin_counter != 0) + error_counter++; + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_23_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.23.02 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_10_24_01_test.c b/test/regression/netxduo_test/netx_10_24_01_test.c new file mode 100644 index 00000000..ff64e92a --- /dev/null +++ b/test/regression/netxduo_test/netx_10_24_01_test.c @@ -0,0 +1,331 @@ +/* 10.24 TCP, in CLOSE-WAIT, CLOSING or LAST-ACK state, MUST not change state after receiving a FIN. */ +/*This is 10.24_01 in CLOSE-WAIT state*/ +/* Procedure + 1.Connection successfully + 2.Disconnect the Server socket. + 3.Drop the ACK packet sent form the Client to the Sever. + 4.The Server will retransmit the FIN packet. + 5.Check whether the state of the client socket has been changed. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_10_24_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_10_24_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_24_01_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_10_24_01; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_24_01; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Sleep two seconds to wait for the retransmission of the FIN packet. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + if((client_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT) || (fin_counter != 2)) + error_counter++; + + /* Return error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.24.01 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE * 2); + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +static UINT my_packet_process_10_24_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Drop the ACK packet in order to let the server socket retransmit a FIN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (fin_counter == 1)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +void my_tcp_packet_receive_10_24_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (fin_counter == 0)) + { + fin_counter++; + } + + /* Check wether receive a FIN in CLOSE_WAIT state */ + else if (client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT && fin_counter == 1) + { + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_24_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.24.01 Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_10_24_02_test.c b/test/regression/netxduo_test/netx_10_24_02_test.c new file mode 100644 index 00000000..6af5d55a --- /dev/null +++ b/test/regression/netxduo_test/netx_10_24_02_test.c @@ -0,0 +1,362 @@ +/* 10.24 TCP, in CLOSE-WAIT, CLOSING or LAST-ACK state, MUST not change state after receiving a FIN. */ +/*This is 10.24_02 in CLOSING state*/ + +/* Procedure + 1.Connection successfully + 2.Disconnect the Server socket. + 3.Drop the FIN packet sent form the Sever to the Client. + 4.Disconnect the Client socket. + 5.Drop the ACK packet sent form the Sever to the Client. + 6.The Client will retransmit the FIN packet. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); + + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_10_24_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_10_24_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_24_02_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.24.02 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_10_24_02; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_24_02; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* sleep to wait for the retransmission of FIN */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* Check the server socket state and fin_counter. */ + if((server_socket.nx_tcp_socket_state != NX_TCP_CLOSING) || (fin_counter != 3)) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (fin_counter != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* CLOSE_WAIT.. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 3 * NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +static UINT my_packet_process_10_24_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (fin_counter == 0)) + { + fin_counter++; + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + /* Drop the ACK packet in order to let the client socket retransmit a FIN packet. */ + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (ip_ptr == &ip_0)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +void my_tcp_packet_receive_10_24_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (fin_counter == 1)) + { + fin_counter++; + } + /* Check wether receive a FIN in CLOSE_WAIT state */ + else if (server_socket.nx_tcp_socket_state == NX_TCP_CLOSING && fin_counter == 2) + { + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_24_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.24.02 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_10_24_03_test.c b/test/regression/netxduo_test/netx_10_24_03_test.c new file mode 100644 index 00000000..0c1adf54 --- /dev/null +++ b/test/regression/netxduo_test/netx_10_24_03_test.c @@ -0,0 +1,347 @@ +/* 10.24 TCP, in CLOSE-WAIT, CLOSING or LAST-ACK state, MUST not change state after receiving a FIN. */ +/*This is 10.24_03 in LAST-ACK state*/ + +/* Procedure + 1.Connection successfully + 2.Disconnect the Server socket. + 3.Drop the packet sent form the Client to the Sever. + 4.Disconnect the Client socket. + 5.Drop the packet sent form the Client to the Sever. + 6.The Server will retransmit the FIN packet. + 7.Check whether the state of the client socket has been changed. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_10_24_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_10_24_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_24_03_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* sleep to wait for the retransmission of FIN */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * 3); + + if((client_socket.nx_tcp_socket_state != NX_TCP_LAST_ACK) || (fin_counter != 3)) + error_counter++; + + /* Return error. */ + if((error_counter) || (fin_counter != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.24.03 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_10_24_03; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_24_03; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE * 3); + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + + +static UINT my_packet_process_10_24_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Drop the ACK packet from client socket to let server socket retransmit FIN. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (fin_counter == 1)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + /* Drop the FIN packet from client socket in order to keep the client socket in NX_TCP_LAST_ACK state. */ + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (ip_ptr == &ip_0)) + { + + if (fin_counter == 1) + fin_counter++; + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +void my_tcp_packet_receive_10_24_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (fin_counter == 0)) + { + fin_counter++; + } + + /* Check wether receive a FIN in NX_TCP_LAST_ACK state */ + else if ((client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) && (fin_counter == 2)) + { + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_24_03_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.24.03 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_10_25_test.c b/test/regression/netxduo_test/netx_10_25_test.c new file mode 100644 index 00000000..96304782 --- /dev/null +++ b/test/regression/netxduo_test/netx_10_25_test.c @@ -0,0 +1,384 @@ +/* 10.25 TCP, in ESTABLISHED state, SHOULD piggyback acknowledgement with +a segment being transmitted (whenever possible) without incurring undue delay. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a packet to Server. + 3. When receives packet, Server sends a packet to client immediately. + 4. Check the packet server sending to client,if it acknowledges packet of client. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_counter; +static ULONG ack_counter; + +static UCHAR data_10_25[20]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process_10_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_10_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_25_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.25 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_25; + packet_process_callback = my_packet_process_10_25; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + srand((unsigned)time(NULL)); + for(i = 0;i < 20;i++) + { + data_10_25[i] = rand() % 256; + } + + status = nx_packet_data_append(my_packet, data_10_25, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (data_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void my_tcp_packet_receive_10_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + if( (server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) && (packet_ptr->nx_packet_length == 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, data_10_25, 20))) + { + data_counter ++; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT my_packet_process_10_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if( server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Check whether piggyback acknowledgment with a segment being transmitted. */ + if((tcp_header_ptr ->nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_acknowledgment_number == client_socket.nx_tcp_socket_tx_sequence)) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + + packet_process_callback = NULL; + } + + return NX_TRUE; + +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.25 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_10_26_test.c b/test/regression/netxduo_test/netx_10_26_test.c new file mode 100644 index 00000000..13eb69c3 --- /dev/null +++ b/test/regression/netxduo_test/netx_10_26_test.c @@ -0,0 +1,394 @@ +/* 10.26 TCP, in ESTABLISHED state, MUST ignore a dupli-cate ACK. */ + +/* Procedure + 1. Connection. + 2. Client sends a packet, then Server replies with an ACK packet + 3. Record client's tx_sequence. + 4. Server sends a same ACK packet and check whether receives a reply. Check client's tx_sequence dosen't change. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +static UCHAR data_10_26[20]; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ack_counter; + +static ULONG tx_sequence; +static ULONG acknowledgment_number; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_10_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_26_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + acknowledgment_number = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_10_26; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + srand((unsigned)time(NULL)); + for(i = 0;i < 20;i++) + { + data_10_26[i] = rand() % 256; + } + + status = nx_packet_data_append(my_packet, data_10_26, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if(tx_sequence != client_socket.nx_tcp_socket_tx_sequence) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 10.26 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + nx_packet_release(my_packet); + + /* Let the thread sleep to wait for the the delay confirmation */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Send the duplicate ACK packet. */ + _nx_tcp_packet_send_ack(&server_socket,server_socket.nx_tcp_socket_tx_sequence); + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void my_tcp_packet_receive_10_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if (client_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether the packet is a ACK one. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (ack_counter == 0)) + { + ack_counter++; + tx_sequence = client_socket.nx_tcp_socket_tx_sequence; + acknowledgment_number = tcp_header_ptr -> nx_tcp_acknowledgment_number; + } + + /* Check whether the packet is a duplicate ACK. */ + else if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (acknowledgment_number == tcp_header_ptr -> nx_tcp_acknowledgment_number) && + (ack_counter == 1)) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_10_26_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 10.26 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_11_18_test.c b/test/regression/netxduo_test/netx_11_18_test.c new file mode 100644 index 00000000..f1cea786 --- /dev/null +++ b/test/regression/netxduo_test/netx_11_18_test.c @@ -0,0 +1,330 @@ +/* 11.18 TCP, if starts as an active connection and reaches SYN-RCVD state MUST go to CLOSED state on RESET. */ + +/* Procedure +1. Client_1 sends a SYN to Client_2. +2. Use my_packet_process_11_18 function to drop the SYN packet. +3. Client_2 sends a SYN to Client_1. +4. Client_1 sends a SYN+ACK to Client_2. +5. Use my_packet_process_11_18 function to drop the SYN+ACK packet. +6. Client_2 sends a RST to Client_1. +7. Check the Client_1 state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_1_socket; +static NX_TCP_SOCKET client_2_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_11_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_11_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.18 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_1_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_1_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the SYN packet with my routing */ + advanced_packet_process_callback = my_packet_process_11_18; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_18; + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_1_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check the Client_1's state. */ + if((rst_counter != 1) || (client_1_socket.nx_tcp_socket_state != NX_TCP_CLOSED)) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_1_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_1_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_2_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_bind(&client_2_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_2_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = client_1_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_1_socket.nx_tcp_socket_tx_sequence + 1; + + _nx_tcp_packet_send_rst(&client_2_socket, &header_ptr); + + tx_thread_sleep(NX_IP_PERIODIC_RATE/20); + + /* Disconnect the socket. */ + status = nx_tcp_socket_disconnect(&client_2_socket, NX_NO_WAIT); + + status = nx_tcp_client_socket_unbind(&client_2_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_2_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_counter != 2 ) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process_11_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Check if it is a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (syn_counter == 0)) + { + syn_counter++; + + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + /* Check if it is a SYN+ACK packet. */ + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (syn_counter == 2)) + { + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + advanced_packet_process_callback = NX_NULL; + } + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_11_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (syn_counter == 1)) + syn_counter++; + else if(client_1_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let client1 receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.18 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_11_19_test.c b/test/regression/netxduo_test/netx_11_19_test.c new file mode 100644 index 00000000..16db4269 --- /dev/null +++ b/test/regression/netxduo_test/netx_11_19_test.c @@ -0,0 +1,317 @@ +/* 11.19 TCP, in ESTABLISHED state MUST inform the application in case of aborting from remote site. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a RST packet to serve. + 3. Check if server is notified. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +static UINT is_notified; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_11_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_19; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if (is_notified == NX_FALSE) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.19 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + is_notified = NX_FALSE; + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Send a RST packet */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + /* let ntest_0 to check*/ + tx_thread_sleep(1); + + status = nx_tcp_socket_disconnect(&server_socket,NX_IP_PERIODIC_RATE); + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1) ) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_tcp_packet_receive_11_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + /* Check for proper disconnected socket. */ + if(socket != &client_socket) + error_counter++; + + is_notified = NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.19 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_11_23_test.c b/test/regression/netxduo_test/netx_11_23_test.c new file mode 100644 index 00000000..1a8a902f --- /dev/null +++ b/test/regression/netxduo_test/netx_11_23_test.c @@ -0,0 +1,380 @@ +/* 11.23 Local user initiates the close, a FIN segment can be constructed and placed on the outgoing segment queue. */ + +/* Procedure + 1 Establish the connection; + 2 Let the server socket send segments until the rx_window of the client socket reduce to 0; + 3 Call the disconnect API, check whether a FIN packet is sent out in the callback function; + 4 Let the client socket receive the packet; + 5 Check whether the FIN packet is received in the tcp packet receive function we defined.0 */ + +/* Warning: FIN segment is not placed on the outgoing segment queue. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +static UCHAR data_11_23[88]; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_11_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_23_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for error. */ + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for error. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.23 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 88, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + srand((unsigned)time(NULL)); + for(i = 0;i < 88;i++) + { + data_11_23[i] = rand() % 256; + } + + status = nx_packet_data_append(my_packet, data_11_23, 88, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_rx_window_current != 0) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 88, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_23; + + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + if(client_socket.nx_tcp_socket_rx_window_current == 0) + error_counter++; + + nx_packet_release(my_packet); + } + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if (fin_counter != 1) + { + printf("WARNING!\n"); + test_control_return(2); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +void my_tcp_packet_receive_11_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_23_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.23 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_11_24_test.c b/test/regression/netxduo_test/netx_11_24_test.c new file mode 100644 index 00000000..8f0d6297 --- /dev/null +++ b/test/regression/netxduo_test/netx_11_24_test.c @@ -0,0 +1,346 @@ +/* 11.24 Local user initiates the close, TCP enters the FIN-WAIT-1 state. RECEIVEs are allowed in this state. */ + +/* Procedure + 1.Connection successfully + 2.Let Server's state to FIN_WAIT_1 + 3.Client sends some data to Server + 4.Check if Server receives data successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +#include "nx_ram_network_driver_test_1500.h" +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_counter; + +static UCHAR data_11_24[20]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_11_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_24_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.24 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_11_24; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((my_packet -> nx_packet_length == 20) && (!memcmp(my_packet -> nx_packet_prepend_ptr, data_11_24, 20))) + data_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + else + error_counter++; + + advanced_packet_process_callback = NX_NULL; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + srand((unsigned)time(NULL)); + for(i = 0;i < 20;i++) + { + data_11_24[i] = rand() % 256; + } + + status = nx_packet_data_append(my_packet, data_11_24, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (data_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static UINT my_packet_process_11_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_24_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.24 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_11_25_test.c b/test/regression/netxduo_test/netx_11_25_test.c new file mode 100644 index 00000000..a55374fc --- /dev/null +++ b/test/regression/netxduo_test/netx_11_25_test.c @@ -0,0 +1,322 @@ +/* 11.25 TCP enters the FIN-WAIT-2 state. RECEIVEs are allowed in this state. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a packet to server. + 3. Server calls disconnect function. + 4. When server receives ACK packet from client, call receive function. + 5. Check if server receives data successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_counter; + +static UCHAR data_11_25[20]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_25_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.25 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((my_packet -> nx_packet_length == 20) && (!memcmp(my_packet -> nx_packet_prepend_ptr, data_11_25, 20))) + data_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + else + error_counter++; + + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + srand((unsigned)time(NULL)); + for(i = 0;i < 20;i++) + { + data_11_25[i] = rand() % 256; + } + + status = nx_packet_data_append(my_packet, data_11_25, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (data_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.25 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_11_26_test.c b/test/regression/netxduo_test/netx_11_26_test.c new file mode 100644 index 00000000..cd1b1053 --- /dev/null +++ b/test/regression/netxduo_test/netx_11_26_test.c @@ -0,0 +1,354 @@ +/* 11.26:If an unsolicited FIN arrives from the network, TCP enters the CLOSE_WAIT state. TCP can send any remaining data. */ + +/* Procedure + 1. Client connects to server. + 2. Disconnect the server socket, then the client socket's state is ClOSE_WAIT + 3. Client socket sends segment, it should return SUCCESS. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_counter; +static ULONG fin_counter; + +static UCHAR data_11_26[20]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_11_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_11_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_26_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_26; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + srand((unsigned)time(NULL)); + for(i = 0;i < 20;i++) + { + data_11_26[i] = rand() % 256; + } + + status = nx_packet_data_append(my_packet, data_11_26, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_11_26; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (data_counter != 1) || (fin_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 11.26 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100,NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +void my_tcp_packet_receive_11_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + { + fin_counter++; + + /* Point to default function */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static UINT my_packet_process_11_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UCHAR *data_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + data_ptr = packet_ptr -> nx_packet_prepend_ptr + 40; + + if(memcmp(data_ptr, data_11_26, 20) == 0) + data_counter++; + + advanced_packet_process_callback = NX_NULL; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_26_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.26 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_11_27_test.c b/test/regression/netxduo_test/netx_11_27_test.c new file mode 100644 index 00000000..7453bbe0 --- /dev/null +++ b/test/regression/netxduo_test/netx_11_27_test.c @@ -0,0 +1,349 @@ +/* 11.27 TCP, FINWAIT-1 state MUST inform the application in case of aborting from remote site. */ + +/* Procedure + 1. Client connects to server. + 2. Server calls disconnect function. + 3. Drop the FIN packet. + 4. Send a RST packet to server. + 5. Check if server is notified. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_11_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_11_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_27_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.27 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_27; + advanced_packet_process_callback = my_packet_process_11_27; + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + if((rst_counter != 1) || (status!= NX_DISCONNECT_FAILED)) + error_counter++; + + advanced_packet_process_callback = NX_NULL; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; + +} + +static void my_tcp_packet_receive_11_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if (server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + + +static UINT my_packet_process_11_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_27_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.27 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_11_28_test.c b/test/regression/netxduo_test/netx_11_28_test.c new file mode 100644 index 00000000..c434eac8 --- /dev/null +++ b/test/regression/netxduo_test/netx_11_28_test.c @@ -0,0 +1,318 @@ +/* 11.28 TCP, FINWAIT-2 state MUST inform the application in case of aborting from remote site. */ + +/* Procedure + 1. Client connects to server. + 2. Server calls disconnect function. + 2. When server receives ACK packet, client sends a RST packet to server. + 3. Check if server is notified. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_11_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_28_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.28 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_28; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + if((rst_counter != 1) || (status!= NX_DISCONNECT_FAILED)) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Attempt to connect the socket. */ + status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Send a RST packet */ + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_11_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_28_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.28 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_11_29_test.c b/test/regression/netxduo_test/netx_11_29_test.c new file mode 100644 index 00000000..e19cf17b --- /dev/null +++ b/test/regression/netxduo_test/netx_11_29_test.c @@ -0,0 +1,318 @@ +/* 11.29 TCP, in CLOSE-WAIT state MUST inform the appli-cation in case of aborting from remote site. */ + +/* Procedure + 1. Client connects to Server. + 2. Server calls disconnect function. + 2. When Client receives FIN packet, Server sends a RST packet to Client. + 3. Check if Client is notified. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_11_29(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_29_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup function pointer. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_29; + + /* Attempt to connect the socket. */ + status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.29 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Send a RST packet */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_11_29(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_11_29_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 11.29 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_12_01_test.c b/test/regression/netxduo_test/netx_12_01_test.c new file mode 100644 index 00000000..17a80239 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_01_test.c @@ -0,0 +1,422 @@ +/* 12.01 TCP MUST be prepared to handle an illegal option length for MSS, in a SYN segment, without crashing; + a suggested procedure is to reset the connection and log the reason. */ + +/* Procedure + 1. Client send SYN to server. + 2. When server receives SYN packet, modify the length of MSS in 'my_tcp_packet_process_12_01'. + 3. Pass the SYN packet to the default function . + 4. Check whether client received the RST packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG syn_counter; +static ULONG rst_counter; +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_01_1(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, ULONG protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.01 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_01_1; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*To handle the syn packet.*/ + advanced_packet_process_callback = my_packet_process_12_01; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_01_2; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Clean up the Server socket. */ + tx_thread_sleep(TX_TIMER_TICKS_PER_SECOND); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0) || (syn_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static UINT my_packet_process_12_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Chcek whether it is a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Modify the MSS length to 0*/ + *option_word_1 = *option_word_1 & 0xFF00FFFF; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Put the packet pointer to tcp*/ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + return NX_TRUE; + } + +static void my_tcp_packet_receive_12_01_1(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + if((*option_word_1 & 0x00FF0000) == 0) + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_12_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a RST packet. */ + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + rst_counter++; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.01 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_12_02_test.c b/test/regression/netxduo_test/netx_12_02_test.c new file mode 100644 index 00000000..22e6e561 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_02_test.c @@ -0,0 +1,409 @@ +/* 12.02 TCP MUST be able to receive No Operation and End of Options List options in SYN segment. */ + +/* Procedure + 1. Client sends SYN to server. + 2. When server receives SYN packet, modify the option kind to 'No Operation' and 'End of Options List'. + 3. Pass the SYN packet to the default function . + 4. Check whether client connect to server successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0;; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.02 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_02; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + if(syn_counter == 1) + { + /*Check whether the connection has crashed*/ + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + } + else + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*To handle the syn packet.*/ + advanced_packet_process_callback = my_packet_process_12_02; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Disconnect this socket. */ + status= nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || syn_counter != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +static UINT my_packet_process_12_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +UCHAR *option; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Check whether receives a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* Set len to length address. */ + option = packet_ptr -> nx_packet_prepend_ptr + 40; + + /* Modify option data. */ + *(ULONG*)option = NX_TCP_OPTION_END; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /*Put the packet pointer to tcp*/ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /*Put the packet pointer to tcp*/ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + return NX_TRUE; + +} + +static void my_tcp_packet_receive_12_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +UCHAR *option; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* Set len to length address. */ + option = packet_ptr -> nx_packet_prepend_ptr + 20; + + if(*(ULONG*)option == NX_TCP_OPTION_END) + syn_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.02 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_12_03_test.c b/test/regression/netxduo_test/netx_12_03_test.c new file mode 100644 index 00000000..0bf4c92a --- /dev/null +++ b/test/regression/netxduo_test/netx_12_03_test.c @@ -0,0 +1,425 @@ +/* 12.03 TCP MUST ignore without error any TCP option it does not implement. */ + +/* Procedure +1. Client send SYN to server. +2. When server receives SYN packet, modify the TCP option to error in 'my_tcp_packet_process_12_03'. +3. Pass the SYN packet to the default function . +4. Check if client connect to server successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG syn_counter; + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + if(status) + error_counter++; + status = nx_tcp_enable(&ip_1); + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.03 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_03; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + if(syn_counter == 1) + { + /*Check whether the connection has crashed*/ + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + } + else + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*To handle the syn packet.*/ + advanced_packet_process_callback = my_packet_process_12_03; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0) || (syn_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static UINT my_packet_process_12_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Client receives a SYN+ACK packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Modify the TCP option to unkown option with crrect option length. */ + *option_word_1 = 0x05040002; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Put the packet pointer to tcp. */ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + + checksum = ~checksum & NX_LOWER_16_MASK; + +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a SYN packet. */ + if ((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + if (*option_word_1 == 0x05040002) + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.03 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_12_04_test.c b/test/regression/netxduo_test/netx_12_04_test.c new file mode 100644 index 00000000..6550ad04 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_04_test.c @@ -0,0 +1,420 @@ +/* 12.04 TCP MUST be prepared to handle an illegal option length for MSS, in a SYN segment; a suggested procedure is to reset the connection. */ + +/* Procedure +1.Intercept the SYN packet +2.Modify the option_words to the 1220 +3.Check whether the connection is reset */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.04 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_04; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_04_2; + + /*To handle the syn packet.*/ + advanced_packet_process_callback = my_packet_process_12_04; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Clean up the Server socket. */ + tx_thread_sleep(TX_TIMER_TICKS_PER_SECOND); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter != 0) && (syn_counter != 1) && (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_12_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + + /* Check whether receives a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Modify the MSS length to 0*/ + *option_word_1 = *option_word_1 & 0xFF00FFFF; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + if((*option_word_1 & 0x00FF0000) == 0) + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_12_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + + /*Check whether the connection is reset.*/ + if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + rst_counter++; + + /*If connection havn't been reset, give back, restore the TCP receive function.*/ + else if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.04 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_12_17_test.c b/test/regression/netxduo_test/netx_12_17_test.c new file mode 100644 index 00000000..7fade9b6 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_17_test.c @@ -0,0 +1,418 @@ +/* 12.17 TCP MUST be prepared to handle an illegal option length for MSS, in a SYN,ACK segment, without crashing. */ + +/* Procedure + + 1. Client sends SYN to server and server returns SYN+ACK. + 2. When client receives SYN+ACK packet, modify the length of MSS in 'my_tcp_packet_receive_12_17'. + 3. Pass the SYN+ACK packet to the default function . + 4. Check whether the connection is reset */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +#define DEMO_STACK_SIZE 2048 +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG syn_ack_counter; +static ULONG rst_counter; +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_17_1(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_17_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + if(status) + error_counter++; + status = nx_tcp_enable(&ip_1); + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.17 Test......................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_17_1; + + /*To handle the syn,ack packet.*/ + advanced_packet_process_callback = my_packet_process_12_17; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0) || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status...*/ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_17_2; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static UINT my_packet_process_12_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN+ACK packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Modify the MSS length to 0*/ + *option_word_1 = *option_word_1 & 0xFF00FFFF; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Put the packet pointer to tcp*/ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &server_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &server_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + +#elif defined(__PRODUCT_NETX__) + dest_ip = server_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_17_1(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN+ACK packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + if((*option_word_1 & 0x00FF0000) == 0) + syn_ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_12_17_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a RST packet. */ + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + rst_counter++; + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.17 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_12_18_test.c b/test/regression/netxduo_test/netx_12_18_test.c new file mode 100644 index 00000000..d7ce2734 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_18_test.c @@ -0,0 +1,447 @@ +/* 12.18:TCP MUST be able to receive MSS option in SYN segment and calculate the effective send segment size appropriately. */ + +/* Procedure +1.Connect +2.Server_socket's connect_MSS should equal client_socket's MSS.(client_socket's MSS = 88, server_socket's MSS = 1460) +3. A packet should be intercepted by function my_tcp_packet_receive_12_18 which is sent from client socket to server socket. +4. Check: the packet should be a SYN packet, increment the syn_counter. Whether or not calling the defaulted packet receiving function. +5. Check if all of the packets we have catched can connected to the my_packet we send*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +static TX_THREAD ntest_1; +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_1; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG data_counter; +static ULONG mss_option_12_18; +static ULONG packet_length_12_18; + +static UCHAR callback_rcv_buffer[200]; +static UINT callback_rcv_length; +static UCHAR rcv_buffer[200]; +static UINT rcv_length; +static UCHAR data_12_18[200]; + +/* Define thread prototypes. */ + +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void rand_12_18(); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + data_counter = 0; + mss_option_12_18 = 0; + callback_rcv_length = 0; + rcv_length = 0; + packet_length_12_18 = 200; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512*16); + pointer = pointer + 512*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the server socket to check the SYN segment*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_18; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Check if the MSS option of server socket has calculated to the appropriate 88(client_socket's MSS) which the SYN packet from client socket carried*/ + if(server_socket.nx_tcp_socket_connect_mss != mss_option_12_18) + error_counter++; + + + advanced_packet_process_callback = my_packet_process_12_18; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a 200-byte length message randomly. */ + rand_12_18(); + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, data_12_18, packet_length_12_18, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /*Check if the content of the callback_rcv_buffer which appended by all the received packets' payload is the data_12_18 sent before*/ + if(!memcmp(callback_rcv_buffer, data_12_18, packet_length_12_18)) + data_counter++; + + advanced_packet_process_callback = NX_NULL; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG bytes_copied; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.18 Test......................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(nx_tcp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE))) + { + /*Check if the packet is fragmented by TCP layer.*/ + if(my_packet -> nx_packet_length > mss_option_12_18) + error_counter++; + + /* Retrieve data from packet to the receive buffer. */ + status = nx_packet_data_retrieve(my_packet, &rcv_buffer[rcv_length], &bytes_copied); + if(status) + error_counter++; + + rcv_length += bytes_copied; + } + + /*Check if the content which connected by all the received packets is the data_12_18 sent from the client socket*/ + if(!memcmp(rcv_buffer, data_12_18, packet_length_12_18)) + data_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status += nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter !=0) || (syn_counter != 1) || (data_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void rand_12_18() +{ +UINT flag; +UINT j, k = 0; + + srand((unsigned)time(NULL)); + for(j = 0;j < 200;j++) + { + flag = rand() & 1; + if(flag) + data_12_18[k++] = 'A' + rand() % 26; + else + data_12_18[k++] = 'a' + rand() % 26; + } +} + +static UINT my_packet_process_12_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#else +NX_IP_HEADER *ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + if((packet_ptr -> nx_packet_length) > 40) + { + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /*Check if the packet is fragmented by IP layer.*/ + if(!(ip_header_ptr -> nx_ip_header_word_1 & NX_IP_FRAGMENT_MASK)) + { + /*Check if the packet is fragmented by TCP layer*/ + if((packet_ptr -> nx_packet_length - 40) > mss_option_12_18) + error_counter++; + } + else + error_counter++; + + /* Append the intercepted packet's content to the receive buffer. */ + memcpy(&callback_rcv_buffer[callback_rcv_length], packet_ptr -> nx_packet_prepend_ptr + 40, packet_ptr -> nx_packet_length - 40); + callback_rcv_length = callback_rcv_length + packet_ptr -> nx_packet_length - 40; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + } + + return NX_TRUE; +} + + + +static void my_tcp_packet_receive_12_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + /* It is a SYN packet. */ + syn_counter++; + + /*Get the option kind*/ + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss_option_12_18); + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.18 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_12_19_test.c b/test/regression/netxduo_test/netx_12_19_test.c new file mode 100644 index 00000000..817a3ec1 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_19_test.c @@ -0,0 +1,439 @@ +/* 12.19:TCP MUST assume a default send MSS of 536 if MSS option is not received at connection setup. */ + +/* Procedure + 1.Client_socket connect server_socket. + 2.When server_socket received SYN, then clean the MSS option, deal the packet with default receive function. + 3.Check the connect_mss of server_socket has been changed to be 536. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; + + +/* Define thread prototypes. */ + + +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Point to my routing */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_19; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(syn_counter == 1) + { + /*Check if the connection has established*/ + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + } + else + error_counter++; + + if(server_socket.nx_tcp_socket_connect_mss != 536) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 12.19 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_12_19; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0 ) || (syn_counter != 1 )) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + + + +static UINT my_packet_process_12_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Modify the syn packet */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Clean the MSS option*/ + *option_word_1 = *option_word_1 & 0x00000000; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + tcp_header_ptr -> nx_tcp_header_word_4 = tcp_header_ptr -> nx_tcp_header_word_4 & 0xFFFF0000; + + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + return NX_TRUE; + +} + + +static void my_tcp_packet_receive_12_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a syn packet */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Check whether the packet have the MSS option*/ + if(!(*option_word_1)) + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Point to default function */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Deal with default function */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.19 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_12_20_test.c b/test/regression/netxduo_test/netx_12_20_test.c new file mode 100644 index 00000000..d85adbf1 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_20_test.c @@ -0,0 +1,535 @@ +/* 12.20:TCP MUST ignore MSS option in data segment. */ + +/* Procedure + 1.Connect + 2.Allocate a data packet with MSS_OPTION but not SYN packet + 3.Client socket sends the packet to server socket + 4.Check whether server_socket's connect_mss changed or not */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +#include + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG mss_option_12_20; +static ULONG data_packet_counter; +static UCHAR data_12_20[20]; + +/* Define thread prototypes. */ + + +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +static void rand_12_20(); +extern UINT _nx_packet_data_append(NX_PACKET *packet_ptr, VOID *data_start, ULONG data_size,NX_PACKET_POOL *pool_ptr, ULONG wait_option); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + mss_option_12_20 = 20; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 1", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 0", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + + + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Let server checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_20; + + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((my_packet -> nx_packet_length == 20) && (!memcmp(my_packet -> nx_packet_prepend_ptr, data_12_20, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /*Check if the mss of client socket has changed*/ + if(server_socket.nx_tcp_socket_connect_mss == mss_option_12_20) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + + + +static void ntest_1_entry(ULONG thread_input) +{ + UINT status; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 12.20 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_12_20; + _nx_tcp_packet_send_syn(&client_socket,client_socket.nx_tcp_socket_tx_sequence); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if((error_counter != 0) || (data_packet_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static void rand_12_20() +{ + UINT flag; + UINT j,k=0; + + srand((unsigned)time(NULL)); + for(j=0;j<20;j++) + { + flag=rand()%2; + if(flag) data_12_20[k++]='A'+rand()%26; + else data_12_20[k++]='a'+rand()%26; + } +} + +static UINT my_packet_process_12_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; + + +ULONG val; +ULONG checksum; +ULONG checksum_ip; +ULONG temp; +#if defined(__PRODUCT_NETXDUO__) + NX_IPV4_HEADER *ip_header_ptr; +#else + NX_IP_HEADER *ip_header_ptr; +#endif + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#else + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Construct a data segment with mss option based on the SYN packet*/ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /*Delete the SYN bit.*/ + tcp_header_ptr -> nx_tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3 ^ NX_TCP_SYN_BIT; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Modify the MSS option value to 20*/ + *option_word_1 = *option_word_1 & 0xFFFF0000; + *option_word_1 = *option_word_1 | 0x00000014; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + rand_12_20(); + nx_packet_data_append(packet_ptr, data_12_20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + tcp_header_ptr -> nx_tcp_header_word_4 = tcp_header_ptr -> nx_tcp_header_word_4 & 0xFFFF0000; + + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + /*Modify the packet length in ip header.*/ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + ip_header_ptr -> nx_ip_header_word_0 = ip_header_ptr -> nx_ip_header_word_0 & 0xFFFF0000; + ip_header_ptr -> nx_ip_header_word_0 = ip_header_ptr -> nx_ip_header_word_0 | 0x00000044; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 & 0x0000FFFF; + + + temp = ip_header_ptr -> nx_ip_header_word_0; + checksum_ip = (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_1; + checksum_ip += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_2; + checksum_ip += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_source_ip; + checksum_ip += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_destination_ip; + checksum_ip += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + + /* Fold a 4-byte value into a two byte value */ + checksum_ip = (checksum_ip >> 16) + (checksum_ip & 0xFFFF); + + /* Do it again in case previous operation generates an overflow */ + checksum_ip = (checksum_ip >> 16) + (checksum_ip & 0xFFFF); + + /* Convert to host byte order. */ + NX_CHANGE_USHORT_ENDIAN(checksum_ip); + + val = (ULONG)(~checksum_ip); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + + /* Modify the new sequence of client socket. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + + + +static void my_tcp_packet_receive_12_20 (NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG option_words; +ULONG mss; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /*Check if both the sockets are in ESTABLISHED state*/ + if(server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + + /*Get the option kind*/ + option_words = (tcp_header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss); + + if(mss == mss_option_12_20) + data_packet_counter++; + + /* Point to default function */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + /* Deal with default function */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.20 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_12_21_test.c b/test/regression/netxduo_test/netx_12_21_test.c new file mode 100644 index 00000000..a6c0b444 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_21_test.c @@ -0,0 +1,443 @@ +/* 12.21:TCP MUST be able to receive MSS option in SYN,ACK segment and calculate the effective send segment size appropriately. */ + +/* Procedure + 1.Connect + 2.Client_socket's connect_MSS should equal server_socket's MSS.(client_socket's MSS = 1460, server_socket's MSS = 88) + 3. A packet should be intercepted by function my_tcp_packet_receive_12_21 which is sent from client socket to server socket. + 4. Check: the packet should be a SYN packet, increment the syn_counter. Whether or not calling the defaulted packet receiving function. + 5. Check if all of the packets we catched can connected to the my_packet we send*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the counters used in the demo application... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo applicaton... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG data_counter; +static ULONG mss_option_12_21; +static ULONG packet_length_12_21; + +static UCHAR callback_rcv_buffer[200]; +static UINT callback_rcv_length; +static UCHAR rcv_buffer[200]; +static UINT rcv_length; +static UCHAR data_12_21[200]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +static void rand_12_21(); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + data_counter = 0; + mss_option_12_21 = 0; + packet_length_12_21 = 200; + rcv_length = 0; + callback_rcv_length = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.21 Test......................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_21; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Check if the MSS option of server socket has calculated to the appropriate 88(server_socket's MSS) which the SYN,ACK packet from client socket carried*/ + if(client_socket.nx_tcp_socket_connect_mss != mss_option_12_21) + error_counter++; + + advanced_packet_process_callback = my_packet_process_12_21; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a 200-byte length message randomly. */ + rand_12_21(); + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, data_12_21, packet_length_12_21, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Check if the content of the callback_rcv_buffer which appended by all the received packets' payload is the data_12_18 sent before*/ + if(!memcmp(callback_rcv_buffer, data_12_21, packet_length_12_21)) + data_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status += nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Check for error. */ + if((error_counter !=0) || (syn_ack_counter != 1) || (data_counter != 2)) + { + printf("ERROR\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; +ULONG bytes_copied; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE))) + { + /*Check if the packet is fragmented by TCP layer.*/ + if(my_packet -> nx_packet_length > mss_option_12_21) + error_counter++; + + /* Retrieve data from packet to the receive buffer. */ + status = nx_packet_data_retrieve(my_packet, &rcv_buffer[rcv_length], &bytes_copied); + if(status) + error_counter++; + + rcv_length += bytes_copied; + } + + /*Check if the content which connected by all the received packets is the data_12_21 sent from the client socket*/ + if(!memcmp(rcv_buffer, data_12_21, packet_length_12_21)) + data_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void rand_12_21() +{ +UINT flag; +UINT j, k = 0; + + srand((unsigned)time(NULL)); + for(j = 0;j < 200;j++) + { + flag = rand() & 1; + if(flag) + data_12_21[k++] = 'A' + rand() % 26; + else + data_12_21[k++] = 'a' + rand() % 26; + } +} + + +static UINT my_packet_process_12_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#else +NX_IP_HEADER *ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + if((packet_ptr -> nx_packet_length) > 40) + { + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /*Check if the packet is fragmented by IP layer.*/ + if(!(ip_header_ptr->nx_ip_header_word_1& NX_IP_FRAGMENT_MASK)) + { + /*Check if the packet is fragmented by TCP layer*/ + if((packet_ptr->nx_packet_length - 40) > mss_option_12_21) + error_counter++; + } + else + error_counter++; + + /* Append the intercepted packet's content to the receive buffer. */ + memcpy(&callback_rcv_buffer[callback_rcv_length], packet_ptr->nx_packet_prepend_ptr + 40, packet_ptr -> nx_packet_length - 40); + callback_rcv_length = callback_rcv_length + packet_ptr -> nx_packet_length - 40; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + } + + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG option_words; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN+ACK packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* It is a SYN+ACK packet. */ + syn_ack_counter++; + + /*Get the MSS option kind*/ + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss_option_12_21); + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.21 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_12_23_test.c b/test/regression/netxduo_test/netx_12_23_test.c new file mode 100644 index 00000000..9f548825 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_23_test.c @@ -0,0 +1,315 @@ +/* 12.23 TCP MUST implement sending the MSS option. */ + +/* RFC 1122, Section 4.2.2.6, page 85, Maximum Segment Size Option: RFC-793 Section 3.1. +TCP MUST implement both sending and receiving the Maximum Segment Size option. */ + +/* Procedure +1. Client send a SYN to Server. +2. Check whether the packet during establishing the connection have the MSS option +*/ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; + + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_23_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.23 Test......................................."); + + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_23; + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter !=0 || syn_ack_counter != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_12_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG kind; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* This packet is from TCP ,this program is to check the MSS option. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + kind = (tcp_header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + if(kind == 2) + syn_ack_counter++; + + /* Point to default function */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Deal with default function */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_23_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.23 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_12_24_test.c b/test/regression/netxduo_test/netx_12_24_test.c new file mode 100644 index 00000000..2e0a93c9 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_24_test.c @@ -0,0 +1,375 @@ +/* 12.24 TCP SHOULD send MSS option in every SYN segment + when its receive MSS differs from the default 536. */ + +/* Procedure + 1. Client send a SYN to Server. + 2. Use advanced_packet_process function to receive and deal with the SYN packet, + then change the MSS. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG syn_ack_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_24_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_24_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + syn_ack_counter = 0; + + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 1", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 0", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the server socket to check the SYN segment*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_24; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.24 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the client socket to check the SYN+ACK segment*/ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_24_2; + + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter !=0) || (syn_counter != 1) || (syn_ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static void my_tcp_packet_receive_12_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; +ULONG mss_option; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* It is a SYN packet. */ + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss_option); + + if(mss_option != 536) + syn_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_12_24_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; + + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN,ACK packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* It is a SYN,ACK packet. */ + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + if(option_words == 2) + syn_ack_counter++; + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_24_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.24 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_12_25_test.c b/test/regression/netxduo_test/netx_12_25_test.c new file mode 100644 index 00000000..12de964f --- /dev/null +++ b/test/regression/netxduo_test/netx_12_25_test.c @@ -0,0 +1,454 @@ +/* 12.25 TCP MAY send MSS option in every SYN segment + even when its receive MSS value is same as the default 536. */ + +/* Procedure + 1. Client send a SYN to Server. + 2. Use packet_process function to receive and deal with the SYN packet, + then change the MSS to 536. + 3. Use packet_process function to receive and deal with the SYN packet, + Judge the MSS options. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG syn_ack_counter; + + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_12_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_25_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_25_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + syn_ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 1", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 0", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the server socket to check the SYN segment*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_25; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.25 Test......................................."); + + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + + /* Deal the SYN packet with my routing */ + advanced_packet_process_callback = my_packet_process_12_25; + + /*Let the client socket to check the SYN+ACK segment*/ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_25_2; + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter !=0) || (syn_counter != 1) || (syn_ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_12_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* This packet is the first incoming packet,this program is to send a SYN to Server. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Change the MSS. */ + *option_word_1 = *option_word_1 & 0xFFFF0000; + *option_word_1 = *option_word_1 | 536; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + + tcp_header_ptr -> nx_tcp_header_word_4 = tcp_header_ptr -> nx_tcp_header_word_4 & 0xFFFF0000; + + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; +ULONG mss_option; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* It is a SYN packet. */ + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss_option); + + if(mss_option == 536) + syn_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_12_25_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + if(option_words == 2) + syn_ack_counter++; + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.25 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_12_26_test.c b/test/regression/netxduo_test/netx_12_26_test.c new file mode 100644 index 00000000..67b2da51 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_26_test.c @@ -0,0 +1,472 @@ +/* 12.26 TCP over IPv6 MUST assume a default send MSS of 1220 if MSS + option is not received at connection setup When using TCP over IPv6, + the MSS must be computed as the maximum packet size minus 60 octets. */ + +/* Procedure + 1. Client send a SYN to Server. + 2. Use packet_process function to receive and deal with the SYN packet, + then change the MSS option. + 3. Use packet_process function to receive and deal with the SYN+ACK packet, + Check the MSS. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv6.h" +#else +#include "nx_ip.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_12_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_26_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "ntest 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + /* Create the main thread. */ + tx_thread_create(&ntest_1, "ntest 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2,64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_26; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /*Check if the packet has been received successfully*/ + if(syn_counter == 1) + { + /*Check if the connection has crashed*/ + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + } + else + error_counter++; + + if(server_socket.nx_tcp_socket_connect_mss != 1220) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.26 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Deal the SYN packet with my routing */ + advanced_packet_process_callback = my_packet_process_12_26; + + /* Call connect to send a SYN */ + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0 ) || (syn_counter != 1 )) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + + + + +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_12_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG *source_ip; +ULONG *dest_ip; +ULONG checksum; +ULONG mss; +ULONG option_words; + + /*The length of ipv6 header is 40.*/ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 40); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Modify the syn packet */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /*Get the option kind*/ + option_words = (tcp_header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER) + sizeof(NX_IPV6_HEADER)), option_words*sizeof(ULONG), &mss); + + /*The MSS must be com-puted as the maximum packet size minus 60 octets.*/ + if( mss != 1440) + error_counter++; + + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 40); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Change the MSS. */ + *option_word_1 = *option_word_1 & 0x00000000; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Modify the nx_packet_prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr += 40; + + /* Get the TCP packet length. */ + packet_ptr -> nx_packet_length -= 40; + + dest_ip = client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6; + source_ip = client_socket.nx_tcp_socket_ipv6_addr -> nxd_ipv6_address; + + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr->nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + + + + /* Return to the nx_packet_prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr -= 40; + + /* Return to the IP packet length. */ + packet_ptr -> nx_packet_length += 40; + + advanced_packet_process_callback = NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + + + +static void my_tcp_packet_receive_12_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receive syn packet */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Check if the packet don't have the mss option*/ + if(!(*option_word_1)) + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Point to default function */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Deal with default function */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_26_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.26 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_12_27_test.c b/test/regression/netxduo_test/netx_12_27_test.c new file mode 100644 index 00000000..0c807efb --- /dev/null +++ b/test/regression/netxduo_test/netx_12_27_test.c @@ -0,0 +1,491 @@ +/* 12.27 TCP MUST ignore MSS option in data segment When using TCP over IPv6, + the MSS must be computed as the maximum packet size minus 60 octets. */ + +/* Procedure + 1. Client connect with Server. + 2. Client sends a packet containing MSS options to Server. + 3. Judge the packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_counter; +static UCHAR data_12_27[20]; +static ULONG mss_option_12_27; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_27_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_counter = 0; + mss_option_12_27 = 20; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 1", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 0", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + status = nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1,64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2,64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_27; + status = nx_tcp_socket_receive(&server_socket,&my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((my_packet -> nx_packet_length == 20) && (!memcmp(my_packet -> nx_packet_prepend_ptr, data_12_27, 20))) + data_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + /* Check whether the server ignore the MSS options. */ + if(server_socket.nx_tcp_socket_connect_mss == mss_option_12_27) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.27 Test......................................."); + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send a SYN. */ + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_12_27; + _nx_tcp_packet_send_syn(&client_socket,client_socket.nx_tcp_socket_tx_sequence ); + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if((error_counter != 0) || (data_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + + +static void rand_12_27() +{ +UINT flag; +UINT j,k=0; + + srand((unsigned)time(NULL)); + for(j=0;j<20;j++) + { + flag=rand()%2; + if(flag) data_12_27[k++]='A'+rand()%26; + else data_12_27[k++]='a'+rand()%26; + } +} + +static UINT my_packet_process_12_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +NX_IPV6_HEADER *ip_header_ptr; +ULONG *source_ip, *dest_ip; +ULONG mss; +ULONG option_words; + + /*Create a data seg with mss option*/ + + ip_header_ptr = (NX_IPV6_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 40); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Construct a data segment with mss option based on the SYN packet*/ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /*Get the option kind*/ + option_words = (tcp_header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER) + sizeof(NX_IPV6_HEADER)), option_words*sizeof(ULONG), &mss); + + /*The MSS must be com-puted as the maximum packet size minus 60 octets.*/ + if( mss != 1440) + error_counter++; + + /*Delete the SYN bit.*/ + tcp_header_ptr -> nx_tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3 ^ NX_TCP_SYN_BIT; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Modify the MSS option value to 20*/ + *option_word_1 = *option_word_1 & 0xFFFF0000; + *option_word_1 = *option_word_1 | 0x00000014; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + rand_12_27(); + nx_packet_data_append(packet_ptr, data_12_27, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /*Modify the payload length of the IPv6 header.*/ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr->nx_ip_header_word_1); + ip_header_ptr->nx_ip_header_word_1 = ip_header_ptr->nx_ip_header_word_1 & 0x0000FFFF; + ip_header_ptr->nx_ip_header_word_1 = ip_header_ptr->nx_ip_header_word_1 | 0x00300000; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr->nx_ip_header_word_1); + + + + + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV6_HEADER); + + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + + dest_ip = client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6; + source_ip = client_socket.nx_tcp_socket_ipv6_addr -> nxd_ipv6_address; + + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr->nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); + + /* Modify the new sequence of client socket. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + return NX_TRUE; +} + + +static void my_tcp_packet_receive_12_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG option_words; +ULONG mss; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /*Check if both the sockets are in ESTABLISHED state*/ + if(server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + /*Get the option kind*/ + option_words = (tcp_header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss); + + if(mss == mss_option_12_27) + data_counter++; + + /* Point to default function */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + /* Deal with default function */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_27_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.27 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_12_30_test.c b/test/regression/netxduo_test/netx_12_30_test.c new file mode 100644 index 00000000..8262fcac --- /dev/null +++ b/test/regression/netxduo_test/netx_12_30_test.c @@ -0,0 +1,470 @@ +/* 12.30 TCP MAY send MSS option in every SYN segment even when its receive + MSS value is same as the default 1220 When using TCP over IPv6, the MSS + must be computed as the maximum packet size minus 60 octets. */ + +/* Update + nx_ram_network_driver_test.c and nx_ram_network_driver_test_1500.c */ + +/* Procedure + 1.Connect + 2.Validate the Client's connection_mss and the Server's connection_mss ?= 1500-60 */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) + +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG syn_ack_counter; + + + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_30(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_12_30(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_30_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_30_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + syn_ack_counter = 0; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "ntest 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + /* Create the main thread. */ + tx_thread_create(&ntest_1, "ntest 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2,64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_30; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.30 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + + /* Deal the SYN packet with my routing */ + advanced_packet_process_callback = my_packet_process_12_30; + + /*Let the client socket to check the SYN+ACK segment*/ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_30_2; + + /* Call connect to send a SYN */ + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0 ) || (syn_counter != 1) || (syn_ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process_12_30(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +ULONG option_words; +ULONG *source_ip, *dest_ip; +ULONG mss; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 40); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + /* This packet is the first incoming packet,this program is to send a SYN to Server. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /*Get the option kind*/ + option_words = (tcp_header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER) + sizeof(NX_IPV6_HEADER)), option_words*sizeof(ULONG), &mss); + + /*The MSS must be com-puted as the maximum packet size minus 60 octets.*/ + if( mss != 1440) + error_counter++; + + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Change the MSS. */ + *option_word_1 = *option_word_1 & 0xFFFF0000; + *option_word_1 = *option_word_1 | 1220; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Modify the nx_packet_prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr += 40; + + /* Get the TCP packet length. */ + packet_ptr -> nx_packet_length -= 40; + + dest_ip = client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6; + source_ip = client_socket.nx_tcp_socket_ipv6_addr -> nxd_ipv6_address; + + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr->nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + + /* Return to the nx_packet_prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr -= 40; + + /* Return to the IP packet length. */ + packet_ptr -> nx_packet_length += 40; + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_30(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; +ULONG mss_option; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* It is a SYN packet. */ + + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + /*Get the MSS option form the SYN packet.*/ + _nx_tcp_mss_option_get((packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER)), option_words*sizeof(ULONG), &mss_option); + + if(mss_option == 1220) + syn_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + + + +static void my_tcp_packet_receive_12_30_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; +ULONG option_words; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + option_words = (header_ptr -> nx_tcp_header_word_3 >> 28) - 5; + + if(option_words == 2) + syn_ack_counter++; + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_30_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.30 Test.......................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_12_31_test.c b/test/regression/netxduo_test/netx_12_31_test.c new file mode 100644 index 00000000..2df0daa7 --- /dev/null +++ b/test/regression/netxduo_test/netx_12_31_test.c @@ -0,0 +1,411 @@ +/* 12.31 TCP MUST be prepared to handle an illegal option length for MSS, in a SYN,ACK segment; a suggested procedure is to reset the connection. */ + +/* Procedure + 1.Intercept the ACK + SYN packet + 2.Modify the option_words to the 1220 + 3.Check whether the connection is reset */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_12_31(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_12_31_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, int protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_12_31(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_31_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.31 Test......................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 310, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_31; + + /*To handle the syn,ack packet.*/ + advanced_packet_process_callback = my_packet_process_12_31; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter != 0) || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_12_31_2; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_12_31(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN+ACK packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Modify the MSS length to 0*/ + *option_word_1 = *option_word_1 & 0xFF00FFFF; + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /*Put the packet pointer to tcp*/ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &server_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &server_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = server_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + + return NX_TRUE; +} + +static void my_tcp_packet_receive_12_31(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_1; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(header_ptr + 1); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN+ACK packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + if((*option_word_1 & 0x00FF0000) == 0) + syn_ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_12_31_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + + /*Check if the connection has been reset.*/ + if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + rst_counter++; + + /*If connection havn't been reset, give back, restore the TCP receive function.*/ + else if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_12_31_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 12.31 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_13_01_test.c b/test/regression/netxduo_test/netx_13_01_test.c new file mode 100644 index 00000000..f3c92847 --- /dev/null +++ b/test/regression/netxduo_test/netx_13_01_test.c @@ -0,0 +1,420 @@ +/* 13.01 A full-sized segment MUST be acknowledged within a time of 0.5 sec. */ + +/* RFC 1122, Section 4.2.3.2, page 96, When to Send an ACK Segment. + A TCP SHOULD implement a delayed ACK, but an ACK should not be excessively delayed; + in particular, the delay MUST be less than 0.5 seconds, and in a stream of full-sized + segments there SHOULD be an ACK for at least every second segment. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a full-sized packet to server. + 3. When server receives packet, activate timer. + 4. When server sends ACK packet, wake up server and client thread. + 5. When timer expired, check if segment has been acknowledged. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static TX_TIMER my_timer; +static UINT ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_13_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_13_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_timer_entry(ULONG); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + /* Check status. */ + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if(status) + error_counter++; + + /* Create an application timer. */ + status = tx_timer_create(&my_timer, "my time", + my_timer_entry, (ULONG) 0, + NX_IP_PERIODIC_RATE / 2, + NX_IP_PERIODIC_RATE / 2, + TX_NO_ACTIVATE); + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.01 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_13_01; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_13_01; + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == ip_1.nx_ip_interface[0].nx_interface_ip_mtu_size - 40) && + (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, ip_1.nx_ip_interface[0].nx_interface_ip_mtu_size - 40))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete timer. */ + tx_timer_delete(&my_timer); +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a full-sized packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, ip_1.nx_ip_interface[0].nx_interface_ip_mtu_size - 40, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Wait until client receives ACK packet. */ + tx_thread_suspend(&ntest_1); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (ack_counter != 1) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_timer_entry(ULONG l) +{ + /* Check if segment has been acknowledged. */ + if(ack_counter == 0) + error_counter++; + + /* Wake up the client thread. */ + tx_thread_resume(&ntest_1); +} + +static UINT my_packet_process_13_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if it is an ACK packet. */ + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + ack_counter++; + + /* ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_13_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is a SEG. */ + if(packet_ptr -> nx_packet_length == (ip_1.nx_ip_interface[0].nx_interface_ip_mtu_size - 20) && + (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, ip_1.nx_ip_interface[0].nx_interface_ip_mtu_size - 40))) + { + /* Start timer. */ + tx_timer_activate(&my_timer); + + /* Restore function pointer. */ + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass current packet to default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.01 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_13_02_test.c b/test/regression/netxduo_test/netx_13_02_test.c new file mode 100644 index 00000000..b3d14178 --- /dev/null +++ b/test/regression/netxduo_test/netx_13_02_test.c @@ -0,0 +1,414 @@ +/* 13.02 TCP SHOULD implement a delayed ACK, but the delay MUST be less than 0.5 sec. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a packet to server. + 3. When server receives packet, activate timer. + 4. When server sends ACK packet, wake up server and client thread. + 5. When timer expired, check if segment has been acknowledged. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static TX_TIMER my_timer; +static UINT ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_13_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_13_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_timer_entry(ULONG); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + /* Check status. */ + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if(status) + error_counter++; + + /* Create an application timer. */ + status = tx_timer_create(&my_timer, "my timer", + my_timer_entry, (ULONG) 0, + NX_IP_PERIODIC_RATE / 2, + NX_IP_PERIODIC_RATE / 2, + TX_NO_ACTIVATE); + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.02 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_13_02; + + advanced_packet_process_callback = my_packet_process_13_02; + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 2); + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete timer. */ + tx_timer_delete(&my_timer); + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a full-sized packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Wait until client receives ACK packet. */ + tx_thread_suspend(&ntest_1); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (ack_counter != 1) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_timer_entry(ULONG l) +{ + /* Check if segment has been acknowledged. */ + if(ack_counter == 0) + error_counter++; + + /* Wake up the client thread. */ + tx_thread_resume(&ntest_1); +} + +static UINT my_packet_process_13_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if it is an ACK packet. */ + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + ack_counter++; + + /* ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_13_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is a SEG. */ + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + { + /* Restore function pointer. */ + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Start timer. */ + tx_timer_activate(&my_timer); + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass current packet to default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.02 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_13_04_test.c b/test/regression/netxduo_test/netx_13_04_test.c new file mode 100644 index 00000000..e26b54ae --- /dev/null +++ b/test/regression/netxduo_test/netx_13_04_test.c @@ -0,0 +1,404 @@ +/* 13.04 TCP SHOULD be capable of queuing out-of-order segments. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a packet that is out of order. + 3. Client sends a packet that is in order. + 5. Server receives packets successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UCHAR data_13_04[50]; +static UCHAR rcv_buffer[50]; +static UINT rcv_length; +/* Define thread prototypes. */ + +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void rand_13_04(); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + rcv_length = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + + + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +ULONG bytes_copied; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Established the connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE))) + { + data_packet_counter++; + + /* Retrieve data from packet to the receive buffer. */ + status = nx_packet_data_retrieve(packet_ptr, &rcv_buffer[rcv_length], &bytes_copied); + if(status) + error_counter++; + + rcv_length += bytes_copied; + bytes_copied = 0; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if((data_packet_counter != 2) || (rcv_length != 40) || (memcmp(rcv_buffer, (void*)data_13_04, rcv_length))) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +UINT old_threshold; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.04 Test......................................."); + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a 40-byte length message randomly. */ + rand_13_04(); + + /* Modify tx_sequence. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, &data_13_04[20], 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Modify tx_sequence. */ + client_socket.nx_tcp_socket_tx_sequence -= 40; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, data_13_04, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disable preemption from IP thread. */ + tx_thread_preemption_change(&ntest_1, 0, &old_threshold); + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Modify tx_sequence. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + + /* Enable preemption from IP thread. */ + tx_thread_preemption_change(&ntest_1, old_threshold, &old_threshold); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0) || (data_packet_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void rand_13_04() +{ +UINT flag; +UINT j,k=0; + + srand((unsigned)time(NULL)); + for(j=0;j<40;j++) + { + flag=rand()%2; + if(flag) data_13_04[k++]='A'+rand()%26; + else data_13_04[k++]='a'+rand()%26; + } + +} + + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.04 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_13_05_test.c b/test/regression/netxduo_test/netx_13_05_test.c new file mode 100644 index 00000000..e92224cc --- /dev/null +++ b/test/regression/netxduo_test/netx_13_05_test.c @@ -0,0 +1,439 @@ +/* 13.05 TCP MAY send an ACK segment acknowledging RCV.NXT for valid out-of-order data segments. */ + +/* Procedure + 1. Client connects to server. + 2. Client sends a packet out of order. + 3. Check if server replies an ACK segment acknowledging RCV.NXT. + 4. Client sends a packet in order. + 5. Check if server receives data successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UCHAR data_13_05[50]; +static UCHAR rcv_buffer[50]; +static UINT rcv_length; +static ULONG is_acked; +static ULONG expected_seq; +/* Define thread prototypes. */ + +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_13_05(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void rand_13_05(); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_05_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + rcv_length = 0; + is_acked = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + + + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +ULONG bytes_copied; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Established the connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE))) + { + data_packet_counter++; + + /* Retrieve data from packet to the receive buffer. */ + status = nx_packet_data_retrieve(packet_ptr, &rcv_buffer[rcv_length], &bytes_copied); + if(status) + error_counter++; + + rcv_length += bytes_copied; + bytes_copied = 0; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if((data_packet_counter != 2) || (rcv_length != 40) || (memcmp(rcv_buffer, (void*)data_13_05, rcv_length))) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +UINT old_threshold; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.05 Test......................................."); + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_13_05; + + /* Record expected sequence of client. */ + expected_seq = client_socket.nx_tcp_socket_tx_sequence; + + /* Create a 40-byte length message randomly. */ + rand_13_05(); + + /* Modify tx_sequence. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, &data_13_05[20], 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Modify tx_sequence. */ + client_socket.nx_tcp_socket_tx_sequence -= 40; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, data_13_05, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disable preemption from IP thread. */ + tx_thread_preemption_change(&ntest_1, 0, &old_threshold); + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Modify tx_sequence. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + + /* Enable preemption from IP thread. */ + tx_thread_preemption_change(&ntest_1, old_threshold, &old_threshold); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0) || (data_packet_counter != 2) || (is_acked != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void rand_13_05() +{ +UINT flag; +UINT j,k=0; + + srand((unsigned)time(NULL)); + for(j=0;j<40;j++) + { + flag=rand()%2; + if(flag) data_13_05[k++]='A'+rand()%26; + else data_13_05[k++]='a'+rand()%26; + } + +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_13_05(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + if(expected_seq == header_ptr -> nx_tcp_acknowledgment_number) + is_acked = NX_TRUE; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Deal with default function */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_05_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.05 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_13_17_test.c b/test/regression/netxduo_test/netx_13_17_test.c new file mode 100644 index 00000000..90102c31 --- /dev/null +++ b/test/regression/netxduo_test/netx_13_17_test.c @@ -0,0 +1,402 @@ +/* 13.17 In a stream of full-sized segments there SHOULD be an ACK for at least every second segment. */ + +/* Procedure + 1. Client connects to server. + 2. Server sends a stream of full-sized segments(4 segments) to Client. + 3. Check if client sends more than 2 ACK packet to Server. */ + +/* The check logic of ACK packets is incorrect. NetXDuo implements it by defining NX_TCP_ACK_EVERY_N_PACKETS to 2. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +#include + +extern void test_control_return(UINT status); + +#if 0 +/*#ifndef NX_TCP_ACK_EVERY_N_PACKETS*/ + +#define DEMO_STACK_SIZE 2048 + + + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static INT is_acked_every_2seg; + +static UCHAR rcv_buffer[352]; +static UINT rcv_length; +static UCHAR data_13_17[352]; +static ULONG mss_option_13_17; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *client_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *client_socket); +static void rand_13_17(); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_13_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + rcv_length = 0; + is_acked_every_2seg = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512*16); + pointer = pointer + 512*16; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet; + ULONG bytes_copied; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 13.17 Test......................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while(!(nx_tcp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE))) + { + + /* Retrieve data from packet to the receive buffer. */ + status = nx_packet_data_retrieve(my_packet, &rcv_buffer[rcv_length], &bytes_copied); + if(status) + error_counter++; + + rcv_length += bytes_copied; + } + + /*Check if the content which connected by all the received packets is the data_13_17 sent from the client socket*/ + if(memcmp(rcv_buffer, data_13_17, rcv_length)) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + status += nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter ==0) && (is_acked_every_2seg == NX_TRUE) && (ack_counter >= 2)) + { + printf("SUCCESS!\n"); + test_control_return(0); + + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } + +} + + +/* Define the test threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the server socket to check the ACK segment*/ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_13_17; + + mss_option_13_17 = server_socket.nx_tcp_socket_connect_mss; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 80, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a 4*mss_option_13_17 length message randomly. */ + rand_13_17(); + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, data_13_17, 4*mss_option_13_17, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + + +static void rand_13_17() +{ +UINT flag; +UINT j, k = 0; + + srand((unsigned)time(NULL)); + for(j = 0;j < 4*mss_option_13_17;j++) + { + flag = rand() & 1; + if(flag) + data_13_17[k++] = 'A' + rand() % 26; + else + data_13_17[k++] = 'a' + rand() % 26; + } +} + + + +static void my_tcp_packet_receive_13_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a ACK packet. */ + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + { + + ack_counter++; + + if(ack_counter >= (server_socket.nx_tcp_socket_packets_sent >> 1)) + is_acked_every_2seg = NX_TRUE; + } + else if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_13_17_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 13.17 Test.......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_14_19_test.c b/test/regression/netxduo_test/netx_14_19_test.c new file mode 100644 index 00000000..31805f8f --- /dev/null +++ b/test/regression/netxduo_test/netx_14_19_test.c @@ -0,0 +1,345 @@ +/* 14.19 TCP MUST include an SWS avoidance algorithm in the receiver when effective send MSS < (1/ 2)*RCV_BUFF. */ + +/* Procedure + 1.Connection successfully + 2.First Client sends 40 data to Server, then check if the last_sent changed + 3.Then Client sends more 20 data to Server, also check if the last_sent changed + 4.If the last_sent changed, the SWS avoidance algorithm has not been used. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "----------abcdefgh20----------ABCDEFGH40----------klmnopqr60----------KLMNOPQR80--------------------" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UINT is_included; +static ULONG mss_option; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_14_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_included = NX_FALSE; + mss_option = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; +ULONG window_last_sent; +ULONG rcv_length; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 14.19 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + tx_thread_suspend(&ntest_0); + + window_last_sent = server_socket.nx_tcp_socket_rx_window_last_sent; + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == mss_option - 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, mss_option - 20))) + data_packet_counter++; + + rcv_length = rcv_packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Check whether the premise 'effective send MSS < (1/ 2)*RCV_BUFF' is satisfied. */ + if((data_packet_counter == 1) && (rcv_length <= server_socket.nx_tcp_socket_connect_mss) && (server_socket.nx_tcp_socket_connect_mss < (0.5 * server_socket.nx_tcp_socket_rx_window_default))) + if(window_last_sent == server_socket.nx_tcp_socket_rx_window_last_sent) + is_included = NX_TRUE; + + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +char *msg = MSG; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + mss_option = client_socket.nx_tcp_socket_connect_mss; + + + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, msg, mss_option - 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the my_packet0 */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 1) || (is_included != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_14_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 14.19 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_14_20_test.c b/test/regression/netxduo_test/netx_14_20_test.c new file mode 100644 index 00000000..94a03aa3 --- /dev/null +++ b/test/regression/netxduo_test/netx_14_20_test.c @@ -0,0 +1,343 @@ +/* 14.19 TCP MUST include an SWS avoidance algorithm in the receiver when effective send MSS < (1/ 2)*RCV_BUFF. */ + +/* Procedure + 1.Connection successfully + 2.First Client sends 40 data to Server, then check if the last_sent changed + 3.Then Client sends more 20 data to Server, also check if the last_sent changed + 4.If the last_sent changed, the SWS avoidance algorithm has not been used. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "----------abcdefgh20----------ABCDEFGH40----------klmnopqr60----------KLMNOPQR80--------------------" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UINT is_included; +static ULONG mss_option; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_14_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_included = NX_FALSE; + mss_option = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; +ULONG window_last_sent; +ULONG rcv_length; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 14.20 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_0); + + window_last_sent = server_socket.nx_tcp_socket_rx_window_last_sent; + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == mss_option) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, mss_option))) + data_packet_counter++; + + rcv_length = rcv_packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + if((data_packet_counter == 1) && (rcv_length <= server_socket.nx_tcp_socket_connect_mss) && (server_socket.nx_tcp_socket_connect_mss >= (0.5 * server_socket.nx_tcp_socket_rx_window_default))) + if(window_last_sent != server_socket.nx_tcp_socket_rx_window_last_sent) + is_included = NX_TRUE; + + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +char *msg = MSG; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + mss_option = client_socket.nx_tcp_socket_connect_mss; + + + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, msg, mss_option, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the my_packet0 */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 1) || (is_included != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_14_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 14.20 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_15_03_test.c b/test/regression/netxduo_test/netx_15_03_test.c new file mode 100644 index 00000000..7e1d56eb --- /dev/null +++ b/test/regression/netxduo_test/netx_15_03_test.c @@ -0,0 +1,394 @@ +/* 15.03 If a retransmitted packet is identical to the original packet, then the same IP identification field MAY be used. */ + +/* Procedure +1. Set 'nx_ipv4_packet_receive' pointer of server ip instance to 'my_ipv4_packet_receive_15_03' to deal with ip packet. +2. Client sends data to server. +3. Server drop the data packet in 'my_ipv4_packet_receive_15_03'. +4. Client retransmits data to server. +5. Server compares the TCP data and in 'my_ipv4_packet_receive_15_03' IP identification field. */ + +/* Warning: NetX does not use the same IP identification. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if !defined(NX_ENABLE_INTERFACE_CAPABILITY) && !defined(NX_DISABLE_TCP_TX_CHECKSUM) && !defined(NX_DISABLE_TCP_RX_CHECKSUM) && !defined(NX_DISABLE_IPV4) +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG expected_id; +static ULONG drop_counter; +static ULONG is_identical_id; +static ULONG data_counter; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_15_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_counter = 0; + is_identical_id = NX_FALSE; + data_counter = 0; + expected_id = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.03 Test......................................."); + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_15_03; + + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Determine if the test was successful. */ + if((error_counter !=0) || (drop_counter != 1) || (data_counter == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(is_identical_id != NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, the connection has established. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + if((packet_ptr -> nx_packet_length == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + + +static UINT my_packet_process_15_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#else +NX_IP_HEADER *ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + /* Drop the packet. */ + if ((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + if(drop_counter == 0) + { + /* Record the packet's IP identification. */ + expected_id = (ip_header_ptr -> nx_ip_header_word_1 & NX_LOWER_16_MASK); + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + drop_counter++; + } + else + { + if(expected_id == (ip_header_ptr -> nx_ip_header_word_1 & NX_LOWER_16_MASK)) + is_identical_id = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + + /* Wake up server and client threads. */ + tx_thread_resume(&ntest_0); + tx_thread_resume(&ntest_1); + + } + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_03_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 15.03 Test.......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_15_20_test.c b/test/regression/netxduo_test/netx_15_20_test.c new file mode 100644 index 00000000..470602df --- /dev/null +++ b/test/regression/netxduo_test/netx_15_20_test.c @@ -0,0 +1,460 @@ +/* 15.20 If a retransmitted packet differs from the original packet in the window value,then the same IP identification field MUST NOT be used. */ + +/* Procedure + 1.Connection successfully + 2.Record the 1st coming IP_ID to ip_id_15_20 + 3.Drop this packet and wait for the retransmitted packet + 4.Modify retransmitted packet's WINDOW value + 5.Check the retransmitted packet's IP_ID ?= ip_id_15_20 */ + +/*The NetX doesn't judge the acknowledgement field of the retransmitted packet, it uses the different IP identification when send every packet.*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG retrans_packet_counter; +static UINT is_different; + +static ULONG ip_id_15_20; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_15_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_15_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + retrans_packet_counter = 0; + is_different = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(client_socket.nx_tcp_socket_transmit_sent_head, MSG + 20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + client_socket.nx_tcp_socket_tx_sequence += 20; + + /* Increase the window size so the retransmitted packet is different from the original one. */ + client_socket.nx_tcp_socket_rx_window_current++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (retrans_packet_counter != 1) || (data_packet_counter != 1) || (is_different != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.20 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_15_20; + advanced_packet_process_callback = my_packet_process_15_20; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((my_packet -> nx_packet_length == 40) && (!memcmp(my_packet -> nx_packet_prepend_ptr, MSG, 40))) + retrans_packet_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_15_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +ULONG *source_ip, *dest_ip; +ip_header_ptr = (NX_IPV4_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); +#elif defined(__PRODUCT_NETX__) +NX_IP_HEADER *ip_header_ptr; +ULONG source_ip, dest_ip; +ip_header_ptr = (NX_IP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + if ((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + ip_id_15_20 = (ip_header_ptr -> nx_ip_header_word_1 & NX_LOWER_16_MASK); + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + data_packet_counter++; + } + + else if ((packet_ptr -> nx_packet_length - 40 == 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 40))) + { +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_0.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_15_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +ip_header_ptr = (NX_IPV4_HEADER *)(packet_ptr -> nx_packet_prepend_ptr - 20); +#else +NX_IP_HEADER *ip_header_ptr; +ip_header_ptr = (NX_IP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr - 20); +#endif + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + if ((packet_ptr -> nx_packet_length - 20 == 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 40))) + { + if(ip_id_15_20 != (ip_header_ptr -> nx_ip_header_word_1 & NX_LOWER_16_MASK)) + is_different = NX_TRUE; + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.20 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_15_21_test.c b/test/regression/netxduo_test/netx_15_21_test.c new file mode 100644 index 00000000..0a55893d --- /dev/null +++ b/test/regression/netxduo_test/netx_15_21_test.c @@ -0,0 +1,469 @@ +/* 15.21 If a retransmitted packet differs from the original packet in the acknowledgement field, the same IP identification field MUST NOT be used. */ + +/* Procedure + 1.Connection successfully + 2.Record the 1st coming IP_ID to ip_id_15_21 + 3.Drop this packet and wait for the retransmitted packet + 4.Modify retransmitted packet's Acknowledgement field + 5.Check the retransmitted packet's IP_ID ?= ip_id_15_21 */ + +/*The NetX doesn't judge the acknowledgement field of the retransmitted packet, it uses the different IP identification when send every packet.*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#else +#include "nx_ip.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +#define MSG "----------abcdefgh20----------ABCDEFGH40----------klmnopqr60----------KLMNOPQR80----------" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG drop_counter; +static ULONG ip_id_15_21; +static UINT is_different; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, int, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_15_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + drop_counter = 0; + is_different = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; +NX_TCP_HEADER *retransmit_header; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.21 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_15_21; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&server_socket , my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_transmit_sent_head) + { + retransmit_header = (NX_TCP_HEADER *)(server_socket.nx_tcp_socket_transmit_sent_head -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(retransmit_header -> nx_tcp_acknowledgment_number); + + /* Modify the packet's acknowledgement field*/ + retransmit_header -> nx_tcp_acknowledgment_number --; + + NX_CHANGE_ULONG_ENDIAN(retransmit_header -> nx_tcp_acknowledgment_number); + + } + else + { + error_counter++; + } + + tx_thread_suspend(&ntest_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (drop_counter != 1) || (data_packet_counter != 1) || (is_different != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_15_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum = 0; +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +NX_IP_HEADER *ip_header_ptr; +#else +#error "NetX Product undefined." +#endif + + if (packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); +#elif defined(__PRODUCT_NETX__) + ip_header_ptr = (NX_IP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); +#endif + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr+20); + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + if (drop_counter == 0) + { + ip_id_15_21 = (ip_header_ptr -> nx_ip_header_word_1 & (~NX_LOWER_16_MASK)); + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + drop_counter ++; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + return NX_TRUE; + + } + else + { + if(ip_id_15_21 != (ip_header_ptr -> nx_ip_header_word_1 & (~NX_LOWER_16_MASK))) + is_different = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + tx_thread_resume(&ntest_0); + tx_thread_resume(&ntest_1); + + } + + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + + checksum = ~checksum & NX_LOWER_16_MASK; + +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.21 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_15_24_test.c b/test/regression/netxduo_test/netx_15_24_test.c new file mode 100644 index 00000000..b6b79508 --- /dev/null +++ b/test/regression/netxduo_test/netx_15_24_test.c @@ -0,0 +1,375 @@ +/* 15.24 TCP MUST include 'exponential backoff' (check that it increases) for successive RTO values for sending data segments. */ + +/* Procedure + 1. Client sends data to server. + 2. When server receives packet for the first three times, check RTO and drop the packet. + 3. Check if server receives data successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG drop_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_15_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_24_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.24 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, the connection has established. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Init transmit configure. */ + status = nx_tcp_socket_transmit_configure(&server_socket, server_socket.nx_tcp_socket_transmit_queue_maximum, + server_socket.nx_tcp_socket_timeout_rate, server_socket.nx_tcp_socket_timeout_max_retries, 1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_15_24; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&server_socket , my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Wait for the retransmit. */ + tx_thread_suspend(&ntest_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Wait until retransmit. */ + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && + (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (drop_counter != 2) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_15_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + /* Drop packet three times. */ + if ((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + + if(drop_counter < 2) + { + + /* Check if successive RTO increases as 'exponential backoff'. */ + if(server_socket.nx_tcp_socket_timeout != (server_socket.nx_tcp_socket_timeout_rate << (drop_counter * server_socket.nx_tcp_socket_timeout_shift))) + { + error_counter++; + } + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + drop_counter++; + } + else + { + advanced_packet_process_callback = NX_NULL; + + /* Wake up server and client thread. */ + tx_thread_resume(&ntest_0); + tx_thread_resume(&ntest_1); + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_24_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.24 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_15_25_test.c b/test/regression/netxduo_test/netx_15_25_test.c new file mode 100644 index 00000000..b2ffed65 --- /dev/null +++ b/test/regression/netxduo_test/netx_15_25_test.c @@ -0,0 +1,344 @@ +/* 15.25 TCP MUST include exponential backoff(check that it increases) for successive RTO values for sending SYN segments. */ + +/* Procedure + 1. Client sends SYN to server. + 2. When server receives SYN packet for the first three times, check RTO and drop the packet. + 3. Check if client connects to server successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG drop_counter; +static ULONG syn_counter; + +/* Define thread prototypes. */ + +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_15_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_25_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Init transmit configure. */ + status = nx_tcp_socket_transmit_configure(&client_socket, client_socket.nx_tcp_socket_transmit_queue_maximum, + client_socket.nx_tcp_socket_timeout_rate, client_socket.nx_tcp_socket_timeout_max_retries, 1); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_15_25; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 100 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (drop_counter != 1) || (syn_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.25 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, the connection has established. */ + status = nx_tcp_server_socket_accept(&server_socket, 100 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_15_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Drop packet three times. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + syn_counter++; + + if(drop_counter == 0) + { + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + drop_counter++; + } + else + { + /* Check if successive RTO increases as 'exponential backoff'. */ + if(client_socket.nx_tcp_socket_timeout != (client_socket.nx_tcp_socket_timeout_rate << (drop_counter * client_socket.nx_tcp_socket_timeout_shift))) + { + error_counter++; + } + + advanced_packet_process_callback = NX_NULL; + + /* Wake up server and client thread. */ + tx_thread_resume(&ntest_0); + tx_thread_resume(&ntest_1); + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + } + } + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.25 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_15_26_test.c b/test/regression/netxduo_test/netx_15_26_test.c new file mode 100644 index 00000000..ab70efd1 --- /dev/null +++ b/test/regression/netxduo_test/netx_15_26_test.c @@ -0,0 +1,321 @@ +/* 15.26 TCP SHOULD use RTO = 3 sec initially. */ + +/* Procedure + 1. Client sends SYN packet to server. + 2. When the packet passed to driver, check RTO of client. */ + +/* Warning: TCP SHOULD use RTO = 1 sec initially. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_system.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UINT need_warning; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_15_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_26_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + need_warning = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Capture the packet send to server. */ + advanced_packet_process_callback = my_packet_process_15_26; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(need_warning == NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.26 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_15_26(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG three_second; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + three_second = NX_IP_PERIODIC_RATE; + three_second += (NX_IP_PERIODIC_RATE << 1); + + /* Check if RTO = 3 sec. */ + if(client_socket.nx_tcp_socket_timeout != three_second) + need_warning = NX_TRUE; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + advanced_packet_process_callback = NULL; + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_15_26_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 15.26 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_16_02_test.c b/test/regression/netxduo_test/netx_16_02_test.c new file mode 100644 index 00000000..c96f85ce --- /dev/null +++ b/test/regression/netxduo_test/netx_16_02_test.c @@ -0,0 +1,370 @@ +/* 16.02 Even if the receive window is closed indefinitely, the sending TCP MUST allow the connection to stay open as long as probes are acknowledged. */ + +/* Update + 1. nx_tcp_fast_periodic_processing.c between line 199 and line 271. + 2. nx_tcp_socket_state_ack_check.c between line 436 and 441, line 536. */ + +/* Procedure + 1. Set 'nx_ip_tcp_packet_receive' pointer of client ip instance to 'my_tcp_packet_receive_16_02' to deal with ACK packet. + 2. Client sends data to server whose length equals window size of server . + 3. Server sends back ACK with window size 0. + 4. Client sends probe to server. + 5. Server sends back ACK with window size 0. + 6. Server receives data and window size is back to original. + 7. Check if connection is still open. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG server_window; +static ULONG ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_16_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup function pointer to deal with ACK packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_16_02; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, server_window, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check if connection is still open. */ + if((ack_counter != 1) || (client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter != 1) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.02 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 20, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + server_window = server_socket.nx_tcp_socket_rx_window_current; + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == server_window) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, server_window))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_16_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + /* Check the window size. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_LOWER_16_MASK) == 0) + ack_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Pass current packet to default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.02 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_16_17_test.c b/test/regression/netxduo_test/netx_16_17_test.c new file mode 100644 index 00000000..48a1ea36 --- /dev/null +++ b/test/regression/netxduo_test/netx_16_17_test.c @@ -0,0 +1,315 @@ +/* 16.17 A TCP MAY keep its offered receive window closed indefinitely. */ + +/* Procedure + 1. Client connect to Server. + 2. Client send a packet to Server,the size of packet is same as Server's receive window size. + 3. Check the Server's receive window size. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG server_window; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.17 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + server_window = server_socket.nx_tcp_socket_rx_window_current; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_rx_window_current != 0) + error_counter++; + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send a SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, server_window, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.17 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_16_19_test.c b/test/regression/netxduo_test/netx_16_19_test.c new file mode 100644 index 00000000..04e6bf8a --- /dev/null +++ b/test/regression/netxduo_test/netx_16_19_test.c @@ -0,0 +1,360 @@ +/* 16.19 A sending TCP MUST be robust against window shrinking, which may cause the "usable window" to become negative. */ + +/* Procedure + 1.Connection successfully. + 2.Modify the rx window size of the server socket to 20. + 3.Client sends 40 data to Server. + 4.Check whether Server socket receive the packet and whether the server socket's state change. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG queue_count; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +UINT data_counter; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.19 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + server_socket.nx_tcp_socket_rx_window_current = 20; + + queue_count = server_socket.nx_tcp_socket_receive_queue_count; + + + tx_thread_suspend(&ntest_0); + + /* Check whether the packet is queued. */ + if(server_socket.nx_tcp_socket_receive_queue_count != (queue_count + 1)) + error_counter++; + + /* Check Client socket's state. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Receive the first part data that in window, then upate the window. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter ++; + } + else + { + data_counter = packet_ptr -> nx_packet_length; + nx_packet_release(packet_ptr); + } + + /* Receive the second part data that out of window, the data out of window should be retransmitted. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + data_counter += packet_ptr -> nx_packet_length; + nx_packet_release(packet_ptr); + } + + /* Check the data counter. */ + if (data_counter != 40) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 3 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 40, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Let ntest_0 receive the data. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 3 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.19 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_16_21_test.c b/test/regression/netxduo_test/netx_16_21_test.c new file mode 100644 index 00000000..483a07b5 --- /dev/null +++ b/test/regression/netxduo_test/netx_16_21_test.c @@ -0,0 +1,385 @@ +/* 16.21 TCP SHOULD send the first zero window probe when the receiver window size remains zero for the retransmission timeout period. */ + +/* Procedure + 1. Set 'nx_ip_tcp_packet_receive' pointer of client ip instance to 'my_tcp_packet_receive_16_21' to deal with ACK packet. + 2. Client sends data whose length equals window size of server to server. + 3. Server sends back ACK with window size 0. + 4. Client sends probe to server. + 5. Server sends back ACK with window size 0. + 6. Server receives data and window size is back to original. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if !defined(__PRODUCT_NETXDUO__) || defined(NX_DISABLE_IPV4) +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_21_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 16.21 Test.......................................N/A\n"); + test_control_return(3); +} +#else + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG server_window; +static ULONG ack_counter; +static ULONG data_packet_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_16_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_21_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup function pointer to deal with ACK packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_16_21; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, server_window, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a packet to send one byte. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 1, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + + /* Send should fail since window is zero. */ + if(!status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check if connection is still open. */ + if(ack_counter != 1) + error_counter++; + + + tx_thread_resume(&ntest_1); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter != 1) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.21 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 20, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + server_window = server_socket.nx_tcp_socket_rx_window_current; + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == server_window) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, server_window))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_16_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + /* Check the window size. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_LOWER_16_MASK) == 0) + ack_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Pass current packet to default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#endif diff --git a/test/regression/netxduo_test/netx_16_22_test.c b/test/regression/netxduo_test/netx_16_22_test.c new file mode 100644 index 00000000..8c134fdb --- /dev/null +++ b/test/regression/netxduo_test/netx_16_22_test.c @@ -0,0 +1,391 @@ +/* 16.22 TCP SHOULD increase exponentially the interval between successive zero window probes. */ + +/* Procedure + 1. Set 'nx_ip_tcp_packet_receive' pointer of client ip instance to 'my_tcp_packet_receive_16_21' to deal with ACK packet. + 2. Client sends data whose length equals window size of server to server. + 3. Server sends back ACK with window size 0. + 4. Client sends probe to server. + 5. Server sends back ACK with window size 0. + 6. Server receives data and window size is back to original. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if !defined(__PRODUCT_NETXDUO__) || defined(NX_DISABLE_IPV4) +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_22_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 16.22 Test.......................................N/A\n"); + test_control_return(3); +} +#else + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG server_window; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_16_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_16_22_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 16.22 Test......................................."); + + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Modify the timeout_shift transmit parameter of the client aocket. */ + status = nx_tcp_socket_transmit_configure(&client_socket, client_socket.nx_tcp_socket_transmit_queue_maximum, + client_socket.nx_tcp_socket_timeout_rate, client_socket.nx_tcp_socket_timeout_max_retries, 1); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Setup function pointer to deal with ACK packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_16_22; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, server_window, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a packet to send one byte. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 1, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + + /* Send should fail since window is zero. */ + if(!status) + error_counter++; + + /* Sleep 3 seconds ticks to wait for the successive zero window probes.*/ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + tx_thread_resume(&ntest_1); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 20, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + server_window = server_socket.nx_tcp_socket_rx_window_current; + + /* Wait until both ACK received. */ + tx_thread_suspend(&ntest_1); + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket,&packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, (void*)MSG, packet_ptr -> nx_packet_length) || (packet_ptr -> nx_packet_length != 20)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_16_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if it is an ACK packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_LOWER_16_MASK)) + { + if(ack_counter == 0) + ack_counter++; + else + { + /* Check if TCP increase exponentially the interval between successive zero window probes. */ + if(client_socket.nx_tcp_socket_timeout == + client_socket.nx_tcp_socket_timeout_rate << (ack_counter * client_socket.nx_tcp_socket_timeout_shift)) + ack_counter++; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass current packet to default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#endif diff --git a/test/regression/netxduo_test/netx_17_17_test.c b/test/regression/netxduo_test/netx_17_17_test.c new file mode 100644 index 00000000..263fe7ca --- /dev/null +++ b/test/regression/netxduo_test/netx_17_17_test.c @@ -0,0 +1,378 @@ +/* 17.17 The TTL value used to send TCP segments MUST be configurable. */ + +/* Procedure + 1. Client connects to server. + 2. Modify TTL of client. + 3. Client sends a new packet to server using modified TTL. + 4. Server receives packets successfully. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG client_TTL; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT my_packet_process_17_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_17_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + client_TTL = 10; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 17.17 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_17_17; + + /* Modify the client socket's TTL. */ + client_socket.nx_tcp_socket_time_to_live = client_TTL; + + /* Create a packet to send. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Send packet to server. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check status... */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check status... */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + else + { + if((packet_ptr -> nx_packet_length == 0) || (memcmp(packet_ptr -> nx_packet_prepend_ptr, (void*)MSG, packet_ptr -> nx_packet_length))) + error_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_17_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +#elif defined(__PRODUCT_NETX__) +NX_IP_HEADER *ip_header_ptr; +#endif + +ULONG TTL; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); +#elif defined(__PRODUCT_NETX__) + ip_header_ptr = (NX_IP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + /* Check the TTL value of the packet. */ + TTL = ip_header_ptr -> nx_ip_header_word_2; + TTL = TTL >> 24; + if(TTL == client_TTL) + { + data_packet_counter++; + advanced_packet_process_callback = NULL; + } + + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_17_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 17.17 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_18_21_test.c b/test/regression/netxduo_test/netx_18_21_test.c new file mode 100644 index 00000000..0c91493a --- /dev/null +++ b/test/regression/netxduo_test/netx_18_21_test.c @@ -0,0 +1,371 @@ +/* 18.21 TCP MAY aggregate data requested by an application for + sending until accumulated data exceeds effective send MSS. */ + +/* Procedure + 1. Client connect with Server. + 2. Client send packet to Server. + 3. Server receives the packet. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG is_aggregated; +static ULONG mss_option_18_21; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_18_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_18_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_aggregated = NX_FALSE; + mss_option_18_21 = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 18.21 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send a SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Get the MSS value of the connected socket. */ + mss_option_18_21 = client_socket.nx_tcp_socket_connect_mss; + + /* Create one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet1, MSG, 40, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Send the first packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, mss_option_18_21 - 40, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Send the first packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check status... */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check status... */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter == 0) && (is_aggregated == NX_TRUE)) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else if((error_counter == 0) && (is_aggregated == NX_FALSE) && (data_packet_counter == 2)) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_18_21; + + while(!(status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE))) + { + + if(((packet_ptr -> nx_packet_length == 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (void*)MSG, 40))) || + ((packet_ptr -> nx_packet_length == mss_option_18_21 - 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (void*)MSG, mss_option_18_21 - 40)))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_18_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If the packets are aggregated. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_PSH_BIT) && (packet_ptr -> nx_packet_length - 20 == mss_option_18_21) && + (!memcmp((packet_ptr -> nx_packet_prepend_ptr + 20), (void*)MSG, 40)) && (!memcmp((packet_ptr -> nx_packet_prepend_ptr + 60), (void*)MSG, (mss_option_18_21 - 40)))) + is_aggregated = NX_TRUE; + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_18_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 18.21 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_01_test.c b/test/regression/netxduo_test/netx_1_01_test.c new file mode 100644 index 00000000..e7ee4e85 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_01_test.c @@ -0,0 +1,347 @@ +/* 1.01 TCP MUST send a SYN,ACK in response to a SYN in LISTEN state. */ + +/* Procedure + 1. Check the state of server is LISTEN. + 2. Client sends a SYN packet. + 3. Check the packet is a SYN one. + 4. Server replies a packet. + 5. Check the packet is a SYN + ACK one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG syn_ack_counter; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_01_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + syn_counter = 0; + syn_ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + + printf("NetX Test: TCP Spec 1.01 Test........................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state of server is LISTEN. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_01; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + /* Check for error. */ + if (status) + error_counter++; + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ + UINT status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_01_2; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter||syn_counter!=1||syn_ack_counter!=1) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void my_tcp_packet_receive_1_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT ) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + /* If receives other packet, it is error. */ + else + error_counter++; + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_tcp_packet_receive_1_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether the packet is a SYN+ACK packet which responsing the SYN one. */ + if(syn_counter == 1) + { + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + syn_ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + } + /* If receives other packet, it is error. */ + else + error_counter++; + + /* Let client receives the SYN + ACK packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.01 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_02_test.c b/test/regression/netxduo_test/netx_1_02_test.c new file mode 100644 index 00000000..16729120 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_02_test.c @@ -0,0 +1,325 @@ +/* 1.02 TCP MUST move on to ESTABLISHED state after receiving ACK in SYN-RCVD state. */ + +/* Procedure + 1. Client sends a SYN packet. + 2. Server receives the SYN packet and replies a SYN + ACK packet. + 3. Client receives the SYN + ACK packet and replies an ACK packet. + 4. Check the state of server is SYN_RCVD. + 5. Check the packet is a ACK one. + 6. Let server deal with the ACK packet and checks the state of server is ESTABLISHED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 128, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: TCP Spec 1.02 Test........................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let server checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_02; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check whether received an ACK packet. */ + if(ack_counter != 1) + error_counter++; + + /* Check the state of server is ESTABLISHED. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the state of server is SYN_RCVD. */ + if (server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a ACK one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.02 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_03_test.c b/test/regression/netxduo_test/netx_1_03_test.c new file mode 100644 index 00000000..a30274ca --- /dev/null +++ b/test/regression/netxduo_test/netx_1_03_test.c @@ -0,0 +1,346 @@ +/* 1.03 TCP MUST send an ACK in response to a FIN received in ESTABLISHED state. */ + +/* Procedure + 1. Check the state of client is ESTABLISHED. + 2. Server sends a FIN packet. + 3. Check the packet is a FIN one. + 4. Client replies a packet. + 5. Check the packet is an ACK one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_03_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + error_counter = 0; + fin_counter = 0; + ack_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_03; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 1.03 Test........................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let server checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_03_2; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check the state of client is ESTABLISHED. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_tcp_packet_receive_1_03_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the packet is a ACK packet which responsing the FIN one. */ + if(fin_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.03 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_04_ipv6_test.c b/test/regression/netxduo_test/netx_1_04_ipv6_test.c new file mode 100644 index 00000000..83597dd3 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_04_ipv6_test.c @@ -0,0 +1,327 @@ +/* 1.04 TCP, in CLOSED state, must send a RST segment with zero SEQ number +in response to an incoming segment not containing RST and ACK flags. */ + +/* This case is based on IPv6. */ + +/* Procedure +1. Create server and client sockets. +2. Let the client socket connect to the server socket in order to send a segment not containing RST and ACK flags. +3. Check if the server socket is in CLOSED state. +4. Check if the packet is a segment not containing RST and ACK flags. +5. Let the server socket receive the segment and send a RST segment. +6. Check if the packet is the RST segment with zero SEQ number. +7. Let the client socket receive the RST segment. +8. Check the error_counter and rst_counter. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static UINT seg_counter; + +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_04_ipv6_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + seg_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + if(status) + error_counter++; + + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + if(status) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.04 IPv6 Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_04; + + tx_thread_suspend(&ntest_0); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_04_2; + + /* Call connect to establish a TCP connection*/ + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_0, 12, NX_IP_PERIODIC_RATE/2); + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (seg_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_1_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSED) + { + + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Determined if it set the ACK BIT and RST BIT. */ + if((!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT))) + { + /* The incoming segment is not containing RST and ACK flags. */ + seg_counter = 1; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_1_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if (seg_counter == 1) + { + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Determined the RST BIT,ACK BIT,SEQ. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_sequence_number == 0)) + { + + /* ACK_BIT and RST_BIT has been set and SEQ is zero. */ + rst_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + else + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_04_ipv6_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 1.04 IPv6 Test...................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_1_04_test.c b/test/regression/netxduo_test/netx_1_04_test.c new file mode 100644 index 00000000..4c8051c9 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_04_test.c @@ -0,0 +1,309 @@ +/* 1.04 TCP, in CLOSED state, must send a RST segment with zero SEQ number +in response to an incoming segment not containing RST and ACK flags. */ + +/* Procedure +1. Create server and client sockets. +2. Let the client socket connect to the server socket in order to send a segment not containing RST and ACK flags. +3. Check if the server socket is in CLOSED state. +4. Check if the packet is a segment not containing RST and ACK flags. +5. Let the server socket receive the segment and send a RST segment. +6. Check if the packet is the RST segment with zero SEQ number. +7. Let the client socket receive the RST segment. +8. Check the error_counter and rst_counter. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static UINT seg_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + seg_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.04 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_04; + + tx_thread_suspend(&ntest_0); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_04_2; + + /* Call connect to establish a TCP connection*/ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 50); + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (seg_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_1_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSED) + { + + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Determined if it set the ACK BIT and RST BIT. */ + if((!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT))) + { + /* The incoming segment is not containing RST and ACK flags. */ + seg_counter = 1; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_1_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if (seg_counter == 1) + { + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Determined the RST BIT,ACK BIT,SEQ. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_sequence_number == 0)) + { + + /* ACK_BIT and RST_BIT has been set and SEQ is zero. */ + rst_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + else + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.04 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_05_test.c b/test/regression/netxduo_test/netx_1_05_test.c new file mode 100644 index 00000000..7169fc05 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_05_test.c @@ -0,0 +1,362 @@ +/* 1.05 TCP, in CLOSED state, must send a RST in response to an incoming segment containing ACK and not containing RST and SEQ number is taken from SEG.ACK. */ + +/* Procedure +1. Create server and client sockets. +2. Let the client socket connect to the server socket. +3. Unbind the client socket. +4. Let the server socket send an ACK segment. +5. Check if the client socket is in CLOSED state. +6. Check if the segment is containing ACK and not containing RST. +7. Let the client socket receive the segment and send a RST segment. +8. Check if the segment is the RST one and its SEQ number is taken from SEG.ACK. +9. Check the error_counter and rst_counter. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG ack_counter; +static ULONG ack_number; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_05(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_05_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_05_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + ack_counter = 0; + ack_number = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.05 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_05; + + /* Set the client socket to CLOSE state. */ + client_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + + /* Unbind the client socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Let client check the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_05_2; + + /* Send out an ACK segment. */ + _nx_tcp_packet_send_ack(&server_socket, server_socket.nx_tcp_socket_tx_sequence); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_05(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSED) + { + + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Determined if it set the ACK BIT and not set RST BIT. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT))) + { + /* The incoming segment is containing ACK and not containing RST. */ + ack_counter = 1; + ack_number = tcp_header_ptr -> nx_tcp_acknowledgment_number; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_tcp_packet_receive_1_05_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if (ack_counter == 1) + { + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Determined the RST BIT,ACK BIT,SEQ. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) && (tcp_header_ptr -> nx_tcp_sequence_number == ack_number)) + { + + /* RST_BIT have been set and SEQ number is taken from SEG.ACK. */ + rst_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + else + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_05_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.05 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_1_17_test.c b/test/regression/netxduo_test/netx_1_17_test.c new file mode 100644 index 00000000..a4601b8e --- /dev/null +++ b/test/regression/netxduo_test/netx_1_17_test.c @@ -0,0 +1,313 @@ +/* 1.17 TCP, in CLOSED state, MUST send a SYN on an active OPEN call. */ + +/* Procedure + 1. Create a client socket. + 2. Check the state of client is CLOSED and call connect command. + 3. Check the packet is a SYN one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state of client is CLOSED. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter)||(syn_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: TCP Spec 1.17 Test........................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let server checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_17; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_counter++; + + /* Deal the packet with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the SYN packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.17 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_18_test.c b/test/regression/netxduo_test/netx_1_18_test.c new file mode 100644 index 00000000..7db7f53f --- /dev/null +++ b/test/regression/netxduo_test/netx_1_18_test.c @@ -0,0 +1,325 @@ +/* 1.18 TCP MUST be capable of progressing to ESTABLISHED state after receiving SYN,ACK in SYN-SENT state. */ + +/* Procedure + 1. Client sends a SYN packet and becomes SYN_SENT state. + 2. Server receives the SYN packet and replies a SYN + ACK packet. + 3. Check the state of client is SYN_SENT. + 4. Let client deal with the SYN + ACK packet and checks the state of client is ESTABLISHED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_18; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(syn_ack_counter == 1) + { + /* Check the state of client is ESTABLISHED. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + } + else + error_counter++; + + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: TCP Spec 1.18 Test........................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check the state of client is SYN_SENT. */ + if(client_socket.nx_tcp_socket_state == NX_TCP_SYN_SENT) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN + ACK one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + syn_ack_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + /* Let client receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.18 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_19_01_test.c b/test/regression/netxduo_test/netx_1_19_01_test.c new file mode 100644 index 00000000..dce5f0f2 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_19_01_test.c @@ -0,0 +1,321 @@ +/* 1.19.01:TCP MUST send a FIN on a CLOSE call in ESTAB-LISHED state. */ + +/* Procedure + 1.Let the client connect server socket. + 2.Check the state of server socket is Established. + 3.Server send a FIN on a CLOSE call. + 4.Check the FIN packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG flag_1_19_01; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_19_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_19_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + flag_1_19_01 = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.19.01 Test....................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state of server is ESTABLISHED. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Disconnect the server socket to send a CLOSE call. */ + if(flag_1_19_01 == 0) + flag_1_19_01 = 1; + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_19_01; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void my_tcp_packet_receive_1_19_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + if(flag_1_19_01 == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + flag_1_19_01 = 0; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_19_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.19.01 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_19_02_test.c b/test/regression/netxduo_test/netx_1_19_02_test.c new file mode 100644 index 00000000..c88d7103 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_19_02_test.c @@ -0,0 +1,338 @@ +/* 1.19.02:TCP MUST send a FIN on a CLOSE call in SYN-RCVD state. */ + +/* Procedure + 1.Client sends a SYN packet and becomes SYN_SENT state. + 2.Server receives the SYN packet and becomes SYN_RECEIVED state. + 3.Server calls the CLOSE command. + 4.Server socket sends a FIN packet on a CLOSE call. + 5.Check the packet is a FIN one */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG flag_1_19_02; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_1_19_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_1_19_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_19_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + flag_1_19_02 = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.19.02 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver drop the SYN+ACK packet. */ + advanced_packet_process_callback = my_packet_process_1_19_02; + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + /* Check the state of server socket is SYN_RECEIVED. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED) + error_counter++; + + /* Disconnect the server socket on a CLOSE call. */ + if(flag_1_19_02 == 0) + flag_1_19_02 = 1; + status = nx_tcp_socket_disconnect(&server_socket,50); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_19_02; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_1_19_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a SYN+ACK packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN+ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + + tx_thread_resume(&ntest_0); + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_1_19_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + if(flag_1_19_02 == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + flag_1_19_02 = 0; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_19_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.19.02 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_19_03_test.c b/test/regression/netxduo_test/netx_1_19_03_test.c new file mode 100644 index 00000000..a73df0b7 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_19_03_test.c @@ -0,0 +1,321 @@ +/* 1.19.03:TCP MUST send a FIN on a CLOSE call in CLOSE_WAIT state. */ + +/* Procedure + 1.Client socket connects to server socket. + 2.Server socket disconnects to client socket. + 3.Check the state of client socket is CLOSE_WAIT. + 4.Client sends a FIN packet in order to call CLOSE command. + 5.Check the packet is a FIN one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG flag_1_19_03; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_19_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_19_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + flag_1_19_03 = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.19.03 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state of client is CLOSE_WAIT. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT) + error_counter++; + + /* Disconnect the client socket to send a CLOSE call. */ + if(flag_1_19_03 == 0) + flag_1_19_03 = 1; + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a connection from client socket. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Point to my function */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_19_03; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_1_19_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + if(flag_1_19_03 == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + flag_1_19_03 = 0; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_19_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.19.03 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_20_test.c b/test/regression/netxduo_test/netx_1_20_test.c new file mode 100644 index 00000000..455c4656 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_20_test.c @@ -0,0 +1,359 @@ +/* 1.20 TCP MUST move on to CLOSED state after receiving an ACK of the sent FIN in LAST_ACK state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Client sends a FIN packet and becomes LAST_ACK state. +3. Check the packet is FIN one. +4. Server receives the FIN packet and replies an ACK packet. +5. Check the state of client is LAST_ACK. +6. Check the packet is an ACK one. +7. Client receives the ACK packet. +8. Check the state of client is CLOSED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_20_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_20_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + fin_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.20 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_20; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* To test if client_socket is on the CLOSED state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter!=1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let server checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_20_2; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the state of server is LAST_ACK. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + /* Check whether the packet is a ACK packet which responsing the FIN one. */ + if(fin_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + } + + /* Let client receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +void my_tcp_packet_receive_1_20_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a fin one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let client receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.20 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_21_01_test.c b/test/regression/netxduo_test/netx_1_21_01_test.c new file mode 100644 index 00000000..16efb004 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_21_01_test.c @@ -0,0 +1,377 @@ +/* 1.21 TCP MUST send an ACK after receiving a FIN in FIN_WAIT_1 state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Server sends a FIN packet and becomes FIN_WAIT_1 state. +3. Delay the FIN packet and keep the server state to FIN_WAIT_1. +4. Client sends a FIN packet. +5. Check the packet is a FIN one. +6. Server replies an ACK packet. +7. Check the packet is an ACK one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_1_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_1_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_21_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_21_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.21.01 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let the driver delay the FIN packet. */ + advanced_packet_process_callback = my_packet_process_1_21_01; + + /*Let the server socket check the FIN packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_21_01; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the ACK packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_21_01_2; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_1_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +void my_tcp_packet_receive_1_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the state of server is in FIN_WAIT_1. */ + if (server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_tcp_packet_receive_1_21_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the packet is a ACK packet which responsing the FIN one. */ + if(fin_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_21_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.21.01 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_1_21_02_test.c b/test/regression/netxduo_test/netx_1_21_02_test.c new file mode 100644 index 00000000..c1ca17e5 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_21_02_test.c @@ -0,0 +1,346 @@ +/* 1.21 TCP MUST send an ACK after receiving a FIN in FIN_WAIT_2 state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Server sends a FIN packet. +3. Server receives an ACK packet which responsing the FIN one and becomes FIN_WAIT_2 state. +4. Client sends a FIN packet. +5. Check the packet is a FIN one. +6. Server replies an ACK packet. +7. Check the packet is an ACK one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_21_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_1_21_02_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_21_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.21.02 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let server check the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_21_02; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_21_02_2; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_21_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check the state of server is FIN_WAIT_2. */ + if (server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_tcp_packet_receive_1_21_02_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the packet is a ACK packet which responsing the FIN one. */ + if(fin_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_21_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.21.02 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_26_01_test.c b/test/regression/netxduo_test/netx_1_26_01_test.c new file mode 100644 index 00000000..f9eca41c --- /dev/null +++ b/test/regression/netxduo_test/netx_1_26_01_test.c @@ -0,0 +1,396 @@ +/* 1.26 TCP MAY send an ACK after receiving a data segment in FINWAIT_1 state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Server sends a FIN packet and becomes FIN_WAIT_1 state. +3. Delay the FIN packet and keep the server state to FIN_WAIT_1. +4. Client sends a data segment. +5. Check whether the server receives the data segment. +6. Server replies an ACK packet. +7. Check the packet is an ACK one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG data_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_1_26_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_1_26_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_26_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 1.26.01 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay the FIN packet. */ + advanced_packet_process_callback = my_packet_process_1_26_01; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + /* Check the server socket state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr,NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the data segment. */ + if(!memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + data_counter++; + } + + else + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_26_01; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_counter !=1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(ack_counter != 1) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_1_26_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +void my_tcp_packet_receive_1_26_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the packet is a ACK packet which responsing the data segment. */ + if(data_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_26_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.26.01 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_26_02_test.c b/test/regression/netxduo_test/netx_1_26_02_test.c new file mode 100644 index 00000000..eccb330d --- /dev/null +++ b/test/regression/netxduo_test/netx_1_26_02_test.c @@ -0,0 +1,362 @@ +/* 1.26 TCP MAY send an ACK after receiving a data segment in FINWAIT_2 state. */ + +/* Procedure + 1. Establish a connection by the "three-way handshake" procedure. + 2. Server disconnects to client and becomes FIN_WAIT_2 state. + 3. Client sends a data segment. + 4. Check whether the server socket is in FIN_WAIT_2 state. + 5. Check whether the server receives the data segment. + 6. Server replies an ACK packet. + 7. Check the packet is an ACK one. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG data_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_26_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_26_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 1.26.02 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + /* Check the server socket state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr,NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the data segment. */ + if(!memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + data_counter++; + } + else + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client check the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_26_02; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_counter !=1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(ack_counter != 1) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_1_26_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the packet is a ACK packet which responsing the data segment. */ + if(data_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let client receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_26_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.26.02 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_27_01_test.c b/test/regression/netxduo_test/netx_1_27_01_test.c new file mode 100644 index 00000000..a7224d95 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_27_01_test.c @@ -0,0 +1,380 @@ +/* 1.27.01 TCP must ignore a data segment in SYN_SENT state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Set client socket to CLOSED state. +3. Let client socket connect to the server socket. +4. Let the driver drop the SYN packet. +5. Let the server socket send out a data segment. +6. Check if the client socket is in SYN_SENT state. +7. Let the client socket receive the data segment +8. Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UINT is_ignored; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_1_27_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_1_27_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_ignored = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 1.27.01 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Set client state to CLOSED. */ + client_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + + /* Let driver drop the SYN packet. */ + advanced_packet_process_callback = my_packet_process_1_27_01; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Setup function pointer. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_27_01; + + tx_thread_resume(&ntest_1); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state == NX_TCP_SYN_SENT) + { + status = nx_tcp_socket_receive(&client_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for valid status. */ + if(status) + is_ignored = NX_TRUE; + } + else + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(is_ignored != NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload. */ + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + } + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_1_27_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + /* Drop the SYN packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + return NX_TRUE; +} + +static void my_tcp_packet_receive_1_27_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + if(client_socket.nx_tcp_socket_state == NX_TCP_SYN_SENT) + { + if((packet_ptr->nx_packet_length == 40) && !(memcmp(packet_ptr->nx_packet_prepend_ptr + 20, MSG, 20))) + { + data_packet_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.27.01 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_1_27_02_test.c b/test/regression/netxduo_test/netx_1_27_02_test.c new file mode 100644 index 00000000..479fd431 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_27_02_test.c @@ -0,0 +1,352 @@ +/* 1.27.02 TCP must ignore a data segment in CLOSE_WAIT state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Let the server socket disconnect to client socket. +3. Set the server socket to ESTABLISHED state. +4. Let the server socket send out a data segment. +5. Check if the client socket is in CLOSE_WAIT state. +6. Let the client socket receive the data segment. +7. Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UINT is_ignored; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_1_27_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_ignored = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 1.27.02 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup function pointer. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_27_02; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + status = nx_tcp_socket_receive(&client_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for valid status. */ + if(status) + is_ignored = NX_TRUE; + } + else + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(is_ignored != NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Set the server socket to ESTABLISHED state. */ + server_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload. */ + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_1_27_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + if((packet_ptr->nx_packet_length == 40) && !(memcmp(packet_ptr->nx_packet_prepend_ptr + 20, MSG, 20))) + { + data_packet_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.27.02 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_1_27_03_test.c b/test/regression/netxduo_test/netx_1_27_03_test.c new file mode 100644 index 00000000..44a68823 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_27_03_test.c @@ -0,0 +1,385 @@ +/* 1.27.03 TCP must ignore a data segment in CLOSING state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Let the server socket disconnect to the client socket. +3. Let the driver delay the FIN packet. +4. Let the client socket disconnect to the server socket. +5. Let the client socket send out a data segment. +6. Check if the server socket is in CLOSING state. +7. Let the server socket receive the data segment +8. Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UINT is_ignored; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_1_27_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_1_27_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_ignored = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 1.27.03 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay the FIN packet. */ + advanced_packet_process_callback = my_packet_process_1_27_03; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Setup function pointer. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_27_03; + + tx_thread_suspend(&ntest_0); + + /* Check the client socket state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for valid status. */ + if(status) + is_ignored = NX_TRUE; + } + else + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Set client state to CLOSED. */ + client_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload. */ + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 50); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(is_ignored != NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_1_27_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + + /* Delay the FIN packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = 200; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_1_27_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + if((packet_ptr->nx_packet_length == 40) && !(memcmp(packet_ptr->nx_packet_prepend_ptr + 20, MSG, 20))) + { + data_packet_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.27.03 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_1_27_04_test.c b/test/regression/netxduo_test/netx_1_27_04_test.c new file mode 100644 index 00000000..33557c19 --- /dev/null +++ b/test/regression/netxduo_test/netx_1_27_04_test.c @@ -0,0 +1,368 @@ +/* 1.27.04 TCP must ignore a data segment in LAST_ACK state. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Let the server socket disconnect to the client socket. +3. Let the client socket disconnect to the server socket. +4. Let the driver delay the FIN packet. +5. Let the server socket send out a data segment. +6. Check if the client socket is in LAST_ACK state. +7. Let the client socket receive the data segment. +8. Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static UINT is_ignored; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_1_27_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_1_27_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + is_ignored = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 1.27.04 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay the FIN packet. */ + advanced_packet_process_callback = my_packet_process_1_27_04; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Setup function pointer. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_1_27_04; + + tx_thread_resume(&ntest_1); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + status = nx_tcp_socket_receive(&client_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for valid status. */ + if(status) + is_ignored = NX_TRUE; + } + else + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(is_ignored != NX_TRUE) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_1); + + /* Set the server socket to ESTABLISHED state. */ + server_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload. */ + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out. */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_1_27_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + + /* Delay the FIN packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = 200; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_1_27_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + if(client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + if((packet_ptr->nx_packet_length == 40) && !(memcmp(packet_ptr->nx_packet_prepend_ptr + 20, MSG, 20))) + { + data_packet_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_1_27_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 1.27.04 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_23_02_01_test.c b/test/regression/netxduo_test/netx_23_02_01_test.c new file mode 100644 index 00000000..edfa6993 --- /dev/null +++ b/test/regression/netxduo_test/netx_23_02_01_test.c @@ -0,0 +1,410 @@ +/* 23.02.1 TCP in LISTEN state, MUST reject an incoming SYN with broadcast address(255.255.255.255) as source IP address. */ + + +/* Procedure + 1. Client send a SYN to Server. + 2. Use packet_process function to receive and deal with the SYN packet,change the IP address. + 3. Check whether the SYN packet is rejected. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if (defined(__PRODUCT_NETXDUO__) || defined(NX_ENABLE_SOURCE_ADDRESS_CHECK)) && !defined(NX_DISABLE_IPV4) + +#ifndef __PRODUCT_NETXDUO__ +#define NX_IPV4_HEADER NX_IP_HEADER +#endif + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG is_rejected; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_23_02_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /*Initial the variable. */ + error_counter = 0; + is_rejected = NX_TRUE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.01 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(!status) + is_rejected = NX_FALSE; + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_23_02_01; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 50); + + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (is_rejected != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_23_02_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +NX_IPV4_HEADER *ip_header_ptr; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +ULONG val; +#else +ULONG source_ip, dest_ip; +ULONG temp; +#endif +ULONG checksum; + + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether the segment is a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT))) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Point to the IP HEADER. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + + /* Change the source IP address in the IP header. */ + ip_header_ptr -> nx_ip_header_source_ip = 0xFFFFFFFF; + + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 & 0x0000FFFF; + +#ifdef __PRODUCT_NETXDUO__ + /* Calculate the IP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + 20, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + +#else + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + /* Build the IP header checksum. */ + temp = ip_header_ptr -> nx_ip_header_word_0; + checksum = (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_1; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_2; + checksum += (temp >> NX_SHIFT_BY_16); + temp = ip_header_ptr -> nx_ip_header_source_ip; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_destination_ip; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | (NX_LOWER_16_MASK & (~checksum)); + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); +#endif + + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); + + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + + +#ifdef __PRODUCT_NETXDUO__ + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#else + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.01 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_23_02_02_test.c b/test/regression/netxduo_test/netx_23_02_02_test.c new file mode 100644 index 00000000..8f378a38 --- /dev/null +++ b/test/regression/netxduo_test/netx_23_02_02_test.c @@ -0,0 +1,415 @@ +/* 23.02.2 TCP in LISTEN state, MUST reject an incoming SYN with +multicast addresses as source IP address. */ + +/* Update + 1. nx_tcp_packet_process.c between line 340 and line 355. */ + +/* Procedure + 1. Client send a SYN to Server. + 2. Use packet_process function to receive and deal with the SYN packet,change the IP address. + 3. Judge the packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if (defined(__PRODUCT_NETXDUO__) || defined(NX_ENABLE_SOURCE_ADDRESS_CHECK)) && !defined(NX_DISABLE_IPV4) + +#ifndef __PRODUCT_NETXDUO__ +#define NX_IPV4_HEADER NX_IP_HEADER +#endif + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG is_rejected; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_23_02_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /*Initial the variable. */ + error_counter = 0; + is_rejected = NX_TRUE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.02 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(!status) + is_rejected = NX_FALSE; + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_23_02_02; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 50); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (is_rejected != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_23_02_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +NX_IPV4_HEADER *ip_header_ptr; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +ULONG val; +#else +ULONG source_ip, dest_ip; +ULONG temp; +#endif +ULONG checksum; + + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Point to the TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether the segment is a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT))) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Point to the IP HEADER. */ + + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + + /* Change the source IP address in the IP header. */ + ip_header_ptr -> nx_ip_header_source_ip = 0x010000E0; + + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 & 0x0000FFFF; + +#ifdef __PRODUCT_NETXDUO__ + /* Calculate the IP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + 20, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + +#else + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + /* Build the IP header checksum. */ + temp = ip_header_ptr -> nx_ip_header_word_0; + checksum = (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_1; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_2; + checksum += (temp >> NX_SHIFT_BY_16); + temp = ip_header_ptr -> nx_ip_header_source_ip; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_destination_ip; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | (NX_LOWER_16_MASK & (~checksum)); + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); +#endif + + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); + + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + + +#ifdef __PRODUCT_NETXDUO__ + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#else + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.02 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_23_02_03_test.c b/test/regression/netxduo_test/netx_23_02_03_test.c new file mode 100644 index 00000000..d79b36cd --- /dev/null +++ b/test/regression/netxduo_test/netx_23_02_03_test.c @@ -0,0 +1,273 @@ +/* 23.02.03 TCP in LISTEN state, MUST reject an incoming SYN with + broadcast address(subnet-directed broadcast--128.1.2.255) as source IP address. */ + +/* Update + 1. nx_tcp_packet_process.c between line 346 and line 347. */ + +/* Procedure + 1. Client send a SYN to Server. + 2. Use packet_process function to receive and deal with the SYN packet. + 3. Use packet_process function to receive and deal with the SYN packet,Judge the packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if (defined(__PRODUCT_NETXDUO__) || defined(NX_ENABLE_SOURCE_ADDRESS_CHECK)) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG is_rejected; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /*Initial the variable. */ + error_counter = 0; + is_rejected = NX_TRUE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(256, 1, 2, 2), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(256, 1, 2, 255), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.03 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(!status) + is_rejected = NX_FALSE; + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(256, 1, 2, 2), 12, 50); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (is_rejected != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.03 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_23_02_04_test.c b/test/regression/netxduo_test/netx_23_02_04_test.c new file mode 100644 index 00000000..b88cc5f5 --- /dev/null +++ b/test/regression/netxduo_test/netx_23_02_04_test.c @@ -0,0 +1,273 @@ +/* 23.02.04 TCP in LISTEN state, MUST reject an incoming SYN with + local subnet address (128.1.2.0) as source IP address. */ + +/* Update + 1. nx_tcp_packet_process.c between line 348 and line 349. */ + +/* Procedure + 1. Client send a SYN to Server. + 2. Use packet_process function to receive and deal with the SYN packet. + 3. Use packet_process function to receive and deal with the SYN packet,Judge the packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if (defined(__PRODUCT_NETXDUO__) || defined(NX_ENABLE_SOURCE_ADDRESS_CHECK)) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG is_rejected; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /*Initial the variable. */ + error_counter = 0; + is_rejected = NX_TRUE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(128, 1, 2, 2), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(128, 1, 2, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.04 Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(!status) + is_rejected = NX_FALSE; + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(128, 1, 2, 2), 12, 50); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (is_rejected != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_23_02_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 23.02.04 Test....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_2_01_test.c b/test/regression/netxduo_test/netx_2_01_test.c new file mode 100644 index 00000000..b7bde59c --- /dev/null +++ b/test/regression/netxduo_test/netx_2_01_test.c @@ -0,0 +1,390 @@ +/* 2.02 Receiver TCP must check the checksum in any incoming segment, and must not acknowledge in case of an error. */ + +/* Procedure +1. Let the client socket and server socket finish "three-way handshake" process. +2. Let the server socket allocate a data segment and send it out . +3. Change the TCP checksum of the data segment. +4. Check if the receiver TCP reply an ACK pakcet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if !defined(NX_ENABLE_INTERFACE_CAPABILITY) && !defined(NX_DISABLE_TCP_TX_CHECKSUM) && !defined(NX_DISABLE_TCP_RX_CHECKSUM) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static UINT data_counter; +static ULONG ack_number; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_2_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_2_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_counter = 0; + ack_number = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let my function change the checksum. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_2_01; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter) || (data_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 2.01 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let my function change the checksum. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_2_01_2; + + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01234567890123456789", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Record the tx_sequence. */ + ack_number = server_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Avoid server resend the packet. */ + server_socket.nx_tcp_socket_tx_sequence = server_socket.nx_tcp_socket_tx_sequence - 20; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + /* Get nothing the peer socket info. */ + if (nxd_tcp_socket_peer_info_get(&server_socket, NX_NULL, NX_NULL) == NX_SUCCESS) + error_counter++; +#endif /* __PRODUCT_NETXDUO__ */ +} + +void my_tcp_packet_receive_2_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; + + + /* Change the checksum. */ + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, "01234567890123456789", 20))) + { + + data_counter++; + + /* Point to TCP header */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr->nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + checksum = tcp_header_ptr ->nx_tcp_header_word_4 >> NX_SHIFT_BY_16; + checksum += 1; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Use the default routine. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + /* Let the client socket receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +void my_tcp_packet_receive_2_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the client socket reply an ACK packet to the data segment. */ + if(data_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT))&& (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT))&& (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT))) + { + /* Get the ack_number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr -> nx_tcp_acknowledgment_number == (ack_number + 20)) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + { + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let the server socket receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_01_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Spec 2.01 Test........................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_2_02_test.c b/test/regression/netxduo_test/netx_2_02_test.c new file mode 100644 index 00000000..df811293 --- /dev/null +++ b/test/regression/netxduo_test/netx_2_02_test.c @@ -0,0 +1,370 @@ +/* 2.02 Receiver TCP must check the checksum in any incoming segment, and must acknowledge in case of no error. */ + +/* Procedure +1. Let the client socket and server socket finish "three-way handshake" process. +2. Let the server socket allocate a data segment and send it out . +3. Change the TCP checksum of the data segment. +4. Check if the receiver TCP reply an ACK pakcet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG ack_number; +static UINT data_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_2_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + ack_number = 0; + data_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + + printf("NetX Test: TCP Spec 2.02 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_receive(&server_socket, &my_packet,2 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if(status) + error_counter++; + else + { + /* Check whether the server socket received an packet with correct checksum. */ + if((my_packet -> nx_packet_length == 20) && (!memcmp(my_packet -> nx_packet_prepend_ptr, "01234567890123456789", 20))) + data_counter++; + + nx_packet_release(my_packet); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_2_02; + + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01234567890123456789", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Record the tx_sequence. */ + ack_number = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (ack_counter !=1)|| (data_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +void my_tcp_packet_receive_2_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check whether the client socket receives a data segment. */ + if(data_counter == 1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether the client socket reply an ACK packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT))&& (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT))&& (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT))) + { + + /* Get the ack_number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Check if the ACK packet responses to the data segment. */ + if(tcp_header_ptr -> nx_tcp_acknowledgment_number == ack_number + 20) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let the server socket receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 2.02 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_2_17_test.c b/test/regression/netxduo_test/netx_2_17_test.c new file mode 100644 index 00000000..e3ce57d7 --- /dev/null +++ b/test/regression/netxduo_test/netx_2_17_test.c @@ -0,0 +1,360 @@ +/* 2.17 Sender TCP MUST generate checksum. */ + +/* Procedure + 1. Let the client socket send a SYN packet . + 2. Check if the checksum is generated. + 3. Check if the checksum is correct. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks. */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application. */ + +static ULONG error_counter; +static ULONG syn_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern ULONG _nx_ip_checksum_compute(NX_PACKET *, int, UINT, ULONG *, ULONG *); +static void my_tcp_packet_receive_2_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + printf("NetX Test: TCP Spec 2.17 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let the server socket check the checksum. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_2_17; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive_2_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG checksum; +ULONG checksum_2_17; +#if defined(__PRODUCT_NETXDUO__) + ULONG *source_ip, *dest_ip; + +#elif defined(__PRODUCT_NETX__) + ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is a SYN one. */ + if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) + { + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_4); + + /* Record the value of checksum. */ + checksum_2_17 = header_ptr -> nx_tcp_header_word_4 >> NX_SHIFT_BY_16; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_4); + + /* Clean the checksum in the packet. */ + header_ptr -> nx_tcp_header_word_4 = 0; +#if defined(__PRODUCT_NETXDUO__) + /* Calculate the TCP checksum. */ + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_0.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + +#ifndef NX_DISABLE_TCP_TX_CHECKSUM + /* Check if the checksum is correct. */ + if(checksum_2_17 != checksum) + error_counter++; +#endif /* NX_DISABLE_TCP_TX_CHECKSUM */ + + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_4); + header_ptr -> nx_tcp_header_word_4 = (checksum_2_17 << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_4); + + /* Use the default routine. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + else + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Let the server socket receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 2.17 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_2_20_test.c b/test/regression/netxduo_test/netx_2_20_test.c new file mode 100644 index 00000000..a0676464 --- /dev/null +++ b/test/regression/netxduo_test/netx_2_20_test.c @@ -0,0 +1,451 @@ +/* 2.20 When congestion occurs, one-half of the current window size is saved in ssthresh. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG ack_counter; +static ULONG seq_number; +static ULONG ack_counter; +static ULONG duplicate_ack_counter; +static ULONG is_set; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_2_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_2_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + ack_counter = 0; + seq_number = 0; + duplicate_ack_counter = 0; + is_set = NX_FALSE; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 2.20 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_2_20; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_2_20; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG+20, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet3, MSG+40, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Create a tcp packet. */ + status = nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet4, MSG+60, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + + while(!(status = nx_tcp_socket_receive(&client_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE))) + { + + if((packet_ptr -> nx_packet_length == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (MSG + data_packet_counter * 20), 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 4) || (duplicate_ack_counter != 3) || (is_set != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_2_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + if((packet_ptr -> nx_packet_length-40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr+40, MSG, 20))) + { + if(server_socket.nx_tcp_socket_timeout_retries == 0) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + seq_number = tcp_header_ptr -> nx_tcp_sequence_number; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + else if(server_socket.nx_tcp_socket_timeout_retries == 1) + { + if((server_socket.nx_tcp_socket_tx_slow_start_threshold == server_socket.nx_tcp_socket_tx_outstanding_bytes / 2) || (server_socket.nx_tcp_socket_tx_slow_start_threshold == server_socket.nx_tcp_socket_connect_mss * 2)) + is_set = NX_TRUE; + + advanced_packet_process_callback = NX_NULL; + } + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_2_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr ->nx_tcp_acknowledgment_number == seq_number) + duplicate_ack_counter++; + + if(duplicate_ack_counter == 3) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_2_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 2.20 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_3_01_test.c b/test/regression/netxduo_test/netx_3_01_test.c new file mode 100644 index 00000000..26fb04df --- /dev/null +++ b/test/regression/netxduo_test/netx_3_01_test.c @@ -0,0 +1,329 @@ +/* 3.01 TCP MUST return to LISTEN state, on receiving an acceptable RST, in SYN-RCVD state */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.01 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_01; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /*Check the TCP state.*/ + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisted on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + /* Send RST packet. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error*/ + if(status) + error_counter++; + + /* Delete the socket*/ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error*/ + if (status) + error_counter++; + + /* Check for error. */ + if(error_counter || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a SYN+ACK packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_ack_counter ++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN+ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_01; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + if((server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) && (syn_ack_counter == 1)) + { + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if TCP sends an RST packet */ + if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + rst_counter ++; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.01 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_3_02_test.c b/test/regression/netxduo_test/netx_3_02_test.c new file mode 100644 index 00000000..29c78413 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_02_test.c @@ -0,0 +1,356 @@ +/* 3.2 TCP MUST NOT change state, on receiving an unacceptable RST, in SYN-RCVD state. */ + +/* Procedure +1.Client connect with server. +2.Server receives the SYN packet and becomes SYN_RCVD state. +3.Client sends an unacceptable RST packet to server. +4.Server will remain the same state. +5.Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG syn_ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + syn_ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.02 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + advanced_packet_process_callback = my_packet_process_3_02; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_02; + + tx_thread_suspend(&ntest_0); + + /* The server socket should remain the SYN_RVED state. */ + if((server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED) || (rst_counter != 1)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + /* Send an unacceptable packet. */ + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence- 10; + + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + tx_thread_resume(&ntest_0); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (rst_counter != 1) || (syn_ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a AYN+ACK packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_ack_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* AYN+ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* The server socket should be in SYN_RVED state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.02 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_3_03_test.c b/test/regression/netxduo_test/netx_3_03_test.c new file mode 100644 index 00000000..17ad7ba5 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_03_test.c @@ -0,0 +1,385 @@ +/* 3.03:TCP MUST send a RST after receiving an unacceptable ACK in SYN-RCVD state. */ + +/* Procedure +1.Client connect with server. +2.Server receives the SYN packet and becomes SYN_RCVD state. +3.Client sends an unacceptable ACK to server. +4.Server should send a RST packet. +5.Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG syn_ack_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_03_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + syn_ack_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.03 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_03; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_03; + + tx_thread_suspend(&ntest_0); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisted on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_03_02; + + client_socket.nx_tcp_socket_rx_sequence -= 10; + + /* Send an unacceptable ACK */ + _nx_tcp_packet_send_ack(&client_socket, client_socket.nx_tcp_socket_tx_sequence); + + tx_thread_resume(&ntest_0); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error*/ + if(status) + error_counter++; + + /* Delete the socket*/ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error*/ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (rst_counter != 1) || (syn_ack_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_ack_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN+ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* The server socket should be in SYN_RCVD state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + /* Check if client sends an unacceptable ACK packet */ + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + if(header_ptr -> nx_tcp_acknowledgment_number != server_socket.nx_tcp_socket_rx_sequence) + ack_counter ++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_3_03_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* The server socket have received the unacceptable ACK. */ + if(ack_counter == 1) + { + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + if(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter ++; + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + } + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.03 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_3_04_test.c b/test/regression/netxduo_test/netx_3_04_test.c new file mode 100644 index 00000000..58ac78e1 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_04_test.c @@ -0,0 +1,525 @@ +/* 3.04:TCP, in ESTABLISHED state, + MUST return ACK with proper SEQ and ACK numbers after recv a seg with OTW SEQ or unacc ACK number, + and remain in same state If the connection is in a synchronized state, + any unacceptable segment (out of window sequence number or unacceptable acknowledgment number) + must elicit only an empty acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected to be received, + and the connection remains in the same state. */ + +/* Procedure + 1.Connect + 2.Client sends a packet with OTW SEQ and acceptable ACK number to server + 3.Client should receive an ACK with proper SEQ and ACK numbers + 4.Client sends a packet with proper OTW SEQ and unacceptable ACK number to server + 5.Client should receive an ACK with proper SEQ and ACK numbers */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#endif +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.04 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_04; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_04; + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_04_2; + + /* Allocate packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the first packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the second packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + client_socket.nx_tcp_socket_tx_sequence -= 40; + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 2) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + /* Pointer to TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + /* Check if it is a DATA packet. */ + if((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + if (data_packet_counter == 0) + { + /* OTW SEQ. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + tcp_header_ptr-> nx_tcp_sequence_number -= 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + else + { + /* Unacceptable ACK number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + tcp_header_ptr-> nx_tcp_acknowledgment_number += 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + advanced_packet_process_callback = NX_NULL; + } + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + } + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + /* Check if it is a segment. */ + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + { + + /* Check if client sends a packet with OTW SEQ and proper ACK number. */ + if(((header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current))&& + (header_ptr ->nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_tx_sequence) ) + data_packet_counter ++; + + /* Check if client sends a packet with proper SEQ and unacceptable ACK number. */ + else if(((header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence) && + (header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current))&& + (header_ptr ->nx_tcp_acknowledgment_number != server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter ++; + + if (data_packet_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_3_04_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + if ((header_ptr -> nx_tcp_sequence_number == server_socket.nx_tcp_socket_tx_sequence)&& + (header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence)) + { + ack_counter++; + + /* ACK packet has been processed. */ + if (ack_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.04 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_3_06_test.c b/test/regression/netxduo_test/netx_3_06_test.c new file mode 100644 index 00000000..e05dca97 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_06_test.c @@ -0,0 +1,449 @@ +/* 3.6 TCP, in LISTEN state MUST send a RST after receiving a segment that is carrying an unacceptable ACK and remain in the same state. */ + +/* Procedure + 1. Connection. + 2. Server calls disconnect command. + 3. Client sends a segment that is carrying an unacceptable ACK. + 4. Server checks whether the packet contains ACK or not. + 5. Server checks whether a RST packet is send. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_06(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_06(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_06_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_06_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_06; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Relisten on the server port. */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_06; + + tx_thread_suspend(&ntest_0); + + if (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 3.06 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_06_2; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 10, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1) || (rst_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_3_06(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + if((packet_ptr -> nx_packet_length == 30) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 10))) + data_packet_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_3_06_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT my_packet_process_3_06(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +#endif + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Modify the acknowledgment number of the packet to an unacceptable data and recalculate the checksum */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_acknowledgment_number); + + /* Modify the acknowledgment number */ + tcp_header_ptr ->nx_tcp_acknowledgment_number += 10; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_06_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.06 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_07_test.c b/test/regression/netxduo_test/netx_3_07_test.c new file mode 100644 index 00000000..9b84f20f --- /dev/null +++ b/test/regression/netxduo_test/netx_3_07_test.c @@ -0,0 +1,426 @@ +/* 3.7 TCP, in ESTABLISHED state, MUST send an ACK indicating the correct SEQ number it expects, after receiving a SYN with a SEQ number that is OTW. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG syn_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_07(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_07(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_07_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_07_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + syn_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Let server checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_07; + + tx_thread_suspend(&ntest_0); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.07 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_07; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Let client checks the packet. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_07_2; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (rst_counter != 1) || (syn_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_07(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +#endif + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Modify the sequence number of the packet to be OTW and recalculate the checksum. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + tcp_header_ptr ->nx_tcp_sequence_number += server_socket.nx_tcp_socket_rx_window_current; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_sequence_number); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_07(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_3_07_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence) + ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let client receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_07_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.07 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_08_test.c b/test/regression/netxduo_test/netx_3_08_test.c new file mode 100644 index 00000000..5ff3c11d --- /dev/null +++ b/test/regression/netxduo_test/netx_3_08_test.c @@ -0,0 +1,397 @@ +/* 3.8 TCP, in LISTEN state, MUST send a RST after receiving a spurious SYN,ACK that potentially corresponds to an old SYN. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#include "nx_ipv6.h" +#else +#include "nx_ip.h" +#endif +#include "nx_packet.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, int, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_08(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_08(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_08_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_IP *ip_ptr; +NX_PACKET *packet_ptr; +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG *option_word_2; +#if defined(__PRODUCT_NETXDUO__) + NX_IPV4_HEADER *ip_header_ptr; +ULONG val; +#else + NX_IP_HEADER *ip_header_ptr; +#endif +ULONG checksum; +ULONG source; +ULONG dest; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +ULONG temp; +#endif + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 3.08 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x00112233, 0x4456); + + if(status) + error_counter++; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + ip_ptr = server_socket.nx_tcp_socket_ip_ptr; + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_TCP_SYN_SIZE; + packet_ptr -> nx_packet_length = NX_TCP_SYN_SIZE; +#else + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_SYN); + packet_ptr -> nx_packet_length = sizeof(NX_TCP_SYN); +#endif + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + option_word_2 = option_word_1 + 1; + + /*Build TCP header. */ + tcp_header_ptr -> nx_tcp_header_word_0 = (ULONG) server_socket.nx_tcp_socket_port; + tcp_header_ptr -> nx_tcp_sequence_number = 1000; + tcp_header_ptr -> nx_tcp_acknowledgment_number = 0; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_SYN_HEADER | NX_TCP_SYN_BIT | NX_TCP_ACK_BIT | (server_socket.nx_tcp_socket_rx_window_current); + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + *option_word_1 = NX_TCP_MSS_OPTION; + *option_word_2 = NX_TCP_OPTION_END; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(*option_word_2); + + source = 0x01020305; + dest = 0x01020304; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &dest; + source_ip = &source; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = dest; + source_ip = source; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + sizeof(NX_IPV4_HEADER); +#elif defined(__PRODUCT_NETX__) + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + sizeof(NX_IP_HEADER); +#endif + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; +#elif defined(__PRODUCT_NETX__) + ip_header_ptr = (NX_IP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; +#endif + + /*Build IP header. */ + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | (0xFFFF & packet_ptr -> nx_packet_length)); +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + ip_header_ptr -> nx_ip_header_word_1 = (((ULONG)NX_RAND()) << NX_SHIFT_BY_16); +#else + ip_header_ptr -> nx_ip_header_word_1 = (ip_ptr -> nx_ip_packet_id++ << NX_SHIFT_BY_16); +#endif /* NX_ENABLE_IP_ID_RANDOMIZATION */ + ip_header_ptr -> nx_ip_header_word_2 = ((server_socket.nx_tcp_socket_time_to_live << NX_IP_TIME_TO_LIVE_SHIFT) | NX_IP_TCP); + ip_header_ptr -> nx_ip_header_source_ip = 0x01020305; + ip_header_ptr -> nx_ip_header_destination_ip = 0x01020304; + +#ifdef __PRODUCT_NETX__ + + /* Build the IP header checksum. */ + temp = ip_header_ptr -> nx_ip_header_word_0; + checksum = (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_1; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_word_2; + checksum += (temp >> NX_SHIFT_BY_16); + temp = ip_header_ptr -> nx_ip_header_source_ip; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + temp = ip_header_ptr -> nx_ip_header_destination_ip; + checksum += (temp >> NX_SHIFT_BY_16) + (temp & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | (NX_LOWER_16_MASK & (~checksum)); +#endif + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + +#ifdef __PRODUCT_NETXDUO__ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, 20, NULL, NULL); + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; +#endif + + advanced_packet_process_callback = my_packet_process_3_08; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_08; + + _nx_ip_packet_deferred_receive(ip_ptr, packet_ptr); + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_08(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* RST packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_08(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + syn_ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_08_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.08 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_3_17_test.c b/test/regression/netxduo_test/netx_3_17_test.c new file mode 100644 index 00000000..9fe1a117 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_17_test.c @@ -0,0 +1,469 @@ +/* 3.17 TCP in SYN-SENT state MUST send RST after receiving a segment carrying + an unacceptable ACK and send the SYN again, SEQ number is taken from SEG.ACK. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG data_packet_counter; +static ULONG rst_counter; +static ULONG ack_number; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_17_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + data_packet_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_17; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_17; + + tx_thread_resume(&ntest_1); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if((error_counter) || (data_packet_counter != 1) || (rst_counter != 2) || (syn_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 3.17 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_17_2; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 10, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + tx_thread_suspend(&ntest_1); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +#endif + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) + { + syn_counter++; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else if((packet_ptr -> nx_packet_length == 50) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 10))) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_acknowledgment_number); + + tcp_header_ptr ->nx_tcp_acknowledgment_number += 10; + ack_number = tcp_header_ptr ->nx_tcp_acknowledgment_number; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &server_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &server_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = server_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if((packet_ptr -> nx_packet_length == 30) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 10))) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_acknowledgment_number); + + if(tcp_header_ptr ->nx_tcp_acknowledgment_number != client_socket.nx_tcp_socket_tx_sequence) + data_packet_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_3_17_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + else if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if(tcp_header_ptr -> nx_tcp_sequence_number != ack_number) + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.17 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_18_test.c b/test/regression/netxduo_test/netx_3_18_test.c new file mode 100644 index 00000000..0e6be36c --- /dev/null +++ b/test/regression/netxduo_test/netx_3_18_test.c @@ -0,0 +1,536 @@ +/* 3.18:TCP, in FINWAIT-1 state, + MUST return an ACK with proper SEQ and ACK numbers after recv a seg with OTW SEQ or unacc ACK number, + and remain in same state If the connection is in a synchronized state, + any unacceptable segment (out of window sequence number or unacceptible acknowledgment number) + must elicit only an empty acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected to be received, + and the connection remains in the same state. */ + +/* Procedure + 1.Connect + 2.Server disconnect, then server state is FINWAIT1. + 3.Client sends a packet with OTW SEQ and acceptable ACK number to server. + 4.Client should receive an ACK with proper SEQ and ACK numbers + 5.Client sends a packet with proper OTW SEQ and unacceptable ACK number to server + 6.Client should receive an ACK with proper SEQ and ACK numbers */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#endif +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_18_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.18 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay FIN packet. */ + advanced_packet_process_callback = my_packet_process_3_18; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_18; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1) + error_counter++; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1) + error_counter++; + + tx_thread_sleep(1); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (fin_counter != 1) || (data_packet_counter != 2) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_18_2; + + /* Allocate packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the first packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the second packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + client_socket.nx_tcp_socket_tx_sequence -= 41; + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + + /* Pointer to TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + if ((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + if(data_packet_counter == 0) + { + /* OTW SEQ. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + tcp_header_ptr-> nx_tcp_sequence_number -= 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + else + { + /* Unacceptable ACK number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + tcp_header_ptr-> nx_tcp_acknowledgment_number += 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + advanced_packet_process_callback = NX_NULL; + } + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + } + else + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + { + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + { + /* Check whether client sends a packet with OTW SEQ and proper ACK number. */ + if (((header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (header_ptr -> nx_tcp_acknowledgment_number + 1 == server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter++; + + /* Check whether client sends a packet with proper SEQ and unacceptable ACK number. */ + else if(((header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence) && + (header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (header_ptr -> nx_tcp_acknowledgment_number + 1 != server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter ++; + + if (data_packet_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_3_18_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) &&(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)&&!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + if ((header_ptr -> nx_tcp_sequence_number == server_socket.nx_tcp_socket_tx_sequence) && + (header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence)) + { + ack_counter++; + + if(ack_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.18 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_19_test.c b/test/regression/netxduo_test/netx_3_19_test.c new file mode 100644 index 00000000..a269dd46 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_19_test.c @@ -0,0 +1,514 @@ +/* 3.19:TCP, in FINWAIT-2 state, + MUST return an ACK with proper SEQ and ACK numbers after recv a seg with OTW SEQ or unacc ACK number, + and remain in same state If the connection is in a synchronized state, + any unacceptable segment (out of window sequence number or unacceptible acknowledgment number) + must elicit only an empty acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected to be received, + and the connection remains in the same state. */ + +/* Procedure + 1.connect + 2.Server disconnect, then server state is FINWAIT2. + 3.Client sends a packet with OTW SEQ and acceptable ACK number to server. + 4.Client should receive an ACK with proper SEQ and ACK numbers + 5.Client sends a packet with proper OTW SEQ and unacceptable ACK number to server + 6.Client should receive an ACK with proper SEQ and ACK numbers */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#endif +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_19_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.19 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_19; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_19; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2) + error_counter++; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2) + error_counter++; + + tx_thread_sleep(1); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (data_packet_counter != 2) || (ack_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_19_2; + + /* Allocate packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the first packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the second packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + client_socket.nx_tcp_socket_tx_sequence -= 41; + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + /* Pointer to TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + if ((packet_ptr -> nx_packet_length - 40 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 40, MSG, 20))) + { + if(data_packet_counter == 0) + { + /* OTW SEQ. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + tcp_header_ptr-> nx_tcp_sequence_number -= 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + else + { + /* Unacceptable ACK number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + tcp_header_ptr-> nx_tcp_acknowledgment_number += 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + advanced_packet_process_callback = NX_NULL; + } + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + } + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + /* Check if client sends a packet with OTW SEQ and proper ACK number. */ + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + { + /* Check whether client sends a packet with OTW SEQ and proper ACK number. */ + if (((header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter++; + + /* Check whether client sends a packet with proper SEQ and unacceptable ACK number. */ + else if(((header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence) && + (header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (header_ptr -> nx_tcp_acknowledgment_number != server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter ++; + + if (data_packet_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_3_19_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + if ((header_ptr -> nx_tcp_sequence_number == server_socket.nx_tcp_socket_tx_sequence) && + (header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence)) + { + ack_counter++; + + /* ACK packet has been processed. */ + if(ack_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number) + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.19 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_20_test.c b/test/regression/netxduo_test/netx_3_20_test.c new file mode 100644 index 00000000..65132844 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_20_test.c @@ -0,0 +1,486 @@ +/* 3.20:TCP, in CLOSING state, + MUST return an ACK with proper SEQ and ACK numbers after recv a seg with OTW SEQ or unacc ACK number, + and remain in same state If the connection is in a synchronized state, + any unacceptable segment (out of window sequence number or unacceptible acknowledgment number) + must elicit only an empty acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected to be received, + and the connection remains in the same state. */ + +/* Procedure + 1.Connect + 2.Set server to CLOSING state + 3.Client sends a packet with OTW SEQ to server + 4.Client should receive an ACK with proper SEQ and ACK numbers + 5.Client sends a packet with unacceptable acknowledge number to server + 6.Client should receive an ACK with proper SEQ and ACK numbers */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG ack_counter; +static ULONG otw_seq_counter; +static ULONG unaccept_ack_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_20_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + ack_counter =0; + otw_seq_counter = 0; + unaccept_ack_counter = 0; + + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.20 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_3_20; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_20; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_CLOSING) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_20_2; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + client_socket.nx_tcp_socket_tx_sequence++; + + _nx_tcp_packet_send_ack(&client_socket, (client_socket.nx_tcp_socket_tx_sequence - 1)); + + client_socket.nx_tcp_socket_tx_sequence++; + + _nx_tcp_packet_send_ack(&client_socket, (client_socket.nx_tcp_socket_tx_sequence - 1)); + + tx_thread_resume(&ntest_0); + + /* Determine if the test was successful. */ + if(error_counter || (ack_counter != 3) || fin_counter != 2 || otw_seq_counter != 1 || unaccept_ack_counter != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (fin_counter == 0)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + fin_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + { + if(ack_counter == 1 && otw_seq_counter == 0) + { + /* OTW SEQ. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + tcp_header_ptr-> nx_tcp_sequence_number -= 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + } + else if(ack_counter == 2 && unaccept_ack_counter == 0) + { + /* Unacceptable ACK number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + tcp_header_ptr-> nx_tcp_acknowledgment_number += 100; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +static void my_tcp_packet_receive_3_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a FIN one. */ + if ((header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && ((header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT))) + { + fin_counter++; + } + else if (!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) &&(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + &&!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + /* Check whether client sends a packet with OTW SEQ and proper ACK number. */ + if (((header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (header_ptr -> nx_tcp_acknowledgment_number + 1 == server_socket.nx_tcp_socket_tx_sequence)) + otw_seq_counter++; + + /* Check whether client sends a packet with proper SEQ and unacceptable ACK number. */ + else if(((header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence) && + (header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (header_ptr -> nx_tcp_acknowledgment_number + 1 != server_socket.nx_tcp_socket_tx_sequence)) + { + unaccept_ack_counter++; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + } + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +static void my_tcp_packet_receive_3_20_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (ack_counter == 0)) + { + ack_counter++; + } + else if(!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) &&(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)&&!(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + + if ((header_ptr -> nx_tcp_sequence_number == server_socket.nx_tcp_socket_tx_sequence) && + (header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence)) + { + ack_counter++; + + if(ack_counter == 3) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.20 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_21_test.c b/test/regression/netxduo_test/netx_3_21_test.c new file mode 100644 index 00000000..5f3bfb59 --- /dev/null +++ b/test/regression/netxduo_test/netx_3_21_test.c @@ -0,0 +1,550 @@ +/* 3.21:TCP, in LAST-ACK state, + MUST return an ACK with proper SEQ and ACK numbers after recv a seg with OTW SEQ or unacc ACK number, + and remain in same state If the connection is in a synchronized state, + any unacceptable segment (out of window sequence number or unacceptible acknowledgment number) + must elicit only an empty acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected to be received, + and the connection remains in the same state. */ + +/* Procedure + 1.Connect. + 2.Set server socket to LAST_ACK state. + 3.Client sends a packet to server. + 4.Set the packet to an OTW packet in the callback function. + 5.Client should receive an ACK with proper SEQ and ACK numbers, and server socket should remain in LAST_ACK state. + 6.Client sends a packet to server. + 7.Set the packet to an unacceptable packet in the callback function. + 8.Client should receive an ACK with proper SEQ and ACK numbers, and server socket should remain in LAST_ACK state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#endif +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG fin_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_21_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + fin_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.21 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Suspend the thread ntest_0. */ + tx_thread_suspend(&ntest_0); + + if (server_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process_3_21; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state != NX_TCP_LAST_ACK) + error_counter++; + + /* Set the receive function to my_tcp_packet_receive_3_21. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_21; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_LAST_ACK) + error_counter++; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_LAST_ACK) + error_counter++; + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1, *my_packet2; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Set client transmit number */ + client_socket.nx_tcp_socket_tx_sequence++; + + /* Send FIN */ + _nx_tcp_packet_send_fin(&client_socket,client_socket.nx_tcp_socket_tx_sequence - 1); + + /* Resume the thread ntest_0. */ + tx_thread_resume(&ntest_0); + + /* Replace the TCP receive function with my_tcp_packet_receive_3_21 for ip_1. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_21_2; + + /* Create 2 packet */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet1 */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /*Resume the thread ntest_0. */ + tx_thread_resume(&ntest_0); + + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet2 */ + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter == 0) && (fin_counter == 1) && (ack_counter == 2) && (data_packet_counter == 2)) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG checksum = 0; +NX_TCP_HEADER *tcp_header_ptr; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + /* Point to TCP header */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr+20); + + /* The data segment process. */ + if(packet_ptr -> nx_packet_length - 40 == 20) + { + if (data_packet_counter == 0) + { + /* Chang the sequence number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + tcp_header_ptr -> nx_tcp_sequence_number -= 100; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + else if (data_packet_counter == 1) + { + /* Change the ACK number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + tcp_header_ptr -> nx_tcp_acknowledgment_number += 100; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + advanced_packet_process_callback = NULL; + } + + client_socket.nx_tcp_socket_tx_sequence -= 20; + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + } + /* The flag packet process. */ + else + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + client_socket.nx_tcp_socket_rx_sequence++; + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + fin_counter++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + } + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr->nx_packet_prepend_ptr; + + /* Check if it is a segment. */ + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Check if client sends a packet with OTW SEQ and proper ACK number. */ + if(((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current))&& + (tcp_header_ptr ->nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_tx_sequence) ) + data_packet_counter ++; + + /* Check if client sends a packet with proper SEQ and unacceptable ACK number. */ + else if(((tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence) && + (tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current))&& + (tcp_header_ptr ->nx_tcp_acknowledgment_number != server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter ++; + + if (data_packet_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_3_21_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr->nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((tcp_header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence) && + (tcp_header_ptr -> nx_tcp_sequence_number == server_socket.nx_tcp_socket_tx_sequence)) + { + ack_counter++; + + if (ack_counter == 2) + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.21 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_3_23_test.c b/test/regression/netxduo_test/netx_3_23_test.c new file mode 100644 index 00000000..2655abfe --- /dev/null +++ b/test/regression/netxduo_test/netx_3_23_test.c @@ -0,0 +1,535 @@ +/* 3.23:TCP, in CLOSE-WAIT state, + MUST return an ACK with proper SEQ and ACK numbers after recv a seg with OTW SEQ or unacc ACK number, + and remain in same state If the connection is in a synchronized state, + any unacceptable segment (out of window sequence number or unacceptible acknowledgment number) + must elicit only an empty acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected to be received, + and the connection remains in the same state. */ + +/* Procedure + 1.Connect + 2.Set server socket to CLOSE_WAIT state + 3.Client sends a packet with OTW SEQ to server + 4.Client should receive an ACK with proper SEQ and ACK numbers, and server socket should remain in CLOSE_WAIT state + 5.Client sends a packet with unacceptable acknowledge numbers + 6.Client should receive an ACK with proper SEQ and ACK numbers, and server socket should remain in CLOSE_WAIT state */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_ipv4.h" +#endif +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_3_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_3_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_3_23_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_23_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.23 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Suspend the thread ntest_0. */ + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT) + error_counter++; + + /* Set the receive function to my_tcp_packet_receive_3_23. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_23; + + /* Suspend the thread ntest_0. */ + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT) + error_counter++; + + /* Suspend the thread ntest_0. */ + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1, *my_packet2; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* Set client transmit number */ + client_socket.nx_tcp_socket_tx_sequence++; + + /* Send FIN */ + _nx_tcp_packet_send_fin(&client_socket,client_socket.nx_tcp_socket_tx_sequence - 1); + + tx_thread_resume(&ntest_0); + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process_3_23; + + /* Replace the TCP receive function with my_tcp_packet_receive_3_23 for ip_1. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_3_23_2; + + /* Create packet1 */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet1 */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Resume the thread ntest_0. */ + tx_thread_resume(&ntest_0); + + /* Create packet2. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet2, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send packet2 */ + status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Resume the thread ntest_0. */ + tx_thread_resume(&ntest_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter == 0) && (ack_counter == 2) && (data_packet_counter == 2)) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_3_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +ULONG checksum = 0; +NX_TCP_HEADER *tcp_header_ptr; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +#else +#error "NetX Product undefined." +#endif + + /* Point to TCP header */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + /* The data segment process. */ + if(packet_ptr -> nx_packet_length - 40 == 20) + { + if (data_packet_counter == 0) + { + /* Chang the sequence number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + tcp_header_ptr -> nx_tcp_sequence_number -= 100; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + else if (data_packet_counter == 1) + { + /* Change the ACK number. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + tcp_header_ptr -> nx_tcp_acknowledgment_number += 100; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + advanced_packet_process_callback = NULL; + + } + client_socket.nx_tcp_socket_tx_sequence -= 20; + + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + } + + return NX_TRUE; +} + +static void my_tcp_packet_receive_3_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr->nx_packet_prepend_ptr; + + + /* Check if it is a segment. */ + if((packet_ptr -> nx_packet_length - 20 == 20) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Check if client sends a packet with OTW SEQ and proper ACK number. */ + if(((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (tcp_header_ptr ->nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_tx_sequence) ) + data_packet_counter ++; + + /* Check if client sends a packet with proper SEQ and unacceptable ACK number. */ + else if(((tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence) && + (tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) && + (tcp_header_ptr ->nx_tcp_acknowledgment_number != server_socket.nx_tcp_socket_tx_sequence)) + data_packet_counter ++; + + if (data_packet_counter == 2) + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_3_23_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr->nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((tcp_header_ptr -> nx_tcp_acknowledgment_number == server_socket.nx_tcp_socket_rx_sequence) && + (tcp_header_ptr -> nx_tcp_sequence_number == server_socket.nx_tcp_socket_tx_sequence)) + { + ack_counter++; + + if (ack_counter == 2) + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_3_23_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 3.23 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_4_01_test.c b/test/regression/netxduo_test/netx_4_01_test.c new file mode 100644 index 00000000..617c8d59 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_01_test.c @@ -0,0 +1,376 @@ +/* 4.01 TCP in a CLOSED state, MUST ignore a RST control message. */ +/* An incoming segment containing a RST is discarded. */ + +/* Procedure +1.Client connect with server. +2.Client becomes CLOSED state. +3.Server sends a RST packet to Client. +4.Client should ignore the incoming RST packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_4_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_4_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Let thread 1 run. */ + tx_thread_relinquish(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send a SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error*/ + if(status) + error_counter++; + + /* The client state should be in ESTABLISHED state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Modify the Client state to NX_TCP_CLOSED. */ + client_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + + /* Monitor the RST message from Server. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_4_01; + + /* Monitor the TCP message from Client. */ + advanced_packet_process_callback = my_packet_process_4_01; + + /* Let Server socket send RST message to Client Socket. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* The client state should be in CLOSED state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error*/ + if(status) + error_counter++; + + /* Delete the socket*/ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error*/ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.01 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* The client state should be in ESTABLISHED state. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Let thread 0 run. */ + tx_thread_relinquish(); + + /* Fake one TCP header to send RST packet. */ + header_ptr.nx_tcp_header_word_3 = NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = 1; + header_ptr.nx_tcp_sequence_number = 1; + + /* Send the RST packet to Client. */ + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + /* Call disconnect to send a SYN. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisted on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_4_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Set the TCP header. */ + header_ptr = (NX_TCP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a RST packet. */ + if ((header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + /* Increase the RST counter. */ + rst_counter++; + + /* Cover the tcp receive function. */ + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Let Client socket receive the RST packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT my_packet_process_4_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header_ptr; +#else +NX_IP_HEADER *ip_header_ptr; +#endif + + /* Set the IP header. */ +#ifdef __PRODUCT_NETXDUO__ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; +#else + ip_header_ptr = (NX_IP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; +#endif + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Check if the source address is 1.2.3.4. */ + if (ip_header_ptr -> nx_ip_header_source_ip == IP_ADDRESS(1, 2, 3, 4)) + { + + /* Client socket shouldn't send any packet in response. */ + error_counter ++; + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.01 Test........................................N/A\n"); + test_control_return(3); +} + +#endif diff --git a/test/regression/netxduo_test/netx_4_17_test.c b/test/regression/netxduo_test/netx_4_17_test.c new file mode 100644 index 00000000..a1f1ce71 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_17_test.c @@ -0,0 +1,191 @@ +/* 4.17 For an active OPEN call with unspecified foreign socket, +TCP MUST return error: foreign socket unspecified. */ + +/* Procedure +1. Client connect with foreign socket. +2. Judge the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_17_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.17 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.17 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_4_21_test.c b/test/regression/netxduo_test/netx_4_21_test.c new file mode 100644 index 00000000..a70baeda --- /dev/null +++ b/test/regression/netxduo_test/netx_4_21_test.c @@ -0,0 +1,328 @@ +/* 4.21 If an OPEN call arrives on state SYN-SENT, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_4_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_21_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.21 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN packet. */ + advanced_packet_process_callback = my_packet_process_4_21; + + /* Call connect to send an SYN. */ + nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check state. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_SYN_SENT) + { + /* Try to connect to the server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* NX_NOT_CLOSED is equal to the message of "error: connection already exists". */ + if(status != NX_NOT_CLOSED) + error_counter++; + } + else + error_counter++; + + /* Let the server to disconnect. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_4_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Check if it is a SYN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.21 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_4_23_test.c b/test/regression/netxduo_test/netx_4_23_test.c new file mode 100644 index 00000000..bf0a43ec --- /dev/null +++ b/test/regression/netxduo_test/netx_4_23_test.c @@ -0,0 +1,331 @@ +/* 4.23 If an OPEN call arrives on state SYN-RCVD, TCP MUST return error: connection already exists. */ + +/* Procedure +1. Client sends a SYN packet and becomes SYN_SENT state. +2. Server receives the SYN packet and becomes SYN_RCVD state. +3. Server calls the OPEN call. +4. Judge the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_4_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_23_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + /* Send packet in SYN_RECEIVED status. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + + status = nx_tcp_client_socket_connect(&server_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* NX_NOT_CLOSED is equal to the message of "error: connection already exists". */ + if(status != NX_NOT_CLOSED) + error_counter++; + } + + status = nx_tcp_socket_state_wait(&server_socket, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.23 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the timeout error occurred. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_4_23; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /*syn_ack_counter =1.error_counter=0. */ + if(error_counter == 0) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_4_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to the TCP HEADER */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Intercept the SYN+ACK message */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN+ACK packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + + tx_thread_resume(&ntest_0); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_23_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.23 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_4_24_test.c b/test/regression/netxduo_test/netx_4_24_test.c new file mode 100644 index 00000000..4892d9a1 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_24_test.c @@ -0,0 +1,293 @@ +/* 4.24 If an OPEN call arrives on state ESTABLISHED, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#define DEMO_STACK_SIZE 2048 +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_24_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.24 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + /* Try to connect to the server again. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 0); + + /* NX_NOT_CLOSED is equal to the message of "error: connection already exists". */ + if(status != NX_NOT_CLOSED) + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the error. */ + if( !error_counter ) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_24_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.24 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_4_25_test.c b/test/regression/netxduo_test/netx_4_25_test.c new file mode 100644 index 00000000..518daa36 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_25_test.c @@ -0,0 +1,315 @@ +/* 4.25 If an OPEN call arrives on state FINWAIT-1, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 +#include "nx_ram_network_driver_test_1500.h" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_4_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_25_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 1", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 0", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.25 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let the driver drop the FIN packet. */ + advanced_packet_process_callback = my_packet_process_4_25; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + /* An OPEN call arrives at the state NX_TCP_FIN_WAIT_1. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + status = nx_tcp_client_socket_connect(&server_socket, IP_ADDRESS(1, 2, 3, 5), 12, 0); + + if (status != NX_NOT_CLOSED) + error_counter++; + } + else + error_counter++; + + /* Resume the thread. */ + tx_thread_resume(&ntest_1); + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Suspend the thread. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_4_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.25 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_4_26_test.c b/test/regression/netxduo_test/netx_4_26_test.c new file mode 100644 index 00000000..7de695a6 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_26_test.c @@ -0,0 +1,293 @@ +/* 4.26 If an OPEN call arrives on state FINWAIT-2, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_26_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Connect to the server socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + /* An OPEN call arrives when the client socket is in FIN_WAIT_2 state. */ + if(client_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* NX_NOT_CLOSED is equal to the message of "error: connection already exists". */ + if( status != NX_NOT_CLOSED ) + { + error_counter++; + } + } + else + error_counter++; + + /* Resume the ntest_1 thread. */ + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.26 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Suspend the ntest_1 thread. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the server socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_26_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.26 Test........................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_4_27_test.c b/test/regression/netxduo_test/netx_4_27_test.c new file mode 100644 index 00000000..769be0ae --- /dev/null +++ b/test/regression/netxduo_test/netx_4_27_test.c @@ -0,0 +1,297 @@ +/* 4.27 If an OPEN call arrives on state CLOSE-WAIT, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_27_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.27 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the timeout error occurred. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state */ + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 0); + + /* NX_NOT_CLOSED is equal to the message of "error: connection already exists". */ + if( status != NX_NOT_CLOSED ) + error_counter++; + } + else + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_27_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.27 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_4_28_test.c b/test/regression/netxduo_test/netx_4_28_test.c new file mode 100644 index 00000000..98f8d4e0 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_28_test.c @@ -0,0 +1,341 @@ +/* 4.28 If an OPEN call arrives on state CLOSING, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_4_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_4_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_28_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status += nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.28 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver drop the FIN packet. */ + advanced_packet_process_callback = my_packet_process_4_28; + + /*Let the client socket to check the FIN segment*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_4_28; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Resume the thread. */ + tx_thread_resume(&ntest_1); + + if (client_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 0); + + if (status != NX_NOT_CLOSED) + error_counter++; + } + else + error_counter++; + + /* Let the server thread finish first. */ + tx_thread_suspend(&ntest_0); + + /* Determine if the test was successful. */ + if ((error_counter) || (fin_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_4_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + fin_counter++; + + /* Delay the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +static void my_tcp_packet_receive_4_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a FIN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* It is a FIN packet. */ + fin_counter++; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_28_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.28 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_4_29_test.c b/test/regression/netxduo_test/netx_4_29_test.c new file mode 100644 index 00000000..620bc8e9 --- /dev/null +++ b/test/regression/netxduo_test/netx_4_29_test.c @@ -0,0 +1,301 @@ +/* 4.29 If an OPEN call arrives on state LAST-ACK, TCP MUST return error: connection already exists. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_4_29(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_29_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status += nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.29 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN packet. */ + advanced_packet_process_callback = my_packet_process_4_29; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + if(client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 0); + + /* NX_NOT_CLOSED is equal to the message of "error: connection already exists". */ + if (status != NX_NOT_CLOSED) + error_counter++; + } + else + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_4_29(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* The FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_4_29_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 4.29 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_5_18_test.c b/test/regression/netxduo_test/netx_5_18_test.c new file mode 100644 index 00000000..b76c28d1 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_18_test.c @@ -0,0 +1,195 @@ +/* 5.18 If a SEND call arrives on CLOSED state, and user has got proper access to such conn, TCP MUST return "error: connection does not exist". */ + +/* Procedure + 1. Client bind. + 2. Client allocates a packet and sends the packet. + 3. TCP return "NX_NOT CONNECTED". */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.18 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + +#if defined(__PRODUCT_NETXDUO__) + client_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; +#endif + + /*An SEND call arrives when thc client socket is in NX_TCP_CLOSED state. */ + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSED) + { + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + else + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.18 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_5_19_test.c b/test/regression/netxduo_test/netx_5_19_test.c new file mode 100644 index 00000000..130f27b5 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_19_test.c @@ -0,0 +1,327 @@ +/* 5.19 If SEND call arrives on state FINWAIT-1, TCP MUST return error: connection closing. */ + +/* Procedure + 1. Connection. + 2. Client calls disconnect and sends a FIN packet.. + 3. Client interrupts the FIN packet and calls send command. + 4. Check the state of client is FIN_WAIT_1 and the status is NX_NOT_CONNECTED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_5_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.19 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay FIN packet. */ + advanced_packet_process_callback = my_packet_process_5_19; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* A SEND Call arrives when client socket is in NX_TCP_WAIT_1 state.*/ + if(client_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + } + else + error_counter++; + + /* Resume the ntest_1 thread. */ + tx_thread_resume(&ntest_1); +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_5_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.19 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_5_20_test.c b/test/regression/netxduo_test/netx_5_20_test.c new file mode 100644 index 00000000..ef218b13 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_20_test.c @@ -0,0 +1,303 @@ +/* 5.20 If SEND call arrives on state FINWAIT-2, TCP MUST return error: connection closing. */ + +/* Procedure +1. Connection. +2. Client calls disconnect and sends a FIN packet.. +3. Server replies an ACK packet. +4. Client receives the ACK packet and calls send command. +5. Check the state of client is FIN_WAIT_2 and the status is NX_NOT_CONNECTED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.20 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* A SEND call arrives when the client server is in FIN_WAIT_2 state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten the server socket. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the server socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.20 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_5_21_test.c b/test/regression/netxduo_test/netx_5_21_test.c new file mode 100644 index 00000000..bfc6b980 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_21_test.c @@ -0,0 +1,202 @@ +/* 5.21 If a SEND call arrives on LISTEN state, and foreign socket was not specified, TCP MUST return "error: foreign socket unspecified". */ + +/* Procedure +1. Create server socket and listen. +2. Allocates a packet and sends the packet. +3. TCP return "NX_NOT_BOUND". */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.21 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /*An SEND call arrives when the server socket is in NX_TCP_LISTEN_STATE state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_LISTEN_STATE) + { + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + server_socket.nx_tcp_socket_mss = 100; + +#if defined(__PRODUCT_NETXDUO__) + server_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; +#endif + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status == NX_SUCCESS) + error_counter++; + } + else + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.21 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_5_22_test.c b/test/regression/netxduo_test/netx_5_22_test.c new file mode 100644 index 00000000..c1365f60 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_22_test.c @@ -0,0 +1,357 @@ +/* 5.22 f SEND call arrives on state CLOSING, TCP MUST return "error: connection closing". */ + +/* Procedure + 1. Connection. + 2. Client calls disconnect and sends a FIN packet.. + 3. Server interrupts the FIN packet and call disconnect command. + 4. Client receives the FIN packet and becomes CLOSING state. + 5. Client calls send command and checks the status is NX_NOT_CONNECTED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined (NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_5_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_5_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_22_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter =0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.22 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay the FIN packet. */ + advanced_packet_process_callback = my_packet_process_5_22; + + /*Let the client socket to check the FIN segment*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_5_22; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Resume the thread. */ + tx_thread_resume(&ntest_1); + + if (client_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*n Suspend the ntest_1 thread. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter !=2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_5_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + fin_counter++; + + /* Delay the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +static void my_tcp_packet_receive_5_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* It is a SYN packet. */ + fin_counter++; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_22_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.22 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_5_23_test.c b/test/regression/netxduo_test/netx_5_23_test.c new file mode 100644 index 00000000..cd3ef955 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_23_test.c @@ -0,0 +1,318 @@ +/* 5.23 If SEND call arrives on state LAST-ACK, TCP MUST return "error: connection closing". */ + +/* Procedure + 1. Connection. + 2. Client calls disconnect and sends a FIN packet.. + 3. Server replies an ACK packet and calls disconnect command. + 4. Server becomes LSAT_ACK state. + 5. Server calls send command and checks the status is NX_NOT_CONNECTED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_5_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_23_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.23 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN packet. */ + advanced_packet_process_callback = my_packet_process_5_23; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Check the state of server is LAST_ACK. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_5_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_23_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.23 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_5_24_test.c b/test/regression/netxduo_test/netx_5_24_test.c new file mode 100644 index 00000000..a162dc20 --- /dev/null +++ b/test/regression/netxduo_test/netx_5_24_test.c @@ -0,0 +1,383 @@ +/* 5.24 If a SEND call arrives on SYN-SENT state, TCP MAY queue the request and send it after entering ESTABLISHED state. */ + +/* Procedure + 1. Client sends a SYN packet and becomes SYN_SENT state. + 2. Client calls the send command. + 3. Check the status, test error. + 4. After entering ESTABLISHED state, check if client sends the packet.*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_5_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_24_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.24 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN packet. */ + advanced_packet_process_callback = my_packet_process_5_24; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check state. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_SYN_SENT) + { + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + } + else + error_counter++; + + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(data_packet_counter != 1) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *rcv_packet_ptr; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED && server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + status = nx_tcp_socket_receive(&server_socket, &rcv_packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + if(status == NX_SUCCESS) + { + data_packet_counter ++; + + /* Check data length */ + if(rcv_packet_ptr -> nx_packet_length != 20) + error_counter++; + + /* Check received data. */ + if(memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, "01012345678920123456", 20)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + } + else + error_counter++; + + /* Let client thread disconnect first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_5_24(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Check if it is a SYN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_24_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.24 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_5_25_test.c b/test/regression/netxduo_test/netx_5_25_test.c new file mode 100644 index 00000000..c8f4ba7e --- /dev/null +++ b/test/regression/netxduo_test/netx_5_25_test.c @@ -0,0 +1,380 @@ +/* 5.25 If a SEND call arrives on SYN-RCVD state, TCP MAY queue the request and send it after entering ESTABLISHED state. */ + +/* Procedure +1. Client sends a SYN packet and becomes SYN_SENT state. +2. Server receives the SYN packet and becomes SYN_RCVD state. +3. Server calls the send command. +4. Check the status, test error. +5. After entering ESTABLISHED state, check if server sends the packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_5_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_25_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 5.25 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN+ACK packet. */ + advanced_packet_process_callback = my_packet_process_5_25; + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + /* Send packet in SYN_RECEIVED status. */ + if (server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED && + client_socket.nx_tcp_socket_state == NX_TCP_SYN_SENT) + { + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, "01012345678920123456", 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + } + + status = nx_tcp_socket_state_wait(&server_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Sleep to let client thread run. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, NX_IP_PERIODIC_RATE); + + if(!status) + { + data_packet_counter ++; + + /* Check data length */ + if(rcv_packet_ptr -> nx_packet_length != 20) + error_counter++; + + /* Check received data. */ + if(memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, "01012345678920123456", 20)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Let client thread disconnect first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (syn_ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if (data_packet_counter != 1) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_5_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a SYN+ACK packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_ack_counter++; + + /* Drop the SYN packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + + tx_thread_resume(&ntest_0); + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_5_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 5.25 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_6_17_test.c b/test/regression/netxduo_test/netx_6_17_test.c new file mode 100644 index 00000000..1f1be647 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_17_test.c @@ -0,0 +1,337 @@ +/* 6.17 If RECEIVE call arrives on state CLOSING, TCP MUST return error: connection closing. */ + +/* Procedure + 1. Client connect with Server. + 2. Server call disconnect, then Server state is FINWAIT1. + 3. CLient call disconnect,then Server state is CLOSING. + 4. Server call receive function. + 5. Judge the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_6_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_6_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.17 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_6_17; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_6_17; + + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + /* Server call receive. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 50); + + if(status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + tx_thread_resume(&ntest_0); + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_6_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* It is a FIN packet. */ + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_6_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + fin_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.17 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_6_18_test.c b/test/regression/netxduo_test/netx_6_18_test.c new file mode 100644 index 00000000..7ac804e5 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_18_test.c @@ -0,0 +1,171 @@ +/* 6.18 If RECEIVE call arrives on CLOSED state, and the user has got access to such conn, TCP MUST return error: connection does not exist. */ + +/* Procedure + 1. Client bind. + 2. Client calls receive command. + 3. TCP return "NX_NOT_CONNECTED". */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) + + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 6.18 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state of the TCP client. */ + if ( client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Call receive. */ + status = nx_tcp_socket_receive(&client_socket, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.18 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_6_20_test.c b/test/regression/netxduo_test/netx_6_20_test.c new file mode 100644 index 00000000..414dcfb0 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_20_test.c @@ -0,0 +1,385 @@ +/* 6.20 If a RECEIVE call arrives on SYN-SENT state, TCP MAY queue the request and for processing after entering ESTABLISHED state. */ + +/* Procedure +1. Client sends a SYN packet and becomes SYN_SENT state. +2. Client calls the receive command. +3. Check the status, test error. +4. After entering ESTABLISHED state, check if client receives the packet.*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG data_packet_counter; +static UINT rcv_status; +static NX_PACKET *my_packet; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_6_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + data_packet_counter = 0; + rcv_status = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + printf("NetX Test: TCP Spec 6.20 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN packet. */ + advanced_packet_process_callback = my_packet_process_6_20; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + if (client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Call a receive function! */ + rcv_status = nx_tcp_socket_receive(&client_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(rcv_status == NX_SUCCESS) + { + /* Check received data and the data length. */ + if((packet_ptr -> nx_packet_length != 20) || (memcmp(packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + error_counter++; + else + data_packet_counter ++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + tx_thread_resume(&ntest_1); + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if((rcv_status != NX_SUCCESS) || (data_packet_counter != 1)) + { + printf("WARNING!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Disconnect the client socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_6_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Check if it is a SYN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.20 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_6_22_01_test.c b/test/regression/netxduo_test/netx_6_22_01_test.c new file mode 100644 index 00000000..5f52dd19 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_22_01_test.c @@ -0,0 +1,387 @@ +/* 6.22.01 If RECEIVE call arrives in ESTABLISHED or FINWAIT-1 state, + TCP MUST reassemble queued incoming segments and return to the application. */ + +/* Procedure + 1. Client connect with Server, then Client state is ESTABLISHED. + 2. Client call receive function, then judge the status. + 3. Client call disconnect, and delay a fin packet, then Client state is FIN-WAIT-1. + 4. Client call receive function, then check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG_1 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +#define MSG_2 "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_6_22_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_22_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.22.01 Test....................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check client state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Call socket receive. */ + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG_1, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + /* Let driver delay the FIN packet. */ + advanced_packet_process_callback = my_packet_process_6_22_01; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Check client state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1) + error_counter++; + + /* Call socket receive. */ + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG_2, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + tx_thread_resume(&ntest_1); +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create three packets. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet1, MSG_1, 20, &pool_0, NX_IP_PERIODIC_RATE); + status += nx_packet_data_append(my_packet2, MSG_2, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + status += nx_tcp_socket_send(&server_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter || (fin_counter != 1) || (data_packet_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_6_22_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + { + + fin_counter++; + + /* Delay 1 seconds. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_22_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.22.01 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_6_22_02_test.c b/test/regression/netxduo_test/netx_6_22_02_test.c new file mode 100644 index 00000000..406999f3 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_22_02_test.c @@ -0,0 +1,340 @@ +/* 6.22.02 If RECEIVE call arrives in FINWAIT-2 state, + TCP MUST reassemble queued incoming segments and return to the application. */ + +/* Procedure + 1. Client connect with Server, then Client state is ESTABLISHED. + 2. Client call disconnect without waiting, then Client state is FIN-WAIT-2.. + 3. Client call receive function,then judge the status. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_22_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.22.02 Test....................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Check client state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2) + error_counter++; + + /* Call socket receive. */ + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create three packets. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_22_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.22.02 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_6_23_test.c b/test/regression/netxduo_test/netx_6_23_test.c new file mode 100644 index 00000000..d93375a9 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_23_test.c @@ -0,0 +1,325 @@ +/* 6.23 If RECEIVE call arrives on CLOSE-WAIT state and there is data awaiting delivery, TCP MUST return the data to the application. */ + +/* Procedure + 1. Connection. + 2. Server sends a data packet. + 3. Server calls disconnect command and sends a FIN packet. + 4. Client replies the FIN packet and becomes CLOSE_WAIT state. + 5. Client calls receive command and checks the status is SUCCESS. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_23_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *rcv_packet_ptr; + + printf("NetX Test: TCP Spec 6.23 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + /* Client call receive. */ + status = nx_tcp_socket_receive(&client_socket, &rcv_packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + error_counter++; + else + { + /* Check data length and payload */ + if((rcv_packet_ptr -> nx_packet_length == 20) && (!memcmp(rcv_packet_ptr -> nx_packet_prepend_ptr, MSG, 20))) + data_packet_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet_ptr); + } + } + else + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (data_packet_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_23_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.23 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_6_24_test.c b/test/regression/netxduo_test/netx_6_24_test.c new file mode 100644 index 00000000..975e13ce --- /dev/null +++ b/test/regression/netxduo_test/netx_6_24_test.c @@ -0,0 +1,292 @@ +/* 6.24 If RECEIVE call arrives on CLOSE-WAIT state and there is no data awaiting delivery, TCP MUST respond error: connection closing to the application. */ + +/* Procedure + 1. Connection. + 2. Server calls disconnect command and sends a FIN packet. + 3. Client replies the FIN packet and becomes CLOSE_WAIT state. + 4. Client calls receive command and checks the status is NX_NOT_CONNECTED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_24_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 6.24 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + /* Call receive. */ + status = nx_tcp_socket_receive(&client_socket, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_24_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.24 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_6_25_test.c b/test/regression/netxduo_test/netx_6_25_test.c new file mode 100644 index 00000000..e1b3800a --- /dev/null +++ b/test/regression/netxduo_test/netx_6_25_test.c @@ -0,0 +1,310 @@ +/* 6.25 If RECEIVE call arrives on state LAST-ACK, TCP MUST return "error: connection closing". */ + +/* Procedure + 1. Connection. + 2. Server calls disconnect command and sends a FIN packet. + 3. Client replies an ACK packet and calls disconnect command. + 4. Client calls receive command. + 5. Check the state of client is LAST_ACK and TCP return NX_NOT_CONNECTED. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_6_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_25_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + printf("NetX Test: TCP Spec 6.25 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay FIN packet. */ + advanced_packet_process_callback = my_packet_process_6_25; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + if(client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + /* Client receive the packet. */ + status = nx_tcp_socket_receive(&client_socket, &my_packet, 50); + + if(status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_6_25(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* It is a FIN packet. */ + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_25_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.25 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_6_27_test.c b/test/regression/netxduo_test/netx_6_27_test.c new file mode 100644 index 00000000..50cefe2c --- /dev/null +++ b/test/regression/netxduo_test/netx_6_27_test.c @@ -0,0 +1,165 @@ +/* 6.27 For CLOSE call on CLOSED state, if the user has got access to such a connection, + TCP MUST return error: connection does not exist. */ + +/* Procedure +1. Client bind. +2. Client calls close command. +3. TCP return "NX_NOT_CONNECTED". */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_27_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.27 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the state of the TCP client. */ + if ( client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if (status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_27_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.27 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_6_28_test.c b/test/regression/netxduo_test/netx_6_28_test.c new file mode 100644 index 00000000..0349e219 --- /dev/null +++ b/test/regression/netxduo_test/netx_6_28_test.c @@ -0,0 +1,347 @@ +/* 6.28 For CLOSE call on state CLOSING, TCP MUST return with error: connection closing. */ + +/* Procedure + 1. Client connect with Server. + 2. Server call disconnect, then Server state is FINWAIT1. + 3. Client call disconnect,then Server state is CLOSING. + 4. Server call disconnect. + 5. Judge the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_6_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_6_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_28_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.28 Test........................................"); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay SYN packet. */ + advanced_packet_process_callback = my_packet_process_6_28; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the server socket to check the FIN segment*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_6_28; + + tx_thread_suspend(&ntest_0); + + if (server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + if (status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_6_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* SYN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_6_28(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Client receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* It is a SYN packet. */ + fin_counter++; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_28_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.28 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_6_29_test.c b/test/regression/netxduo_test/netx_6_29_test.c new file mode 100644 index 00000000..20e5293c --- /dev/null +++ b/test/regression/netxduo_test/netx_6_29_test.c @@ -0,0 +1,325 @@ +/* 6.29 TCP, in FINWAIT-1 state, MUST return error: connection closing for CLOSE call. */ + +/* Procedure + 1. Client connect with Server. + 2. Server disconnect, then server state is FINWAIT1. + 3. Client call disconnect. + 4. Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_6_29(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_29_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.29 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let driver delay FIN packet. */ + advanced_packet_process_callback = my_packet_process_6_29; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if (server_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + if (status != NX_NOT_CONNECTED) + error_counter++; + } + else + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter || (fin_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_6_29(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + /* FIN packet has been processed. */ + advanced_packet_process_callback = NX_NULL; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_29_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.29 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_6_32_test.c b/test/regression/netxduo_test/netx_6_32_test.c new file mode 100644 index 00000000..67d424df --- /dev/null +++ b/test/regression/netxduo_test/netx_6_32_test.c @@ -0,0 +1,298 @@ +/* 6.32 For CLOSE call on state FINWAIT-2, TCP SHOULD return error: connection closing. */ + +/* Procedure + 1. Client connect with Server. + 2. Server disconnect, then Server state is FINWAIT2. + 3. Server call disconnect function. + 4. Check the status. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_32_application_define(void *first_unused_memory) +#endif + { +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status += nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.32 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT ); + + /* Check if server state is FIN_WAIT_2. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2) + error_counter++; + + /* Server state is FIN_WAIT_2, Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check the server state. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisted on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error*/ + if(status) + error_counter++; + + /* Delete the socket*/ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error*/ + if (status) + error_counter++; + + /* Return error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_6_32_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 6.32 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_8_01_test.c b/test/regression/netxduo_test/netx_8_01_test.c new file mode 100644 index 00000000..fcef5239 --- /dev/null +++ b/test/regression/netxduo_test/netx_8_01_test.c @@ -0,0 +1,487 @@ +/* 8.01 TCP MUST ignore an incoming segment with RST flag in LISTEN state. */ + +/* Procedure +1. Connection. +2. Server calls disconnect command. +3. Server calls unaccept and relisten command. +4. Client sends a segment that is carrying an RST flag. +5. Check whether server send a packet in response to incoming segment. +6. Clean up.Print the resuit. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define MSG "ABCDEFGHIJKLMNOPQRSTUVWXYZ " +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG data_packet_counter; +static ULONG rst_counter; + +static ULONG client_tx; + +/* Define thread prototypes. */ + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT my_packet_process_8_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_8_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1.need? */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Set the callback function to my_packet_process_8_01. */ + advanced_packet_process_callback = my_packet_process_8_01; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup server socket state to LISTEN */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &server_socket); + + if(status) + error_counter++; + + /* Set the receive function to my_tcp_packet_receive_8_01. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_01; + + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* suspend the thread ntest_0. */ + tx_thread_suspend(&ntest_0); + + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.01 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Replace the TCP receive function with my_tcp_packet_receive_8_01 for ip_1. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_01_2; + + /* Check for error. */ + if(status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + client_tx = server_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Replace the TCP receive function with _nx_tcp_packet_receive for ip_1. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* resume the thread ntest_0 */ + tx_thread_resume(&ntest_0); + + /* Disconnect the server socket. */ + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /*Check the status. */ + if((error_counter == 0) && (rst_counter == 1) && (data_packet_counter == 1)) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG checksum = 0; +NX_TCP_HEADER *tcp_header_ptr; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +NX_IPV4_HEADER *ip_header_ptr; +#else +ULONG source_ip, dest_ip; +NX_IP_HEADER *ip_header_ptr; +#endif + + /* Point to the TCP HEADER */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Drop the FIN packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (packet_ptr -> nx_packet_length - 40 == 20)) + { + +#if defined(__PRODUCT_NETXDUO__) + + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); + +#else + + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); + +#endif + + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + tcp_header_ptr -> nx_tcp_header_word_3 &= 0xFFE0FFFF; + tcp_header_ptr -> nx_tcp_header_word_3 |= NX_TCP_ACK_BIT|NX_TCP_RST_BIT; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 &= 0x0000ffff; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + + dest_ip = &ip_header_ptr -> nx_ip_header_destination_ip; + source_ip = &ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + + dest_ip = ip_header_ptr -> nx_ip_header_destination_ip; + source_ip = ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); + +#endif + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); + +#else + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); + +#endif + + advanced_packet_process_callback = NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr->nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + if((packet_ptr -> nx_packet_length == 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20))) + data_packet_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_8_01_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr->nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(tcp_header_ptr -> nx_tcp_acknowledgment_number == client_tx) + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.01 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_8_02_test.c b/test/regression/netxduo_test/netx_8_02_test.c new file mode 100644 index 00000000..a99ac3ec --- /dev/null +++ b/test/regression/netxduo_test/netx_8_02_test.c @@ -0,0 +1,428 @@ +/* 8.2 :TCP in LISTEN state, + TCP MUST send RST in response to incoming segment with ACK and remain in the same state, + SEQ number of RST is taken from SEG.ACK. */ + +/* Procedure +1. Connection. +2. Server calls disconnect command. +3. Server calls unaccept and relisten command. +4. Client sends a segment that is carrying an ACK flag. +5. Server sends a RST segment with SEQ number taken from SEG.ACK. +6. Clean up.Print the resuit. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define MSG "ABCDEFGHIJKLMNOPQRSTUVWXYZ " +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; +static ULONG data_packet_counter; +static ULONG ack_segment; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_8_02_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + data_packet_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 8.02 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 100, NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Set the callback function to my_packet_process_8_02. */ + advanced_packet_process_callback = my_packet_process_8_02; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup server socket state to LISTEN */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &server_socket); + + if(status) + error_counter++; + + if (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Set the receive function to my_tcp_packet_receive_8_02. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_02; + + /* suspend the thread ntest_0 */ + tx_thread_suspend(&ntest_0); + + /* Check whether the server socket is in LISTEN state. */ + if((data_packet_counter == 1) && (rst_counter == 2)) + { + if (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + } + else + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Replace the TCP receive function with my_tcp_packet_receive_8_02 for ip_1. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_02_2; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Resume the thread ntest_0. */ + tx_thread_resume(&ntest_0); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /*Check the program status. */ + if((error_counter == 0) && (data_packet_counter == 1) && (rst_counter == 2)) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Point to the TCP header */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + rst_counter++; + + advanced_packet_process_callback = NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr->nx_packet_prepend_ptr; + + if ((packet_ptr -> nx_packet_length - 20 == 20) && !memcmp(packet_ptr -> nx_packet_prepend_ptr + 20, MSG, 20)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + ack_segment = tcp_header_ptr -> nx_tcp_acknowledgment_number; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + data_packet_counter++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_8_02_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr->nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if (tcp_header_ptr -> nx_tcp_sequence_number == ack_segment) + rst_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.02 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_8_17_test.c b/test/regression/netxduo_test/netx_8_17_test.c new file mode 100644 index 00000000..259c2505 --- /dev/null +++ b/test/regression/netxduo_test/netx_8_17_test.c @@ -0,0 +1,366 @@ +/* 8.17 TCP in SYN-SENT state MUST ignore a segment carrying an unacceptable ACK and RST. */ + +/* Procedure +1. Client connects. +2. Drop the SYN+ACK packet in the driver. +3. Server sends a segment that is carrying an ACK and RST flag with unacceptable ACK number. +4. Clean up.Print the resuit. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_17_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_8_17; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_17; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if(error_counter || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER tcp_header_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 8.17 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_1); + + /* If ACK bit not set, _nx_tcp_packet_send_rst will send one RST and ACK packet. */ + tcp_header_ptr.nx_tcp_header_word_3 = NX_TCP_RST_BIT; + + /* Set the sequence number. */ + tcp_header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + tcp_header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence + 30; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&server_socket, &tcp_header_ptr); + + /* Suspend the thread ntest_1. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + client_socket.nx_tcp_socket_rx_sequence = tcp_header_ptr -> nx_tcp_sequence_number + 1; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + syn_ack_counter++; + + advanced_packet_process_callback = NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + && (tcp_header_ptr ->nx_tcp_acknowledgment_number != client_socket.nx_tcp_socket_tx_sequence)) + { + rst_counter ++; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.17 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_8_18_test.c b/test/regression/netxduo_test/netx_8_18_test.c new file mode 100644 index 00000000..83343534 --- /dev/null +++ b/test/regression/netxduo_test/netx_8_18_test.c @@ -0,0 +1,450 @@ +/* 8.18 TCP, in SYN-SENT state MUST ignore a RST control message. */ + +/* Procedure +1. Client connects. +2. Drop the SYN+ACK packet in the driver. +3. Server sends a segment that is carrying an RST and ACK flag. +4. Modify the packet with RST flag. +5. Client ignores the packet. +6. Clean up.Print the resuit. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_18_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_8_18; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_18; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if(error_counter || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER tcp_header_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 8.18 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_1); + + + /* Set the RST. */ + tcp_header_ptr.nx_tcp_header_word_3 |= NX_TCP_RST_BIT | NX_TCP_ACK_BIT; + + /* Set the sequence number. */ + tcp_header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + tcp_header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&server_socket, &tcp_header_ptr); + + + /* Suspend the thread ntest_1. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum = 0; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +NX_IPV4_HEADER *ip_header_ptr; +#elif defined(__PRODUCT_NETX__) +ULONG source_ip, dest_ip; +NX_IP_HEADER *ip_header_ptr; +#endif + + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + client_socket.nx_tcp_socket_rx_sequence = tcp_header_ptr -> nx_tcp_sequence_number + 1; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + syn_ack_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + } + + /* Remove the ACK bit in THE rst packet. */ + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { +#if defined(__PRODUCT_NETXDUO__) + + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); + +#elif defined(__PRODUCT_NETX__) + + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); + +#endif + + tcp_header_ptr -> nx_tcp_header_word_3 &= 0xffc0ffff; + tcp_header_ptr -> nx_tcp_header_word_3 |= NX_TCP_RST_BIT; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + tcp_header_ptr -> nx_tcp_header_word_4 &= 0x0000ffff; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + + dest_ip = &ip_header_ptr -> nx_ip_header_destination_ip; + source_ip = &ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + + checksum = ~checksum & NX_LOWER_16_MASK; + +#elif defined(__PRODUCT_NETX__) + + dest_ip = ip_header_ptr -> nx_ip_header_destination_ip; + source_ip = ip_header_ptr -> nx_ip_header_source_ip; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); + +#endif + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); + +#elif defined(__PRODUCT_NETX__) + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); + +#endif + + advanced_packet_process_callback = NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + rst_counter ++; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.18 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_8_19_test.c b/test/regression/netxduo_test/netx_8_19_test.c new file mode 100644 index 00000000..b122876e --- /dev/null +++ b/test/regression/netxduo_test/netx_8_19_test.c @@ -0,0 +1,359 @@ +/* 8.19 TCP, in SYN-SENT state MUST move on to CLOSED state after receiving a segment with ACK and RST and acceptable ACK number. */ + +/* Procedure +1. Connection. +2. Drop the SYN+ACK packet in the driver. +3. Server sends a segment that is carrying an ACK and RST flag with acceptable ACK number. +4. Check the client state. +5. Clean up.Print the resuit. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_19_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_8_19; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_19; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if(error_counter || (syn_ack_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER tcp_header_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 8.19 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_1); + + /* Set the RST. */ + tcp_header_ptr.nx_tcp_header_word_3 = NX_TCP_RST_BIT; + + /* Set the sequence number. */ + tcp_header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence ; + tcp_header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence ; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&server_socket, &tcp_header_ptr); + + /* Suspend the thread ntest_1. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + syn_ack_counter++; + + advanced_packet_process_callback = NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + return NX_TRUE; +} + + +static void my_tcp_packet_receive_8_19(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (tcp_header_ptr -> nx_tcp_acknowledgment_number == client_socket.nx_tcp_socket_tx_sequence)) + { + rst_counter++; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_19_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.19 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_8_20_test.c b/test/regression/netxduo_test/netx_8_20_test.c new file mode 100644 index 00000000..b41d6952 --- /dev/null +++ b/test/regression/netxduo_test/netx_8_20_test.c @@ -0,0 +1,352 @@ +/* 8.20 TCP, in SYN-SENT state MUST remain in the same state after receiving a segment with neither SYN nor RST flag set. */ + + +/* Procedure +1. Connection. +2. Drop syn+ack packet. +3. server sends ack packet. +4. the state of client socket should be the SYN_SENT. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG ack_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_20_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_8_20; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check the client socket state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT) + error_counter++; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_20; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Check whether the client socket state has changed. */ + if((ack_counter != 1) || (client_socket.nx_tcp_socket_state != NX_TCP_SYN_SENT)) + error_counter++; + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if(error_counter || (syn_ack_counter != 1) || (ack_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(2); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 8.20 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + /* Suspend the thread ntest_1. */ + tx_thread_suspend(&ntest_1); + + /* Send a ack packet. */ + _nx_tcp_packet_send_ack(&server_socket,server_socket.nx_tcp_socket_tx_sequence); + + /* Suspend the thread ntest_1. */ + tx_thread_suspend(&ntest_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Drop the SYN+ACK packet in order to postpone the connection. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + syn_ack_counter++; + + advanced_packet_process_callback = NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if(!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_acknowledgment_number == client_socket.nx_tcp_socket_tx_sequence)) + { + ack_counter++; + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.20 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_8_21_test.c b/test/regression/netxduo_test/netx_8_21_test.c new file mode 100644 index 00000000..aed3857a --- /dev/null +++ b/test/regression/netxduo_test/netx_8_21_test.c @@ -0,0 +1,392 @@ +/* 8.21:TCP, in SYN-RCVD state, + MUST send ACK with next expected SEQ num on receiving any segment (without RST) with OTW SEQ number and remain in the same state. */ + +/* Procedure + 1.Connect + 2.Set server socket to SYN_RCVD state + 3.Client sends a packet with OTW SEQ to server + 4.Client should receive an ACK with proper SEQ and ACK numbers, and server socket should remain in SYN_RCVD state */ + +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ack_counter; +static ULONG seg_counter; +static ULONG expected_ack; +static ULONG expected_seq; +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_8_21_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_21_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + seg_counter = 0; + ack_counter = 0; + expected_ack = 0; + expected_seq = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Spec 8.21 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_21; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + /* Suspend the thread ntest_0. */ + tx_thread_suspend(&ntest_0); + + /* Check the server socket state. */ + if((seg_counter != 1) || (server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Set the port to NULL. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process_8_21; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Deal the packet with my routing. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_21_2; + + expected_ack = client_socket.nx_tcp_socket_tx_sequence; + + /* Send FIN with OTW sequence. */ + _nx_tcp_packet_send_fin(&client_socket,(client_socket.nx_tcp_socket_tx_sequence - 50)); + + /* Resume the thread ntest_1. */ + tx_thread_resume(&ntest_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check for error. */ + if(error_counter || (ack_counter != 1) || (seg_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Skip packet that is not TCP. */ + if (packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Drop the ACK packet. */ + if(!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + advanced_packet_process_callback = NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Check the server socket state. */ + if(server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + /* Check the FIN packet with OTW sequence. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + if((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) + { + seg_counter++; + + /* Record expected sequence of the server socket. */ + expected_seq = server_socket.nx_tcp_socket_tx_sequence; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_8_21_2(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Check the ACK packet. */ + if(!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && + (tcp_header_ptr -> nx_tcp_sequence_number == expected_seq) && (tcp_header_ptr -> nx_tcp_acknowledgment_number == expected_ack)) + { + ack_counter++; + + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_21_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.21 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_8_29_01_test.c b/test/regression/netxduo_test/netx_8_29_01_test.c new file mode 100644 index 00000000..785a0b6f --- /dev/null +++ b/test/regression/netxduo_test/netx_8_29_01_test.c @@ -0,0 +1,385 @@ +/* 8.29.01 TCP, in SYN-RECEIVED or ESTABLISHED state,MUST ignore a RST segment with OTW SEQ number. */ + +/* Procedure + 1.Client sends a SYN to Server. + 2.Server responses SYN+ACK to Client. + 3.Delay the SYN+ACK packet. + 4.When Server is on the SYN_RECEIVED state, Client sends a RST which contains a OTW SEQ to Server. + 5.Check whether the state has been changed. + 6.When Server is on the ESTABLISHED state, Client sends a RST which contains a OTW SEQ to Server. + 7.Check whether the state has been changed.*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_29_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_29_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_01_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.01 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_8_29_01; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + /* Check Server socket's state. */ + if((rst_counter != 1) || (server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED)) + error_counter++; + + status = nx_tcp_socket_state_wait(&server_socket, NX_TCP_ESTABLISHED, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* Check Server socket's state. */ + if((rst_counter != 2) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence - 10; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + tx_thread_resume(&ntest_0); + + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence - 20; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + tx_thread_resume(&ntest_0); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (syn_ack_counter != 1) || (rst_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_29_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(packet_ptr -> nx_packet_length >= 40) + { + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a SYN+ACK packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + syn_ack_counter++; + + /* Delay 500 ticks. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = 200; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_29_01; + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_29_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(((server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) && (rst_counter == 0)) || ((server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) && (rst_counter == 1))) + { + /* Check if the packet is a RST one with OTW SEQ number. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) + rst_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + } + + if(rst_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.01 Test.....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_8_29_02_test.c b/test/regression/netxduo_test/netx_8_29_02_test.c new file mode 100644 index 00000000..c71ed782 --- /dev/null +++ b/test/regression/netxduo_test/netx_8_29_02_test.c @@ -0,0 +1,380 @@ +/* 8.29.02 TCP, in FINWAIT-1 or FINWAIT-2 state,MUST ignore a RST segment with OTW SEQ number. */ + +/* Procedure + 1.Connection. + 2.Server disconnect without waiting. + 3.Delay the FIN packet. + 4.When Server is on the FINWAIT-1 state, Client sends a RST which contains a OTW SEQ to Server. + 5.Check whether the state has been changed. + 6.When Server is on the FINWAIT-2 state, Client sends a RST which contains a OTW SEQ to Server. + 7.Check whether the state has been changed. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_29_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_29_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_02_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.02 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_8_29_02; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_29_02; + + tx_thread_suspend(&ntest_0); + + if((rst_counter != 1) || (server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1)) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if(server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2) + error_counter++; + + tx_thread_suspend(&ntest_0); + + if((rst_counter != 2) || (server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_2)) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1) || (rst_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence - 10; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + tx_thread_resume(&ntest_0); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence - 20; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + tx_thread_resume(&ntest_0); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_29_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_29_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) + rst_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(rst_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.02 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_8_29_03_test.c b/test/regression/netxduo_test/netx_8_29_03_test.c new file mode 100644 index 00000000..a3a590fd --- /dev/null +++ b/test/regression/netxduo_test/netx_8_29_03_test.c @@ -0,0 +1,341 @@ +/* 8.29.03 TCP, in CLOSING state,MUST ignore a RST segment with OTW SEQ number. */ + +/* Procedure + 1. Client connect with Server. + 2. Server call disconnect, then Server state is FINWAIT1. + 3. CLient call disconnect,then Server state is CLOSING. + 4. Client send a RST to Server. + 5. Check whether the state has been changed. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_29_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_29_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_03_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_8_29_03; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_29_03; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_0); + + if((rst_counter != 1) || (server_socket.nx_tcp_socket_state != NX_TCP_CLOSING)) + error_counter++; + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_TCP_HEADER header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.03 Test....................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence - 10; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + tx_thread_resume(&ntest_0); + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 2) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_29_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (fin_counter == 0)) + { + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_29_03(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + /* Check the packet is a RST one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) + rst_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + else if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + fin_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_03_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.03 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_8_29_04_test.c b/test/regression/netxduo_test/netx_8_29_04_test.c new file mode 100644 index 00000000..7607917b --- /dev/null +++ b/test/regression/netxduo_test/netx_8_29_04_test.c @@ -0,0 +1,367 @@ +/* 8.29.04 TCP, in CLOSE-WAIT or LAST-ACK state,MUST ignore a RST segment with OTW SEQ number. */ + +/* Procedure + 1.Connection. + 2.Server disconnect without waiting. + 3.When Client is on the CLOSE-WAIT state, Server sends a RST which contains a OTW SEQ to Client. + 4.Check whether the state has been changed. + 5.Client disconnect without waiting. + 6.Delay the FIN packet. + 7.When Client is on the LAST-ACK state, Server sends a RST which contains a OTW SEQ to Client. + 8.Check whether the state has been changed. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_8_29_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_8_29_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_04_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the received packet with my routine. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_8_29_04; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check whether the client socket's state changed after receiving a RST packet. */ + if((rst_counter != 1) || (client_socket.nx_tcp_socket_state != NX_TCP_CLOSE_WAIT)) + error_counter++; + + /* Delay the FIN packet in my_packet_process_8_29_04 to keep the socket in LAST_ACK state. */ + advanced_packet_process_callback = my_packet_process_8_29_04; + + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + if(client_socket.nx_tcp_socket_state != NX_TCP_LAST_ACK) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Check whether the client socket's state changed after receiving a RST packet. */ + if((rst_counter != 2) || (client_socket.nx_tcp_socket_state != NX_TCP_LAST_ACK)) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Determine if the test was successful. */ + if((error_counter) || (fin_counter != 1) || (rst_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.04 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + +#if 0 + tx_thread_suspend(&ntest_1); +#endif + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence - 10; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + tx_thread_suspend(&ntest_1); + + /* Send RST */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_RST_BIT; + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence - 20; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + tx_thread_suspend(&ntest_1); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process_8_29_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + fin_counter++; + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} + +static void my_tcp_packet_receive_8_29_04(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + if(((client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) && (rst_counter == 0)) || ((client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) && (rst_counter == 1))) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check whether the packet is a RST one. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if ((tcp_header_ptr -> nx_tcp_sequence_number < server_socket.nx_tcp_socket_rx_sequence) || + (tcp_header_ptr -> nx_tcp_sequence_number >= server_socket.nx_tcp_socket_rx_sequence + server_socket.nx_tcp_socket_rx_window_current)) + rst_counter++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + if(rst_counter == 2) + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_8_29_04_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 8.29.04 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_9_17_test.c b/test/regression/netxduo_test/netx_9_17_test.c new file mode 100644 index 00000000..ac871e5d --- /dev/null +++ b/test/regression/netxduo_test/netx_9_17_test.c @@ -0,0 +1,336 @@ +/* 9.17 TCP, in SYN-RCVD state, reached through active OPEN, MUST inform "connection refused" to application on recv a RST. + and socket state MUST go to CLOSED state on RST.*/ + +/* RFC 793, Section 3.9, page 70, Event Processing. +The user need not be informed. If this connection was +initiated with an active OPEN (i.e., came from SYN-SENT state) +then the connection was refused, signalthe user "connection refused". +In either case, all segmentson the retransmission queue should be removed. +And in the active OPEN case, enter the CLOSED state and delete the TCB,and return. */ + +/* Procedure +1. Client_1 sends a SYN to Client_2. +2. Use my_packet_process_9_17 function to drop the SYN packet. +3. Client_2 sends a SYN to Client_1. +4. Client_1 send a SYN+ACK to Client_2. +5. Use my_packet_process_9_17 function to drop the SYN+ACK packet. +6. Client_2 sends a RST to Client_1. +7. Check the connection return status and the Client_1 state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_1_socket; +static NX_TCP_SOCKET client_2_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_3000(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_3000(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_9_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_9_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_17_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the counters. */ + error_counter = 0; + syn_counter = 0; + rst_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_3000, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_3000, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the client thread. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.17 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_1_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_1_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the SYN packet with my routing */ + advanced_packet_process_callback = my_packet_process_9_17; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_17; + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_1_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Judge the Client state. */ + if((rst_counter != 1) || (client_1_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || status != NX_NOT_CONNECTED) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_1_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_1_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +/* Define the server thread. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_2_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_bind(&client_2_socket, 12, NX_IP_PERIODIC_RATE); + + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_2_socket, IP_ADDRESS(1, 2, 3, 4), 12, NX_NO_WAIT); + + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + header_ptr.nx_tcp_acknowledgment_number = client_1_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_1_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&client_2_socket, &header_ptr); + + tx_thread_sleep(1); + + /* Return error. */ + if((error_counter) || (syn_counter != 2 ) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process_9_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if (ip_ptr != &ip_0) + return NX_TRUE; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Check if it is a SYN packet. */ + if (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (syn_counter == 0)) + { + syn_counter++; + + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + else if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (syn_counter == 2)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + } + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +void my_tcp_packet_receive_9_17(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && (syn_counter == 1)) + { + syn_counter++; + } + /* Check the packet is a RST one. */ + else if (client_1_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.17 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_9_18_test.c b/test/regression/netxduo_test/netx_9_18_test.c new file mode 100644 index 00000000..19436193 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_18_test.c @@ -0,0 +1,333 @@ +/* 9.18 TCP, in ESTABLISHED state, MUST return to CLOSED state on RESET. */ + +/* RFC 793, Section 3.9, page 70, Event Processing. +ESTABLISHED +If the RST bit is set then, Users should receive an unsolicited general +"connection reset" signal. Enter the CLOSED state, delete the TCB, +and return. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Server sends a RST to Client. +3. Check the Client state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_9_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_18_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&ntest_0, "ntest 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&ntest_1, "ntest 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the client thread. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.18 Test........................................"); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Let client checks the packet. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_18; + + /* Call connect to send an SYN. */ + status =nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + /* Check the client state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +/* Define the server thread. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Send a RST packet */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_disconnect(&server_socket,NX_NO_WAIT); + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +void my_tcp_packet_receive_9_18(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) + { + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.18 Test........................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_9_19_01_test.c b/test/regression/netxduo_test/netx_9_19_01_test.c new file mode 100644 index 00000000..88351e13 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_19_01_test.c @@ -0,0 +1,372 @@ +/* 9.19.01 TCP, in FINWAIT-1 state, MUST return to CLOSED state on RST. */ + +/* RFC 793, Section 3.9, page 70, Event Processing. + FIN-WAIT-1 + If the RST bit is set then, Users should receive an unsolicited general + "connection reset" signal. Enter the CLOSED state, delete the TCB, + and return. */ + +/* Procedure +1. Establish a connection by the "three-way handshake" procedure. +2. Client disconnect, then Client state is FINWAIT1. +3. Server sends a RST to Client. +4. Judge the Client state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fin_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_9_19_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_9_19_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_19_01_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fin_counter = 0; + rst_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&ntest_0, "ntest 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&ntest_1, "ntest 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.19.01 Test....................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_9_19_01; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_19_01; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + tx_thread_resume(&ntest_1); + + + /* Check the client state. */ + if((rst_counter != 1) || (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED)) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status += nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (fin_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Let the ACK number is big enough excluding the OTW situation. */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_disconnect(&server_socket,NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static UINT my_packet_process_9_19_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER* tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + fin_counter++; + + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +void my_tcp_packet_receive_9_19_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + else + error_counter++; + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_19_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.19.01 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_9_19_02_test.c b/test/regression/netxduo_test/netx_9_19_02_test.c new file mode 100644 index 00000000..8e97aa17 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_19_02_test.c @@ -0,0 +1,315 @@ +/* 9.19.02 TCP, in FINWAIT-2 state, MUST return to CLOSED state on RST. */ + +/* RFC 793, Section 3.9, page 70, Event Processing. + FIN-WAIT-2 + If the RST bit is set then, Users should receive an unsolicited general + "connection reset" signal. Enter the CLOSED state, delete the TCB, + and return. */ + +/* Procedure + 1. Establish a connection by the "three-way handshake" procedure. + 2. Client disconnect, then Client state is FINWAIT2. + 3. Server sends a RST to Client. + 4. Judge the Client state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined NX_DISABLE_RESET_DISCONNECT && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_9_19_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_19_02_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "ntest 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "ntest 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.19.02 Test....................................."); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_19_02; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + + tx_thread_resume(&ntest_1); + + /* Check the client state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + tx_thread_resume(&ntest_1); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Send a RST packet */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + tx_thread_suspend(&ntest_1); + + status = nx_tcp_socket_disconnect(&server_socket,NX_NO_WAIT); + + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +void my_tcp_packet_receive_9_19_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_FIN_WAIT_2) + { + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_19_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.19.02 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_9_20_test.c b/test/regression/netxduo_test/netx_9_20_test.c new file mode 100644 index 00000000..343d6606 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_20_test.c @@ -0,0 +1,321 @@ +/* 9.20 TCP, in CLOSE-WAIT state, MUST return to CLOSED state on RST. */ + +/* Procedure + 1. Client connect with Server. + 2. Server disconnect, then Client state is CLOSE-WAIT. + 3. Server sends RST to Client. + 4. Judge the Client state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_9_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_20_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 256 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.20 Test........................................"); + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*Let the client socket check the RST packet*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_20; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the client state. */ + if((rst_counter != 1) || (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED)) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status += nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Set the sequence number. */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + + +void my_tcp_packet_receive_9_20(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_20_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.20 Test........................................N/A\n"); + test_control_return(3); + +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_9_21_01_test.c b/test/regression/netxduo_test/netx_9_21_01_test.c new file mode 100644 index 00000000..30549984 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_21_01_test.c @@ -0,0 +1,365 @@ +/* 9.21 TCP, in CLOSING, LAST-ACK state, MUST return to CLOSED state on receiving a RST. */ + +/*9.21.1 test the TCP in LAST-ACK state*/ +/* Procedure + 1. Client connect with Server. + 2. Server disconnect. + 3. Client disconnect,then Client's state move to LAST-ACK state. + 4. Server sends RST to Client. + 5. Judge the Client state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_9_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_9_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_21_01_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.21.01 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the FIN packet with my routing */ + advanced_packet_process_callback = my_packet_process_9_21_01; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_21_01; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + tx_thread_resume(&ntest_1); + + /* Check the client state. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_TCP_HEADER header_ptr; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if (status) + error_counter++; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_suspend(&ntest_1); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Set the sequence number. */ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence + 1; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&server_socket, &header_ptr); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + + +static UINT my_packet_process_9_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* drop the fin packet send from client to server */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +void my_tcp_packet_receive_9_21_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(client_socket.nx_tcp_socket_state == NX_TCP_LAST_ACK) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_21_01_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.21.01 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_9_21_02_test.c b/test/regression/netxduo_test/netx_9_21_02_test.c new file mode 100644 index 00000000..239355b8 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_21_02_test.c @@ -0,0 +1,359 @@ +/* 9.21 TCP, in CLOSING, LAST-ACK state, MUST return to CLOSED state on receiving a RST. */ + +/*9.21.2 test the TCP in CLOSING state*/ +/* Procedure + 1. Client connect with Server. + 2. Server disconnect, delay the FIN packet + 3. Client disconnect, then Server state is CLOSING + 4. Client sends RST to Server. + 5. Check the Server state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_9_21_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_9_21_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_21_02_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536 * 16); + pointer = pointer + 1536 * 16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.21.02 Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process_9_21_02; + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_21_02; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) +#else + if(server_socket.nx_tcp_socket_state != NX_TCP_CLOSED) +#endif + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send an SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call disconnect to send an FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + /* Set the sequence number. */ + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence + 1; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + +} + + +static UINT my_packet_process_9_21_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER* tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + /*Delay the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + advanced_packet_process_callback = NX_NULL; + + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +void my_tcp_packet_receive_9_21_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if(server_socket.nx_tcp_socket_state == NX_TCP_CLOSING) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a RST one. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_21_02_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.21.02 Test.....................................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_9_22_test.c b/test/regression/netxduo_test/netx_9_22_test.c new file mode 100644 index 00000000..370f85ef --- /dev/null +++ b/test/regression/netxduo_test/netx_9_22_test.c @@ -0,0 +1,349 @@ +/* 9.22 TCP, in SYN-RCVD state through passive open, MUST return to LISTEN state on RST. */ + + +/* Procedure +1. Client connect to the Server. +2. Drop the ack packet sent from the Client to the Server, then the server state is SYN_RCVD +3. Client sends a RST to Server. +4. Judge the Server state. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process_9_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_9_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_22_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.22 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal the the SYN+ACK packet with my routine. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_22; + advanced_packet_process_callback = my_packet_process_9_22; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check the state of the client. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_TCP_HEADER header_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Call connect to send a SYN. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Send RST. */ + header_ptr.nx_tcp_header_word_3 = header_ptr.nx_tcp_header_word_3 | NX_TCP_ACK_BIT | NX_TCP_RST_BIT; + + header_ptr.nx_tcp_acknowledgment_number = server_socket.nx_tcp_socket_rx_sequence; + header_ptr.nx_tcp_sequence_number = server_socket.nx_tcp_socket_tx_sequence + 1; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if((error_counter) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static UINT my_packet_process_9_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a SYN+ACK packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT)) + { + /*Drop the packet*/ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; + +} + +void my_tcp_packet_receive_9_22(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Check the packet is a RST one. */ + if (server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_22_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.22 Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_9_27_test.c b/test/regression/netxduo_test/netx_9_27_test.c new file mode 100644 index 00000000..155994a0 --- /dev/null +++ b/test/regression/netxduo_test/netx_9_27_test.c @@ -0,0 +1,428 @@ +/* 9.27 TCP, in SYN-RCVD state, MUST send a reset and go to CLOSED, on recv a seg with SYN in window. */ + +/* Procedure +1. Client connect to the Server. +2. Change the ACK packet sent from the Client to the Server to a SYN packet. +3. Judge whether the Client received a RST packet. +4. Judge the Server state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG rst_counter; + +static UINT syn_flag; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +extern USHORT _nx_ip_checksum_compute(NX_PACKET *, ULONG, UINT, ULONG *, ULONG *); + +static UINT my_packet_process_9_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive_9_27_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void my_tcp_packet_receive_9_27_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_27_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + rst_counter = 0; + syn_flag = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.27 Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_27_01; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + if(server_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Deal rst with my routing. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_9_27_02; + advanced_packet_process_callback = my_packet_process_9_27; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Disconnect the socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Return error. */ + if(error_counter || (syn_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Return success. */ + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process_9_27(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; + +#if defined(__PRODUCT_NETXDUO__) +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +#endif + + if (packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + syn_flag = 1; + + /* Clean the ACK bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3 & 0xFFEFFFFF; + + /* Set the SYN bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3 | NX_TCP_SYN_BIT; + + /*SYN occupy a squence number*/ + client_socket.nx_tcp_socket_tx_sequence ++; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); +#endif + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + +#if defined(__PRODUCT_NETXDUO__) + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &ip_1.nx_ip_interface[TEST_INTERFACE].nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#else + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_1.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); +#endif + + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + advanced_packet_process_callback = NX_NULL; + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + + +static void my_tcp_packet_receive_9_27_01(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + if((server_socket.nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) && (syn_flag == 1)) + { + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check the packet is a SYN one. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) + { + syn_counter++; + + /* Deal packets with default routing. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + } + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void my_tcp_packet_receive_9_27_02(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + rst_counter++; + + /* Deal packets with default routing. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_9_27_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Spec 9.27 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_api_compile_test.c b/test/regression/netxduo_test/netx_api_compile_test.c new file mode 100644 index 00000000..f6fa0b08 --- /dev/null +++ b/test/regression/netxduo_test/netx_api_compile_test.c @@ -0,0 +1,332 @@ +/* This NetX test concentrates on compiling all APIs for NetXDuo. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) +#define DEMO_STACK_SIZE 2048 +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_packet.h" +#include "nx_tcp.h" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static ULONG error_counter = 0; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_api_compile_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +NX_PACKET *pkt_ptr = NX_NULL; + + /* Print out test information banner. */ + printf("NetX Test: API Compile Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* APIs for ARP. */ + nx_arp_dynamic_entries_invalidate(0); + nx_arp_dynamic_entry_set(0, 0, 0, 0); + nx_arp_enable(0, 0 , 0); + nx_arp_entry_delete(0, 0); + nx_arp_gratuitous_send(0, 0); + nx_arp_hardware_address_find(0, 0, 0, 0); + nx_arp_info_get(0, 0, 0, 0, 0, 0, 0, 0, 0); + nx_arp_ip_address_find(0, 0, 0, 0); + nx_arp_static_entries_delete(0); + nx_arp_static_entry_create(0, 0, 0, 0); + nx_arp_static_entry_delete(0, 0, 0, 0); + + /* APIs for ICMP */ + nx_icmp_enable(0); + nx_icmp_info_get(0, 0, 0, 0, 0, 0, 0); + nx_icmp_ping(0, 0, 0, 0, 0, 0); + nxd_icmp_enable(0); + nxd_icmp_ping(0, 0, 0, 0, 0, 0); + nxd_icmp_source_ping(0, 0, 0, 0, 0, 0, 0); + nxd_icmpv6_ra_flag_callback_set(0, 0); + + /* APIs for IGMP */ + nx_igmp_enable(0); + nx_igmp_info_get(0, 0, 0, 0, 0); + nx_igmp_loopback_disable(0); + nx_igmp_loopback_enable(0); + nx_igmp_multicast_interface_join(0, 0, 0); + nx_igmp_multicast_interface_leave(0, 0, 0); + nx_igmp_multicast_join(0, 0); + nx_igmp_multicast_leave(0, 0); + + /* APIs for IP */ + nx_ip_address_change_notify(0, 0, 0); + nx_ip_address_get(0, 0, 0); + nx_ip_address_set(0, 0, 0); + nx_ip_auxiliary_packet_pool_set(0, 0); +#ifndef NX_ENABLE_DUAL_PACKET_POOL + _nx_ip_auxiliary_packet_pool_set(0, 0); +#endif + nx_ip_create(0, 0, 0, 0, 0, 0, 0, 0, 0); + nx_ip_delete(0); + nx_ip_driver_direct_command(0, 0, 0); + nx_ip_driver_interface_direct_command(0, 0, 0, 0); + nx_ip_forwarding_disable(0); + nx_ip_forwarding_enable(0); + nx_ip_fragment_disable(0); + nx_ip_fragment_enable(0); + nx_ip_gateway_address_clear(0); + nx_ip_gateway_address_get(0, 0); + nx_ip_gateway_address_set(0, 0); + nx_ip_info_get(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + nx_ip_interface_address_get(0, 0, 0, 0); + nx_ip_interface_address_mapping_configure(0, 0, 0); + nx_ip_interface_address_set(0, 0, 0, 0); + nx_ip_interface_attach(0, 0, 0, 0, 0); + nx_ip_interface_capability_get(0, 0, 0); + nx_ip_interface_capability_set(0, 0, 0); +#ifndef NX_ENABLE_INTERFACE_CAPABILITY + _nx_ip_interface_capability_get(0, 0, 0); + _nx_ip_interface_capability_set(0, 0, 0); +#endif + nx_ip_interface_detach(0, 0); + nx_ip_interface_info_get(0, 0, 0, 0, 0, 0, 0, 0); + nx_ip_interface_mtu_set(0, 0, 0); + nx_ip_interface_physical_address_get(0, 0, 0, 0); + nx_ip_interface_physical_address_set(0, 0, 0, 0, 0); + nx_ip_interface_status_check(0, 0, 0, 0, 0); + nx_ip_link_status_change_notify_set(0, 0); + nx_ip_max_payload_size_find(0, 0, 0, 0, 0, 0, 0, 0); + nx_ip_status_check(0, 0, 0, 0); + nx_ip_static_route_add(0, 0, 0, 0); + nx_ip_static_route_delete(0, 0, 0); +#ifndef NX_ENABLE_IP_STATIC_ROUTING + _nx_ip_static_route_add(0, 0, 0, 0); + _nx_ip_static_route_delete(0, 0, 0); +#endif + nx_ipv4_multicast_interface_join(0, 0, 0); + nx_ipv4_multicast_interface_leave(0, 0, 0); + nxd_ipv6_address_change_notify(0, 0); +#ifndef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + _nxd_ipv6_address_change_notify(0, 0); +#endif + nxd_ipv6_address_delete(0, 0); + nxd_ipv6_address_get(0, 0, 0, 0, 0); + nxd_ipv6_address_set(0, 0, 0, 0, 0); + nxd_ipv6_default_router_add(0, 0, 0, 0); + nxd_ipv6_default_router_delete(0, 0); + nxd_ipv6_default_router_entry_get(0, 0, 0, 0, 0, 0, 0); + nxd_ipv6_default_router_get(0, 0, 0, 0, 0); + nxd_ipv6_default_router_number_of_entries_get(0, 0, 0); + nxd_ipv6_disable(0); + nxd_ipv6_enable(0); + nxd_ipv6_multicast_interface_join(0, 0, 0); + nxd_ipv6_multicast_interface_leave(0, 0, 0); +#ifndef NX_ENABLE_IPV6_MULTICAST + _nxd_ipv6_multicast_interface_join(0, 0, 0); + _nxd_ipv6_multicast_interface_leave(0, 0, 0); +#endif + nxd_ipv6_stateless_address_autoconfig_disable(0, 0); + nxd_ipv6_stateless_address_autoconfig_enable(0, 0); +#ifndef NX_IPV6_STATELESS_AUTOCONFIG_CONTROL + _nxd_ipv6_stateless_address_autoconfig_disable(0, 0); + _nxd_ipv6_stateless_address_autoconfig_enable(0, 0); +#endif + + /* APIs for RAW service. */ + nx_ip_raw_packet_disable(0); + nx_ip_raw_packet_enable(0); + nx_ip_raw_packet_filter_set(0, 0); +#ifndef NX_ENABLE_IP_RAW_PACKET_FILTER + _nx_ip_raw_packet_filter_set(0, 0); +#endif + nx_ip_raw_packet_receive(0, 0, 0); + nx_ip_raw_packet_send(0, pkt_ptr, 0, 0); + nx_ip_raw_packet_source_send(0, pkt_ptr, 0, 0, 0); + nx_ip_raw_receive_queue_max_set(0, 0); + nxd_ip_raw_packet_send(0, pkt_ptr, 0, 0, 0, 0); + nxd_ip_raw_packet_source_send(0, 0, 0, 0, 0, 0, 0); + + /* APIs for ND cache. */ + nxd_nd_cache_entry_set(0, 0, 0, 0); + nxd_nd_cache_entry_delete(0, 0); + nxd_nd_cache_hardware_address_find(0, 0, 0, 0, 0); + nxd_nd_cache_invalidate(0); + nxd_nd_cache_ip_address_find(0, 0, 0, 0, 0); + + /* APIs for packet pool. */ + nx_packet_allocate(0, 0, 0, 0); + nx_packet_copy(0, 0, 0, 0); + nx_packet_data_append(0, 0, 0, 0, 0); + nx_packet_data_extract_offset(0, 0, 0, 0, 0); + nx_packet_data_retrieve(0, 0, 0); + nx_packet_length_get(0, 0); + nx_packet_pool_create(0, 0, 0, 0, 0); + nx_packet_pool_delete(0); + nx_packet_pool_info_get(0, 0, 0, 0, 0, 0); + nx_packet_pool_low_watermark_set(0, 0); +#ifndef NX_ENABLE_LOW_WATERMARK + _nx_packet_pool_low_watermark_set(0, 0); +#endif + nx_packet_release(pkt_ptr); + nx_packet_transmit_release(pkt_ptr); + + /* APIs for RARP. */ + nx_rarp_disable(0); + nx_rarp_enable(0); + nx_rarp_info_get(0, 0, 0, 0); + + /* APIs for TCP. */ + nx_tcp_client_socket_bind(0, 0, 0); + nx_tcp_client_socket_connect(0, 0, 0, 0); + nx_tcp_client_socket_port_get(0, 0); + nx_tcp_client_socket_unbind(0); + nx_tcp_enable(0); + nx_tcp_free_port_find(0, 0, 0); + nx_tcp_info_get(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + nx_tcp_server_socket_accept(0, 0); + nx_tcp_server_socket_listen(0, 0, 0, 0, 0); + nx_tcp_server_socket_relisten(0, 0, 0); + nx_tcp_server_socket_unaccept(0); + nx_tcp_server_socket_unlisten(0, 0); + nx_tcp_socket_bytes_available(0, 0); + nx_tcp_socket_create(0, 0, 0, 0, 0, 0, 0, 0, 0); + nx_tcp_socket_delete(0); + nx_tcp_socket_disconnect(0, 0); + nx_tcp_socket_disconnect_complete_notify(0, 0); + nx_tcp_socket_establish_notify(0, 0); +#ifdef NX_DISABLE_EXTENDED_NOTIFY_SUPPORT + _nx_tcp_socket_disconnect_complete_notify(0, 0); + _nx_tcp_socket_establish_notify(0, 0); +#endif + nx_tcp_socket_info_get(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + nx_tcp_socket_mss_get(0, 0); + nx_tcp_socket_mss_peer_get(0, 0); + nx_tcp_socket_mss_set(0, 0); + nx_tcp_socket_peer_info_get(0, 0, 0); + nx_tcp_socket_queue_depth_notify_set(0, 0); +#ifndef NX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY + _nx_tcp_socket_queue_depth_notify_set(0, 0); +#endif + nx_tcp_socket_receive(0, 0, 0); + nx_tcp_socket_receive_notify(0, 0); + nx_tcp_socket_receive_queue_max_set(0, 0); +#ifndef NX_ENABLE_LOW_WATERMARK + _nx_tcp_socket_receive_queue_max_set(0, 0); +#endif + nx_tcp_socket_send(0, pkt_ptr, 0); + nx_tcp_socket_state_wait(0, 0, 0); + nx_tcp_socket_timed_wait_callback(0, 0); +#ifdef NX_DISABLE_EXTENDED_NOTIFY_SUPPORT + _nx_tcp_socket_timed_wait_callback(0, 0); +#endif + nx_tcp_socket_transmit_configure(0, 0, 0, 0, 0); + nx_tcp_socket_window_update_notify_set(0, 0); + nxd_tcp_client_socket_connect(0, 0, 0, 0); + nxd_tcp_socket_peer_info_get(0, 0, 0); + + /* APIs for UDP */ + nx_udp_enable(0); + nx_udp_free_port_find(0, 0, 0); + nx_udp_info_get(0, 0, 0, 0, 0, 0, 0, 0); + nx_udp_packet_info_extract(0, 0, 0, 0, 0); + nx_udp_socket_bind(0, 0, 0); + nx_udp_socket_bytes_available(0, 0); + nx_udp_socket_checksum_disable(0); + nx_udp_socket_checksum_enable(0); + nx_udp_socket_create(0, 0, 0, 0, 0, 0, 0); + nx_udp_socket_delete(0); + nx_udp_socket_info_get(0, 0, 0, 0, 0, 0, 0, 0); + nx_udp_socket_port_get(0, 0); + nx_udp_socket_receive(0, 0, 0); + nx_udp_socket_receive_notify(0, 0); + nx_udp_socket_send(0, pkt_ptr, 0, 0); + nx_udp_socket_source_send(0, pkt_ptr, 0, 0, 0); + nx_udp_socket_unbind(0); + nx_udp_source_extract(0, 0, 0); + nxd_udp_packet_info_extract(0, 0, 0, 0, 0); + nxd_udp_socket_send(0, pkt_ptr, 0, 0); + nxd_udp_socket_source_send(0, pkt_ptr, 0, 0, 0); + nxd_udp_source_extract(0, 0, 0); + + /* APIs for others. */ + nx_system_initialize(); +#ifndef NX_DRIVER_DEFERRED_PROCESSING +UINT status; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &pkt_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + _nx_ip_driver_deferred_enable(0, 0); + _nx_ip_driver_deferred_receive(0, pkt_ptr); +#endif + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_api_compile_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: API Compile Test..........................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_auto_entry_test.c b/test/regression/netxduo_test/netx_arp_auto_entry_test.c new file mode 100644 index 00000000..d110c79d --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_auto_entry_test.c @@ -0,0 +1,168 @@ +/* Test ARP entry is created automatically on receiving an ARP packet. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ARP_AUTO_ENTRY) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* ARP packet. + * src MAC: 20:0b:c7:94:45:96 + * src IP: 1.2.3.5. + * dst MAC: 00:00:00:00:00:00 + * dst IP: 1.2.3.4. */ +static char arp_pkt[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x01, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x96, 0x01, 0x02, 0x03, 0x05, /* ..E..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_auto_entry_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP */ + status = nx_arp_enable(&ip_0, pointer, 1024); + + /* Check ARP enable status. */ + if(status) + error_counter++; + pointer = pointer + 1024; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG physical_msw, physical_lsw; + + /* Print out test information banner. */ + printf("NetX Test: ARP Auto Entry Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject ARP packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &arp_pkt[14], sizeof(arp_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(arp_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify ARP entry is created. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + + /* Check status */ + if(status) + error_counter++; + + /* Verify the MAC. */ + if ((((physical_msw >> 8) & 0xFF) != 0x20) || + (((physical_msw) & 0xFF) != 0x0b) || + (((physical_lsw >> 24) & 0xFF) != 0xc7) || + (((physical_lsw >> 16) & 0xFF) != 0x94) || + (((physical_lsw >> 8) & 0xFF) != 0x45) || + (((physical_lsw) & 0xFF) != 0x96)) + { + error_counter++; + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_auto_entry_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Invalid Type Test.....................................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_ARP_AUTO_ENTRY */ diff --git a/test/regression/netxduo_test/netx_arp_basic_test.c b/test/regression/netxduo_test/netx_arp_basic_test.c new file mode 100644 index 00000000..d6c1c566 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_basic_test.c @@ -0,0 +1,327 @@ +/* This NetX test concentrates on the basic ARP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + printf("NetX Test: ARP Basic Processing Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Basic Processing Test.................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_arp_branch_test.c b/test/regression/netxduo_test/netx_arp_branch_test.c new file mode 100644 index 00000000..568b9b6d --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_branch_test.c @@ -0,0 +1,846 @@ +/* This NetX test concentrates on the code coverage for ARP functions, + *_nx_arp_static_entry_delete_internal + *_nx_arp_interface_entries_delete + *_nx_arp_packet_receive + *_nx_arp_periodic_update +*/ + +#include "nx_arp.h" +#include "nx_api.h" +#include "tx_thread.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_ASSERT +static TX_THREAD thread_for_assert; +#endif +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; +static UINT arp_entries; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef __PRODUCT_NETXDUO__ +#ifndef NX_DISABLE_ASSERT +static void thread_for_assert_entry(ULONG thread_input); +#endif +static UINT arp_packet_allocate(NX_IP *ip_ptr, NX_PACKET **packet_ptr, UINT arp_type, + ULONG source_ip, ULONG source_physical_msw, ULONG source_physical_lsw, + ULONG target_ip, ULONG target_physical_msw, ULONG target_physical_lsw); +#endif + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_branch_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 2048; + arp_entries = 1024 / sizeof(NX_ARP); + + /* Check ARP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +#ifdef __PRODUCT_NETXDUO__ +UINT i; +ULONG address; +ULONG msw; +ULONG lsw; +NX_PACKET *my_packet; +#endif /* __PRODUCT_NETXDUO__ */ +NX_ARP arp_entry; +NX_ARP arp_entry_next; +NX_ARP *arp_active_list; +ULONG physical_msw, physical_lsw; + + /* Print out some test information banners. */ + printf("NetX Test: ARP Branch Test..........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + + _nx_arp_initialize(); + + /* Hit false condition of if (arp_entry -> nx_arp_active_list_head) in _nx_arp_static_entry_delete_internal(). */ + nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 7), 0x0011, 0x22334457); + ip_0.nx_ip_arp_table[10] -> nx_arp_active_list_head = NX_NULL; + _nx_arp_static_entry_delete_internal(&ip_0, ip_0.nx_ip_arp_table[10]); + + + /* Hit condition of while (next_arp_entry) in _nx_arp_interface_entries_delete(). */ + ip_0.nx_ip_arp_static_list = &arp_entry; + arp_entry.nx_arp_pool_previous = NX_NULL; + arp_entry.nx_arp_pool_next = NX_NULL; + arp_entry.nx_arp_ip_interface = NX_NULL; + _nx_arp_interface_entries_delete(&ip_0, 0); + + /* Recover */ + ip_0.nx_ip_arp_static_list = NX_NULL; + + + + /* Test _nx_arp_packet_receive(). */ + + /* Hit false condition (sender_ip_address == 0). + if ((interface_ptr -> nx_interface_ip_address == 0) && + ((sender_ip_address == interface_ptr -> nx_interface_ip_probe_address) || + ((sender_ip_address == 0) && (target_ip_address == interface_ptr -> nx_interface_ip_probe_address)))) + */ + + /* Clear the interface address. */ + ip_0.nx_ip_interface[0].nx_interface_ip_address = 0; + + /* Set the probe address. */ + ip_0.nx_ip_interface[0].nx_interface_ip_probe_address = IP_ADDRESS(1, 2, 3, 4); + + /* Allocate the packet. */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334456, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the packet interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + + /* Hit false condition. + if ((sender_physical_msw != interface_ptr -> nx_interface_physical_address_msw) || + (sender_physical_lsw != interface_ptr -> nx_interface_physical_address_lsw)) + + if (interface_ptr -> nx_interface_ip_conflict_notify_handler) + */ + + /* Allocate ARP packet, */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the packet interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + /* Allocate ARP packet, */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 4), 0x0022, 0x22334456, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the packet interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + + /* Hit false condition. + if ((sender_physical_msw != interface_ptr -> nx_interface_physical_address_msw) || + (sender_physical_lsw != interface_ptr -> nx_interface_physical_address_lsw)) + */ + + /* Set the interface address. */ + ip_0.nx_ip_interface[0].nx_interface_ip_address = IP_ADDRESS(1, 2, 3, 4); + + /* Clear the probe address. */ + ip_0.nx_ip_interface[0].nx_interface_ip_probe_address = IP_ADDRESS(0, 0, 0, 0); + + /* Allocate ARP packet, */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the packet interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + /* Allocate ARP packet, */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 4), 0x0022, 0x22334456, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the packet interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + /* Hit false condition. + if (((ip_ptr -> nx_ip_arp_allocate)(ip_ptr, &(ip_ptr -> nx_ip_arp_table[index]), NX_FALSE)) == NX_SUCCESS) + */ + + /* Set the IP address. */ + address = 20; + + /* Set the physical address. */ + msw = 0x0033; + lsw = 0x22334457; + + /* Loop to added the static entries to fill the arp entries. */ + for (i = 0; i < arp_entries; i++) + { + + /* Set a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, address), msw, lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address ++; + + /* Update the physical address. */ + lsw ++; + } + } + + /* Allocate ARP packet, */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 10), 0x0011, 0x22334458, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the packet interface. */ + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + /* Test packet_ptr -> nx_packet_length < NX_ARP_MESSAGE_SIZE. */ + /* Allocate ARP packet, */ + status = arp_packet_allocate(&ip_0, &my_packet, NX_ARP_OPTION_REQUEST, IP_ADDRESS(1, 2, 3, 10), 0x0011, 0x22334458, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the packet length. */ + my_packet -> nx_packet_length -= 1; + + /* Call _nx_arp_packet_receive. */ + _nx_arp_packet_receive(&ip_0, my_packet); + + /* Update the address. */ + address --; + lsw --; + + /* Loop to delete the static entries. */ + for (i = 0; i < arp_entries; i++) + { + + /* Set a static ARP entry. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, address), msw, lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + lsw --; + } + } + + + +#ifndef NX_DISABLE_ASSERT + /* Test _nx_arp_packet_send(). */ + /* Hit NX_ASSERT(nx_interface != NX_NULL); */ + + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); +#endif /* NX_DISABLE_ASSERT */ +#endif /* __PRODUCT_NETXDUO__ */ + + + + /* Test _nx_arp_periodic_update(). */ + +#if 0 + /* Hit flase condition. + if ((arp_entry -> nx_arp_physical_address_msw) || (arp_entry -> nx_arp_physical_address_lsw)) + */ + ip_0.nx_ip_arp_dynamic_active_count ++; + ip_0.nx_ip_arp_dynamic_list = &arp_entry; + arp_entry.nx_arp_entry_next_update = 1; + arp_entry.nx_arp_physical_address_msw = 0x0000; + arp_entry.nx_arp_physical_address_lsw = 0x22334456; + arp_entry.nx_arp_retries = 0; + arp_entry.nx_arp_active_list_head = NX_NULL; + arp_entry.nx_arp_pool_next = &arp_entry; + arp_entry.nx_arp_pool_previous = &arp_entry; + arp_entry.nx_arp_packets_waiting = NX_NULL; + _nx_arp_periodic_update(&ip_0); + + /* Hit flase condition. + if ((arp_entry -> nx_arp_physical_address_msw) || (arp_entry -> nx_arp_physical_address_lsw)) + */ + ip_0.nx_ip_arp_dynamic_active_count ++; + ip_0.nx_ip_arp_dynamic_list = &arp_entry; + arp_entry.nx_arp_entry_next_update = 1; + arp_entry.nx_arp_physical_address_msw = 0x0011; + arp_entry.nx_arp_physical_address_lsw = 0x00000000; + arp_entry.nx_arp_retries = 0; + arp_entry.nx_arp_active_list_head = NX_NULL; + arp_entry.nx_arp_pool_next = &arp_entry; + arp_entry.nx_arp_pool_previous = &arp_entry; + arp_entry.nx_arp_packets_waiting = NX_NULL; + _nx_arp_periodic_update(&ip_0); + + /* Hit flase condition. + if ((arp_entry -> nx_arp_physical_address_msw) || (arp_entry -> nx_arp_physical_address_lsw)) + */ + ip_0.nx_ip_arp_dynamic_active_count ++; + ip_0.nx_ip_arp_dynamic_list = &arp_entry; + arp_entry.nx_arp_entry_next_update = 1; + arp_entry.nx_arp_physical_address_msw = 0x0000; + arp_entry.nx_arp_physical_address_lsw = 0x00000000; + arp_entry.nx_arp_retries = 0; + arp_entry.nx_arp_active_list_head = NX_NULL; + arp_entry.nx_arp_pool_next = &arp_entry; + arp_entry.nx_arp_pool_previous = &arp_entry; + arp_entry.nx_arp_packets_waiting = NX_NULL; + arp_entry.nx_arp_ip_address = IP_ADDRESS(1, 2, 3, 10); + arp_entry.nx_arp_ip_interface = &ip_0.nx_ip_interface[0]; + _nx_arp_periodic_update(&ip_0); +#endif + + /* Hit flase condition. + if ((arp_entry -> nx_arp_physical_address_msw) || (arp_entry -> nx_arp_physical_address_lsw)) + + if (arp_entry -> nx_arp_active_list_head) + + if (arp_entry != arp_entry -> nx_arp_pool_next) + */ + ip_0.nx_ip_arp_dynamic_active_count ++; + ip_0.nx_ip_arp_dynamic_list = &arp_entry; + arp_entry.nx_arp_entry_next_update = 1; + arp_entry.nx_arp_physical_address_msw = 0; + arp_entry.nx_arp_physical_address_lsw = 0; + arp_entry.nx_arp_retries = NX_ARP_MAXIMUM_RETRIES; + arp_entry.nx_arp_active_list_head = NX_NULL; + arp_entry.nx_arp_pool_next = &arp_entry; + arp_entry.nx_arp_pool_previous = &arp_entry; + arp_entry.nx_arp_packets_waiting = NX_NULL; + _nx_arp_periodic_update(&ip_0); + + + /* Hit flase condition. + if (*(arp_entry -> nx_arp_active_list_head) == arp_entry) + */ + arp_active_list = &arp_entry_next; + ip_0.nx_ip_arp_dynamic_active_count ++; + ip_0.nx_ip_arp_dynamic_list = &arp_entry; + arp_entry.nx_arp_entry_next_update = 1; + arp_entry.nx_arp_physical_address_msw = 0; + arp_entry.nx_arp_physical_address_lsw = 0; + arp_entry.nx_arp_retries = NX_ARP_MAXIMUM_RETRIES; + arp_entry.nx_arp_active_list_head = &arp_active_list; + arp_entry.nx_arp_active_next = arp_active_list; + arp_entry.nx_arp_active_previous = &arp_entry; + arp_entry.nx_arp_packets_waiting = NX_NULL; + arp_active_list -> nx_arp_active_next = &arp_entry; + _nx_arp_periodic_update(&ip_0); + + + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_arp_static_entry_create */ + /* Hit false condition if (ip_ptr -> nx_ip_arp_dynamic_list == arp_ptr) */ + _nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer += 1024; + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 29), 0x0011, 0x22334478); /* arp index: 0 */ + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); /* arp index: 0 */ + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 62), 0x0011, 0x22334499); /* arp index: 1 */ + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + _nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Recover, delete the arp entry. */ + status = nx_arp_dynamic_entries_invalidate(&ip_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + /* Test _nx_arp_hardware_address_find */ + /* Hit false condition (arp_entry -> nx_arp_physical_address_msw | arp_entry -> nx_arp_physical_address_lsw)) for static arp list */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334488)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_msw = 0x0000; + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_lsw = 0x22334488; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0000) || (physical_lsw != 0x22334488)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_msw = 0x0011; + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_lsw = 0x00000000; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x00000000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_msw = 0x0000; + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_lsw = 0x22334488; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0000) || (physical_lsw != 0x22334488)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_msw = 0x0000; + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_lsw = 0x00000000; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Recover the MAC address. */ + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_msw = 0x0011; + ip_0.nx_ip_arp_static_list -> nx_arp_physical_address_lsw = 0x22334488; + + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Hit false condition (arp_entry -> nx_arp_physical_address_msw | arp_entry -> nx_arp_physical_address_lsw)) for dynamic arp list */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334488)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_msw = 0x0000; + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_lsw = 0x22334488; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0000) || (physical_lsw != 0x22334488)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_msw = 0x0011; + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_lsw = 0x00000000; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x00000000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_msw = 0x0000; + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_lsw = 0x22334488; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0000) || (physical_lsw != 0x22334488)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the MAC address. */ + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_msw = 0x0000; + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_lsw = 0x00000000; + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 61), &physical_msw, &physical_lsw); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Recover the MAC address. */ + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_msw = 0x0011; + ip_0.nx_ip_arp_dynamic_list -> nx_arp_physical_address_lsw = 0x22334488; + + status = nx_arp_dynamic_entries_invalidate(&ip_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_arp_static_entry_create() */ + /* Hit condition of if (arp_ptr -> nx_arp_route_static == NX_FALSE) */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create static entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create static entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Recover, delete the ARP entry. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 61), 0x0011, 0x22334488); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +#ifdef __PRODUCT_NETXDUO__ +UINT arp_packet_allocate(NX_IP *ip_ptr, NX_PACKET **packet_ptr, UINT arp_type, + ULONG source_ip, ULONG source_physical_msw, ULONG source_physical_lsw, + ULONG target_ip, ULONG target_physical_msw, ULONG target_physical_lsw) +{ + +NX_PACKET *request_ptr; +ULONG *message_ptr; + + + /* Allocate a packet to build the ARP message in. */ + if (nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &request_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT)) + { + + /* Error getting packet, so just get out! */ + return (NX_FALSE); + } + + /* Build the ARP request packet. */ + + /* Setup the size of the ARP message. */ + request_ptr -> nx_packet_length = NX_ARP_MESSAGE_SIZE; + + /* Setup the append pointer to the end of the message. */ + request_ptr -> nx_packet_append_ptr = request_ptr -> nx_packet_prepend_ptr + NX_ARP_MESSAGE_SIZE; + + /* Setup the pointer to the message area. */ + message_ptr = (ULONG *) request_ptr -> nx_packet_prepend_ptr; + + /* Write the Hardware type into the message. */ + *message_ptr = (ULONG) (NX_ARP_HARDWARE_TYPE << 16) | (NX_ARP_PROTOCOL_TYPE); + *(message_ptr+1) = (ULONG) (NX_ARP_HARDWARE_SIZE << 24) | (NX_ARP_PROTOCOL_SIZE << 16) | arp_type; + *(message_ptr+2) = (ULONG) (source_physical_msw << 16) | (source_physical_lsw >> 16); + *(message_ptr+3) = (ULONG) (source_physical_lsw << 16) | (source_ip >> 16); + *(message_ptr+4) = (ULONG) (source_ip << 16) | (target_physical_msw & 0xFFFF); + *(message_ptr+5) = (ULONG) target_physical_lsw; + *(message_ptr+6) = (ULONG) target_ip; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Return packet. */ + *packet_ptr = request_ptr; + + return (NX_TRUE); +} + +#ifndef NX_DISABLE_ASSERT +/* Define the test threads. */ + +static void thread_for_assert_entry(ULONG thread_input) +{ + + /* Call function with NULL interface. */ + _nx_arp_packet_send(&ip_0, IP_ADDRESS(1, 2, 3, 5), NX_NULL); +} +#endif /* NX_DISABLE_ASSERT */ + +#endif /* __PRODUCT_NETXDUO__ */ +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Branch Test...........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_conflict_test.c b/test/regression/netxduo_test/netx_arp_conflict_test.c new file mode 100644 index 00000000..40a14911 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_conflict_test.c @@ -0,0 +1,183 @@ +/* This NetX test concentrates on the ARP conflict operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_arp.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_ARP_DEFEND_BY_REPLY) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG arp_packet_received; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern VOID _nx_arp_packet_send(NX_IP *ip_ptr, ULONG destination_ip, NX_INTERFACE *nx_interface); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_conflict_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + arp_packet_received = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + + printf("NetX Test: ARP Conflict Test........................................."); + + /* Setup callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Send conflict ARP packet. */ + _nx_arp_packet_send(&ip_0, IP_ADDRESS(1, 2, 3, 4), &ip_0.nx_ip_interface[0]); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Three packets: one sent by this thread, one sent by ip_1 and one sent by ip_0. */ + if(arp_packet_received != 3) + error_counter++; + + /* Send conflict ARP packet in 10 seconds. */ + _nx_arp_packet_send(&ip_0, IP_ADDRESS(1, 2, 3, 4), &ip_0.nx_ip_interface[0]); + + /* Only more packet sent by this thread. */ + if(arp_packet_received != 4) + error_counter++; + + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + /* Send conflict ARP packet after 10 seconds. */ + _nx_arp_packet_send(&ip_0, IP_ADDRESS(1, 2, 3, 4), &ip_0.nx_ip_interface[0]); + + /* Three more packets: one sent by this thread, one sent by ip_1 and one sent by ip_0. */ + if(arp_packet_received != 7) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG *message; + + /* Counter ARP packet only. */ + if (packet_ptr -> nx_packet_length == NX_ARP_MESSAGE_SIZE) + { + message = (ULONG *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(*message); + if(*message == (ULONG)((NX_ARP_HARDWARE_TYPE << 16) | NX_ARP_PROTOCOL_TYPE)) + arp_packet_received++; + NX_CHANGE_ULONG_ENDIAN(*message); + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_conflict_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Conflict Test.........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_arp_dual_pool_test.c b/test/regression/netxduo_test/netx_arp_dual_pool_test.c new file mode 100644 index 00000000..f6e8cf53 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dual_pool_test.c @@ -0,0 +1,217 @@ +/* This NetX test concentrates on the ARP packets from dual pool. */ + +#include "nx_api.h" +#include "nx_arp.h" + +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_DUAL_PACKET_POOL) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG arp_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dual_pool_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + arp_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512 + sizeof(NX_PACKET)); + pointer = pointer + 512 + sizeof(NX_PACKET); + + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pointer, 256 + sizeof(NX_PACKET)); + pointer = pointer + 256 + sizeof(NX_PACKET); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dual Pool Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process; + + /* Send a gratuitous ARP message. */ + nx_arp_gratuitous_send(&ip_0, NX_NULL); + + /* Check the arp_counter. */ + if (arp_counter != 1) + { + error_counter++; + } + + /* Allocate the only one packet from default packet pool. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT); + if (status) + { + error_counter++; + } + + /* Send a gratuitous ARP message. */ + nx_arp_gratuitous_send(&ip_0, NX_NULL); + + /* Check the arp_counter. */ + if (arp_counter != 1) + { + error_counter++; + } + + /* Now set dual packet pool. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_0, &pool_1); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Send a gratuitous ARP message. */ + nx_arp_gratuitous_send(&ip_0, NX_NULL); + + /* Check the arp_counter. */ + if (arp_counter != 2) + { + error_counter++; + } + + /* Allocate the only one packet from default packet pool. */ + status = nx_packet_allocate(&pool_1, &packet_ptr, 0, NX_NO_WAIT); + if (status) + { + error_counter++; + } + + /* Send a gratuitous ARP message. */ + nx_arp_gratuitous_send(&ip_0, NX_NULL); + + /* Check the arp_counter. */ + if (arp_counter != 2) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Check the packet length. */ + if (packet_ptr ->nx_packet_length == NX_ARP_MESSAGE_SIZE) + { + + /* Update the arp_counter. */ + arp_counter++; + } + + /* Return to caller. */ + return NX_TRUE; +} +#else /* NX_ENABLE_DUAL_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dual_pool_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dual Pool Test........................................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ diff --git a/test/regression/netxduo_test/netx_arp_dynamic_entry_fail_test.c b/test/regression/netxduo_test/netx_arp_dynamic_entry_fail_test.c new file mode 100644 index 00000000..01e739af --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_entry_fail_test.c @@ -0,0 +1,176 @@ +/* This NetX test concentrates on the ARP dynamic entry retries has been exceeded. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_system.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_fail_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dynamic Entry Fail Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the packet count. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address that does not exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping another IP address that does not exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 37), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the packet count, one ping packet should be exi. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total - 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep to test the _nx_arp_periodic_update. */ + tx_thread_sleep((NX_ARP_MAXIMUM_RETRIES + 1) * NX_ARP_UPDATE_RATE * NX_IP_PERIODIC_RATE); + + /* Check the packet count. */ + if ((pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Fail Test...............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_arp_dynamic_entry_set_test.c b/test/regression/netxduo_test/netx_arp_dynamic_entry_set_test.c new file mode 100644 index 00000000..b725317d --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_entry_set_test.c @@ -0,0 +1,202 @@ +/* This NetX test concentrates on the ARP dynamic entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_set_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dynamic Entry Set Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry that can be reached. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address for existence entry. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry that cannot be reached. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 4, 5), 0x0011, 0x22334458); + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the gateway. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 1)); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry that cannot be reached again. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 4, 5), 0x0011, 0x22334458); + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry that cannot be reached again. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 15), 0x00, 0x22334459); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0000, 0x22334459); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 15))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 15), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x00) || (physical_lsw != 0x22334459)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* The test was successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_set_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Set Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_arp_dynamic_entry_test.c b/test/regression/netxduo_test/netx_arp_dynamic_entry_test.c new file mode 100644 index 00000000..35116055 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_entry_test.c @@ -0,0 +1,423 @@ +/* This NetX test concentrates on the ARP dynamic entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG requests_sent; +ULONG requests_received; +ULONG responses_sent; +ULONG responses_received; +ULONG dynamic_entries; +ULONG static_entries; +ULONG aged_entries; +ULONG invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dynamic Entry Processing Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a invalid dynamic ARP entry, the destination address isnot directly accessible . */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334458); + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address for inexistence entry. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334458); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for inexistence entry. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(2, 2, 3, 5), &physical_msw, &physical_lsw); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get nothing from ARP information. */ + status = nx_arp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get ARP information. */ + status = nx_arp_info_get(&ip_0, &requests_sent, &requests_received, &responses_sent, &responses_received, &dynamic_entries, &static_entries, &aged_entries, &invalid_messages); + + /* Check for error conditions. */ + if ((status) || (requests_received) || (requests_sent) || (responses_sent) || (responses_received) || (dynamic_entries != 1) || (static_entries) || (aged_entries) || (invalid_messages)) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + /* Test the API arp entry delete. */ + status = nx_arp_entry_delete(&ip_0, IP_ADDRESS(1,2,3,5)); + if(status != NX_SUCCESS) + error_counter++; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Processing Test.........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_arp_dynamic_entry_test2.c b/test/regression/netxduo_test/netx_arp_dynamic_entry_test2.c new file mode 100644 index 00000000..e49f72b7 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_entry_test2.c @@ -0,0 +1,260 @@ +/* This NetX test concentrates on the ARP dynamic entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_system.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; +static CHAR set_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_test2_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dynamic Entry Processing Test2........................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the packet count. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address that does exist, but the peer IP instance disable the ARP feature. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the packet count, one ping packet should be exi. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total - 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the all dynamic entries. */ + status = nx_arp_dynamic_entries_invalidate(&ip_0); + + /* Check the status and packet count. */ + if ((status) || (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set packet process to detect the ARP message and set the dynamic entry, the ping operation should be correct. */ + advanced_packet_process_callback = my_packet_process; + + /* Update the counter. */ + set_counter = 0; + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; + + /* Update the counter. */ + set_counter ++; + + /* Check the arp counter. */ + if (set_counter == 1) + { + + /* Set a dynamic ARP entry for IP instance0, the ping will be sent. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + { + error_counter++; + } + + /* Set a dynamic ARP entry for IP instance0, the ping will be response. */ + status = nx_arp_dynamic_entry_set(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + if (status) + { + error_counter++; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Processing Test2........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_dynamic_entry_test3.c b/test/regression/netxduo_test/netx_arp_dynamic_entry_test3.c new file mode 100644 index 00000000..fb2639f5 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_entry_test3.c @@ -0,0 +1,174 @@ +/* This NetX test concentrates on sending packet when ARP entry is not completed. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_test3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delay the first ARP request by 1 second. */ + advanced_packet_process_callback = packet_process; + + /* Create a dynamic entry with zero MAC. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now send ping with fragment disabled. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "Test", 4, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_test3_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_dynamic_entry_timeout_test.c b/test/regression/netxduo_test/netx_arp_dynamic_entry_timeout_test.c new file mode 100644 index 00000000..8a283de7 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_entry_timeout_test.c @@ -0,0 +1,160 @@ +/* This NetX test concentrates on the ARP dynamic entry timeouts on NX_ARP_MAXIMUM_RETRIES * NX_ARP_UPDATE_RATE operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dynamic Entry Timeout Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#if (NX_ARP_EXPIRATION_RATE != NX_ARP_UPDATE_RATE) + ip_0.nx_ip_arp_dynamic_list -> nx_arp_entry_next_update = NX_ARP_UPDATE_RATE; +#endif /* (NX_ARP_EXPIRATION_RATE == 0) */ + + for (i = 0; i < NX_ARP_MAXIMUM_RETRIES + 1; i++) + { + tx_thread_sleep((NX_ARP_UPDATE_RATE - 1) * NX_IP_PERIODIC_RATE); + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_entry_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Entry Timeout Test............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_arp_dynamic_invalidate_test.c b/test/regression/netxduo_test/netx_arp_dynamic_invalidate_test.c new file mode 100644 index 00000000..9d6ff9b1 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_dynamic_invalidate_test.c @@ -0,0 +1,405 @@ +/* This NetX test concentrates on the ARP dynamic entry invalidate operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_invalidate_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG requests_sent; +ULONG requests_received; +ULONG responses_sent; +ULONG responses_received; +ULONG dynamic_entries; +ULONG static_entries; +ULONG aged_entries; +ULONG invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Dynamic Invalidate Processing Test...................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup multiple dynamic ARP entries. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + status += nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 6), 0x0011, 0x22334458); + status += nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 7), 0x0011, 0x22334459); + status += nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 39), 0x0011, 0x2233445a); + status += nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 37), 0x0011, 0x2233445b); + status += nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 69), 0x0011, 0x2233445c); + + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send a gratuitous ARP message. */ + status = nx_arp_gratuitous_send(&ip_0, NX_NULL); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Invalidate all ARP dynamic entries. */ + status = nx_arp_dynamic_entries_invalidate(&ip_0); + + /* Get ARP information. */ + status = nx_arp_info_get(&ip_0, &requests_sent, &requests_received, &responses_sent, &responses_received, &dynamic_entries, &static_entries, &aged_entries, &invalid_messages); + + /* Check for error conditions - and look for the ARP message being sent! */ + if ((status) || (requests_received)|| (responses_sent) || (responses_received) || (dynamic_entries) || (static_entries) || (aged_entries) || (invalid_messages)) + error_counter++; + +#ifndef NX_DISABLE_ARP_INFO + if(requests_sent != 1) + error_counter++; +#endif + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_dynamic_invalidate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Dynamic Invalidate Processing Test....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_entry_abnormal_operation_test.c b/test/regression/netxduo_test/netx_arp_entry_abnormal_operation_test.c new file mode 100644 index 00000000..5df330b0 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_entry_abnormal_operation_test.c @@ -0,0 +1,570 @@ +/* This NetX test concentrates on the ARP dynamic/static entry abnormal operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined (__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES >= 2) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define NX_ETHERNET_IP 0x0800 +#define NX_ETHERNET_ARP 0x0806 +#define NX_ETHERNET_RARP 0x8035 +#define NX_ETHERNET_IPV6 0x86DD + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT arp_receive; +static UINT icmp_receive; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_entry_abnormal_operation_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Attach new interface. */ + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing. */ + status = nx_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Entry Abnormal Operation Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to detect the packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Ping an IP address that does exist, but the peer IP instance disable the ARP feature. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_TRUE) || (icmp_receive != NX_FALSE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Set a dynamic ARP entry with the same IP address. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334467); + + /* Determine if the timeout error occurred. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_FALSE) || (icmp_receive != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Ping an IP address that does exist, but the peer IP instance disable the ARP feature. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 50); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_FALSE) || (icmp_receive != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Setup multiple static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334467); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_FALSE) || (icmp_receive != NX_FALSE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334467); + if ((status) || (ip_address != IP_ADDRESS(2, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(2, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334467)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Ping an IP address that does exist, but the peer IP instance disable the ARP feature. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_FALSE) || (icmp_receive != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334467); + +#ifdef __PRODUCT_NETXDUO__ + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) +#else + if (status) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Detach the second interface. */ + status = nx_ip_interface_detach(&ip_0, 1); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Attach interface again. */ + status = nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to detect the packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Ping an IP address that does exist, but the peer IP instance disable the ARP feature. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_TRUE) || (icmp_receive != NX_FALSE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Clear the arp receive and icmp receive falg. */ + arp_receive = NX_FALSE; + icmp_receive = NX_FALSE; + + /* Setup multiple static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334467); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp receive and icmp receive flag. */ + if ((arp_receive != NX_FALSE) || (icmp_receive != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_dynamic_active_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the dynamic entry count. */ + if (ip_0.nx_ip_arp_static_entries != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header_ptr; +#else +NX_IP_HEADER *ip_header_ptr; +#endif +ULONG protocol; + + /* For this test case, only ARP and ICMP packet will be send. */ + + /* Check the packet length. */ + if (packet_ptr -> nx_packet_length >= 28) + { + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + +#else + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + + /* Is ICMP packet? */ + if(protocol == 1) + { + + /* Set the flag. */ + icmp_receive = NX_TRUE; + } + else + { + + /* Set the flag. */ + arp_receive = NX_TRUE; + } + } + + /* Release the packet. */ + nx_packet_release(packet_ptr); + + return NX_FALSE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_entry_abnormal_operation_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ARP Entry Abnormal Operation Test.........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_entry_cache_test.c b/test/regression/netxduo_test/netx_arp_entry_cache_test.c new file mode 100644 index 00000000..89bc57f5 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_entry_cache_test.c @@ -0,0 +1,383 @@ +/* This NetX test concentrates on the ARP dynamic entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define ARP_ENTRY_COUNT 35 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_entry_cache_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0, the ARP cache can store five entries. */ + status = nx_arp_enable(&ip_0, (void *) pointer, ARP_ENTRY_COUNT * sizeof(NX_ARP)); + pointer = pointer + ARP_ENTRY_COUNT * sizeof(NX_ARP); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +INT i; +UINT status; +ULONG physical_msw; +ULONG physical_lsw; +ULONG address; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Entry CACHE Processing Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address. */ + address = 5; + + /* Set the physical address. */ + physical_msw = 0x0011; + physical_lsw = 0x22334457; + + /* Loop to added the dynamic entries, the dynamic entry can be replaced. . */ + for (i = 0; i < 3 * ARP_ENTRY_COUNT; i++) + { + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, address), physical_msw, physical_lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address ++; + + /* Update the physical address. */ + physical_lsw ++; + } + } + + /* Delete the entry that does not exist. */ + status = nx_arp_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, address)); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + physical_lsw --; + + /* Update the idex. */ + i --; + } + + /* Loop to delete the dynamic entries, the dynamic entry can be replaced. . */ + for (; i >= 2 * ARP_ENTRY_COUNT; i--) + { + + /* Delete a dynamic ARP entry. */ + status = nx_arp_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, address)); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + physical_lsw --; + } + } + + /* Loop to delete the replaced dynamic entries. */ + for (; i >= 0; i--) + { + + /* Delete a dynamic ARP entry. */ + status = nx_arp_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, address)); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + physical_lsw --; + } + } + + /* Set the IP address. */ + address = 5; + + /* Set the physical address. */ + physical_msw = 0x0011; + physical_lsw = 0x22334457; + + /* Loop to added the dynamic entries, 35. */ + for (i = 0; i < ARP_ENTRY_COUNT; i++) + { + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, address), physical_msw, physical_lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address ++; + + /* Update the physical address. */ + physical_lsw ++; + } + } + + /* Loop to added the static entries, 35. */ + for (; i < 2 * ARP_ENTRY_COUNT; i++) + { + + /* Set a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, address), physical_msw, physical_lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address ++; + + /* Update the physical address. */ + physical_lsw ++; + } + } + + /* Set a static ARP entry, should be fail. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, address), physical_msw, physical_lsw); + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry, should be fail. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, address), physical_msw, physical_lsw); + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + physical_lsw --; + + /* Update the idex. */ + i --; + + /* Loop to delete the static entries. */ + for (; i >= ARP_ENTRY_COUNT; i--) + { + + /* Delete a static ARP entry. */ + status = nx_arp_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, address)); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + physical_lsw --; + } + } + + /* Loop to delete the replaced dynamic entries. */ + for (; i >= 0; i--) + { + + /* Delete a dynamic ARP entry. */ + status = nx_arp_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, address)); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address --; + + /* Update the physical address. */ + physical_lsw --; + } + } + + /* Set the IP address. */ + address = 5; + + /* Set the physical address. */ + physical_msw = 0x0011; + physical_lsw = 0x22334457; + + /* Loop to added the dynamic entries, 35. */ + for (i = 0; i < ARP_ENTRY_COUNT; i++) + { + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, address), physical_msw, physical_lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address ++; + + /* Update the physical address. */ + physical_lsw ++; + } + } + + /* Invalidate all dynamic entries. */ + status = nx_arp_dynamic_entries_invalidate(&ip_0); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_entry_cache_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Entry CACHE Processing Test...........................N/A\n"); + + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ + diff --git a/test/regression/netxduo_test/netx_arp_gratuitous_test.c b/test/regression/netxduo_test/netx_arp_gratuitous_test.c new file mode 100644 index 00000000..a5c49150 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_gratuitous_test.c @@ -0,0 +1,489 @@ +/* This NetX test concentrates on the ARP Gratuitous operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_arp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG announce_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_gratuitous_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + announce_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG requests_sent; +ULONG requests_received; +ULONG responses_sent; +ULONG responses_received; +ULONG dynamic_entries; +ULONG static_entries; +ULONG aged_entries; +ULONG invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Gratuitous Entry Processing Test......................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ARP packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Send a gratuitous ARP message. */ + status = nx_arp_gratuitous_send(&ip_0, NX_NULL); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ARP packet. */ + advanced_packet_process_callback = NX_NULL; + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get ARP information. */ + status = nx_arp_info_get(&ip_0, &requests_sent, &requests_received, &responses_sent, &responses_received, &dynamic_entries, &static_entries, &aged_entries, &invalid_messages); + + /* Check for error conditions - and look for the ARP message being sent! */ + if ((status) || (requests_received)|| (responses_sent) || (responses_received) || (dynamic_entries != 1) || (static_entries) || (aged_entries) || (invalid_messages)) + error_counter++; +#ifndef NX_DISABLE_ARP_INFO + if(requests_sent != 1) + error_counter++; +#endif + + /* Check announce_counter. */ + if (announce_counter == 0) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 200 /* 100 */); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG *message_ptr; +ULONG sender_physical_msw; +ULONG sender_physical_lsw; +ULONG sender_ip_address; +ULONG target_physical_msw; +ULONG target_physical_lsw; +ULONG target_ip_address; +ULONG message_type; + + /* Check the packet length. */ + if (packet_ptr ->nx_packet_length != NX_ARP_MESSAGE_SIZE) + { + + /* Update the error_counter. */ + error_counter++; + + /* Release the packet */ + nx_packet_release(packet_ptr); + + /* Return to caller. */ + return NX_FALSE; + } + + /* Setup a pointer to the ARP message. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Pickup the ARP message type. */ + message_type = (ULONG) (*(message_ptr+1) & 0xFFFF); + + /* Determine if the ARP message type is valid. */ + if (message_type != NX_ARP_OPTION_REQUEST) + { + + /* Update the error_counter. */ + error_counter++; + + /* Release the packet */ + nx_packet_release(packet_ptr); + + /* Return to caller. */ + return NX_FALSE; + } + + + /* Pick up the sender's physical address from the message. */ + sender_physical_msw = (*(message_ptr+2) >> 16); + sender_physical_lsw = (*(message_ptr+2) << 16) | (*(message_ptr+3) >> 16); + sender_ip_address = (*(message_ptr+3) << 16) | (*(message_ptr+4) >> 16); + target_physical_msw = (*(message_ptr+4) & 0x0000FFFF); + target_physical_lsw = *(message_ptr+5); + target_ip_address = *(message_ptr+6); + + /* Check the sender and target information. */ + if (((sender_physical_msw | sender_physical_lsw) != 0) && (sender_ip_address != 0) && + ((target_physical_msw | target_physical_lsw) == 0) && (target_ip_address != 0)) + announce_counter ++; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Return to caller. */ + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_gratuitous_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Gratuitous Entry Processing Test......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_invalid_type_test.c b/test/regression/netxduo_test/netx_arp_invalid_type_test.c new file mode 100644 index 00000000..cd7f4817 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_invalid_type_test.c @@ -0,0 +1,149 @@ +/* Test processing of ARP packet with invalid type. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ARP_INFO) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* ARP packet. + * Type: 0003. */ +static char ra_pkt[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x03, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x96, 0xc0, 0xa8, 0x64, 0x01, /* ..E...d. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xa8, /* ........ */ +0x64, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_invalid_type_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP */ + status = nx_arp_enable(&ip_0, pointer, 1024); + + /* Check ARP enable status. */ + if(status) + error_counter++; + pointer = pointer + 1024; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ARP Invalid Type Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject ARP packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + if (ip_0.nx_ip_arp_invalid_messages != 1) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_invalid_type_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Invalid Type Test.....................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_arp_no_duplicate_entry_test.c b/test/regression/netxduo_test/netx_arp_no_duplicate_entry_test.c new file mode 100644 index 00000000..5b5186a5 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_no_duplicate_entry_test.c @@ -0,0 +1,425 @@ +/* Send ARP packets using the deferred receive service. This test checks that duplicate ARP entries are + not created, that existing matching ARP entries will be updated regardless of message type, and ARP probe + packets (zero sender IP address) are not entered into the ARP cache. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined (NX_DISABLE_ARP_AUTO_ENTRY) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#ifdef __PRODUCT_NETX__ +#define NX_ARP_TABLE_MASK NX_ROUTE_TABLE_MASK +#endif + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* ARP request packet. This test checks that request packets are checked for adding to/updating the ARP cache. + * src MAC: 20:0b:c7:94:45:96 + * src IP: 1.2.3.5. + * target MAC: 00:00:00:00:00:00 + * target IP: 1.2.3.4. */ +static char arp_request_pkt[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x01, + 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x96, 0x01, 0x02, 0x03, 0x05, /* ..E..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + + +/* Second ARP request packet + * src MAC: 20:0b:c7:94:45:97 The test is to check if the 20:0b:c7:94:45:96 entry is updated to 20:0b:c7:94:45:97 + there should not be duplicate entries for 1.2.3.5. + * src IP: 1.2.3.5. + * target MAC: 00:00:00:00:00:00 + * target IP: 1.2.3.4. */ +static char arp_request_pkt2[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x97, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x01, + 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x97, 0x01, 0x02, 0x03, 0x05, /* ..E..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* An ARP reply packet; This tests that NetX checks responses for updating its ARP Cache + * src MAC: 30:1b:d7:a4:55:a6 + * src IP: 1.2.3.44. + * target MAC: 22:0b:c7:94:45:98 + * target IP: 1.2.3.6. */ +static char arp_reply_pkt[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0x1b, /* ...... . */ +0xd7, 0xa4, 0x55, 0xa6, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x02, + 0x30, 0x1b, /* ...... . */ +0xd7, 0xa4, 0x55, 0xa6, 0x01, 0x02, 0x03, 0x2c, /* ..E..... */ +0x22, 0x0b, 0xc7, 0x94, 0x45, 0x98, 0x01, 0x02, /* ........ */ +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* An ARP probe packet - This test is to check that NetX does not create an entry for probe (sender address is zero) packets. + * src MAC: 00:b1:7d:4a:55:6a + * src IP: 0.0.0.0 + * target MAC: 00:00:00:00:00:00 + * target IP: 1.2.3.85. */ +static char arp_probe_pkt[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xb1, /* ...... . */ +0x7d, 0x4a, 0x55, 0x6a, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x01, + + 0x00, 0xb1, /* ...... . */ +0x7d, 0x4a, 0x55, 0x6a, 0x00, 0x00, 0x00, 0x00, /* ..E..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x055, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + + +/* Third ARP request packet -- The test is to check that NetX does not create a duplicate entry for 1.2.3.5. + * src MAC: 20:0b:c7:94:45:97 + * src IP: 1.2.3.5. + * target MAC: 00:00:00:00:00:00 + * target IP: 1.2.3.4. */ +static char arp_request_pkt3[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x97, 0x08, 0x06, 0x00, 0x01, /* ..E..... */ +0x08, 0x00, 0x06, 0x04, 0x00, 0x01, + 0x20, 0x0b, /* ...... . */ +0xc7, 0x94, 0x45, 0x97, 0x01, 0x02, 0x03, 0x05, /* ..E..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_no_duplicate_entry_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP */ + status = nx_arp_enable(&ip_0, pointer, 1024); + + /* Check ARP enable status. */ + if(status) + error_counter++; + pointer = pointer + 1024; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG physical_msw, physical_lsw; +ULONG test_ip_address; +UINT index; +UINT match_count = 0; +NX_ARP *arp_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: ARP No Duplicate Entry Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject ARP packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /******************************* First ARP packet ******************************** + This will be a request. Fill in the packet with data. Skip the MAC header. */ + + memcpy(packet_ptr -> nx_packet_prepend_ptr, &arp_request_pkt[14], sizeof(arp_request_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(arp_request_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify ARP entry is added to the ARP table. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + + /* Check status */ + if(status) + error_counter++; + + /* Verify the MAC. */ + if ((((physical_msw >> 8) & 0xFF) != 0x20) || + (((physical_msw) & 0xFF) != 0x0b) || + (((physical_lsw >> 24) & 0xFF) != 0xc7) || + (((physical_lsw >> 16) & 0xFF) != 0x94) || + (((physical_lsw >> 8) & 0xFF) != 0x45) || + (((physical_lsw) & 0xFF) != 0x96)) + { + error_counter++; + } + + /******************************* Second ARP packet ******************************** + Inject a second ARP packet from same host but different MAC. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* This will be a request. Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &arp_request_pkt2[14], sizeof(arp_request_pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(arp_request_pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify ARP entry is added to the ARP table. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + + /* Check status */ + if(status) + error_counter++; + + /* Verify the MAC. */ + if ((((physical_msw >> 8) & 0xFF) != 0x20) || + (((physical_msw) & 0xFF) != 0x0b) || + (((physical_lsw >> 24) & 0xFF) != 0xc7) || + (((physical_lsw >> 16) & 0xFF) != 0x94) || + (((physical_lsw >> 8) & 0xFF) != 0x45) || + (((physical_lsw) & 0xFF) != 0x97)) + { + error_counter++; + } + + /* Verify this MAC is not an entry in the table. */ + physical_msw = 0x200b; + physical_lsw = 0xc7944596; + + /* The MAC address above should not be in the table. */ + status = nx_arp_ip_address_find(&ip_0, &test_ip_address, physical_msw, physical_lsw); + + /* Check status */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /******************************* Third ARP packet ******************************** + Inject a third ARP packet. This is a response packet */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* This will be a request. Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &arp_reply_pkt[14], sizeof(arp_reply_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(arp_reply_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify ARP entry is created. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 44), &physical_msw, &physical_lsw); + + /* Check status */ + if(status) + error_counter++; + + /* Verify the MAC. */ + else if ((((physical_msw >> 8) & 0xFF) != 0x30) || + (((physical_msw) & 0xFF) != 0x1b) || + (((physical_lsw >> 24) & 0xFF) != 0xd7) || + (((physical_lsw >> 16) & 0xFF) != 0xa4) || + (((physical_lsw >> 8) & 0xFF) != 0x55) || + (((physical_lsw) & 0xFF) != 0xa6)) + { + error_counter++; + } + + + /* Verify ARP entry is created for the target of this reply packet (1.2.3.6). */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 6), &physical_msw, &physical_lsw); + + /* Check status */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + + /******************************* Fourth ARP packet ******************************** + Inject a fourth ARP packet. This is a probe packet */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* This will be a request. Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &arp_probe_pkt[14], sizeof(arp_probe_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(arp_probe_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify ARP entry is NOT created. ARP probes should not be added to the ARP cache. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 85), &physical_msw, &physical_lsw); + + /* Check status */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* This is the MAC of the sender of the ARP probe. */ + physical_msw = 0x00b1; + physical_lsw = 0x7d4a556a; + + /* The IP address should not be in the ARP cache because it is an ARP probe. */ + status = nx_arp_ip_address_find(&ip_0, &test_ip_address, physical_msw, physical_lsw); + + /* Check status */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + + + /******************************* Fifth ARP packet ******************************** + Inject a fifth ARP packet. This is a duplicate request packet */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* This will be a request. Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &arp_request_pkt3[14], sizeof(arp_request_pkt3) - 14); + packet_ptr -> nx_packet_length = sizeof(arp_request_pkt3) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ARP packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Calculate the hash index for the sender IP address. */ + index = (UINT) ((IP_ADDRESS(0x01, 0x02, 0x03, 0x05) + (IP_ADDRESS(0x01, 0x02, 0x03, 0x05) >> 8)) & NX_ARP_TABLE_MASK); + + /* Pickup the first ARP entry. */ + arp_ptr = ip_0.nx_ip_arp_table[index]; + + /* Loop to look for an ARP match. There should be only one. */ + do + { + match_count++; + + /* Determine if we are at the end of the ARP list. */ + if (arp_ptr == ip_0.nx_ip_arp_table[index]) + { + + /* Clear the ARP pointer. */ + arp_ptr = NX_NULL; + break; + } + + /* Move to the next active ARP entry. */ + arp_ptr = arp_ptr -> nx_arp_active_next; + + } while (arp_ptr); + + /* Check out match count. */ + if (match_count != 1) + { + error_counter++; + } + + /* Check for any error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_no_duplicate_entry_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP No Duplicate Entry Test...............................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_ARP_AUTO_ENTRY */ diff --git a/test/regression/netxduo_test/netx_arp_nxe_api_test.c b/test/regression/netxduo_test/netx_arp_nxe_api_test.c new file mode 100644 index 00000000..755f2d25 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_nxe_api_test.c @@ -0,0 +1,789 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; +static UCHAR cache_memory[1024]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void responder_handler(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG arp_requests_sent; +ULONG arp_requests_received; +ULONG arp_responses_sent; +ULONG arp_responses_received; +ULONG arp_dynamic_entries; +ULONG arp_static_entries; +ULONG arp_aged_entries; +ULONG arp_invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP NXE API Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_enable api */ + /************************************************/ + + /* Enable the ARP feature for NULL IP instance. */ + status = nx_arp_enable(NX_NULL, cache_memory, 1024); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ARP feature for invalid IP instance. */ + status = nx_arp_enable(&invalid_ip, cache_memory, 1024); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ARP feature for IP instance with invalid cache. */ + status = nx_arp_enable(&ip_0, NX_NULL, 1024); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ARP feature for IP instance with invalid cache size. */ + status = nx_arp_enable(&ip_0, cache_memory, 2); + + /* Check for error. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ARP feature for valid IP instance. */ + status = nx_arp_enable(&ip_0, cache_memory, 1024); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ARP feature again. */ + status = nx_arp_enable(&ip_0, cache_memory, 1024); + + /* Check for error. */ + if (status != NX_ALREADY_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_entry_delete api */ + /************************************************/ + + /* Delete the entry for NULL IP instance. */ + status = nx_arp_entry_delete(NX_NULL, IP_ADDRESS(1, 2, 3, 4)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the entry for invalid IP instance. */ + status = nx_arp_entry_delete(&invalid_ip, IP_ADDRESS(1, 2, 3, 4)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the entry with invalid IP address. */ + status = nx_arp_entry_delete(&ip_0, NX_NULL); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_gratuitous_send api */ + /************************************************/ + + /* Call the gratuitous send for NULL IP instance. */ + status = nx_arp_gratuitous_send(NX_NULL, responder_handler); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call the gratuitous send for invalid IP instance. */ + status = nx_arp_gratuitous_send(&invalid_ip, responder_handler); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Call the gratuitous send for invalid IP instance. */ + status = nx_arp_gratuitous_send(&invalid_ip, responder_handler); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Call the gratuitous send for valid IP instance without ARP feature. */ + status = nx_arp_gratuitous_send(&ip_0, responder_handler); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_hardware_address_find api */ + /************************************************/ + + /* Find the hardware address for NULL IP instance. */ + status = nx_arp_hardware_address_find(NX_NULL, IP_ADDRESS(1, 2, 3, 4), &physical_msw, &physical_lsw); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Find the hardware address for invalid IP instance. */ + status = nx_arp_hardware_address_find(&invalid_ip, IP_ADDRESS(1, 2, 3, 4), &physical_msw, &physical_lsw); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for valid IP instance with invalid physical_msw pointer. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 4), NX_NULL, &physical_lsw); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for valid IP instance with invalid physical_msw pointer. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 4), &physical_msw, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for valid IP instance with NULL IP address. */ + status = nx_arp_hardware_address_find(&ip_0, NX_NULL, &physical_msw, &physical_lsw); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Find the hardware address for valid IP instance without ARP feature. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 4), &physical_msw, &physical_lsw); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_info_get api */ + /************************************************/ + + /* Get the ARP information for NULL IP instance. */ + status = nx_arp_info_get(NX_NULL, &arp_requests_sent, &arp_requests_received, &arp_responses_sent, &arp_responses_received, &arp_dynamic_entries, &arp_static_entries, &arp_aged_entries, &arp_invalid_messages); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the ARP information for invalid IP instance. */ + status = nx_arp_info_get(&invalid_ip, &arp_requests_sent, &arp_requests_received, &arp_responses_sent, &arp_responses_received, &arp_dynamic_entries, &arp_static_entries, &arp_aged_entries, &arp_invalid_messages); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Get the ARP information for invalid IP instance. */ + status = nx_arp_info_get(&ip_0, &arp_requests_sent, &arp_requests_received, &arp_responses_sent, &arp_responses_received, &arp_dynamic_entries, &arp_static_entries, &arp_aged_entries, &arp_invalid_messages); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_ip_address_find api */ + /************************************************/ + + /* Find the ip address for NULL IP instance. */ + status = nx_arp_ip_address_find(NX_NULL, &ip_address, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Find the ip address for invalid IP instance. */ + status = nx_arp_ip_address_find(&invalid_ip, &ip_address, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the ip address for valid IP instance with invalid ip address pointer. */ + status = nx_arp_ip_address_find(&ip_0, NX_NULL, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the ip address for valid IP instance with NULL physical address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0, 0); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Find the ip address for valid IP instance without ARP feature. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*****************************************************/ + /* Tested the nxe_arp_dynamic_entries_invalidate api */ + /*****************************************************/ + + /* Delete the dynamic entries for NULL IP instance. */ + status = nx_arp_dynamic_entries_invalidate(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the dynamic entries for invalid IP instance. */ + status = nx_arp_dynamic_entries_invalidate(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Delete the dynamic entries for valid IP instance without ARP feature. */ + status = nx_arp_dynamic_entries_invalidate(&ip_0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_dynamic_entry_set api */ + /************************************************/ + + /* Create the dynamic entry for NULL IP instance. */ + status = nx_arp_dynamic_entry_set(NX_NULL, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Create the dynamic entry for invalid IP instance. */ + status = nx_arp_dynamic_entry_set(&invalid_ip, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the dynamic entry with invalid IP address. */ + status = nx_arp_dynamic_entry_set(&ip_0, NX_NULL, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the dynamic entry with multicast IP address. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(224,0,0,251), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the dynamic entry with directed broadcast IP address. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(255, 255, 255, 255), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Create the dynamic entry for valid IP instance without ARP feature. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_static_entries_delete api */ + /************************************************/ + + /* Delete the static entries for NULL IP instance. */ + status = nx_arp_static_entries_delete(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the static entries for invalid IP instance. */ + status = nx_arp_static_entries_delete(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Delete the static entries for valid IP instance without ARP feature. */ + status = nx_arp_static_entries_delete(&ip_0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_static_entry_create api */ + /************************************************/ + + /* Create the static entry for NULL IP instance. */ + status = nx_arp_static_entry_create(NX_NULL, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Create the static entry for invalid IP instance. */ + status = nx_arp_static_entry_create(&invalid_ip, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the static entry with invalid IP address. */ + status = nx_arp_static_entry_create(&ip_0, NX_NULL, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the static entry with multicast IP address. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(224,0,0,251), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the static entry with directed broadcast IP address. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(255, 255, 255, 255), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the static entry with invalid IP address. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0, 0); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Create the static entry for valid IP instance without ARP feature. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_arp_static_entry_delete api */ + /************************************************/ + + /* Delete the static entry for NULL IP instance. */ + status = nx_arp_static_entry_delete(NX_NULL, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the static entry for invalid IP instance. */ + status = nx_arp_static_entry_delete(&invalid_ip, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the static entry for valid IP address. */ + status = nx_arp_static_entry_delete(&ip_0, NX_NULL, 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the static entry for valid physical address. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0, 0); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ARP feature. */ + ip_0.nx_ip_arp_allocate = NX_NULL; + + /* Delete the static entry for valid IP instance without ARP feature. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void responder_handler(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP NXE API Test..........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_packet_allocate_test.c b/test/regression/netxduo_test/netx_arp_packet_allocate_test.c new file mode 100644 index 00000000..3a83a4c8 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_packet_allocate_test.c @@ -0,0 +1,232 @@ +/* This NetX test concentrates on the ARP conflict operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_arp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG arp_packet_received; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_packet_allocate_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + arp_packet_received = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT i; +UINT status; +UINT packet_counter; +NX_PACKET *my_packet[10]; + + printf("NetX Test: ARP Packet Allocate Test.................................."); + + /* Setup callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Loop to allocate the all packets to let _nx_packet_data_append failure in nx_ip_forward_packet_process.c */ + packet_counter = pool_0.nx_packet_pool_available; + for (i = 0; i < packet_counter; i++) + { + status = nx_packet_allocate(&pool_0, &my_packet[i], 0, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Check the available counter. */ + if (pool_0.nx_packet_pool_available != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp_packet_received counter. */ + if (arp_packet_received != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to release all packet. */ + for (i = 0; i < packet_counter; i++) + { + + /* Release the packet. */ + status = nx_packet_release(my_packet[i]); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + + /* Check the available counter. */ + if (pool_0.nx_packet_pool_available != packet_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 6), 0, 0); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the arp_packet_received counter. */ + if (arp_packet_received != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG *message; + + /* Counter ARP packet only. */ + if (packet_ptr -> nx_packet_length == NX_ARP_MESSAGE_SIZE) + { + message = (ULONG *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(*message); + if(*message == (ULONG)((NX_ARP_HARDWARE_TYPE << 16) | NX_ARP_PROTOCOL_TYPE)) + arp_packet_received++; + NX_CHANGE_ULONG_ENDIAN(*message); + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_packet_allocate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Packet Allocate Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_arp_queue_depth_test.c b/test/regression/netxduo_test/netx_arp_queue_depth_test.c new file mode 100644 index 00000000..b38a693b --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_queue_depth_test.c @@ -0,0 +1,172 @@ +/* This NetX test concentrates on the ARP dynamic entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_queue_depth_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: ARP Queue Depth Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the packet count. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to send the ICMP ping to test the ARP queue depth. */ + for (i = 0; i < NX_ARP_MAX_QUEUE_DEPTH + 3; i ++) + { + + /* Ping an IP address that does exist, but the peer IP instance disable the ARP feature. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 10); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the count. */ + if (i < NX_ARP_MAX_QUEUE_DEPTH) + { + + /* Check the packet count, one ping packet should be exi. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total - i - 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + else + { + + /* Check the packet count, one ping packet should be exi. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total - NX_ARP_MAX_QUEUE_DEPTH) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_queue_depth_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Queue Depth Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_arp_static_entries_delete_test.c b/test/regression/netxduo_test/netx_arp_static_entries_delete_test.c new file mode 100644 index 00000000..07bdf841 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_static_entries_delete_test.c @@ -0,0 +1,423 @@ +/* This NetX test concentrates on the ARP static delete all entries operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entries_delete_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG requests_sent; +ULONG requests_received; +ULONG responses_sent; +ULONG responses_received; +ULONG dynamic_entries; +ULONG static_entries; +ULONG aged_entries; +ULONG invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Static Delete All Entries Processing Test............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup multiple static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + status += nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 6), 0x0011, 0x22334458); + status += nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 7), 0x0011, 0x22334459); + status += nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 39), 0x0011, 0x2233445a); + status += nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 37), 0x0011, 0x2233445b); + status += nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 69), 0x0000, 0x2233445c); + + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0000, 0x2233445c); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 69))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 69), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0000) || (physical_lsw != 0x2233445c)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send a gratuitous ARP message. */ + status = nx_arp_gratuitous_send(&ip_0, NX_NULL); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Delete all ARP static entries. */ + status = nx_arp_static_entries_delete(&ip_0); + + /* Get ARP information. */ + status = nx_arp_info_get(&ip_0, &requests_sent, &requests_received, &responses_sent, &responses_received, &dynamic_entries, &static_entries, &aged_entries, &invalid_messages); + + /* Check for error conditions - and look for the ARP message being sent! */ + if ((status) || (requests_received)|| (responses_sent) || (responses_received) || (dynamic_entries) || (static_entries) || (aged_entries) || (invalid_messages)) + error_counter++; + +#ifndef NX_DISABLE_ARP_INFO + if(requests_sent != 1) + error_counter++; +#endif + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entries_delete_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Static Delete All Entries Processing Test.............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_static_entry_create_test.c b/test/regression/netxduo_test/netx_arp_static_entry_create_test.c new file mode 100644 index 00000000..0189bac9 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_static_entry_create_test.c @@ -0,0 +1,316 @@ +/* This NetX test concentrates on the ARP static entry create operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define ARP_ENTRY_COUNT 35 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entry_create_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0, the ARP cache can store thirty-five entries. */ + status = nx_arp_enable(&ip_0, (void *) pointer, ARP_ENTRY_COUNT * sizeof(NX_ARP)); + pointer = pointer + ARP_ENTRY_COUNT * sizeof(NX_ARP); + if (status) + error_counter++; + + /* Enable TCP processing for IP instance 0. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +ULONG address; +ULONG msw; +ULONG lsw; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Static Entry Create Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the gateway. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 1)); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the static entries. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set a static ARP entry, the destination address is not directly accessible. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0022, 0x22334457); + + /* Check the status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the static entries. */ + if (ip_0.nx_ip_arp_static_entries != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set the IP address. */ + address = 5; + + /* Set the physical address. */ + msw = 0x0011; + lsw = 0x22334457; + + /* Loop to added the static entries to fill the arp entries, only remain one ARP entry for dynamic. */ + for (i = 0; i < ARP_ENTRY_COUNT - 1; i++) + { + + /* Set a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, address), msw, lsw); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the IP address. */ + address ++; + + /* Update the physical address. */ + lsw ++; + } + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the static entries. */ + if (ip_0.nx_ip_arp_static_entries != ARP_ENTRY_COUNT - 1) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set a valid dynamic ARP entry. */ + status = nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, address), msw, lsw); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the static entries. */ + if (ip_0.nx_ip_arp_static_entries != ARP_ENTRY_COUNT - 1) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, msw, lsw); + + /* Check the result. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, address))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, address), &physical_msw, &physical_lsw); + + /* Check the result. */ + if ((status) || (physical_msw != msw) || (physical_lsw != lsw)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the physical address. */ + lsw ++; + + /* Set a valid static ARP entry again to instead the dynamic ARP entry, same IP address, different physical address. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, address), msw, lsw); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + /* Check the static entries. */ + if (ip_0.nx_ip_arp_static_entries != ARP_ENTRY_COUNT) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, msw, lsw); + + /* Check the result. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, address))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, address), &physical_msw, &physical_lsw); + + /* Check the result. */ + if ((status) || (physical_msw != msw) || (physical_lsw != lsw)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0000, 0xaabbccdd); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 200), &physical_msw, &physical_lsw); + + /* Check the result. */ + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test was successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entry_create_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Static Entry Create Test..............................N/A\n"); + + test_control_return(3); +} +#endif + \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c b/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c new file mode 100644 index 00000000..9b70281a --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c @@ -0,0 +1,210 @@ +/* This NetX test concentrates on the ARP static entry may be updated by ARP packet. + * JIRA: https://expresslogic.atlassian.net/projects/NETXDUO/issues/NETXDUO-222. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entry_pollute_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG requests_sent; +ULONG requests_received; +ULONG responses_sent; +ULONG responses_received; +ULONG dynamic_entries; +ULONG static_entries; +ULONG aged_entries; +ULONG invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Static Entry Pollute Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set an incorrect static ARP entry of IP1 in IP0. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x00FF, 0x22334457); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x00FF) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + { + nx_packet_release(my_packet); + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x00FF) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entry_pollute_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Static Entry Pollute Test.............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_arp_static_entry_test.c b/test/regression/netxduo_test/netx_arp_static_entry_test.c new file mode 100644 index 00000000..82355b83 --- /dev/null +++ b/test/regression/netxduo_test/netx_arp_static_entry_test.c @@ -0,0 +1,473 @@ +/* This NetX test concentrates on the ARP static entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entry_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG ip_address; +ULONG physical_msw; +ULONG physical_lsw; +ULONG requests_sent; +ULONG requests_received; +ULONG responses_sent; +ULONG responses_received; +ULONG dynamic_entries; +ULONG static_entries; +ULONG aged_entries; +ULONG invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: ARP Static Entry Processing Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete an not existing static entry. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + + /* Check for error. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Set a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334457); + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 5))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(1, 2, 3, 5), &physical_msw, &physical_lsw); + if ((status) || (physical_msw != 0x0011) || (physical_lsw != 0x22334457)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a invalid static ARP entry, the destination address isnot directly accessible . */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334458); + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the IP address for inexistence entry. */ + status = nx_arp_ip_address_find(&ip_0, &ip_address, 0x0011, 0x22334458); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for inexistence entry. */ + status = nx_arp_hardware_address_find(&ip_0, IP_ADDRESS(2, 2, 3, 5), &physical_msw, &physical_lsw); + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get ARP information. */ + status = nx_arp_info_get(&ip_0, &requests_sent, &requests_received, &responses_sent, &responses_received, &dynamic_entries, &static_entries, &aged_entries, &invalid_messages); + +#ifndef NX_DISABLE_ARP_INFO + if ((requests_sent) || (requests_received) || (responses_sent) || (responses_received) || (static_entries != 1) || (aged_entries) || (invalid_messages)) + { + error_counter++; + } +#endif + + /* Check for error conditions. */ + if ((status) || (dynamic_entries)) + error_counter++; + + /* Delete the static entry with wrong MAC. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0x22334457); + + /* Check for error. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Delete the static entry. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get ARP information again. */ + status = nx_arp_info_get(&ip_0, &requests_sent, &requests_received, &responses_sent, &responses_received, &dynamic_entries, &static_entries, &aged_entries, &invalid_messages); + +#ifndef NX_DISABLE_ARP_INFO + if ((requests_sent) || (requests_received) || (responses_sent) || (responses_received) || (static_entries) || (aged_entries) || (invalid_messages)) + { + error_counter++; + } +#endif + + /* Check for other error conditions. */ + if ((status) || (dynamic_entries)) + error_counter++; + + /* Set a static ARP entry with lsw 0 . */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 15), 0x0011, 0x00000000); + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the static entry with wrong MAC. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 15), 0x0011, 0x00000001); + + /* Check for error. */ + if (status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* Delete the static entry with correct MAC. */ + status = nx_arp_static_entry_delete(&ip_0, IP_ADDRESS(1, 2, 3, 15), 0x0011, 0x00000000); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set a static ARP entry. */ + status = nx_arp_static_entry_create(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_arp_static_entry_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ARP Static Entry Processing Test..........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_caller_check_test.c b/test/regression/netxduo_test/netx_caller_check_test.c new file mode 100644 index 00000000..b863fd5c --- /dev/null +++ b/test/regression/netxduo_test/netx_caller_check_test.c @@ -0,0 +1,1105 @@ +/* This NetX test concentrates on caller check for error checking functions. */ + +#include "nx_api.h" +#include "tx_thread.h" +#include "tx_timer.h" +#include "nx_udp.h" +#include "nx_tcp.h" +#include "nx_rarp.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_igmp.h" +#include "nx_arp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && defined(__linux__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP test_ip; +static NX_TCP_SOCKET tcp_socket; +static NX_UDP_SOCKET udp_socket; +static NXD_ADDRESS address = {NX_IP_VERSION_V6, }; +static TX_TIMER timer_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG expected_system_state; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void link_status_change_notify(NX_IP *ip_ptr, UINT interface_index, UINT link_up); +static void tcp_receive_notify(NX_TCP_SOCKET *socket_ptr); +static VOID tcp_socket_window_update_notify(NX_TCP_SOCKET *socket_ptr); +VOID test_process(ULONG id); +VOID test_process_1(ULONG id); +VOID test_process_2(ULONG id); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_caller_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable UDP processing for IP instance. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Enable IGMP for IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check IGMP enable status. */ + if (status) + error_counter++; + + /* Enable ICMP processing for IP instance. */ + status = nxd_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + +VOID test_process(ULONG id) +{ +UINT uint_value; +ULONG ulong_value; +NX_PACKET_POOL + test_pool; +ULONG ipv6_addr[4]; +UINT old_state = _tx_thread_system_state; + + + _tx_thread_system_state = expected_system_state; + + if (nx_ip_raw_packet_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_raw_packet_disable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_raw_receive_queue_max_set(&ip_0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_fragment_disable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_rarp_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_gateway_address_clear(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, + NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_link_status_change_notify_set(&ip_0, link_status_change_notify) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_address_change_notify(&ip_0, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_rarp_disable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_fragment_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_rarp_queue_process = _nx_rarp_queue_process; + if (nx_rarp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_static_entries_delete(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_icmp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_igmp_loopback_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_igmp_loopback_disable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_driver_direct_command(&ip_0, 0xFFFFFFFF, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_driver_interface_direct_command(&ip_0, 0xFFFFFFFF, 0, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_physical_address_set(&ip_0, 0, 0, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, + NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_igmp_info_get(&ip_0, 0, 0, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_mtu_set(&ip_0, 0, 1500) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_gateway_address_set(&ip_0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_entry_delete(&ip_0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_arp_allocate = NX_NULL; + if (nx_arp_enable(&ip_0, (VOID *)0x20000000, 1024) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_arp_allocate = _nx_arp_entry_allocate; + if (nx_tcp_socket_mss_set(&tcp_socket, 1460) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_mss_get(&tcp_socket, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_window_update_notify_set(&tcp_socket, tcp_socket_window_update_notify) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_gateway_address_get(&ip_0, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_icmp_packet_receive = NX_NULL; + if (nx_icmp_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_icmp_packet_receive = _nx_icmp_packet_receive; + if (nx_tcp_socket_info_get(&tcp_socket, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, + NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + if (nx_igmp_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + if (nx_ip_interface_address_mapping_configure(&ip_0, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_info_get(&ip_0, 0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_address_set(&ip_0, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_address_get(&ip_0, &ulong_value, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_address_set(&ip_0, 0, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_physical_address_get(&ip_0, 0, &ulong_value, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_transmit_configure(&tcp_socket, 1, 1, 1, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_receive_notify(&tcp_socket, tcp_receive_notify) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_pool_create(&test_pool, "Invalid pool", 256, (VOID *)0x20000000, 1024) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_address_get(&ip_0, 0, &ulong_value, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_create(&test_ip, "test ip", 0, 0, &pool_0, _nx_ram_network_driver_256, + (VOID *)0x20000000, 1024, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_static_entry_create(&ip_0, 1, 1, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + address.nxd_ip_version = NX_IP_VERSION_V6; + if (nx_ip_max_payload_size_find(&ip_0, &address, 0, 1, 1, NX_PROTOCOL_TCP, &ulong_value, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_create(&ip_0, &udp_socket, "UDP socket", 0, 0, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_create(&ip_0, &tcp_socket, "TCP socket", 0, 0, 0, 0, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } +#if (NX_MAX_PHYSICAL_INTERFACES>1) + if (nx_ip_interface_detach(&ip_0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_interface_attach(&ip_0, "Second interface", 1, 0, _nx_ram_network_driver_256) != NX_CALLER_ERROR) + { + error_counter++; + } +#endif /* (NX_MAX_PHYSICAL_INTERFACES>1) */ +#ifdef FEATURE_NX_IPV6 + if (nxd_ipv6_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_disable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_default_router_delete(&ip_0, &address) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_default_router_entry_get(&ip_0, 0, 0, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_icmpv6_ra_flag_callback_set(&ip_0, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_icmp_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_address_delete(&ip_0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_nd_cache_entry_delete(&ip_0, ipv6_addr) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_nd_cache_entry_set(&ip_0, ipv6_addr, 0, "") != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_address_get(&ip_0, 0, &address, &ulong_value, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + address.nxd_ip_version = NX_IP_VERSION_V6; + if (nxd_ipv6_default_router_add(&ip_0, &address, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } +#endif /* FEATURE_NX_IPV6 */ + + _tx_thread_system_state = old_state; + + /* Deactivate current timer. */ + tx_timer_deactivate(&timer_0); +} + +VOID test_process_1(ULONG id) +{ +NX_PACKET *packet_ptr; +ULONG ulong_value; +UINT uint_value; +ULONG ipv6_addr[4]; +UINT old_state = _tx_thread_system_state; +TX_THREAD *old_thread = _tx_thread_current_ptr; + + + nx_packet_allocate(&pool_0, &packet_ptr, 0, 0); + packet_ptr -> nx_packet_ip_version = 0; + + _tx_thread_system_state = expected_system_state; + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nxd_udp_packet_info_extract(packet_ptr, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_packet_info_extract(packet_ptr, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_bytes_available(&udp_socket, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_port_get(&udp_socket, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_raw_ip_processing = _nx_ip_raw_packet_processing; + if (nx_ip_raw_packet_receive(&ip_0, &packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_receive(&udp_socket, &packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_allocate(&pool_0, &packet_ptr, 0, 0); + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr; + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nxd_udp_source_extract(packet_ptr, &address, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_delete(&udp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_unbind(&udp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_free_port_find(&ip_0, 1, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_delete(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ipv4_multicast_interface_leave(&ip_0, IP_ADDRESS(224, 0, 0, 1), 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_pool_delete(&pool_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_dynamic_entries_invalidate(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_disconnect(&tcp_socket, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_client_socket_unbind(&tcp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_delete(&tcp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_server_socket_accept(&tcp_socket, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_server_socket_unaccept(&tcp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_state_wait(&tcp_socket, NX_TCP_CLOSED, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ipv4_multicast_interface_join(&ip_0, IP_ADDRESS(224, 0, 0, 1), 0) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_allocate(&pool_0, &packet_ptr, sizeof(NX_IPV4_HEADER), 0); + address.nxd_ip_version = NX_IP_VERSION_V4; + address.nxd_ip_address.v4 = 1; + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nxd_ip_raw_packet_send(&ip_0, packet_ptr, &address, 0, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_raw_packet_source_send(&ip_0, packet_ptr, 1, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_raw_packet_send(&ip_0, packet_ptr, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_release(packet_ptr); + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224, 0, 0, 1), 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224, 0, 0, 1), 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &ulong_value, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_bind(&udp_socket, 10, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_mss_peer_get(&tcp_socket, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_client_socket_bind(&tcp_socket, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_bytes_available(&tcp_socket, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_receive(&tcp_socket, &packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_client_socket_port_get(&tcp_socket, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, 0); + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_udp_socket_send(&udp_socket, packet_ptr, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_release(packet_ptr); + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_arp_ip_address_find(&ip_0, ipv6_addr, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_free_port_find(&ip_0, 1, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224, 0, 0, 1)) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224, 0, 0, 1)) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_icmp_ping(&ip_0, 1, "", 0, &packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_socket_peer_info_get(&tcp_socket, &ulong_value, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_static_entry_delete(&ip_0, 1, 1, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_server_socket_unlisten(&ip_0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_tcp_socket_peer_info_get(&tcp_socket, &address, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_tcp_client_socket_connect(&tcp_socket, &address, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_client_socket_connect(&tcp_socket, 1, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, 0); + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_udp_socket_source_send(&udp_socket, packet_ptr, 1, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_release(packet_ptr); + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_ip_interface_status_check(&ip_0, 0, NX_IP_INITIALIZE_DONE, &ulong_value, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_hardware_address_find(&ip_0, 1, &ulong_value, &ulong_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_dynamic_entry_set(&ip_0, 1, 1, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_arp_gratuitous_send(&ip_0, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_tcp_socket_send(&tcp_socket, packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_udp_socket_source_send(&udp_socket, packet_ptr, &address, 1, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_udp_socket_send(&udp_socket, packet_ptr, &address, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_ip_raw_packet_source_send(&ip_0, packet_ptr, &address, 0, 0, 0, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_release(packet_ptr); + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_tcp_server_socket_relisten(&ip_0, 1, &tcp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_tcp_server_socket_listen(&ip_0, 1, &tcp_socket, 1, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_icmp_ping(&ip_0, &address, "", 0, &packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } +#ifdef FEATURE_NX_IPV6 + if (nxd_nd_cache_invalidate(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_nd_cache_ip_address_find(&ip_0, &address, 1, 1, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nxd_icmp_source_ping(&ip_0, &address, 0, "", 0, &packet_ptr, 0) != NX_CALLER_ERROR) + { + error_counter++; + } + address.nxd_ip_version = NX_IP_VERSION_V6; + if (nxd_nd_cache_hardware_address_find(&ip_0, &address, &ulong_value, &ulong_value, &uint_value) != NX_CALLER_ERROR) + { + error_counter++; + } +#endif /* FEATURE_NX_IPV6 */ + + _tx_thread_system_state = old_state; + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + /* Deactivate current timer. */ + tx_timer_deactivate(&timer_0); +} + +VOID test_process_2(ULONG id) +{ +NX_PACKET *packet_ptr; +NX_PACKET *test_packet_ptr; +ULONG ulong_value; +UINT old_state = _tx_thread_system_state; +TX_THREAD *old_thread = _tx_thread_current_ptr; + + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + + _tx_thread_system_state = expected_system_state; + + if (id == 1) + _tx_thread_current_ptr = TX_NULL; + + if (nx_packet_allocate(&pool_0, &test_packet_ptr, 0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_copy(packet_ptr, &packet_ptr, &pool_0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_data_append(packet_ptr, "", 1, &pool_0, 1) != NX_CALLER_ERROR) + { + error_counter++; + } + + _tx_thread_system_state = old_state; + + if (id == 1) + _tx_thread_current_ptr = old_thread; + + nx_packet_release(packet_ptr); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +TX_INTERRUPT_SAVE_AREA +UINT i; +UINT old_state; +TX_THREAD *old_thread; +NX_PACKET *packet_ptr; +ULONG ulong_value; +UINT uint_value; +ULONG ipv6_addr[4]; +struct sched_param sp; + + /* Print out some test information banners. */ + printf("NetX Test: Caller Check Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Modify the thread priority so it will pass the check as not a user thread. */ + sp.sched_priority = 1; + pthread_setschedparam(_tx_thread_current_ptr -> tx_thread_linux_thread_id, SCHED_FIFO, &sp); + + /* Create a UDP socket. */ + nx_udp_socket_create(&ip_0, &udp_socket, "UDP Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Create a TCP socket. */ + nx_tcp_socket_create(&ip_0, &tcp_socket, "TCP Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + TX_DISABLE + old_state = _tx_thread_system_state; + old_thread = _tx_thread_current_ptr; + + /* 1. NX_INIT_AND_THREADS_CALLER_CHECKING checking. */ + + /* 1.1 _tx_thread_system_state = 1, _tx_thread_current_ptr != _tx_timer_thread */ + expected_system_state = 1; + test_process(0); + +#ifndef TX_TIMER_PROCESS_IN_ISR + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + /* 1.2 _tx_thread_system_state = 0xF0F0F0F0UL, _tx_thread_current_ptr = _tx_timer_thread */ + expected_system_state = 0xF0F0F0F0UL; + tx_timer_create(&timer_0, "TIMER 0", test_process, 0, 1, 1, TX_AUTO_ACTIVATE); + /* Invoke functions in timer thread. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + tx_timer_delete(&timer_0); +#endif /* TX_TIMER_PROCESS_IN_ISR */ + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + /* 1.3 _tx_thread_current_ptr = &_tx_timer_thread, _tx_thread_system_state = 0. */ + expected_system_state = 0; + tx_timer_create(&timer_0, "TIMER 1", test_process, 0, 1, 1, TX_AUTO_ACTIVATE); + /* Invoke functions in timer thread. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + tx_timer_delete(&timer_0); + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + + /* 2. NX_NOT_ISR_CALLER_CHECKING checking. */ + /* 2.1 _tx_thread_system_state = 0 */ + _tx_thread_system_state = 0; + if (nx_udp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_info_get(&udp_socket, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) == NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_udp_packet_receive = NX_NULL; + if (nx_udp_enable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + if (nx_udp_socket_checksum_disable(&udp_socket) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_checksum_enable(&udp_socket) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_pool_info_get(&pool_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_forwarding_enable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_forwarding_disable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + + /* 2.2 _tx_thread_system_state = 1 */ + _tx_thread_system_state = 1; + if (nx_udp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_info_get(&udp_socket, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_udp_packet_receive = NX_NULL; + if (nx_udp_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + if (nx_udp_socket_checksum_disable(&udp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_checksum_enable(&udp_socket) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_pool_info_get(&pool_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_forwarding_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_forwarding_disable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_tcp_packet_receive = NX_NULL; + if (nx_tcp_enable(&ip_0) != NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* 2.3 _tx_thread_system_state = 0xF0F0F0F0UL */ + _tx_thread_system_state = 0xF0F0F0F0UL; + if (nx_udp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_info_get(&udp_socket, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) == NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_udp_packet_receive = NX_NULL; + if (nx_udp_enable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + if (nx_udp_socket_checksum_disable(&udp_socket) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_udp_socket_checksum_enable(&udp_socket) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_packet_pool_info_get(&pool_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_forwarding_enable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + if (nx_ip_forwarding_disable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_tcp_packet_receive = NX_NULL; + if (nx_tcp_enable(&ip_0) == NX_CALLER_ERROR) + { + error_counter++; + } + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + + /* 3. NX_THREADS_ONLY_CALLER_CHECKING checking. */ + /* 3.1 _tx_thread_system_state = 1 */ + expected_system_state = 1; + test_process_1(0); + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + /* 3.2 _tx_thread_current_ptr = &_tx_timer_thread, _tx_thread_system_state = 0. */ + expected_system_state = 0; + tx_timer_create(&timer_0, "TIMER 2", test_process_1, 0, 1, 1, TX_AUTO_ACTIVATE); + /* Invoke functions in timer thread. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + tx_timer_delete(&timer_0); + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + /* 3.3 _tx_thread_current_ptr = TX_NULL, _tx_thread_system_state = 0. */ + expected_system_state = 0; + test_process_1(1); + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + + /* 4. NX_THREAD_WAIT_CALLER_CHECKING checking. */ + /* 4.1 _tx_thread_system_state = 1. */ + expected_system_state = 1; + test_process_2(0); + + /* 4.2 _tx_thread_current_ptr = TX_NULL, _tx_thread_system_state = 0. */ + expected_system_state = 0; + test_process_2(1); + + /* 4.3 _tx_thread_current_ptr = &_tx_timer_thread, _tx_thread_system_state = 0. */ + expected_system_state = 0; + tx_timer_create(&timer_0, "TIMER 3", test_process_2, 0, 1, 1, TX_AUTO_ACTIVATE); + /* Invoke functions in timer thread. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + tx_timer_delete(&timer_0); + + /* Restore. */ + _tx_thread_current_ptr = old_thread; + _tx_thread_system_state = old_state; + TX_RESTORE + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void link_status_change_notify(NX_IP *ip_ptr, UINT interface_index, UINT link_up) +{ +} + +static void tcp_receive_notify(NX_TCP_SOCKET *socket_ptr) +{ +} + +static VOID tcp_socket_window_update_notify(NX_TCP_SOCKET *socket_ptr) +{ +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_caller_check_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Caller Check Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_checksum_test.c b/test/regression/netxduo_test/netx_checksum_test.c new file mode 100644 index 00000000..453b58e0 --- /dev/null +++ b/test/regression/netxduo_test/netx_checksum_test.c @@ -0,0 +1,323 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_tcp.h" +#include "nx_icmp.h" +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#endif /* FEATURE_NX_IPV6 */ + +#if defined(__PRODUCT_NETX__) +#define NX_PROTOCOL_TCP 6 +#define NX_PROTOCOL_UDP 17 +#define NX_PROTOCOL_ICMPV6 58 +#define NX_PROTOCOL_ICMP 1 +#define NX_IP_VERSION_V4 4 /* IP-in-IP encapsulation */ +#endif + +#define DEMO_STACK_SIZE 2048 +#define PHYSICAL_OFFSET 14 + +/* Define raw packet data. */ +static char pkt_tcp_32[] = { +0x00, 0x50, 0x56, 0xc0, 0x00, 0x08, 0x00, 0x0c, +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x10, +0x00, 0x34, 0xf2, 0x4b, 0x40, 0x00, 0x40, 0x06, +0xea, 0x94, 0xc0, 0xa8, 0xee, 0x80, 0xc0, 0xa8, +0xee, 0x01, 0x00, 0x16, 0xe2, 0xb1, 0xcb, 0xe8, +0x2a, 0xb4, 0x0a, 0x4e, 0x4c, 0x16, 0x80, 0x10, +0x03, 0xea, 0x36, 0xba, 0x00, 0x00, 0x01, 0x01, +0x05, 0x0a, 0x0a, 0x4e, 0x4e, 0x16, 0x0a, 0x4e, +0x4e, 0xca }; + +static char pkt_tcp_37[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, +0x00, 0x39, 0x77, 0xd7, 0x40, 0x00, 0x40, 0x06, +0xc4, 0xe5, 0x7f, 0x00, 0x00, 0x01, 0x7f, 0x00, +0x00, 0x01, 0x00, 0x0d, 0x9d, 0x48, 0x52, 0x32, +0xec, 0x47, 0x52, 0x2b, 0x98, 0x93, 0x80, 0x18, +0x02, 0x00, 0x4f, 0x22, 0x00, 0x00, 0x01, 0x01, +0x08, 0x0a, 0x03, 0x05, 0x9b, 0x90, 0x03, 0x05, +0x9b, 0x90, 0x48, 0x65, 0x6c, 0x6c, 0x6f }; + +static char pkt_udp_53[] = { +0x00, 0x50, 0x56, 0xfb, 0x32, 0x2d, 0x00, 0x0c, +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, +0x00, 0x49, 0x43, 0x73, 0x40, 0x00, 0x40, 0x11, +0x99, 0x5c, 0xc0, 0xa8, 0xee, 0x80, 0xc0, 0xa8, +0xee, 0x02, 0xe1, 0xee, 0x00, 0x35, 0x00, 0x35, +0x61, 0x91, 0x7c, 0x8c, 0x01, 0x00, 0x00, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x68, +0x65, 0x6c, 0x70, 0x06, 0x75, 0x62, 0x75, 0x6e, +0x74, 0x75, 0x03, 0x63, 0x6f, 0x6d, 0x0b, 0x6c, +0x6f, 0x63, 0x61, 0x6c, 0x64, 0x6f, 0x6d, 0x61, +0x69, 0x6e, 0x00, 0x00, 0x1c, 0x00, 0x01 }; + +static char pkt_udp_40[] = { +0x00, 0x50, 0x56, 0xfb, 0x32, 0x2d, 0x00, 0x0c, +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, +0x00, 0x3c, 0x43, 0x5a, 0x40, 0x00, 0x40, 0x11, +0x99, 0x82, 0xc0, 0xa8, 0xee, 0x80, 0xc0, 0xa8, +0xee, 0x02, 0xd7, 0x98, 0x00, 0x35, 0x00, 0x28, +0x06, 0x9c, 0x34, 0xb8, 0x01, 0x00, 0x00, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x77, +0x77, 0x77, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, +0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x01, +0x00, 0x01 }; + +static char pkt_icmp_18[] = { +0x00, 0x50, 0x56, 0xfb, 0x32, 0x2d, 0x00, 0x0c, +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, +0x00, 0x26, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01, +0xcb, 0x04, 0xc0, 0xa8, 0xee, 0x80, 0xc0, 0xa8, +0x00, 0x01, 0x08, 0x00, 0x26, 0x76, 0x15, 0xa0, +0x00, 0x01, 0x71, 0x94, 0xd1, 0x50, 0x65, 0xfa, +0x0b, 0x00, 0x08, 0x09 }; + +static char pkt_icmp_23[] = { +0x00, 0x50, 0x56, 0xfb, 0x32, 0x2d, 0x00, 0x0c, +0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, +0x00, 0x2b, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01, +0xca, 0xff, 0xc0, 0xa8, 0xee, 0x80, 0xc0, 0xa8, +0x00, 0x01, 0x08, 0x00, 0x55, 0x9b, 0x15, 0xa4, +0x00, 0x02, 0x91, 0x94, 0xd1, 0x50, 0xf2, 0xb7, +0x0b, 0x00, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, +0x0e }; + +static char pkt_icmpv6_32[] = { +0x33, 0x33, 0xff, 0x89, 0x7e, 0xba, 0x00, 0x0c, +0x29, 0x01, 0xd4, 0x79, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, +0x29, 0xff, 0xfe, 0x01, 0xd4, 0x79, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x89, 0x7e, 0xba, 0x87, 0x00, +0x42, 0x58, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, +0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x01, +0x00, 0x0c, 0x29, 0x01, 0xd4, 0x79 }; + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void verify_checksum(UINT index); +extern void test_control_return(UINT status); + +typedef struct CHECKSUM_TEST_SEQ_STRUCT +{ + char *pkt_data; + int pkt_size; + + ULONG protocol; + ULONG offset; +}CHECKSUM_TEST_SEQ; + +static CHECKSUM_TEST_SEQ checksum_test_seq[] = +{ + + /* ICMPv6 checksum with payload size 32. */ + {pkt_icmpv6_32, sizeof(pkt_icmpv6_32), NX_PROTOCOL_ICMPV6, 54}, + + /* Following packets are IPv4. */ + /* IPv4 checksum with payload size 43. */ + {pkt_icmp_23, sizeof(pkt_icmp_23), NX_IP_VERSION_V4, 14}, + + /* ICMPv4 checksum with payload size 23. */ + {pkt_icmp_23, sizeof(pkt_icmp_23), NX_PROTOCOL_ICMP, 34}, + + /* IPv4 checksum with payload size 38. */ + {pkt_icmp_18, sizeof(pkt_icmp_18), NX_IP_VERSION_V4, 14}, + + /* ICMPv4 checksum with payload size 18. */ + {pkt_icmp_18, sizeof(pkt_icmp_18), NX_PROTOCOL_ICMP, 34}, + + /* IPv4 checksum with payload size 60. */ + {pkt_udp_40, sizeof(pkt_udp_40), NX_IP_VERSION_V4, 14}, + + /* UDP checksum with payload size 40. */ + {pkt_udp_40, sizeof(pkt_udp_40), NX_PROTOCOL_UDP, 34}, + + /* IPv4 checksum with payload size 73. */ + {pkt_udp_53, sizeof(pkt_udp_53), NX_IP_VERSION_V4, 14}, + + /* UDP checksum with payload size 53. */ + {pkt_udp_53, sizeof(pkt_udp_53), NX_PROTOCOL_UDP, 34}, + + /* IPv4 checksum with payload size 57. */ + {pkt_tcp_37, sizeof(pkt_tcp_37), NX_IP_VERSION_V4, 14}, + + /* TCP checksum with payload size 37. */ + {pkt_tcp_37, sizeof(pkt_tcp_37), NX_PROTOCOL_TCP, 34}, + + /* IPv4 checksum with payload size 52. */ + {pkt_tcp_32, sizeof(pkt_tcp_32), NX_IP_VERSION_V4, 14}, + + /* TCP checksum with payload size 32. */ + {pkt_tcp_32, sizeof(pkt_tcp_32), NX_PROTOCOL_TCP, 34} +}; + +static UINT seq_size = sizeof(checksum_test_seq)/sizeof(CHECKSUM_TEST_SEQ); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_checksum_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: Checksum Test............................................."); + + for(i = 0; i < seq_size; i++) + verify_checksum(i); + + /* Check status. */ + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the verify checksum function. */ +static void verify_checksum(UINT index) +{ +NX_PACKET *pkt_ptr; +ULONG source_ip[4]; +ULONG dest_ip[4]; +ULONG checksum; + + + /* Allocate a packet and fill data into the packet. */ + if(nx_packet_allocate(&pool_0, &pkt_ptr, NX_RECEIVE_PACKET, TX_NO_WAIT)) + { + error_counter++; + return; + } + if(nx_packet_data_append(pkt_ptr, checksum_test_seq[index].pkt_data + checksum_test_seq[index].offset, + checksum_test_seq[index].pkt_size - checksum_test_seq[index].offset, + &pool_0, TX_NO_WAIT)) + { + error_counter++; + nx_packet_release(pkt_ptr); + return; + } + +#if defined(__PRODUCT_NETXDUO__) + /* Get IP address. */ + if((*(checksum_test_seq[index].pkt_data + PHYSICAL_OFFSET) >> 4) == NX_IP_VERSION_V4) + { +#ifndef NX_DISABLE_IPV4 + NX_IPV4_HEADER *ip_header_ptr; + ip_header_ptr = (NX_IPV4_HEADER*)(checksum_test_seq[index].pkt_data + PHYSICAL_OFFSET); + source_ip[0] = ip_header_ptr -> nx_ip_header_source_ip; + dest_ip[0] = ip_header_ptr -> nx_ip_header_destination_ip; + NX_CHANGE_ULONG_ENDIAN(source_ip[0]); + NX_CHANGE_ULONG_ENDIAN(dest_ip[0]); + + pkt_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; +#else + nx_packet_release(pkt_ptr); + return; +#endif /* NX_DISABLE_IPV4 */ + } +#ifdef FEATURE_NX_IPV6 + else if((*(checksum_test_seq[index].pkt_data + PHYSICAL_OFFSET) >> 4) == NX_IP_VERSION_V6) + { + NX_IPV6_HEADER *ipv6_header; + ipv6_header = (NX_IPV6_HEADER*)(checksum_test_seq[index].pkt_data + PHYSICAL_OFFSET); + COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_source_ip, source_ip); + COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_destination_ip, dest_ip); + _nx_ipv6_address_change_endian(source_ip); + _nx_ipv6_address_change_endian(dest_ip); + + pkt_ptr -> nx_packet_ip_version = NX_IP_VERSION_V6; + } +#endif /* FEATURE_NX_IPV6 */ + else + { + + /* Release packet. */ + nx_packet_release(pkt_ptr); + return; + } + + if(checksum_test_seq[index].protocol == NX_IP_VERSION_V4) + pkt_ptr -> nx_packet_length = 20; + + /* Calculate checksum. */ + checksum = _nx_ip_checksum_compute(pkt_ptr, checksum_test_seq[index].protocol, + pkt_ptr -> nx_packet_length, + source_ip, dest_ip); + + checksum = ~checksum & NX_LOWER_16_MASK; +#elif defined(__PRODUCT_NETX__) + checksum = 0; + if(checksum_test_seq[index].protocol == NX_PROTOCOL_TCP) + { + NX_IP_HEADER *ip_header_ptr; + ip_header_ptr = (NX_IP_HEADER*)(checksum_test_seq[index].pkt_data + PHYSICAL_OFFSET); + source_ip[0] = ip_header_ptr -> nx_ip_header_source_ip; + dest_ip[0] = ip_header_ptr -> nx_ip_header_destination_ip; + NX_CHANGE_ULONG_ENDIAN(source_ip[0]); + NX_CHANGE_ULONG_ENDIAN(dest_ip[0]); + checksum = _nx_tcp_checksum(pkt_ptr, source_ip[0], dest_ip[0]); + } + else if(checksum_test_seq[index].protocol == NX_PROTOCOL_ICMP) + { + checksum = _nx_icmp_checksum_compute(pkt_ptr); + checksum = ~checksum & NX_LOWER_16_MASK; + } +#endif + if(checksum) + error_counter++; + + /* Release packet. */ + nx_packet_release(pkt_ptr); +} diff --git a/test/regression/netxduo_test/netx_dest_table_add_fail_test.c b/test/regression/netxduo_test/netx_dest_table_add_fail_test.c new file mode 100644 index 00000000..5d82470b --- /dev/null +++ b/test/regression/netxduo_test/netx_dest_table_add_fail_test.c @@ -0,0 +1,235 @@ +/* This NetX test concentrates on the failure of adding destination table. */ + +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 +#include "nx_icmpv6.h" +#include "nx_nd_cache.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dest_table_add_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMPv6 enable status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +ND_CACHE_ENTRY *nd_cache_entry; +NX_IPV6_DESTINATION_ENTRY + *dest_entry; +NXD_ADDRESS dest_ip; +CHAR mac_address[6]; +ULONG next_hop; + + + /* Print out test information banner. */ + printf("NetX Test: Dest Table Add Fail Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Added ND Cache entry until full. */ + for (i = 0; i < NX_IPV6_NEIGHBOR_CACHE_SIZE; i++) + { + + /* Set unique MAC address. */ + mac_address[0] = 0x00; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = i + 1; + + /* Set unique ipv6 address. */ + dest_ip.nxd_ip_version = NX_IP_VERSION_V6; + dest_ip.nxd_ip_address.v6[0] = 0x20010000; + dest_ip.nxd_ip_address.v6[1] = 0x00000000; + dest_ip.nxd_ip_address.v6[2] = 0x00000000; + dest_ip.nxd_ip_address.v6[3] = i + 1; + + /* Call the function to added nd cache entry. */ + status = _nx_nd_cache_add(&ip_0, dest_ip.nxd_ip_address.v6, &ip_0.nx_ip_interface[0], mac_address, + NX_FALSE, ND_CACHE_STATE_CREATED, &(ip_0.nx_ipv6_address[0]), &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Set unique MAC address. */ + mac_address[0] = 0x00; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = i + 1; + + /* Set unique ipv6 address. */ + dest_ip.nxd_ip_version = NX_IP_VERSION_V6; + dest_ip.nxd_ip_address.v6[0] = 0x20010000; + dest_ip.nxd_ip_address.v6[1] = 0x00000000; + dest_ip.nxd_ip_address.v6[2] = 0x00000000; + dest_ip.nxd_ip_address.v6[3] = i + 1; + + /* Call the function to added nd cache entry. */ + status = _nx_nd_cache_add(&ip_0, dest_ip.nxd_ip_address.v6, &ip_0.nx_ip_interface[0], mac_address, + NX_FALSE, ND_CACHE_STATE_CREATED, &(ip_0.nx_ipv6_address[0]), &nd_cache_entry); + + /* Check status. */ + if (status != NX_NOT_SUCCESSFUL) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add destination table entry. */ + status = _nx_icmpv6_dest_table_add(&ip_0, dest_ip.nxd_ip_address.v6, &dest_entry, + &next_hop, 0, 0, &(ip_0.nx_ipv6_address[0])); + + /* Check status. */ + if (status != NX_NOT_SUCCESSFUL) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now delete one nd cache entry. */ + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_nd_status = ND_CACHE_STATE_INVALID; + + /* Add destination table entry. */ + status = _nx_icmpv6_dest_table_add(&ip_0, dest_ip.nxd_ip_address.v6, &dest_entry, + &next_hop, 0, 0, &(ip_0.nx_ipv6_address[0])); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_dest_table_add_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Dest Table Add Fail Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_icmp_small_header_test.c b/test/regression/netxduo_test/netx_forward_icmp_small_header_test.c new file mode 100644 index 00000000..0592f9a2 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_icmp_small_header_test.c @@ -0,0 +1,222 @@ +/* This NetX test concentrates on the forwarding operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_small_header_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: Forward ICMP Small Header Processing Test................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_0.nx_ipv4_packet_receive = my_packet_process; + + /* Now ip_1 ping ip_2. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +ULONG shift_size; + + /* Calculate the shift data size. */ + shift_size = (ULONG)(packet_ptr -> nx_packet_append_ptr - packet_ptr -> nx_packet_prepend_ptr); + + /* Move the data to the start location, so the forward packet should remove the packet data to added the physical header. */ + memmove(packet_ptr -> nx_packet_data_start, packet_ptr -> nx_packet_prepend_ptr, shift_size); + + /* Update the prepend and append pointer. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + shift_size; + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_small_header_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward ICMP Small Header Processing Test.................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_icmp_small_header_test2.c b/test/regression/netxduo_test/netx_forward_icmp_small_header_test2.c new file mode 100644 index 00000000..db832643 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_icmp_small_header_test2.c @@ -0,0 +1,299 @@ +/* This NetX test concentrates on the Forward ICMP ping with small header operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter = 0; +static ULONG shift_size = 0; +static ULONG callback_0_counter = 0; +static ULONG callback_1_counter = 0; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID ip_0_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_small_header_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 3); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; +UINT size; +CHAR data[256]; + + + /* Print out test information banner. */ + printf("NetX Test: Forward ICMP Small Header Processing Test2................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334458); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334459); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_2, IP_ADDRESS(2, 2, 3, 4), 0x0011, 0x22334457); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_0.nx_ipv4_packet_receive = ip_0_packet_process; + + /* Set the max size for ICMP. */ + size = 256 - NX_IPv4_ICMP_PACKET - NX_ICMP_HEADER_SIZE; + + /* Set the data. */ + for (i = 0; i < size; i++) + data[i] = 'a'; + + /* Now ip_1 ping ip_2 again, this packet will be modified by callback function. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 5), data, size, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status . */ + if ((status != NX_SUCCESS) || (my_packet -> nx_packet_length != size)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the counter. */ + if ((callback_0_counter != 1) || (callback_1_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +static VOID ip_0_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + /* Update the counter. */ + callback_0_counter ++; + + /* Calculate the shift data size. */ + shift_size = (ULONG)(packet_ptr -> nx_packet_prepend_ptr - packet_ptr -> nx_packet_data_start); + + /* Update the data start pointer. */ + packet_ptr -> nx_packet_data_start += shift_size; + + /* Set the callback function to get the IPv4 packet. */ + advanced_packet_process_callback = driver_packet_process; + + /* Reset the IP callback function. */ + ip_0.nx_ipv4_packet_receive = _nx_ipv4_packet_receive; + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(ip_ptr, packet_ptr); +} +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Update the counter. */ + callback_1_counter ++; + + /* Check the packet pointer for forwarding packet. */ + if ((packet_ptr -> nx_packet_prepend_ptr - packet_ptr -> nx_packet_data_start) != NX_PHYSICAL_HEADER) + error_counter ++; + + /* Update the packet start pointer.*/ + packet_ptr -> nx_packet_data_start -= shift_size; + + /* Clear the callback function. */ + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_small_header_test2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward ICMP Small Header Processing Test2................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_icmp_small_header_test3.c b/test/regression/netxduo_test/netx_forward_icmp_small_header_test3.c new file mode 100644 index 00000000..80ed1a82 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_icmp_small_header_test3.c @@ -0,0 +1,314 @@ +/* This NetX test concentrates on the Forward ICMP ping with small header operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter = 0; +static ULONG shift_size = 0; +static ULONG callback_0_counter = 0; +static ULONG callback_1_counter = 0; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID ip_0_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_small_header_test3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 3); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; +UINT size; +CHAR data[256]; + + + /* Print out test information banner. */ + printf("NetX Test: Forward ICMP Small Header Processing Test3................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334458); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0x0011, 0x22334459); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_1, IP_ADDRESS(1, 2, 3, 4), 0x0011, 0x22334456); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup static ARP entries. */ + status = nx_arp_static_entry_create(&ip_2, IP_ADDRESS(2, 2, 3, 4), 0x0011, 0x22334457); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_0.nx_ipv4_packet_receive = ip_0_packet_process; + + /* Set the max size for ICMP. */ + size = 256 - NX_IPv4_ICMP_PACKET - NX_ICMP_HEADER_SIZE; + + /* Set the data. */ + for (i = 0; i < size; i++) + data[i] = 'a'; + + /* Now ip_1 ping ip_2 again, this packet will be modified by callback function. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 5), data, size, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status . */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the counter. */ + if ((callback_0_counter != 1) || (callback_1_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +static VOID ip_0_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +UINT packet_counter; +UINT i; +UINT status; +NX_PACKET *my_packet[10]; + + /* Update the counter. */ + callback_0_counter ++; + + /* Calculate the shift data size. */ + shift_size = (ULONG)(packet_ptr -> nx_packet_prepend_ptr - packet_ptr -> nx_packet_data_start); + + /* Update the data start pointer. */ + packet_ptr -> nx_packet_data_start += shift_size; + + /* Set the callback function to get the IPv4 packet. */ + advanced_packet_process_callback = driver_packet_process; + + /* Reset the IP callback function. */ + ip_0.nx_ipv4_packet_receive = _nx_ipv4_packet_receive; + + /* Loop to allocate the all packets to let _nx_packet_data_append failure in nx_ip_forward_packet_process.c */ + packet_counter = pool_0.nx_packet_pool_available; + for (i = 0; i < packet_counter; i++) + { + status = nx_packet_allocate(&pool_0, &my_packet[i], 0, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter ++; + } + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(ip_ptr, packet_ptr); +} +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Update the counter. */ + callback_1_counter ++; + + /* Check the packet pointer for forwarding packet. */ + if ((packet_ptr -> nx_packet_prepend_ptr - packet_ptr -> nx_packet_data_start) != NX_PHYSICAL_HEADER) + error_counter ++; + + /* Update the packet start pointer.*/ + packet_ptr -> nx_packet_data_start -= shift_size; + + /* Clear the callback function. */ + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_small_header_test3_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward ICMP Small Header Processing Test3................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_icmp_test.c b/test/regression/netxduo_test/netx_forward_icmp_test.c new file mode 100644 index 00000000..79c51d1c --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_icmp_test.c @@ -0,0 +1,377 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_ping_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: Forward ICMP Processing Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ip_0 ping ip_1. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_0 ping ip_2. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 2) || (ping_responses_received != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Enable all TX checksum capability. */ + nx_ip_interface_capability_set(&ip_0, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM); +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Now ip_1 ping an one address of ip_0. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_1 ping an other address of ip_0. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 2) || (ping_responses_received != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_1 ping ip_2. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 3) || (ping_responses_received != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Disable all interface capability. */ + nx_ip_interface_capability_set(&ip_0, 0, 0); +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Now ip_2 ping an one address of ip_0. */ + status = nx_icmp_ping(&ip_2, IP_ADDRESS(2, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_2, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_2 ping an other address of ip_0. */ + status = nx_icmp_ping(&ip_2, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_2, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 2) || (ping_responses_received != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_2 ping ip_1. */ + status = nx_icmp_ping(&ip_2, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_2, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 3) || (ping_responses_received != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_1 ping the address that does not exist. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(3, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the timeout error occurred. */ + if ((ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_ping_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward ICMP Processing Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_icmp_ttl_test.c b/test/regression/netxduo_test/netx_forward_icmp_ttl_test.c new file mode 100644 index 00000000..1a5f8c68 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_icmp_ttl_test.c @@ -0,0 +1,303 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter = 0; +static ULONG icmp_counter = 0; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_ttl_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: Forward ICMP TTL Processing Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + packet_process_callback = my_packet_process; + + /* Now ip_1 ping ip_2. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Now ip_1 ping ip_2 again, modified the TTL as 1, this packet should be dropped by forward function. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status . */ + if ((status == NX_SUCCESS) || (ip_0.nx_ip_receive_packets_dropped != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ICMP counter for IP instance 1. */ + if (icmp_counter != 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +#else +NX_IP_HEADER *ip_header_ptr; +#endif +ULONG protocol; +ULONG checksum; +ULONG old_m; +ULONG new_m; + + /* Only detect the IP instance 1. */ + if (ip_ptr != &ip_1) + return NX_TRUE; + + /* Ignore packet that is not ICMP. */ + if(packet_ptr -> nx_packet_length < 28) + return NX_TRUE; + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + +#else + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Get the next protocol. */ + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + + /* Is ICMP packet? */ + if(protocol == 1) + { + + /* Yes it is. */ + + /* Only modify the second ICMP packet. */ + if (icmp_counter == 1) + { + + /* Get the old checksum (HC) in header. */ + checksum = ip_header_ptr -> nx_ip_header_word_2 & NX_LOWER_16_MASK; + + /* Get the old TTL(m). */ + old_m = (ip_header_ptr -> nx_ip_header_word_2 & 0xFFFF0000) >> 16;; + + /* Set the new TTL as 1. */ + new_m = ((old_m & 0x00FF) | (0x0100)); + + /* Update the checksum, get the new checksum(HC'), + The new_m is ULONG value, so need get the lower value after invert. */ + checksum = ((~checksum) & 0xFFFF) + ((~old_m) & 0xFFFF) + new_m; + + /* Fold a 4-byte value into a two byte value */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Do it again in case previous operation generates an overflow */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Set the ttl as 1. */ + ip_header_ptr -> nx_ip_header_word_2 = (ip_header_ptr -> nx_ip_header_word_2 & 0x00FFFFFF) | 0x01000000; + + /* Now store the new checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ((ip_header_ptr -> nx_ip_header_word_2 & 0xFFFF0000) | ((~checksum) & NX_LOWER_16_MASK)); + } + + /* Update the ICMP counter. */ + icmp_counter ++; + } + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_icmp_ttl_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward ICMP TTL Processing Test..........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_link_local_address_test.c b/test/regression/netxduo_test/netx_forward_link_local_address_test.c new file mode 100644 index 00000000..088545e2 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_link_local_address_test.c @@ -0,0 +1,187 @@ +/* This NetX test concentrates on the Link Local address check operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_link_local_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0, link local address. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(169, 254, 0, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2, link local address. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(169, 254, 0, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(169, 254, 0, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: Forward Link Local Address Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ip_1 ping ip_2, ip_0 should not forward the packet with link-local address. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(169, 254, 0, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successfully. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_link_local_address_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward Link Local Address Test...........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_multicast_test.c b/test/regression/netxduo_test/netx_forward_multicast_test.c new file mode 100644 index 00000000..a95b517d --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_multicast_test.c @@ -0,0 +1,224 @@ +/* This NetX test concentrates on the multicast forward. + * Multicast packet must not be forward. */ + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_ICMP_INFO) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_multicast_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 0. */ + status = nx_icmp_enable(&ip_0); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 1. */ + status = nx_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Enable ICMP processing for both IP Instance 2. */ + status = nx_icmp_enable(&ip_2); + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; +NX_IP_DRIVER driver_request; + + + /* Print out test information banner. */ + printf("NetX Test: Forward multicast Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register the new multicast group with the underlying driver to + ensure that there is room for the new group at the hardware level. */ + driver_request.nx_ip_driver_ptr = &ip_0; + driver_request.nx_ip_driver_command = NX_LINK_MULTICAST_JOIN; + driver_request.nx_ip_driver_physical_address_msw = NX_IP_MULTICAST_UPPER; + driver_request.nx_ip_driver_physical_address_lsw = NX_IP_MULTICAST_LOWER | (IP_ADDRESS(224, 0, 0, 2) & NX_IP_MULTICAST_MASK); + driver_request.nx_ip_driver_interface = &ip_0.nx_ip_interface[0]; + (ip_0.nx_ip_interface[0].nx_interface_link_driver_entry)(&driver_request); + + /* Now ip_1 ping multicast address. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(224, 0, 0, 2), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* No response is expected. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + if ((status != NX_SUCCESS) || (ping_timeouts != 0) || (pings_sent != 0) || (ping_responses_received != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + if ((status != NX_SUCCESS) || (ping_timeouts != 1) || (pings_sent != 1) || (ping_responses_received != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_icmp_info_get(&ip_2, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + if ((status != NX_SUCCESS) || (ping_timeouts != 0) || (pings_sent != 0) || (ping_responses_received != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_multicast_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward multicast Test....................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_tcp_test_1.c b/test/regression/netxduo_test/netx_forward_tcp_test_1.c new file mode 100644 index 00000000..97f59c95 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_tcp_test_1.c @@ -0,0 +1,479 @@ +/* This NetX test concentrates on the basic TCP operation with forward. */ + +/* Test tcp function between IP_1 and Interface0 of IP_0. */ + + /*************/ + /* */ + /* IP_1 */ + /****************/ /* 1.2.3.5 */ + /* 1.2.3.4 */ /*************/ + /* Interface0 */ + /* */ + /* IP_0 */ + /* */ + /* Interface1 */ + /* 2.2.3.4 */ /*************/ + /****************/ /* */ + /* IP_2 */ + /* 2.2.3.5 */ + /*************/ + + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_TCP_SOCKET socket_0; +static NX_TCP_SOCKET socket_1; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_1_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + status += nx_tcp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: Forward TCP Processing Test1.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &socket_1, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_1, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_1, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&socket_1, &free_port); + + /* Check for error. */ + if ((status) || (free_port != 0x88)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&socket_1, IP_ADDRESS(1, 2, 3, 4), 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&socket_1, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&socket_1, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + nx_packet_release(my_packet); + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&socket_1, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&socket_1); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&socket_1, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_1); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &socket_0, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 0x89, &socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&socket_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_1_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward TCP Processing Test1..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_tcp_test_2.c b/test/regression/netxduo_test/netx_forward_tcp_test_2.c new file mode 100644 index 00000000..40ea6902 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_tcp_test_2.c @@ -0,0 +1,476 @@ +/* This NetX test concentrates on the basic TCP operation with forward. */ + +/* Test tcp function between IP_1 and Interface1 of IP_0. */ + + /*************/ + /* */ + /* IP_1 */ + /****************/ /* 1.2.3.5 */ + /* 1.2.3.4 */ /*************/ + /* Interface0 */ + /* */ + /* IP_0 */ + /* */ + /* Interface1 */ + /* 2.2.3.4 */ /*************/ + /****************/ /* */ + /* IP_2 */ + /* 2.2.3.5 */ + /*************/ + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_TCP_SOCKET socket_0; +static NX_TCP_SOCKET socket_1; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + status += nx_tcp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: Forward TCP Processing Test2.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &socket_1, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_1, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_1, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&socket_1, &free_port); + + /* Check for error. */ + if ((status) || (free_port != 0x88)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&socket_1, IP_ADDRESS(2, 2, 3, 4), 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&socket_1, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&socket_1, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + nx_packet_release(my_packet); + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&socket_1, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&socket_1); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&socket_1, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_1); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &socket_0, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 0x89, &socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&socket_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward TCP Processing Test2..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_tcp_test_3.c b/test/regression/netxduo_test/netx_forward_tcp_test_3.c new file mode 100644 index 00000000..defc829f --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_tcp_test_3.c @@ -0,0 +1,480 @@ +/* This NetX test concentrates on the basic TCP operation with forward. */ + +/* Test tcp function between IP_2 and Interface0 of IP_0. */ + + /*************/ + /* */ + /* IP_1 */ + /****************/ /* 1.2.3.5 */ + /* 1.2.3.4 */ /*************/ + /* Interface0 */ + /* */ + /* IP_0 */ + /* */ + /* Interface1 */ + /* 2.2.3.4 */ /*************/ + /****************/ /* */ + /* IP_2 */ + /* 2.2.3.5 */ + /*************/ + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_TCP_SOCKET socket_0; +static NX_TCP_SOCKET socket_2; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + status += nx_tcp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: Forward TCP Processing Test3.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_2, &socket_2, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_2, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_2, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&socket_2, &free_port); + + /* Check for error. */ + if ((status) || (free_port != 0x88)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&socket_2, IP_ADDRESS(1, 2, 3, 4), 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&socket_2, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&socket_2, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + nx_packet_release(my_packet); + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&socket_2, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&socket_2); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_2); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &socket_0, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 0x89, &socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&socket_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_3_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward TCP Processing Test3..............................N/A\n"); + test_control_return(3); +} +#endif + + diff --git a/test/regression/netxduo_test/netx_forward_tcp_test_4.c b/test/regression/netxduo_test/netx_forward_tcp_test_4.c new file mode 100644 index 00000000..f9fe12d1 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_tcp_test_4.c @@ -0,0 +1,476 @@ +/* This NetX test concentrates on the basic TCP operation with forward. */ + +/* Test tcp function between IP_2 and Interface1 of IP_0. */ + + /*************/ + /* */ + /* IP_1 */ + /****************/ /* 1.2.3.5 */ + /* 1.2.3.4 */ /*************/ + /* Interface0 */ + /* */ + /* IP_0 */ + /* */ + /* Interface1 */ + /* 2.2.3.4 */ /*************/ + /****************/ /* */ + /* IP_2 */ + /* 2.2.3.5 */ + /*************/ + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_TCP_SOCKET socket_0; +static NX_TCP_SOCKET socket_2; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_4_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + status += nx_tcp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: Forward TCP Processing Test4.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_2, &socket_2, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_2, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_2, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&socket_2, &free_port); + + /* Check for error. */ + if ((status) || (free_port != 0x88)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&socket_2, IP_ADDRESS(2, 2, 3, 4), 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&socket_2, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&socket_2, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + nx_packet_release(my_packet); + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&socket_2, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&socket_2); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_2); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &socket_0, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 0x89, &socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&socket_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_0); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_4_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward TCP Processing Test4..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_tcp_test_5.c b/test/regression/netxduo_test/netx_forward_tcp_test_5.c new file mode 100644 index 00000000..94ba66c4 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_tcp_test_5.c @@ -0,0 +1,476 @@ +/* This NetX test concentrates on the basic TCP operation with forward. */ + +/* Test tcp function between IP_1 and IP_2. */ + + /*************/ + /* */ + /* IP_1 */ + /****************/ /* 1.2.3.5 */ + /* 1.2.3.4 */ /*************/ + /* Interface0 */ + /* */ + /* IP_0 */ + /* */ + /* Interface1 */ + /* 2.2.3.4 */ /*************/ + /****************/ /* */ + /* IP_2 */ + /* 2.2.3.5 */ + /*************/ + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_TCP_SOCKET socket_1; +static NX_TCP_SOCKET socket_2; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_5_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + status += nx_tcp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: Forward TCP Processing Test5.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &socket_1, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_1, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_1, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&socket_1, &free_port); + + /* Check for error. */ + if ((status) || (free_port != 0x88)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&socket_1, IP_ADDRESS(2, 2, 3, 5), 0x89, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&socket_1, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&socket_1, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + nx_packet_release(my_packet); + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&socket_1, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&socket_1); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&socket_1, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_1); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_2, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_2, &socket_2, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_2, 0x89, &socket_2, 5, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&socket_2, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&socket_2, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&socket_2, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&socket_2); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_2, 0x89); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&socket_2); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_tcp_test_5_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward TCP Processing Test5..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_udp_fragment_test.c b/test/regression/netxduo_test/netx_forward_udp_fragment_test.c new file mode 100644 index 00000000..e9d67e6c --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_udp_fragment_test.c @@ -0,0 +1,497 @@ +/* This NetX test concentrates on forward fragment operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined (NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG notify_calls = 0; + +static UCHAR message[1024]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 1500 * 10); + pointer = pointer + 1500 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + + /* Enable the fragment function. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + status += nx_ip_fragment_enable(&ip_2); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: Forward UDP Fragment Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 1. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x89. */ + status = nx_udp_free_port_find(&ip_1, 0x89, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_1, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 2. */ + status = nx_udp_socket_create(&ip_2, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x8a. */ + status = nx_udp_free_port_find(&ip_2, 0x8a, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_2, 0x8a, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_2, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Clear the message. */ + memset(&message[0], 1, 1024); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &message[0], 400); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 400; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 400; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket2 information. */ + status = nx_udp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 0) || (bytes_sent != 0) || (packets_received != 1) || (bytes_received != 400)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Clear the message. */ + memset(&message[0], 1, 1024); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &message[0], 1024); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 1024; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 1024; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Get UDP socket2 information. */ + status = nx_udp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 0) || (bytes_sent != 0) || (packets_received != 2) || (bytes_received != 1424)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_2); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_2); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /***********************************************************************/ + /* Socket2 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward UDP Fragment Test.................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_udp_fragment_test2.c b/test/regression/netxduo_test/netx_forward_udp_fragment_test2.c new file mode 100644 index 00000000..bf990e23 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_udp_fragment_test2.c @@ -0,0 +1,457 @@ +/* This NetX test concentrates on the forward fragment operation(fragment failure:_nx_packet_allocate failure in nx_ip_fragment_forward_packet). */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined (NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG packet_received = NX_FALSE; +static ULONG notify_calls = 0; + +static UCHAR message[1024]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 1500 * 10); + pointer = pointer + 1500 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + + /* Enable the fragment function. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + status += nx_ip_fragment_enable(&ip_2); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; + + + /* Print out some test information banners. */ + printf("NetX Test: Forward UDP Fragment Test2................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 1. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x89. */ + status = nx_udp_free_port_find(&ip_1, 0x89, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_1, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_0.nx_ipv4_packet_receive = my_packet_process; + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Clear the message. */ + memset(&message[0], 1, 1024); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_data_append(my_packet, &message[0], 800, &pool_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((error_counter) || (packet_received != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Create a UDP socket 2. */ + status = nx_udp_socket_create(&ip_2, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x8a. */ + status = nx_udp_free_port_find(&ip_2, 0x8a, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_2, 0x8a, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_2, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket2 information. */ + status = nx_udp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 0) || (bytes_sent != 0) || (packets_received != 1) || (bytes_received != 800)) + { + error_counter++; + } +#endif + + /* Check status. */ + if ((error_counter) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +UINT i; +UINT avalibale_count; +NX_PACKET *my_packet; +NX_PACKET *tmp_packet[10]; + + + /* Update the flag. */ + packet_received = NX_TRUE; + + /* Store the packet. */ + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, &my_packet, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the available count. */ + avalibale_count = pool_0.nx_packet_pool_available; + + /* Allocate the all packets. */ + for (i = 0; i < avalibale_count; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &tmp_packet[i], NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check the status. */ + if (status) + error_counter++; + } + + /* Call the _nx_ipv4_packet_receive function directly receive this packet(forward module). */ + _nx_ipv4_packet_receive(&ip_0, packet_ptr); + + /* Check the forward fragment operation(_nx_ip_fragment_forward_packet function). */ +#ifndef NX_DISABLE_IP_INFO + if ((ip_0.nx_ip_fragment_failures != 1) || (ip_0.nx_ip_send_packets_dropped != 1) || (ip_0.nx_ip_transmit_resource_errors != 1)) + error_counter++; +#endif + + /* Check the packet available count(fragment failure, the source packet should be release). */ + if (pool_0.nx_packet_pool_available != 1) + error_counter++; + + /* Allocate the all packets. */ + for (i = 0; i < avalibale_count; i++) + { + + /* Release the packets. */ + nx_packet_release(tmp_packet[i]); + } + + /* Call the _nx_ipv4_packet_receive function directly receive the copy packet(forward module). */ + _nx_ipv4_packet_receive(&ip_0, my_packet); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward UDP Fragment Test2................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_udp_fragment_test3.c b/test/regression/netxduo_test/netx_forward_udp_fragment_test3.c new file mode 100644 index 00000000..ec2836b1 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_udp_fragment_test3.c @@ -0,0 +1,445 @@ +/* This NetX test concentrates on the forward fragment operation(fragment failure:_nx_packet_data_append failure in nx_ip_fragment_forward_packet). */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined (NX_DISABLE_FRAGMENTATION) && !defined (NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_PACKET_POOL pool_2; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG packet_received = NX_FALSE; +static ULONG notify_calls = 0; + +static UCHAR message[1024]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 256 * 10); + pointer = pointer + 256 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 1500, pointer, 1500 * 10); + pointer = pointer + 1500 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_2, "NetX Main Packet Pool", 1500, pointer, 1500 * 10); + pointer = pointer + 1500 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_2, _nx_ram_network_driver_512, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + + /* Enable the fragment function. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + status += nx_ip_fragment_enable(&ip_2); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; + + + /* Print out some test information banners. */ + printf("NetX Test: Forward UDP Fragment Test3................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 1. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x89. */ + status = nx_udp_free_port_find(&ip_1, 0x89, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_1, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_0.nx_ipv4_packet_receive = my_packet_process; + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Clear the message. */ + memset(&message[0], 1, 1024); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_data_append(my_packet, &message[0], 800, &pool_1, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((error_counter) || (packet_received != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Create a UDP socket 2. */ + status = nx_udp_socket_create(&ip_2, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x8a. */ + status = nx_udp_free_port_find(&ip_2, 0x8a, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_2, 0x8a, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_2, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket2 information. */ + status = nx_udp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 0) || (bytes_sent != 0) || (packets_received != 0) || (bytes_received != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check status. */ + if ((receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +UINT i; +UINT avalibale_count; +NX_PACKET *tmp_packet[10]; + + + /* Update the flag. */ + packet_received = NX_TRUE; + + /* Get the available count. */ + avalibale_count = pool_0.nx_packet_pool_available; + + /* Fragment packet_ptr need four packets. */ + + /* Remain two packets for fragment, one packet for nx_packet allocate, one packet for nx_packet_data_append in nx_ip_fragment_forward_packet. */ + for (i = 0; i < avalibale_count - 2; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &tmp_packet[i], 0, TX_WAIT_FOREVER); + + /* Check the status. */ + if (status) + error_counter++; + } + + /* Call the _nx_ipv4_packet_receive function directly receive the copy packet(forward module). */ + _nx_ipv4_packet_receive(&ip_0, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test3_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward UDP Fragment Test3................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_udp_fragment_test4.c b/test/regression/netxduo_test/netx_forward_udp_fragment_test4.c new file mode 100644 index 00000000..200d6e19 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_udp_fragment_test4.c @@ -0,0 +1,446 @@ +/* This NetX test concentrates on the forward fragment operation. + (fragment failure: source_packet -> nx_packet_next is null and the remaining_bytes is non zero in nx_ip_fragment_forward_packet). */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined (NX_DISABLE_FRAGMENTATION) && !defined (NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_PACKET_POOL pool_2; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG packet_received = NX_FALSE; +static UCHAR message[1024]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test4_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 256 * 10); + pointer = pointer + 256 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 1500, pointer, 1500 * 10); + pointer = pointer + 1500 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_2, "NetX Main Packet Pool", 1500, pointer, 1500 * 10); + pointer = pointer + 1500 * 10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_2, _nx_ram_network_driver_512, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; + + /* Enable the fragment function. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + status += nx_ip_fragment_enable(&ip_2); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; + + + /* Print out some test information banners. */ + printf("NetX Test: Forward UDP Fragment Test4................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 1. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x89. */ + status = nx_udp_free_port_find(&ip_1, 0x89, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_1, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_0.nx_ipv4_packet_receive = my_packet_process; + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Clear the message. */ + memset(&message[0], 1, 1024); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_data_append(my_packet, &message[0], 800, &pool_1, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((error_counter) || (packet_received != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Create a UDP socket 2. */ + status = nx_udp_socket_create(&ip_2, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x8a. */ + status = nx_udp_free_port_find(&ip_2, 0x8a, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_2, 0x8a, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_2, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket2 information. */ + status = nx_udp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 0) || (bytes_sent != 0) || (packets_received != 0) || (bytes_received != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check status. */ + if ((receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +ULONG checksum; +ULONG val; + + /* Update the flag. */ + packet_received = NX_TRUE; + + /* Discard the chain packet. */ + packet_ptr -> nx_packet_next = NX_NULL; + packet_ptr -> nx_packet_last = NX_NULL; + + /* Set the IP header. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + /* Clear the checksum. */ + ip_header_ptr -> nx_ip_header_word_2 &= 0x0000FFFF; + + /* Calcuate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, 20, NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + + /* Call the _nx_ipv4_packet_receive function directly receive the copy packet(forward module). */ + _nx_ipv4_packet_receive(&ip_0, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_fragment_test4_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward UDP Fragment Test3................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_forward_udp_test.c b/test/regression/netxduo_test/netx_forward_udp_test.c new file mode 100644 index 00000000..25b17598 --- /dev/null +++ b/test/regression/netxduo_test/netx_forward_udp_test.c @@ -0,0 +1,954 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an forward IP Instance 0. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface for forward IP Instance 0. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if (status) + error_counter++; + + /* Create an IP Instance 1. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 1. */ + status = nx_ip_gateway_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 4)); + if (status) + error_counter++; + + /* Create another IP Instance 2. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the gateway for IP Instance 2. */ + status = nx_ip_gateway_address_set(&ip_2, IP_ADDRESS(2, 2, 3, 4)); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable the forwarding function for IP Instance 0. */ + status = nx_ip_forwarding_enable(&ip_0); + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: Forward UDP Processing Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 0. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 1. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x89. */ + status = nx_udp_free_port_find(&ip_1, 0x89, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_1, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x89)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket 2. */ + status = nx_udp_socket_create(&ip_2, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x8a. */ + status = nx_udp_free_port_find(&ip_2, 0x8a, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_2, 0x8a, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_2, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x8a)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket0 sends udp packet to unknow address */ + /***********************************************************************/ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(3, 2, 3, 5), 0x89, 0); + + /* Check status. */ + if (status) + { + nx_packet_release(my_packet); + } + + /***********************************************************************/ + /* Socket0 sends udp packet to Socket1 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket0 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket0 by interface0 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(1, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket0 by interface1 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket1 sends udp packet to Socket2 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x8a); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 sends udp packet to Socket0 by interface0 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_2, my_packet, IP_ADDRESS(1, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 sends udp packet to Socket0 by interface1 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_2, my_packet, IP_ADDRESS(2, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 sends udp packet to Socket1 */ + /***********************************************************************/ + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_2, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Get UDP socket0 information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 3) || (bytes_sent != 3 * 28) || (packets_received != 4) || (bytes_received != 4 * 28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket1 information. */ + status = nx_udp_socket_info_get(&socket_1, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 3) || (bytes_sent != 3 * 28) || (packets_received != 2) || (bytes_received != 2 * 28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket2 information. */ + status = nx_udp_socket_info_get(&socket_2, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != 3) || (bytes_sent != 3 * 28) || (packets_received != 2) || (bytes_received != 2 * 28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_2); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_2); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + + /***********************************************************************/ + /* Socket1 receives the udp packet from Socket0 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 receives the udp packet from Socket0 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket0 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket0 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket2 receives the udp packet from Socket1 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket0 receives the udp packet from Socket2 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket0 receives the udp packet from Socket2 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************************************/ + /* Socket1 receives the udp packet from Socket2 */ + /***********************************************************************/ + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_forward_udp_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Forward UDP Processing Test...............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_http_proxy_basic_test.c b/test/regression/netxduo_test/netx_http_proxy_basic_test.c new file mode 100644 index 00000000..d9aacbf3 --- /dev/null +++ b/test/regression/netxduo_test/netx_http_proxy_basic_test.c @@ -0,0 +1,481 @@ +/* This case tests basic HTTP Proxy connection. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_HTTP_PROXY) && defined(__PRODUCT_NETXDUO__) +#include "nx_http_proxy_client.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the HTTP proxy server global variables */ +static TX_THREAD proxy_thread; +static NX_PACKET_POOL proxy_pool; +static NX_IP proxy_ip; +static NX_TCP_SOCKET agent_server, agent_client; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void thread_proxy_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_PROXY_ADDRESS IP_ADDRESS(1,2,3,6) +#define HTTP_PROXY_PORT 8888 +#define TEST_SERVER_PORT 8080 + +static UCHAR connect_200[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x43, 0x6f, 0x6e, +0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, +0x68, 0x65, 0x64, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, +0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x31, 0x2e, 0x38, 0x2e, +0x34, 0x0d, 0x0a, 0x0d, 0x0a, +}; + +static UCHAR connect_req[] = +{ +0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x3a, /* CONNECT 1.2.3.4: */ +0x38, 0x30, 0x38, 0x30, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, /* 8080 HTTP/1.1..H */ +0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x0d, 0x0a, 0x50, 0x72, /* ost: 1.2.3.4..Pr */ +0x6f, 0x78, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* oxy-authorizatio */ +0x6e, 0x3a, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x64, 0x58, 0x4e, 0x6c, 0x63, 0x6a, 0x70, /* n: Basic dXNlcjp */ +0x77, 0x59, 0x58, 0x4e, 0x7a, 0x64, 0x32, 0x39, 0x79, 0x5a, 0x41, 0x3d, 0x3d, 0x0d, 0x0a, 0x0d, /* wYXNzd29yZA==... */ +0x0a +}; + +static UCHAR test_data[] = "HTTP Proxy Basic Test!"; + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Proxy thread. */ + status = tx_thread_create(&proxy_thread, "HTTP Proxy", thread_proxy_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&proxy_pool, "HTTP Proxy Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&proxy_ip, "HTTP Proxy IP", HTTP_PROXY_ADDRESS, + 0xFFFFFF00UL, &proxy_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&proxy_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&proxy_ip); + if (status) + error_counter++; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS proxy_server_address; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + proxy_server_address.nxd_ip_version = NX_IP_VERSION_V4; + proxy_server_address.nxd_ip_address.v4 = HTTP_PROXY_ADDRESS; + + status = nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, NX_NULL, 1, "password", sizeof("password") - 1); + if (status != NX_PTR_ERROR) + error_counter++; + + status = nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, NX_NULL, 1); + if (status != NX_PTR_ERROR) + error_counter++; + + status = nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", NX_HTTP_PROXY_MAX_USERNAME + 1, "password", sizeof("password") - 1); + if (status != NX_SIZE_ERROR) + error_counter++; + + status = nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", NX_HTTP_PROXY_MAX_PASSWORD + 1); + if (status != NX_SIZE_ERROR) + error_counter++; + + status = nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", sizeof("password") - 1); + if(status) + error_counter++; + + status = nx_tcp_socket_create(&client_ip, &test_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for ( i = 0 ; i < TEST_LOOP; i++) + { + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, test_data, sizeof(test_data) - 1, &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&test_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the echo data from server. */ + status = nx_tcp_socket_receive(&test_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + /* Check the received data. */ + if ((packet_ptr -> nx_packet_length != (sizeof(test_data) - 1)) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, test_data, packet_ptr -> nx_packet_length) != 0)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Set the flag. */ + test_client_stop = 1; + nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); +} + +void thread_proxy_entry(ULONG thread_input) +{ +UINT i, status; +ULONG actual_status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&proxy_ip, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&proxy_ip, &agent_server, "Agent Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&proxy_ip, &agent_client, "Agent Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&proxy_ip, HTTP_PROXY_PORT, &agent_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Connect to the test server. */ + status = nx_tcp_client_socket_bind(&agent_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + status += nxd_tcp_client_socket_connect(&agent_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_200, sizeof(connect_200), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Tunneling... */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_receive(&agent_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + nx_tcp_socket_disconnect(&agent_client, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&agent_client); + } + + nx_tcp_socket_delete(&agent_server); + nx_tcp_socket_delete(&agent_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Basic Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Echo data. */ + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + while(!test_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + test_server_start = 0; + test_client_stop = 0; + + nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&test_server); + nx_tcp_server_socket_relisten(&server_ip, TEST_SERVER_PORT, &test_server); + } + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Basic Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_http_proxy_data_fin_test.c b/test/regression/netxduo_test/netx_http_proxy_data_fin_test.c new file mode 100644 index 00000000..6a418666 --- /dev/null +++ b/test/regression/netxduo_test/netx_http_proxy_data_fin_test.c @@ -0,0 +1,589 @@ +/* This case tests: +1. TCP connection failed with HTTP Proxy server. +2. Processing CONNECT response with FIN set. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_HTTP_PROXY) && !defined(NX_DISABLE_EXTENDED_NOTIFY_SUPPORT) && defined(__PRODUCT_NETXDUO__) +#include "nx_http_proxy_client.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the HTTP proxy server global variables */ +static TX_THREAD proxy_thread; +static NX_PACKET_POOL proxy_pool; +static NX_IP proxy_ip; +static NX_TCP_SOCKET agent_server, agent_client; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void thread_proxy_entry(ULONG thread_input); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_PROXY_ADDRESS IP_ADDRESS(1,2,3,6) +#define HTTP_PROXY_PORT 8888 +#define TEST_SERVER_PORT 8080 + +static UCHAR connect_200[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x43, 0x6f, 0x6e, /* HTTP/1.0 200 Con */ +0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, /* nection establis */ +0x68, 0x65, 0x64, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, /* hed..Proxy-agent */ +0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x31, 0x2e, 0x38, 0x2e, /* : tinyproxy/1.8. */ +0x34, 0x0d, 0x0a, 0x0d, 0x0a, /* 4.... */ +}; + +static UCHAR connect_req[] = +{ +0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x3a, /* CONNECT 1.2.3.4: */ +0x38, 0x30, 0x38, 0x30, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, /* 8080 HTTP/1.1..H */ +0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x0d, 0x0a, 0x50, 0x72, /* ost: 1.2.3.4..Pr */ +0x6f, 0x78, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* oxy-authorizatio */ +0x6e, 0x3a, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x64, 0x58, 0x4e, 0x6c, 0x63, 0x6a, 0x70, /* n: Basic dXNlcjp */ +0x77, 0x59, 0x58, 0x4e, 0x7a, 0x64, 0x32, 0x39, 0x79, 0x5a, 0x41, 0x3d, 0x3d, 0x0d, 0x0a, 0x0d, /* wYXNzd29yZA==... */ +0x0a +}; + +static UCHAR connect_403[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x33, 0x20, 0x41, 0x63, 0x63, /* HTTP/1.0 403 Acc */ +0x65, 0x73, 0x73, 0x20, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0d, 0x0a, 0x53, /* ess violation..S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, /* erver: tinyproxy */ +0x2f, 0x31, 0x2e, 0x38, 0x2e, 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* /1.8.4..Content- */ +0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, /* Type: text/html. */ +0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, /* .Connection: clo */ +0x73, 0x65, 0x0d, 0x0a, 0x0d, 0x0a, /* se.... */ +}; + +static UCHAR test_data[] = "HTTP Proxy Basic Test!"; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_data_fin_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Proxy thread. */ + status = tx_thread_create(&proxy_thread, "HTTP Proxy", thread_proxy_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&proxy_pool, "HTTP Proxy Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&proxy_ip, "HTTP Proxy IP", HTTP_PROXY_ADDRESS, + 0xFFFFFF00UL, &proxy_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&proxy_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&proxy_ip); + if (status) + error_counter++; +} + +static UINT connected = NX_FALSE; +static UINT disconnected = NX_FALSE; +static void test_establish_notify(NX_TCP_SOCKET *socekt_ptr) +{ + connected = NX_TRUE; +} + +static void test_disconnect_callback(NX_TCP_SOCKET *socekt_ptr) +{ + disconnected = NX_TRUE; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +NXD_ADDRESS proxy_server_address; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + proxy_server_address.nxd_ip_version = NX_IP_VERSION_V4; + proxy_server_address.nxd_ip_address.v4 = HTTP_PROXY_ADDRESS; + nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", sizeof("password") - 1); + + status = nx_tcp_socket_create(&client_ip, &test_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, test_disconnect_callback); + if(status) + error_counter++; + + nx_tcp_socket_establish_notify(&test_client, test_establish_notify); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + connected = NX_FALSE; + disconnected = NX_FALSE; + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + + /* Server not started. */ + if (!status || (connected == NX_TRUE) || (disconnected == NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + /* Resume the HTTP Proxy server. */ + tx_thread_resume(&proxy_thread); + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + + /* Error response with FIN set. */ + if (!status || (connected == NX_TRUE) || (disconnected == NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + + if (status || (connected != NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, test_data, sizeof(test_data) - 1, &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&test_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the echo data from server. */ + status = nx_tcp_socket_receive(&test_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + /* Check the received data. */ + if ((packet_ptr -> nx_packet_length != (sizeof(test_data) - 1)) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, test_data, packet_ptr -> nx_packet_length) != 0)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Set the flag. */ + test_client_stop = 1; + nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); +} + +void thread_proxy_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&proxy_ip, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&proxy_ip, &agent_server, "Agent Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&proxy_ip, &agent_client, "Agent Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Suspend the thread to make client connection timeout. */ + tx_thread_suspend(&proxy_thread); + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&proxy_ip, HTTP_PROXY_PORT, &agent_server, 5, NX_NULL); + if(status) + error_counter++; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + { + error_counter++; + return; + } + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Set the TCP receive function. */ + client_ip.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Send error response to test client and with FIN set. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_403, sizeof(connect_403), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + { + error_counter++; + return; + } + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Connect to the test server. */ + status = nx_tcp_client_socket_bind(&agent_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + status += nxd_tcp_client_socket_connect(&agent_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_200, sizeof(connect_200), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Tunneling... */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_receive(&agent_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + nx_tcp_socket_disconnect(&agent_client, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&agent_client); + + nx_tcp_socket_delete(&agent_server); + nx_tcp_socket_delete(&agent_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Data Fin Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Echo data. */ + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + while(!test_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + test_server_start = 0; + test_client_stop = 0; + + nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&test_server); + nx_tcp_server_socket_relisten(&server_ip, TEST_SERVER_PORT, &test_server); + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +ULONG *source_ip, *dest_ip; + + /* Set the tcp header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr ->nx_packet_prepend_ptr; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Set FIN bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3 | NX_TCP_FIN_BIT; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Clear the checksum field. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum . */ + dest_ip = &test_client.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &test_client.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Clear the callback function. */ + client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_data_fin_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Data Fin Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_http_proxy_disconnect_test.c b/test/regression/netxduo_test/netx_http_proxy_disconnect_test.c new file mode 100644 index 00000000..c6fefa9f --- /dev/null +++ b/test/regression/netxduo_test/netx_http_proxy_disconnect_test.c @@ -0,0 +1,531 @@ +/* This case tests TCP disconnect before HTTP Proxy connected. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_HTTP_PROXY) && !defined(NX_DISABLE_EXTENDED_NOTIFY_SUPPORT) && defined(__PRODUCT_NETXDUO__) +#include "nx_http_proxy_client.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the HTTP proxy server global variables */ +static TX_THREAD proxy_thread; +static NX_PACKET_POOL proxy_pool; +static NX_IP proxy_ip; +static NX_TCP_SOCKET agent_server, agent_client; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void thread_proxy_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_PROXY_ADDRESS IP_ADDRESS(1,2,3,6) +#define HTTP_PROXY_PORT 8888 +#define TEST_SERVER_PORT 8080 + +static UCHAR connect_200[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x43, 0x6f, 0x6e, /* HTTP/1.0 200 Con */ +0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, /* nection establis */ +0x68, 0x65, 0x64, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, /* hed..Proxy-agent */ +0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x31, 0x2e, 0x38, 0x2e, /* : tinyproxy/1.8. */ +0x34, 0x0d, 0x0a, 0x0d, 0x0a, /* 4.... */ +}; + +static UCHAR connect_req[] = +{ +0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x3a, /* CONNECT 1.2.3.4: */ +0x38, 0x30, 0x38, 0x30, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, /* 8080 HTTP/1.1..H */ +0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x0d, 0x0a, 0x50, 0x72, /* ost: 1.2.3.4..Pr */ +0x6f, 0x78, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* oxy-authorizatio */ +0x6e, 0x3a, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x64, 0x58, 0x4e, 0x6c, 0x63, 0x6a, 0x70, /* n: Basic dXNlcjp */ +0x77, 0x59, 0x58, 0x4e, 0x7a, 0x64, 0x32, 0x39, 0x79, 0x5a, 0x41, 0x3d, 0x3d, 0x0d, 0x0a, 0x0d, /* wYXNzd29yZA==... */ +0x0a +}; + +static UCHAR test_data[] = "HTTP Proxy Basic Test!"; + +#define TEST_LOOP 2 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_disconnect_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Proxy thread. */ + status = tx_thread_create(&proxy_thread, "HTTP Proxy", thread_proxy_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&proxy_pool, "HTTP Proxy Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&proxy_ip, "HTTP Proxy IP", HTTP_PROXY_ADDRESS, + 0xFFFFFF00UL, &proxy_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&proxy_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&proxy_ip); + if (status) + error_counter++; +} + +static UINT connected = NX_FALSE; +static UINT disconnected = NX_FALSE; +static void test_establish_notify(NX_TCP_SOCKET *socekt_ptr) +{ + connected = NX_TRUE; +} + +static void test_disconnect_callback(NX_TCP_SOCKET *socekt_ptr) +{ + disconnected = NX_TRUE; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS proxy_server_address; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + proxy_server_address.nxd_ip_version = NX_IP_VERSION_V4; + proxy_server_address.nxd_ip_address.v4 = HTTP_PROXY_ADDRESS; + nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", sizeof("password") - 1); + + status = nx_tcp_socket_create(&client_ip, &test_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, test_disconnect_callback); + if(status) + error_counter++; + + nx_tcp_socket_establish_notify(&test_client, test_establish_notify); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for ( i = 0; i < TEST_LOOP; i++) + { + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + connected = NX_FALSE; + disconnected = NX_FALSE; + + if (i % 2 == 0) + { + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + status = nx_tcp_socket_state_wait(&test_client, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + } + else + { + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + } + + /* Server disconnected. */ + if (!status || (connected == NX_TRUE) || (disconnected == NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + if (i % 2 == 0) + { + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + status = nx_tcp_socket_state_wait(&test_client, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + } + else + { + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + } + + if (status || (connected != NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, test_data, sizeof(test_data) - 1, &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&test_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the echo data from server. */ + status = nx_tcp_socket_receive(&test_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + /* Check the received data. */ + if ((packet_ptr -> nx_packet_length != (sizeof(test_data) - 1)) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, test_data, packet_ptr -> nx_packet_length) != 0)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Set the flag. */ + test_client_stop = 1; + nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); +} + +void thread_proxy_entry(ULONG thread_input) +{ +UINT i, status; +ULONG actual_status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&proxy_ip, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&proxy_ip, &agent_server, "Agent Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&proxy_ip, &agent_client, "Agent Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&proxy_ip, HTTP_PROXY_PORT, &agent_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + { + error_counter++; + return; + } + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Connect to the test server. */ + status = nx_tcp_client_socket_bind(&agent_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + status += nxd_tcp_client_socket_connect(&agent_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_200, sizeof(connect_200), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Tunneling... */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_receive(&agent_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + nx_tcp_socket_disconnect(&agent_client, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&agent_client); + } + + nx_tcp_socket_delete(&agent_server); + nx_tcp_socket_delete(&agent_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Disconnect Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Echo data. */ + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + while(!test_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + test_server_start = 0; + test_client_stop = 0; + + nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&test_server); + nx_tcp_server_socket_relisten(&server_ip, TEST_SERVER_PORT, &test_server); + } + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Disconnect Test................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_http_proxy_error_response_test.c b/test/regression/netxduo_test/netx_http_proxy_error_response_test.c new file mode 100644 index 00000000..991a84ae --- /dev/null +++ b/test/regression/netxduo_test/netx_http_proxy_error_response_test.c @@ -0,0 +1,545 @@ +/* This case tests HTTP Proxy error response. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_HTTP_PROXY) && !defined(NX_DISABLE_EXTENDED_NOTIFY_SUPPORT) && defined(__PRODUCT_NETXDUO__) +#include "nx_http_proxy_client.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the HTTP proxy server global variables */ +static TX_THREAD proxy_thread; +static NX_PACKET_POOL proxy_pool; +static NX_IP proxy_ip; +static NX_TCP_SOCKET agent_server, agent_client; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void thread_proxy_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_PROXY_ADDRESS IP_ADDRESS(1,2,3,6) +#define HTTP_PROXY_PORT 8888 +#define TEST_SERVER_PORT 8080 + +static UCHAR connect_200[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x43, 0x6f, 0x6e, /* HTTP/1.0 200 Con */ +0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, /* nection establis */ +0x68, 0x65, 0x64, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, /* hed..Proxy-agent */ +0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x31, 0x2e, 0x38, 0x2e, /* : tinyproxy/1.8. */ +0x34, 0x0d, 0x0a, 0x0d, 0x0a, /* 4.... */ +}; + +static UCHAR connect_req[] = +{ +0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x3a, /* CONNECT 1.2.3.4: */ +0x38, 0x30, 0x38, 0x30, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, /* 8080 HTTP/1.1..H */ +0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x0d, 0x0a, 0x50, 0x72, /* ost: 1.2.3.4..Pr */ +0x6f, 0x78, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* oxy-authorizatio */ +0x6e, 0x3a, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x64, 0x58, 0x4e, 0x6c, 0x63, 0x6a, 0x70, /* n: Basic dXNlcjp */ +0x77, 0x59, 0x58, 0x4e, 0x7a, 0x64, 0x32, 0x39, 0x79, 0x5a, 0x41, 0x3d, 0x3d, 0x0d, 0x0a, 0x0d, /* wYXNzd29yZA==... */ +0x0a +}; + +static UCHAR connect_403[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x33, 0x20, 0x41, 0x63, 0x63, /* HTTP/1.0 403 Acc */ +0x65, 0x73, 0x73, 0x20, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0d, 0x0a, 0x53, /* ess violation..S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, /* erver: tinyproxy */ +0x2f, 0x31, 0x2e, 0x38, 0x2e, 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* /1.8.4..Content- */ +0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, /* Type: text/html. */ +0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, /* .Connection: clo */ +0x73, 0x65, 0x0d, 0x0a, 0x0d, 0x0a, /* se.... */ +}; + +static UCHAR test_data[] = "HTTP Proxy Basic Test!"; + +#define TEST_LOOP 2 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_error_response_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Proxy thread. */ + status = tx_thread_create(&proxy_thread, "HTTP Proxy", thread_proxy_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&proxy_pool, "HTTP Proxy Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&proxy_ip, "HTTP Proxy IP", HTTP_PROXY_ADDRESS, + 0xFFFFFF00UL, &proxy_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&proxy_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&proxy_ip); + if (status) + error_counter++; +} + +static UINT connected = NX_FALSE; +static void test_establish_notify(NX_TCP_SOCKET *socekt_ptr) +{ + connected = NX_TRUE; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS proxy_server_address; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + proxy_server_address.nxd_ip_version = NX_IP_VERSION_V4; + proxy_server_address.nxd_ip_address.v4 = HTTP_PROXY_ADDRESS; + nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", sizeof("password") - 1); + + status = nx_tcp_socket_create(&client_ip, &test_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + nx_tcp_socket_establish_notify(&test_client, test_establish_notify); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for ( i = 0; i < TEST_LOOP; i++) + { + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + connected = NX_FALSE; + + if (i % 2 == 0) + { + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + status = nx_tcp_socket_state_wait(&test_client, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + } + else + { + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + } + + /* Received error response. */ + if (!status || (connected == NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + if (i % 2 == 0) + { + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + status = nx_tcp_socket_state_wait(&test_client, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + } + else + { + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + } + + if (status || (connected != NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, test_data, sizeof(test_data) - 1, &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&test_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the echo data from server. */ + status = nx_tcp_socket_receive(&test_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + /* Check the received data. */ + if ((packet_ptr -> nx_packet_length != (sizeof(test_data) - 1)) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, test_data, packet_ptr -> nx_packet_length) != 0)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Set the flag. */ + test_client_stop = 1; + nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); +} + +void thread_proxy_entry(ULONG thread_input) +{ +UINT i, status; +ULONG actual_status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&proxy_ip, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&proxy_ip, &agent_server, "Agent Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&proxy_ip, &agent_client, "Agent Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&proxy_ip, HTTP_PROXY_PORT, &agent_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send error response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_403, sizeof(connect_403), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Connect to the test server. */ + status = nx_tcp_client_socket_bind(&agent_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + status += nxd_tcp_client_socket_connect(&agent_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_200, sizeof(connect_200), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Tunneling... */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_receive(&agent_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + nx_tcp_socket_disconnect(&agent_client, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&agent_client); + } + + nx_tcp_socket_delete(&agent_server); + nx_tcp_socket_delete(&agent_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Error Response Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Echo data. */ + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + while(!test_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + test_server_start = 0; + test_client_stop = 0; + + nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&test_server); + nx_tcp_server_socket_relisten(&server_ip, TEST_SERVER_PORT, &test_server); + } + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_error_response_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Error Response Test............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_http_proxy_multiple_response_test.c b/test/regression/netxduo_test/netx_http_proxy_multiple_response_test.c new file mode 100644 index 00000000..6113afb3 --- /dev/null +++ b/test/regression/netxduo_test/netx_http_proxy_multiple_response_test.c @@ -0,0 +1,504 @@ +/* This case tests HTTP Proxy response in multiple packets. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_HTTP_PROXY) && !defined(NX_DISABLE_EXTENDED_NOTIFY_SUPPORT) && defined(__PRODUCT_NETXDUO__) +#include "nx_http_proxy_client.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the HTTP proxy server global variables */ +static TX_THREAD proxy_thread; +static NX_PACKET_POOL proxy_pool; +static NX_IP proxy_ip; +static NX_TCP_SOCKET agent_server, agent_client; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void thread_proxy_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_PROXY_ADDRESS IP_ADDRESS(1,2,3,6) +#define HTTP_PROXY_PORT 8888 +#define TEST_SERVER_PORT 8080 + +static UCHAR connect_200[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x43, 0x6f, 0x6e, +0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, +0x68, 0x65, 0x64, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, +0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x31, 0x2e, 0x38, 0x2e, +0x34, 0x0d, 0x0a, 0x0d, 0x0a, +}; + +static UCHAR connect_req[] = +{ +0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x3a, /* CONNECT 1.2.3.4: */ +0x38, 0x30, 0x38, 0x30, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, /* 8080 HTTP/1.1..H */ +0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x0d, 0x0a, 0x50, 0x72, /* ost: 1.2.3.4..Pr */ +0x6f, 0x78, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* oxy-authorizatio */ +0x6e, 0x3a, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x64, 0x58, 0x4e, 0x6c, 0x63, 0x6a, 0x70, /* n: Basic dXNlcjp */ +0x77, 0x59, 0x58, 0x4e, 0x7a, 0x64, 0x32, 0x39, 0x79, 0x5a, 0x41, 0x3d, 0x3d, 0x0d, 0x0a, 0x0d, /* wYXNzd29yZA==... */ +0x0a +}; + +static UCHAR test_data[] = "HTTP Proxy Basic Test!"; + +#define TEST_LOOP 4 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_multiple_response_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Proxy thread. */ + status = tx_thread_create(&proxy_thread, "HTTP Proxy", thread_proxy_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&proxy_pool, "HTTP Proxy Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&proxy_ip, "HTTP Proxy IP", HTTP_PROXY_ADDRESS, + 0xFFFFFF00UL, &proxy_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&proxy_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&proxy_ip); + if (status) + error_counter++; +} + +static UINT connected = NX_FALSE; +static void test_establish_notify(NX_TCP_SOCKET *socekt_ptr) +{ + connected = NX_TRUE; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS proxy_server_address; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + proxy_server_address.nxd_ip_version = NX_IP_VERSION_V4; + proxy_server_address.nxd_ip_address.v4 = HTTP_PROXY_ADDRESS; + nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", sizeof("password") - 1); + + status = nx_tcp_socket_create(&client_ip, &test_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + nx_tcp_socket_establish_notify(&test_client, test_establish_notify); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for ( i = 0 ; i < TEST_LOOP; i++) + { + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + connected = NX_FALSE; + if (i % 2 == 0) + { + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + status = nx_tcp_socket_state_wait(&test_client, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + } + else + { + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + } + + if (status || (connected != NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, test_data, sizeof(test_data) - 1, &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&test_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the echo data from server. */ + status = nx_tcp_socket_receive(&test_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + /* Check the received data. */ + if ((packet_ptr -> nx_packet_length != (sizeof(test_data) - 1)) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, test_data, packet_ptr -> nx_packet_length) != 0)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Set the flag. */ + test_client_stop = 1; + nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); +} + +void thread_proxy_entry(ULONG thread_input) +{ +UINT i, status; +ULONG actual_status; +NX_PACKET *packet_ptr, *packet_ptr_1, *packet_ptr_2; +NXD_ADDRESS server_ip_address; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&proxy_ip, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&proxy_ip, &agent_server, "Agent Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&proxy_ip, &agent_client, "Agent Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&proxy_ip, HTTP_PROXY_PORT, &agent_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Connect to the test server. */ + status = nx_tcp_client_socket_bind(&agent_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + status += nxd_tcp_client_socket_connect(&agent_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_200, 5, &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_allocate(&client_pool, &packet_ptr_1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + nx_packet_data_append(packet_ptr_1, connect_200 + 5, 15, &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr_1, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_allocate(&client_pool, &packet_ptr_2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + nx_packet_data_append(packet_ptr_2, connect_200 + 20, sizeof(connect_200) - 20, &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr_2, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Tunneling... */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_receive(&agent_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + nx_tcp_socket_disconnect(&agent_client, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&agent_client); + } + + nx_tcp_socket_delete(&agent_server); + nx_tcp_socket_delete(&agent_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Multiple Response Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Echo data. */ + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + while(!test_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + test_server_start = 0; + test_client_stop = 0; + + nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&test_server); + nx_tcp_server_socket_relisten(&server_ip, TEST_SERVER_PORT, &test_server); + } + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_multiple_response_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Multiple Response Test.........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_http_proxy_non_block_test.c b/test/regression/netxduo_test/netx_http_proxy_non_block_test.c new file mode 100644 index 00000000..0b27f3a5 --- /dev/null +++ b/test/regression/netxduo_test/netx_http_proxy_non_block_test.c @@ -0,0 +1,479 @@ +/* This case tests HTTP Proxy non-blocking connection. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_HTTP_PROXY) && !defined(NX_DISABLE_EXTENDED_NOTIFY_SUPPORT) && defined(__PRODUCT_NETXDUO__) +#include "nx_http_proxy_client.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; +static UINT error_counter; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the HTTP proxy server global variables */ +static TX_THREAD proxy_thread; +static NX_PACKET_POOL proxy_pool; +static NX_IP proxy_ip; +static NX_TCP_SOCKET agent_server, agent_client; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static void thread_proxy_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_PROXY_ADDRESS IP_ADDRESS(1,2,3,6) +#define HTTP_PROXY_PORT 8888 +#define TEST_SERVER_PORT 8080 + +static UCHAR connect_200[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x43, 0x6f, 0x6e, +0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, +0x68, 0x65, 0x64, 0x0d, 0x0a, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, +0x3a, 0x20, 0x74, 0x69, 0x6e, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x31, 0x2e, 0x38, 0x2e, +0x34, 0x0d, 0x0a, 0x0d, 0x0a, +}; + +static UCHAR connect_req[] = +{ +0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x3a, /* CONNECT 1.2.3.4: */ +0x38, 0x30, 0x38, 0x30, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x48, /* 8080 HTTP/1.1..H */ +0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x2e, 0x34, 0x0d, 0x0a, 0x50, 0x72, /* ost: 1.2.3.4..Pr */ +0x6f, 0x78, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* oxy-authorizatio */ +0x6e, 0x3a, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x64, 0x58, 0x4e, 0x6c, 0x63, 0x6a, 0x70, /* n: Basic dXNlcjp */ +0x77, 0x59, 0x58, 0x4e, 0x7a, 0x64, 0x32, 0x39, 0x79, 0x5a, 0x41, 0x3d, 0x3d, 0x0d, 0x0a, 0x0d, /* wYXNzd29yZA==... */ +0x0a +}; + +static UCHAR test_data[] = "HTTP Proxy Basic Test!"; + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_non_block_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the HTTP Proxy thread. */ + status = tx_thread_create(&proxy_thread, "HTTP Proxy", thread_proxy_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&proxy_pool, "HTTP Proxy Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&proxy_ip, "HTTP Proxy IP", HTTP_PROXY_ADDRESS, + 0xFFFFFF00UL, &proxy_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&proxy_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&proxy_ip); + if (status) + error_counter++; +} + +static UINT connected = NX_FALSE; +static void test_establish_notify(NX_TCP_SOCKET *socekt_ptr) +{ + connected = NX_TRUE; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS proxy_server_address; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + proxy_server_address.nxd_ip_version = NX_IP_VERSION_V4; + proxy_server_address.nxd_ip_address.v4 = HTTP_PROXY_ADDRESS; + nx_http_proxy_client_enable(&client_ip, &proxy_server_address, HTTP_PROXY_PORT, "user", sizeof("user") - 1, "password", sizeof("password") - 1); + + status = nx_tcp_socket_create(&client_ip, &test_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + nx_tcp_socket_establish_notify(&test_client, test_establish_notify); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for ( i = 0 ; i < TEST_LOOP; i++) + { + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + status = nx_tcp_socket_state_wait(&test_client, NX_TCP_ESTABLISHED, NX_IP_PERIODIC_RATE); + + if (status || (connected != NX_TRUE)) + { + error_counter++; + test_client_stop = 1; + return; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, test_data, sizeof(test_data) - 1, &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&test_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive the echo data from server. */ + status = nx_tcp_socket_receive(&test_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + + /* Check the received data. */ + if ((packet_ptr -> nx_packet_length != (sizeof(test_data) - 1)) || + (memcmp(packet_ptr -> nx_packet_prepend_ptr, test_data, packet_ptr -> nx_packet_length) != 0)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Set the flag. */ + test_client_stop = 1; + nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); +} + +void thread_proxy_entry(ULONG thread_input) +{ +UINT i, status; +ULONG actual_status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&proxy_ip, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&proxy_ip, &agent_server, "Agent Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&proxy_ip, &agent_client, "Agent Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&proxy_ip, HTTP_PROXY_PORT, &agent_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&agent_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive CONNECT request. */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Check the received CONNECT request. */ + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, connect_req, sizeof(connect_req)) != 0) + error_counter++; + + /* Connect to the test server. */ + status = nx_tcp_client_socket_bind(&agent_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + status += nxd_tcp_client_socket_connect(&agent_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send response to test client. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, connect_200, sizeof(connect_200), &proxy_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Tunneling... */ + status = nx_tcp_socket_receive(&agent_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_client, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_receive(&agent_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_tcp_socket_send(&agent_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnet. */ + nx_tcp_socket_disconnect(&agent_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&agent_server); + nx_tcp_server_socket_relisten(&proxy_ip, HTTP_PROXY_PORT, &agent_server); + nx_tcp_socket_disconnect(&agent_client, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&agent_client); + } + + nx_tcp_socket_delete(&agent_server); + nx_tcp_socket_delete(&agent_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Non Block Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Echo data. */ + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait client test finished. */ + while(!test_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + test_server_start = 0; + test_client_stop = 0; + + nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&test_server); + nx_tcp_server_socket_relisten(&server_ip, TEST_SERVER_PORT, &test_server); + } + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_http_proxy_non_block_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: HTTP Proxy Non Block Test.................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_icmp_branch_test.c b/test/regression/netxduo_test/netx_icmp_branch_test.c new file mode 100644 index 00000000..f1ec06b3 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_branch_test.c @@ -0,0 +1,242 @@ +/* This NetX test concentrates on the code coverage for ICMP functions, + * _nx_icmp_packet_receive.c + * _nx_icmp_cleanup.c + */ + +#include "nx_icmp.h" +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_branch_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable UDP processing for IP instance. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Enable ICMP processing for IP instance. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +#ifndef NX_ENABLE_ICMP_ADDRESS_CHECK +ULONG system_state; +#endif /* NX_ENABLE_ICMP_ADDRESS_CHECK */ +#if !defined(NX_ENABLE_ICMP_ADDRESS_CHECK) || defined(__PRODUCT_NETXDUO__) +NX_PACKET *my_packet[2]; +#endif /* !defined(NX_ENABLE_ICMP_ADDRESS_CHECK) || defined(__PRODUCT_NETXDUO__) */ +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header_ptr; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Print out some test information banners. */ + printf("NetX Test: ICMP Branch Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + +#ifndef NX_ENABLE_ICMP_ADDRESS_CHECK + /* Hit condition of if ((_tx_thread_system_state) || (&(ip_ptr -> nx_ip_thread) != _tx_thread_current_ptr)) in _nx_icmp_packet_receive(). */ + tx_mutex_get(&(ip_0.nx_ip_protection), TX_WAIT_FOREVER); + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], "abcdefghijklmnopqrstuvwxyz", 26, &pool_0, NX_NO_WAIT); + + system_state = _tx_thread_system_state; + _tx_thread_system_state = 0; + + _nx_icmp_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_icmp_queue_head = NX_NULL; + + _tx_thread_system_state = system_state; + nx_packet_release(my_packet[0]); + + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], "abcdefghijklmnopqrstuvwxyz", 26, &pool_0, NX_NO_WAIT); + system_state = _tx_thread_system_state; + _tx_thread_system_state = 1; + + _nx_icmp_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_icmp_queue_head = NX_NULL; + + _tx_thread_system_state = system_state; + nx_packet_release(my_packet[0]); + tx_mutex_put(&(ip_0.nx_ip_protection)); +#endif /* NX_ENABLE_ICMP_ADDRESS_CHECK */ + + + /* Test _nx_icmp_cleanup(). */ + /* tx_thread_suspend_control_block is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + _nx_icmp_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* tx_thread_suspend_control_block is set to IP but tx_thread_suspend_cleanup is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &ip_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + _nx_icmp_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* tx_thread_suspend_control_block is set to IP and tx_thread_suspend_cleanup is set to suspend_cleanup, but clear the IP ID. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &ip_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + ip_0.nx_ip_id = 0; + _nx_icmp_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + ip_0.nx_ip_id = NX_IP_ID; + + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_icmpv4_send_error_message(). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr = (NX_IPV4_HEADER *)(my_packet[0] -> nx_packet_prepend_ptr); + ip_header_ptr -> nx_ip_header_destination_ip = IP_ADDRESS(224, 0, 0, 1); + _nx_icmpv4_send_error_message(&ip_0, my_packet[0], 0, 0); + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &(ip_0.nx_ip_interface[0]); + ip_header_ptr -> nx_ip_header_word_1 = NX_IP_OFFSET_MASK; + ip_header_ptr -> nx_ip_header_destination_ip = IP_ADDRESS(2, 2, 3, 0); + _nx_icmpv4_send_error_message(&ip_0, my_packet[0], 0, 0); + ip_header_ptr -> nx_ip_header_word_1 = 0; + ip_header_ptr -> nx_ip_header_destination_ip = IP_ADDRESS(1, 2, 3, 6); + ip_header_ptr -> nx_ip_header_source_ip = IP_ADDRESS(0, 0, 0, 0); + _nx_icmpv4_send_error_message(&ip_0, my_packet[0], 0, 0); + ip_header_ptr -> nx_ip_header_source_ip = IP_ADDRESS(0, 0, 0, 0); + _nx_icmpv4_send_error_message(&ip_0, my_packet[0], 0, 0); + ip_header_ptr -> nx_ip_header_source_ip = NX_IP_LOOPBACK_LAST; + _nx_icmpv4_send_error_message(&ip_0, my_packet[0], 0, 0); + ip_header_ptr -> nx_ip_header_source_ip = NX_IP_LIMITED_BROADCAST; + _nx_icmpv4_send_error_message(&ip_0, my_packet[0], 0, 0); + nx_packet_release(my_packet[0]); +#endif /* __PRODUCT_NETXDUO__ */ + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Branch Test..........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_icmp_broadcast_ping_test.c b/test/regression/netxduo_test/netx_icmp_broadcast_ping_test.c new file mode 100644 index 00000000..b2845e8f --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_broadcast_ping_test.c @@ -0,0 +1,230 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_broadcast_ping_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Broadcast Ping Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an subnet-directed broadcast. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 255), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + +#ifdef NX_ENABLE_ICMP_ADDRESS_CHECK + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Ping an limited broadcast. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(255, 255, 255, 255), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + +#ifdef NX_ENABLE_ICMP_ADDRESS_CHECK + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Enable IGMP feature. */ + status = nx_igmp_enable(&ip_0); + status += nx_igmp_enable(&ip_1); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join in multicast group. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224, 0, 0, 251)); + status += nx_igmp_multicast_join(&ip_1, IP_ADDRESS(224, 0, 0, 251)); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an multicast. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(224, 0, 0, 251), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + +#ifdef NX_ENABLE_ICMP_ADDRESS_CHECK + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_broadcast_ping_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Broadcast Ping Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_cleanup_test.c b/test/regression/netxduo_test/netx_icmp_cleanup_test.c new file mode 100644 index 00000000..31a66e72 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_cleanup_test.c @@ -0,0 +1,422 @@ +/* This NetX test concentrates on the ICMP Clean up operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#ifdef FEATURE_NX_IPV6 +#include "nx_icmpv6.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; +static TX_THREAD ntest_3; +#ifdef FEATURE_NX_IPV6 +static TX_THREAD ntest_4; +#endif +static TX_THREAD ntest_5; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +static void ntest_3_entry(ULONG thread_input); +#ifdef FEATURE_NX_IPV6 +static void ntest_4_entry(ULONG thread_input); +#endif +static void ntest_5_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS global_address; +#endif + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_3, "thread 3", ntest_3_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + +#ifdef FEATURE_NX_IPV6 + /* Create the main thread. */ + tx_thread_create(&ntest_4, "thread 4", ntest_4_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; +#endif + + /* Create the main thread. */ + tx_thread_create(&ntest_5, "thread 5", ntest_5_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for IP instances. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address.nxd_ip_version = NX_IP_VERSION_V6; + global_address.nxd_ip_address.v6[0] = 0x20010000; + global_address.nxd_ip_address.v6[1] = 0x00000000; + global_address.nxd_ip_address.v6[2] = 0x00000000; + global_address.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +#endif + + /* Resume the test thread. */ + tx_thread_resume(&ntest_0); +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Cleanup Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + tx_thread_resume(&ntest_1); + tx_thread_resume(&ntest_2); + tx_thread_resume(&ntest_3); +#ifdef FEATURE_NX_IPV6 + tx_thread_resume(&ntest_4); +#endif + tx_thread_resume(&ntest_5); + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 1 second. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 5 seconds. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_WAIT_ABORTED) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the test threads. */ + +static void ntest_2_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 4 seconds. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 4 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Abort thread 1. */ + tx_thread_wait_abort(&ntest_1); +} + +/* Define the test threads. */ + +static void ntest_3_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 3) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 3 seconds. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 3 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +#ifdef FEATURE_NX_IPV6 +/* Define the test threads. */ + +static void ntest_4_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NXD_ADDRESS dest_address; + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 4) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set destination address. */ + dest_address.nxd_ip_version = NX_IP_VERSION_V6; + dest_address.nxd_ip_address.v6[0] = 0x20010000; + dest_address.nxd_ip_address.v6[1] = 0x00000000; + dest_address.nxd_ip_address.v6[2] = 0x00000000; + dest_address.nxd_ip_address.v6[3] = 0x10000002; + + /* Ping an unknown IP address. This will timeout after 2 seconds. */ + status = nxd_icmp_ping(&ip_0, &dest_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 3) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} +#endif + +/* Define the test threads. */ + +static void ntest_5_entry(ULONG thread_input) +{ + +#ifdef FEATURE_NX_IPV6 + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 5) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + /* Check the ICMP ping suspended count. */ + if (ip_0.nx_ip_icmp_ping_suspended_count != 4) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Cleanup Test.........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_interface2_ping6_test.c b/test/regression/netxduo_test/netx_icmp_interface2_ping6_test.c new file mode 100644 index 00000000..e47d0d9e --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_interface2_ping6_test.c @@ -0,0 +1,623 @@ +/* This NetX test concentrates on the ICMP ping6 operation use second interface. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_nd_cache.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS ipv6_address_3; +static NXD_ADDRESS ipv6_address_4; +static NXD_ADDRESS ipv6_address_5; +static NXD_ADDRESS ip0_lla_1; +static NXD_ADDRESS ip0_lla_2; +static NXD_ADDRESS ip1_lla_1; +static NXD_ADDRESS ip1_lla_2; +#ifndef NX_DISABLE_LOOPBACK_INTERFACE +static NXD_ADDRESS loopback_addr; +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ +#ifdef NX_DISABLE_FRAGMENTATION +static char long_msg[700] = ""; +#endif + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +#if !defined(NX_DISABLE_IPV6_DAD) || defined(NX_DISABLE_FRAGMENTATION) +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +#endif +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT check_checksum(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +#if (NX_IPV6_NEIGHBOR_CACHE_SIZE==8) && defined(NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES) +static UINT packet_process_filter(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +#endif + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_interface2_ping6_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + ipv6_address_5.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_5.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_5.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[3] = 0x10000005; + + ip0_lla_1.nxd_ip_version = NX_IP_VERSION_V6; + ip0_lla_1.nxd_ip_address.v6[0] = 0xfe800000; + ip0_lla_1.nxd_ip_address.v6[1] = 0x0; + ip0_lla_1.nxd_ip_address.v6[2] = 0x0; + ip0_lla_1.nxd_ip_address.v6[3] = 0x1; + + ip0_lla_2.nxd_ip_version = NX_IP_VERSION_V6; + ip0_lla_2.nxd_ip_address.v6[0] = 0xfe800000; + ip0_lla_2.nxd_ip_address.v6[1] = 0x0; + ip0_lla_2.nxd_ip_address.v6[2] = 0x0; + ip0_lla_2.nxd_ip_address.v6[3] = 0x2; + + ip1_lla_1.nxd_ip_version = NX_IP_VERSION_V6; + ip1_lla_1.nxd_ip_address.v6[0] = 0xfe800000; + ip1_lla_1.nxd_ip_address.v6[1] = 0x1; + ip1_lla_1.nxd_ip_address.v6[2] = 0x0; + ip1_lla_1.nxd_ip_address.v6[3] = 0x1; + + ip1_lla_2.nxd_ip_version = NX_IP_VERSION_V6; + ip1_lla_2.nxd_ip_address.v6[0] = 0xfe800000; + ip1_lla_2.nxd_ip_address.v6[1] = 0x1; + ip1_lla_2.nxd_ip_address.v6[2] = 0x0; + ip1_lla_2.nxd_ip_address.v6[3] = 0x2; + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + loopback_addr.nxd_ip_version = NX_IP_VERSION_V6; + loopback_addr.nxd_ip_address.v6[0] = 0x0; + loopback_addr.nxd_ip_address.v6[1] = 0x0; + loopback_addr.nxd_ip_address.v6[2] = 0x0; + loopback_addr.nxd_ip_address.v6[3] = 0x1; +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + + /* Check ipv6 address set status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +#if !defined(NX_DISABLE_IPV6_DAD) || defined(NX_DISABLE_FRAGMENTATION) +TX_INTERRUPT_SAVE_AREA +#endif +UINT status = 0; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; +NX_IPV6_HEADER *ipv6_header; +UINT addr_index_1; +UINT addr_index_2; +ULONG return_value; + + /* Print out test information banner. */ + printf("NetX Test: ICMP Interface2 Ping6 Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + /* Now ping loopback address. */ + status = nxd_icmp_ping(&ip_0, &loopback_addr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Configure mapping needed and test again. */ + nx_ip_interface_address_mapping_configure(&ip_0, 0, NX_FALSE); + nx_ip_interface_address_mapping_configure(&ip_1, 0, NX_FALSE); + + /* Now ping local address. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Now ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + nx_ip_interface_address_mapping_configure(&ip_0, 0, NX_TRUE); + nx_ip_interface_address_mapping_configure(&ip_1, 0, NX_TRUE); + + /* Delete the global addresses and assign link local addresses. */ + status = nxd_ipv6_address_delete(&ip_0, 0); + status += nxd_ipv6_address_delete(&ip_1, 0); + if(status) + error_counter++; + + /* Set interfaces' address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + if(status) + error_counter++; + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_5, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now setup address 5. */ + status = nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_5, 64, NX_NULL); + if(status) + error_counter++; + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Ping address 5. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_5, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Now ping local address. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Now ping peer's address. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Now ping an IP address that does exist. */ + /* The checksum of echo reply should not be 0xFFFF. */ + packet_process_callback = check_checksum; + status = nxd_icmp_ping(&ip_0, &ipv6_address_4, "zzzNzFzHbJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + packet_process_callback = NX_NULL; + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + if ((ping_timeouts != 1) || (pings_sent != 8) || (ping_responses_received != 7)) +#else + if ((ping_timeouts != 1) || (pings_sent != 7) || (ping_responses_received != 6)) +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure the packet is received via the 2nd address on IP 0. */ + ipv6_header = (NX_IPV6_HEADER*)(my_packet -> nx_packet_ip_header); + + if(!CHECK_IPV6_ADDRESSES_SAME(ipv6_header -> nx_ip_header_destination_ip, ipv6_address_3.nxd_ip_address.v6)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + + + /* Set interfaces' address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ip0_lla_1, 10, &addr_index_1); + status += nxd_ipv6_address_set(&ip_1, 0, &ip1_lla_1, 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ip0_lla_2, 10, &addr_index_2); + status += nxd_ipv6_address_set(&ip_1, 1, &ip1_lla_2, 10, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IPV6_DAD + /* Disable interrupts. */ + TX_DISABLE + + /* Hook link driver to check packets. */ + packet_process_callback = packet_process; + + /* Send ICMPv6 packet before address is valid. */ + nxd_icmp_interface_ping(&ip_0, &ip1_lla_2, addr_index_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + packet_process_callback = NX_NULL; + + /* Restore previous interrupt posture. */ + TX_RESTORE + + /* Check whether ICMPv6 echo request is sent out. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Send a ping to ip1_lla_2, via ip0_lla_2.*/ + status = nxd_icmp_interface_ping(&ip_0, &ip1_lla_2, addr_index_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, TX_TIMER_TICKS_PER_SECOND); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify that we receive the ping response via addr_3 */ + ipv6_header = (NX_IPV6_HEADER*)(my_packet -> nx_packet_ip_header); + if(!CHECK_IPV6_ADDRESSES_SAME(ipv6_header -> nx_ip_header_destination_ip, ip0_lla_2.nxd_ip_address.v6)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Set link status from up to down. */ + nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_DISABLE, 0, &return_value); + nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_DISABLE, 1, &return_value); + + /* Send a ping to ip1_lla_2.*/ + status = nxd_icmp_ping(&ip_0, &ip1_lla_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, TX_TIMER_TICKS_PER_SECOND); + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link status from down to up. */ + nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_ENABLE, 0, &return_value); + nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_ENABLE, 1, &return_value); + +#ifdef NX_DISABLE_FRAGMENTATION + + /* Disable interrupts. */ + TX_DISABLE + + /* Hook link driver to check packets. */ + packet_process_callback = packet_process; + + /* Send ICMPv6 packet larger than MTU. */ + nxd_icmp_interface_ping(&ip_0, &ip1_lla_2, addr_index_2, long_msg, 600, &my_packet, NX_NO_WAIT); + + packet_process_callback = NX_NULL; + + /* Restore previous interrupt posture. */ + TX_RESTORE + + /* Check whether ICMPv6 echo request is sent out. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_FRAGMENTATION */ + +#if 0 +#if (NX_IPV6_DESTINATION_TABLE_SIZE==8) + /* Seven destination tables are used. Ping needs two more destination tables. Ping should not success. */ + status = nxd_icmp_interface_ping(&ip_0, &ip1_lla_1, addr_index_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#if (NX_IPV6_NEIGHBOR_CACHE_SIZE==8) && defined(NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES) && (NX_IPV6_DESTINATION_TABLE_SIZE>8) + /* Seven nd caches are used. nd cache of ip0_lla_2 is poluted. Ping needs two more destination tables. Ping should not success. */ + packet_process_callback = packet_process_filter; + status = nxd_icmp_interface_ping(&ip_0, &ip1_lla_1, addr_index_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif +#endif + + printf("SUCCESS!\n"); + test_control_return(0); + + +} + + +static UINT check_checksum(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV6_HEADER *ip_header_ptr; +ULONG protocol; +NX_ICMPV6_HEADER *icmp_header_ptr; + + /* Ignore packet that is not ICMP. */ + if(packet_ptr -> nx_packet_length < (sizeof(NX_IPV6_HEADER) + sizeof(NX_ICMPV6_HEADER))) + return NX_TRUE; + + ip_header_ptr = (NX_IPV6_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + protocol = (ip_header_ptr -> nx_ip_header_word_1 >> 8) & 0xFF; + if(protocol == NX_PROTOCOL_ICMPV6) + { + + /* Get ICMP header. */ + icmp_header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)); + if((icmp_header_ptr -> nx_icmpv6_header_checksum) == 0xFFFF) + error_counter++; + } + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); +} + + +#if !defined(NX_DISABLE_IPV6_DAD) || defined(NX_DISABLE_FRAGMENTATION) +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + /* In this case, ICMPv6 echo request is sent out. */ + error_counter++; + return NX_TRUE; +} +#endif + +#if (NX_IPV6_NEIGHBOR_CACHE_SIZE==8) && defined(NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES) +static UINT packet_process_filter(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +UINT i; + + /* Continue process only when echo request is received. */ + if (packet_ptr -> nx_packet_length != 76) + return NX_TRUE; + + /* Modify ND CACHE for lla_0. */ + for (i = 0; i < NX_IPV6_NEIGHBOR_CACHE_SIZE; i++) + { + if (CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_nd_cache[i].nx_nd_cache_dest_ip, ip0_lla_2.nxd_ip_address.v6)) + { + ip_0.nx_ipv6_nd_cache[i].nx_nd_cache_dest_ip[3] = 9; + break; + } + } + + /* Modify destination table for lla_0. */ + for (i = 0; i < NX_IPV6_DESTINATION_TABLE_SIZE; i++) + { + + /* Skip invalid entries. */ + if (!ip_0.nx_ipv6_destination_table[i].nx_ipv6_destination_entry_valid) + continue; + + if(CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_destination_table[i].nx_ipv6_destination_entry_destination_address, ip0_lla_2.nxd_ip_address.v6)) + { + ip_0.nx_ipv6_destination_table[i].nx_ipv6_destination_entry_destination_address[3] = 9; + break; + } + } + + packet_process_callback = NX_NULL; + return NX_TRUE; +} +#endif + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_interface2_ping6_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Interface2 Ping6 Test................................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmp_interface2_ping_test.c b/test/regression/netxduo_test/netx_icmp_interface2_ping_test.c new file mode 100644 index 00000000..0f1f2e3b --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_interface2_ping_test.c @@ -0,0 +1,206 @@ +/* This NetX test concentrates on the ICMP ping operation use second interface. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_interface2_ping_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#endif /* __PRODUCT_NETXDUO__ */ + + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Interface2 Ping Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Set the address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(2, 2, 3, 5); + + /* Now ping an IP address that does exist using unreachable interface. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status == NX_SUCCESS) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO +#ifdef __PRODUCT_NETXDUO__ + if ((ping_timeouts != 2) || (pings_sent != 3) || (ping_responses_received != 1)) +#else + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) +#endif /* __PRODUCT_NETXDUO__ */ + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_interface2_ping_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: ICMP Interface2 Ping Test.................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_invalid_echo_reply_test.c b/test/regression/netxduo_test/netx_icmp_invalid_echo_reply_test.c new file mode 100644 index 00000000..2776be08 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_invalid_echo_reply_test.c @@ -0,0 +1,159 @@ +/* This NetX test concentrates on processing an echo reply without sequence match. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_ICMP_INFO) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* ICMP packet. + * src: 1.2.3.5 + * dst: 1.2.3.4 */ +static char icmp_pkt[] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0x20, 0x0b, /* ..s)_f . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x00, /* ..E...E. */ +0x00, 0x3c, 0x2b, 0x25, 0x00, 0x00, 0xff, 0x01, /* .<+%.... */ +0x88, 0x8f, 0x01, 0x02, 0x03, 0x05, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x00, 0x00, 0x55, 0x5a, 0x00, 0x01, /* ....UZ.. */ +0x00, 0x01, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* ..abcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69 /* hi */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_invalid_echo_reply_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing. */ + status = nx_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Invalid Echo Reply Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject Echo Reply packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &icmp_pkt[14], sizeof(icmp_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(icmp_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the Echo Reply packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if ((ip_0.nx_ip_ping_responses_received != 1) || + (ip_0.nx_ip_icmp_invalid_packets != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_invalid_echo_reply_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ICMP Invalid Echo Reply Test..............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_ICMP_INFO */ diff --git a/test/regression/netxduo_test/netx_icmp_invalid_source_test.c b/test/regression/netxduo_test/netx_icmp_invalid_source_test.c new file mode 100644 index 00000000..bf6abab2 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_invalid_source_test.c @@ -0,0 +1,160 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_SOURCE_ADDRESS_CHECK) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_invalid_source_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 0, 1), 0xFFFFFFFCUL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(192, 168, 0, 3), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Invalid Source Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping from IP_0 to IP_1. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(192, 168, 0, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) + { + nx_packet_release(my_packet); + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping from IP_1 to IP_0. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(192, 168, 0, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) + { + nx_packet_release(my_packet); + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_invalid_source_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: ICMP Invalid Source Test..................................N/A\n"); + test_control_return(3); +} +#endif /* NX_ENABLE_SOURCE_ADDRESS_CHECK */ diff --git a/test/regression/netxduo_test/netx_icmp_loopback_fail_test.c b/test/regression/netxduo_test/netx_icmp_loopback_fail_test.c new file mode 100644 index 00000000..6558b216 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_loopback_fail_test.c @@ -0,0 +1,158 @@ +/* This NetX test concentrates on the ICMP ping through loopback interface. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_LOOPBACK_INTERFACE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_loopback_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for IP_0. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *first_packet; +NX_PACKET *second_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Loopback Fail Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure only two packets are available in the pool. */ + if (pool_0.nx_packet_pool_available != 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping IPv4 loopback address. */ + status = nx_icmp_ping(&ip_0, NX_IP_LOOPBACK_FIRST + 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &first_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (first_packet == NX_NULL) || (first_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure only one packet is available in the pool since first_packet is not released. */ + /* Now ping IPv4 loopback address. */ + status = nx_icmp_ping(&ip_0, NX_IP_LOOPBACK_FIRST + 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &second_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IP_INFO + if (ip_0.nx_ip_send_packets_dropped != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_IP_INFO */ + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_loopback_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ICMP Loopback Fail Test...................................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ diff --git a/test/regression/netxduo_test/netx_icmp_loopback_test.c b/test/regression/netxduo_test/netx_icmp_loopback_test.c new file mode 100644 index 00000000..8a9a770f --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_loopback_test.c @@ -0,0 +1,171 @@ +/* This NetX test concentrates on the ICMP ping through loopback interface. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_LOOPBACK_INTERFACE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NXD_ADDRESS address_lo; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +#endif /* FEATURE_NX_IPV6 */ + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status = nxd_ipv6_enable(&ip_0); + + /* Set global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + + /* Check for errors. */ + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ + + /* Set loopback address. */ + address_lo.nxd_ip_version = NX_IP_VERSION_V4; + address_lo.nxd_ip_address.v4 = IP_ADDRESS(127, 0, 0, 1); +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Loopback Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping IPv4 loopback address. */ + status = nxd_icmp_source_ping(&ip_0, &address_lo, NX_LOOPBACK_INTERFACE, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Wait for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Now ping IPv6 address through loopback interface. */ + status = nxd_icmp_source_ping(&ip_0, &address_0, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ICMP Loopback Test........................................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ diff --git a/test/regression/netxduo_test/netx_icmp_loopback_test2.c b/test/regression/netxduo_test/netx_icmp_loopback_test2.c new file mode 100644 index 00000000..93441e08 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_loopback_test2.c @@ -0,0 +1,178 @@ +/* This NetX test concentrates on the ICMP ping through all kinds of IPv4 loopback addresses. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_LOOPBACK_INTERFACE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_ENABLE_ICMP_ADDRESS_CHECK) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_loopback_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for IP_0. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG addr; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Loopback Test 2......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test loopback address between 127.0.0.1 and 127.255.255.255. The step is a random value less than 0x1000. */ + for (addr = NX_IP_LOOPBACK_FIRST; addr <= NX_IP_LOOPBACK_LAST; addr += (NX_RAND() & 0xFFF) + 1) + { + + /* Now ping IPv4 loopback address. */ + status = nx_icmp_ping(&ip_0, addr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + /* Now ping IPv4 interface address with address mapping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + + /* Disable address mapping. */ + status = nx_ip_interface_address_mapping_configure(&ip_0, 0, NX_FALSE); + + /* Check error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping IPv4 interface address without address mapping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_loopback_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ICMP Loopback Test 2......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_multiple_ping6_test1.c b/test/regression/netxduo_test/netx_icmp_multiple_ping6_test1.c new file mode 100644 index 00000000..81c17300 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_multiple_ping6_test1.c @@ -0,0 +1,289 @@ +/* This NetX test concentrates on the ICMPv6 ping operation. */ +/* + thread 0 send ICMPv6 Echo Request to the existent IP address IP_ADDRESS(1, 2, 3, 5), + thread 1 send ICMPv6 Echo Request to the nonexistent IP address IP_ADDRESS(1, 2, 3, 7), + Delay the ICMPv6 Echo Reply in driver, let thread 0 receive the ICMPv6 Echo Reply after thread 1 send ICMPv6 Echo Request. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; +static NXD_ADDRESS destination_address; +static UINT icmpv6_request_counter; +static UINT icmpv6_reply_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping6_test1_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + icmpv6_request_counter = 0; + icmpv6_reply_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Resume test thread. */ + tx_thread_resume(&ntest_0); +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping6 Test1................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + tx_thread_resume(&ntest_1); + + /* Let driver delay the echo reply for 1 second. */ + advanced_packet_process_callback = packet_process; + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000002; + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 3 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status) || (my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 1 run. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check the error counter. */ + if ((error_counter) || (icmpv6_request_counter != 1) || (icmpv6_reply_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000003; + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) + { + error_counter++; + } +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Packet length: 40(IPv6) + 8(ICMPv6) + 28(data). */ + if ((ip_ptr == &ip_0) && + (packet_ptr -> nx_packet_length == 76) && + (*(packet_ptr -> nx_packet_prepend_ptr + 40) == NX_ICMPV6_ECHO_REQUEST_TYPE)) + { + + /* Updated the icmpv6_request_counter. */ + icmpv6_request_counter ++; + } + + /* Packet length: 40(IPv6) + 8(ICMPv6) + 28(data). */ + if ((ip_ptr == &ip_1) && + (packet_ptr -> nx_packet_length == 76) && + (*(packet_ptr -> nx_packet_prepend_ptr + 40) == NX_ICMPV6_ECHO_REPLY_TYPE)) + { + + /* Updated the icmpv6_request_counter. */ + icmpv6_reply_counter ++; + + /* Delay the first ICMPv6 Echo Reply. */ + if (icmpv6_reply_counter == 1) + { + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping6_test1_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping6 Test1.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_multiple_ping6_test2.c b/test/regression/netxduo_test/netx_icmp_multiple_ping6_test2.c new file mode 100644 index 00000000..bc6b7703 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_multiple_ping6_test2.c @@ -0,0 +1,277 @@ +/* This NetX test concentrates on the ICMPv6 ping operation. */ +/* + thread 0 send ICMPv6 Echo Request to the existent IP address IP_ADDRESS(1, 2, 3, 5), + thread 1 send ICMPv6 Echo Request to the existent IP address IP_ADDRESS(1, 2, 3, 5), + Delay the first ICMPv6 Echo Reply in driver, let thread 1 first receive the ICMPv6 Echo Reply before thread 0 receive the ICMPv6 Echo Reply. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; +static UINT icmpv6_request_counter; +static UINT icmpv6_reply_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping6_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + icmpv6_request_counter = 0; + icmpv6_reply_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Resume test thread. */ + tx_thread_resume(&ntest_0); +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping6 Test2................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + tx_thread_resume(&ntest_1); + + /* Let driver delay the echo reply for 1 second. */ + advanced_packet_process_callback = packet_process; + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 3 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status) || (my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 1 run. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check the error counter. */ + if ((error_counter) || (icmpv6_request_counter != 2) || (icmpv6_reply_counter != 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Ping an exist IP address. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status) || (my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28))) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Packet length: 40(IPv6) + 8(ICMPv6) + 28(data). */ + if ((ip_ptr == &ip_0) && + (packet_ptr -> nx_packet_length == 76) && + (*(packet_ptr -> nx_packet_prepend_ptr + 40) == NX_ICMPV6_ECHO_REQUEST_TYPE)) + { + + /* Updated the icmpv6_request_counter. */ + icmpv6_request_counter ++; + } + + /* Packet length: 40(IPv6) + 8(ICMPv6) + 28(data). */ + if ((ip_ptr == &ip_1) && + (packet_ptr -> nx_packet_length == 76) && + (*(packet_ptr -> nx_packet_prepend_ptr + 40) == NX_ICMPV6_ECHO_REPLY_TYPE)) + { + + /* Updated the icmpv6_request_counter. */ + icmpv6_reply_counter ++; + + /* Delay the first ICMPv6 Echo Reply. */ + if (icmpv6_reply_counter == 1) + { + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping6_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping6 Test2.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_multiple_ping_test1.c b/test/regression/netxduo_test/netx_icmp_multiple_ping_test1.c new file mode 100644 index 00000000..d89eebfa --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_multiple_ping_test1.c @@ -0,0 +1,244 @@ +/* This NetX test concentrates on the ICMP ping operation. */ +/* + thread 0 send ICMP Echo Request to the existent IP address IP_ADDRESS(1, 2, 3, 5), + thread 1 send ICMP Echo Request to the nonexistent IP address IP_ADDRESS(1, 2, 3, 7), + Delay the ICMP Echo Reply in driver, let thread 0 receive the ICMP Echo Reply after thread 1 send ICMP Echo Request. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT icmp_request_counter; +static UINT icmp_reply_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping_test1_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + icmp_request_counter = 0; + icmp_reply_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping Test1.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver delay the echo reply for 1 second. */ + advanced_packet_process_callback = packet_process; + + /* Ping an IP address. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 3 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status) || (my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 1 run. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check the error counter. */ + if ((error_counter) || (icmp_request_counter != 1) || (icmp_reply_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) + { + error_counter++; + } +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Packet length: 20(IP) + 8(ICMP) + 28(data). */ + if ((ip_ptr == &ip_0) && + (packet_ptr -> nx_packet_length == 56) && + (*(packet_ptr -> nx_packet_prepend_ptr + 20) == NX_ICMP_ECHO_REQUEST_TYPE)) + { + + /* Updated the icmp_request_counter. */ + icmp_request_counter ++; + } + + /* Packet length: 20(IP) + 8(ICMP) + 28(data). */ + if ((ip_ptr == &ip_1) && + (packet_ptr -> nx_packet_length == 56) && + (*(packet_ptr -> nx_packet_prepend_ptr + 20) == NX_ICMP_ECHO_REPLY_TYPE)) + { + + /* Updated the icmp_request_counter. */ + icmp_reply_counter ++; + + /* Delay the first ICMP Echo Reply. */ + if (icmp_reply_counter == 1) + { + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping_test1_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping Test1..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_multiple_ping_test2.c b/test/regression/netxduo_test/netx_icmp_multiple_ping_test2.c new file mode 100644 index 00000000..6e555b6c --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_multiple_ping_test2.c @@ -0,0 +1,244 @@ +/* This NetX test concentrates on the ICMP ping operation. */ +/* + thread 0 send ICMP Echo Request to the existent IP address IP_ADDRESS(1, 2, 3, 5), + thread 1 send ICMP Echo Request to the existent IP address IP_ADDRESS(1, 2, 3, 5), + Delay the first ICMP Echo Reply in driver, let thread 1 first receive the ICMP Echo Reply before thread 0 receive the ICMP Echo Reply. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT icmp_request_counter; +static UINT icmp_reply_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + icmp_request_counter = 0; + icmp_reply_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping Test2.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver delay the echo reply for 1 second. */ + advanced_packet_process_callback = packet_process; + + /* Ping an IP address. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 3 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status) || (my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the error counter. */ + if ((error_counter) || (icmp_request_counter != 2) || (icmp_reply_counter != 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status) || (my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28))) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Packet length: 20(IP) + 8(ICMP) + 28(data). */ + if ((ip_ptr == &ip_0) && + (packet_ptr -> nx_packet_length == 56) && + (*(packet_ptr -> nx_packet_prepend_ptr + 20) == NX_ICMP_ECHO_REQUEST_TYPE)) + { + + /* Updated the icmp_request_counter. */ + icmp_request_counter ++; + } + + /* Packet length: 20(IP) + 8(ICMP) + 28(data). */ + if ((ip_ptr == &ip_1) && + (packet_ptr -> nx_packet_length == 56) && + (*(packet_ptr -> nx_packet_prepend_ptr + 20) == NX_ICMP_ECHO_REPLY_TYPE)) + { + + /* Updated the icmp_request_counter. */ + icmp_reply_counter ++; + + /* Delay the first ICMP Echo Reply. */ + if (icmp_reply_counter == 1) + { + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_multiple_ping_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Multiple Ping Test2..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_nxe_api_test.c b/test/regression/netxduo_test/netx_icmp_nxe_api_test.c new file mode 100644 index 00000000..7b61c340 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_nxe_api_test.c @@ -0,0 +1,670 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#endif /* FEATURE_NX_IPV6 */ + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef FEATURE_NX_IPV6 +static void icmpv6_ra_flag_callback(NX_IP *ip_ptr, UINT ra_flag); +#endif + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS ipv6_address; +#endif + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x10000001; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, NX_NULL); + + /* Check for IP create errors. */ + if (status) + error_counter++; +#endif +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet = NX_NULL; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS ip_address; +#endif + + /* Print out some test information banners. */ + printf("NetX Test: ICMP NXE API Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_icmp_enable api */ + /************************************************/ + + /* Enable the ICMP feature for NULL IP instance. */ + status = nx_icmp_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the ICMP feature for invalid IP instance. */ + status = nx_icmp_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ICMP feature for valid IP instance. */ + status = nx_icmp_enable(&ip_0); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the ICMP feature again for valid IP instance . */ + status = nx_icmp_enable(&ip_0); + + /* Check for error. */ + if (status != NX_ALREADY_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_icmp_info_get api */ + /************************************************/ + + /* Get the ICMP information for NULL IP instance. */ + status = nx_icmp_info_get(NX_NULL, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the ICMP information for invalid IP instance. */ + status = nx_icmp_info_get(&invalid_ip, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ICMP feature. */ + ip_0.nx_ip_icmp_packet_receive = NX_NULL; + + /* Get the ICMP information for invalid IP instance. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_icmp_ping api */ + /************************************************/ + + /* Send the ping information for NULL IP instance. */ + status = nx_icmp_ping(NX_NULL, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Send the ping information for invalid IP instance. */ + status = nx_icmp_ping(&invalid_ip, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ping information for valid IP instance with NULL packet pointer. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, NX_NULL, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Send the ping information for valid IP instance with invalid address. */ + status = nx_icmp_ping(&ip_0, NX_NULL, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ICMP feature. */ + ip_0.nx_ip_icmp_packet_receive = NX_NULL; + + /* Send the ping information for valid IP instance with disable ICMP feature. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + + /************************************************/ + /* Tested the nxde_icmp_enable api */ + /************************************************/ + + /* Enable the ICMPv6 feature for NULL IP instance. */ + status = nxd_icmp_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the ICMPv6 feature for invalid IP instance. */ + status = nxd_icmp_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_icmp_ping api */ + /************************************************/ + + /* Set the address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Send the ping information for NULL IP instance. */ + status = nxd_icmp_ping(NX_NULL, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Send the ping information for invalid IP instance. */ + status = nxd_icmp_ping(&invalid_ip, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ping information for valid IP instance with NULL packet pointer. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, NX_NULL, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ping information for valid IP instance with invalid address. */ + status = nxd_icmp_ping(&ip_0, NX_NULL, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the wrong address version. */ + ip_address.nxd_ip_version = 0x80; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Send the ping information for valid IP instance with invalid address. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the address . */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Disable the ICMPv4 feature. */ + ip_0.nx_ip_icmpv4_packet_process = NX_NULL; + + /* Send the ping information, valid IP instance, valid address and disable ICMPv4 feature. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the address . */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010000; + ip_address.nxd_ip_address.v6[1] = 0x00000000; + ip_address.nxd_ip_address.v6[2] = 0x00000000; + ip_address.nxd_ip_address.v6[3] = 0x00000001; + + /* Disable the ICMPv6 feature. */ + ip_0.nx_ip_icmpv6_packet_process = NX_NULL; + + /* Send the ping information, valid IP instance, valid address and disable ICMPv6 feature. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_icmpv6_packet_process = _nx_icmpv6_packet_process; + + /* Disable the IPv6 feature. */ + ip_0.nx_ipv6_packet_receive = NX_NULL; + + /* Send the ping information, valid IP instance, valid address and disable ICMPv6 feature. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ipv6_packet_receive = _nx_ipv6_packet_receive; + + /************************************************/ + /* Tested the nxde_icmp_source_ping api */ + /************************************************/ + + /* Set the address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Send the ping information for NULL IP instance. */ + status = nxd_icmp_source_ping(NX_NULL, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Send the ping information for invalid IP instance. */ + status = nxd_icmp_source_ping(&invalid_ip, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ping information for valid IP instance with NULL packet pointer. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, NX_NULL, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ping information for valid IP instance with invalid address. */ + status = nxd_icmp_source_ping(&ip_0, NX_NULL, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the wrong address version. */ + ip_address.nxd_ip_version = 0x80; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Send the ping information for valid IP instance with invalid address. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the address . */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Send the ping information, valid IP instance, valid address and valid interface index. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, NX_MAX_IP_INTERFACES, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the ICMPv4 feature. */ + ip_0.nx_ip_icmpv4_packet_process = NX_NULL; + + /* Send the ping information, valid IP instance, valid address and disable ICMPv4 feature. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the address . */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010000; + ip_address.nxd_ip_address.v6[1] = 0x00000000; + ip_address.nxd_ip_address.v6[2] = 0x00000000; + ip_address.nxd_ip_address.v6[3] = 0x00000001; + + /* Send the ping information, valid IP instance, valid address and invalid address index. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, NX_MAX_IPV6_ADDRESSES + NX_LOOPBACK_IPV6_ENABLED, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ping information, valid IP instance, valid address and invalid address attached interface. */ + ip_0.nx_ipv6_address[0].nxd_ipv6_address_attached = NX_NULL; + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ipv6_address[0].nxd_ipv6_address_attached = &ip_0.nx_ip_interface[0]; + + /* Send the ping information, valid IP instance, valid address and invalid address state. */ + ip_0.nx_ipv6_address[0].nxd_ipv6_address_valid = NX_FALSE; + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ipv6_address[0].nxd_ipv6_address_valid = NX_TRUE; + + /* Disable the ICMPv6 feature. */ + ip_0.nx_ip_icmpv6_packet_process = NX_NULL; + + /* Send the ping information, valid IP instance, valid address and disable ICMPv6 feature. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_icmpv6_packet_process = _nx_icmpv6_packet_process; + + /* Disable the IPv6 feature. */ + ip_0.nx_ipv6_packet_receive = NX_NULL; + + /* Send the ping information, valid IP instance, valid address and disable ICMPv6 feature. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ipv6_packet_receive = _nx_ipv6_packet_receive; + + /***************************************************/ + /* Tested the nxde_icmpv6_ra_flag_callback_set api */ + /***************************************************/ + + /* Send the ra callback function for NULL IP instance. */ + status = nxd_icmpv6_ra_flag_callback_set(NX_NULL, icmpv6_ra_flag_callback); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the ra callback function for invalid IP instance. */ + status = nxd_icmpv6_ra_flag_callback_set(&invalid_ip, icmpv6_ra_flag_callback); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#ifdef FEATURE_NX_IPV6 +static void icmpv6_ra_flag_callback(NX_IP *ip_ptr, UINT ra_flag) +{ +} +#endif +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP NXE API Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_packet_receive_function_test.c b/test/regression/netxduo_test/netx_icmp_packet_receive_function_test.c new file mode 100644 index 00000000..5eb7ca86 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_packet_receive_function_test.c @@ -0,0 +1,424 @@ +/* This NetX test case test _nx_icmp_packet_receive and _nx_icmp_queue_process function with non standard operation . */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ICMPV4_RX_CHECKSUM) && !defined(NX_ENABLE_ICMP_ADDRESS_CHECK) && !defined(NX_DISABLE_IPV4) +#include "nx_icmp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR icmp_packet_received = NX_FALSE; +static NX_PACKET *copy_packet_0; +static NX_PACKET *copy_packet_1; +static NX_PACKET *copy_packet_2; +static NX_PACKET *copy_packet_3; +static NX_PACKET *copy_packet_4; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_packet_receive_function_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + /* Print out test information banner. */ + printf("NetX Test: ICMP Packet Receive Function Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to new receive function */ + ip_1.nx_ip_icmp_packet_receive = packet_receive; + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information for IP instance0. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ICMP_INFO +#ifdef __PRODUCT_NETXDUO__ + + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if ((copy_packet_2 -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM) == 0) + { +#endif /* NX_DISABLE_ICMP_INFO */ + + /* Check the ICMP information for IP instance1. */ + if ((ip_1.nx_ip_icmp_total_messages_received != 5) || (ip_1.nx_ip_icmp_invalid_packets != 3) || (ip_1.nx_ip_pings_received != 1) || (ip_1.nx_ip_pings_responded_to != 1) || (ip_1.nx_ip_icmp_checksum_errors != 1) || (ip_1.nx_ip_icmp_unhandled_messages != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + } + else + { + + /* Check the ICMP information for IP instance1. */ + if ((ip_1.nx_ip_icmp_total_messages_received != 4) || (ip_1.nx_ip_icmp_invalid_packets != 2) || (ip_1.nx_ip_pings_received != 1) || (ip_1.nx_ip_pings_responded_to != 1) || (ip_1.nx_ip_icmp_checksum_errors != 0) || (ip_1.nx_ip_icmp_unhandled_messages != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + } +#endif /* NX_DISABLE_ICMP_INFO */ +#else + + /* Check the ICMP information for IP instance1. */ + if ((ip_1.nx_ip_icmp_total_messages_received != 4) || (ip_1.nx_ip_icmp_invalid_packets != 2) || (ip_1.nx_ip_pings_received != 1) || (ip_1.nx_ip_pings_responded_to != 1) || (ip_1.nx_ip_icmp_checksum_errors != 1) || (ip_1.nx_ip_icmp_unhandled_messages != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ +#endif /* NX_DISABLE_ICMP_INFO */ + + /* Determine if the test was successful. */ + if ((error_counter) || (icmp_packet_received != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Wait for receive the ICMP packet. */ + while(icmp_packet_received == NX_FALSE) + { + tx_thread_sleep(1); + } + + /* Call _nx_icmp_packet_receive to directly receive the invalid packet. */ + _nx_icmp_packet_receive(&ip_1, copy_packet_0); + + /* Let IP thread to diretcly process the ICMP packet. */ + tx_thread_sleep(1); + +#ifdef __PRODUCT_NETXDUO__ + + /* Disable ICMP feature. */ + ip_1.nx_ip_icmpv4_packet_process = NX_NULL; + + /* Call _nx_icmp_packet_receive to directly receive the valid packet . */ + _nx_icmp_packet_receive(&ip_1, copy_packet_1); + + /* Let IP thread to diretcly process the ICMP packet. */ + tx_thread_sleep(1); + + /* Reenable ICMP feature. */ + ip_1.nx_ip_icmpv4_packet_process = _nx_icmpv4_packet_process; +#endif + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if ((copy_packet_2 -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM) == 0) + { +#endif + /* Call _nx_icmp_packet_receive to directly receive the packet with incorrect checksum, and queue the packet to the ICMP message queue. */ + _nx_icmp_packet_receive(&ip_1, copy_packet_2); +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + } +#endif + + /* Call _nx_icmp_packet_receive to receive the packet with incorrect code, and queue the packet to the ICMP message queue. */ + _nx_icmp_packet_receive(&ip_1, copy_packet_3); + + /* Call _nx_icmp_packet_receive to receive the valid packet, and queue the packet to the ICMP message queue. */ + _nx_icmp_packet_receive(&ip_1, copy_packet_4); +} + +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +NX_ICMP_HEADER *header_ptr; +ULONG checksum; +ULONG old_m; +ULONG new_m; + + /* Store the ICMP ping packet. */ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, ©_packet_0, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + error_counter++; + } + + /* Set the packet length with invalid value. */ + memcpy(copy_packet_0 -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28); + copy_packet_0 -> nx_packet_length = sizeof(NX_ICMP_HEADER) - 1; + copy_packet_0 -> nx_packet_append_ptr = copy_packet_0 -> nx_packet_prepend_ptr + copy_packet_0 -> nx_packet_length; + + /* Update the packet prepend and length to include the IP header. */ + packet_ptr -> nx_packet_prepend_ptr -= 20; + packet_ptr -> nx_packet_length += 20; + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_1, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_1 -> nx_packet_prepend_ptr += 20; + copy_packet_1 -> nx_packet_length -= 20; + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_2, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_2 -> nx_packet_prepend_ptr += 20; + copy_packet_2 -> nx_packet_length -= 20; + + /* Point to the ICMP message header. */ + header_ptr = (NX_ICMP_HEADER *) copy_packet_2 -> nx_packet_prepend_ptr; + + /* Set the incorrect checksum. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_icmp_header_word_0); + header_ptr -> nx_icmp_header_word_0 -= 1; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_icmp_header_word_0); + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_3, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_3 -> nx_packet_prepend_ptr += 20; + copy_packet_3 -> nx_packet_length -= 20; + + /* Point to the ICMP message header. */ + header_ptr = (NX_ICMP_HEADER *) copy_packet_3 -> nx_packet_prepend_ptr; + + /* Set the incorrect ICMP code. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_icmp_header_word_0); + + /* Set the new ICMP code. */ + header_ptr -> nx_icmp_header_word_0 += 0x01000000; + + /* Get the old checksum (HC) in header. */ + checksum = header_ptr -> nx_icmp_header_word_0 & NX_LOWER_16_MASK; + + /* Get the new ICMP code in the header. */ + new_m = (header_ptr -> nx_icmp_header_word_0 & 0xFFFF0000) >> 16; + + /* Get the OLD ICMP code. */ + old_m = new_m - 0x0100; + + /* Update the checksum, get the new checksum(HC'), + The new_m is ULONG value, so need get the lower value after invert. */ + checksum = ((~checksum) & 0xFFFF) + ((~old_m) & 0xFFFF) + new_m; + + /* Fold a 4-byte value into a two byte value */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Do it again in case previous operation generates an overflow */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Now store the new checksum in the IP header. */ + header_ptr -> nx_icmp_header_word_0 = ((header_ptr -> nx_icmp_header_word_0 & 0xFFFF0000) | ((~checksum) & NX_LOWER_16_MASK)); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_icmp_header_word_0); + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_4, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_4 -> nx_packet_prepend_ptr += 20; + copy_packet_4 -> nx_packet_length -= 20; + } + + /* Release the ICMP ping packet. */ + nx_packet_release(packet_ptr); + + /* Update the flag. */ + icmp_packet_received = NX_TRUE; + + /* Stop the process. */ + return; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_packet_receive_function_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: ICMP Packet Receive Function Test.........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_ping6_data_append_test.c b/test/regression/netxduo_test/netx_icmp_ping6_data_append_test.c new file mode 100644 index 00000000..27aec9bf --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_ping6_data_append_test.c @@ -0,0 +1,194 @@ +/* This NetX test concentrates on the ICMP Interface Ping6 data append operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; +static CHAR data[4096]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_data_append_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool, packet payload size is 256, packet counts is 10. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, ((sizeof(NX_PACKET) + 256) * 10)); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping6 Data Append Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the data. */ + for (i = 0; i < 4096; i ++) + data[i] = 'A'; + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Ping an IP address that does exist. One packet size is 256, use 2 packets. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, data, 400, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address that does exist. One packet size is 256, use 20 packets, data append failure. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, data, 4096, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_data_append_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping6 Data Append Test...............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_ping6_fragment_test.c b/test/regression/netxduo_test/netx_icmp_ping6_fragment_test.c new file mode 100644 index 00000000..0e5a2ff8 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_ping6_fragment_test.c @@ -0,0 +1,225 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; + +/* Define the ping message. */ +static CHAR ping_message[259]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable fragment. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i, index; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping6 Fragment Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Random genearte the write data. */ + for (i = 0; i < sizeof(ping_message); i ++) + { + ping_message[i] = (UCHAR)rand(); + } + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, ping_message, sizeof(ping_message), &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != sizeof(ping_message) /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compute a simple hash based on the dest_ip */ + index = (UINT)((global_address_1.nxd_ip_address.v6[0] + global_address_1.nxd_ip_address.v6[1] + global_address_1.nxd_ip_address.v6[2] + global_address_1.nxd_ip_address.v6[3]) % (NX_IPV6_NEIGHBOR_CACHE_SIZE)); + + /* Check the queued packet for ND CACHE. */ + if (ip_0.nx_ipv6_nd_cache[index].nx_nd_cache_packet_waiting_head) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping6 Fragment Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_ping6_test.c b/test/regression/netxduo_test/netx_icmp_ping6_test.c new file mode 100644 index 00000000..4463d52f --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_ping6_test.c @@ -0,0 +1,509 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; +static NXD_ADDRESS destination_address; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 again. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check status. */ + if (status != NX_ALREADY_ENABLED) + error_counter++; + + /* Disable IPv6. */ + status = nxd_ipv6_disable(&ip_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Disable IPv6 again. */ + status = nxd_ipv6_disable(&ip_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Enable IPv6 again. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) + /* Enable IP fragment for both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check IP fragment enable status. */ + if (status) + error_counter++; +#endif +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NX_PACKET *packet_ptr[20]; +UINT i; +ULONG pings_sent; +ULONG pings_sent_expected = 0; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG ping_responses_received_expected = 0; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping6 Test..........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Loop to allocate the all packets. */ + for (i = 0; i < pool_0.nx_packet_pool_total; i++) + { + + /* Allocate the packets. */ + status = nx_packet_allocate(&pool_0, &packet_ptr[i], NX_ICMP_PACKET, 1); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000002; + + /* Ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_NO_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Loop to release the all packets. */ + for (i = 0; i < pool_0.nx_packet_pool_total; i++) + { + + /* Release the packets. */ + status = nx_packet_release(packet_ptr[i]); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000002; + +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) + /* Ping an IP address with big data. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 257, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + pings_sent_expected++; + ping_responses_received_expected++; + nx_packet_release(my_packet); +#endif + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x30010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000003; + + /* Ping an unreachable IP address (Different network) with no wait. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status . */ + if ((status != NX_NO_INTERFACE_ADDRESS) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000003; + + /* Ping an unknown IP address with no wait. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + pings_sent_expected++; + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000003; + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + pings_sent_expected++; + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000001; + + /* Now ping loopback address. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + pings_sent_expected++; + ping_responses_received_expected++; + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Release the packet. */ + nx_packet_release(my_packet); + + /* Set ipv6 destination address. */ + destination_address.nxd_ip_version = NX_IP_VERSION_V6; + destination_address.nxd_ip_address.v6[0] = 0x20010000; + destination_address.nxd_ip_address.v6[1] = 0x00000000; + destination_address.nxd_ip_address.v6[2] = 0x00000000; + destination_address.nxd_ip_address.v6[3] = 0x10000002; + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + pings_sent_expected++; + ping_responses_received_expected++; + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Invalidate all nd caches. */ + status = nxd_nd_cache_invalidate(&ip_0); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist again. */ + status = nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Invalidate all nd caches. */ + status = nxd_nd_cache_invalidate(&ip_0); + + /* Disable and enable IPv6. */ + status = nxd_ipv6_disable(&ip_0); + status += nxd_ipv6_enable(&ip_0); + + /* Set the IPv6 address. */ + status += nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist with icmp disabled. Skip error checking. */ + status = _nxd_icmp_ping(&ip_0, &destination_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping6 Test...........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_ping_fragment_test.c b/test/regression/netxduo_test/netx_icmp_ping_fragment_test.c new file mode 100644 index 00000000..9b34904d --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_ping_fragment_test.c @@ -0,0 +1,203 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR msg[256]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping Fragment Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now send ping with fragment disabled. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), msg, sizeof(msg), &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_NO_RESPONSE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable IP fragment for both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check IP fragment enable status. */ + if (status) + error_counter++; + + + /* Now send ping with fragment enabled. The fragment will be disabled while ARP is sent. */ + advanced_packet_process_callback = packet_process; + nx_arp_dynamic_entries_invalidate(&ip_0); + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), msg, sizeof(msg), &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_NO_RESPONSE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Enable IP fragment for both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check IP fragment enable status. */ + if (status) + error_counter++; + + + /* Now send ping with fragment enabled. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), msg, sizeof(msg), &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Disable fragment. */ + nx_ip_fragment_disable(&ip_0); + nx_ip_fragment_disable(&ip_1); + + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: ICMP Ping Fragment Test...................................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_icmp_ping_multicast_test.c b/test/regression/netxduo_test/netx_icmp_ping_multicast_test.c new file mode 100644 index 00000000..75533d11 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_ping_multicast_test.c @@ -0,0 +1,188 @@ +/* This NetX test concentrates on the ICMP ping multicast operation. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_ENABLE_ICMP_ADDRESS_CHECK) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#ifndef NX_DISABLE_FRAGMENTATION +static CHAR msg[300]; +#endif /* NX_DISABLE_FRAGMENTATION */ + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_multicast_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping Multicast Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Now send a ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 255), "Test", 4, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); + + +#ifndef NX_DISABLE_FRAGMENTATION + /* Now send a large ping with fragment disabled. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 255), msg, sizeof(msg), &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_NO_RESPONSE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Enable IP fragment for both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check IP fragment enable status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now send a large ping with fragment enabled. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 255), msg, sizeof(msg), &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet); +#endif /* NX_DISABLE_FRAGMENTATION */ + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_multicast_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: ICMP Ping Fragment Test...................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_ping_test.c b/test/regression/netxduo_test/netx_icmp_ping_test.c new file mode 100644 index 00000000..9a15bb60 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_ping_test.c @@ -0,0 +1,531 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR msg[5000]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) + /* Enable IP fragment for both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check IP fragment enable status. */ + if (status) + error_counter++; +#endif +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NX_PACKET *packet_ptr[20]; +UINT i; +ULONG pings_sent; +ULONG pings_sent_expected = 0; +ULONG ping_timeouts; +ULONG ping_timeouts_expected = 0; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG ping_responses_received_expected = 0; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS ip_address; +#endif + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping Test............................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Bring down the primary interface. And ping limited broadcast address. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(255, 255, 255, 255), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* No interface to send ping packet. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bring up the primary interface. And ping limited broadcast address. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(255, 255, 255, 255), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + +#ifdef NX_ENABLE_ICMP_ADDRESS_CHECK + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ping_timeouts_expected++; +#else + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + ping_responses_received_expected++; +#endif + + pings_sent_expected++; + nx_packet_release(my_packet); +#endif + + packet_process_callback = my_packet_process; + + /* Loop to allocate the all packets. */ + for (i = 0; i < pool_0.nx_packet_pool_total; i++) + { + + /* Allocate the packets. */ + status = nx_packet_allocate(&pool_0, &packet_ptr[i], NX_ICMP_PACKET, 10); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_NO_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to release the all packets. */ + for (i = 0; i < pool_0.nx_packet_pool_total; i++) + { + + /* Release the packets. */ + status = nx_packet_release(packet_ptr[i]); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Ping an IP address that does exist but the packet is not enough to fill all the data. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), msg, sizeof(msg), &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) + /* Ping an IP address with big data. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 257, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + pings_sent_expected++; + ping_responses_received_expected++; +#endif + + /* Ping an unreachable IP address with no wait. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status . */ + if ((status != NX_IP_ADDRESS_ERROR) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address with no wait. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + pings_sent_expected++; + + /* Get no ICMP information. */ + status = nx_icmp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check the status . */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != ping_timeouts_expected) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + pings_sent_expected++; + ping_timeouts_expected++; + + /* Now ping loopback address. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + pings_sent_expected++; + ping_responses_received_expected++; + + /* Release the packet. */ + nx_packet_release(my_packet); + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + + /* Now ping loopback address. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + pings_sent_expected++; + ping_responses_received_expected++; + + /* Release the packet. */ + nx_packet_release(my_packet); +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + + /* Now ping an IP address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + pings_sent_expected++; + ping_responses_received_expected++; + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != ping_timeouts_expected) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + + /* Set the address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Now ping an IP address that does exist using nxd_icmp_ping API. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + pings_sent_expected++; + ping_responses_received_expected++; + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != ping_timeouts_expected) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist using nxd_icmp_source_ping API. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + pings_sent_expected++; + ping_responses_received_expected++; + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != ping_timeouts_expected) || (pings_sent != pings_sent_expected) || (ping_responses_received != ping_responses_received_expected)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef FEATURE_NX_IPV6 + /* Set the address version. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + + /* Now ping an IPv6 address when disable the IPv6 feature. */ + status = nxd_icmp_ping(&ip_0, &ip_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status != NX_NOT_SUPPORTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IPv6 address when disable the IPv6 feature. */ + status = nxd_icmp_source_ping(&ip_0, &ip_address, 0, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status != NX_NOT_SUPPORTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +#else +NX_IP_HEADER *ip_header_ptr; +#endif +ULONG protocol; +NX_ICMP_HEADER *icmp_header_ptr; + + /* Ignore packet that is not ICMP. */ + if(packet_ptr -> nx_packet_length < 28) + return NX_TRUE; + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + +#else + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + + /* Is ICMP packet? */ + if(protocol == 1) + { + + /* Yes it is. */ + /* Get ICMP header. */ + icmp_header_ptr = (NX_ICMP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(icmp_header_ptr -> nx_icmp_header_word_0); + + if((icmp_header_ptr -> nx_icmp_header_word_0 & NX_LOWER_16_MASK) == 0xFFFF) + error_counter++; + + NX_CHANGE_ULONG_ENDIAN(icmp_header_ptr -> nx_icmp_header_word_0); + } + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMP Ping Test............................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_send_error_message_test.c b/test/regression/netxduo_test/netx_icmp_send_error_message_test.c new file mode 100644 index 00000000..8cc1c483 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_send_error_message_test.c @@ -0,0 +1,470 @@ +/* This NetX test concentrates on the ICMPv4 Error Message. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +#if defined (__PRODUCT_NETXDUO__) && !defined (NX_DISABLE_ICMPV4_ERROR_MESSAGE) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ip_0_icmp_counter; +static ULONG ip_1_icmp_counter; +static ULONG ip_1_icmp_error_message_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static VOID my_ipv4_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_send_error_message_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + ip_0_icmp_counter = 0; + ip_1_icmp_counter = 0; + ip_1_icmp_error_message_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for IP 0 instances. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Send Error Message Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + packet_process_callback = my_packet_process; + + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((ip_0_icmp_counter != 1) && (ip_1_icmp_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable ICMP processing for IP 1 instances. */ + status = nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option and destination address (255, 255, 255, 255) by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((ip_0_icmp_counter != 2) && (ip_1_icmp_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option and non-initial fragment by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((ip_0_icmp_counter != 3) && (ip_1_icmp_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set my function. */ + ip_1.nx_ipv4_packet_receive = my_ipv4_packet_receive; + + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((ip_0_icmp_counter != 4) && (ip_1_icmp_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_ENABLE_SOURCE_ADDRESS_CHECK + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option and multicast address by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((ip_0_icmp_counter != 5) && (ip_1_icmp_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Test unknown protocol. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_ENABLE_SOURCE_ADDRESS_CHECK + /* Check the value. */ + if ((ip_0_icmp_counter != 6) && (ip_1_icmp_counter != 1)) +#else + /* Check the value. */ + if ((ip_0_icmp_counter != 5) && (ip_1_icmp_counter != 1)) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +NX_ICMP_HEADER *icmp_header_ptr; +ULONG ip_header_length; +ULONG protocol; +ULONG checksum; +ULONG val; +ULONG offset = 0; +ULONG shift; +ULONG message_word; + + /* Get the IP header pointer. */ + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Only process ICMP message. */ + if (protocol != NX_PROTOCOL_ICMP) + return (NX_TRUE); + + /* Modify the ICMP packet from ip_0 instance. */ + if(ip_ptr == &ip_0) + { + + /* Update the icmp_counter. */ + ip_0_icmp_counter++; + + /* Get the IP header pointer. */ + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the IPv4 option length. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + ip_header_length = ((ip_header_ptr -> nx_ip_header_word_0 & NX_IP_LENGTH_MASK) >> 24) * sizeof(ULONG); + + /* Get ICMP header. */ + icmp_header_ptr = (NX_ICMP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + ip_header_length); + + /* Add the illegal length 7 for NX_IP_OPTION_INTERNET_TIMESTAMP option. */ + if ((ip_0_icmp_counter == 1) || (ip_0_icmp_counter == 2) || +#ifndef NX_ENABLE_SOURCE_ADDRESS_CHECK + (ip_0_icmp_counter == 3) || (ip_0_icmp_counter == 4) || (ip_0_icmp_counter == 5)) +#else + (ip_0_icmp_counter == 3) || (ip_0_icmp_counter == 4)) +#endif + { + + /* Move the data to add the option. */ + offset = 12; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (7 << 16) | (5 << 8) ); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , offset - sizeof(ULONG)); + } + + /* Modified the destination address to 255.255.255.255. */ + if (ip_0_icmp_counter == 2) + { + + /* Modified the destination address to 255.255.255.255. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + ip_header_ptr -> nx_ip_header_destination_ip = IP_ADDRESS(255, 255, 255, 255); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + } + + /* Modified the fragment offset. */ + if (ip_0_icmp_counter == 3) + { + + /* Modified the destination address to 255.255.255.255. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + ip_header_ptr -> nx_ip_header_word_1 |= 10; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + } + +#ifndef NX_ENABLE_SOURCE_ADDRESS_CHECK + /* Modified the destination address to 255.255.255.255. */ + if (ip_0_icmp_counter == 5) + { + + /* Modified the source address to 224.0.0.251. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + ip_header_ptr -> nx_ip_header_source_ip = IP_ADDRESS(224,0,0,251); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_source_ip); + } +#endif + + /* Modified the protocol as unknown. */ +#ifndef NX_ENABLE_SOURCE_ADDRESS_CHECK + if (ip_0_icmp_counter == 6) +#else + if (ip_0_icmp_counter == 5) +#endif + { + + /* Set the protocol as unkown protocol, ip_1 should send the icmp unreachable meesage. */; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + ip_header_ptr -> nx_ip_header_word_2 |= 0x00FF0000; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + } + + /* Update the header IP length and total length. */ + ip_header_length += offset; + packet_ptr -> nx_packet_append_ptr += offset; + packet_ptr -> nx_packet_length += offset; + + /* Rebuild the first 32-bit word of the IP header. */ + ip_header_ptr -> nx_ip_header_word_0 = (ULONG)((NX_IP_VERSION_V4 << 28) | + ((ip_header_length/sizeof(ULONG)) << 24) | + NX_IP_NORMAL | + (0xFFFF & packet_ptr -> nx_packet_length)); + + /* Endian swapping logic. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Clear the checksum . */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 & 0x0000FFFF; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + (UINT)(ip_header_length), + /* IPv4 header checksum does not use src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + + /* Check the ICMP packet from ip_1 instance. */ + if(ip_ptr == &ip_1) + { + + /* Update the icmp_counter. */ + ip_1_icmp_counter++; + } + + return NX_TRUE; +} + +VOID my_ipv4_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_PACKET *my_packet[20]; +UINT packet_counter; +UINT i; + + /* Record the counter. */ + packet_counter = ip_ptr -> nx_ip_default_packet_pool -> nx_packet_pool_available; + + /* Loop to allocate the packet. */ + for (i = 0; i < packet_counter; i ++) + nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet[i], 0, NX_NO_WAIT); + + /* Receive the packet. */ + _nx_ipv4_packet_receive(ip_ptr, packet_ptr); + + /* Loop to release the packet. */ + for (i = packet_counter; i > 0; i --) + nx_packet_release(my_packet[i - 1]); + + /* Reset the function. */ + ip_1.nx_ipv4_packet_receive = _nx_ipv4_packet_receive; +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_send_error_message_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: ICMP Send Error Message Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_send_error_message_test_1.c b/test/regression/netxduo_test/netx_icmp_send_error_message_test_1.c new file mode 100644 index 00000000..d537e302 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_send_error_message_test_1.c @@ -0,0 +1,284 @@ +/* This NetX test concentrates on sending the ICMP error message. + * The destination of incoming packet is link-layer broadcast address. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +#if defined (__PRODUCT_NETXDUO__) && !defined (NX_DISABLE_ICMPV4_ERROR_MESSAGE) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ip_0_icmp_counter; +static ULONG ip_1_icmp_counter; +static ULONG ip_1_icmp_error_message_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_send_error_message_test_1_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + ip_0_icmp_counter = 0; + ip_1_icmp_counter = 0; + ip_1_icmp_error_message_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMP Send Error Message Test 1............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + packet_process_callback = my_packet_process; + + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option and destination address (1, 2, 3, 255) by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the value. */ + if ((ip_0_icmp_counter != 1) && (ip_1_icmp_counter != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +NX_ICMP_HEADER *icmp_header_ptr; +ULONG ip_header_length; +ULONG protocol; +ULONG checksum; +ULONG val; +ULONG offset = 0; +ULONG shift; +ULONG message_word; + + /* Get the IP header pointer. */ + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Only process ICMP message. */ + if (protocol != NX_PROTOCOL_ICMP) + return (NX_TRUE); + + /* Modify the ICMP packet from ip_0 instance. */ + if(ip_ptr == &ip_0) + { + + /* Update the icmp_counter. */ + ip_0_icmp_counter++; + + /* Get the IP header pointer. */ + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the IPv4 option length. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + ip_header_length = ((ip_header_ptr -> nx_ip_header_word_0 & NX_IP_LENGTH_MASK) >> 24) * sizeof(ULONG); + + /* Get ICMP header. */ + icmp_header_ptr = (NX_ICMP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + ip_header_length); + + /* Add the illegal length 7 for NX_IP_OPTION_INTERNET_TIMESTAMP option. */ + /* Move the data to add the option. */ + offset = 12; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (7 << 16) | (5 << 8) ); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , offset - sizeof(ULONG)); + + /* Modified the destination address to 1.2.3.255. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + ip_header_ptr -> nx_ip_header_destination_ip = IP_ADDRESS(1, 2, 3, 255); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + + /* Update the header IP length and total length. */ + ip_header_length += offset; + packet_ptr -> nx_packet_append_ptr += offset; + packet_ptr -> nx_packet_length += offset; + + /* Rebuild the first 32-bit word of the IP header. */ + ip_header_ptr -> nx_ip_header_word_0 = (ULONG)((NX_IP_VERSION_V4 << 28) | + ((ip_header_length/sizeof(ULONG)) << 24) | + NX_IP_NORMAL | + (0xFFFF & packet_ptr -> nx_packet_length)); + + /* Endian swapping logic. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Clear the checksum . */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 & 0x0000FFFF; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + (UINT)(ip_header_length), + /* IPv4 header checksum does not use src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + + /* Check the ICMP packet from ip_1 instance. */ + else if(ip_ptr == &ip_1) + { + + /* Update the icmp_counter. */ + ip_1_icmp_counter++; + } + + return NX_TRUE; +} +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_send_error_message_test_1_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: ICMP Send Error Message Test 1............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv4_ping_test.c b/test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv4_ping_test.c new file mode 100644 index 00000000..f2edfc9f --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv4_ping_test.c @@ -0,0 +1,240 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_tunnel.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_tunnel_ipv4_ipv4_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_256); + + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; + + /* Create ip0 TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V4,address_selector_0); + + + /* Create ip1 TUNNEL . */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020305; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020304; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V4,address_selector_1); +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV4_4 Ping Test.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_tunnel_ipv4_ipv4_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV4_4 Ping Test..............................N/A\n"); + + test_control_return(3); + +} + +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv6_ping_test.c b/test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv6_ping_test.c new file mode 100644 index 00000000..18740150 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_tunnel_ipv4_ipv6_ping_test.c @@ -0,0 +1,280 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_tunnel_ipv4_ipv6_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; + + /* Create ip0 TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + + /* Create ip1 TUNNEL . */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV4_6 Ping Test.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 7), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping_tunnel_ipv4_ipv6_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV4_6 Ping Test..............................N/A\n"); + + test_control_return(3); + +} + +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv4_ping_test.c b/test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv4_ping_test.c new file mode 100644 index 00000000..f7efe16e --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv4_ping_test.c @@ -0,0 +1,311 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_tunnel.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_tunnel_ipv6_ipv4_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; + + /* Create ip0 TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V4,address_selector_0); + + if (status) + error_counter++; + + /* Create ip1 TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020305; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020304; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V4,address_selector_1); + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV6_4 Ping Test.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = _nx_icmp_ping6(&ip_0, &ipv6_address_3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = _nx_icmp_ping6(&ip_0, &ipv6_address_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_tunnel_ipv6_ipv4_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV6_4 Ping Test..............................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv6_ping_test.c b/test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv6_ping_test.c new file mode 100644 index 00000000..4ffbe154 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmp_tunnel_ipv6_ipv6_ping_test.c @@ -0,0 +1,308 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_tunnel.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; +NXD_ADDRESS ipv6_address_5; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_tunnel_ipv6_ipv6_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + ipv6_address_5.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_5.nxd_ip_address.v6[0] = 0x20000001; + ipv6_address_5.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[3] = 0x50000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = _nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV6_6 Ping Test.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = _nx_icmp_ping6(&ip_0, &ipv6_address_5, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = _nx_icmp_ping6(&ip_0, &ipv6_address_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 1) || (pings_sent != 2) || (ping_responses_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmp_ping6_tunnel_ipv6_ipv6_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TUNNEL ICMP IPV6_6 Ping Test..............................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmpv6_DAD_test.c b/test/regression/netxduo_test/netx_icmpv6_DAD_test.c new file mode 100644 index 00000000..44339f43 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_DAD_test.c @@ -0,0 +1,426 @@ +/* This NetX test concentrates on the ICMP ping6 operation use second interface. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV6_DAD) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ +static ULONG error_counter; +static ULONG NS_counter; +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static ULONG Address_manual_config_counter; +static ULONG DAD_success_counter; +static ULONG DAD_failure_counter; +#endif + +static NXD_ADDRESS link_address_0; +static NXD_ADDRESS link_address_1; +static NXD_ADDRESS global_address; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static VOID ipv6_address_DAD_notify(NX_IP *ip_ptr, UINT status, UINT interface_index, UINT ipv6_addr_index, ULONG *ipv6_address); +#endif + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_DAD_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Check IP create status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status = 0; +ULONG prefix_length; +UINT interface_index; +UINT valid_address_count; +UINT packet_counter; +UINT i; +UINT address_index; +NX_PACKET *my_packet[30]; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 DAD Test .........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + /* Set the callback function. */ + nxd_ipv6_address_change_notify(&ip_0, ipv6_address_DAD_notify); + + /* Set the callback function. */ + nxd_ipv6_address_change_notify(&ip_1, ipv6_address_DAD_notify); +#endif + + /* Hook link driver to check packets. */ + packet_process_callback = packet_process; + + /* Allocate all packet from packet pool. */ + packet_counter = pool_0.nx_packet_pool_available; + for(i =0; i < packet_counter; i ++) + { + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Set the IPv6 linklocal address for IP instance 0. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the NS counter. */ + if(NS_counter != 0) + error_counter ++; + + /* Release all allocated packet. */ + for(i =0; i < packet_counter; i ++) + { + + /* Allocate the packet. */ + status = nx_packet_release(my_packet[i]); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Delete the IPv6 linklocal address for IP instance 0. */ + status = nxd_ipv6_address_delete(&ip_0, address_index); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 linklocal address for IP instance 0 again. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the NS counter. */ + if(NS_counter != 3) + error_counter ++; + + /* Get the IPv6 link local address for IP instance 0. */ + status = nxd_ipv6_address_get(&ip_0, 0, &link_address_0, &prefix_length, &interface_index); + + /* Check the status. */ + if(status) + error_counter ++; + + /* Reset the NS_counter. */ + NS_counter = 0; + + /* Set the IPv6 linklocal address for IP instance 1. */ + status = nxd_ipv6_address_set(&ip_1, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + error_counter ++; + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the NS counter. */ + if(NS_counter != 3) + error_counter ++; + + /* Get the IPv6 link local address for IP instance 0. */ + status = nxd_ipv6_address_get(&ip_1, 0, &link_address_1, &prefix_length, &interface_index); + + /* Check the status. */ + if(status) + error_counter ++; + + /* Reset the NS_counter. */ + NS_counter = 0; + + /* Set ipv6 global address for IP instance 0. */ + global_address.nxd_ip_version = NX_IP_VERSION_V6; + global_address.nxd_ip_address.v6[0] = 0x20010000; + global_address.nxd_ip_address.v6[1] = 0x00000000; + global_address.nxd_ip_address.v6[2] = 0x00000000; + global_address.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address, 64, NX_NULL); + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the NS counter. */ + if(NS_counter != 3) + error_counter ++; + + /* Get the IPv6 global address for IP instance 0. */ + status = nxd_ipv6_address_get(&ip_0, 1, &global_address_0, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || + (!CHECK_IPV6_ADDRESSES_SAME(&global_address.nxd_ip_address.v6[0], &global_address_0.nxd_ip_address.v6[0]))) + error_counter ++; + + /* Reset the NS_counter. */ + NS_counter = 0; + + /* Get count of valid addresses. */ + valid_address_count = 0; + for (i = 0; i < NX_MAX_IPV6_ADDRESSES; i++) + { + if (ip_1.nx_ipv6_address[i].nxd_ipv6_address_valid) + { + valid_address_count++; + } + } + + /* Set the same IPv6 global address for instance 1. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address, 64, NX_NULL); + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the NS counter. */ + if(NS_counter != 1) + error_counter ++; + + /* Get the IPv6 global address for IP instance 1. */ + status = nxd_ipv6_address_get(&ip_1, 1, &global_address_1, &prefix_length, &interface_index); + + /* Check the status. */ + if(!status) + error_counter ++; + + /* Is there only one address in the list of interface? */ + if (ip_1.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_next != NX_NULL) + error_counter++; + + /* Check count of valid addresses. */ + for (i = 0; i < NX_MAX_IPV6_ADDRESSES; i++) + { + if (ip_1.nx_ipv6_address[i].nxd_ipv6_address_valid) + { + valid_address_count--; + } + } + if (valid_address_count) + error_counter++; + + /* Clear link driver to check packets. */ + packet_process_callback = NX_NULL; + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + /* Check the counter. */ + if((Address_manual_config_counter != 5) || (DAD_success_counter != 4) || (DAD_failure_counter != 1)) + { + error_counter ++; + } +#endif + + /* Check the error counter. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_ICMPV6_HEADER *header_ptr; + + /* Points to the ICMP message header. */ + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)); + + /* Determine the message type and call the appropriate handler. */ + if (header_ptr -> nx_icmpv6_header_type == NX_ICMPV6_NEIGHBOR_SOLICITATION_TYPE) + { + + /* Update the NS counter. */ + NS_counter ++; + } + + return NX_TRUE; +} + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static VOID ipv6_address_DAD_notify(NX_IP *ip_ptr, UINT status, UINT interface_index, UINT ipv6_addr_index, ULONG *ipv6_address) +{ + + /* Check thte status. */ + switch(status) + { + case NX_IPV6_ADDRESS_MANUAL_CONFIG: + { + + /* Update the counter. */ + Address_manual_config_counter ++; + break; + } + + case NX_IPV6_ADDRESS_DAD_SUCCESSFUL: + { + + /* Check the IPv6 address index. */ + if((ipv6_addr_index == 1) && (ip_ptr == &ip_1)) + error_counter ++; + + /* Update the counter. */ + DAD_success_counter ++; + break; + } + case NX_IPV6_ADDRESS_DAD_FAILURE: + { + + /* Check the IPv6 address index. */ + if((ipv6_addr_index == 1) && (ip_ptr != &ip_1)) + error_counter ++; + + /* Update the counter. */ + DAD_failure_counter ++; + break; + } + } +} +#endif +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_DAD_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 DAD Test...........................................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_abnormal_mtu_in_ra_test.c b/test/regression/netxduo_test/netx_icmpv6_abnormal_mtu_in_ra_test.c new file mode 100644 index 00000000..a5718077 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_abnormal_mtu_in_ra_test.c @@ -0,0 +1,201 @@ +/* Test processing of RA with MTU option whose value is larger than link MTU. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * src: 0xFE80::0x0200:0x00FF:0xFE00:0xA0A0 + * mtu option: MTU size is 3000 */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x82, 0xc6, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x0b, 0xb8 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_abnormal_mtu_in_ra_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; +NX_IPV6_DESTINATION_ENTRY *dest_entry_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Abnormal MTU in RA Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Get destination entry. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x020000FF; + ipv6_address.nxd_ip_address.v6[3] = 0xFE00A0A0; + status = _nx_icmpv6_dest_table_find(&ip_0, ipv6_address.nxd_ip_address.v6, &dest_entry_ptr, 0, 0); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + + /* Verify the MTU size. */ + if (dest_entry_ptr -> nx_ipv6_destination_entry_path_mtu != 1500) + { + error_counter++; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_abnormal_mtu_in_ra_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Abnormal MTU in RA Test............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_branch_test.c b/test/regression/netxduo_test/netx_icmpv6_branch_test.c new file mode 100644 index 00000000..e30a6cc4 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_branch_test.c @@ -0,0 +1,578 @@ +/* This NetX test concentrates on the code coverage for ICMPv6 functions, + * _nx_icmpv6_DAD_failure.c + * _nx_icmpv6_dest_table_find.c + */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_ENABLE_INTERFACE_CAPABILITY) +#include "tx_thread.h" +#include "nx_icmp.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + +#define ASSERT_THREAD_COUNT 10 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +#ifndef NX_DISABLE_ASSERT +static TX_THREAD thread_for_assert[ASSERT_THREAD_COUNT]; +static UCHAR stack_for_assert[ASSERT_THREAD_COUNT][DEMO_STACK_SIZE]; +#endif + +/* NS packet with invalid option type 0. */ +static unsigned char pkt1[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xae, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x01, /* "..3DV.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* NS packet with different SLLA. */ +static unsigned char pkt2[86] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, /* 33.3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x2d, 0xd9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; +static unsigned char pkt3[86] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, /* 33.3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x2d, 0x39, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -9...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, /* "..3DV.. */ +0x00, 0xa0, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifndef NX_DISABLE_ASSERT +static VOID thread_for_assert_entry_0(ULONG thread_input); +static VOID thread_for_assert_entry_1(ULONG thread_input); +static VOID thread_for_assert_entry_2(ULONG thread_input); +static VOID thread_for_assert_entry_3(ULONG thread_input); +static VOID thread_for_assert_entry_4(ULONG thread_input); +static VOID thread_for_assert_entry_5(ULONG thread_input); +static VOID thread_for_assert_entry_6(ULONG thread_input); +static VOID thread_for_assert_entry_7(ULONG thread_input); +static VOID thread_for_assert_entry_8(ULONG thread_input); +static VOID thread_for_assert_entry_9(ULONG thread_input); +static VOID (*thread_for_assert_entry[])(ULONG) = +{ + thread_for_assert_entry_0, + thread_for_assert_entry_1, + thread_for_assert_entry_2, + thread_for_assert_entry_3, + thread_for_assert_entry_4, + thread_for_assert_entry_5, + thread_for_assert_entry_6, + thread_for_assert_entry_7, + thread_for_assert_entry_8, + thread_for_assert_entry_9, +}; +#endif + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_branch_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ICMP processing for IP instance. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if (status) + error_counter++; + + /* Enable IPv6 processing for IP instance. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG destination_address[4]; +ULONG next_hop[4]; +NX_IPV6_DESTINATION_ENTRY + *dest_entry_ptr; +#ifndef NX_DISABLE_IPV6_DAD +NXD_ADDRESS ipv6_address; +#endif +NX_PACKET *packet_ptr; +NX_IPV6_HEADER + *ip_header_ptr; +ND_CACHE_ENTRY + nd_entry; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: ICMPv6 Branch Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + +#ifndef NX_DISABLE_IPV6_DAD + /* Hit condition of if (address_ptr -> nxd_ipv6_address_next == ipv6_address) in _nx_icmpv6_DAD_failure(). */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000009; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00010003; + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, NX_NULL); + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000009; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00010004; + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, NX_NULL); + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000009; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00010005; + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, NX_NULL); + + _nx_icmpv6_DAD_failure(&ip_0, &ip_0.nx_ipv6_address[2]); + _nx_icmpv6_DAD_failure(&ip_0, &ip_0.nx_ipv6_address[1]); + + nxd_ipv6_address_delete(&ip_0, 0); + nxd_ipv6_address_delete(&ip_0, 1); + nxd_ipv6_address_delete(&ip_0, 2); +#endif + + + + /* Test _nx_icmpv6_dest_table_find. */ + /* Hit false condition of (i < NX_IPV6_DESTINATION_TABLE_SIZE). */ + ip_0.nx_ipv6_destination_table_size = 1; + if (_nx_icmpv6_dest_table_find(&ip_0, destination_address, &dest_entry_ptr, 0, 0) == NX_SUCCESS) + { + error_counter++; + } + + /* Recover*/ + ip_0.nx_ipv6_destination_table_size = 0; + +#ifndef NX_DISABLE_ASSERT + for (i = 0; i < ASSERT_THREAD_COUNT; i++) + { + + /* Create the assert thread. */ + tx_thread_create(&thread_for_assert[i], "Assert Test thread", thread_for_assert_entry[i], 0, + stack_for_assert[i], DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert[i]); + tx_thread_delete(&thread_for_assert[i]); + } +#endif + for (i = 0; i < NX_IPV6_DESTINATION_TABLE_SIZE; i++) + { + ip_0.nx_ipv6_destination_table[i].nx_ipv6_destination_entry_valid = NX_FALSE; + } + + /* Test _nx_icmpv6_send_queued_packets(). */ + /* Cover the false branch of 'if (status == NX_SUCCESS)'. */ + destination_address[0] = 0xfe800000; + destination_address[1] = 0; + destination_address[2] = 0; + destination_address[3] = 1; + next_hop[0] = 0; + next_hop[1] = 0; + next_hop[2] = 0; + next_hop[3] = 0; + nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if (nx_packet_allocate(&pool_0, &packet_ptr, NX_IPv6_PACKET, 0)) + { + error_counter++; + } + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_append_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); + COPY_IPV6_ADDRESS(destination_address, ip_header_ptr -> nx_ip_header_destination_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + nd_entry.nx_nd_cache_packet_waiting_head = packet_ptr; + nd_entry.nx_nd_cache_interface_ptr = &(ip_0.nx_ip_interface[0]); + packet_ptr -> nx_packet_queue_next = NX_NULL; + packet_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr = &(ip_0.nx_ipv6_address[0]); + _nx_icmpv6_send_queued_packets(&ip_0, &nd_entry); + + /* Test _nx_icmpv6_send_queued_packets(). */ + /* Cover the false branch of 'if (!CHECK_UNSPECIFIED_ADDRESS(&(next_hop_address[0])))'. */ + destination_address[0] = 0xfe800000; + destination_address[1] = 0; + destination_address[2] = 0; + destination_address[3] = 1; + next_hop[0] = 0; + next_hop[1] = 0; + next_hop[2] = 0; + next_hop[3] = 0; + nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + _nx_icmpv6_dest_table_add(&ip_0, destination_address, &dest_entry_ptr, next_hop, 0, 0, &ip_0.nx_ipv6_address[0]); + if (nx_packet_allocate(&pool_0, &packet_ptr, NX_IPv6_PACKET, 0)) + { + error_counter++; + } + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_append_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); + COPY_IPV6_ADDRESS(destination_address, ip_header_ptr -> nx_ip_header_destination_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + nd_entry.nx_nd_cache_packet_waiting_head = packet_ptr; + nd_entry.nx_nd_cache_interface_ptr = &(ip_0.nx_ip_interface[0]); + packet_ptr -> nx_packet_queue_next = NX_NULL; + packet_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr = &(ip_0.nx_ipv6_address[0]); + _nx_icmpv6_send_queued_packets(&ip_0, &nd_entry); + + /* Cover the false branch of 'if ((next_hop_dest_entry_ptr -> nx_ipv6_destination_entry_path_mtu > 0) &&'. */ + destination_address[0] = 0xfe800000; + destination_address[1] = 0; + destination_address[2] = 0; + destination_address[3] = 3; + ip_0.nx_ip_interface[0].nx_interface_ip_mtu_size = 0; + _nx_icmpv6_dest_table_add(&ip_0, destination_address, &dest_entry_ptr, next_hop, 0, 0, &ip_0.nx_ipv6_address[0]); + ip_0.nx_ip_interface[0].nx_interface_ip_mtu_size = 256; + destination_address[0] = 0xfe800000; + destination_address[1] = 0; + destination_address[2] = 0; + destination_address[3] = 2; + next_hop[0] = 0xfe800000; + next_hop[1] = 0; + next_hop[2] = 0; + next_hop[3] = 3; + _nx_icmpv6_dest_table_add(&ip_0, destination_address, &dest_entry_ptr, next_hop, 256, 0, &ip_0.nx_ipv6_address[0]); + if (nx_packet_allocate(&pool_0, &packet_ptr, NX_IPv6_PACKET, 0)) + { + error_counter++; + } + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_append_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); + COPY_IPV6_ADDRESS(destination_address, ip_header_ptr -> nx_ip_header_destination_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + nd_entry.nx_nd_cache_packet_waiting_head = packet_ptr; + nd_entry.nx_nd_cache_interface_ptr = &(ip_0.nx_ip_interface[0]); + packet_ptr -> nx_packet_queue_next = NX_NULL; + packet_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr = &(ip_0.nx_ipv6_address[0]); + _nx_icmpv6_send_queued_packets(&ip_0, &nd_entry); + + /* Cover the false branch of 'if (status == NX_SUCCESS)'. */ + destination_address[0] = 0xfe800000; + destination_address[1] = 0; + destination_address[2] = 0; + destination_address[3] = 5; + next_hop[0] = 0xfe800000; + next_hop[1] = 0; + next_hop[2] = 0; + next_hop[3] = 6; + _nx_icmpv6_dest_table_add(&ip_0, destination_address, &dest_entry_ptr, next_hop, 256, 0, &ip_0.nx_ipv6_address[0]); + if (nx_packet_allocate(&pool_0, &packet_ptr, NX_IPv6_PACKET, 0)) + { + error_counter++; + } + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_append_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); + COPY_IPV6_ADDRESS(destination_address, ip_header_ptr -> nx_ip_header_destination_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header_ptr -> nx_ip_header_destination_ip); + nd_entry.nx_nd_cache_packet_waiting_head = packet_ptr; + nd_entry.nx_nd_cache_interface_ptr = &(ip_0.nx_ip_interface[0]); + packet_ptr -> nx_packet_queue_next = NX_NULL; + packet_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr = &(ip_0.nx_ipv6_address[0]); + _nx_icmpv6_send_queued_packets(&ip_0, &nd_entry); + + + +#ifndef NX_DISABLE_ICMPV6_ERROR_MESSAGE + /* Test _nx_icmpv6_send_error_message(). */ + /* Cover the true banch of 'if ((pkt_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr == NX_NULL) ||' */ + destination_address[0] = 0xfe800000; + destination_address[1] = 0; + destination_address[2] = 0; + destination_address[3] = 1; + if (nx_packet_allocate(&pool_0, &packet_ptr, NX_IPv6_PACKET, 0)) + { + error_counter++; + } + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_append_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_address.nx_packet_ipv6_address_ptr = NX_NULL; + COPY_IPV6_ADDRESS(destination_address, ip_header_ptr -> nx_ip_header_destination_ip); + COPY_IPV6_ADDRESS(destination_address, ip_header_ptr -> nx_ip_header_source_ip); + _nx_icmpv6_send_error_message(&ip_0, packet_ptr, 0, 0); +#endif + + + /* Test _nx_icmpv6_process_ns(). */ + /* Cover the false branch of '(option_ptr -> nx_icmpv6_option_type == ICMPV6_OPTION_TYPE_SRC_LINK_ADDR)'. */ + /* Inject NS packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test _nx_icmpv6_process_ns(). */ + /* Cover the false branch of '(mac_msw != new_msw)'. */ + /* Inject NS packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Set address state to valid. */ + ip_0.nx_ipv6_address[0].nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_VALID; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject NS packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt3) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Set address state to valid. */ + ip_0.nx_ipv6_address[0].nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_VALID; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#ifndef NX_DISABLE_ASSERT +static VOID thread_for_assert_entry_0(ULONG thread_input) +{ + + /* Test _nx_icmpv6_dest_table_add(). */ + /* Hit NX_ASSERT((destination_address != NX_NULL) && (dest_entry_ptr != NX_NULL) && (next_hop != NX_NULL)); */ + _nx_icmpv6_dest_table_add(&ip_0, NX_NULL, NX_NULL, NX_NULL, 0, 0, NX_NULL); +} + +static VOID thread_for_assert_entry_1(ULONG thread_input) +{ +ULONG destination_address[4] = {0}; + + /* Test _nx_icmpv6_dest_table_add(). */ + /* Hit NX_ASSERT((destination_address != NX_NULL) && (dest_entry_ptr != NX_NULL) && (next_hop != NX_NULL)); */ + _nx_icmpv6_dest_table_add(&ip_0, destination_address, NX_NULL, NX_NULL, 0, 0, NX_NULL); +} + +static VOID thread_for_assert_entry_2(ULONG thread_input) +{ +ULONG destination_address[4] = {0}; +NX_IPV6_DESTINATION_ENTRY *dest_entry; + + /* Test _nx_icmpv6_dest_table_add(). */ + /* Hit NX_ASSERT((destination_address != NX_NULL) && (dest_entry_ptr != NX_NULL) && (next_hop != NX_NULL)); */ + _nx_icmpv6_dest_table_add(&ip_0, destination_address, &dest_entry, NX_NULL, 0, 0, NX_NULL); +} + +static VOID thread_for_assert_entry_3(ULONG thread_input) +{ +ULONG destination_address[4] = {0}; +NX_IPV6_DESTINATION_ENTRY *dest_entry; +ULONG next_hop; +UINT i; + + /* Test _nx_icmpv6_dest_table_add(). */ + /* Hit NX_ASSERT(i < NX_IPV6_DESTINATION_TABLE_SIZE); */ + for (i = 0; i < NX_IPV6_DESTINATION_TABLE_SIZE; i++) + { + ip_0.nx_ipv6_destination_table[i].nx_ipv6_destination_entry_valid = NX_TRUE; + } + _nx_icmpv6_dest_table_add(&ip_0, destination_address, &dest_entry, &next_hop, 0, 0, NX_NULL); +} + +static VOID thread_for_assert_entry_4(ULONG thread_input) +{ + + /* Test _nx_icmpv6_dest_table_find(). */ + /* Hit NX_ASSERT((destination_address != NX_NULL) && (dest_entry_ptr != NULL)); */ + _nx_icmpv6_dest_table_find(&ip_0, NX_NULL, NX_NULL, 0, 0); +} + +static VOID thread_for_assert_entry_5(ULONG thread_input) +{ +ULONG destination_address[4]; + + /* Test _nx_icmpv6_dest_table_find(). */ + /* Hit NX_ASSERT((destination_address != NX_NULL) && (dest_entry_ptr != NULL)); */ + _nx_icmpv6_dest_table_find(&ip_0, destination_address, NX_NULL, 0, 0); +} + +static VOID thread_for_assert_entry_6(ULONG thread_input) +{ +ULONG destination_address[4]; +NXD_IPV6_ADDRESS ipv6_address; + + /* Test _nx_icmpv6_send_ns(). */ + /* Hit NX_ASSERT(driver_request.nx_ip_driver_interface != NX_NULL); */ + ipv6_address.nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_TENTATIVE; + ipv6_address.nxd_ipv6_address_attached = NX_NULL; + _nx_icmpv6_send_ns(&ip_0, destination_address, NX_FALSE, &ipv6_address, NX_FALSE, NX_NULL); +} + +static VOID thread_for_assert_entry_7(ULONG thread_input) +{ +ULONG destination_address[4]; +NXD_IPV6_ADDRESS ipv6_address; +NX_INTERFACE nx_interface; + + /* Test _nx_icmpv6_send_ns(). */ + /* Hit NX_ASSERT(outgoing_address -> nxd_ipv6_address_attached -> nx_interface_link_driver_entry != NX_NULL); */ + ipv6_address.nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_TENTATIVE; + ipv6_address.nxd_ipv6_address_attached = &nx_interface; + nx_interface.nx_interface_link_driver_entry = NX_NULL; + _nx_icmpv6_send_ns(&ip_0, destination_address, NX_FALSE, &ipv6_address, NX_FALSE, NX_NULL); +} + +static VOID thread_for_assert_entry_8(ULONG thread_input) +{ + + /* Test _nx_icmpv6_send_queued_packets(). */ + /* Hit NX_ASSERT(nd_entry != NX_NULL); */ + _nx_icmpv6_send_queued_packets(&ip_0, NX_NULL); +} + +static VOID thread_for_assert_entry_9(ULONG thread_input) +{ +ND_CACHE_ENTRY nd_entry; + + /* Test _nx_icmpv6_send_queued_packets(). */ + /* Hit NX_ASSERT(nd_entry -> nx_nd_cache_packet_waiting_head != NX_NULL); */ + nd_entry.nx_nd_cache_packet_waiting_head = NX_NULL; + _nx_icmpv6_send_queued_packets(&ip_0, &nd_entry); +} +#endif + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Branch Test........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_icmpv6_destination_table_periodic_test.c b/test/regression/netxduo_test/netx_icmpv6_destination_table_periodic_test.c new file mode 100644 index 00000000..600ee12c --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_destination_table_periodic_test.c @@ -0,0 +1,985 @@ +/* This NetX test to test the ICMPv6 Echo request process. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static ULONG echo_request_sent; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Frame (118 bytes): RA */ +static const unsigned char pkt1[118] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, /* ...@:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x9f, 0x75, 0x00, 0x00, 0x03, 0x20, 0x00, 0x00, /* .u... .. */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* u0...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes): Echo Request 3ffe:501:ffff:100:200:ff:fe00:100 */ +static const unsigned char pkt2[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes): NS */ +static const unsigned char pkt3[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes): NA */ +static const unsigned char pkt4[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* W.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes): Echo Reply 3ffe:501:ffff:100:200:ff:fe00:100 */ +static const unsigned char pkt5[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (1294 bytes): Echo Request 3ffe:501:ffff:102:200:ff:fe00:a2a2 */ +static const unsigned char pkt6[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xd4, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* ...... */ +}; + +/* Frame (1294 bytes): Echo Reply, 3ffe:501:ffff:102:200:ff:fe00:a2a2 */ +static const unsigned char pkt7[1294] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, /* ........ */ +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* ...... */ +}; + +/* Frame (1294 bytes): Packet Too Big, MTU 56, 3ffe:501:ffff:100:200:ff:fe00:100 */ +static const unsigned char pkt8[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, /* "..3DV.. */ +0xe1, 0x8e, 0x00, 0x00, 0x00, 0x38, 0x60, 0x00, /* .....8`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, /* ........ */ +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* ........ */ +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* ........ */ +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_destination_table_periodic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + packet_counter = 0; + echo_request_sent = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*4); + pointer = pointer + 1536*4; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check IP create status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +NXD_ADDRESS dest_ip; +CHAR mac[6]; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Destination Table Periodic Test...................."); + + /* Set the linklocal address*/ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Setup filter function to check whether the packet is sent from ip_0. */ + advanced_packet_process_callback = my_packet_process; + + /* Set the destination address and mac address. */ + dest_ip.nxd_ip_version = NX_IP_VERSION_V6; + dest_ip.nxd_ip_address.v6[0] = 0xfe800000; + dest_ip.nxd_ip_address.v6[1] = 0x00000000; + dest_ip.nxd_ip_address.v6[2] = 0x020000ff; + dest_ip.nxd_ip_address.v6[3] = 0xfe000100; + mac[0] = 0; + mac[1] = 0; + mac[2] = 0; + mac[3] = 0; + mac[4] = 1; + mac[5] = 0; + + /* Added ND Cache Entry. */ + status = nxd_nd_cache_entry_set(&ip_0, dest_ip.nxd_ip_address.v6, 0, mac); + + /* Check status */ + if(status) + error_counter ++; + + /* Send ICMPv6 RA to ip_0. */ + /* The source address is fe80::200:ff:fe00:100. */ + /* The destination address is ff02::1. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMPv6 RA packet. */ + _nx_ip_packet_receive(&ip_0, packet_ptr); + + /* Waiting for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the destination table. the destination address is fe80::200:ff:fe00:100. */ + if ((ip_0.nx_ipv6_destination_table_size != 1) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[0] != 0xfe800000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[1] != 0x00000000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER)) + error_counter ++; + + /* Send ICMPv6 Echo Request to ip_0. */ + /* The source address is 3ffe:501:ffff:100:200:ff:fe00:100. */ + /* The destination address is 3ffe:501:ffff:100:211:22ff:fe33:4456. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMPv6 Echo Request packet. */ + _nx_ip_packet_receive(&ip_0, packet_ptr); + + /* Sleep 1 second to check NS, inject NA and check Echo Reply. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the destination table. */ + if ((ip_0.nx_ipv6_destination_table_size != 2) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[0] != 0xfe800000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[1] != 0x00000000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[1] != 0xffff0100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER)) + error_counter ++; + + /* Send ICMPv6 Echo Request to ip_0. */ + /* The source address is 3ffe:501:ffff:102:200:ff:fe00:a2a2. */ + /* The destination address is 3ffe:501:ffff:100:211:22ff:fe33:4456. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt6[14], sizeof(pkt6) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt6) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMPv6 Echo Request packet. */ + _nx_ip_packet_receive(&ip_0, packet_ptr); + + /* Sleep 1 second to check Echo Reply. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the destination table. */ + if ((ip_0.nx_ipv6_destination_table_size != 3) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[0] != 0xfe800000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[1] != 0x00000000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[1] != 0xffff0100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[1] != 0xffff0102) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[3] != 0xfe00a2a2) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER)) + error_counter ++; + + /* Send ICMPv6 Packet too big packet with MTU 56 to ip_0. */ + /* The source address is 0x3ffe:501:ffff:100:200:ff:fe00:100. */ + /* The destination address is 0x3ffe:501:ffff:100:211:22ff:fe33:4456. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt8[14], sizeof(pkt8) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt8) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMPv6 Packet too big packet. */ + _nx_ip_packet_receive(&ip_0, packet_ptr); + + /* Check the destination table. */ + if ((ip_0.nx_ipv6_destination_table_size != 3) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[0] != 0xfe800000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[1] != 0x00000000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[1] != 0xffff0100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[1] != 0xffff0102) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[3] != 0xfe00a2a2) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_path_mtu != 56) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_MTU_timer_tick != NX_PATH_MTU_INCREASE_WAIT_INTERVAL_TICKS)) + error_counter ++; + + /* Sleep NX_PATH_MTU_INCREASE_WAIT_INTERVAL_TICKS to check destination table. */ +#if (NX_IP_PERIODIC_RATE == 1000) + /* Plus 10 ticks to for the deviation when defined NX_IP_PERIODIC_RATE as 1000. */ + tx_thread_sleep(NX_PATH_MTU_INCREASE_WAIT_INTERVAL_TICKS + NX_IP_PERIODIC_RATE / 100); +#else + tx_thread_sleep(NX_PATH_MTU_INCREASE_WAIT_INTERVAL_TICKS); +#endif + + /* Check the destination table. */ + if ((ip_0.nx_ipv6_destination_table_size != 3) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[0] != 0xfe800000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[1] != 0x00000000) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[1] != 0xffff0100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_destination_address[3] != 0xfe000100) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[0] != 0x3ffe0501) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[1] != 0xffff0102) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[2] != 0x020000ff) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_destination_address[3] != 0xfe00a2a2) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_path_mtu != 1500) || + (ip_0.nx_ipv6_destination_table[2].nx_ipv6_destination_entry_MTU_timer_tick != NX_WAIT_FOREVER)) + error_counter ++; + + /* Check error_counter and packet_counter. */ + if ((error_counter) || (packet_counter != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Out successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Check whether it is an NS packet. */ + if ((packet_counter == 0) && (packet_ptr -> nx_packet_length == (sizeof(pkt3) - 14))) + { + + /* Updated the packet counter. */ + packet_counter ++; + + /* Send NA packet to ip_0. */ + /* The source address is 0x3ffe:501:ffff:100:200:ff:fe00:100. */ + /* The destination address is 0x3ffe:501:ffff:100:211:22ff:fe33:4456. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt4[14], sizeof(pkt4) - 14); + my_packet -> nx_packet_length = sizeof(pkt4) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_receive(&ip_0, my_packet); + } + + /* Check whether it is an Echo Reply packet. */ + if ((packet_counter == 1) && (packet_ptr -> nx_packet_length == (sizeof(pkt5) - 14))) + { + + /* Updated the packet counter. */ + packet_counter ++; + } + + /* Check whether it is an Echo Reply packet. */ + if ((packet_counter == 2) && (packet_ptr -> nx_packet_length == (sizeof(pkt7) - 14))) + { + + /* Updated the packet counter. */ + packet_counter ++; + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_destination_table_periodic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Destination Table Periodic Test....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_echo_reply_test.c b/test/regression/netxduo_test/netx_icmpv6_echo_reply_test.c new file mode 100644 index 00000000..b8fa7c08 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_echo_reply_test.c @@ -0,0 +1,287 @@ +/* This NetX test to test the ICMPv6 Echo Reply process. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_IPV6_DAD) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void icmp_checksum_compute(NX_PACKET *packet_ptr); + +/* Frame (68 bytes) */ +static const unsigned char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x81, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_echo_reply_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*4); + pointer = pointer + 1536*4; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check IP create status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NX_IPV6_HEADER *ip_header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Echo Reply Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address*/ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Before DAD complete. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 54); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 54; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 54; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the ICMPv6 Echo Reply. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_ping_responses_received != 1) || (ip_0.nx_ip_icmp_invalid_packets != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 54); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 54; + + /* Set the error append pointer. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 54; + + /* Points to the base of IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER*)my_packet -> nx_packet_prepend_ptr; + + /* Modified the source address as invalid. */ + ip_header_ptr -> nx_ip_header_source_ip[0] = 0; + ip_header_ptr -> nx_ip_header_source_ip[1] = 0; + ip_header_ptr -> nx_ip_header_source_ip[2] = 0; + ip_header_ptr -> nx_ip_header_source_ip[3] = 0; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the ICMPv6 Echo Reply with error source address. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_ping_responses_received != 2) || (ip_0.nx_ip_icmp_invalid_packets != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 54); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 54; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 54; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the valid ICMPv6 Echo Reply. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_ping_responses_received != 3) || (ip_0.nx_ip_icmp_invalid_packets != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Out successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void icmp_checksum_compute(NX_PACKET *packet_ptr) +{ +NX_ICMPV6_HEADER *header_ptr; +ULONG *source_ip, *dest_ip; +ULONG checksum; + + /* Set packet version. */ + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Skip IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV6_HEADER); + + /* Get IPv6 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 32); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 16); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(dest_ip); + + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the ICMP checksum. */ + header_ptr -> nx_icmpv6_header_checksum = 0; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_ICMPV6, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + header_ptr -> nx_icmpv6_header_checksum = checksum; + NX_CHANGE_USHORT_ENDIAN(header_ptr -> nx_icmpv6_header_checksum); + + /* Recover IPv6 header. */ + NX_IPV6_ADDRESS_CHANGE_ENDIAN(source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(dest_ip); + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_echo_reply_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Echo Reply Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_echo_request_test.c b/test/regression/netxduo_test/netx_icmpv6_echo_request_test.c new file mode 100644 index 00000000..20a8cfb0 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_echo_request_test.c @@ -0,0 +1,288 @@ +/* This NetX test to test the ICMPv6 Echo request process. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_IPV6_DAD) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void icmp_checksum_compute(NX_PACKET *packet_ptr); + +/* Frame (68 bytes) */ +static const unsigned char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_echo_request_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*4); + pointer = pointer + 1536*4; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check icmp enable status. */ + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NX_IPV6_HEADER *ip_header_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Echo Request Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address*/ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Before DAD complete. */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 54); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 54; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 54; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the ICMPv6 Echo Request. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_pings_received != 0) || (ip_0.nx_ip_pings_responded_to != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 54); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 54; + + /* Set the error append pointer. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 54; + + /* Points to the base of IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER*)my_packet -> nx_packet_prepend_ptr; + + /* Modified the source address as invalid. */ + ip_header_ptr -> nx_ip_header_source_ip[0] = 0; + ip_header_ptr -> nx_ip_header_source_ip[1] = 0; + ip_header_ptr -> nx_ip_header_source_ip[2] = 0; + ip_header_ptr -> nx_ip_header_source_ip[3] = 0; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the ICMPv6 Echo Request with error source address. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_pings_received != 0) || (ip_0.nx_ip_pings_responded_to != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 54); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 54; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 54; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the valid ICMPv6 Echo Request. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_pings_received != 1) || (ip_0.nx_ip_pings_responded_to != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Out successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void icmp_checksum_compute(NX_PACKET *packet_ptr) +{ +NX_ICMPV6_HEADER *header_ptr; +ULONG *source_ip, *dest_ip; +ULONG checksum; + + /* Set packet version. */ + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Skip IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV6_HEADER); + + /* Get IPv6 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 32); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 16); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(dest_ip); + + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the ICMP checksum. */ + header_ptr -> nx_icmpv6_header_checksum = 0; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_ICMPV6, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + header_ptr -> nx_icmpv6_header_checksum = checksum; + NX_CHANGE_USHORT_ENDIAN(header_ptr -> nx_icmpv6_header_checksum); + + /* Recover IPv6 header. */ + NX_IPV6_ADDRESS_CHANGE_ENDIAN(source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(dest_ip); + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV6_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_echo_request_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Echo Request Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_error_small_packet_test.c b/test/regression/netxduo_test/netx_icmpv6_error_small_packet_test.c new file mode 100644 index 00000000..c282d8fc --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_error_small_packet_test.c @@ -0,0 +1,305 @@ +/* This NetX test concentrates on icmpv6 error function. */ +/* + * 1. IP 0 sends a UDP packet to IP 1. + * 2. Since IP 1 has no UDP socket binding, it will reply ICMPv6 error. + * 3. No ICMPv6 error message is sent out since IP 1 payload is too small. + * + */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined (NX_DISABLE_ICMPV6_ERROR_MESSAGE) && !defined(NX_DISABLE_PACKET_CHAIN) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; + +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS multicast_addr; +static NXD_ADDRESS lla_1; +static NXD_ADDRESS lla_2; + +static UCHAR pool_area_0[40960]; +static UCHAR pool_area_1[2048]; +static UCHAR test_data[128]; +static CHAR mac[2][6] = {{0x00, 0x11, 0x22, 0x33, 0x44, 0x56}, {0x00, 0x11, 0x22, 0x33, 0x44, 0x57}}; +static ULONG icmpv6_error_count; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT _nx_ram_network_driver_set_pool(NX_PACKET_POOL *pool_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_error_small_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + icmpv6_error_count = 0; + memset(test_data, 255, sizeof(test_data)); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pool_area_0, sizeof(pool_area_0)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", NX_IPv6_ICMP_PACKET, pool_area_1, sizeof(pool_area_1)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + multicast_addr.nxd_ip_version = NX_IP_VERSION_V6; + multicast_addr.nxd_ip_address.v6[0] = 0xFF020000; + multicast_addr.nxd_ip_address.v6[1] = 0x00000000; + multicast_addr.nxd_ip_address.v6[2] = 0x00000000; + multicast_addr.nxd_ip_address.v6[3] = 0x00000001; + + lla_1.nxd_ip_version = NX_IP_VERSION_V6; + lla_1.nxd_ip_address.v6[0] = 0xfe800000; + lla_1.nxd_ip_address.v6[1] = 0x00000000; + lla_1.nxd_ip_address.v6[2] = 0x00000000; + lla_1.nxd_ip_address.v6[3] = 0x10000001; + + lla_2.nxd_ip_version = NX_IP_VERSION_V6; + lla_2.nxd_ip_address.v6[0] = 0xfe800000; + lla_2.nxd_ip_address.v6[1] = 0x00000000; + lla_2.nxd_ip_address.v6[2] = 0x00000000; + lla_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + /* Check for IPv6 address set errors. */ + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check for IPv6 enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check for ICMP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status += nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: ICMPv6 Error Small Packet Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait until DAD finishes. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + advanced_packet_process_callback = my_packet_process; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver use large pool. */ + _nx_ram_network_driver_set_pool(&pool_0); + + /* Test error message with icmp disabled. */ + /* Set nd cache so no NS or NA is needed. */ + nxd_nd_cache_entry_set(&ip_0, ipv6_address_2.nxd_ip_address.v6, 0, mac[1]); + nxd_nd_cache_entry_set(&ip_1, ipv6_address_1.nxd_ip_address.v6, 0, mac[0]); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Write data into the packet payload! */ + status += nx_packet_data_append(my_packet, test_data, sizeof(test_data), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet to unbinded peer. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_2, 0x89); + + /* Check status. */ + if ((status) || (icmpv6_error_count != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *data = packet_ptr -> nx_packet_prepend_ptr; + + /* Check whether it is an icmpv6 packet. */ + if (packet_ptr -> nx_packet_length >= 48) + { + + /* Is it ICMPv6 packet? */ + if (data[6] == 0x3A) + { + + /* ICMPv6 error message. */ + if (data[40] == 0x01) + { + + /* Yes it is. */ + icmpv6_error_count++; + } + } + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_error_small_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ICMPv6 Error Small Packet Test............................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_error_test.c b/test/regression/netxduo_test/netx_icmpv6_error_test.c new file mode 100644 index 00000000..46f68999 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_error_test.c @@ -0,0 +1,548 @@ +/* This NetX test concentrates on icmpv6 error function. */ +/* + * 1. IP 0 sends a UDP packet to IP 1. + * 2. Since IP 1 has no UDP socket binding, it will reply ICMPv6 error. + * 3. During sending ICMPv6 error packet, original data are copied. + * 4. Since IP 1 has smaller payload pool than IP 0, there was a bug causes memory leak. + * + */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined (NX_DISABLE_ICMPV6_ERROR_MESSAGE) && !defined(NX_DISABLE_PACKET_CHAIN) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; + +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS multicast_addr; +static NXD_ADDRESS lla_1; +static NXD_ADDRESS lla_2; + +static UCHAR pool_area_0[40960]; +static UCHAR pool_area_1[2048]; +static UCHAR clean_buffer[1024]; +static UCHAR test_data[1024]; +static CHAR mac[2][6] = {{0x00, 0x11, 0x22, 0x33, 0x44, 0x56}, {0x00, 0x11, 0x22, 0x33, 0x44, 0x57}}; +static ULONG dest_unreachable_count; +static ULONG parameter_problem_count; +static NX_PACKET *test_packet[10]; + +/* Packet to trigger parameter problem message. + * src: 2001::1000:1 + * dst: ff02::1 */ +static const unsigned char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x25, 0x00, 0xff, 0x20, 0x01, /* ...%.. . */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3c, 0x00, /* ......<. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, /* ......,. */ +0x87, 0x04, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x80, 0x00, /* .....e.. */ +0x10, 0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05 /* ... */ +}; + +/* Packet to trigger parameter problem message. + * src: fe80::1000:1 + * dst: ff02::1 */ +static const unsigned char pkt2[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x25, 0x00, 0xff, 0xfe, 0x80, /* ...%.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3c, 0x00, /* ......<. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, /* ......,. */ +0x87, 0x04, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x80, 0x00, /* .....e.. */ +0x10, 0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05 /* ... */ +}; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT _nx_ram_network_driver_set_pool(NX_PACKET_POOL *pool_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_error_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + dest_unreachable_count = 0; + parameter_problem_count = 0; + memset(clean_buffer, 0, sizeof(clean_buffer)); + memset(test_data, 255, sizeof(test_data)); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pool_area_0, sizeof(pool_area_0)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 544, pool_area_1, sizeof(pool_area_1)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + multicast_addr.nxd_ip_version = NX_IP_VERSION_V6; + multicast_addr.nxd_ip_address.v6[0] = 0xFF020000; + multicast_addr.nxd_ip_address.v6[1] = 0x00000000; + multicast_addr.nxd_ip_address.v6[2] = 0x00000000; + multicast_addr.nxd_ip_address.v6[3] = 0x00000001; + + lla_1.nxd_ip_version = NX_IP_VERSION_V6; + lla_1.nxd_ip_address.v6[0] = 0xfe800000; + lla_1.nxd_ip_address.v6[1] = 0x00000000; + lla_1.nxd_ip_address.v6[2] = 0x00000000; + lla_1.nxd_ip_address.v6[3] = 0x10000001; + + lla_2.nxd_ip_version = NX_IP_VERSION_V6; + lla_2.nxd_ip_address.v6[0] = 0xfe800000; + lla_2.nxd_ip_address.v6[1] = 0x00000000; + lla_2.nxd_ip_address.v6[2] = 0x00000000; + lla_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + /* Check for IPv6 address set errors. */ + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check for IPv6 enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check for ICMP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status += nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: ICMPv6 Error Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait until DAD finishes. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + advanced_packet_process_callback = my_packet_process; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver use large pool. */ + _nx_ram_network_driver_set_pool(&pool_0); + + /* Test error message with icmp disabled. */ + /* Set nd cache so no NS or NA is needed. */ + nxd_nd_cache_entry_set(&ip_0, ipv6_address_2.nxd_ip_address.v6, 0, mac[1]); + nxd_nd_cache_entry_set(&ip_1, ipv6_address_1.nxd_ip_address.v6, 0, mac[0]); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Write data into the packet payload! */ + status += nx_packet_data_append(my_packet, test_data, sizeof(test_data), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet to unbinded peer. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_2, 0x89); + + /* Check status. */ + if ((status) || (dest_unreachable_count != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test error message with icmp enabled. */ + nxd_icmp_enable(&ip_1); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Write data into the packet payload! */ + status += nx_packet_data_append(my_packet, test_data, sizeof(test_data), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate all packets of IP1's default pool. */ + for (i = 0; i < sizeof(test_packet) / sizeof(NX_PACKET *); i++) + { + if (nx_packet_allocate(&pool_1, &test_packet[i], 0, NX_NO_WAIT)) + break; + } + + /* Whether array reaches the bound. */ + if (i == sizeof(test_packet) / sizeof(NX_PACKET *)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet to unbinded peer. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_2, 0x89); + + /* No destination unrechable message should received since pool of IP1 is empty. */ + /* Check status. */ + if ((status) || (dest_unreachable_count != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release all packets. */ + while (i != 0) + { + i--; + nx_packet_release(test_packet[i]); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Write data into the packet payload! */ + status += nx_packet_data_append(my_packet, test_data, sizeof(test_data), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet to unbinded peer. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_2, 0x89); + + /* Check status. */ + if ((status) || (dest_unreachable_count != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify all packets are normal. */ + for (i = 0; i < sizeof(test_packet) / sizeof(NX_PACKET *); i++) + { + if (nx_packet_allocate(&pool_1, &test_packet[i], 0, NX_NO_WAIT)) + break; + nx_packet_data_append(test_packet[i], test_data, pool_1.nx_packet_pool_payload_size, &pool_1, NX_NO_WAIT); + } + + /* Whether array reaches the bound. */ + if (i == sizeof(test_packet) / sizeof(NX_PACKET *)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release all packets. */ + while (i != 0) + { + i--; + nx_packet_release(test_packet[i]); + } + + /* Verify the clean buffer is not polluted. */ + for (i = 0; i < sizeof(clean_buffer); i++) + { + if (clean_buffer[i] != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + my_packet -> nx_packet_length = sizeof(pkt1) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Directly receive the packet to let IP 1 send parameter problem packet. */ + _nx_ip_packet_deferred_receive(&ip_1, my_packet); + + /* Since IP 1 doesn't have link local address, the ICMPV6 error message can't be sent. */ + if (parameter_problem_count != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set link local address. */ + nxd_ipv6_address_set(&ip_0, 0, &lla_1, 10, NX_NULL); + nxd_ipv6_address_set(&ip_1, 0, &lla_2, 10, NX_NULL); + +#ifndef NX_DISABLE_IPV6_DAD + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + my_packet -> nx_packet_length = sizeof(pkt2) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Directly receive the packet to let IP 1 send parameter problem packet. + * Since lla_2 is not ready, no ICMPV6 message could be sent from link local address. */ + _nx_ip_packet_deferred_receive(&ip_1, my_packet); + + if (parameter_problem_count != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* NX_DISABLE_IPV6_DAD */ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + my_packet -> nx_packet_length = sizeof(pkt2) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Directly receive the packet to let IP 1 send parameter problem packet. */ + _nx_ip_packet_deferred_receive(&ip_1, my_packet); + + if (parameter_problem_count != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *data = packet_ptr -> nx_packet_prepend_ptr; + + /* Check whether it is an icmpv6 packet. */ + if (packet_ptr -> nx_packet_length >= 48) + { + + /* Is it ICMPv6 packet? */ + if (data[6] == 0x3A) + { + + /* Is it destination unreachable packet? */ + if (data[40] == 0x01) + { + + /* Yes it is. */ + dest_unreachable_count++; + } + + /* Is it parameter problem packet? */ + if (data[40] == 0x04) + { + + /* Yes it is. */ + parameter_problem_count++; + } + } + + /* Is it a framgent packet? */ + else if (data[6] == 0x2C) + { + + /* Is the offset non-zero? */ + if ((data[42] != 0) || ((data[32] & 0xF8) != 0)) + { + + /* Drop the fragment that is not header. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + } + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_error_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: ICMPv6 Error Test.........................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_invalid_length_test.c b/test/regression/netxduo_test/netx_icmpv6_invalid_length_test.c new file mode 100644 index 00000000..eb907ce1 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_invalid_length_test.c @@ -0,0 +1,183 @@ +/* Test processing of RA with invalid option type and length. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * ICMPv6 option type: 0. + * ICMPv6 option length: 8. + * Actual ICMPv6 option length: 4. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x93, 0x7d, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* .~@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_length_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid Length Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + +#ifndef NX_DISABLE_ICMP_INFO + if (ip_0.nx_ip_icmp_invalid_packets != 1) + error_counter++; +#endif /* NX_DISABLE_ICMP_INFO */ + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid Length Test................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_invalid_length_test2.c b/test/regression/netxduo_test/netx_icmpv6_invalid_length_test2.c new file mode 100644 index 00000000..f7d684cf --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_invalid_length_test2.c @@ -0,0 +1,177 @@ +/* Test processing of NS with invalid ICMPv6 payload length. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* NS packet. + * ICMPv6 type: 135. + * ICMPv6 code: 0. + * The length of ICMPv6 payload is 8. */ +static char ns_pkt[62] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x08, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, /* "..3DV.. */ +0x14, 0x20, 0x00, 0x00, 0x00, 0x00 /* c..... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_length_test2_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid Length Test 2.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ns_pkt[14], sizeof(ns_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ns_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (ip_0.nx_ip_icmp_invalid_packets != 1) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_length_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid Length Test 2..............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_invalid_message_test.c b/test/regression/netxduo_test/netx_icmpv6_invalid_message_test.c new file mode 100644 index 00000000..3f1780a4 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_invalid_message_test.c @@ -0,0 +1,230 @@ +/* Test processing of too big message with invalid length. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_RX_SIZE_CHECKING) +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Invalid too big message. */ +static char too_big_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x08, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xf2, 0x80, 0x00, 0x00, 0x05, 0x00 +}; + +static char echo_request_pkt[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x07, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x22, 0x00, 0x00, 0x00 +}; + +static char echo_reply_pkt[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x07, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x81, 0x00, +0x18, 0x22, 0x00, 0x00, 0x00 +}; + +typedef struct TEST_PACKET_STRUCT +{ + CHAR *test_packet_ptr; + UINT test_packet_length; + +}TEST_PACKET; + +static TEST_PACKET test_packet[] = +{ +#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY + { + too_big_pkt, + sizeof(too_big_pkt), + }, +#endif + { + echo_request_pkt, + sizeof(echo_request_pkt), + }, + { + echo_reply_pkt, + sizeof(echo_reply_pkt), + }, +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_message_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; +INT i; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid Message Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject the test packets. */ + for (i = 0; i < (sizeof(test_packet) / sizeof(TEST_PACKET)); i++) + { + + /* Allocate packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if (status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr->nx_packet_prepend_ptr, test_packet[i].test_packet_ptr + 14, test_packet[i].test_packet_length - 14); + packet_ptr->nx_packet_length = test_packet[i].test_packet_length - 14; + packet_ptr->nx_packet_append_ptr = packet_ptr->nx_packet_prepend_ptr + packet_ptr->nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + } + +#ifndef NX_DISABLE_ICMP_INFO + if (ip_0.nx_ip_icmp_invalid_packets != (sizeof(test_packet) / sizeof(TEST_PACKET))) + error_counter++; +#endif /* NX_DISABLE_ICMP_INFO */ + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_message_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid Message Test...............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_invalid_na.c b/test/regression/netxduo_test/netx_icmpv6_invalid_na.c new file mode 100644 index 00000000..c848d36d --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_invalid_na.c @@ -0,0 +1,178 @@ +/* Test processing of NA with same target address after DAD. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* NA packet. + * target Address: FE80::211:22FF:FE33:4456 */ +static char na_pkt[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x7c, 0xb7, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* |.`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, /* "..3DV.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_na_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid NA Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &na_pkt[14], sizeof(na_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(na_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (ip_0.nx_ip_icmp_invalid_packets != 1) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_na_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid NA Test....................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_invalid_ra_dest_test.c b/test/regression/netxduo_test/netx_icmpv6_invalid_ra_dest_test.c new file mode 100644 index 00000000..d3ea2ba9 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_invalid_ra_dest_test.c @@ -0,0 +1,189 @@ +/* Test processing of RA with destination multicast address but not ff02::1. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_IP_INFO) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * destination: 0xff02::1:ff33:4456. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x86, 0x00, /* ...3DV.. */ +0xea, 0x6b, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* .k@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, /* @....... */ +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_ra_dest_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid RA Dest Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x021122FF; + ipv6_address.nxd_ip_address.v6[3] = 0xFE334456; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify the packet is received by IP but dropped by ICMP layer. */ + if ((ip_0.nx_ip_total_packets_delivered != 1) || (ip_0.nx_ip_icmp_invalid_packets != 1)) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_ra_dest_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid RA Dest Test...............................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_invalid_ra_option_test.c b/test/regression/netxduo_test/netx_icmpv6_invalid_ra_option_test.c new file mode 100644 index 00000000..3e8c11e3 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_invalid_ra_option_test.c @@ -0,0 +1,183 @@ +/* Test processing of RA with invalid option. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_IP_INFO) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * Invalid option length for option type ICMPV6_OPTION_TYPE_PREFIX_INFO. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, 0xa0, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, 0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_ra_option_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid RA Option Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x021122FF; + ipv6_address.nxd_ip_address.v6[3] = 0xFE334456; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Verify the packet is received by IP but dropped by ICMP layer. */ + if ((ip_0.nx_ip_total_packets_delivered != 1) || (ip_0.nx_ip_icmp_invalid_packets != 1)) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_invalid_ra_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Invalid RA Option Test.............................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_mtu_option_test.c b/test/regression/netxduo_test/netx_icmpv6_mtu_option_test.c new file mode 100644 index 00000000..f367a479 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_mtu_option_test.c @@ -0,0 +1,190 @@ +/* This NetX test concentrates on the IPv6 process ICMPv6 Option for MTU 0. + change last two bytes from 0x05, 0x00 to 0x00, 0x00 */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if defined FEATURE_NX_IPV6 && defined NX_ENABLE_IPV6_PATH_MTU_DISCOVERY + +#include "nx_icmpv6.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static char mtu_option[78] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x45, 0x1b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, /* E....... */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_mtu_option_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check IP create status. */ + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 MTU Option Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address*/ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &mtu_option[0], sizeof(mtu_option)); + my_packet -> nx_packet_length = sizeof(mtu_option); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Directly pointer to ICMPv6 MTU option. */ + my_packet -> nx_packet_prepend_ptr += 70; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_ipv6_address_ptr = &ip_0.nx_ipv6_address[0]; + + /* Call function to process the MTU option. */ + status = _nx_icmpv6_process_packet_too_big(&ip_0, my_packet); + + /* Check the error counter. */ + if (status != NX_INVALID_MTU_DATA) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_mtu_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 MTU Option Test....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_icmpv6_na_buffer_overwrite_test.c b/test/regression/netxduo_test/netx_icmpv6_na_buffer_overwrite_test.c new file mode 100644 index 00000000..a746301c --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_na_buffer_overwrite_test.c @@ -0,0 +1,367 @@ +/* Test processing of NA with chained packet. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_RX_SIZE_CHECKING) + +#define DEMO_STACK_SIZE 2048 + +#define PACKET_PAYLOAD_SIZE 1508 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* NA packet. */ +static char na_pkt[] = { +0xc8, 0xd9, 0xd2, 0x23, 0xe4, 0x9a, 0xc8, 0xd9, /* ...#.... */ +0xd2, 0x24, 0x23, 0x53, 0x86, 0xdd, 0x60, 0x00, /* .$#S..`. */ +0x00, 0x00, 0x05, 0xb0, 0x00, 0xff, 0x11, 0x11, /* ........ */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x67, 0x11, 0x11, /* ..fffg.. */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3a, 0xb4, /* ..ffff:. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, /* ........ */ +0x99, 0xde, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_na_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_PAYLOAD_SIZE, pointer, (sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + pointer = pointer + ((sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NA Buffer Overwrite Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x11111111; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x66666666; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject NA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(packet_ptr, &na_pkt[14], sizeof(na_pkt) - 14, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter++; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Wait 1s to process this NA packet. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_na_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NA Buffer Overwrite Test...........................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_na_test.c b/test/regression/netxduo_test/netx_icmpv6_na_test.c new file mode 100644 index 00000000..4ebef5c2 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_na_test.c @@ -0,0 +1,262 @@ +/* Test the process of NA packet. Section 7.2.5, RFC 4861 + * 1. Inject RA packet with TLLA. + * 2. Inject NA packet with different LLA. All flags are not set. + * 3. Router should not be modified since overwrite bit is not set and TLLA is different. + * 4. Inject NA packet with no TLLA. All flags are not set. + * 5. Router should be deleted since no TLLA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static char ra_pkt[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x1c, 0xb4, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, /* ..@..... */ +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static char na_pkt1[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x75, 0x9c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* u....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 /* ...... */ +}; + +static char na_pkt2[78] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd1, 0x4e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .N...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_na_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +UINT num_entries; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NA Test............................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check whether one router is added. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 1) + error_counter++; + + + /* Inject the first NA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &na_pkt1[14], sizeof(na_pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(na_pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check whether one router is still available. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 1) + error_counter++; + + + /* Inject the second NA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &na_pkt2[14], sizeof(na_pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(na_pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check whether no router is available. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 0) + error_counter++; + + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_na_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NA Test............................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_na_tlla_changed_test.c b/test/regression/netxduo_test/netx_icmpv6_na_tlla_changed_test.c new file mode 100644 index 00000000..3fead71e --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_na_tlla_changed_test.c @@ -0,0 +1,346 @@ +/* Test processing of solicitated RA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 +#include "nx_nd_cache.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Packet trace from 73 of section 2, TAHI test. */ +/* Frame (70 bytes) */ +static unsigned char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static unsigned char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static unsigned char pkt5[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0xe5, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0xa0, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Packet trace from 125 of section 2, TAHI test. */ +/* Frame (110 bytes) */ +static unsigned char ra_pkt[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xa0, 0x49, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* .I@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static unsigned char pkt8[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x0e, 0x05, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0xa0, 0xa0, 0xa0 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_na_tlla_changed_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS router_address; +NX_PACKET *packet_ptr; +UINT interface_index; +ULONG physical_msw; +ULONG physical_lsw; +ND_CACHE_ENTRY + *nd_entry; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NA TLLA Changed Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x021122FF; + ipv6_address.nxd_ip_address.v6[3] = 0xFE334456; + router_address.nxd_ip_version = NX_IP_VERSION_V6; + router_address.nxd_ip_address.v6[0] = 0xFE800000; + router_address.nxd_ip_address.v6[1] = 0x00000000; + router_address.nxd_ip_address.v6[2] = 0x020000FF; + router_address.nxd_ip_address.v6[3] = 0xFE000100; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + /* Inject echo request packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the echo request packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Inject NA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt3) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (nxd_nd_cache_hardware_address_find(&ip_0, &router_address, &physical_msw, &physical_lsw, &interface_index)) + error_counter++; + else if ((physical_msw != 0x0) || (physical_lsw != 0x100)) + error_counter++; + + + /* Inject NA packet with different TLLA. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt5[14], sizeof(pkt5) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt5) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (nxd_nd_cache_hardware_address_find(&ip_0, &router_address, &physical_msw, &physical_lsw, &interface_index)) + error_counter++; + else if ((physical_msw != 0x00) || (physical_lsw != 0xa000a0a0)) + error_counter++; + + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Find the ND cache and set te status to created. */ + if (_nx_nd_cache_find_entry(&ip_0, router_address.nxd_ip_address.v6, &nd_entry)) + { + printf("ERROR!\n"); + test_control_return(1); + } + nd_entry -> nx_nd_cache_nd_status = ND_CACHE_STATE_CREATED; + + /* Inject NA packet with different TLLA. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt5[14], sizeof(pkt5) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt5) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Inject NA packet with r bit changed from TRUE to FALSE. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt8[14], sizeof(pkt8) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt8) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_na_tlla_changed_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NA TLLA Changed Test...............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ns_buffer_overwrite_test.c b/test/regression/netxduo_test/netx_icmpv6_ns_buffer_overwrite_test.c new file mode 100644 index 00000000..d044354b --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ns_buffer_overwrite_test.c @@ -0,0 +1,367 @@ +/* Test processing of NS with chained packet. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_RX_SIZE_CHECKING) + +#define DEMO_STACK_SIZE 2048 + +#define PACKET_PAYLOAD_SIZE 1508 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* NS packet. */ +static char ns_pkt[] = { +0xc8, 0xd9, 0xd2, 0x23, 0xe4, 0x9a, 0xc8, 0xd9, /* ...#.... */ +0xd2, 0x24, 0x23, 0x53, 0x86, 0xdd, 0x60, 0x00, /* .$#S..`. */ +0x00, 0x00, 0x05, 0xb0, 0x00, 0xff, 0x11, 0x11, /* ........ */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x67, 0x11, 0x11, /* ..fffg.. */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3a, 0xb4, /* ..ffff:. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, /* ........ */ +0x9a, 0xde, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ns_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_PAYLOAD_SIZE, pointer, (sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + pointer = pointer + ((sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NS Buffer Overwrite Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x11111111; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x66666666; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject NS packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(packet_ptr, &ns_pkt[14], sizeof(ns_pkt) - 14, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter++; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Wait 1s to process this NS packet. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ns_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NS Buffer Overwrite Test...........................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ns_with_small_packet_test.c b/test/regression/netxduo_test/netx_icmpv6_ns_with_small_packet_test.c new file mode 100644 index 00000000..0e2315b1 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ns_with_small_packet_test.c @@ -0,0 +1,166 @@ +/* This NetX test concentrates on the ICMPV6 NS operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV6_DAD) +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ +static ULONG error_counter; +static ULONG NS_counter; + +/* Define thread prototypes. */ +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ns_with_small_packet_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_IPv6_ICMP_PACKET, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check IP create status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status = 0; +UINT address_index; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NS With Small Packet Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Hook link driver to check packets. */ + packet_process_callback = packet_process; + + /* Set the IPv6 linklocal address for IP instance 0. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the NS counter. */ + if(NS_counter != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_ICMPV6_HEADER *header_ptr; + + + /* Points to the ICMP message header. */ + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)); + + /* Determine the message type and call the appropriate handler. */ + if (header_ptr -> nx_icmpv6_header_type == NX_ICMPV6_NEIGHBOR_SOLICITATION_TYPE) + { + + /* Update the NS counter. */ + NS_counter ++; + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ns_with_small_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 NS With Small Packet Test..........................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_address_full_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_address_full_test.c new file mode 100644 index 00000000..60d6d4a5 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_address_full_test.c @@ -0,0 +1,198 @@ +/* Test processing of solicitated RA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * destination: 0xfe80::1. + * reachable time: 1ms. + * retrans timer: 1ms. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x73, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* Bs@..... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_address_full_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Address Full Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00000001; + + /* Loop to set the linklocal address. All address entries are used. */ + while (nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index) == NX_SUCCESS) + { + ipv6_address.nxd_ip_address.v6[3]++; + } + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Sleep 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + for (address_index = 0; address_index < NX_MAX_IPV6_ADDRESSES; address_index++) + { + if (nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index)) + { + + /* No more addresses. */ + break; + } + + /* Check the prefix. */ + if (prefix_length == 64) + { + + /* Global address is set though address entries are all used. Error. */ + error_counter++; + break; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_address_full_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Address Full Test...............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_buffer_overwrite_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_buffer_overwrite_test.c new file mode 100644 index 00000000..a81cb1d6 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_buffer_overwrite_test.c @@ -0,0 +1,371 @@ +/* Test processing of too big with chained packet. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) && !defined(NX_DISABLE_RX_SIZE_CHECKING) && !defined(NX_DISABLE_PACKET_CHAIN) + +#define DEMO_STACK_SIZE 2048 + +#define PACKET_PAYLOAD_SIZE 1536 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Packet. */ +static char pkt[] = { +0xc8, 0xd9, 0xd2, 0x23, 0xe4, 0x9a, 0xc8, 0xd9, /* ...#.... */ +0xd2, 0x24, 0x23, 0x53, 0x86, 0xdd, 0x60, 0x00, /* .$#S..`. */ +0x00, 0x00, 0x05, 0xd0, 0x00, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x67, 0xfe, 0x80, /* ..fffg.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3a, 0xb3, /* ..ffff,. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, /* ........ */ +0x4a, 0x7a, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* Bs@..... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_PAYLOAD_SIZE, pointer, (sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + pointer = pointer + ((sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Buffer Overwrite Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x66666666; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject NS packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(packet_ptr, &pkt[14], sizeof(pkt) - 14, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter++; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Wait 1s to process this NS packet. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Buffer Overwrite Test...........................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_flag_callback_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_flag_callback_test.c new file mode 100644 index 00000000..55abcd8b --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_flag_callback_test.c @@ -0,0 +1,192 @@ +/* Test ICMPv6 RA flag callback function. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UINT ra_flag_notified; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID icmpv6_ra_flag_callback(NX_IP *ip_ptr, UINT ra_flag); + +/* RA packet with prefix length 128. */ +static char pkt_prefix_128[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xed, 0xeb, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x80, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_flag_callback_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + ra_flag_notified = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Flag Callback Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set callback function. */ + nxd_icmpv6_ra_flag_callback_set(&ip_0, icmpv6_ra_flag_callback); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA with prefix length 128. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_prefix_128[14], sizeof(pkt_prefix_128) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt_prefix_128) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check whether icmpv6_ra_flag_callback is called. */ + if (ra_flag_notified != NX_TRUE) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID icmpv6_ra_flag_callback(NX_IP *ip_ptr, UINT ra_flag) +{ + ra_flag_notified = NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_flag_callback_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Flag Callback Test..............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_invalid_length_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_invalid_length_test.c new file mode 100644 index 00000000..842b74be --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_invalid_length_test.c @@ -0,0 +1,176 @@ +/* Test processing of RA with invalid length. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + Invalid length. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x02, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf9, 0xf8, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03 +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_invalid_length_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Invalid Length Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (ip_0.nx_ip_icmp_invalid_packets != 1) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_invalid_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Invalid Length Test.............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_lifetime_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_lifetime_test.c new file mode 100644 index 00000000..4aeeddc4 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_lifetime_test.c @@ -0,0 +1,231 @@ +/* Test the lifetime of RA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * router lifetime: 5s. + * prefix: 0x2001::/64. */ +static char ra_pkt1[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xd4, 0x71, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, /* .q...... */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* u0...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, /* :..... . */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* RA packet. + * router lifetime: 6s. + * prefix: 0x2002::/64. */ +static char ra_pkt2[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x02, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xd3, 0x6f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, /* .o...... */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* u0...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, /* :..... . */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_lifetime_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +UINT num_entries; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Lifetime Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt1[14], sizeof(ra_pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt2[14], sizeof(ra_pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Check whether two routers are added. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 2) + error_counter++; + + + /* Wait until router timeouts. */ + tx_thread_sleep(10 * NX_IP_PERIODIC_RATE); + + + /* Check whether no routers are available. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 0) + error_counter++; + + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_lifetime_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Lifetime Test...................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_router_full_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_router_full_test.c new file mode 100644 index 00000000..dc5b59f0 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_router_full_test.c @@ -0,0 +1,186 @@ +/* Test processing of solicitated RA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * destination: 0xfe80::1. + * reachable time: 1ms. + * retrans timer: 1ms. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x73, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* Bs@..... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_router_full_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS router_address; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Address Full Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00000001; + router_address.nxd_ip_version = NX_IP_VERSION_V6; + router_address.nxd_ip_address.v6[0] = 0xFE800000; + router_address.nxd_ip_address.v6[1] = 0x00000000; + router_address.nxd_ip_address.v6[2] = 0x00000000; + router_address.nxd_ip_address.v6[3] = 0x00000002; + + /* Set the linklocal address. */ + if (nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index)) + error_counter++; + + /* Sleep 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Loop to add router until full. */ + while (nxd_ipv6_default_router_add(&ip_0, &router_address, 3600, 0) == NX_SUCCESS) + { + router_address.nxd_ip_address.v6[3]++; + } + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_router_full_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA Address Full Test...............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_ra_slla_changed_test.c b/test/regression/netxduo_test/netx_icmpv6_ra_slla_changed_test.c new file mode 100644 index 00000000..d456f368 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_ra_slla_changed_test.c @@ -0,0 +1,253 @@ +/* Test processing of solicitated RA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Packet trace from 154 of section 2, TAHI test. */ +/* Frame (70 bytes) */ +static unsigned char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static unsigned char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* The MAC address in SLLA is changed to 00:c0:00:00:c0:c0. */ +/* Frame (78 bytes) */ +static unsigned char pkt5[78] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xad, 0x0d, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* '....... */ +0x00, 0xc0, 0x00, 0x00, 0xc0, 0xc0 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_slla_changed_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS router_address; +NX_PACKET *packet_ptr; +UINT interface_index; +ULONG physical_msw; +ULONG physical_lsw; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA SLLA Changed Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x021122FF; + ipv6_address.nxd_ip_address.v6[3] = 0xFE334456; + router_address.nxd_ip_version = NX_IP_VERSION_V6; + router_address.nxd_ip_address.v6[0] = 0xFE800000; + router_address.nxd_ip_address.v6[1] = 0x00000000; + router_address.nxd_ip_address.v6[2] = 0x020000FF; + router_address.nxd_ip_address.v6[3] = 0xFE00A0A0; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + /* Inject echo request packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the echo request packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Inject NA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt3) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the NA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (nxd_nd_cache_hardware_address_find(&ip_0, &router_address, &physical_msw, &physical_lsw, &interface_index)) + error_counter++; + else if ((physical_msw != 0x0) || (physical_lsw != 0xa0a0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt5[14], sizeof(pkt5) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt5) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (nxd_nd_cache_hardware_address_find(&ip_0, &router_address, &physical_msw, &physical_lsw, &interface_index)) + error_counter++; + else if ((physical_msw != 0xc0) || (physical_lsw != 0xc0c0)) + error_counter++; + + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_ra_slla_changed_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 RA SLLA Changed Test...............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_redirect_buffer_overwrite_test.c b/test/regression/netxduo_test/netx_icmpv6_redirect_buffer_overwrite_test.c new file mode 100644 index 00000000..9fe1a5d6 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_redirect_buffer_overwrite_test.c @@ -0,0 +1,370 @@ +/* Test processing of too big with chained packet. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_REDIRECT_PROCESS) && !defined(NX_DISABLE_RX_SIZE_CHECKING) && !defined(NX_DISABLE_PACKET_CHAIN) + +#define DEMO_STACK_SIZE 2048 + +#define PACKET_PAYLOAD_SIZE 1516 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Packet. */ +static char pkt[] = { +0xc8, 0xd9, 0xd2, 0x23, 0xe4, 0x9a, 0xc8, 0xd9, /* ...#.... */ +0xd2, 0x24, 0x23, 0x53, 0x86, 0xdd, 0x60, 0x00, /* .$#S..`. */ +0x00, 0x00, 0x05, 0xc8, 0x00, 0xff, 0x11, 0x11, /* ........ */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x67, 0x11, 0x11, /* ..fffg.. */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3a, 0xb3, /* ..ffff,. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x00, /* ........ */ +0x98, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_redirect_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_PAYLOAD_SIZE, pointer, (sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + pointer = pointer + ((sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Redirect Buffer Overwrite Test....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x11111111; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x66666666; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject NS packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(packet_ptr, &pkt[14], sizeof(pkt) - 14, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter++; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Wait 1s to process this NS packet. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_redirect_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Redirect Buffer Overwrite Test.....................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_redirect_nd_full_test.c b/test/regression/netxduo_test/netx_icmpv6_redirect_nd_full_test.c new file mode 100644 index 00000000..53ce9e44 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_redirect_nd_full_test.c @@ -0,0 +1,283 @@ +/* Test processing of REDIRECT message when ND cache is full. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet with SLLA and PREFIX options. */ +static char ra_pkt[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xa0, 0x49, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* .I@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Redirect packet */ +static char redirect_pkt[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, /* ...(:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x9a, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Redirect packet */ +static char redirect_tlla_pkt[102] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Redirect packet with TLLA changed */ +static char redirect_tlla_changed_pkt[102] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x9e, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_redirect_nd_full_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG address[4] = {0xfe800000, 0, 0, 1}; +CHAR mac[6] = {0, 0, 0, 0, 0, 1}; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Redirect ND Full Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Sleep 5 seconds for global address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + /* Inject REDIRECT packet with TLLA changed. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &redirect_tlla_changed_pkt[14], sizeof(redirect_tlla_changed_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(redirect_tlla_changed_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the REDIRECT packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Occupy all ND caches. */ + while (nxd_nd_cache_entry_set(&ip_0, address, 0, mac) == NX_SUCCESS) + { + address[3]++; + mac[5]++; + } + + /* Inject REDIRECT packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &redirect_pkt[14], sizeof(redirect_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(redirect_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the REDIRECT packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Inject REDIRECT packet with TLLA option. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &redirect_tlla_pkt[14], sizeof(redirect_tlla_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(redirect_tlla_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the REDIRECT packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Verify the redirect message is dropped. */ + if (ip_0.nx_ip_icmp_invalid_packets != 2) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_redirect_nd_full_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Redirect ND Full Test..............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_redirect_test.c b/test/regression/netxduo_test/netx_icmpv6_redirect_test.c new file mode 100644 index 00000000..73c45294 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_redirect_test.c @@ -0,0 +1,540 @@ +/* This NetX test to test the ICMPv6 Echo request process. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_REDIRECT_PROCESS) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG echo_request_sent; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* ICMPv6 redirect to 3ffe:501:ffff::200:ff:fe00:100. */ +static const unsigned char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xda, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + + +/* ICMPv6 redirect to 3ffe:501:ffff::300:ff:fe00:100. */ +static const unsigned char pkt2[102] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x95, 0xda, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x03, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x03, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + + +/* ICMPv6 redirect to 3ffe:501:ffff::200:ff:fe00:100. + * MTU in MTU option is 1484 */ +static const unsigned char pkt3[110] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x92, 0x40, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .0...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xcc, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + + +/* ICMPv6 redirect to 3ffe:501:ffff::200:ff:fe00:100. + * MTU in MTU option is 1244 */ +static const unsigned char pkt4[110] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x92, 0x32, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .0...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x05, 0xff, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x04, 0xdc, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* ICMPv6 redirect to 3ffe:501:ffff::200:ff:fe00:100. + * MTU in MTU option is 1200, less than NX_MINIMUM_IPV6_PATH_MTU */ +static const unsigned char pkt5[110] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, /* "..3DV.. */ +0x93, 0x5c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .0...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x04, 0xb0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_redirect_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + echo_request_sent = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*4); + pointer = pointer + 1536*4; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check IP create status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +NXD_ADDRESS src, dst, dst_2, router; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Redirect Test......................................"); + + /* Setup address. */ + src.nxd_ip_version = NX_IP_VERSION_V6; + src.nxd_ip_address.v6[0] = 0x3ffe0501; + src.nxd_ip_address.v6[1] = 0xffff0100; + src.nxd_ip_address.v6[2] = 0x021122ff; + src.nxd_ip_address.v6[3] = 0xfe334456; + + dst.nxd_ip_version = NX_IP_VERSION_V6; + dst.nxd_ip_address.v6[0] = 0x3ffe0501; + dst.nxd_ip_address.v6[1] = 0xffff0000; + dst.nxd_ip_address.v6[2] = 0x020000ff; + dst.nxd_ip_address.v6[3] = 0xfe000100; + + dst_2.nxd_ip_version = NX_IP_VERSION_V6; + dst_2.nxd_ip_address.v6[0] = 0x3ffe0501; + dst_2.nxd_ip_address.v6[1] = 0xffff0000; + dst_2.nxd_ip_address.v6[2] = 0x030000ff; + dst_2.nxd_ip_address.v6[3] = 0xfe000100; + + router.nxd_ip_version = NX_IP_VERSION_V6; + router.nxd_ip_address.v6[0] = 0xfe800000; + router.nxd_ip_address.v6[1] = 0x00000000; + router.nxd_ip_address.v6[2] = 0x020000ff; + router.nxd_ip_address.v6[3] = 0xfe00a0a0; + + /* Set the linklocal address*/ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 0, &src, 64, NX_NULL); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Send ICMP redirect packet to ip_0. */ + /* The redirect destination is 0x3ffe:501:ffff:0:200:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Since this message is not sent from router(no router yet). It should not be added into destination table. */ + if (ip_0.nx_ipv6_destination_table_size != 0) + { + error_counter++; + } + + /* Set router. */ + nxd_ipv6_default_router_add(&ip_0, &router, 60, 0); + + /* Send ICMP redirect packet to ip_0. */ + /* The redirect destination is 0x3ffe:501:ffff:0:200:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the destination table. */ + if ((ip_0.nx_ipv6_destination_table_size != 1) || (ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_valid != NX_TRUE)) + { + error_counter++; + } + + + /* Now move this desitnation table entry from the first one to the second one. */ + memcpy(&ip_0.nx_ipv6_destination_table[1], &ip_0.nx_ipv6_destination_table[0], sizeof(ip_0.nx_ipv6_destination_table[0])); + ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_valid = NX_FALSE; + + + /* Send ICMP redirect packet to ip_0. */ + /* The redirect destination is 0x3ffe:501:ffff:0:200:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the destination table. */ + if ((ip_0.nx_ipv6_destination_table_size != 1) || (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_valid != NX_TRUE)) + { + error_counter++; + } + + /* Setup filter function to check whether echo request is sent. */ + advanced_packet_process_callback = my_packet_process; + status = nxd_icmp_ping(&ip_0, &dst, "", 0, &packet_ptr, NX_NO_WAIT); + + if ((status == NX_SUCCESS) || (echo_request_sent != 1)) + { + error_counter++; + } + + + /* Occupy all destination tables. */ + for (i = 0; i < NX_IPV6_DESTINATION_TABLE_SIZE; i++) + { + if (i != 1) + { + memcpy(&ip_0.nx_ipv6_destination_table[i], &ip_0.nx_ipv6_destination_table[1], sizeof(ip_0.nx_ipv6_destination_table[i])); + ip_0.nx_ipv6_destination_table_size++; + } + } + + /* The redirect destination is 0x3ffe:501:ffff:0:300:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Release destination tables occpied before. */ + for (i = 0; i < NX_IPV6_DESTINATION_TABLE_SIZE; i++) + { + if (i != 1) + { + ip_0.nx_ipv6_destination_table[i].nx_ipv6_destination_entry_valid = NX_FALSE; + ip_0.nx_ipv6_destination_table_size--; + } + } + + + /* Send ICMP redirect packet to ip_0. */ + /* The redirect destination is 0x3ffe:501:ffff:0:300:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the destination table. */ + if (ip_0.nx_ipv6_destination_table_size != 2) + { + error_counter++; + } + + /* Setup filter function to check whether echo request is sent. */ + advanced_packet_process_callback = my_packet_process; + status = nxd_icmp_ping(&ip_0, &dst_2, "", 0, &packet_ptr, NX_NO_WAIT); + + if ((status == NX_SUCCESS) || (echo_request_sent != 2)) + { + error_counter++; + } + + + /* Remove destination entry for 0x3ffe:501:ffff:0:200:ff:fe00:100*/ + ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_valid = NX_FALSE; + ip_0.nx_ipv6_destination_table_size--; + + /* The redirect destination is 0x3ffe:501:ffff:0:200:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt3) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the destination table. */ + if (ip_0.nx_ipv6_destination_table_size != 2) + { + error_counter++; + } + +#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY + if (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_path_mtu != 1484) + { + error_counter++; + } +#endif /* NX_ENABLE_IPV6_PATH_MTU_DISCOVERY */ + + + /* Remove destination entry for 0x3ffe:501:ffff:0:200:ff:fe00:100*/ + ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_valid = NX_FALSE; + ip_0.nx_ipv6_destination_table_size--; + + /* The redirect destination is 0x3ffe:501:ffff:0:200:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt4[14], sizeof(pkt4) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt4) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the destination table. The option length is invalid, so the destination table is not updated. */ + if (ip_0.nx_ipv6_destination_table_size != 1) + { + error_counter++; + } + + /* The redirect destination is 0x3ffe:501:ffff:0:200:ff:fe00:100. */ + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_RECEIVE_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt5[14], sizeof(pkt5) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt5) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the ICMP redirect packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the destination table. */ + if (ip_0.nx_ipv6_destination_table_size != 2) + { + error_counter++; + } + +#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY + if (ip_0.nx_ipv6_destination_table[1].nx_ipv6_destination_entry_path_mtu != 1200) + { + error_counter++; + } +#endif /* NX_ENABLE_IPV6_PATH_MTU_DISCOVERY */ + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Out successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UCHAR *data = packet_ptr -> nx_packet_prepend_ptr; + + /* Check whether it is an echo request packet. */ + if (packet_ptr -> nx_packet_length == 48) + { + + /* Is it ICMPv6 packet? */ + if (data[6] == 0x3A) + { + /* Is the ICMPv6 type echo request? */ + if (data[40] == 0x80) + { + + /* It is echo request packet. */ + echo_request_sent++; + advanced_packet_process_callback = NX_NULL; + } + } + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_redirect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Redirect Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_icmpv6_router_solicitation_test.c b/test/regression/netxduo_test/netx_icmpv6_router_solicitation_test.c new file mode 100644 index 00000000..922fe31d --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_router_solicitation_test.c @@ -0,0 +1,211 @@ +/* Test ICMPv6 Router Solicitation for _nx_packet_allocate failure in _nx_icmpv6_send.rs. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_SOLICITATION) + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rs_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_router_solicitation_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + rs_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Router Solicitation Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to process the RS packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the Router */ + if (ip_0.nx_ip_interface[0].nx_ipv6_rtr_solicitation_count != 3) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for linklocal address DAD and (NX_ICMPV6_RTR_SOLICITATION_INTERVAL*3) for Router Solicitation. */ + tx_thread_sleep((5 + (NX_ICMPV6_RTR_SOLICITATION_INTERVAL * 3)) * NX_IP_PERIODIC_RATE); + + /* Check the Router Solicitation count. */ + if (ip_0.nx_ip_interface[0].nx_ipv6_rtr_solicitation_count != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the error. */ + if((error_counter) ||(rs_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +UINT i; +UINT packet_counter; +NX_ICMPV6_HEADER *header_ptr; +NX_PACKET *tmp_packet[16]; + + + /* Points to the ICMP message header. */ + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)); + + /* Determine the message type and call the appropriate handler. */ + if (header_ptr -> nx_icmpv6_header_type == NX_ICMPV6_ROUTER_SOLICITATION_TYPE) + { + + /* Update the RS counter. */ + rs_counter ++; + } + + /* Check the rs_counter, allocate all packets to let ip_0 send RS failure. */ + if (rs_counter == 1) + { + + /* Release the RS packet. */ + nx_packet_release(packet_ptr); + + /* Get the available packet. */ + packet_counter = pool_0.nx_packet_pool_available; + + /* Loop to allocate the all packets from pool_0. */ + for (i = 0; i < packet_counter; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &tmp_packet[i], NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check the status. */ + if (status) + error_counter++; + } + } + + return NX_FALSE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_router_solicitation_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Router Solicitation Test...........................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_solicitated_ra_test.c b/test/regression/netxduo_test/netx_icmpv6_solicitated_ra_test.c new file mode 100644 index 00000000..def43b1d --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_solicitated_ra_test.c @@ -0,0 +1,196 @@ +/* Test processing of solicitated RA. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet. + * destination: 0xfe80::1. + * reachable time: 1ms. + * retrans timer: 1ms. */ +static char ra_pkt[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x73, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* Bs@..... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_solicitated_ra_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Solicitated RA Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00000001; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Sleep 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index + 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 64) || (interface_index != 0)) + error_counter++; + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_solicitated_ra_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Solicitated RA Test................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_icmpv6_too_big_buffer_overwrite_test.c b/test/regression/netxduo_test/netx_icmpv6_too_big_buffer_overwrite_test.c new file mode 100644 index 00000000..7a5cc0d4 --- /dev/null +++ b/test/regression/netxduo_test/netx_icmpv6_too_big_buffer_overwrite_test.c @@ -0,0 +1,367 @@ +/* Test processing of too big with chained packet. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) && !defined(NX_DISABLE_RX_SIZE_CHECKING) + +#define DEMO_STACK_SIZE 2048 + +#define PACKET_PAYLOAD_SIZE 1536 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Packet. */ +static char pkt[] = { +0xc8, 0xd9, 0xd2, 0x23, 0xe4, 0x9a, 0xc8, 0xd9, /* ...#.... */ +0xd2, 0x24, 0x23, 0x53, 0x86, 0xdd, 0x60, 0x00, /* .$#S..`. */ +0x00, 0x00, 0x05, 0xb0, 0x00, 0xff, 0x11, 0x11, /* ........ */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x67, 0x11, 0x11, /* ..fffg.. */ +0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3a, 0xb3, /* ..ffff:. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x1f, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_too_big_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_PAYLOAD_SIZE, pointer, (sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + pointer = pointer + ((sizeof(NX_PACKET) + PACKET_PAYLOAD_SIZE)*16); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Too Big Buffer Overwrite Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x11111111; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x66666666; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Inject NS packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(packet_ptr, &pkt[14], sizeof(pkt) - 14, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter++; + + /* Directly receive the NS packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Wait 1s to process this NS packet. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_icmpv6_too_big_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ICMPv6 Too Big Buffer Overwrite Test......................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_igmp_basic_test.c b/test/regression/netxduo_test/netx_igmp_basic_test.c new file mode 100644 index 00000000..a948df93 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_basic_test.c @@ -0,0 +1,219 @@ +/* This NetX test concentrates on the basic IGMP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IGMP_INFO) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG igmp_reports_sent; +ULONG igmp_queries_received; +ULONG igmp_checksum_errors; +ULONG current_groups_joined; + + + /* Print out test information banner. */ + printf("NetX Test: IGMP Basic Operation Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Perform 7 IGMP join operations. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,2)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,3)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,5)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,6)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,7)); + + /* Join one group another 4 times to test the counting operation. */ + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,4)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check for status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_reports_sent) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 7)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the periodic event to test igmp_periodic_processing. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Attempt to join a new group. This should result in an error. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,8)); + + /* Determine if an error has occurred. */ + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now leave all the groups to make sure that processing works properly. */ + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,2)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,3)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,5)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,6)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,7)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IGMP Basic Operation Test.................................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_IGMP_INFO */ diff --git a/test/regression/netxduo_test/netx_igmp_branch_test.c b/test/regression/netxduo_test/netx_igmp_branch_test.c new file mode 100644 index 00000000..6b930e5b --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_branch_test.c @@ -0,0 +1,516 @@ +/* This NetX test concentrates on the code coverage for IGMP functions, + * _nx_igmp_packet_receive + *_nx_igmp_multicast_check + *_nx_igmp_multicast_interface_join_internal + *_nx_igmp_multicast_interface_leave_internal + *_nx_igmp_periodic_processing + *_nx_igmp_packet_process + */ + +#include "nx_api.h" +#include "tx_thread.h" +#include "tx_timer.h" +#include "nx_igmp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_branch_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable IGMP processing for IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check IGMP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG system_state; +NX_PACKET *my_packet[2]; +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_ENABLE_INTERFACE_CAPABILITY) +UINT packet_available; +#endif + + + /* Print out some test information banners. */ + printf("NetX Test: IGMP Branch Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Hit condition of if ((_tx_thread_system_state) || (&(ip_ptr -> nx_ip_thread) != _tx_thread_current_ptr)) in _nx_igmp_packet_receive(). */ + tx_mutex_get(&(ip_0.nx_ip_protection), TX_WAIT_FOREVER); + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], "abcdefghijklmnopqrstuvwxyz", 26, &pool_0, NX_NO_WAIT); + + system_state = _tx_thread_system_state; + _tx_thread_system_state = 0; + + _nx_igmp_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_igmp_queue_head = NX_NULL; + + _tx_thread_system_state = system_state; + nx_packet_release(my_packet[0]); + + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], "abcdefghijklmnopqrstuvwxyz", 26, &pool_0, NX_NO_WAIT); + system_state = _tx_thread_system_state; + _tx_thread_system_state = 1; + + _nx_igmp_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_igmp_queue_head = NX_NULL; + + _tx_thread_system_state = system_state; + nx_packet_release(my_packet[0]); + tx_mutex_put(&(ip_0.nx_ip_protection)); + + + + /* Hit condition of if ((ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_list == group) && (nx_interface == ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_interface_list)) in _nx_igmp_multicast_check(). */ + nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224, 0, 0, 2)); + _nx_igmp_multicast_check(&ip_0, IP_ADDRESS(224, 0, 0, 2), &ip_0.nx_ip_interface[0]); + _nx_igmp_multicast_check(&ip_0, IP_ADDRESS(224, 0, 0, 2), NX_NULL); + nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224, 0, 0, 2)); + + + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_ENABLE_INTERFACE_CAPABILITY) + /* Hit condition of if ((ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_list == group) && (nx_interface == ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_join_interface_list)) in _nx_igmp_multicast_interface_join_internal(). */ + /* Attach the 2nd interface to IP instance0 */ + nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_256); + nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224, 0, 0, 2), 0); + _nx_igmp_multicast_interface_join_internal(&ip_0, IP_ADDRESS(224, 0, 0, 2), 0, NX_FALSE); + _nx_igmp_multicast_interface_join_internal(&ip_0, IP_ADDRESS(224, 0, 0, 2), 1, NX_FALSE); + _nx_igmp_multicast_interface_join_internal(&ip_0, IP_ADDRESS(224, 0, 0, 3), 1, NX_FALSE); + _nx_igmp_multicast_interface_join_internal(&ip_0, IP_ADDRESS(224, 0, 0, 3), 0, NX_FALSE); + nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224, 0, 0, 2)); + nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224, 0, 0, 3)); + nx_ip_interface_detach(&ip_0, 1); + + + + /* Test _nx_igmp_multicast_interface_leave_internal */ + /* Hit false condition of if (status == NX_SUCCESS) for _nx_packet_allocate.*/ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 2); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_count = 1; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = 1; + + /* Record the packet available count. */ + packet_available = pool_0.nx_packet_pool_available; + + /* Set the packet available count as 0. */ + pool_0.nx_packet_pool_available = 0; + + /* Call function. */ + _nx_igmp_multicast_interface_leave_internal(&ip_0, IP_ADDRESS(224, 0, 0, 2), 0); + + /* Recover the packet available count. */ + pool_0.nx_packet_pool_available = packet_available; + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + + + /* Test _nx_igmp_multicast_interface_leave_internal + 173 [ - + ]: 42 : if (ip_ptr -> nx_ip_igmp_router_version == NX_IGMP_HOST_VERSION_1) + 174 : : { + 177 : 0 : tx_mutex_put(&(ip_ptr -> nx_ip_protection)); + 180 : 0 : return(NX_SUCCESS); + 181 : : } + */ + ip_0.nx_ip_igmp_router_version = NX_IGMP_HOST_VERSION_1; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 2); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_count = 1; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = 1; + + /* Call function. */ + _nx_igmp_multicast_interface_leave_internal(&ip_0, IP_ADDRESS(224, 0, 0, 2), 0); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + /* Revert the IGMP version */ + ip_0.nx_ip_igmp_router_version = NX_IGMP_HOST_VERSION_2; + + + + /* Test _nx_igmp_periodic_processing(). */ + + /* Hit false condition of (ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_update_time != NX_WAIT_FOREVER). */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 2); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = NX_WAIT_FOREVER; + _nx_igmp_periodic_processing(&ip_0); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + + /* Hit false condition of if ((sent_count > 0) && (ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_update_time == 0)). */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 2); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = 1; + ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 3); + ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_update_time = 2; + _nx_igmp_periodic_processing(&ip_0); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_join_list = 0; + + + /* Hit false condition of if ((ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_update_time == 0) && (sent_count == 0)). */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 2); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = 1; + ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 3); + ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_update_time = 1; + _nx_igmp_periodic_processing(&ip_0); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_join_list = 0; + + + /* Hit false condition of if (status == NX_SUCCESS) for _nx_packet_allocate. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 2); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = 1; + + /* Record the packet available count. */ + packet_available = pool_0.nx_packet_pool_available; + + /* Set the packet available count as 0. */ + pool_0.nx_packet_pool_available = 0; + + /* Call function. */ + _nx_igmp_periodic_processing(&ip_0); + + /* Recover the packet available count. */ + pool_0.nx_packet_pool_available = packet_available; + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + + + /* Test _nx_igmp_packet_process(). */ + + /* Hit false condition of if (packet_ptr -> nx_packet_last) and if (checksum & NX_CARRY_BIT). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0xFF; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFF; + my_packet[0] -> nx_packet_prepend_ptr[8] = 0x2; + my_packet[0] -> nx_packet_length = 9; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + +#ifndef NX_DISABLE_PACKET_CHAIN + /* Hit true condition + * 172 [ - + ]: 6 : if (packet_ptr -> nx_packet_last) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0xFF; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFF; + my_packet[0] -> nx_packet_prepend_ptr[8] = 0x2; + my_packet[0] -> nx_packet_length = 9; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + my_packet[0] -> nx_packet_last = my_packet[0]; + _nx_igmp_packet_process(&ip_0, my_packet[0]); +#endif /* NX_DISABLE_PACKET_CHAIN */ + + /* Hit false condition of if ((update_time > max_update_time) || (update_time == 0)). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x01; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x1E; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + _tx_timer_system_clock = 1; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Hit false condition of if ((update_time > max_update_time) || (update_time == 0)). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x01; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x1E; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + _tx_timer_system_clock = 0; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Hit false condition of (header_ptr -> nx_igmp_header_word_1 != NX_NULL)) and (ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_update_time == NX_WAIT_FOREVER). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x01; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0xFE; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0xFF; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0x00; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 251); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + /* Hit true condition of (header_ptr -> nx_igmp_header_word_1 != NX_NULL)) and (ip_ptr -> nx_ipv4_multicast_entry[i].nx_ipv4_multicast_update_time == NX_WAIT_FOREVER). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x01; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0xFE; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0xFF; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0x00; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 251); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = NX_WAIT_FOREVER; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + /* Hit false condition of (header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x17; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x08; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 251); + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + + /* Hit false condition of for (i = 0; i < NX_MAX_MULTICAST_GROUPS; i++) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x16; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x09; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Hit false condition of for (i = 0; i < NX_MAX_MULTICAST_GROUPS; i++) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x16; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x09; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 251);; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = NX_WAIT_FOREVER; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + /* Hit false condition : + else if (((header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x14; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x0b; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 251);; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = NX_WAIT_FOREVER; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; + + /* Hit false condition : + else if (((header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_prepend_ptr[0] = 0x12; + my_packet[0] -> nx_packet_prepend_ptr[1] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[2] = 0x0d; + my_packet[0] -> nx_packet_prepend_ptr[3] = 0x04; + my_packet[0] -> nx_packet_prepend_ptr[4] = 0xE0; + my_packet[0] -> nx_packet_prepend_ptr[5] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[6] = 0x00; + my_packet[0] -> nx_packet_prepend_ptr[7] = 0xFB; + my_packet[0] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + my_packet[0] -> nx_packet_length; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = IP_ADDRESS(224, 0, 0, 251);; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_update_time = NX_WAIT_FOREVER; + _nx_igmp_packet_process(&ip_0, my_packet[0]); + + /* Recover the multicast. */ + ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list = 0; +#endif /* __PRODUCT_NETXDUO__ */ + + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP Branch Test..........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_igmp_checksum_computation_test.c b/test/regression/netxduo_test/netx_igmp_checksum_computation_test.c new file mode 100644 index 00000000..63752cc3 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_checksum_computation_test.c @@ -0,0 +1,373 @@ +/* This NetX test case verifies that the IGMP packet data is included in the checksum, not just the header, + and that it handles 2 byte data when there is zero length left. Also it must handled chained + packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_igmp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +#define DATA_SIZE 762 +#define PACKET_PAYLOAD 600 + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void igmp_checksum_compute(NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_checksum_computation_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_PAYLOAD, pointer, PACKET_PAYLOAD*6); + pointer = pointer + PACKET_PAYLOAD*6; + + if(status) + error_counter++; + + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable IGMP processing for both IP instances. */ + status = nx_igmp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: IGMP Checksum Computation Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to new receive function */ + advanced_packet_process_callback = my_packet_process; + + /* Perform IGMP join operations for IP instance0. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + error_counter++; + } + + return; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_IGMP_HEADER *header_ptr; +NX_PACKET *my_packet; +UINT status; +UCHAR buffer[DATA_SIZE]; + + +#ifndef NX_DISABLE_IGMPV2 + /* Check the version. */ + if (ip_ptr -> nx_ip_igmp_router_version == NX_IGMP_HOST_VERSION_2) + { + /* Setup a pointer to the IGMP packet header. */ + header_ptr = (NX_IGMP_HEADER *) (packet_ptr -> nx_packet_prepend_ptr + 24); + } + else + { + + /* Setup a pointer to the IGMP packet header. */ + header_ptr = (NX_IGMP_HEADER *) (packet_ptr -> nx_packet_prepend_ptr + 20); + } +#else + header_ptr = (NX_IGMP_HEADER *) (packet_ptr -> nx_packet_prepend_ptr + 20); +#endif + + /* Do byte swapping for little endian processors before parsing + IGMP header data. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + +#ifndef NX_DISABLE_IGMPV2 + /* Is this IGMPv1 host's join request? */ + if (((header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE) || + /* ...Or an IGMPv2 host's join request? */ + ((header_ptr -> nx_igmp_header_word_0 & NX_IGMPV2_TYPE_MASK) == NX_IGMP_HOST_V2_JOIN_TYPE)) +#else + + /* Is this another IGMPv1 host's join request? */ + if ((header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE) +#endif + { + + /* Fill the buffer with 0x58. */ + memset(&buffer[0],0x58, DATA_SIZE); + + /* Ensure that the data is not symmetrical with respect to endianness or our test is meaningless. */ + if (DATA_SIZE > 8) + { + buffer[0] = 48; + buffer[1] = 47; + buffer[2] = 46; + buffer[3] = 45; + buffer[4] = 44; + buffer[5] = 43; + buffer[6] = 42; + buffer[7] = 41; + } + + /* Allocate a packet to place the IGMP Router query message in, IGMP version1. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IGMP_PACKET , TX_NO_WAIT); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *) my_packet -> nx_packet_prepend_ptr; + + /* Build the IGMPv1 Router query message. */ + header_ptr -> nx_igmp_header_word_0 = (ULONG) (NX_IGMP_VERSION | NX_IGMP_ROUTER_QUERY_TYPE); + header_ptr -> nx_igmp_header_word_1 = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list; + + /* Stamp the outgoing interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list; + + /* set the append pointer past the IGMP header including the 2 extra bytes. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + NX_IGMP_HEADER_SIZE; + my_packet -> nx_packet_length = NX_IGMP_HEADER_SIZE; + + /* Add the IGMP 'data'. */ + nx_packet_data_append(my_packet, &buffer[0], DATA_SIZE, &pool_0, 200); + + /* Calculate the IGMP checksum. */ + igmp_checksum_compute(my_packet); + + /* Call _nx_igmp_packet_receive to directly receive the valid packet. */ + _nx_igmp_packet_receive(&ip_0, my_packet); + + } + else + error_counter++; + + + } + + /* Determine if the test was successful. */ + if ((error_counter) || (ip_0.nx_ip_igmp_checksum_errors != 0) || (ip_0.nx_ip_igmp_invalid_packets != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return NX_TRUE; +} + +static void igmp_checksum_compute(NX_PACKET *packet_ptr) +{ + +NX_IGMP_HEADER *header_ptr; +UCHAR *word_ptr; +NX_PACKET *current_packet; +ULONG checksum; +ULONG long_temp; +USHORT short_temp; +ULONG length; + + + /* Setup a pointer to the IGMP packet header. */ + header_ptr = (NX_IGMP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + /* Clear the IGMP checksum. */ + header_ptr -> nx_igmp_header_word_0 &= 0xFFFF0000; + + /* First verify the checksum is correct. */ + checksum = 0; + + /* Setup the length of the packet checksum. */ + length = packet_ptr -> nx_packet_length; + + /* Check for an odd numbered (invalid) length packet payload. */ + if (((length/sizeof(USHORT))*sizeof(USHORT)) != length) + { + + /* Discard the packet. */ + nx_packet_release(packet_ptr); + + return; + } + + + /* Swap back to host byte order to insert the checksum if little endian is specified. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_1); + + /* Setup the pointer to the start of the packet. */ + word_ptr = (UCHAR *) packet_ptr -> nx_packet_prepend_ptr; + + /* Initialize the current packet to the input packet pointer. */ + current_packet = packet_ptr; + + checksum = 0; + + /* Loop to calculate the packet's checksum. */ + while (length) + { + /* Determine if there is at least one ULONG left. */ + if ((UINT)(current_packet -> nx_packet_append_ptr - word_ptr) >= sizeof(ULONG)) + { + + /* Pickup a whole ULONG. */ + long_temp = *((ULONG *) word_ptr); + + /* Add upper 16-bits into checksum. */ + checksum = checksum + (long_temp >> NX_SHIFT_BY_16); + + /* Check for carry bits. */ + if (checksum & NX_CARRY_BIT) + checksum = (checksum & NX_LOWER_16_MASK) + 1; + + /* Add lower 16-bits into checksum. */ + checksum = checksum + (long_temp & NX_LOWER_16_MASK); + + /* Check for carry bits. */ + + if (checksum & NX_CARRY_BIT) + checksum = (checksum & NX_LOWER_16_MASK) + 1; + + /* Move the word pointer and decrease the length. */ + word_ptr = word_ptr + sizeof(ULONG); + length = length - sizeof(ULONG); + + } + else + { + + /* Pickup the 16-bit word. */ + short_temp = *((USHORT *) word_ptr); + + /* Add next 16-bit word into checksum. */ + checksum = checksum + short_temp; + + /* Check for carry bits. */ + if (checksum & NX_CARRY_BIT) + checksum = (checksum & NX_LOWER_16_MASK) + 1; + + /* Move the word pointer and decrease the length. */ + word_ptr = word_ptr + sizeof(USHORT); + length = length - sizeof(USHORT); + } + + /* Determine if we are at the end of the current packet. */ + if ((word_ptr >= (UCHAR *) current_packet -> nx_packet_append_ptr) && + (current_packet -> nx_packet_next)) + { + + /* We have crossed the packet boundary. Move to the next packet + structure. */ + current_packet = current_packet -> nx_packet_next; + + /* Setup the new word pointer. */ + word_ptr = (UCHAR *) current_packet -> nx_packet_prepend_ptr; + } + } + + /* Swap back to host byte order to insert the checksum if little endian is specified. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + + /* If little endian is specified, we need to byte swap the checksum instead of computing the + data in network byte order. */ + NX_CHANGE_ULONG_ENDIAN(checksum); + + /* Place the checksum 1s complement into the first header word. */ + header_ptr -> nx_igmp_header_word_0 |= (~(checksum >> NX_SHIFT_BY_16) & NX_LOWER_16_MASK); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_checksum_computation_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP Checksum Computation Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_igmp_interface_indirect_report_send_test.c b/test/regression/netxduo_test/netx_igmp_interface_indirect_report_send_test.c new file mode 100644 index 00000000..fac3d854 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_interface_indirect_report_send_test.c @@ -0,0 +1,307 @@ +/* This NetX test tests the IGMP report send IGMP operation. The application + registers (joins) a group address with the IP instance long enough to send + out an initial report. Then the application wishes to resend the same IGMP + report (because it detects a new router. The timeout in the multicast entry for that + group address is reset to one so that an IGMP report is sent out on the next + periodic. For 5.9, this service is an internal function and only supports + sending join IGMP reports. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_igmp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IGMP_INFO) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_interface_indirect_report_send_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + status = nx_ip_interface_attach(&ip_0, "Secondary IP", IP_ADDRESS(1,2,4,4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + + UINT status; + ULONG igmp_reports_sent; + ULONG igmp_queries_received; + ULONG igmp_checksum_errors; + ULONG current_groups_joined; + + + /* Let the IP task initialize the driver. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE / 5); + + /* Print out test information banner. */ + printf("NetX Test: IGMP Multicast Indirect Report Send Test.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Perform an IGMP join operation on the primary interface. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,7), 0); + + /* Determine if there is an error. */ + if (status) + { + error_counter++ ; + } + + /* Perform another IGMP join operation on the primary interface. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,1), 0); + + /* Determine if there is an error. */ + if (status) + { + error_counter++ ; + } + + /* Perform an IGMP join operation on the secondary interface. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,3), 1); + + /* Determine if there is an error. */ + if (status) + { + error_counter++ ; + } + + /* Should be long enough for three IP periodic cycles to send a report. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status and if NetX sent off any IGMP reports. */ + if ((status) || (igmp_reports_sent != 3) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 3)) + { + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE / 10); + +#ifdef __PRODUCT_NETXDUO__ + /* Perform IGMP leave operation and test if we need to send a leave report. */ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,3), 1); +#else + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,3)); +#endif + + /* Determine if there is an error. */ + if (status) + { + error_counter++ ; + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + +#ifndef NX_DISABLE_IGMPV2 + /* Check for status and if NetX sent off any IGMP reports. */ + if ((igmp_reports_sent != 3) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#else + /* IGMPv1 protocol does not call for sending leave reports. */ + if ((igmp_reports_sent != 3) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#endif + { + error_counter++; + } + + /* Attempt to rejoin the group after we cleared the multicast entry for it. */ + status = _nx_igmp_interface_report_send(&ip_0, IP_ADDRESS(224,0,0,1), 0, NX_TRUE); + + /* Determine if there is an error. */ + if (status != NX_SUCCESS) + { + error_counter++ ; + } + + /* Wait a second, only one IGMP report goes out per IP thread task periodic. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Call the IGMP information get routine to see if NetX sent out another report message. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + if (status) + { + error_counter++; + } + + /* Check IGMP statistics. */ + +#ifndef NX_DISABLE_IGMPV2 + if ((status) || (igmp_reports_sent != 4) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#else + /* IGMPv1 protocol does not call for sending leave reports. */ + if ((status) || (igmp_reports_sent != 4) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#endif + { + error_counter++; + } + + /* Send a join report for a group that we left the membership of. */ + status = _nx_igmp_interface_report_send(&ip_0, IP_ADDRESS(224,0,0,7), 0, NX_TRUE); + + /* Determine if there is an error. This call should succeed because nx_igmp_interface_report_send does not check + the membership of the group address. It is assumed the caller does. */ + if (status != NX_SUCCESS) + { + error_counter++ ; + } + + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + if (status) + { + error_counter++; + } + +#ifndef NX_DISABLE_IGMPV2 + if ((status) || (igmp_reports_sent != 5) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#else + /* IGMPv1 protocol does not call for sending leave reports. */ + if ((status) || (igmp_reports_sent != 5) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#endif + { + error_counter++; + } + + /* Perform an IGMP leave operation on the primary interface. */ +#ifdef __PRODUCT_NETXDUO__ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,5), 0); +#else + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,5)); +#endif + + /* We never joined this group so this call should return an error. */ + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Call the IGMP information get routine to see if NetX sent out another report message. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + if (status) + { + error_counter++; + } + + /* Check for status. There should be no change here. */ +#ifndef NX_DISABLE_IGMPV2 + if ((status) || (igmp_reports_sent != 5) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#else + /* IGMPv1 protocol does not call for sending leave reports. */ + if ((status) || (igmp_reports_sent != 5) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 2)) +#endif + { + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_interface_indirect_report_send_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IGMP Multicast Indirect Report Send Test...................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_IGMP_INFO */ diff --git a/test/regression/netxduo_test/netx_igmp_join_fail_test.c b/test/regression/netxduo_test/netx_igmp_join_fail_test.c new file mode 100644 index 00000000..e0bb83d5 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_join_fail_test.c @@ -0,0 +1,183 @@ +/* This NetX test concentrates on the IGMP join fails when driver returns error. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT available; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_join_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + available = NX_TRUE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, test_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: IGMP Join Fail Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set available to false. */ + available = NX_FALSE; + + /* Perform IGMP join operations. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set available to true. */ + available = NX_TRUE; + + /* Perform IGMP join operations. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now leave the group to make sure that processing works properly. */ + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req) +{ + if ((driver_req -> nx_ip_driver_command == NX_LINK_MULTICAST_JOIN) && + (available == NX_FALSE)) + { + + /* Return not supported. */ + driver_req -> nx_ip_driver_status = NX_UNHANDLED_COMMAND; + } + else + { + + /* Pass the request to ram driver. */ + _nx_ram_network_driver_256(driver_req); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_join_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP Join Fail Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_igmp_leave_test.c b/test/regression/netxduo_test/netx_igmp_leave_test.c new file mode 100644 index 00000000..63dec5e1 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_leave_test.c @@ -0,0 +1,158 @@ +/* This NetX test concentrates on the IGMP leave. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_leave_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: IGMP Leave Test..........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Perform IGMP join operations. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now leave the group to make sure that processing works properly. */ + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now leave the group again. */ + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if no entry is found. */ + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_leave_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP Leave Test...........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_igmp_loopback_test.c b/test/regression/netxduo_test/netx_igmp_loopback_test.c new file mode 100644 index 00000000..0809c53f --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_loopback_test.c @@ -0,0 +1,312 @@ +/* This NetX test concentrates on the IGMP loopback operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IGMP_INFO) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define TEST_INTERFACE 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; + + /* Enable UDP processing for this IP instance. */ + status = nx_udp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG igmp_reports_sent; +ULONG igmp_queries_received; +ULONG igmp_checksum_errors; +ULONG current_groups_joined; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS dest_address; +#endif + + + /* Print out test information banner. */ + printf("NetX Test: IGMP Loopback Operation Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Enable all TX checksum capability. */ + nx_ip_interface_capability_set(&ip_0, TEST_INTERFACE, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM); + +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Enable IGMP loopback. */ + status = nx_igmp_loopback_enable(&ip_0); + + /* Perform 7 IGMP join operations. */ + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,1),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,2),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,3),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,5),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,6),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,7),TEST_INTERFACE); + + /* Join one group another 4 times to test the counting operation. */ + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4),TEST_INTERFACE); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4),TEST_INTERFACE); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 2 seconds to let IGMP packets be sent. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 7)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create and bind two UDP sockets. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Sending Socket", NX_IP_NORMAL, NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 5); + status += nx_udp_socket_create(&ip_0, &socket_1, "Receiving Socket", NX_IP_NORMAL, NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 5); + status += nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + status += nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + +#ifdef __PRODUCT_NETXDUO__ + dest_address.nxd_ip_address.v4 =IP_ADDRESS(224, 0, 0, 4); + dest_address.nxd_ip_version = 4; + + /* Send the UDP packet. */ + status = nxd_udp_socket_interface_send(&socket_0, my_packet, &dest_address, 0x89, TEST_INTERFACE); +#else + + /* Send the UDP packet. */ + status = nx_udp_socket_interface_send(&socket_0, my_packet, IP_ADDRESS(224, 0, 0, 4), 0x89, TEST_INTERFACE); +#endif + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive the UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP loopback. */ + status = nx_igmp_loopback_disable(&ip_0); + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Disable all interface capability. */ + nx_ip_interface_capability_set(&ip_0, TEST_INTERFACE, 0); +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Now leave all the groups to make sure that processing works properly. */ +#ifdef __PRODUCT_NETXDUO__ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,1), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,2), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,3), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,5), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,6), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,7), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), TEST_INTERFACE); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), TEST_INTERFACE); +#else + + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,2)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,3)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,5)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,6)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,7)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); +#endif + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IGMP Loopback Operation Test..............................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_IGMP_INFO */ diff --git a/test/regression/netxduo_test/netx_igmp_multicast_basic_test.c b/test/regression/netxduo_test/netx_igmp_multicast_basic_test.c new file mode 100644 index 00000000..e89f80e1 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_multicast_basic_test.c @@ -0,0 +1,302 @@ +/* This NetX test concentrates on the basic multicast IGMP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IGMP_INFO) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_multicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + + UINT status; + ULONG igmp_reports_sent; + ULONG igmp_queries_received; + ULONG igmp_checksum_errors; + ULONG current_groups_joined; + + + /* Print out test information banner. */ + printf("NetX Test: IGMP Multicast Basic Operation Test......................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test the first interface. */ + /* Perform 7 IGMP join operations. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,1), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,2), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,3), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,5), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,7), 0); + +#ifdef __PRODUCT_NETXDUO__ + /* Test the nxe_igmp_multicast_interface_join_internal.c */ + status += nx_ipv4_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,6), 0); +#else + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,6), 0); +#endif /* __PRODUCT_NETXDUO__ */ + + /* Join one group another 4 times to test the counting operation. */ + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 0); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 0); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_reports_sent) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 7)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to join a new group. This should result in an error. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,8)); + + /* Determine if an error has occurred. */ + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,2)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,3)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,5)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,7)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); +#ifdef __PRODUCT_NETXDUO__ + status += nx_ipv4_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,6), 0); +#else + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,6)); +#endif /* __PRODUCT_NETXDUO__ */ + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + if(NX_MAX_PHYSICAL_INTERFACES > 1) + { + + /* Test the second interface. */ + /* Perform 7 IGMP join operations. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,1), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,2), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,3), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,5), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,6), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,7), 1); + + /* Join one group another 4 times to test the counting operation. */ + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_reports_sent) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined != 7)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to join a new group. This should result in an error. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,8)); + + /* Determine if an error has occurred. */ + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now leave all the groups to make sure that processing works properly. */ +#ifdef __PRODUCT_NETXDUO__ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,1), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,2), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,3), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,5), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,6), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,7), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,4), 1); +#else + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,1)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,2)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,3)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,5)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,6)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,7)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); + status += nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,4)); +#endif + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Call the IGMP information get routine to see if all the groups are there. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for status. */ + if ((status) || (igmp_reports_sent) || (igmp_queries_received) || (igmp_checksum_errors) || (current_groups_joined)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_multicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IGMP Multicast Basic Operation Test.......................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_IGMP_INFO */ diff --git a/test/regression/netxduo_test/netx_igmp_nxe_api_test.c b/test/regression/netxduo_test/netx_igmp_nxe_api_test.c new file mode 100644 index 00000000..fb92ee45 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_nxe_api_test.c @@ -0,0 +1,744 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "nx_igmp.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined NX_DISABLE_ERROR_CHECKING && defined __PRODUCT_NETXDUO__ && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG igmp_reports_sent; +ULONG igmp_queries_received; +ULONG igmp_checksum_errors; +ULONG current_groups_joined; + + + /* Print out some test information banners. */ + printf("NetX Test: IGMP NXE API Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_igmp_enable api */ + /************************************************/ + + /* Enable the IGMP feature for NULL IP instance. */ + status = nx_icmp_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the IGMP feature for invalid IP instance. */ + status = nx_igmp_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the IGMP feature for valid IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the IGMP feature again for valid IP instance . */ + status = nx_igmp_enable(&ip_0); + + /* Check for error. */ + if (status != NX_ALREADY_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_igmp_info_get api */ + /************************************************/ + + /* Get the IGMP information for NULL IP instance. */ + status = nx_igmp_info_get(NX_NULL, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the IGMP information for invalid IP instance. */ + status = nx_igmp_info_get(&invalid_ip, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Get the IGMP information for invalid IP instance. */ + status = nx_igmp_info_get(&ip_0, &igmp_reports_sent, &igmp_queries_received, &igmp_checksum_errors, ¤t_groups_joined); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_igmp_loopback_disable api */ + /************************************************/ + + /* Disable the IGMP loopback for NULL IP instance. */ + status = nx_igmp_loopback_disable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Disable the IGMP loopback for invalid IP instance. */ + status = nx_igmp_loopback_disable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Disable the IGMP loopback for invalid IP instance. */ + status = nx_igmp_loopback_disable(&ip_0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_igmp_loopback_enable api */ + /************************************************/ + + /* Enable the IGMP loopback for NULL IP instance. */ + status = nx_igmp_loopback_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the IGMP loopback for invalid IP instance. */ + status = nx_igmp_loopback_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Enable the IGMP loopback for invalid IP instance. */ + status = nx_igmp_loopback_enable(&ip_0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***************************************************/ + /* Tested the nxe_igmp_multicast_interface_join api */ + /***************************************************/ + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group for NULL IP instance. */ + status = nx_igmp_multicast_interface_join(NX_NULL, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Join the ICMP group for invalid IP instance. */ + status = nx_igmp_multicast_interface_join(&invalid_ip, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with invalid IP address. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(1, 2, 3, 4), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Join the ICMP group with IGMP feature disable. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group with MAX interface index. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,251), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with invalid interface. */ + ip_0.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,251), 0); + ip_0.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*************************************************************/ + /* Tested the nxe_igmp_multicast_interface_join_internal api */ + /* by nxe_ipv4_multicast_interface_join api */ + /*************************************************************/ + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group for NULL IP instance. */ + status = nx_ipv4_multicast_interface_join(NX_NULL, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with invalid interface. */ + ip_0.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + status = nx_ipv4_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,251), 0); + ip_0.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Join the ICMP group for invalid IP instance. */ + status = nx_ipv4_multicast_interface_join(&invalid_ip, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with invalid IP address. */ + status = nx_ipv4_multicast_interface_join(&ip_0, IP_ADDRESS(1, 2, 3, 4), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with MAX interface index. */ + status = nx_ipv4_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,251), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*****************************************************/ + /* Tested the nxe_igmp_multicast_interface_leave api */ + /*****************************************************/ + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Leave the ICMP group for NULL IP instance. */ + status = nx_igmp_multicast_interface_leave(NX_NULL, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Leave the ICMP group for invalid IP instance. */ + status = nx_igmp_multicast_interface_leave(&invalid_ip, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Leave the ICMP group with invalid IP address. */ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(1, 2, 3, 4), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Join the ICMP group with IGMP feature disable. */ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Leave the ICMP group with MAX interface index. */ + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,251), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Leave the IGMP group with invalid interface. */ + ip_0.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + status = nx_igmp_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,251), 0); + ip_0.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /**************************************************************/ + /* Tested the nxe_igmp_multicast_interface_leave_internal api */ + /* by nxe_ipv4_multicast_interface_leave api */ + /**************************************************************/ + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Leave the multicast for NULL IP instance. */ + status = nx_ipv4_multicast_interface_leave(NX_NULL, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Leave the multicast for invalid IP instance. */ + status = nx_ipv4_multicast_interface_leave(&invalid_ip, IP_ADDRESS(224,0,0,251), 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Leave the multicast with invalid IP address. */ + status = nx_ipv4_multicast_interface_leave(&ip_0, IP_ADDRESS(1, 2, 3, 4), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Leave the multicast group with MAX interface index. */ + status = nx_ipv4_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,251), NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Leave the IGMP group with invalid interface. */ + ip_0.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + status = nx_ipv4_multicast_interface_leave(&ip_0, IP_ADDRESS(224,0,0,251), 0); + ip_0.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***************************************************/ + /* Tested the nxe_igmp_multicast_join api */ + /***************************************************/ + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group for NULL IP instance. */ + status = nx_igmp_multicast_join(NX_NULL, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Join the ICMP group for invalid IP instance. */ + status = nx_igmp_multicast_join(&invalid_ip, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with invalid IP address. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(1, 2, 3, 4)); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Join the ICMP group with IGMP feature disable. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP instance ID and igmp packet receive function. */ + invalid_ip.nx_ip_id = NX_IP_ID; + invalid_ip.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group with invalid interface index. */ + status = nx_igmp_multicast_join(&invalid_ip, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***************************************************/ + /* Tested the nxe_igmp_multicast_leave api */ + /***************************************************/ + + /* Reset the igmp packet receive function. */ + ip_0.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group for NULL IP instance. */ + status = nx_igmp_multicast_leave(NX_NULL, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Join the ICMP group for invalid IP instance. */ + status = nx_igmp_multicast_leave(&invalid_ip, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the ICMP group with invalid IP address. */ + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(1, 2, 3, 4)); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IGMP feature. */ + ip_0.nx_ip_igmp_packet_receive = NX_NULL; + + /* Join the ICMP group with IGMP feature disable. */ + status = nx_igmp_multicast_leave(&ip_0, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP instance ID and igmp packet receive function. */ + invalid_ip.nx_ip_id = NX_IP_ID; + invalid_ip.nx_ip_igmp_packet_receive = _nx_igmp_packet_receive; + + /* Join the ICMP group with invalid interface index. */ + status = nx_igmp_multicast_leave(&invalid_ip, IP_ADDRESS(224,0,0,251)); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP NXE API Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_igmp_packet_receive_function_test.c b/test/regression/netxduo_test/netx_igmp_packet_receive_function_test.c new file mode 100644 index 00000000..6a570e27 --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_packet_receive_function_test.c @@ -0,0 +1,412 @@ +/* This NetX test case test _nx_igmp_packet_receive and _nx_igmp_queue_process function with non standard operation . */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_igmp.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR igmp_packet_received = NX_FALSE; +static NX_PACKET *copy_packet_0; +static NX_PACKET *copy_packet_1; +static NX_PACKET *copy_packet_2; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void igmp_checksum_compute(NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_packet_receive_function_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable IGMP processing for both IP instances. */ + status = nx_igmp_enable(&ip_0); + status += nx_igmp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: IGMP Packet Receive Function Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to new receive function */ + ip_1.nx_ip_igmp_packet_receive = packet_receive; + + /* Perform IGMP join operations for IP instance1. */ + status = nx_igmp_multicast_join(&ip_1, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Perform IGMP join operations for IP instance0. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 500 ticks to trigger the NX_IP_PERIODIC_EVENT event. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the IGMP information for IP instance1. */ +#ifndef NX_DISABLE_IGMP_INFO + if (ip_1.nx_ip_igmp_invalid_packets != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Create and bind two UDP sockets. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Sending Socket", NX_IP_NORMAL, NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 5); + status += nx_udp_socket_create(&ip_1, &socket_1, "Receiving Socket", NX_IP_NORMAL, NX_DONT_FRAGMENT, NX_IP_TIME_TO_LIVE, 5); + status += nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + status += nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(224, 0, 0, 1), 0x89); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive the UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if ((error_counter) || (igmp_packet_received != NX_TRUE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Wait for receive the IGMP packet. */ + while(igmp_packet_received == NX_FALSE) + { + tx_thread_sleep(1); + } + + /* Call _nx_igmp_packet_receive to directly receive the invalid packet. */ + _nx_igmp_packet_receive(&ip_1, copy_packet_0); + + /* Calculate the IGMP checksum. */ + igmp_checksum_compute(copy_packet_1); + igmp_checksum_compute(copy_packet_2); + + /* Call _nx_icmp_packet_receive to receive the packet with incorrect checksum. */ + _nx_igmp_packet_receive(&ip_1, copy_packet_1); + + /* Call _nx_icmp_packet_receive to receive the valid packet. */ + _nx_igmp_packet_receive(&ip_1, copy_packet_2); +} + +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +NX_IGMP_HEADER *header_ptr; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, ©_packet_0, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + error_counter++; + } + + /* Set the packet length with invalid value. */ + memcpy(copy_packet_0 -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28); + copy_packet_0 -> nx_packet_length = sizeof(NX_IGMP_HEADER) - 1; + copy_packet_0 -> nx_packet_append_ptr = copy_packet_0 -> nx_packet_prepend_ptr + copy_packet_0 -> nx_packet_length; + + /* Update the packet prepend and length to include the IP header. */ + packet_ptr -> nx_packet_prepend_ptr -= 20; + packet_ptr -> nx_packet_length += 20; + + /* Store the packet with incorrect checksum. */ + status = nx_packet_copy(packet_ptr, ©_packet_1, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_1 -> nx_packet_prepend_ptr += 20; + copy_packet_1 -> nx_packet_length -= 20; + + /* Point to the ICMP message header. */ + header_ptr = (NX_IGMP_HEADER *) copy_packet_1 -> nx_packet_prepend_ptr; + + /* Set the incorrect checksum. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + header_ptr -> nx_igmp_header_word_0 -= 1; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + +#ifdef __PRODUCT_NETXDUO__ + /* Set interface of packet. */ + copy_packet_1 -> nx_packet_address.nx_packet_interface_ptr = &ip_1.nx_ip_interface[0]; +#endif /* __PRODUCT_NETXDUO__ */ + } + + /* Store the packet with valid message. */ + status = nx_packet_copy(packet_ptr, ©_packet_2, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_2 -> nx_packet_prepend_ptr += 20; + copy_packet_2 -> nx_packet_length -= 20; + +#ifdef __PRODUCT_NETXDUO__ + /* Set interface of packet. */ + copy_packet_2 -> nx_packet_address.nx_packet_interface_ptr = &ip_1.nx_ip_interface[0]; +#endif /* __PRODUCT_NETXDUO__ */ + } + + /* Release the IGMP packet. */ + nx_packet_release(packet_ptr); + + /* Update the flag. */ + igmp_packet_received = NX_TRUE; + + /* Stop the process. */ + return; +} + + +static void igmp_checksum_compute(NX_PACKET *packet_ptr) +{ +ULONG checksum; +ULONG temp; +NX_IGMP_HEADER *header_ptr; + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_1); + + /* Clear the IGMP checksum. */ + header_ptr -> nx_igmp_header_word_0 &= 0xFFFF0000; + + + /* Calculate the checksum. */ + temp = header_ptr -> nx_igmp_header_word_0; + checksum = (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + temp = header_ptr -> nx_igmp_header_word_1; + checksum += (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Place the checksum into the first header word. */ + header_ptr -> nx_igmp_header_word_0 |= (~checksum & NX_LOWER_16_MASK); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_1); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_packet_receive_function_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP Packet Receive Function Test.........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_igmp_router_query_test.c b/test/regression/netxduo_test/netx_igmp_router_query_test.c new file mode 100644 index 00000000..4136e2cb --- /dev/null +++ b/test/regression/netxduo_test/netx_igmp_router_query_test.c @@ -0,0 +1,471 @@ +/* This NetX test case test router query type . */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_igmp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR igmp_host_response = 0; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void igmp_checksum_compute(NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_router_query_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable IGMP processing for both IP instances. */ + status = nx_igmp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: IGMP Router Qeury Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to new receive function */ + advanced_packet_process_callback = my_packet_process; + + /* Perform IGMP join operations for IP instance0. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,1)); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 2000 ticks to trigger the NX_IP_PERIODIC_EVENT event + 1. Receive the IGMP Host response message, + 2. Send the IGMP Router query message with invalid checksum, + 3. Send the IGMP Router query message, + 4. Send the IGMP Router query message with not joined group address, + 5. Receive the IGMP Host repsonse message. */ + tx_thread_sleep(20 * NX_IP_PERIODIC_RATE); + +#ifndef NX_DISABLE_IGMP_INFO + /* Check the count. */ + if ((ip_0.nx_ip_igmp_reports_sent != 2) || (ip_0.nx_ip_igmp_queries_received != 4) || (ip_0.nx_ip_igmp_invalid_packets != 1) || (ip_0.nx_ip_igmp_checksum_errors != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_IGMP_INFO */ + + /* Determine if the test was successful. */ + if ((error_counter) || (igmp_host_response != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_IGMP_HEADER *header_ptr; +NX_PACKET *my_packet; +ULONG checksum; +ULONG temp; +UINT status; +UINT router_alert = 0; +UINT i; + + +#ifndef NX_DISABLE_IGMPV2 + if (ip_ptr -> nx_ip_igmp_router_version == NX_IGMP_HOST_VERSION_2) + router_alert = 4; +#endif + +#ifndef NX_DISABLE_IGMPV2 + /* Check the version. */ + if (ip_ptr -> nx_ip_igmp_router_version == NX_IGMP_HOST_VERSION_2) + { + /* Setup a pointer to the IGMP packet header. */ + header_ptr = (NX_IGMP_HEADER *) (packet_ptr -> nx_packet_prepend_ptr + 24); + } + else + { + + /* Setup a pointer to the IGMP packet header. */ + header_ptr = (NX_IGMP_HEADER *) (packet_ptr -> nx_packet_prepend_ptr + 20); + } +#else + header_ptr = (NX_IGMP_HEADER *) (packet_ptr -> nx_packet_prepend_ptr + 20); +#endif + + /* Do byte swapping for little endian processors before parsing + IGMP header data. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + +#ifndef NX_DISABLE_IGMPV2 + /* Is this IGMPv1 host's join request? */ + if (((header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE) || + /* ...Or an IGMPv2 host's join request? */ + ((header_ptr -> nx_igmp_header_word_0 & NX_IGMPV2_TYPE_MASK) == NX_IGMP_HOST_V2_JOIN_TYPE)) +#else + + /* Is this another IGMPv1 host's join request? */ + if ((header_ptr -> nx_igmp_header_word_0 & NX_IGMP_TYPE_MASK) == NX_IGMP_HOST_RESPONSE_TYPE) +#endif + { + + /* Do byte swapping for little endian processors before parsing + IGMP header data. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + + /* Update the counter. */ + igmp_host_response ++; + + /* Check the igmp host repsone counter. */ + if (igmp_host_response != 1) + return NX_TRUE; + + /* Allocate a packet to place the IGMP Router query message in, IGMP version1. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, NX_IGMP_PACKET + router_alert, TX_NO_WAIT); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + /* Prepare a IGMP Router Query and send on the "all hosts" multicast + address. */ + + /* Calculate the IGMP response message size and store it in the + packet header. */ + my_packet -> nx_packet_length = NX_IGMP_HEADER_SIZE; + + /* Setup the append pointer to the end of the message. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + NX_IGMP_HEADER_SIZE; + + /* Stamp the outgoing interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list; + + /* Build the IGMP host response packet. */ + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *) my_packet -> nx_packet_prepend_ptr; + + /* Build the IGMPv1 Router query message. */ + header_ptr -> nx_igmp_header_word_0 = (ULONG) (NX_IGMP_VERSION | NX_IGMP_ROUTER_QUERY_TYPE); + header_ptr -> nx_igmp_header_word_1 = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list; + + /* Calculate the checksum. */ + temp = header_ptr -> nx_igmp_header_word_0; + checksum = (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + temp = header_ptr -> nx_igmp_header_word_1; + checksum += (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Modify checksum to invalid one. */ + checksum++; + + /* Place the checksum into the first header word. */ + header_ptr -> nx_igmp_header_word_0 = header_ptr -> nx_igmp_header_word_0 | (~checksum & NX_LOWER_16_MASK); + + /* IGMPv2 packets must be IPv4 packets. */ + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V4; + + /* If NX_LITTLE_ENDIAN is defined, the headers need to be swapped. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_1); + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Clear the capability of calculating the IGMP checksum. */ + ip_0.nx_ip_interface[0].nx_interface_capability_flag &= ~NX_INTERFACE_CAPABILITY_IGMP_RX_CHECKSUM; +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Call _nx_icmp_packet_receive to directly receive the IGMP packet with invalid checksum. */ + _nx_igmp_packet_receive(&ip_0, my_packet); + } + else + { + + /* Update the error counter. */ + error_counter ++; + } + + for (i = 0; i < 2; i++) + { + + /* Allocate a packet to place the IGMP Router query message in, IGMP version1. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, NX_IGMP_PACKET + router_alert, TX_NO_WAIT); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + /* Prepare a IGMP Router Query and send on the "all hosts" multicast + address. */ + + /* Calculate the IGMP response message size and store it in the + packet header. */ + my_packet -> nx_packet_length = NX_IGMP_HEADER_SIZE; + + /* Setup the append pointer to the end of the message. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + NX_IGMP_HEADER_SIZE; + + /* Stamp the outgoing interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list; + + /* Build the IGMP host response packet. */ + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *) my_packet -> nx_packet_prepend_ptr; + + /* Build the IGMPv1 Router query message. */ + header_ptr -> nx_igmp_header_word_0 = (ULONG) (NX_IGMP_VERSION | NX_IGMP_ROUTER_QUERY_TYPE | 0x00010000); + header_ptr -> nx_igmp_header_word_1 = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list; + + /* IGMPv2 packets must be IPv4 packets. */ + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V4; + + /* Calculate the IGMP checksum. */ + igmp_checksum_compute(my_packet); + + /* Call _nx_igmp_packet_receive to directly receive the valid packet. */ + _nx_igmp_packet_receive(&ip_0, my_packet); + } + else + { + + /* Update the error counter. */ + error_counter ++; + } + } + + /* Allocate a packet to place the IGMP Router query message in, IGMP version1. The group address is not joined. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, NX_IGMP_PACKET + router_alert, TX_NO_WAIT); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + /* Prepare a IGMP Router Query and send on the "all hosts" multicast + address. */ + + /* Calculate the IGMP response message size and store it in the + packet header. */ + my_packet -> nx_packet_length = NX_IGMP_HEADER_SIZE; + + /* Setup the append pointer to the end of the message. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + NX_IGMP_HEADER_SIZE; + + /* Stamp the outgoing interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list; + + /* Build the IGMP host response packet. */ + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *) my_packet -> nx_packet_prepend_ptr; + + /* Build the IGMPv1 Router query message. */ + header_ptr -> nx_igmp_header_word_0 = (ULONG) (NX_IGMP_VERSION | NX_IGMP_ROUTER_QUERY_TYPE); + header_ptr -> nx_igmp_header_word_1 = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list + 1; + + /* IGMPv2 packets must be IPv4 packets. */ + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V4; + + /* Calculate the IGMP checksum. */ + igmp_checksum_compute(my_packet); + + /* Call _nx_icmp_packet_receive to directly receive the IGMP packet with group address not joined. */ + _nx_igmp_packet_receive(&ip_0, my_packet); + } + else + { + + /* Update the error counter. */ + error_counter ++; + } + + /* Allocate a packet to place the IGMP Router query message in, IGMP version1. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, NX_IGMP_PACKET + router_alert, TX_NO_WAIT); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + /* Prepare a IGMP Router Query and send on the "all hosts" multicast + address. */ + + /* Calculate the IGMP response message size and store it in the + packet header. */ + my_packet -> nx_packet_length = NX_IGMP_HEADER_SIZE; + + /* Setup the append pointer to the end of the message. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + NX_IGMP_HEADER_SIZE; + + /* Stamp the outgoing interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_interface_list; + + /* Build the IGMP host response packet. */ + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *) my_packet -> nx_packet_prepend_ptr; + + /* Build the IGMPv1 Router query message. */ + header_ptr -> nx_igmp_header_word_0 = (ULONG) (NX_IGMP_VERSION | NX_IGMP_ROUTER_QUERY_TYPE); + header_ptr -> nx_igmp_header_word_1 = ip_ptr -> nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_list; + + /* Calculate the IGMP checksum. */ + igmp_checksum_compute(my_packet); + + /* Modify thread time so the random value get from tx_time_get will be in control. */ + tx_time_set((tx_time_get() & 0xFFFFFFF0) + 2); + + /* Call _nx_icmp_packet_receive to directly receive the valid packet. */ + _nx_igmp_packet_receive(&ip_0, my_packet); + } + else + { + + /* Update the error counter. */ + error_counter ++; + } + } + + return NX_TRUE; +} + +static void igmp_checksum_compute(NX_PACKET *packet_ptr) +{ +ULONG checksum; +ULONG temp; +NX_IGMP_HEADER *header_ptr; + + /* Setup the pointer to the message area. */ + header_ptr = (NX_IGMP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Clear the IGMP checksum. */ + header_ptr -> nx_igmp_header_word_0 &= 0xFFFF0000; + + + /* Calculate the checksum. */ + temp = header_ptr -> nx_igmp_header_word_0; + checksum = (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + temp = header_ptr -> nx_igmp_header_word_1; + checksum += (temp >> NX_SHIFT_BY_16); + checksum += (temp & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Place the checksum into the first header word. */ + header_ptr -> nx_igmp_header_word_0 |= (~checksum & NX_LOWER_16_MASK); + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_igmp_header_word_1); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_igmp_router_query_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IGMP Router Qeury Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_abnormal_packet_test.c b/test/regression/netxduo_test/netx_ip_abnormal_packet_test.c new file mode 100644 index 00000000..29f4d8a2 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_abnormal_packet_test.c @@ -0,0 +1,762 @@ +/* Test IPv6 prefix with length not equal 64. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_LOOPBACK_INTERFACE) && !defined(NX_DISABLE_IPV4) + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmp.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Frame (74 bytes) */ +/* IPv4 pakcet with next protocol 60(DESTINATION). */ +static char pkt1[74] = { +0x20, 0x0b, 0xc7, 0x94, 0x45, 0x96, 0x18, 0x03, /* ...E... */ +0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ +0x00, 0x3c, 0x6c, 0x31, 0x00, 0x00, 0x40, 0x3c, /* . nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Set invalid value to test destination protocol. */ + packet_ptr -> nx_packet_destination_header = 1; + packet_ptr -> nx_packet_option_state = 0; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt2; + pkt_len = sizeof(pkt2); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Set invalid value to test destination protocol. */ + packet_ptr -> nx_packet_destination_header = 0; + packet_ptr -> nx_packet_option_state = ROUTING_HEADER; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt3; + pkt_len = sizeof(pkt3); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Set invalid value to test destination protocol. */ + packet_ptr -> nx_packet_destination_header = 0; + packet_ptr -> nx_packet_option_state = FRAGMENT_HEADER; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + +#ifndef NX_IPSEC_ENABLE + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt4; + pkt_len = sizeof(pkt4); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt5; + pkt_len = sizeof(pkt5); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } +#endif /* NX_IPSEC_ENABLE */ + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt6; + pkt_len = sizeof(pkt6); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Disable ICMP. */ + ip_0.nx_ip_icmpv6_packet_process = NX_NULL; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Disable ICMP. */ + ip_0.nx_ip_icmpv6_packet_process = _nx_icmpv6_packet_process; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt7; + pkt_len = sizeof(pkt7); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Disable ICMP. */ + ip_0.nx_ip_icmp_packet_receive = NX_NULL; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Disable ICMP. */ + ip_0.nx_ip_icmp_packet_receive = _nx_icmp_packet_receive; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt8; + pkt_len = sizeof(pkt8); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt9; + pkt_len = sizeof(pkt9); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt10; + pkt_len = sizeof(pkt10); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt11; + pkt_len = sizeof(pkt11); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(127, 0, 0, 1), "", 0, &ping_resp, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + error_counter++; + } + else + { + nx_packet_release(ping_resp); + } + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt12; + pkt_len = sizeof(pkt12); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt13; + pkt_len = sizeof(pkt13); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + pkt_data_ptr = pkt14; + pkt_len = sizeof(pkt14); + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data_ptr[14], pkt_len - 14); + packet_ptr -> nx_packet_length = pkt_len - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Abnormal Packet Test...................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ip_address_change_notify_test.c b/test/regression/netxduo_test/netx_ip_address_change_notify_test.c new file mode 100644 index 00000000..0d334d27 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_address_change_notify_test.c @@ -0,0 +1,223 @@ +/* This NetX test concentrates on the IP Address Change Notify operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ip_0_address_change_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void ip_0_address_change_notify(NX_IP *ip_ptr, VOID *additional_info); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_change_notify_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Initialize the value. */ + error_counter = 0; + ip_0_address_change_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: IP Address Change Notify Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register IP address change callback. */ + status = nx_ip_address_change_notify(&ip_0, ip_0_address_change_notify, NX_NULL); + + /* Check for error */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address change counter. */ + if (ip_0_address_change_counter != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test nx_ip_address_set function. */ + + /* Set the same address and network mask again. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address change counter. */ + if (ip_0_address_change_counter != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the different address and same network mask again. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address change counter. */ + if (ip_0_address_change_counter != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the same address and different network mask again. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0xFFFF0000); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address change counter. */ + if (ip_0_address_change_counter != 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test nx_ip_interface_address_set function. */ + + /* Set the different address and same network mask again. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 6), 0xFFFF0000); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address change counter. */ + if (ip_0_address_change_counter != 3) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the same address and different network mask again. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 6), 0xFF000000); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address change counter. */ + if (ip_0_address_change_counter != 4) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); + +} +static VOID ip_0_address_change_notify(NX_IP *ip_ptr, VOID *additional_info) +{ + + /* Update the address change counter. */ + ip_0_address_change_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_change_notify_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Address Change Notify Test.............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_ip_address_conflict_callback_test.c b/test/regression/netxduo_test/netx_ip_address_conflict_callback_test.c new file mode 100644 index 00000000..a81bf733 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_address_conflict_callback_test.c @@ -0,0 +1,212 @@ +/* This NetX test concentrates on the IPv4 Address Conflict Detection. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_arp.h" + +extern void test_control_return(UINT status); +#ifndef NX_DISABLE_IPV4 +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG conflict_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void ip_address_conflict_detection(NX_IP *ip_ptr, UINT interface_index, ULONG ip_address, ULONG msw, ULONG lsw); +static void reject_arp_packet(NX_IP *ip_ptr, UINT interface_index, + ULONG source_ip, ULONG source_physical_msw, ULONG source_physical_lsw, + ULONG target_ip, ULONG target_physical_msw, ULONG target_physical_lsw); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_conflict_callback_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + conflict_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + + + /* Print out some test information banners. */ + printf("NetX Test: IP Address Conflict Callback Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address conflict callback function. */ + ip_0.nx_ip_interface[0].nx_interface_ip_conflict_notify_handler = ip_address_conflict_detection; + + /* Reject the ARP packet without conflict. */ + reject_arp_packet(&ip_0, 0, IP_ADDRESS(1, 2, 3, 5), 0x00000011, 0x22334457, IP_ADDRESS(1, 2, 3, 4), 0x00000011, 0x22334456); + + /* Check the announce counter. */ + if (conflict_counter != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reject the ARP packet with conflict. */ + reject_arp_packet(&ip_0, 0, IP_ADDRESS(1, 2, 3, 4), 0x00000011, 0x22334457, IP_ADDRESS(1, 2, 3, 4), 0x00000011, 0x22334456); + + /* Check the announce counter. */ + if (conflict_counter != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +VOID reject_arp_packet(NX_IP *ip_ptr, UINT interface_index, + ULONG source_ip, ULONG source_physical_msw, ULONG source_physical_lsw, + ULONG target_ip, ULONG target_physical_msw, ULONG target_physical_lsw) +{ + +NX_PACKET *request_ptr; +ULONG *message_ptr; + + + /* Allocate a packet to build the ARP message in. */ + if (nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &request_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT)) + { + + /* Increment error counter. */ + error_counter ++; + + /* Error getting packet, so just get out! */ + return; + } + + /* Build the ARP request packet. */ + + /* Setup the size of the ARP message. */ + request_ptr -> nx_packet_length = NX_ARP_MESSAGE_SIZE; + + /* Setup the append pointer to the end of the message. */ + request_ptr -> nx_packet_append_ptr = request_ptr -> nx_packet_prepend_ptr + NX_ARP_MESSAGE_SIZE; + + /* Setup the pointer to the message area. */ + message_ptr = (ULONG *) request_ptr -> nx_packet_prepend_ptr; + + /* Write the Hardware type into the message. */ + *message_ptr = (ULONG) (NX_ARP_HARDWARE_TYPE << 16) | (NX_ARP_PROTOCOL_TYPE); + *(message_ptr+1) = (ULONG) (NX_ARP_HARDWARE_SIZE << 24) | (NX_ARP_PROTOCOL_SIZE << 16) | + NX_ARP_OPTION_REQUEST; + *(message_ptr+2) = (ULONG) (source_physical_msw << 16) | (source_physical_lsw >> 16); + *(message_ptr+3) = (ULONG) (source_physical_lsw << 16) | (source_ip >> 16); + *(message_ptr+4) = (ULONG) (source_ip << 16) | (target_physical_msw & 0xFFFF); + *(message_ptr+5) = (ULONG) target_physical_lsw; + *(message_ptr+6) = (ULONG) target_ip; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Set the interface. */ + request_ptr -> nx_packet_ip_interface = &ip_ptr -> nx_ip_interface[interface_index]; + + /* Directly receive this packet as conflict packet. */ + _nx_arp_packet_deferred_receive(ip_ptr, request_ptr); +} + +static void ip_address_conflict_detection(NX_IP *ip_ptr, UINT interface_index, ULONG ip_address, ULONG msw, ULONG lsw) +{ + + /* Update the conflict counter. */ + conflict_counter ++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_conflict_callback_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Address Conflict Callback Test.........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_address_conflict_detection_test.c b/test/regression/netxduo_test/netx_ip_address_conflict_detection_test.c new file mode 100644 index 00000000..d1849e17 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_address_conflict_detection_test.c @@ -0,0 +1,497 @@ +/* This NetX test concentrates on the IPv4 Address Conflict Detection. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_arp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the timing and retry constants for ARP probe and announce. */ + +#define NX_ARP_PROBE_WAIT 1 +#define NX_ARP_PROBE_NUM 3 +#define NX_ARP_PROBE_MIN 1 +#define NX_ARP_PROBE_MAX 2 +#define NX_ARP_ANNOUNCE_WAIT 2 +#define NX_ARP_ANNOUNCE_NUM 2 +#define NX_ARP_ANNOUNCE_INTERVAL 2 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG probe_counter; +static ULONG announce_counter; +static ULONG conflict_counter; +static ULONG gratuitous_responder_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void ip_address_conflict_detection(NX_IP *ip_ptr, UINT interface_index, ULONG ip_address, ULONG msw, ULONG lsw); +static void gratuitous_responder_handler(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_conflict_detection_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + probe_counter = 0; + announce_counter = 0; + conflict_counter = 0; + gratuitous_responder_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT packet_counter; +UINT i; +ULONG delay; +NX_PACKET *my_packet[30]; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Address Conflict Detection Test........................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process; + + /* Set the IP address conflict callback function for probing. */ + ip_0.nx_ip_interface[0].nx_interface_ip_conflict_notify_handler = ip_address_conflict_detection; + + /* Allocate all packet from packet pool. */ + packet_counter = pool_0.nx_packet_pool_available; + for(i =0; i < packet_counter; i ++) + { + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Call to send ARP Probe. */ + status = _nx_arp_probe_send(&ip_0, 0, IP_ADDRESS(1, 2, 3, 4)); + + /* Check status. */ + if (status != NX_NO_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release all allocated packet. */ + for(i =0; i < packet_counter; i ++) + { + + /* Allocate the packet. */ + status = nx_packet_release(my_packet[i]); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Delay before probing. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * NX_ARP_PROBE_WAIT); + + /* Loop to probe for the specified local IP address according to RFC5227. */ + for (i = 0; i < NX_ARP_PROBE_NUM; i++) + { + + /* Send the ARP probe. */ + _nx_arp_probe_send(&ip_0, 0, IP_ADDRESS(1, 2, 3, 4)); + + /* Calculate the delay time. */ + delay = ((ULONG) NX_RAND()) % (NX_IP_PERIODIC_RATE * NX_ARP_PROBE_MAX); + + /* Determine if this is less than the minimum. */ + if (delay < (NX_IP_PERIODIC_RATE * NX_ARP_PROBE_MIN)) + { + + /* Set the delay to the minimum. */ + delay = (NX_IP_PERIODIC_RATE * NX_ARP_PROBE_MIN); + } + + /* Sleep for a small period of time. */ + tx_thread_sleep(delay); + } + + /* Check the probe counter. */ + if ((probe_counter != 3) || (conflict_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Change new address and start probing. */ + + /* Delay before probing. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * NX_ARP_PROBE_WAIT); + + /* Loop to probe for the specified local IP address according to RFC5227. */ + for (i = 0; i < NX_ARP_PROBE_NUM; i++) + { + + /* Send the ARP probe. */ + _nx_arp_probe_send(&ip_0, 0, IP_ADDRESS(1, 2, 3, 5)); + + /* Calculate the delay time. */ + delay = ((ULONG) NX_RAND()) % (NX_IP_PERIODIC_RATE * NX_ARP_PROBE_MAX); + + /* Determine if this is less than the minimum. */ + if (delay < (NX_IP_PERIODIC_RATE * NX_ARP_PROBE_MIN)) + { + + /* Set the delay to the minimum. */ + delay = (NX_IP_PERIODIC_RATE * NX_ARP_PROBE_MIN); + } + + /* Sleep for a small period of time. */ + tx_thread_sleep(delay); + } + + /* Check the probe counter. */ + if ((probe_counter != 6) || (conflict_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the NetX IP address. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 5), 0xFFFF0000); + + /* Check for status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate all packet from packet pool. */ + packet_counter = pool_0.nx_packet_pool_available; + for(i =0; i < packet_counter; i ++) + { + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Send the ARP announcement. */ + status = _nx_arp_announce_send(&ip_0, 0); + + /* Check status. */ + if (status != NX_NO_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release all allocated packet. */ + for(i =0; i < packet_counter; i ++) + { + + /* Allocate the packet. */ + status = nx_packet_release(my_packet[i]); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Delay before announcing. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * NX_ARP_ANNOUNCE_WAIT); + + /* It is now time to go into an announce phase to indicate local IP address is ours! + Note:NetX do not give up its address during announce pahse. */ + for (i = 0; i < NX_ARP_ANNOUNCE_NUM; i++) + { + + /* Send the ARP announcement. */ + _nx_arp_announce_send(&ip_0, 0); + + /* Calculate the delay time. */ + delay = (NX_IP_PERIODIC_RATE * NX_ARP_ANNOUNCE_INTERVAL); + + /* Sleep for announce interval. */ + tx_thread_sleep(delay); + } + + /* Check the announce counter. */ + if (announce_counter != 2) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send a gratuitous ARP message. */ + status = nx_arp_gratuitous_send(&ip_0, gratuitous_responder_handler); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep for IP conflict. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the announce counter. */ + if ((announce_counter != 4) || (conflict_counter != 2) || (gratuitous_responder_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG *message_ptr; +ULONG sender_physical_msw; +ULONG sender_physical_lsw; +ULONG sender_ip_address; +ULONG target_physical_msw; +ULONG target_physical_lsw; +ULONG target_ip_address; +ULONG message_type; + + /* Check the packet length. */ + if (packet_ptr ->nx_packet_length != NX_ARP_MESSAGE_SIZE) + { + + /* Update the error_counter. */ + error_counter++; + + /* Release the packet */ + nx_packet_release(packet_ptr); + + /* Return to caller. */ + return NX_FALSE; + } + + /* Setup a pointer to the ARP message. */ + message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Pickup the ARP message type. */ + message_type = (ULONG) (*(message_ptr+1) & 0xFFFF); + + /* Determine if the ARP message type is valid. */ + if (message_type != NX_ARP_OPTION_REQUEST) + { + + /* Update the error_counter. */ + error_counter++; + + /* Release the packet */ + nx_packet_release(packet_ptr); + + /* Return to caller. */ + return NX_FALSE; + } + + + /* Pick up the sender's physical address from the message. */ + sender_physical_msw = (*(message_ptr+2) >> 16); + sender_physical_lsw = (*(message_ptr+2) << 16) | (*(message_ptr+3) >> 16); + sender_ip_address = (*(message_ptr+3) << 16) | (*(message_ptr+4) >> 16); + target_physical_msw = (*(message_ptr+4) & 0x0000FFFF); + target_physical_lsw = *(message_ptr+5); + target_ip_address = *(message_ptr+6); + + /* Check the sender and target information. */ + if (((sender_physical_msw | sender_physical_lsw) != 0) && (sender_ip_address == 0) && + ((target_physical_msw | target_physical_lsw) == 0) && (target_ip_address != 0)) + probe_counter ++; + + else if (((sender_physical_msw | sender_physical_lsw) != 0) && (sender_ip_address != 0) && + ((target_physical_msw | target_physical_lsw) == 0) && (target_ip_address != 0)) + announce_counter ++; + + /* Let IP conflict. */ + if ((probe_counter == 3) || (announce_counter == 3)) + { + + /* Modify the sender MAC address let IP address conflict. */ + *(message_ptr+2) += 0x10; + } + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the ARP message. */ + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); + NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); + + /* Let IP conflict. */ + if ((probe_counter == 3) || (announce_counter == 3)) + { + + /* Directly receive this packet as conflict packet. */ + _nx_arp_packet_deferred_receive(ip_ptr, packet_ptr); + + return NX_FALSE; + } + + /* Release the packet */ + nx_packet_release(packet_ptr); + + /* Return to caller. */ + return NX_FALSE; +} + +static void ip_address_conflict_detection(NX_IP *ip_ptr, UINT interface_index, ULONG ip_address, ULONG msw, ULONG lsw) +{ + + /* Update the conflict counter. */ + conflict_counter ++; +} + +static void gratuitous_responder_handler(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + /* Update the gratuitous_responder_counter. */ + gratuitous_responder_counter ++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_conflict_detection_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Address Conflict Detection Test........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_address_get_test.c b/test/regression/netxduo_test/netx_ip_address_get_test.c new file mode 100644 index 00000000..677e8f19 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_address_get_test.c @@ -0,0 +1,204 @@ +/* This NetX test concentrates on the IP Address Get operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_get_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG address; +ULONG mask; + + /* Print out test information banner. */ + printf("NetX Test: IP Address Get Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_address_get(&ip_0, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1,2,3,4)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_0, 1, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(4, 3, 2, 10)) || (mask != 0xFF000000)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_0, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_address_get(&ip_1, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1,2,3,5)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_1, 1, &address, &mask); + + + if((status != NX_SUCCESS ) || (address != IP_ADDRESS(4,3,2,11)) || (mask != 0xFF000000)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_1, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_get_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Address Get Test.......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_address_set_test.c b/test/regression/netxduo_test/netx_ip_address_set_test.c new file mode 100644 index 00000000..faf1d33e --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_address_set_test.c @@ -0,0 +1,462 @@ +/* This NetX test concentrates on the IP Address Set operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_set_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 14), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 15), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG address; +ULONG mask; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; +ULONG my_packet_length; + + + /* Print out test information banner. */ + printf("NetX Test: IP Address Set Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 110), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 111), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure we can ping using the current IP address. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 91), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 110), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + status += nx_packet_length_get(my_packet, &my_packet_length); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 14), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping via the other direction. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 9), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 111), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 15), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((pings_sent != 3) || (ping_timeouts != 1) || (ping_responses_received != 2) || (icmp_checksum_errors) || + (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((pings_sent != 3) || (ping_timeouts != 1) || (ping_responses_received != 2) || (icmp_checksum_errors) || + (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reconfigure the interface IP addresses. */ + status = nx_ip_interface_address_set(&ip_0, 1, IP_ADDRESS(4, 3, 2, 10), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_set(&ip_0, 2, IP_ADDRESS(4, 3, 2, 15), 0xFFFFF000); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_set(&ip_1, 1, IP_ADDRESS(4, 3, 2, 11), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_set(&ip_1, 2, IP_ADDRESS(4, 3, 2, 15), 0xFFFFF000); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_address_set(&ip_1, IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Make sure we can ping via the new interface IP address. */ + /* Make sure we can ping using the current IP address. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 91), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 10), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping via the other direction. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 9), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 6) || (ping_timeouts != 2) || (ping_responses_received != 4) ||(icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 6) || (ping_timeouts != 2) || (ping_responses_received != 4) ||(icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_ip_interface_address_get(&ip_0, 0, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1, 2, 3, 4)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_ip_interface_address_get(&ip_0, 1, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(4, 3, 2, 10)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_0, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_interface_address_get(&ip_1, 0, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1, 2, 3, 5)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_1, 1, &address, &mask); + + if((status != NX_SUCCESS ) || (address != IP_ADDRESS(4, 3, 2, 11)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_1, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + printf("SUCCESS!\n"); + test_control_return(0); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_address_set_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Address Set Test.......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_auxiliary_packet_pool_set_test.c b/test/regression/netxduo_test/netx_ip_auxiliary_packet_pool_set_test.c new file mode 100644 index 00000000..1e8183ae --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_auxiliary_packet_pool_set_test.c @@ -0,0 +1,167 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#if defined __PRODUCT_NETXDUO__ && defined NX_ENABLE_DUAL_PACKET_POOL + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL auxiliary_pool_0; +static NX_PACKET_POOL auxiliary_pool_1; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_auxiliary_packet_pool_set_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. 256 * 10= 2560 */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2560); + pointer = pointer + 2560; + + if (status) + error_counter++; + + /* Create a auxiliary packet pool 0. 128*10 = 1280 */ + status = nx_packet_pool_create(&auxiliary_pool_0, "NetX Auxiliary Packet Pool 0", 128, pointer, 1280); + pointer = pointer + 1280; + + if (status) + error_counter++; + + /* Create a auxiliary packet pool 1. 512*10 = 5120 */ + status = nx_packet_pool_create(&auxiliary_pool_1, "NetX Auxiliary Packet Pool 1", 512, pointer, 5120); + pointer = pointer + 5120; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: IP Auxiliary Packet Pool Set Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the auxiliary packet pool 0 for IP instance 0. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_0, &auxiliary_pool_0); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the default packet pool and auxiliary packet pool. */ + if ((ip_0.nx_ip_default_packet_pool != &pool_0) || + (ip_0.nx_ip_auxiliary_packet_pool != &auxiliary_pool_0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the auxiliary packet pool 1 for IP instance 1. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_0, &auxiliary_pool_1); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the default packet pool and auxiliary packet pool. */ + if ((ip_0.nx_ip_default_packet_pool != &auxiliary_pool_1) || + (ip_0.nx_ip_auxiliary_packet_pool != &auxiliary_pool_0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_auxiliary_packet_pool_set_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Auxiliary Packet Pool Set Test.........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_basic_test.c b/test/regression/netxduo_test/netx_ip_basic_test.c new file mode 100644 index 00000000..7783be60 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_basic_test.c @@ -0,0 +1,386 @@ +/* This NetX test concentrates on the basic IP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *ip_0_memory_ptr; +static CHAR *ip_1_memory_ptr; +static CHAR *arp_0_memory_ptr; +static CHAR *arp_1_memory_ptr; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern ULONG simulated_address_msw; +extern ULONG simulated_address_lsw; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create IP instances. */ + ip_0_memory_ptr = pointer; + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + ip_1_memory_ptr = pointer; + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + arp_0_memory_ptr = pointer; + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + arp_1_memory_ptr = pointer; + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG mask; +ULONG value; +ULONG ip_total_packets_sent; +ULONG ip_total_bytes_sent; +ULONG ip_total_packets_received; +ULONG ip_total_bytes_received; +ULONG ip_invalid_packets; +ULONG ip_receive_packets_dropped; +ULONG ip_receive_checksum_errors; +ULONG ip_send_packets_dropped; +ULONG ip_total_fragments_sent; +ULONG ip_total_fragments_received; +#ifdef __PRODUCT_NETXDUO__ +ULONG physical_msw; +ULONG physical_lsw; +ULONG gateway_addr_getted; +#endif /* __PRODUCT_NETXDUO__ */ +#ifdef NX_ENABLE_IP_STATIC_ROUTING +NX_INTERFACE + *if_ptr = NX_NULL; +ULONG next_hop_address; + + + /* Test static routing. */ + /* Add static route. */ + nx_ip_static_route_add(&ip_0, IP_ADDRESS(1, 2, 3, 0), 0xFFFFFF00UL, IP_ADDRESS(1, 2, 3, 2)); + + nx_ip_static_route_add(&ip_0, IP_ADDRESS(1, 2, 3, 0), 0xFFFFFF00UL, IP_ADDRESS(1, 2, 3, 1)); + + nx_ip_static_route_add(&ip_0, IP_ADDRESS(1, 2, 4, 0), 0xFFFFFF00UL, IP_ADDRESS(1, 2, 3, 1)); + + /* Find route. */ + _nx_ip_route_find(&ip_0, IP_ADDRESS(1, 2, 3, 2), &if_ptr, &next_hop_address); + + /* Check interface and next hop address. */ + if((if_ptr != &ip_0.nx_ip_interface[0]) || + (next_hop_address != IP_ADDRESS(1, 2, 3, 1))) + error_counter++; +#endif /* NX_ENABLE_IP_STATIC_ROUTING */ + + + /* Print out test information banner. */ + printf("NetX Test: IP Basic Operation Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the IP address. */ + status = nx_ip_address_get(&ip_0, &ip_address, &mask); + + /* Check for an error. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 9))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 13), 0xFFFFFF00UL); + status += nx_ip_address_get(&ip_0, &ip_address, &mask); + + /* Check for an error. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 13))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + /* Delete a static route. */ + status = nx_ip_static_route_delete(&ip_0, IP_ADDRESS(1,2,4,0), 0xFFFFFF00UL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + /* Delete both IP instances. */ + status = nx_ip_delete(&ip_0); + status += nx_ip_delete(&ip_1); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_0_memory_ptr, 2048, 1); + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_1_memory_ptr, 2048, 1); + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_0, (void *) arp_0_memory_ptr, 1024); + status += nx_arp_enable(&ip_1, (void *) arp_1_memory_ptr, 1024); + + /* Check the status of the IP instances. */ + status += nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call driver directly. */ + status = nx_ip_driver_direct_command(&ip_0, NX_LINK_GET_STATUS, &value); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call driver directly specifying the interface. */ + status = nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_GET_STATUS, 0, &value); + + /* Check for an error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable and disable forwarding. */ + status = nx_ip_forwarding_enable(&ip_0); + status += nx_ip_forwarding_disable(&ip_0); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Enable fragment feature. */ + status = nx_ip_fragment_enable(&ip_0); + +#ifndef NX_DISABLE_FRAGMENTATION + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + /* Check the status. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Disable fragment feature. */ + status = nx_ip_fragment_disable(&ip_0); + +#ifndef NX_DISABLE_FRAGMENTATION + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + /* Check the status. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif +#endif + + /* Set the gateway address. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 87)); + + /* Check for an error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + status = nx_ip_gateway_address_get(&ip_0, &gateway_addr_getted); + if((status != NX_SUCCESS) || gateway_addr_getted != IP_ADDRESS(1,2,3,87)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + +#ifdef __PRODUCT_NETXDUO__ + /* Get Mac address. */ + status = nx_ip_interface_physical_address_get(&ip_0, 0, &physical_msw, &physical_lsw); + if((status != NX_SUCCESS) || + (physical_msw != simulated_address_msw) || + (physical_lsw != simulated_address_lsw)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_gateway_address_clear(&ip_0); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /* Get nothing from IP info. */ + status = nx_ip_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP info. */ + status = nx_ip_info_get(&ip_0, &ip_total_packets_sent, + &ip_total_bytes_sent, + &ip_total_packets_received, + &ip_total_bytes_received, + &ip_invalid_packets, + &ip_receive_packets_dropped, + &ip_receive_checksum_errors, + &ip_send_packets_dropped, + &ip_total_fragments_sent, + &ip_total_fragments_received); + + /* Check status. */ + if ((status) || (ip_total_packets_sent) || (ip_total_bytes_sent) || (ip_total_packets_received) || + (ip_total_bytes_received) || (ip_invalid_packets) || (ip_receive_packets_dropped) || (ip_receive_checksum_errors) || + (ip_send_packets_dropped) || (ip_total_fragments_sent) || (ip_total_fragments_received)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Basic Operation Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_branch_test.c b/test/regression/netxduo_test/netx_ip_branch_test.c new file mode 100644 index 00000000..fc4df347 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_branch_test.c @@ -0,0 +1,1143 @@ +/* This NetX test concentrates on the code coverage for IP functions, + * _nx_ip_deferred_link_status_process.c + * _nx_ip_interface_detach.c + * _nx_ip_max_payload_size_find.c + * _nx_ip_packet_receive.c + */ + +#include "nx_ip.h" +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_icmp.h" +#include "nx_arp.h" +#include "nx_rarp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nx_udp.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_test1; +static TX_THREAD thread_test2; +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_ASSERT +static TX_THREAD thread_for_assert; +static UINT assert_count = 0; +#endif +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static CHAR *pointer; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER); +static VOID link_status_change_callback(NX_IP *ip_ptr, UINT interface_index, UINT link_status); +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_ASSERT +static void thread_for_assert_entry(ULONG thread_input); +#endif +#ifdef FEATURE_NX_IPV6 +static UINT my_raw_packet_processing(NX_IP *ip_ptr, ULONG protocol, NX_PACKET *packet_ptr); +#endif + +#ifdef __PRODUCT_NETXDUO__ +static char pkt1[590] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x08, 0x00, 0x45, 0x00, /* "3DX..E. */ +0x02, 0x40, 0x00, 0x01, 0x40, 0x00, 0x80, 0x11, /* .@..@... */ +0xf8, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x44, 0x00, 0x43, 0x02, 0x2c, /* ...D.C., */ +0xd7, 0x45, 0x01, 0x01, 0x06, 0x00, 0x22, 0x33, /* .E...."3 */ +0x44, 0x60, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* D`...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* "3DX.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x01, 0x33, 0x04, 0xff, /* Sc5..3.. */ +0xff, 0xff, 0xff, 0x0c, 0x0b, 0x64, 0x68, 0x63, /* .....dhc */ +0x70, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, /* p_client */ +0x37, 0x03, 0x01, 0x03, 0x06, 0xff, 0x00, 0x00, /* 7....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (342 bytes) */ +static char pkt2[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x58, 0x00, 0x50, /* .."3DX.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x7d, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %}...... */ +0x00, 0x18, 0x00, 0x3c, 0x00, 0x44, 0x01, 0x34, /* ...<.D.4 */ +0xdb, 0x3c, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .<...."3 */ +0x44, 0x60, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* D`...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x18, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* "3DX.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x02, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Frame (342 bytes) */ +static char pkt3[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x58, 0x00, 0x50, /* .."3DX.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x7d, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %}...... */ +0x00, 0x18, 0x00, 0x43, 0x00, 0x46, 0x01, 0x34, /* ...C.F.4 */ +0xd8, 0x32, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .2...."3 */ +0x44, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, /* D`...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x18, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* "3DX.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +/* Frame (342 bytes) */ +static const unsigned char pkt4[342] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x58, 0x00, 0x50, /* .."3DX.P */ +0x56, 0x39, 0xf6, 0x3d, 0x08, 0x00, 0x45, 0x10, /* V9.=..E. */ +0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, /* .H...... */ +0x25, 0x7d, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, /* %}...... */ +0x00, 0x18, 0x00, 0x43, 0x00, 0x44, 0x01, 0x34, /* ...C.D.4 */ +0xd8, 0x34, 0x02, 0x01, 0x06, 0x00, 0x22, 0x33, /* .4...."3 */ +0x44, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, /* D`...... */ +0x00, 0x00, 0x0a, 0x00, 0x00, 0x18, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* "3DX.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ +0x53, 0x63, 0x35, 0x01, 0x05, 0x36, 0x04, 0x0a, /* Sc5..6.. */ +0x00, 0x00, 0x01, 0x33, 0x04, 0x00, 0x00, 0x01, /* ...3.... */ +0x2c, 0x01, 0x04, 0xff, 0xff, 0xff, 0x00, 0x03, /* ,....... */ +0x04, 0x0a, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + +#ifdef FEATURE_NX_IPV6 +static const unsigned char pkt5[78] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x00, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; +#endif /* FEATURE_NX_IPV6 */ +#endif + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_branch_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 800, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 processing for IP instance. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG thread_state; +NX_PACKET *my_packet[2]; + +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS dest_address; +ULONG src_ip_addr = 0x01020304; +ULONG dest_ip_addr = 0x01020305; +NX_IPV4_HEADER *ip_header_ptr; +NX_ARP *temp_arp; +#endif /* __PRODUCT_NETXDUO__ */ +NX_INTERFACE + *if_ptr = NX_NULL; +ULONG next_hop_address; +#ifndef NX_DISABLE_LOOPBACK_INTERFACE +UINT i; +#endif +#ifdef FEATURE_NX_IPV6 +NX_IPV6_HEADER *ipv6_header_ptr; +#endif /* FEATURE_NX_IPV6 */ + + + /* Print out some test information banners. */ + printf("NetX Test: IP Branch Test............................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Hit false condition of ip_ptr -> nx_ip_interface[i].nx_interface_link_status_change in _nx_ip_deferred_link_status_process(). */ + ip_0.nx_ip_link_status_change_callback = link_status_change_callback; + ip_0.nx_ip_interface[0].nx_interface_link_status_change = NX_FALSE; + _nx_ip_deferred_link_status_process(&ip_0); + ip_0.nx_ip_interface[0].nx_interface_link_status_change = NX_TRUE; + _nx_ip_deferred_link_status_process(&ip_0); + + /* Recover. */ + ip_0.nx_ip_link_status_change_callback = NX_NULL; + + +#ifdef __PRODUCT_NETXDUO__ + /* Hit condition of if (interface_ptr -> nx_interface_valid == NX_FALSE) in _nx_ip_max_payload_size_find(). */ + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + _nx_ip_max_payload_size_find(&ip_0, &dest_address, 0, 0, 0, NX_PROTOCOL_TCP, NX_NULL, NX_NULL); + _nx_ip_max_payload_size_find(&ip_0, &dest_address, NX_MAX_PHYSICAL_INTERFACES, 0, 0, NX_PROTOCOL_TCP, NX_NULL, NX_NULL); + _nx_ip_max_payload_size_find(&ip_0, &dest_address, 0, 0, 0, NX_PROTOCOL_ICMP, NX_NULL, NX_NULL); + + +#if (NX_MAX_PHYSICAL_INTERFACES >= 2) + /* Hit condition of if (interface_ptr -> nx_interface_valid == NX_FALSE) in _nx_ip_interface_detach(). */ + _nx_ip_interface_detach(&ip_0, 1); + nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_256); + _nx_ip_interface_detach(&ip_0, 1); +#endif + +#endif /* __PRODUCT_NETXDUO__ */ + + + + /* Test _nx_ip_raw_packet_cleanup(). */ + /* tx_thread_suspend_control_block is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + _nx_ip_raw_packet_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* tx_thread_suspend_control_block is set to IP but tx_thread_suspend_cleanup is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &ip_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + _nx_ip_raw_packet_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* tx_thread_suspend_control_block is set to IP and tx_thread_suspend_cleanup is set to suspend_cleanup, but clear the IP ID. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &ip_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + ip_0.nx_ip_id = 0; + _nx_ip_raw_packet_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + ip_0.nx_ip_id = NX_IP_ID; + + ip_0.nx_ip_raw_packet_suspended_count ++; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + thread_state = tx_thread_identify() -> tx_thread_state; + tx_thread_identify() -> tx_thread_state = 0; + _nx_ip_raw_packet_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + + + /* Setup tx_thread_suspend_cleanup, control block. */ + ip_0.nx_ip_raw_packet_suspended_count ++; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &ip_0; + tx_thread_identify() -> tx_thread_suspended_next = &thread_test1; + tx_thread_identify() -> tx_thread_suspended_previous = &thread_test2; + thread_state = tx_thread_identify() -> tx_thread_state; + tx_thread_identify() -> tx_thread_state = 0; + _nx_ip_raw_packet_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + + +#ifdef FEATURE_NX_IPV6 + /* Hit condition of if (ip_version == NX_IP_VERSION_V4 && ip_ptr -> nx_ipv4_packet_receive) and if (ip_version == NX_IP_VERSION_V6 && ip_ptr -> nx_ipv6_packet_receive) in _nx_ip_packet_receive(). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + *(my_packet[0] -> nx_packet_prepend_ptr) = NX_IP_VERSION_V4 << 4; + ip_0.nx_ipv4_packet_receive = NX_NULL; + _nx_ip_packet_receive(&ip_0, my_packet[0]); + *(my_packet[0] -> nx_packet_prepend_ptr) = NX_IP_VERSION_V6 << 4; + ip_0.nx_ipv6_packet_receive = NX_NULL; + _nx_ip_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ipv4_packet_receive = _nx_ipv4_packet_receive; + ip_0.nx_ipv6_packet_receive = _nx_ipv6_packet_receive; + nx_packet_release(my_packet[0]); +#endif /* FEATURE_NX_IPV6 */ + + /* Test nx_ip_route_find with a down interface for multicast address. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + if_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_route_find(&ip_0, IP_ADDRESS(224, 2, 3, 2), &if_ptr, &next_hop_address); + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + + /* Hit the condition that (*ip_interface_ptr != interface_ptr). */ + if_ptr = &ip_0.nx_ip_interface[4]; + _nx_ip_route_find(&ip_0, IP_ADDRESS(1, 2, 3, 4), &if_ptr, &next_hop_address); + + /* Test nx_ip_route_find with a down interface for link local address. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + if_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_route_find(&ip_0, IP_ADDRESS(169, 254, 3, 2), &if_ptr, &next_hop_address); + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + + /* Test nx_ip_route_find with a invalid interface for link local address. */ + ip_0.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + if_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_route_find(&ip_0, IP_ADDRESS(169, 254, 3, 2), &if_ptr, &next_hop_address); + ip_0.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + + + /* Test nx_ip_route_find with a null interface for link local address. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + ip_0.nx_ip_interface[4].nx_interface_valid = NX_FALSE; + if_ptr = NX_NULL; + _nx_ip_route_find(&ip_0, IP_ADDRESS(169, 254, 3, 2), &if_ptr, &next_hop_address); + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + ip_0.nx_ip_interface[4].nx_interface_valid = NX_TRUE; + + /* Test nx_ip_route_find with a invalid gateway interface. */ + ip_0.nx_ip_gateway_address = IP_ADDRESS(1, 2, 3, 5); + if_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_route_find(&ip_0, IP_ADDRESS(2, 3, 4, 5), &if_ptr, &next_hop_address); + ip_0.nx_ip_gateway_interface = &ip_0.nx_ip_interface[4]; + ip_0.nx_ip_interface[4].nx_interface_link_up = NX_FALSE; + _nx_ip_route_find(&ip_0, IP_ADDRESS(2, 3, 4, 5), &if_ptr, &next_hop_address); + ip_0.nx_ip_interface[4].nx_interface_link_up = NX_TRUE; + ip_0.nx_ip_gateway_interface = NX_NULL; + ip_0.nx_ip_gateway_address = 0; + +#ifdef FEATURE_NX_IPV6 + /* Test _nx_ipv4_option_process with invalid options. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + *(my_packet[0] -> nx_packet_prepend_ptr + 3) = NX_IP_VERSION_V4 << 4 | 15; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER)) = NX_IP_OPTION_INTERNET_TIMESTAMP; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 1) = 40; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 2) = 6; + _nx_ipv4_option_process(&ip_0, my_packet[0]); + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 1) = 39; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 2) = 5; + _nx_ipv4_option_process(&ip_0, my_packet[0]); + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 1) = 41; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 2) = 5; + _nx_ipv4_option_process(&ip_0, my_packet[0]); + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 1) = 40; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 3) = 1; + _nx_ipv4_option_process(&ip_0, my_packet[0]); + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + 3) = 3; + _nx_ipv4_option_process(&ip_0, my_packet[0]); + nx_packet_release(my_packet[0]); +#endif + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_ASSERT + /* Test _nx_ip_header_add(). */ + /* Hit NX_ASSERT(packet_ptr -> nx_packet_prepend_ptr >= packet_ptr -> nx_packet_data_start); */ + + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nx_ip_checksum_compute(). */ + /* Hit condition: src_ip_addr == NX_NULL; + 152 [ + - ][ - + ]: NX_ASSERT((src_ip_addr != NX_NULL) && (dest_ip_addr != NX_NULL)); */ + + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + /* Hit condition: dest_ip_addr == NX_NULL; + 152 [ + - ][ - + ]: NX_ASSERT((src_ip_addr != NX_NULL) && (dest_ip_addr != NX_NULL)); */ + + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); +#endif /* NX_DISABLE_ASSERT */ + + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_ip_checksum_compute.*/ + /* Hit condition: 208 [ + - ]: while (current_packet) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 9; + my_packet[0] -> nx_packet_length = 9; + _nx_ip_checksum_compute(my_packet[0], NX_PROTOCOL_UDP, 9, &src_ip_addr, &dest_ip_addr); + nx_packet_release(my_packet[0]); + + + +#ifndef NX_DISABLE_PACKET_CHAIN + /* Test _nx_ipv4_packet_receive. */ + /* Hit condition: 268 [ + - ]: while (delta) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_allocate(&pool_0, &my_packet[1], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 30; + my_packet[0] -> nx_packet_length = 30; + my_packet[0] -> nx_packet_next = my_packet[1]; + my_packet[0] -> nx_packet_last = my_packet[1]; + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | NX_IP_NORMAL | (0xFFFF & 22)); + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + my_packet[1] -> nx_packet_append_ptr = my_packet[1] -> nx_packet_prepend_ptr + 8; + my_packet[1] -> nx_packet_length = 8; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + _nx_ipv4_packet_receive(&ip_0, my_packet[0]); +#endif + + + /* Hit true condition: (ip_header_ptr -> nx_ip_header_destination_ip == 0) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + memcpy(my_packet[0] ->nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + sizeof(pkt1) - 14; + my_packet[0] -> nx_packet_length = sizeof(pkt1) - 14; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + _nx_ipv4_packet_receive(&ip_0, my_packet[0]); + + + /* Hit true condition: src_port = 70; + 755 [ + - ][ + - ]: if ((src_port == 67) && (dest_port == 68)) */ + ip_0.nx_ip_interface[0].nx_interface_ip_address = 0; + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + memcpy(my_packet[0] ->nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + sizeof(pkt2) - 14; + my_packet[0] -> nx_packet_length = sizeof(pkt2) - 14; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + _nx_ipv4_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_interface[0].nx_interface_ip_address = IP_ADDRESS(1, 2, 3, 4); + + + /* Hit true condition: dest_port = 70; + 755 [ + - ][ + - ]: if ((src_port == 67) && (dest_port == 68)) */ + ip_0.nx_ip_interface[0].nx_interface_ip_address = 0; + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + memcpy(my_packet[0] ->nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + sizeof(pkt3) - 14; + my_packet[0] -> nx_packet_length = sizeof(pkt3) - 14; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + _nx_ipv4_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_interface[0].nx_interface_ip_address = IP_ADDRESS(1, 2, 3, 4); + + /* Hit true condition: + 757 [ + - ]: if (ip_ptr -> nx_ip_udp_packet_receive) */ + ip_0.nx_ip_interface[0].nx_interface_ip_address = 0; + ip_0.nx_ip_udp_packet_receive = NX_NULL; + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + memcpy(my_packet[0] ->nx_packet_prepend_ptr, &pkt4[14], sizeof(pkt4) - 14); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + sizeof(pkt4) - 14; + my_packet[0] -> nx_packet_length = sizeof(pkt4) - 14; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + _nx_ipv4_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_interface[0].nx_interface_ip_address = IP_ADDRESS(1, 2, 3, 4); + ip_0.nx_ip_udp_packet_receive = _nx_udp_packet_receive; +#endif + + + /* Test _nx_ip_delete. */ + nx_ip_fragment_enable(&ip_0); + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_allocate(&pool_0, &my_packet[1], 0, NX_NO_WAIT); + ip_0.nx_ip_deferred_received_packet_head = my_packet[0]; + ip_0.nx_ip_deferred_received_packet_tail = my_packet[0]; + ip_0.nx_ip_raw_packet_suspension_list = &thread_test1; + ip_0.nx_ip_raw_packet_suspended_count ++; + thread_test1.tx_thread_suspend_cleanup = suspend_cleanup; + thread_test1.tx_thread_suspend_control_block = &ip_0; + thread_test1.tx_thread_suspended_next = &thread_test1; + _nx_ip_delete(&ip_0); + + + + /* Test _nx_ip_thread_entry() */ + /* Hit condition: if ((ip_ptr -> nx_ip_interface[i].nx_interface_valid) && (ip_ptr -> nx_ip_interface[i].nx_interface_link_driver_entry)) */ + /* Create an IP instance. */ + _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, NX_NULL, + pointer, 2048, 1); + pointer = pointer + 2048; + ip_0.nx_ip_interface[0].nx_interface_link_driver_entry = _nx_ram_network_driver_256; + _nx_ip_delete(&ip_0); + + + /* Create an IP instance. */ + nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Hit condition: 394 [ + - ]: if (!ip_events) */ + /* Enable TCP. */ + nx_tcp_enable(&ip_0); + + /* Wakeup IP thread for processing one or more messages in the TCP queue. */ + tx_event_flags_set(&(ip_0.nx_ip_events), NX_IP_TCP_EVENT, TX_OR); + + /* Let IP thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Wakeup IP thread for processing one or more messages in the TCP queue. */ + tx_event_flags_set(&(ip_0.nx_ip_events), NX_IP_TCP_EVENT | NX_IP_ARP_REC_EVENT, TX_OR); + + /* Let IP thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + /* Hit condition: 546 [ + + ][ + - ]: if ((ip_events & NX_IP_ARP_REC_EVENT) && (ip_ptr -> nx_ip_arp_queue_process)) */ + ip_0.nx_ip_arp_queue_process = NX_NULL; + + /* Set NX_IP_ARP_REC_EVENT. */ + tx_event_flags_set(&(ip_0.nx_ip_events), NX_IP_ARP_REC_EVENT, TX_OR); + + /* Let IP thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + ip_0.nx_ip_arp_queue_process = _nx_arp_queue_process; + + + /* Hit condition: 554 [ + + ][ + - ]: if ((ip_events & NX_IP_RARP_REC_EVENT) && (ip_ptr -> nx_ip_rarp_queue_process)) */ + ip_0.nx_ip_rarp_queue_process = NX_NULL; + + /* Set NX_IP_RARP_REC_EVENT. */ + tx_event_flags_set(&(ip_0.nx_ip_events), NX_IP_RARP_REC_EVENT, TX_OR); + + /* Let IP thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + ip_0.nx_ip_arp_queue_process = _nx_rarp_queue_process; + + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + /* Hit condition: 627 [ + + ][ + - ]: while ((ip_ptr -> nx_ip_interface[index].nx_interface_valid) && (index < NX_MAX_PHYSICAL_INTERFACES)) */ + /* Set the all interface as valid. */ + for (i = 1; i < NX_MAX_IP_INTERFACES; i++) + { + /* Set all interface as valid. */ + ip_0.nx_ip_interface[i].nx_interface_valid = 1; + ip_0.nx_ip_interface[i].nx_interface_link_driver_entry = _nx_ram_network_driver_256; + } + + /* Set NX_IP_DRIVER_DEFERRED_EVENT. */ + tx_event_flags_set(&(ip_0.nx_ip_events), NX_IP_DRIVER_DEFERRED_EVENT, TX_OR); + + /* Let IP thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Clear the valid flag except interface 0. */ + for (i = 1; i < NX_MAX_IP_INTERFACES; i++) + { + /* Set all interface as valid. */ + ip_0.nx_ip_interface[i].nx_interface_valid = 0; + ip_0.nx_ip_interface[i].nx_interface_link_driver_entry = NX_NULL; + } +#endif + + + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_ip_forward_packet_process() */ + /* Hit condition: + 147 [ + + ][ - + ]: 46 : if (((ip_header_ptr -> nx_ip_header_source_ip & 0xFFFF0000) == 0xA9FE0000) || + 148 : 45 : ((ip_header_ptr -> nx_ip_header_destination_ip & 0xFFFF0000) == 0xA9FE0000)) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_source_ip = 0x01020305; + ip_header_ptr -> nx_ip_header_destination_ip = 0xA9FE0000; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + _nx_ip_forward_packet_process(&ip_0, my_packet[0]); + + + + /* Hit condition: first [ + - ] + 361 [ + - ][ + - ]: 7 : if ((ip_ptr -> nx_ip_fragment_processing) && (!(fragment_bits & NX_IP_DONT_FRAGMENT))) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 600; + my_packet[0] -> nx_packet_length = 600; + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | NX_IP_NORMAL | (0xFFFF & my_packet[0] -> nx_packet_length)); +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + ip_header_ptr -> nx_ip_header_word_1 = (((ULONG)NX_RAND()) << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#else + ip_header_ptr -> nx_ip_header_word_1 = (ip_0.nx_ip_packet_id++ << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#endif /* NX_ENABLE_IP_ID_RANDOMIZATION */ + ip_header_ptr -> nx_ip_header_word_2 = ((0x80 << NX_IP_TIME_TO_LIVE_SHIFT) | NX_IP_ICMP); + ip_header_ptr -> nx_ip_header_source_ip = 0x02020305; + ip_header_ptr -> nx_ip_header_destination_ip = 0x01020305; + ip_0.nx_ip_fragment_processing = NX_NULL; + _nx_ip_forward_packet_process(&ip_0, my_packet[0]); + + +#ifndef NX_DISABLE_FRAGMENTATION + /* Hit condition: second [ + - ] + 361 [ + - ][ + - ]: 7 : if ((ip_ptr -> nx_ip_fragment_processing) && (!(fragment_bits & NX_IP_DONT_FRAGMENT))) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 600; + my_packet[0] -> nx_packet_length = 600; + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | NX_IP_NORMAL | (0xFFFF & my_packet[0] -> nx_packet_length)); +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + ip_header_ptr -> nx_ip_header_word_1 = (((ULONG)NX_RAND()) << NX_SHIFT_BY_16) | NX_DONT_FRAGMENT; +#else + ip_header_ptr -> nx_ip_header_word_1 = (ip_0.nx_ip_packet_id++ << NX_SHIFT_BY_16) | NX_DONT_FRAGMENT; +#endif /* NX_ENABLE_IP_ID_RANDOMIZATION */ + ip_header_ptr -> nx_ip_header_word_2 = ((0x80 << NX_IP_TIME_TO_LIVE_SHIFT) | NX_IP_ICMP); + ip_header_ptr -> nx_ip_header_source_ip = 0x02020305; + ip_header_ptr -> nx_ip_header_destination_ip = 0x01020305; + ip_0.nx_ip_fragment_processing = _nx_ip_fragment_packet; + _nx_ip_forward_packet_process(&ip_0, my_packet[0]); + ip_0.nx_ip_fragment_processing = NX_NULL; +#endif + + + + /* Test _nx_ip_driver_packet_send() */ +#ifndef NX_DISABLE_FRAGMENTATION + /* Hit condition: 263 [ + + ][ - + ]: if ((ip_ptr -> nx_ip_fragment_processing == NX_NULL) || (fragment != NX_FRAGMENT_OKAY)) */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 600; + my_packet[0] -> nx_packet_length = 600; + ip_0.nx_ip_fragment_processing = NX_NULL; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_driver_packet_send(&ip_0, my_packet[0], IP_ADDRESS(1, 2, 3, 5), NX_DONT_FRAGMENT, IP_ADDRESS(1, 2, 3, 5)); + + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 600; + my_packet[0] -> nx_packet_length = 600; + ip_0.nx_ip_fragment_processing = _nx_ip_fragment_packet; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_driver_packet_send(&ip_0, my_packet[0], IP_ADDRESS(1, 2, 3, 5), NX_DONT_FRAGMENT, IP_ADDRESS(1, 2, 3, 5)); + ip_0.nx_ip_fragment_processing = NX_NULL; +#endif + + + /* Hit condition: + 378 [ + + - + ]: if ((!ip_ptr -> nx_ip_arp_allocate) || + 379 : ((ip_ptr -> nx_ip_arp_allocate)(ip_ptr, &(ip_ptr -> nx_ip_arp_table[index]), NX_FALSE))) */ + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + temp_arp = ip_0.nx_ip_arp_dynamic_list; + ip_0.nx_ip_arp_dynamic_list = NX_NULL; + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + _nx_ip_driver_packet_send(&ip_0, my_packet[0], IP_ADDRESS(1, 2, 3, 5), NX_DONT_FRAGMENT, IP_ADDRESS(1, 2, 3, 5)); + ip_0.nx_ip_arp_dynamic_list = temp_arp; + + + /* Hit condition: + 436 [ + + ][ - + ]: 17075 : if ((((destination_ip >= NX_IP_LOOPBACK_FIRST) && + 437 [ + + ]: 593 : (destination_ip <= NX_IP_LOOPBACK_LAST))) || + 438 : 593 : (destination_ip == packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_ip_address)) */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | NX_IP_NORMAL | (0xFFFF & my_packet[0] -> nx_packet_length)); +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + ip_header_ptr -> nx_ip_header_word_1 = (((ULONG)NX_RAND()) << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#else + ip_header_ptr -> nx_ip_header_word_1 = (ip_0.nx_ip_packet_id++ << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#endif /* NX_ENABLE_IP_ID_RANDOMIZATION */ + ip_header_ptr -> nx_ip_header_word_2 = ((0x80 << NX_IP_TIME_TO_LIVE_SHIFT) | NX_IP_ICMP); + ip_header_ptr -> nx_ip_header_source_ip = 0x01020304; + ip_header_ptr -> nx_ip_header_destination_ip = NX_IP_LOOPBACK_LAST; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + ip_0.nx_ip_interface[0].nx_interface_address_mapping_needed = 0; + _nx_ip_driver_packet_send(&ip_0, my_packet[0], NX_IP_LOOPBACK_LAST, NX_DONT_FRAGMENT, NX_IP_LOOPBACK_LAST); + ip_0.nx_ip_interface[0].nx_interface_address_mapping_needed = 1; + + +#ifndef NX_ENABLE_INTERFACE_CAPABILITY + /* Hit condition: + 436 [ + + ][ + - ]: 17075 : if ((((destination_ip >= NX_IP_LOOPBACK_FIRST) && + 437 [ + + ]: 593 : (destination_ip <= NX_IP_LOOPBACK_LAST))) || + 438 : 593 : (destination_ip == packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_ip_address)) */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | NX_IP_NORMAL | (0xFFFF & my_packet[0] -> nx_packet_length)); +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + ip_header_ptr -> nx_ip_header_word_1 = (((ULONG)NX_RAND()) << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#else + ip_header_ptr -> nx_ip_header_word_1 = (ip_0.nx_ip_packet_id++ << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#endif /* NX_ENABLE_IP_ID_RANDOMIZATION */ + ip_header_ptr -> nx_ip_header_word_2 = ((0x80 << NX_IP_TIME_TO_LIVE_SHIFT) | NX_IP_ICMP); + ip_header_ptr -> nx_ip_header_source_ip = 0x01020304; + ip_header_ptr -> nx_ip_header_destination_ip = NX_IP_LOOPBACK_LAST + 1; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + ip_0.nx_ip_interface[0].nx_interface_address_mapping_needed = 0; + _nx_ip_driver_packet_send(&ip_0, my_packet[0], NX_IP_LOOPBACK_LAST + 1, NX_DONT_FRAGMENT, NX_IP_LOOPBACK_LAST); + ip_0.nx_ip_interface[0].nx_interface_address_mapping_needed = 1; +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + +#ifndef NX_DISABLE_FRAGMENTATION + /* Hit condition: + 511 [ + + ][ + - ]: 3014 : if ((ip_ptr -> nx_ip_fragment_processing) && (fragment != NX_DONT_FRAGMENT)) */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 600; + my_packet[0] -> nx_packet_length = 600; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + ip_0.nx_ip_fragment_processing = _nx_ip_fragment_packet; + _nx_ip_driver_packet_send(&ip_0, my_packet[0], 0x01020305, NX_DONT_FRAGMENT, 0x01020305); + ip_0.nx_ip_fragment_processing = NX_NULL; +#endif + + +#ifndef NX_DISABLE_ASSERT + /* Hit condition: packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_link_driver_entry = NX_NULL + NX_ASSERT(packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_link_driver_entry != NX_NULL); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + /* Recover. */ + ip_0.nx_ip_interface[0].nx_interface_link_driver_entry = _nx_ram_network_driver_256; +#endif /* NX_DISABLE_ASSERT */ + + + +#ifdef FEATURE_NX_IPV6 + /* Hit condition: second [ + - ] + 493 [ + + ][ + - ]: 2264309 : if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) || + 494 [ + - ]: 181 : ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && + 495 : 181 : (incoming_addr -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_VALID))) */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_version = 5; + _nx_ip_dispatch_process(&ip_0, my_packet[0], NX_PROTOCOL_TCP); + nx_packet_release( my_packet[0]); + + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + my_packet[0] -> nx_packet_address.nx_packet_ipv6_address_ptr = &ip_0.nx_ipv6_address[0]; + my_packet[0] -> nx_packet_ip_version = NX_IP_VERSION_V6; + _nx_ip_dispatch_process(&ip_0, my_packet[0], NX_PROTOCOL_TCP); + nx_packet_release( my_packet[0]); + + /* Hit condition: second [ + - ] + 574 [ + + ][ + - ]: 16830 : if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) || + 575 [ + - ]: 5041 : ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && + 576 : 5041 : (incoming_addr -> nxd_ipv6_address_state == NX_IPV6_ADDR_STATE_VALID))) */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_version = 5; + _nx_ip_dispatch_process(&ip_0, my_packet[0], NX_PROTOCOL_UDP); + nx_packet_release( my_packet[0]); + + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + my_packet[0] -> nx_packet_address.nx_packet_ipv6_address_ptr = &ip_0.nx_ipv6_address[0]; + my_packet[0] -> nx_packet_ip_version = NX_IP_VERSION_V6; + _nx_ip_dispatch_process(&ip_0, my_packet[0], NX_PROTOCOL_UDP); + nx_packet_release( my_packet[0]); + + + /* Hit condition: + 601 [ + - ]: 39 : if ((ip_ptr -> nx_ip_raw_ip_processing)(ip_ptr, protocol << 16, packet_ptr) == NX_SUCCESS) */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_PHYSICAL_HEADER, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 40; + my_packet[0] -> nx_packet_length = 40; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_version = 4; + ip_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + ip_header_ptr -> nx_ip_header_word_0 = (NX_IP_VERSION | NX_IP_NORMAL | (0xFFFF & my_packet[0] -> nx_packet_length)); +#ifdef NX_ENABLE_IP_ID_RANDOMIZATION + ip_header_ptr -> nx_ip_header_word_1 = (((ULONG)NX_RAND()) << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#else + ip_header_ptr -> nx_ip_header_word_1 = (ip_0.nx_ip_packet_id++ << NX_SHIFT_BY_16) | NX_FRAGMENT_OKAY; +#endif /* NX_ENABLE_IP_ID_RANDOMIZATION */ + ip_header_ptr -> nx_ip_header_word_2 = ((0x80 << NX_IP_TIME_TO_LIVE_SHIFT) | NX_IP_ICMP); + ip_header_ptr -> nx_ip_header_source_ip = 0x01020305; + ip_header_ptr -> nx_ip_header_destination_ip = 0x01020304; + ip_0.nx_ip_raw_ip_processing = my_raw_packet_processing; + _nx_ip_dispatch_process(&ip_0, my_packet[0], 203); + nx_packet_release( my_packet[0]); + ip_0.nx_ip_raw_ip_processing = NX_NULL; + + + /* Hit condition: + 664 [ + - ]: 1145 : if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + memcpy(my_packet[0] -> nx_packet_prepend_ptr, &pkt5[14], sizeof(pkt5) - 14); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + sizeof(pkt5) - 14; + my_packet[0] -> nx_packet_length = sizeof(pkt5) - 14; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + ipv6_header_ptr = (NX_IPV6_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(ipv6_header_ptr -> nx_ip_header_word_0); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ipv6_header_ptr -> nx_ip_header_destination_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ipv6_header_ptr -> nx_ip_header_source_ip); + my_packet[0] -> nx_packet_prepend_ptr += 40; + my_packet[0] -> nx_packet_length -= 40; + my_packet[0] -> nx_packet_ip_version = 5; + _nx_ip_dispatch_process(&ip_0, my_packet[0], NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP); +#endif + +#endif + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER) +{ +} + +static VOID link_status_change_callback(NX_IP *ip_ptr, UINT interface_index, UINT link_status) +{ +} + +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_ASSERT +/* Define the test threads. */ + +static void thread_for_assert_entry(ULONG thread_input) +{ +NX_PACKET *test_packet; +ULONG src_ip_addr = 0x01020304; + + /* Check the count. */ + if (assert_count == 0) + { + + /* Update the count. */ + assert_count ++; + + nx_packet_allocate(&pool_0, &test_packet, 0, NX_NO_WAIT); + test_packet -> nx_packet_prepend_ptr = test_packet -> nx_packet_data_start - 1; + + /* Call function with NULL interface. */ + _nx_ip_header_add(&ip_0, test_packet, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5), 0, 0, 0, NX_FALSE); + } + else if (assert_count == 1) + { + + /* Update the count. */ + assert_count ++; + + /* Call function with NULL src_ip_addr. */ + nx_packet_allocate(&pool_0, &test_packet, 0, NX_NO_WAIT); + _nx_ip_checksum_compute(test_packet, NX_PROTOCOL_UDP, 0, NX_NULL, NX_NULL); + } + else if (assert_count == 2) + { + + /* Update the count. */ + assert_count ++; + + /* Call function with NULL src_ip_addr. */ + nx_packet_allocate(&pool_0, &test_packet, 0, NX_NO_WAIT); + _nx_ip_checksum_compute(test_packet, NX_PROTOCOL_UDP, 0, &src_ip_addr, NX_NULL); + } + else if (assert_count == 3) + { + + /* Update the count. */ + assert_count ++; + + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0x0011, 0x22334457); + nx_packet_allocate(&pool_0, &test_packet, NX_PHYSICAL_HEADER, NX_NO_WAIT); + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + 40; + test_packet -> nx_packet_length = 40; + test_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + ip_0.nx_ip_interface[0].nx_interface_link_driver_entry = NX_NULL; + _nx_ip_driver_packet_send(&ip_0, test_packet, 0x01020305, NX_DONT_FRAGMENT, 0x01020305); + } +} +#endif + +#ifdef FEATURE_NX_IPV6 +static UINT my_raw_packet_processing(NX_IP *ip_ptr, ULONG protocol, NX_PACKET *packet_ptr) +{ + + return(1); +} +#endif +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Branch Test............................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_ip_chain_packet_process_test.c b/test/regression/netxduo_test/netx_ip_chain_packet_process_test.c new file mode 100644 index 00000000..33e712fc --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_chain_packet_process_test.c @@ -0,0 +1,358 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR receive_data_flag = NX_FALSE; +static UCHAR send_data[1000]; +static UCHAR receive_data[1000]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_chain_packet_process_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 10240); + pointer = pointer + 10240; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: IP Chain Packet Process Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let server thread run. */ + tx_thread_relinquish(); + + /* Set the callback function to get the IPv4 packet. */ + ip_1.nx_ipv4_packet_receive = my_packet_process; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the data. */ + for (i = 0; i < 1000; i ++) + send_data[i] = (UCHAR)rand(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, send_data, 1000, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let server thread run. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_packet_pool_delete(&pool_0); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG bytes_copied; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the data. */ + status = nx_packet_data_extract_offset(my_packet, 0, receive_data, 1000, &bytes_copied); + + /* Check status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Compare the receive data with send data. */ + if(memcmp(receive_data, send_data, 1000) || (bytes_copied != 1000)) + { + receive_data_flag = NX_TRUE; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_PACKET *last_packet; + + /* Get the last packet. */ + last_packet = packet_ptr -> nx_packet_last; + + /* Update the last packet and packet length, let NetX correct it. */ + + /* Update the packet length. */ + packet_ptr -> nx_packet_length += 3; + last_packet -> nx_packet_length += 3; + + /* Update the packet append. */ + last_packet -> nx_packet_append_ptr += 3; + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, packet_ptr); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_chain_packet_process_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: IP Chain Packet Process Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_create_test.c b/test/regression/netxduo_test/netx_ip_create_test.c new file mode 100644 index 00000000..6522da1c --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_create_test.c @@ -0,0 +1,126 @@ +/* This NetX test concentrates on the IP Delete operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_system.h" +#include "nx_packet.h" + + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_create_test_application_define(void *first_unused_memory) +#endif +{ + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +CHAR id; + + + /* Print out test information banner. */ + printf("NetX Test: IP Create Operation Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Store the ID. */ + id = _nx_version_id[0]; + + /* Clear the ID. */ + _nx_version_id[0] = 0; + + /* Clear the system value. */ + _nx_system_build_options_1 = 0; + _nx_system_build_options_2 = 0; + _nx_system_build_options_3 = 0; + _nx_system_build_options_4 = 0; + _nx_system_build_options_5 = 0; + + /* Set the pool ID. */ + pool_0.nx_packet_pool_id = NX_PACKET_POOL_ID; + + /* Create IP instances with NX_NULL ID before NetX initialize. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + + /* Check the status. */ + if (status != NX_NOT_IMPLEMENTED) + error_counter++; + + /* Reset the ID. */ + _nx_version_id[0] = id; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_ip_delete_test.c b/test/regression/netxduo_test/netx_ip_delete_test.c new file mode 100644 index 00000000..1f40fccc --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_delete_test.c @@ -0,0 +1,727 @@ +/* This NetX test concentrates on the IP Delete operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" +#include "nx_igmp.h" +#include "nx_arp.h" +#include "nx_rarp.h" +#include "nx_udp.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NX_TCP_SOCKET client_socket; +static NX_UDP_SOCKET socket_0; +static UCHAR ip_stack[2048]; +static UCHAR ip_stack_1[2048]; +static UCHAR ip_stack_2[2048]; +static UCHAR arp_stack[1024]; +static UCHAR ping_done; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void _nx_ram_network_driver_test(NX_IP_DRIVER *driver_req_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_delete_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Initialize the counters. */ + error_counter = 0; + ping_done = NX_FALSE; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, arp_stack, sizeof(arp_stack)); + + if (status) + error_counter++; + + /* Enable TCP processing for IP instances. */ + status = nx_tcp_enable(&ip_0); + + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +UINT old_threshold; +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS ipv6_address; +#endif /* FEATURE_NX_IPV6 */ + + + /* Print out test information banner. */ + printf("NetX Test: IP Delete Operation Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the IP instance. */ + status = nx_ip_delete(&ip_0); + + /* Check for an error. */ + if (status != NX_SOCKETS_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the IP instance. */ + status = nx_ip_delete(&ip_0); + + /* Check for an error. */ + if (status != NX_SOCKETS_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the IP instance. */ + status = nx_ip_delete(&ip_0); + + /* Check for an error. */ + if (status != NX_SOCKETS_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the IP instance. */ + status = nx_ip_delete(&ip_0); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Create IP instances. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(2, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack_1, sizeof(ip_stack_1), 1); + + /* Create IP instances. */ + status += nx_ip_create(&ip_2, "NetX IP Instance 2", IP_ADDRESS(3, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack_2, sizeof(ip_stack_2), 1); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete IP instances. */ + status = nx_ip_delete(&ip_2); + status += nx_ip_delete(&ip_1); + status += nx_ip_delete(&ip_0); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check RAW queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable RAW traffic. */ + status += nx_ip_raw_packet_enable(&ip_0); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABC", 3, &pool_0, NX_WAIT_FOREVER); + + /* Send the RAW packet. */ + status += nx_ip_raw_packet_send(&ip_0, packet_ptr, IP_ADDRESS(1, 2, 3, 9), NX_IP_NORMAL); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + /* Check RAW queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable RAW traffic. */ + status += nx_ip_raw_packet_enable(&ip_0); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABC", 3, &pool_0, NX_WAIT_FOREVER); + + /* Send the RAW packet. */ + status += nx_ip_raw_packet_send(&ip_0, packet_ptr, IP_ADDRESS(127, 0, 0, 1), NX_IP_NORMAL); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + + +#ifndef NX_ENABLE_ICMP_ADDRESS_CHECK + /* Check ICMP queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable ICMP. */ + status += nx_icmp_enable(&ip_0); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCEFGHIJKLMNOPQRSTUVWXYZ", 26, &pool_0, NX_WAIT_FOREVER); + + /* Disable preemption temporarily. */ + tx_thread_preemption_change(&ntest_0, 0, &old_threshold); + + /* Call _nx_icmp_packet_receive to directly receive the packet. */ + _nx_icmp_packet_receive(&ip_0, packet_ptr); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Restore preemption. */ + tx_thread_preemption_change(&ntest_0, old_threshold, &old_threshold); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_ENABLE_ICMP_ADDRESS_CHECK */ + + + /* Check IGMP queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable IGMP. */ + status += nx_igmp_enable(&ip_0); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCEFGHIJKLMNOPQRSTUVWXYZ", 26, &pool_0, NX_WAIT_FOREVER); + + /* Disable preemption temporarily. */ + tx_thread_preemption_change(&ntest_0, 0, &old_threshold); + + /* Call _nx_igmp_packet_receive to directly receive the packet. */ + _nx_igmp_packet_receive(&ip_0, packet_ptr); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Restore preemption. */ + tx_thread_preemption_change(&ntest_0, old_threshold, &old_threshold); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Check TCP queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable TCP. */ + status += nx_tcp_enable(&ip_0); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCEFGHIJKLMNOPQRSTUVWXYZ", 26, &pool_0, NX_WAIT_FOREVER); + + /* Disable preemption temporarily. */ + tx_thread_preemption_change(&ntest_0, 0, &old_threshold); + + /* Call _nx_tcp_packet_receive to directly receive the packet. */ + _nx_tcp_packet_receive(&ip_0, packet_ptr); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Restore preemption. */ + tx_thread_preemption_change(&ntest_0, old_threshold, &old_threshold); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Check UDP queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable UDP. */ + status += nx_tcp_enable(&ip_0); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCEFGHIJKLMNOPQRSTUVWXYZ", 26, &pool_0, NX_WAIT_FOREVER); + + /* Disable preemption temporarily. */ + tx_thread_preemption_change(&ntest_0, 0, &old_threshold); + + /* Call _nx_udp_packet_receive to directly receive the packet. */ + _nx_udp_packet_receive(&ip_0, packet_ptr); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Restore preemption. */ + tx_thread_preemption_change(&ntest_0, old_threshold, &old_threshold); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Check ARP queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable ARP. */ + status += nx_arp_enable(&ip_0, arp_stack, sizeof(arp_stack)); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCEFGHIJKLMNOPQRSTUVWXYZ", 26, &pool_0, NX_WAIT_FOREVER); + + /* Disable preemption temporarily. */ + tx_thread_preemption_change(&ntest_0, 0, &old_threshold); + + /* Call _nx_arp_packet_deferred_receive to directly receive the packet. */ + _nx_arp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Restore preemption. */ + tx_thread_preemption_change(&ntest_0, old_threshold, &old_threshold); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Check RARP queue is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable RARP. */ + status += nx_rarp_enable(&ip_0); + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCEFGHIJKLMNOPQRSTUVWXYZ", 26, &pool_0, NX_WAIT_FOREVER); + + /* Disable preemption temporarily. */ + tx_thread_preemption_change(&ntest_0, 0, &old_threshold); + + /* Call _nx_rarp_packet_deferred_receive to directly receive the packet. */ + _nx_rarp_packet_deferred_receive(&ip_0, packet_ptr); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Restore preemption. */ + tx_thread_preemption_change(&ntest_0, old_threshold, &old_threshold); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Test packet queued on ND cache. */ + /* Create IP instances. */ + nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + nxd_ipv6_enable(&ip_0); + nxd_icmp_enable(&ip_0); + nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_address.nxd_ip_address.v6[1] = 0; + ipv6_address.nxd_ip_address.v6[2] = 0; + ipv6_address.nxd_ip_address.v6[3] = 1; + nxd_icmp_ping(&ip_0, &ipv6_address, "", 0, &packet_ptr, NX_NO_WAIT); + + /* Delete the IP instance. */ + nx_ip_delete(&ip_0); + + /* Check for pool available. */ + if (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* FEATURE_NX_IPV6 */ + + +#ifdef __PRODUCT_NETXDUO__ + /* Check ICMP suspension list is cleared after IP is deleted. */ + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_stack, sizeof(ip_stack), 1); + + /* Enable ARP and ICMP. */ + status += nx_arp_enable(&ip_0, arp_stack, sizeof(arp_stack)); + status += nx_icmp_enable(&ip_0); + + /* Resume thread 1 and let it start to ping. */ + tx_thread_resume(&ntest_1); + + /* Delete the IP instance. */ + status += nx_ip_delete(&ip_0); + + /* Check for error and pool available. */ + if ((status) || (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available) || + (ping_done == NX_FALSE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_test, + ip_stack, sizeof(ip_stack), 1); + + /* Delete IP with sleep in driver. */ + status += nx_ip_delete(&ip_0); + if (status || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *packet_ptr; +UINT status; + + /* Ping an address not existed. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 4), "", 0, &packet_ptr, NX_WAIT_FOREVER); + + if (status == NX_SUCCESS) + { + + /* No response should be received. */ + printf("ERROR!\n"); + test_control_return(1); + } + + ping_done = NX_TRUE; +} + +static void _nx_ram_network_driver_test(NX_IP_DRIVER *driver_req_ptr) +{ + if (driver_req_ptr -> nx_ip_driver_command == NX_LINK_UNINITIALIZE) + { + if (tx_thread_sleep(1)) + { + error_counter++; + } + } + _nx_ram_network_driver_256(driver_req_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_delete_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Delete Operation Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_driver_deferred_test.c b/test/regression/netxduo_test/netx_ip_driver_deferred_test.c new file mode 100644 index 00000000..2bb497d9 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_driver_deferred_test.c @@ -0,0 +1,308 @@ +/* This NetX test concentrates on NX_IP_DRIVER_DEFERRED_EVENT for NX_LINK_PACKET_SEND command. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_IP_DRIVER driver_request; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_driver_deferred_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, test_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: IP Driver Deferred Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req) +{ + if (driver_req -> nx_ip_driver_command == NX_LINK_PACKET_SEND) + { + + /* Store the driver request. */ + memcpy(&driver_request, driver_req, sizeof(driver_request)); + + /* Call deferred processing. */ + _nx_ip_driver_deferred_processing(driver_req -> nx_ip_driver_ptr); + } + else if (driver_req -> nx_ip_driver_command == NX_LINK_DEFERRED_PROCESSING) + { + + /* Test if this pointer is initialized. */ + *(driver_req -> nx_ip_driver_return_ptr) = 1; + + /* Pass the unfinished driver request to the real driver. */ + _nx_ram_network_driver_256(&driver_request); + } + else + { + + /* Pass the driver request to the real driver directly. */ + _nx_ram_network_driver_256(driver_req); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_driver_deferred_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Driver Deferred Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_disable_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_disable_test.c new file mode 100644 index 00000000..2f5be491 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_disable_test.c @@ -0,0 +1,277 @@ +/* This NetX test concentrates on IP fragmentation disable operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_FRAGMENT_IMMEDIATE_ASSEMBLY) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG icmp_counter; +static NX_PACKET *copy_packet_0; +static NX_PACKET *copy_packet_1; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_disable_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 500, pointer, 4096); + pointer = pointer + 4096; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP traffic. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check for ICMP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR data[256]; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Disable Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_1.nx_ipv4_packet_receive = my_packet_process; + + /* Now ip_0 ping ip_1 to check nx_ip_received_fragment_head and nx_ip_fragment_assembly_head. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), data, 300, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status == NX_SUCCESS) || (my_packet)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the error counter and icmp counter. */ + if ((error_counter) || (icmp_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the callback function. */ + ip_1.nx_ipv4_packet_receive = _nx_ipv4_packet_receive; + + /* Now ip_0 ping ip_1 to check nx_ipv4_packet_receive after ip_1 disable fragment feature . */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), data, 300, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status == NX_SUCCESS) || (my_packet)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Sleep 100 ticks to receive the fragment packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_0); + + /* Check the received/assembly fragment head. */ + if ((ip_1.nx_ip_received_fragment_head) || ((ip_1.nx_ip_fragment_assembly_head == NX_NULL))) + error_counter ++; + + /* Get mutex protection. */ + tx_mutex_get(&(ip_1.nx_ip_protection), TX_WAIT_FOREVER); + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_1); + + /* Check the received/assembly fragment head. */ + if ((ip_1.nx_ip_received_fragment_head == NX_NULL) || (ip_1.nx_ip_fragment_assembly_head == NX_NULL)) + error_counter ++; + + /* Disable the fragment. */ + status = nx_ip_fragment_disable(&ip_1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Check the received/assembly fragment head. */ + if ((ip_1.nx_ip_received_fragment_head) || (ip_1.nx_ip_fragment_assembly_head)) + error_counter ++; + + /* Release mutex protection. */ + tx_mutex_put(&(ip_1.nx_ip_protection)); +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; + + /* Get the ICMP packet. */ + icmp_counter ++; + + /* Check the icmp counter. */ + if (icmp_counter == 1) + { + + /* First fragmentation. */ + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_0, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + if (icmp_counter == 2) + { + + /* Second fragmentation. */ + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_1, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_disable_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Disable Test.............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_dispatch_fail_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_dispatch_fail_test.c new file mode 100644 index 00000000..aca4d4c8 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_dispatch_fail_test.c @@ -0,0 +1,166 @@ +/* This NetX test concentrates on the failure of dispatch for assembled packets. */ + + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IP_INFO) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 +#define SEND_SIZE 3000 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR send_buf[SEND_SIZE]; +static UCHAR pool_area[102400]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_dispatch_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1000, pool_area, sizeof(pool_area)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for both IP instances. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP for IP_0 only. */ + status = nx_icmp_enable(&ip_0); + + /* Check for ICMP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Dispatch Fail Test......................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now send a ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), send_buf, sizeof(send_buf), &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check packet dropped by IP_1. */ + if (ip_1.nx_ip_receive_packets_dropped != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_dispatch_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Dispatch Fail Test.......................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_duplicate_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_duplicate_test.c new file mode 100644 index 00000000..6432e5af --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_duplicate_test.c @@ -0,0 +1,448 @@ +/* This NetX test concentrates on the processing of duplicated fragments. */ + + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 +#define SEND_SIZE 3000 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + +static UINT fragments_count; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR send_buf[SEND_SIZE]; +static UCHAR pool_area[102400]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_duplicate_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1000, pool_area, sizeof(pool_area)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for both IP instances. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0xFE800000; + address_0.nxd_ip_address.v6[1] = 0x00000000; + address_0.nxd_ip_address.v6[2] = 0x00000000; + address_0.nxd_ip_address.v6[3] = 0x00000001; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0xFE800000; + address_1.nxd_ip_address.v6[1] = 0x00000000; + address_1.nxd_ip_address.v6[2] = 0x00000000; + address_1.nxd_ip_address.v6[3] = 0x00000002; + + status = nxd_ipv6_address_set(&ip_0, 0, &address_0, 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &address_1, 10, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Duplicate Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 2; i++) +#else + for (i = 0; i < 1; i++) +#endif + { + + /* Reset the testing data. */ + memset(send_buf, i, sizeof(send_buf)); + fragments_count = 0; + + /* Set callback function to duplicate the second fragments. */ + advanced_packet_process_callback = packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data. */ + status = nx_packet_data_append(my_packet, send_buf, sizeof(send_buf), &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if (i == 0) + { + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + } +#ifdef FEATURE_NX_IPV6 + else + { + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + } +#endif /* FEATURE_NX_IPV6 */ + + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the callback function. */ + advanced_packet_process_callback = NX_NULL; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 2; i++) +#else + for (i = 0; i < 1; i++) +#endif + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(my_packet -> nx_packet_length != sizeof(send_buf)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Ignore packets from IP_1. */ + if (ip_ptr == &ip_1) + return NX_TRUE; + + if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) + { + if ((packet_ptr -> nx_packet_length > 28) && + (*(packet_ptr -> nx_packet_prepend_ptr + 9) == NX_PROTOCOL_UDP)) + { + + /* It's a UDP packet. */ + if (fragments_count == 1) + { + *operation_ptr = 2 * NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + else if (fragments_count == 2) + { + *operation_ptr = NX_RAMDRIVER_OP_DUPLICATE; + } + + fragments_count++; + } + } +#ifdef FEATURE_NX_IPV6 + else + { + if ((packet_ptr -> nx_packet_length > 48) && + (*(packet_ptr -> nx_packet_prepend_ptr + 6) == NX_PROTOCOL_NEXT_HEADER_FRAGMENT)) + { + + /* It's a UDP packet. */ + if(fragments_count == 1) + { + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + else if (fragments_count == 2) + { + *operation_ptr = NX_RAMDRIVER_OP_DUPLICATE; + } + + fragments_count++; + } + } +#endif /* FEATURE_NX_IPV6 */ + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_duplicate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Duplicate Test...........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_invalid_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_invalid_test.c new file mode 100644 index 00000000..dd10ad42 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_invalid_test.c @@ -0,0 +1,407 @@ +/* This NetX test concentrates on the invalid IP fragmentation. */ + + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_UDP_SOCKET socket_0; + +static UCHAR pool_area[(1536 + sizeof(NX_PACKET)) * 20]; + + +/* Define the packet data. */ +/* Frame (43 bytes) */ +static const unsigned char pkt1[43] = { +0x46, 0xa8, 0xe4, 0x73, 0x5b, 0x56, 0xc8, 0xd9, /* F..s[V.. */ +0xd2, 0x23, 0xe4, 0xab, 0x08, 0x00, 0x45, 0x00, /* .#....E. */ +0x00, 0x1d, 0x11, 0x11, 0x20, 0x00, 0x80, 0x02, /* .... ... */ +0x84, 0x46, 0xc0, 0xa8, 0x02, 0x18, 0xc0, 0xa8, /* ........ */ +0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00 /* ... */ +}; + +/* Frame (1534 bytes) */ +static const unsigned char pkt2[1534] = { +0x46, 0xa8, 0xe4, 0x73, 0x5b, 0x56, 0xc8, 0xd9, /* F..s[V.. */ +0xd2, 0x23, 0xe4, 0xab, 0x08, 0x00, 0x45, 0x00, /* .#....E. */ +0x05, 0xf0, 0x11, 0x11, 0x00, 0x01, 0x80, 0x02, /* .... ... */ +0x9e, 0x72, 0xc0, 0xa8, 0x02, 0x18, 0xc0, 0xa8, /* ........ */ +0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_invalid_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pool_area, sizeof(pool_area)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 2, 31), 0xFFFFF000UL, + &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(192, 168, 2, 32), 0xFFFFF000UL, + &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable IGMP. */ + status = nx_igmp_enable(&ip_0); + status += nx_igmp_enable(&ip_1); + + /* Check for IGMP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Invalid Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 3 seconds and let thread 1 run and thread 0 to assemble packets. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + + error_counter++; + break; + } + } + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Send the first fragmentation of the first packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt1 + 14), sizeof(pkt1) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Send the second fragmentation of the first packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 16, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt2 + 14), sizeof(pkt2) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if (status) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_invalid_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Invalid Test.............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_order_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_order_test.c new file mode 100644 index 00000000..5f7317e4 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_order_test.c @@ -0,0 +1,476 @@ +/* This NetX test concentrates on basic IP fragmentation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG packet_counter; +static ULONG error_counter; +static ULONG notify_calls; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_order_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG udp_packets_sent, udp_bytes_sent, udp_packets_received, udp_bytes_received, udp_invalid_packets, udp_receive_packets_dropped, udp_checksum_errors; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + + advanced_packet_process_callback = my_packet_process; + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Now, enable the checksum. */ + status = nx_udp_socket_checksum_enable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send another packet with checksum enabled. */ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + + /* Get UDP socket information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_IP_INFO + + if((packets_sent != 2) || (bytes_sent != 2*1500)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || + (packets_received) || (bytes_received) || + (packets_queued) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP information. */ + status = nx_udp_info_get(&ip_0, &udp_packets_sent, &udp_bytes_sent, &udp_packets_received, &udp_bytes_received, + &udp_invalid_packets, &udp_receive_packets_dropped, &udp_checksum_errors); + +#ifndef NX_DISABLE_IP_INFO + + if((udp_packets_sent != 2) || (udp_bytes_sent != 2*1500)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || + (udp_packets_received) || (udp_bytes_received) || + (udp_invalid_packets) || (udp_receive_packets_dropped) || (udp_checksum_errors) || (notify_calls != 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Out Of Order Processing Test............."); + + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + error_counter++; + + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + if(status == NX_SUCCESS) + { + + /* Check data length */ + if(my_packet -> nx_packet_length != 1500) + error_counter++; + + /* Check received data. */ + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Get another packet. */ + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + if(status == NX_SUCCESS) + { + + /* Check data length */ + if(my_packet -> nx_packet_length != 1500) + error_counter++; + + /* Check received data. */ + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + error_counter++; +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Check data length and payload */ + if (!memcmp(packet_ptr -> nx_packet_prepend_ptr + 28, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26)) + { + /* Delay some seconds. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE / 5; + + packet_counter++; + } + + if(packet_counter == 2) + advanced_packet_process_callback = NX_NULL; + + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_order_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Out Of Order Processing Test.............N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_packet_copy_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_packet_copy_test.c new file mode 100644 index 00000000..8be8696d --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_packet_copy_test.c @@ -0,0 +1,327 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send 1500 bytes to Server. + * 2. Driver copy the second fragment packet and send the copy packet to Server. + * 3. Check if Server receive the 1500 bytes. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_packet_copy_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT packet_length; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Packet Copy Test........................."); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let Socket 0 send all packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Initialize the value. */ + packet_length = 0; + + /* Loop to receive the packets. */ + while(1) + { + + /* Receive the packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + /* Update the packet length. */ + packet_length += my_packet -> nx_packet_length; + } + else + { + break; + } + } + + /* Check the packet length. */ + if (packet_length != 1500) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (packet_counter < 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Return if it is not an IP packet from ip_0. */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 28)) + { + + /* Updated the packet_counter. */ + packet_counter ++; + + /* Copy the second fragmentation packet. */ + if (packet_counter == 2) + { + /* Delay some seconds. */ + *operation_ptr = NX_RAMDRIVER_OP_DUPLICATE; + } + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_packet_copy_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Packet Copy Test.........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_packet_delay_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_packet_delay_test.c new file mode 100644 index 00000000..d4e40233 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_packet_delay_test.c @@ -0,0 +1,328 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send 1500 bytes to Server. + * 2. Driver delay the second fragment packet. + * 3. Check if Server receive the 1500 bytes. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_packet_delay_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT packet_length; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Packet Delay Test........................"); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let Socket 0 send all packet. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Initialize the value. */ + packet_length = 0; + + /* Loop to receive the packets. */ + while(1) + { + + /* Receive the packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + /* Update the packet length. */ + packet_length += my_packet -> nx_packet_length; + } + else + { + break; + } + } + + /* Check the packet length. */ + if (packet_length != 1500) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (packet_counter < 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Return if it is not an IP packet from ip_0. */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 28)) + { + + /* Updated the packet_counter. */ + packet_counter ++; + + /* Copy the second fragmentation packet. */ + if (packet_counter == 2) + { + /* Delay some seconds. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_packet_delay_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Packet Delay Test........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_packet_drop_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_packet_drop_test.c new file mode 100644 index 00000000..20a0700a --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_packet_drop_test.c @@ -0,0 +1,328 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send 1500 bytes to Server. + * 2. Driver drop the first fragment packet. + * 3. Check if Server receive the 1500 bytes. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_packet_drop_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT packet_length; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Packet Drop Test........................."); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let Socket 0 send all packet and fragment timeout. + Cover the branch [ + - ]: if ((ipv4_header -> nx_ip_header_word_1 & NX_IP_OFFSET_MASK) == 0) in _nx_ip_fragment_cleanup() */ + tx_thread_sleep(70 * NX_IP_PERIODIC_RATE); + + /* Initialize the value. */ + packet_length = 0; + + /* Loop to receive the packets. */ + while(1) + { + + /* Receive the packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + /* Update the packet length. */ + packet_length += my_packet -> nx_packet_length; + } + else + { + break; + } + } + + /* Check the packet length. */ + if (packet_length != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (packet_counter < 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Return if it is not an IP packet from ip_0. */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 28)) + { + + /* Updated the packet_counter. */ + packet_counter ++; + + /* Copy the first fragmentation packet. */ + if (packet_counter == 1) + { + /* Drop the fragmentation. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_packet_drop_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Packet Drop Test.........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_test.c new file mode 100644 index 00000000..a457347b --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_test.c @@ -0,0 +1,503 @@ +/* This NetX test concentrates on basic IP fragmentation. */ + + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG notify_calls; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 500, pointer, 4096); + pointer = pointer + 4096; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG udp_packets_sent, udp_bytes_sent, udp_packets_received, udp_bytes_received, udp_invalid_packets, udp_receive_packets_dropped, udp_checksum_errors; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Processing Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the IP threads and thread 1 execute. */ + tx_thread_relinquish(); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Send 1000 packets without checksum. */ + thread_0_counter = 0; + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 300; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 300; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Now, enable the checksum. */ + status = nx_udp_socket_checksum_enable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send another 1000 packets with checksum enabled. */ + while ((thread_0_counter < 2000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 300; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 300; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Get UDP socket information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_IP_INFO + + if((packets_sent != 2000) || (bytes_sent != 2000*300)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 2000) || (thread_1_counter != 2000) || + (packets_received) || (bytes_received) || + (packets_queued) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP information. */ + status = nx_udp_info_get(&ip_0, &udp_packets_sent, &udp_bytes_sent, &udp_packets_received, &udp_bytes_received, + &udp_invalid_packets, &udp_receive_packets_dropped, &udp_checksum_errors); + +#ifndef NX_DISABLE_IP_INFO + + if((udp_packets_sent != 2000) || (udp_bytes_sent != 2000*300)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 2000) || (thread_1_counter != 2000) || + (udp_packets_received) || (udp_bytes_received) || + (udp_invalid_packets) || (udp_receive_packets_dropped) || (udp_checksum_errors) || (notify_calls != 2000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +UINT port; +NX_PACKET *my_packet; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Get 1000 packets. */ + thread_1_counter = 0; + while (thread_1_counter < 1000) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nx_udp_source_extract(my_packet, &ip_address, &port); + + /* Check status. */ + if ((status) || (ip_address != IP_ADDRESS(1,2,3,4)) || (port != 0x88)) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Get another 1000 packets. */ + while (thread_1_counter < 2000) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Processing Test..........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_time_exceeded_message_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_time_exceeded_message_test.c new file mode 100644 index 00000000..d1e8bf0d --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_time_exceeded_message_test.c @@ -0,0 +1,301 @@ +/* This NetX test concentrates on ICMP Time Exceeded Message for IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_ICMPV4_ERROR_MESSAGE is not defined. NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. ip_0 send ICMP Ping with 600 bytes to ip_2. It is fragmented into three packets. + * 2. Delay 5 seconds for second fragmentation packet of ip_0 to update the timeout of fragmentation to let ip_1 fragmentation timeout first. + * 3. Delay NX_IP_TIME_TO_LIVE + 4 seconds for third fragmentation of ip_0, send the third fragmentation before ip_0 fragmentation timeout, after ip_1 fragmentation timeout. + * 4. ip_1 send ICMP Ping with 600 bytes to ip_2. It is fragmented into three packets. + * 5. Discard the third fragmentation packet of ip_1 to let ip_1 fragmentation timeout. + * 6. Check if ip_1 instance get the fragmentation time exceeded message from ip_2 instance. + * 7. Check if ip_1 instance get the response from ip_2 instance. + * 7. Check if ip_0 instance get the response from ip_2 instance. + */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_icmp.h" +#include "nx_system.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined (__PRODUCT_NETXDUO__) && !defined (NX_DISABLE_ICMPV4_ERROR_MESSAGE) && !defined (NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG ip_0_packet_counter; +static ULONG ip_1_packet_counter; +static UCHAR time_exceeded_message; +static UCHAR icmp_ping_timeout; +static UCHAR icmp_ping_received; +static CHAR msg[600]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_time_exceeded_message_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ip_0_packet_counter = 0; + ip_1_packet_counter = 0; + time_exceeded_message = NX_FALSE; + icmp_ping_received = NX_FALSE; + icmp_ping_timeout = NX_FALSE; + memset(msg, '1', sizeof(msg)); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*20); + pointer = pointer + 1536*20; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_2, "NetX IP Instance 2", IP_ADDRESS(1, 2, 3, 6), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP traffic. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + status += nx_icmp_enable(&ip_2); + + /* Check for ICMP enable errors. */ + if (status) + error_counter++; + + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + status += nx_ip_fragment_enable(&ip_2); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Time Exceeded Message Test..............."); + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Ping an IP address that does exist. Set the timeout as NX_IP_TIME_TO_LIVE + 1 + 5. delay the second fragmentation. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 6), msg, 600, &my_packet, (NX_IP_TIME_TO_LIVE + 1 + 5) * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + /* Update the flag. */ + icmp_ping_received = NX_TRUE; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Check status. */ + if ((error_counter) || (time_exceeded_message != NX_TRUE) || + (icmp_ping_timeout != NX_TRUE) || (icmp_ping_received != NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Ping an IP address that does exist. Set the timeout as NX_IP_TIME_TO_LIVE + 1. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 6), msg, 600, &my_packet, (NX_IP_TIME_TO_LIVE + 1) * NX_IP_PERIODIC_RATE); + + /* Check the status, should not get the response. */ + if (status == NX_NO_RESPONSE) + { + icmp_ping_timeout = NX_TRUE; + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_ICMPV4_ERROR *icmpv4_error; + + /* Return if it is not an IP packet. */ + if (packet_ptr -> nx_packet_length <= 28) + return NX_TRUE; + + /* Check the IP instance. */ + if (ip_ptr == &ip_0) + { + + /* Update the fragmentation packet counter. */ + ip_0_packet_counter ++; + + /* Delay the second fragmentation packet. */ + if (ip_0_packet_counter == 2) + { + + /* Set the discard operation. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + + /* Delay the second fragmentation ping, the timeout of ip_0 fragmentation should be updated. . */ + *delay_ptr = 5 * NX_IP_PERIODIC_RATE; + } + /* Delay the second fragmentation packet. */ + if (ip_0_packet_counter == 3) + { + + /* Set the discard operation. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + + /* Delay the third fragmentation ping, send the third fragmentation ping after ip_1 fragmentation timeout, before ip_0 fragmentation timeout. */ + *delay_ptr = (NX_IP_TIME_TO_LIVE + 4) * NX_IP_PERIODIC_RATE; + } + } + /* Check the IP instance. */ + else if (ip_ptr == &ip_1) + { + + /* Update the fragmentation packet counter. */ + ip_1_packet_counter ++; + + /* Discard the third fragmentation packet. */ + if (ip_1_packet_counter == 3) + { + + /* Set the discard operation. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + } + else + { + + /* Set the ICMP Error Message header. */ + icmpv4_error = (NX_ICMPV4_ERROR*)(packet_ptr -> nx_packet_prepend_ptr + 20); + + /* Check if it is a fragmentation time exceeded message. */ + if ((icmpv4_error -> nx_icmpv4_error_header.nx_icmpv4_header_type == NX_ICMP_TIME_EXCEEDED_TYPE) && + (icmpv4_error -> nx_icmpv4_error_header.nx_icmpv4_header_code == NX_ICMP_FRT_EXCEEDED_CODE)) + time_exceeded_message = NX_TRUE; + } + + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_time_exceeded_message_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Time Exceeded Message Test...............N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test.c new file mode 100644 index 00000000..1f9dd6b3 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test.c @@ -0,0 +1,346 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send 600 bytes (all '0') to Server. It is fragmented into three packets. + * First fragment is delayed 10s by driver. Third fragment is delayed 65s by driver. + * 2. Client send another 600 bytes (all '1') to Server. It is fragmented into three packets. + * The third packet is dropped by driver. + * 3. Check fragment tail after 60 second. It should be the packet contains all '0'. + */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) +#define DEMO_STACK_SIZE 2048 + +#include "nx_ipv4.h" +#include "nx_system.h" +#include "nx_ram_network_driver_test_1500.h" + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR msg[2][600]; +static CHAR rcv_buffer[600]; +static UINT operations[] = {NX_RAMDRIVER_OP_DELAY, NX_RAMDRIVER_OP_BYPASS, NX_RAMDRIVER_OP_DELAY, + NX_RAMDRIVER_OP_BYPASS, NX_RAMDRIVER_OP_BYPASS, NX_RAMDRIVER_OP_DROP}; +static UINT delays[] = {1000, 0, (NX_IPV4_MAX_REASSEMBLY_TIME + 5) * NX_IP_PERIODIC_RATE, 0, 0, 0}; +static UINT operation_index; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_timeout_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + operation_index = 0; + memset(msg[0], '0', sizeof(msg[0])); + memset(msg[1], '1', sizeof(msg[1])); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet, *rcv_packet; +ULONG len; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Timeout Check Test......................."); + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 1, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 1, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write all '0' into the packet payload! */ + status = nx_packet_data_append(my_packet, msg[0], sizeof(msg[0]), &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write all '0' into the packet payload! */ + status = nx_packet_data_append(my_packet, msg[1], sizeof(msg[1]), &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep assembly timeout. */ + tx_thread_sleep((NX_IPV4_MAX_REASSEMBLY_TIME + 1) * NX_IP_PERIODIC_RATE); + + /* Check head and tail fragment link of ip_1. */ + /* The second packet in fragment link is dropped. */ + if (ip_1.nx_ip_fragment_assembly_head != ip_1.nx_ip_fragment_assembly_tail) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &rcv_packet, 10 * NX_IP_PERIODIC_RATE); + + if(status == NX_SUCCESS) + { + + status = nx_packet_data_retrieve(rcv_packet, rcv_buffer, &len); + + /* Check data length */ + if(len != sizeof(msg[0])) + error_counter++; + + /* Check received data. */ + if(memcmp(rcv_buffer, msg[0], len)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_IPV4_HEADER *header; + + /* Return if it is not an IP packet. */ + if (packet_ptr -> nx_packet_length <= 28) + return NX_TRUE; + + /* Get IP header. */ + header = (NX_IPV4_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header -> nx_ip_header_word_1); + + /* Is it fragmented? */ + if (header -> nx_ip_header_word_1 & NX_IP_FRAGMENT_MASK) + { + + /* Yes it is. Setup operations. */ + *operation_ptr = operations[operation_index]; + *delay_ptr = delays[operation_index++]; + } + + NX_CHANGE_ULONG_ENDIAN(header -> nx_ip_header_word_1); + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_timeout_check_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Timeout Check Test.......................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test2.c b/test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test2.c new file mode 100644 index 00000000..0ab9db9c --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_timeout_check_test2.c @@ -0,0 +1,359 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send 600 bytes (all '0') to Server. It is fragmented into three packets (A, B and C). + * 2. Client send another 600 bytes (all '1') to Server. It is fragmented into three packets (D, E and F). + * 3. The packets are received in this sequence: C, A, D, E, B. Packet F is dropped. + * 3. Check fragment head and tail after reassembly timeout. No packets are queued any more. + */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +#include "nx_ip.h" +#include "nx_system.h" +#include "nx_ram_network_driver_test_1500.h" + +#ifdef __PRODUCT_NETX__ +#define NX_IPV4_HEADER NX_IP_HEADER +#ifndef NX_IPV4_MAX_REASSEMBLY_TIME +#define NX_IPV4_MAX_REASSEMBLY_TIME 5 +#endif /* NX_IPV4_MAX_REASSEMBLY_TIME */ +#endif /* __PRODUCT_NETX__ */ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR msg[2][600]; +static CHAR rcv_buffer[600]; +static UINT operations[] = {NX_RAMDRIVER_OP_DELAY, NX_RAMDRIVER_OP_DELAY, NX_RAMDRIVER_OP_BYPASS, + NX_RAMDRIVER_OP_DELAY, NX_RAMDRIVER_OP_DELAY, NX_RAMDRIVER_OP_DROP}; +static UINT delays[] = {1, 10, 0, 2, 2, 0}; +static UINT operation_index; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_timeout_check_test_2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + operation_index = 0; + memset(msg[0], '0', sizeof(msg[0])); + memset(msg[1], '1', sizeof(msg[1])); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet, *rcv_packet; +ULONG len; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Timeout Check Test 2....................."); + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 1, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 1, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write all '0' into the packet payload! */ + status = nx_packet_data_append(my_packet, msg[0], sizeof(msg[0]), &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write all '0' into the packet payload! */ + status = nx_packet_data_append(my_packet, msg[1], sizeof(msg[1]), &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep assembly timeout. */ + tx_thread_sleep((NX_IPV4_MAX_REASSEMBLY_TIME + 1) * NX_IP_PERIODIC_RATE); + + /* Check head and tail fragment link of ip_1. */ + /* The second packet in fragment link is dropped. */ + if ((ip_1.nx_ip_fragment_assembly_head != ip_1.nx_ip_fragment_assembly_tail) || + (ip_1.nx_ip_fragment_assembly_head != NX_NULL)) + { + error_counter++; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &rcv_packet, 10 * NX_IP_PERIODIC_RATE); + + if(status == NX_SUCCESS) + { + + status = nx_packet_data_retrieve(rcv_packet, rcv_buffer, &len); + + /* Check data length */ + if(len != sizeof(msg[0])) + error_counter++; + + /* Check received data. */ + if(memcmp(rcv_buffer, msg[0], len)) + error_counter++; + + /* Release the packet. */ + nx_packet_release(rcv_packet); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + error_counter++; + + /* Check no packet is leak. */ + if (pool_0.nx_packet_pool_total != pool_0.nx_packet_pool_available) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_IPV4_HEADER *header; + + /* Return if it is not an IP packet. */ + if (packet_ptr -> nx_packet_length <= 28) + return NX_TRUE; + + /* Get IP header. */ + header = (NX_IPV4_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header -> nx_ip_header_word_1); + + /* Is it fragmented? */ + if (header -> nx_ip_header_word_1 & NX_IP_FRAGMENT_MASK) + { + + /* Yes it is. Setup operations. */ + *operation_ptr = operations[operation_index]; + *delay_ptr = delays[operation_index++]; + } + + NX_CHANGE_ULONG_ENDIAN(header -> nx_ip_header_word_1); + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_timeout_check_test_2_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Timeout Check Test 2.....................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_wrong_destination_address_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_wrong_destination_address_test.c new file mode 100644 index 00000000..e5d24d7a --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_wrong_destination_address_test.c @@ -0,0 +1,361 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send UDP 1500 bytes to Server. + * 2. Modify the destination address with 255.255.255.255 for second fragment packet. + * 3. Check if Server receive the 1500 bytes. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#include "nx_ip.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_wrong_destination_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT packet_length; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Wrong Destination Address Test..........."); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let Socket 0 send all packet. test _nx_ip_fragment_assembly() + Hit the false condition: ((search_header -> nx_ip_header_word_2 & NX_IP_PROTOCOL_MASK) == + (current_header -> nx_ip_header_word_2 & NX_IP_PROTOCOL_MASK)) */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Initialize the value. */ + packet_length = 0; + + /* Loop to receive the packets. */ + while(1) + { + + /* Receive the packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + /* Update the packet length. */ + packet_length += my_packet -> nx_packet_length; + } + else + { + break; + } + } + + /* Check the packet length. */ + if (packet_length != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (packet_counter < 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +ULONG val; +ULONG checksum; + + /* Return if it is not an IP packet from ip_0. */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 28)) + { + + /* Updated the packet_counter. */ + packet_counter ++; + + /* Copy the first fragmentation packet. */ + if (packet_counter == 2) + { + + /* Point to the IP HEADER. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Modify the destination address to 255.255.255.255. */ + ip_header_ptr -> nx_ip_header_destination_ip = IP_ADDRESS(255, 255, 255, 255); + + /* Clear the checksume. */ + ip_header_ptr -> nx_ip_header_word_2 &= 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Calculate the IP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + 20, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_wrong_destination_address_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Wrong Destination Address Test...........N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test.c b/test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test.c new file mode 100644 index 00000000..bfe42c30 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test.c @@ -0,0 +1,359 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send UDP 1500 bytes to Server. + * 2. Modify the protocol with ICMP for second fragment packet. + * 3. Check if Server receive the 1500 bytes. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#include "nx_ip.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_wrong_protocol_field_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT packet_length; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Wrong Protocol Field Test................"); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let Socket 0 send all packet. test _nx_ip_fragment_assembly() + Hit the false condition: ((search_header -> nx_ip_header_word_2 & NX_IP_PROTOCOL_MASK) == + (current_header -> nx_ip_header_word_2 & NX_IP_PROTOCOL_MASK)) */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Initialize the value. */ + packet_length = 0; + + /* Loop to receive the packets. */ + while(1) + { + + /* Receive the packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + /* Update the packet length. */ + packet_length += my_packet -> nx_packet_length; + } + else + { + break; + } + } + + /* Check the packet length. */ + if (packet_length != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (packet_counter < 2)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +ULONG val; +ULONG checksum; + + /* Return if it is not an IP packet from ip_0. */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 28)) + { + + /* Updated the packet_counter. */ + packet_counter ++; + + /* Copy the first fragmentation packet. */ + if (packet_counter == 2) + { + + /* Point to the IP HEADER. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Modify the protocol to ICMP. */ + ip_header_ptr -> nx_ip_header_word_2 &= 0xFF000000; + ip_header_ptr -> nx_ip_header_word_2 |= NX_IP_ICMP; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Calculate the IP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + 20, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_wrong_protocol_field_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Wrong Protocol Field Test................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test2.c b/test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test2.c new file mode 100644 index 00000000..4937ec9a --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_fragmentation_wrong_protocol_field_test2.c @@ -0,0 +1,395 @@ +/* This NetX test concentrates on basic IP fragmentation. */ +/* Requirement: __PRODUCT_NETXDUO__ is defined, NX_DISABLE_FRAGMENTATION is not defined. */ +/* Test sequence: + * 1. Client send UDP 1500 bytes to Server. + * 2. Modify the protocol with ICMP and delay one second for first fragment packet. + * 2. Modify the protocol with ICMP for second fragment packet. + * 3. Check if Server receive the 1500 bytes. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_FRAGMENTATION) && !defined(NX_DISABLE_IPV4) +#include "nx_ip.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_wrong_protocol_field_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + packet_counter=0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 1536*16); + pointer = pointer + 1500*16; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT packet_length; + + /* Print out some test information banners. */ + printf("NetX Test: IP Fragmentation Wrong Protocol Field Test2..............."); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let Socket 0 send all packet. test _nx_ip_fragment_assembly() + Hit the false condition: 442 [ + - ]: if (fragment_head == ip_ptr -> nx_ip_fragment_assembly_tail) */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Initialize the value. */ + packet_length = 0; + + /* Loop to receive the packets. */ + while(1) + { + + /* Receive the packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + /* Update the packet length. */ + packet_length += my_packet -> nx_packet_length; + } + else + { + break; + } + } + + /* Check the packet length. */ + if (packet_length != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (packet_counter < 3)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x08, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1500, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +ULONG val; +ULONG checksum; + + /* Return if it is not an IP packet from ip_0. */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 28)) + { + + /* Updated the packet_counter. */ + packet_counter ++; + + /* Modify the first fragmentation packet. */ + if (packet_counter == 1) + { + + /* Point to the IP HEADER. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Modify the protocol to ICMP. */ + ip_header_ptr -> nx_ip_header_word_2 &= 0xFF000000; + ip_header_ptr -> nx_ip_header_word_2 |= NX_IP_ICMP; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Calculate the IP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + 20, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + + /* Delay some seconds. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + } + + /* Modify the second fragmentation packet. */ + if (packet_counter == 2) + { + + /* Point to the IP HEADER. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Modify the protocol to ICMP. */ + ip_header_ptr -> nx_ip_header_word_2 &= 0xFF000000; + ip_header_ptr -> nx_ip_header_word_2 |= NX_IP_ICMP; + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Calculate the IP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + 20, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + } + + return NX_TRUE; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_fragmentation_wrong_protocol_field_test2_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Fragmentation Wrong Protocol Field Test2...............N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ip_gateway_address_test.c b/test/regression/netxduo_test/netx_ip_gateway_address_test.c new file mode 100644 index 00000000..41108e87 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_gateway_address_test.c @@ -0,0 +1,237 @@ +/* This NetX test concentrates on the IP Address Set operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef __PRODUCT_NETX__ +#define nx_udp_socket_source_send nx_udp_socket_interface_send +#endif + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_UDP_SOCKET socket_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_gateway_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && defined(__PRODUCT_NETXDUO__) + /* Attach the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(1, 3, 3, 4), 0xFFFF0000UL, _nx_ram_network_driver_1500); + + if (status) + error_counter++; +#endif + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && defined(__PRODUCT_NETXDUO__) +ULONG ip_address; +#endif +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: IP Gateway Address Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && defined(__PRODUCT_NETXDUO__) + /* Get the gateway address before setting gateway. */ + status = nx_ip_gateway_address_get(&ip_0, &ip_address); + + /* Check the status. */ + if (status != NX_NOT_FOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set the gateway address with another network address. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(2, 2, 3, 1)); + + /* Check the status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the gateway address with correct network address. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 1)); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && defined(__PRODUCT_NETXDUO__) + /* Get the gateway address. */ + status = nx_ip_gateway_address_get(&ip_0, &ip_address); + + /* Check the status. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 1))) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IP_INFO + if (ip_0.nx_ip_invalid_transmit_packets != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_IP_INFO */ + + /* Send a packet out of network through the second interface. + * But the default gateway is set at first interface. */ + nx_udp_socket_source_send(&socket_0, packet_ptr, IP_ADDRESS(1, 4, 3, 5), 12, 1); + +#if !defined(NX_DISABLE_IP_INFO) && (NX_MAX_PHYSICAL_INTERFACES > 1) && defined(__PRODUCT_NETXDUO__) + /* Make sure the packet is dropped. */ + if (ip_0.nx_ip_invalid_transmit_packets == 0) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_IP_INFO */ + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_gateway_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Gateway Address Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_idle_scan_test.c b/test/regression/netxduo_test/netx_ip_idle_scan_test.c new file mode 100644 index 00000000..9f9614dc --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_idle_scan_test.c @@ -0,0 +1,213 @@ +/* This NetX test concentrates on idle-scan as described in https://www.youtube.com/watch?v=v5QEB-T6pH0. + Idle scans are a way for an attacker to perform a port scan in a way that might evade network restrictions and detection mechanisms. The basic defense is to avoid predictably incrementing the IP Identification field. */ + +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_IP_ID_RANDOMIZATION) + +#define DEMO_STACK_SIZE 2048 +#define DEMO_LOOP 10 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static USHORT ip_ids[DEMO_LOOP]; +static UINT ip_ids_index; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_idle_scan_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out test information banner. */ + printf("NetX Test: IP Idle Scan Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + packet_process_callback = my_packet_process; + + /* Now start ping multiple times. */ + ip_ids_index = 0; + for (i = 0; i < DEMO_LOOP; i++) + { + + /* Initialize IP IDs to be consecutive values. */ + ip_ids[i] = (USHORT)i; + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + } + + /* Make sure IP IDs are not consecutive. */ + for (i = 0; i < DEMO_LOOP - 1; i++) + { + if ((ip_ids[i] + 1) != ip_ids[i + 1]) + { + + /* Not consecutive. */ + break; + } + } + + /* Determine if the timeout error occurred. */ + if ((i == (DEMO_LOOP - 1)) || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +#if defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header_ptr; +#else +NX_IP_HEADER *ip_header_ptr; +#endif +ULONG protocol; + + /* Ignore packet from IP 1. */ + if(ip_ptr == &ip_1) + return NX_TRUE; + + /* Ignore packet that is not IP packet. */ + if(packet_ptr -> nx_packet_length < 20) + return NX_TRUE; + +#if defined(__PRODUCT_NETXDUO__) + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + +#else + ip_header_ptr = (NX_IP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); +#endif + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + ip_ids[ip_ids_index++] = (ip_header_ptr -> nx_ip_header_word_1 >> NX_SHIFT_BY_16) & 0xFFFF; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_idle_scan_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Idle Scan Test.........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_ip_interface_address_get_test.c b/test/regression/netxduo_test/netx_ip_interface_address_get_test.c new file mode 100644 index 00000000..4cdae2e1 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_address_get_test.c @@ -0,0 +1,208 @@ +/* This NetX test concentrates on the IP Interface Address Get operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_address_get_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG address; +ULONG mask; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Address Get Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_0, 0, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1,2,3,4)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_0, 1, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(4, 3, 2, 10)) || (mask != 0xFF000000)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_0, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_interface_address_get(&ip_1, 0, &address, &mask); + + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1,2,3,5)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_1, 1, &address, &mask); + + + if((status != NX_SUCCESS ) || (address != IP_ADDRESS(4,3,2,11)) || (mask != 0xFF000000)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_1, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_address_get_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Address Get Test.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_address_set_test.c b/test/regression/netxduo_test/netx_ip_interface_address_set_test.c new file mode 100644 index 00000000..ff44ed3a --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_address_set_test.c @@ -0,0 +1,526 @@ +/* This NetX test concentrates on the IP Interface Address Set operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +VOID ip_address_change_notify(NX_IP *ip_ptr, VOID *additional_info); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_address_set_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 14), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 15), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG address; +ULONG mask; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Address Set Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 110), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Attach the same address to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 110), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_DUPLICATED_ENTRY) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 111), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure we can ping using the current IP address. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 91), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 110), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 14), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping via the other direction. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 9), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 111), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 15), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 3) || (ping_timeouts != 1) || (ping_responses_received != 2) ||(icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 3) || (ping_timeouts != 1) || (ping_responses_received != 2) ||(icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reconfigure the interface IP addresses. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_set(&ip_0, 1, IP_ADDRESS(4, 3, 2, 10), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_set(&ip_0, 2, IP_ADDRESS(4, 3, 2, 15), 0xFFFFF000); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_interface_address_set(&ip_1, 0, IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_set(&ip_1, 1, IP_ADDRESS(4, 3, 2, 11), 0xFFFFFF00); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_set(&ip_1, 2, IP_ADDRESS(4, 3, 2, 15), 0xFFFFF000); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + + /* Make sure we can ping via the new interface IP address. */ + /* Make sure we can ping using the current IP address. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 91), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(4, 3, 2, 10), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_1, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping via the other direction. */ + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 9), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 6) || (ping_timeouts != 2) || (ping_responses_received != 4) ||(icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_1, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 6) || (ping_timeouts != 2) || (ping_responses_received != 4) ||(icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_ip_interface_address_get(&ip_0, 0, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1, 2, 3, 4)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_ip_interface_address_get(&ip_0, 1, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(4, 3, 2, 10)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_0, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_interface_address_get(&ip_1, 0, &address, &mask); + + if((status != NX_SUCCESS) || (address != IP_ADDRESS(1, 2, 3, 5)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_get(&ip_1, 1, &address, &mask); + + if((status != NX_SUCCESS ) || (address != IP_ADDRESS(4, 3, 2, 11)) || (mask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_address_get(&ip_1, 2, &address, &mask); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Test the condition for network mask if ((address_change_notify) && ((ip_address != previous_ip_address) || (network_mask != previous_network_mask)) in _nx_ip_interface_address_set. + Same network mask. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_change_notify, NX_NULL); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test the condition for network mask if ((address_change_notify) && ((ip_address != previous_ip_address) || (network_mask != previous_network_mask)) in _nx_ip_interface_address_set. + Different network mask. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 4), 0xFFFF0000); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test the condition for network mask if ((address_change_notify) && ((ip_address != previous_ip_address) || (network_mask != previous_network_mask)) in _nx_ip_interface_address_set. + Same network mask. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 39), 0xFFFFFF00); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test the condition for network mask if ((address_change_notify) && ((ip_address != previous_ip_address) || (network_mask != previous_network_mask)) in _nx_ip_interface_address_set. + Different network mask. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 2, 3, 40), 0xFFFF0000); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +VOID ip_address_change_notify(NX_IP *ip_ptr, VOID *additional_info) +{ +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_address_set_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Address Set Test.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_attachment_test.c b/test/regression/netxduo_test/netx_ip_interface_attachment_test.c new file mode 100644 index 00000000..8ece0a69 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_attachment_test.c @@ -0,0 +1,229 @@ +/* This NetX test concentrates on the IP Interface Attachment operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_attachment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +UINT i; +ULONG ip_address; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + error_counter++; + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + error_counter++; + + /* Set the IP address for next interface. */ + ip_address = IP_ADDRESS(5, 3, 2, 10); + + /* Loop to attached the valid interface to IP instance 0. */ + for (i = 2; i< NX_MAX_PHYSICAL_INTERFACES; i++) + { + + /* Attach the interface. */ + status = nx_ip_interface_attach(&ip_0, "New interface", ip_address, 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + error_counter++; + + /* Update the IP address. */ + ip_address += 0x01000000UL; + } + + /* Attach the invalid interface to IP instance 0. */ + status = nx_ip_interface_attach(&ip_0, "New interface", ip_address, 0xFFFFFF00UL, _nx_ram_network_driver_1500); + if(status != NX_NO_MORE_ENTRIES) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Attachment Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 9), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 3) || (ping_timeouts != 1) || (ping_responses_received != 2) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_attachment_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Attachment Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_capability_test.c b/test/regression/netxduo_test/netx_ip_interface_capability_test.c new file mode 100644 index 00000000..4687d57e --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_capability_test.c @@ -0,0 +1,135 @@ +/* This NetX test concentrates on the basic IP static operation: static route add/delete/find */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_INTERFACE_CAPABILITY) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_capability_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG interface_capability_flag; + + printf("NetX Test: IP Interface Capability test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface capability. */ + status = nx_ip_interface_capability_set(&ip_0, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the interface capability. */ + status = nx_ip_interface_capability_get(&ip_0, 0, &interface_capability_flag); + + /* Check the status. */ + if ((status) || (interface_capability_flag != NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM)) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_capability_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Capability test..............................N/A\n"); + test_control_return(3); +} +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + diff --git a/test/regression/netxduo_test/netx_ip_interface_detachment_arp_table_test.c b/test/regression/netxduo_test/netx_ip_interface_detachment_arp_table_test.c new file mode 100644 index 00000000..39656b77 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_detachment_arp_table_test.c @@ -0,0 +1,257 @@ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_arp_table_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main threads. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; + + /* Attach the 3rd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "3rd interface", IP_ADDRESS(4, 3, 2, 12), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +UINT i; +NX_ARP *arp_ptr; +UINT arp_entry_counter = 0; + + printf("NetX Test: IP Interface Detachment ARP table Test...................."); + + /* Check earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address to create dynamic arp entries associated with ip_0's 2nd interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address to create dynamic arp entries associated with ip_0's 2nd interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 12), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address to create dynamic arp entries associated with ip_0's 1st interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create static arp entries associated with ip_0's 2nd interface. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(4,3,2,13), 0x0011, 0x22334458); + status += nx_arp_static_entry_create(&ip_0, IP_ADDRESS(4,3,2,14), 0x0011, 0x22334459); + if(status) + error_counter++; + + /* Create static arp entries associated with ip_0's 2nd interface. */ + status = nx_arp_static_entry_create(&ip_0, IP_ADDRESS(1,2,3,10), 0x0011, 0x22334460); + if(status) + error_counter++; + + /* Check the whole arp table. */ + for(i = 0; i < NX_ARP_TABLE_SIZE; i++) + { + arp_ptr = ip_0.nx_ip_arp_table[i]; + while(arp_ptr) + { + if((arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 11)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 12)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(1, 2, 3, 5)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 13)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 14)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(1, 2, 3, 10))) + { + arp_entry_counter++; + } + + /* Move to the next active ARP entry. */ + arp_ptr = arp_ptr -> nx_arp_active_next; + + /* Determine if we are at the end of the ARP list. */ + if(arp_ptr == ip_0.nx_ip_arp_table[i]) + break; + } + } + + if(arp_entry_counter != 6) + error_counter++; + + /* Reset the counter. */ + arp_entry_counter = 0; + + /* Detach the 2nd interface(4.3.2.11) from ip_0. */ + status = nx_ip_interface_detach(&ip_0, 1); + if(status) + error_counter++; + + /* Check the whole arp table. */ + for(i = 0; i < NX_ARP_TABLE_SIZE; i++) + { + arp_ptr = ip_0.nx_ip_arp_table[i]; + while(arp_ptr) + { + /* These entries should have been removed. */ + if((arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 11)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 12)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 13)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(4, 3, 2, 14))) + { + error_counter++; + } + + /* These entries should still be exsited. */ + else if((arp_ptr -> nx_arp_ip_address == IP_ADDRESS(1, 2, 3, 5)) || + (arp_ptr -> nx_arp_ip_address == IP_ADDRESS(1, 2, 3, 10))) + { + arp_entry_counter++; + } + + /* Move to the next active ARP entry. */ + arp_ptr = arp_ptr -> nx_arp_active_next; + + /* Determine if we are at the end of the ARP list. */ + if(arp_ptr == ip_0.nx_ip_arp_table[i]) + break; + } + } + + if(arp_entry_counter != 2) + error_counter++; + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_arp_table_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Interface Detachment ARP table Test....................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_detachment_gateway_test.c b/test/regression/netxduo_test/netx_ip_interface_detachment_gateway_test.c new file mode 100644 index 00000000..a7b8c77e --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_detachment_gateway_test.c @@ -0,0 +1,136 @@ +/* This case test if the gateway has been cleared after interface detachment. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_gateway_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main threads. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +ULONG gateway_address; + + printf("NetX Test: IP Interface Detachment Gateway Test......................"); + + /* Check earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Set gateway address. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 1)); + if(status) + error_counter++; + + /* Get gateway address. */ + status = nx_ip_gateway_address_get(&ip_0, &gateway_address); + if((status) || (gateway_address != IP_ADDRESS(1, 2, 3, 1))) + error_counter++; + + /* Detach the interface from ip_0. */ + status = nx_ip_interface_detach(&ip_0, 0); + if(status) + error_counter++; + + /* Get gateway address. */ + status = nx_ip_gateway_address_get(&ip_0, &gateway_address); + if(status == NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_gateway_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Detachment Gateway Test......................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_detachment_tcp_connection_test.c b/test/regression/netxduo_test/netx_ip_interface_detachment_tcp_connection_test.c new file mode 100644 index 00000000..c882a111 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_detachment_tcp_connection_test.c @@ -0,0 +1,369 @@ +/* This case test if the tcp connections has been reset after interface detachment. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG syn_ack_counter; +static ULONG ack_drop_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_tcp_connection_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_counter = 0; + ack_drop_counter = 0; + + /* Create the main threads. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + if(status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + printf("NetX Test: IP Interface Detachment TCP connection Test..............."); + + /* Check earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if(status) + error_counter++; + + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, NX_NULL); + if(status) + error_counter++; + + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + /* Detach the 2nd interface(4.3.2.10) from ip_0. */ + status = nx_ip_interface_detach(&ip_0, 1); + if(status) + error_counter++; + + /* Detachment should not reset the listening TCP socket. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED) + error_counter++; + + /* Attach the 2nd interface(4.3.2.10) removed before to ip_0. */ + nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver); + + /* ntest_0 relinquishes the CPU. */ + tx_thread_suspend(&ntest_0); + + /* Check if server is SYN_RECV. Now, the server has receiced a SYN. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED) + error_counter++; + + /* Detach the 2nd interface(4.3.2.10) from ip_0. */ + status = nx_ip_interface_detach(&ip_0, 1); + if(status) + error_counter++; + + /* Detachment should reset the TCP server socket which is in connection building progress . */ + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Attach the 2nd interface(4.3.2.10) removed before to ip_0. */ + nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver); + + /* ntest_0 relinquished the CPU. */ + tx_thread_suspend(&ntest_0); + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Relisten the TCP server socket. */ + status += nx_tcp_server_socket_relisten(&ip_0, 12, &server_socket); + + status += nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + if(server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Detach the 2nd interface(4.3.2.10) from ip_0. */ + status = nx_ip_interface_detach(&ip_0, 1); + if(status) + error_counter++; + + /* Detachment should reset the established TCP connection. */ + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* ntest_0 relinquished the CPU. */ + tx_thread_suspend(&ntest_0); + + /* Clean. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&ip_0, 12); + status += nx_tcp_socket_delete(&server_socket); + if(status) + error_counter++; + + if((error_counter) || (syn_ack_counter != 1) || (ack_drop_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + status += nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_packet_process; + + /* Deal the packet with my routing. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(4, 3, 2, 10), 12, NX_NO_WAIT); + if(status != NX_IN_PROGRESS) + error_counter++; + + /* ntest_1 relinquishes the CPU. */ + tx_thread_resume(&ntest_0); + + /* Detach the 2nd interface(4.3.2.11) from ip_1. */ + status = nx_ip_interface_detach(&ip_1, 1); + if(status) + error_counter++; + + /* Detachment should reset the TCP server socket which is in connection building progress . */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Attach the 2nd interface(4.3.2.11) removed before to ip_1. */ + nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + + /* ntest_1 relinquishes the CPU. */ + tx_thread_resume(&ntest_0); + + /* Attempt to connect the socket again. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(4, 3, 2, 10), 12, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + if(client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + error_counter++; + + /* Detach the 2nd interface(4.3.2.11) from ip_1. */ + status = nx_ip_interface_detach(&ip_1, 1); + if(status) + error_counter++; + + /* Detachment should reset the established TCP connection. */ + if(client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Clean. */ + status = nx_tcp_client_socket_unbind(&client_socket); + status += nx_tcp_socket_delete(&client_socket); + if(status) + error_counter++; + + /* ntest_1 relinquishes the CPU. */ + tx_thread_resume(&ntest_0); +} + + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && + (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + syn_ack_counter++; + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Let server receives the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + if(syn_ack_counter == 1) + { + /* Point to TCP HEADER. */ + tcp_header_ptr = (NX_TCP_HEADER *)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + /* Drop the ACK packet in order to postpone the connection. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + ack_drop_counter++; + + advanced_packet_process_callback = NULL; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_tcp_connection_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Detachment TCP connection Test...............N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_detachment_test.c b/test/regression/netxduo_test/netx_ip_interface_detachment_test.c new file mode 100644 index 00000000..cd8fa8df --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_detachment_test.c @@ -0,0 +1,321 @@ + + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address; +static NXD_ADDRESS router_address; +#endif + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static TX_MUTEX mutex_0; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main threads. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver); + if(status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + status = nx_ip_static_route_add(&ip_1, IP_ADDRESS(4, 3, 2, 1), 0xFFFFFF00UL, IP_ADDRESS(4, 3, 2, 10)); + + /* Check status. */ + if (status) + error_counter++; + +#endif /* NX_ENABLE_IP_STATIC_ROUTING */ + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x10000001; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_1, 0, &ipv6_address, 64, NX_NULL); + + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + router_address.nxd_ip_version = NX_IP_VERSION_V6; + router_address.nxd_ip_address.v6[0] = 0x20010000; + router_address.nxd_ip_address.v6[1] = 0x00000000; + router_address.nxd_ip_address.v6[2] = 0x00000000; + router_address.nxd_ip_address.v6[3] = 0x10000002; + + /* Add the default router. */ + status = nxd_ipv6_default_router_add(&ip_1, &router_address, 1500, 0); + + /* Check status. */ + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Detachment Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_mutex_create(&mutex_0, "mutex_0", TX_NO_INHERIT); + + tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Ping an unknown IP address. This will timeout after 100 ticks. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 9), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an IP address that does exist. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* It should also be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let ntest_1 detach the 2nd interface(4.3.2.11) from IP instance1. */ + tx_mutex_put(&mutex_0); + tx_thread_sleep(1); + tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Now ping an IP address that has been detached. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* It should be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let ntest_1 attach the interface(4.3.2.11) removed before, then detach the 1st interface(1.2.3.5) to IP instance1. */ + tx_mutex_put(&mutex_0); + tx_thread_sleep(1); + tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Now ping an IP address that has been detached. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(4, 3, 2, 11), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* It should be able to ping an IP address that is accessible via the primary interface. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + tx_mutex_delete(&mutex_0); + + /* Get ICMP information. */ + status += nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + + if ((pings_sent != 7) || (ping_timeouts != 3) || (ping_responses_received != 4) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Detach the 2nd interface(4.3.2.11) from IP instance1. */ + status = nx_ip_interface_detach(&ip_1, 1); + if(status) + error_counter++; + + tx_mutex_put(&mutex_0); + tx_thread_sleep(1); + tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Attach the 2nd interface(4.3.2.11) removed before to IP instance1. */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver); + + /* Detach the 1st interface(1.2.3.5)from IP instance1. */ + status += nx_ip_interface_detach(&ip_1, 0); + + if(status) + error_counter++; + + tx_mutex_put(&mutex_0); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_detachment_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Detachment Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_info_get_test.c b/test/regression/netxduo_test/netx_ip_interface_info_get_test.c new file mode 100644 index 00000000..6b304c03 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_info_get_test.c @@ -0,0 +1,227 @@ +/* This NetX test concentrates on the IP Interface Info Get operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_info_get_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +CHAR *interface_name; +ULONG address; +ULONG netmask; +ULONG mtu_size; +ULONG physical_address_msw; +ULONG physical_address_lsw; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Info Get Test................................"); + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information before it is valid. */ + status = nx_ip_interface_info_get(&ip_0, 1, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get nothing from interface 0. */ + status = nx_ip_interface_info_get(&ip_0, 0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_info_get(&ip_0, 0, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if((status != NX_SUCCESS) || strcmp(interface_name, "PRI") || (address != IP_ADDRESS(1, 2, 3, 4)) || (netmask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_ip_interface_info_get(&ip_0, 1, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if((status != NX_SUCCESS) || strcmp(interface_name, "2nd interface") || (address != IP_ADDRESS(4, 3, 2, 10)) || (netmask != 0xFF000000)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_info_get(&ip_0, 2, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_interface_info_get(&ip_1, 0, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if((status != NX_SUCCESS) || strcmp(interface_name, "PRI") || (address != IP_ADDRESS(1, 2, 3, 5)) || (netmask != 0xFFFFFF00)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_info_get(&ip_1, 1, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if((status != NX_SUCCESS) || strcmp(interface_name, "2nd interface") || (address != IP_ADDRESS(4, 3, 2, 11)) || (netmask != 0xFF000000)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_info_get(&ip_1, 2, &interface_name, &address, &netmask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_info_get_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Info Get Test................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_physical_address_set_fail_test.c b/test/regression/netxduo_test/netx_ip_interface_physical_address_set_fail_test.c new file mode 100644 index 00000000..d60fd06c --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_physical_address_set_fail_test.c @@ -0,0 +1,136 @@ +/* This NetX test concentrates on the IGMP join fails when driver returns error. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#ifdef __PRODUCT_NETXDUO__ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_physical_address_set_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, test_driver, + pointer, 2048, 1); + pointer = pointer + 2048; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Physical Address Set Fail Test..............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Perform IP interface physcial address set operations. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, 0x0011, 0x22334458, NX_TRUE); + + /* Check status. */ + if (status != NX_UNHANDLED_COMMAND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req) +{ + if (driver_req -> nx_ip_driver_command == NX_LINK_SET_PHYSICAL_ADDRESS) + { + + /* Return not supported. */ + driver_req -> nx_ip_driver_status = NX_UNHANDLED_COMMAND; + } + else + { + + /* Pass the request to ram driver. */ + _nx_ram_network_driver_256(driver_req); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_physical_address_set_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Physical Address Set Fail Test...............N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_physical_address_test.c b/test/regression/netxduo_test/netx_ip_interface_physical_address_test.c new file mode 100644 index 00000000..99a262fc --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_physical_address_test.c @@ -0,0 +1,149 @@ +/* This NetX test concentrates on the basic IP static operation: static route add/delete/find */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#ifdef __PRODUCT_NETXDUO__ +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_physical_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG physical_msw; +ULONG physical_lsw; + + + printf("NetX Test: IP Interface Physical Address Test........................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface physical address. */ + status = nx_ip_interface_physical_address_get(&ip_0, 0, &physical_msw, &physical_lsw); + + /* Check the status. */ + if (status) + error_counter++; + + /* Set the physical address. */ + physical_msw = 0x0102; + physical_lsw = 0x03040506; + + /* Set the interface capability. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, physical_msw, physical_lsw, NX_TRUE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the interface physical address again. */ + status = nx_ip_interface_physical_address_get(&ip_0, 0, &physical_msw, &physical_lsw); + + /* Check the status. */ + if (status) + error_counter++; + + /* Check the physical address. */ + if ((physical_msw != 0x0102) || (physical_lsw != 0x03040506)) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_physical_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Physical Address Test........................N/A\n"); + test_control_return(3); +} +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + diff --git a/test/regression/netxduo_test/netx_ip_interface_status_check_fail_test.c b/test/regression/netxduo_test/netx_ip_interface_status_check_fail_test.c new file mode 100644 index 00000000..c6d18032 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_status_check_fail_test.c @@ -0,0 +1,280 @@ +/* This NetX test concentrates on the IP Interface Status Check operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ +static ULONG error_counter; + +static ULONG test_enabled; +static ULONG test_status; +static ULONG reject_command; +static ULONG return_value; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_status_check_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + reject_command = 0; + test_enabled = NX_FALSE; + return_value = NX_TRUE; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, test_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG val; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Status Check Fail Test......................."); + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_ARP_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_UDP_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_TCP_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_IGMP_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the IP address. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_RARP_COMPLETE, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address again. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return 1. */ + reject_command = NX_LINK_GET_STATUS; + test_enabled = NX_TRUE; + test_status = 1; + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return NX_UNHANDLED_COMMAND. */ + reject_command = NX_LINK_GET_STATUS; + test_enabled = NX_TRUE; + test_status = NX_UNHANDLED_COMMAND; + ip_0.nx_ip_interface[0].nx_interface_link_up = 0; + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return 1. */ + reject_command = NX_LINK_GET_STATUS; + test_enabled = NX_TRUE; + test_status = 1; + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return NX_UNHANDLED_COMMAND. */ + reject_command = NX_LINK_GET_STATUS; + test_enabled = NX_TRUE; + test_status = NX_UNHANDLED_COMMAND; + ip_0.nx_ip_interface[0].nx_interface_link_up = 0; + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return NX_SUCCESS. */ + reject_command = NX_LINK_GET_STATUS; + test_enabled = NX_TRUE; + test_status = NX_SUCCESS; + return_value = NX_FALSE; + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return NX_SUCCESS. */ + reject_command = NX_LINK_GET_STATUS; + test_enabled = NX_TRUE; + test_status = NX_SUCCESS; + return_value = NX_FALSE; + + nx_ip_interface_detach(&ip_0,0); + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req) +{ + + /* Inject the command. */ + if ((driver_req -> nx_ip_driver_command == reject_command) && (test_enabled == NX_TRUE)) + { + driver_req -> nx_ip_driver_status = test_status; + *driver_req -> nx_ip_driver_return_ptr = return_value; + test_enabled = NX_FALSE; + } + else + { + _nx_ram_network_driver_1500(driver_req); + } +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_status_check_fail_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Status Check Fail Test.......................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_interface_status_check_test.c b/test/regression/netxduo_test/netx_ip_interface_status_check_test.c new file mode 100644 index 00000000..22112cc5 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_interface_status_check_test.c @@ -0,0 +1,339 @@ +/* This NetX test concentrates on the IP Interface Status Check operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the test application... */ +static ULONG error_counter; + +static ULONG test_enabled; +static ULONG test_status; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_status_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + error_counter = 0; + test_enabled = NX_FALSE; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, test_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, test_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + status = nx_udp_enable(&ip_0); + if (status) + error_counter++; + + status = nx_tcp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_igmp_enable(&ip_0); + if(status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG val; + + + /* Print out test information banner. */ + printf("NetX Test: IP Interface Status Check Test............................"); + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_1500); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check interface IP address. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_ADDRESS_RESOLVED, &val, NX_NO_WAIT); + if((status != NX_SUCCESS) || !(val & NX_IP_ADDRESS_RESOLVED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check link status. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_LINK_ENABLED, &val, NX_NO_WAIT); + if((status != NX_SUCCESS) || !(val & NX_IP_LINK_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return NX_UNHANDLED_COMMAND. */ + test_enabled = NX_TRUE; + test_status = NX_UNHANDLED_COMMAND; + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check ARP status. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_ARP_ENABLED, &val, NX_NO_WAIT); + if((status != NX_SUCCESS) || !(val & NX_IP_ARP_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check UDP status. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_UDP_ENABLED, &val, NX_NO_WAIT); + if((status != NX_SUCCESS) || !(val & NX_IP_UDP_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check TCP status. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_TCP_ENABLED, &val, NX_NO_WAIT); + if((status != NX_SUCCESS) || !(val & NX_IP_TCP_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check IGMP status. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_IGMP_ENABLED, &val, NX_NO_WAIT); + if((status != NX_SUCCESS) || !(val & NX_IP_IGMP_ENABLED)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check RARP status. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_RARP_COMPLETE, &val, NX_NO_WAIT); + /* ip_0 has had an IP address, RARP shoul be in complete status. */ + if((status != NX_SUCCESS) || !(val & NX_IP_RARP_COMPLETE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check an unknown status with wait time 0. the result should be error.*/ + status = nx_ip_interface_status_check(&ip_0, 0, 4343, &val, NX_NO_WAIT); + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check an unknown status with wait time 10. the result should be error.*/ + status = nx_ip_interface_status_check(&ip_0, 0, 4343, &val, 10); + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_0, 1, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_status_check(&ip_0, 2, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + status = nx_ip_interface_status_check(&ip_1, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_ip_interface_status_check(&ip_1, 1, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let driver return NX_UNHANDLED_COMMAND. */ + test_enabled = NX_TRUE; + test_status = NX_UNHANDLED_COMMAND; + + status = nx_ip_interface_status_check(&ip_1, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_ip_interface_status_check(&ip_1, 2, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Modify the ip instance to generate a special test condition. */ + ip_0.nx_ip_id = 1234; + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_INTERFACE_LINK_ENABLED, &val, NX_NO_WAIT); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_id = NX_IP_ID; +#endif + + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void test_driver(struct NX_IP_DRIVER_STRUCT *driver_req) +{ + + /* Inject NX_LINK_GET_STATUS command. */ + if ((driver_req -> nx_ip_driver_command == NX_LINK_GET_STATUS) && (test_enabled == NX_TRUE)) + { + driver_req -> nx_ip_driver_status = test_status; + test_enabled = NX_FALSE; + } + else + { + _nx_ram_network_driver_1500(driver_req); + } +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_interface_status_check_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Interface Status Check Test............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_invalid_packet_receive_test.c b/test/regression/netxduo_test/netx_ip_invalid_packet_receive_test.c new file mode 100644 index 00000000..e42fcf0e --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_invalid_packet_receive_test.c @@ -0,0 +1,420 @@ +/* This NetX test concentrates on IP fragmentation disable operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG icmp_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_invalid_packet_receive_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 500, pointer, 4096); + pointer = pointer + 4096; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP traffic. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check for ICMP enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: IP Invalid Packet Receive Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_1.nx_ipv4_packet_receive = my_packet_process; + + /* Now ip_0 ping ip_1. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status == NX_SUCCESS) || (my_packet)) + { +#if defined(NX_ENABLE_INTERFACE_CAPABILITY) || defined(NX_DISABLE_IP_RX_CHECKSUM) + if (my_packet -> nx_packet_length == 28) +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Check the error counter and icmp counter. */ + if ((error_counter) || (icmp_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +NX_PACKET *copy_packet_0; +NX_PACKET *copy_packet_1; +NX_PACKET *copy_packet_2; +#ifndef NX_DISABLE_PACKET_CHAIN +NX_PACKET *copy_packet_3; +NX_PACKET *copy_packet_4; +NX_PACKET *copy_packet_5; +#endif +#ifdef __PRODUCT_NETXDUO__ +NX_IPV4_HEADER *ip_header_ptr; +#else +NX_IP_HEADER *ip_header_ptr; +#endif + + /* Get the ICMP packet. */ + icmp_counter ++; + + /*************************************************************/ + /* nx_packet_length < header length nx_ipv4_packet_receive() */ + /*************************************************************/ + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_0, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Set the invalid packet length. */ + copy_packet_0 -> nx_packet_length = 18; + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_0); + + /**********************************************************/ + /* nx_packet_length < pkt_length nx_ipv4_packet_receive() */ + /**********************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_1, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the IPv4 header. */ +#ifdef __PRODUCT_NETXDUO__ + ip_header_ptr = (NX_IPV4_HEADER *)copy_packet_1 -> nx_packet_prepend_ptr; +#else + ip_header_ptr = (NX_IP_HEADER *)copy_packet_1 -> nx_packet_prepend_ptr; +#endif + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_0 += 0x00000001; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_1); + + /****************************************************************************/ + /* nx_packet_length > pkt_length for normal packet nx_ipv4_packet_receive() */ + /****************************************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_2, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the IPv4 header. */ +#ifdef __PRODUCT_NETXDUO__ + ip_header_ptr = (NX_IPV4_HEADER *)copy_packet_2 -> nx_packet_prepend_ptr; +#else + ip_header_ptr = (NX_IP_HEADER *)copy_packet_2 -> nx_packet_prepend_ptr; +#endif + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_0 -= 0x00000001; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_2); + +#ifndef NX_DISABLE_PACKET_CHAIN + + /***************************************************************************/ + /* nx_packet_length > pkt_length for chain packet nx_ipv4_packet_receive() */ + /* last packet < delta, two packet chain. */ + /***************************************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_3, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the IPv4 header. */ +#ifdef __PRODUCT_NETXDUO__ + ip_header_ptr = (NX_IPV4_HEADER *)copy_packet_3 -> nx_packet_prepend_ptr; +#else + ip_header_ptr = (NX_IP_HEADER *)copy_packet_3 -> nx_packet_prepend_ptr; +#endif + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_0 -= 0x00000004; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, ©_packet_4, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(copy_packet_4 -> nx_packet_prepend_ptr, "ABC", 3); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + copy_packet_4 -> nx_packet_length = 3; + copy_packet_4 -> nx_packet_append_ptr = copy_packet_4 -> nx_packet_prepend_ptr + 3; + + /* Chain the packet. */ + copy_packet_3 -> nx_packet_next = copy_packet_4; + copy_packet_3 -> nx_packet_last = copy_packet_4; + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_3); + + /***************************************************************************/ + /* nx_packet_length > pkt_length for chain packet nx_ipv4_packet_receive() */ + /* last packet < delta, three packet chain */ + /***************************************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_3, &pool_0, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the IPv4 header. */ +#ifdef __PRODUCT_NETXDUO__ + ip_header_ptr = (NX_IPV4_HEADER *)copy_packet_3 -> nx_packet_prepend_ptr; +#else + ip_header_ptr = (NX_IP_HEADER *)copy_packet_3 -> nx_packet_prepend_ptr; +#endif + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_0 -= 0x00000004; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, ©_packet_4, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(copy_packet_4 -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + copy_packet_4 -> nx_packet_length = 26; + copy_packet_4 -> nx_packet_append_ptr = copy_packet_4 -> nx_packet_prepend_ptr + 26; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, ©_packet_5, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(copy_packet_5 -> nx_packet_prepend_ptr, "ABC", 3); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + copy_packet_5 -> nx_packet_length = 3; + copy_packet_5 -> nx_packet_append_ptr = copy_packet_5 -> nx_packet_prepend_ptr + 3; + + /* Chain the packet. */ + copy_packet_3 -> nx_packet_next = copy_packet_4; + copy_packet_3 -> nx_packet_last = copy_packet_5; + copy_packet_4 -> nx_packet_next = copy_packet_5; + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_3); +#endif + + /*******************************************************************/ + /* ip_header_length < NX_IP_NORMAL_LENGTH nx_ipv4_packet_receive() */ + /*******************************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_0, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Get the IPv4 header. */ +#ifdef __PRODUCT_NETXDUO__ + ip_header_ptr = (NX_IPV4_HEADER *)copy_packet_0 -> nx_packet_prepend_ptr; +#else + ip_header_ptr = (NX_IP_HEADER *)copy_packet_0 -> nx_packet_prepend_ptr; +#endif + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Modified the header length. */ + ip_header_ptr -> nx_ip_header_word_0 -= 0x01000000; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, copy_packet_0); + + /****************************************************************************/ + /* nx_packet_length = pkt_length and no IP address nx_ipv4_packet_receive() */ + /****************************************************************************/ + + /* Clear the ip_1 instance address. */ + nx_ip_address_set(&ip_1, 0, 0); + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(&ip_1, packet_ptr); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_invalid_packet_receive_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Invalid Packet Receive Test............................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_link_local_address_test.c b/test/regression/netxduo_test/netx_ip_link_local_address_test.c new file mode 100644 index 00000000..743b9673 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_link_local_address_test.c @@ -0,0 +1,314 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_link_local_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(169, 254, 3, 4), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT i; +ULONG server_addr; + + /* Print out some test information banners. */ + printf("NetX Test: IP Link-Local Address Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + server_addr = IP_ADDRESS(1, 2, 3, 5); + + for (i = 0; i < 2; i++) + { + + /* Create the client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, server_addr, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Disconnect from server. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unbind the client socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Modify the IP address to routable. */ + nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00); + server_addr = IP_ADDRESS(169, 254, 3, 5); + } + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; +UINT i; + + for (i = 0; i < 2; i++) + { + + /* Create the server socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Listen the socket. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Accept connection from client. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Disconnect from client. */ + status = nx_tcp_socket_disconnect(&server_socket, 5); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Modify the IP address to link-local. */ + nx_ip_address_set(&ip_1, IP_ADDRESS(169, 254, 3, 5), 0xFFFF0000); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_link_local_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Link-Local Address Test................................N/A\n"); + + test_control_return(3); + +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_ip_link_status_test.c b/test/regression/netxduo_test/netx_ip_link_status_test.c new file mode 100644 index 00000000..bdfcf4c8 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_link_status_test.c @@ -0,0 +1,288 @@ +/* This case tests link status down and up. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UINT link_up_count; +static UINT link_down_count; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static VOID ntest_0_entry(ULONG thread_input); +static VOID ntest_1_entry(ULONG thread_input); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID link_status_change_notify(NX_IP *ip_ptr, UINT interface_index, UINT link_up); +static VOID set_link_status(NX_IP *ip_ptr, UINT link_status); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_link_status_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + link_up_count = 0; + link_down_count = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ICMP enable status. */ + if(status) + error_counter++; +} + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: IP Link Status Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let server thread listen first. */ + tx_thread_relinquish(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check the connection status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* Set link status change notify as NULL. */ + nx_ip_link_status_change_notify_set(&ip_0, NX_NULL); + + /* Simulator link down. */ + set_link_status(&ip_0, NX_FALSE); + + /* Set link status change notify. */ + nx_ip_link_status_change_notify_set(&ip_0, link_status_change_notify); + + /* Simulator link down. */ + set_link_status(&ip_0, NX_FALSE); + + /* Check whether TCP connections are dropped. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Check whether network is reachable. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABC", 3, &packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + { + + /* It is not expected to receive a response. */ + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Simulator link up. */ + set_link_status(&ip_0, NX_TRUE); + + /* Check whether network is reachable. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABC", 3, &packet_ptr, 1 * NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + { + + /* It is expected to receive a response. */ + nx_packet_release(packet_ptr); + } + else + { + error_counter++; + } + + /* Determine if the test was successful. */ + if((error_counter) || (link_up_count != 1) || (link_down_count != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; +} + + +static VOID link_status_change_notify(NX_IP *ip_ptr, UINT interface_index, UINT link_up) +{ + if (link_up == NX_TRUE) + { + + /* Link status from down to up. */ + link_up_count++; + } + else + { + /* Link status from up to down. */ + link_down_count++; + + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + } +} + + +static VOID set_link_status(NX_IP *ip_ptr, UINT link_status) +{ + + /* Set link status and notify IP layer. */ + ip_ptr -> nx_ip_interface[0].nx_interface_link_up = (UCHAR)link_status; + _nx_ip_driver_link_status_event(ip_ptr, 0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_link_status_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Link Status Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_loopback_multihome_test.c b/test/regression/netxduo_test/netx_ip_loopback_multihome_test.c new file mode 100644 index 00000000..99270cad --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_loopback_multihome_test.c @@ -0,0 +1,253 @@ +/* This NetX test concentrates on the ICMP ping through all loopback addresses with multiple addresses. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_LOOPBACK_INTERFACE) && defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_loopback_multihome_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +#endif + + /* Enable ICMP processing for IP_0. */ + status = nxd_icmp_enable(&ip_0); + + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ + + /* Set the second interface. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, _nx_ram_network_driver_256); + + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: IP Loopback Multihome Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Wait for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Detect packet in driver callback function. */ + advanced_packet_process_callback = packet_process; + +#ifndef NX_DISABLE_IPV4 + /* Now ping the first IPv4 interface address. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 4), "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + /* Now ping the second IPv4 interface address. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } +#endif + + +#ifdef FEATURE_NX_IPV6 + /* Now ping the first IPv6 interface address. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + + /* Now ping the second IPv6 interface address. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28)) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } +#endif /* FEATURE_NX_IPV6 */ + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* No packet is expected to be sent out by driver. */ + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_loopback_multihome_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: IP Loopback Multihome Test................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_malformed_packet_test.c b/test/regression/netxduo_test/netx_ip_malformed_packet_test.c new file mode 100644 index 00000000..497f92cb --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_malformed_packet_test.c @@ -0,0 +1,158 @@ +/* Test processing malformed IP packet. */ + +#include "netx_ip_malformed_packet_test.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static UCHAR pool_area[1024 * 1024]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_malformed_packet_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1552, pool_area, sizeof(pool_area)); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192,168,0,170), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP */ + status = nx_arp_enable(&ip_0, pointer, 1024); + + /* Check ARP enable status. */ + if(status) + error_counter++; + pointer = pointer + 1024; + + /* Enable IP fragmentation logic. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT i; +ULONG packet_available; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: IP Malformed Packet Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get available packets. */ + packet_available = pool_0.nx_packet_pool_available; + + for (i = 0; i < sizeof(raw_packets) / sizeof(RAW_PACKET); i++) + { + + /* Inject all packets. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, raw_packets[i].data, raw_packets[i].length); + packet_ptr -> nx_packet_length = raw_packets[i].length; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the IP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + } + + /* Sleep one second to let all packets consumed by IP thread. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check available packets. */ + if (packet_available != pool_0.nx_packet_pool_available) + { + error_counter++; + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_malformed_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Malformed Packet Test..................................N/A\n"); + test_control_return(3); + +} +#endif /* NX_DISABLE_ARP_AUTO_ENTRY */ diff --git a/test/regression/netxduo_test/netx_ip_malformed_packet_test.h b/test/regression/netxduo_test/netx_ip_malformed_packet_test.h new file mode 100644 index 00000000..959f641c --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_malformed_packet_test.h @@ -0,0 +1,9315 @@ +#include "nx_api.h" + +#define TO_RAW_PACKET(p) {(UCHAR *)(&p[14]), sizeof(p) - 14} + +/* Define raw packet data structure. */ +typedef struct +{ + UCHAR *data; + UINT length; +} RAW_PACKET; + +/* Frame (34 bytes) */ +static const unsigned char pkt3700[34] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf8, 0xa9, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa /* .. */ +}; + +/* Frame (35 bytes) */ +static const unsigned char pkt3701[35] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf8, 0xa8, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78 /* ..x */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3702[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf2, 0xe1, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (35 bytes) */ +static const unsigned char pkt3703[35] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf8, 0xa8, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0xff /* ... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3704[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf2, 0xe1, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff /* .. */ +}; + +/* Frame (35 bytes) */ +static const unsigned char pkt3705[35] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf8, 0xa8, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x00 /* ... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3706[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, /* ......@< */ +0xf2, 0xe1, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3707[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x20, 0x00, 0x40, 0x3c, /* ...= .@< */ +0xd2, 0xa4, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3708[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x20, 0xb9, 0x40, 0x3c, /* ...= .@< */ +0xd1, 0xeb, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (74 bytes) */ +static const unsigned char pkt3709[74] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x00, 0x3c, 0xcd, 0xa9, 0x40, 0x00, 0x40, 0x06, /* .<..@.@. */ +0xeb, 0x0d, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0xca, 0x89, 0x08, 0x4a, 0x40, 0x02, /* .....J@. */ +0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, /* ........ */ +0x72, 0x10, 0x82, 0x33, 0x00, 0x00, 0x02, 0x04, /* r..3.... */ +0x05, 0xb4, 0x04, 0x02, 0x08, 0x0a, 0x0a, 0x14, /* ........ */ +0xcd, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, /* ........ */ +0x03, 0x07 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3710[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x21, 0x72, 0x40, 0x3c, /* ...=!r@< */ +0xd1, 0x32, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .2...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3711[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x22, 0x2b, 0x40, 0x3c, /* ...="+@< */ +0xd0, 0x79, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .y...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3712[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x22, 0xe4, 0x40, 0x3c, /* ...=".@< */ +0xcf, 0xc0, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3713[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x23, 0x9d, 0x40, 0x3c, /* ...=#.@< */ +0xcf, 0x07, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3714[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x24, 0x56, 0x40, 0x3c, /* ...=$V@< */ +0xce, 0x4e, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .N...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3715[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x25, 0x0f, 0x40, 0x3c, /* ...=%.@< */ +0xcd, 0x95, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3716[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x25, 0xc8, 0x40, 0x3c, /* ...=%.@< */ +0xcc, 0xdc, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3717[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x26, 0x81, 0x40, 0x3c, /* ...=&.@< */ +0xcc, 0x23, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .#...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3718[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x27, 0x3a, 0x40, 0x3c, /* ...=':@< */ +0xcb, 0x6a, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .j...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3719[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x27, 0xf3, 0x40, 0x3c, /* ...='.@< */ +0xca, 0xb1, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3720[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x28, 0xac, 0x40, 0x3c, /* ...=(.@< */ +0xc9, 0xf8, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3721[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x29, 0x65, 0x40, 0x3c, /* ...=)e@< */ +0xc9, 0x3f, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .?...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3722[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2a, 0x1e, 0x40, 0x3c, /* ...=*.@< */ +0xc8, 0x86, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3723[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2a, 0xd7, 0x40, 0x3c, /* ...=*.@< */ +0xc7, 0xcd, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3724[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2b, 0x90, 0x40, 0x3c, /* ...=+.@< */ +0xc7, 0x14, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3725[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2c, 0x49, 0x40, 0x3c, /* ...=,I@< */ +0xc6, 0x5b, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .[...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3726[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2d, 0x02, 0x40, 0x3c, /* ...=-.@< */ +0xc5, 0xa2, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3727[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2d, 0xbb, 0x40, 0x3c, /* ...=-.@< */ +0xc4, 0xe9, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3728[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2e, 0x74, 0x40, 0x3c, /* ...=.t@< */ +0xc4, 0x30, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .0...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3729[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2f, 0x2d, 0x40, 0x3c, /* ...=/-@< */ +0xc3, 0x77, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .w...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3730[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x2f, 0xe6, 0x40, 0x3c, /* ...=/.@< */ +0xc2, 0xbe, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3731[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x30, 0x9f, 0x40, 0x3c, /* ...=0.@< */ +0xc2, 0x05, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3732[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x31, 0x58, 0x40, 0x3c, /* ...=1X@< */ +0xc1, 0x4c, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .L...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3733[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x32, 0x11, 0x40, 0x3c, /* ...=2.@< */ +0xc0, 0x93, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3734[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x32, 0xca, 0x40, 0x3c, /* ...=2.@< */ +0xbf, 0xda, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3735[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x33, 0x83, 0x40, 0x3c, /* ...=3.@< */ +0xbf, 0x21, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .!...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3736[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x34, 0x3c, 0x40, 0x3c, /* ...=4<@< */ +0xbe, 0x68, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .h...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3737[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x34, 0xf5, 0x40, 0x3c, /* ...=4.@< */ +0xbd, 0xaf, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3738[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x35, 0xae, 0x40, 0x3c, /* ...=5.@< */ +0xbc, 0xf6, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3739[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x36, 0x67, 0x40, 0x3c, /* ...=6g@< */ +0xbc, 0x3d, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .=...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3740[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x37, 0x20, 0x40, 0x3c, /* ...=7 @< */ +0xbb, 0x84, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3741[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x37, 0xd9, 0x40, 0x3c, /* ...=7.@< */ +0xba, 0xcb, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3742[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x38, 0x92, 0x40, 0x3c, /* ...=8.@< */ +0xba, 0x12, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3743[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x39, 0x4b, 0x40, 0x3c, /* ...=9K@< */ +0xb9, 0x59, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .Y...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (98 bytes) */ +static const unsigned char pkt3744[98] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x00, 0x54, 0xea, 0x30, 0x00, 0x00, 0x40, 0x01, /* .T.0..@. */ +0x0e, 0x74, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .t...... */ +0x00, 0xaa, 0x08, 0x00, 0xbd, 0x9c, 0xea, 0x30, /* .......0 */ +0x3f, 0x21, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* ?!wwwwww */ +0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* wwwwwwww */ +0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* wwwwwwww */ +0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* wwwwwwww */ +0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* wwwwwwww */ +0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* wwwwwwww */ +0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, /* wwwwwwww */ +0x77, 0x77 /* ww */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3745[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x3a, 0x04, 0x40, 0x3c, /* ...=:.@< */ +0xb8, 0xa0, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3746[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x3a, 0xbd, 0x40, 0x3c, /* ...=:.@< */ +0xb7, 0xe7, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3747[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x3b, 0x76, 0x40, 0x3c, /* ...=;v@< */ +0xb7, 0x2e, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3748[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x3c, 0x2f, 0x40, 0x3c, /* ...=Z@< */ +0xb4, 0x4a, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* .J...... */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt3752[1514] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x05, 0xdc, 0x00, 0x3d, 0x3f, 0x13, 0x40, 0x3c, /* ...=?.@< */ +0xb3, 0x91, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78 /* xx */ +}; + +/* Frame (429 bytes) */ +static const unsigned char pkt3753[429] = { +0x00, 0x06, 0x77, 0x12, 0xfb, 0x99, 0x00, 0x03, /* ..w..... */ +0x1d, 0x10, 0xf4, 0x43, 0x08, 0x00, 0x45, 0x00, /* ...C..E. */ +0x01, 0x9f, 0x00, 0x3d, 0x1f, 0xcc, 0x40, 0x3c, /* ...=..@< */ +0xd7, 0x15, 0xc0, 0xa8, 0x00, 0x0a, 0xc0, 0xa8, /* ........ */ +0x00, 0xaa, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* ..xxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, /* xxxxxxxx */ +0x78, 0x78, 0x78, 0x78, 0x78 /* xxxxx */ +}; + +RAW_PACKET raw_packets[] = +{ + TO_RAW_PACKET(pkt3700), + TO_RAW_PACKET(pkt3701), + TO_RAW_PACKET(pkt3702), + TO_RAW_PACKET(pkt3703), + TO_RAW_PACKET(pkt3704), + TO_RAW_PACKET(pkt3705), + TO_RAW_PACKET(pkt3706), + TO_RAW_PACKET(pkt3707), + TO_RAW_PACKET(pkt3708), +#if 0 /* SYN packet */ + TO_RAW_PACKET(pkt3709), +#endif + TO_RAW_PACKET(pkt3710), + TO_RAW_PACKET(pkt3711), + TO_RAW_PACKET(pkt3712), + TO_RAW_PACKET(pkt3713), + TO_RAW_PACKET(pkt3714), + TO_RAW_PACKET(pkt3715), + TO_RAW_PACKET(pkt3716), + TO_RAW_PACKET(pkt3717), + TO_RAW_PACKET(pkt3718), + TO_RAW_PACKET(pkt3719), + TO_RAW_PACKET(pkt3720), + TO_RAW_PACKET(pkt3721), + TO_RAW_PACKET(pkt3722), + TO_RAW_PACKET(pkt3723), + TO_RAW_PACKET(pkt3724), + TO_RAW_PACKET(pkt3725), + TO_RAW_PACKET(pkt3726), + TO_RAW_PACKET(pkt3727), + TO_RAW_PACKET(pkt3728), + TO_RAW_PACKET(pkt3729), + TO_RAW_PACKET(pkt3730), + TO_RAW_PACKET(pkt3731), + TO_RAW_PACKET(pkt3732), + TO_RAW_PACKET(pkt3733), + TO_RAW_PACKET(pkt3734), + TO_RAW_PACKET(pkt3735), + TO_RAW_PACKET(pkt3736), + TO_RAW_PACKET(pkt3737), + TO_RAW_PACKET(pkt3738), + TO_RAW_PACKET(pkt3739), + TO_RAW_PACKET(pkt3740), + TO_RAW_PACKET(pkt3741), + TO_RAW_PACKET(pkt3742), + TO_RAW_PACKET(pkt3743), +#if 0 /* ICMP packet */ + TO_RAW_PACKET(pkt3744), +#endif + TO_RAW_PACKET(pkt3745), + TO_RAW_PACKET(pkt3746), + TO_RAW_PACKET(pkt3747), + TO_RAW_PACKET(pkt3748), + TO_RAW_PACKET(pkt3749), + TO_RAW_PACKET(pkt3750), + TO_RAW_PACKET(pkt3751), + TO_RAW_PACKET(pkt3752), + TO_RAW_PACKET(pkt3753) +}; \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_ip_max_payload_size_find_test.c b/test/regression/netxduo_test/netx_ip_max_payload_size_find_test.c new file mode 100644 index 00000000..1668eb3a --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_max_payload_size_find_test.c @@ -0,0 +1,296 @@ +/* This NetX test concentrates on the ip max payload size find operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; +#endif + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_max_payload_size_find_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +#endif + + +#ifdef FEATURE_NX_IPV6 + + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + if(status) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + if(status) + error_counter++; + + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; +#endif +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS dest_address; +ULONG start_offset, payload_length; + + /* Print out test information banner. */ + printf("NetX Test: IP Max Payload Size Find Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 10), 0xFF000000, _nx_ram_network_driver_512); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the 2nd interface to IP instance1 */ + status = nx_ip_interface_attach(&ip_1, "2nd interface", IP_ADDRESS(4, 3, 2, 11), 0xFF000000, _nx_ram_network_driver_256); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IPV4 + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + status = nx_ip_max_payload_size_find(&ip_0, &dest_address, 0, 80, 80, NX_PROTOCOL_TCP, + &start_offset, &payload_length); + + if((status != NX_SUCCESS) || (start_offset != 56) || (payload_length != 1460)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(4, 3, 2, 11); + + status = nx_ip_max_payload_size_find(&ip_0, &dest_address, 1, 80, 80, NX_PROTOCOL_TCP, + &start_offset, &payload_length); + + if((status != NX_SUCCESS) ||(start_offset != 56) || (payload_length != 472)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test an invalid address. */ + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(4, 3, 2, 11); + + status = nx_ip_max_payload_size_find(&ip_0, &dest_address, 3, 80, 80, NX_PROTOCOL_TCP, + &start_offset, &payload_length); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 4); + + status = nx_ip_max_payload_size_find(&ip_1, &dest_address, 0, 80, 80, NX_PROTOCOL_TCP, + &start_offset, &payload_length); + + if((status != NX_SUCCESS) || (start_offset != 56) || (payload_length != 984)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(4, 3, 2, 10); + + status = nx_ip_max_payload_size_find(&ip_1, &dest_address, 1, 80, 80, NX_PROTOCOL_TCP, + &start_offset, &payload_length); + + /* 56 = 16 + 20 + 20. 216 = 256 + 16 - 56 */ + if((status != NX_SUCCESS) ||(start_offset != 56) || (payload_length != 216)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef FEATURE_NX_IPV6 + /* Find the max payload with invalid address index. */ + status = nx_ip_max_payload_size_find(&ip_0, &ipv6_address_1, (NX_MAX_IPV6_ADDRESSES + NX_LOOPBACK_IPV6_ENABLED), 80, 80, NX_PROTOCOL_UDP, &start_offset, &payload_length); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the max payload with valid address index. */ + status = nx_ip_max_payload_size_find(&ip_0, &ipv6_address_1, 0, 80, 80, NX_PROTOCOL_UDP, &start_offset, &payload_length); + /* 64 = 16 + 40 + 8 208 = 1500 + 16 - 64 */ + if((status != NX_SUCCESS) || (start_offset != 64) || (payload_length != 1452)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifndef NX_DISABLE_IPV4 + /* Test an invalid address. */ + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(4, 3, 2, 11); + + status = nx_ip_max_payload_size_find(&ip_1, &dest_address, 3, 80, 80, NX_PROTOCOL_TCP, + &start_offset, &payload_length); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + printf("SUCCESS!\n"); + test_control_return(0); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_max_payload_size_find_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Max Payload Size Find Test.............................N/A\n"); + test_control_return(3); + +} +#endif + diff --git a/test/regression/netxduo_test/netx_ip_multicast_interface_detach_test.c b/test/regression/netxduo_test/netx_ip_multicast_interface_detach_test.c new file mode 100644 index 00000000..5b3eac2b --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_multicast_interface_detach_test.c @@ -0,0 +1,216 @@ +/* This NetX test concentrates on the basic multicast IGMP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_multicast_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if(status) + error_counter++; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + /* Check the status. */ + if(status) + error_counter++; + + /* Enable IGMP processing for both this IP instance. */ + status = nx_igmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: IP Multicast Interface Detach Test........................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test the first interface. */ + /* Perform 7 IGMP join operations. */ + status = nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,1), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,2), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,3), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,5), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,6), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,7), 1); + + /* Join one group another 4 times to test the counting operation. */ + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + status += nx_igmp_multicast_interface_join(&ip_0, IP_ADDRESS(224,0,0,4), 1); + + /* Determine if there is an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the groups info. */ + if((ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_count != 1) || + (ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_join_count != 1) || + (ip_0.nx_ipv4_multicast_entry[2].nx_ipv4_multicast_join_count != 1) || + (ip_0.nx_ipv4_multicast_entry[3].nx_ipv4_multicast_join_count != 5) || + (ip_0.nx_ipv4_multicast_entry[4].nx_ipv4_multicast_join_count != 1) || + (ip_0.nx_ipv4_multicast_entry[5].nx_ipv4_multicast_join_count != 1) || + (ip_0.nx_ipv4_multicast_entry[6].nx_ipv4_multicast_join_count != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IGMP_INFO + /* Check the groups info. */ + if(ip_0.nx_ip_igmp_groups_joined != 7) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Attempt to join a new group. This should result in an error. */ + status = nx_igmp_multicast_join(&ip_0, IP_ADDRESS(224,0,0,8)); + + /* Determine if an error has occurred. */ + if (status != NX_NO_MORE_ENTRIES) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Detach the seconde interface. */ + status = nx_ip_interface_detach(&ip_0, 1); + + /* Check status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the groups info. */ + if((ip_0.nx_ipv4_multicast_entry[0].nx_ipv4_multicast_join_count != 0) || + (ip_0.nx_ipv4_multicast_entry[1].nx_ipv4_multicast_join_count != 0) || + (ip_0.nx_ipv4_multicast_entry[2].nx_ipv4_multicast_join_count != 0) || + (ip_0.nx_ipv4_multicast_entry[3].nx_ipv4_multicast_join_count != 0) || + (ip_0.nx_ipv4_multicast_entry[4].nx_ipv4_multicast_join_count != 0) || + (ip_0.nx_ipv4_multicast_entry[5].nx_ipv4_multicast_join_count != 0) || + (ip_0.nx_ipv4_multicast_entry[6].nx_ipv4_multicast_join_count != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IGMP_INFO + /* Check the groups info. */ + if(ip_0.nx_ip_igmp_groups_joined != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_multicast_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IP Multicast Interface Detach Test........................N/A\n"); + test_control_return(3); +} +#endif /* NX_ENABLE_IPV6_MULTICAST */ diff --git a/test/regression/netxduo_test/netx_ip_nxe_api_test.c b/test/regression/netxduo_test/netx_ip_nxe_api_test.c new file mode 100644 index 00000000..99d1f0be --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_nxe_api_test.c @@ -0,0 +1,1746 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "tx_thread.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL invalid_pool; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP invalid_ip; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID link_status_change_notify(NX_IP *ip_ptr, UINT interface_index, UINT link_up); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 1); + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Create an IP instance in ISR with invalid IP address. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 0", IP_ADDRESS(255, 255, 255, 255), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer + 2048, 2048, 1); + + /* Check for IP create errors. */ + if (status != NX_IP_ADDRESS_ERROR) + error_counter++; + + /* Create an IP instance in ISR with corruptted memory. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer + 1, 2048, 1); + + /* Check for IP create errors. */ + if (status != NX_PTR_ERROR) + error_counter++; + + + /* Create an IP instance in ISR with corruptted memory. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer + 1, 2048, 1); + + /* Check for IP create errors. */ + if (status != NX_PTR_ERROR) + error_counter++; + + /* Create an IP instance in ISR with corruptted memory. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer - 1, 2048, 1); + + /* Check for IP create errors. */ + if (status != NX_PTR_ERROR) + error_counter++; + + pointer = pointer + 2048; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG network_mask; +ULONG return_value_ptr; +ULONG ip_total_packets_sent; +ULONG ip_total_bytes_sent; +ULONG ip_total_packets_received; +ULONG ip_total_bytes_received; +ULONG ip_invalid_packets; +ULONG ip_receive_packets_dropped; +ULONG ip_receive_checksum_errors; +ULONG ip_send_packets_dropped; +ULONG ip_total_fragments_sent; +ULONG ip_total_fragments_received; +#ifdef NX_ENABLE_INTERFACE_CAPABILITY +ULONG interface_capability_flag; +#endif +CHAR *interface_name; +ULONG mtu_size; +ULONG physical_address_msw; +ULONG physical_address_lsw; +ULONG actual_status; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS dest_address; +ULONG start_offset_ptr; +ULONG payload_length_ptr; +#endif + + /* Print out some test information banners. */ + printf("NetX Test: IP NXE API Test..........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_address_change_notify api */ + /************************************************/ + + /* Set the IP address change notify function for NULL IP instance. */ + status = nx_ip_address_change_notify(NX_NULL, NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the IP address change notify function for invalid IP instance. */ + status = nx_ip_address_change_notify(&invalid_ip, NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_address_get api */ + /************************************************/ + + /* Get the IP address for NULL IP instance. */ + status = nx_ip_address_get(NX_NULL, &ip_address, &network_mask); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the IP address for invalid IP instance. */ + status = nx_ip_address_get(&invalid_ip, &ip_address, &network_mask); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IP address with NULL address pointer. */ + status = nx_ip_address_get(&ip_0, NX_NULL, &network_mask); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IP address with NULL network mask pointer. */ + status = nx_ip_address_get(&ip_0, &ip_address, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_address_set api */ + /************************************************/ + + /* Set the IP address for NULL IP instance. */ + status = nx_ip_address_set(NX_NULL, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the IP address for invalid IP instance. */ + status = nx_ip_address_set(&invalid_ip, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address with loopback address. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(255, 255, 255, 255), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address with Class C address. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(192, 0, 0, 1), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_create api */ + /************************************************/ + +#ifndef NX_DISABLE_ERROR_CHECKING + status = _nxe_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 1, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Create the IP instance with NULL IP instance. */ + status = nx_ip_create(NX_NULL, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with NULL pool. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, NX_NULL, _nx_ram_network_driver_256, pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid pool. */ + invalid_pool.nx_packet_pool_id = NX_NULL; + + /* Create the IP instance with invalid pool. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &invalid_pool, _nx_ram_network_driver_256, pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with NULL driver. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, NX_NULL, pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with NULL memory pointer. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, NX_NULL, 2048, 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with small memory size. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, pointer, TX_MINIMUM_STACK - 1, 1); + + /* Check for error. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with small memory size. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, TX_MAX_PRIORITIES); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with same IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance test", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the IP instance with invalid address. */ + status = nx_ip_create(&ip_1, "NetX IP Instance test", IP_ADDRESS(255, 255, 255, 255), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_delete api */ + /************************************************/ + + /* Delete the IP instance for NULL IP instance. */ + status = nx_ip_delete(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the IP instance for invalid IP instance. */ + status = nx_ip_delete(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_driver_direct_command api */ + /************************************************/ + + /* Set the command for NULL IP instance. */ + status = nx_ip_driver_direct_command(NX_NULL, NX_LINK_GET_STATUS, &return_value_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the command for invalid IP instance. */ + status = nx_ip_driver_direct_command(&invalid_ip, NX_LINK_GET_STATUS, &return_value_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the command with NULL return value pointer. */ + status = nx_ip_driver_direct_command(&ip_0, NX_LINK_GET_STATUS, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*********************************************************/ + /* Tested the nxe_ip_driver_interface_direct_command api */ + /*********************************************************/ + + /* Set the command for NULL IP instance. */ + status = nx_ip_driver_interface_direct_command(NX_NULL, NX_LINK_GET_STATUS, 0, &return_value_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the command for invalid IP instance. */ + status = nx_ip_driver_interface_direct_command(&invalid_ip, NX_LINK_GET_STATUS, 0, &return_value_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the command with NULL return value pointer. */ + status = nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_GET_STATUS, 0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the command with error interface index. */ + status = nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_GET_STATUS, NX_MAX_PHYSICAL_INTERFACES, &return_value_ptr); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_forwarding_disable api */ + /************************************************/ + + /* Disable forward feature for NULL IP instance. */ + status = nx_ip_forwarding_disable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Disable forward feature for invalid IP instance. */ + status = nx_ip_forwarding_disable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_forwarding_enable api */ + /************************************************/ + + /* Enable forward feature for NULL IP instance. */ + status = nx_ip_forwarding_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable forward feature for invalid IP instance. */ + status = nx_ip_forwarding_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_fragment_disable api */ + /************************************************/ + + /* Disable fragment feature for NULL IP instance. */ + status = nx_ip_fragment_disable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Disable fragment feature for invalid IP instance. */ + status = nx_ip_fragment_disable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_fragment_enable api */ + /************************************************/ + + /* Enable fragment feature for NULL IP instance. */ + status = nx_ip_forwarding_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable fragment feature for invalid IP instance. */ + status = nx_ip_fragment_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_gateway_address_clear api */ + /************************************************/ + + /* Clear the gateway address for NULL IP instance. */ + status = nx_ip_gateway_address_clear(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Clear the gateway address for invalid IP instance. */ + status = nx_ip_gateway_address_clear(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_gateway_address_get api */ + /************************************************/ + + /* Get the gateway address for NULL IP instance. */ + status = nx_ip_gateway_address_get(NX_NULL, &ip_address); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the gateway address for invalid IP instance. */ + status = nx_ip_gateway_address_get(&invalid_ip, &ip_address); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the gateway address with NULL ip address pointer. */ + status = nx_ip_gateway_address_get(&ip_0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_gateway_address_set api */ + /************************************************/ + + /* Set the gateway address for NULL IP instance. */ + status = nx_ip_gateway_address_set(NX_NULL, IP_ADDRESS(1, 2, 3, 1)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the gateway address for invalid IP instance. */ + status = nx_ip_gateway_address_set(&invalid_ip, IP_ADDRESS(1, 2, 3, 1)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the gateway address with NULL address. */ + status = nx_ip_gateway_address_set(&ip_0, NX_NULL); + + /* Check the status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_info_get api */ + /************************************************/ + + /* Get IP info with NULL IP instance. */ + status = nx_ip_info_get(NX_NULL, &ip_total_packets_sent, + &ip_total_bytes_sent, + &ip_total_packets_received, + &ip_total_bytes_received, + &ip_invalid_packets, + &ip_receive_packets_dropped, + &ip_receive_checksum_errors, + &ip_send_packets_dropped, + &ip_total_fragments_sent, + &ip_total_fragments_received); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get IP info with invalid IP instance. */ + status = nx_ip_info_get(&invalid_ip, &ip_total_packets_sent, + &ip_total_bytes_sent, + &ip_total_packets_received, + &ip_total_bytes_received, + &ip_invalid_packets, + &ip_receive_packets_dropped, + &ip_receive_checksum_errors, + &ip_send_packets_dropped, + &ip_total_fragments_sent, + &ip_total_fragments_received); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_interface_address_get api */ + /************************************************/ + + /* Get the interface IP address for NULL IP instance. */ + status = nx_ip_interface_address_get(NX_NULL, 0, &ip_address, &network_mask); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the interface IP address for invalid IP instance. */ + status = nx_ip_interface_address_get(&invalid_ip, 0, &ip_address, &network_mask); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface IP address with NULL address pointer. */ + status = nx_ip_interface_address_get(&ip_0, 0, NX_NULL, &network_mask); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface IP address with NULL network mask pointer. */ + status = nx_ip_interface_address_get(&ip_0, 0, &ip_address, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface IP address with MAX interface index. */ + status = nx_ip_interface_address_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &ip_address, &network_mask); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface IP address with invalid interface index. */ + status = nx_ip_interface_address_get(&ip_0, 1, &ip_address, &network_mask); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /**************************************************************/ + /* Tested the nxe_ip_interface_address_mapping_configure api */ + /**************************************************************/ + + /* Configure the interface mapping for NULL IP instance. */ + status = nx_ip_interface_address_mapping_configure(NX_NULL, 0, NX_FALSE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Configure the interface mapping for invalid IP instance. */ + status = nx_ip_interface_address_mapping_configure(&invalid_ip, 0, NX_FALSE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Configure the interface mapping with MAX interface index. */ + status = nx_ip_interface_address_mapping_configure(&ip_0, NX_MAX_PHYSICAL_INTERFACES, NX_FALSE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_interface_address_set api */ + /************************************************/ + + /* Set the IP address with Class B address. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(128, 0, 0, 1), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address with Class C address. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(192, 0, 0, 1), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface IP address for NULL IP instance. */ + status = nx_ip_interface_address_set(NX_NULL, 0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the interface IP address for invalid IP instance. */ + status = nx_ip_interface_address_set(&invalid_ip, 0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface IP address with NULL address pointer. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(255, 255, 255, 255), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface IP address with MAX interface index. */ + status = nx_ip_interface_address_set(&ip_0, NX_MAX_PHYSICAL_INTERFACES, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface IP address with invalid interface index. */ + status = nx_ip_interface_address_set(&ip_0, 1, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + #if (NX_MAX_PHYSICAL_INTERFACES >= 2) + /************************************************/ + /* Tested the nxe_ip_interface_attach api */ + /************************************************/ + + /* Attach the interface for NULL IP instance. */ + status = nx_ip_interface_attach(NX_NULL, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Attach the interface for invalid IP instance. */ + status = nx_ip_interface_attach(&invalid_ip, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the interface for NULL dirver. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the interface for NULL name. */ + status = nx_ip_interface_attach(&ip_0, NX_NULL, IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the interface for invalid IP address. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(255, 255, 255, 255), 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach the interface for valid IP address. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(192, 0, 0, 2), 0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + nx_ip_interface_detach(&ip_0, 1); +#endif + + + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /**************************************************/ + /* Tested the nxe_ip_interface_capability_get api */ + /**************************************************/ + + /* Get the interface capability for NULL IP instance. */ + status = nx_ip_interface_capability_get(NX_NULL, 0, &interface_capability_flag); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the interface capability for invalid IP instance. */ + status = nx_ip_interface_capability_get(&invalid_ip, 0, &interface_capability_flag); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface capability with MAX interface index. */ + status = nx_ip_interface_capability_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &interface_capability_flag); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface capability with NULL interface capability pointer. */ + status = nx_ip_interface_capability_get(&ip_0, 0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /**************************************************/ + /* Tested the nxe_ip_interface_capability_set api */ + /**************************************************/ + + /* Set the interface capability for NULL IP instance. */ + status = nx_ip_interface_capability_set(NX_NULL, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the interface capability for invalid IP instance. */ + status = nx_ip_interface_capability_set(&invalid_ip, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface capability with MAX interface index. */ + status = nx_ip_interface_capability_set(&ip_0, NX_MAX_PHYSICAL_INTERFACES, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /************************************************/ + /* Tested the nxe_ip_interface_detach api */ + /************************************************/ + + /* Detach the interface for NULL IP instance. */ + status = nx_ip_interface_detach(NX_NULL, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Detach the interface for invalid IP instance. */ + status = nx_ip_interface_detach(&invalid_ip, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Detach the interface with MAX interface index. */ + status = nx_ip_interface_detach(&ip_0, NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_interface_info_get api */ + /************************************************/ + + /* Get the interface info for NULL IP instance. */ + status = nx_ip_interface_info_get(NX_NULL, 0, &interface_name, &ip_address, &network_mask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the interface info for NULL IP instance. */ + status = nx_ip_interface_info_get(&invalid_ip, 0, &interface_name, &ip_address, &network_mask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface info with MAX interface index. */ + status = nx_ip_interface_info_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &interface_name, &ip_address, &network_mask, &mtu_size, &physical_address_msw, &physical_address_lsw); + + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /*******************************************/ + /* Tested the nxe_ip_interface_mtu_set api */ + /*******************************************/ + + /* Set the interface mtu for NULL IP instance. */ + status = nx_ip_interface_mtu_set(NX_NULL, 0, 512); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the interface mtu for invalid IP instance. */ + status = nx_ip_interface_mtu_set(&invalid_ip, 0, 512); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface mtu with MAX interface index. */ + status = nx_ip_interface_mtu_set(&ip_0, NX_MAX_PHYSICAL_INTERFACES, 512); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /********************************************************/ + /* Tested the nxe_ip_interface_physical_address_get api */ + /********************************************************/ + + /* Get the interface physical address for NULL IP instance. */ + status = nx_ip_interface_physical_address_get(NX_NULL, 0, &physical_address_msw, &physical_address_lsw); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the interface physical address for invalid IP instance. */ + status = nx_ip_interface_physical_address_get(&invalid_ip, 0, &physical_address_msw, &physical_address_lsw); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface physical address with NULL physical pointer. */ + status = nx_ip_interface_physical_address_get(&ip_0, 0, NX_NULL, &physical_address_lsw); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface physical address with NULL physical pointer. */ + status = nx_ip_interface_physical_address_get(&ip_0, 0, &physical_address_msw, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the interface physical address with MAX interface index. */ + status = nx_ip_interface_physical_address_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &physical_address_msw, &physical_address_lsw); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /********************************************************/ + /* Tested the nxe_ip_interface_physical_address_set api */ + /********************************************************/ + + /* Set the interface physical address for NULL IP instance. */ + status = nx_ip_interface_physical_address_set(NX_NULL, 0, 0x0011, 0x0022334457, NX_TRUE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the interface physical address for invalid IP instance. */ + status = nx_ip_interface_physical_address_set(&invalid_ip, 0, 0x0011, 0x0022334457, NX_TRUE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the interface physical address with MAX interface index. */ + status = nx_ip_interface_physical_address_set(&ip_0, NX_MAX_PHYSICAL_INTERFACES, 0x0011, 0x0022334457, NX_TRUE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_interface_status_check api */ + /************************************************/ + + /* Check the interface status for NULL IP instance. */ + status = nx_ip_interface_status_check(NX_NULL, 0, NX_IP_RARP_COMPLETE, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Check the interface status for invalid IP instance. */ + status = nx_ip_interface_status_check(&invalid_ip, 0, NX_IP_RARP_COMPLETE, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the interface status with NULL actual status pointer. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_RARP_COMPLETE, NX_NULL, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the interface status with MAX interface index. */ + status = nx_ip_interface_status_check(&ip_0, NX_MAX_PHYSICAL_INTERFACES, NX_IP_RARP_COMPLETE, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the interface status with invalid interface index. */ + status = nx_ip_interface_status_check(&ip_0, 1, NX_IP_RARP_COMPLETE, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the interface status with invalid need status. */ + status = nx_ip_interface_status_check(&ip_0, 0, 0x8000, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + + /************************************************/ + /* Tested the nxe_ip_max_payload_size_find api */ + /************************************************/ + + /* Set the dest address. */ + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Find the max payload size for NULL IP instance. */ + status = nx_ip_max_payload_size_find(NX_NULL, &dest_address, 0, 80, 80, NX_PROTOCOL_TCP, &start_offset_ptr, &payload_length_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Find the max payload size for invalid IP instance. */ + status = nx_ip_max_payload_size_find(&invalid_ip, &dest_address, 0, 80, 80, NX_PROTOCOL_TCP, &start_offset_ptr, &payload_length_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the max payload size with NULL dest address. */ + status = nx_ip_max_payload_size_find(&ip_0, NX_NULL, 0, 80, 80, NX_PROTOCOL_TCP, &start_offset_ptr, &payload_length_ptr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the dest address. */ + dest_address.nxd_ip_version = 0x80; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Find the max payload size with invalid dest address. */ + status = nx_ip_max_payload_size_find(&ip_0, &dest_address, 0, 80, 80, NX_PROTOCOL_TCP, &start_offset_ptr, &payload_length_ptr); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the dest address. */ + dest_address.nxd_ip_version = NX_IP_VERSION_V4; + dest_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Find the max payload size with invalid protocol. */ + status = nx_ip_max_payload_size_find(&ip_0, &dest_address, 0, 80, 80, NX_PROTOCOL_ICMP, &start_offset_ptr, &payload_length_ptr); + + /* Check for error. */ + if (status != NX_NOT_SUPPORTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + /************************************************/ + /* Tested the nxe_ip_auxiliary_packet_pool_set api */ + /************************************************/ + + /* Set the auxiliary packet pool for NULL IP instance. */ + status = nx_ip_auxiliary_packet_pool_set(NX_NULL, &pool_0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the auxiliary packet pool for invalid IP instance. */ + status = nx_ip_auxiliary_packet_pool_set(&invalid_ip, &pool_0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the auxiliary packet pool with NULL pool. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid pool. */ + invalid_pool.nx_packet_pool_id = NX_NULL; + + /* Set the auxiliary packet pool with invalid pool. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_0, &invalid_pool); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + /************************************************/ + /* Tested the nxe_ip_static_route_add api */ + /************************************************/ + + /* Add the static route for NULL IP instance. */ + status = nx_ip_static_route_add(NX_NULL, IP_ADDRESS(1, 2, 3, 10), IP_ADDRESS(255, 255, 255,0 ), IP_ADDRESS(1, 2, 3, 1)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Add the static route for invalid IP instance. */ + status = nx_ip_static_route_add(&invalid_ip, IP_ADDRESS(1, 2, 3, 10), IP_ADDRESS(255, 255, 255, 0), IP_ADDRESS(1, 2, 3, 1)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_ip_static_route_delete api */ + /************************************************/ + + /* Delete the static route for NULL IP instance. */ + status = nx_ip_static_route_delete(NX_NULL, IP_ADDRESS(1, 2, 3, 10), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the static route for invalid IP instance. */ + status = nx_ip_static_route_delete(&invalid_ip, IP_ADDRESS(1, 2, 3, 10), IP_ADDRESS(255, 255, 255, 0)); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /************************************************/ + /* Tested the nxe_ip_status_check api */ + /************************************************/ + + /* Check the status for NULL IP instance. */ + status = nx_ip_status_check(NX_NULL, NX_IP_RARP_COMPLETE, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Check the status for invalid IP instance. */ + status = nx_ip_status_check(&invalid_ip, NX_IP_RARP_COMPLETE, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the status with NULL actual status pointer. */ + status = nx_ip_status_check(&ip_0, NX_IP_RARP_COMPLETE, NX_NULL, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the status with invalid need status. */ + status = nx_ip_status_check(&ip_0, 0x8000, &actual_status, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /******************************************************/ + /* Tested the nx_ip_link_status_change_notify_set api */ + /******************************************************/ + + /* Set link status change notify will NULL IP. */ + status = nx_ip_link_status_change_notify_set(NX_NULL, link_status_change_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link status change notify will NULL callback function pointer. */ + status = nx_ip_link_status_change_notify_set(&ip_0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static VOID link_status_change_notify(NX_IP *ip_ptr, UINT interface_index, UINT link_up) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP NXE API Test...........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_packet_filter_extended_test.c b/test/regression/netxduo_test/netx_ip_packet_filter_extended_test.c new file mode 100644 index 00000000..790c0434 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_packet_filter_extended_test.c @@ -0,0 +1,369 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_IP_PACKET_FILTER) && !defined(NX_DISABLE_ICMP_INFO) && defined(__PRODUCT_NETXDUO__) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT drop_incoming_packet_extended(struct NX_IP_STRUCT *ip_ptr, NX_PACKET *packet_ptr, UINT direction); +static UINT drop_outgoing_packet_extended(struct NX_IP_STRUCT *ip_ptr, NX_PACKET *packet_ptr, UINT direction); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_packet_filter_extended_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +#endif + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT test_sent = 0; +UINT test_responses_received = 0; +UINT test_received = 0; +UINT test_responded_to = 0; + + /* Print out test information banner. */ + printf("NetX Test: IP Packet Filter Extended Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + +#ifndef NX_DISABLE_IPV4 + /* Do not set packet filter. */ + ip_0.nx_ip_packet_filter_extended = NX_NULL; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + + test_sent++; test_responses_received++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop outgoing packet. */ + ip_0.nx_ip_packet_filter_extended = drop_outgoing_packet_extended; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop incoming packet. */ + ip_0.nx_ip_packet_filter_extended = drop_incoming_packet_extended; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef FEATURE_NX_IPV6 + /* Do not set packet filter. */ + ip_0.nx_ip_packet_filter_extended = NX_NULL; + + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + + test_sent++; test_responses_received++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop outgoing packet. */ + ip_0.nx_ip_packet_filter_extended = drop_outgoing_packet_extended; + + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop incoming packet. */ + ip_0.nx_ip_packet_filter_extended = drop_incoming_packet_extended; + + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* FEATURE_NX_IPV6 */ + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT drop_incoming_packet_extended(struct NX_IP_STRUCT *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if (direction == NX_IP_PACKET_IN) + { + return(NX_INVALID_PACKET); + } + return(NX_SUCCESS); +} + +static UINT drop_outgoing_packet_extended(struct NX_IP_STRUCT *ip_ptr, NX_PACKET *packet_ptr, UINT direction) +{ + if (direction == NX_IP_PACKET_OUT) + { + return(NX_INVALID_PACKET); + } + return(NX_SUCCESS); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_packet_filter_extended_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Packet Filter Extended Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_packet_filter_test.c b/test/regression/netxduo_test/netx_ip_packet_filter_test.c new file mode 100644 index 00000000..876965d1 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_packet_filter_test.c @@ -0,0 +1,369 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_IP_PACKET_FILTER) && !defined(NX_DISABLE_ICMP_INFO) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT drop_incoming_packet(VOID *ip_header_ptr, UINT direction); +static UINT drop_outgoing_packet(VOID *ip_header_ptr, UINT direction); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_packet_filter_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +#endif + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT test_sent = 0; +UINT test_responses_received = 0; +UINT test_received = 0; +UINT test_responded_to = 0; + + /* Print out test information banner. */ + printf("NetX Test: IP Packet Filter Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + +#ifndef NX_DISABLE_IPV4 + /* Do not set packet filter. */ + ip_0.nx_ip_packet_filter = NX_NULL; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + + test_sent++; test_responses_received++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop outgoing packet. */ + ip_0.nx_ip_packet_filter = drop_outgoing_packet; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop incoming packet. */ + ip_0.nx_ip_packet_filter = drop_incoming_packet; + + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef FEATURE_NX_IPV6 + /* Do not set packet filter. */ + ip_0.nx_ip_packet_filter = NX_NULL; + + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + + test_sent++; test_responses_received++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop outgoing packet. */ + ip_0.nx_ip_packet_filter = drop_outgoing_packet; + + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set packet filter to drop incoming packet. */ + ip_0.nx_ip_packet_filter = drop_incoming_packet; + + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + test_sent++; + test_received++; test_responded_to++; + + /* Check ping sent and ping received. */ + if ((ip_0.nx_ip_pings_sent != test_sent) || + (ip_0.nx_ip_ping_responses_received != test_responses_received) || + (ip_1.nx_ip_pings_received != test_received) || + (ip_1.nx_ip_pings_responded_to != test_responded_to)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* FEATURE_NX_IPV6 */ + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT drop_incoming_packet(VOID *ip_header_ptr, UINT direction) +{ + if (direction == NX_IP_PACKET_IN) + { + return(NX_INVALID_PACKET); + } + return(NX_SUCCESS); +} + +static UINT drop_outgoing_packet(VOID *ip_header_ptr, UINT direction) +{ + if (direction == NX_IP_PACKET_OUT) + { + return(NX_INVALID_PACKET); + } + return(NX_SUCCESS); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_packet_filter_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Packet Filter Test.....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_raw_loopback_test.c b/test/regression/netxduo_test/netx_ip_raw_loopback_test.c new file mode 100644 index 00000000..e6b0c913 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_raw_loopback_test.c @@ -0,0 +1,240 @@ +/* This NetX test concentrates on the raw packet send/receive through loopback interface. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_LOOPBACK_INTERFACE) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_addr; +#endif /* FEATURE_NX_IPV6 */ +static NXD_ADDRESS ipv4_lo; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_loopback_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status != NX_SUCCESS) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + ipv6_addr.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_addr.nxd_ip_address.v6[0] = 0x20010000; + ipv6_addr.nxd_ip_address.v6[1] = 0x00000000; + ipv6_addr.nxd_ip_address.v6[2] = 0x00000000; + ipv6_addr.nxd_ip_address.v6[3] = 0x00010001; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ + + ipv4_lo.nxd_ip_version = NX_IP_VERSION_V4; + ipv4_lo.nxd_ip_address.v4 = IP_ADDRESS(127, 0, 0, 1); + + status = nx_ip_raw_packet_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Loopback Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 3; i++) +#else + for (i = 0; i < 2; i++) +#endif + { + + /* Now, pickup the three raw packets that should be queued on the other IP instance. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + if((my_packet -> nx_packet_length != 28) || + (memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28))) + error_counter++; + + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +UINT i; + +#ifdef FEATURE_NX_IPV6 + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_addr, 64, NX_NULL); + if(status != NX_SUCCESS) + error_counter++; + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 3; i++) +#else + for (i = 0; i < 2; i++) +#endif + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the raw IP packet. */ + if (i == 0) + { + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, ipv4_lo.nxd_ip_address.v4, + NX_LOOPBACK_INTERFACE, NX_IP_NORMAL); + } + else if (i == 1) + { + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &ipv4_lo, + NX_LOOPBACK_INTERFACE, NX_IP_RAW >> 16, 255, NX_IP_NORMAL); + } +#ifdef FEATURE_NX_IPV6 + else + { + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &ipv6_addr, + 0, NX_IP_RAW >> 16, 255, NX_IP_NORMAL); + } +#endif + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_loopback_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Loopback Test......................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_raw_packet_filter_test.c b/test/regression/netxduo_test/netx_ip_raw_packet_filter_test.c new file mode 100644 index 00000000..ebd9d43e --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_raw_packet_filter_test.c @@ -0,0 +1,265 @@ +/* This NetX test concentrates on the raw packet IPv6 send/receive operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(NX_ENABLE_IP_RAW_PACKET_FILTER) && !defined(NX_DISABLE_IPV4) +#include "nx_tcp.h" +#include "nx_udp.h" + +#define DEMO_STACK_SIZE 2048 + +#ifdef NX_ENABLE_IP_RAW_PACKET_ALL_STACK +#define PROTOCOL NX_PROTOCOL_ICMP +#else +#define PROTOCOL 0x99 +#endif + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static UINT flag; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT my_raw_packet_filter(NX_IP *ip_ptr, ULONG protocol, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_packet_filter_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + flag = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status != NX_SUCCESS) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable UDP for IP instances. */ + status = nx_udp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&ip_1); + if(status) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG value; + + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Packet Filter Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Set the filter. */ + status = nx_ip_raw_packet_filter_set(&ip_0, my_raw_packet_filter); + if(status != NX_SUCCESS) + error_counter++; + + /* Let filter been called. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + if (flag != 1) + { + + /* Expect packet received. */ + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG value; +NXD_ADDRESS dest_addr; + + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 9); + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Send the raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_1, my_packet, &dest_addr, 0, PROTOCOL, 0x80, NX_IP_NORMAL); + if (status != NX_SUCCESS) + error_counter++; + + /* Send again. */ + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Send the second raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_1, my_packet, &dest_addr, 0, PROTOCOL, 0x80, NX_IP_NORMAL); + if (status != NX_SUCCESS) + error_counter++; + +} + +static UINT my_raw_packet_filter(NX_IP *ip_ptr, ULONG protocol, NX_PACKET *packet_ptr) +{ + if (protocol != PROTOCOL) + { + error_counter++; + } + if (memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", packet_ptr -> nx_packet_length)) + { + error_counter++; + } + if (flag == 0) + { + flag++; + return NX_SUCCESS; + } + else + { + /* In order to test code in _nx_ip_raw_packet_processing. */ + return 123; + } + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_packet_filter_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Raw Packet Filter Test.................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_raw_packet_queue_test.c b/test/regression/netxduo_test/netx_ip_raw_packet_queue_test.c new file mode 100644 index 00000000..a5f33b0c --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_raw_packet_queue_test.c @@ -0,0 +1,252 @@ +/* This NetX test concentrates on the raw packet IPv6 send/receive operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_packet_queue_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status != NX_SUCCESS) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable UDP for IP instances. */ + status = nx_udp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&ip_1); + if(status) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG value; +NX_PACKET *my_packet; +UINT i; + + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Packet Queue Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Set queue size to 2. */ + status = nx_ip_raw_receive_queue_max_set(&ip_0, 2); + if(status != NX_SUCCESS) + error_counter++; + + /* Let thread 1 to send 3 packets. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Receive 2 packets. */ + i = 0; + while(i < 2) + { + i++; + + /* Receive the second packet. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + } + + /* Because the queue size is 2, the 3rd packet can't be received. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + + if (status != NX_NO_PACKET) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG value; +UINT i; + + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + i = 0; + while(i < 2) + { + i++; + + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the second raw IP packet. */ + status = nx_ip_raw_packet_send(&ip_1, my_packet, IP_ADDRESS(1, 2, 3, 9), NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_packet_queue_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Packet Queue Test..................................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_ip_raw_packet_test.c b/test/regression/netxduo_test/netx_ip_raw_packet_test.c new file mode 100644 index 00000000..7e2db158 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_raw_packet_test.c @@ -0,0 +1,557 @@ +/* This NetX test concentrates on the raw packet IP send/receive operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *ip_0_memory_ptr; +static CHAR *ip_1_memory_ptr; +static CHAR *arp_0_memory_ptr; +static CHAR *arp_1_memory_ptr; +static NX_TCP_SOCKET tcp_server_socket; +static NX_TCP_SOCKET tcp_client_socket; +static NX_UDP_SOCKET udp_server_socket; +static NX_UDP_SOCKET udp_client_socket; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ip_0_memory_ptr = NX_NULL; + ip_1_memory_ptr = NX_NULL; + arp_0_memory_ptr = NX_NULL; + arp_1_memory_ptr = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create IP instances. */ + ip_0_memory_ptr = pointer; + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + ip_1_memory_ptr = pointer; + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + arp_0_memory_ptr = pointer; + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + arp_1_memory_ptr = pointer; + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + +#ifndef NX_DISABLE_FRAGMENTATION +static UCHAR buff[256]; +#endif /* NX_DISABLE_FRAGMENTATION */ + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +ULONG mask; +ULONG value; +ULONG ip_total_packets_sent; +ULONG ip_total_bytes_sent; +ULONG ip_total_packets_received; +ULONG ip_total_bytes_received; +ULONG ip_invalid_packets; +ULONG ip_receive_packets_dropped; +ULONG ip_receive_checksum_errors; +ULONG ip_send_packets_dropped; +ULONG ip_total_fragments_sent; +ULONG ip_total_fragments_received; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Packet Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the IP address. */ + status = nx_ip_address_get(&ip_0, &ip_address, &mask); + + /* Check for an error. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 9))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address. */ + status = nx_ip_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 13), 0xFFFFFF00UL); + status += nx_ip_address_get(&ip_0, &ip_address, &mask); + + /* Check for an error. */ + if ((status) || (ip_address != IP_ADDRESS(1, 2, 3, 13))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete both IP instances. */ + status = nx_ip_delete(&ip_0); + status += nx_ip_delete(&ip_1); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_0_memory_ptr, 2048, 1); + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + ip_1_memory_ptr, 2048, 1); + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_0, (void *) arp_0_memory_ptr, 1024); + status += nx_arp_enable(&ip_1, (void *) arp_1_memory_ptr, 1024); + + /* Enable TCP for IP instances. */ + status += nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable UDP for IP instances. */ + status += nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check the status of the IP instances. */ + status += nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call driver directly. */ + status = nx_ip_driver_direct_command(&ip_0, NX_LINK_GET_STATUS, &value); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable and disable forwarding. */ + status = nx_ip_forwarding_enable(&ip_0); + status += nx_ip_forwarding_disable(&ip_0); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_FRAGMENTATION + /* Enable and disable fragmenting. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_disable(&ip_0); + status += nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + status += nx_ip_fragment_disable(&ip_1); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set the gateway address. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 87)); + + /* Check for an error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get IP info. */ + status = nx_ip_info_get(&ip_0, &ip_total_packets_sent, + &ip_total_bytes_sent, + &ip_total_packets_received, + &ip_total_bytes_received, + &ip_invalid_packets, + &ip_receive_packets_dropped, + &ip_receive_checksum_errors, + &ip_send_packets_dropped, + &ip_total_fragments_sent, + &ip_total_fragments_received); + + /* Check status. */ + if ((status) || (ip_total_packets_sent) || (ip_total_bytes_sent) || (ip_total_packets_received) || + (ip_total_bytes_received) || (ip_invalid_packets) || (ip_receive_packets_dropped) || (ip_receive_checksum_errors) || + (ip_send_packets_dropped) || (ip_total_fragments_sent) || (ip_total_fragments_received)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable raw IP packet sending and receiving. This can only be done between two NetX nodes. */ + status = nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + +#ifndef NX_DISABLE_FRAGMENTATION + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Write ABCs into the packet payload! */ + status += nx_packet_data_append(my_packet, buff, sizeof(buff), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the raw IP packet. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_FRAGMENTATION */ + + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + +#ifdef __PRODUCT_NETXDUO__ + /* Send the second raw IP packet. */ + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); +#else + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); +#endif /* __PRODUCT_NETXDUO__ */ + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the third raw IP packet. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_FRAGMENTATION + /* Now, pickup the three raw packets that should be queued on the other IP instance. */ + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, NX_IP_PERIODIC_RATE); + status += nx_packet_release(my_packet); + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_FRAGMENTATION */ + + /* Receive the second packet. */ + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, NX_IP_PERIODIC_RATE); + status += nx_packet_release(my_packet); + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive the third packet. */ + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, NX_IP_PERIODIC_RATE); + status += nx_packet_release(my_packet); + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to receive a packet on an empty queue.... should be an error. */ + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_NO_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check TCP connection when raw packet is enabled. */ + /* Create a server socket. */ + status = nx_tcp_socket_create(&ip_1, &tcp_server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Setup this thread to listen. */ + status += nx_tcp_server_socket_listen(&ip_1, 12, &tcp_server_socket, 5, NX_NULL); + + /* Create a client socket. */ + status += nx_tcp_socket_create(&ip_0, &tcp_client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Bind the socket. */ + status += nx_tcp_client_socket_bind(&tcp_client_socket, 12, NX_WAIT_FOREVER); + + /* Connect to server. */ + nx_tcp_client_socket_connect(&tcp_client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* If accept return successfully, then it handles an illegal option length for MSS. */ + status += nx_tcp_server_socket_accept(&tcp_server_socket, NX_IP_PERIODIC_RATE); + + /* Check if client is in establish state. */ + status += nx_tcp_socket_state_wait(&tcp_client_socket, NX_TCP_ESTABLISHED, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Append data. */ + status += nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_NO_WAIT); + + /* Send a packet from server to client. */ + status += nx_tcp_socket_send(&tcp_server_socket, my_packet, NX_NO_WAIT); + + /* Receive packet from server. */ + status += nx_tcp_socket_receive(&tcp_client_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status and received data. */ + if(status || memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + status++; + + /* Release packet. */ + status += nx_packet_release(my_packet); + + /* Disconnect. */ + nx_tcp_socket_disconnect(&tcp_server_socket, NX_NO_WAIT); + nx_tcp_socket_disconnect(&tcp_client_socket, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&tcp_server_socket); + + /* Check if both sockets are closed. */ + status += nx_tcp_socket_state_wait(&tcp_client_socket, NX_TCP_CLOSED, NX_NO_WAIT); + status += nx_tcp_socket_state_wait(&tcp_client_socket, NX_TCP_CLOSED, NX_NO_WAIT); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check UDP connection when raw packet is enabled. */ + /* Create two UDP sockets. */ + status = nx_udp_socket_create(&ip_0, &udp_client_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + status += nx_udp_socket_create(&ip_1, &udp_server_socket, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to the IP port. */ + status += nx_udp_socket_bind(&udp_client_socket, 0x89, NX_NO_WAIT); + status += nx_udp_socket_bind(&udp_server_socket, 0x89, NX_NO_WAIT); + + /* Allocate a packet. */ + status += nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Append data. */ + status += nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_NO_WAIT); + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&udp_client_socket, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Receive a UDP packet. */ + status += nx_udp_socket_receive(&udp_server_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status and received data. */ + if(status || memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + status++; + + /* Unbind the UDP socket. */ + status += nx_udp_socket_unbind(&udp_client_socket); + status += nx_udp_socket_unbind(&udp_server_socket); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Disable the raw IP capability on both IP instances. */ + status = nx_ip_raw_packet_disable(&ip_0); + status += nx_ip_raw_packet_disable(&ip_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_raw_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Packet Test........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_ip_route_reachable_test.c b/test/regression/netxduo_test/netx_ip_route_reachable_test.c new file mode 100644 index 00000000..42c701a9 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_route_reachable_test.c @@ -0,0 +1,181 @@ +/* This NetX test concentrates on route reachable. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_route_reachable_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing. */ + status = nx_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: IP Route Reachable Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup gateway. */ + status = nx_ip_gateway_address_set(&ip_0, IP_ADDRESS(1, 2, 3, 1)); + + if (status) + error_counter++; + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + /* Add static routing. */ + status = nx_ip_static_route_add(&ip_0, IP_ADDRESS(3, 2, 3, 0), 0xFFFFFF00, IP_ADDRESS(1, 2, 3, 2)); + + if (status) + error_counter++; +#endif /* NX_ENABLE_IP_STATIC_ROUTING */ + + /* Now ping out of network address through gateway without waiting. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_NO_WAIT); + + if (status != NX_NO_RESPONSE) + error_counter++; + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + /* Now ping out of network address through static route without waiting. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(3, 2, 3, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_NO_WAIT); + + if (status != NX_NO_RESPONSE) + error_counter++; +#endif /* NX_ENABLE_IP_STATIC_ROUTING */ + + /* Now set the address to other network. */ + status = nx_ip_interface_address_set(&ip_0, 0, IP_ADDRESS(1, 3, 3, 4), 0xFFFFFF00); + + if (status) + error_counter++; + + /* Now ping out of network address through gateway without waiting. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_NO_WAIT); + + if (status != NX_IP_ADDRESS_ERROR) + error_counter++; + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + /* Now ping out of network address through static route without waiting. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(3, 2, 3, 1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_NO_WAIT); + + if (status != NX_IP_ADDRESS_ERROR) + error_counter++; +#endif /* NX_ENABLE_IP_STATIC_ROUTING */ + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_route_reachable_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Route Reachable Test...................................N/A\n"); + + test_control_return(3); + +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_ip_static_route_add_test.c b/test/regression/netxduo_test/netx_ip_static_route_add_test.c new file mode 100644 index 00000000..319e8680 --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_static_route_add_test.c @@ -0,0 +1,184 @@ +/* This NetX test concentrates on the IP Static Route Add operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_static_route_add_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +#ifdef NX_ENABLE_IP_STATIC_ROUTING +UINT i; +ULONG network_address; +ULONG network_mask; +ULONG next_hop_address; +#endif + + /* Print out test information banner. */ + printf("NetX Test: IP Static Route Add Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the gateway address with another network address. */ + status = nx_ip_static_route_add(&ip_0, IP_ADDRESS(2, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0), IP_ADDRESS(2, 2, 3, 1)); + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + /* Check the status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + /* Check the status. */ + if (status != NX_NOT_SUPPORTED) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef NX_ENABLE_IP_STATIC_ROUTING + + /* Set the network_address, networ_mask and next_hop_address. */ + network_address = IP_ADDRESS(2, 2, 3, 4); + network_mask = IP_ADDRESS(255, 255, 0, 0); + next_hop_address = IP_ADDRESS(1, 2, 3, 4); + + /* Loop to add the static route. */ + for (i = 0; i < NX_IP_ROUTING_TABLE_SIZE; i++) + { + + /* Add the static route. */ + status = nx_ip_static_route_add(&ip_0, network_address, network_mask, next_hop_address); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the network_address. */ + network_address += 0x00010000; + } + + /* Update the network_mask. */ + network_mask = IP_ADDRESS(255, 254, 0, 0); + + /* Add the static route with larger nets when the table is full. */ + status = nx_ip_static_route_add(&ip_0, network_address, network_mask, next_hop_address); + + /* Check the status. */ + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the network_mask. */ + network_mask = IP_ADDRESS(255, 255, 255, 0); + + /* Add the static route with small nets when the table is full. */ + status = nx_ip_static_route_add(&ip_0, network_address, network_mask, next_hop_address); + + /* Check the status. */ + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_static_route_add_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP Static Route Add Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_static_route_delete_test.c b/test/regression/netxduo_test/netx_ip_static_route_delete_test.c new file mode 100644 index 00000000..ad63eb9c --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_static_route_delete_test.c @@ -0,0 +1,144 @@ +/* This NetX test concentrates on the IP Static Route Delete operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(NX_ENABLE_IP_STATIC_ROUTING) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_static_route_delete_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: IP Static Route Delete Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add the static route. */ + status = nx_ip_static_route_add(&ip_0, IP_ADDRESS(2, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0), IP_ADDRESS(1, 2, 3, 5)); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the inexistent static route. */ + status = nx_ip_static_route_delete(&ip_0, IP_ADDRESS(3, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check the status. */ + if (status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the existent static route. */ + status = nx_ip_static_route_delete(&ip_0, IP_ADDRESS(2, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the static route when the entry count is zero. */ + status = nx_ip_static_route_delete(&ip_0, IP_ADDRESS(2, 2, 3, 4), IP_ADDRESS(255, 255, 255, 0)); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_static_route_delete_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Static Route Delete Test...............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_static_route_find_test.c b/test/regression/netxduo_test/netx_ip_static_route_find_test.c new file mode 100644 index 00000000..775401db --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_static_route_find_test.c @@ -0,0 +1,216 @@ +/* This NetX test concentrates on the IP Static Route Find operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined (__PRODUCT_NETXDUO__) && defined (NX_ENABLE_IP_STATIC_ROUTING) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ +static ULONG error_counter; +static ULONG icmp_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_static_route_find_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG return_value; + + + /* Print out test information banner. */ + printf("NetX Test: IP Static Route Find Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the gateway address with another network address. */ + status = nx_ip_static_route_add(&ip_0, IP_ADDRESS(2, 2, 3, 5), IP_ADDRESS(255, 255, 255, 0), IP_ADDRESS(1, 2, 3, 5)); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function to get the IPv4 packet. */ + ip_1.nx_ipv4_packet_receive = my_packet_process; + + /* Ping an IP address in another network. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_NO_RESPONSE) || (my_packet) || (icmp_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link status from up to down. */ + status = nx_ip_driver_interface_direct_command(&ip_0, NX_LINK_DISABLE, 0, &return_value); + + /* Check for earlier error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address in another network again. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(2, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the timeout error occurred. */ + if ((status != NX_IP_ADDRESS_ERROR) || (my_packet) || (icmp_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +ULONG protocol; + + /* Ignore packet that is not ICMP. */ + if(packet_ptr -> nx_packet_length >= 28) + { + + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + + /* Is ICMP packet? */ + if(protocol == 1) + { + + /* Yes it is. Update the counter. */ + icmp_counter ++; + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + } + + /* Call the _nx_ipv4_packet_receive function directly receive this packet. */ + _nx_ipv4_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_static_route_find_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Static Route Find Test.................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ip_status_check_test.c b/test/regression/netxduo_test/netx_ip_status_check_test.c new file mode 100644 index 00000000..07ce43fc --- /dev/null +++ b/test/regression/netxduo_test/netx_ip_status_check_test.c @@ -0,0 +1,198 @@ +/* This NetX test concentrates on the raw packet IPv6 send/receive operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#include "nx_tcp.h" +#include "nx_udp.h" + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_status_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status != NX_SUCCESS) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable UDP for IP instances. */ + status = nx_udp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Enable TCP for IP instances. */ + status = nx_tcp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Enable IGMP for IP instances. */ + status = nx_igmp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG value; + + + /* Print out test information banner. */ + printf("NetX Test: IP status Check Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_LINK_ENABLED)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_ARP_ENABLED, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_ARP_ENABLED)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_UDP_ENABLED, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_UDP_ENABLED)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_TCP_ENABLED, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_TCP_ENABLED)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_IGMP_ENABLED, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_IGMP_ENABLED)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_RARP_COMPLETE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_RARP_COMPLETE)) + error_counter++; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_INTERFACE_LINK_ENABLED, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INTERFACE_LINK_ENABLED)) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ip_status_check_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IP status Check Test......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_ipv4_option_process_test.c b/test/regression/netxduo_test/netx_ipv4_option_process_test.c new file mode 100644 index 00000000..5e1b14f4 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv4_option_process_test.c @@ -0,0 +1,523 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG icmp_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv4_option_process_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: IPv4 Option Process Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + packet_process_callback = my_packet_process; + + /* Test NX_IP_OPTION_NO_OPERATION and NX_IP_OPTION_END option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Test illegal length of NX_IP_OPTION_INTERNET_TIMESTAMP option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test two NX_IP_OPTION_INTERNET_TIMESTAMP options by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test illegal offset of NX_IP_OPTION_INTERNET_TIMESTAMP option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test illegal overflow NX_IP_OPTION_INTERNET_TIMESTAMP option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test illegal flags of NX_IP_OPTION_INTERNET_TIMESTAMP option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test illegal option length of Stream Identifier option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test illegal option length of Stream Identifier option by ping. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_NO_RESPONSE) || (my_packet)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV4_HEADER *ip_header_ptr; +NX_ICMP_HEADER *icmp_header_ptr; +ULONG ip_header_length; +ULONG protocol; +ULONG checksum; +ULONG val; +ULONG offset; +ULONG shift; +ULONG message_word; + + /* Get the IP header pointer. */ + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Get IP header. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 16) & 0xFF; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_2); + + /* Modify the ICMP packet from ip_0 instance. */ + if((protocol == NX_PROTOCOL_ICMP) && (ip_ptr == &ip_0)) + { + + /* Update the icmp_counter. */ + icmp_counter++; + + /* Get the IP header pointer. */ + ip_header_ptr = (NX_IPV4_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the IPv4 option length. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + ip_header_length = ((ip_header_ptr -> nx_ip_header_word_0 & NX_IP_LENGTH_MASK) >> 24) * sizeof(ULONG); + + /* Get ICMP header. */ + icmp_header_ptr = (NX_ICMP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + ip_header_length); + + /* Add the NX_IP_OPTION_NO_OPERATION and NX_IP_OPTION_END option. */ + if (icmp_counter == 1) + { + + /* Move the data to add the option. */ + offset = 4; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add NX_IP_OPTION_NO_OPERATION and NX_IP_OPTION_END. */ + message_word = (ULONG)((NX_IP_OPTION_NO_OPERATION << 24) | (NX_IP_OPTION_END << 16)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Copy the option into the buffer. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + } + + /* Add the two NX_IP_OPTION_INTERNET_TIMESTAMP options. */ + else if (icmp_counter == 2) + { + + /* Move the data to add the option. */ + offset = 24; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Add the first option. */ + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (12 << 16) | (5 << 8)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , 12 - sizeof(ULONG)); + + /* Add the second option. */ + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (12 << 16) | (5 << 8)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(((UCHAR *)icmp_header_ptr) + 12, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + 12 + sizeof(ULONG), 0 , 12 - sizeof(ULONG)); + } + + /* Add the illegal length 7 for NX_IP_OPTION_INTERNET_TIMESTAMP option. */ + else if (icmp_counter == 3) + { + + /* Move the data to add the option. */ + offset = 12; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (7 << 16) | (5 << 8) ); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , offset - sizeof(ULONG)); + } + + /* Add the illegal offset 4 for NX_IP_OPTION_INTERNET_TIMESTAMP option. */ + else if (icmp_counter == 4) + { + + /* Move the data to add the option. */ + offset = 12; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (12 << 16) | (4 << 8) ); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , offset - sizeof(ULONG)); + } + + /* Add the illegal overflow 15 for NX_IP_OPTION_INTERNET_TIMESTAMP option. */ + else if (icmp_counter == 5) + { + + /* Move the data to add the option. */ + offset = 12; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (12 << 16) | (5 << 8) | (15 << 4)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , offset - sizeof(ULONG)); + } + + /* Add the illegal flags 5 for NX_IP_OPTION_INTERNET_TIMESTAMP option. */ + else if (icmp_counter == 6) + { + + /* Move the data to add the option. */ + offset = 12; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((NX_IP_OPTION_INTERNET_TIMESTAMP << 24) | (12 << 16) | (5 << 8) | (5)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + + /* Clear the time stamp value. */ + memset(((UCHAR *)(icmp_header_ptr)) + sizeof(ULONG), 0 , offset - sizeof(ULONG)); + } + + /* Add the illegal length 0 of Stream Identifier option. */ + else if (icmp_counter == 7) + { + + /* Move the data to add the option. */ + offset = 4; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((136 << 24) | (0 << 16)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + } + + /* Add the illegal length 5 of Stream Identifier option. */ + else if (icmp_counter == 8) + { + + /* Move the data to add the option. */ + offset = 4; + shift = packet_ptr -> nx_packet_length - ip_header_length; + memmove(((UCHAR *)(icmp_header_ptr)) + offset, icmp_header_ptr, shift); + + /* Clear memory. */ + memset(&message_word, 0, sizeof(ULONG)); + + /* Add type, length, offset, overflw and flags. */ + message_word = (ULONG)((136 << 24) | (5 << 16)); + + /* Adjust for endianness. */ + NX_CHANGE_ULONG_ENDIAN(message_word); + + /* Add type, length, offset, overflw and flags. */ + memcpy(icmp_header_ptr, &message_word, sizeof(ULONG)); + } + + /* Update the header IP length and total length. */ + ip_header_length += offset; + packet_ptr -> nx_packet_append_ptr += offset; + packet_ptr -> nx_packet_length += offset; + + /* Rebuild the first 32-bit word of the IP header. */ + ip_header_ptr -> nx_ip_header_word_0 = (ULONG)((NX_IP_VERSION_V4 << 28) | + ((ip_header_length/sizeof(ULONG)) << 24) | + NX_IP_NORMAL | + (0xFFFF & packet_ptr -> nx_packet_length)); + + /* Endian swapping logic. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_0); + + /* Clear the checksum . */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 & 0x0000FFFF; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* Length is the size of IP header, including options */ + (UINT)(ip_header_length), + /* IPv4 header checksum does not use src/dest addresses */ + NULL, NULL); + + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + + return NX_TRUE; +} + +#else + +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv4_option_process_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IPv4 Option Process Test..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_address_delete_test.c b/test/regression/netxduo_test/netx_ipv6_address_delete_test.c new file mode 100644 index 00000000..f792f6f8 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_address_delete_test.c @@ -0,0 +1,373 @@ +/* This test case validates nxd_ipv6_address_delete. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS if0_lla; +static NXD_ADDRESS if1_lla; +static NXD_ADDRESS if0_ga0; +static NXD_ADDRESS if0_ga1; +static NXD_ADDRESS if0_ga2; +static NXD_ADDRESS if1_ga0; +static NXD_ADDRESS if1_ga1; +static NXD_ADDRESS if1_ga2; +static NXD_ADDRESS if1_ga3; +static NXD_ADDRESS if2_ga0; +static UINT if0_lla_index; +static UINT if0_ga0_index; +static UINT if0_ga1_index; +static UINT if0_ga2_index; +static UINT if1_ga0_index; +static UINT if1_ga1_index; + #ifndef NX_DISABLE_ERROR_CHECKING +static UINT if1_ga3_index; +static UINT if2_ga0_index; +#endif /* NX_DISABLE_ERROR_CHECKING */ + + +#define PRIMARY_INTERFACE 0 +#define SECONDARY_INTERFACE 1 + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); + +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_address_delete_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set up IF0 LLA. */ + if0_lla.nxd_ip_version = NX_IP_VERSION_V6; + if0_lla.nxd_ip_address.v6[0] = 0xFE800000; + if0_lla.nxd_ip_address.v6[1] = 0x00000000; + if0_lla.nxd_ip_address.v6[2] = 0x00000000; + if0_lla.nxd_ip_address.v6[3] = 0x00000001; + + /* Set up IF1 LLA. */ + if1_lla.nxd_ip_version = NX_IP_VERSION_V6; + if1_lla.nxd_ip_address.v6[0] = 0xFE800000; + if1_lla.nxd_ip_address.v6[1] = 0x00000000; + if1_lla.nxd_ip_address.v6[2] = 0x00000000; + if1_lla.nxd_ip_address.v6[3] = 0x00000002; + + /* Set up IF0 GA0 */ + if0_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga0.nxd_ip_address.v6[0] = 0x20010000; + if0_ga0.nxd_ip_address.v6[1] = 0x00000000; + if0_ga0.nxd_ip_address.v6[2] = 0x00000000; + if0_ga0.nxd_ip_address.v6[3] = 0x00010001; + + /* Set up IF0 GA1 */ + if0_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga1.nxd_ip_address.v6[0] = 0x20010000; + if0_ga1.nxd_ip_address.v6[1] = 0x00000000; + if0_ga1.nxd_ip_address.v6[2] = 0x00000000; + if0_ga1.nxd_ip_address.v6[3] = 0x00010002; + + /* Set up IF0 GA2 */ + if0_ga2.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga2.nxd_ip_address.v6[0] = 0x20010000; + if0_ga2.nxd_ip_address.v6[1] = 0x00000000; + if0_ga2.nxd_ip_address.v6[2] = 0x00000000; + if0_ga2.nxd_ip_address.v6[3] = 0x00010003; + + /* Set up IF1 GA0 */ + if1_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga0.nxd_ip_address.v6[0] = 0x20010000; + if1_ga0.nxd_ip_address.v6[1] = 0x00000000; + if1_ga0.nxd_ip_address.v6[2] = 0x00000000; + if1_ga0.nxd_ip_address.v6[3] = 0x00020001; + + /* Set up IF1 GA1 */ + if1_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga1.nxd_ip_address.v6[0] = 0x20010000; + if1_ga1.nxd_ip_address.v6[1] = 0x00000000; + if1_ga1.nxd_ip_address.v6[2] = 0x00000000; + if1_ga1.nxd_ip_address.v6[3] = 0x00020002; + + /* Set up IF1 GA2 */ + if1_ga2.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga2.nxd_ip_address.v6[0] = 0x20010000; + if1_ga2.nxd_ip_address.v6[1] = 0x00000000; + if1_ga2.nxd_ip_address.v6[2] = 0x00000000; + if1_ga2.nxd_ip_address.v6[3] = 0x00020003; + + /* Set up IF1 GA3 */ + if1_ga3.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga3.nxd_ip_address.v6[0] = 0x20010000; + if1_ga3.nxd_ip_address.v6[1] = 0x00000000; + if1_ga3.nxd_ip_address.v6[2] = 0x00000000; + if1_ga3.nxd_ip_address.v6[3] = 0x00020004; + + /* Set up IF2 GA0 */ + if2_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if2_ga0.nxd_ip_address.v6[0] = 0x20010000; + if2_ga0.nxd_ip_address.v6[1] = 0x00000000; + if2_ga0.nxd_ip_address.v6[2] = 0x00000000; + if2_ga0.nxd_ip_address.v6[3] = 0x00030001; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + UINT i; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Address Delete Test ................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach two more interface. */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", 0x02010101, 0xFFFFFF00, _nx_ram_network_driver_1500); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address0 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_lla, 64, &if0_lla_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address0 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga0, 64, &if0_ga0_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga1, 64, &if0_ga1_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address2 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga2, 64, &if0_ga2_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address0 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga0, 64, &if1_ga0_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga1, 64, &if1_ga1_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + #ifndef NX_DISABLE_ERROR_CHECKING + /* This assumes the max entry of IPv6 address is 6. */ + if(NX_MAX_IPV6_ADDRESSES == 6) + { + + /* Set Global address3 on the 2nd interface. This one should fail.*/ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga3, 64, &if1_ga3_index); + if(status != NX_NO_MORE_ENTRIES) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* This assumes the max physical interface is 2. */ + if(NX_MAX_PHYSICAL_INTERFACES == 2) + { + + /* Set global address0 on the 3rd interface. This one should fail. */ + status = nxd_ipv6_address_set(&ip_0, 2, &if2_ga0, 64, &if2_ga0_index); + if(status != NX_INVALID_INTERFACE) + { + test_control_return(1); + } + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + + /* Verify the IP addresses just set. */ + if((!CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_address[if0_lla_index].nxd_ipv6_address, if0_lla.nxd_ip_address.v6)) || + (!CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_address[if0_ga0_index].nxd_ipv6_address, if0_ga0.nxd_ip_address.v6)) || + (!CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_address[if0_ga1_index].nxd_ipv6_address, if0_ga1.nxd_ip_address.v6)) || + (!CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_address[if0_ga2_index].nxd_ipv6_address, if0_ga2.nxd_ip_address.v6)) || + (!CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_address[if1_ga0_index].nxd_ipv6_address, if1_ga0.nxd_ip_address.v6)) || + (!CHECK_IPV6_ADDRESSES_SAME(ip_0.nx_ipv6_address[if1_ga1_index].nxd_ipv6_address, if1_ga1.nxd_ip_address.v6))) + + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete all IPv6 addresses on IF0 */ + status = nxd_ipv6_address_delete(&ip_0, if0_lla_index); + status += nxd_ipv6_address_delete(&ip_0, if0_ga0_index); + status += nxd_ipv6_address_delete(&ip_0, if0_ga1_index); + status += nxd_ipv6_address_delete(&ip_0, if0_ga2_index); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure there are no IPv6 addresses on IF0 */ + if(ip_0.nx_ip_interface[PRIMARY_INTERFACE].nxd_interface_ipv6_address_list_head) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete all IPv6 address on IF1 */ + status = nxd_ipv6_address_delete(&ip_0, if1_ga0_index); + status += nxd_ipv6_address_delete(&ip_0, if1_ga1_index); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure there are no IPv6 addresses on IF0 */ + if(ip_0.nx_ip_interface[SECONDARY_INTERFACE].nxd_interface_ipv6_address_list_head) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + if(ip_0.nx_ipv6_address[0].nxd_ipv6_address_valid || ip_0.nx_ipv6_address[1].nxd_ipv6_address_valid || ip_0.nx_ipv6_address[2].nxd_ipv6_address_valid || + ip_0.nx_ipv6_address[3].nxd_ipv6_address_valid || ip_0.nx_ipv6_address[4].nxd_ipv6_address_valid || ip_0.nx_ipv6_address[5].nxd_ipv6_address_valid || + (ip_0.nx_ip_interface[PRIMARY_INTERFACE].nxd_interface_ipv6_address_list_head != NX_NULL)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the 1nd address on the 2nd interface */ + for(i = 0; i < NX_MAX_IPV6_ADDRESSES; i++) + { + status = nxd_ipv6_address_delete(&ip_0, i); + + if(status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nxd_ipv6_address_delete(&ip_0, NX_MAX_IPV6_ADDRESSES); + if(status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_address_delete_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Address Delete Test .................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_address_get_test.c b/test/regression/netxduo_test/netx_ipv6_address_get_test.c new file mode 100644 index 00000000..1c05cba5 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_address_get_test.c @@ -0,0 +1,237 @@ +/* This test case validates nxd_ipv6_address_set. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG notify_counter; + +static NXD_ADDRESS if0_ga0; +static NXD_ADDRESS if0_ga1; + +#define PRIMARY_INTERFACE 0 + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static void my_ipv6_addrress_change_notify(NX_IP *ip_tr, UINT type, UINT interface_index, UINT addr_index, ULONG *addr_ptr); +#endif + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_address_get_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + notify_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set up IF0 GA0 */ + if0_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga0.nxd_ip_address.v6[0] = 0x20010000; + if0_ga0.nxd_ip_address.v6[1] = 0x00000000; + if0_ga0.nxd_ip_address.v6[2] = 0x00000000; + if0_ga0.nxd_ip_address.v6[3] = 0x00010001; + + /* Set up IF0 GA1 */ + if0_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga1.nxd_ip_address.v6[0] = 0x20010000; + if0_ga1.nxd_ip_address.v6[1] = 0x00000000; + if0_ga1.nxd_ip_address.v6[2] = 0x00000000; + if0_ga1.nxd_ip_address.v6[3] = 0x00010002; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; + +ULONG prefix_length; +UINT interface_index; +NXD_ADDRESS ipv6_addr; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Address Get Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + status = nxd_ipv6_address_change_notify(&ip_0, my_ipv6_addrress_change_notify); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Set Global address0 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga0, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga1, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + status = nxd_ipv6_address_get(&ip_0, 0, &ipv6_addr, &prefix_length, &interface_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if((ipv6_addr.nxd_ip_version != NX_IP_VERSION_V6) || + (ipv6_addr.nxd_ip_address.v6[0] != 0x20010000) || + (ipv6_addr.nxd_ip_address.v6[1] != 0x0) || + (ipv6_addr.nxd_ip_address.v6[2] != 0x0) || + (ipv6_addr.nxd_ip_address.v6[3] != 0x00010001)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 1, &ipv6_addr, &prefix_length, &interface_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if((ipv6_addr.nxd_ip_version != NX_IP_VERSION_V6) || + (ipv6_addr.nxd_ip_address.v6[0] != 0x20010000) || + (ipv6_addr.nxd_ip_address.v6[1] != 0x0) || + (ipv6_addr.nxd_ip_address.v6[2] != 0x0) || + (ipv6_addr.nxd_ip_address.v6[3] != 0x00010002)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 2, &ipv6_addr, &prefix_length, &interface_index); + if(status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable IPv6 */ + status = nxd_ipv6_disable(&ip_0); + + /* notify counter should be 4, ipv6_address_set (ip_0, ip_1), DAD (ip_0, ip_1) calls. */ + if((status != NX_SUCCESS) +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + || (notify_counter != 4) +#endif + ) + { + printf("ERROR!\n"); + test_control_return(1); + + } + + printf("SUCCESS!\n"); + test_control_return(0); + +} + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static void my_ipv6_addrress_change_notify(NX_IP *ip_tr, UINT type, UINT interface_index, UINT addr_index, ULONG *addr_ptr) +{ + notify_counter++; +} +#endif + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_address_get_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Address Get Test.....................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_address_set_test.c b/test/regression/netxduo_test/netx_ipv6_address_set_test.c new file mode 100644 index 00000000..b0990346 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_address_set_test.c @@ -0,0 +1,693 @@ +/* This test case validates nxd_ipv6_address_set. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +#ifndef NX_DISABLE_ERROR_CHECKING +static NXD_ADDRESS multicast_addr; +#endif /* NX_DISABLE_ERROR_CHECKING */ +static NXD_ADDRESS if0_lla; +static NXD_ADDRESS if1_lla; +static NXD_ADDRESS if0_ga0; +static NXD_ADDRESS if0_ga1; +static NXD_ADDRESS if0_ga2; +static NXD_ADDRESS if0_gax; +static NXD_ADDRESS if1_ga0; +static NXD_ADDRESS if1_ga1; +static NXD_ADDRESS if1_ga2; +static NXD_ADDRESS if1_ga3; +static NXD_ADDRESS if2_ga0; + +static int if0_lla_check; +static int if0_ga1_check; +static int if0_ga2_check; +static int if1_ga0_check; +static int if1_ga1_check; +static int if1_ga2_check; + +static NXD_ADDRESS if_addr; + +#define PRIMARY_INTERFACE 0 +#define SECONDARY_INTERFACE 1 + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_address_set_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set up IF0 LLA. */ + if0_lla.nxd_ip_version = NX_IP_VERSION_V6; + if0_lla.nxd_ip_address.v6[0] = 0xFE800000; + if0_lla.nxd_ip_address.v6[1] = 0x00000000; + if0_lla.nxd_ip_address.v6[2] = 0x00000000; + if0_lla.nxd_ip_address.v6[3] = 0x00000001; + + /* Set up IF1 LLA. */ + if1_lla.nxd_ip_version = NX_IP_VERSION_V6; + if1_lla.nxd_ip_address.v6[0] = 0xFE800000; + if1_lla.nxd_ip_address.v6[1] = 0x00000000; + if1_lla.nxd_ip_address.v6[2] = 0x00000000; + if1_lla.nxd_ip_address.v6[3] = 0x00000002; + + /* Set up IF0 GA0 */ + if0_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga0.nxd_ip_address.v6[0] = 0x20010000; + if0_ga0.nxd_ip_address.v6[1] = 0x00000000; + if0_ga0.nxd_ip_address.v6[2] = 0x00000000; + if0_ga0.nxd_ip_address.v6[3] = 0x00010001; + + /* Set up IF0 GA1 */ + if0_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga1.nxd_ip_address.v6[0] = 0x20010000; + if0_ga1.nxd_ip_address.v6[1] = 0x00000000; + if0_ga1.nxd_ip_address.v6[2] = 0x00000000; + if0_ga1.nxd_ip_address.v6[3] = 0x00010002; + + /* Set up IF0 GA2 */ + if0_ga2.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga2.nxd_ip_address.v6[0] = 0x20010000; + if0_ga2.nxd_ip_address.v6[1] = 0x00000000; + if0_ga2.nxd_ip_address.v6[2] = 0x00000000; + if0_ga2.nxd_ip_address.v6[3] = 0x00010003; + + /* Set up IF1 GA0 */ + if1_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga0.nxd_ip_address.v6[0] = 0x20010000; + if1_ga0.nxd_ip_address.v6[1] = 0x00000000; + if1_ga0.nxd_ip_address.v6[2] = 0x00000000; + if1_ga0.nxd_ip_address.v6[3] = 0x00020001; + + /* Set up IF1 GA1 */ + if1_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga1.nxd_ip_address.v6[0] = 0x20010000; + if1_ga1.nxd_ip_address.v6[1] = 0x00000000; + if1_ga1.nxd_ip_address.v6[2] = 0x00000000; + if1_ga1.nxd_ip_address.v6[3] = 0x00020002; + + /* Set up IF1 GA2 */ + if1_ga2.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga2.nxd_ip_address.v6[0] = 0x20010000; + if1_ga2.nxd_ip_address.v6[1] = 0x00000000; + if1_ga2.nxd_ip_address.v6[2] = 0x00000000; + if1_ga2.nxd_ip_address.v6[3] = 0x00020003; + + /* Set up IF1 GA3 */ + if1_ga3.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga3.nxd_ip_address.v6[0] = 0x20010000; + if1_ga3.nxd_ip_address.v6[1] = 0x00000000; + if1_ga3.nxd_ip_address.v6[2] = 0x00000000; + if1_ga3.nxd_ip_address.v6[3] = 0x00020004; + + /* Set up IF2 GA0 */ + if2_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if2_ga0.nxd_ip_address.v6[0] = 0x20010000; + if2_ga0.nxd_ip_address.v6[1] = 0x00000000; + if2_ga0.nxd_ip_address.v6[2] = 0x00000000; + if2_ga0.nxd_ip_address.v6[3] = 0x00030001; + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Set up multicast address. */ + multicast_addr.nxd_ip_version = NX_IP_VERSION_V6; + multicast_addr.nxd_ip_address.v6[0] = 0xFF050000; + multicast_addr.nxd_ip_address.v6[1] = 0x00000000; + multicast_addr.nxd_ip_address.v6[2] = 0x00000000; + multicast_addr.nxd_ip_address.v6[3] = 0x00010003; +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG prefix_length; +UINT interface_index; +NXD_IPV6_ADDRESS *ipv6_addr_ptr; +UINT address_count; +UINT i; +UINT link_local_address_index; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Address Set Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attach two more interface. */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", 0x02010101, 0xFFFFFF00, _nx_ram_network_driver_1500); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Set multicast address on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &multicast_addr, 64, NX_NULL); + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Set Global address0 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_lla, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga1, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address2 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga2, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link local address on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, NX_NULL, 10, &link_local_address_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set link local address on the 1st interface again. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, NX_NULL, 10, NX_NULL); + if(status != NX_DUPLICATED_ENTRY) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the link local address. */ + status = nxd_ipv6_address_delete(&ip_0, link_local_address_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address0 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga0, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga1, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address2 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga2, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Set global address0 on the 3rd interface. This one should fail. */ + status = nxd_ipv6_address_set(&ip_0, 2, &if2_ga0, 64, NX_NULL); + if(status != NX_INVALID_INTERFACE) + { + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Now go through all the IPv6 addresses and make sure the values are programmed correctly. */ + if((ip_0.nx_ipv6_address[0].nxd_ipv6_address_valid != 1) || + (ip_0.nx_ipv6_address[0].nxd_ipv6_address_type != NX_IP_VERSION_V6) || + (memcmp(ip_0.nx_ipv6_address[0].nxd_ipv6_address, &if0_lla.nxd_ip_address.v6[0], 16)) || + (ip_0.nx_ipv6_address[0].nxd_ipv6_address_prefix_length != 64) || + (ip_0.nx_ipv6_address[0].nxd_ipv6_address_state != NX_IPV6_ADDR_STATE_VALID) || + (ip_0.nx_ipv6_address[0].nxd_ipv6_address_attached != &ip_0.nx_ip_interface[0])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + if((ip_0.nx_ipv6_address[1].nxd_ipv6_address_valid != 1) || + (ip_0.nx_ipv6_address[1].nxd_ipv6_address_type != NX_IP_VERSION_V6) || + (memcmp(ip_0.nx_ipv6_address[1].nxd_ipv6_address, &if0_ga1.nxd_ip_address.v6[0], 16)) || + (ip_0.nx_ipv6_address[1].nxd_ipv6_address_prefix_length != 64) || + (ip_0.nx_ipv6_address[1].nxd_ipv6_address_state != NX_IPV6_ADDR_STATE_VALID) || + (ip_0.nx_ipv6_address[1].nxd_ipv6_address_attached != &ip_0.nx_ip_interface[0])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if((ip_0.nx_ipv6_address[2].nxd_ipv6_address_valid != 1) || + (ip_0.nx_ipv6_address[2].nxd_ipv6_address_type != NX_IP_VERSION_V6) || + (memcmp(ip_0.nx_ipv6_address[2].nxd_ipv6_address, &if0_ga2.nxd_ip_address.v6[0], 16)) || + (ip_0.nx_ipv6_address[2].nxd_ipv6_address_prefix_length != 64) || + (ip_0.nx_ipv6_address[2].nxd_ipv6_address_state != NX_IPV6_ADDR_STATE_VALID) || + (ip_0.nx_ipv6_address[2].nxd_ipv6_address_attached != &ip_0.nx_ip_interface[0])) + { + printf("ERROR!\n"); + test_control_return(1); + } + if((ip_0.nx_ipv6_address[3].nxd_ipv6_address_valid != 1) || + (ip_0.nx_ipv6_address[3].nxd_ipv6_address_type != NX_IP_VERSION_V6) || + (memcmp(ip_0.nx_ipv6_address[3].nxd_ipv6_address, &if1_ga0.nxd_ip_address.v6[0], 16)) || + (ip_0.nx_ipv6_address[3].nxd_ipv6_address_prefix_length != 64) || + (ip_0.nx_ipv6_address[3].nxd_ipv6_address_state != NX_IPV6_ADDR_STATE_VALID) || + (ip_0.nx_ipv6_address[3].nxd_ipv6_address_attached != &ip_0.nx_ip_interface[1])) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check each interface, making sure they have the proper IPv6 addresses configured. */ + if0_lla_check = if0_ga1_check = if0_ga2_check = if1_ga0_check = 0; + ipv6_addr_ptr = ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head; + address_count = 0; + while(ipv6_addr_ptr) + { + if(memcmp(ipv6_addr_ptr -> nxd_ipv6_address, &if0_lla.nxd_ip_address.v6[0], 16) == 0) + if0_lla_check++; + if(memcmp(ipv6_addr_ptr -> nxd_ipv6_address, &if0_ga1.nxd_ip_address.v6[0], 16) == 0) + if0_ga1_check++; + if(memcmp(ipv6_addr_ptr -> nxd_ipv6_address, &if0_ga2.nxd_ip_address.v6[0], 16) == 0) + if0_ga2_check++; + + address_count++; + ipv6_addr_ptr = ipv6_addr_ptr -> nxd_ipv6_address_next; + } + if((address_count != 3) || (if0_lla_check != 1) || (if0_ga1_check != 1) || (if0_ga2_check != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + ipv6_addr_ptr = ip_0.nx_ip_interface[1].nxd_interface_ipv6_address_list_head; + address_count = 0; + while(ipv6_addr_ptr) + { + if(memcmp(ipv6_addr_ptr -> nxd_ipv6_address, &if1_ga0.nxd_ip_address.v6[0], 16) == 0) + if1_ga0_check++; + if(memcmp(ipv6_addr_ptr -> nxd_ipv6_address, &if1_ga1.nxd_ip_address.v6[0], 16) == 0) + if1_ga1_check++; + if(memcmp(ipv6_addr_ptr -> nxd_ipv6_address, &if1_ga2.nxd_ip_address.v6[0], 16) == 0) + if1_ga2_check++; + + address_count++; + ipv6_addr_ptr = ipv6_addr_ptr -> nxd_ipv6_address_next; + } + + if((address_count != 3) || (if1_ga0_check != 1) || (if1_ga1_check != 1) || (if1_ga2_check != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reprogram all the interface IPv6 addresses. */ + + /* Now delete all the IPv6 addresses. */ + for(i = 0; i < 6; i++) + { + status = nxd_ipv6_address_delete(&ip_0, i); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + } + + status = nxd_ipv6_address_delete(&ip_0, 6); + if(status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set up IF0 LLA. */ + if0_lla.nxd_ip_version = NX_IP_VERSION_V6; + if0_lla.nxd_ip_address.v6[0] = 0xFE800000; + if0_lla.nxd_ip_address.v6[1] = 0x00000000; + if0_lla.nxd_ip_address.v6[2] = 0x00010000; + if0_lla.nxd_ip_address.v6[3] = 0x00000001; + + /* Set up IF1 LLA. */ + if1_lla.nxd_ip_version = NX_IP_VERSION_V6; + if1_lla.nxd_ip_address.v6[0] = 0xFE800000; + if1_lla.nxd_ip_address.v6[1] = 0x00000000; + if1_lla.nxd_ip_address.v6[2] = 0x00010000; + if1_lla.nxd_ip_address.v6[3] = 0x00000002; + + /* Set up IF0 GA0 */ + if0_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga0.nxd_ip_address.v6[0] = 0x20010000; + if0_ga0.nxd_ip_address.v6[1] = 0x00000000; + if0_ga0.nxd_ip_address.v6[2] = 0x00010000; + if0_ga0.nxd_ip_address.v6[3] = 0x00010001; + + /* Set up IF0 GA1 */ + if0_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga1.nxd_ip_address.v6[0] = 0x20010000; + if0_ga1.nxd_ip_address.v6[1] = 0x00000000; + if0_ga1.nxd_ip_address.v6[2] = 0x00010000; + if0_ga1.nxd_ip_address.v6[3] = 0x00010002; + + /* Set up IF0 GA2 */ + if0_ga2.nxd_ip_version = NX_IP_VERSION_V6; + if0_ga2.nxd_ip_address.v6[0] = 0x20010000; + if0_ga2.nxd_ip_address.v6[1] = 0x00000000; + if0_ga2.nxd_ip_address.v6[2] = 0x00010000; + if0_ga2.nxd_ip_address.v6[3] = 0x00010003; + + /* Set up IF1 GA0 */ + if1_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga0.nxd_ip_address.v6[0] = 0x20010000; + if1_ga0.nxd_ip_address.v6[1] = 0x00000000; + if1_ga0.nxd_ip_address.v6[2] = 0x00010000; + if1_ga0.nxd_ip_address.v6[3] = 0x00020001; + + /* Set up IF1 GA1 */ + if1_ga1.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga1.nxd_ip_address.v6[0] = 0x20010000; + if1_ga1.nxd_ip_address.v6[1] = 0x00000000; + if1_ga1.nxd_ip_address.v6[2] = 0x00010000; + if1_ga1.nxd_ip_address.v6[3] = 0x00020002; + + /* Set up IF1 GA2 */ + if1_ga2.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga2.nxd_ip_address.v6[0] = 0x20010000; + if1_ga2.nxd_ip_address.v6[1] = 0x00000000; + if1_ga2.nxd_ip_address.v6[2] = 0x00010000; + if1_ga2.nxd_ip_address.v6[3] = 0x00020003; + + /* Set up IF1 GA3 */ + if1_ga3.nxd_ip_version = NX_IP_VERSION_V6; + if1_ga3.nxd_ip_address.v6[0] = 0x20010000; + if1_ga3.nxd_ip_address.v6[1] = 0x00000000; + if1_ga3.nxd_ip_address.v6[2] = 0x00000000; + if1_ga3.nxd_ip_address.v6[3] = 0x00020004; + + /* Set up IF2 GA0 */ + if2_ga0.nxd_ip_version = NX_IP_VERSION_V6; + if2_ga0.nxd_ip_address.v6[0] = 0x20010000; + if2_ga0.nxd_ip_address.v6[1] = 0x00000000; + if2_ga0.nxd_ip_address.v6[2] = 0x00010000; + if2_ga0.nxd_ip_address.v6[3] = 0x00030001; + + /* Set Global address0 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga0, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga1, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address2 on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga2, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set duplicated Global address2 on the 1st interface again. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_ga2, 64, NX_NULL); + if(status != NX_DUPLICATED_ENTRY) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set invalid addrss on the 1st interface. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, NX_NULL, 64, NX_NULL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address0 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga0, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address1 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga1, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set Global address2 on the 2nd interface. */ + status = nxd_ipv6_address_set(&ip_0, SECONDARY_INTERFACE, &if1_ga2, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + + /* Set global address0 on the 3rd interface. This one should fail. */ + status = nxd_ipv6_address_set(&ip_0, 2, &if2_ga0, 64, NX_NULL); + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Now read back the IP addresses and make sure they match. */ + status = nxd_ipv6_address_get(&ip_0, 0, &if_addr, &prefix_length, &interface_index); + if(status != NX_SUCCESS || (memcmp(&if_addr, &if0_ga0, sizeof(NXD_ADDRESS))) || (prefix_length != 64) || (interface_index != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 1, &if_addr, &prefix_length, &interface_index); + if((status != NX_SUCCESS || (memcmp(&if_addr, &if0_ga1, sizeof(NXD_ADDRESS)))) || (prefix_length != 64) || (interface_index != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 2, &if_addr, &prefix_length, &interface_index); + if((status != NX_SUCCESS || (memcmp(&if_addr, &if0_ga2, sizeof(NXD_ADDRESS))) || (prefix_length != 64)) || (interface_index != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 3, &if_addr, &prefix_length, &interface_index); + if((status != NX_SUCCESS) || (memcmp(&if_addr, &if1_ga0, sizeof(NXD_ADDRESS))) || (prefix_length != 64) || (interface_index != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 4, &if_addr, &prefix_length, &interface_index); + if((status != NX_SUCCESS) || (memcmp(&if_addr, &if1_ga1, sizeof(NXD_ADDRESS))) || (prefix_length != 64) || (interface_index != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_get(&ip_0, 5, &if_addr, &prefix_length, &interface_index); + if((status != NX_SUCCESS) || (memcmp(&if_addr, &if1_ga2, sizeof(NXD_ADDRESS))) || (prefix_length != 64) || (interface_index != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up IF0 GAX */ + if0_gax.nxd_ip_version = NX_IP_VERSION_V6; + if0_gax.nxd_ip_address.v6[0] = 0x20010000; + if0_gax.nxd_ip_address.v6[1] = 0x00000009; + if0_gax.nxd_ip_address.v6[2] = 0x00000000; + if0_gax.nxd_ip_address.v6[3] = 0x00010003; + + /* Loop to add the IPv6 addresses. */ + for(i = 6; i < NX_MAX_IPV6_ADDRESSES; i++) + { + + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_gax, 64, NX_NULL); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Update the IP address IF0 GAX */ + if0_gax.nxd_ip_version = NX_IP_VERSION_V6; + if0_gax.nxd_ip_address.v6[1] += 1; + } + + /* Add the IPv6 address that exceed the max IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_gax, 64, NX_NULL); + if(status != NX_NO_MORE_ENTRIES) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the address on the 1 interface */ + for(i = 0; i < NX_MAX_IPV6_ADDRESSES; i++) + { + status = nxd_ipv6_address_delete(&ip_0, i); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Set up IF0 GAX */ + if0_gax.nxd_ip_version = NX_IP_VERSION_V6; + if0_gax.nxd_ip_address.v6[0] = 0x20010000; + if0_gax.nxd_ip_address.v6[1] = 0x00000009; + if0_gax.nxd_ip_address.v6[2] = 0x00000000; + if0_gax.nxd_ip_address.v6[3] = 0x00010003; + + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_gax, 64, NX_NULL); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up the address only v6[2] different with the address above. */ + if0_gax.nxd_ip_version = NX_IP_VERSION_V6; + if0_gax.nxd_ip_address.v6[0] = 0x20010000; + if0_gax.nxd_ip_address.v6[1] = 0x00000009; + if0_gax.nxd_ip_address.v6[2] = 0x00000002; + if0_gax.nxd_ip_address.v6[3] = 0x00010003; + + status = nxd_ipv6_address_set(&ip_0, PRIMARY_INTERFACE, &if0_gax, 64, NX_NULL); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_address_set_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Address Set Test.....................................N/A\n"); + test_control_return(3); + +} + +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_branch_test.c b/test/regression/netxduo_test/netx_ipv6_branch_test.c new file mode 100644 index 00000000..f1dd93b4 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_branch_test.c @@ -0,0 +1,871 @@ +/* This NetX test concentrates on the code coverage for IPv6 functions, + * nx_tcp_connect_cleanup.c + * nx_tcp_disconnect_cleanup.c + * nx_udp_bind_cleanup.c */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 + +#include "tx_thread.h" +#include "nx_icmp.h" +#include "nx_ip.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +#ifndef NX_DISABLE_ASSERT +static TX_THREAD thread_for_assert; +static UINT assert_count = 0; +#endif +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static CHAR *pointer; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifndef NX_DISABLE_ASSERT +static void thread_for_assert_entry(ULONG thread_input); +#endif + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_branch_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, + _nx_ram_network_driver_256); + + if (status) + error_counter++; +#endif /* (NX_MAX_PHYSICAL_INTERFACES > 1) */ + + /* Enable ICMP processing for IP instance. */ + status = nxd_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Enable IPv6 processing for IP instance. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet[2]; +NXD_ADDRESS ipv6_address; +ULONG prefix_address[4]; +ULONG address_1[4]; +ULONG address_2[4]; +ULONG router_address; +void *nd_cache_entry; +ND_CACHE_ENTRY + cache_entry; +NXD_IPV6_ADDRESS + *nxd_ipv6_address; +#ifndef NX_DISABLE_FRAGMENTATION +NX_IP_DRIVER + driver_request; +#endif +UINT address_index; + + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 Branch Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + +#ifndef NX_DISABLE_FRAGMENTATION + /* Hit condition of while (bytes_remaining > 0) and if ((source_pkt == NX_NULL) || (dest_pkt == NX_NULL)) in _nx_ipv6_packet_copy(). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_allocate(&pool_0, &my_packet[1], 0, NX_NO_WAIT); + _nx_ipv6_packet_copy(my_packet[0], my_packet[1], 0); + my_packet[0] -> nx_packet_last = my_packet[1]; + _nx_ipv6_packet_copy(my_packet[0], my_packet[1], 100); + my_packet[0] -> nx_packet_last = NX_NULL; + my_packet[1] -> nx_packet_last = my_packet[0]; + _nx_ipv6_packet_copy(my_packet[0], my_packet[1], 100); + my_packet[0] -> nx_packet_last = NX_NULL; + my_packet[1] -> nx_packet_last = NX_NULL; + nx_packet_release(my_packet[0]); + nx_packet_release(my_packet[1]); +#endif + + + + /* Hit false condition of CHECK_IPV6_ADDRESSES_SAME(prefix, current -> nx_ipv6_prefix_entry_network_address) in _nx_ipv6_prefix_list_delete . */ + prefix_address[0] = 0x20010001; + prefix_address[1] = 0x00000002; + prefix_address[2] = 0x00000003; + prefix_address[3] = 0x00000004; + _nx_ipv6_prefix_list_add_entry(&ip_0, prefix_address, 64, 100); + _nx_ipv6_prefix_list_delete(&ip_0, prefix_address, 48); + prefix_address[3] = 0x00000005; + _nx_ipv6_prefix_list_delete(&ip_0, prefix_address, 64); + prefix_address[3] = 0x00000004; + _nx_ipv6_prefix_list_delete(&ip_0, prefix_address, 64); + + + /* Hit false condition of if (interface_ipv6_address -> nxd_ipv6_address_state != NX_IPV6_ADDR_STATE_UNKNOWN) in _nx_ipv6_prefix_list_delete_entry . */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20010001; + ipv6_address.nxd_ip_address.v6[1] = 0x00000002; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x00000004; + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, NX_NULL); + ip_0.nx_ipv6_address[0].nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_UNKNOWN; + _nx_ipv6_prefix_list_delete_entry(&ip_0, ip_0.nx_ipv6_prefix_list_ptr); + nxd_ipv6_address_delete(&ip_0, 0); + + + + /* Hit condition of for (i = 0; i < 4; i++) in _nxd_ipv6_find_max_prefix_length . */ + address_1[0] = 0x20010001; + address_1[1] = 0x00000002; + address_1[2] = 0x00000003; + address_1[3] = 0x00000004; + + address_2[0] = 0x20010001; + address_2[1] = 0x00000002; + address_2[2] = 0x00000003; + address_2[3] = 0x00000004; + _nxd_ipv6_find_max_prefix_length(address_1, address_2, 128); + +#ifndef NX_DISABLE_ASSERT + /* Test _nx_ip_header_add(). */ + /* Hit NX_ASSERT(packet_ptr -> nx_packet_prepend_ptr >= packet_ptr -> nx_packet_data_start); */ + + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nxd_ipv6_destination_table_find_next_hop */ + /* Hit NX_ASSERT(next_hop != NX_NULL); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nxd_ipv6_router_lookup */ + /* Hit NX_ASSERT(routers_checked != NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nxd_ipv6_router_lookup */ + /* Hit NX_ASSERT(nd_cache_entry != NX_NULL) */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nxd_ipv6_interface_find */ + /* Hit NX_ASSERT(ipv6_addr != NX_NULL); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nxd_ipv6_interface_find */ + /* Hit NX_ASSERT((*ipv6_addr) -> nxd_ipv6_address_valid); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + + /* Test _nxd_ipv6_interface_find */ + /* Hit NX_ASSERT((*ipv6_addr) -> nxd_ipv6_address_valid); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + /* Test _nxd_ipv6_interface_find */ + /* Hit NX_ASSERT((*ipv6_addr) -> nxd_ipv6_address_valid); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + /* Test _nx_ipv6_header_add */ + /* Hit NX_ASSERT(packet_ptr -> nx_packet_prepend_ptr >= packet_ptr -> nx_packet_data_start); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + /* Test _nx_ipv6_packet_send */ + /* Hit NX_ASSERT(if_ptr -> nx_interface_link_driver_entry != NX_NULL); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + ip_0.nx_ip_interface[0].nx_interface_link_driver_entry = _nx_ram_network_driver_256; + + /* Test _nx_ipv6_packet_send */ + /* Hit NX_ASSERT(if_ptr != NX_NULL); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); + + /* Test _nx_ipv6_packet_send */ + /* Hit NX_ASSERT(NDCacheEntry -> nx_nd_cache_nd_status != ND_CACHE_STATE_INVALID); */ + /* Create the main thread. */ + tx_thread_create(&thread_for_assert, "Assert Test thread", thread_for_assert_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert); + tx_thread_delete(&thread_for_assert); +#else + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x4; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xfe800000; + + /* Add a router. */ + _nxd_ipv6_default_router_add(&ip_0, &ipv6_address, 1000, 0); + +#endif /* NX_DISABLE_ASSERT */ + + /* Hit false condition of for (i = 0; table_size && (i < NX_IPV6_DESTINATION_TABLE_SIZE); i++). */ + ip_0.nx_ipv6_destination_table_size = NX_IPV6_DESTINATION_TABLE_SIZE + 1; + _nxd_ipv6_destination_table_find_next_hop(&ip_0, address_1, address_2); + ip_0.nx_ipv6_destination_table_size = 0; + + /* Cover the branches for NDCacheEntry -> nx_nd_cache_nd_status. */ + cache_entry.nx_nd_cache_nd_status = ND_CACHE_STATE_INVALID; + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_neighbor_cache_ptr = &cache_entry; + _nxd_ipv6_router_lookup(&ip_0, &ip_0.nx_ip_interface[0], &router_address, &nd_cache_entry); + cache_entry.nx_nd_cache_nd_status = ND_CACHE_STATE_CREATED; + _nxd_ipv6_router_lookup(&ip_0, &ip_0.nx_ip_interface[0], &router_address, &nd_cache_entry); + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_neighbor_cache_ptr = NX_NULL; + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) + /* Hit the branch + 156 [ + + ][ + - ]: 408 : if ((rt_entry -> nx_ipv6_default_router_entry_flag & NX_IPV6_ROUTE_TYPE_VALID) && + 157 : 378 : (rt_entry -> nx_ipv6_default_router_entry_interface_ptr == if_ptr)) + */ + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_flag = NX_IPV6_ROUTE_TYPE_VALID; + _nxd_ipv6_router_lookup(&ip_0, &ip_0.nx_ip_interface[1], &router_address, &nd_cache_entry); +#endif /* (NX_MAX_PHYSICAL_INTERFACES > 1) */ + + /* Call nxd_ipv6_default_router_entry_get with NULL pointers. */ + nxd_ipv6_default_router_entry_get(&ip_0, 0, 0, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Set linklocal address */ + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 10, NX_NULL); + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x3; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFF000000; + + /* Call _nxd_ipv6_interface_find with multicast destination address. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &nxd_ipv6_address, NX_NULL); + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x2; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address[0] = 0xFE000000; + + /* Call _nxd_ipv6_interface_find with link local destination address. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &nxd_ipv6_address, NX_NULL); + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address[0] = 0xFE800000; + + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_DEPRECATED; + /* Call _nxd_ipv6_interface_find with multicast destination address. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &nxd_ipv6_address, NX_NULL); + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_VALID; + + /* Call _nxd_ipv6_address_delete with invalid interface address list. */ + ip_0.nx_ipv6_address[0].nxd_ipv6_address_attached -> nxd_interface_ipv6_address_list_head = NX_NULL; + _nxd_ipv6_address_delete(&ip_0, 0); + ip_0.nx_ipv6_address[0].nxd_ipv6_address_attached -> nxd_interface_ipv6_address_list_head = &ip_0.nx_ipv6_address[0]; + + /* Call _nx_ipv6_header_add with invalid address state and protocol. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &my_packet[0] -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_DEPRECATED; + _nx_ipv6_header_add(&ip_0, &my_packet[0], NX_PROTOCOL_UDP, 10, 10, NX_NULL, NX_NULL, NX_NULL); + nx_packet_release(my_packet[0]); + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_VALID; + + +#ifndef NX_DISABLE_FRAGMENTATION + /* Call _nx_ipv6_fragment_process with a packet with NX_PROTOCOL_NEXT_HEADER_ROUTING. */ + driver_request.nx_ip_driver_ptr = &ip_0; + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + driver_request.nx_ip_driver_packet = my_packet[0]; + my_packet[0] -> nx_packet_length = 48; + my_packet[0] ->nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 48; + + *(my_packet[0] -> nx_packet_prepend_ptr + 6) = NX_PROTOCOL_NEXT_HEADER_ROUTING; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)) = NX_PROTOCOL_TCP; + *(my_packet[0] -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER) + 1) = 0; + _nx_ipv6_fragment_process(&driver_request, 1400); +#endif + + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x4; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xfe800000; + + /* Add a duplicated router. */ + _nxd_ipv6_default_router_add(&ip_0, &ipv6_address, 1000, 0); + + /* Add a duplicated router but with a different interface. */ + _nxd_ipv6_default_router_add_internal(&ip_0, ipv6_address.nxd_ip_address.v6, 0xFFFF, &ip_0.nx_ip_interface[1], NX_IPV6_ROUTE_TYPE_STATIC, NX_NULL); + + _nxd_ipv6_prefix_router_timer_tick(&ip_0); + + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_life_time = 0; + ip_0.nx_ipv6_destination_table_size = NX_IPV6_DESTINATION_TABLE_SIZE + 1; + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_neighbor_cache_ptr = &cache_entry; + _nxd_ipv6_prefix_router_timer_tick(&ip_0); + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_neighbor_cache_ptr = NX_NULL; + ip_0.nx_ipv6_destination_table_size = 0; + + /* Test _nxd_ipv6_address_set with different interface address. */ + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address[1] = 1; + _nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address[1] = 0; + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address[2] = 0x021122FF; + _nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Test _nxd_ipv6_disable with null nx_nd_cache_interface_ptr. */ + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_nd_status = ND_CACHE_STATE_CREATED; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_interface_ptr = NX_NULL; + _nxd_ipv6_disable(&ip_0); + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_nd_status = ND_CACHE_STATE_INVALID; + _nxd_ipv6_enable(&ip_0); + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +#ifndef NX_DISABLE_ASSERT +/* Define the test threads. */ + +static void thread_for_assert_entry(ULONG thread_input) +{ +NX_PACKET *test_packet; +NXD_ADDRESS destination_ip; +ULONG ipv6_destination_address[4]; +NXD_ADDRESS ipv6_address; +ULONG router_address; +void *nd_cache_entry; +NXD_IPV6_ADDRESS + *nxd_ipv6_address; +NX_IPV6_DESTINATION_ENTRY + *dest_entry_ptr; + + + /* Check the count. */ + if (assert_count == 0) + { + + /* Update the count. */ + assert_count ++; + + nx_packet_allocate(&pool_0, &test_packet, 0, NX_NO_WAIT); + test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr = NX_NULL; + + /* Call function with NULL interface. */ + _nxd_ipv6_raw_packet_send_internal(&ip_0, test_packet, &destination_ip, 0); + } + else if (assert_count == 1) + { + + /* Update the count. */ + assert_count ++; + + /* Call function with NULL next hop. */ + _nxd_ipv6_destination_table_find_next_hop(&ip_0, ipv6_destination_address, NX_NULL); + } + else if (assert_count == 2) + { + + /* Update the count. */ + assert_count ++; + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x3; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xfe800000; + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, NX_NULL); + ipv6_address.nxd_ip_address.v6[3] = 0x4; + + _nxd_ipv6_default_router_add(&ip_0, &ipv6_address, 1000, 0); + + /* Hit false condition of for (i = 0; table_size && (i < NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE); i++). */ + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_flag = NX_IPV6_ROUTE_TYPE_NOT_ROUTER; + _nxd_ipv6_router_lookup(&ip_0, &ip_0.nx_ip_interface[0], &router_address, &nd_cache_entry); + + } + else if (assert_count == 3) + { + + /* Update the count. */ + assert_count ++; + + ip_0.nx_ipv6_default_router_table[0].nx_ipv6_default_router_entry_flag = NX_IPV6_ROUTE_TYPE_VALID | NX_IPV6_ROUTE_TYPE_STATIC; + + /* Call function with NULL cache entry pointer. */ + _nxd_ipv6_router_lookup(&ip_0, &ip_0.nx_ip_interface[0], &router_address, NX_NULL); + } + else if (assert_count == 4) + { + + /* Update the count. */ + assert_count ++; + + /* Call function with NULL address pointers. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_destination_address, NX_NULL, NX_NULL); + } + else if (assert_count == 5) + { + + /* Update the count. */ + assert_count ++; + + /* This test point is useless since the logic of _nxd_ipv6_interface_find is modified. */ +#if 0 + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x3; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFF020000; + + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_valid = NX_FALSE; + + /* Call function with invalid address pointers. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &nxd_ipv6_address, NX_NULL); +#else + tx_thread_suspend(tx_thread_identify()); +#endif + + } + else if (assert_count == 6) + { + + /* Update the count. */ + assert_count ++; + + /* This test point is useless since the logic of _nxd_ipv6_interface_find is modified. */ +#if 0 + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x2; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_valid = NX_FALSE; + + /* Call function with invalid address pointers. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &nxd_ipv6_address, NX_NULL); +#else + tx_thread_suspend(tx_thread_identify()); +#endif + + } + else if (assert_count == 7) + { + + /* Update the count. */ + assert_count ++; + + /* This test point is useless since the logic of _nxd_ipv6_interface_find is modified. */ +#if 0 + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x2; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address[0] = 0x20010000; + ip_0.nx_ip_interface[0].nxd_interface_ipv6_address_list_head -> nxd_ipv6_address_valid = NX_FALSE; + + /* Call function with invalid address pointers. */ + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &nxd_ipv6_address, NX_NULL); +#else + tx_thread_suspend(tx_thread_identify()); +#endif + + } + else if (assert_count == 8) + { + + /* Update the count. */ + assert_count ++; + + /* Call _nx_ipv6_header_add with invalid nx_packet_prepend_ptr. */ + nx_packet_allocate(&pool_0, &test_packet, 0, NX_NO_WAIT); + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + test_packet -> nx_packet_prepend_ptr = test_packet -> nx_packet_data_start - 1; + _nx_ipv6_header_add(&ip_0, &test_packet, NX_PROTOCOL_ICMPV6, 10, 10, NX_NULL, NX_NULL, NX_NULL); + + } + else if (assert_count == 9) + { + + /* Update the count. */ + assert_count ++; + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x2; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + + /* Test _nx_ipv6_packet_send with nx_ipv6_destination_table full for on link destination. */ + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ip_0.nx_ipv6_destination_table_size = NX_IPV6_DESTINATION_TABLE_SIZE; + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + ip_0.nx_ipv6_destination_table_size = 0; + + /* Test _nx_ipv6_packet_send with nx_ipv6_destination_table full for off link destination. */ + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ipv6_address.nxd_ip_address.v6[0] = 0x20010000; + ip_0.nx_ipv6_destination_table_size = NX_IPV6_DESTINATION_TABLE_SIZE; + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + ip_0.nx_ipv6_destination_table_size = 0; + + /* Call _nx_ipv6_packet_send to add ND cache. */ + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + + /* Call _nx_ipv6_packet_send to add ND cache. */ + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_prepend_ptr = test_packet -> nx_packet_data_start + NX_IPv6_UDP_PACKET; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + + /* Call _nx_ipv6_packet_send with null nx_nd_cache_packet_waiting_head. */ + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_prepend_ptr = test_packet -> nx_packet_data_start + NX_IPv6_UDP_PACKET; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ip_0.nx_ipv6_nd_cache[2].nx_nd_cache_packet_waiting_head = NX_NULL; + ip_0.nx_ipv6_nd_cache[2].nx_nd_cache_packet_waiting_queue_length = NX_ND_MAX_QUEUE_DEPTH + 1; + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + +#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY + /* Call _nx_ipv6_packet_send with zero nx_ipv6_destination_entry_path_mtu. */ + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_prepend_ptr = test_packet -> nx_packet_data_start + NX_IPv6_UDP_PACKET; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ip_0.nx_ipv6_nd_cache[2].nx_nd_cache_nd_status = ND_CACHE_STATE_REACHABLE; + ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu = 0; + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + + /* Call _nx_ipv6_packet_send with null nx_interface_link_driver_entry. */ + ip_0.nx_ip_interface[0].nx_interface_link_driver_entry = NX_NULL; + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_prepend_ptr = test_packet -> nx_packet_data_start + NX_IPv6_UDP_PACKET; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ip_0.nx_ipv6_destination_table[0].nx_ipv6_destination_entry_path_mtu = 256; + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); +#endif + + } + else if (assert_count == 10) + { + NXD_IPV6_ADDRESS ipv6_address2; + + /* Update the count. */ + assert_count ++; + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x2; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + + /* Test _nx_ipv6_packet_send with null interface pointer. */ + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + ipv6_address2 = *test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr; + ipv6_address2.nxd_ipv6_address_attached = NX_NULL; + test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr = &ipv6_address2; + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + + } + else if (assert_count == 11) + { + + /* Update the count. */ + assert_count ++; + + /* Set up the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[3] = 0x2; + ipv6_address.nxd_ip_address.v6[2] = 0x0; + ipv6_address.nxd_ip_address.v6[1] = 0x0; + ipv6_address.nxd_ip_address.v6[0] = 0xFE800000; + + + nx_packet_allocate(&pool_0, &test_packet, NX_IPv6_UDP_PACKET, NX_NO_WAIT); + test_packet -> nx_packet_length = 60; + test_packet -> nx_packet_append_ptr = test_packet -> nx_packet_prepend_ptr + test_packet -> nx_packet_length; + _nxd_ipv6_interface_find(&ip_0, ipv6_address.nxd_ip_address.v6, &test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr, NX_NULL); + + /* Test _nx_ipv6_packet_send with state of ND cache invalid. */ + _nx_icmpv6_dest_table_add(&ip_0, ipv6_address.nxd_ip_address.v6, &dest_entry_ptr, + ipv6_address.nxd_ip_address.v6, 1500, NX_WAIT_FOREVER, + test_packet -> nx_packet_address.nx_packet_ipv6_address_ptr); + dest_entry_ptr -> nx_ipv6_destination_entry_nd_entry -> nx_nd_cache_nd_status = ND_CACHE_STATE_INVALID; + + _nx_ipv6_packet_send(&ip_0, test_packet, NX_PROTOCOL_UDP, test_packet -> nx_packet_length, ip_0.nx_ipv6_hop_limit, ip_0.nx_ipv6_address[0].nxd_ipv6_address, ipv6_address.nxd_ip_address.v6); + } + +} +#endif + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Branch Test..........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_default_router_api_test.c b/test/regression/netxduo_test/netx_ipv6_default_router_api_test.c new file mode 100644 index 00000000..ddafa75e --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_default_router_api_test.c @@ -0,0 +1,496 @@ +/* Test IPv4 default router set/get APIs. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#define MAX_TEST_INTERFACES 2 + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES >= MAX_TEST_INTERFACES) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_router_address; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_default_router_api_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 0,&ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; + +#ifndef NX_DISABLE_ERROR_CHECKING + + /* Attempt to set default router on interface 1. Since Interface 1 has no drivers attached yet, this call shall fail. */ + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = 100; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_router_address, 100, 1); + if(status != NX_INVALID_INTERFACE) + error_counter++; + +#endif /* NX_DISABLE_ERROR_CHECKING */ + + status = nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_512); + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20020000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_1, 64, NX_NULL); + + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Enable ICMP for IP Instance 0. */ + status += nxd_icmp_enable(&ip_0); + + + /* Check status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +ULONG router_lifetime; +ULONG prefix_length; +ULONG configuration_method; +UINT entries; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Default Router API Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + for(i = 0; i < MAX_TEST_INTERFACES; i++) + { + /* Attempt to get a default router before routers are configured. */ + memset(&ipv6_router_address, 0, sizeof(ipv6_router_address)); + router_lifetime = 0; + prefix_length = 0; + status = nxd_ipv6_default_router_get(&ip_0, i, &ipv6_router_address, &router_lifetime, &prefix_length); + if(status != NX_NOT_FOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to get default router entries. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, i, &entries); + if(entries !=0) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Fill the interface with different routers. */ + status = 0; + for(i = 0; i < NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE; i++) + { + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000 + 0x10000 * (i % MAX_TEST_INTERFACES); + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = i; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + + status += nxd_ipv6_default_router_add(&ip_0, &ipv6_router_address, 100, i % MAX_TEST_INTERFACES); + } + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check router entry for each interface. */ + for(i = 0; i < MAX_TEST_INTERFACES; i++) + { + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, i, &entries); + + /* Check entries. */ + if(entries != ((NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE + MAX_TEST_INTERFACES - i - 1) / MAX_TEST_INTERFACES)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check router entry for this interface. */ + for(j = 0; j < entries; j++) + { + status = nxd_ipv6_default_router_entry_get(&ip_0, i, j, &ipv6_router_address, &router_lifetime, &prefix_length, &configuration_method); + if(status != NX_SUCCESS) + { + error_counter++; + } + if(prefix_length != 64) + error_counter++; + if (configuration_method != NX_IPV6_ROUTE_TYPE_STATIC) + error_counter++; + + if(ipv6_router_address.nxd_ip_version != NX_IP_VERSION_V6) + { + error_counter++; + } + if((ipv6_router_address.nxd_ip_address.v6[0] != 0x20010000 + 0x10000 * (i % MAX_TEST_INTERFACES)) || + (ipv6_router_address.nxd_ip_address.v6[1] != 0x00000000) || + (ipv6_router_address.nxd_ip_address.v6[2] != (j * MAX_TEST_INTERFACES + i)) || + (ipv6_router_address.nxd_ip_address.v6[3] != 0x01020305)) + { + error_counter++; + } + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + } + + /* Delete a not existing router. */ + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_router_address.nxd_ip_address.v6[1] = 0; + ipv6_router_address.nxd_ip_address.v6[2] = 0; + ipv6_router_address.nxd_ip_address.v6[3] = 1; + status = nxd_ipv6_default_router_delete(&ip_0, &ipv6_router_address); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete all routers. */ + status = 0; + for(i = 0; i < NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE; i++) + { + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000 + 0x10000 * (i % MAX_TEST_INTERFACES); + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = i; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + + status += nxd_ipv6_default_router_delete(&ip_0, &ipv6_router_address); + } + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Fill the IPv6 default router table. */ + status = 0; + for(i = 0; i < NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE; i++) + { + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + if(i == 0) + /* Set the first default router to be link local. */ + ipv6_router_address.nxd_ip_address.v6[0] = 0xFE800000; + else + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000 + 0x10000 * (i % MAX_TEST_INTERFACES); + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = i + 1; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + + status += nxd_ipv6_default_router_add(&ip_0, &ipv6_router_address, 100, i % MAX_TEST_INTERFACES); + } + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Read back the default routers. */ + for(i = 0; i < MAX_TEST_INTERFACES; i++) + { + memset(&ipv6_router_address, 0, sizeof(ipv6_router_address)); + router_lifetime = 0; + prefix_length = 0; + status = nxd_ipv6_default_router_get(&ip_0, i, &ipv6_router_address, &router_lifetime, &prefix_length); + if(status != NX_SUCCESS) + { + error_counter++; + } + if(i == 0) + { + if(prefix_length != 10) + error_counter++; + } + else if(prefix_length != 64) + error_counter++; + + if(ipv6_router_address.nxd_ip_version != NX_IP_VERSION_V6) + { + error_counter++; + } + if(i == 0) + { + if(ipv6_router_address.nxd_ip_address.v6[0] != 0xFE800000) + error_counter++; + if(prefix_length != 10) + error_counter++; + + } + else + { + if(ipv6_router_address.nxd_ip_address.v6[0] != 0x20010000 + 0x10000 * (i % MAX_TEST_INTERFACES)) + error_counter++; + if(prefix_length != 64) + error_counter++; + } + if((ipv6_router_address.nxd_ip_address.v6[1] != 0x00000000) || + (ipv6_router_address.nxd_ip_address.v6[2] != (i + 1)) || + (ipv6_router_address.nxd_ip_address.v6[3] != 0x01020305)) + { + error_counter++; + } + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Now delete the 1st entry. */ + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0xFE800000; + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = 1; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + status = nxd_ipv6_default_router_delete(&ip_0, &ipv6_router_address); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Read back the router address. The 2nd entry should be returned. */ + memset(&ipv6_router_address, 0, sizeof(ipv6_router_address)); + router_lifetime = 0; + prefix_length = 0; + + status = nxd_ipv6_default_router_get(&ip_0, 0, &ipv6_router_address, &router_lifetime, &prefix_length); + if((status != NX_SUCCESS) || (prefix_length != 64)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(ipv6_router_address.nxd_ip_version != NX_IP_VERSION_V6) + { + printf("ERROR!\n"); + test_control_return(1); + } + if((ipv6_router_address.nxd_ip_address.v6[0] != 0x20010000) || + (ipv6_router_address.nxd_ip_address.v6[1] != 0x00000000) || + (ipv6_router_address.nxd_ip_address.v6[2] != (MAX_TEST_INTERFACES + 1)) || + (ipv6_router_address.nxd_ip_address.v6[3] != 0x01020305)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now add another router. It should be stored at the 1st slot. */ + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = 0x00010001; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_router_address, 100, 0); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Read back the default routers. */ + /* In this case the 1st entry (updated) should be returned. */ + memset(&ipv6_router_address, 0, sizeof(ipv6_router_address)); + router_lifetime = 0; + prefix_length = 0; + status = nxd_ipv6_default_router_get(&ip_0, 0, &ipv6_router_address, &router_lifetime, &prefix_length); + if((status != NX_SUCCESS) || (prefix_length != 64)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(ipv6_router_address.nxd_ip_version != NX_IP_VERSION_V6) + { + printf("ERROR!\n"); + test_control_return(1); + } + if((ipv6_router_address.nxd_ip_address.v6[0] != 0x20010000) || + (ipv6_router_address.nxd_ip_address.v6[1] != 0x00000000) || + (ipv6_router_address.nxd_ip_address.v6[2] != 0x00010001) || + (ipv6_router_address.nxd_ip_address.v6[3] != 0x01020305)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the last entry. */ + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000 + 0x10000 * ((NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE - 1) % MAX_TEST_INTERFACES); + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + status = nxd_ipv6_default_router_delete(&ip_0, &ipv6_router_address); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add another entry. This one should take the last spot in the IPv6 default router table */ + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20020000; + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_router_address, 100, 1); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Make sure the last entry is correctly set. */ + i = NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE - 1; + if((ip_0.nx_ipv6_default_router_table[i].nx_ipv6_default_router_entry_flag == 0) || + (ip_0.nx_ipv6_default_router_table[i].nx_ipv6_default_router_entry_router_address[0] != 0x20020000) || + (ip_0.nx_ipv6_default_router_table[i].nx_ipv6_default_router_entry_router_address[1] != 0x00000000) || + (ip_0.nx_ipv6_default_router_table[i].nx_ipv6_default_router_entry_router_address[2] != (i + 1)) | + (ip_0.nx_ipv6_default_router_table[i].nx_ipv6_default_router_entry_router_address[3] != 0x01020305)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + ipv6_router_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_router_address.nxd_ip_address.v6[0] = 0x20010000; + ipv6_router_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_router_address.nxd_ip_address.v6[2] = NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE; + ipv6_router_address.nxd_ip_address.v6[3] = 0x01020305; + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_router_address, 100, 0); + if(status != NX_NO_MORE_ENTRIES) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* All done. Return Success */ + printf("SUCCESS!\n"); + + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_default_router_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Default Router API Test..............................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_default_router_test.c b/test/regression/netxduo_test/netx_ipv6_default_router_test.c new file mode 100644 index 00000000..4cf57c19 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_default_router_test.c @@ -0,0 +1,316 @@ +/* This NetX test concentrates on the IPv6 default router. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV6_DAD) +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_nd_cache.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS ipv6_address_3; +static NXD_ADDRESS ipv6_address_4; +static NXD_ADDRESS ipv6_multicast; + + + +/* Define the counters used in the test application... */ +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_default_router_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, + &pool_0, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), + 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x10000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x40010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x10000003; + + ipv6_multicast.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_multicast.nxd_ip_address.v6[0] = 0xFF020000; + ipv6_multicast.nxd_ip_address.v6[1] = 0x00000000; + ipv6_multicast.nxd_ip_address.v6[2] = 0x00000000; + ipv6_multicast.nxd_ip_address.v6[3] = 0x00000001; + + /* Check ipv6 address set status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status = 0; +NX_PACKET *my_packet; +NXD_IPV6_ADDRESS *ipv6_address; +CHAR mac_address[6]; +ND_CACHE_ENTRY *nd_cache_entry; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Default Router Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set default router to primary interface before setting IPv6 address. */ + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_address_1, 60, 0); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set multicast address default router to primary interface. */ + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_multicast, 60, 0); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set default router to primary interface. */ + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_address_1, 60, 0); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set default router to an address which isn't on link. */ + status = nxd_ipv6_default_router_add(&ip_0, &ipv6_address_3, 60, 0); + + if(status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Try to send a ping. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + /* Since the state of address is tentative, no interface can be found. */ + if(status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_4, 64, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let DAD finishes. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Try to send a ping. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + /* Router is found. Since it doesn't wait, the result is no response. */ + if(status != NX_NO_RESPONSE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* The interface index of default router is 0. */ + /* Outgoing interface should be found. */ + status = _nxd_ipv6_interface_find(&ip_0, ipv6_address_3.nxd_ip_address.v6, &ipv6_address, + &ip_0.nx_ip_interface[0]); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Outgoing interface should not be found. */ + status = _nxd_ipv6_interface_find(&ip_0, ipv6_address_3.nxd_ip_address.v6, &ipv6_address, + &ip_0.nx_ip_interface[1]); + + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the link. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + + /* Try to send a ping. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + /* Since the link is down, no interface can be found. */ + if(status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the link. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_TRUE; + + + /* Added the ND Cache entry. */ + mac_address[0] = 0x11; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x57; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &ipv6_address_1.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_REACHABLE, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Try to send a ping. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_NO_WAIT); + + /* Since the link is down, no interface can be found. */ + if(status != NX_NO_RESPONSE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + printf("SUCCESS!\n"); + test_control_return(0); + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_default_router_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Default Router Test..................................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_disable_test.c b/test/regression/netxduo_test/netx_ipv6_disable_test.c new file mode 100644 index 00000000..c1bf1c09 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_disable_test.c @@ -0,0 +1,231 @@ +/* This NetX test concentrates on the IPv6 disable operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_disable_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Disable Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status != NX_SUCCESS) || (my_packet -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable IPv6. */ + status = nxd_ipv6_disable(&ip_0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable IPv6 again. */ + status = nxd_ipv6_disable(&ip_0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ping an IP address that does exist again. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address indexes are still valid after IPv6 enabled. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + for (i = 0; i < NX_MAX_IPV6_ADDRESSES; i++) + { + if (ip_0.nx_ipv6_address[i].nxd_ipv6_address_index != (UCHAR)i) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_disable_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Disable Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_fragment_fail_test.c b/test/regression/netxduo_test/netx_ipv6_fragment_fail_test.c new file mode 100644 index 00000000..5daaf6d5 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_fragment_fail_test.c @@ -0,0 +1,188 @@ +/* This NetX test concentrates on fragment IPv6 packet fail due to empty packet pool. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(FEATURE_NX_IPV6) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NXD_ADDRESS addr_0, addr_1; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR send_buff[2000]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragment_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool with two packets available. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 4000); + pointer = pointer + 4000; + + if (status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 1536, pointer, 15360); + pointer = pointer + 15360; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ICMP processing. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable fragmentation */ + status += nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check status. */ + if(status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Fragment Fail Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set IPv6 address. */ + addr_0.nxd_ip_version = NX_IP_VERSION_V6; + addr_0.nxd_ip_address.v6[0] = 0xFE800000; + addr_0.nxd_ip_address.v6[1] = 0x00000000; + addr_0.nxd_ip_address.v6[2] = 0x00000000; + addr_0.nxd_ip_address.v6[3] = 0x00000001; + addr_1.nxd_ip_version = NX_IP_VERSION_V6; + addr_1.nxd_ip_address.v6[0] = 0xFE800000; + addr_1.nxd_ip_address.v6[1] = 0x00000000; + addr_1.nxd_ip_address.v6[2] = 0x00000000; + addr_1.nxd_ip_address.v6[3] = 0x00000002; + + status = nxd_ipv6_address_set(&ip_0, 0, &addr_0, 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &addr_1, 10, NX_NULL); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Ping IP_1 to make sure ND cache is filled. */ + status = nxd_icmp_ping(&ip_0, &addr_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + nx_packet_release(packet_ptr); + + /* Now send a ping that takes two packets. */ + status = nxd_icmp_ping(&ip_0, &addr_1, send_buff, sizeof(send_buff), &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragment_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 Fragment Fail Test...................................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_ICMP_INFO */ diff --git a/test/regression/netxduo_test/netx_ipv6_fragmentation_error_test1.c b/test/regression/netxduo_test/netx_ipv6_fragmentation_error_test1.c new file mode 100644 index 00000000..aa82b00d --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_fragmentation_error_test1.c @@ -0,0 +1,248 @@ +/* This NetX test concentrates on basic IPv6 fragmentation. */ +/* Test sequence: + * 1. ip_0 allocate 1000 bytes. + * 2. ip_0 discard the packets excpet the header packet, packet length also is 1000. + * 3. ip_0 call nxd_ip_raw_packet_send to send packet. + * 4. ip_0 call nx_ipv6_fragment_process to fragment packet and send the fragmentation packets. + * 5. check if the driver receive fragmentation packet form ip_0. + Test pointer: + * 1. in _nx_ipv6_packet_copy failure since the next packet of source packet is NX_NULL, cover the following code. + if ((source_pkt == NX_NULL) || (dest_pkt == NX_NULL)) + return(NX_NOT_SUCCESSFUL); + * 2. in nx_ipv6_fragment_process failure since _nx_ipv6_packet_copy failure, cover the following code: + // Copy the rest of the frame. + if (_nx_ipv6_packet_copy(source_packet, first_fragment, fragment_size)) + break; +*/ + + +#include "tx_api.h" +#include "nx_api.h" +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(FEATURE_NX_IPV6) +#include "nx_ipv6.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fragmentation_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragmentation_error_test1_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fragmentation_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 128, pointer, 128*60); + pointer = pointer + 128*60; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + if (status) + error_counter++; + + /* Enable IP raw feature on both IP instances. */ + status = nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + if (status) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 Fragmentation Error Test1............................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1000, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Discard the packets except the header packet. */ + my_packet -> nx_packet_next = NX_NULL; + my_packet -> nx_packet_last = NX_NULL; + + /* Send the raw packet. */ + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &ipv6_address_1, 23, 255, NX_IP_NORMAL); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for error. */ + if((error_counter) || (fragmentation_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Check if receive IPv6 fragmentation packet from ip_0, except NA and NS(IPv6(40) + NS/NA(32)). */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 72)) + { + + /* Updated the packet_counter. */ + fragmentation_counter ++; + } + + return NX_TRUE; +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragmentation_error_test1_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Fragmentation Error Test1............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ipv6_fragmentation_error_test2.c b/test/regression/netxduo_test/netx_ipv6_fragmentation_error_test2.c new file mode 100644 index 00000000..77b42145 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_fragmentation_error_test2.c @@ -0,0 +1,271 @@ +/* This NetX test concentrates on basic IPv6 fragmentation. */ +/* Test sequence: + * 1. ip_0 allocate one packets. + * 1. ip_0 add the Hop-by-Hop Option, 2 bytes(next header, option length) + 128 bytes(option length). + * 1. ip_0 append the data 1000 bytes. + * 2. ip_0 discard the packets excpet the header packet, packet length also is 2 + 128 + 1000. + * 3. ip_0 call nxd_ip_raw_packet_send to send the packet with Hop-by-Hop Option. + * 4. ip_0 call nx_ipv6_fragment_process to fragment packet and send the fragmentation packets. + * 5. check if the driver receive fragmentation packet form ip_0. + Test pointer: + * 1. in _nx_ipv6_packet_copy failure since the next packet of source packet is NX_NULL, cover the following code. + if ((source_pkt == NX_NULL) || (dest_pkt == NX_NULL)) + return(NX_NOT_SUCCESSFUL); + * 2. in nx_ipv6_fragment_process failure since _nx_ipv6_packet_copy failure, cover the following code: + // For the first packet, the prepend pointer is already at the begining of the IP header. + if (_nx_ipv6_packet_copy(source_packet, first_fragment, fragment_size)) + break; +*/ + + +#include "tx_api.h" +#include "nx_api.h" +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(FEATURE_NX_IPV6) +#include "nx_ipv6.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fragmentation_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +static CHAR msg[1500]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragmentation_error_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fragmentation_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 128, pointer, 128*60); + pointer = pointer + 128*60; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + if (status) + error_counter++; + + /* Enable IP raw feature on both IP instances. */ + status = nx_ip_raw_packet_enable(&ip_0); + status += nx_ip_raw_packet_enable(&ip_1); + if (status) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UCHAR data; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 Fragmentation Error Test2............................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the callback function. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Added Hop-by-Hop Options header to let the unfragmentable size exceed one packet. */ + + /* Added the Next header. */ + data = 23; + status = nx_packet_data_append(my_packet, &data, 1, &pool_0, NX_IP_PERIODIC_RATE); + + /* Added the Hdr Ext Len. */ + data = 16; + status += nx_packet_data_append(my_packet, &data, 1, &pool_0, NX_IP_PERIODIC_RATE); + + /* Added the Options. */ + status += nx_packet_data_append(my_packet, msg, 16 * 8, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, msg, 1000, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Discard the packets except the header packet. */ + my_packet -> nx_packet_next = NX_NULL; + my_packet -> nx_packet_last = NX_NULL; + + /* Send the raw packet for Hop-by-Hop Option. */ + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &ipv6_address_1, NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, 255, NX_IP_NORMAL); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check for error. */ + if((error_counter) || (fragmentation_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Check if receive IPv6 fragmentation packet from ip_0, except NA and NS(IPv6(40) + NS/NA(32)). */ + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length > 72)) + { + + /* Updated the packet_counter. */ + fragmentation_counter ++; + } + + return NX_TRUE; +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragmentation_error_test2_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Fragmentation Error Test2............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ipv6_fragmentation_test.c b/test/regression/netxduo_test/netx_ipv6_fragmentation_test.c new file mode 100644 index 00000000..2624bc68 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_fragmentation_test.c @@ -0,0 +1,275 @@ +/* This NetX test concentrates on basic IP fragmentation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(FEATURE_NX_IPV6) +#include "nx_ipv6.h" +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG fragmentation_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UCHAR buffer[4500]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragmentation_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + fragmentation_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 4800, pointer, 5000*10); + pointer = pointer + 5000*10; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + if (status) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 Fragmentation Processing Test........................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Force enable ICMPv6 checksum capability. */ + ip_0.nx_ip_interface[0].nx_interface_capability_flag |= NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM; +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Disable IP fragmentation logic on IP instance 1. */ + status = nx_ip_fragment_disable(&ip_1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Now ping an IP address that does exist. */ + memcpy(buffer, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26); + status = nxd_icmp_ping(&ip_0, &ipv6_address_1, buffer, 4500, &my_packet, TX_TIMER_TICKS_PER_SECOND); + + /* Check the status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Enable IP fragmentation logic on IP instance 1. */ + status = nx_ip_fragment_enable(&ip_1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Install IPv6 packet receive processing function pointer */ + ip_1.nx_ipv6_packet_receive = my_packet_process; + + /* Now ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_1, buffer, 4500, &my_packet, TX_TIMER_TICKS_PER_SECOND); + + /* Check the status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Install IPv6 packet receive processing function pointer */ + ip_1.nx_ipv6_packet_receive = _nx_ipv6_packet_receive; + + /* Disable IP fragmentation logic on IP instance 1 to release the fragmentation packet. */ + status = nx_ip_fragment_disable(&ip_1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on IP instance 1. */ + status = nx_ip_fragment_enable(&ip_1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Now ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_1, buffer, 4500, &my_packet, TX_TIMER_TICKS_PER_SECOND); + + /* Check the status. */ + if ((status != NX_SUCCESS) || (my_packet -> nx_packet_length != 4500)) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_IPV6_HEADER *ip_header_ptr; +UCHAR next_header_type; + + /* Points to the base of IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER*)packet_ptr -> nx_packet_prepend_ptr; + + /* Byte swap WORD 1 to obtain IPv6 payload length. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Get the next header type. */ + next_header_type = (UCHAR)((ip_header_ptr -> nx_ip_header_word_1 >> 8) & 0xFF); + + /* Check the next header type. */ + if (next_header_type == NX_PROTOCOL_NEXT_HEADER_FRAGMENT) + { + + /* Update the counter. */ + fragmentation_counter ++; + + if (fragmentation_counter == 3) + { + + /* Modified the packet length. */ + packet_ptr -> nx_packet_length = 65000; + + /* Modified the payload length. */ + ip_header_ptr -> nx_ip_header_word_1 &= 0x0000FFFF; + ip_header_ptr -> nx_ip_header_word_1 |= ((packet_ptr -> nx_packet_length - sizeof(NX_IPV6_HEADER)) << 16); + } + } + + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Directly receive the packet. */ + _nx_ipv6_packet_receive (ip_ptr, packet_ptr); +} + +#else +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_fragmentation_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Fragmentation Processing Test........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_ipv6_hop_by_hop_fragment_test.c b/test/regression/netxduo_test/netx_ipv6_hop_by_hop_fragment_test.c new file mode 100644 index 00000000..120f10b4 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_hop_by_hop_fragment_test.c @@ -0,0 +1,400 @@ +/* This NetX test concentrates on fragment IPv6 packet with hop by hop option. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(FEATURE_NX_IPV6) && !defined(NX_ENABLE_INTERFACE_CAPABILITY) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NXD_ADDRESS addr_0, addr_1; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* ICMPv6 echo request packet with hop by hop option. + * src: 0xFE80::1 + * dst: 0xFE80::2 + * length of ping data: 1400. */ +static char icmp_pkt[] = { +0xa4, 0x1f, 0x72, 0x53, 0xa0, 0xf7, 0x18, 0x03, /* ..rS.... */ +0x73, 0x29, 0x5f, 0x66, 0x86, 0xdd, 0x60, 0x00, /* s)_f..`. */ +0x00, 0x00, 0x05, 0x88, 0x00, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3a, 0x00, /* ......:. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0x18, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x61, 0x62, /* ......ab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* wabcdefg */ +0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* hijklmno */ +0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* pqrstuvw */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, /* qrstuvwa */ +0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* bcdefghi */ +0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, /* jklmnopq */ +0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, /* rstuvwab */ +0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, /* cdefghij */ +0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, /* klmnopqr */ +0x73, 0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, /* stuvwabc */ +0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */ +0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */ +0x74, 0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, /* tuvwabcd */ +0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, /* efghijkl */ +0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, /* mnopqrst */ +0x75, 0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, /* uvwabcde */ +0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, /* fghijklm */ +0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, /* nopqrstu */ +0x76, 0x77, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* vwabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74 /* opqrst */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_hop_by_hop_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 15360); + pointer = pointer + 15360; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ICMP processing. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable fragmentation */ + status += nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Enable RAW packet for IP_0.*/ + status += nx_ip_raw_packet_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Hop by Hop Fragment Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set IPv6 address. */ + addr_0.nxd_ip_version = NX_IP_VERSION_V6; + addr_0.nxd_ip_address.v6[0] = 0xFE800000; + addr_0.nxd_ip_address.v6[1] = 0x00000000; + addr_0.nxd_ip_address.v6[2] = 0x00000000; + addr_0.nxd_ip_address.v6[3] = 0x00000001; + addr_1.nxd_ip_version = NX_IP_VERSION_V6; + addr_1.nxd_ip_address.v6[0] = 0xFE800000; + addr_1.nxd_ip_address.v6[1] = 0x00000000; + addr_1.nxd_ip_address.v6[2] = 0x00000000; + addr_1.nxd_ip_address.v6[3] = 0x00000002; + + status = nxd_ipv6_address_set(&ip_0, 0, &addr_0, 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &addr_1, 10, NX_NULL); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set driver filter to replace echo request packet. */ + advanced_packet_process_callback = packet_process; + + /* Ping IP_1. */ + status = nxd_icmp_ping(&ip_0, &addr_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check status */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the length. */ + if (packet_ptr -> nx_packet_length != 1400) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + nx_packet_release(packet_ptr); + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_PACKET *my_packet; + + if ((ip_ptr == &ip_0) && (packet_ptr -> nx_packet_length == 76)) + { + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* Inject Echo Request packet. */ + if (nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, NX_WAIT_FOREVER) == NX_SUCCESS) + { + + /* Fill in the packet with data. Skip the MAC and IPv6 header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &icmp_pkt[54], sizeof(icmp_pkt) - 54); + my_packet -> nx_packet_length = sizeof(icmp_pkt) - 54; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Send by RAW service. */ + nxd_ip_raw_packet_send(ip_ptr, my_packet, &addr_1, NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, 255, NX_IP_NORMAL); + } + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_hop_by_hop_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 Hop by Hop Fragment Test.............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_ICMP_INFO */ diff --git a/test/regression/netxduo_test/netx_ipv6_hop_by_hop_option_error_test.c b/test/regression/netxduo_test/netx_ipv6_hop_by_hop_option_error_test.c new file mode 100644 index 00000000..4e2a133a --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_hop_by_hop_option_error_test.c @@ -0,0 +1,279 @@ +/* This NetX test to test the IPv6 onlink search. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMP_INFO) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void icmp_checksum_compute(NX_PACKET *packet_ptr); + + +static char pkt1[78] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x00, 0xff, 0xfe, 0x80, /* ... .... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_hop_by_hop_option_error_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*4); + pointer = pointer + 1536*4; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check IP create status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Hop By Hop Option Error Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address*/ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 64); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 64; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 64; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the ICMPv6 Request with hop by hop option. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_pings_received != 1) || (ip_0.nx_ip_pings_responded_to != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 64); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 64; + + /* Set the error append pointer. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 46; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* Calculate the ICMP checksum. */ + icmp_checksum_compute(my_packet); + + /* Call the _nx_ip_packet_receive function directly receive the ICMPv6 Request with hop by hop option. */ + _nx_ip_packet_receive(&ip_0, my_packet); + + /* Check the value. */ + if ((ip_0.nx_ip_pings_received != 1) || (ip_0.nx_ip_pings_responded_to != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* buffer overread test */ + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], 64); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 64; + + /* Set the error append pointer. */ + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 1; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + /* invoke _nx_ipv6_process_hop_by_hop_option with error packet. */ + status = _nx_ipv6_process_hop_by_hop_option(NX_NULL, my_packet); + + /* Check the status. */ + if (status != NX_OPTION_HEADER_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Out successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +static void icmp_checksum_compute(NX_PACKET *packet_ptr) +{ +NX_ICMPV6_HEADER *header_ptr; +ULONG *source_ip, *dest_ip; +ULONG checksum; + + /* Set packet version. */ + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Get IPv6 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 24); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(dest_ip); + + /* Skip IPv6 header and hop by hop header. */ + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV6_HEADER) + 8; + packet_ptr -> nx_packet_length -= sizeof(NX_IPV6_HEADER) + 8; + + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the ICMP checksum. */ + header_ptr -> nx_icmpv6_header_checksum = 0; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_ICMPV6, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + header_ptr -> nx_icmpv6_header_checksum = checksum; + NX_CHANGE_USHORT_ENDIAN(header_ptr -> nx_icmpv6_header_checksum); + + /* Recover IPv6 header. */ + NX_IPV6_ADDRESS_CHANGE_ENDIAN(source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(dest_ip); + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV6_HEADER) + 8; + packet_ptr -> nx_packet_length += sizeof(NX_IPV6_HEADER) + 8; +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_hop_by_hop_option_error_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Hop By Hop Option Error Test.........................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_interface_detachment_router_test.c b/test/regression/netxduo_test/netx_ipv6_interface_detachment_router_test.c new file mode 100644 index 00000000..4b475655 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_interface_detachment_router_test.c @@ -0,0 +1,196 @@ +/* Test the default router after interface detachment. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_ICMPV6_ROUTER_ADVERTISEMENT_PROCESS) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static VOID thread_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static char ra_pkt[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x1c, 0xb4, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, /* ..@..... */ +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_interface_detachment_router_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +UINT num_entries; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Interface Detachment Router Test....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + /* Inject RA packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &ra_pkt[14], sizeof(ra_pkt) - 14); + packet_ptr -> nx_packet_length = sizeof(ra_pkt) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Check whether one router is added. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 1) + error_counter++; + + + /* Detach the interface from IP instance. */ + status += nx_ip_interface_detach(&ip_0, 0); + + if(status) + error_counter++; + + + /* Check whether no router is available. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, &num_entries); + + /* Check status */ + if(status) + error_counter++; + + if (num_entries != 0) + error_counter++; + + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_interface_detachment_router_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Interface Detachment Router Test.....................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_invalid_packet_receive_test.c b/test/regression/netxduo_test/netx_ipv6_invalid_packet_receive_test.c new file mode 100644 index 00000000..24cb2e90 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_invalid_packet_receive_test.c @@ -0,0 +1,333 @@ +/* This NetX test concentrates on the IPv6 receive the invalid packet operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG icmp_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x07, 0x2b, 0xff, 0x20, 0x01, /* ... .... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x20, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3a, 0x00, /* "..3DV:. */ +0x01, 0x04, 0x00, 0x00, 0x00, +}; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3c, 0xff, 0x20, 0x01, /* ... .... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x20, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x3c, 0x00, /* "..3DV:. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, /* ........ */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_invalid_packet_receive_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMPv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT drop_counter = 0; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Invalid Packet Receive Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the callback function to get the IPv6 packet. */ + ip_1.nx_ipv6_packet_receive = my_packet_process; + + /* Ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status == NX_SUCCESS) || (my_packet)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14 + 40], sizeof(pkt1) - 14 - 40); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = sizeof(pkt1) - 14 - 40; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + + status = _nx_ipv6_process_routing_option(&ip_0, my_packet); + + /* Check the status. */ + if (status != NX_OPTION_HEADER_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_FRAGMENTATION + + nx_ip_fragment_enable(&ip_0); + + status = _nx_ipv6_process_fragment_option(&ip_0, my_packet); + + /* Check the status. */ + if (status != NX_OPTION_HEADER_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + nx_packet_release(my_packet); + + /* Allocate one packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Write data into the packet payload, ignore the physical header! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = sizeof(pkt2) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + /* Set the interface. */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V6; + + drop_counter = ip_0.nx_ip_receive_packets_dropped; + + /* Cover nx_ip_dispatch_process.c line 185. */ + _nx_ipv6_packet_receive(&ip_0, my_packet); +#ifndef NX_DISABLE_IP_INFO + if (drop_counter == ip_0.nx_ip_receive_packets_dropped) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check the error counter and icmp counter. */ + if ((error_counter) || (icmp_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +NX_PACKET *my_packet; +NX_IPV6_HEADER *ip_header_ptr; + + + /* Check the packet length. */ + if (packet_ptr ->nx_packet_length == 76) // 28(DATA) + 8(ICMP HEADER) + 40(IPV6 HEADER) + { + + /* Get the ICMP packet. */ + icmp_counter ++; + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, &my_packet, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter ++; + + + /**********************************************************/ + /* nx_packet_length < pkt_length nx_ipv6_packet_receive() */ + /**********************************************************/ + + /* Get the IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_1 += 0x00010000; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Set the address state as NX_IPV6_ADDR_STATE_UNKNOWN, and receive the packet again, then recover the state. + Cover the code if (interface_ipv6_address_next -> nxd_ipv6_address_state != NX_IPV6_ADDR_STATE_UNKNOWN) in _nx_ipv6_packet_receive. */ + ip_1.nx_ipv6_address[0].nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_UNKNOWN; + _nx_ipv6_packet_receive(&ip_1, my_packet); + ip_1.nx_ipv6_address[0].nxd_ipv6_address_state = NX_IPV6_ADDR_STATE_VALID; + } + + /* Call the _nx_ipv6_packet_receive function directly receive this packet. */ + _nx_ipv6_packet_receive(&ip_1, packet_ptr); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_invalid_packet_receive_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Invalid Packet Receive Test..........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_multicast_basic_test.c b/test/regression/netxduo_test/netx_ipv6_multicast_basic_test.c new file mode 100644 index 00000000..242b7195 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_multicast_basic_test.c @@ -0,0 +1,296 @@ +/* This NetX test concentrates on the basic multicast IGMP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS group_address[8]; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Multicast Basic Operation Test......................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the group address . */ + group_address[0].nxd_ip_version = NX_IP_VERSION_V6; + group_address[0].nxd_ip_address.v6[0] = 0xff020000; + group_address[0].nxd_ip_address.v6[1] = 0x00000000; + group_address[0].nxd_ip_address.v6[2] = 0x00000000; + group_address[0].nxd_ip_address.v6[3] = 0x01020301; + + /* Set the group address . */ + group_address[1].nxd_ip_version = NX_IP_VERSION_V6; + group_address[1].nxd_ip_address.v6[0] = 0xff020000; + group_address[1].nxd_ip_address.v6[1] = 0x00000000; + group_address[1].nxd_ip_address.v6[2] = 0x00000000; + group_address[1].nxd_ip_address.v6[3] = 0x01020302; + + /* Set the group address . */ + group_address[2].nxd_ip_version = NX_IP_VERSION_V6; + group_address[2].nxd_ip_address.v6[0] = 0xff020000; + group_address[2].nxd_ip_address.v6[1] = 0x00000000; + group_address[2].nxd_ip_address.v6[2] = 0x00000000; + group_address[2].nxd_ip_address.v6[3] = 0x01020303; + + /* Set the group address . */ + group_address[3].nxd_ip_version = NX_IP_VERSION_V6; + group_address[3].nxd_ip_address.v6[0] = 0xff020000; + group_address[3].nxd_ip_address.v6[1] = 0x00000000; + group_address[3].nxd_ip_address.v6[2] = 0x00000000; + group_address[3].nxd_ip_address.v6[3] = 0x01020304; + + /* Set the group address . */ + group_address[4].nxd_ip_version = NX_IP_VERSION_V6; + group_address[4].nxd_ip_address.v6[0] = 0xff020000; + group_address[4].nxd_ip_address.v6[1] = 0x00000000; + group_address[4].nxd_ip_address.v6[2] = 0x00000000; + group_address[4].nxd_ip_address.v6[3] = 0x01020305; + + /* Set the group address . */ + group_address[5].nxd_ip_version = NX_IP_VERSION_V6; + group_address[5].nxd_ip_address.v6[0] = 0xff020000; + group_address[5].nxd_ip_address.v6[1] = 0x00000000; + group_address[5].nxd_ip_address.v6[2] = 0x00000000; + group_address[5].nxd_ip_address.v6[3] = 0x01020306; + + /* Set the group address . */ + group_address[6].nxd_ip_version = NX_IP_VERSION_V6; + group_address[6].nxd_ip_address.v6[0] = 0xff020000; + group_address[6].nxd_ip_address.v6[1] = 0x00000000; + group_address[6].nxd_ip_address.v6[2] = 0x00000000; + group_address[6].nxd_ip_address.v6[3] = 0x01020307; + + /* Set the group address . */ + group_address[7].nxd_ip_version = NX_IP_VERSION_V6; + group_address[7].nxd_ip_address.v6[0] = 0xff020000; + group_address[7].nxd_ip_address.v6[1] = 0x00000000; + group_address[7].nxd_ip_address.v6[2] = 0x00000000; + group_address[7].nxd_ip_address.v6[3] = 0x01020308; + + /* Perform IGMP join operations. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address[0], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[1], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[1], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[2], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[2], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[2], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 0); + + /* Check status. */ + if(status) + error_counter ++; + + /* Attempt to join a new group. This should result in an error. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address[7], 0); + + /* Check status. */ + if(!status) + error_counter ++; + + /* Check the groups info. */ + if((ip_0.nx_ipv6_multicast_groups_joined != 7) || + (ip_0.nx_ipv6_multicast_entry[0].nx_ip_mld_join_count != 1) || + (ip_0.nx_ipv6_multicast_entry[1].nx_ip_mld_join_count != 2) || + (ip_0.nx_ipv6_multicast_entry[2].nx_ip_mld_join_count != 3) || + (ip_0.nx_ipv6_multicast_entry[3].nx_ip_mld_join_count != 4) || + (ip_0.nx_ipv6_multicast_entry[4].nx_ip_mld_join_count != 5) || + (ip_0.nx_ipv6_multicast_entry[5].nx_ip_mld_join_count != 6) || + (ip_0.nx_ipv6_multicast_entry[6].nx_ip_mld_join_count != 7)) + error_counter ++; + + /* Leave the every group . */ + status = nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[0], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[1], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[2], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + + /* Check status. */ + if(status) + error_counter ++; + + /* Check the groups info. */ + if((ip_0.nx_ipv6_multicast_groups_joined != 6) || + (ip_0.nx_ipv6_multicast_entry[0].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[1].nx_ip_mld_join_count != 1) || + (ip_0.nx_ipv6_multicast_entry[2].nx_ip_mld_join_count != 2) || + (ip_0.nx_ipv6_multicast_entry[3].nx_ip_mld_join_count != 3) || + (ip_0.nx_ipv6_multicast_entry[4].nx_ip_mld_join_count != 4) || + (ip_0.nx_ipv6_multicast_entry[5].nx_ip_mld_join_count != 5) || + (ip_0.nx_ipv6_multicast_entry[6].nx_ip_mld_join_count != 6)) + error_counter ++; + + /* Leave the group 0 again. This should result in an error. */ + status = nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[0], 0); + + /* Check status. */ + if(!status) + error_counter ++; + + /* Leave the every group . */ + status = nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[1], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[2], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[2], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[3], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[4], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[5], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + status += nxd_ipv6_multicast_interface_leave(&ip_0, &group_address[6], 0); + + /* Check status. */ + if(status) + error_counter ++; + + /* Check the groups info. */ + if((ip_0.nx_ipv6_multicast_groups_joined != 0) || + (ip_0.nx_ipv6_multicast_entry[0].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[1].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[2].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[3].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[4].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[5].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[6].nx_ip_mld_join_count != 0)) + error_counter ++; + + /* Check for status. */ + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Multicast Basic Operation Test.......................N/A\n"); + test_control_return(3); + +} +#endif /* NX_ENABLE_IPV6_MULTICAST */ diff --git a/test/regression/netxduo_test/netx_ipv6_multicast_interface_detach_test.c b/test/regression/netxduo_test/netx_ipv6_multicast_interface_detach_test.c new file mode 100644 index 00000000..2ac5b88c --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_multicast_interface_detach_test.c @@ -0,0 +1,232 @@ +/* This NetX test concentrates on the basic multicast IGMP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if(status) + error_counter++; + + /* Attach the 2nd interface to IP instance0 */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + /* Check the status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS group_address[8]; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Multicast Interface Detach Test......................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the group address . */ + group_address[0].nxd_ip_version = NX_IP_VERSION_V6; + group_address[0].nxd_ip_address.v6[0] = 0xff020000; + group_address[0].nxd_ip_address.v6[1] = 0x00000000; + group_address[0].nxd_ip_address.v6[2] = 0x00000000; + group_address[0].nxd_ip_address.v6[3] = 0x01020301; + + /* Set the group address . */ + group_address[1].nxd_ip_version = NX_IP_VERSION_V6; + group_address[1].nxd_ip_address.v6[0] = 0xff020000; + group_address[1].nxd_ip_address.v6[1] = 0x00000000; + group_address[1].nxd_ip_address.v6[2] = 0x00000000; + group_address[1].nxd_ip_address.v6[3] = 0x01020302; + + /* Set the group address . */ + group_address[2].nxd_ip_version = NX_IP_VERSION_V6; + group_address[2].nxd_ip_address.v6[0] = 0xff020000; + group_address[2].nxd_ip_address.v6[1] = 0x00000000; + group_address[2].nxd_ip_address.v6[2] = 0x00000000; + group_address[2].nxd_ip_address.v6[3] = 0x01020303; + + /* Set the group address . */ + group_address[3].nxd_ip_version = NX_IP_VERSION_V6; + group_address[3].nxd_ip_address.v6[0] = 0xff020000; + group_address[3].nxd_ip_address.v6[1] = 0x00000000; + group_address[3].nxd_ip_address.v6[2] = 0x00000000; + group_address[3].nxd_ip_address.v6[3] = 0x01020304; + + /* Set the group address . */ + group_address[4].nxd_ip_version = NX_IP_VERSION_V6; + group_address[4].nxd_ip_address.v6[0] = 0xff020000; + group_address[4].nxd_ip_address.v6[1] = 0x00000000; + group_address[4].nxd_ip_address.v6[2] = 0x00000000; + group_address[4].nxd_ip_address.v6[3] = 0x01020305; + + /* Set the group address . */ + group_address[5].nxd_ip_version = NX_IP_VERSION_V6; + group_address[5].nxd_ip_address.v6[0] = 0xff020000; + group_address[5].nxd_ip_address.v6[1] = 0x00000000; + group_address[5].nxd_ip_address.v6[2] = 0x00000000; + group_address[5].nxd_ip_address.v6[3] = 0x01020306; + + /* Set the group address . */ + group_address[6].nxd_ip_version = NX_IP_VERSION_V6; + group_address[6].nxd_ip_address.v6[0] = 0xff020000; + group_address[6].nxd_ip_address.v6[1] = 0x00000000; + group_address[6].nxd_ip_address.v6[2] = 0x00000000; + group_address[6].nxd_ip_address.v6[3] = 0x01020307; + + /* Set the group address . */ + group_address[7].nxd_ip_version = NX_IP_VERSION_V6; + group_address[7].nxd_ip_address.v6[0] = 0xff020000; + group_address[7].nxd_ip_address.v6[1] = 0x00000000; + group_address[7].nxd_ip_address.v6[2] = 0x00000000; + group_address[7].nxd_ip_address.v6[3] = 0x01020308; + + /* Perform IGMP join operations. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address[0], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[1], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[1], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[2], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[2], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[2], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[3], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[4], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[5], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address[6], 1); + + /* Check status. */ + if(status) + error_counter ++; + + /* Detach the seconde interface. */ + status = nx_ip_interface_detach(&ip_0, 1); + + /* Check status. */ + if(status) + error_counter ++; + + /* Check the groups info. */ + if((ip_0.nx_ipv6_multicast_groups_joined != 0) || + (ip_0.nx_ipv6_multicast_entry[0].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[1].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[2].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[3].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[4].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[5].nx_ip_mld_join_count != 0) || + (ip_0.nx_ipv6_multicast_entry[6].nx_ip_mld_join_count != 0)) + error_counter ++; + + /* Check for status. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Multicast Interface Detach Test......................N/A\n"); + test_control_return(3); +} +#endif /* NX_ENABLE_IPV6_MULTICAST */ diff --git a/test/regression/netxduo_test/netx_ipv6_multicast_ping_test.c b/test/regression/netxduo_test/netx_ipv6_multicast_ping_test.c new file mode 100644 index 00000000..9c555065 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_multicast_ping_test.c @@ -0,0 +1,311 @@ +/* This NetX test concentrates on the basic multicast IGMP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_0_1; +static NXD_ADDRESS global_address_1; +static NXD_ADDRESS global_address_2; +static UINT address_index_0_1; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_ping_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_2, "NetX IP Instance 2", IP_ADDRESS(1, 2, 3, 6), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Set the second interface. */ + status = nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + status += nxd_ipv6_enable(&ip_2); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + status += nxd_icmp_enable(&ip_2); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the second ipv6 global address for IP instance 0. */ + global_address_0_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_0_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_0_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_0_1.nxd_ip_address.v6[3] = 0x20000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 1, &global_address_0_1, 64, &address_index_0_1); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 2. */ + global_address_2.nxd_ip_version = NX_IP_VERSION_V6; + global_address_2.nxd_ip_address.v6[0] = 0x20010000; + global_address_2.nxd_ip_address.v6[1] = 0x00000000; + global_address_2.nxd_ip_address.v6[2] = 0x00000000; + global_address_2.nxd_ip_address.v6[3] = 0x10000003; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_2, 0, &global_address_2, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS group_address; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Multicast Ping Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the group address . */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0xff020000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x01020301; + + /* Ping group address before joining. */ + status = nxd_icmp_ping(&ip_0, &group_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Perform IGMP join operations. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address, 0); + status += nxd_ipv6_multicast_interface_join(&ip_0, &group_address, 1); + status += nxd_ipv6_multicast_interface_join(&ip_1, &group_address, 0); + status += nxd_ipv6_multicast_interface_join(&ip_2, &group_address, 0); + + /* Check status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Now ping an Multicast address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &group_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IPV4 + /* Get ICMP information. */ + status = nx_icmp_info_get(&ip_0, &pings_sent, &ping_timeouts, &ping_threads_suspended, &ping_responses_received, &icmp_checksum_errors, &icmp_unhandled_messages); + +#ifndef NX_DISABLE_ICMP_INFO + if ((ping_timeouts != 0) || (pings_sent != 1) || (ping_responses_received != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS) || (my_packet == NX_NULL) || (my_packet -> nx_packet_length != 28 /* data only */) || + (ping_threads_suspended) || (icmp_checksum_errors) || (icmp_unhandled_messages)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Release the response packet. */ + nx_packet_release(my_packet); + + /* Disable the primary interace. */ + ip_0.nx_ip_interface[0].nx_interface_link_up = NX_FALSE; + + /* And now ping an Multicast address that does exist. */ + status = nxd_icmp_ping(&ip_0, &group_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the response packet. */ + nx_packet_release(my_packet); + + /* Delete the address of the second interface. */ + nxd_ipv6_address_delete(&ip_0, address_index_0_1); + + /* And now ping an Multicast address that does exist. */ + status = nxd_icmp_ping(&ip_0, &group_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + if (status != NX_NO_INTERFACE_ADDRESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_ping_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Multicast Ping Test..................................N/A\n"); + test_control_return(3); + +} +#endif /* NX_ENABLE_IPV6_MULTICAST */ diff --git a/test/regression/netxduo_test/netx_ipv6_multicast_ping_test1.c b/test/regression/netxduo_test/netx_ipv6_multicast_ping_test1.c new file mode 100644 index 00000000..ae020154 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_multicast_ping_test1.c @@ -0,0 +1,193 @@ +/* This NetX test concentrates on the basic multicast ICMPv6 operation. + * Two nodes (A and B) with link local addresses. + * Let node A finish DAD first. + * Let node A ping all node multicast address. + * Since the state of address for node B is still tentative, B would not respond A. + * Let node B finish DAD. + * Let node A ping all node multicast address. + * Check the return status of ping from A. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV6_DAD) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_ping_test1_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS multicast_address; +NX_PACKET *my_packet; +ULONG pings_sent; +ULONG ping_timeouts; +ULONG ping_threads_suspended; +ULONG ping_responses_received; +ULONG icmp_checksum_errors; +ULONG icmp_unhandled_messages; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Multicast Ping Test 1................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, NX_NULL, 10, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the group address . */ + multicast_address.nxd_ip_version = NX_IP_VERSION_V6; + multicast_address.nxd_ip_address.v6[0] = 0xff020000; + multicast_address.nxd_ip_address.v6[1] = 0x00000000; + multicast_address.nxd_ip_address.v6[2] = 0x00000000; + multicast_address.nxd_ip_address.v6[3] = 0x00000001; + + /* Ping multicast address before DAD of IP_1 is done. */ + status = nxd_icmp_ping(&ip_0, &multicast_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Now ping an Multicast address that does exist. */ + /* The reply packet contains checksum 0. */ + status = nxd_icmp_ping(&ip_0, &multicast_address, "PjCZEZGZIZKZMZOZQZSZUZWZYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_multicast_ping_test1_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: IPv6 Multicast Ping Test 1................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_nd_cache_api_test.c b/test/regression/netxduo_test/netx_ipv6_nd_cache_api_test.c new file mode 100644 index 00000000..f5341c49 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_nd_cache_api_test.c @@ -0,0 +1,384 @@ +/* Test IPv6 ND CACHE APIs. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#define MAX_TEST_INTERFACES 2 + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES >= MAX_TEST_INTERFACES) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_nd_cache_api_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 0,&ipv6_address_0, 64, NX_NULL); + + if(status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_512); + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20020000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_1, 64, NX_NULL); + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS dest_address[4]; +CHAR dest_mac[4][6]; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS invalid_address; +ULONG physical_msw; +ULONG physical_lsw; +UINT interface_index; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 ND Cache API Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the Destination address and mac address. */ + dest_address[0].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[0].nxd_ip_address.v6[0] = 0x20010000; + dest_address[0].nxd_ip_address.v6[1] = 0x00000000; + dest_address[0].nxd_ip_address.v6[2] = 0x00000000; + dest_address[0].nxd_ip_address.v6[3] = 0x01020305; + + dest_mac[0][0] = 0x11; + dest_mac[0][1] = 0x22; + dest_mac[0][2] = 0x33; + dest_mac[0][3] = 0x44; + dest_mac[0][4] = 0x55; + dest_mac[0][5] = 0x69; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[0].nxd_ip_address.v6[0], 0, &dest_mac[0][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[1].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[1].nxd_ip_address.v6[0] = 0x20010000; + dest_address[1].nxd_ip_address.v6[1] = 0x00000000; + dest_address[1].nxd_ip_address.v6[2] = 0x00000000; + dest_address[1].nxd_ip_address.v6[3] = 0x01020306; + + dest_mac[1][0] = 0x11; + dest_mac[1][1] = 0x22; + dest_mac[1][2] = 0x33; + dest_mac[1][3] = 0x44; + dest_mac[1][4] = 0x55; + dest_mac[1][5] = 0x70; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[1].nxd_ip_address.v6[0], 0, &dest_mac[1][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[2].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[2].nxd_ip_address.v6[0] = 0x20020000; + dest_address[2].nxd_ip_address.v6[1] = 0x00000000; + dest_address[2].nxd_ip_address.v6[2] = 0x00000000; + dest_address[2].nxd_ip_address.v6[3] = 0x01020305; + + dest_mac[2][0] = 0x11; + dest_mac[2][1] = 0x22; + dest_mac[2][2] = 0x33; + dest_mac[2][3] = 0x44; + dest_mac[2][4] = 0x66; + dest_mac[2][5] = 0x69; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[2].nxd_ip_address.v6[0], 1, &dest_mac[2][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[3].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[3].nxd_ip_address.v6[0] = 0x20020000; + dest_address[3].nxd_ip_address.v6[1] = 0x00000000; + dest_address[3].nxd_ip_address.v6[2] = 0x00000000; + dest_address[3].nxd_ip_address.v6[3] = 0x01020306; + + dest_mac[3][0] = 0x11; + dest_mac[3][1] = 0x22; + dest_mac[3][2] = 0x33; + dest_mac[3][3] = 0x44; + dest_mac[3][4] = 0x66; + dest_mac[3][5] = 0x70; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[3].nxd_ip_address.v6[0], 1, &dest_mac[3][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[0], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 0) || + (physical_msw != 0x00001122) || + (physical_lsw != 0x33445569)) + error_counter ++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[3], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (physical_msw != 0x00001122) || + (physical_lsw != 0x33446670)) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33445570, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 0) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address[1].nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address[1].nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address[1].nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address[1].nxd_ip_address.v6[3])) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446669, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address[2].nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address[2].nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address[2].nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address[2].nxd_ip_address.v6[3])) + error_counter ++; + + /* Set an invalid address. */ + invalid_address.nxd_ip_version = NX_IP_VERSION_V6; + invalid_address.nxd_ip_address.v6[0] = 0x30000000; + invalid_address.nxd_ip_address.v6[1] = 0x00000000; + invalid_address.nxd_ip_address.v6[2] = 0x00000000; + invalid_address.nxd_ip_address.v6[3] = 0x11111111; + + /* Delete the ND Cache entry with invalid address. */ + status = nxd_nd_cache_entry_delete(&ip_0, &invalid_address.nxd_ip_address.v6[0]); + + /* Check status. */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* Delete the ND Cache entry. */ + status = nxd_nd_cache_entry_delete(&ip_0, &dest_address[0].nxd_ip_address.v6[0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the destination address 0. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[0], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Invalidate the all address. */ + status = nxd_nd_cache_invalidate(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the mac address 0 by destination address 0. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[0], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the mac address 1 by destination address 1. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[1], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the mac address 2 by destination address 2. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[2], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the mac address 3 by destination address 3. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[3], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 0 by hardware address 0. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33445569, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 1 by hardware address 1. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33445570, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 2 by hardware address 2. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446669, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 3 by hardware address 3. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446670, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_nd_cache_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 ND Cache API Test....................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_nxe_api_test.c b/test/regression/netxduo_test/netx_ipv6_nxe_api_test.c new file mode 100644 index 00000000..61ee1de2 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_nxe_api_test.c @@ -0,0 +1,991 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG prefix_length; +UINT interface_index; +UINT address_index; +ULONG router_lifetime; +ULONG configuration_method; +UINT num_entries; +NXD_ADDRESS ip_address; +NXD_ADDRESS router_addr; +#ifdef NX_ENABLE_IPV6_MULTICAST +NXD_ADDRESS group_address; +#endif + + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 NXE API Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + /**************************************************/ + /* Tested the nxde_ipv6_address_change_notify api */ + /**************************************************/ + + /* Set the IPV6 address change notify function for NULL IP instance. */ + status = nxd_ipv6_address_change_notify(NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the IPv6 address change notify function for invalid IP instance. */ + status = nxd_ipv6_address_change_notify(&invalid_ip, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /************************************************/ + /* Tested the nxde_ipv6_address_delete api */ + /************************************************/ + + /* Delete the IPv6 address with NULL IP instance. */ + status = nxd_ipv6_address_delete(NX_NULL, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the IPv6 address with invalid IP instance. */ + status = nxd_ipv6_address_delete(&invalid_ip, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the IPv6 address with invalid address index. */ + status = nxd_ipv6_address_delete(&ip_0, NX_MAX_IPV6_ADDRESSES); + + /* Check for error. */ + if (status != NX_NO_INTERFACE_ADDRESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_ipv6_address_get api */ + /************************************************/ + + /* Get the IPv6 address with NULL IP instance. */ + status = nxd_ipv6_address_get(NX_NULL, 0, &ip_address, &prefix_length, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the IPv6 address with invalid IP instance. */ + status = nxd_ipv6_address_get(&invalid_ip, 0, &ip_address, &prefix_length, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IP address with NULL address pointer. */ + status = nxd_ipv6_address_get(&ip_0, 0, NX_NULL, &prefix_length, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address with NULL prefix length pointer. */ + status = nxd_ipv6_address_get(&ip_0, 0, &ip_address, NX_NULL, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address with NULL interface index pointer. */ + status = nxd_ipv6_address_get(&ip_0, 0, &ip_address, &prefix_length, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IPv6 address with invalid address index. */ + status = nxd_ipv6_address_get(&ip_0, (NX_MAX_IPV6_ADDRESSES + NX_LOOPBACK_IPV6_ENABLED), &ip_address, &prefix_length, &interface_index); + + /* Check for error. */ + if (status != NX_NO_INTERFACE_ADDRESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_ipv6_address_set api */ + /************************************************/ + + /* Set the IPv6 address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x20010000; + ip_address.nxd_ip_address.v6[1] = 0x00000000; + ip_address.nxd_ip_address.v6[2] = 0x00000000; + ip_address.nxd_ip_address.v6[3] = 0x00001234; + + /* Set the IPv6 address with NULL IP instance. */ + status = nxd_ipv6_address_set(NX_NULL, 0, &ip_address, 64, &address_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the IPv6 address with invalid IP instance. */ + status = nxd_ipv6_address_set(&invalid_ip, 0, &ip_address, 64, &address_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address with invalid version. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Set the IP address with invalid address version. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ip_address, 64, &address_index); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the IPv6 address version. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + + /* Set the IP address with invalid interface index. */ + status = nxd_ipv6_address_set(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &ip_address, 64, &address_index); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the IPv6 address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V6; + ip_address.nxd_ip_address.v6[0] = 0x00000000; + ip_address.nxd_ip_address.v6[1] = 0x00000000; + ip_address.nxd_ip_address.v6[2] = 0x00000000; + ip_address.nxd_ip_address.v6[3] = 0x00000000; + + /* Set the IPv6 address with NULL prefix length pointer. */ + status = nxd_ipv6_address_set(&ip_0, 0, &ip_address, 64, &address_index); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_ipv6_default_router_add api */ + /************************************************/ + + /* Set the router IPv6 address. */ + router_addr.nxd_ip_version = NX_IP_VERSION_V6; + router_addr.nxd_ip_address.v6[0] = 0x20010000; + router_addr.nxd_ip_address.v6[1] = 0x00000000; + router_addr.nxd_ip_address.v6[2] = 0x00000000; + router_addr.nxd_ip_address.v6[3] = 0x00000001; + + /* Add the default router address with NULL IP instance. */ + status = nxd_ipv6_default_router_add(NX_NULL, &router_addr, 1000, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Add the default router address with invalid IP instance. */ + status = nxd_ipv6_default_router_add(&invalid_ip, &router_addr, 1000, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add the default router address with NULL router address pointer. */ + status = nxd_ipv6_default_router_add(&ip_0, NX_NULL, 1000, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address with invalid address version. */ + router_addr.nxd_ip_version = NX_IP_VERSION_V4; + + /* Add the default router address with invalid address version. */ + status = nxd_ipv6_default_router_add(&ip_0, &router_addr, 1000, 0); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the IPv6 address version. */ + router_addr.nxd_ip_version = NX_IP_VERSION_V6; + + /* Add the default router address with invalid interface index. */ + status = nxd_ipv6_default_router_add(&ip_0, &router_addr, 1000, NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Add the default router address with invalid interface index. */ + status = nxd_ipv6_default_router_add(&ip_0, &router_addr, 1000, 1); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***************************************************/ + /* Tested the nxde_ipv6_default_router_delete api */ + /***************************************************/ + + /* Set the router IPv6 address. */ + router_addr.nxd_ip_version = NX_IP_VERSION_V6; + router_addr.nxd_ip_address.v6[0] = 0x20010000; + router_addr.nxd_ip_address.v6[1] = 0x00000000; + router_addr.nxd_ip_address.v6[2] = 0x00000000; + router_addr.nxd_ip_address.v6[3] = 0x00000001; + + /* Delete the default router address with NULL IP instance. */ + status = nxd_ipv6_default_router_delete(NX_NULL, &router_addr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the default router address with invalid IP instance. */ + status = nxd_ipv6_default_router_delete(&invalid_ip, &router_addr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the default router address with NULL router address pointer. */ + status = nxd_ipv6_default_router_delete(&ip_0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address with invalid address version. */ + router_addr.nxd_ip_version = NX_IP_VERSION_V4; + + /* Delete the default router address with invalid address version. */ + status = nxd_ipv6_default_router_delete(&ip_0, &router_addr); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*****************************************************/ + /* Tested the nxde_ipv6_default_router_entry_get api */ + /*****************************************************/ + + /* Get the default router address with NULL IP instance. */ + status = nxd_ipv6_default_router_entry_get(NX_NULL, 0, 0, &router_addr, &router_lifetime, &prefix_length, &configuration_method); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the default router address with invalid IP instance. */ + status = nxd_ipv6_default_router_entry_get(&invalid_ip, 0, 0, &router_addr, &router_lifetime, &prefix_length, &configuration_method); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with invalid interface index. */ + status = nxd_ipv6_default_router_entry_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, 0, &router_addr, &router_lifetime, &prefix_length, &configuration_method); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with invalid entry index. */ + status = nxd_ipv6_default_router_entry_get(&ip_0, 0, NX_IPV6_DEFAULT_ROUTER_TABLE_SIZE, &router_addr, &router_lifetime, &prefix_length, &configuration_method); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*****************************************************/ + /* Tested the nxde_ipv6_default_router_get api */ + /*****************************************************/ + + /* Get the default router address with NULL IP instance. */ + status = nxd_ipv6_default_router_get(NX_NULL, 0, &router_addr, &router_lifetime, &prefix_length); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the default router address with invalid IP instance. */ + status = nxd_ipv6_default_router_get(&invalid_ip, 0, &router_addr, &router_lifetime, &prefix_length); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with NULL router address pointer. */ + status = nxd_ipv6_default_router_get(&ip_0, 0, NX_NULL, &router_lifetime, &prefix_length); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with NULL router lifetime pointer. */ + status = nxd_ipv6_default_router_get(&ip_0, 0, &router_addr, NX_NULL, &prefix_length); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with NULL prefix length. */ + status = nxd_ipv6_default_router_get(&ip_0, 0, &router_addr, &router_lifetime, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with invalid interface index. */ + status = nxd_ipv6_default_router_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &router_addr, &router_lifetime, &prefix_length); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*****************************************************************/ + /* Tested the nxde_ipv6_default_router_number_of_entries_get api */ + /*****************************************************************/ + + /* Get the default router number with NULL IP instance. */ + status = nxd_ipv6_default_router_number_of_entries_get(NX_NULL, 0, &num_entries); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the default router number with invalid IP instance. */ + status = nxd_ipv6_default_router_number_of_entries_get(&invalid_ip, 0, &num_entries); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router number with NULL num entries pointer. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, 0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the default router address with invalid interface index. */ + status = nxd_ipv6_default_router_number_of_entries_get(&ip_0, NX_MAX_PHYSICAL_INTERFACES, &num_entries); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_ipv6_disable api */ + /************************************************/ + + /* Disable the IPv6 feature with NULL IP instance. */ + status = nxd_ipv6_disable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Disable the IPv6 feature with invalid IP instance. */ + status = nxd_ipv6_disable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_ipv6_enable api */ + /************************************************/ + + /* Enable the IPv6 feature with NULL IP instance. */ + status = nxd_ipv6_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the IPv6 feature with invalid IP instance. */ + status = nxd_ipv6_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_IPV6_MULTICAST + /*************************************************************/ + /* Tested the nxde_ipv6_multicast_interface_join api */ + /*************************************************************/ + + /* Set the IPv6 Multicast group address. */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0xFF020000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x000000FB; + + /* Join the IPv6 multicast group with NULL IP instance. */ + status = nxd_ipv6_multicast_interface_join(NX_NULL, &group_address, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Join the IPv6 multicast group with invalid IP instance. */ + status = nxd_ipv6_multicast_interface_join(&invalid_ip, &group_address, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the IPv6 multicast group with NULL group address pointer. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, NX_NULL, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid multicast address. */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0x20010000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x00001234; + + /* Join the IPv6 multicast group with invalid multicast address. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address, 0); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the IPv6 Multicast group address. */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0xFF020000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x000000FB; + + /* Join the IPv6 multicast group with invalid interface index. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address, NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Join the IPv6 multicast group with invalid interface index. */ + status = nxd_ipv6_multicast_interface_join(&ip_0, &group_address, 1); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*************************************************************/ + /* Tested the nxde_ipv6_multicast_interface_leave api */ + /*************************************************************/ + + /* Set the IPv6 Multicast group address. */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0xFF020000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x000000FB; + + /* Leave the IPv6 multicast group with NULL IP instance. */ + status = nxd_ipv6_multicast_interface_leave(NX_NULL, &group_address, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Leave the IPv6 multicast group with invalid IP instance. */ + status = nxd_ipv6_multicast_interface_leave(&invalid_ip, &group_address, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Leave the IPv6 multicast group with NULL group address pointer. */ + status = nxd_ipv6_multicast_interface_leave(&ip_0, NX_NULL, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid multicast address. */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0x20010000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x00001234; + + /* Leave the IPv6 multicast group with invalid multicast address. */ + status = nxd_ipv6_multicast_interface_leave(&ip_0, &group_address, 0); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the IPv6 Multicast group address. */ + group_address.nxd_ip_version = NX_IP_VERSION_V6; + group_address.nxd_ip_address.v6[0] = 0xFF020000; + group_address.nxd_ip_address.v6[1] = 0x00000000; + group_address.nxd_ip_address.v6[2] = 0x00000000; + group_address.nxd_ip_address.v6[3] = 0x000000FB; + + /* Leave the IPv6 multicast group with invalid interface index. */ + status = nxd_ipv6_multicast_interface_leave(&ip_0, &group_address, NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef NX_IPV6_STATELESS_AUTOCONFIG_CONTROL + /*****************************************************************/ + /* Tested the nxde_ipv6_stateless_address_autoconfig_disable api */ + /*****************************************************************/ + + /* Disable the IPv6 stateless address autoconfig feature with NULL IP instance. */ + status = nxd_ipv6_stateless_address_autoconfig_disable(NX_NULL, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Disable the IPv6 stateless address autoconfig feature with invalid IP instance. */ + status = nxd_ipv6_stateless_address_autoconfig_disable(&invalid_ip, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the IPv6 stateless address autoconfig feature with invalid interface index. */ + status = nxd_ipv6_stateless_address_autoconfig_disable(&ip_0, NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*****************************************************************/ + /* Tested the nxde_ipv6_stateless_address_autoconfig_enable api */ + /*****************************************************************/ + + /* Enable the IPv6 stateless address autoconfig feature with NULL IP instance. */ + status = nxd_ipv6_stateless_address_autoconfig_enable(NX_NULL, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the IPv6 stateless address autoconfig feature with invalid IP instance. */ + status = nxd_ipv6_stateless_address_autoconfig_enable(&invalid_ip, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the IPv6 stateless address autoconfig feature with invalid interface index. */ + status = nxd_ipv6_stateless_address_autoconfig_enable(&ip_0, NX_MAX_PHYSICAL_INTERFACES); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 NXE API Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_packet_chain_test.c b/test/regression/netxduo_test/netx_ipv6_packet_chain_test.c new file mode 100644 index 00000000..ef374473 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_packet_chain_test.c @@ -0,0 +1,346 @@ +/* Test processing of packet chain. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_PACKET_CHAIN) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG icmp_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMPv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Packet Chain Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the callback function to get the IPv6 packet. */ + ip_1.nx_ipv6_packet_receive = my_packet_process; + + /* Ping an IP address that does exist. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if ((status == NX_SUCCESS) || (my_packet)) + { +#if defined(NX_ENABLE_INTERFACE_CAPABILITY) + printf("ERROR!\n"); + test_control_return(1); +#endif + } + + /* Check the error counter and icmp counter. */ + if ((error_counter) || (icmp_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static VOID my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +UINT status; +NX_PACKET *my_packet_1; +NX_PACKET *my_packet_2; +NX_PACKET *my_packet_3; +NX_IPV6_HEADER *ip_header_ptr; + + + /* Check the packet length. */ + if (packet_ptr ->nx_packet_length == 76) // 28(DATA) + 8(ICMP HEADER) + 40(IPV6 HEADER) + { + + /* Get the ICMP packet. */ + icmp_counter ++; + + /***************************************************************************/ + /* nx_packet_length > pkt_length for chain packet nx_ipv6_packet_receive() */ + /* last packet < delta, two packet chain. */ + /***************************************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, &my_packet_1, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter ++; + + /* Get the IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER *)my_packet_1 -> nx_packet_prepend_ptr; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_1 -= 0x00040000; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet_2, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet_2 -> nx_packet_prepend_ptr, "ABC", 3); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + my_packet_2 -> nx_packet_length = 3; + my_packet_2 -> nx_packet_append_ptr = my_packet_2 -> nx_packet_prepend_ptr + 3; + + /* Chain the packet. */ + my_packet_1 -> nx_packet_next = my_packet_2; + my_packet_1 -> nx_packet_last = my_packet_2; + + /* Call the _nx_ipv6_packet_receive function directly receive this packet. */ + _nx_ipv6_packet_receive(&ip_1, my_packet_1); + + /***************************************************************************/ + /* nx_packet_length > pkt_length for chain packet nx_ipv6_packet_receive() */ + /* last packet < delta, three packet chain */ + /***************************************************************************/ + + /* Copy the packet. */ + status = nx_packet_copy(packet_ptr, &my_packet_1, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter ++; + + /* Get the IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER *)my_packet_1 -> nx_packet_prepend_ptr; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_1 -= 0x00040000; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet_2, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet_2 -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + my_packet_2 -> nx_packet_length = 26; + my_packet_2 -> nx_packet_append_ptr = my_packet_2 -> nx_packet_prepend_ptr + 26; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet_3, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet_3 -> nx_packet_prepend_ptr, "ABC", 3); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + my_packet_3 -> nx_packet_length = 3; + my_packet_3 -> nx_packet_append_ptr = my_packet_3 -> nx_packet_prepend_ptr + 3; + + /* Chain the packet. */ + my_packet_1 -> nx_packet_next = my_packet_2; + my_packet_1 -> nx_packet_last = my_packet_3; + my_packet_2 -> nx_packet_next = my_packet_3; + + /* Call the _nx_ipv6_packet_receive function directly receive this packet. */ + _nx_ipv6_packet_receive(&ip_1, my_packet_1); + + /***************************************************************************/ + /* nx_packet_length > pkt_length for chain packet nx_ipv6_packet_receive() */ + /* last packet < delta, while(delta == 0). */ + /***************************************************************************/ + + /* Get the IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Modified the packet length. */ + ip_header_ptr -> nx_ip_header_word_1 -= 0x00030000; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet_1, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet_1 -> nx_packet_prepend_ptr, "ABC", 3); + + /* Adjust the write pointer. bigger than 256 to cause fragmentation. */ + my_packet_1 -> nx_packet_length = 3; + my_packet_1 -> nx_packet_append_ptr = my_packet_1 -> nx_packet_prepend_ptr + 3; + + /* Chain the packet. */ + packet_ptr -> nx_packet_next = my_packet_1; + packet_ptr -> nx_packet_last = my_packet_1; + } + + /* Call the _nx_ipv6_packet_receive function directly receive this packet. */ + _nx_ipv6_packet_receive(&ip_1, packet_ptr); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Packet Chain Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_pmtu_test.c b/test/regression/netxduo_test/netx_ipv6_pmtu_test.c new file mode 100644 index 00000000..9882528a --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_pmtu_test.c @@ -0,0 +1,650 @@ +/* This test case is modified from IPv6 TAHI 4-13. + * It aims to test PMTU when NA is received. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xa4, 0x26, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, /* .&...x.. */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, /* u0...... */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* c....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xe6, 0x07, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x45, 0x1b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x01, 0x00, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static TAHI_TEST_SEQ pmtu_seq[] = { + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 1}, + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 1}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 1}, + {CHECK, &pkt18[0], sizeof(pkt18), 1}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &pmtu_seq[0];test_suite[0].test_case_size = sizeof(pmtu_seq) / sizeof(TAHI_TEST_SEQ); +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_pmtu_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + printf("NetX Test: IPv6 PMTU Test............................................"); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_pmtu_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 PMTU Test............................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_prefix_test.c b/test/regression/netxduo_test/netx_ipv6_prefix_test.c new file mode 100644 index 00000000..371a6066 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_prefix_test.c @@ -0,0 +1,407 @@ +/* Test IPv6 prefix with length not equal 64. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && (NX_IPV6_PREFIX_LIST_TABLE_SIZE == 8) + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* RA packet with prefix length 128. */ +static char pkt_prefix_128[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xed, 0xeb, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x80, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* RA packet with prefix length 120. */ +static char pkt_prefix_120[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf5, 0xeb, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x78, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* RA packet with prefix length 100. */ +static char pkt_prefix_100[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x57, 0x01, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, /* W.@..... */ +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x64, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, /* d....... */ +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* RA packet with prefix length 96. */ +static char pkt_prefix_96[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x5b, 0x01, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, /* [.@..... */ +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x60, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, /* `....... */ +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* RA packet with prefix length 92. */ +static char pkt_prefix_92[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x5f, 0x01, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, /* _.@..... */ +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x5c, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, /* \....... */ +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* RA packet with prefix length 88. */ +static char pkt_prefix_88[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x63, 0x01, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, /* c.@..... */ +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x58, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, /* X....... */ +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* RA packet with prefix length 64. */ +static char pkt_prefix_64[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xf6, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* RA packet with prefix length 0. */ +static char pkt_prefix_0[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x6d, 0xec, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x00, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* RA packet with prefix length 64. */ +static char pkt_prefix_full[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xe6, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_prefix_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *packet_ptr; +NX_IPV6_PREFIX_ENTRY *current_prefix; +UINT i; +CHAR *pkt_data[] = {pkt_prefix_64, pkt_prefix_128, + pkt_prefix_0, pkt_prefix_120, + pkt_prefix_100, pkt_prefix_96, + pkt_prefix_92, pkt_prefix_88, pkt_prefix_full}; +UINT pkt_len[] = {sizeof(pkt_prefix_64), sizeof(pkt_prefix_128), + sizeof(pkt_prefix_0), sizeof(pkt_prefix_120), + sizeof(pkt_prefix_100), sizeof(pkt_prefix_96), + sizeof(pkt_prefix_92), sizeof(pkt_prefix_88), sizeof(pkt_prefix_full)}; +ULONG prefix_len[] = {128, 120, 100, 96, 92, 88, 64, 0}; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Prefix Test.........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + for (i = 0; i < sizeof(pkt_data) / sizeof(CHAR *); i++) + { + + /* Inject RA with prefix length 64. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt_data[i][14], pkt_len[i] - 14); + packet_ptr -> nx_packet_length = pkt_len[i] - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + if (i == 0) + { + + /* Sleep one second and let prefix 64 bits timeout first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the first global address. */ + status = nxd_ipv6_address_get(&ip_0, address_index + 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 64) || (interface_index != 0)) + error_counter++; + + /* Get the second global address. */ + status = nxd_ipv6_address_get(&ip_0, address_index + 2, &ipv6_address, &prefix_length, &interface_index); + + /* No IPv6 address should be formed since prefix length is not 64. */ + if (status != NX_NO_INTERFACE_ADDRESS) + { + error_counter++; + } + + /* Check prefix list. It should be linked from largest to smallest. */ + current_prefix = ip_0.nx_ipv6_prefix_list_ptr; + + for (i = 0; i < sizeof(prefix_len) / sizeof(ULONG); i++) + { + + /* Check length of prefix. */ + if (current_prefix) + { + if (current_prefix -> nx_ipv6_prefix_entry_prefix_length != prefix_len[i]) + { + error_counter++; + break; + } + + /* Move to next prefix entry. */ + current_prefix = current_prefix -> nx_ipv6_prefix_entry_next; + } + else + { + error_counter++; + break; + } + } + + /* No more prefix. */ + if (current_prefix) + { + error_counter++; + } + + /* Sleep 30 seconds for prefix timeout. */ + tx_thread_sleep(30 * NX_IP_PERIODIC_RATE); + + /* All prefixes are timeout. */ + if (ip_0.nx_ipv6_prefix_list_ptr != NX_NULL) + { + error_counter++; + } + + /* Check the error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_prefix_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Prefix Test..........................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_raw_packet_test.c b/test/regression/netxduo_test/netx_ipv6_raw_packet_test.c new file mode 100644 index 00000000..29de4ddd --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_raw_packet_test.c @@ -0,0 +1,389 @@ +/* This NetX test concentrates on the raw packet IPv6 send/receive operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) +#include "nx_tcp.h" +#include "nx_udp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +static NXD_ADDRESS ipv6_addr_0; +static NXD_ADDRESS ipv6_addr_1; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_raw_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status != NX_SUCCESS) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; +#endif + + /* Enable UDP for IP instances. */ + status = nx_udp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + + ipv6_addr_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_addr_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_addr_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_addr_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_addr_0.nxd_ip_address.v6[3] = 0x00010001; + + ipv6_addr_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_addr_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_addr_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_addr_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_addr_1.nxd_ip_address.v6[3] = 0x00010002; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nxd_ipv6_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; + + status = nxd_icmp_enable(&ip_1); + if(status) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG value; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Raw Packet Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_addr_0, 64, NX_NULL); + if(status != NX_SUCCESS) + error_counter++; + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Now, pickup the three raw packets that should be queued on the other IP instance. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Receive the second packet. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; +#endif + + /* Receive the third packet. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + + /* Receive the last packet. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + + /* Attempt to receive a packet on an empty queue.... should be an error. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + + if (status != NX_NO_PACKET) + error_counter++; + + /* Suspend thread_0 to let thread_1 disable the raw, which will call raw_packet_cleanup */ + nx_ip_raw_packet_receive(&ip_0, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG value; +NXD_ADDRESS dest_addr; + + + status = nxd_ipv6_address_set(&ip_1, 0, &ipv6_addr_1, 64, NX_NULL); + if(status != NX_SUCCESS) + error_counter++; + + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + + /* Check for an error. */ + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the raw IP packet. */ + status = nxd_ip_raw_packet_send(&ip_1, my_packet, &ipv6_addr_0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + dest_addr.nxd_ip_version = NX_IP_VERSION_V4; + dest_addr.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 9); + + /* Send the second raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_1, my_packet, &dest_addr, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; +#endif + + /* Allocate another packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Send the third raw IP packet. */ + status = nxd_ip_raw_packet_send(&ip_1, my_packet, &ipv6_addr_0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the raw IP packet using API without error checking. */ + status = _nxd_ip_raw_packet_send(&ip_1, my_packet, &ipv6_addr_0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + status = nx_ip_raw_packet_disable(&ip_0); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_raw_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Raw Packet Test......................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_search_onlink_test.c b/test/regression/netxduo_test/netx_ipv6_search_onlink_test.c new file mode 100644 index 00000000..f8de7a0d --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_search_onlink_test.c @@ -0,0 +1,481 @@ +/* This NetX test to test the IPv6 onlink search. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS test_address; +static NXD_ADDRESS prefix_0; /* 1111:0001:1000:0003::/64 */ +static NXD_ADDRESS prefix_1; /* 2222:1111:1001:1002::/63 */ +static NXD_ADDRESS prefix_2; /* 3333:0001:1234:1002:1234::/72 */ + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_search_onlink_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*4); + pointer = pointer + 1536*4; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + + /* Enable ICMP for IP Instance 0. */ + status += nxd_icmp_enable(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT i; +UINT status; +UINT address1_index, address2_index; +UINT prefix_length; +NXD_ADDRESS temp_prefix; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Search Onlink Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* prefix_0: 1111:0001:1000:0003::/64 */ + prefix_0.nxd_ip_address.v6[0] = 0x11110001; + prefix_0.nxd_ip_address.v6[1] = 0x10000003; + prefix_0.nxd_ip_address.v6[2] = 0; + prefix_0.nxd_ip_address.v6[3] = 0; + + /* prefix_1: 2222:1111:1001:1002::/63 */ + prefix_1.nxd_ip_address.v6[0] = 0x22221111; + prefix_1.nxd_ip_address.v6[1] = 0x10011002; + prefix_1.nxd_ip_address.v6[2] = 0; + prefix_1.nxd_ip_address.v6[3] = 0; + + /* prefix_2: 3333:0001:1234:1002:1234::/72 */ + prefix_2.nxd_ip_address.v6[0] = 0x33330001; + prefix_2.nxd_ip_address.v6[1] = 0x12341002; + prefix_2.nxd_ip_address.v6[2] = 0x12000000; + prefix_2.nxd_ip_address.v6[3] = 0; + + status = _nx_ipv6_prefix_list_add_entry(&ip_0, &prefix_0.nxd_ip_address.v6[0], 64, 1800); + status += _nx_ipv6_prefix_list_add_entry(&ip_0, &prefix_1.nxd_ip_address.v6[0], 63, 1800); + status += _nx_ipv6_prefix_list_add_entry(&ip_0, &prefix_2.nxd_ip_address.v6[0], 72, 1800); + + if(status) + error_counter++; + + /* Manually configure an IPv6 address that is on the prefix list */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x33330001; + ipv6_address_1.nxd_ip_address.v6[1] = 0x12341002; + ipv6_address_1.nxd_ip_address.v6[2] = 0x12340000; + ipv6_address_1.nxd_ip_address.v6[3] = 1; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 72, &address1_index); + + /* Manually configure an IPv6 address that is NOT on the prefix list */ + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x44440000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x12341002; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 1; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 71, &address2_index); + if(status) + error_counter++; + + /* Test an onlink entry. */ + test_address.nxd_ip_address.v6[0] = 0x11110001; + test_address.nxd_ip_address.v6[1] = 0x10000003; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Modify the previous test to make it offlink. */ + test_address.nxd_ip_address.v6[0] = 0x11110001; + test_address.nxd_ip_address.v6[1] = 0x10000002; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status == 1) + error_counter++; + + /* Test the 2nd onlink entry */ + test_address.nxd_ip_address.v6[0] = 0x22221111; + test_address.nxd_ip_address.v6[1] = 0x10011002; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* This one should also be onlink */ + test_address.nxd_ip_address.v6[0] = 0x22221111; + test_address.nxd_ip_address.v6[1] = 0x10011003; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + + /* This one should be offlink */ + test_address.nxd_ip_address.v6[0] = 0x22221111; + test_address.nxd_ip_address.v6[1] = 0x10011006; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + /* Test the 3rd onlink entry */ + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x12000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + + /* This one should also be onlink. */ + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x12800000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* This one should also be offlink. */ + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x13000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + + /* Test the manually configured one. */ + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x01000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Test the manually configured one. */ + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x00800000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Test the manually configured one. This one should be offlink. */ + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x02000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + /* Test the manually configured one. This one should be onlink. */ + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x01000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + + /* Delete the 3rd onlink entry. */ + _nx_ipv6_prefix_list_delete(&ip_0, &prefix_2.nxd_ip_address.v6[0], 72); + + /* Test the 3rd onlink entry */ + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x12000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Make sure the 1st and the 2nd prefix entry is still there. */ + test_address.nxd_ip_address.v6[0] = 0x11110001; + test_address.nxd_ip_address.v6[1] = 0x10000003; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Test the 2nd onlink entry */ + test_address.nxd_ip_address.v6[0] = 0x22221111; + test_address.nxd_ip_address.v6[1] = 0x10011002; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Now delete 1st and 2nd, and then make sure they are indeed removed. */ + _nx_ipv6_prefix_list_delete(&ip_0, &prefix_1.nxd_ip_address.v6[0], 63); + _nx_ipv6_prefix_list_delete(&ip_0, &prefix_0.nxd_ip_address.v6[0], 64); + + /* The first prefix should still be there because it is also set manually. */ + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x12000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Test the 2nd onlink entry */ + test_address.nxd_ip_address.v6[0] = 0x22221111; + test_address.nxd_ip_address.v6[1] = 0x10011002; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + + /* Make sure the manually configured entry is still there. */ + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x01000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* Now delete the 1st manually configured IPv6 address, verify that the 1st prefix is + no longer onlink but the 2nd manually configure IPv6 address is onlink. */ + nxd_ipv6_address_delete(&ip_0, address1_index); + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x12000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x01000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 1) + error_counter++; + + /* delete the 2nd manually configured address, and verify that all the entries are gone. */ + nxd_ipv6_address_delete(&ip_0, address2_index); + test_address.nxd_ip_address.v6[0] = 0x11110001; + test_address.nxd_ip_address.v6[1] = 0x10000003; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + test_address.nxd_ip_address.v6[0] = 0x22221111; + test_address.nxd_ip_address.v6[1] = 0x10011003; + test_address.nxd_ip_address.v6[2] = 0; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + + test_address.nxd_ip_address.v6[0] = 0x33330001; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x12000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + test_address.nxd_ip_address.v6[0] = 0x44440000; + test_address.nxd_ip_address.v6[1] = 0x12341002; + test_address.nxd_ip_address.v6[2] = 0x01000000; + test_address.nxd_ip_address.v6[3] = 1; + + status = _nxd_ipv6_search_onlink(&ip_0, &test_address.nxd_ip_address.v6[0]); + if(status != 0) + error_counter++; + + /* temp_prefix: 4444:0001:1234:1002:1200::1/64 */ + temp_prefix.nxd_ip_address.v6[0] = 0x44440001; + temp_prefix.nxd_ip_address.v6[1] = 0x12341002; + temp_prefix.nxd_ip_address.v6[2] = 0x12000000; + temp_prefix.nxd_ip_address.v6[3] = 0x00000001; + + prefix_length = 64; + + /* Loop to add entry with prefix. */ + for (i = 0; i < NX_IPV6_PREFIX_LIST_TABLE_SIZE; i++) + { + + /* Added the entry. */ + status = _nx_ipv6_prefix_list_add_entry(&ip_0, &temp_prefix.nxd_ip_address.v6[0], prefix_length, 1800); + + /* Check the status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Update the address. */ + temp_prefix.nxd_ip_address.v6[0]++; + + if (i % 2) + prefix_length = 64 + i; + else + prefix_length = 64 - i; + } + } + + /* Added the entry. */ + status = _nx_ipv6_prefix_list_add_entry(&ip_0, &temp_prefix.nxd_ip_address.v6[0], prefix_length, 1800); + + /* Check the status. */ + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + + test_control_return(0); + } + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_search_onlink_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Search Onlink Test...................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_send_fail_test.c b/test/regression/netxduo_test/netx_ipv6_send_fail_test.c new file mode 100644 index 00000000..5fcca7f7 --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_send_fail_test.c @@ -0,0 +1,295 @@ +/* This NetX test concentrates on failure situation of IPv6 send. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 +#include "nx_nd_cache.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE +static NXD_ADDRESS lo_address; +static NX_PACKET *consume_packet[20]; +static ULONG consumed; +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + +#ifdef NX_DISABLE_FRAGMENTATION +static CHAR send_buffer[256]; +#endif /* NX_DISABLE_FRAGMENTATION */ + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_send_fail_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "Pool 0", 512, pointer, 4096); + pointer = pointer + 4096; + + /* Create a packet pool. */ + status += nx_packet_pool_create(&pool_1, "Pool 1", 512, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + if(status) + error_counter++; + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + /* Set IPv6 loopback address. */ + lo_address.nxd_ip_version = NX_IP_VERSION_V6; + lo_address.nxd_ip_address.v6[0] = 0x00000000; + lo_address.nxd_ip_address.v6[1] = 0x00000000; + lo_address.nxd_ip_address.v6[2] = 0x00000000; + lo_address.nxd_ip_address.v6[3] = 0x00000001; +#endif /* FEATURE_NX_IPV6 */ +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *pkt_ptr; +NXD_ADDRESS address_1; +NXD_ADDRESS address_unknown; +ULONG prefix_length; +UINT interface_index; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: IPv6 send fail Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, NX_NULL, 10, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Sleep 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + +#ifndef NX_DISABLE_LOOPBACK_INTERFACE + /* Now ping loopback address. */ + status = nxd_icmp_ping(&ip_0, &lo_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &pkt_ptr, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + nx_packet_release(pkt_ptr); + } + + /* Now consume packets from pool_0. */ + consumed = 0; + while (pool_0.nx_packet_pool_available > 1) + { + nx_packet_allocate(&pool_0, &consume_packet[consumed++], 0, NX_NO_WAIT); + } + + /* Now ping loopback address. Only one packet is left so it is not possible to receive the packet. */ + status = nxd_icmp_ping(&ip_0, &lo_address, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &pkt_ptr, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + error_counter++; + nx_packet_release(pkt_ptr); + } + + /* Release consumed packets. */ + while (consumed) + { + consumed--; + nx_packet_release(consume_packet[consumed]); + } +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ + + /* Get the link local address of ip_1. */ + status = nxd_ipv6_address_get(&ip_1, 0, &address_1, &prefix_length, &interface_index); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Set function pointer of ICMPv6 to NULL. */ + ip_0.nx_ip_icmpv6_packet_process = NX_NULL; + + /* Now ping ip_1's address. ICMPv6 process function pointer is set to NULL. */ + status = nxd_icmp_ping(&ip_0, &address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &pkt_ptr, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + error_counter++; + nx_packet_release(pkt_ptr); + } + + /* Recover function pointer of ICMPv6. */ + ip_0.nx_ip_icmpv6_packet_process = _nx_icmpv6_packet_process; + + /* Now ping ip_1's address. */ + status = nxd_icmp_ping(&ip_0, &address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &pkt_ptr, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + nx_packet_release(pkt_ptr); + } + +#ifdef NX_DISABLE_FRAGMENTATION + /* Now ping ip_1's address. Fragment is disabled but sizeof data is larger than MTU. */ + status = nxd_icmp_ping(&ip_0, &address_1, send_buffer, sizeof(send_buffer), &pkt_ptr, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + error_counter++; + nx_packet_release(pkt_ptr); + } +#endif /* NX_DISABLE_FRAGMENTATION */ + + /* Set an unknown destination. */ + address_unknown.nxd_ip_version = NX_IP_VERSION_V6; + address_unknown.nxd_ip_address.v6[0] = 0xFE800000; + address_unknown.nxd_ip_address.v6[1] = 0x00000000; + address_unknown.nxd_ip_address.v6[2] = 0x00000000; + address_unknown.nxd_ip_address.v6[3] = 0x00000001; + + /* Ping unknow address until ND queue depth. */ + for (i = 0; i <= NX_ND_MAX_QUEUE_DEPTH; i++) + { + status = nxd_icmp_ping(&ip_0, &address_unknown, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &pkt_ptr, NX_NO_WAIT); + + /* Check status. */ + if (status == NX_SUCCESS) + { + error_counter++; + nx_packet_release(pkt_ptr); + } + } + + /* Determine how to report error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_send_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 send fail Test.......................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_ipv6_stateless_address_autoconfig_test.c b/test/regression/netxduo_test/netx_ipv6_stateless_address_autoconfig_test.c new file mode 100644 index 00000000..1e5fa85b --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_stateless_address_autoconfig_test.c @@ -0,0 +1,460 @@ +/* Test IPv6 ND CACHE APIs. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && defined(NX_IPV6_STATELESS_AUTOCONFIG_CONTROL) && !defined(NX_DISABLE_ICMPV6_ROUTER_SOLICITATION) + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +#ifdef NX_ENABLE_DUAL_PACKET_POOL +static NX_PACKET_POOL auxiliary_pool; +#endif +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rs_counter; +static ULONG address_expired; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static VOID ip_address_change_notify(NX_IP *ip_ptr, UINT operation, UINT if_index, UINT address_index, ULONG *address); +#endif /* NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY */ + +/* RA packet. */ +/* Two prefixes, 3ffe:0501:ffff:0100:: and 3ffe:0501:ffff:0101:: */ +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa3, 0xd5, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +/* One prefix 3ffe:0501:ffff:0100. */ +static const unsigned char pkt2[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x86, 0x00, /* "..3DV.. */ +0x7f, 0xd1, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, /* ..@..... */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x0f, 0x14, 0x40, 0x03, 0x04, /* .....@.. */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* @....... */ +0x09, 0x60, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .`....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_stateless_address_autoconfig_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the value. */ + error_counter = 0; + rs_counter = 0; + address_expired = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + /* Create a auxiliary pool. */ + status = nx_packet_pool_create(&auxiliary_pool, "NetX Main Auxiliary Pool", 256, pointer, 256*16); + pointer = pointer + 256*16; + + if(status) + error_counter++; +#endif + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 ICMP */ + status += nxd_icmp_enable(&ip_0); + + /* Check IPv6 ICMP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +UINT i, packet_counter_0; +#ifdef NX_ENABLE_DUAL_PACKET_POOL +UINT packet_counter_1; +NX_PACKET *tmp_auxiliary_packet[16]; +#endif +UINT address_index; +NXD_ADDRESS ipv6_address; +ULONG prefix_length; +UINT interface_index; +NX_PACKET *tmp_packet[16]; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Stateless Address Autoconfig Test...................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + /* Set address change notify. */ + nxd_ipv6_address_change_notify(&ip_0, ip_address_change_notify); +#endif /* NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY */ + + /* Disable the Stateless Address Autoconfig feature. */ + status = nxd_ipv6_stateless_address_autoconfig_disable(&ip_0, 0); + + /* Check the status. */ + if(status) + error_counter++; + + /* Disable the Stateless Address Autoconfig feature again. */ + status = nxd_ipv6_stateless_address_autoconfig_disable(&ip_0, 0); + + /* Check the status. */ + if(status) + error_counter++; + + /* Set the linklocal address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the linklocal address. */ + status = nxd_ipv6_address_get(&ip_0, address_index, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 10) || (interface_index != 0)) + error_counter++; + + /* Set the callback function to process the RS packet. */ + advanced_packet_process_callback = my_packet_process; + + packet_counter_0 = pool_0.nx_packet_pool_available; + + /* Loop to allocate the all packets from pool_0. */ + for (i = 0; i < packet_counter_0; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &tmp_packet[i], NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check the status. */ + if (status) + error_counter++; + } + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + packet_counter_1 = auxiliary_pool.nx_packet_pool_available; + + /* Loop to allocate the all packets from auxiliary_pool. */ + for (i = 0; i < packet_counter_1; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&auxiliary_pool, &tmp_auxiliary_packet[i], NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check the status. */ + if (status) + error_counter++; + } +#endif + + /* Enable the Stateless Address Autoconfig feature. */ + status = nxd_ipv6_stateless_address_autoconfig_enable(&ip_0, 0); + + /* Check the status. */ + if(status) + error_counter++; + + /* Enable the Stateless Address Autoconfig feature again. */ + status = nxd_ipv6_stateless_address_autoconfig_enable(&ip_0, 0); + + /* Check the status. */ + if(status != NX_ALREADY_ENABLED) + error_counter++; + + /* Sleep 5 seconds for NetX sending RS message. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check the error. */ + if(rs_counter != 0) + error_counter++; + + /* Disable the Stateless Address Autoconfig feature. */ + status = nxd_ipv6_stateless_address_autoconfig_disable(&ip_0, 0); + + /* Check the status. */ + if(status) + error_counter++; + + /* Loop to release the all packets for pool_0. */ + for (i = 0; i < packet_counter_0; i++) + { + + /* Allocate a packet. */ + status = nx_packet_release(tmp_packet[i]); + + /* Check the status. */ + if (status) + error_counter++; + } + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + /* Loop to release the all packets for auxiliary_pool. */ + for (i = 0; i < packet_counter_1; i++) + { + + /* Allocate a packet. */ + status = nx_packet_release(tmp_auxiliary_packet[i]); + + /* Check the status. */ + if (status) + error_counter++; + } +#endif + + /* Enable the Stateless Address Autoconfig feature. */ + status = nxd_ipv6_stateless_address_autoconfig_enable(&ip_0, 0); + + /* Check the status. */ + if(status) + error_counter++; + + /* Sleep 5 seconds for Stateless Address Autoconfig. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the Stateless address. */ + status = nxd_ipv6_address_get(&ip_0, 1, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 64) || (interface_index != 0)) + error_counter++; + + /* Get the Stateless address. */ + status = nxd_ipv6_address_get(&ip_0, 2, &ipv6_address, &prefix_length, &interface_index); + + /* Check the status. */ + if((status) || (prefix_length != 64) || (interface_index != 0)) + error_counter++; + + /* Send the RA packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_ICMP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + my_packet -> nx_packet_length = sizeof(pkt2) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(pkt2) - 14; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Sleep 5 seconds for linklocal address DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Get the Stateless address. No new addresses are generated. */ + status = nxd_ipv6_address_get(&ip_0, 3, &ipv6_address, &prefix_length, &interface_index); + + if (status == NX_SUCCESS) + error_counter++; + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + /* Sleep 40 seconds and let prefix timeout. */ + tx_thread_sleep(40 * NX_IP_PERIODIC_RATE); + + /* Get the Stateless address. */ + status = nxd_ipv6_address_get(&ip_0, 1, &ipv6_address, &prefix_length, &interface_index); + + if (status == NX_SUCCESS) + error_counter++; + + /* Get the Stateless address. */ + status = nxd_ipv6_address_get(&ip_0, 2, &ipv6_address, &prefix_length, &interface_index); + + if (status == NX_SUCCESS) + error_counter++; + + /* Check whether two addresses are expired. */ + if (address_expired != 2) + error_counter++; +#endif /* NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY */ + + /* Check the error. */ + if((error_counter) ||(rs_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +static VOID ip_address_change_notify(NX_IP *ip_ptr, UINT operation, UINT if_index, + UINT address_index, ULONG *address) +{ + if (operation == NX_IPV6_ADDRESS_LIFETIME_EXPIRED) + { + address_expired++; + + /* Check prefix. */ + if ((address[0] != 0x3ffe0501) || + ((address[1] != 0xffff0100) && (address[1] !=0xffff0101))) + { + error_counter++; + } + + } +} +#endif /* NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY */ + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +UINT status; +NX_ICMPV6_HEADER *header_ptr; +NX_PACKET *my_packet; + + /* Clean the callback function. */ + advanced_packet_process_callback = NX_NULL; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* Points to the ICMP message header. */ + header_ptr = (NX_ICMPV6_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)); + + /* Determine the message type and call the appropriate handler. */ + if (header_ptr -> nx_icmpv6_header_type == NX_ICMPV6_ROUTER_SOLICITATION_TYPE) + { + + /* Update the RS counter. */ + rs_counter ++; + + /* Send the RA packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_ICMP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + my_packet -> nx_packet_length = sizeof(pkt1) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(pkt1) - 14; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_stateless_address_autoconfig_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Stateless Address Autoconfig Test....................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_ipv6_util_api_test.c b/test/regression/netxduo_test/netx_ipv6_util_api_test.c new file mode 100644 index 00000000..bc70a2ae --- /dev/null +++ b/test/regression/netxduo_test/netx_ipv6_util_api_test.c @@ -0,0 +1,1139 @@ +/* This test case validates nxd_ipv6_address_delete. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_util_api_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ipv6_address_1[4]; +ULONG ipv6_address_2[4]; + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Util API Test........................................"); + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x10000000; + ipv6_address_1[3] = 0x00000011; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x20000000; + ipv6_address_2[3] = 0x00000022; + + /* Check the address by prefixe length. */ + status = CHECK_IP_ADDRESSES_BY_PREFIX(ipv6_address_1, ipv6_address_2, 48); + + /* Check the status. */ + if (status != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address by prefixe length. */ + status = CHECK_IP_ADDRESSES_BY_PREFIX(ipv6_address_1, ipv6_address_2, 64); + + /* Check the status. */ + if (status != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the address by prefixe length. */ + status = CHECK_IP_ADDRESSES_BY_PREFIX(ipv6_address_1, ipv6_address_2, 96); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000011; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check the address by prefixe length. */ + status = CHECK_IP_ADDRESSES_BY_PREFIX(ipv6_address_1, ipv6_address_2, 127); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000011; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check the address by prefixe length. */ + status = CHECK_IP_ADDRESSES_BY_PREFIX(ipv6_address_1, ipv6_address_2, 16); + + /* Check the status. */ + if (status != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x20010000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000003; + + /* Check the address by prefixe length. */ + status = CHECK_UNSPECIFIED_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000002; + + /* Check if the address is router multicast address. */ + status = CHECK_ALL_ROUTER_MCAST_ADDRESS(ipv6_address_1); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010000; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check if the address is node multicast address. */ + status = CHECK_IPV6_SOLICITED_NODE_MCAST_ADDRESS(ipv6_address_1, ipv6_address_2); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010003; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check if the address is node multicast address. */ + status = CHECK_IPV6_SOLICITED_NODE_MCAST_ADDRESS(ipv6_address_1, ipv6_address_2); + + /* Check the status. */ + if (status == 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010003; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check if the address is node multicast address. */ + status = CHECK_IPV6_SOLICITED_NODE_MCAST_ADDRESS(ipv6_address_1, ipv6_address_2); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00010003; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check if the address is node multicast address. */ + status = CHECK_IPV6_SOLICITED_NODE_MCAST_ADDRESS(ipv6_address_1, ipv6_address_2); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x20010004; + + /* Set address 2. */ + ipv6_address_2[0] = 0x20010000; + ipv6_address_2[1] = 0x00000000; + ipv6_address_2[2] = 0x00000000; + ipv6_address_2[3] = 0x00000022; + + /* Check if the address is node multicast address. */ + status = CHECK_IPV6_SOLICITED_NODE_MCAST_ADDRESS(ipv6_address_1, ipv6_address_2); + + /* Check the status. */ + if (status != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF030000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000004; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF010000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000004; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != (IPV6_ADDRESS_MULTICAST | IPV6_ALL_NODE_MCAST)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF050000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF000001; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000002; + ipv6_address_1[3] = 0x00010003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0x00000000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000000; + ipv6_address_1[3] = 0x00000003; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != (IPV6_ADDRESS_UNICAST | IPV6_ADDRESS_GLOBAL)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000001; + ipv6_address_1[2] = 0x00000001; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000001; + ipv6_address_1[3] = 0x00000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != IPV6_ADDRESS_MULTICAST) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set address 1. */ + ipv6_address_1[0] = 0xFF020000; + ipv6_address_1[1] = 0x00000000; + ipv6_address_1[2] = 0x00000001; + ipv6_address_1[3] = 0xFF000000; + + /* Check the address type. */ + status = IPv6_Address_Type(ipv6_address_1); + + /* Check the status. */ + if (status != (IPV6_ADDRESS_MULTICAST | IPV6_SOLICITED_NODE_MCAST)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Change the IPv6 address with NULL pointer. */ + NX_IPV6_ADDRESS_CHANGE_ENDIAN(NX_NULL); + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ipv6_util_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Util API Test........................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_low_watermark_fragment_test.c b/test/regression/netxduo_test/netx_low_watermark_fragment_test.c new file mode 100644 index 00000000..c5436e07 --- /dev/null +++ b/test/regression/netxduo_test/netx_low_watermark_fragment_test.c @@ -0,0 +1,308 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_LOW_WATERMARK) +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define PACKET_SIZE 1536 +#define POOL_0_COUNT 20 +#define POOL_1_COUNT 10 +#define TEST_LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG fragments_count; +static ULONG drop_count; + + +/* Define pool area. */ +static UCHAR pool_area_0[POOL_0_COUNT * (sizeof(NX_PACKET) + PACKET_SIZE)]; +static UCHAR pool_area_1[POOL_1_COUNT * (sizeof(NX_PACKET) + PACKET_SIZE)]; + +static UCHAR ping_buffer[2048]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_low_watermark_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pool_area_0, sizeof(pool_area_0)); + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", PACKET_SIZE, pool_area_1, sizeof(pool_area_1)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ICMP enable status. */ + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMP enable status. */ + if (status) + error_counter++; + + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT i; +NX_PACKET *packet_ptr; +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: Low Watermark Fragment Test..............................."); + + /* Setup driver callback to drop last fragment of each ICMP packet. */ + advanced_packet_process_callback = packet_process; + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Set low_watermark. */ + nx_packet_pool_low_watermark_set(&pool_1, 2); + fragments_count = 0; + drop_count = 0; + for (i = 0; (i < TEST_LOOP) && (error_counter == 0); i++) + { + +#ifndef NX_DISABLE_IPV4 + /* Ping IP1 address with fragments. The first fragment will be dropped by driver. */ + nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), ping_buffer, sizeof(ping_buffer), + &packet_ptr, NX_NO_WAIT); + fragments_count++; + + /* Ping IP1 address without fragments. */ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1, 2, 3, 5), "", 0, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(packet_ptr); +#endif /* NX_DISABLE_IPV4 */ + +#ifdef FEATURE_NX_IPV6 + /* Ping IP1 address with fragments. The first fragment will be dropped by driver. */ + nxd_icmp_ping(&ip_0, &ipv6_address_2, ping_buffer, sizeof(ping_buffer), + &packet_ptr, NX_NO_WAIT); + fragments_count++; + + /* Ping IP1 address without fragments. */ + status = nxd_icmp_ping(&ip_0, &ipv6_address_2, "", 0, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(packet_ptr); +#endif /* FEATURE_NX_IPV6 */ + } + + /* Check status. */ + if (error_counter || (drop_count != fragments_count)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG ip_version; +#ifndef NX_DISABLE_IPV4 +NX_IPV4_HEADER *ip_header_ptr; +#endif /* NX_DISABLE_IPV4 */ +#ifdef FEATURE_NX_IPV6 +NX_IPV6_HEADER *ipv6_header_ptr; +NX_IPV6_HEADER_FRAGMENT_OPTION *ipv6_fragment_option; +#endif /* FEATURE_NX_IPV6 */ + + if (ip_ptr == &ip_1) + return NX_TRUE; + + ip_version = packet_ptr -> nx_packet_ip_version; + + if (ip_version == NX_IP_VERSION_V6) + { +#ifdef FEATURE_NX_IPV6 + if (packet_ptr -> nx_packet_length < 40) + { + return NX_TRUE; + } + ipv6_header_ptr = (NX_IPV6_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(ipv6_header_ptr -> nx_ip_header_word_1); + if (((ipv6_header_ptr -> nx_ip_header_word_1 >> 8) & 0xFF) == NX_PROTOCOL_NEXT_HEADER_FRAGMENT) + { + ipv6_fragment_option = (NX_IPV6_HEADER_FRAGMENT_OPTION *)(packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV6_HEADER)); + NX_CHANGE_USHORT_ENDIAN(ipv6_fragment_option -> nx_ipv6_header_fragment_option_offset_flag); + if (ipv6_fragment_option -> nx_ipv6_header_fragment_option_offset_flag & 1) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + drop_count++; + } + NX_CHANGE_USHORT_ENDIAN(ipv6_fragment_option -> nx_ipv6_header_fragment_option_offset_flag); + } + NX_CHANGE_ULONG_ENDIAN(ipv6_header_ptr -> nx_ip_header_word_1); +#endif /* FEATURE_NX_IPV6 */ + } +#ifndef NX_DISABLE_IPV4 + else + { + if ((packet_ptr -> nx_packet_length < 20) || (packet_ptr -> nx_packet_length == 28)) + { + return NX_TRUE; + } + ip_header_ptr = (NX_IPV4_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + if (ip_header_ptr -> nx_ip_header_word_1 & (NX_IP_FRAGMENT_MASK | NX_IP_MORE_FRAGMENT) == + (NX_IP_FRAGMENT_MASK | NX_IP_MORE_FRAGMENT)) + { + *operation_ptr = NX_RAMDRIVER_OP_DROP; + drop_count++; + } + NX_CHANGE_ULONG_ENDIAN(ip_header_ptr -> nx_ip_header_word_1); + } +#endif /* NX_DISABLE_IPV4 */ + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_low_watermark_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Low Watermark Fragment Test...............................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_ENABLE_LOW_WATERMARK */ diff --git a/test/regression/netxduo_test/netx_low_watermark_test.c b/test/regression/netxduo_test/netx_low_watermark_test.c new file mode 100644 index 00000000..55c4d2d3 --- /dev/null +++ b/test/regression/netxduo_test/netx_low_watermark_test.c @@ -0,0 +1,502 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_LOW_WATERMARK) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 +#define PACKET_SIZE 1536 +#define POOL_0_COUNT 20 +#define POOL_1_COUNT 10 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET tcp_client; +static NX_TCP_SOCKET tcp_server; +static NX_UDP_SOCKET udp_client; +static NX_UDP_SOCKET udp_server; +static ULONG zero_window_received = 0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define pool area. */ +static UCHAR pool_area_0[POOL_0_COUNT * (sizeof(NX_PACKET) + PACKET_SIZE)]; +static UCHAR pool_area_1[POOL_1_COUNT * (sizeof(NX_PACKET) + PACKET_SIZE)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void verify_tcp(UINT low_watermark, UINT receive_queue_maximum, + UINT expected_packet_available, + UINT expected_receive_queue_count); +static void verify_udp(UINT low_watermark, UINT receive_queue_maximum, + UINT expected_packet_available, + UINT expected_receive_queue_count); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_low_watermark_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pool_area_0, sizeof(pool_area_0)); + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", PACKET_SIZE, pool_area_1, sizeof(pool_area_1)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Enable UDP processing for both IP instances. */ + status += nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT i, j; +UINT max; + + /* Print out some test information banners. */ + printf("NetX Test: Low Watermark Test........................................"); + + /* Setup driver callback. */ + advanced_packet_process_callback = packet_process; + + /* 1. Do not set low watermark or receive queue maximum. + * All packets in pool_1 should be queued in TCP socket. + * */ + verify_tcp(0, POOL_1_COUNT, 0, POOL_1_COUNT); + verify_udp(0, POOL_1_COUNT, 0, POOL_1_COUNT); + + /* 2. Set low watermark but do not set receive queue maximum. */ + for (i = 1; i < POOL_1_COUNT; i++) + { + verify_tcp(i, POOL_1_COUNT, i, POOL_1_COUNT - i); + verify_udp(i, POOL_1_COUNT, i, POOL_1_COUNT - i); + + /* Check status. */ + if (error_counter) + { + break; + } + } + + /* 3. Do not set low watermark but set receive queue maximum. */ + for (i = 1; i < POOL_1_COUNT; i++) + { + verify_tcp(0, POOL_1_COUNT - i, i, POOL_1_COUNT - i); + verify_udp(0, POOL_1_COUNT - i, i, POOL_1_COUNT - i); + + /* Check status. */ + if (error_counter) + { + break; + } + } + + /* 4. Set low watermark and receive queue maximum. */ + for (i = 1; i < POOL_1_COUNT; i++) + { + for (j = 1; j < POOL_1_COUNT; j++) + { + + /* Get maximum limitation. */ + if (i > j) + max = i; + else + max = j; + + verify_tcp(i, POOL_1_COUNT - j, max, POOL_1_COUNT - max); + verify_udp(i, POOL_1_COUNT - j, max, POOL_1_COUNT - max); + + /* Check status. */ + if (error_counter) + { + break; + } + } + } + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void verify_tcp(UINT low_watermark, UINT receive_queue_maximum, + UINT expected_packet_available, + UINT expected_receive_queue_count) +{ +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +UINT i; +CHAR ch; + + /* Create server socket. */ + status = nx_tcp_socket_create(&ip_1, &tcp_server, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &tcp_server, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&tcp_server, NX_NO_WAIT); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &tcp_client, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&tcp_client, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&tcp_client, IP_ADDRESS(1, 2, 3, 5), 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set low watermark and receive queue maximum. */ + nx_packet_pool_low_watermark_set(&pool_1, low_watermark); + nx_tcp_socket_receive_queue_max_set(&tcp_server, receive_queue_maximum); + zero_window_received = 0; + for (i = 0; i < POOL_1_COUNT; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + ch = 'A' + i; + status = nx_packet_data_append(send_packet, &ch, 1, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + /* Send the packet out! */ + status = nx_tcp_socket_send(&tcp_client, send_packet, NX_NO_WAIT); + + /* Determine if the status is valid. */ + if (status) + { + + if (status != NX_WINDOW_OVERFLOW) + error_counter++; + nx_packet_release(send_packet); + break; + } + } + + /* Check whether zero window has been sent. */ + if ((tcp_server.nx_tcp_socket_receive_queue_count != POOL_1_COUNT) && + (zero_window_received == 0)) + { + error_counter++; + } + else if ((tcp_server.nx_tcp_socket_receive_queue_count == POOL_1_COUNT) && + (zero_window_received != 0)) + { + error_counter++; + } + + /* Verify packets in server's receive queue. */ + if (tcp_server.nx_tcp_socket_receive_queue_count != expected_receive_queue_count) + { + error_counter++; + } + + /* Verify packets in server's pool. */ + if (pool_1.nx_packet_pool_available != expected_packet_available) + { + error_counter++; + } + + /* Receive all packets. */ + for (i = tcp_server.nx_tcp_socket_receive_queue_count; i > 0; i--) + { + if (nx_tcp_socket_receive(&tcp_server, &recv_packet, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + nx_packet_release(recv_packet); + } + else + { + error_counter++; + } + } + + /* Force close the connection. */ + nx_tcp_socket_disconnect(&tcp_client, NX_NO_WAIT); + nx_tcp_client_socket_unbind(&tcp_client); + nx_tcp_socket_delete(&tcp_client); + nx_tcp_socket_disconnect(&tcp_server, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&tcp_server); + nx_tcp_server_socket_unlisten(&ip_1, 12); + nx_tcp_socket_delete(&tcp_server); +} + + +static void verify_udp(UINT low_watermark, UINT receive_queue_maximum, + UINT expected_packet_available, + UINT expected_receive_queue_count) +{ +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +UINT i; +CHAR ch; + + /* Create server socket. */ + status = nx_udp_socket_create(&ip_1, &udp_server, "Server Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, receive_queue_maximum); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to port 12. */ + status = nx_udp_socket_bind(&udp_server, 12, TX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create client socket. */ + status = nx_udp_socket_create(&ip_0, &udp_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 20); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind to port 12. */ + status = nx_udp_socket_bind(&udp_client, 12, TX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set low watermark and receive queue maximum. */ + nx_packet_pool_low_watermark_set(&pool_1, low_watermark); + for (i = 0; i < POOL_1_COUNT; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + ch = 'A' + i; + status = nx_packet_data_append(send_packet, &ch, 1, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + /* Send the packet out! */ + status = nx_udp_socket_send(&udp_client, send_packet, IP_ADDRESS(1, 2, 3, 5), 12); + + /* Determine if the status is valid. */ + if (status) + { + + error_counter++; + nx_packet_release(send_packet); + break; + } + } + + /* Verify packets in server's receive queue. */ + if (udp_server.nx_udp_socket_receive_count != expected_receive_queue_count) + { + error_counter++; + } + + /* Verify packets in server's pool. */ + if (pool_1.nx_packet_pool_available != expected_packet_available) + { + error_counter++; + } + + /* Receive all packets. */ + for (i = udp_server.nx_udp_socket_receive_count; i > 0; i--) + { + if (nx_udp_socket_receive(&udp_server, &recv_packet, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + nx_packet_release(recv_packet); + } + else + { + error_counter++; + } + } + + /* Force close the connection. */ + nx_udp_socket_unbind(&udp_client); + nx_udp_socket_delete(&udp_client); + nx_udp_socket_unbind(&udp_server); + nx_udp_socket_delete(&udp_server); +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Skip packets that are not TCP. */ + if ((packet_ptr -> nx_packet_length < 40) || + (*(packet_ptr -> nx_packet_prepend_ptr + 9) != NX_PROTOCOL_TCP)) + return NX_TRUE; + + /* Get TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check window size. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_LOWER_16_MASK) == 0) + zero_window_received++; + + /* Restore endian. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_low_watermark_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Low Watermark Test........................................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_ENABLE_LOW_WATERMARK */ diff --git a/test/regression/netxduo_test/netx_low_watermark_zero_window_test.c b/test/regression/netxduo_test/netx_low_watermark_zero_window_test.c new file mode 100644 index 00000000..d081a213 --- /dev/null +++ b/test/regression/netxduo_test/netx_low_watermark_zero_window_test.c @@ -0,0 +1,330 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(NX_ENABLE_LOW_WATERMARK) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 +#define PACKET_SIZE 1536 +#define POOL_0_COUNT 20 +#define POOL_1_COUNT 10 +#define SERVER_IP_ADDRESS IP_ADDRESS(1, 2, 3, 99) +#define CLIENT_IP_ADDRESS IP_ADDRESS(1, 2, 3, 4) + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD client_thread; +static TX_THREAD server_thread; + +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL server_pool; +static NX_IP client_ip; +static NX_IP server_ip; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static ULONG zero_window_received = 0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT client_running = NX_TRUE; + + +/* Define pool area. */ +static UCHAR client_pool_area[POOL_0_COUNT * (sizeof(NX_PACKET) + PACKET_SIZE)]; +static UCHAR server_pool_area[POOL_1_COUNT * (sizeof(NX_PACKET) + PACKET_SIZE)]; + + +/* Define thread prototypes. */ + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_low_watermark_zero_window_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the Client thread. */ + tx_thread_create(&client_thread, "Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the Server thread. */ + tx_thread_create(&server_thread, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&client_pool, "ClientPacket Pool", PACKET_SIZE, client_pool_area, sizeof(client_pool_area)); + status += nx_packet_pool_create(&server_pool, "Server Packet Pool", PACKET_SIZE, server_pool_area, sizeof(server_pool_area)); + + if (status) + error_counter++; + + /* Create client IP instance. */ + status = nx_ip_create(&client_ip, "Client IP Instance", CLIENT_IP_ADDRESS, 0xFFFFFF00UL, &client_pool, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create sever IP instance. */ + status += nx_ip_create(&server_ip, "Server IP Instance", SERVER_IP_ADDRESS, 0xFFFFFF00UL, &server_pool, + _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + + /* Check enable status. */ + if (status) + error_counter++; + + return; +} + +static void thread_server_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *send_packet; + + + tx_thread_sleep(10); + + /* Print out some test information banners. */ + printf("NetX Test: Low Watermark Zero Window Test..........................."); + + /* Setup driver callback. */ + advanced_packet_process_callback = packet_process; + + /* Create server socket. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&server_ip, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + zero_window_received = 0; + + /* Allocate a packet. */ + status = nx_packet_allocate(&server_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the first packet payload! */ + memcpy(send_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + send_packet -> nx_packet_length = 28; + send_packet -> nx_packet_append_ptr = send_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, send_packet, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + nx_packet_release(send_packet); + error_counter++; + } + + while(client_running) + tx_thread_sleep(100); + + nx_tcp_socket_disconnect(&server_socket, 200); + nx_tcp_server_socket_unaccept(&server_socket); + nx_tcp_server_socket_unlisten(&server_ip, 12); + nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *recv_packet; + + tx_thread_sleep(50); + + /* Create a socket. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, SERVER_IP_ADDRESS, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set low watermark to prevent using any packets. */ + status = nx_packet_pool_low_watermark_set(&client_pool, client_pool.nx_packet_pool_total); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_socket_receive(&client_socket, &recv_packet, NX_IP_PERIODIC_RATE); + + if (status && (status != NX_NO_PACKET)) + { + error_counter++; + } + else if (status == NX_SUCCESS) + { + error_counter++; + nx_packet_release(recv_packet); + } + + /* Set low watermark to allow using all packets. */ + nx_packet_pool_low_watermark_set(&client_pool, 0); + + status = nx_tcp_socket_receive(&client_socket, &recv_packet, 5*NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + { + error_counter++; + } + else + nx_packet_release(recv_packet); + + /* Check whether zero window has been sent. */ + if (zero_window_received == 0) + { + error_counter++; + } + + client_running = NX_FALSE; + + /* Force close the connection. */ + nx_tcp_socket_disconnect(&client_socket, 300); + nx_tcp_client_socket_unbind(&client_socket); + nx_tcp_socket_delete(&client_socket); + + return; + +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Get TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check window size. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_LOWER_16_MASK) == 0) + zero_window_received++; + + /* Restore endian. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_low_watermark_zero_window_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Low Watermark Zero Window Test...........................N/A\n"); + test_control_return(3); + +} +#endif /* NX_ENABLE_LOW_WATERMARK */ diff --git a/test/regression/netxduo_test/netx_nd_cache_add_test.c b/test/regression/netxduo_test/netx_nd_cache_add_test.c new file mode 100644 index 00000000..0e6e4371 --- /dev/null +++ b/test/regression/netxduo_test/netx_nd_cache_add_test.c @@ -0,0 +1,404 @@ +/* This NetX test concentrates on the ICMP ping operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_icmp.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 +#include "nx_nd_cache.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static NXD_ADDRESS global_address_0; +static NXD_ADDRESS global_address_1; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_add_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check ipv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 processing for IP instances0 . */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMPv6 enable status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 0. */ + global_address_0.nxd_ip_version = NX_IP_VERSION_V6; + global_address_0.nxd_ip_address.v6[0] = 0x20010000; + global_address_0.nxd_ip_address.v6[1] = 0x00000000; + global_address_0.nxd_ip_address.v6[2] = 0x00000000; + global_address_0.nxd_ip_address.v6[3] = 0x10000001; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, &global_address_0, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; + + /* Set ipv6 global address for IP instance 1. */ + global_address_1.nxd_ip_version = NX_IP_VERSION_V6; + global_address_1.nxd_ip_address.v6[0] = 0x20010000; + global_address_1.nxd_ip_address.v6[1] = 0x00000000; + global_address_1.nxd_ip_address.v6[2] = 0x00000000; + global_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, &global_address_1, 64, NX_NULL); + + /* Check status. */ + if(status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet; +ND_CACHE_ENTRY *nd_cache_entry; +NXD_ADDRESS dest_ip; +CHAR mac_address[6]; + + + /* Print out test information banner. */ + printf("NetX Test: ND Cache Add Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Ping an IP address that does exist. One entry status is ND_CACHE_STATE_REACHABLE, one entry status is ND_CACHE_STATE_DELAY. */ + status = nxd_icmp_ping(&ip_0, &global_address_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Added the same ND Cache entry. */ + mac_address[0] = 0x00; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x57; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &global_address_1.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_CREATED, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Added the same ND Cache entry with different first short. */ + mac_address[0] = 0x11; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x57; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &global_address_1.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_REACHABLE, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Added the same ND Cache entry with different second short. */ + mac_address[0] = 0x11; + mac_address[1] = 0x11; + mac_address[2] = 0x33; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x57; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &global_address_1.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_REACHABLE, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Added the same ND Cache entry with different third short. */ + mac_address[0] = 0x11; + mac_address[1] = 0x11; + mac_address[2] = 0x33; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x44; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &global_address_1.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_REACHABLE, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Set ipv6 global address for IP instance 1. */ + dest_ip.nxd_ip_version = NX_IP_VERSION_V6; + dest_ip.nxd_ip_address.v6[0] = 0x20010000; + dest_ip.nxd_ip_address.v6[1] = 0x00000000; + dest_ip.nxd_ip_address.v6[2] = 0x00000000; + dest_ip.nxd_ip_address.v6[3] = 0x10000003; + + /* Added the same ND Cache entry. */ + mac_address[0] = 0x00; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x58; + + /* Loop to added the ND CACHE ENTRY. */ + for (i = 0; i < NX_IPV6_NEIGHBOR_CACHE_SIZE - 1; i ++) + { + + /* Update the IP address and mac address. */ + dest_ip.nxd_ip_address.v6[3] += 1; + mac_address[5] += 1; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &dest_ip.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_CREATED, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Set the status to stale. */ + ip_0.nx_ipv6_nd_cache[NX_IPV6_NEIGHBOR_CACHE_SIZE - 1].nx_nd_cache_nd_status = ND_CACHE_STATE_STALE; + ip_0.nx_ipv6_nd_cache[NX_IPV6_NEIGHBOR_CACHE_SIZE - 1].nx_nd_cache_timer_tick = 10; + ip_0.nx_ipv6_nd_cache[NX_IPV6_NEIGHBOR_CACHE_SIZE - 2].nx_nd_cache_nd_status = ND_CACHE_STATE_STALE; + ip_0.nx_ipv6_nd_cache[NX_IPV6_NEIGHBOR_CACHE_SIZE - 2].nx_nd_cache_timer_tick = 20; + + /* Update the IP address and mac address. */ + dest_ip.nxd_ip_address.v6[3] += 1; + mac_address[5] += 1; + + /* Call the function to added the new entry. the entry status is ND_CACHE_STATE_REACHABLE can be replaced when disable the NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES. */ + status = _nx_nd_cache_add(&ip_0, &dest_ip.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_CREATED, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + +#ifndef NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#else + /* Check status. */ + if (status != NX_NOT_SUCCESSFUL) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Loop to mark all the ND CACHE ENTRY as static. */ + for (i = 0; i < NX_IPV6_NEIGHBOR_CACHE_SIZE; i++) + { + ip_0.nx_ipv6_nd_cache[i].nx_nd_cache_is_static = NX_TRUE; + } + + /* Update the IP address and mac address. */ + dest_ip.nxd_ip_address.v6[3] += 1; + mac_address[5] += 1; + + /* Call the function to added the new entry. the entry status is ND_CACHE_STATE_REACHABLE can be replaced when disable the NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES. */ + status = _nx_nd_cache_add(&ip_0, &dest_ip.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_CREATED, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status != NX_NOT_SUCCESSFUL) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES + /* Cover branch in nx_nd_cache_add_entry.c + 212 [ + - ]: 8 : if (ip_ptr -> nx_ipv6_nd_cache[index].nx_nd_cache_timer_tick < timer_ticks_left) */ + /* Invalidate all ND caches. */ + nxd_nd_cache_invalidate(&ip_0); + + /* Set ipv6 global address for IP instance 1. */ + dest_ip.nxd_ip_version = NX_IP_VERSION_V6; + dest_ip.nxd_ip_address.v6[0] = 0x20010000; + dest_ip.nxd_ip_address.v6[1] = 0x00000000; + dest_ip.nxd_ip_address.v6[2] = 0x00000000; + dest_ip.nxd_ip_address.v6[3] = 0x10000003; + + /* Added the same ND Cache entry. */ + mac_address[0] = 0x00; + mac_address[1] = 0x11; + mac_address[2] = 0x22; + mac_address[3] = 0x33; + mac_address[4] = 0x44; + mac_address[5] = 0x58; + + /* Loop to added the ND CACHE ENTRY. */ + for (i = 0; i < NX_IPV6_NEIGHBOR_CACHE_SIZE; i++) + { + + /* Update the IP address and mac address. */ + dest_ip.nxd_ip_address.v6[3] += 1; + mac_address[5] += 1; + + /* Call the function to added the same entry. */ + status = _nx_nd_cache_add(&ip_0, &dest_ip.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_REACHABLE, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_timer_tick -= 1; + ip_0.nx_ipv6_nd_cache[1].nx_nd_cache_timer_tick -= 2; + + dest_ip.nxd_ip_address.v6[3] += 1; + mac_address[5] += 1; + status = _nx_nd_cache_add(&ip_0, &dest_ip.nxd_ip_address.v6[0], &ip_0.nx_ip_interface[0], &mac_address[0], 0, ND_CACHE_STATE_CREATED, &ip_0.nx_ipv6_address[0], &nd_cache_entry); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_IPV6_PURGE_UNUSED_CACHE_ENTRIES */ + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_add_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ND Cache Add Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_nd_cache_api_test.c b/test/regression/netxduo_test/netx_nd_cache_api_test.c new file mode 100644 index 00000000..24efed4d --- /dev/null +++ b/test/regression/netxduo_test/netx_nd_cache_api_test.c @@ -0,0 +1,384 @@ +/* Test IPv6 ND CACHE APIs. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#define MAX_TEST_INTERFACES 2 + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES >= MAX_TEST_INTERFACES) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_api_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 0,&ipv6_address_0, 64, NX_NULL); + + if(status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_512); + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20020000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_1, 64, NX_NULL); + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS dest_address[4]; +CHAR dest_mac[4][6]; +NXD_ADDRESS ipv6_address; +NXD_ADDRESS invalid_address; +ULONG physical_msw; +ULONG physical_lsw; +UINT interface_index; + + /* Print out test information banner. */ + printf("NetX Test: ND Cache API Test........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the Destination address and mac address. */ + dest_address[0].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[0].nxd_ip_address.v6[0] = 0x20010000; + dest_address[0].nxd_ip_address.v6[1] = 0x00000000; + dest_address[0].nxd_ip_address.v6[2] = 0x00000000; + dest_address[0].nxd_ip_address.v6[3] = 0x01020305; + + dest_mac[0][0] = 0x11; + dest_mac[0][1] = 0x22; + dest_mac[0][2] = 0x33; + dest_mac[0][3] = 0x44; + dest_mac[0][4] = 0x55; + dest_mac[0][5] = 0x69; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[0].nxd_ip_address.v6[0], 0, &dest_mac[0][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[1].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[1].nxd_ip_address.v6[0] = 0x20010000; + dest_address[1].nxd_ip_address.v6[1] = 0x00000000; + dest_address[1].nxd_ip_address.v6[2] = 0x00000000; + dest_address[1].nxd_ip_address.v6[3] = 0x01020306; + + dest_mac[1][0] = 0x11; + dest_mac[1][1] = 0x22; + dest_mac[1][2] = 0x33; + dest_mac[1][3] = 0x44; + dest_mac[1][4] = 0x55; + dest_mac[1][5] = 0x70; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[1].nxd_ip_address.v6[0], 0, &dest_mac[1][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[2].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[2].nxd_ip_address.v6[0] = 0x20020000; + dest_address[2].nxd_ip_address.v6[1] = 0x00000000; + dest_address[2].nxd_ip_address.v6[2] = 0x00000000; + dest_address[2].nxd_ip_address.v6[3] = 0x01020305; + + dest_mac[2][0] = 0x11; + dest_mac[2][1] = 0x22; + dest_mac[2][2] = 0x33; + dest_mac[2][3] = 0x44; + dest_mac[2][4] = 0x66; + dest_mac[2][5] = 0x69; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[2].nxd_ip_address.v6[0], 1, &dest_mac[2][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[3].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[3].nxd_ip_address.v6[0] = 0x20020000; + dest_address[3].nxd_ip_address.v6[1] = 0x00000000; + dest_address[3].nxd_ip_address.v6[2] = 0x00000000; + dest_address[3].nxd_ip_address.v6[3] = 0x01020306; + + dest_mac[3][0] = 0x11; + dest_mac[3][1] = 0x22; + dest_mac[3][2] = 0x33; + dest_mac[3][3] = 0x44; + dest_mac[3][4] = 0x66; + dest_mac[3][5] = 0x70; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[3].nxd_ip_address.v6[0], 1, &dest_mac[3][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[0], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 0) || + (physical_msw != 0x00001122) || + (physical_lsw != 0x33445569)) + error_counter ++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[3], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (physical_msw != 0x00001122) || + (physical_lsw != 0x33446670)) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33445570, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 0) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address[1].nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address[1].nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address[1].nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address[1].nxd_ip_address.v6[3])) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446669, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address[2].nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address[2].nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address[2].nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address[2].nxd_ip_address.v6[3])) + error_counter ++; + + /* Set an invalid address. */ + invalid_address.nxd_ip_version = NX_IP_VERSION_V6; + invalid_address.nxd_ip_address.v6[0] = 0x30000000; + invalid_address.nxd_ip_address.v6[1] = 0x00000000; + invalid_address.nxd_ip_address.v6[2] = 0x00000000; + invalid_address.nxd_ip_address.v6[3] = 0x11111111; + + /* Delete the ND Cache entry with invalid address. */ + status = nxd_nd_cache_entry_delete(&ip_0, &invalid_address.nxd_ip_address.v6[0]); + + /* Check status. */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* Delete the ND Cache entry. */ + status = nxd_nd_cache_entry_delete(&ip_0, &dest_address[0].nxd_ip_address.v6[0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the destination address 0. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[0], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Invalidate the all address. */ + status = nxd_nd_cache_invalidate(&ip_0); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the mac address 0 by destination address 0. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[0], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the mac address 1 by destination address 1. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[1], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the mac address 2 by destination address 2. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[2], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the mac address 3 by destination address 3. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[3], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 0 by hardware address 0. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33445569, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 1 by hardware address 1. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33445570, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 2 by hardware address 2. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446669, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address 3 by hardware address 3. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446670, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ND Cache API Test.........................................N/A\n"); + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_nd_cache_branch_test.c b/test/regression/netxduo_test/netx_nd_cache_branch_test.c new file mode 100644 index 00000000..d42718bc --- /dev/null +++ b/test/regression/netxduo_test/netx_nd_cache_branch_test.c @@ -0,0 +1,187 @@ +/* This NetX test concentrates on the code coverage for ND functions, + * _nx_nd_cache_delete_internal.c + * _nx_nd_cache_find_entry.c + * _nx_nd_cache_find_entry_by_mac_addr.c + */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 +#include "tx_thread.h" +#include "nx_icmp.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_branch_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ICMP processing for IP instance. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ICMP enable status. */ + if (status) + error_counter++; + + /* Enable IPv6 processing for IP instance. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + +ULONG address_1[4]; +ND_CACHE_ENTRY *cache_entry; + + /* Print out some test information banners. */ + printf("NetX Test: ND CACHE Branch Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + + + /* Hit false condition of while (table_size && i < NX_IPV6_DESTINATION_TABLE_SIZE) in _nx_nd_cache_delete_internal . */ + ip_0.nx_ipv6_destination_table_size = NX_IPV6_DESTINATION_TABLE_SIZE + 1; + _nx_nd_cache_delete_internal(&ip_0, &ip_0.nx_ipv6_nd_cache[0]); + ip_0.nx_ipv6_destination_table_size = 0; + + + /* Hit false condition of (ip_0.nx_ipv6_nd_cache[index].nx_nd_cache_interface_ptr) in _nx_nd_cache_find_entry . */ + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_nd_status = ND_CACHE_STATE_CREATED; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_interface_ptr = NX_NULL; + address_1[0] = 0x00000000; + address_1[1] = 0x00000000; + address_1[2] = 0x00000000; + address_1[3] = 0x00000000; + _nx_nd_cache_find_entry(&ip_0, address_1, &cache_entry); + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_nd_status = ND_CACHE_STATE_INVALID; + + + /* Hit condition of if ((mac_msw == physical_msw) && (mac_lsw == physical_lsw)) in _nx_nd_cache_find_entry_by_mac_addr. */ + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_nd_status = ND_CACHE_STATE_CREATED; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_interface_ptr = &ip_0.nx_ip_interface[0]; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_mac_addr[0] = 0x00; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_mac_addr[1] = 0x11; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_mac_addr[2] = 0x22; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_mac_addr[3] = 0x33; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_mac_addr[4] = 0x44; + ip_0.nx_ipv6_nd_cache[0].nx_nd_cache_mac_addr[5] = 0x56; + _nx_nd_cache_find_entry_by_mac_addr(&ip_0, 0x0000, 0x22334456, &cache_entry); + _nx_nd_cache_find_entry_by_mac_addr(&ip_0, 0x0011, 0x22334456, &cache_entry); + memset(&ip_0.nx_ipv6_nd_cache[0], 0, sizeof(ip_0.nx_ipv6_nd_cache[0])); + + + /* Hit false condition of (i < NX_IPV6_DESTINATION_TABLE_SIZE) in _nx_invalidate_destination_entry. */ + ip_0.nx_ipv6_destination_table_size = NX_IPV6_DESTINATION_TABLE_SIZE + 1; + address_1[0] = 0x90010001; + address_1[1] = 0x00000002; + address_1[2] = 0x00000003; + address_1[3] = 0x00000004; + _nx_invalidate_destination_entry(&ip_0, address_1); + ip_0.nx_ipv6_destination_table_size = 0; + + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ND CACHE Branch Test......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_nd_cache_nxe_api_test.c b/test/regression/netxduo_test/netx_nd_cache_nxe_api_test.c new file mode 100644 index 00000000..985bd251 --- /dev/null +++ b/test/regression/netxduo_test/netx_nd_cache_nxe_api_test.c @@ -0,0 +1,420 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined NX_DISABLE_ERROR_CHECKING && defined FEATURE_NX_IPV6 +#include "nx_nd_cache.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS ipv6_address; +CHAR mac_addr[6]; +ULONG physical_msw; +ULONG physical_lsw; +UINT interface_index; + + /* Print out some test information banners. */ + printf("NetX Test: ND CACHE NXE API Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address.nxd_ip_address.v6[0] = 0x20020000; + ipv6_address.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address.nxd_ip_address.v6[3] = 0x01020306; + + /* Set the MAC address. */ + mac_addr[0] = 0x00; + mac_addr[0] = 0x11; + mac_addr[0] = 0x22; + mac_addr[0] = 0x33; + mac_addr[0] = 0x44; + mac_addr[0] = 0x58; + + /************************************************/ + /* Tested the nxe_arp_entry_delete api */ + /************************************************/ + + /* Delete the entry for NULL IP instance. */ + status = nxd_nd_cache_entry_delete(NX_NULL, &ipv6_address.nxd_ip_address.v6[0]); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the entry for invalid IP instance. */ + status = nxd_nd_cache_entry_delete(&invalid_ip, &ipv6_address.nxd_ip_address.v6[0]); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the entry with NULL IP address pointer. */ + status = nxd_nd_cache_entry_delete(&ip_0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /**********************************************/ + /* Tested the nxde_nd_cache_entry_set api */ + /**********************************************/ + + /* Set the ND CACHE entry for NULL IP instance. */ + status = nxd_nd_cache_entry_set(NX_NULL, &ipv6_address.nxd_ip_address.v6[0], 0, mac_addr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Set the ND CACHE entry for invalid IP instance. */ + status = nxd_nd_cache_entry_set(&invalid_ip, &ipv6_address.nxd_ip_address.v6[0], 0, mac_addr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ND CACHE entry with NULL ipv6 address pointer. */ + status = nxd_nd_cache_entry_set(&ip_0, NX_NULL, 0, mac_addr); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ND CACHE entry with NULL mac address pointer. */ + status = nxd_nd_cache_entry_set(&ip_0, &ipv6_address.nxd_ip_address.v6[0], 0, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ND CACHE entry with MAX interface index. */ + status = nxd_nd_cache_entry_set(&ip_0, &ipv6_address.nxd_ip_address.v6[0], NX_MAX_PHYSICAL_INTERFACES, mac_addr); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /******************************************************/ + /* Tested the nxde_nd_cache_hardware_address_find api */ + /******************************************************/ + + /* Find the hardware address for NULL IP instance. */ + status = nxd_nd_cache_hardware_address_find(NX_NULL, &ipv6_address, &physical_msw, &physical_lsw, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Find the hardware address for invalid IP instance. */ + status = nxd_nd_cache_hardware_address_find(&invalid_ip, &ipv6_address, &physical_msw, &physical_lsw, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address with NULL address pointer. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, NX_NULL, &physical_msw, &physical_lsw, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for valid IP instance with invalid physical_msw pointer. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &ipv6_address, NX_NULL, &physical_lsw, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for valid IP instance with invalid physical_msw pointer. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &ipv6_address, &physical_msw, NX_NULL, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the hardware address for valid IP instance with NULL interface index pointer. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &ipv6_address, &physical_msw, &physical_lsw, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 address with invalid version. */ + ipv6_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Find the hardware address with invalid address version. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &ipv6_address, &physical_msw, &physical_lsw, &interface_index); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*******************************************/ + /* Tested the nxde_nd_cache_invalidate api */ + /*******************************************/ + + /* Delete the ND Cache entries for NULL IP instance. */ + status = nxd_nd_cache_invalidate(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Delete the ND Cache entries for invalid IP instance. */ + status = nxd_nd_cache_invalidate(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxde_nd_cache_ip_address_find api */ + /************************************************/ + + /* Find the ip address for NULL IP instance. */ + status = nxd_nd_cache_ip_address_find(NX_NULL, &ipv6_address, 0x0011, 0x22334456, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Find the ip address for invalid IP instance. */ + status = nxd_nd_cache_ip_address_find(&invalid_ip, &ipv6_address, 0x0011, 0x22334456, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the ip address with NULL ip address pointer. */ + status = nxd_nd_cache_ip_address_find(&ip_0, NX_NULL, 0x0011, 0x22334456, &interface_index); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the ip address with NULL interface index pointer. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x0011, 0x22334456, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the ip address with invalid physcial address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0, 0, &interface_index); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the ip address with valid physcial address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0, 1, &interface_index); + + /* Check for error. */ + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ND CACHE NXE API Test.....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_nd_cache_under_interface_detach_test.c b/test/regression/netxduo_test/netx_nd_cache_under_interface_detach_test.c new file mode 100644 index 00000000..e745e0a2 --- /dev/null +++ b/test/regression/netxduo_test/netx_nd_cache_under_interface_detach_test.c @@ -0,0 +1,324 @@ +/* Test IPv6 ND CACHE APIs. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#define MAX_TEST_INTERFACES 2 + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES >= MAX_TEST_INTERFACES) +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_under_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 0,&ipv6_address_0, 64, NX_NULL); + + if(status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_512); + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20020000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x01020304; + + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_1, 64, NX_NULL); + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS dest_address[4]; +CHAR dest_mac[4][6]; +NXD_ADDRESS ipv6_address; +ULONG physical_msw; +ULONG physical_lsw; +UINT interface_index; + + /* Print out test information banner. */ + printf("NetX Test: ND Cache Under Interface Detach Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the Destination address and mac address. */ + dest_address[0].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[0].nxd_ip_address.v6[0] = 0x20010000; + dest_address[0].nxd_ip_address.v6[1] = 0x00000000; + dest_address[0].nxd_ip_address.v6[2] = 0x00000000; + dest_address[0].nxd_ip_address.v6[3] = 0x01020305; + + dest_mac[0][0] = 0x11; + dest_mac[0][1] = 0x22; + dest_mac[0][2] = 0x33; + dest_mac[0][3] = 0x44; + dest_mac[0][4] = 0x55; + dest_mac[0][5] = 0x69; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[0].nxd_ip_address.v6[0], 0, &dest_mac[0][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[1].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[1].nxd_ip_address.v6[0] = 0x20010000; + dest_address[1].nxd_ip_address.v6[1] = 0x00000000; + dest_address[1].nxd_ip_address.v6[2] = 0x00000000; + dest_address[1].nxd_ip_address.v6[3] = 0x01020306; + + dest_mac[1][0] = 0x11; + dest_mac[1][1] = 0x22; + dest_mac[1][2] = 0x33; + dest_mac[1][3] = 0x44; + dest_mac[1][4] = 0x55; + dest_mac[1][5] = 0x70; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[1].nxd_ip_address.v6[0], 0, &dest_mac[1][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[2].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[2].nxd_ip_address.v6[0] = 0x20020000; + dest_address[2].nxd_ip_address.v6[1] = 0x00000000; + dest_address[2].nxd_ip_address.v6[2] = 0x00000000; + dest_address[2].nxd_ip_address.v6[3] = 0x01020305; + + dest_mac[2][0] = 0x11; + dest_mac[2][1] = 0x22; + dest_mac[2][2] = 0x33; + dest_mac[2][3] = 0x44; + dest_mac[2][4] = 0x66; + dest_mac[2][5] = 0x69; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[2].nxd_ip_address.v6[0], 1, &dest_mac[2][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Set the Destination address and mac address. */ + dest_address[3].nxd_ip_version = NX_IP_VERSION_V6; + dest_address[3].nxd_ip_address.v6[0] = 0x20020000; + dest_address[3].nxd_ip_address.v6[1] = 0x00000000; + dest_address[3].nxd_ip_address.v6[2] = 0x00000000; + dest_address[3].nxd_ip_address.v6[3] = 0x01020306; + + dest_mac[3][0] = 0x11; + dest_mac[3][1] = 0x22; + dest_mac[3][2] = 0x33; + dest_mac[3][3] = 0x44; + dest_mac[3][4] = 0x66; + dest_mac[3][5] = 0x70; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address[3].nxd_ip_address.v6[0], 1, &dest_mac[3][0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[2], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (physical_msw != 0x00001122) || + (physical_lsw != 0x33446669)) + error_counter ++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[3], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (physical_msw != 0x00001122) || + (physical_lsw != 0x33446670)) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446669, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address[2].nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address[2].nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address[2].nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address[2].nxd_ip_address.v6[3])) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446670, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 1) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address[3].nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address[3].nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address[3].nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address[3].nxd_ip_address.v6[3])) + error_counter ++; + + /* Detach the second interface. */ + status = nx_ip_interface_detach(&ip_0, 1); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[2], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address[3], &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446669, &interface_index); + + /* Check status. */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00001122, 0x33446670, &interface_index); + + /* Check status. */ + if(status != NX_ENTRY_NOT_FOUND) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_under_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ND Cache Under Interface Detach Test......................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_nd_cache_with_own_address_test.c b/test/regression/netxduo_test/netx_nd_cache_with_own_address_test.c new file mode 100644 index 00000000..5ef0ba12 --- /dev/null +++ b/test/regression/netxduo_test/netx_nd_cache_with_own_address_test.c @@ -0,0 +1,239 @@ +/* Test IPv6 ND CACHE APIs. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV6_DAD) +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_with_own_address_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMPv6 */ + status = nxd_icmp_enable(&ip_0); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS dest_address; +CHAR dest_mac[6]; +NXD_ADDRESS ipv6_address; +ULONG physical_msw; +ULONG physical_lsw; +UINT interface_index; +UINT address_index; + + /* Print out test information banner. */ + printf("NetX Test: ND Cache With Own Address Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IPv6 linklocal address for IP instance 0. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Set the Destination address and mac address. */ + dest_address.nxd_ip_version = NX_IP_VERSION_V6; + dest_address.nxd_ip_address.v6[0] = 0xfe800000; + dest_address.nxd_ip_address.v6[1] = 0x00000000; + dest_address.nxd_ip_address.v6[2] = 0x021122ff; + dest_address.nxd_ip_address.v6[3] = 0xfe334457; + + dest_mac[0] = 0x00; + dest_mac[1] = 0x11; + dest_mac[2] = 0x22; + dest_mac[3] = 0x33; + dest_mac[4] = 0x44; + dest_mac[5] = 0x57; + + /* Set the ND CACHE entry. */ + status = nxd_nd_cache_entry_set(&ip_0, &dest_address.nxd_ip_address.v6[0], 0, &dest_mac[0]); + + /* Check status. */ + if(status) + error_counter++; + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address, &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 0) || + (physical_msw != 0x00000011) || + (physical_lsw != 0x22334457)) + error_counter ++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00000011, 0x22334457, &interface_index); + + /* Check status. */ + if(status) + error_counter++; + + /* Match the mac address and interface index. */ + if ((interface_index != 0) || + (ipv6_address.nxd_ip_address.v6[0] != dest_address.nxd_ip_address.v6[0]) || + (ipv6_address.nxd_ip_address.v6[1] != dest_address.nxd_ip_address.v6[1]) || + (ipv6_address.nxd_ip_address.v6[2] != dest_address.nxd_ip_address.v6[2]) || + (ipv6_address.nxd_ip_address.v6[3] != dest_address.nxd_ip_address.v6[3])) + error_counter ++; + + /* Delete the linklocal address. */ + nxd_ipv6_address_delete(&ip_0, address_index); + + /* Set the physical address. */ + physical_msw = 0x00000011; + physical_lsw = 0x22334457; + + /* Set the interface capability. */ + status = nx_ip_interface_physical_address_set(&ip_0, 0, physical_msw, physical_lsw, NX_TRUE); + + /* Check the status. */ + if (status) + error_counter++; + + /* Set the IPv6 linklocal address for IP instance 0. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); + + /* Check the status. */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 5 seconds for Duplicate Address Detected. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* The linklocal address is same as nd cache address, the ND entry should be invalid. */ + + /* Find the hardware address and interface index by ipv6 address. */ + status = nxd_nd_cache_hardware_address_find(&ip_0, &dest_address, &physical_msw, &physical_lsw, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Find the ipv6 address and interface index by hardware address. */ + status = nxd_nd_cache_ip_address_find(&ip_0, &ipv6_address, 0x00000011, 0x22334456, &interface_index); + + /* Check status. */ + if(status == NX_SUCCESS) + error_counter++; + + /* Check the error counter. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nd_cache_with_own_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: ND Cache With Own Address Test............................N/A\n"); + test_control_return(3); +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_nxd_udp_socket_send_special_test.c b/test/regression/netxduo_test/netx_nxd_udp_socket_send_special_test.c new file mode 100644 index 00000000..ee89ae43 --- /dev/null +++ b/test/regression/netxduo_test/netx_nxd_udp_socket_send_special_test.c @@ -0,0 +1,269 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +static NXD_ADDRESS address_3; +/* Used to construct a packet whose checksum is 0. */ +static UCHAR data[4096 * 32 + 2]; +#endif +static NXD_ADDRESS address_2; + +static UCHAR pool_area[1536*120]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nxd_udp_socket_send_special_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pool_area, sizeof(pool_area)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IPv6 traffic. */ +#ifdef FEATURE_NX_IPV6 + status = nxd_ipv6_enable(&ip_0); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + /* Set the destination address. */ + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + /* Set the IPv6 address. */ + status += nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + + /* Check for status. */ + if (status) + error_counter++; + + address_3.nxd_ip_version = NX_IP_VERSION_V6; + address_3.nxd_ip_address.v6[0] = 0x30010DB8; + address_3.nxd_ip_address.v6[1] = 0x00010001; + address_3.nxd_ip_address.v6[2] = 0x021122FF; + address_3.nxd_ip_address.v6[3] = 0xFE334499; +#endif /* FEATURE_NX_IPV6 */ + + address_2.nxd_ip_version = NX_IP_VERSION_V4; + address_2.nxd_ip_address.v4 = IP_ADDRESS(111, 222, 222, 222); +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: NXD UDP Socket Send Special Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Create udp socket without ip instance. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Socket is not bound, should return error. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_2, 0x89); + if(status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, 2 * NX_IP_PERIODIC_RATE); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with an address that will cause route fail. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_2, 0x89); + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Send the the packet with an address that will cause route fail. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_3, 0x89); + if (status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + nx_packet_release(my_packet); + +#ifdef FEATURE_NX_IPV6 + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set data to let checksum be 0. */ + memset(data, 0xff, 4096 * 32 + 2); + data[4096*32 - 1] = 0x9f; + data[4096*32] = 0xd5; + data[4096*32 + 1] = 0x39; + + status = nx_packet_data_append(my_packet, data, sizeof(data), &pool_0, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_nxd_udp_socket_send_special_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NXD UDP Socket Send Special Test..........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_old_api_test.c b/test/regression/netxduo_test/netx_old_api_test.c new file mode 100644 index 00000000..9cad2919 --- /dev/null +++ b/test/regression/netxduo_test/netx_old_api_test.c @@ -0,0 +1,141 @@ +/* This case tests if compile works with old APIs. */ + +#include "nx_api.h" +#include "tx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static TX_THREAD ntest_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +static void ntest_0_entry(ULONG thread_input); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_old_api_application_define(void *first_unused_memory) +#endif +{ +UCHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +#if defined(__PRODUCT_NETXDUO__) +NX_PACKET *packet_ptr; +NX_UDP_SOCKET udp_socket; +#ifdef FEATURE_NX_IPV6 + +NXD_ADDRESS src_address; + + /* Set source and destination address with global address. */ + src_address.nxd_ip_version = NX_IP_VERSION_V6; + src_address.nxd_ip_address.v6[0] = 0x20010DB8; + src_address.nxd_ip_address.v6[1] = 0x00010001; + src_address.nxd_ip_address.v6[2] = 0x021122FF; + src_address.nxd_ip_address.v6[3] = 0xFE334456; + + nxd_ipv6_address_set(&ip_0, 0, &src_address, 64, NX_NULL); +#endif + + /* Test old APIs. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nx_ip_raw_packet_interface_send(&ip_0, packet_ptr, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nx_udp_socket_create(&ip_0, &udp_socket, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + nx_udp_socket_bind(&udp_socket, 0x88, TX_WAIT_FOREVER); + nx_udp_socket_interface_send(&udp_socket, packet_ptr, IP_ADDRESS(1, 2, 3, 5), 87, 0); + +#ifdef FEATURE_NX_IPV6 + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nxd_ip_raw_packet_interface_send(&ip_0, packet_ptr, &src_address, 0, 100, 255, NX_IP_NORMAL); + + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nxd_udp_socket_interface_send(&udp_socket, packet_ptr, &src_address, 87, 0); + + nxd_icmp_interface_ping(&ip_0, &src_address, 0, "test", 4, &packet_ptr, TX_NO_WAIT); +#endif + + /* Test new APIs. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nx_ip_raw_packet_interface_send(&ip_0, packet_ptr, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nx_udp_socket_source_send(&udp_socket, packet_ptr, IP_ADDRESS(1, 2, 3, 5), 87, 0); + +#ifdef FEATURE_NX_IPV6 + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nxd_ip_raw_packet_source_send(&ip_0, packet_ptr, &src_address, 0, 100, 255, NX_IP_NORMAL); + + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_NO_WAIT); + nxd_udp_socket_source_send(&udp_socket, packet_ptr, &src_address, 87, 0); + + nxd_icmp_source_ping(&ip_0, &src_address, 0, "test", 4, &packet_ptr, TX_NO_WAIT); +#endif + + printf("NetX Test: Old APIs Test.............................................SUCCESS!\n"); + test_control_return(0); +#endif +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_old_api_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Old APIs Test.............................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_packet_basic_test.c b/test/regression/netxduo_test/netx_packet_basic_test.c new file mode 100644 index 00000000..114030c0 --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_basic_test.c @@ -0,0 +1,733 @@ +/* This NetX test concentrates on the basic packet operations. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_packet.h" + +#define DEMO_STACK_SIZE 2048 + +#define TEST_SIZE (NX_UDP_PACKET+28) + +#ifndef NX_PACKET_ALIGNMENT +#define NX_PACKET_ALIGNMENT sizeof(ULONG) +#endif /* NX_PACKET_ALIGNMENT */ + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_PACKET_POOL pool_2; +#ifdef NX_DISABLE_ERROR_CHECKING +static NX_PACKET_POOL pool_3; +#endif +static NX_PACKET_POOL pool_4; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pool_0_ptr; +static CHAR *pool_1_ptr; +static CHAR *pool_2_ptr; +#ifdef NX_DISABLE_ERROR_CHECKING +static CHAR *pool_3_ptr; +#endif +static CHAR *pool_4_ptr; +static ULONG pool_0_size; + + +static UCHAR buffer[2048]; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + pool_0_ptr = NX_NULL; + pool_1_ptr = NX_NULL; + pool_2_ptr = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create first packet pool. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + pool_0_ptr = pointer; + pool_0_size = (((TEST_SIZE + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)) + ((sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1))) * 3; + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pool_0_ptr, pool_0_size); + + pointer = pointer + pool_0_size; + if (status) + error_counter++; + + /* Create second packet pool. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + status = nx_packet_pool_create(&pool_1, "NetX Second Packet Pool", 200, pointer, 1000); + pool_1_ptr = pointer; + pointer = pointer + 1000; + + if (status) + error_counter++; + + /* Create third packet pool. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + status = nx_packet_pool_create(&pool_2, "NetX Third Packet Pool", 256, pointer, 8192); + pool_2_ptr = pointer; + pointer = pointer + 8192; + + if (status) + error_counter++; + +#ifdef NX_DISABLE_ERROR_CHECKING + /* Create fourth packet pool, small pool size. */ + status = nx_packet_pool_create(&pool_3, "NetX Fourth Packet Pool", 256, pointer, 200); + pool_3_ptr = pointer; + pointer = pointer + 200; + + if (status) + error_counter++; +#endif + + /* Create fourth packet pool, small pool size. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + status = nx_packet_pool_create(&pool_4, "NetX Fifth Packet Pool", 252, pointer, 8192); + pool_4_ptr = pointer; + pointer = pointer + 8192; + + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) +NX_PACKET *packet_ptr; +#endif /* !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) */ +ULONG size; +UCHAR local_buffer[300]; +ULONG total_packets, free_packets, empty_pool_requests, empty_pool_suspensions, invalid_packet_releases; + + /* Print out test information banner. */ + printf("NetX Test: Packet Basic Processing Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete all the packet pools. */ + status = nx_packet_pool_delete(&pool_0); + status += nx_packet_pool_delete(&pool_1); + status += nx_packet_pool_delete(&pool_2); +#ifdef NX_DISABLE_ERROR_CHECKING + status += nx_packet_pool_delete(&pool_3); +#endif + status += nx_packet_pool_delete(&pool_4); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the pools again. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pool_0_ptr, pool_0_size); + status += nx_packet_pool_create(&pool_1, "NetX Second Packet Pool", TEST_SIZE, pool_1_ptr, 1000); + status += nx_packet_pool_create(&pool_2, "NetX Third Packet Pool", 256, pool_2_ptr, 8192); +#ifdef NX_DISABLE_ERROR_CHECKING + status += nx_packet_pool_create(&pool_3, "NetX Fourth Packet Pool", 256, pool_3_ptr, 200); +#endif + status += nx_packet_pool_create(&pool_4, "NetX Fifth Packet Pool", 252, pool_4_ptr, 8192); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate packets. */ + status = nx_packet_allocate(&pool_4, &my_packet1, NX_UDP_PACKET, 10); + status += nx_packet_allocate(&pool_4, &my_packet2, NX_UDP_PACKET, 10); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check alignment. */ + if(((ALIGN_TYPE)my_packet1 & (NX_PACKET_ALIGNMENT - 1)) || + ((ALIGN_TYPE)my_packet2 & (NX_PACKET_ALIGNMENT - 1)) || + ((ALIGN_TYPE)(my_packet1 -> nx_packet_data_start) & (NX_PACKET_ALIGNMENT - 1)) || + ((ALIGN_TYPE)(my_packet2 -> nx_packet_data_start) & (NX_PACKET_ALIGNMENT - 1))) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_release(my_packet1); + status += nx_packet_release(my_packet2); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Allocate packets. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_UDP_PACKET, 10); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_UDP_PACKET, 10); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_UDP_PACKET, 10); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to allocate another packet to get the error return. */ + status = nx_packet_allocate(&pool_0, &my_packet4, NX_UDP_PACKET, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_NO_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release all the packets but the first. */ + status = nx_packet_release(my_packet2); + status += nx_packet_release(my_packet3); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Place the alphabet in the packet. */ + status = nx_packet_data_append(my_packet1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy the packet to another pool. */ + status = nx_packet_copy(my_packet1, &my_packet2, &pool_1, NX_NO_WAIT); + + /* Check status. */ + if ((status != NX_SUCCESS) || (my_packet2 -> nx_packet_length != 28)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Retrieve the payload from new packet. */ + local_buffer[0] = 0; + status = nx_packet_data_retrieve(my_packet2, local_buffer, &size); + + /* Check status. */ + if ((status) || (my_packet2 -> nx_packet_length != 28) || (size != 28) || (local_buffer[0] != 'A')) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet copy. */ + status = nx_packet_release(my_packet2); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) + /* Make sure the packet is chained. */ + while(my_packet1 -> nx_packet_next == (NX_PACKET *)NX_NULL) + { + + /* Append numbers to first message. This will introduce packet chaining. */ + status += nx_packet_data_append(my_packet1, "0102030405060708091011121314151617181920", 40, &pool_0, NX_NO_WAIT); + } + + /* Trim data in the last packet. */ + my_packet1 -> nx_packet_length -= (ULONG)((ALIGN_TYPE)my_packet1 -> nx_packet_last -> nx_packet_append_ptr - (ALIGN_TYPE)my_packet1 -> nx_packet_last -> nx_packet_append_ptr); + my_packet1 -> nx_packet_last = my_packet1; + packet_ptr = my_packet1 -> nx_packet_next; + + /* Append numbers to first message. This will reuse the packet chaining. */ + status += nx_packet_data_append(my_packet1, "abc", 3, &pool_0, NX_NO_WAIT); + + /* Check status. */ + if ((status != NX_SUCCESS) || (my_packet1 -> nx_packet_next != packet_ptr)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy the packet to a packet in both pools. This requires chaining and non-chaining. */ + status = nx_packet_copy(my_packet1, &my_packet2, &pool_1, NX_NO_WAIT); + status += nx_packet_copy(my_packet2, &my_packet3, &pool_2, NX_NO_WAIT); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (my_packet2 -> nx_packet_length != my_packet1 -> nx_packet_length) || + (my_packet3 -> nx_packet_length != my_packet2 -> nx_packet_length)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Retrieve the payload from the first new packet. */ + local_buffer[0] = 0; + status = nx_packet_data_retrieve(my_packet2, local_buffer, &size); + + /* Check status. */ + if ((status) || + (my_packet1 -> nx_packet_length != my_packet2 -> nx_packet_length) || + (size != my_packet2 -> nx_packet_length) || + (local_buffer[0] != 'A') || (local_buffer[28] != '0')) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Retrieve the payload from the second new packet. */ + local_buffer[0] = 0; + status = nx_packet_data_retrieve(my_packet3, local_buffer, &size); + + /* Check status. */ + if ((status) || (my_packet3 -> nx_packet_length != my_packet2 -> nx_packet_length) || + (size != my_packet2 -> nx_packet_length) || + (local_buffer[0] != 'A') || (local_buffer[28] != '0')) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_PACKET_CHAIN && __PRODUCT_NETXDUO__ */ + + /* Transmit release all packets. */ + status = nx_packet_transmit_release(my_packet1); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) + status += nx_packet_transmit_release(my_packet2); + status += nx_packet_transmit_release(my_packet3); +#endif /* NX_DISABLE_PACKET_CHAIN && __PRODUCT_NETXDUO__ */ + + /* Get nothing from the first pool. */ + status += nx_packet_pool_info_get(&pool_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Get information about the first pool. */ + status += nx_packet_pool_info_get(&pool_0, &total_packets, &free_packets, &empty_pool_requests, &empty_pool_suspensions, &invalid_packet_releases); + +#ifndef NX_DISABLE_PACKET_INFO + + if(empty_pool_requests != 1) + status++; +#endif + + /* Check status. */ + if ((status) || (total_packets != 3) || (free_packets != 3) || (empty_pool_suspensions) || (invalid_packet_releases)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete all the packet pools. */ + status = nx_packet_pool_delete(&pool_0); + status += nx_packet_pool_delete(&pool_1); + status += nx_packet_pool_delete(&pool_2); +#ifdef NX_DISABLE_ERROR_CHECKING + status += nx_packet_pool_delete(&pool_3); +#endif + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Tested the abnormal operation. */ + + /* Create the pools again. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pool_0_ptr, pool_0_size); + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", TEST_SIZE, pool_1_ptr, 1000); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 0, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Append data that is larger than whole pool. */ + status = nx_packet_data_append(my_packet1, buffer, sizeof(buffer), &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if((!status) ||(pool_0.nx_packet_pool_invalid_releases)) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /* Copy the packet with length 0. */ + status = nx_packet_copy(my_packet1, &my_packet2, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if(!status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) + /* Append data that is two packet size. */ + status = nx_packet_data_append(my_packet1, buffer, TEST_SIZE * 2, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy the packet when the pool size not enough. */ + status = nx_packet_copy(my_packet1, &my_packet2, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if(!status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Modify the first packet prepend and append. */ + my_packet1 -> nx_packet_prepend_ptr = my_packet1 -> nx_packet_append_ptr; + my_packet1 -> nx_packet_length = TEST_SIZE; + + /* Copy the packet . */ + status = nx_packet_copy(my_packet1, &my_packet2, &pool_1, NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Release the packet. */ + nx_packet_release(my_packet1); + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 0, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Construct the packet data. */ + memcpy(my_packet1 -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 28; + + /* Set the invalid length. */ + my_packet1 -> nx_packet_length = 30; + + /* Copy the packet when the pool size not enough. */ + status = nx_packet_copy(my_packet1, &my_packet2, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if(!status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Retrieve the packet data. */ + status = nx_packet_data_retrieve(my_packet1, buffer, &size); + + /* Check the status. */ + if(!status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet with zero offset. */ + status = nx_packet_data_extract_offset(my_packet1, 30, buffer, sizeof(buffer), &size); + + /* Check the status. */ + if(!status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid packet length. */ + my_packet1 -> nx_packet_length = 0; + + /* Extract the packet with zero offset. */ + status = nx_packet_data_extract_offset(my_packet1, 0, buffer, sizeof(buffer), &size); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the valid packet length. */ + my_packet1 -> nx_packet_length = 28; + + /* Extract the packet with small buffer. */ + status = nx_packet_data_extract_offset(my_packet1, 0, buffer, 26, &size); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + nx_packet_release(my_packet1); + +#ifndef NX_DISABLE_PACKET_CHAIN + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 0, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data that is two packet size. */ + status = nx_packet_data_append(my_packet1, buffer, TEST_SIZE * 2, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet. */ + status = nx_packet_data_extract_offset(my_packet1, TEST_SIZE, buffer, sizeof(buffer), &size); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet with small buffer. */ + status = nx_packet_data_extract_offset(my_packet1, 0, buffer, TEST_SIZE, &size); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid length. */ + my_packet1 -> nx_packet_length = TEST_SIZE * 3; + + /* Extract the packet with invalid length. */ + status = nx_packet_data_extract_offset(my_packet1, TEST_SIZE * 2, buffer, sizeof(buffer), &size); + + /* Check the status. */ + if(!status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the packet length. */ + my_packet1 -> nx_packet_length = TEST_SIZE * 2; + + /* Try to release this packet. */ + status = nx_packet_release(my_packet1); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Allocate the packet with large packet type. */ + status = nx_packet_allocate(&pool_0, &my_packet1, (pool_0.nx_packet_pool_payload_size + 4), NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, 0, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Modifed the pool owner. */ + my_packet1 -> nx_packet_pool_owner = NX_NULL; + + /* Try to release this packet. */ + status = nx_packet_release(my_packet1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Modifed the pool owner ID. */ + my_packet1 -> nx_packet_pool_owner = &pool_0; + my_packet1 -> nx_packet_pool_owner -> nx_packet_pool_id = 0; + + /* Try to release this packet. */ + status = nx_packet_release(my_packet1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Recover the pool ID. */ + my_packet1 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + + /* Try to release this packet. */ + status = nx_packet_release(my_packet1); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} + diff --git a/test/regression/netxduo_test/netx_packet_branch_test.c b/test/regression/netxduo_test/netx_packet_branch_test.c new file mode 100644 index 00000000..ad300a65 --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_branch_test.c @@ -0,0 +1,248 @@ +/* This NetX test concentrates on the code coverage for packet functions, + * _nx_packet_transmit_release.c + * _nx_packet_release.c + * _nx_packet_pool_cleanup.c +*/ + +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_packet.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_test1; +static TX_THREAD thread_test2; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static UCHAR buffer[256]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_branch_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable UDP processing for IP instance. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG thread_state; +NX_PACKET *my_packet[2]; + + /* Print out some test information banners. */ + printf("NetX Test: Packet Branch Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_packet_data_adjust() */ + /* header size (512) is larger than the payload size (256). */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + if (_nx_packet_data_adjust(my_packet[0], 512) == NX_SUCCESS) + { + error_counter++; + } + nx_packet_release(my_packet[0]); + +#ifndef NX_DISABLE_PACKET_CHAIN + /* header size (255) is odd and larger than the available size of the first packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], 128, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], buffer, sizeof(buffer), &pool_0, NX_NO_WAIT); + if (_nx_packet_data_adjust(my_packet[0], 255) == NX_SUCCESS) + { + error_counter++; + } + nx_packet_release(my_packet[0]); + + /* Adjust packet with packet chain. */ + nx_packet_allocate(&pool_0, &my_packet[0], 128, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], buffer, sizeof(buffer), &pool_0, NX_NO_WAIT); + if (_nx_packet_data_adjust(my_packet[0], 256) != NX_SUCCESS) + { + error_counter++; + } + nx_packet_release(my_packet[0]); +#endif /* NX_DISABLE_PACKET_CHAIN */ +#endif /* __PRODUCT_NETXDUO__ */ + + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + + /* Release the packet. */ + _nx_packet_transmit_release(my_packet[0]); + + /* Release the packet again. */ + _nx_packet_transmit_release(my_packet[0]); + + + +#ifdef __PRODUCT_NETXDUO__ + /* Hit condition of if ((pool_ptr) && (pool_ptr -> nx_packet_pool_id == NX_PACKET_POOL_ID)) in _nx_packet_release(). */ + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_allocate(&pool_0, &my_packet[1], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ENQUEUED; + my_packet[0] -> nx_packet_pool_owner -> nx_packet_pool_id = 0; + _nx_packet_release(my_packet[0]); +#ifndef NX_DISABLE_PACKET_CHAIN + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; + my_packet[0] -> nx_packet_next = my_packet[1]; + my_packet[1] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ENQUEUED; + my_packet[1] -> nx_packet_pool_owner = NX_NULL; + _nx_packet_release(my_packet[0]); + + /* Recover. */ + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; + my_packet[0] -> nx_packet_pool_owner = &pool_0; + my_packet[0] -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + my_packet[0] -> nx_packet_next = NX_NULL; + my_packet[1] -> nx_packet_pool_owner = &pool_0; +#else + + /* Recover. */ + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; + my_packet[0] -> nx_packet_pool_owner = &pool_0; + my_packet[0] -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; +#endif + _nx_packet_release(my_packet[0]); + _nx_packet_release(my_packet[1]); +#endif /* __PRODUCT_NETXDUO__ */ + + + + /* Test _nx_packet_pool_cleanup(). */ + /* tx_thread_suspend_control_block is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + _nx_packet_pool_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* tx_thread_suspend_control_block is set to POOL but tx_thread_suspend_cleanup is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &pool_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + _nx_packet_pool_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* tx_thread_suspend_control_block is set to IP and tx_thread_suspend_cleanup is set to suspend_cleanup, but clear the IP ID. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &pool_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + pool_0.nx_packet_pool_id = 0; + _nx_packet_pool_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + pool_0.nx_packet_pool_id = NX_PACKET_POOL_ID; + + pool_0.nx_packet_pool_suspended_count ++; + tx_thread_identify() -> tx_thread_suspend_control_block = &pool_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + thread_state = tx_thread_identify() -> tx_thread_state; + tx_thread_identify() -> tx_thread_state = 0; + _nx_packet_pool_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + + pool_0.nx_packet_pool_suspended_count ++; + tx_thread_identify() -> tx_thread_suspend_control_block = &pool_0; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspended_next = &thread_test1; + tx_thread_identify() -> tx_thread_suspended_previous = &thread_test2; + thread_state = tx_thread_identify() -> tx_thread_state; + tx_thread_identify() -> tx_thread_state = 0; + _nx_packet_pool_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER) +{ +} + diff --git a/test/regression/netxduo_test/netx_packet_data_append_test.c b/test/regression/netxduo_test/netx_packet_data_append_test.c new file mode 100644 index 00000000..e0e8695e --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_data_append_test.c @@ -0,0 +1,131 @@ +/* This NetX test concentrates on the basic packet operations. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_packet.h" + +#define DEMO_STACK_SIZE 2048 + +#define TEST_SIZE (NX_UDP_PACKET+28) + +#ifndef NX_PACKET_ALIGNMENT +#define NX_PACKET_ALIGNMENT sizeof(ULONG) +#endif /* NX_PACKET_ALIGNMENT */ + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) +static UCHAR buffer[2048]; +#endif + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_data_append_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the pools again. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer, (TEST_SIZE + sizeof(NX_PACKET)) * 10); + pointer = pointer + ((TEST_SIZE + sizeof(NX_PACKET)) * 10); + + /* Check status */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) +UINT status; +NX_PACKET *my_packet; +#endif /* !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) */ + + /* Print out test information banner. */ + printf("NetX Test: Packet Data Append Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data that is two packet size. */ + status = nx_packet_data_append(my_packet, buffer, TEST_SIZE * 4, &pool_0, NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check the status. */ + if(status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} + diff --git a/test/regression/netxduo_test/netx_packet_debug_info_test.c b/test/regression/netxduo_test/netx_packet_debug_info_test.c new file mode 100644 index 00000000..112cc0db --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_debug_info_test.c @@ -0,0 +1,553 @@ +/* This NetX test concentrates on the packet debug information. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_packet.h" +#include "nx_ram_network_driver_test_1500.h" +extern VOID test_control_return(UINT status); + +#if defined(NX_ENABLE_PACKET_DEBUG_INFO) && defined(__PRODUCT_NETXDUO__) && (__NETXDUO_MINOR_VERSION__ > 8) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +#define TEST_SIZE 1536 +#define PACKET_NUM 16 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET temp_socket; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +#ifndef NX_DISABLE_FRAGMENTATION +static UCHAR buffer[2048]; +#endif /* NX_DISABLE_FRAGMENTATION */ +static CHAR *verify_file; +static NX_PACKET_POOL *verify_pool; +static UINT count; +static UINT operation; +static UINT delay; + +/* Define thread prototypes. */ + +static VOID ntest_0_entry(ULONG thread_input); +static VOID ntest_1_entry(ULONG thread_input); +static VOID verify_packet(NX_PACKET_POOL *pool_ptr, CHAR *in_files); +extern VOID _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +VOID netx_packet_debug_info_test_application_define(VOID *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create first packet pool. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer, ((TEST_SIZE + sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)) * PACKET_NUM); + + pointer = pointer + (TEST_SIZE + NX_PACKET_ALIGNMENT + sizeof(NX_PACKET)) * PACKET_NUM; + if (status) + error_counter++; + + /* Create second packet pool. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", TEST_SIZE, pointer, ((TEST_SIZE + sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)) * PACKET_NUM); + + pointer = pointer + (TEST_SIZE + NX_PACKET_ALIGNMENT + sizeof(NX_PACKET)) * PACKET_NUM; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (VOID *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (VOID *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Enable ICMP processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMP enable status. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if (status) + error_counter++; + +#ifndef NX_DISABLE_FRAGMENTATION + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +#endif /* NX_DISABLE_FRAGMENTATION */ + + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &address_1, 64, NX_NULL); + + /* Check for IPv6 enable errors. */ + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + + +static VOID verify_packet(NX_PACKET_POOL *pool_ptr, CHAR *in_files) +{ +UINT i; +CHAR *file_info, *p; +ULONG packet_status; +UINT packet_found = NX_FALSE; +NX_PACKET *packet_ptr; +CHAR *thread_info; +ULONG line_info; + + for (i = 0; i < pool_ptr -> nx_packet_pool_total; i++) + { + /* Get debug information. */ + _nx_packet_debug_info_get(pool_ptr, i, &packet_ptr, &packet_status, &thread_info, &file_info, &line_info); + + /* Check if no packets are expected to be allocated. */ + if (in_files == NX_NULL) + { + if (packet_status == NX_PACKET_ALLOCATED) + { + error_counter++; + break; + } + } + else + { + + /* Check if is the packet looking for? */ + /* Trim path. */ + for(p = file_info + strlen(file_info); p != file_info && *p != '\\' && *p != '/'; p--); + + if(*p == '\\' || *p == '/') + p++; + + /* Is expected packet found? */ + if(strcmp(in_files, p) == 0) + packet_found = NX_TRUE; + } + } + + /* Check whether packet is found in specified file. */ + if((in_files != NX_NULL) && (packet_found == NX_FALSE)) + error_counter++; +} + + +/* Define the test threads. */ +static VOID ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + printf("NetX Test: Packet Debug Info Test...................................."); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + verify_packet(&pool_1, NX_NULL); + +#ifdef FEATURE_NX_IPV6 + /* Sleep 3 seconds to finish DAD. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + + /* Verify ARP/ND and ICMP packet debug information. */ + /* Ping between two IPs. */ + verify_pool = &pool_0; + verify_file = NX_PACKET_ARP_WAITING_QUEUE; + advanced_packet_process_callback = my_packet_process; + operation = NX_RAMDRIVER_OP_BYPASS; + delay = 0; + count = 0; + status = nx_icmp_ping(&ip_0, IP_ADDRESS(1,2,3,5), "", 0, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + + /* Verify packet is processed by nx_icmp_interface_ping.c before passing to application. */ + verify_packet(&pool_0, "nx_icmp_interface_ping.c"); + verify_packet(&pool_1, NX_NULL); + nx_packet_release(packet_ptr); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + } + +#ifdef FEATURE_NX_IPV6 + verify_pool = &pool_0; + verify_file = NX_PACKET_ND_WAITING_QUEUE; + status = nxd_icmp_ping(&ip_0, &address_1, "zzzNzFzHbJKLMNOPQRSTUVWXYZ", 28, &packet_ptr, NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + + /* Verify packet is processed by nx_icmp_interface_ping6.c before passing to application. */ + verify_packet(&pool_0, "nx_icmp_interface_ping6.c"); + verify_packet(&pool_1, NX_NULL); + nx_packet_release(packet_ptr); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + } +#endif /* FEATURE_NX_IPV6 */ + + + /* Verify TCP packet debug information. */ + /* Create two TCP socket socket. */ + nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + nx_tcp_socket_create(&ip_0, &temp_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Bind the socket. */ + nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + nx_tcp_client_socket_bind(&temp_socket, 13, NX_WAIT_FOREVER); + + /* Attempt to connect server at the same time. */ + nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + nx_tcp_client_socket_connect(&temp_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Verify a SYN packet is in peer's listen queue. */ + verify_packet(&pool_0, NX_NULL); + verify_packet(&pool_1, NX_PACKET_TCP_LISTEN_QUEUE); + + /* Let remote accpet the connection. */ + tx_thread_resume(&ntest_1); + + /* Disconnect the connection and let the SYN packet be processed. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + nx_tcp_socket_disconnect(&temp_socket, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&temp_socket); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + verify_packet(&pool_1, NX_NULL); + + /* Connect server. */ + nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_WAIT_FOREVER); + + /* Allocate a packet and send to peer. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + verify_packet(&pool_0, "nx_packet_allocate.c"); + nx_packet_data_append(packet_ptr, "ABCD", 4, &pool_0, NX_WAIT_FOREVER); + verify_packet(&pool_0, "nx_packet_data_append.c"); + + /* The packet is in send queue before ACKed. */ + nx_tcp_socket_send(&client_socket, packet_ptr, NX_WAIT_FOREVER); + + /* Verify a packet is in TCP send/receive queue. */ + verify_packet(&pool_0, "nx_tcp_socket_send_internal.c"); + verify_packet(&pool_1, NX_PACKET_TCP_RECEIVE_QUEUE); + + /* Let remote receive the pakcet. */ + tx_thread_resume(&ntest_1); + + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + + /* Verify UDP packet debug information. */ + nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to the IP port. */ + nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + nx_udp_socket_bind(&socket_1, 0x88, TX_WAIT_FOREVER); + + /* Allocate a packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_WAIT_FOREVER); + nx_packet_data_append(packet_ptr, "ABCD", 4, &pool_0, NX_WAIT_FOREVER); + + /* Send the UDP packet. */ + if(nx_udp_socket_send(&socket_0, packet_ptr, IP_ADDRESS(1, 2, 3, 5), 0x88)) + { + error_counter++; + nx_packet_release(packet_ptr); + } + else + { + + /* Verify a packet is in UDP receive queue. */ + verify_packet(&pool_1, NX_PACKET_UDP_RECEIVE_QUEUE); + + /* Receive a UDP packet. */ + nx_udp_socket_receive(&socket_1, &packet_ptr, NX_WAIT_FOREVER); + nx_packet_release(packet_ptr); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + verify_packet(&pool_1, NX_NULL); + } + + +#ifndef NX_DISABLE_FRAGMENTATION + /* Verify fragmentation packet debug information. */ + /* Allocate a packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_UDP_PACKET, TX_WAIT_FOREVER); + nx_packet_data_append(packet_ptr, buffer, sizeof(buffer), &pool_0, NX_WAIT_FOREVER); + + /* Let driver delay the second fragmentation for one second. */ + operation = NX_RAMDRIVER_OP_DELAY; + delay = 100; + count = 1; + + /* Send the UDP packet. */ + if(nx_udp_socket_send(&socket_0, packet_ptr, IP_ADDRESS(1, 2, 3, 5), 0x88)) + { + error_counter++; + nx_packet_release(packet_ptr); + } + else + { + + /* Verify a packet is in UDP receive queue. */ + verify_packet(&pool_1, NX_PACKET_IP_FRAGMENT_QUEUE); + + /* Receive a UDP packet. */ + nx_udp_socket_receive(&socket_1, &packet_ptr, NX_WAIT_FOREVER); + nx_packet_release(packet_ptr); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + verify_packet(&pool_1, NX_NULL); + } +#endif /* NX_DISABLE_FRAGMENTATION */ + + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_suspend(&ntest_1); + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Disconnect the connection and let the SYN packet be processed. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&server_socket); + + /* Verify the SYN packet is still in listen queue. */ + verify_packet(&pool_1, NX_PACKET_TCP_LISTEN_QUEUE); + nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Disconnect the connection and let the SYN packet be processed. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&server_socket); + nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + tx_thread_suspend(&ntest_1); + + if(nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER)) + { + error_counter++; + } + else + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + nx_packet_release(packet_ptr); + + /* Verify no packet used. */ + verify_packet(&pool_0, NX_NULL); + verify_packet(&pool_1, NX_NULL); + } + + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + if(verify_pool) + { + + /* Verify packet used. */ + verify_packet(verify_pool, verify_file); + verify_pool = NX_NULL; + } + + /* Is there an operation needed? */ + if(operation != NX_RAMDRIVER_OP_BYPASS) + { + count--; + if(count == 0) + { + *operation_ptr = operation; + *delay_ptr = delay; + operation = NX_RAMDRIVER_OP_BYPASS; + } + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +VOID netx_packet_debug_info_test_application_define(VOID *first_unused_memory) +#endif +{ + + printf("NetX Test: Packet Debug Info Test....................................N/A\n"); + + test_control_return(3); +} +#endif /* NX_ENABLE_PACKET_DEBUG_INFO */ diff --git a/test/regression/netxduo_test/netx_packet_nxe_api_test.c b/test/regression/netxduo_test/netx_packet_nxe_api_test.c new file mode 100644 index 00000000..a477e9af --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_nxe_api_test.c @@ -0,0 +1,911 @@ +/* This NetX test concentrates on the basic packet operations. */ + +#include "nx_packet.h" +#include "tx_api.h" +#include "nx_api.h" +#include "tx_thread.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && !defined(NX_PACKET_HEADER_PAD) + +#define DEMO_STACK_SIZE 2048 + +#ifndef NX_PACKET_ALIGNMENT +#define NX_PACKET_ALIGNMENT 4 +#endif /* NX_PACKET_ALIGNMENT */ + +#define TEST_SIZE (((NX_UDP_PACKET+28)+NX_PACKET_ALIGNMENT - 1)/NX_PACKET_ALIGNMENT*NX_PACKET_ALIGNMENT) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_PACKET_POOL invalid_pool; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static CHAR *pointer; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ +UINT status; +ULONG header_size = (sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1)/NX_PACKET_ALIGNMENT*NX_PACKET_ALIGNMENT; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool with valid parameters in NULL thread. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer,(TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + /* Create packet pool with corruptted memory. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", TEST_SIZE, pointer - 1,(TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + error_counter++; + } + + /* Create packet pool with corruptted memory. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", TEST_SIZE, pointer + 1,(TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + error_counter++; + } + + /* Create the same packet pool with valid parameters in NULL thread. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer,(TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + error_counter++; + } + + /* Update the pointer. */ + pointer = pointer + (TEST_SIZE + header_size) * 3; + + if (NX_PACKET_ALIGNMENT != sizeof(ULONG)) + { + + /* Print out test information banner. */ + printf("NetX Test: Packet NXE API Test.......................................N/A\n"); + + test_control_return(3); + } +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG total_packets, free_packets, empty_pool_requests, empty_pool_suspensions, invalid_packet_releases; +ULONG packet_length; +ULONG buffer[200]; +ULONG bytes_copied; +NX_PACKET *my_packet_1; +NX_PACKET *my_packet_2; +NX_PACKET invalid_packet; +NX_PACKET *invalid_packet_2; +ULONG header_size = (sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1)/NX_PACKET_ALIGNMENT*NX_PACKET_ALIGNMENT; + + /* Print out test information banner. */ + printf("NetX Test: Packet NXE API Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_pool_create api */ + /************************************************/ + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Create packet pool with invalid pool size. */ + status = _nxe_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer, (TEST_SIZE + header_size) * 3, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Create packet pool with null pool. */ + status = nx_packet_pool_create(NX_NULL, "NetX Main Packet Pool", TEST_SIZE, pointer, (TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create packet pool with null pointer. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, NX_NULL, (TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create packet pool with invalid payload size. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 0, pointer, (TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create packet pool with invalid pool size. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer, 0); + + /* Check for error. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the same packet pool with valid parameters. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", TEST_SIZE, pointer,(TEST_SIZE + header_size) * 3); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_pool_delete api */ + /************************************************/ + + /* Delete packet pool with null pool. */ + status = nx_packet_pool_delete(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete packet pool with invalid pool. */ + status = nx_packet_pool_delete(&invalid_pool); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_pool_info_get api */ + /************************************************/ + + /* Get the packet pool info with null pool. */ + status = nx_packet_pool_info_get(NX_NULL, &total_packets, &free_packets, &empty_pool_requests, &empty_pool_suspensions, &invalid_packet_releases); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the packet pool info with invalid pool. */ + status = nx_packet_pool_info_get(&invalid_pool, &total_packets, &free_packets, &empty_pool_requests, &empty_pool_suspensions, &invalid_packet_releases); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_LOW_WATERMARK + /************************************************/ + /* Tested the nxe_packet_pool_low_watermark api */ + /************************************************/ + + /* Delete packet pool with null pool. */ + status = nx_packet_pool_low_watermark_set(NX_NULL, 5); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete packet pool with invalid pool. */ + status = nx_packet_pool_low_watermark_set(&invalid_pool, 5); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_ENABLE_LOW_WATERMARK */ + + /************************************************/ + /* Tested the nxe_packet_allocate api */ + /************************************************/ + + /* Allocate packet with null pool. */ + status = nx_packet_allocate(NX_NULL, &my_packet_1, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate packet with invalid pool. */ + status = nx_packet_allocate(&invalid_pool, &my_packet_1, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate packet with null packet. */ + status = nx_packet_allocate(&pool_0, NX_NULL, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate packet with Four byte unaligned packet type. */ + status = nx_packet_allocate(&pool_0, &my_packet_1, 5, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate packet with big packet type. */ + status = nx_packet_allocate(&pool_0, &my_packet_1, TEST_SIZE + 4, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate packet with valid parameter. */ + status = nx_packet_allocate(&pool_0, &my_packet_1, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_data_append api */ + /************************************************/ + + /* Append the packet data with null packet. */ + status = nx_packet_data_append(NX_NULL, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet data with null data. */ + status = nx_packet_data_append(my_packet_1, NX_NULL, 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet data with null data size. */ + status = nx_packet_data_append(my_packet_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 0, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet data with null pool. */ + status = nx_packet_data_append(my_packet_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, NX_NULL, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet data with invalid pool. */ + status = nx_packet_data_append(my_packet_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &invalid_pool, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet with invalid packet that prepend pointer is less than data start. */ + invalid_packet.nx_packet_data_start = (UCHAR *)0x20; + invalid_packet.nx_packet_prepend_ptr = (UCHAR *)0x10; + invalid_packet.nx_packet_append_ptr = (UCHAR *)0x30; + invalid_packet.nx_packet_data_end = (UCHAR *)0x40; + status = nx_packet_data_append(&invalid_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_UNDERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append packet with invalid packet that prepend pointer is less than data start. */ + invalid_packet.nx_packet_data_start = (UCHAR *)0x10; + invalid_packet.nx_packet_prepend_ptr = (UCHAR *)0x20; + invalid_packet.nx_packet_append_ptr = (UCHAR *)0x40; + invalid_packet.nx_packet_data_end = (UCHAR *)0x20; + status = nx_packet_data_append(&invalid_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet data with valid parameters. */ + status = nx_packet_data_append(my_packet_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_copy api */ + /************************************************/ + + /* Copy packet with null original packet. */ + status = nx_packet_copy(NX_NULL, &my_packet_2, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy packet with null new packet. */ + status = nx_packet_copy(my_packet_1, NX_NULL, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy packet with null pool. */ + status = nx_packet_copy(my_packet_1, &my_packet_2, NX_NULL, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy packet with invalid pool. */ + status = nx_packet_copy(my_packet_1, &my_packet_2, &invalid_pool, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy packet with invalid original packet that prepend pointer is less than data start. */ + invalid_packet.nx_packet_data_start = (UCHAR *)0x20; + invalid_packet.nx_packet_prepend_ptr = (UCHAR *)0x10; + invalid_packet.nx_packet_append_ptr = (UCHAR *)0x30; + invalid_packet.nx_packet_data_end = (UCHAR *)0x40; + status = nx_packet_copy(&invalid_packet, &my_packet_2, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_UNDERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy packet with invalid original packet that prepend pointer is less than data start. */ + invalid_packet.nx_packet_data_start = (UCHAR *)0x10; + invalid_packet.nx_packet_prepend_ptr = (UCHAR *)0x20; + invalid_packet.nx_packet_append_ptr = (UCHAR *)0x40; + invalid_packet.nx_packet_data_end = (UCHAR *)0x20; + status = nx_packet_copy(&invalid_packet, &my_packet_2, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy packet with valid parameters. */ + status = nx_packet_copy(my_packet_1, &my_packet_2, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_length_get api */ + /************************************************/ + + /* Get packet length with null packet. */ + status = nx_packet_length_get(NX_NULL, &packet_length); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get packet length with null length pointer. */ + status = nx_packet_length_get(my_packet_1, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get packet length with invalid packet pool owner. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = NX_NULL; + status = nx_packet_length_get(invalid_packet_2, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get packet length with invalid packet pool ID. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = 0; + status = nx_packet_length_get(invalid_packet_2, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get packet length with valid parameters. */ + status = nx_packet_length_get(my_packet_1, &packet_length); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_data_extract_offset api*/ + /************************************************/ + + /* Extract the packet data with null packet. */ + status = nx_packet_data_extract_offset(NX_NULL, 0, buffer, 200, &bytes_copied); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet data with invalid buffer. */ + status = nx_packet_data_extract_offset(my_packet_1, 0, NX_NULL, 200, &bytes_copied); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet data with null bytes copied parameter. */ + status = nx_packet_data_extract_offset(my_packet_1, 0, buffer, 200, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet data with valid parameter. */ + status = nx_packet_data_extract_offset(my_packet_1, 0, buffer, 200, &bytes_copied); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_data_retrieve api */ + /************************************************/ + + /* Retrieve the packet data with null packet. */ + status = nx_packet_data_retrieve(NX_NULL, buffer, &bytes_copied); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet data with invalid buffer. */ + status = nx_packet_data_retrieve(my_packet_1, NX_NULL, &bytes_copied); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet data with valid parameter. */ + status = nx_packet_data_retrieve(my_packet_1, buffer, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Extract the packet data with valid parameter. */ + status = nx_packet_data_retrieve(my_packet_1, buffer, &bytes_copied); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_release api */ + /************************************************/ + + /* Release the packet with invalid packet. */ + invalid_packet_2 = NX_NULL; + status = nx_packet_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with invalid original packet that prepend pointer is less than data start. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + invalid_packet_2 -> nx_packet_data_start = (UCHAR *)0x20; + invalid_packet_2 -> nx_packet_prepend_ptr = (UCHAR *)0x10; + invalid_packet_2 -> nx_packet_append_ptr = (UCHAR *)0x30; + invalid_packet_2 -> nx_packet_data_end = (UCHAR *)0x40; + status = nx_packet_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_UNDERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with invalid original packet that prepend pointer is less than data start. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + invalid_packet_2 -> nx_packet_data_start = (UCHAR *)0x10; + invalid_packet_2 -> nx_packet_prepend_ptr = (UCHAR *)0x20; + invalid_packet_2 -> nx_packet_append_ptr = (UCHAR *)0x40; + invalid_packet_2 -> nx_packet_data_end = (UCHAR *)0x20; + status = nx_packet_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet data with valid packet. */ + status = nx_packet_release(my_packet_1); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_packet_transmit_release api */ + /************************************************/ + + /* Release the packet with invalid packet. */ + invalid_packet_2 = NX_NULL; + status = nx_packet_transmit_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with no packet pool owner. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = NX_NULL; + status = nx_packet_transmit_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with invalid packet owner. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = 0; + status = nx_packet_transmit_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with invalid packet nx_packet_tcp_queue_next. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_append_ptr = invalid_packet_2 -> nx_packet_data_end; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &pool_0; +#ifdef __PRODUCT_NETXDUO__ + invalid_packet_2 -> nx_packet_union_next.nx_packet_tcp_queue_next = ((NX_PACKET *)NX_PACKET_FREE); +#else + invalid_packet_2 -> nx_packet_tcp_queue_next = ((NX_PACKET *)NX_PACKET_FREE); +#endif + status = nx_packet_transmit_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with invalid original packet that prepend pointer is less than data start. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + invalid_packet_2 -> nx_packet_data_start = (UCHAR *)0x20; + invalid_packet_2 -> nx_packet_prepend_ptr = (UCHAR *)0x10; + invalid_packet_2 -> nx_packet_append_ptr = (UCHAR *)0x30; + invalid_packet_2 -> nx_packet_data_end = (UCHAR *)0x40; + status = nx_packet_transmit_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_UNDERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet with invalid original packet that prepend pointer is less than data start. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + invalid_packet_2 -> nx_packet_data_start = (UCHAR *)0x10; + invalid_packet_2 -> nx_packet_prepend_ptr = (UCHAR *)0x20; + invalid_packet_2 -> nx_packet_append_ptr = (UCHAR *)0x40; + invalid_packet_2 -> nx_packet_data_end = (UCHAR *)0x20; + status = nx_packet_transmit_release(invalid_packet_2); + + /* Check for error. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet data with valid packet. */ + status = nx_packet_transmit_release(my_packet_2); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete packet pool with valid pool. */ + status = nx_packet_pool_delete(&pool_0); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Packet NXE API Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_packet_payload_size_test.c b/test/regression/netxduo_test/netx_packet_payload_size_test.c new file mode 100644 index 00000000..7d6cfde7 --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_payload_size_test.c @@ -0,0 +1,384 @@ +/* This case tests payload that is only two bytes aligned. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +#ifdef __PRODUCT_NETXDUO__ +static NX_PACKET_POOL pool_2; +#endif /* __PRODUCT_NETXDUO__ */ +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static CHAR send_buff[250]; +static CHAR recv_buff[250]; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_payload_size_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +#ifdef __PRODUCT_NETXDUO__ +ULONG header_size; +#endif /* __PRODUCT_NETXDUO__ */ + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool with payload not four bytes aligned. */ + memset(pointer, 0, 8192); + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 202, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create a packet pool. */ + memset(pointer, 0, 8192); + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + pointer += 1; + pointer = (CHAR *)((((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) / NX_PACKET_ALIGNMENT) * NX_PACKET_ALIGNMENT); + + /* Calculate the rounded payload size. */ + header_size = ((sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1)/NX_PACKET_ALIGNMENT) * NX_PACKET_ALIGNMENT; +#ifndef NX_DISABLE_ERROR_CHECKING + /* Create a packet pool with starting address not four byte aligned. The pool size is not enough. */ + status = nx_packet_pool_create(&pool_2, "NetX Main Packet Pool", 512, (pointer - 1), 512 + header_size); + + if (status == NX_SUCCESS) + error_counter++; +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Create a packet pool with starting address not four byte aligned. The pool size is enough. */ + status = nx_packet_pool_create(&pool_2, "NetX Main Packet Pool", 512, (pointer - 1), 516 + header_size); + pointer = pointer + 516 + header_size; + + if (status != NX_SUCCESS) + error_counter++; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: Packet Payload Size Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset send buffer and recv buffer. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = 0x01; + recv_buff[i] = 0x00; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG byte_copied; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check for error. */ + if (status) + error_counter++; + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + + /* Retrieve data. */ + status = nx_packet_data_retrieve(packet_ptr, recv_buff, &byte_copied); + + /* Check for error. */ + if (status) + error_counter++; + + /* Compare with send buffer. */ + if (byte_copied != sizeof(send_buff)) + error_counter++; + else if (memcmp(send_buff, recv_buff, sizeof(send_buff))) + error_counter++; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_payload_size_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Packet Payload Size Test..................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_packet_suspension_test.c b/test/regression/netxduo_test/netx_packet_suspension_test.c new file mode 100644 index 00000000..596fb49f --- /dev/null +++ b/test/regression/netxduo_test/netx_packet_suspension_test.c @@ -0,0 +1,241 @@ +/* This NetX test concentrates on the packet suspension operations. */ + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +#ifndef NX_PACKET_ALIGNMENT +#define NX_PACKET_ALIGNMENT sizeof(ULONG) +#endif /* NX_PACKET_ALIGNMENT */ + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ntest_1_counter; +static ULONG ntest_2_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_packet_suspension_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ntest_1_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create another thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create another thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Align the starting address. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) / NX_PACKET_ALIGNMENT * NX_PACKET_ALIGNMENT); + + /* Create first packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_UDP_PACKET, pointer, + ((NX_UDP_PACKET + sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)) * 3); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +ULONG total_packets, free_packets, empty_pool_requests, empty_pool_suspensions, invalid_packet_releases; + + + /* Print out test information banner. */ + printf("NetX Test: Packet Suspension Processing Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate the three packets to ensure the other thread will suspend. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_UDP_PACKET, NX_IP_PERIODIC_RATE/10); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_UDP_PACKET, NX_IP_PERIODIC_RATE/10); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_UDP_PACKET, NX_IP_PERIODIC_RATE/10); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Suspend for 1 second ticks to let the other thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Ensure the other thread is where it is supposed to be. */ + if (ntest_1_counter != 1) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release a packet, which should cause the other thread to resume. */ + status = nx_packet_release(my_packet1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release a packet, which should cause the other thread to resume. */ + status = nx_packet_release(my_packet3); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Relinquish to the other thread so it can complete. */ + tx_thread_relinquish(); + + /* Get information about the pool. */ + status += nx_packet_pool_info_get(&pool_0, &total_packets, &free_packets, &empty_pool_requests, &empty_pool_suspensions, &invalid_packet_releases); + +#ifndef NX_DISABLE_PACKET_INFO + + if((empty_pool_requests != 4) || (empty_pool_suspensions != 4)) + status++; +#endif + + /* Check status. */ + if ((status) || (total_packets != 3) || (free_packets != 0) || (invalid_packet_releases) || (ntest_1_counter != 2) || (ntest_2_counter != 2) || (error_counter)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; + + + /* Set the counter to zero! */ + ntest_1_counter = 0; + + /* Attempt to allocate a packet with a timeout. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_UDP_PACKET, NX_IP_PERIODIC_RATE/10); + + /* Determine if we received a timeout error. */ + if (status != NX_NO_PACKET) + error_counter++; + + /* Increment counter. */ + ntest_1_counter++; + + /* Allocate packet again. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Determine if we received a timeout error. */ + if (status) + error_counter++; + + /* Increment counter. */ + ntest_1_counter++; +} + +static void ntest_2_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; + + + /* Set the counter to zero! */ + ntest_2_counter = 0; + + /* Attempt to allocate a packet with a timeout. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_UDP_PACKET, NX_IP_PERIODIC_RATE/10); + + /* Determine if we received a timeout error. */ + if (status != NX_NO_PACKET) + error_counter++; + + /* Increment counter. */ + ntest_2_counter++; + + /* Allocate packet again. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Determine if we received a timeout error. */ + if (status) + error_counter++; + + /* Increment counter. */ + ntest_2_counter++; +} diff --git a/test/regression/netxduo_test/netx_ramdriver_callback_test.c b/test/regression/netxduo_test/netx_ramdriver_callback_test.c new file mode 100644 index 00000000..97931bee --- /dev/null +++ b/test/regression/netxduo_test/netx_ramdriver_callback_test.c @@ -0,0 +1,358 @@ +/* This case tests advanced packet process callback feature for ramdriver. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET client_socket; +static NX_UDP_SOCKET server_socket; +static NX_PACKET *send_packet, *recv_packet; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT driver_op; +static UINT driver_delay; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT advanced_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_netx_ramdriver_callback_application_define(void *first_unused_memory) +#endif +{ + +UCHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +CHAR msg[20]; + + + printf("NetX Test: RAMDriver callback test..................................."); + + /* Create client socket. */ + status = nx_udp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the socket. */ + status += nx_udp_socket_bind(&client_socket, 0x88, TX_WAIT_FOREVER); + + /* Create server socket. */ + status += nx_udp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the socket. */ + status += nx_udp_socket_bind(&server_socket, 0x88, TX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup advanced callback function. */ + advanced_packet_process_callback = advanced_packet_process; + + + /* Test delay feature. */ + driver_op = NX_RAMDRIVER_OP_DELAY; + driver_delay = 4 * NX_IP_PERIODIC_RATE; + + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &send_packet, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Set message for delayed packet. */ + memcpy(msg, "1234567890", 10); + + /* Fill in the packet with data. */ + status += nx_packet_data_append(send_packet, msg, 10, &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_udp_socket_send(&client_socket, send_packet, IP_ADDRESS(1, 2, 3, 5), 0x88); + + /* Check status. */ + if(status) + { + error_counter++; + nx_packet_release(send_packet); + } + + /* Try to receive on server socket. */ + status = nx_udp_socket_receive(&server_socket, &recv_packet, driver_delay / 2); + + /* No packet should be received. */ + if(status != NX_NO_PACKET) + { + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(recv_packet); + } + + /* Try to receive on server socket. */ + status = nx_udp_socket_receive(&server_socket, &recv_packet, (driver_delay / 2 + 1 * NX_IP_PERIODIC_RATE)); + + /* The packet should be received. */ + if(status) + error_counter++; + else + { + + /* Check packet data. */ + if(memcmp(msg, recv_packet -> nx_packet_prepend_ptr, 10)) + error_counter++; + + /* Release the packet */ + status = nx_packet_release(recv_packet); + + /* Check for error. */ + if(status) + error_counter++; + } + + + /* Test drop feature. */ + driver_op = NX_RAMDRIVER_OP_DROP; + + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &send_packet, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Set message for dropped packet. */ + memcpy(msg, "abcdefghij", 10); + + /* Fill in the packet with data. */ + status += nx_packet_data_append(send_packet, msg, 10, &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_udp_socket_send(&client_socket, send_packet, IP_ADDRESS(1, 2, 3, 5), 0x88); + + /* Check status. */ + if(status) + { + error_counter++; + nx_packet_release(send_packet); + } + + /* Try to receive on server socket. */ + status = nx_udp_socket_receive(&server_socket, &recv_packet, 5 * NX_IP_PERIODIC_RATE); + + /* No packet should be received. */ + if(status != NX_NO_PACKET) + { + error_counter++; + if(status == NX_SUCCESS) + nx_packet_release(recv_packet); + } + + + /* Test duplicate feature. */ + driver_op = NX_RAMDRIVER_OP_DUPLICATE; + + /* Create a packet. */ + status = nx_packet_allocate(&pool_0, &send_packet, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + + /* Set message for duplicated packet. */ + memcpy(msg, "ABCDEFGHIJ", 10); + + /* Fill in the packet with data. */ + status += nx_packet_data_append(send_packet, msg, 10, &pool_0, NX_NO_WAIT); + + /* Check for error. */ + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_udp_socket_send(&client_socket, send_packet, IP_ADDRESS(1, 2, 3, 5), 0x88); + + /* Check status. */ + if(status) + { + error_counter++; + nx_packet_release(send_packet); + } + + /* Try to receive on server socket. */ + status = nx_udp_socket_receive(&server_socket, &recv_packet, 5 * NX_IP_PERIODIC_RATE); + + /* The original packet received. */ + if(status) + error_counter++; + else + { + + /* Check packet data. */ + if(memcmp(msg, recv_packet -> nx_packet_prepend_ptr, 10)) + error_counter++; + + /* Release the packet */ + status = nx_packet_release(recv_packet); + + /* Check for error. */ + if(status) + error_counter++; + } + + /* Try to receive on server socket. */ + status = nx_udp_socket_receive(&server_socket, &recv_packet, 5 * NX_IP_PERIODIC_RATE); + + /* The duplicated packet received. */ + if(status) + error_counter++; + else + { + + /* Check packet data. */ + if(memcmp(msg, recv_packet -> nx_packet_prepend_ptr, 10)) + error_counter++; + + /* Release the packet */ + status = nx_packet_release(recv_packet); + + /* Check for error. */ + if(status) + error_counter++; + } + + /* Cleanup */ + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&client_socket); + status += nx_udp_socket_unbind(&server_socket); + + /* Delete the UDP socket. */ + status += nx_udp_socket_delete(&client_socket); + status += nx_udp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Clean advanced callback function. */ + advanced_packet_process_callback = NX_NULL; + + /* Determine if the test was successful. */ + if((error_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT advanced_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if(packet_ptr == send_packet) + { + *operation_ptr = driver_op; + *delay_ptr = driver_delay; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_netx_ramdriver_callback_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RAMDriver callback test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_rarp_basic_processing_test.c b/test/regression/netxduo_test/netx_rarp_basic_processing_test.c new file mode 100644 index 00000000..4f928bc3 --- /dev/null +++ b/test/regression/netxduo_test/netx_rarp_basic_processing_test.c @@ -0,0 +1,453 @@ +/* This NetX test concentrates on the RARP dynamic entry operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_rarp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_RARP_INFO) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT response_type; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_rarp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID ip_address_change_notify(NX_IP *ip_ptr, VOID *additional_info); +static VOID fake_rarp_response_packet(NX_PACKET **my_packet, UINT type); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +void _nx_ram_network_driver_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id); + +#define NX_ETHERNET_RARP 0x8035 +#define NX_ETHERNET_SIZE 14 + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", 0, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Attach the 2nd interface IP address so it dosn't need RARP service. */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", IP_ADDRESS(4, 3, 2, 111), 0xFF000000, _nx_ram_network_driver_256); + if(status != NX_SUCCESS) + { + error_counter++; + } + +#if (NX_MAX_PHYSICAL_INTERFACES > 2) && defined(__PRODUCT_NETXDUO__) + /* Attach the 3rd interface IP address so it dosn't need RARP service. */ + status = nx_ip_interface_attach(&ip_0, "3rd interface", 0, 0xFFFFFF00, _nx_ram_network_driver_256); + if(status != NX_SUCCESS) + { + error_counter++; + } +#endif +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +ULONG ip_address, network_mask; +ULONG rarp_requests_sent, rarp_responses_received, rarp_invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: RARP Basic Processing Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#if (NX_MAX_PHYSICAL_INTERFACES > 2) && defined(__PRODUCT_NETXDUO__) + /* Disable address mapping. */ + nx_ip_interface_address_mapping_configure(&ip_0, 2, NX_FALSE); +#endif + + /* Enable RARP for IP Instance 0. */ + status = nx_rarp_enable(&ip_0); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the rarp feature again. */ + status = nx_rarp_enable(&ip_0); + + /* Check status... */ + if (status != NX_ALREADY_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Register IP address change callback. */ + status = nx_ip_address_change_notify(&ip_0, ip_address_change_notify, NX_NULL); + + /* Check for error */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = my_rarp_packet_process; + + /* Set the response type as 0 . */ + response_type = 0; + + /* Waiting NetX sending the RARP request to get the address. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable RARP for IP Instance 0. */ + status = nx_rarp_enable(&ip_0); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the response type as 0 . */ + response_type = 1; + + /* Waiting NetX sending the RARP request to get the address. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the IP instance address. */ + status = nx_ip_interface_address_get(&ip_0, 0, &ip_address, &network_mask); + + /* Check status... */ + if((status != NX_SUCCESS) || (ip_address != IP_ADDRESS(1,2,3,4)) || (network_mask != 0xFFFFFF00UL)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about RARP. */ + status = nx_rarp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_rarp_info_get(&ip_0, &rarp_requests_sent, &rarp_responses_received, &rarp_invalid_messages); + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ARP_INFO + if((rarp_requests_sent != 2) || (rarp_responses_received != 1) || (rarp_invalid_messages != 3)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef __PRODUCT_NETXDUO__ + /* Tested the nx_rarp_enable feature after IP address resloved. */ + + /* Enable the rarp feature again. */ + status = nx_rarp_enable(&ip_0); + + /* Check status... */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the rarp feature. */ + status = nx_rarp_disable(&ip_0); + + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_rarp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +UINT status; +NX_PACKET *fake_packet_1; +NX_PACKET *fake_packet_2; +NX_PACKET *fake_packet_3; + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* Check the response type. */ + if (response_type == 0) + { + + /* Disable the rarp feature. */ + status = nx_rarp_disable(&ip_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Fake the response packet. */ + fake_rarp_response_packet(&fake_packet_1, NX_RARP_OPTION_RESPONSE); + + /* Call the driver to receive this packet. */ + _nx_ram_network_driver_receive(&ip_0, fake_packet_1, 0); + } + else if (response_type == 1) + { + + /* Fake a request packet. */ + fake_rarp_response_packet(&fake_packet_1, NX_RARP_OPTION_REQUEST); + + /* Call the driver to receive this packet. */ + _nx_ram_network_driver_receive(&ip_0, fake_packet_1, 0); + + /* Fake a invalid packet. */ + fake_rarp_response_packet(&fake_packet_2, 0); + + /* Call the driver to receive this packet. */ + _nx_ram_network_driver_receive(&ip_0, fake_packet_2, 0); + + /* Fake the response packet. */ + fake_rarp_response_packet(&fake_packet_3, NX_RARP_OPTION_RESPONSE); + + /* Call the driver to receive this packet. */ + _nx_ram_network_driver_receive(&ip_0, fake_packet_3, 0); + } + + return NX_TRUE; +} +static VOID fake_rarp_response_packet(NX_PACKET **packet_ptr, UINT type) +{ +UINT status; +NX_PACKET *my_packet; +ULONG *ethernet_frame_ptr; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create a fake RARP response packet to assign address(1.2.3.4)! */ + my_packet -> nx_packet_prepend_ptr[0] = 0x00; /* Ethernet header */ + my_packet -> nx_packet_prepend_ptr[1] = 0x01; + my_packet -> nx_packet_prepend_ptr[2] = 0x80; /* IP address */ + my_packet -> nx_packet_prepend_ptr[3] = 0x00; + my_packet -> nx_packet_prepend_ptr[4] = 0x06; /* Hardware address size */ + my_packet -> nx_packet_prepend_ptr[5] = 0x04; /* IP address size */ + + /* Check the type. */ + if (type == NX_RARP_OPTION_REQUEST) + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* RARP request */ + my_packet -> nx_packet_prepend_ptr[7] = 0x03; + } + else if (type == NX_RARP_OPTION_RESPONSE) + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* RARP response */ + my_packet -> nx_packet_prepend_ptr[7] = 0x04; + } + else + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* Invalid RARP type */ + my_packet -> nx_packet_prepend_ptr[7] = 0x00; + } + my_packet -> nx_packet_prepend_ptr[8] = 0x11; /* Sender Ethernet hardware address */ + my_packet -> nx_packet_prepend_ptr[9] = 0x22; + my_packet -> nx_packet_prepend_ptr[10] = 0x33; + my_packet -> nx_packet_prepend_ptr[11] = 0x44; + my_packet -> nx_packet_prepend_ptr[12] = 0x55; + my_packet -> nx_packet_prepend_ptr[13] = 0x67; + my_packet -> nx_packet_prepend_ptr[14] = 0x01; /* Sender IP address */ + my_packet -> nx_packet_prepend_ptr[15] = 0x02; + my_packet -> nx_packet_prepend_ptr[16] = 0x03; + my_packet -> nx_packet_prepend_ptr[17] = 0x87; + my_packet -> nx_packet_prepend_ptr[18] = 0x11; /* Target hardware address */ + my_packet -> nx_packet_prepend_ptr[19] = 0x22; + my_packet -> nx_packet_prepend_ptr[20] = 0x33; + my_packet -> nx_packet_prepend_ptr[21] = 0x44; + my_packet -> nx_packet_prepend_ptr[22] = 0x55; + my_packet -> nx_packet_prepend_ptr[23] = 0x66; + my_packet -> nx_packet_prepend_ptr[24] = 0x01; /* Target IP address */ + my_packet -> nx_packet_prepend_ptr[25] = 0x02; + my_packet -> nx_packet_prepend_ptr[26] = 0x03; + my_packet -> nx_packet_prepend_ptr[27] = 0x04; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Fake a receive RARP packet. */ + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[TEST_INTERFACE]; + + /* Adjust the prepend pointer. */ + my_packet -> nx_packet_prepend_ptr = my_packet -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + my_packet -> nx_packet_length = my_packet -> nx_packet_length + NX_ETHERNET_SIZE; + + /* Setup the ethernet frame pointer to build the ethernet frame. Backup another 2 + bytes to get 32-bit word alignment. */ + ethernet_frame_ptr = (ULONG *) (my_packet -> nx_packet_prepend_ptr - 2); + + /* Build the ethernet frame. */ + *ethernet_frame_ptr = 0x00000011; + *(ethernet_frame_ptr+1) = 0x22334456; + *(ethernet_frame_ptr+2) = (0x00000011 << 16) | (0x22334457 >> 16); + *(ethernet_frame_ptr+3) = ((0x22334457 & 0xFFFF) << 16); + *(ethernet_frame_ptr+3) |= NX_ETHERNET_RARP; + + /* Endian swapping if NX_LITTLE_ENDIAN is defined. */ + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3)); + + /* Set the packet pointer. */ + *packet_ptr = my_packet; +} +static VOID ip_address_change_notify(NX_IP *ip_ptr, VOID *additional_info) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: RARP Basic Processing Test................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_rarp_branch_test.c b/test/regression/netxduo_test/netx_rarp_branch_test.c new file mode 100644 index 00000000..9e03c02f --- /dev/null +++ b/test/regression/netxduo_test/netx_rarp_branch_test.c @@ -0,0 +1,383 @@ +/* This NetX test concentrates on the code coverage for RARP functions, + *_nx_rarp_packet_receive +*/ + +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_rarp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static CHAR *pointer; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT rarp_packet_allocate(NX_IP *ip_ptr, NX_PACKET **packet_ptr, UINT arp_type, + UCHAR *source_ip, UCHAR *source_physical, + UCHAR *target_ip, UCHAR *target_physical); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_branch_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UCHAR source_mac[6]; +UCHAR source_ip[4]; +UCHAR destination_mac[6]; +UCHAR destination_ip[6]; + + /* Print out some test information banners. */ + printf("NetX Test: RARP Branch Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Test _nx_rarp_packet_receive. */ + /* Hit condition of if (*(message_ptr + 6)) */ + source_mac[0] = 0x11; + source_mac[1] = 0x22; + source_mac[2] = 0x33; + source_mac[3] = 0x44; + source_mac[4] = 0x55; + source_mac[5] = 0x67; + source_ip[0] = 0x01; + source_ip[1] = 0x02; + source_ip[2] = 0x03; + source_ip[3] = 0x87; + + destination_mac[0] = 0x11; + destination_mac[1] = 0x22; + destination_mac[2] = 0x33; + destination_mac[3] = 0x44; + destination_mac[4] = 0x55; + destination_mac[5] = 0x66; + destination_ip[0] = 0x01; + destination_ip[1] = 0x02; + destination_ip[2] = 0x03; + destination_ip[3] = 0x04; + + /* Allocate ARP packet, */ + status = rarp_packet_allocate(&ip_0, &my_packet, NX_RARP_OPTION_RESPONSE, source_ip, source_mac, destination_ip, destination_mac); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + + /* Call function. */ + _nx_rarp_packet_receive(&ip_0, my_packet); + + /* Set the MAC and IP address. */ + source_mac[0] = 0x11; + source_mac[1] = 0x22; + source_mac[2] = 0x33; + source_mac[3] = 0x44; + source_mac[4] = 0x55; + source_mac[5] = 0x67; + source_ip[0] = 0x01; + source_ip[1] = 0x02; + source_ip[2] = 0x03; + source_ip[3] = 0x87; + + destination_mac[0] = 0x11; + destination_mac[1] = 0x22; + destination_mac[2] = 0x33; + destination_mac[3] = 0x44; + destination_mac[4] = 0x55; + destination_mac[5] = 0x66; + destination_ip[0] = 0x00; + destination_ip[1] = 0x00; + destination_ip[2] = 0x00; + destination_ip[3] = 0x00; + + /* Allocate ARP packet, */ + status = rarp_packet_allocate(&ip_0, &my_packet, NX_RARP_OPTION_RESPONSE, source_ip, source_mac, destination_ip, destination_mac); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + + /* Call function. */ + _nx_rarp_packet_receive(&ip_0, my_packet); + + + /* Hit condition of if (previous_ip_address != *(message_ptr + 6)) */ + source_mac[0] = 0x11; + source_mac[1] = 0x22; + source_mac[2] = 0x33; + source_mac[3] = 0x44; + source_mac[4] = 0x55; + source_mac[5] = 0x67; + source_ip[0] = 0x01; + source_ip[1] = 0x02; + source_ip[2] = 0x03; + source_ip[3] = 0x87; + + destination_mac[0] = 0x11; + destination_mac[1] = 0x22; + destination_mac[2] = 0x33; + destination_mac[3] = 0x44; + destination_mac[4] = 0x55; + destination_mac[5] = 0x66; + destination_ip[0] = 0x01; + destination_ip[1] = 0x02; + destination_ip[2] = 0x03; + destination_ip[3] = 0x04; + + /* Allocate ARP packet, */ + status = rarp_packet_allocate(&ip_0, &my_packet, NX_RARP_OPTION_RESPONSE, source_ip, source_mac, destination_ip, destination_mac); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + + /* Call function. */ + _nx_rarp_packet_receive(&ip_0, my_packet); + + /* Set the MAC and IP address. */ + source_mac[0] = 0x11; + source_mac[1] = 0x22; + source_mac[2] = 0x33; + source_mac[3] = 0x44; + source_mac[4] = 0x55; + source_mac[5] = 0x67; + source_ip[0] = 0x01; + source_ip[1] = 0x02; + source_ip[2] = 0x03; + source_ip[3] = 0x87; + + destination_mac[0] = 0x11; + destination_mac[1] = 0x22; + destination_mac[2] = 0x33; + destination_mac[3] = 0x44; + destination_mac[4] = 0x55; + destination_mac[5] = 0x66; + destination_ip[0] = 0x01; + destination_ip[1] = 0x02; + destination_ip[2] = 0x03; + destination_ip[3] = 0x05; + + /* Allocate ARP packet, */ + status = rarp_packet_allocate(&ip_0, &my_packet, NX_RARP_OPTION_RESPONSE, source_ip, source_mac, destination_ip, destination_mac); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + + /* Call function. */ + _nx_rarp_packet_receive(&ip_0, my_packet); + + /* Allocate ARP packet, */ + status = rarp_packet_allocate(&ip_0, &my_packet, NX_RARP_OPTION_RESPONSE, source_ip, source_mac, destination_ip, destination_mac); + + /* Check status. */ + if (status != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[0]; + my_packet -> nx_packet_length -= 1; + + /* Call function. */ + _nx_rarp_packet_receive(&ip_0, my_packet); + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +UINT rarp_packet_allocate(NX_IP *ip_ptr, NX_PACKET **packet_ptr, UINT arp_type, + UCHAR *source_ip, UCHAR *source_physical, + UCHAR *target_ip, UCHAR *target_physical) +{ + +NX_PACKET *my_packet; + + + /* Allocate a packet to build the ARP message in. */ + if (nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, NX_PHYSICAL_HEADER, NX_NO_WAIT)) + { + + /* Error getting packet, so just get out! */ + return (NX_FALSE); + } + + /* Create a fake RARP response packet to assign address(1.2.3.4)! */ + my_packet -> nx_packet_prepend_ptr[0] = 0x00; /* Ethernet header */ + my_packet -> nx_packet_prepend_ptr[1] = 0x01; + my_packet -> nx_packet_prepend_ptr[2] = 0x80; /* IP address */ + my_packet -> nx_packet_prepend_ptr[3] = 0x00; + my_packet -> nx_packet_prepend_ptr[4] = 0x06; /* Hardware address size */ + my_packet -> nx_packet_prepend_ptr[5] = 0x04; /* IP address size */ + + /* Check the type. */ + if (arp_type == NX_RARP_OPTION_REQUEST) + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* RARP request */ + my_packet -> nx_packet_prepend_ptr[7] = 0x03; + } + else if (arp_type == NX_RARP_OPTION_RESPONSE) + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* RARP response */ + my_packet -> nx_packet_prepend_ptr[7] = 0x04; + } + else + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* Invalid RARP type */ + my_packet -> nx_packet_prepend_ptr[7] = 0x00; + } + + my_packet -> nx_packet_prepend_ptr[8] = source_physical[0]; /* Sender Ethernet hardware address */ + my_packet -> nx_packet_prepend_ptr[9] = source_physical[1];; + my_packet -> nx_packet_prepend_ptr[10] = source_physical[2];; + my_packet -> nx_packet_prepend_ptr[11] = source_physical[3];; + my_packet -> nx_packet_prepend_ptr[12] = source_physical[4];; + my_packet -> nx_packet_prepend_ptr[13] = source_physical[5];; + my_packet -> nx_packet_prepend_ptr[14] = source_ip[0]; /* Sender IP address */ + my_packet -> nx_packet_prepend_ptr[15] = source_ip[1]; + my_packet -> nx_packet_prepend_ptr[16] = source_ip[2]; + my_packet -> nx_packet_prepend_ptr[17] = source_ip[3]; + my_packet -> nx_packet_prepend_ptr[18] = target_physical[0]; /* Target hardware address */ + my_packet -> nx_packet_prepend_ptr[19] = target_physical[1]; + my_packet -> nx_packet_prepend_ptr[20] = target_physical[2]; + my_packet -> nx_packet_prepend_ptr[21] = target_physical[3]; + my_packet -> nx_packet_prepend_ptr[22] = target_physical[4]; + my_packet -> nx_packet_prepend_ptr[23] = target_physical[5]; + my_packet -> nx_packet_prepend_ptr[24] = target_ip[0]; /* Target IP address */ + my_packet -> nx_packet_prepend_ptr[25] = target_ip[1]; + my_packet -> nx_packet_prepend_ptr[26] = target_ip[2]; + my_packet -> nx_packet_prepend_ptr[27] = target_ip[3]; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Return packet. */ + *packet_ptr = my_packet; + + return (NX_TRUE); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RARP Branch Test..........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_rarp_multiple_interfaces_test.c b/test/regression/netxduo_test/netx_rarp_multiple_interfaces_test.c new file mode 100644 index 00000000..44f9e5c1 --- /dev/null +++ b/test/regression/netxduo_test/netx_rarp_multiple_interfaces_test.c @@ -0,0 +1,292 @@ +/* This NetX test concentrates on the RARP for multiple interfaces. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_rarp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static VOID ntest_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID fake_rarp_response_packet(NX_PACKET **my_packet, UINT type); +extern VOID _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern VOID _nx_ram_network_driver_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id); + +#define NX_ETHERNET_RARP 0x8035 +#define NX_ETHERNET_SIZE 14 + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_multiple_interfaces_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", 0, 0, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Attach the 2nd interface IP address so it dosn't need RARP service. */ + status = nx_ip_interface_attach(&ip_0, "2nd interface", 0, 0, _nx_ram_network_driver_256); + if(status != NX_SUCCESS) + { + error_counter++; + } +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Print out some test information banners. */ + printf("NetX Test: RARP Multiple interfaces Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable RARP for IP Instance 0. */ + status = nx_rarp_enable(&ip_0); + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = packet_process; + + /* Verify the address of interface 0 is resolved. */ + status = nx_ip_interface_status_check(&ip_0, 0, NX_IP_ADDRESS_RESOLVED, &actual_status, 2 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if ((status != NX_SUCCESS) || (actual_status != NX_IP_ADDRESS_RESOLVED)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify the address of interface 1 is not resolved. */ + status = nx_ip_interface_status_check(&ip_0, 1, NX_IP_ADDRESS_RESOLVED, &actual_status, 2 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_PACKET *fake_packet; + + /* Fake the response packet. */ + fake_rarp_response_packet(&fake_packet, NX_RARP_OPTION_RESPONSE); + + /* Call the driver to receive this packet. */ + _nx_ram_network_driver_receive(&ip_0, fake_packet, 0); + + /* Clear the callback function. */ + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} +static VOID fake_rarp_response_packet(NX_PACKET **packet_ptr, UINT type) +{ +UINT status; +NX_PACKET *my_packet; +ULONG *ethernet_frame_ptr; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create a fake RARP response packet to assign address(1.2.3.4)! */ + my_packet -> nx_packet_prepend_ptr[0] = 0x00; /* Ethernet header */ + my_packet -> nx_packet_prepend_ptr[1] = 0x01; + my_packet -> nx_packet_prepend_ptr[2] = 0x80; /* IP address */ + my_packet -> nx_packet_prepend_ptr[3] = 0x00; + my_packet -> nx_packet_prepend_ptr[4] = 0x06; /* Hardware address size */ + my_packet -> nx_packet_prepend_ptr[5] = 0x04; /* IP address size */ + + /* Check the type. */ + if (type == NX_RARP_OPTION_REQUEST) + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* RARP request */ + my_packet -> nx_packet_prepend_ptr[7] = 0x03; + } + else if (type == NX_RARP_OPTION_RESPONSE) + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* RARP response */ + my_packet -> nx_packet_prepend_ptr[7] = 0x04; + } + else + { + my_packet -> nx_packet_prepend_ptr[6] = 0x00; /* Invalid RARP type */ + my_packet -> nx_packet_prepend_ptr[7] = 0x00; + } + my_packet -> nx_packet_prepend_ptr[8] = 0x11; /* Sender Ethernet hardware address */ + my_packet -> nx_packet_prepend_ptr[9] = 0x22; + my_packet -> nx_packet_prepend_ptr[10] = 0x33; + my_packet -> nx_packet_prepend_ptr[11] = 0x44; + my_packet -> nx_packet_prepend_ptr[12] = 0x55; + my_packet -> nx_packet_prepend_ptr[13] = 0x67; + my_packet -> nx_packet_prepend_ptr[14] = 0x01; /* Sender IP address */ + my_packet -> nx_packet_prepend_ptr[15] = 0x02; + my_packet -> nx_packet_prepend_ptr[16] = 0x03; + my_packet -> nx_packet_prepend_ptr[17] = 0x87; + my_packet -> nx_packet_prepend_ptr[18] = 0x11; /* Target hardware address */ + my_packet -> nx_packet_prepend_ptr[19] = 0x22; + my_packet -> nx_packet_prepend_ptr[20] = 0x33; + my_packet -> nx_packet_prepend_ptr[21] = 0x44; + my_packet -> nx_packet_prepend_ptr[22] = 0x55; + my_packet -> nx_packet_prepend_ptr[23] = 0x66; + my_packet -> nx_packet_prepend_ptr[24] = 0x01; /* Target IP address */ + my_packet -> nx_packet_prepend_ptr[25] = 0x02; + my_packet -> nx_packet_prepend_ptr[26] = 0x03; + my_packet -> nx_packet_prepend_ptr[27] = 0x04; + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Fake a receive RARP packet. */ + my_packet -> nx_packet_ip_interface = &ip_0.nx_ip_interface[TEST_INTERFACE]; + + /* Adjust the prepend pointer. */ + my_packet -> nx_packet_prepend_ptr = my_packet -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + my_packet -> nx_packet_length = my_packet -> nx_packet_length + NX_ETHERNET_SIZE; + + /* Setup the ethernet frame pointer to build the ethernet frame. Backup another 2 + bytes to get 32-bit word alignment. */ + ethernet_frame_ptr = (ULONG *) (my_packet -> nx_packet_prepend_ptr - 2); + + /* Build the ethernet frame. */ + *ethernet_frame_ptr = 0x00000011; + *(ethernet_frame_ptr+1) = 0x22334456; + *(ethernet_frame_ptr+2) = (0x00000011 << 16) | (0x22334457 >> 16); + *(ethernet_frame_ptr+3) = ((0x22334457 & 0xFFFF) << 16); + *(ethernet_frame_ptr+3) |= NX_ETHERNET_RARP; + + /* Endian swapping if NX_LITTLE_ENDIAN is defined. */ + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3)); + + /* Set the packet pointer. */ + *packet_ptr = my_packet; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_multiple_interfaces_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: RARP Basic Processing Test................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_rarp_nxe_api_test.c b/test/regression/netxduo_test/netx_rarp_nxe_api_test.c new file mode 100644 index 00000000..c704534e --- /dev/null +++ b/test/regression/netxduo_test/netx_rarp_nxe_api_test.c @@ -0,0 +1,218 @@ +/* This NetX test concentrates on the basic UDP operation. */ + +#include "nx_rarp.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG rarp_requests_sent; +ULONG rarp_responses_received; +ULONG rarp_invalid_messages; + + + /* Print out some test information banners. */ + printf("NetX Test: RARP NXE API Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_rarp_disable api */ + /************************************************/ + + /* Enable the RARP feature for NULL IP instance. */ + status = nx_rarp_disable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Disable the RARP feature for invalid IP instance. */ + status = nx_rarp_disable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_rarp_enable api */ + /************************************************/ + + /* Enable the RARP feature for NULL IP instance. */ + status = nx_rarp_enable(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Enable the RARP feature for invalid IP instance. */ + status = nx_rarp_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***********************************************/ + /* Tested the nxe_rarp_info_get api */ + /************************************************/ + + /* Get the RARP information for NULL IP instance. */ + status = nx_rarp_info_get(NX_NULL, &rarp_requests_sent, &rarp_responses_received, &rarp_invalid_messages); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the ID for invalid IP instance. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the RARP information for invalid IP instance. */ + status = nx_rarp_info_get(&invalid_ip, &rarp_requests_sent, &rarp_responses_received, &rarp_invalid_messages); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable the RARP feature. */ + ip_0.nx_ip_rarp_queue_process = NX_NULL; + ip_0.nx_ip_rarp_responses_received = NX_NULL; + + /* Get the RARP information for invalid IP instance. */ + status = nx_rarp_info_get(&ip_0, &rarp_requests_sent, &rarp_responses_received, &rarp_invalid_messages); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output success. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rarp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RARP NXE API Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_rarp_packet_allocate_fail_test.c b/test/regression/netxduo_test/netx_rarp_packet_allocate_fail_test.c new file mode 100644 index 00000000..7c61b997 --- /dev/null +++ b/test/regression/netxduo_test/netx_rarp_packet_allocate_fail_test.c @@ -0,0 +1,186 @@ +/* This NetX test concentrates on the auxiliary packet usage of RARP module. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_rarp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern VOID test_control_return(UINT status); + +#if !defined(NX_DISABLE_RARP_INFO) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL no_packet_pool_0; +static NX_PACKET_POOL no_packet_pool_1; +static NX_IP ip_0; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static VOID ntest_0_entry(ULONG thread_input); +extern VOID test_control_return(UINT status); +extern VOID _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +#define NX_ETHERNET_RARP 0x8035 +#define NX_ETHERNET_SIZE 14 + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +VOID netx_rarp_packet_allocate_fail_test_application_define(VOID *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +NX_PACKET *pkt_ptr; +UINT header_size = sizeof(NX_PACKET); + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an auxiliary packet pool. */ +#if defined(__PRODUCT_NETXDUO__) && defined(NX_PACKET_ALIGNMENT) + header_size = (sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1) / NX_PACKET_ALIGNMENT * NX_PACKET_ALIGNMENT; + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) / NX_PACKET_ALIGNMENT * NX_PACKET_ALIGNMENT); +#endif + status = nx_packet_pool_create(&no_packet_pool_0, "NetX Auxiliary Packet Pool", 256, pointer, (256 + header_size)); + pointer = pointer + 256 + header_size; + + if (status) + error_counter++; + + /* Create a packet pool with no packet. */ + status = nx_packet_pool_create(&no_packet_pool_1, "NetX No Packet Pool", 256, pointer, (256 + header_size)); + pointer = pointer + 256 + header_size; + + if (status) + error_counter++; + + /* Allocate the only one packet from pool. */ + nx_packet_allocate(&no_packet_pool_0, &pkt_ptr, NX_TCP_PACKET, NX_NO_WAIT); + nx_packet_allocate(&no_packet_pool_1, &pkt_ptr, NX_TCP_PACKET, NX_NO_WAIT); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", 0, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (VOID *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static VOID ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: RARP Packet Allocate Fail Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set packet pool to empty one. */ + ip_0.nx_ip_default_packet_pool = &no_packet_pool_0; +#ifdef NX_ENABLE_DUAL_PACKET_POOL + ip_0.nx_ip_auxiliary_packet_pool = &no_packet_pool_0; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + /* Enable RARP for IP Instance 0. */ + status = nx_rarp_enable(&ip_0); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Waiting NetX sending the RARP request to get the address. */ + tx_thread_sleep(1.5 * NX_IP_PERIODIC_RATE); + + /* No RARP request should be sent due to no packet. */ + if ((ip_0.nx_ip_rarp_requests_sent) || (no_packet_pool_0.nx_packet_pool_empty_requests == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + /* Set auxiliry packet pool to empty one. */ + ip_0.nx_ip_auxiliary_packet_pool = &no_packet_pool_1; + + /* Waiting NetX sending the RARP request to get the address. */ + tx_thread_sleep(1.5 * NX_IP_PERIODIC_RATE); + + /* No RARP request should be sent due to no packet. */ + if ((ip_0.nx_ip_rarp_requests_sent) || (no_packet_pool_1.nx_packet_pool_empty_requests == 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +VOID netx_rarp_packet_allocate_fail_test_application_define(VOID *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: RARP Packet Allocate Fail Test............................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ diff --git a/test/regression/netxduo_test/netx_raw_nxe_api_test.c b/test/regression/netxduo_test/netx_raw_nxe_api_test.c new file mode 100644 index 00000000..0e5b6a43 --- /dev/null +++ b/test/regression/netxduo_test/netx_raw_nxe_api_test.c @@ -0,0 +1,744 @@ +/* This NetX test concentrates on the raw nxe API. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_tcp.h" +#include "nx_udp.h" +#include "nx_packet.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; +#ifdef __PRODUCT_NETXDUO__ +NXD_ADDRESS des_address; +#endif +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_raw_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NX_PACKET *invalid_packet; +NX_PACKET *invalid_packet2; +UCHAR *temp_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: IP Raw Nxe API Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCD", 4, &pool_0, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable raw with null pointer, should return error. */ + status = nx_ip_raw_packet_enable(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable raw with invalid IP ID, should return error. */ + invalid_ip.nx_ip_id = 0; + status = nx_ip_raw_packet_enable(&invalid_ip); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable raw with null pointer, should return error. */ + status = nx_ip_raw_packet_disable(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable raw with invalid IP. */ + status = nx_ip_raw_packet_disable(&invalid_ip); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive raw packet before enable, error should be returned. */ + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive raw packet without null packet pointer. */ + status = nx_ip_raw_packet_receive(&ip_0, NX_NULL, NX_IP_PERIODIC_RATE); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive raw packet with invalid IP instance. */ + ip_0.nx_ip_id = 0; + status = nx_ip_raw_packet_receive(&ip_0, &my_packet, NX_IP_PERIODIC_RATE); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_id = NX_IP_ID; + + /* Send the raw IP packet before enable. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 + des_address.nxd_ip_version = NX_IP_VERSION_V6; + des_address.nxd_ip_address.v6[0] = 0x20010DB8; + des_address.nxd_ip_address.v6[1] = 0x00010001; + des_address.nxd_ip_address.v6[2] = 0x021122FF; + des_address.nxd_ip_address.v6[3] = 0xFE334456; + + /* Send raw packet with null IP instance. */ + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif +#endif + + + /* Enable RAW. */ + status = nx_ip_raw_packet_enable(&ip_0); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set raw filter with null IP instance, should return error. */ + status = nx_ip_raw_packet_filter_set(NX_NULL, NX_NULL); +#ifdef NX_ENABLE_IP_RAW_PACKET_FILTER + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#else + if(status != NX_NOT_SUPPORTED) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Receive raw packet with null IP instance, should return error. */ + status = nx_ip_raw_packet_receive(NX_NULL, NX_NULL, NX_IP_PERIODIC_RATE); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Send the raw IP packet with null IP instance. */ + status = nx_ip_raw_packet_send(NX_NULL, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the raw IP packet with invalid IP instance. */ + status = nx_ip_raw_packet_send(&invalid_ip, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the raw IP packet with NULL packet. */ + invalid_packet2 = NX_NULL; + status = nx_ip_raw_packet_send(&ip_0, invalid_packet2, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the raw IP packet with invalid packet state. */ +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#endif + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#endif + + /* Send the raw IP packet with invalid IP address. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, 0, NX_IP_NORMAL); + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the raw IP packet with invalid type of service. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xffffffff); + if (status != NX_OPTION_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &invalid_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + temp_ptr = invalid_packet -> nx_packet_prepend_ptr; + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nx_ip_raw_packet_send(&ip_0, invalid_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + + temp_ptr = invalid_packet -> nx_packet_append_ptr; + invalid_packet -> nx_packet_append_ptr = invalid_packet -> nx_packet_data_end + 1; + /* Send the invalid raw IP packet. */ + status = nx_ip_raw_packet_send(&ip_0, invalid_packet, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL); + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_append_ptr = temp_ptr; + + + /* Send raw packet with null IP instance. */ + status = nx_ip_raw_packet_source_send(NX_NULL, my_packet, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with null packet. */ + invalid_packet2 = NX_NULL; + status = nx_ip_raw_packet_source_send(&ip_0, invalid_packet2, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with invalid IP instance. */ + ip_0.nx_ip_id = 0; + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_id = NX_IP_ID; + + /* Send raw packet with invalid IP address. */ + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, 0, 0, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with invalid packet state. */ +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#endif + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, 0, 0, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#endif + + /* Send raw packet with invalid type of service. */ + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0, 0xffffffff); + if(status != NX_OPTION_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + temp_ptr = invalid_packet -> nx_packet_prepend_ptr; + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nx_ip_raw_packet_source_send(&ip_0, invalid_packet, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + + temp_ptr = invalid_packet -> nx_packet_append_ptr; + invalid_packet -> nx_packet_append_ptr = invalid_packet -> nx_packet_data_end + 1; + /* Send the invalid raw IP packet. */ + status = nx_ip_raw_packet_source_send(&ip_0, invalid_packet, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_append_ptr = temp_ptr; + + /* Send raw packet with invalid interface index. */ + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xffff, NX_IP_NORMAL); + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + ip_0.nx_ip_interface[0].nx_interface_valid = NX_FALSE; + /* Send raw packet with invalid interface. */ + status = nx_ip_raw_packet_source_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0, NX_IP_NORMAL); + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_interface[0].nx_interface_valid = NX_TRUE; + + /* Set raw packet receive queue size with null ip instance. */ + status = nx_ip_raw_receive_queue_max_set(NX_NULL, 5); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set raw packet receive queue size with invalid IP instance. */ + ip_0.nx_ip_id = 0; + status = nx_ip_raw_receive_queue_max_set(&ip_0, 5); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_id = NX_IP_ID; + +#ifdef __PRODUCT_NETXDUO__ + +#ifdef FEATURE_NX_IPV6 + /* Send raw packet with null IP instance. */ + status = nxd_ip_raw_packet_send(NX_NULL, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with invalid IP instance. */ + invalid_ip.nx_ip_id = 0; + status = nxd_ip_raw_packet_send(&invalid_ip, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with NULL packet. */ + invalid_ip.nx_ip_id = 0; + invalid_packet2 = NX_NULL; + status = nxd_ip_raw_packet_send(&ip_0, invalid_packet2, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with invalid packet state. */ +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#endif + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#endif + + /* Send raw packet to NULL IP address. */ + status = nxd_ip_raw_packet_send(&ip_0, my_packet, NX_NULL, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet to an invalid IP address. */ + des_address.nxd_ip_version = 8; + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + des_address.nxd_ip_version = NX_IP_VERSION_V6; + + /* Send raw packet with invalid protocol. */ + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, 0xffff, 0x80, NX_IP_NORMAL); + if(status != NX_INVALID_PARAMETERS) + { + printf("ERROR!\n"); + test_control_return(1); + } + des_address.nxd_ip_version = NX_IP_VERSION_V4; + + temp_ptr = invalid_packet -> nx_packet_prepend_ptr; + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_send(&ip_0, invalid_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + + temp_ptr = invalid_packet -> nx_packet_append_ptr; + invalid_packet -> nx_packet_append_ptr = invalid_packet -> nx_packet_data_end + 1; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_send(&ip_0, invalid_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_append_ptr = temp_ptr; + + des_address.nxd_ip_version = NX_IP_VERSION_V6; + + temp_ptr = invalid_packet -> nx_packet_prepend_ptr; + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_send(&ip_0, invalid_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + + /* Send to unspecified IP address. */ + memset(des_address.nxd_ip_address.v6, 0, sizeof(des_address.nxd_ip_address.v6)); + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + des_address.nxd_ip_address.v6[0] = 1; + + temp_ptr = invalid_packet -> nx_packet_prepend_ptr; + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_0, invalid_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + + temp_ptr = invalid_packet -> nx_packet_append_ptr; + invalid_packet -> nx_packet_append_ptr = invalid_packet -> nx_packet_data_end + 1; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_0, invalid_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_append_ptr = temp_ptr; + + /* Send to an invalid IPv6 addres. */ + des_address.nxd_ip_address.v6[0] = 0; + des_address.nxd_ip_address.v6[1] = 0; + des_address.nxd_ip_address.v6[2] = 0; + des_address.nxd_ip_address.v6[3] = 0; + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Send to an invalid IPv4 address. */ + des_address.nxd_ip_version = NX_IP_VERSION_V4; + des_address.nxd_ip_address.v4 = 0; + status = nxd_ip_raw_packet_send(&ip_0, my_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send to an valid IPv4 address with an invalid packet. */ + des_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_send(&ip_0, invalid_packet, &des_address, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + + /* Send to an valid IPv4 address with an invalid packet. */ + des_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_0, invalid_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; + +#ifdef FEATURE_NX_IPV6 + /* Send to an valid IPv6 address with an invalid packet. */ + des_address.nxd_ip_version = NX_IP_VERSION_V6; + invalid_packet -> nx_packet_prepend_ptr = invalid_packet -> nx_packet_data_start; + /* Send the invalid raw IP packet. */ + status = nxd_ip_raw_packet_source_send(&ip_0, invalid_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + invalid_packet -> nx_packet_prepend_ptr = temp_ptr; +#endif /* FEATURE_NX_IPV6 */ + + + /* Send raw packet with null IP instance. */ + status = nxd_ip_raw_packet_source_send(NX_NULL, my_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with null packet. */ + status = nxd_ip_raw_packet_source_send(&ip_0, NX_NULL, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send raw packet with null destination. */ + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, NX_NULL, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send to an invalid IP address. */ + des_address.nxd_ip_version = 8; + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send to an invalid IPv4 address. */ + des_address.nxd_ip_version = NX_IP_VERSION_V4; + des_address.nxd_ip_address.v4 = 0; + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send with an invalid interface. */ + des_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &des_address, 0xffff, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Send to an invalid IPv6 address. */ + des_address.nxd_ip_version = NX_IP_VERSION_V6; + des_address.nxd_ip_address.v6[0] = 0; + des_address.nxd_ip_address.v6[1] = 0; + des_address.nxd_ip_address.v6[2] = 0; + des_address.nxd_ip_address.v6[3] = 0; + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &des_address, 0, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send with invalid IPv6 address index. */ + des_address.nxd_ip_address.v6[0] = 0x20010DB8; + des_address.nxd_ip_address.v6[1] = 0x00010001; + des_address.nxd_ip_address.v6[2] = 0x021122FF; + des_address.nxd_ip_address.v6[3] = 0xFE334456; + status = nxd_ip_raw_packet_source_send(&ip_0, my_packet, &des_address, 0xffff, NX_IP_RAW >> 16, 0x80, NX_IP_NORMAL); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#endif + + + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_raw_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: IP Raw Nxe API Test.......................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_raw_special_test.c b/test/regression/netxduo_test/netx_raw_special_test.c new file mode 100644 index 00000000..e822dafd --- /dev/null +++ b/test/regression/netxduo_test/netx_raw_special_test.c @@ -0,0 +1,324 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_addr_0; +static NXD_ADDRESS ipv6_addr_1; +#endif + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_raw_special_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + if (status != NX_SUCCESS) + error_counter++; + + /* Create IP instances. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 9), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status != NX_SUCCESS) + error_counter++; + + /* Enable UDP for IP instances. */ + status = nx_udp_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + ipv6_addr_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_addr_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_addr_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_addr_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_addr_0.nxd_ip_address.v6[3] = 0x00010001; + + ipv6_addr_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_addr_1.nxd_ip_address.v6[0] = 0x30010000; + ipv6_addr_1.nxd_ip_address.v6[1] = 0x02300000; + ipv6_addr_1.nxd_ip_address.v6[2] = 0x00440000; + ipv6_addr_1.nxd_ip_address.v6[3] = 0x00010002; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + status = nxd_ipv6_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + + status = nxd_icmp_enable(&ip_0); + if(status != NX_SUCCESS) + error_counter++; + + status = nxd_icmp_enable(&ip_1); + if(status) + error_counter++; + + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_addr_0, 64, NX_NULL); + if(status != NX_SUCCESS) + error_counter++; +#endif + + +} + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG value; +UINT i; + + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Raw Special Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Send the raw IP packet Before enable. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 10), NX_IP_NORMAL); + if (status != NX_NOT_ENABLED) + error_counter++; +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Enable RAW. */ + status = nx_ip_raw_packet_enable(&ip_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Send to a address that can't be routed. */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(23, 42, 3, 10), NX_IP_NORMAL); + if (status != NX_IP_ADDRESS_ERROR) + error_counter++; + + /* Let ntest_1 do its job. */ + tx_thread_resume(&ntest_1); + tx_thread_suspend(&ntest_0); + + /* Two threads ntest_1 and ntest_2 suspend on the packet now. This will cover some code in raw_packet_processing */ + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 10), NX_IP_NORMAL); + if(status != NX_SUCCESS) + error_counter++; + + /* Send packets to fill the raw packet receive queue. This will cover some code in raw_packet_processing */ + for(i = 0; i < ip_0.nx_ip_raw_received_packet_max + 5; i++) + { + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_ip_raw_packet_send(&ip_0, my_packet, IP_ADDRESS(1, 2, 3, 10), NX_IP_NORMAL); + if(status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + } + + /* Disable RAW for ip_1. To test the situation that there are packets in the RAW packet queue. */ + status = nx_ip_raw_packet_disable(&ip_1); + if(status != NX_SUCCESS) + error_counter++; + + /* Enable again. */ + status = nx_ip_raw_packet_enable(&ip_1); + if(status != NX_SUCCESS) + error_counter++; + + tx_thread_suspend(&ntest_0); + + /* When thread ends, raw_packet_cleanup will be called. */ + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +ULONG value; + + /* Check the status of the IP instances. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &value, NX_IP_PERIODIC_RATE); + if ((status) || (value != NX_IP_INITIALIZE_DONE)) + error_counter++; + + status = nx_ip_raw_packet_enable(&ip_1); + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&ntest_2); + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + } + + /* Suspend on the packet to test raw_packet_cleanup. */ + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + +} + +static void ntest_2_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + tx_thread_resume(&ntest_0); + + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + { + status = nx_packet_release(my_packet); + if (status != NX_SUCCESS) + error_counter++; + } + + tx_thread_resume(&ntest_0); + /* Suspend on the packet to test raw_packet_cleanup. */ + status = nx_ip_raw_packet_receive(&ip_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_raw_special_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: IPv6 Raw Special Test.....................................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_tcp_4_duplicate_ack_test.c b/test/regression/netxduo_test/netx_tcp_4_duplicate_ack_test.c new file mode 100644 index 00000000..aa0dcbeb --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_4_duplicate_ack_test.c @@ -0,0 +1,340 @@ +/* This NetX test concentrates on the processing 4 duplicate ACK packets. */ + +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG duplicate_ack = 0; +static ULONG ack_number = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_4_duplicate_ack_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + duplicate_ack = 0; + ack_number = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; +UINT old_threshold; + + /* Print out some test information banners. */ + printf("NetX Test: TCP 4 Duplicate ACK Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Disable preemption from IP thread 1. */ + tx_thread_preemption_change(&thread_0, 2, &old_threshold); + + /* Set ACK number that should be duplicated. */ + ack_number = client_socket.nx_tcp_socket_tx_sequence; + + /* Set driver filter to drop the first packet. */ + advanced_packet_process_callback = packet_process; + + /* Set the TCP filter to check duplicate ACK. */ + ip_0.nx_ip_tcp_packet_receive = tcp_packet_receive; + + for (i = 0; i < 5; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_NO_WAIT); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Enable preemption. */ + tx_thread_preemption_change(&thread_0, old_threshold, &old_threshold); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 5; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Simply drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} + +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Get the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + if (tcp_header_ptr -> nx_tcp_acknowledgment_number == ack_number) + { + + /* It is duplicate ACK. */ + duplicate_ack++; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_4_duplicate_ack_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP 4 Duplicate ACK Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_ack_before_release_test.c b/test/regression/netxduo_test/netx_tcp_ack_before_release_test.c new file mode 100644 index 00000000..eef390b5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ack_before_release_test.c @@ -0,0 +1,313 @@ +/* This NetX test concentrates on the TCP receives ACK for the transmitting packet + * that has not been released by driver. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET server_socket_0; +static NX_PACKET *process_packet; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ack_before_release_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + process_packet = NX_NULL; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: TCP ACK Before Release Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_0, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket_0, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Set the driver filter to delay the packet and receive fake ACK packet. */ + advanced_packet_process_callback = driver_packet_process; + process_packet = packet_ptr; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket_0, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check the packet is not ACKed yet since driver should delay it for 1s. */ + if (client_socket_0.nx_tcp_socket_transmit_sent_count != 1) + { + error_counter++; + } + +#ifdef __PRODUCT_NETXDUO__ + /* Wakeup server thread. */ + tx_thread_resume(&thread_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + /* Let client run. */ + tx_thread_suspend(&thread_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +#endif /* __PRODUCT_NETXDUO__ */ +} + +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr) +{ +ULONG seq; + + if (packet_ptr == process_packet) + { + + /* Delay the packet by driver. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + advanced_packet_process_callback = NX_NULL; + + /* Send a fake packet that ACKs the delayed packet. */ + seq = server_socket_0.nx_tcp_socket_rx_sequence; + server_socket_0.nx_tcp_socket_rx_sequence = client_socket_0.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_ack(&server_socket_0, + server_socket_0.nx_tcp_socket_tx_sequence); + server_socket_0.nx_tcp_socket_rx_sequence = seq; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ack_before_release_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP ACK Before Release Test...............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_ack_check_for_syn_message_test.c b/test/regression/netxduo_test/netx_tcp_ack_check_for_syn_message_test.c new file mode 100644 index 00000000..ec486264 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ack_check_for_syn_message_test.c @@ -0,0 +1,383 @@ +/* This NetX test concentrates on fast retransmit. */ + +/* Procedure: +1. Client connect with Server. +2. Check the socket state. +3. Modify client socket state to unbind the client socket. +4. Check the socket state. +5. Set the callback function to check the TCP message. +6. Bind the client socket again. +7. Call nx_tcp_client_socket_connect to send SYN messsage. +8. Modify the server rx_sequence to let the SYN sequence number in server socket window in callback function. +9. Check if the server send the RST message. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ack_check_for_syn_message_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512 * 30); + pointer = pointer + 512 * 30; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP ACK Check For SYN Message Test........................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Let thread 1 run. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Check the socket state. */ + if ((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || + (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + { + error_counter++; + } + + /* Modified the socket state as NX_TCP_TIMED_WAIT to unbind client socket. */ + client_socket.nx_tcp_socket_state = NX_TCP_TIMED_WAIT; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Check the socket state. */ + if ((client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || + (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + { + error_counter++; + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = client_tcp_packet_receive; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Call connection. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status == NX_SUCCESS) + { + error_counter++; + } + + /* Check the socket state. */ + if ((client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || + (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE)) + { + error_counter++; + } + + /* Reset the callback functions. */ + advanced_packet_process_callback = NX_NULL; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Let thread 0 run. */ + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if ((error_counter) || (syn_counter != 1) || (rst_counter != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Ingore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an SYN packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) + { + + /* Update the counter. */ + syn_counter++; + + /* Modified the server rx_sequence to let the SYN sequence number in server socket window. */ + server_socket.nx_tcp_socket_rx_sequence = tcp_header_ptr -> nx_tcp_sequence_number - 1; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an RST packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + + /* Update the counter. */ + rst_counter++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ack_check_for_syn_message_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP ACK Check For SYN Message Test........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_ack_check_issue_test.c b/test/regression/netxduo_test/netx_tcp_ack_check_issue_test.c new file mode 100644 index 00000000..0e257888 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ack_check_issue_test.c @@ -0,0 +1,328 @@ +/* This NetX test concentrates a bug in nx_tcp_socket_state_ack_check.c. */ +/* When the packet is in TCP transmit queue but not sent by driver yet, + * an incoming ACK packet will trigger an ACK response. That is a bug. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG ack_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ack_check_issue_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP ACK Check Issue Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Set the driver filter to delay the packet. */ + advanced_packet_process_callback = driver_packet_process; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Wakeup the server thread. */ + tx_thread_resume(&thread_1); + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if ((error_counter) || (ack_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Let client thread run. */ + tx_thread_suspend(&thread_1); + + /* Setup the TCP receive filter to verify whether client sends ACK to server. */ + ip_1.nx_ip_tcp_packet_receive = tcp_packet_receive; + + /* Send an ACK to client. */ + _nx_tcp_packet_send_ack(&server_socket, server_socket.nx_tcp_socket_tx_sequence); + + /* Remove the filter function before disconnect. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Delay the packet by driver. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} + +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (packet_ptr -> nx_packet_length == 20)) + { + ack_counter++; + } + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ack_check_issue_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP ACK Check Issue Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_advertised_window_update_test.c b/test/regression/netxduo_test/netx_tcp_advertised_window_update_test.c new file mode 100644 index 00000000..dcca5772 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_advertised_window_update_test.c @@ -0,0 +1,331 @@ +/* This NetX test updating advertise window. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +static UINT updated_window; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_advertised_window_update_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +char *msg = MSG; + + /* Print out test information banner. */ + printf("NetX Test: TCP Advertised Window Update Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 37 + Packet 2 contains bytes 38 - 75 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 38); + my_packet1 -> nx_packet_length = 38; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[38], 38); + my_packet2 -> nx_packet_length = 38; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 38; + + /* Set a fixed sequence number to make sure + "nx_tcp_socket_state_ack_check.c: ((INT)tcp_header_ptr -> nx_tcp_sequence_number - (INT)ending_rx_sequence > 0)" + will not be hit. */ + client_socket.nx_tcp_socket_tx_sequence = 0x00221122; + client_socket.nx_tcp_socket_tx_sequence_recover = 0x00221121; + server_socket.nx_tcp_socket_rx_sequence = 0x00221122; + server_socket.nx_tcp_socket_rx_sequence_acked = 0x00221122; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Set the callback function. */ + updated_window = 0x200; + client_socket.nx_tcp_socket_rx_window_current = updated_window; + + /* Send packet 2. */ + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 76) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + if(server_socket.nx_tcp_socket_tx_window_advertised != updated_window) + error_counter++; + +#ifndef NX_DISABLE_PACKET_INFO + /* Check packet pool state. */ + if(pool_0.nx_packet_pool_invalid_releases) + error_counter++; +#endif + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_advertised_window_update_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Advertised Window Update Test.........................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_basic_processing_test.c b/test/regression/netxduo_test/netx_tcp_basic_processing_test.c new file mode 100644 index 00000000..17f6642d --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_basic_processing_test.c @@ -0,0 +1,646 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +#ifdef __PRODUCT_NETXDUO__ +static NX_PACKET_POOL my_auxiliary_pool; +#endif +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +#ifndef NX_DISABLE_EXTENDED_NOTIFY_SUPPORT +static void thread_0_establish_notify(NX_TCP_SOCKET *client_socket); +static void thread_0_disconnect_complete_notify(NX_TCP_SOCKET *client_socket); +#endif +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +#ifdef NX_ENABLE_EXTENDED_NOTIFY_SUPPORT +static void timed_wait_notify(NX_TCP_SOCKET *client_socket); +#endif +static void window_update_notify(NX_TCP_SOCKET *client_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + /* Create a auxiliary packet pool. 128*10 = 1280 */ + status = nx_packet_pool_create(&my_auxiliary_pool, "NetX Auxiliary Packet Pool", 128, pointer, 1280); + pointer = pointer + 1280; + + if (status) + error_counter++; +#endif + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#if defined(__PRODUCT_NETXDUO__) + + /* Set the auxiliary packet pool for IP instance 0. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_0, &my_auxiliary_pool); + + /* Check the status. */ +#ifdef NX_ENABLE_DUAL_PACKET_POOL + if(status != NX_SUCCESS) + error_counter++; +#else + if(status != NX_NOT_SUPPORTED) + error_counter++; +#endif + + /* Set the auxiliary packet pool for IP instance 1. */ + status = nx_ip_auxiliary_packet_pool_set(&ip_1, &my_auxiliary_pool); + + /* Check the status. */ +#ifdef NX_ENABLE_DUAL_PACKET_POOL + if(status != NX_SUCCESS) + error_counter++; +#else + if(status != NX_NOT_SUPPORTED) + error_counter++; +#endif + +#endif +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT compare_port; +ULONG mss, peer_mss, peer_ip_address, peer_port, bytes_available; +ULONG tcp_packets_sent, tcp_bytes_sent, tcp_packets_received, tcp_bytes_received, tcp_invalid_packets, tcp_receive_packets_dropped, tcp_checksum_errors, tcp_connections, tcp_disconnections, tcp_connections_dropped, tcp_retransmit_packets; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; +ULONG window_size = 200; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Basic Processing Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_TCP_WINDOW_SCALING + window_size = 0xFFFFFF; +#endif /* NX_ENABLE_TCP_WINDOW_SCALING */ + + /* Loop to establish 1000 connections, send one message, and disconnect. */ + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, window_size, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&client_socket, thread_0_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + +#ifndef NX_DISABLE_EXTENDED_NOTIFY_SUPPORT + status = nx_tcp_socket_establish_notify(&client_socket, thread_0_establish_notify); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_socket_disconnect_complete_notify(&client_socket, thread_0_disconnect_complete_notify); + + /* Check for error. */ + if (status) + error_counter++; +#endif + +#ifdef NX_ENABLE_EXTENDED_NOTIFY_SUPPORT + /* Setup a receive notify function. */ + status = nx_tcp_socket_timed_wait_callback(&client_socket, timed_wait_notify); + + /* Check for error. */ + if (status) + error_counter++; +#endif + + /* Setup a receive notify function. */ + status = nx_tcp_socket_window_update_notify_set(&client_socket, window_update_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&client_socket, &compare_port); + + /* Check for error. */ + if ((status) || (client_port != compare_port)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get information about peer socket before connection. */ + status = nx_tcp_socket_peer_info_get(&client_socket, &peer_ip_address, &peer_port); + + /* The status should not be successful since the connection is not established. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_tcp_socket_mss_set(&client_socket, 200); + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get the socket mss. */ + status = nx_tcp_socket_mss_get(&client_socket, &mss); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set the socket mss. */ + status = nx_tcp_socket_mss_set(&client_socket, mss - 1); + + /* Check for error. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Get the peer socket mss. */ + status = nx_tcp_socket_mss_peer_get(&client_socket, &peer_mss); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&client_socket, &bytes_available); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get information about peer socket. */ + status = nx_tcp_socket_peer_info_get(&client_socket, &peer_ip_address, &peer_port); + + /* Check for errors. */ + if ((status) || (peer_ip_address != IP_ADDRESS(1, 2, 3, 5)) || (peer_port != 12)) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get nothing from the socket. */ + status = nx_tcp_socket_info_get(&client_socket, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&client_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + error_counter++; +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != window_size)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Get nothing from the overall TCP information. */ + status = nx_tcp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get the overall TCP information. */ + status = nx_tcp_info_get(&ip_0, &tcp_packets_sent, &tcp_bytes_sent, &tcp_packets_received, &tcp_bytes_received, + &tcp_invalid_packets, &tcp_receive_packets_dropped, &tcp_checksum_errors, &tcp_connections, + &tcp_disconnections, &tcp_connections_dropped, &tcp_retransmit_packets); + +#ifndef NX_DISABLE_TCP_INFO + if((tcp_packets_sent != 1000) || (tcp_bytes_sent != 1000*28) || (tcp_connections != 1000) || (tcp_disconnections != 2000)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 1000) || (thread_1_counter != 1000) || (connections != 1000) || (disconnections) || + (tcp_packets_received) || (tcp_bytes_received) || (tcp_invalid_packets) ||(tcp_receive_packets_dropped) || (tcp_checksum_errors) || + (tcp_connections_dropped) || (tcp_retransmit_packets)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, thread_1_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Configure the socket further. */ + status = nx_tcp_socket_transmit_configure(&server_socket, 10, 300, 10, 0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Loop to create and establish server connections. */ + while((thread_1_counter < 1000) && (error_counter == 0)) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + +#ifndef NX_DISABLE_EXTENDED_NOTIFY_SUPPORT +static void thread_0_establish_notify(NX_TCP_SOCKET *client_socket) +{ + ; +} + +static void thread_0_disconnect_complete_notify(NX_TCP_SOCKET *client_socket) +{ + ; +} +#endif + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#ifdef NX_ENABLE_EXTENDED_NOTIFY_SUPPORT +static void timed_wait_notify(NX_TCP_SOCKET *client_socket) +{ +} +#endif + +static void window_update_notify(NX_TCP_SOCKET *client_socket) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Basic Processing Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_branch_test.c b/test/regression/netxduo_test/netx_tcp_branch_test.c new file mode 100644 index 00000000..5cbe96d0 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_branch_test.c @@ -0,0 +1,2150 @@ +/* This NetX test concentrates on the code coverage for TCP functions, + * _nx_tcp_connect_cleanup.c + * _nx_tcp_disconnect_cleanup.c + * _nx_tcp_client_bind_cleanup.c + * _nx_tcp_receive_cleanup.c + * _nx_tcp_transmit_cleanup.c + * _nx_tcp_socket_thread_resume.c + * _nx_tcp_packet_receive.c + * _nx_tcp_server_socket_listen.c + * _nx_tcp_socket_mss_set.c + * _nx_tcp_socket_state_fin_wait2.c + * _nx_tcp_socket_state_data_trim.c + * _nx_tcp_client_socket_unbind.c + * _nx_tcp_socket_disconnect.c + * _nx_tcp_client_bind_cleanup.c + */ + +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_packet.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define ASSERT_THREAD_COUNT 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_test1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET tcp_socket; +static NX_TCP_SOCKET tcp_socket_2; +static NX_TCP_SOCKET test_socket; +static NX_TCP_LISTEN tcp_listen[2]; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UCHAR pool_area[102400]; +#ifdef __PRODUCT_NETXDUO__ +static UINT disconnect_flag = NX_FALSE; + +#if defined FEATURE_NX_IPV6 && !defined NX_DISABLE_ASSERT +static TX_THREAD thread_for_assert[ASSERT_THREAD_COUNT]; +static UCHAR stack_for_assert[ASSERT_THREAD_COUNT][DEMO_STACK_SIZE]; +#endif + +#if !defined NX_DISABLE_PACKET_CHAIN && !defined NX_DISABLE_ASSERT +static TX_THREAD thread_for_assert_1; +static UCHAR stack_for_assert_1[DEMO_STACK_SIZE]; +#endif /* __PRODUCT_NETXDUO__ */ + +#endif +#ifdef FEATURE_NX_IPV6 +static UINT address_index; +#endif /* FEATURE_NX_IPV6 */ + +#ifdef __PRODUCT_NETXDUO__ +/* TCP packet. 192.168.100.23:6206 -> 192.168.100.4:80 */ +static unsigned char pkt1[54] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x08, 0x00, 0x45, 0x00, /* 8.%...E. */ +0x00, 0x28, 0x10, 0x9d, 0x00, 0x00, 0x80, 0x06, /* .(...... */ +0xe0, 0xc6, 0xc0, 0xa8, 0x64, 0x17, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x18, 0x3e, 0x00, 0x50, 0x62, 0xf3, /* d..>.Pb. */ +0xa5, 0x46, 0x54, 0x7e, 0x0c, 0xe7, 0x50, 0x10, /* .FT~..P. */ +0x01, 0x00, 0xe3, 0x3a, 0x00, 0x00 /* ...:.. */ +}; + +#ifdef FEATURE_NX_IPV6 +/* TCP packet. [fe80::1]:6206 -> [fe80::211:22ff:fe33:4456]:80 */ +static unsigned char pkt2[74] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x86, 0xdd, 0x60, 0x00, /* 8.%...`. */ +0x00, 0x00, 0x00, 0x14, 0x06, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x18, 0x3e, /* "..3DV.> */ +0x00, 0x50, 0x62, 0xf3, 0xa5, 0x46, 0x54, 0x7e, /* .Pb..FT~ */ +0x0c, 0xe7, 0x50, 0x10, 0x01, 0x00, 0xc8, 0x0a, /* ..P..... */ +0x00, 0x00 /* .. */ +}; + +/* TCP packet with invalid option. SYN bits are set. */ +static unsigned char pkt3[78] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x86, 0xdd, 0x60, 0x00, /* 8.%...`. */ +0x00, 0x00, 0x00, 0x18, 0x06, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x18, 0x3e, /* "..3DV.> */ +0x00, 0x50, 0x62, 0xf3, 0xa5, 0x46, 0x54, 0x7e, /* .Pb..FT~ */ +0x0c, 0xe7, 0x60, 0x02, 0x01, 0x00, 0xb6, 0x14, /* ..`..... */ +0x00, 0x00, 0x02, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* TCP packet with invalid option. SYN bits are set. */ +static unsigned char pkt4[78] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x86, 0xdd, 0x60, 0x00, /* 8.%...`. */ +0x00, 0x00, 0x00, 0x18, 0x06, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x18, 0x3e, /* "..3DV.> */ +0x00, 0x50, 0x62, 0xf3, 0xa5, 0x46, 0x54, 0x7e, /* .Pb..FT~ */ +0x0c, 0xe7, 0x60, 0x00, 0x01, 0x00, 0xb6, 0x16, /* ..`..... */ +0x00, 0x00, 0x02, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* TCP packet. 192.168.100.4:80 -> 192.168.100.4:80 */ +static unsigned char pkt5[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0xf4, 0xfb, 0xc0, 0xa8, 0x64, 0x04, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x00, 0x50, 0x00, 0x50, 0x9e, 0xc2, /* d..P.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x00, /* ......P. */ +0x01, 0xf9, 0x1c, 0x87, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* TCP packet. [fe80::211:22ff:fe33:4456]:6206 -> [fe80::211:22ff:fe33:4456]:80 */ +static unsigned char pkt6[78] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x86, 0xdd, 0x60, 0x00, /* 8.%...`. */ +0x00, 0x00, 0x00, 0x18, 0x06, 0xff, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0xff, 0x02, /* ...3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x18, 0x3e, /* ...3DV.> */ +0x00, 0x50, 0x62, 0xf3, 0xa5, 0x46, 0x54, 0x7e, /* .Pb..FT~ */ +0x0c, 0xe7, 0x60, 0x00, 0x01, 0x00, 0x96, 0x97, /* ..`..... */ +0x00, 0x00, 0x01, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* TCP packet. 255.255.255.255:80 -> 192.168.100.4:80 */ +static unsigned char pkt7[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0x19, 0xa9, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xa8, /* ........ */ +0x64, 0x04, 0x00, 0x50, 0x00, 0x50, 0x9e, 0xc2, /* d..P.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x00, /* ......P. */ +0x01, 0xf9, 0x41, 0x34, 0x00, 0x00, 0x00, 0x00, /* ..A4.... */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* TCP RST packet. 192.168.100.23:80 -> 192.168.100.4:80 */ +static unsigned char pkt8[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0xf4, 0xe8, 0xc0, 0xa8, 0x64, 0x17, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x00, 0x50, 0x00, 0x50, 0x9e, 0xc2, /* d..P.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x04, /* ......P. */ +0x01, 0xf9, 0x1c, 0x70, 0x00, 0x00, 0x00, 0x00, /* ...p.... */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* TCP packet. 224.0.0.1:80 -> 192.168.100.4:80 */ +static unsigned char pkt9[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0x39, 0xa7, 0xe0, 0x00, 0x00, 0x01, 0xc0, 0xa8, /* 9....... */ +0x64, 0x04, 0x00, 0x50, 0x00, 0x50, 0x9e, 0xc2, /* d..P.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x04, /* ......P. */ +0x01, 0xf9, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, /* ..a..... */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* TCP SYN packet. 192.168.100.24:80 -> 192.168.100.4:80 */ +static unsigned char pkt10[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0xf4, 0xe7, 0xc0, 0xa8, 0x64, 0x18, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x00, 0x50, 0x00, 0x50, 0x9e, 0xc2, /* d..P.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x02, /* ......P. */ +0x01, 0xf9, 0x1c, 0x71, 0x00, 0x00, 0x00, 0x00, /* ...q.... */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* TCP SYN packet. 192.168.100.23:81 -> 192.168.100.4:80 */ +static unsigned char pkt11[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0xf4, 0xe8, 0xc0, 0xa8, 0x64, 0x17, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x00, 0x51, 0x00, 0x50, 0x9e, 0xc2, /* d..Q.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x02, /* ......P. */ +0x01, 0xf9, 0x1c, 0x71, 0x00, 0x00, 0x00, 0x00, /* ...q.... */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* TCP SYN packet. [fe80::211:22ff:fe33:4456]:6206 -> [fe80::211:22ff:fe33:4456]:80 */ +static unsigned char pkt12[78] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x86, 0xdd, 0x60, 0x00, /* 8.%...`. */ +0x00, 0x00, 0x00, 0x18, 0x06, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x18, 0x3e, /* "..3DV.> */ +0x00, 0x50, 0x62, 0xf3, 0xa5, 0x46, 0x54, 0x7e, /* .Pb..FT~ */ +0x0c, 0xe7, 0x60, 0x02, 0x01, 0x00, 0xb7, 0x14, /* ..`..... */ +0x00, 0x00, 0x01, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* TCP RST packet. [fe80::211:22ff:fe33:4456]:6207 -> [fe80::211:22ff:fe33:4456]:80 */ +static unsigned char pkt13[78] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x86, 0xdd, 0x60, 0x00, /* 8.%...`. */ +0x00, 0x00, 0x00, 0x18, 0x06, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x18, 0x3f, /* "..3DV.? */ +0x00, 0x50, 0x62, 0xf3, 0xa5, 0x46, 0x54, 0x7e, /* .Pb..FT~ */ +0x0c, 0xe7, 0x60, 0x04, 0x01, 0x00, 0xb7, 0x11, /* ..`..... */ +0x00, 0x00, 0x01, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* TCP RST packet. 192.168.100.24:80 -> 192.168.100.4:80 */ +static unsigned char pkt14[60] = { +0xf4, 0x8e, 0x38, 0xa3, 0x25, 0xb3, 0x20, 0x0b, /* ..8.%. . */ +0xc7, 0x94, 0x45, 0x96, 0x08, 0x00, 0x45, 0x10, /* ..E...E. */ +0x00, 0x28, 0x02, 0x6b, 0x40, 0x00, 0x3a, 0x06, /* .(.k@.:. */ +0xf4, 0xe7, 0xc0, 0xa8, 0x64, 0x18, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x00, 0x50, 0x00, 0x50, 0x9e, 0xc2, /* d..P.P.. */ +0x86, 0xc6, 0x18, 0xc8, 0x09, 0x1a, 0x50, 0x04, /* ......P. */ +0x01, 0xf9, 0x1c, 0x6f, 0x00, 0x00, 0x00, 0x00, /* ...o.... */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +#endif /* __PRODUCT_NETXDUO__ */ + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER); +#ifdef __PRODUCT_NETXDUO__ +static VOID tcp_fast_periodic_processing(NX_IP *ip_ptr); +static VOID my_tcp_queue_process(NX_IP *ip_ptr); +static VOID ack_check_test(); +static VOID data_check_test(); +static VOID socket_packet_process_test(); + +#if defined FEATURE_NX_IPV6 && !defined NX_DISABLE_ASSERT +static VOID thread_for_assert_entry_0(ULONG thread_input); +static VOID (*thread_for_assert_entry[])(ULONG) = +{ + thread_for_assert_entry_0, +}; +#endif + +#if !defined NX_DISABLE_PACKET_CHAIN && !defined NX_DISABLE_ASSERT +static VOID thread_for_assert_entry_1(ULONG thread_input); +#endif + +#endif /* __PRODUCT_NETXDUO__ */ + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_branch_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Branch Test..........................................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pool_area, sizeof(pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 processing for IP instance. */ + status = nxd_ipv6_enable(&ip_0); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; + +#endif /* FEATURE_NX_IPV6 */ +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG system_state; +ULONG thread_state; +NX_PACKET *my_packet[3]; +TX_THREAD *suspension_list; +TX_INTERRUPT_SAVE_AREA + +#ifdef __PRODUCT_NETXDUO__ +NX_PACKET *packet_ptr; +NX_TCP_HEADER tcp_header, *tcp_header_ptr; +TX_THREAD *temp_suspend_thread; +NX_IPV4_HEADER *ipv4_header_ptr; +#ifndef NX_DISABLE_PACKET_CHAIN +UINT packet_counter; +#endif +#endif /* __PRODUCT_NETXDUO__ */ +#if defined FEATURE_NX_IPV6 && !defined NX_DISABLE_ASSERT +UINT i; +#endif /* NX_DISABLE_ASSERT */ + + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &tcp_socket, "TCP Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + status += nx_tcp_socket_create(&ip_0, &tcp_socket_2, "TCP Socket 2", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + +#ifdef FEATURE_NX_IPV6 + nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, &address_index); +#endif /* FEATURE_NX_IPV6 */ + if (nx_tcp_client_socket_bind(&tcp_socket, 80, 0)) + { + error_counter++; + } + + /* Test bind again. */ + if (nx_tcp_client_socket_bind(&tcp_socket, 80, 0) != NX_ALREADY_BOUND) + { + error_counter++; + } + + /* Cover true branch of (socket_ptr -> nx_tcp_socket_bind_in_progress). */ + tcp_socket_2.nx_tcp_socket_bind_in_progress = _tx_thread_current_ptr; + if (nx_tcp_client_socket_bind(&tcp_socket_2, 81, 0) != NX_ALREADY_BOUND) + { + error_counter++; + } + tcp_socket_2.nx_tcp_socket_bind_in_progress = NX_NULL; + if (nx_tcp_client_socket_bind(&tcp_socket_2, 81, 0)) + { + error_counter++; + } + +#if defined FEATURE_NX_IPV6 && !defined NX_DISABLE_ASSERT + for (i = 0; i < ASSERT_THREAD_COUNT; i++) + { + + /* Create the assert thread. */ + tx_thread_create(&thread_for_assert[i], "Assert Test thread", thread_for_assert_entry[i], 0, + stack_for_assert[i], DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert[i]); + tx_thread_delete(&thread_for_assert[i]); + } +#endif +#ifdef FEATURE_NX_IPV6 + ip_0.nx_ipv6_address[address_index].nxd_ipv6_address_attached = &ip_0.nx_ip_interface[0]; + nxd_ipv6_address_delete(&ip_0, address_index); +#endif /* FEATURE_NX_IPV6 */ + nx_tcp_client_socket_unbind(&tcp_socket); + + + /* suspension list is set to NULL. */ + suspension_list = NX_NULL; + _nx_tcp_socket_thread_resume(&suspension_list, 0); + + /* tx_thread_suspend_control_block is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + _nx_tcp_client_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_transmit_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Test for invalid nx_tcp_socket_id */ + tx_thread_identify() -> tx_thread_suspend_control_block = (VOID*)&tcp_socket; + tcp_socket.nx_tcp_socket_id = 0; + _nx_tcp_client_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_transmit_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + + + TX_DISABLE + /* Test for Thread state in ISR. */ + tx_thread_identify() -> tx_thread_suspend_control_block = (VOID*)&tcp_socket; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tcp_socket.nx_tcp_socket_connect_suspended_thread = tx_thread_identify(); + tcp_socket.nx_tcp_socket_disconnect_suspended_thread = tx_thread_identify(); + system_state = _tx_thread_system_state; + _tx_thread_system_state = 1; + _nx_tcp_client_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_transmit_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _tx_thread_system_state = 0; + _tx_thread_system_state = system_state; + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + TX_RESTORE + tx_thread_sleep(1); + + + /* tx_thread_suspend_control_block is set to TCP socket but tx_thread_suspend_cleanup is set to NULL. */ + tx_thread_identify() -> tx_thread_suspend_control_block = &tcp_socket; + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + _nx_tcp_client_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_transmit_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup and tx_thread_suspended_next. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + tcp_socket.nx_tcp_socket_transmit_suspended_count = 1; + _nx_tcp_transmit_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + tcp_socket.nx_tcp_socket_receive_suspended_count = 1; + _nx_tcp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + tcp_socket.nx_tcp_socket_bound_previous = &tcp_socket; + tcp_socket.nx_tcp_socket_bind_suspended_count = 1; + _nx_tcp_client_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + + /* Hit condition of if ((_tx_thread_system_state) || (&(ip_ptr -> nx_ip_thread) != _tx_thread_current_ptr)) in _nx_tcp_packet_receive(). */ + tx_mutex_get(&(ip_0.nx_ip_protection), TX_WAIT_FOREVER); + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], "abcdefghijklmnopqrstuvwxyz", 26, &pool_0, NX_NO_WAIT); + + system_state = _tx_thread_system_state; + _tx_thread_system_state = 0; + + _nx_tcp_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_tcp_queue_head = NX_NULL; + ip_0.nx_ip_tcp_received_packet_count = 0; + + _tx_thread_system_state = system_state; + nx_packet_release(my_packet[0]); + + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_data_append(my_packet[0], "abcdefghijklmnopqrstuvwxyz", 26, &pool_0, NX_NO_WAIT); + system_state = _tx_thread_system_state; + _tx_thread_system_state = 1; + + _nx_tcp_packet_receive(&ip_0, my_packet[0]); + ip_0.nx_ip_tcp_queue_head = NX_NULL; + ip_0.nx_ip_tcp_received_packet_count = 0; + + _tx_thread_system_state = system_state; + nx_packet_release(my_packet[0]); + tx_mutex_put(&(ip_0.nx_ip_protection)); + + + /* Test _nx_tcp_server_socket_listen() */ + /* Hit condition: + 143 [ + - ][ + + ]: 2428 : if ((socket_ptr -> nx_tcp_socket_bound_next) || + 144 : 2428 : (socket_ptr -> nx_tcp_socket_bind_in_progress)) + */ + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + _nx_tcp_server_socket_listen(&ip_0, 12, &tcp_socket, 5, NX_NULL); + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + + + /* Test _nx_tcp_server_socket_listen() */ + /* Hit condition: + 144 [ + + ][ - + ]: 305 : if ((socket_ptr -> nx_tcp_socket_bound_next) || + 145 : 303 : (socket_ptr -> nx_tcp_socket_bind_in_progress)). */ + tcp_socket.nx_tcp_socket_bind_in_progress = tx_thread_identify(); + _nx_tcp_server_socket_listen(&ip_0, 12, &tcp_socket, 5, NX_NULL); + tcp_socket.nx_tcp_socket_bind_in_progress = NX_NULL; + + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + tcp_socket.nx_tcp_socket_bind_in_progress = tx_thread_identify(); + _nx_tcp_server_socket_listen(&ip_0, 12, &tcp_socket, 5, NX_NULL); + tcp_socket.nx_tcp_socket_bind_in_progress = NX_NULL; + + + /* Hit condition of if ((mss > ((if_mtu - ip_header_size) - sizeof(NX_TCP_HEADER))) || (mss == 0)) in _nx_tcp_socket_mss_set. */ + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; +#ifdef __PRODUCT_NETXDUO__ + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; +#endif + _nx_tcp_socket_mss_set(&tcp_socket, 5); + _nx_tcp_socket_mss_set(&tcp_socket, 0); + + +#ifdef __PRODUCT_NETXDUO__ + /* Hit condition of if (socket_ptr -> nx_tcp_socket_disconnect_suspended_thread) in _nx_tcp_socket_state_fin_wait2. */ + tcp_socket.nx_tcp_socket_fin_received = NX_TRUE; + tcp_socket.nx_tcp_socket_fin_sequence = tcp_socket.nx_tcp_socket_rx_sequence; + temp_suspend_thread = tcp_socket.nx_tcp_socket_disconnect_suspended_thread; + tcp_socket.nx_tcp_socket_disconnect_suspended_thread = NX_NULL; + _nx_tcp_socket_state_fin_wait2(&tcp_socket); + tcp_socket.nx_tcp_socket_disconnect_suspended_thread = temp_suspend_thread; + + + /* Hit condition of if (amount >= packet_ptr -> nx_packet_length) in _nx_tcp_socket_state_data_trim. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + _nx_tcp_socket_state_data_trim(my_packet[0], 1); + _nx_tcp_socket_state_data_trim_front(my_packet[0], 0); + my_packet[0] -> nx_packet_length = 1; + _nx_tcp_socket_state_data_trim_front(my_packet[0], 0); + my_packet[0] -> nx_packet_length = 0; + _nx_tcp_socket_state_data_trim_front(my_packet[0], 1); + nx_packet_release(my_packet[0]); +#endif + + /* Test _nx_tcp_connect_cleanup */ + tcp_socket.nx_tcp_socket_id = 1; + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + + /* Test _nx_tcp_disconnect_cleanup(). */ + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &tcp_socket; + tcp_socket.nx_tcp_socket_id = 0; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tcp_socket.nx_tcp_socket_id = 0; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = &tcp_socket; + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = &tcp_socket; + tcp_socket.nx_tcp_socket_id = 0; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + tcp_socket.nx_tcp_socket_id = 0; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &tcp_socket; + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + system_state = _tx_thread_system_state; + _tx_thread_system_state = 0; + _nx_tcp_connect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + _tx_thread_system_state = system_state; + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &tcp_socket; + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + thread_state = tx_thread_identify() -> tx_thread_state; + tx_thread_identify() -> tx_thread_state = 0; + _nx_tcp_disconnect_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + + + + /* Test _nx_tcp_client_socket_unbind(). */ + /* Hit false condition of if (socket_ptr -> nx_tcp_socket_state != NX_TCP_CLOSED) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + _nx_tcp_client_socket_unbind(&tcp_socket); + + + /* Test _nx_tcp_socket_disconnect */ + /* Hit false condition of if ((socket_ptr -> nx_tcp_socket_state == NX_TCP_SYN_RECEIVED) && + (socket_ptr -> nx_tcp_socket_connect_interface != NX_NULL)) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_SYN_SENT; + tcp_socket.nx_tcp_socket_client_type = NX_FALSE; + _nx_tcp_socket_disconnect(&tcp_socket, 1); + + /* Hit false condition of (wait_option) && (_tx_thread_current_ptr != &(ip_ptr -> nx_ip_thread) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_receive_suspension_list = &thread_test1; + tcp_socket.nx_tcp_socket_receive_suspended_count ++; + thread_test1.tx_thread_suspend_cleanup = suspend_cleanup; + thread_test1.tx_thread_suspend_control_block = &tcp_socket; + thread_test1.tx_thread_suspended_next = &thread_test1; + _nx_tcp_socket_disconnect(&tcp_socket, 0); + + /* Recover. */ + tcp_socket.nx_tcp_socket_receive_suspension_list = NX_NULL; + + +#ifdef __PRODUCT_NETXDUO__ + /* Hit false condition of (_tx_thread_current_ptr != &(ip_ptr -> nx_ip_thread) in _nx_tcp_socket_disconnect() */ + ip_0.nx_ip_tcp_fast_periodic_processing = tcp_fast_periodic_processing; + + /* Let trigger TCP fast periodic notify function. s*/ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the flag. */ + if (disconnect_flag != NX_TRUE) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + + /* Test _nx_tcp_server_socket_unaccept() */ + /* Hit false condition of (socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSED) && (socket_ptr -> nx_tcp_socket_bound_next)) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + _nx_tcp_server_socket_unaccept(&tcp_socket); + + /* Hit false condition of (ip_ptr -> nx_ip_tcp_port_table[index] == socket_ptr) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_LISTEN_STATE; + tcp_socket.nx_tcp_socket_bound_next = &test_socket; + tcp_socket.nx_tcp_socket_bound_previous = &test_socket; + test_socket.nx_tcp_socket_bound_next = NX_NULL; + test_socket.nx_tcp_socket_bound_previous = NX_NULL; + _nx_tcp_server_socket_unaccept(&tcp_socket); + + /* Hit false condition of if (listen_ptr) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_LISTEN_STATE; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + tcp_socket.nx_tcp_socket_bound_previous = NX_NULL; + _nx_tcp_server_socket_unaccept(&tcp_socket); + + /* Hit false condition of if (listen_ptr -> nx_tcp_listen_socket_ptr == socket_ptr) */ + tcp_socket.nx_tcp_socket_state = NX_TCP_LISTEN_STATE; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + tcp_socket.nx_tcp_socket_bound_previous = NX_NULL; + ip_0.nx_ip_tcp_active_listen_requests = &tcp_listen[0]; + tcp_listen[0].nx_tcp_listen_next = &tcp_listen[1]; + tcp_listen[1].nx_tcp_listen_next = &tcp_listen[0]; + _nx_tcp_server_socket_unaccept(&tcp_socket); + + /* Hit condition: + 130 [ + + ][ + + ]: 2314 : if ((socket_ptr -> nx_tcp_socket_state >= NX_TCP_CLOSE_WAIT) || + 131 [ - + ]: 54 : ((socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSED) && (socket_ptr -> nx_tcp_socket_bound_next))) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + _nx_tcp_server_socket_unaccept(&tcp_socket); + + /* Hit condition + 201 [ + - ]: 5 : if (ip_ptr -> nx_ip_tcp_port_table[index] == socket_ptr) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + tcp_socket.nx_tcp_socket_bound_next = &test_socket; + tcp_socket.nx_tcp_socket_bound_previous = &test_socket; + test_socket.nx_tcp_socket_bound_next = NX_NULL; + test_socket.nx_tcp_socket_bound_previous = NX_NULL; + _nx_tcp_server_socket_unaccept(&tcp_socket); + ip_0.nx_ip_tcp_active_listen_requests = NX_NULL; + +#ifdef __PRODUCT_NETXDUO__ + /* Test _nx_tcp_socket_state_syn_received */ + /* Test line: + 140 [ + - ][ + + ]: 2278 : if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + 141 : 2278 : (tcp_header_ptr -> nx_tcp_acknowledgment_number == socket_ptr -> nx_tcp_socket_tx_sequence)) + */ + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + tcp_socket.nx_tcp_socket_tx_sequence = 10; + tcp_header.nx_tcp_acknowledgment_number = 9; + tcp_header.nx_tcp_header_word_3 = 0; + _nx_tcp_socket_state_syn_received(&tcp_socket, &tcp_header); + + /* Test line: + 235 [ + - ][ + - ]: 1 : else if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + 236 : 1 : (tcp_header_ptr -> nx_tcp_acknowledgment_number != socket_ptr -> nx_tcp_socket_tx_sequence)) + */ + tcp_socket.nx_tcp_socket_tx_sequence = 10; + tcp_header.nx_tcp_acknowledgment_number = 9; + tcp_header.nx_tcp_header_word_3 = 0; + _nx_tcp_socket_state_syn_received(&tcp_socket, &tcp_header); + + tcp_socket.nx_tcp_socket_tx_sequence = 10; + tcp_header.nx_tcp_acknowledgment_number = 9; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + _nx_tcp_socket_state_syn_received(&tcp_socket, &tcp_header); + + + /* Test nx_tcp_socket_state_syn_sent.c */ + /* Test line: + 158 [ + + ][ + + ]: 2296 : else if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && + 159 [ + - ]: 2281 : (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + 160 : 2281 : (tcp_header_ptr -> nx_tcp_acknowledgment_number == socket_ptr -> nx_tcp_socket_tx_sequence)) + + 262 [ + + ][ + - ]: 15 : else if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && + 263 : 3 : (!(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT))) + + */ + tcp_header.nx_tcp_header_word_3 = NX_TCP_SYN_BIT | NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 10; + tcp_socket.nx_tcp_socket_tx_sequence = 9; + _nx_tcp_socket_state_syn_sent(&tcp_socket, &tcp_header, my_packet[0]); + + + /* Test line: + 310 [ + - ][ + + ]: 12 : else if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + 311 : 12 : (tcp_header_ptr -> nx_tcp_acknowledgment_number != socket_ptr -> nx_tcp_socket_tx_sequence)) + */ + tcp_header.nx_tcp_header_word_3 = 0; + tcp_header.nx_tcp_acknowledgment_number = 10; + tcp_socket.nx_tcp_socket_rx_sequence = 9; + _nx_tcp_socket_state_syn_sent(&tcp_socket, &tcp_header, my_packet[0]); + + + /* Test nx_tcp_socket_state_last_ack.c + 117 [ + - ]: 1188 : if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + */ + tcp_header.nx_tcp_header_word_3 = 0; + _nx_tcp_socket_state_last_ack(&tcp_socket, &tcp_header); + + /* + 121 [ + + ][ + - ]: 1188 : if ((tcp_header_ptr -> nx_tcp_acknowledgment_number == socket_ptr -> nx_tcp_socket_tx_sequence) && + 122 : 1187 : (tcp_header_ptr -> nx_tcp_sequence_number == socket_ptr -> nx_tcp_socket_rx_sequence)) + */ + + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 10; + tcp_socket.nx_tcp_socket_tx_sequence = 10; + tcp_header.nx_tcp_sequence_number = 9; + tcp_socket.nx_tcp_socket_rx_sequence = 8; + _nx_tcp_socket_state_last_ack(&tcp_socket, &tcp_header); + + /* + 129 [ + - ]: 1187 : if (socket_ptr -> nx_tcp_socket_disconnect_suspended_thread) + */ + + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 10; + tcp_socket.nx_tcp_socket_tx_sequence = 10; + tcp_header.nx_tcp_sequence_number = 9; + tcp_socket.nx_tcp_socket_rx_sequence = 9; + tcp_socket.nx_tcp_socket_disconnect_suspended_thread = NULL; + _nx_tcp_socket_state_last_ack(&tcp_socket, &tcp_header); + + + + + + /* Test nx_tcp_socket_receive.c: + 168 [ + + ][ + + ]: 116763 : if ((socket_ptr -> nx_tcp_socket_state < NX_TCP_SYN_SENT) || + 169 [ - + ]: 116749 : (socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSE_WAIT) || + 170 : 116749 : (socket_ptr -> nx_tcp_socket_state >= NX_TCP_CLOSING)) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSING; + tcp_socket.nx_tcp_socket_bound_next = &test_socket; + tcp_socket.nx_tcp_socket_receive_queue_head = NX_NULL; + _nx_tcp_socket_receive(&tcp_socket, &packet_ptr, 0); + + /* Test nx_tcp_server_socket_relisten() + 174 [ + + ][ - + ]: 2078 : if ((socket_ptr -> nx_tcp_socket_bound_next) || + 175 : 2076 : (socket_ptr -> nx_tcp_socket_bind_in_progress)) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + tcp_socket.nx_tcp_socket_bound_next = 0; + tcp_socket.nx_tcp_socket_bind_in_progress = _tx_thread_current_ptr; + _nx_tcp_server_socket_relisten(&ip_0, 80, &tcp_socket); + + /* Test nx_tcp_server_socket_accept(): + 142 [ + + ][ + - ]: 2302 : if ((socket_ptr -> nx_tcp_socket_state != NX_TCP_LISTEN_STATE) && (socket_ptr -> nx_tcp_socket_state != NX_TCP_SYN_RECEIVED)) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_SYN_RECEIVED; + _nx_tcp_server_socket_accept(&tcp_socket, 1); + + + /* Test nx_tcp_socket_state_fin_wait1.c: + 132 [ + + ][ + - ]: 12 : else if ((socket_ptr -> nx_tcp_socket_fin_acked) && + 133 [ + - ]: 1 : (socket_ptr -> nx_tcp_socket_fin_received) && + 134 : 1 : (socket_ptr -> nx_tcp_socket_fin_sequence == socket_ptr -> nx_tcp_socket_rx_sequence)) + */ + + + tcp_socket.nx_tcp_socket_fin_acked = NX_TRUE; + tcp_socket.nx_tcp_socket_fin_received = NX_TRUE; + tcp_socket.nx_tcp_socket_fin_sequence = tcp_socket.nx_tcp_socket_rx_sequence + 1; + _nx_tcp_socket_state_fin_wait1(&tcp_socket); + + + /* + 159 [ + - ]: 1 : if (socket_ptr -> nx_tcp_socket_disconnect_suspended_thread) + 168 [ + - ]: 2 : if (socket_ptr -> nx_tcp_disconnect_callback) + */ + + tcp_socket.nx_tcp_socket_fin_acked = NX_TRUE; + tcp_socket.nx_tcp_socket_fin_received = NX_TRUE; + tcp_socket.nx_tcp_socket_fin_sequence = tcp_socket.nx_tcp_socket_rx_sequence; + tcp_socket.nx_tcp_socket_disconnect_suspended_thread = NX_NULL; + tcp_socket.nx_tcp_disconnect_callback = NX_NULL; + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + _nx_tcp_socket_state_fin_wait1(&tcp_socket); + + /* + 197 [ + + ][ + - ]: 11 : else if ((socket_ptr -> nx_tcp_socket_fin_received) && + 198 : 1 : (socket_ptr -> nx_tcp_socket_fin_sequence == socket_ptr -> nx_tcp_socket_rx_sequence)) + */ + + tcp_socket.nx_tcp_socket_fin_acked = NX_FALSE; + tcp_socket.nx_tcp_socket_fin_received = NX_TRUE; + tcp_socket.nx_tcp_socket_fin_sequence = tcp_socket.nx_tcp_socket_rx_sequence + 1; + _nx_tcp_socket_state_fin_wait1(&tcp_socket); + + /* Test nx_tcp_socket_state_closing.c + 118 [ + - ]: 1 : if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + */ + tcp_header.nx_tcp_header_word_3 = 0; + _nx_tcp_socket_state_closing(&tcp_socket, &tcp_header); + + /* + 122 [ + - ][ + - ]: 1 : if ((tcp_header_ptr -> nx_tcp_acknowledgment_number == socket_ptr -> nx_tcp_socket_tx_sequence) && + 123 : 1 : (tcp_header_ptr -> nx_tcp_sequence_number == socket_ptr -> nx_tcp_socket_rx_sequence)) + */ + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_tx_sequence; + tcp_header.nx_tcp_sequence_number = tcp_socket.nx_tcp_socket_rx_sequence + 1; + _nx_tcp_socket_state_closing(&tcp_socket, &tcp_header); + + tcp_header.nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_tx_sequence + 1; + tcp_header.nx_tcp_sequence_number = tcp_socket.nx_tcp_socket_rx_sequence; + _nx_tcp_socket_state_closing(&tcp_socket, &tcp_header); + + /* + 140 [ + - ]: 1 : if (socket_ptr -> nx_tcp_socket_disconnect_suspended_thread) + 149 [ + - ]: 1 : if (socket_ptr -> nx_tcp_disconnect_callback) + */ + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_tx_sequence; + tcp_header.nx_tcp_sequence_number = tcp_socket.nx_tcp_socket_rx_sequence; + tcp_socket.nx_tcp_socket_disconnect_suspended_thread = NX_NULL; + tcp_socket.nx_tcp_disconnect_callback = NX_NULL; + _nx_tcp_socket_state_closing(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_delete.c: + 136 [ + + ][ + - ]: 2482 : if ((socket_ptr -> nx_tcp_socket_bound_next) || + 137 [ - + ]: 2477 : (socket_ptr -> nx_tcp_socket_bind_in_progress) || + 138 : 2477 : (socket_ptr -> nx_tcp_socket_state != NX_TCP_CLOSED)) + */ + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + tcp_socket.nx_tcp_socket_bound_next = 0; + tcp_socket.nx_tcp_socket_bind_in_progress = NX_FALSE; + tcp_socket.nx_tcp_socket_state = NX_TCP_LISTEN_STATE; + _nx_tcp_socket_delete(&tcp_socket); + + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + tcp_socket.nx_tcp_socket_bound_next = 0; + tcp_socket.nx_tcp_socket_bind_in_progress = tx_thread_identify(); + tcp_socket.nx_tcp_socket_state = NX_TCP_LISTEN_STATE; + _nx_tcp_socket_delete(&tcp_socket); + tcp_socket.nx_tcp_socket_bind_in_progress = TX_NULL; + + /* Test nx_tcp_fast_periodic_processing.c + 216 [ + + ][ + + ]: 2559 : else if (socket_ptr -> nx_tcp_socket_transmit_sent_head || + 217 [ + - ]: 137 : ((socket_ptr -> nx_tcp_socket_tx_window_advertised == 0) && + 218 : 137 : (socket_ptr -> nx_tcp_socket_state <= NX_TCP_CLOSE_WAIT))) + */ + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + tcp_socket.nx_tcp_socket_timeout = _nx_tcp_fast_timer_rate; + tcp_socket.nx_tcp_socket_state = NX_TCP_FIN_WAIT_2; + _nx_tcp_fast_periodic_processing(&ip_0); + + /* Test nx_tcp_fast_periodic_processing.c + 231 [ + + ][ + + ]: 2374 : else if ((socket_ptr -> nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) || + 232 [ - + ]: 2371 : (socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSING) || + 233 : 2371 : (socket_ptr -> nx_tcp_socket_state == NX_TCP_LAST_ACK)) + */ + ip_0.nx_ip_tcp_active_listen_requests = NX_NULL; + tcp_socket.nx_tcp_socket_timeout = _nx_tcp_fast_timer_rate; + tcp_socket.nx_tcp_socket_state = NX_TCP_LAST_ACK; + _nx_tcp_fast_periodic_processing(&ip_0); + + /* Test nx_tcp_fast_periodic_processing.c + 187 [ + + ][ + + ]: 2857 : else if (((socket_ptr -> nx_tcp_socket_timeout_retries >= socket_ptr -> nx_tcp_socket_timeout_max_retries) && + 188 [ + + ]: 2856 : (socket_ptr -> nx_tcp_socket_zero_window_probe_has_data == NX_FALSE)) || + 189 [ + - ]: 4 : ((socket_ptr -> nx_tcp_socket_zero_window_probe_failure >= socket_ptr -> nx_tcp_socket_timeout_max_retries) && + 190 : 4 : (socket_ptr -> nx_tcp_socket_zero_window_probe_has_data == NX_TRUE)) + */ + tcp_socket.nx_tcp_socket_timeout = _nx_tcp_fast_timer_rate; + tcp_socket.nx_tcp_socket_zero_window_probe_failure = tcp_socket.nx_tcp_socket_timeout_max_retries; + _nx_tcp_fast_periodic_processing(&ip_0); + tcp_socket.nx_tcp_socket_zero_window_probe_failure = 0; + + + /* Test nx_tcp_no_connection_reset.c + 227 [ + - ]: 9 : if (tcp_header_ptr -> nx_tcp_header_word_3 & (NX_TCP_SYN_BIT | NX_TCP_FIN_BIT)) + */ + tcp_header.nx_tcp_header_word_3 = 0; + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_ip_version = NX_IP_VERSION_V4; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + _nx_tcp_no_connection_reset(&ip_0, my_packet[0], &tcp_header); + + + /* Test nx_tcp_packet_process.c + 402 [ + - ]: 2261852 : if (socket_ptr -> nx_tcp_socket_connect_ip.nxd_ip_version == packet_ptr -> nx_packet_ip_version) + */ + tcp_socket.nx_tcp_socket_id = NX_TCP_ID; + tcp_socket.nx_tcp_socket_port = 80; + tcp_socket.nx_tcp_socket_connect_port = 6206; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V6; + ip_0.nx_ip_tcp_port_table[80 & NX_TCP_PORT_TABLE_MASK] = &tcp_socket; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + nx_ip_address_set(&ip_0, IP_ADDRESS(192,168,100,4), 0xFFFFFF00); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 409 [ + - ]: 2261688 : if (socket_ptr -> nx_tcp_socket_connect_ip.nxd_ip_address.v4 == *source_ip) + */ + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(192,168,100,20); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + +#ifdef FEATURE_NX_IPV6 + /* Test nx_tcp_packet_process.c + 415 [ + - ]: 164 : else if (CHECK_IPV6_ADDRESSES_SAME(socket_ptr -> nx_tcp_socket_connect_ip.nxd_ip_address.v6, source_ip)) + */ + nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V6; + tcp_socket.nx_tcp_socket_ipv6_addr = &ip_0.nx_ipv6_address[0]; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 442 [ + - ][ + - ]: 1 : if ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) || + 443 : 1 : (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT)) + */ + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[0] = 0xFE800000; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[1] = 0; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[2] = 0; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[3] = 1; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt3[14], sizeof(pkt3) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt3) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + tcp_socket.nx_tcp_socket_port = 80; + tcp_socket.nx_tcp_socket_connect_port = 6206; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V6; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[0] = 0xFE800000; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[1] = 0; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[2] = 0; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v6[3] = 1; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt4[14], sizeof(pkt4) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt4) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); +#endif /* FEATURE_NX_IPV6 */ + + ip_0.nx_ip_tcp_port_table[80 & NX_TCP_PORT_TABLE_MASK] = NX_NULL; + + + /* Test nx_tcp_packet_process.c + 562 [ + + ][ + + ]: 2342 : if (((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) && (*source_ip == *dest_ip) && (source_port == port)) + [ + - ] + 563 : : #ifdef FEATURE_NX_IPV6 + 564 [ + + ][ + + ]: 2342 : || ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && (CHECK_IPV6_ADDRESSES_SAME(source_ip, dest_ip)) && (source_port == port)) + [ + - ] + 565 : : #endif + 566 : : ) + */ + ip_0.nx_ip_tcp_active_listen_requests = ip_0.nx_ip_tcp_available_listen_requests; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt5[14], sizeof(pkt5) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt5) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt6[14], sizeof(pkt6) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt6) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 589 [ + - ]: 2300 : ((*source_ip & NX_IP_CLASS_D_MASK) == NX_IP_CLASS_D_TYPE) || + 591 [ + + ]: 2295 : (((*source_ip & interface_ptr -> nx_interface_ip_network_mask) == interface_ptr -> nx_interface_ip_network) && + 592 [ + + ]: 2299 : ((*source_ip & ~(interface_ptr -> nx_interface_ip_network_mask)) == ~(interface_ptr -> nx_interface_ip_network_mask))) || + 594 [ - + ]: 2298 : (*source_ip == interface_ptr -> nx_interface_ip_network) || + 596 : 2298 : (*source_ip == NX_IP_LIMITED_BROADCAST) + */ + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt7[14], sizeof(pkt7) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt7) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt9[14], sizeof(pkt9) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt9) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 900 [ + - ][ + - ]: 6 : if ((*queued_source_ip == *source_ip) && (queued_source_port == source_port)) + */ + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_port = 80; + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current = 0; + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_socket_ptr = NX_NULL; + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_maximum = 5; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt10[14], sizeof(pkt10) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt10) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt11[14], sizeof(pkt11) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt11) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 677 [ + + ][ + - ]: 2335 : if ((listen_ptr -> nx_tcp_listen_socket_ptr) && + 678 : 2284 : ((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) == NX_NULL)) + */ + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_port = 80; + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_socket_ptr = &tcp_socket; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt8[14], sizeof(pkt8) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt8) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 983 [ + - ]: 7 : if (queued_ptr == listen_ptr -> nx_tcp_listen_queue_tail) + */ + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt14[14], sizeof(pkt14) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt14) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_packet_process.c + 934 [ + + ][ + - ]: 52 : if ((CHECK_IPV6_ADDRESSES_SAME(queued_source_ip, source_ip)) && (queued_source_port == source_port)) + */ + ip_0.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_socket_ptr = NX_NULL; + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt12[14], sizeof(pkt12) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt12) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt13[14], sizeof(pkt13) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt13) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + + /* Test nx_tcp_no_connection_reset: + 227 [ + - ]: 9 : if (tcp_header_ptr -> nx_tcp_header_word_3 & (NX_TCP_SYN_BIT | NX_TCP_FIN_BIT)) + */ + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt8[14], sizeof(pkt8) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt8) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + tcp_header.nx_tcp_header_word_3 = 0; + _nx_tcp_no_connection_reset(&ip_0, packet_ptr, &tcp_header); + /* Do not release this packet. We will reuse it in the next test case. */ + + /* Test nx_tcp_server_socket_relisten.c: + 187 : 2076 : listen_ptr = ip_ptr -> nx_ip_tcp_active_listen_requests; + 188 [ + - ]: 2076 : if (listen_ptr) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + tcp_socket.nx_tcp_socket_bind_in_progress = 0; + ip_0.nx_ip_tcp_active_listen_requests = NX_NULL; + _nx_tcp_server_socket_relisten(&ip_0, 80, &tcp_socket); + + /* + 246 [ + - ]: 9 : if (packet_ptr == listen_ptr -> nx_tcp_listen_queue_tail) + */ + + ip_0.nx_ip_tcp_active_listen_requests = &tcp_listen[0]; + tcp_listen[0].nx_tcp_listen_next = NX_NULL; + tcp_listen[0].nx_tcp_listen_port = 80; + tcp_listen[0].nx_tcp_listen_socket_ptr = NX_NULL; + tcp_listen[0].nx_tcp_listen_queue_current = 1; + tcp_listen[0].nx_tcp_listen_queue_head = packet_ptr; + tcp_listen[0].nx_tcp_listen_queue_tail = NX_NULL; + tcp_listen[0].nx_tcp_listen_callback = NX_NULL; + packet_ptr -> nx_packet_queue_next = NX_NULL; + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = 0; + _nx_tcp_server_socket_relisten(&ip_0, 80, &tcp_socket); + + /* 262 [ + - ]: 9 : if (option_words > 0) */ + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt8[14], sizeof(pkt8) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt8) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_address.nx_packet_interface_ptr = NX_NULL; + tcp_header.nx_tcp_header_word_3 = 0; + + ip_0.nx_ip_tcp_active_listen_requests = &tcp_listen[0]; + tcp_listen[0].nx_tcp_listen_next = NX_NULL; + tcp_listen[0].nx_tcp_listen_port = 80; + tcp_listen[0].nx_tcp_listen_socket_ptr = NX_NULL; + tcp_listen[0].nx_tcp_listen_queue_current = 1; + tcp_listen[0].nx_tcp_listen_queue_head = packet_ptr; + tcp_listen[0].nx_tcp_listen_queue_tail = NX_NULL; + tcp_listen[0].nx_tcp_listen_callback = NX_NULL; + packet_ptr -> nx_packet_queue_next = NX_NULL; + tcp_header_ptr = (NX_TCP_HEADER*)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_SYN_BIT | (5 << 28); + _nx_tcp_server_socket_relisten(&ip_0, 80, &tcp_socket); + + ip_0.nx_ip_tcp_active_listen_requests = NX_NULL; + + + /* Test _nx_tcp_socket_state_transmit_check() */ + /* Hit condition: + 169 [ + + ][ + - ]: 332 : if ((tx_window_current) && + 170 : 262 : (socket_ptr -> nx_tcp_socket_transmit_sent_count < socket_ptr -> nx_tcp_socket_transmit_queue_maximum)) */ + /* suspension list is set to NULL. */ + tcp_socket.nx_tcp_socket_transmit_suspension_list = &thread_test1; + tcp_socket.nx_tcp_socket_tx_window_advertised = 100; + tcp_socket.nx_tcp_socket_tx_window_congestion = 100; + tcp_socket.nx_tcp_socket_transmit_sent_count = 10; + tcp_socket.nx_tcp_socket_transmit_queue_maximum = 5; + _nx_tcp_socket_state_transmit_check(&tcp_socket); + tcp_socket.nx_tcp_socket_transmit_suspension_list = TX_NULL; + tcp_socket.nx_tcp_socket_tx_window_advertised = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 0; + tcp_socket.nx_tcp_socket_transmit_sent_count = 0; + tcp_socket.nx_tcp_socket_transmit_queue_maximum = 0x14; + + /* Test _nx_tcp_socket_state_transmit_check() */ + /* Hit condition of if (socket_ptr -> nx_tcp_socket_duplicated_ack_received == 2) */ + tcp_socket.nx_tcp_socket_transmit_suspension_list = &thread_test1; + tcp_socket.nx_tcp_socket_tx_window_congestion = 100; + tcp_socket.nx_tcp_socket_tx_window_advertised = tcp_socket.nx_tcp_socket_tx_window_congestion + 10; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 2; + tcp_socket.nx_tcp_socket_transmit_sent_count = 10; + tcp_socket.nx_tcp_socket_transmit_queue_maximum = 5; + _nx_tcp_socket_state_transmit_check(&tcp_socket); + tcp_socket.nx_tcp_socket_duplicated_ack_received = 0; + _nx_tcp_socket_state_transmit_check(&tcp_socket); + tcp_socket.nx_tcp_socket_transmit_suspension_list = TX_NULL; + tcp_socket.nx_tcp_socket_tx_window_advertised = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 0; + tcp_socket.nx_tcp_socket_transmit_sent_count = 0; + tcp_socket.nx_tcp_socket_transmit_queue_maximum = 0x14; + + + /* Test nx_tcp_server_socket_accept(): + 222 [ + + ][ + - ]: 2302 : if ((wait_option) && (_tx_thread_current_ptr != &(ip_ptr -> nx_ip_thread))) + */ + ip_0.nx_ip_tcp_queue_process = my_tcp_queue_process; + + /* Wakeup IP thread for processing one or more messages in the TCP queue. */ + tx_event_flags_set(&(ip_0.nx_ip_events), NX_IP_TCP_EVENT, TX_OR); + + /* Let IP thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + ip_0.nx_ip_tcp_queue_process = _nx_tcp_queue_process; + + + + /* Test _nx_tcp_server_socket_relisten(): + 262 [ + - ]: 9 : if (option_words > 0) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + /* Skip ipv4 header. */ + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr; + ipv4_header_ptr = (NX_IPV4_HEADER *)my_packet[0] -> nx_packet_ip_header; + ipv4_header_ptr -> nx_ip_header_source_ip = 0x01020305; + ipv4_header_ptr -> nx_ip_header_destination_ip = 0x01020304; + my_packet[0] -> nx_packet_prepend_ptr += 20; + my_packet[0] -> nx_packet_ip_version = NX_IP_VERSION_V4; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_0 = (0x1235 << NX_SHIFT_BY_16) | 0x1234; + tcp_header_ptr -> nx_tcp_acknowledgment_number = 1; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_HEADER_SIZE | NX_TCP_SYN_BIT | tcp_socket.nx_tcp_socket_rx_window_current; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + tcp_listen[0].nx_tcp_listen_port = 0x1234; + tcp_listen[0].nx_tcp_listen_socket_ptr = NX_NULL; + tcp_listen[0].nx_tcp_listen_queue_current = 1; + tcp_listen[0].nx_tcp_listen_queue_head = my_packet[0]; + tcp_listen[0].nx_tcp_listen_queue_tail = my_packet[0]; + ip_0.nx_ip_tcp_active_listen_requests = &tcp_listen[0]; + _nx_tcp_server_socket_relisten(&ip_0, 0x1234, &tcp_socket); + ip_0.nx_ip_tcp_active_listen_requests = NX_NULL; + ip_0.nx_ip_tcp_port_table[6] = NX_NULL; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + tcp_socket.nx_tcp_socket_bound_previous = NX_NULL; + ip_0.nx_ip_tcp_active_listen_requests = NX_NULL; + + + /* Test _nx_tcp_socket_retransmit() */ + /* Hit condition: + 212 [ + - ][ + - ]: 159 : while (packet_ptr && (packet_ptr -> nx_packet_queue_next == (NX_PACKET *)NX_DRIVER_TX_DONE)) + */ + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + _nx_tcp_socket_retransmit(&ip_0, &tcp_socket, NX_FALSE); + + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + tcp_socket.nx_tcp_socket_transmit_sent_head = my_packet[0]; + my_packet[0] -> nx_packet_queue_next = NX_NULL; + _nx_tcp_socket_retransmit(&ip_0, &tcp_socket, NX_FALSE); + nx_packet_release(my_packet[0]); + + /* Hit condition: + 315 [ + + ][ + - ]: 158 : if ((header_ptr -> nx_tcp_acknowledgment_number == original_acknowledgment_number) && + 316 [ + + ]: 152 : (header_ptr -> nx_tcp_header_word_3 == original_header_word_3) && + 317 : 152 : (header_ptr -> nx_tcp_header_word_4 == original_header_word_4)) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_0 = (0x1235 << NX_SHIFT_BY_16) | 0x1234; + tcp_header_ptr -> nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_rx_sequence; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_HEADER_SIZE | NX_TCP_SYN_BIT | tcp_socket.nx_tcp_socket_rx_window_current; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + tcp_socket.nx_tcp_socket_transmit_sent_head = my_packet[0]; + my_packet[0] -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + _nx_tcp_socket_retransmit(&ip_0, &tcp_socket, NX_FALSE); + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *) NX_PACKET_ALLOCATED; + nx_packet_release(my_packet[0]); + + /* Hit condition: + 355 [ + + ][ + + ]: 488 : if ((header_ptr -> nx_tcp_acknowledgment_number == original_acknowledgment_number) && + 356 [ + - ]: 462 : (header_ptr -> nx_tcp_header_word_3 == original_header_word_3) && + 357 : 462 : (header_ptr -> nx_tcp_header_word_4 == original_header_word_4)) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_0 = (0x1235 << NX_SHIFT_BY_16) | 0x1234; + tcp_header_ptr -> nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_rx_sequence; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_HEADER_SIZE | NX_TCP_ACK_BIT | NX_TCP_PSH_BIT | tcp_socket.nx_tcp_socket_rx_window_current; + tcp_header_ptr -> nx_tcp_header_word_4 = 0xFFFF0000; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + tcp_socket.nx_tcp_socket_transmit_sent_head = my_packet[0]; + my_packet[0] -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + _nx_tcp_socket_retransmit(&ip_0, &tcp_socket, NX_FALSE); + my_packet[0] -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *) NX_PACKET_ALLOCATED; + nx_packet_release(my_packet[0]); + + + + /* Test _nx_tcp_socket_receive() */ + /* Hit condition: + 262 [ + + ][ + + ]: 19398 : if (((socket_ptr -> nx_tcp_socket_rx_window_current - socket_ptr -> nx_tcp_socket_rx_window_last_sent) >= (socket_ptr -> nx_tcp_socket_rx_window_default / 2)) && + 263 [ + - ][ - + ]: 3 : ((socket_ptr -> nx_tcp_socket_state == NX_TCP_ESTABLISHED) || (socket_ptr -> nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) || (socket_ptr -> nx_tcp_socket_state == NX_TCP_FIN_WAIT_2))) + */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_queue_next = ((NX_PACKET *)NX_PACKET_READY); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_0 = (0x1235 << NX_SHIFT_BY_16) | 0x1234; + tcp_header_ptr -> nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_rx_sequence; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_HEADER_SIZE | NX_TCP_SYN_BIT | tcp_socket.nx_tcp_socket_rx_window_current; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + tcp_socket.nx_tcp_socket_state = NX_TCP_FIN_WAIT_1; + tcp_socket.nx_tcp_socket_receive_queue_head = my_packet[0]; + tcp_socket.nx_tcp_socket_bound_next = &test_socket; + tcp_socket.nx_tcp_socket_receive_queue_count ++; + tcp_socket.nx_tcp_socket_rx_window_last_sent = 0; + _nx_tcp_socket_receive(&tcp_socket, &packet_ptr, NX_NO_WAIT); + nx_packet_release(packet_ptr); + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_queue_next = ((NX_PACKET *)NX_PACKET_READY); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_0 = (0x1235 << NX_SHIFT_BY_16) | 0x1234; + tcp_header_ptr -> nx_tcp_acknowledgment_number = tcp_socket.nx_tcp_socket_rx_sequence; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_HEADER_SIZE | NX_TCP_SYN_BIT | tcp_socket.nx_tcp_socket_rx_window_current; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + tcp_socket.nx_tcp_socket_state = NX_TCP_FIN_WAIT_2; + tcp_socket.nx_tcp_socket_receive_queue_head = my_packet[0]; + tcp_socket.nx_tcp_socket_bound_next = &test_socket; + tcp_socket.nx_tcp_socket_receive_queue_count ++; + tcp_socket.nx_tcp_socket_rx_window_last_sent = 0; + _nx_tcp_socket_receive(&tcp_socket, &packet_ptr, NX_NO_WAIT); + nx_packet_release(packet_ptr); + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + + + + /* Test _nx_tcp_socket_send_internal() */ + +#ifndef NX_DISABLE_PACKET_CHAIN + /* Hit condition: + 377 [ + + ][ + + ]: 125717 : else if ((packet_ptr -> nx_packet_next != NX_NULL) && + 378 [ + - ]: 6631 : ((packet_ptr -> nx_packet_length + data_offset) < pool_ptr -> nx_packet_pool_payload_size) && + 379 : 6631 : (pool_ptr -> nx_packet_pool_available > 0)) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 40; + nx_packet_allocate(&pool_0, &my_packet[1], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[1] -> nx_packet_append_ptr = my_packet[1] -> nx_packet_prepend_ptr + 20; + my_packet[1] -> nx_packet_length = 20; + my_packet[0] -> nx_packet_next = my_packet[1]; + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + packet_counter = pool_0.nx_packet_pool_available; + pool_0.nx_packet_pool_available = 0; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + _nx_tcp_socket_send_internal(&tcp_socket, my_packet[0], 1); + pool_0.nx_packet_pool_available = packet_counter; + + + /* Hit condition: + 391 [ + - ][ + + ]: 5 : while ((current_packet != NX_NULL) && (current_packet -> nx_packet_prepend_ptr == current_packet -> nx_packet_append_ptr)) + + 399 [ - + ]: 2 : NX_ASSERT(current_packet != NX_NULL); + */ + +#ifndef NX_DISABLE_ASSERT + /* Create the assert thread. */ + tx_thread_create(&thread_for_assert_1, "Assert Test thread", thread_for_assert_entry_1, 0, + stack_for_assert_1, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Let test thread run. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Terminate the test thread. */ + tx_thread_terminate(&thread_for_assert_1); + tx_thread_delete(&thread_for_assert_1); +#endif /* NX_DISABLE_ASSERT */ + + + /* Hit condition: + 454 [ + - ]: 1 : if (preempted == NX_TRUE) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 40; + tcp_socket.nx_tcp_socket_tx_window_advertised = tcp_socket.nx_tcp_socket_tx_outstanding_bytes + 30; + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + packet_counter = pool_0.nx_packet_pool_available; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + packet_counter = pool_0.nx_packet_pool_available; + pool_0.nx_packet_pool_available = 0; + _nx_tcp_socket_send_internal(&tcp_socket, my_packet[0], 1); + pool_0.nx_packet_pool_available = packet_counter; + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + + /* Hit condition: + 490 [ + - ]: 2 : if (preempted == NX_TRUE) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr; + my_packet[0] -> nx_packet_length = 40; + tcp_socket.nx_tcp_socket_tx_window_advertised = tcp_socket.nx_tcp_socket_tx_outstanding_bytes + 30; + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + packet_counter = pool_0.nx_packet_pool_available; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + _nx_tcp_socket_send_internal(&tcp_socket, my_packet[0], 0); + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + + /* Hit condition: + 550 [ + - ]: 1 : if (preempted == NX_TRUE) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr; + my_packet[0] -> nx_packet_length = 400; + nx_packet_allocate(&pool_0, &my_packet[1], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[1] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_data_end; + my_packet[1] -> nx_packet_length = 200; + my_packet[0] -> nx_packet_next = my_packet[1]; + nx_packet_allocate(&pool_0, &my_packet[2], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[2] -> nx_packet_append_ptr = my_packet[2] -> nx_packet_data_end; + my_packet[2] -> nx_packet_length = 200; + my_packet[1] -> nx_packet_next = my_packet[2]; + tcp_socket.nx_tcp_socket_tx_window_advertised = tcp_socket.nx_tcp_socket_tx_outstanding_bytes + 300; + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + packet_counter = pool_0.nx_packet_pool_available; + pool_0.nx_packet_pool_available = 1; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + tcp_socket.nx_tcp_socket_connect_mss = 536; + tcp_socket.nx_tcp_socket_tx_window_congestion = 536; + _nx_tcp_socket_send_internal(&tcp_socket, my_packet[0], 0); + pool_0.nx_packet_pool_available = packet_counter; + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + tcp_socket.nx_tcp_socket_connect_mss = 216; +#endif /* NX_DISABLE_PACKET_CHAIN */ + + /* Hit condition: + 344 [ - + ]: 10 : if (tx_window_current > socket_ptr -> nx_tcp_socket_tx_window_advertised) + */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_TCP_PACKET, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 20; + my_packet[0] -> nx_packet_length = 20; + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + tcp_socket.nx_tcp_socket_tx_window_congestion = 100; + tcp_socket.nx_tcp_socket_tx_window_advertised = 200; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 2; + tcp_socket.nx_tcp_socket_connect_mss = 0x218; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + _nx_tcp_socket_send_internal(&tcp_socket, my_packet[0], 1); + tcp_socket.nx_tcp_socket_tx_window_congestion = 0x218; + tcp_socket.nx_tcp_socket_tx_window_advertised = 0xffff; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 0; + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + + /* Test nx_tcp_socket_state_ack_check.c */ + ack_check_test(); + + /* Test nx_tcp_socket_state_data_check.c */ + data_check_test(); + + /* Test nx_tcp_socket_packet_process.c */ + socket_packet_process_test(); +#endif + + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER) +{ +} + +#ifdef __PRODUCT_NETXDUO__ +static VOID tcp_fast_periodic_processing(NX_IP *ip_ptr) +{ +NXD_ADDRESS server_ip; +UINT status; + + /* Check the flag. */ + if (disconnect_flag == NX_FALSE) + { + + /* Update the flag. */ + disconnect_flag = NX_TRUE; + + /* Set the condition. */ + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_next_hop_address = IP_ADDRESS(1, 2, 3, 5); + _nx_tcp_socket_disconnect(&tcp_socket, 1); + + /* Recover. */ + ip_0.nx_ip_tcp_fast_periodic_processing = _nx_tcp_fast_periodic_processing; + + /* Connect to addrss not reachable. */ + server_ip.nxd_ip_version = NX_IP_VERSION_V4; + server_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 6); + status = nxd_tcp_client_socket_connect(&tcp_socket_2, &server_ip, 80, 1); + if (status != NX_IN_PROGRESS) + { + error_counter++; + } + } +} + +static VOID my_tcp_queue_process(NX_IP *ip_ptr) +{ +NX_PACKET *packet_ptr; + + /* Test nx_tcp_server_socket_accept(): + 222 [ + + ][ + - ]: 2302 : if ((wait_option) && (_tx_thread_current_ptr != &(ip_ptr -> nx_ip_thread))) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_SYN_RECEIVED; + _nx_tcp_server_socket_accept(&tcp_socket, 1); + + + /* Test _nx_tcp_socket_receive() */ + /* + 283 [ + + ][ + - ]: 118586 : else if ((wait_option) && (_tx_thread_current_ptr != &(ip_ptr -> nx_ip_thread))) + */ + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_receive_queue_head = NX_NULL; + tcp_socket.nx_tcp_socket_bound_next = &test_socket; + _nx_tcp_socket_receive(&tcp_socket, &packet_ptr, 1); + tcp_socket.nx_tcp_socket_bound_next = NX_NULL; + + + /* Test _nx_tcp_socket_send_internal() */ + /* Hit condition: + 867 [ + + ][ + - ]: 281 : else if ((wait_option) && (_tx_thread_current_ptr != &(ip_ptr -> nx_ip_thread))) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 20; + packet_ptr -> nx_packet_length = 20; + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + _nx_tcp_socket_send_internal(&tcp_socket, packet_ptr, 1); + tcp_socket.nx_tcp_socket_connect_mss = 216; + nx_packet_release(packet_ptr); +} + + +static VOID ack_check_test() +{ +NX_TCP_HEADER tcp_header; +NX_TCP_HEADER *tcp_header_ptr; +NX_PACKET *packet_ptr; + + /* Test nx_tcp_socket_state_ack_check.c + 283 [ + - ][ + - ]: 14 : else if ((socket_ptr -> nx_tcp_socket_tx_window_congestion > socket_ptr -> nx_tcp_socket_connect_mss) && + 284 : 28 : ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - (socket_ptr -> nx_tcp_socket_previous_highest_ack + + 285 : 14 : (socket_ptr -> nx_tcp_socket_connect_mss << 2))) < 0)) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 1; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 2; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_tx_sequence = 20; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 1; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 2; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1500; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_previous_highest_ack = 0xFFFF0000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_tx_sequence = 20; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_state_ack_check.c + 295 [ + + ][ + - ]: 38 : else if ((socket_ptr -> nx_tcp_socket_duplicated_ack_received > 3) && + 296 : 1 : (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE)) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 1; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 4; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_fast_recovery = NX_FALSE; + tcp_socket.nx_tcp_socket_tx_sequence = 20; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_state_ack_check.c + 295 [ + + ][ - + ]: 38 : else if ((socket_ptr -> nx_tcp_socket_duplicated_ack_received > 3) && + 296 : 1 : (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE)) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 1; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 4; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_fast_recovery = NX_TRUE; + tcp_socket.nx_tcp_socket_tx_sequence = 20; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + + /* Test nx_tcp_socket_state_ack_check.c + 727 [ + + ][ + - ]: 44949 : if ((socket_ptr -> nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) || + 728 [ + + ]: 44892 : (socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSING) || + 729 : 44892 : (socket_ptr -> nx_tcp_socket_state == NX_TCP_LAST_ACK)) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 0; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 4; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_tail = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSING; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_state_ack_check.c + 479 [ - + ]: 12 : if (tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence) + 480 : : { + 481 : : + 482 : : / * ACK does not cover the search packet. Break out of the loop. * / + 483 : 0 : break; + 484 : : } + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + packet_ptr -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0xEEEEEEEE; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 4; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 0; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_fast_recovery = NX_FALSE; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_state_ack_check.c + 500 [ + - ]: 9 : if (tcp_header_ptr -> nx_tcp_acknowledgment_number >= starting_tx_sequence) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + packet_ptr -> nx_packet_length = 10; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0xFFFFFFF0; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 4; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 0; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_fast_recovery = NX_FALSE; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_state_ack_check.c + 679 [ + + ][ - + ]: 164665 : if ((((INT)tcp_header_ptr -> nx_tcp_acknowledgment_number - (INT)starting_tx_sequence > 0) && + 680 [ + + ]: 125179 : ((INT)tcp_header_ptr -> nx_tcp_acknowledgment_number - (INT)ending_tx_sequence <= 0)) || + 681 [ + + ]: 118418 : ((INT)tcp_header_ptr -> nx_tcp_sequence_number - (INT)ending_rx_sequence > 0) || + 682 [ + + ]: 112183 : (((INT)tcp_header_ptr -> nx_tcp_sequence_number == (INT)ending_rx_sequence) && + 683 : 112183 : ((INT)tcp_header_ptr -> nx_tcp_acknowledgment_number - (INT)starting_tx_sequence >= 0))) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = NX_IP_VERSION_V4; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + packet_ptr -> nx_packet_length = 10; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_acknowledgment_number = 20; + tcp_socket.nx_tcp_socket_tx_sequence = 4; + tcp_socket.nx_tcp_socket_duplicated_ack_received = 0; + tcp_socket.nx_tcp_socket_tx_sequence_recover = 0; + tcp_socket.nx_tcp_socket_tx_window_congestion = 1000; + tcp_socket.nx_tcp_socket_connect_mss = 1460; + tcp_socket.nx_tcp_socket_transmit_sent_head = packet_ptr; + tcp_socket.nx_tcp_socket_transmit_sent_count = 1; + tcp_socket.nx_tcp_socket_fast_recovery = NX_FALSE; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 20; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); + + /* Test nx_tcp_socket_state_ack_check.c + [+ -] 114 if (search_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_queue_next = (NX_PACKET *)NX_DRIVER_TX_DONE; + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_ip_version = 0; + packet_ptr -> nx_packet_ip_header = packet_ptr -> nx_packet_prepend_ptr - 20; + packet_ptr -> nx_packet_length = 10; + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + tcp_header.nx_tcp_sequence_number = 0; + tcp_header.nx_tcp_acknowledgment_number = 0; + tcp_socket.nx_tcp_socket_tx_sequence = 4; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 0; + tcp_socket.nx_tcp_socket_receive_queue_tail = packet_ptr; + _nx_tcp_socket_state_ack_check(&tcp_socket, &tcp_header); +} + +static VOID data_check_test() +{ +NX_TCP_HEADER *tcp_header_ptr; +NX_PACKET *packet_ptr; + + /* Test nx_tcp_socket_state_data_check.c + 729 [ + - ]: 185 : while (search_ptr) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = NX_NULL; + packet_ptr -> nx_packet_length = 30; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = 0x50000000; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_socket.nx_tcp_socket_receive_queue_head = packet_ptr; + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_length = 30; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = 0x50000000; + tcp_header_ptr -> nx_tcp_sequence_number = 20; + tcp_socket.nx_tcp_socket_rx_sequence = 0; + _nx_tcp_socket_state_data_check(&tcp_socket, packet_ptr); + +} + +static VOID socket_packet_process_test() +{ +NX_TCP_HEADER *tcp_header_ptr; +NX_PACKET *packet_ptr; + + /* Test nx_tcp_socket_packet_process.c + 210 [ + + ][ + + ]: 3 : else if ((tcp_header_copy.nx_tcp_header_word_3 & NX_TCP_RST_BIT) || + 211 [ + - ]: 1 : (tcp_header_copy.nx_tcp_header_word_3 & NX_TCP_URG_BIT) || + 212 : 1 : ((tcp_header_copy.nx_tcp_header_word_3 & NX_TCP_CONTROL_MASK) == NX_TCP_ACK_BIT)) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = 0x50000000; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_socket.nx_tcp_socket_rx_window_current = 0; + tcp_socket.nx_tcp_socket_rx_sequence = 1; + tcp_socket.nx_tcp_socket_state = NX_TCP_TIMED_WAIT; + _nx_tcp_socket_packet_process(&tcp_socket, packet_ptr); + + + /* Test nx_tcp_socket_packet_process.c + 229 [ + + ][ + + ]: 136515 : if ((rx_window > 0) && + 230 [ - + ]: 136280 : ((((INT)packet_sequence - (INT)rx_sequence >= 0) && + 231 [ + + ]: 134 : ((INT)rx_sequence + (INT)rx_window - (INT)packet_sequence > 0)) || + 232 [ + - ]: 10 : (((INT)packet_sequence + ((INT)packet_data_length - 1) - (INT)rx_sequence >= 0) && + 233 : 10 : ((INT)rx_sequence + 1 + ((INT)rx_window - (INT)packet_sequence) - (INT)packet_data_length > 0)))) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_length = 30; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = 0x50000000; + tcp_header_ptr -> nx_tcp_sequence_number = 2; + tcp_socket.nx_tcp_socket_rx_window_current = 1; + tcp_socket.nx_tcp_socket_rx_sequence = 1; + tcp_socket.nx_tcp_socket_state = NX_TCP_TIMED_WAIT; + _nx_tcp_socket_packet_process(&tcp_socket, packet_ptr); + + /* Test nx_tcp_socket_packet_process.c + 452 [ + - ]: 1 : if (urgent_callback) + */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 0); + packet_ptr -> nx_packet_length = 20; + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_3 = 0x50000000 | NX_TCP_URG_BIT | NX_TCP_ACK_BIT; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_socket.nx_tcp_socket_rx_window_current = 0; + tcp_socket.nx_tcp_socket_rx_sequence = 0; + tcp_socket.nx_tcp_socket_state = NX_TCP_TIMED_WAIT; + tcp_socket.nx_tcp_socket_receive_queue_tail = NX_NULL; + _nx_tcp_socket_packet_process(&tcp_socket, packet_ptr); +} + +#if defined FEATURE_NX_IPV6 && !defined NX_DISABLE_ASSERT +static VOID thread_for_assert_entry_0(ULONG thread_input) +{ +NXD_ADDRESS server_ip; +UINT status; + + /* Connect to addrss not reachable. */ + server_ip.nxd_ip_version = NX_IP_VERSION_V6; + server_ip.nxd_ip_address.v6[0] = 0xFE800000; + server_ip.nxd_ip_address.v6[1] = 0; + server_ip.nxd_ip_address.v6[2] = 0; + server_ip.nxd_ip_address.v6[3] = 0x1; + ip_0.nx_ipv6_address[address_index].nxd_ipv6_address_attached = NX_NULL; + status = nxd_tcp_client_socket_connect(&tcp_socket, &server_ip, 80, 0); + if (status != NX_INVALID_INTERFACE) + { + error_counter++; + } +} +#endif /* NX_DISABLE_ASSERT */ + +#if !defined NX_DISABLE_PACKET_CHAIN && !defined NX_DISABLE_ASSERT +static VOID thread_for_assert_entry_1(ULONG thread_input) +{ +NX_PACKET *test_packet; + + /* Hit condition: + 391 [ + - ][ + + ]: 5 : while ((current_packet != NX_NULL) && (current_packet -> nx_packet_prepend_ptr == current_packet -> nx_packet_append_ptr)) + + 399 [ - + ]: 2 : NX_ASSERT(current_packet != NX_NULL); + */ + nx_packet_allocate(&pool_0, &test_packet, NX_TCP_PACKET, NX_NO_WAIT); + if (nx_tcp_socket_send(&tcp_socket, test_packet, 0) != NX_INVALID_PACKET) + { + error_counter++; + } + + test_packet -> nx_packet_length = 10; + nx_tcp_socket_send(&tcp_socket, test_packet, 0); +} +#endif + +#endif /* __PRODUCT_NETXDUO__ */ +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_branch_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Branch Test...........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_chained_packet_test.c b/test/regression/netxduo_test/netx_tcp_chained_packet_test.c new file mode 100644 index 00000000..3d74387c --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_chained_packet_test.c @@ -0,0 +1,295 @@ +/* This NetX test concentrates on the chained packet of TCP transmission. */ +/* Window size is 1200 bytes. Payload size of pool is 512. Host A sends 2000 bytes. */ + +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static UCHAR send_buff[3000]; +static UCHAR recv_buff[3000]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_chained_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +UINT i; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = i & 0xFF; + recv_buff[i] = 0xFF - (i & 0xFF); + } + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Chained Packet Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), + &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG total_length = 0; +ULONG bytes_copied; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1202, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 3 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Retrieve data. */ + nx_packet_data_retrieve(packet_ptr, recv_buff + total_length, &bytes_copied); + total_length += bytes_copied; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check received data. */ + if (total_length != sizeof(send_buff)) + error_counter++; + else if (memcmp(send_buff, recv_buff, sizeof(send_buff)) != 0) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_chained_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Chained Packet Test...................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_client_bind_cleanup_test.c b/test/regression/netxduo_test/netx_tcp_client_bind_cleanup_test.c new file mode 100644 index 00000000..44f6a26b --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_client_bind_cleanup_test.c @@ -0,0 +1,305 @@ +/* This NetX test concentrates on the TCP Client Bind Cleanup operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; +static NX_TCP_SOCKET client_socket_2; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_client_bind_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Client Bind Cleanup Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket 0. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket 1. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket 2. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_2, "Client Socket 2", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_0.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_1.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_2.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Bind the client_socket_0 port to 12. */ + status = nx_tcp_client_socket_bind(&client_socket_0, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_0.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_1.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_2.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Bind the client_socket_1 port to same port. */ + status = nx_tcp_client_socket_bind(&client_socket_1, 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PORT_UNAVAILABLE) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_0.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_1.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_2.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Unbind the socket 0. */ + status = nx_tcp_client_socket_unbind(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket 1. */ + status = nx_tcp_client_socket_unbind(&client_socket_1); + + /* Check for error. */ + if (status != NX_NOT_BOUND) + error_counter++; + + /* Unbind the socket 2. */ + status = nx_tcp_client_socket_unbind(&client_socket_2); + + /* Check for error. */ + if (status != NX_NOT_BOUND) + error_counter++; + + /* Delete the socket 0. */ + status = nx_tcp_socket_delete(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 1. */ + status = nx_tcp_socket_delete(&client_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 2. */ + status = nx_tcp_socket_delete(&client_socket_2); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the error counter. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* Check the TCP socket bind suspended count. */ + if (client_socket_0.nx_tcp_socket_bind_suspended_count != 1) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_1.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_2.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Bind the client_socket_3 port to same port. */ + status = nx_tcp_client_socket_bind(&client_socket_2, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PORT_UNAVAILABLE) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_0.nx_tcp_socket_bind_suspended_count != 1) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_1.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_2.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_2_entry(ULONG thread_input) +{ + + /* Check the TCP socket bind suspended count. */ + if (client_socket_0.nx_tcp_socket_bind_suspended_count != 2) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_1.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket_2.nx_tcp_socket_bind_suspended_count != 0) + error_counter++; +} + diff --git a/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c b/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c new file mode 100644 index 00000000..31efaec0 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c @@ -0,0 +1,333 @@ +/* This NetX test concentrates TCP client packet leak issue + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-144. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_client_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG tcp_transmit_window; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Packet Leak Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create the client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Disconnect from server. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Connect to server again without unbind. */ + nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unbind the client socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Create the server socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Listen the socket. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Accept connection from client. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + packet_ptr -> nx_packet_length = 28; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + /* Disconnect from client. */ + status = nx_tcp_socket_disconnect(&server_socket, 5); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + nx_tcp_server_socket_unaccept(&server_socket); + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_client_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Packet Leak Test......................................N/A\n"); + + test_control_return(3); + +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_tcp_client_socket_bind_test.c b/test/regression/netxduo_test/netx_tcp_client_socket_bind_test.c new file mode 100644 index 00000000..ff39e547 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_client_socket_bind_test.c @@ -0,0 +1,206 @@ +/* This NetX test concentrates on the TCP free port find operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_TCP_SOCKET socket_0; +static NX_TCP_SOCKET my_socket[NX_MAX_PORT - NX_SEARCH_PORT_START + 1]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* The 2 ports will hashed to the same index. */ +#define CLIENT_PORT_1 0x00000100 +#define CLIENT_PORT_2 0x00008100 + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_client_socket_bind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&ip_0); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT free_port; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Clinet Socket Bind Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket. */ + status = nx_tcp_socket_create(&ip_0, &socket_0, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_0, CLIENT_PORT_1, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* CLIENT_PORT_1 has been bound. */ + status = nx_tcp_free_port_find(&ip_0, CLIENT_PORT_1, &free_port); + if((status != NX_SUCCESS) && (free_port != CLIENT_PORT_1 + 1)) + error_counter++; + + /* CLIENT_PORT_2 and CLIENT_PORT_1 are mapped to the same index. */ + status = nx_tcp_free_port_find(&ip_0, CLIENT_PORT_2, &free_port); + if ((status != NX_SUCCESS) || (free_port != CLIENT_PORT_2)) + error_counter++; + + /* Unbind the TCP socket. */ + status = nx_tcp_client_socket_unbind(&socket_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Test port wrap around. */ + status = nx_tcp_client_socket_bind(&socket_0, NX_MAX_PORT, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_tcp_free_port_find(&ip_0, NX_MAX_PORT, &free_port); + if ((status != NX_SUCCESS) || (free_port != NX_SEARCH_PORT_START)) + error_counter++; + + /* Unbind the TCP socket. */ + status = nx_tcp_client_socket_unbind(&socket_0); + if (status != NX_SUCCESS) + error_counter++; + + for(i = 0; i <= (NX_MAX_PORT - NX_SEARCH_PORT_START); i++) + { + + /* Create a TCP socket. */ + status = nx_tcp_socket_create(&ip_0, &my_socket[i], "Socket Array", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_client_socket_bind(&my_socket[i], i + NX_SEARCH_PORT_START, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_0, NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status != NX_NO_FREE_PORTS) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&socket_0, NX_SEARCH_PORT_START, NX_NO_WAIT); + + /* Check for error. */ + if(status != NX_PORT_UNAVAILABLE) + error_counter++; + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&socket_0); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + diff --git a/test/regression/netxduo_test/netx_tcp_client_socket_port_get_test.c b/test/regression/netxduo_test/netx_tcp_client_socket_port_get_test.c new file mode 100644 index 00000000..ffa17584 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_client_socket_port_get_test.c @@ -0,0 +1,179 @@ +/* This NetX test concentrates on the fast disconnect TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_client_socket_port_get_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; +UINT compare_port; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Client Socket Port Get Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket before port bind. */ + status = nx_tcp_client_socket_port_get(&client_socket, &compare_port); + + /* Check for error. */ + if (status != NX_NOT_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&client_socket, &compare_port); + + /* Check for error. */ + if ((status) || (client_port != compare_port)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_client_socket_unbind_test.c b/test/regression/netxduo_test/netx_tcp_client_socket_unbind_test.c new file mode 100644 index 00000000..00548f10 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_client_socket_unbind_test.c @@ -0,0 +1,193 @@ +/* This NetX test concentrates on the TCP Client Bind Cleanup operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_client_socket_unbind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Client Socket Unbind Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket 0. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the client_socket_0 port to 12. */ + status = nx_tcp_client_socket_bind(&client_socket_0, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let thread 1 run. */ + tx_thread_relinquish(); + + /* Check the socket 1. */ + if (!client_socket_1.nx_tcp_socket_bind_in_progress) + error_counter++; + + /* Unbind the socket 1 when the socket 1 bind in progress. */ + status = nx_tcp_client_socket_unbind(&client_socket_1); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Check the socket 1. */ + if (client_socket_1.nx_tcp_socket_bind_in_progress) + error_counter++; + + /* Unbind the socket 0. */ + status = nx_tcp_client_socket_unbind(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 1. */ + status = nx_tcp_socket_delete(&client_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 0. */ + status = nx_tcp_socket_delete(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the error counter. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket 1. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the client_socket_1 port to same port. */ + nx_tcp_client_socket_bind(&client_socket_1, 12, 2 * NX_IP_PERIODIC_RATE); +} \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_connection_reset_test.c b/test/regression/netxduo_test/netx_tcp_connection_reset_test.c new file mode 100644 index 00000000..dea9072d --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_connection_reset_test.c @@ -0,0 +1,359 @@ +/* This NetX test concentrates on connection reset. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define a packet data send FIN from 192.168.1.10 to 192.168.1.8. The ACK bit is not set. */ +static const unsigned char pkt_fin[] = { +0x00, 0x08, 0xee, 0x03, 0x6a, 0xc6, 0x00, 0x50, /* ....j..P */ +0xb6, 0x07, 0xa1, 0x69, 0x08, 0x00, 0x45, 0x00, /* ...i..E. */ +0x00, 0x28, 0x57, 0x1c, 0x40, 0x00, 0x80, 0x06, /* .(W.@... */ +0x20, 0x51, 0xc0, 0xa8, 0x01, 0x0a, 0xc0, 0xa8, /* Q...... */ +0x01, 0x08, 0xd3, 0xed, 0x1f, 0x90, 0x66, 0xe8, /* ......f. */ +0x6b, 0x67, 0x28, 0xd9, 0x25, 0x44, 0x50, 0x01, /* kg(.%DP. */ +0xfa, 0xf0, 0x1d, 0xa5, 0x00, 0x00 /* ...... */ +}; +#ifdef __PRODUCT_NETXDUO__ +static const ULONG fin_sequence = 0x66e86b67; +#endif /* __PRODUCT_NETXDUO__ */ + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG rst_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_connection_reset_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + rst_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 1, 10), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(192, 168, 1, 8), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /*Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status = nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP Connection Reset Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /*Send an echo request to make arp*/ + status = nx_icmp_ping(&ip_0, IP_ADDRESS(192, 168, 1, 8), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 28, &my_packet, TX_TIMER_TICKS_PER_SECOND); + + /* Determine if the timeout error occurred. */ + if ((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /*Deal the syn+ack packet with my routing*/ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + advanced_packet_process_callback = my_packet_process; + + /*Call connect to send an syn*/ + nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(192, 168, 1, 8), 12, 5 * TX_TIMER_TICKS_PER_SECOND); + + /*Let server deal with rst*/ + tx_thread_relinquish(); + + status = nx_packet_allocate(&pool_0, &my_packet, NX_ICMP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + error_counter ++; + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(my_packet -> nx_packet_prepend_ptr, &pkt_fin[14], sizeof(pkt_fin) - 14); + my_packet -> nx_packet_length = sizeof(pkt_fin) - 14; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + sizeof(pkt_fin) - 14; + + /* Directly receive the RA packet. */ + _nx_ip_packet_deferred_receive(&ip_1, my_packet); + + /* Determine if the test was successful. */ +#ifdef __PRODUCT_NETXDUO__ + if ((error_counter) || (rst_counter != 1)) +#else + if (error_counter) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + if(server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + + tx_thread_resume(&thread_0); +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER header_ptr; + + /*Send rst*/ + header_ptr.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_tx_sequence; + _nx_tcp_packet_send_rst(&client_socket, &header_ptr); + _nx_tcp_socket_thread_resume(&(client_socket.nx_tcp_socket_connect_suspended_thread), NX_NOT_ENABLED); + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Do not process packets that are not TCP. */ + if ((packet_ptr -> nx_packet_length < 40) || (ip_ptr != &ip_1)) + return NX_TRUE; + + /* Get TCP header. */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check whether it is a RST packet. */ + if (header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + + /* Yes it is. */ + rst_counter++; + +#ifdef __PRODUCT_NETXDUO__ + /* Check whether the ACK equals SEQ in FIN plus one. */ + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); + if (header_ptr -> nx_tcp_acknowledgment_number != fin_sequence + 1) + { + error_counter++; + } + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_acknowledgment_number); +#endif + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_connection_reset_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Connection Reset Test.................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_cwnd_test.c b/test/regression/netxduo_test/netx_tcp_cwnd_test.c new file mode 100644 index 00000000..59557ef8 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_cwnd_test.c @@ -0,0 +1,395 @@ +/* This NetX test concentrates on the congestion window increasement during slow start and congestion avoidance. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static CHAR send_buff[1500]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_cwnd_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG cwnd; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP CWND Test............................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Reset the send_buff. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (CHAR)(i & 0xFF); + } + + /* Store the congestion window before sending. */ + cwnd = client_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, client_socket.nx_tcp_socket_connect_mss, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Sleep 1 second to make sure ACK is received. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the congestion window increased by one MSS. */ + if (client_socket.nx_tcp_socket_tx_window_congestion != cwnd + client_socket.nx_tcp_socket_connect_mss) + error_counter++; + + + /* Send packet to enter congestion avoidance. */ + while (client_socket.nx_tcp_socket_tx_window_congestion < client_socket.nx_tcp_socket_tx_slow_start_threshold) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, client_socket.nx_tcp_socket_connect_mss, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + + /* Store the congestion window before sending. */ + cwnd = client_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, client_socket.nx_tcp_socket_connect_mss, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Sleep 1 second to make sure ACK is received. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the congestion window increased by MSS * MSS / CWND. */ + if (client_socket.nx_tcp_socket_tx_window_congestion != cwnd + client_socket.nx_tcp_socket_connect_mss2 / cwnd) + error_counter++; + + + /* Send packet to let cwnd > MSS * MSS. */ + while (client_socket.nx_tcp_socket_tx_window_congestion <= client_socket.nx_tcp_socket_connect_mss2) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, client_socket.nx_tcp_socket_connect_mss, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + + /* Store the congestion window before sending. */ + cwnd = client_socket.nx_tcp_socket_tx_window_congestion; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, client_socket.nx_tcp_socket_connect_mss, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Sleep 1 second to make sure ACK is received. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the congestion window increased by 1 byte. */ + if (client_socket.nx_tcp_socket_tx_window_congestion != cwnd + 1) + error_counter++; + + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buff, packet_ptr -> nx_packet_length)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_cwnd_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP CWND Test.............................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_data_transfer_test.c b/test/regression/netxduo_test/netx_tcp_data_transfer_test.c new file mode 100644 index 00000000..8858a6c5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_data_transfer_test.c @@ -0,0 +1,545 @@ +/* This NetX test concentrates on the TCP data transfer operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_data_transfer_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT compare_port; +ULONG tcp_packets_sent, tcp_bytes_sent, tcp_packets_received, tcp_bytes_received, tcp_invalid_packets, tcp_receive_packets_dropped, tcp_checksum_errors, tcp_connections, tcp_disconnections, tcp_connections_dropped, tcp_retransmit_packets; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Data Transfer Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 12, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&client_socket, thread_0_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&client_socket, &compare_port); + + /* Check for error. */ + if ((status) || (client_port != compare_port)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Loop to send 1000 messages! */ + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + +#if !defined(FEATURE_NX_IPV6) && defined(__PRODUCT_NETXDUO__) + /* Sleep 2MSL and check the state of socket from timed_wait to closed. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_TIMED_WAIT) + { + error_counter++; + } + else + { + tx_thread_sleep(_nx_tcp_2MSL_timer_rate + 1); + if (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + { + error_counter++; + } + } +#endif /* FEATURE_NX_IPV6 */ + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&client_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + if((packets_sent != 1000) || (bytes_sent != 1000*28)) + error_counter++; +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get the overall TCP information. */ + status = nx_tcp_info_get(&ip_0, &tcp_packets_sent, &tcp_bytes_sent, &tcp_packets_received, &tcp_bytes_received, + &tcp_invalid_packets, &tcp_receive_packets_dropped, &tcp_checksum_errors, &tcp_connections, + &tcp_disconnections, &tcp_connections_dropped, &tcp_retransmit_packets); + +#ifndef NX_DISABLE_TCP_INFO + if((tcp_packets_sent != 1000) || (tcp_bytes_sent != 1000*28) || (tcp_connections != 1)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 1000) || (thread_1_counter != 1000) || (connections != 1) || (disconnections) || + (tcp_packets_received) || (tcp_bytes_received) || (tcp_invalid_packets) || (tcp_receive_packets_dropped) || (tcp_checksum_errors) || + (tcp_connections_dropped) || (tcp_retransmit_packets)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, thread_1_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Configure the socket further. */ + status = nx_tcp_socket_transmit_configure(&server_socket, 10, 300, 10, 0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Inject the SYN packet. */ + ip_1.nx_ip_tcp_packet_receive = tcp_packet_receive; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Loop to accept 1000 messages. */ + while((thread_1_counter < 1000) && (error_counter == 0)) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Let client disconnect first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +#if defined(NX_ENABLE_INTERFACE_CAPABILITY) && defined(__PRODUCT_NETXDUO__) +NX_IPV4_HEADER *ip_header; +NX_PACKET *loopback_src_port; +NX_PACKET *broadcast_source; + + /* Set the source IP equal to destination IP. Verify whether or not system crashes. */ + /* Set the interface capability to ignore the checksum. */ + packet_ptr -> nx_packet_address.nx_packet_interface_ptr -> nx_interface_capability_flag |= NX_INTERFACE_CAPABILITY_TCP_RX_CHECKSUM; + + /* Copy from the original packet. */ + nx_packet_copy(packet_ptr, &loopback_src_port, &pool_0, NX_NO_WAIT); + nx_packet_copy(packet_ptr, &broadcast_source, &pool_0, NX_NO_WAIT); + + /* Get IP header. */ + ip_header = (NX_IPV4_HEADER *)loopback_src_port -> nx_packet_ip_header; + + /* Copy the dest ip to source ip field. */ + ip_header -> nx_ip_header_source_ip = ip_header -> nx_ip_header_destination_ip; + + /* Pass the packet. */ + _nx_tcp_packet_receive(ip_ptr, loopback_src_port); + +#ifndef NX_DISABLE_TCP_INFO + if (ip_ptr -> nx_ip_tcp_invalid_packets != 1) + error_counter++; +#endif /* NX_DISABLE_TCP_INFO */ + + /* Get IP header. */ + ip_header = (NX_IPV4_HEADER *)broadcast_source -> nx_packet_ip_header; + + /* Copy the dest ip to source ip field. */ + ip_header -> nx_ip_header_source_ip = NX_IP_LIMITED_BROADCAST; + + /* Pass the packet. */ + _nx_tcp_packet_receive(ip_ptr, broadcast_source); + +#ifndef NX_DISABLE_TCP_INFO + if (ip_ptr -> nx_ip_tcp_invalid_packets != 2) + error_counter++; +#endif /* NX_DISABLE_TCP_INFO */ +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Restore tcp receive function pointer. */ + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Pass the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_data_transfer_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Data Transfer Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_data_trim_test.c b/test/regression/netxduo_test/netx_tcp_data_trim_test.c new file mode 100644 index 00000000..76f597d6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_data_trim_test.c @@ -0,0 +1,335 @@ +/* This NetX test concentrates on the TCP data trim operation. */ +/* Cover the code line 115-124 and line 136-146 for _nx_tcp_socket_state_trim(); */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define NX_PACKET_SIZE (1536 + sizeof(NX_PACKET)) +#define NX_PACKET_POOL_SIZE (NX_PACKET_SIZE * 20) +#define NX_PACKET_SMALL_SIZE (256 + sizeof(NX_PACKET)) +#define NX_PACKET_POOL_SMALL_SIZE (NX_PACKET_SMALL_SIZE * 20) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR message[1000]; +static ULONG data_counter; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_data_trim_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + error_counter = 0; + data_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for IP instance 0. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PACKET_SIZE, pointer, NX_PACKET_POOL_SIZE); + pointer = pointer + NX_PACKET_POOL_SIZE; + + if (status) + error_counter++; + + /* Create a packet pool for IP instance 1. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Let the other thread run first. */ + tx_thread_relinquish(); + + /* Print out test information banner. */ + printf("NetX Test: TCP Data Trim Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_relinquish(); + + /* Check the window size. */ + if ((client_socket.nx_tcp_socket_rx_window_current != 300) || (client_socket.nx_tcp_socket_tx_window_advertised != 300) || + (server_socket.nx_tcp_socket_rx_window_current != 300) || (server_socket.nx_tcp_socket_tx_window_advertised != 300)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the tx_window_advertised value to let client send large packet to server. */ + client_socket.nx_tcp_socket_tx_window_advertised = 1000; + + /* Allocate the packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write data that is larger than window size. */ + status = nx_packet_data_append(my_packet, message, 1000, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_relinquish(); + + /* Check the data length. Server socket should trim the data if the data length is larger than the window. */ + + /* Determine if the test was successful. */ + if ((data_counter != 300) || (error_counter)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket with the window size 300(2 packets, one packet payload size is 256). */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive the packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Record the received data counter. */ + data_counter = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); +} + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_data_trim_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Data Trim Test........................................N/A\n"); + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_delayed_retransmission_test.c b/test/regression/netxduo_test/netx_tcp_delayed_retransmission_test.c new file mode 100644 index 00000000..b331ece2 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_delayed_retransmission_test.c @@ -0,0 +1,371 @@ +/* This NetX test concentrates on delayed retransmission TCP packet. + * 1. Send packet A. + * 2. Drop packet A in driver. + * 3. Send packet B, C and D. + * 4. Retransmit packet A. + * 5. Copy the data in A and transmit it. Delay packet A for 1 seconds. + * 6. Wait 2 seconds. + * 7. Check all packets are released. + * 8. Check no invalid packet released. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +static NX_PACKET *drop_packet; +static NX_PACKET *duplicate_packet; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_delayed_retransmission_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_packet = NX_NULL; + duplicate_packet = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Delayed Retransmission Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Set driver packet process callback. */ + advanced_packet_process_callback = packet_process; + + for (i = 0; i < 4; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "A", 1, &pool_0, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + if (i == 0) + { + + /* Drop the first packet. */ + drop_packet = my_packet; + } + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Wait two seconds. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Verify all packets are released from TX queue. */ + if (client_socket.nx_tcp_socket_tx_outstanding_bytes != 0) + error_counter++; + + /* Verify pool is full. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + error_counter++; + +#ifndef NX_DISABLE_PACKET_INFO + /* Verify no packet is released invalid. */ + if (pool_0.nx_packet_pool_invalid_releases != 0) + error_counter++; +#endif /* NX_DISABLE_PACKET_INFO */ + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 4; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "A", 1)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if (packet_ptr == drop_packet) + { + + /* This packet should be dropped. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* Duplicate this packet next time. */ + duplicate_packet = drop_packet; + drop_packet = NX_NULL; + } + else if (packet_ptr == duplicate_packet) + { + + /* This packet should be duplicated and delayed for 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + if (nx_packet_allocate(&pool_0, &duplicate_packet, 16, NX_NO_WAIT) == NX_SUCCESS) + { + + /* Copy data from original packet. */ + memcpy(duplicate_packet -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_prepend_ptr, + packet_ptr -> nx_packet_length); + duplicate_packet -> nx_packet_length = packet_ptr -> nx_packet_length; + duplicate_packet -> nx_packet_append_ptr += duplicate_packet -> nx_packet_length; + + /* Let IP 0 receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_1, duplicate_packet); + } + else + { + error_counter++; + } + + duplicate_packet = NX_NULL; + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_delayed_retransmission_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Delayed Retransmission Test...........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_delayed_retransmission_test2.c b/test/regression/netxduo_test/netx_tcp_delayed_retransmission_test2.c new file mode 100644 index 00000000..74204503 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_delayed_retransmission_test2.c @@ -0,0 +1,359 @@ +/* This NetX test concentrates on delayed retransmission TCP packet. + * 1. Send packet A. + * 2. Drop packet A in driver. + * 4. Retransmit packet A. + * 5. Copy the data in A and transmit it. Delay packet A for 1 seconds. + * 6. Wait 2 seconds. + * 7. Check all packets are released. + * 8. Check no invalid packet released. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +static NX_PACKET *drop_packet; +static NX_PACKET *duplicate_packet; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_delayed_retransmission_test_2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_packet = NX_NULL; + duplicate_packet = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Delayed Retransmission Test 2........................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Set driver packet process callback. */ + advanced_packet_process_callback = packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "A", 1, &pool_0, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Drop the first packet. */ + drop_packet = my_packet; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Wait two seconds. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Verify all packets are released from TX queue. */ + if (client_socket.nx_tcp_socket_tx_outstanding_bytes != 0) + error_counter++; + + /* Verify pool is full. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + error_counter++; + +#ifndef NX_DISABLE_PACKET_INFO + /* Verify no packet is released invalid. */ + if (pool_0.nx_packet_pool_invalid_releases != 0) + error_counter++; +#endif /* NX_DISABLE_PACKET_INFO */ + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "A", 1)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if (packet_ptr == drop_packet) + { + + /* This packet should be dropped. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + if (duplicate_packet == NX_NULL) + { + + /* Duplicate this packet next time. */ + duplicate_packet = drop_packet; + } + drop_packet = NX_NULL; + } + else if (packet_ptr == duplicate_packet) + { + + /* This packet should be duplicated and delayed for 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + if (nx_packet_allocate(&pool_0, &duplicate_packet, 16, NX_NO_WAIT) == NX_SUCCESS) + { + + /* Copy data from original packet. */ + memcpy(duplicate_packet -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_prepend_ptr, + packet_ptr -> nx_packet_length); + duplicate_packet -> nx_packet_length = packet_ptr -> nx_packet_length; + duplicate_packet -> nx_packet_append_ptr += duplicate_packet -> nx_packet_length; + + /* Let IP 0 receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_1, duplicate_packet); + } + else + { + error_counter++; + } + + duplicate_packet = NX_NULL; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_delayed_retransmission_test_2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Delayed Retransmission Test 2.........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_dropped_packet_test.c b/test/regression/netxduo_test/netx_tcp_dropped_packet_test.c new file mode 100644 index 00000000..60ca400c --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_dropped_packet_test.c @@ -0,0 +1,502 @@ +/* This NetX test concentrates on dropping of TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; + + +extern ULONG packet_gather; +extern ULONG packet_drop; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_dropped_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Dropped Packet Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_relinquish(); + + /* Loop to repeat things over and over again! */ + thread_0_counter = 0; + while ((thread_0_counter < 2000) && (!error_counter)) + { + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Set the gather flag to instruct the test driver to save the packets and reverse the order. */ + packet_gather = 1; + + /* Set the dropped packet variable to drop a packet. */ + packet_drop = (thread_0_counter & 3) + 1; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 20 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 20 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 20 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_suspend(&thread_0); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter) || (thread_0_counter != 2000) || (thread_1_counter != 2000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG sequence_increment = 1; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Supsend thread 0. */ + tx_thread_suspend(&thread_0); + nx_tcp_socket_state_wait(&server_socket, NX_TCP_ESTABLISHED, 2 * NX_IP_PERIODIC_RATE); + tx_thread_resume(&thread_0); + + /* Set all the sequence numbers the way we want them for our test. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00; + client_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00; + client_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00; + server_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00; + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00; + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00; + + /* Loop to create and establish server connections. */ + thread_1_counter = 0; + while ((thread_1_counter < 2000) && (!error_counter)) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 20 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 20 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 20 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + server_socket.nx_tcp_socket_rx_window_last_sent = 0; /* Force an ACK out! */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 20 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Set all the sequence numbers the way we want them for our test. */ + if ((server_socket.nx_tcp_socket_rx_sequence < 0xFFFFFF00) && + (server_socket.nx_tcp_socket_rx_sequence > 0x100)) + { + /* Wait for client socket to empty. */ + while (client_socket.nx_tcp_socket_transmit_sent_count) + { + tx_thread_sleep(1); + } + + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + client_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + client_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00 + (sequence_increment++ & 0xFF); + } + + /* Resume thread 0. */ + tx_thread_resume(&thread_0); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_dropped_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Dropped Packet Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_dropped_packet_test2.c b/test/regression/netxduo_test/netx_tcp_dropped_packet_test2.c new file mode 100644 index 00000000..78f1cadd --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_dropped_packet_test2.c @@ -0,0 +1,314 @@ +/* This NetX test concentrates on TCP packet drop. + * Client sends 5 packet to server. Each packet size is MSS. + * The first and the third packets are dropped. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static CHAR send_buff[1500]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_dropped_packet_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Dropped Packet Test 2................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Reset the send_buff. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (CHAR)(i & 0xFF); + } + + for (i = 0; i < 5; i++) + { + + if ((i == 0) || (i == 2)) + { + + /* Set driver filter to drop the first and third packets. */ + advanced_packet_process_callback = packet_process; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, client_socket.nx_tcp_socket_connect_mss, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 5; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, send_buff, packet_ptr -> nx_packet_length)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Simply drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_dropped_packet_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Dropped Packet Test 2.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_duplicate_accept_test.c b/test/regression/netxduo_test/netx_tcp_duplicate_accept_test.c new file mode 100644 index 00000000..874b6efd --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_duplicate_accept_test.c @@ -0,0 +1,294 @@ +/* This NetX test concentrates on calling nx_tcp_server_socket_accept() for multiple times. + * It verifies a bug that TCP server would send SYN+ACK on each accept() call. The ACK number in each packet is different. */ + +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT syn_ack_received; +static UINT sequence[10]; +static UINT ack_number[10]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_duplicate_accept_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_ack_received = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Duplicate Accept Test................................."); + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Filter the TCP packet received by client. */ + ip_0.nx_ip_tcp_packet_receive = tcp_packet_receive; + + /* Attempt to connect the socket. */ + nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1460, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Sleep one second. Let client send SYN first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + if (status != NX_IN_PROGRESS) + error_counter++; + + /* Accept a client socket connection again. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_NO_WAIT); + if (status != NX_IN_PROGRESS) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + + /* Only one SYN+ACK packet is expected. */ + if (syn_ack_received != 1) + { + error_counter++; + + /* Check whether all sequence and ACK numbers are the same. */ + for (i = 1; i < syn_ack_received; i++) + { + if (sequence[i] != sequence[0]) + error_counter++; + if (ack_number[i] != ack_number[0]) + error_counter++; + } + } + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Get the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && + (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* Get Sequence and ACK numbers. */ + sequence[syn_ack_received] = tcp_header_ptr -> nx_tcp_sequence_number; + ack_number[syn_ack_received] = tcp_header_ptr -> nx_tcp_acknowledgment_number; + syn_ack_received++; + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + /* Drop the packet to avoid RST. */ + nx_packet_release(packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_duplicate_accept_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Duplicate Accept Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_error_operation_check_test.c b/test/regression/netxduo_test/netx_tcp_error_operation_check_test.c new file mode 100644 index 00000000..9681384c --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_error_operation_check_test.c @@ -0,0 +1,235 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_error_operation_check_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP instances 0. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NXD_ADDRESS server_ip; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Error Operation Check Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the server IP address. */ + server_ip.nxd_ip_version = NX_IP_VERSION_V4; + server_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Call connect before port bound. */ + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the unreachable IPv4 address. */ + server_ip.nxd_ip_version = NX_IP_VERSION_V4; + server_ip.nxd_ip_address.v4 = IP_ADDRESS(2, 2, 3, 5); + + /* Call connect with error address. */ + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Set the unreachable IPv6 address. */ + server_ip.nxd_ip_version = NX_IP_VERSION_V6; + server_ip.nxd_ip_address.v6[0] = 0x20010000; + server_ip.nxd_ip_address.v6[1] = 0x00000000; + server_ip.nxd_ip_address.v6[2] = 0x00000000; + server_ip.nxd_ip_address.v6[3] = 0x10000002; + + /* Call connect with error address. */ + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Set the error address version. */ + server_ip.nxd_ip_version = 0x05; + server_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Call connect with error address. */ + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Set the server address. */ + server_ip.nxd_ip_version = NX_IP_VERSION_V4; + server_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Set the small interface mtu. */ + status = nx_ip_interface_mtu_set(&ip_0, 0, 20); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect with small interface mtu. */ + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_error_operation_check_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Error Operation Check Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_fast_disconnect_test.c b/test/regression/netxduo_test/netx_tcp_fast_disconnect_test.c new file mode 100644 index 00000000..850a1a9e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_fast_disconnect_test.c @@ -0,0 +1,475 @@ +/* This NetX test concentrates on the fast disconnect TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#define DEMO_STACK_SIZE 2048 + +#if !defined(NX_DISABLE_RESET_DISCONNECT) && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fast_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT compare_port; +ULONG tcp_packets_sent, tcp_bytes_sent, tcp_packets_received, tcp_bytes_received, tcp_invalid_packets, tcp_receive_packets_dropped, tcp_checksum_errors, tcp_connections, tcp_disconnections, tcp_connections_dropped, tcp_retransmit_packets; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Fast Disconnect Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to establish 1000 connections, send one message, and disconnect. */ + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&client_socket, thread_0_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&client_socket, &compare_port); + + /* Check for error. */ + if ((status) || (client_port != compare_port)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Determine if the status is valid. */ + if (status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&client_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + if((packets_sent != 1) || (bytes_sent != 28)) + error_counter++; +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || (retransmit_packets) || (packets_queued) || + (checksum_errors) || (socket_state != NX_TCP_CLOSED) || (transmit_queue_depth) || (receive_window != 200)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Get the overall TCP information. */ + status = nx_tcp_info_get(&ip_0, &tcp_packets_sent, &tcp_bytes_sent, &tcp_packets_received, &tcp_bytes_received, + &tcp_invalid_packets, &tcp_receive_packets_dropped, &tcp_checksum_errors, &tcp_connections, + &tcp_disconnections, &tcp_connections_dropped, &tcp_retransmit_packets); + +#ifndef NX_DISABLE_TCP_INFO + if((tcp_packets_sent != 1000) || (tcp_bytes_sent != 1000*28) || (tcp_connections != 1000) || (tcp_disconnections != 1000)) + error_counter++; +#endif + + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 1000) || (thread_1_counter != 1000) || (connections != 1000) || (disconnections) || + (tcp_packets_received) || (tcp_bytes_received) || (tcp_invalid_packets) || (tcp_receive_packets_dropped) || (tcp_checksum_errors) || + (tcp_connections_dropped) || (tcp_retransmit_packets)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, thread_1_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Configure the socket further. */ + status = nx_tcp_socket_transmit_configure(&server_socket, 10, 300, 10, 0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Loop to create and establish server connections. */ + while((thread_1_counter < 1000) && (error_counter == 0)) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + +#ifndef NX_DISABLE_RESET_DISCONNECT + if (status != NX_IN_PROGRESS) + error_counter++; +#endif + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fast_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Fast Disconnect Test..................................N/A\n"); + + test_control_return(3); + +} + +#endif diff --git a/test/regression/netxduo_test/netx_tcp_fast_retransmit_test.c b/test/regression/netxduo_test/netx_tcp_fast_retransmit_test.c new file mode 100644 index 00000000..8edfdda6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_fast_retransmit_test.c @@ -0,0 +1,362 @@ +/* This NetX test concentrates on fast retransmit. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_f_r(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fast_retransmit_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + + /* Print out test information banner. */ + printf("NetX Test: TCP Fast Retransmit Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[60], 20); + my_packet4 -> nx_packet_length = 20; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 20; + + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_f_r; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Send the 2nd one */ + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Send the 3rd one */ + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Send the 4th one */ + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } + + /* Disable timeout retransmit. */ + client_socket.nx_tcp_socket_timeout = 60 * 60 * _nx_tcp_fast_timer_rate; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 80) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_f_r(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + nx_packet_release(packet_ptr); + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fast_retransmit_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Fast Retransmit Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_fin_wait1_to_time_wait_test.c b/test/regression/netxduo_test/netx_tcp_fin_wait1_to_time_wait_test.c new file mode 100644 index 00000000..4dc9ddc8 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_fin_wait1_to_time_wait_test.c @@ -0,0 +1,306 @@ +/* This NetX test concentrates on TCP state change from FIN-WIAT1 to TIME-WAIT. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void tcp_packet_receive_catch_fin(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void tcp_packet_receive_drop_ack(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fin_wait1_to_time_wait_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP FIN-WAIT1 to TIME-WAIT Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let server thread send FIN first. */ + tx_thread_suspend(&thread_0); + + /* Check the state of server socket. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_FIN_WAIT_1) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Check the state of server socket. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_TIMED_WAIT) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Sleep 1 second to make sure client thread is suspended. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Inject FIN packet. */ + ip_0.nx_ip_tcp_packet_receive = tcp_packet_receive_catch_fin; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static VOID tcp_packet_receive_catch_fin(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Process FIN packet. */ + if (header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) + { + + /* Let client thread start to disconnect. */ + tx_thread_resume(&thread_0); + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server drop the ACK to prevent state FIN-WAIT2. */ + ip_1.nx_ip_tcp_packet_receive = tcp_packet_receive_drop_ack; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void tcp_packet_receive_drop_ack(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Point to TCP header */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Process FIN packet. */ + if ((header_ptr -> nx_tcp_header_word_3 & NX_TCP_CONTROL_MASK) == NX_TCP_ACK_BIT) + { + + /* Drop the ACK packet. . */ + nx_packet_release(packet_ptr); + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + return; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fin_wait1_to_time_wait_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: TCP FIN-WAIT1 to TIME-WAIT Test...........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_tcp_fin_wait_recv_test.c b/test/regression/netxduo_test/netx_tcp_fin_wait_recv_test.c new file mode 100644 index 00000000..c3d2bcb4 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_fin_wait_recv_test.c @@ -0,0 +1,300 @@ +/* This NetX test concentrates on receiving retransmitted packet when FIN is received at FIN_WAIT1/FIN_WAIT2 state. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#define DEMO_STACK_SIZE 2048 + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_PACKET *operation_packet; +static CHAR *test_buffer = "ABCDEFGH"; +static UCHAR recv_buffer[10]; +static ULONG recv_len; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fin_wait_recv_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +ULONG pool_size; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + recv_len = 0; + operation_packet = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + pool_size = (sizeof(NX_PACKET) + 256) * 16; + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, pool_size); + pointer = pointer + pool_size; + + if (status) + error_counter++; + + /* Create a packet pool. */ + pool_size = (sizeof(NX_PACKET) + 256) * 16; + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pointer, pool_size); + pointer = pointer + pool_size; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out test information banner. */ + printf("NetX Test: TCP receive on FIN_WAIT1 and FIN_WAIT2 state.............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 500); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup callback function to drop packets once. */ + advanced_packet_process_callback = my_packet_process; + + nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + nx_packet_data_append(my_packet, test_buffer, strlen(test_buffer), &pool_0, NX_WAIT_FOREVER); + + operation_packet = my_packet; + nx_tcp_socket_send(&client_socket, my_packet, NX_WAIT_FOREVER); + + /* Make sure peer send FIN first so peer will enter FIN_WAIT1 state. */ + tx_thread_relinquish(); + + /* Disconnect immediately. */ + nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 500); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let thread 2 start to receive. */ + tx_thread_resume(&thread_2); + + /* Disconnect immediately. */ + nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check received data. */ + if(recv_len != strlen(test_buffer)) + { + error_counter++; + } + else if(memcmp(test_buffer, recv_buffer, recv_len)) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_2_entry(ULONG thread_input) +{ +NX_PACKET *packet_ptr; + + /* Receive one packet. */ + if (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER)) + { + error_counter++; + } + else + { + + /* Retrieve data from packet. */ + nx_packet_data_retrieve(packet_ptr, recv_buffer, &recv_len); + nx_packet_release(packet_ptr); + } +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if(packet_ptr == operation_packet) + { + operation_packet = NX_NULL; + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_fin_wait_recv_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP receive on FIN_WAIT1 and FIN_WAIT2 state..............N/A\n"); + test_control_return(2); +} +#endif /* NX_TCP_MAX_OUT_OF_ORDER_PACKETS */ diff --git a/test/regression/netxduo_test/netx_tcp_invalid_length_test.c b/test/regression/netxduo_test/netx_tcp_invalid_length_test.c new file mode 100644 index 00000000..c708691c --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_invalid_length_test.c @@ -0,0 +1,222 @@ +/* This NetX test concentrates on the code coverage for TCP functions, + * _nx_tcp_packet_receive.c + */ + +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_packet.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RX_SIZE_CHECKING) + +#define DEMO_STACK_SIZE 2048 +#define ASSERT_THREAD_COUNT 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET tcp_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UCHAR pool_area[102400]; + +/* TCP packet. 192.168.100.23:6206 -> 192.168.100.4:80 */ +/* Invalid TCP length. */ +static unsigned char pkt1[54] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x08, 0x00, 0x45, 0x00, /* 8.%...E. */ +0x00, 0x28, 0x10, 0x9d, 0x00, 0x00, 0x80, 0x06, /* .(...... */ +0xe0, 0xc6, 0xc0, 0xa8, 0x64, 0x17, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x18, 0x3e, 0x00, 0x50, 0x62, 0xf3, /* d..>.Pb. */ +0xa5, 0x46, 0x54, 0x7e, 0x0c, 0xe7, 0x40, 0x10, /* .FT~..P. */ +0x01, 0x00, 0xf3, 0x3a, 0x00, 0x00 /* ...:.. */ +}; + +/* TCP packet. 192.168.100.23:6206 -> 192.168.100.4:80 */ +/* Invalid TCP length. */ +static unsigned char pkt2[54] = { +0x00, 0x1e, 0x8f, 0xb1, 0x7a, 0xd4, 0xf4, 0x8e, /* ....z... */ +0x38, 0xa3, 0x25, 0xb3, 0x08, 0x00, 0x45, 0x00, /* 8.%...E. */ +0x00, 0x28, 0x10, 0x9d, 0x00, 0x00, 0x80, 0x06, /* .(...... */ +0xe0, 0xc6, 0xc0, 0xa8, 0x64, 0x17, 0xc0, 0xa8, /* ....d... */ +0x64, 0x04, 0x18, 0x3e, 0x00, 0x50, 0x62, 0xf3, /* d..>.Pb. */ +0xa5, 0x46, 0x54, 0x7e, 0x0c, 0xe7, 0x60, 0x10, /* .FT~..P. */ +0x01, 0x00, 0xd3, 0x3a, 0x00, 0x00 /* ...:.. */ +}; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_length_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Invalid Length Test..................................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pool_area, sizeof(pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &tcp_socket, "TCP Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&tcp_socket, 80, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + nx_ip_address_set(&ip_0, IP_ADDRESS(192,168,100,4), 0xFFFFFF00); + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(192,168,100,4); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt1[14], sizeof(pkt1) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt1) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + + /* Inject TCP packet. */ + nx_packet_allocate(&pool_0, &packet_ptr, NX_PHYSICAL_HEADER, NX_WAIT_FOREVER); + + /* Fill in the packet with data. Skip the MAC header. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr, &pkt2[14], sizeof(pkt2) - 14); + packet_ptr -> nx_packet_length = sizeof(pkt2) - 14; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + packet_ptr -> nx_packet_length; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&ip_0, packet_ptr); + +#ifndef NX_DISABLE_TCP_INFO + if (ip_0.nx_ip_tcp_invalid_packets != 2) + error_counter++; +#endif /* NX_DISABLE_ICMP_INFO */ + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Invalid Length Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_invalid_option_test.c b/test/regression/netxduo_test/netx_tcp_invalid_option_test.c new file mode 100644 index 00000000..a9a45477 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_invalid_option_test.c @@ -0,0 +1,492 @@ +/* This NetX test concentrates on the TCP Socket relisten operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#include "nx_tcp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +#define CLIENT_PORT 0x88 +#define SERVER_PORT 0x89 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT fin_counter = 0; +static UINT rst_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID inject_invalid_option(); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_option_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Invalid Option Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, CLIENT_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to establish connection. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the client and server socket state. */ + if ((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Inject invalid option with invalid SEQ and ACK. */ + /* The receiver is expected to drop the packet. */ + inject_invalid_option(); + + /* Check the client and server socket state. */ + if ((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + advanced_packet_process_callback = my_packet_process; + + /* Call connect to send a SYN */ + status = nx_tcp_socket_disconnect(&client_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the client and server socket state. */ +#ifdef __PRODUCT_NETXDUO__ + if ((client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE)) +#else + if ((client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || (server_socket.nx_tcp_socket_state != NX_TCP_CLOSED)) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (fin_counter != 1) || (rst_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word; +ULONG checksum; +ULONG *source_ip, *dest_ip; + + /* Set the tcp header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr ->nx_packet_prepend_ptr; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a FIN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) && + (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* Update the fin_counter. */ + fin_counter++; + + /* Add the option. */ + option_word = (ULONG *) (packet_ptr ->nx_packet_prepend_ptr + 20 ); + + /* Add the invalid MSS option. */ + *option_word = 0x02030000 | 536; + NX_CHANGE_ULONG_ENDIAN(*option_word); + + /* Update the option word pointer. */ + option_word ++; + *option_word = NX_TCP_OPTION_END; + NX_CHANGE_ULONG_ENDIAN(*option_word); + + /* The ACK must be set or else the packet is dropped before parsing TCP option. */ +#if 0 + /* Clean the ACK bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = (tcp_header_ptr -> nx_tcp_header_word_3 & (~NX_TCP_ACK_BIT)); +#endif + + /* Update the TCP header length. */ + tcp_header_ptr -> nx_tcp_header_word_3 += 0x20000000; + + /* Update the packet length. */ + packet_ptr -> nx_packet_length += 8; + packet_ptr -> nx_packet_append_ptr += 8; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Clear the checksum field. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum . */ +#ifdef __PRODUCT_NETXDUO__ + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#else + checksum = _nx_tcp_checksum(packet_ptr, client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address, client_socket.nx_tcp_socket_connect_ip); +#endif + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + } + else + { + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + } + + /* Clear the callback function. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a RST packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + + /* It is a RST packet. */ + rst_counter++; + + /* Clear the callback. */ + advanced_packet_process_callback = NX_NULL; + } + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +static VOID inject_invalid_option() +{ +NX_PACKET *packet_ptr; +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word; +ULONG checksum; +#ifdef __PRODUCT_NETXDUO__ +ULONG *source_ip, *dest_ip; +#endif + + if (nx_packet_allocate(&pool_0, &packet_ptr, NX_IP_PACKET, NX_IP_PERIODIC_RATE)) + { + error_counter++; + return; + } + + /* Construct TCP header with invalid SEQ and ACK. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_0 = (((ULONG)(client_socket.nx_tcp_socket_port)) << NX_SHIFT_BY_16) | (ULONG)client_socket.nx_tcp_socket_connect_port; + tcp_header_ptr -> nx_tcp_sequence_number = 0; + tcp_header_ptr -> nx_tcp_acknowledgment_number = 0; + tcp_header_ptr -> nx_tcp_header_word_3 = NX_TCP_SYN_HEADER | NX_TCP_ACK_BIT | NX_TCP_PSH_BIT | 200; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Add invalid TCP option. */ + option_word = (ULONG *)(packet_ptr ->nx_packet_prepend_ptr + 20); + + /* Add the invalid MSS option. */ + *option_word = 0x02030000 | 536; + NX_CHANGE_ULONG_ENDIAN(*option_word); + + /* Update the option word pointer. */ + option_word ++; + *option_word = NX_TCP_OPTION_END; + NX_CHANGE_ULONG_ENDIAN(*option_word); + + /* Setup the packet payload pointers and length for a basic TCP packet. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_TCP_HEADER) + 8; + + /* Setup the packet length. */ + packet_ptr -> nx_packet_length = sizeof(NX_TCP_HEADER) + 8; + + + /* Write ABCs into the packet payload! */ + if (nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE)) + { + nx_packet_release(packet_ptr); + error_counter++; + return; + } + + /* Calculate the checksum . */ +#ifdef __PRODUCT_NETXDUO__ + packet_ptr -> nx_packet_address.nx_packet_interface_ptr = client_socket.nx_tcp_socket_connect_interface; + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#else + packet_ptr -> nx_packet_ip_interface = client_socket.nx_tcp_socket_connect_interface; + packet_ptr -> nx_packet_next_hop_address = client_socket.nx_tcp_socket_next_hop_address; + checksum = _nx_tcp_checksum(packet_ptr, packet_ptr -> nx_packet_ip_interface -> nx_interface_ip_address, client_socket.nx_tcp_socket_connect_ip); +#endif + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Send the TCP packet. */ + tx_mutex_get(&(ip_0.nx_ip_protection), TX_WAIT_FOREVER); +#ifdef __PRODUCT_NETXDUO__ + _nx_ip_packet_send(&ip_0, packet_ptr, client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4, + client_socket.nx_tcp_socket_type_of_service, client_socket.nx_tcp_socket_time_to_live, NX_IP_TCP, + client_socket.nx_tcp_socket_fragment_enable, + client_socket.nx_tcp_socket_next_hop_address); +#else + _nx_ip_packet_send(&ip_0, packet_ptr, client_socket.nx_tcp_socket_connect_ip, + client_socket.nx_tcp_socket_type_of_service, client_socket.nx_tcp_socket_time_to_live, NX_IP_TCP, + client_socket.nx_tcp_socket_fragment_enable); +#endif + + tx_mutex_put(&(ip_0.nx_ip_protection)); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Invalid Option Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_invalid_option_test2.c b/test/regression/netxduo_test/netx_tcp_invalid_option_test2.c new file mode 100644 index 00000000..2677b21e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_invalid_option_test2.c @@ -0,0 +1,459 @@ +/* This NetX test concentrates on the invalid TCP option when the ACK bit is not set. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#include "nx_tcp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +#define CLIENT_PORT 0x88 +#define SERVER_PORT 0x89 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT rst_counter = 0; +static UINT hacked_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_option_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Invalid Option Test2.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set the callback function. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + advanced_packet_process_callback = my_packet_process; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to establish connection. */ + /* The received SYN+ACK is modified to clean ACK bit and invalid option length. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_CONNECTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Cleanup TCP socket. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&client_socket); + + tx_thread_sleep(NX_IP_PERIODIC_RATE * 2); + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + advanced_packet_process_callback = my_packet_process; + + /* Call connect to establish connection. */ + /* The received SYN+ACK is modified to FIN packet without ACK bit and invalid option length. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_CONNECTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Cleanup TCP socket. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&client_socket); + + tx_thread_sleep(NX_IP_PERIODIC_RATE * 2); + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + advanced_packet_process_callback = my_packet_process; + + /* Call connect to establish connection. */ + /* The received SYN+ACK is modified clear all bits and invalid option length. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_CONNECTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Cleanup TCP socket. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + nx_tcp_client_socket_unbind(&client_socket); + + tx_thread_sleep(NX_IP_PERIODIC_RATE * 2); + + /* Check status. */ + if ((error_counter) || (rst_counter != 3)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + + /* Clear TCP socket. */ + nx_tcp_server_socket_unaccept(&server_socket); + + /* Relisten for next round. */ + nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT, &server_socket); + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + + /* Clear TCP socket. */ + nx_tcp_server_socket_unaccept(&server_socket); + + /* Relisten for next round. */ + nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT, &server_socket); + + /* Accept a client socket connection. */ + nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word; +ULONG checksum; +ULONG *source_ip, *dest_ip; + + /* Set the tcp header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr ->nx_packet_prepend_ptr; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is an SYN+ACK packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && + (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)) + { + + /* Add the option. */ + option_word = (ULONG *) (packet_ptr ->nx_packet_prepend_ptr + 20 ); + + /* Add the invalid MSS option. */ + *option_word = 0x02030000 | 536; + NX_CHANGE_ULONG_ENDIAN(*option_word); + + /* Update the option word pointer. */ + option_word ++; + *option_word = NX_TCP_OPTION_END; + NX_CHANGE_ULONG_ENDIAN(*option_word); + + /* Clear ACK bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 &= ~NX_TCP_ACK_BIT; + + if (hacked_counter == 1) + { + + /* Clear SYN bit and set FIN bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 &= ~NX_TCP_SYN_BIT; + tcp_header_ptr -> nx_tcp_header_word_3 |= NX_TCP_FIN_BIT; + } + else if (hacked_counter == 2) + { + + /* Clear SYN bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 &= ~NX_TCP_SYN_BIT; + } + hacked_counter++; + + /* Update the TCP header length. */ + tcp_header_ptr -> nx_tcp_header_word_3 += 0x20000000; + + /* Update the packet length. */ + packet_ptr -> nx_packet_length += 8; + packet_ptr -> nx_packet_append_ptr += 8; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Clear the checksum field. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum . */ +#ifdef __PRODUCT_NETXDUO__ + dest_ip = &server_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &server_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; +#else + checksum = _nx_tcp_checksum(packet_ptr, server_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address, server_socket.nx_tcp_socket_connect_ip); +#endif + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + } + else + { + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + } + + /* Clear the callback function. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if it is a RST packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT) + { + + /* It is a RST packet. */ + rst_counter++; + + /* Clear the callback. */ + advanced_packet_process_callback = NX_NULL; + } + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_option_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Invalid Option Test2..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_invalid_packet_chain_test.c b/test/regression/netxduo_test/netx_tcp_invalid_packet_chain_test.c new file mode 100644 index 00000000..705fcae3 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_invalid_packet_chain_test.c @@ -0,0 +1,397 @@ +/* This NetX test concentrates on the TCP header span in multiple packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_RX_SIZE_CHECKING) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UINT client_port; +static ULONG packet_offset; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static UINT my_advanced_packet_process_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT compare_port; +ULONG mss, peer_mss, peer_ip_address, peer_port, bytes_available; +ULONG tcp_packets_sent, tcp_bytes_sent, tcp_packets_received, tcp_bytes_received, tcp_invalid_packets, tcp_receive_packets_dropped, tcp_checksum_errors, tcp_connections, tcp_disconnections, tcp_connections_dropped, tcp_retransmit_packets; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; +ULONG window_size = 200; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Invalid Packet Chain Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set callback function in network driver to bypass dispatch in network driver. */ + advanced_packet_process_callback = my_advanced_packet_process_callback; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, window_size, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set offset to 20. The size of TCP plus IP header is larger than 40. + This packet can not be processed by TCP. */ + packet_offset = 20; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Set offset to 40. Since size of SYN more than 20, with IP header, the total size is larger than 40. + This packet can not be processed by TCP. */ + packet_offset = 40; + + /* Attempt to connect the socket again. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Set offset to 80. This packet can be processed by TCP. */ + packet_offset = 80; + + /* Attempt to connect the socket again. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check for errors. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; +} + +static UINT my_advanced_packet_process_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_PACKET *packet_copy_ptr; + + if (ip_ptr != &ip_0) + { + + /* Handle packets from IP 0 only. */ + return(NX_TRUE); + } + + /* Check if this is an IPv4 packet. */ + if ((*(packet_ptr -> nx_packet_prepend_ptr) != 0x45) || (packet_ptr -> nx_packet_next)) + { + + /* Handle IPv4 packets only. */ + return(NX_TRUE); + } + + /* Allocate a packet with insufficient space for TCP header in first packet. */ + if (nx_packet_allocate(&pool_0, &packet_copy_ptr, + (pool_0.nx_packet_pool_payload_size - packet_offset) & 0xFFFFFFFC, NX_NO_WAIT)) + { + error_counter++; + return(NX_TRUE); + } + + /* Copy data into packet. */ + if (nx_packet_data_append(packet_copy_ptr, packet_ptr -> nx_packet_prepend_ptr, + packet_ptr -> nx_packet_length, &pool_0, NX_NO_WAIT)) + { + error_counter++; + nx_packet_release(packet_copy_ptr); + return(NX_TRUE); + } + _nx_ip_packet_deferred_receive(&ip_1, packet_copy_ptr); + + /* Let network driver to drop this packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + return(NX_TRUE); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_invalid_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Invalid Packet Chain Test.............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_ipv4_interface2_mss_test.c b/test/regression/netxduo_test/netx_tcp_ipv4_interface2_mss_test.c new file mode 100644 index 00000000..75cb0790 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ipv4_interface2_mss_test.c @@ -0,0 +1,336 @@ +/* This NetX test use the second interface send a larger packet with IPv4 address + to test the TCP MSS process procedure. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#include "nx_tcp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static CHAR rcv_buffer[600]; +static INT recv_length = 0; + +static CHAR msg[600]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv4_interface2_mss_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2,2,3,4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2,2,3,5), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); +#else + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); +#endif /* __PRODUCT_NETXDUO__ */ + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + UINT i; + + /* Use random number generator to fill the outgoing packet. */ + for(i = 0; i < 600; i++) + { + msg[i] = rand(); + } + + /* Print out test information banner. */ + printf("NetX Test: TCP IPv4 Interface2 MSS Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 600, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect. */ + status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(2,2,3,5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to new receive function */ + ip_1.nx_ip_tcp_packet_receive = packet_receive; + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 550); + my_packet1 -> nx_packet_length = 550; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 550; + + /* Check for error. */ + if(status) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + my_packet1 -> nx_packet_ip_version = NX_IP_VERSION_V4; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Send the packet. */ + status += nx_tcp_socket_send(&client_socket, my_packet1, 2 * NX_IP_PERIODIC_RATE); + + tx_thread_relinquish(); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 650, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + UINT length; + + /* Data length equal to packet length - 20. */ + length = packet_ptr -> nx_packet_length - 20; + + if(length > client_socket.nx_tcp_socket_connect_mss) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy the packet. */ + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr + 20, length); + recv_length += length; + + /* Check whether or not the last packet. */ + if(length < client_socket.nx_tcp_socket_connect_mss) + { + + /* The packet is the last packet, compare the packet and receive_length. */ + if(memcmp(rcv_buffer,msg,packet_ptr -> nx_packet_length) || recv_length != 550) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to default function. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + } + + /* Set client_socket's outstanding bytes to 0. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes = 0; + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv4_interface2_mss_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP IPv4 Interface2 MSS Test..............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_ipv6_basic_processing_test.c b/test/regression/netxduo_test/netx_tcp_ipv6_basic_processing_test.c new file mode 100644 index 00000000..018f40b0 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ipv6_basic_processing_test.c @@ -0,0 +1,546 @@ +/* This NetX test use the second interface send a larger packet with IPv6 address + to test the TCP MSS process procedure. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; +NXD_ADDRESS peer_address; +ULONG peer_port; +ULONG mss; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out test information banner. */ + printf("NetX Test: TCP IPv6 Basic Processing Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /* Get the peer socket info before connection established, should be fail. */ + status = nxd_tcp_socket_peer_info_get(&client_socket, &peer_address, &peer_port); + + /* Check for error. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Call connect to send a SYN */ + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Get the socket mss. */ + status = nx_tcp_socket_mss_get(&client_socket, &mss); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get the peer socket info. */ + status = nxd_tcp_socket_peer_info_get(&client_socket, &peer_address, &peer_port); + + /* Check for error. */ + if(status) + error_counter++; + + /* Check the peer address and peer port. */ + if((peer_port != 12) || + (peer_address.nxd_ip_version != NX_IP_VERSION_V6) || + (peer_address.nxd_ip_address.v6[0] != 0x20010000) || + (peer_address.nxd_ip_address.v6[1] != 0x00000000) || + (peer_address.nxd_ip_address.v6[2] != 0x00000000) || + (peer_address.nxd_ip_address.v6[3] != 0x10000002)) + error_counter++; + + /* Send the packet to server. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_IPv6_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V6; + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Modify the ip version of connect address. */ + client_socket.nx_tcp_socket_connect_ip.nxd_ip_version = 0; + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* It must fail since ip version is invalid. */ + if (status != NX_NOT_CONNECTED) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + client_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V6; + + /* Delete the Ipv6 address. */ + nxd_ipv6_address_delete(&ip_0, 0); + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* It must fail since address is invalid. */ + if (status != NX_NO_INTERFACE_ADDRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the address. */ + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + /* Wait 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Send packet */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Get the peer socket info before connection established, should be fail. */ + status = nxd_tcp_socket_peer_info_get(&client_socket, &peer_address, &peer_port); + + /* Check for error. */ + if(status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get information about this socket. */ + status = nx_tcp_socket_info_get(&client_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + +#ifndef NX_DISABLE_TCP_INFO + + if((packets_sent != 1) || (bytes_sent != 28)) + error_counter++; +#endif + + /* Check for errors. */ + if ((error_counter) || (status) || (packets_received) || (bytes_received) || + (retransmit_packets) || (packets_queued) || (checksum_errors) || (socket_state != NX_TCP_CLOSED) || + (transmit_queue_depth) || (transmit_window != 100) || (receive_window != 200)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_relinquish(); + + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(status) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + ULONG actual_status; + NX_PACKET *packet_ptr; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Inject the SYN packet. */ + ip_1.nx_ip_tcp_packet_receive = tcp_packet_receive; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_IPV6_HEADER *ipv6_header; +NX_PACKET *loopback_src_port; +NX_PACKET *broadcast_source; +ULONG broadcast[4] = {0xFF020000, 0, 0, 0x01}; +ULONG checksum; +ULONG *source_ip, *dest_ip; +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the source IP equal to destination IP. Verify whether or not system crashes. */ + + /* Copy from the original packet. */ + nx_packet_copy(packet_ptr, &loopback_src_port, &pool_0, NX_NO_WAIT); + + /* Get IPv6 header. */ + ipv6_header = (NX_IPV6_HEADER *)loopback_src_port -> nx_packet_ip_header; + + /* Copy the dest ip to source ip field. */ + COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_destination_ip, + ipv6_header -> nx_ip_header_source_ip); + + /* Calculate the checksum. */ + source_ip = ipv6_header -> nx_ip_header_source_ip; + dest_ip = ipv6_header -> nx_ip_header_destination_ip; + tcp_header_ptr = (NX_TCP_HEADER *) loopback_src_port -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + checksum = _nx_ip_checksum_compute(loopback_src_port, NX_PROTOCOL_TCP, + loopback_src_port -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Pass the packet. */ + _nx_tcp_packet_receive(ip_ptr, loopback_src_port); + +#ifndef NX_DISABLE_TCP_INFO + if (ip_ptr -> nx_ip_tcp_invalid_packets != 1) + error_counter++; +#endif /* NX_DISABLE_TCP_INFO */ + + /* Copy from the original packet. */ + nx_packet_copy(packet_ptr, &broadcast_source, &pool_0, NX_NO_WAIT); + + /* Get IPv6 header. */ + ipv6_header = (NX_IPV6_HEADER *)broadcast_source -> nx_packet_ip_header; + + /* Copy the broadcast address to source IP field. */ + COPY_IPV6_ADDRESS(broadcast, ipv6_header -> nx_ip_header_source_ip); + + /* Calculate the checksum. */ + source_ip = ipv6_header -> nx_ip_header_source_ip; + dest_ip = ipv6_header -> nx_ip_header_destination_ip; + tcp_header_ptr = (NX_TCP_HEADER *)broadcast_source -> nx_packet_prepend_ptr; + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + checksum = _nx_ip_checksum_compute(broadcast_source, NX_PROTOCOL_TCP, + broadcast_source -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Pass the packet. */ + _nx_tcp_packet_receive(ip_ptr, broadcast_source); + +#ifndef NX_DISABLE_TCP_INFO + if (ip_ptr -> nx_ip_tcp_invalid_packets != 2) + error_counter++; +#endif /* NX_DISABLE_TCP_INFO */ + + /* Restore tcp receive function pointer. */ + ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Pass the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP IPv6 Basic Processing Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_ipv6_delayed_retransmission_test.c b/test/regression/netxduo_test/netx_tcp_ipv6_delayed_retransmission_test.c new file mode 100644 index 00000000..05a94165 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ipv6_delayed_retransmission_test.c @@ -0,0 +1,390 @@ +/* This NetX test concentrates on delayed retransmission TCP packet. + * 1. Send packet A. + * 2. Drop packet A in driver. + * 3. Send packet B, C and D. + * 4. Retransmit packet A. + * 5. Copy the data in A and transmit it. Delay packet A for 1 seconds. + * 6. Wait 2 seconds. + * 7. Check all packets are released. + * 8. Check no invalid packet released. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#ifdef FEATURE_NX_IPV6 +#include "nx_ram_network_driver_test_1500.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NXD_ADDRESS ipv6_address_0; +static NXD_ADDRESS ipv6_address_1; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +static NX_PACKET *drop_packet; +static NX_PACKET *duplicate_packet; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_delayed_retransmission_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_packet = NX_NULL; + duplicate_packet = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_0.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_0.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_0.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_0.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP IPv6 Delayed Retransmission Test......................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_1, 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Set driver packet process callback. */ + advanced_packet_process_callback = packet_process; + + for (i = 0; i < 4; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "A", 1, &pool_0, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + if (i == 0) + { + + /* Drop the first packet. */ + drop_packet = my_packet; + } + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Wait two seconds. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Verify all packets are released from TX queue. */ + if (client_socket.nx_tcp_socket_tx_outstanding_bytes != 0) + error_counter++; + + /* Verify pool is full. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + error_counter++; + +#ifndef NX_DISABLE_PACKET_INFO + /* Verify no packet is released invalid. */ + if (pool_0.nx_packet_pool_invalid_releases != 0) + error_counter++; +#endif /* NX_DISABLE_PACKET_INFO */ + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 4; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "A", 1)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if (packet_ptr == drop_packet) + { + + /* This packet should be dropped. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + /* Duplicate this packet next time. */ + duplicate_packet = drop_packet; + drop_packet = NX_NULL; + } + else if (packet_ptr == duplicate_packet) + { + + /* This packet should be duplicated and delayed for 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + if (nx_packet_allocate(&pool_0, &duplicate_packet, 16, NX_NO_WAIT) == NX_SUCCESS) + { + + /* Copy data from original packet. */ + memcpy(duplicate_packet -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_prepend_ptr, + packet_ptr -> nx_packet_length); + duplicate_packet -> nx_packet_length = packet_ptr -> nx_packet_length; + duplicate_packet -> nx_packet_append_ptr += duplicate_packet -> nx_packet_length; + + /* Let IP 0 receive the packet. */ + _nx_ip_packet_deferred_receive(&ip_1, duplicate_packet); + } + else + { + error_counter++; + } + + duplicate_packet = NX_NULL; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_delayed_retransmission_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP IPv6 Delayed Retransmission Test......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_ipv6_interface2_mss_test.c b/test/regression/netxduo_test/netx_tcp_ipv6_interface2_mss_test.c new file mode 100644 index 00000000..e08475d6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ipv6_interface2_mss_test.c @@ -0,0 +1,379 @@ +/* This NetX test use the second interface send a larger packet with IPv6 address + to test the TCP MSS process procedure. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static CHAR rcv_buffer[600]; +static INT recv_length = 0; + +static CHAR msg[600]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS ipv6_address_3; +static NXD_ADDRESS ipv6_address_4; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_interface2_mss_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_512); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + int i; + + for(i=0;i<600;i++) + { + msg[i]=rand(); + } + + /* Print out test information banner. */ + printf("NetX Test: TCP IPv6 Interface2 MSS Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 600, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = _nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_4, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Point to new receive function */ + ip_1.nx_ip_tcp_packet_receive = packet_receive; + + status = nx_packet_allocate(&pool_0, &my_packet1, NX_IPv6_TCP_PACKET, NX_WAIT_FOREVER); + + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* create packet */ + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 550); + my_packet1 -> nx_packet_length = 550; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 550; + my_packet1 -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Check for error. */ + if(status) + error_counter++; + + /* Send packet */ + status += nx_tcp_socket_send(&client_socket, my_packet1, 2 * NX_IP_PERIODIC_RATE); + + tx_thread_relinquish(); + + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(status) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 650, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + UINT length; + + /* Data length equal to packet length - 20 */ + length = packet_ptr -> nx_packet_length - 20; + + if(length > client_socket.nx_tcp_socket_connect_mss) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Copy the packet */ + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr + 20, length); + recv_length += length; + + /* Check whether or not the last packet */ + if(length < client_socket.nx_tcp_socket_connect_mss) + { + /* The packet is the lastest packet, compare the packet and receive_length */ + if(memcmp(rcv_buffer,msg,packet_ptr -> nx_packet_length) || recv_length != 550) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to default function */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + } + + /* Set client_socket's outstangding bytes to 0 */ + client_socket.nx_tcp_socket_tx_outstanding_bytes = 0; + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_interface2_mss_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP IPv6 Interface2 MSS Test..............................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_ipv6_window_scale_test.c b/test/regression/netxduo_test/netx_tcp_ipv6_window_scale_test.c new file mode 100644 index 00000000..e7a82aad --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_ipv6_window_scale_test.c @@ -0,0 +1,361 @@ +/* This NetX test to test the TCP window scale with IPv6 address. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_TCP_WINDOW_SCALING) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define MSG "----------abcdefgh20----------ABCDEFGH40----------klmnopqr60----------KLMNOPQR80----------" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; +NXD_ADDRESS ipv6_address_5; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_window_scale_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_512); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + ipv6_address_5.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_5.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_5.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[3] = 0x10000005; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2,64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3,64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4,64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Check ICMP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet; + char *msg = MSG; + + /* Print out test information banner. */ + printf("NetX Test: TCP ipv6 window scale Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 66000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = _nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_4, 12, 5 * NX_IP_PERIODIC_RATE); + + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check WINDOW SCALE information */ + if(server_socket.nx_tcp_rcv_win_scale_value != 1 || client_socket.nx_tcp_rcv_win_scale_value != 1 || server_socket.nx_tcp_socket_tx_window_advertised != 66000) + { + error_counter ++; + } + + /* Create a packet */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Fill in the packet with data */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet -> nx_packet_length = 20; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 20; + + /* Send the my_packet */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + tx_thread_relinquish(); + + /* Check status */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the information about WINDOW SCALE */ + if(server_socket.nx_tcp_socket_tx_window_advertised != 66000 || client_socket.nx_tcp_socket_tx_window_advertised != 65980) + { + error_counter ++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + ULONG actual_status; + NX_PACKET *my_packet1; + char *msg = MSG; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 66000, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Create a packet */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check the status */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Fill in the packet with data */ + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + /* Send the my_packet1 */ + status = nx_tcp_socket_send(&server_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Check the status */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_ipv6_window_scale_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP ipv6 window scale Test................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_keepalive_test.c b/test/regression/netxduo_test/netx_tcp_keepalive_test.c new file mode 100644 index 00000000..4e61b091 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_keepalive_test.c @@ -0,0 +1,302 @@ +/* This NetX test concentrates on the basic TCP Keepalive operation. + keepalive expiration time is 60s, + After initial expiration, retry every 10s, + Retry a maximum of 10 tims. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_TCP_KEEPALIVE) && (NX_TCP_KEEPALIVE_INITIAL == 60) && (NX_TCP_KEEPALIVE_RETRY == 10) && (NX_TCP_KEEPALIVE_RETRIES == 10) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG ip_0_ack_counter = 0; +static ULONG ip_1_ack_counter = 0; +static ULONG ip_0_rst_counter = 0; +static ULONG ip_1_rst_counter = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_0_disconnect_received(NX_TCP_SOCKET *server_socket); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_keepalive_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Keepalive Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_0_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 11, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set the callback function to detect the socket keepalive packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Waiting for keepalive message. */ + tx_thread_sleep(200 * NX_IP_PERIODIC_RATE); + + /* Check the socket state. */ +#ifdef __PRODUCT_NETXDUO__ + if ((client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE)) +#else + if ((client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) || (server_socket.nx_tcp_socket_state != NX_TCP_CLOSED)) +#endif + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the counter. */ +#ifdef __PRODUCT_NETXDUO__ + if ((error_counter !=0) || (ip_0_ack_counter != 10) || (ip_0_rst_counter != 1) || (ip_1_ack_counter != 10) || (ip_1_rst_counter != 1)) +#else + if ((error_counter !=0) || (ip_0_ack_counter != 9) || (ip_0_rst_counter != 1) || (ip_1_ack_counter != 9) || (ip_1_rst_counter != 1)) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + + /* Only detect the TCP packet. */ + if (packet_ptr ->nx_packet_length < 40) + return NX_TRUE; + + /* Get the TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + /* Swap the data. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + /* Check the IP ptr. */ + if (ip_ptr == &ip_0) + ip_0_ack_counter ++; + else + ip_1_ack_counter ++; + } + + /* Release the keepalive packet to let socket resend the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + return NX_TRUE; +} + +static void thread_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket == &client_socket) + ip_0_rst_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket == &server_socket) + ip_1_rst_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_keepalive_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Keepalive Test........................................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_tcp_large_data_transfer_test.c b/test/regression/netxduo_test/netx_tcp_large_data_transfer_test.c new file mode 100644 index 00000000..bbf75566 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_large_data_transfer_test.c @@ -0,0 +1,295 @@ +/* This NetX test concentrates on the large data of TCP transmission. */ +/* Payload size of pool is 1536. Host A sends 8k bytes. */ + +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static UCHAR send_buff[8192]; +static UCHAR recv_buff[8192]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_large_data_transfer_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +UINT i; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = 0xFF; + recv_buff[i] = 0; + } + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1516, pointer, 30000); + pointer = pointer + 30000; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Large Data Transfer Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), + &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG total_length = 0; +ULONG bytes_copied; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 3 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Retrieve data. */ + nx_packet_data_retrieve(packet_ptr, recv_buff + total_length, &bytes_copied); + total_length += bytes_copied; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check received data. */ + if (total_length != sizeof(send_buff)) + error_counter++; + else if (memcmp(send_buff, recv_buff, sizeof(send_buff)) != 0) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_large_data_transfer_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Large Data Transfer Test..............................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_large_mtu_test.c b/test/regression/netxduo_test/netx_tcp_large_mtu_test.c new file mode 100644 index 00000000..dd40f231 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_large_mtu_test.c @@ -0,0 +1,318 @@ +/* This NetX test concentrates initial cwnd size with large MTU. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_3000(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_large_mtu_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_3000, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_3000, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG tcp_transmit_window; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Large MTU Test........................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create the client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Get TCP transmit window size. */ + status = nx_tcp_socket_info_get(&client_socket, NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, &tcp_transmit_window, + NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Verify the cwnd is 2MSS. */ + if ((tcp_transmit_window != client_socket.nx_tcp_socket_connect_mss * 2) || + (tcp_transmit_window != client_socket.nx_tcp_socket_tx_window_congestion)) + { + error_counter++; + } + + /* Disconnect from server. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unbind the client socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create the server socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Listen the socket. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Accept connection from client. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Verify the cwnd is 2MSS. */ + if (server_socket.nx_tcp_socket_tx_window_congestion != server_socket.nx_tcp_socket_connect_mss * 2) + { + error_counter++; + } + + /* Disconnect from client. */ + status = nx_tcp_socket_disconnect(&server_socket, 5); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_large_mtu_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Large MTU Test........................................N/A\n"); + + test_control_return(3); + +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_tcp_large_mtu_test2.c b/test/regression/netxduo_test/netx_tcp_large_mtu_test2.c new file mode 100644 index 00000000..bf340f8a --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_large_mtu_test2.c @@ -0,0 +1,351 @@ +/* This NetX test concentrates initial cwnd size with large MTU. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_3000(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_large_mtu_test_2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver_3000, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +ULONG tcp_transmit_window; +ULONG mss; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Large MTU Test 2......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create the client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Get TCP transmit window size. */ + status = nx_tcp_socket_info_get(&client_socket, NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, &tcp_transmit_window, + NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Verify the cwnd is 3MSS. */ + if ((tcp_transmit_window != client_socket.nx_tcp_socket_connect_mss * 3) || + (tcp_transmit_window != client_socket.nx_tcp_socket_tx_window_congestion)) + { + error_counter++; + } + + /* Get client MSS. */ + status = nx_tcp_socket_mss_get(&client_socket, &mss); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Verify connection MSS. */ + if (mss != 1460) + { + error_counter++; + } + + /* Disconnect from server. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unbind the client socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; +ULONG mss; + + /* Create the server socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Listen the socket. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Accept connection from client. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Get client MSS. */ + status = nx_tcp_socket_mss_get(&server_socket, &mss); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Verify connection MSS. */ + if (mss != 1460) + { + error_counter++; + } + + /* Verify the cwnd is 3MSS. */ + if (server_socket.nx_tcp_socket_tx_window_congestion != server_socket.nx_tcp_socket_connect_mss * 3) + { + error_counter++; + } + + /* Disconnect from client. */ + status = nx_tcp_socket_disconnect(&server_socket, 5); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_large_mtu_test_2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Large MTU Test 2......................................N/A\n"); + + test_control_return(3); + +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_tcp_listen_packet_leak_test.c b/test/regression/netxduo_test/netx_tcp_listen_packet_leak_test.c new file mode 100644 index 00000000..b580853e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_listen_packet_leak_test.c @@ -0,0 +1,339 @@ +/* This NetX test concentrates on the basic TCP operation. */ +/* Test Process: +Step1. Let IP1(Server Socket) is on listen mode. +step2. Client Socket send SYN packet to IP1, IP1 queue the SYN packet on listen queue. +Step3. Client Socket send RST packet to IP1 +Step4. Check if SYN and RST packet both are released. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET client_socket_2; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_listen_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_TCP_HEADER tcp_header; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Listen Packet Leak Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Check if queue the SYN packet. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current != 1) + error_counter++; + + /* Build TCP header. */ + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + + /* Send the RST packet. We just want to create a fake header, so assume this packet is incoming packet. */ + tcp_header.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_tx_sequence; + tcp_header.nx_tcp_sequence_number = client_socket.nx_tcp_socket_rx_sequence; + + /* Send RST. */ + _nx_tcp_packet_send_rst(&client_socket, &tcp_header); + + /* Check if the SYN and RST both are released. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + /* Check the queue count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current != 0) + error_counter++; + + /* Disconnect the socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + + /* Test multiple SYN packet with different source port. */ + /* Create a socket 2. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_2, "Client Socket 2", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_2, 0x90, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket_2, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Check if queue the SYN packet. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current != 1) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_NO_WAIT); + + /* Check status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Check if queue the SYN packet. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current != 2) + error_counter++; + + /* Build TCP header. */ + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + + /* Send the RST packet. We just want to create a fake header, so assume this packet is incoming packet. */ + tcp_header.nx_tcp_acknowledgment_number = client_socket.nx_tcp_socket_tx_sequence; + tcp_header.nx_tcp_sequence_number = client_socket.nx_tcp_socket_rx_sequence; + + /* Send RST to reset the second SYN. */ + _nx_tcp_packet_send_rst(&client_socket, &tcp_header); + + /* Check if the second SYN and the third RST both are released. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total - 1) + { + error_counter++; + } + + /* Check the queue count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current != 1) + error_counter++; + + /* Build TCP header. */ + tcp_header.nx_tcp_header_word_3 = NX_TCP_ACK_BIT; + + /* Send the RST packet. We just want to create a fake header, so assume this packet is incoming packet. */ + tcp_header.nx_tcp_acknowledgment_number = client_socket_2.nx_tcp_socket_tx_sequence; + tcp_header.nx_tcp_sequence_number = client_socket_2.nx_tcp_socket_rx_sequence; + + /* Send RST to reset the first SYN. */ + _nx_tcp_packet_send_rst(&client_socket_2, &tcp_header); + + /* Check if the first SYN and RST both are released. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + /* Check the queue count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_queue_current != 0) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Unaccept the server socket to let IP1 on listen mode. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check status. */ + if(status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_listen_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Listen Packet Leak Test...............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_listen_test.c b/test/regression/netxduo_test/netx_tcp_listen_test.c new file mode 100644 index 00000000..d8c86254 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_listen_test.c @@ -0,0 +1,332 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET server_socket_1; +static NX_TCP_SOCKET server_socket_2; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_listen_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Listen Test..........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Should return some error message. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &client_socket, 5, NX_NULL); + if (status != NX_ALREADY_BOUND) + error_counter++; + +#ifdef __PRODUCT_NETXDUO__ + /* Should return some error message since server socket is accepting. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status != NX_NOT_LISTEN_STATE) + error_counter++; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_1, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_2, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* server_socket listen again. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status != NX_NOT_CLOSED) + error_counter++; + + /* server_socket_1 listen at port 13. */ + status = nx_tcp_server_socket_listen(&ip_1, 13, &server_socket_1, 5, NX_NULL); + if (status) + error_counter++; + + /* server_socket_2 listen at port 13. Should return duplicate error */ + status = nx_tcp_server_socket_listen(&ip_1, 13, &server_socket_2, 5, NX_NULL); + if (status != NX_DUPLICATE_LISTEN) + error_counter++; + + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 13. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 13); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_listen_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Listen Test...........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_loopback_test.c b/test/regression/netxduo_test/netx_tcp_loopback_test.c new file mode 100644 index 00000000..1da64a78 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_loopback_test.c @@ -0,0 +1,391 @@ +/* This NetX test concentrates on the TCP loopback operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 4096; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + tx_thread_relinquish(); + + + /* Print out some test information banners. */ + printf("NetX Test: TCP Loopback Processing Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 13, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Loop to send 1,000 packets. */ + thread_0_counter = 0; + while (thread_0_counter < 1000) + { + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if ((thread_0_counter & 3) == 0) + { + + /* Disable all interface capability. */ + nx_ip_interface_capability_set(&ip_0, 0, 0); + } + else if ((thread_0_counter & 3) == 1) + { + + /* Enable all TX checksum capability. */ + nx_ip_interface_capability_set(&ip_0, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM); + } + else if ((thread_0_counter & 3) == 2) + { + + /* Enable all RX checksum capability. */ + nx_ip_interface_capability_set(&ip_0, 0, NX_INTERFACE_CAPABILITY_IPV4_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_RX_CHECKSUM); + } + else if ((thread_0_counter & 3) == 3) + { + + /* Enable all checksum capability. */ + nx_ip_interface_capability_set(&ip_0, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IPV4_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_RX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_RX_CHECKSUM); + } +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine how to report error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG expected_length = 0; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Loop to create and establish server connections. */ + thread_1_counter = 0; + while(thread_1_counter < 1000) + { + + if(expected_length == 0) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + expected_length = 28; + } + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + + expected_length -= packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Loopback Processing Test..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_max_window_scale_test.c b/test/regression/netxduo_test/netx_tcp_max_window_scale_test.c new file mode 100644 index 00000000..2d2a9664 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_max_window_scale_test.c @@ -0,0 +1,454 @@ +/* This NetX test concentrates on the TCP MAX windows scale operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +extern void test_control_return(UINT status); + +#if defined(NX_ENABLE_TCP_WINDOW_SCALING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG syn_counter; + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern USHORT _nx_ip_checksum_compute(NX_PACKET *packet_ptr, ULONG protocol, + UINT data_length, ULONG* src_ip_addr, + ULONG* dest_ip_addr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_max_window_scale_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + syn_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_tcp_enable(&ip_1); + if(status) + error_counter++; + +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; + + /* Print out test information banner. */ + printf("NetX Test: TCP MAX Window Scale Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, ((1<<30)-1), + NX_NULL, ntest_0_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + ip_0.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* The window scale value is modified to 0xFF which is larger than 14. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + if(syn_counter == 1) + { + /*Check whether the connection has crashed*/ + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + + /* Check the windows size. */ + if ((client_socket.nx_tcp_socket_rx_window_default != ((1<<30)-1)) || (client_socket.nx_tcp_socket_rx_window_current != ((1<<30)-1)) || + (server_socket.nx_tcp_socket_rx_window_default != ((1<<30)-1)) || (server_socket.nx_tcp_socket_rx_window_current != ((1<<30)-1))) + error_counter++; + } + else + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Relisten. */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* The window scale option is removed from syn packet. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /*Check whether the connection has crashed*/ + if((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + error_counter++; + + /* Check the windows size. */ + if ((client_socket.nx_tcp_socket_rx_window_default != 0xFFFF) || (client_socket.nx_tcp_socket_rx_window_current != 0xFFFF) || + (server_socket.nx_tcp_socket_rx_window_default != 0xFFFF) || (server_socket.nx_tcp_socket_rx_window_current != 0xFFFF)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, ((1<<30)-1), + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Set the window size no less than 2^30. */ + client_socket.nx_tcp_socket_rx_window_default = ((ULONG)1<<31) - 1; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /*To handle the syn packet.*/ + advanced_packet_process_callback = my_packet_process; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if((error_counter != 0) || (syn_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG *option_word_2; +ULONG checksum; +ULONG *source_ip, *dest_ip; + + tcp_header_ptr = (NX_TCP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + option_word_2 = option_word_1 + 1; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* If this is a tcp packet but not an ARP packet or other kind packet. */ + if(packet_ptr -> nx_packet_length >= 40) + { + /* Chcek whether it is a SYN packet. */ + if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(*option_word_2); + + if (syn_counter == 0) + { + + /* Modify the Window scale option to 0xFF which is larger than 14. */ + *option_word_2 = *option_word_2 | 0x0000FF00; + } + else + { + + /* Remove window scale option. */ + *option_word_2 = NX_TCP_OPTION_END; + } + + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(*option_word_2); + + /*Put the packet pointer to tcp*/ + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); + + } + else + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + return NX_TRUE; + } + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG *option_word_2; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + option_word_2 = ((ULONG *)(header_ptr + 1)) + 1; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Server receives a SYN packet. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && !(header_ptr -> nx_tcp_header_word_3 & NX_TCP_RST_BIT)) + { + NX_CHANGE_ULONG_ENDIAN(*option_word_2); + syn_counter++; + + NX_CHANGE_ULONG_ENDIAN(*option_word_2); + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Pass the packet to the default function. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_max_window_scale_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP MAX Window Scale Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_mss_option_test.c b/test/regression/netxduo_test/netx_tcp_mss_option_test.c new file mode 100644 index 00000000..d8a0c055 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_mss_option_test.c @@ -0,0 +1,428 @@ +/* This NetX test concentrates on the TCP Socket relisten operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +#define CLIENT_PORT 0x88 +#define SERVER_PORT 0x89 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT syn_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void tcp_checksum_compute(NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_mss_option_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP MSS Option Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, CLIENT_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Send NOP KIND option in my_tcp_packet_receive. */ + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Send invalid option in my_tcp_packet_receive. */ + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Send invalid option in my_tcp_packet_receive. */ + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_TCP_MSS_CHECK + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Send mss smaller than minimum in my_tcp_packet_receive. */ + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_ENABLE_TCP_MSS_CHECK */ + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + while (1) + { + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the mss value. */ + if (server_socket.nx_tcp_socket_peer_mss != 536) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + } +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; + + /* Update the counter. */ + syn_counter ++; + + /* Get the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Check the counter. */ + if (syn_counter == 1) + { + + /* Set the NOP KIND option. */ + *option_word_1 = NX_TCP_NOP_KIND << 24; + } + + /* Check the counter. */ + if (syn_counter == 2) + { + + /* Set the invalid Option. */ + *option_word_1 = 0x04000000; + } + + /* Check the counter. */ + if (syn_counter == 3) + { + + /* Set the invalid Option. */ + *option_word_1 = 0x04090000; + } + +#ifdef NX_ENABLE_TCP_MSS_CHECK + /* Check the counter. */ + if (syn_counter == 4) + { + + /* Set the mss smaller than minimum. */ + *option_word_1 = NX_TCP_MSS_OPTION | (NX_TCP_MSS_MINIMUM - 1); + } +#endif /* NX_ENABLE_TCP_MSS_CHECK */ + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + + /* Calculate the TCP checksum. */ + tcp_checksum_compute(packet_ptr); + + /* Clear the callback function. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +static void tcp_checksum_compute(NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *source_ip, *dest_ip; +ULONG checksum; + + if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) + { + + /* Get IPv4 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 8); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 4); + } + else + { + + /* Get IPv6 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 32); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 16); + } + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_mss_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP MSS Option Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_multiple_send_test.c b/test/regression/netxduo_test/netx_tcp_multiple_send_test.c new file mode 100644 index 00000000..664b948d --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_multiple_send_test.c @@ -0,0 +1,342 @@ +/* This NetX test concentrates on sending TCP packets in multiple threads simultaneously. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +static UCHAR pool_area_0[20480]; +static UCHAR pool_area_1[20480]; + +static CHAR send_buff[512]; + +static ULONG end_time; + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG thread_2_counter; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_multiple_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + thread_0_counter = 0; + thread_1_counter = 0; + thread_2_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, 1, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, 1, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pool_area_0, sizeof(pool_area_0)); + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pool_area_1, sizeof(pool_area_1)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Multiple Send Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Reset the system timer. */ + tx_time_set(0); + + /* Set the timer that stops sending. */ + end_time = NX_IP_PERIODIC_RATE; + + /* Resume thread 1. */ + tx_thread_resume(&thread_1); + + while (tx_time_get() < end_time) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + thread_0_counter++; + } + + /* Sleep 1 second to make sure thread 1 exists. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + while (tx_time_get() < end_time) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + thread_1_counter++; + } +} + + +static void thread_2_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Release the packet. */ + nx_packet_release(packet_ptr); + thread_2_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_multiple_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Multiple Send Test....................................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_tcp_multiple_send_test2.c b/test/regression/netxduo_test/netx_tcp_multiple_send_test2.c new file mode 100644 index 00000000..e2ecc7a6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_multiple_send_test2.c @@ -0,0 +1,343 @@ +/* This NetX test concentrates on sending TCP packets in multiple threads simultaneously. + Hit the conidtion in _nx_tcp_socket_send_internal: 684 [ + - ]: if (send_packet != packet_ptr) */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +static UCHAR pool_area_0[20480]; +static UCHAR pool_area_1[20480]; + +static CHAR send_buff[200]; + +static ULONG end_time; + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG thread_2_counter; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_multiple_send_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + thread_0_counter = 0; + thread_1_counter = 0; + thread_2_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, 1, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, 1, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pool_area_0, sizeof(pool_area_0)); + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pool_area_1, sizeof(pool_area_1)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Multiple Send Test2..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Reset the system timer. */ + tx_time_set(0); + + /* Set the timer that stops sending. */ + end_time = NX_IP_PERIODIC_RATE; + + /* Resume thread 1. */ + tx_thread_resume(&thread_1); + + while (tx_time_get() < end_time) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + thread_0_counter++; + } + + /* Sleep 1 second to make sure thread 1 exists. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + while (tx_time_get() < end_time) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + thread_1_counter++; + } +} + + +static void thread_2_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Release the packet. */ + nx_packet_release(packet_ptr); + thread_2_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_multiple_send_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Multiple Send Test2...................................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test1.c b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test1.c new file mode 100644 index 00000000..299fe340 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test1.c @@ -0,0 +1,616 @@ +/* This NetX test concentrates on fast retransmit. */ + +/* Procedure: +1. Client connect with Server. +2. Client send five segments to Server. +3. Drop the first and second segments in the driver. +4. Server send three duplicate ACKs with acknowledgment number as the sequence number of first segment. +5. Client fast retransmits the first segment. +6. Server send ACK with acknowledgment number as the second number of first segment. +7. Client fast retransmits the second segment. +8. Server receives the segment and check the segments data. +9. Disconnect. +10. Print the result. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the messsage. */ +static CHAR msg[200]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static ULONG ack_counter; +static ULONG client_tx_sequnce; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test1_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet[5]; + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test1.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Random genearte the data. */ + for (i = 0; i < 200; i ++) + msg[i] = (CHAR)rand(); + + /* Create 5 packets. */ + for (i = 0; i < 5; i ++) + { + + /* Allocate the packet. */ + status += nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check the status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + memcpy(my_packet[i] -> nx_packet_prepend_ptr, &msg[i*20], 20); + my_packet[i] -> nx_packet_length = 20; + my_packet[i] -> nx_packet_append_ptr = my_packet[i] -> nx_packet_prepend_ptr + 20; + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = client_tcp_packet_receive; + + /* Record the client tx_sequence. */ + client_tx_sequnce = client_socket.nx_tcp_socket_tx_sequence; + + /* Loop to send packets. */ + for (i = 0; i < 5; i ++) + { + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet[i], NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + error_counter++; + } + } + + /* Disable timeout retransmit. */ + client_socket.nx_tcp_socket_timeout = 60 * 60 * _nx_tcp_fast_timer_rate; + + /* Sleep 1 second to let server receive segments. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 100) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + + /* Reset the callback functions. */ + advanced_packet_process_callback = NX_NULL; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check the data length. */ + if(recv_length != 100) + error_counter++; + + /* Check the data. */ + if(memcmp(rcv_buffer, msg, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if ((error_counter) || (packet_counter != 7) || (ack_counter < 5)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Ingore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + /* Check the data length. */ + if(packet_ptr -> nx_packet_length == 60) + { + + /* Update the counter. */ + packet_counter ++; + + /* Check the packet counter. */ + if ((packet_counter == 1) || (packet_counter == 2)) + { + + /* Discard the first and second segments. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + /* Check the sequence number. */ + if (packet_counter == 1) + { + + /* Should be 1th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce) + { + error_counter ++; + } + } + else if (packet_counter == 2) + { + + /* Should be 2th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 20) + { + error_counter ++; + } + } + else if (packet_counter == 3) + { + + /* Should be 3th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 40) + { + error_counter ++; + } + } + else if (packet_counter == 4) + { + + /* Should be 4th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 60) + { + error_counter ++; + } + } + else if (packet_counter == 5) + { + + /* Should be 5th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 80) + { + error_counter ++; + } + } + else if (packet_counter == 6) + { + + /* Should be 1th segment retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 100) + { + error_counter ++; + } + } + else if (packet_counter == 7) + { + + /* Should be 2th segment retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 20) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 100) + { + error_counter ++; + } + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + return NX_TRUE; +} + +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + /* Update the counter. */ + ack_counter++; + + /* This should be duplicate ACKs. */ + if ((ack_counter == 1) || (ack_counter == 2) || (ack_counter == 3)) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != ack_counter - 1) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + } + /* This should be normal ACK for 1th segment in fast recovery. */ + else if (ack_counter == 4) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 20) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 100) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 3) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + /* This should be normal ACK for 2th segment in fast recovery. */ + else if (ack_counter == 5) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 100) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 100) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + /* Other ACKs for window update when call nx_tcp_socket_receive API. */ + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test1_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test1..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test2.c b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test2.c new file mode 100644 index 00000000..e769eab1 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test2.c @@ -0,0 +1,711 @@ +/* This NetX test concentrates on fast retransmit. */ + +/* Procedure: +1. Client connect with Server. +2. Client send ten segments to Server. +3. Drop the 2th, 3th, 4th, 6th, 7th, 8th segments in the driver. +4. Server send three duplicate ACKs with acknowledgment number as the sequence number of 2th segment. +5. Client should fast retransmits the 2th, 3th, 4th, 6th, 7th, 8th segment. +6. Server receives the segment and check the segments data. +7. Disconnect. +8. Print the result. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the messsage. */ +static CHAR msg[200]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static ULONG ack_counter; +static ULONG client_tx_sequnce; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512 * 30); + pointer = pointer + 512 * 30; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet[10]; + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test2.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Random genearte the data. */ + for (i = 0; i < 200; i ++) + msg[i] = (CHAR)rand(); + + /* Create 10 packets. */ + for (i = 0; i < 10; i ++) + { + + /* Allocate the packet. */ + status += nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check the status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + memcpy(my_packet[i] -> nx_packet_prepend_ptr, &msg[i*20], 20); + my_packet[i] -> nx_packet_length = 20; + my_packet[i] -> nx_packet_append_ptr = my_packet[i] -> nx_packet_prepend_ptr + 20; + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = client_tcp_packet_receive; + + /* Record the client tx_sequence. */ + client_tx_sequnce = client_socket.nx_tcp_socket_tx_sequence; + + /* Loop to send packets. */ + for (i = 0; i < 10; i ++) + { + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet[i], NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + error_counter++; + } + } + + /* Disable timeout retransmit. */ + client_socket.nx_tcp_socket_timeout = 60 * 60 * _nx_tcp_fast_timer_rate; + + /* Sleep 2 second to let server receive segments. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + + /* Reset the callback functions. */ + advanced_packet_process_callback = NX_NULL; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check the data length. */ + if(recv_length != 200) + error_counter++; + + /* Check the data. */ + if(memcmp(rcv_buffer, msg, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if ((error_counter) || (packet_counter != 16) || (ack_counter < 10)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Ingore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + /* Check the data length. */ + if(packet_ptr -> nx_packet_length == 60) + { + + /* Update the counter. */ + packet_counter ++; + + /* Discard the 2th, 3th, 4th, 6th, 7th, 8th segments. */ + if ((packet_counter == 2) || (packet_counter == 3) || (packet_counter == 4) || + (packet_counter == 6) || (packet_counter == 7) || (packet_counter == 8)) + { + + /* Discard the segments. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + /* Check the sequence number. */ + if ((packet_counter <= 10)) + { + + /* Should be 1th ~ 10th segments. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != (client_tx_sequnce + (packet_counter -1) * 20)) + { + error_counter ++; + } + } + else if ((packet_counter >= 11) && + (packet_counter <= 16)) + { + + if ((packet_counter >= 11) && + (packet_counter <= 13)) + { + + /* Should be 2th, 3th, 4th segments retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + (packet_counter -10) * 20) + { + error_counter ++; + } + } + else if ((packet_counter >= 14) && + (packet_counter <= 16)) + { + + /* Should be 6th, 7th, 8th segments retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + (packet_counter - 9) * 20) + { + error_counter ++; + } + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + return NX_TRUE; +} + +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + /* Update the counter. */ + ack_counter++; + + /* This should be normal ACK for 2th segment. */ + if (ack_counter == 1) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 20) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + } + /* This should be duplicate ACKs for 2th segment. */ + else if ((ack_counter == 2) || (ack_counter == 3) || (ack_counter == 4)) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 20) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != ack_counter - 2) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + } + /* This should be normal ACK for 3th segment in fast recovery. */ + else if (ack_counter == 5) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 40) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 3) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + + /* This should be normal ACK for 4th segment in fast recovery. */ + else if (ack_counter == 6) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 60) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + + /* This should be normal ACK for 6th segment in fast recovery. */ + else if (ack_counter == 7) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 100) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + + /* This should be normal ACK for 7th segment in fast recovery. */ + else if (ack_counter == 8) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 120) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + /* This should be normal ACK for 8th segment in fast recovery. */ + else if (ack_counter == 9) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 140) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + /* This should be normal ACK for 11th segment . */ + else if (ack_counter == 10) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 200) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 200) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + } + /* Other ACKs for window update when call nx_tcp_socket_receive API. */ + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test2..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test3.c b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test3.c new file mode 100644 index 00000000..2317bf55 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test3.c @@ -0,0 +1,684 @@ +/* This NetX test concentrates on fast retransmit. */ + +/* Procedure: +1. Client connect with Server. +2. Client send three segments to Server. +3. Drop the 1th segments in the driver. +4. Server send two duplicate ACKs with acknowledgment number as the sequence number of 1th segment. +5. Client should retransmit the 1th when timeout. +6. Server receives the segment and check the segments data. +7. Disconnect. +8. Print the result. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define notify printf("line %d failed.\n", __LINE__) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the messsage. */ +static CHAR msg[200]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static ULONG ack_counter; +static ULONG client_tx_sequnce; +static ULONG start_ticks; +static ULONG end_ticks; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 512 * 30); + pointer = pointer + 512 * 30; + + if(status) + { + notify; + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + { + notify; + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + { + notify; + error_counter++; + } + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + { + notify; + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet[3]; + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test3.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + notify; + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Random genearte the data. */ + for (i = 0; i < 200; i ++) + msg[i] = (CHAR)rand(); + + /* Create 3 packets. */ + for (i = 0; i < 3; i ++) + { + + /* Allocate the packet. */ + status += nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + notify; + error_counter++; + } + + /* Fill in the packet with data. */ + memcpy(my_packet[i] -> nx_packet_prepend_ptr, &msg[i*20], 20); + my_packet[i] -> nx_packet_length = 20; + my_packet[i] -> nx_packet_append_ptr = my_packet[i] -> nx_packet_prepend_ptr + 20; + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = client_tcp_packet_receive; + + /* Record the client tx_sequence. */ + client_tx_sequnce = client_socket.nx_tcp_socket_tx_sequence; + + /* Loop to send packets. */ + for (i = 0; i < 3; i ++) + { + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet[i], NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + notify; + error_counter++; + } + } + + /* Sleep 2 seconds to let client retransmit the 1th segments and server receive segments. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + notify; + error_counter++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + notify; + error_counter++; + } + + /* Reset the callback functions. */ + advanced_packet_process_callback = NX_NULL; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + notify; + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + { + notify; + error_counter++; + } + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check the data length. */ + if(recv_length != 60) + { + notify; + error_counter++; + } + + /* Check the data. */ + if(memcmp(rcv_buffer, msg, recv_length)) + { + notify; + error_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + { + notify; + error_counter++; + } + + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if ((error_counter) || (packet_counter != 6) || (ack_counter < 3)) + { + notify; + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Ingore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + /* Check the data length. */ + if(packet_ptr -> nx_packet_length == 60) + { + + /* Update the counter. */ + packet_counter ++; + + /* Discard the 1th segment. */ + if (packet_counter == 1) + { + + /* Discard the segments. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + /* Check the sequence number. */ + if (packet_counter == 1) + { + + /* Should be 1th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce) + { + notify; + error_counter++; + } + + /* Get the time. */ + start_ticks = tx_time_get(); + } + else if (packet_counter == 2) + { + + /* Should be 2th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 20) + { + notify; + error_counter ++; + } + } + else if (packet_counter == 3) + { + + /* Should be 3th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 40) + { + notify; + error_counter ++; + } + } + else if (packet_counter == 4) + { + + /* Should be 1th segment retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce) + { + notify; + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + notify; + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 60) + { + notify; + error_counter ++; + } + + /* Get the time. */ + end_ticks = tx_time_get(); + + /* Check the time interval, should be in NX_IP_PERIODIC_RATE - _nx_tcp_fast_timer_rate and NX_IP_PERIODIC_RATE. */ + if (((end_ticks - start_ticks) < (NX_IP_PERIODIC_RATE - _nx_tcp_fast_timer_rate)) || + ((end_ticks - start_ticks) > NX_IP_PERIODIC_RATE)) + { + notify; + error_counter ++; + } + } + + else if (packet_counter == 5) + { + + /* Should be 2th segment retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 20) + { + notify; + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + notify; + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 60) + { + notify; + error_counter ++; + } + + /* Get the time. */ + end_ticks = tx_time_get(); + + /* Check the time interval, should be in NX_IP_PERIODIC_RATE - _nx_tcp_fast_timer_rate and NX_IP_PERIODIC_RATE. */ + if (((end_ticks - start_ticks) < (NX_IP_PERIODIC_RATE - _nx_tcp_fast_timer_rate)) || + ((end_ticks - start_ticks) > NX_IP_PERIODIC_RATE)) + { + notify; + error_counter ++; + } + } + + else if (packet_counter == 6) + { + + /* Should be 1th segment retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 40) + { + notify; + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + notify; + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 60) + { + notify; + error_counter ++; + } + + /* Get the time. */ + end_ticks = tx_time_get(); + + /* Check the time interval, should be in NX_IP_PERIODIC_RATE - _nx_tcp_fast_timer_rate and NX_IP_PERIODIC_RATE. */ + if (((end_ticks - start_ticks) < (NX_IP_PERIODIC_RATE - _nx_tcp_fast_timer_rate)) || + ((end_ticks - start_ticks) > NX_IP_PERIODIC_RATE)) + { + notify; + error_counter ++; + } + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + return NX_TRUE; +} + +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + /* Update the counter. */ + ack_counter++; + + /* This should be duplicate ACKs for 1th segment. */ + if ((ack_counter == 1) || (ack_counter == 2)) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce) + { + notify; + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1) + { + notify; + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != ack_counter - 1) + { + notify; + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + notify; + error_counter ++; + } + } + /* This should be normal ACK for 4th segment . */ + else if (ack_counter == 3) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce + 60) + { + notify; + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + notify; + error_counter ++; + } + } + /* Other ACKs for window update when call nx_tcp_socket_receive API. */ + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test3_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test3..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test4.c b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test4.c new file mode 100644 index 00000000..c3b22cf6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test4.c @@ -0,0 +1,590 @@ +/* This NetX test concentrates on fast retransmit. */ + +/* Procedure: +1. Client connect with Server. The sequence number of client is modified to the edge of 32 bit number. +2. Client send five segments to Server. +3. Drop the first segment in the driver. +4. Server send three duplicate ACKs with acknowledgment number as the sequence number of first segment. +5. Client fast retransmits the first segment. +6. Server receives the segment and check the segments data. +7. Disconnect. +8. Print the result. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the messsage. */ +static CHAR msg[200]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG packet_counter; +static ULONG ack_counter; +static ULONG client_tx_sequnce; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test4_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + packet_counter = 0; + ack_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *my_packet[5]; + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test4.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Random genearte the data. */ + for (i = 0; i < 200; i ++) + msg[i] = (CHAR)rand(); + + /* Create 5 packets. */ + for (i = 0; i < 5; i ++) + { + + /* Allocate the packet. */ + status += nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check the status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + memcpy(my_packet[i] -> nx_packet_prepend_ptr, &msg[i*20], 20); + my_packet[i] -> nx_packet_length = 20; + my_packet[i] -> nx_packet_append_ptr = my_packet[i] -> nx_packet_prepend_ptr + 20; + } + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = client_tcp_packet_receive; + + /* Record the client tx_sequence. */ + client_tx_sequnce = client_socket.nx_tcp_socket_tx_sequence; + + /* Loop to send packets. */ + for (i = 0; i < 5; i ++) + { + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet[i], NX_NO_WAIT); + + /* Check the status. */ + if(status) + { + error_counter++; + } + } + + /* Disable timeout retransmit. */ + client_socket.nx_tcp_socket_timeout = 60 * 60 * _nx_tcp_fast_timer_rate; + + /* Sleep 1 second to let server receive segments. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != 0) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + + /* Reset the callback functions. */ + advanced_packet_process_callback = NX_NULL; + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check the data length. */ + if(recv_length != 100) + error_counter++; + + /* Check the data. */ + if(memcmp(rcv_buffer, msg, recv_length)) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if ((error_counter) || (packet_counter != 6) || (ack_counter < 4)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +#ifdef __PRODUCT_NETXDUO__ +ULONG *source_ip, *dest_ip; +#else +ULONG source_ip, dest_ip; +#endif + + /* Ingore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + + /* Check the data length. */ + if(packet_ptr -> nx_packet_length == 60) + { + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + + /* Update the counter. */ + packet_counter ++; + + /* Check the packet counter. */ + if (packet_counter == 1) + { + + /* Discard the first and second segments. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + /* Check the sequence number. */ + if (packet_counter == 1) + { + + /* Should be 1th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce) + { + error_counter ++; + } + } + else if (packet_counter == 2) + { + + /* Should be 2th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 20) + { + error_counter ++; + } + } + else if (packet_counter == 3) + { + + /* Should be 3th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 40) + { + error_counter ++; + } + } + else if (packet_counter == 4) + { + + /* Should be 4th segment. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce + 60) + { + error_counter ++; + } + } + else if (packet_counter == 5) + { + + /* Should be 1th segment retransmitted. */ + if (tcp_header_ptr -> nx_tcp_sequence_number != client_tx_sequnce) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_TRUE) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1 + 80) + { + error_counter ++; + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + } + else if(packet_ptr -> nx_packet_length > 40) + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_SYN_BIT) + { + + /* It is a SYN packet. */ + /* Modify the sequence number. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFFFF - 90 + 1; + client_socket.nx_tcp_socket_tx_sequence_recover = client_socket.nx_tcp_socket_tx_sequence - 1; + client_socket.nx_tcp_socket_previous_highest_ack = client_socket.nx_tcp_socket_tx_sequence - 1; + tcp_header_ptr -> nx_tcp_sequence_number = client_socket.nx_tcp_socket_tx_sequence - 1; + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_sequence_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Clear the checksum field. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum . */ +#if defined(__PRODUCT_NETXDUO__) + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IPV4_HEADER); + + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket. nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IPV4_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IPV4_HEADER); +#else + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length -= sizeof(NX_IP_HEADER); + + dest_ip = client_socket.nx_tcp_socket_connect_ip; + source_ip = ip_0.nx_ip_address; + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + packet_ptr -> nx_packet_prepend_ptr -= sizeof(NX_IP_HEADER); + packet_ptr -> nx_packet_length += sizeof(NX_IP_HEADER); +#endif + + } + else + { + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + } + + return NX_TRUE; +} + +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + /* Update the counter. */ + ack_counter++; + + /* This should be duplicate ACKs. */ + if ((ack_counter == 1) || (ack_counter == 2) || (ack_counter == 3)) + { + + /* Check the acknowledgment number. */ + if (tcp_header_ptr -> nx_tcp_acknowledgment_number != client_tx_sequnce) + { + error_counter ++; + } + + /* Check the recover value. */ + if (client_socket.nx_tcp_socket_tx_sequence_recover != client_tx_sequnce - 1) + { + error_counter ++; + } + + /* Check the duplicate ACKs. */ + if (client_socket.nx_tcp_socket_duplicated_ack_received != ack_counter - 1) + { + error_counter ++; + } + + /* Check the socket fast recovery status. */ + if (client_socket.nx_tcp_socket_fast_recovery != NX_FALSE) + { + error_counter ++; + } + } + } + + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_acknowledgment_number); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test4_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test4..............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test5.c b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test5.c new file mode 100644 index 00000000..40c1a20e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_new_reno_algorithm_test5.c @@ -0,0 +1,370 @@ +/* This NetX test concentrates on fast retransmit. */ + +/* Procedure: +1. Client connect with Server. The sequence number of client is modified to the edge of 32 bit number. +2. Client send five segments to Server. +3. Drop the first segment in the driver. +4. Server send three duplicate ACKs with acknowledgment number as the sequence number of first segment. +5. Client fast retransmits the first segment. +6. Server receives the segment and check the segments data. +7. Disconnect. +8. Print the result. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the messsage. */ +static CHAR msg[3000]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG window_size; +static NX_PACKET *drop_packet; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test5_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + window_size = 0; + drop_packet = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +UINT old_threshold; +NX_PACKET *my_packet[5]; + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test5.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Random genearte the data. */ + for (i = 0; i < sizeof(msg); i ++) + msg[i] = (CHAR)rand(); + + /* Record the window size of server. */ + window_size = client_socket.nx_tcp_socket_tx_window_advertised; + + /* Create 5 packets. */ + for (i = 0; i < 5; i ++) + { + + /* Allocate the packet. */ + status += nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_NO_WAIT); + + /* Check the status. */ + if(status) + error_counter++; + + /* Fill in the packet with data. */ + memcpy(my_packet[i] -> nx_packet_prepend_ptr, &msg[i*(window_size>>2)], (window_size>>2)); + my_packet[i] -> nx_packet_length = (window_size>>2); + my_packet[i] -> nx_packet_append_ptr = my_packet[i] -> nx_packet_prepend_ptr + (window_size>>2); + } + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + drop_packet = my_packet[0]; + + /* Disable preemption. */ + tx_thread_preemption_change(&thread_0, 0, &old_threshold); + + /* Loop to send packets. */ + for (i = 0; i < 5; i ++) + { + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet[i], NX_IP_PERIODIC_RATE); + + /* Check the status. */ + if(status) + { + error_counter++; + } + } + + /* Restore preemption. */ + tx_thread_preemption_change(&thread_0, old_threshold, &old_threshold); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[3000]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check the data length. */ + if(recv_length != (window_size + (window_size>>2))) + error_counter++; + + /* Check the data. */ + if(memcmp(rcv_buffer, msg, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + tx_thread_relinquish(); + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if (packet_ptr == drop_packet) + { + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + drop_packet = NX_NULL; + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_new_reno_algorithm_test5_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP New Reno Algorithm Test5..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_not_enabled_test.c b/test/regression/netxduo_test/netx_tcp_not_enabled_test.c new file mode 100644 index 00000000..b2bbccd6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_not_enabled_test.c @@ -0,0 +1,289 @@ +/* This NetX test concentrates TCP connections when it is not enabled. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_not_enabled_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for IP 0 only. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP not Enabled Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Before enable TCP for IP 1, try connect. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + error_counter++; + + /* Enable TCP processing for IP 1. */ + status = nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Resume thread 1. */ + tx_thread_resume(&thread_1); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_not_enabled_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP not Enabled Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_nxe_api_test.c b/test/regression/netxduo_test/netx_tcp_nxe_api_test.c new file mode 100644 index 00000000..c1e6281a --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_nxe_api_test.c @@ -0,0 +1,2298 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "nx_tcp.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_packet.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +#ifdef __PRODUCT_NETXDUO__ +static NX_PACKET_POOL invalid_pool; +#endif /* __PRODUCT_NETXDUO__ */ +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP invalid_ip; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET invalid_socket; + +/* Define the counters used in the demo application... */ +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void tcp_receive_notify(NX_TCP_SOCKET *socket_ptr); +#if defined(NX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY) && defined(__PRODUCT_NETXDUO__) +static void tcp_socket_queue_depth_notify(NX_TCP_SOCKET *socket_ptr); +#endif +#ifdef __PRODUCT_NETXDUO__ +static void window_update_notify(NX_TCP_SOCKET *socket_ptr); +#endif /* __PRODUCT_NETXDUO__ */ +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet; +NX_PACKET *unknow_packet; +#ifdef __PRODUCT_NETXDUO__ +NX_PACKET invalid_packet; +NX_PACKET *invalid_packet_2; +#endif /* __PRODUCT_NETXDUO__ */ +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS ip_address; +NXD_ADDRESS nxd_ip_address; +#endif +UINT port; +UINT free_port; +ULONG mss, peer_mss, peer_ip_address, peer_port, bytes_available; +ULONG tcp_packets_sent, tcp_bytes_sent, tcp_packets_received, tcp_bytes_received, tcp_invalid_packets, tcp_receive_packets_dropped, tcp_checksum_errors, tcp_connections, tcp_disconnections, tcp_connections_dropped, tcp_retransmit_packets; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, retransmit_packets, packets_queued, checksum_errors, socket_state, transmit_queue_depth, transmit_window, receive_window; + + /* Print out some test information banners. */ + printf("NetX Test: TCP NXE API Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_enable api */ + /************************************************/ + + /* Enable the TCP feature for invalid IP instance. */ + status = nx_tcp_enable(&invalid_ip); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the TCP feature for valid IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the TCP feature for valid IP instance. */ + status = nx_tcp_enable(&ip_1); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable the TCP feature again. */ + status = nx_tcp_enable(&ip_0); + + /* Check for error. */ + if (status != NX_ALREADY_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_create api */ + /************************************************/ + + /* Create the TCP socket for invalid IP instance. */ + status = nx_tcp_socket_create(NX_NULL, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket for invalid IP instance. */ + status = nx_tcp_socket_create(&invalid_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket for invalid socket. */ + status = nx_tcp_socket_create(&ip_0, NX_NULL, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid IP instance parameter. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Create the TCP socket with invalid structure size. */ + status = _nxe_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL, sizeof(NX_TCP_SOCKET) + 1); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket for IP instance with socket. */ + status = nx_tcp_socket_create(&invalid_ip, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket with invalid type of service. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + 0xFFFFFFFF, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket with invalid type of fragment. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, 0xFFFFFFFF, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket with invalid time of live. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_DONT_FRAGMENT, 0xFFFFFFFF, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket with invalid window size. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 0, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + + /* Create the TCP socket with invalid window size. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, (1 << 30), + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Create the TCP socket with valid parameters. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the TCP socket with valid parameters. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create the same Client socket again. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_free_port_find api */ + /************************************************/ + + /* Find the free port with invalid IP instance. */ + status = nx_tcp_free_port_find(NX_NULL, 80, &free_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the invalid IP instance ID. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Find the free port with invalid IP instance ID. */ + status = nx_tcp_free_port_find(&invalid_ip, 80, &free_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the free port with invalid free port pointer. */ + status = nx_tcp_free_port_find(&ip_0, 80, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid IP instance ID. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Find the free port when disable the TCP feature. */ + status = nx_tcp_free_port_find(&invalid_ip, 80, &free_port); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Find the free port with invalid port. */ + status = nx_tcp_free_port_find(&ip_0, 0xFFFFFFFF, &free_port); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_info_get api */ + /************************************************/ + + /* Get the TCP information with invalid IP instance. */ + status = nx_tcp_info_get(NX_NULL, &tcp_packets_sent, &tcp_bytes_sent, &tcp_packets_received, &tcp_bytes_received, + &tcp_invalid_packets, &tcp_receive_packets_dropped, &tcp_checksum_errors, &tcp_connections, + &tcp_disconnections, &tcp_connections_dropped, &tcp_retransmit_packets); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the invalid IP instance ID. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Get the TCP information with invalid IP instance ID. */ + status = nx_tcp_info_get(&invalid_ip, &tcp_packets_sent, &tcp_bytes_sent, &tcp_packets_received, &tcp_bytes_received, + &tcp_invalid_packets, &tcp_receive_packets_dropped, &tcp_checksum_errors, &tcp_connections, + &tcp_disconnections, &tcp_connections_dropped, &tcp_retransmit_packets); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the invalid IP instance ID. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Get the TCP information when disable the TCP feature. */ + status = nx_tcp_info_get(&invalid_ip, &tcp_packets_sent, &tcp_bytes_sent, &tcp_packets_received, &tcp_bytes_received, + &tcp_invalid_packets, &tcp_receive_packets_dropped, &tcp_checksum_errors, &tcp_connections, + &tcp_disconnections, &tcp_connections_dropped, &tcp_retransmit_packets); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /************************************************/ + /* Tested the nxe_tcp_client_socket_bind api */ + /************************************************/ + + /* Bind the port with invalid socket. */ + status = nx_tcp_client_socket_bind(NX_NULL, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Bind the port with invalid socket ID. */ + status = nx_tcp_client_socket_bind(&invalid_socket, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Bind the port when disable TCP feature. */ + status = nx_tcp_client_socket_bind(&invalid_socket, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the port with invalid prot. */ + status = nx_tcp_client_socket_bind(&client_socket, 0xFFFFFFFF, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /************************************************/ + /* Tested the nxe_tcp_client_socket_connect api */ + /************************************************/ + + /* Connect the TCP with invalid socket. */ + status = nx_tcp_client_socket_connect(NX_NULL, IP_ADDRESS(1, 2, 3, 5), 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Connect the TCP with invalid socket ID. */ + status = nx_tcp_client_socket_connect(&invalid_socket, IP_ADDRESS(1, 2, 3, 5), 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Connect the TCP when disable the TCP feature. */ + status = nx_tcp_client_socket_connect(&invalid_socket, IP_ADDRESS(1, 2, 3, 5), 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Connect the TCP with invalid IP address. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(0, 0, 0, 0), 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ +#ifdef __PRODUCT_NETXDUO__ + if (status != NX_IP_ADDRESS_ERROR) +#else + if (status != NX_NOT_BOUND) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Connect the TCP with invalid IP address. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(255, 255, 255, 255), 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Connect the TCP with invalid port. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 0xFFFFFFFF, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /*************************************************/ + /* Tested the nxde_tcp_client_socket_connect api */ + /*************************************************/ + + /* Set the IP address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Connect the TCP with invalid socket. */ + status = nxd_tcp_client_socket_connect(NX_NULL, &ip_address, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Connect the TCP with invalid socket ID. */ + status = nxd_tcp_client_socket_connect(&invalid_socket, &ip_address, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Connect the TCP when disable the TCP feature. */ + status = nxd_tcp_client_socket_connect(&invalid_socket, &ip_address, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Connect the TCP with invalid IP address. */ + status = nxd_tcp_client_socket_connect(&client_socket, NX_NULL, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address as invalid version. */ + ip_address.nxd_ip_version = 0x80; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + + /* Connect the TCP with invalid IP address. */ + status = nxd_tcp_client_socket_connect(&client_socket, &ip_address, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address as invalid address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(255, 255, 255, 255); + + /* Connect the TCP with invalid IP address. */ + status = nxd_tcp_client_socket_connect(&client_socket, &ip_address, 80, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address as invalid address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(128, 0, 0, 1); + + /* Connect the TCP with valid IP address and invalid port. */ + status = nxd_tcp_client_socket_connect(&client_socket, &ip_address, 0xFFFFFFFF, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP address as valid address. */ + ip_address.nxd_ip_version = NX_IP_VERSION_V4; + ip_address.nxd_ip_address.v4 = IP_ADDRESS(192, 0, 0, 1); + + /* Connect the TCP with invalid port. */ + status = nxd_tcp_client_socket_connect(&client_socket, &ip_address, 0xFFFFFFFF, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /************************************************/ + /* Tested the nxe_tcp_client_socket_port_get api*/ + /************************************************/ + + /* Get the Client socket port with invalid socket. */ + status = nx_tcp_client_socket_port_get(NX_NULL, &port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get the Client socket port with invalid socket ID. */ + status = nx_tcp_client_socket_port_get(&invalid_socket, &port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the Client socket port with invalid port pointer. */ + status = nx_tcp_client_socket_port_get(&client_socket, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get the Client socket port when disable TCP feature. */ + status = nx_tcp_client_socket_port_get(&invalid_socket, &port); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_client_socket_unbind api */ + /************************************************/ + + /* Unbind the Client socket with invalid socket. */ + status = nx_tcp_client_socket_unbind(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Unbind the Client socket with invalid socket ID. */ + status = nx_tcp_client_socket_unbind(&invalid_socket); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Unbind the Client socket when disable the TCP feature. */ + status = nx_tcp_client_socket_unbind(&invalid_socket); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_server_socket_accept api */ + /************************************************/ + + /* Accept the Server socket with invalid socket. */ + status = nx_tcp_server_socket_accept(NX_NULL, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Accept the Server socket with invalid socket ID. */ + status = nx_tcp_server_socket_accept(&invalid_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Accept the Server socket when disable TCP feature. */ + status = nx_tcp_server_socket_accept(&invalid_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_server_socket_listen api */ + /************************************************/ + + /* Listen the Server socket with invalid IP instance. */ + status = nx_tcp_server_socket_listen(NX_NULL, 8080, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the IP instance ID. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Listen the Server socket with invalid IP instance ID. */ + status = nx_tcp_server_socket_listen(&invalid_ip, 8080, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Listen the Server socket with invalid socket. */ + status = nx_tcp_server_socket_listen(&ip_1, 8080, NX_NULL, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Listen the Server socket with invalid socket ID. */ + status = nx_tcp_server_socket_listen(&ip_1, 8080, &invalid_socket, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP instance ID. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_ip.nx_ip_tcp_packet_receive = NX_NULL; + + /* Listen the Server socket when disable the TCP feature. */ + status = nx_tcp_server_socket_listen(&invalid_ip, 8080, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Listen the Server socket with invalid port. */ + status = nx_tcp_server_socket_listen(&ip_1, 0, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Listen the Server socket with invalid port. */ + status = nx_tcp_server_socket_listen(&ip_1, 0xFFFFFFFF, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_server_socket_relisten api*/ + /************************************************/ + + /* Relisten the Server socket with invalid IP instance. */ + status = nx_tcp_server_socket_relisten(NX_NULL, 8080, &server_socket); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the IP instance ID. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Relisten the Server socket with invalid IP instance ID. */ + status = nx_tcp_server_socket_relisten(&invalid_ip, 8080, &server_socket); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Relisten the Server socket with invalid socket. */ + status = nx_tcp_server_socket_relisten(&ip_1, 8080, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Relisten the Server socket with invalid socket ID. */ + status = nx_tcp_server_socket_relisten(&ip_1, 8080, &invalid_socket); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP instance ID. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_ip.nx_ip_tcp_packet_receive = NX_NULL; + + /* Relisten the Server socket when disable the TCP feature. */ + status = nx_tcp_server_socket_relisten(&invalid_ip, 8080, &server_socket); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Relisten the Server socket with invalid port. */ + status = nx_tcp_server_socket_relisten(&ip_1, 0, &server_socket); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Relisten the Server socket with invalid port. */ + status = nx_tcp_server_socket_relisten(&ip_1, 0xFFFFFFFF, &server_socket); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_server_socket_unaccept api*/ + /************************************************/ + + /* Unaccept the Server socket with invalid socket. */ + status = nx_tcp_server_socket_unaccept(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Unaccept the Server socket with invalid socket ID. */ + status = nx_tcp_server_socket_unaccept(&invalid_socket); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Unaccept the Server socket when disable TCP feature. */ + status = nx_tcp_server_socket_unaccept(&invalid_socket); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_server_socket_unlisten api*/ + /************************************************/ + + /* Unlisten the Server socket with invalid IP instance. */ + status = nx_tcp_server_socket_unlisten(NX_NULL, 8080); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the IP instance ID. */ + invalid_ip.nx_ip_id = NX_NULL; + + /* Unlisten the Server socket with invalid IP instance ID. */ + status = nx_tcp_server_socket_unlisten(&invalid_ip, 8080); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the IP instance ID. */ + invalid_ip.nx_ip_id = NX_IP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_ip.nx_ip_tcp_packet_receive = NX_NULL; + + /* Unlisten the Server socket when disable the TCP feature. */ + status = nx_tcp_server_socket_unlisten(&invalid_ip, 8080); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten the Server socket with invalid port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 0); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unlisten the Server socket with invalid port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 0xFFFFFFFF); + + /* Check for error. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_bytes_available api*/ + /************************************************/ + + /* Get the Server socket available bytes with invalid socket. */ + status = nx_tcp_socket_bytes_available(NX_NULL, &bytes_available); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get the Server socket available bytes with invalid socket ID. */ + status = nx_tcp_socket_bytes_available(&invalid_socket, &bytes_available); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the Server socket available bytes with invalid bytes available pointer. */ + status = nx_tcp_socket_bytes_available(&server_socket, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get the Server socket available bytes when disable the TCP feature. */ + status = nx_tcp_socket_bytes_available(&invalid_socket, &bytes_available); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_disconnect api */ + /************************************************/ + + /* Disconnect the TCP with invalid socket. */ + status = nx_tcp_socket_disconnect(NX_NULL, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Disconnect the TCP with invalid socket ID. */ + status = nx_tcp_socket_disconnect(&invalid_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Disconnect the TCP when disable TCP feature. */ + status = nx_tcp_socket_disconnect(&invalid_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_info_get api */ + /************************************************/ + + /* Get the TCP socket information with invalid socket. */ + status = nx_tcp_socket_info_get(NX_NULL, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get the TCP socket information with invalid socket ID. */ + status = nx_tcp_socket_info_get(&invalid_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get the TCP socket information when disable TCP feature. */ + status = nx_tcp_socket_info_get(&invalid_socket, &packets_sent, &bytes_sent, + &packets_received, &bytes_received, + &retransmit_packets, &packets_queued, + &checksum_errors, &socket_state, + &transmit_queue_depth, &transmit_window, + &receive_window); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_mss_get api */ + /************************************************/ + + /* Get the socket mss with invalid socket. */ + status = nx_tcp_socket_mss_get(NX_NULL, &mss); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get the socket mss with invalid socket. */ + status = nx_tcp_socket_mss_get(&invalid_socket, &mss); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the socket mss with invalid mss pointer. */ + status = nx_tcp_socket_mss_get(&client_socket, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get the socket mss when disable TCP feature. */ + status = nx_tcp_socket_mss_get(&invalid_socket, &mss); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_mss_peer_get api */ + /************************************************/ + + /* Get the peer socket mss with invalid socket. */ + status = nx_tcp_socket_mss_peer_get(NX_NULL, &peer_mss); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get the peer socket mss with invalid socket. */ + status = nx_tcp_socket_mss_peer_get(&invalid_socket, &peer_mss); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the peer socket mss with invalid mss pointer. */ + status = nx_tcp_socket_mss_peer_get(&client_socket, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get the peer socket mss when disable TCP feature. */ + status = nx_tcp_socket_mss_peer_get(&invalid_socket, &peer_mss); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_mss_set api */ + /************************************************/ + + /* Set the socket mss with invalid socket. */ + status = nx_tcp_socket_mss_set(NX_NULL, 512); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Set the socket mss with invalid socket. */ + status = nx_tcp_socket_mss_set(&invalid_socket, 512); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Set the socket mss when disable TCP feature. */ + status = nx_tcp_socket_mss_set(&invalid_socket, 512); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_peer_info_get api */ + /************************************************/ + + /* Get peer socket information with invalid socket. */ + status = nx_tcp_socket_peer_info_get(NX_NULL, &peer_ip_address, &peer_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get peer socket information with invalid socket ID. */ + status = nx_tcp_socket_peer_info_get(&invalid_socket, &peer_ip_address, &peer_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get peer socket information with invalid peer IP address pointer. */ + status = nx_tcp_socket_peer_info_get(&client_socket, NX_NULL, &peer_port); + + /* Check for error. */ +#ifdef __PRODUCT_NETXDUO__ + if (status != NX_PTR_ERROR) +#else + if (status != NX_NOT_CONNECTED) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get peer socket information with invalid peer port pointer. */ + status = nx_tcp_socket_peer_info_get(&client_socket, &peer_ip_address, NX_NULL); + + /* Check for error. */ +#ifdef __PRODUCT_NETXDUO__ + if (status != NX_PTR_ERROR) +#else + if (status != NX_NOT_CONNECTED) +#endif + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get peer socket information when disable TCP feature. */ + status = nx_tcp_socket_peer_info_get(&invalid_socket, &peer_ip_address, &peer_port); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + +#ifdef FEATURE_NX_IPV6 + /************************************************/ + /* Tested the nxde_tcp_socket_peer_info_get api */ + /************************************************/ + + /* Get peer socket information with invalid socket. */ + status = nxd_tcp_socket_peer_info_get(NX_NULL, &nxd_ip_address, &peer_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Get peer socket information with invalid socket ID. */ + status = nxd_tcp_socket_peer_info_get(&invalid_socket, &nxd_ip_address, &peer_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get peer socket information with invalid peer IP address pointer. */ + status = nxd_tcp_socket_peer_info_get(&client_socket, NX_NULL, &peer_port); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get peer socket information with invalid peer port pointer. */ + status = nxd_tcp_socket_peer_info_get(&client_socket, &nxd_ip_address, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Get peer socket information when disable TCP feature. */ + status = nxd_tcp_socket_peer_info_get(&invalid_socket, &nxd_ip_address, &peer_port); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + +#if defined(NX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY) && defined(__PRODUCT_NETXDUO__) + /*******************************************************/ + /* Tested the nxe_tcp_socket_queue_depth_notify_set api*/ + /*******************************************************/ + + /* Set the queue depth notify function with invalid socket. */ + status = nx_tcp_socket_queue_depth_notify_set(NX_NULL, tcp_socket_queue_depth_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Set the queue depth notify function with invalid socket ID. */ + status = nx_tcp_socket_queue_depth_notify_set(&invalid_socket, tcp_socket_queue_depth_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the queue depth notify function with invalid callback pointer. */ + status = nx_tcp_socket_queue_depth_notify_set(&client_socket, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Set the queue depth notify function when disable TCP feature. */ + status = nx_tcp_socket_queue_depth_notify_set(&invalid_socket, tcp_socket_queue_depth_notify); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /************************************************/ + /* Tested the nxe_tcp_socket_receive api */ + /************************************************/ + + /* Receive a TCP message with invalid socket. */ + status = nx_tcp_socket_receive(NX_NULL, &packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Receive a TCP message with invalid socket ID. */ + status = nx_tcp_socket_receive(&invalid_socket, &packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a TCP message with invalid packet pointer. */ + status = nx_tcp_socket_receive(&server_socket, NX_NULL, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Receive a TCP message with invalid packet pointer. */ + status = nx_tcp_socket_receive(&invalid_socket, &packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_receive_notify api */ + /************************************************/ + + /* Set the socket receive notify function with invalid socket. */ + status = nx_tcp_socket_receive_notify(NX_NULL, tcp_receive_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Set the socket receive notify function with invalid socket. */ + status = nx_tcp_socket_receive_notify(&invalid_socket, tcp_receive_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Clear socket receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Set the socket receive notify function when disable TCP feature. */ + status = nx_tcp_socket_receive_notify(&invalid_socket, tcp_receive_notify); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /************************************************/ + /* Tested the nxe_tcp_socket_send api */ + /************************************************/ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet with invalid socket. */ + status = nx_tcp_socket_send(NX_NULL, packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Send the packet with invalid socket. */ + status = nx_tcp_socket_send(&invalid_socket, packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet with invalid packet. */ + unknow_packet = NX_NULL; + status = nx_tcp_socket_send(&client_socket, unknow_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Send the packet with freed packet. */ + packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; + status = nx_tcp_socket_send(&client_socket, packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_INVALID_PACKET) + { + + printf("ERROR!\n"); + test_control_return(1); + } + packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#endif + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Send the packet when disable TCP feature. */ + status = nx_tcp_socket_send(&invalid_socket, packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Set the socket ID, tcp_packet_receive and connect IP address. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + invalid_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_NULL; + + /* Send the packet with invalid connect IP address. */ + status = nx_tcp_socket_send(&invalid_socket, packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_CONNECTED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID, tcp_packet_receive and connect IP address. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + invalid_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + + /* Send the invalid packet that prepend pointer is less than data start. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + invalid_packet_2 -> nx_packet_data_start = (UCHAR *)0x20; + invalid_packet_2 -> nx_packet_prepend_ptr = (UCHAR *)0x10; + invalid_packet_2 -> nx_packet_append_ptr = (UCHAR *)0x30; + invalid_packet_2 -> nx_packet_data_end = (UCHAR *)0x40; + invalid_packet_2 -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *) NX_PACKET_ALLOCATED; + status = nx_tcp_socket_send(&invalid_socket, invalid_packet_2, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_UNDERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append packet with invalid packet that prepend pointer is less than data start. */ + invalid_packet_2 = (NX_PACKET *) &invalid_packet; + invalid_packet_2 -> nx_packet_pool_owner = (NX_PACKET_POOL *) &invalid_pool; + invalid_packet_2 -> nx_packet_pool_owner -> nx_packet_pool_id = NX_PACKET_POOL_ID; + invalid_packet_2 -> nx_packet_data_start = (UCHAR *)0x10; + invalid_packet_2 -> nx_packet_prepend_ptr = (UCHAR *)0x40; + invalid_packet_2 -> nx_packet_append_ptr = (UCHAR *)0x80; + invalid_packet_2 -> nx_packet_data_end = (UCHAR *)0x60; + invalid_packet_2 -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *) NX_PACKET_ALLOCATED; + status = nx_tcp_socket_send(&invalid_socket, invalid_packet_2, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet*/ + status = nx_packet_release(packet); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /************************************************/ + /* Tested the nxe_tcp_socket_state_wait api */ + /************************************************/ + + /* Wait for state with invalid socket. */ + status = nx_tcp_socket_state_wait(NX_NULL, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Wait for state with invalid socket ID. */ + status = nx_tcp_socket_state_wait(&invalid_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Wait for state when disable TCP feature. */ + status = nx_tcp_socket_state_wait(&invalid_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for state with invalid desired state. */ + status = nx_tcp_socket_state_wait(&client_socket, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for state with invalid desired state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_LAST_ACK + 1, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /***************************************************/ + /* Tested the nxe_tcp_socket_transmit_configure api*/ + /***************************************************/ + + /* Configure the socket further with invalid socket. */ + status = nx_tcp_socket_transmit_configure(NX_NULL, 10, 300, 10, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Configure the socket further with invalid socket ID. */ + status = nx_tcp_socket_transmit_configure(&invalid_socket, 10, 300, 10, 0); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Configure the socket further with invalid max queue depth. */ + status = nx_tcp_socket_transmit_configure(&server_socket, 0, 300, 10, 0); + + /* Check for error. */ + if (status != NX_OPTION_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Configure the socket further when disable TCP feature. */ + status = nx_tcp_socket_transmit_configure(&invalid_socket, 10, 300, 10, 0); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /*********************************************************/ + /* Tested the nxe_tcp_socket_window_update_notify_set api*/ + /*********************************************************/ + + /* Set the queue depth notify function with invalid socket. */ + status = nx_tcp_socket_window_update_notify_set(NX_NULL, window_update_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Set the queue depth notify function with invalid socket. */ + status = nx_tcp_socket_window_update_notify_set(&invalid_socket, window_update_notify); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the queue depth notify function with invalid notify function. */ + status = nx_tcp_socket_window_update_notify_set(&client_socket, NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Set the queue depth notify function when disable TCP feature. */ + status = nx_tcp_socket_window_update_notify_set(&invalid_socket, window_update_notify); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /************************************************/ + /* Tested the nxe_tcp_socket_delete api */ + /************************************************/ + + /* Delete the TCP socket with invalid socket. */ + status = nx_tcp_socket_delete(NX_NULL); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Delete the TCP socket with invalid socket ID. */ + status = nx_tcp_socket_delete(&invalid_socket); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Disable the TCP feature for invalid IP instance. */ + invalid_socket.nx_tcp_socket_ip_ptr = (NX_IP *)&invalid_ip; + invalid_socket.nx_tcp_socket_ip_ptr -> nx_ip_tcp_packet_receive = NX_NULL; + + /* Delete the TCP socket when disable TCP feature. */ + status = nx_tcp_socket_delete(&invalid_socket); + + /* Check for error. */ + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_ENABLE_LOW_WATERMARK + /* Clear the socket ID. */ + invalid_socket.nx_tcp_socket_id = NX_NULL; + + /* Set receive queue to invalid socket. */ + status = nx_tcp_socket_receive_queue_max_set(&invalid_socket, 10); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_ENABLE_LOW_WATERMARK */ +#endif /* __PRODUCT_NETXDUO__ */ + + printf("SUCCESS!\n"); + test_control_return(0); +} + +#if defined(NX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY) && defined(__PRODUCT_NETXDUO__) +static void tcp_socket_queue_depth_notify(NX_TCP_SOCKET *socket_ptr) +{ +} +#endif +#ifdef __PRODUCT_NETXDUO__ +static void window_update_notify(NX_TCP_SOCKET *socket_ptr) +{ +} +#endif /* __PRODUCT_NETXDUO__ */ +static void tcp_receive_notify(NX_TCP_SOCKET *socket_ptr) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP NXE API Test..........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_odd_window_test.c b/test/regression/netxduo_test/netx_tcp_odd_window_test.c new file mode 100644 index 00000000..563a39ac --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_odd_window_test.c @@ -0,0 +1,314 @@ +/* This NetX test concentrates on the odd window of TCP transmission. */ +/* Window size is 800 bytes. Payload size of pool is 512. + * 1. Host A sends 1 byte. So the remaining window is 799. + * 2. Host A sends 1499 bytes. */ + +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static UCHAR send_buff[1500]; +static UCHAR recv_buff[1500]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_odd_window_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +UINT i; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = i & 0xFF; + recv_buff[i] = 0xFF - (i & 0xFF); + } + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Odd Window Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, 1, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff + 1, sizeof(send_buff) - 1, + &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG total_length = 0; +ULONG bytes_copied; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 800, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 3 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Retrieve data. */ + nx_packet_data_retrieve(packet_ptr, recv_buff + total_length, &bytes_copied); + total_length += bytes_copied; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Check received data. */ + if (total_length != sizeof(send_buff)) + error_counter++; + else if (memcmp(send_buff, recv_buff, sizeof(send_buff)) != 0) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_odd_window_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Odd Window Test.......................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_out_of_order_ack_test.c b/test/regression/netxduo_test/netx_tcp_out_of_order_ack_test.c new file mode 100644 index 00000000..ff3c7bdf --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_out_of_order_ack_test.c @@ -0,0 +1,2801 @@ +/* This case tests the get content length task which should allow zero or more white + spaces between field name (Content-Length) and value. +*/ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT); + +#if (NX_TCP_MAX_OUT_OF_ORDER_PACKETS == 8) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (1536 + sizeof(NX_PACKET)) +#define CLIENT_POOL_SIZE (CLIENT_PACKET_SIZE * 30) + +static TX_THREAD client_thread; +static TX_THREAD server_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET client_socket; +static NX_IP client_ip; +static UINT error_counter; +static UINT tcp_connected = NX_FALSE; +static UINT packet_received_counter = 0; +static UINT packet_response_sent= NX_FALSE; +static UINT test_done = NX_FALSE; +static UINT received_data_size = 0; +static ULONG pool_stack[CLIENT_POOL_SIZE / sizeof(ULONG)]; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void test_initialize(); +static VOID response_packet_inject(UCHAR *data_ptr, UINT data_size); + +#define CLIENT_ADDRESS IP_ADDRESS(192,168,2,3) +#define SERVER_ADDRESS IP_ADDRESS(152,199,19,161) +#define GATEWAY_ADDRESS IP_ADDRESS(192,168,2,1) + +#define RESPONSE_COUNT 14 + +typedef struct RESPONSE_STRUCT +{ + char *response_pkt_data; + int response_pkt_size; +} RESPONSE; + +static RESPONSE response[RESPONSE_COUNT]; + +/* Frame (58 bytes) */ +static const unsigned char pkt2[58] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x33, 0x06, /* .,....3. */ +0x18, 0xb9, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* ........ */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xb8, 0x70, 0xfa, 0xdf, 0xde, 0x78, 0x60, 0x12, /* .p...x`. */ +0xff, 0xff, 0x1b, 0xc3, 0x00, 0x00, 0x02, 0x04, /* ........ */ +0x05, 0xb4 /* .. */ +}; + +/* Frame (54 bytes) */ +static const unsigned char pkt5[54] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x00, 0x28, 0xe7, 0xc9, 0x00, 0x00, 0x33, 0x06, /* .(....3. */ +0x30, 0xf3, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* 0....... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xb8, 0x71, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x10, /* .q...FP. */ +0xff, 0xff, 0x32, 0xb2, 0x00, 0x00 /* ..2... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt6[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xca, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x3e, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +>...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xb8, 0x71, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x10, /* .q...FP. */ +0xff, 0xff, 0xd4, 0x09, 0x00, 0x00, 0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, 0x32, /* TP/1.1 2 */ +0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x41, /* 00 OK..A */ +0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x52, 0x61, /* ccept-Ra */ +0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20, 0x62, 0x79, /* nges: by */ +0x74, 0x65, 0x73, 0x0d, 0x0a, 0x41, 0x67, 0x65, /* tes..Age */ +0x3a, 0x20, 0x36, 0x36, 0x39, 0x36, 0x30, 0x36, /* : 669606 */ +0x0d, 0x0a, 0x43, 0x61, 0x63, 0x68, 0x65, 0x2d, /* ..Cache- */ +0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x3a, /* Control: */ +0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2c, /* public, */ +0x6d, 0x61, 0x78, 0x2d, 0x61, 0x67, 0x65, 0x3d, /* max-age= */ +0x31, 0x37, 0x32, 0x38, 0x30, 0x30, 0x30, 0x30, /* 17280000 */ +0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ +0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, /* t-Dispos */ +0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, /* ition: a */ +0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, /* ttachmen */ +0x74, 0x3b, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x6e, /* t; filen */ +0x61, 0x6d, 0x65, 0x3d, 0x70, 0x6f, 0x63, 0x5f, /* ame=poc_ */ +0x61, 0x69, 0x5f, 0x31, 0x2e, 0x30, 0x2e, 0x37, /* ai_1.0.7 */ +0x2e, 0x62, 0x69, 0x6e, 0x3b, 0x20, 0x66, 0x69, /* .bin; fi */ +0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x3d, /* lename*= */ +0x75, 0x74, 0x66, 0x2d, 0x38, 0x27, 0x27, 0x70, /* utf-8''p */ +0x6f, 0x63, 0x5f, 0x61, 0x69, 0x5f, 0x31, 0x2e, /* oc_ai_1. */ +0x30, 0x2e, 0x37, 0x2e, 0x62, 0x69, 0x6e, 0x0d, /* 0.7.bin. */ +0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, /* .Content */ +0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, /* -Type: a */ +0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ +0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ +0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x0d, /* -stream. */ +0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46, /* .Date: F */ +0x72, 0x69, 0x2c, 0x20, 0x30, 0x39, 0x20, 0x4a, /* ri, 09 J */ +0x75, 0x6e, 0x20, 0x32, 0x30, 0x32, 0x33, 0x20, /* un 2023 */ +0x30, 0x37, 0x3a, 0x30, 0x39, 0x3a, 0x32, 0x35, /* 07:09:25 */ +0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x45, 0x74, /* GMT..Et */ +0x61, 0x67, 0x3a, 0x20, 0x22, 0x61, 0x68, 0x78, /* ag: "ahx */ +0x6b, 0x4a, 0x33, 0x59, 0x78, 0x36, 0x37, 0x63, /* kJ3Yx67c */ +0x70, 0x6c, 0x57, 0x2b, 0x7a, 0x55, 0x55, 0x7a, /* plW+zUUz */ +0x6a, 0x73, 0x55, 0x59, 0x75, 0x69, 0x76, 0x45, /* jsUYuivE */ +0x6e, 0x47, 0x66, 0x72, 0x6b, 0x4b, 0x74, 0x6e, /* nGfrkKtn */ +0x58, 0x50, 0x76, 0x41, 0x36, 0x4c, 0x71, 0x77, /* XPvA6Lqw */ +0x3d, 0x22, 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, /* ="..Last */ +0x2d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, /* -Modifie */ +0x64, 0x3a, 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, /* d: Thu, */ +0x30, 0x31, 0x20, 0x4a, 0x75, 0x6e, 0x20, 0x32, /* 01 Jun 2 */ +0x30, 0x32, 0x33, 0x20, 0x31, 0x33, 0x3a, 0x30, /* 023 13:0 */ +0x36, 0x3a, 0x33, 0x32, 0x20, 0x47, 0x4d, 0x54, /* 6:32 GMT */ +0x0d, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ..Server */ +0x3a, 0x20, 0x45, 0x43, 0x41, 0x63, 0x63, 0x20, /* : ECAcc */ +0x28, 0x70, 0x61, 0x61, 0x2f, 0x36, 0x46, 0x34, /* (paa/6F4 */ +0x32, 0x29, 0x0d, 0x0a, 0x74, 0x72, 0x61, 0x63, /* 2)..trac */ +0x65, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3a, /* eparent: */ +0x20, 0x30, 0x30, 0x2d, 0x35, 0x37, 0x62, 0x35, /* 00-57b5 */ +0x62, 0x31, 0x66, 0x33, 0x66, 0x61, 0x32, 0x34, /* b1f3fa24 */ +0x32, 0x36, 0x62, 0x65, 0x36, 0x65, 0x65, 0x32, /* 26be6ee2 */ +0x38, 0x34, 0x32, 0x66, 0x31, 0x38, 0x30, 0x66, /* 842f180f */ +0x61, 0x31, 0x66, 0x32, 0x2d, 0x39, 0x35, 0x30, /* a1f2-950 */ +0x66, 0x30, 0x33, 0x37, 0x32, 0x32, 0x64, 0x30, /* f03722d0 */ +0x32, 0x63, 0x65, 0x39, 0x66, 0x2d, 0x30, 0x30, /* 2ce9f-00 */ +0x0d, 0x0a, 0x58, 0x2d, 0x41, 0x7a, 0x75, 0x72, /* ..X-Azur */ +0x65, 0x2d, 0x52, 0x65, 0x66, 0x2d, 0x4f, 0x72, /* e-Ref-Or */ +0x69, 0x67, 0x69, 0x6e, 0x53, 0x68, 0x69, 0x65, /* iginShie */ +0x6c, 0x64, 0x3a, 0x20, 0x52, 0x65, 0x66, 0x20, /* ld: Ref */ +0x41, 0x3a, 0x20, 0x37, 0x34, 0x46, 0x36, 0x38, /* A: 74F68 */ +0x42, 0x37, 0x44, 0x34, 0x37, 0x39, 0x37, 0x34, /* B7D47974 */ +0x30, 0x34, 0x38, 0x38, 0x44, 0x34, 0x36, 0x42, /* 0488D46B */ +0x35, 0x46, 0x31, 0x38, 0x39, 0x39, 0x36, 0x43, /* 5F18996C */ +0x42, 0x31, 0x37, 0x20, 0x52, 0x65, 0x66, 0x20, /* B17 Ref */ +0x42, 0x3a, 0x20, 0x41, 0x4d, 0x53, 0x32, 0x33, /* B: AMS23 */ +0x31, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x30, /* 10210140 */ +0x31, 0x39, 0x20, 0x52, 0x65, 0x66, 0x20, 0x43, /* 19 Ref C */ +0x3a, 0x20, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x30, /* : 2023-0 */ +0x36, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x33, 0x3a, /* 6-01T13: */ +0x30, 0x39, 0x3a, 0x31, 0x39, 0x5a, 0x0d, 0x0a, /* 09:19Z.. */ +0x58, 0x2d, 0x43, 0x61, 0x63, 0x68, 0x65, 0x3a, /* X-Cache: */ +0x20, 0x48, 0x49, 0x54, 0x0d, 0x0a, 0x58, 0x2d, /* HIT..X- */ +0x43, 0x43, 0x43, 0x3a, 0x20, 0x46, 0x52, 0x0d, /* CCC: FR. */ +0x0a, 0x58, 0x2d, 0x43, 0x49, 0x44, 0x3a, 0x20, /* .X-CID: */ +0x31, 0x31, 0x0d, 0x0a, 0x58, 0x2d, 0x44, 0x43, /* 11..X-DC */ +0x53, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x2d, /* SOrigin- */ +0x52, 0x65, 0x66, 0x3a, 0x20, 0x77, 0x65, 0x73, /* Ref: wes */ +0x74, 0x65, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x0d, /* teurope. */ +0x0a, 0x58, 0x2d, 0x4d, 0x53, 0x45, 0x64, 0x67, /* .X-MSEdg */ +0x65, 0x2d, 0x52, 0x65, 0x66, 0x3a, 0x20, 0x52, /* e-Ref: R */ +0x65, 0x66, 0x20, 0x41, 0x3a, 0x20, 0x30, 0x32, /* ef A: 02 */ +0x41, 0x31, 0x41, 0x46, 0x32, 0x43, 0x34, 0x42, /* A1AF2C4B */ +0x31, 0x35, 0x34, 0x33, 0x43, 0x30, 0x39, 0x36, /* 1543C096 */ +0x31, 0x36, 0x36, 0x31, 0x41, 0x35, 0x42, 0x38, /* 1661A5B8 */ +0x39, 0x45, 0x39, 0x31, 0x30, 0x32, 0x20, 0x52, /* 9E9102 R */ +0x65, 0x66, 0x20, 0x42, 0x3a, 0x20, 0x4d, 0x49, /* ef B: MI */ +0x4c, 0x33, 0x30, 0x45, 0x44, 0x47, 0x45, 0x31, /* L30EDGE1 */ +0x33, 0x30, 0x37, 0x20, 0x52, 0x65, 0x66, 0x20, /* 307 Ref */ +0x43, 0x3a, 0x20, 0x32, 0x30, 0x32, 0x33, 0x2d, /* C: 2023- */ +0x30, 0x36, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x33, /* 06-01T13 */ +0x3a, 0x30, 0x39, 0x3a, 0x31, 0x39, 0x5a, 0x0d, /* :09:19Z. */ +0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, /* .Content */ +0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, /* -Length: */ +0x20, 0x31, 0x31, 0x35, 0x38, 0x32, 0x38, 0x0d, /* 115828. */ +0x0a, 0x0d, 0x0a, 0x3d, 0xb8, 0xf3, 0x96, 0x00, /* ...=.... */ +0xc0, 0x06, 0x0c, 0x20, 0x00, 0x6c, 0x00, 0xa0, /* ... .l.. */ +0xc2, 0x01, 0x00, 0x04, 0x01, 0x00, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0xbd, 0x7a, 0xc1, 0x28, 0x96, /* ....z.(. */ +0x4a, 0xc6, 0x2a, 0x59, 0x4e, 0xb4, 0x0c, 0xfc, /* J.*YN... */ +0xfb, 0x4d, 0x63, 0xa7, 0x2f, 0x4c, 0x9d, 0xf4, /* .Mc./L.. */ +0x3e, 0xb3, 0xa4, 0xc8, 0xb0, 0x7e, 0x3e, 0x65, /* >....~>e */ +0xdc, 0x62, 0xbf, 0x76, 0x13, 0x85, 0x9a, 0xc6, /* .b.v.... */ +0xe6, 0x18, 0xad, 0xf1, 0xc0, 0x84, 0xf7, 0xc3, /* ........ */ +0xbe, 0x1f, 0xd3, 0x09, 0x03, 0xfd, 0x19, 0x9c, /* ........ */ +0x04, 0xdd, 0x91, 0x5f, 0x1e, 0x87, 0x93, 0x6a, /* ..._...j */ +0x48, 0xca, 0xc4, 0xb1, 0xb9, 0x90, 0xd3, 0x28, /* H......( */ +0xe9, 0x0b, 0x9c, 0x7c, 0x6f, 0x0c, 0x25, 0xba, /* ...|o.%. */ +0xed, 0xb9, 0xf5, 0x14, 0x27, 0x09, 0x15, 0x10, /* ....'... */ +0x24, 0xfd, 0x6d, 0x3f, 0xdb, 0xb5, 0x1a, 0x96, /* $.m?.... */ +0xd4, 0x45, 0xeb, 0x21, 0xcd, 0x86, 0x9f, 0x95, /* .E.!.... */ +0x47, 0xee, 0x24, 0x5e, 0x04, 0xbd, 0x22, 0xe5, /* G.$^..". */ +0x94, 0x02, 0x3d, 0x43, 0x51, 0x9c, 0x6b, 0xb1, /* ..=CQ.k. */ +0x40, 0x1f, 0x37, 0x37, 0xd2, 0x93, 0x8f, 0x75, /* @.77...u */ +0x9c, 0xc3, 0xd8, 0x8e, 0x30, 0x2a, 0x2c, 0xf9, /* ....0*,. */ +0xf7, 0xdf, 0x4b, 0x86, 0x03, 0xbd, 0x03, 0x5c, /* ..K....\ */ +0x73, 0x62, 0x7a, 0x82, 0x5e, 0x4f, 0x5f, 0x1d, /* sbz.^O_. */ +0x4e, 0x67, 0x3e, 0xa0, 0xc6, 0x60, 0xfe, 0x06, /* Ng>..`.. */ +0xa7, 0xef, 0xd4, 0x59, 0x0b, 0x26, 0xa0, 0x37, /* ...Y.&.7 */ +0xcb, 0x42, 0x4a, 0x03, 0x09, 0xf0, 0x44, 0x33, /* .BJ...D3 */ +0x8a, 0x91, 0x21, 0x06, 0xa3, 0x14, 0x4b, 0xa3, /* ..!...K. */ +0xf7, 0xb2, 0xde, 0x28, 0x7c, 0x4f, 0x6f, 0x55, /* ...(|OoU */ +0x10, 0x75, 0xa7, 0xb1, 0x8c, 0x7f, 0x99, 0x9b, /* .u...... */ +0x61, 0x89, 0xdd, 0x22, 0xf8, 0xfb, 0x4f, 0x8d, /* a.."..O. */ +0x5c, 0x5d, 0x0b, 0x0e, 0x76, 0x6e, 0xcf, 0xf2, /* \]..vn.. */ +0x09, 0x1b, 0x9d, 0xaf, 0xe2, 0x17, 0x2c, 0x23, /* ......,# */ +0x77, 0xcf, 0xe2, 0xe1, 0xf9, 0xa9, 0xf0, 0x4e, /* w......N */ +0x50, 0xe6, 0x8f, 0xa1, 0x64, 0x16, 0x20, 0x2f, /* P...d. / */ +0x53, 0x09, 0xed, 0xf4, 0x0d, 0x71, 0x8b, 0x2e, /* S....q.. */ +0x50, 0x1b, 0xe5, 0x0f, 0x12, 0x92, 0xc0, 0xb6, /* P....... */ +0xa3, 0x8c, 0x82, 0x58, 0x57, 0x6e, 0xeb, 0xf6, /* ...XWn.. */ +0xc3, 0x76, 0xb0, 0x90, 0x68, 0xde, 0xa7, 0x11, /* .v..h... */ +0xb9, 0xb9, 0x97, 0x56, 0xea, 0x6f, 0xd0, 0x41, /* ...V.o.A */ +0xd0, 0xa1, 0xb3, 0xb3, 0x26, 0x81, 0x29, 0x34, /* ....&.)4 */ +0xe1, 0x4f, 0x52, 0x10, 0x0e, 0x40, 0xa4, 0x5b, /* .OR..@.[ */ +0x95, 0x61, 0x41, 0x66, 0xd1, 0x3c, 0x81, 0x36, /* .aAf.<.6 */ +0x8d, 0x6d, 0x89, 0xa1, 0x18, 0xa5, 0x98, 0x5c, /* .m.....\ */ +0x13, 0x29, 0x1e, 0x77, 0xb5, 0xa3, 0xd1, 0x5f, /* .).w..._ */ +0x64, 0xb8, 0x03, 0x6c, 0x02, 0x78, 0x43, 0x1f, /* d..l.xC. */ +0xa8, 0xbe, 0x6b, 0xc2, 0xfe, 0xb2, 0x12, 0xee, /* ..k..... */ +0xeb, 0x2a, 0xe5, 0x13, 0x2f, 0x40, 0x29, 0x81, /* .*../@). */ +0x7e, 0x1a, 0x1b, 0x2f, 0xaf, 0x94, 0x79, 0x4a, /* ~../..yJ */ +0x63, 0x18, 0xdf, 0x76, 0x59, 0x18, 0x48, 0x02, /* c..vY.H. */ +0x9e, 0xa5, 0x80, 0xd3, 0x7d, 0xd2, 0xbd, 0x34, /* ....}..4 */ +0x43, 0x2f, 0xbd, 0x95, 0x55, 0xaf, 0x60, 0x1f, /* C/..U.`. */ +0x52, 0xe9, 0x17, 0x3e, 0x34, 0x3d, 0x0d, 0x15, /* R..>4=.. */ +0xb5, 0x2c, 0xd2, 0xcf, 0x97, 0x3b, 0xbf, 0xb2, /* .,...;.. */ +0x2d, 0xa1, 0x06, 0x09, 0xfc, 0xeb, 0xa0, 0xca, /* -....... */ +0x49, 0xd5, 0xf6, 0xdc, 0x84, 0xa0, 0xe2, 0x88, /* I....... */ +0xbc, 0x81, 0xb7, 0x50, 0x9e, 0xab, 0x6b, 0x2f, /* ...P..k/ */ +0x84, 0xe7, 0xe2, 0x15, 0x8d, 0xf2, 0x18, 0x97, /* ........ */ +0xd4, 0x8e, 0xea, 0x79, 0x08, 0x76, 0x76, 0xf7, /* ...y.vv. */ +0x04, 0xf3, 0x04, 0x19, 0x10, 0xdb, 0x6c, 0x95, /* ......l. */ +0xb7, 0x5f, 0x9d, 0x81, 0x48, 0xa8, 0x1f, 0x1b, /* ._..H... */ +0x19, 0x9f, 0x99, 0xb2, 0xd7, 0x13, 0x49, 0x97, /* ......I. */ +0x33, 0x8a, 0x41, 0x0c, 0x37, 0x76, 0xca, 0x14, /* 3.A.7v.. */ +0x14, 0x8b, 0x9a, 0x15, 0x49, 0x6f, 0x79, 0x5b, /* ....Ioy[ */ +0x46, 0xd1, 0x15, 0xb6, 0x20, 0x3a, 0xf0, 0xed, /* F... :.. */ +0xa8, 0x4f, 0x8b, 0xf2, 0xb9, 0x14, 0xfc, 0xa9, /* .O...... */ +0xca, 0x25, 0x4b, 0xfc, 0x20, 0x72, 0xe9, 0x3a, /* .%K. r.: */ +0xa7, 0x37, 0xfe, 0x0f, 0x29, 0xbe, 0xc2, 0xc3, /* .7..)... */ +0x3a, 0xaa, 0xe1, 0xd5, 0x2f, 0x03, 0xd0, 0xa0, /* :.../... */ +0x85, 0x35, 0x65, 0xb4, 0x3a, 0x16, 0x0c, 0x67, /* .5e.:..g */ +0xac, 0x37, 0xdc, 0x6d, 0xe4, 0xc2, 0x69, 0x09, /* .7.m..i. */ +0x42, 0x32, 0x38, 0x1b, 0xb7, 0x52, 0xa9, 0x88, /* B28..R.. */ +0x0d, 0x27, 0x6d, 0x12, 0x21, 0xf1, 0xba, 0x84, /* .'m.!... */ +0xb6, 0x93, 0x7c, 0x8c, 0x19, 0xe0, 0x6f, 0x1e, /* ..|...o. */ +0x2b, 0xa0, 0xc8, 0x27, 0x49, 0xc7, 0xe8, 0xe6, /* +..'I... */ +0x5e, 0x8e, 0x43, 0xb8, 0xda, 0x2a, 0x8c, 0x33, /* ^.C..*.3 */ +0xf4, 0x3c, 0xd8, 0x4f, 0x77, 0x5e, 0xe6, 0x84, /* .<.Ow^.. */ +0x80, 0x52, 0xbe, 0x20, 0x30, 0x04, 0x06, 0x1f, /* .R. 0... */ +0x9a, 0x6f, 0x2f, 0xd5, 0xc6, 0x2a, 0x56, 0x03, /* .o/..*V. */ +0x0a, 0x0a, 0x0c, 0xd8, 0x88, 0x37, 0x08, 0xa1, /* .....7.. */ +0x10, 0x68, 0x9f, 0x77, 0x0e, 0x9e, 0xaf, 0xb6, /* .h.w.... */ +0x7e, 0xf0, 0x74, 0x6c, 0x5a, 0x87, 0x11, 0xeb, /* ~.tlZ... */ +0x06, 0x4e, 0x8d, 0x53, 0x8d, 0xc1, 0x56, 0xa0, /* .N.S..V. */ +0xe8, 0x31, 0x49, 0xb7, 0x7f, 0xfb, 0xe7, 0xbf, /* .1I..... */ +0x5e, 0x57, 0xc1, 0x45, 0xbc, 0xcd, 0x08, 0xbf, /* ^W.E.... */ +0x9c, 0x72, 0x47, 0x67, 0xd0, 0xbc, 0xe4, 0x6a, /* .rGg...j */ +0x5b, 0x6b, 0xfd, 0x18, 0x66, 0xdd, 0x20, 0x0b, /* [k..f. . */ +0x7e, 0xa5 /* ~. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt7[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xcb, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x3d, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +=...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xbe, 0x25, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x18, /* .%...FP. */ +0xff, 0xff, 0x67, 0x02, 0x00, 0x00, 0x74, 0x8f, /* ..g...t. */ +0x9c, 0xfb, 0x61, 0x7e, 0xa5, 0x92, 0x95, 0x81, /* ..a~.... */ +0x31, 0x47, 0xa7, 0xd7, 0xf9, 0x57, 0xe7, 0xd0, /* 1G...W.. */ +0xb9, 0x60, 0x59, 0x14, 0x03, 0x27, 0x2c, 0xd9, /* .`Y..',. */ +0x2e, 0x16, 0x09, 0xfd, 0x81, 0x7a, 0x46, 0xe9, /* .....zF. */ +0xa5, 0x94, 0x49, 0x58, 0x85, 0xd5, 0xc9, 0xc0, /* ..IX.... */ +0x9e, 0x05, 0x8b, 0x14, 0x4d, 0x46, 0xa8, 0x02, /* ....MF.. */ +0xb0, 0x9f, 0xbf, 0xd2, 0xc1, 0x36, 0x36, 0x72, /* .....66r */ +0x96, 0x63, 0x8a, 0xb6, 0x55, 0x29, 0xa3, 0xfa, /* .c..U).. */ +0x0b, 0xb6, 0xfe, 0xbb, 0x7a, 0x51, 0xed, 0x85, /* ....zQ.. */ +0xef, 0x9d, 0xf6, 0x25, 0x80, 0x38, 0x75, 0x20, /* ...%.8u */ +0x2d, 0x02, 0x1e, 0x1e, 0x8e, 0x30, 0xf3, 0x10, /* -....0.. */ +0x24, 0xe2, 0x86, 0x50, 0xd5, 0x19, 0x47, 0x4b, /* $..P..GK */ +0xd8, 0x42, 0x78, 0x09, 0x0f, 0xaa, 0x67, 0x0c, /* .Bx...g. */ +0x72, 0xc0, 0xfa, 0x7f, 0x97, 0x54, 0xd6, 0x78, /* r....T.x */ +0xec, 0xb2, 0xe0, 0x5b, 0xaf, 0x75, 0xcc, 0x39, /* ...[.u.9 */ +0x85, 0x4e, 0xa0, 0x0b, 0x3a, 0x7b, 0xa4, 0xb8, /* .N..:{.. */ +0xde, 0xc7, 0xe0, 0xf9, 0x62, 0x88, 0xdd, 0xfd, /* ....b... */ +0x09, 0x74, 0xf0, 0x31, 0x05, 0xa5, 0x23, 0xa2, /* .t.1..#. */ +0x38, 0xa3, 0x58, 0x87, 0xcb, 0x00, 0xab, 0xf9, /* 8.X..... */ +0x80, 0x46, 0xfb, 0xb9, 0xcf, 0x0a, 0x6d, 0xfe, /* .F....m. */ +0xce, 0xa9, 0xa4, 0xef, 0xb6, 0x03, 0xa4, 0xc9, /* ........ */ +0xc5, 0x50, 0xfa, 0x45, 0xb7, 0xa1, 0x44, 0xc7, /* .P.E..D. */ +0xc8, 0x80, 0x7b, 0x60, 0x40, 0x74, 0xbf, 0xe4, /* ..{`@t.. */ +0xf1, 0xa5, 0xbe, 0x1f, 0xb0, 0xdc, 0x68, 0x03, /* ......h. */ +0x13, 0x57, 0x20, 0x0b, 0x80, 0x23, 0x92, 0xa8, /* .W ..#.. */ +0x85, 0x95, 0x04, 0x3f, 0x99, 0xc7, 0xdb, 0xa6, /* ...?.... */ +0x4c, 0x34, 0xa7, 0xe2, 0xa1, 0xdd, 0x7b, 0x6e, /* L4....{n */ +0xca, 0xda, 0x38, 0xf7, 0x44, 0xef, 0xa4, 0x87, /* ..8.D... */ +0x66, 0x14, 0x1a, 0x91, 0x7f, 0xfe, 0x15, 0x47, /* f......G */ +0x99, 0x21, 0x72, 0x3e, 0x82, 0x30, 0x32, 0xf7, /* .!r>.02. */ +0xab, 0x99, 0x9d, 0xd2, 0x93, 0x7b, 0x14, 0x95, /* .....{.. */ +0x2f, 0x02, 0x3f, 0x94, 0xf5, 0x9e, 0xe2, 0x67, /* /.?....g */ +0xeb, 0xb5, 0x12, 0xff, 0x6e, 0x19, 0xb3, 0x76, /* ....n..v */ +0x5e, 0xf3, 0x4b, 0x26, 0xa1, 0xbc, 0xb3, 0xf4, /* ^.K&.... */ +0x78, 0x0f, 0xf7, 0x24, 0x47, 0x70, 0xe0, 0x45, /* x..$Gp.E */ +0xfd, 0xf0, 0xa5, 0xb7, 0x3c, 0xd0, 0xd4, 0x02, /* ....<... */ +0x94, 0xff, 0x7d, 0x5c, 0xf4, 0xd4, 0x34, 0x4d, /* ..}\..4M */ +0x3c, 0x4f, 0x0a, 0x29, 0xc4, 0x90, 0xd8, 0x28, /* b.. */ +0xed, 0x65, 0x4f, 0x6d, 0x94, 0xa3, 0x0a, 0x77, /* .eOm...w */ +0xb1, 0xf3, 0x87, 0xe2, 0xb7, 0x03, 0x6e, 0x00, /* ......n. */ +0x1a, 0x5b, 0xdb, 0x11, 0xb5, 0x78, 0xaf, 0x74, /* .[...x.t */ +0x8d, 0x06, 0xc9, 0x15, 0xbd, 0xbb, 0xca, 0x53, /* .......S */ +0x68, 0x81, 0x7e, 0xf6, 0x20, 0x4f, 0x80, 0xfd, /* h.~. O.. */ +0x12, 0x28, 0xa4, 0xb5, 0x4d, 0x98, 0x3b, 0xad, /* .(..M.;. */ +0x81, 0x1b, 0x45, 0xe3, 0x50, 0x96, 0x85, 0xb7, /* ..E.P... */ +0x7b, 0x9c, 0xfd, 0xc9, 0x83, 0x47, 0xad, 0x93, /* {....G.. */ +0x7d, 0xee, 0xd8, 0x20, 0x8e, 0x11, 0x8f, 0xab, /* }.. .... */ +0x18, 0x99, 0x8a, 0x64, 0xd2, 0xf0, 0xe1, 0x07, /* ...d.... */ +0x35, 0xec, 0x6c, 0x0e, 0x4c, 0xb8, 0xbb, 0x54, /* 5.l.L..T */ +0xa4, 0x82, 0x53, 0x4a, 0x3e, 0x9a, 0x9f, 0x7c, /* ..SJ>..| */ +0x19, 0x65, 0xda, 0x76, 0xfa, 0x9b, 0x7f, 0x6c, /* .e.v...l */ +0x32, 0x45, 0xd1, 0x0a, 0xce, 0x22, 0xcd, 0x53, /* 2E...".S */ +0x0a, 0x28, 0x4a, 0xf4, 0xf1, 0xdc, 0xb2, 0x06, /* .(J..... */ +0xf8, 0xcb, 0x91, 0x4d, 0x39, 0xc0, 0x0f, 0x65, /* ...M9..e */ +0xe5, 0x78, 0x23, 0xdb, 0x37, 0x59, 0xba, 0x68, /* .x#.7Y.h */ +0x28, 0xd5, 0x91, 0xe3, 0xb2, 0x07, 0x20, 0x63, /* (..... c */ +0xe2, 0x8a, 0x9d, 0x8c, 0xbd, 0x5e, 0x2a, 0x2a, /* .....^** */ +0x87, 0xb2, 0xaa, 0xef, 0xdc, 0xc6, 0x6e, 0xd8, /* ......n. */ +0x81, 0xe2, 0xc0, 0x6f, 0x31, 0x7f, 0x23, 0xd5, /* ...o1.#. */ +0x30, 0x85, 0x2a, 0x91, 0xaf, 0xab, 0xa7, 0xc8, /* 0.*..... */ +0x5c, 0xc6, 0x73, 0xf2, 0x40, 0x97, 0xd7, 0xfb, /* \.s.@... */ +0xb2, 0x7a, 0x4a, 0x66, 0x51, 0xec, 0x41, 0x42, /* .zJfQ.AB */ +0xb1, 0x06, 0x1f, 0x95, 0xfd, 0x6f, 0x82, 0x97, /* .....o.. */ +0x88, 0xbc, 0x01, 0x8f, 0xfd, 0x61, 0xa6, 0x83, /* .....a.. */ +0x69, 0x3d, 0x70, 0xa5, 0xfb, 0xf6, 0xec, 0x61, /* i=p....a */ +0xf0, 0x7a, 0xe4, 0x21, 0x85, 0x38, 0xd5, 0x76, /* .z.!.8.v */ +0x03, 0xc9, 0x3b, 0x5a, 0x62, 0x9e, 0xfa, 0x51, /* ..;Zb..Q */ +0x84, 0x54, 0x12, 0x96, 0x9c, 0x35, 0xf2, 0x25, /* .T...5.% */ +0x70, 0x66, 0x49, 0x22, 0x3e, 0xab, 0xc4, 0x7f, /* pfI">... */ +0x60, 0x3d, 0x47, 0x49, 0x8c, 0x16, 0x33, 0x4a, /* `=GI..3J */ +0x98, 0xa5, 0x91, 0x4a, 0x80, 0x59, 0x76, 0x0f, /* ...J.Yv. */ +0xd7, 0xcc, 0xfb, 0x95, 0x95, 0x7b, 0x0e, 0x6d, /* .....{.m */ +0xff, 0x17, 0x3d, 0x72, 0xf9, 0xf3, 0xc5, 0xb8, /* ..=r.... */ +0x17, 0xca, 0xdd, 0xff, 0xfb, 0x0e, 0x3c, 0xfe, /* ......<. */ +0x9f, 0x1c, 0xac, 0xe8, 0x77, 0x2c, 0x86, 0xd5, /* ....w,.. */ +0xb6, 0x80, 0xaa, 0x26, 0xe0, 0x28, 0x44, 0x71, /* ...&.(Dq */ +0x96, 0x6d, 0x22, 0x24, 0x2d, 0xd8, 0xf4, 0x81, /* .m"$-... */ +0x08, 0x56, 0xf2, 0x18, 0xd5, 0xdb, 0x13, 0x06, /* .V...... */ +0x61, 0x54, 0xdc, 0x41, 0xbb, 0xb7, 0x69, 0x31, /* aT.A..i1 */ +0xc4, 0x73, 0x4d, 0x84, 0xa0, 0x36, 0xef, 0x95, /* .sM..6.. */ +0x6f, 0xc6, 0x9f, 0xa9, 0x45, 0x41, 0xed, 0xd6, /* o...EA.. */ +0x0d, 0x0b, 0x5e, 0x68, 0xd5, 0x35, 0xe7, 0x76, /* ..^h.5.v */ +0xb2, 0x71, 0x62, 0xed, 0x10, 0xfc, 0x0f, 0x78, /* .qb....x */ +0x1a, 0x48, 0x57, 0x03, 0x8b, 0xd8, 0x05, 0x07, /* .HW..... */ +0x5a, 0x34, 0xa5, 0xcd, 0xef, 0x4f, 0x0f, 0xf3, /* Z4...O.. */ +0xbe, 0xf9, 0x98, 0xce, 0x74, 0x2e, 0x4a, 0x9c, /* ....t.J. */ +0x0c, 0x84, 0x39, 0xf5, 0x9d, 0xa0, 0x47, 0xf9, /* ..9...G. */ +0xde, 0x90, 0xf2, 0x7d, 0x0f, 0xa2, 0x25, 0xe4, /* ...}..%. */ +0x36, 0x5b, 0x97, 0xd6, 0xfd, 0x7d, 0xe1, 0xf7, /* 6[...}.. */ +0x8a, 0x5b, 0x4d, 0xc5, 0x89, 0x43, 0xc0, 0x11, /* .[M..C.. */ +0x90, 0xe9, 0x79, 0xba, 0x01, 0x6c, 0x9e, 0x34, /* ..y..l.4 */ +0x89, 0x6c, 0xcc, 0x7c, 0x65, 0x86, 0xbe, 0x46, /* .l.|e..F */ +0x1f, 0x2f, 0xb2, 0x32, 0x1c, 0x3f, 0x2c, 0xdf, /* ./.2.?,. */ +0x24, 0xeb, 0x5b, 0xba, 0xd9, 0x9b, 0x8d, 0x54, /* $.[....T */ +0x17, 0x8e, 0x92, 0x1a, 0x69, 0xbc, 0x56, 0x61, /* ....i.Va */ +0x89, 0x3c, 0xec, 0xf6, 0xcd, 0xaa, 0x9b, 0xfa, /* .<...... */ +0x6a, 0xb8, 0x0a, 0x42, 0x68, 0x76, 0xd8, 0x10, /* j..Bhv.. */ +0x5f, 0x74, 0x89, 0x9a, 0x82, 0xbc, 0x4a, 0xdb, /* _t....J. */ +0x0d, 0x89, 0x73, 0x94, 0x13, 0x77, 0x4b, 0xac, /* ..s..wK. */ +0xa2, 0xf8, 0xad, 0xe8, 0xc2, 0xd7, 0x9b, 0xb8, /* ........ */ +0xeb, 0xf2, 0xf7, 0x33, 0xcc, 0x12, 0x4f, 0x65, /* ...3..Oe */ +0xda, 0x9e, 0xe7, 0xa8, 0x60, 0x55, 0xde, 0x13, /* ....`U.. */ +0x10, 0x8a, 0xa4, 0x0a, 0x0e, 0x5d, 0xfe, 0xcb, /* .....].. */ +0xf3, 0x7f, 0x9d, 0x08, 0x48, 0xba, 0xfe, 0x14, /* ....H... */ +0x48, 0xb4, 0xa3, 0x6c, 0x7a, 0xae, 0xcb, 0xb7, /* H..lz... */ +0xf8, 0x80, 0xe2, 0xfa, 0xd2, 0xdf, 0xac, 0x19, /* ........ */ +0x1c, 0xd8, 0xc7, 0x3f, 0x30, 0xd4, 0x1f, 0x7a, /* ...?0..z */ +0x8d, 0x78, 0xc9, 0xed, 0xb8, 0xe8, 0xfb, 0xd5, /* .x...... */ +0xa2, 0xab, 0x5a, 0x28, 0x4a, 0xfe, 0xc4, 0xcc, /* ..Z(J... */ +0x85, 0xab, 0x88, 0xc5, 0x38, 0x05, 0xe0, 0xbb, /* ....8... */ +0xed, 0x41, 0xe0, 0x73, 0xcc, 0xb4, 0x65, 0xfa, /* .A.s..e. */ +0x55, 0x62, 0xab, 0xf1, 0x12, 0x57, 0x33, 0x49, /* Ub...W3I */ +0xd5, 0x41, 0x02, 0xaa, 0x7a, 0x17, 0x8e, 0xd7, /* .A..z... */ +0xe1, 0xd0, 0x4e, 0xae, 0x6c, 0xb2, 0x0a, 0x4c, /* ..N.l..L */ +0x3b, 0x1c, 0x8c, 0x63, 0x74, 0x3f, 0xbd, 0x19, /* ;..ct?.. */ +0xc5, 0xdb, 0x24, 0x1a, 0x2d, 0x0c, 0xb0, 0xfa, /* ..$.-... */ +0x72, 0x43, 0xe4, 0x8c, 0x9f, 0x10, 0xda, 0x5e, /* rC.....^ */ +0x89, 0xa9, 0xd5, 0x47, 0x04, 0x12, 0x87, 0x62, /* ...G...b */ +0x90, 0x96, 0x19, 0x88, 0xc9, 0xe2, 0xba, 0x56, /* .......V */ +0x3a, 0x37, 0xcf, 0xbc, 0x77, 0x7e, 0x09, 0x1f, /* :7..w~.. */ +0x52, 0xee, 0x8e, 0xf2, 0x82, 0x05, 0xb7, 0x2c, /* R......, */ +0x18, 0x27, 0xfd, 0xa4, 0xf7, 0xff, 0x61, 0x2b, /* .'....a+ */ +0x42, 0xe7, 0x12, 0xc0, 0xc3, 0xee, 0xd9, 0x4a, /* B......J */ +0x0f, 0x6c, 0x5e, 0x31, 0xa6, 0x13, 0xcd, 0x91, /* .l^1.... */ +0x05, 0x84, 0x7c, 0x4e, 0xe7, 0x7b, 0xc1, 0xe7, /* ..|N.{.. */ +0x4b, 0xdf, 0xfc, 0x12, 0x80, 0x11, 0xca, 0x93, /* K....... */ +0xcc, 0x4d, 0x05, 0xbe, 0xaf, 0xd3, 0xa7, 0xcb, /* .M...... */ +0x96, 0x36, 0x5c, 0x67, 0xf0, 0x34, 0x95, 0x5c, /* .6\g.4.\ */ +0x44, 0x3c, 0x2a, 0x7c, 0xde, 0xc0, 0x8b, 0x6d, /* D<*|...m */ +0x32, 0xdc, 0xa0, 0x00, 0xb4, 0xa1, 0x81, 0xf2, /* 2....... */ +0x93, 0xf5, 0x3e, 0x0f, 0xd0, 0x43, 0x31, 0x14, /* ..>..C1. */ +0xa6, 0xa5, 0xa8, 0xf0, 0x38, 0xa9, 0xfb, 0x15, /* ....8... */ +0x3f, 0xba, 0x01, 0x9e, 0x73, 0xc8, 0xe1, 0xe2, /* ?...s... */ +0xdb, 0x95, 0xa8, 0x80, 0x00, 0xb1, 0x13, 0xb9, /* ........ */ +0xb1, 0xb6, 0x23, 0x2a, 0xf6, 0x34, 0xcf, 0x01, /* ..#*.4.. */ +0x12, 0x4e, 0x97, 0x9a, 0x61, 0x3e, 0x9a, 0x11, /* .N..a>.. */ +0xb5, 0x43, 0x27, 0x35, 0x86, 0x57, 0x40, 0xb8, /* .C'5.W@. */ +0x7a, 0x9c, 0x2c, 0xd5, 0x83, 0x0f, 0xb6, 0x1b, /* z.,..... */ +0x40, 0xf8, 0xaf, 0xa1, 0xb7, 0x3a, 0x05, 0xad, /* @....:.. */ +0x7d, 0xba, 0x69, 0x10, 0xca, 0x6f, 0xcb, 0xf0, /* }.i..o.. */ +0xd6, 0xe4, 0x64, 0xf1, 0xd9, 0x93, 0x7d, 0xb5, /* ..d...}. */ +0x20, 0x57, 0xb7, 0x44, 0xa1, 0x6b, 0x8f, 0xb7, /* W.D.k.. */ +0x6c, 0x2f, 0xdc, 0xe7, 0x6a, 0xb8, 0x06, 0x0a, /* l/..j... */ +0xdf, 0xd5, 0x1e, 0x16, 0xd6, 0xf4, 0xc2, 0x9b, /* ........ */ +0x41, 0x78, 0x61, 0xa7, 0x5a, 0xcf, 0x0f, 0x41, /* Axa.Z..A */ +0x61, 0xd2, 0x28, 0xfc, 0x97, 0xc5, 0x94, 0xb2, /* a.(..... */ +0x75, 0x50, 0xb0, 0x5a, 0x8b, 0xea, 0x8f, 0x6e, /* uP.Z...n */ +0x53, 0x56, 0x3c, 0xf6, 0x60, 0xd0, 0x85, 0xe8, /* SV<.`... */ +0xd8, 0xf4, 0x87, 0xd0, 0xf1, 0x19, 0x53, 0x57, /* ......SW */ +0x08, 0x65, 0x89, 0x41, 0x36, 0x7d, 0xb2, 0x73, /* .e.A6}.s */ +0xcf, 0x29, 0x5b, 0xcb, 0x9c, 0x70, 0x47, 0x3a, /* .)[..pG: */ +0x66, 0xc4, 0x6a, 0x5c, 0x9b, 0x41, 0xf6, 0x9f, /* f.j\.A.. */ +0xcf, 0x64, 0xd5, 0xa3, 0xc4, 0x48, 0xee, 0x37, /* .d...H.7 */ +0x16, 0xac, 0x06, 0xb8, 0x32, 0xb4, 0x72, 0x44, /* ....2.rD */ +0x73, 0x54, 0x7a, 0xb0, 0x76, 0x1a, 0xb7, 0xb4, /* sTz.v... */ +0x04, 0x00, 0xf4, 0x4a, 0xdc, 0xb9, 0x58, 0x1f, /* ...J..X. */ +0x34, 0x43, 0xd9, 0xee, 0x02, 0x54, 0x88, 0x7e, /* 4C...T.~ */ +0x49, 0x88, 0x09, 0x68, 0xdd, 0x58, 0x1e, 0x37, /* I..h.X.7 */ +0x61, 0x95, 0xb8, 0xb6, 0x89, 0xf4, 0xf8, 0xa4, /* a....... */ +0x36, 0x05, 0x45, 0x4f, 0x0e, 0x57, 0xab, 0xd6, /* 6.EO.W.. */ +0xdd, 0x85, 0x27, 0xf4, 0xce, 0xd4, 0x3b, 0x39, /* ..'...;9 */ +0x87, 0xa3, 0x35, 0x00, 0x11, 0x53, 0xb2, 0x80, /* ..5..S.. */ +0x60, 0xe7, 0x9e, 0x1b, 0x24, 0x60, 0x65, 0xf6, /* `...$`e. */ +0x35, 0x96, 0x2a, 0x87, 0x87, 0xa6, 0xb8, 0x79, /* 5.*....y */ +0xf5, 0xed, 0x1c, 0xdb, 0x96, 0x9e, 0x08, 0x2f, /* ......./ */ +0xb8, 0x0d, 0x40, 0xe7, 0xa4, 0xb8, 0xe3, 0xf7, /* ..@..... */ +0x49, 0xc4, 0x9d, 0xec, 0x50, 0xf3, 0x8f, 0x00, /* I...P... */ +0x33, 0x1a, 0xc9, 0x3c, 0x14, 0x0e, 0x18, 0xd1, /* 3..<.... */ +0xd8, 0xae /* .. */ +}; + +/* Frame (719 bytes) */ +static const unsigned char pkt8[719] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x02, 0xc1, 0xe7, 0xd3, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2e, 0x50, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* .P...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xeb, 0xc5, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x18, /* .....FP. */ +0xff, 0xff, 0x44, 0x4b, 0x00, 0x00, 0x8d, 0x68, /* ..DK...h */ +0x62, 0x45, 0x47, 0x5a, 0xe3, 0xab, 0x32, 0xbc, /* bEGZ..2. */ +0x5e, 0x31, 0xb1, 0x90, 0x55, 0x75, 0xf3, 0x0f, /* ^1..Uu.. */ +0x83, 0xa4, 0x38, 0x84, 0x00, 0xcf, 0xa4, 0x0b, /* ..8..... */ +0xb3, 0x41, 0xdc, 0x6d, 0x48, 0xb2, 0xbc, 0x5c, /* .A.mH..\ */ +0x26, 0x8f, 0x12, 0x7b, 0xf3, 0xdd, 0xda, 0xb4, /* &..{.... */ +0xb7, 0x68, 0xc7, 0x1b, 0x42, 0x2b, 0x51, 0x90, /* .h..B+Q. */ +0x5b, 0xab, 0x3d, 0x7e, 0x4a, 0xb9, 0x55, 0x9b, /* [.=~J.U. */ +0xd4, 0x80, 0x1d, 0x7f, 0x81, 0xa4, 0xff, 0x54, /* .......T */ +0xa9, 0x61, 0xb9, 0xad, 0x51, 0x29, 0x08, 0x36, /* .a..Q).6 */ +0x57, 0xeb, 0xdd, 0x29, 0x26, 0xcc, 0xd5, 0x95, /* W..)&... */ +0x70, 0x6f, 0xee, 0xcb, 0xd9, 0x14, 0xe2, 0xb5, /* po...... */ +0xd9, 0xbd, 0x0f, 0xb1, 0x90, 0x2a, 0x6b, 0xb7, /* .....*k. */ +0x62, 0x5d, 0x7e, 0x89, 0xee, 0x0f, 0xfd, 0xb1, /* b]~..... */ +0x5a, 0xb1, 0xf6, 0xe7, 0x9c, 0xcb, 0xd1, 0xd7, /* Z....... */ +0x75, 0x4c, 0xc0, 0xb1, 0xe9, 0xb4, 0x87, 0xd9, /* uL...... */ +0x4e, 0x12, 0x62, 0xc4, 0xda, 0xeb, 0x3c, 0xb4, /* N.b...<. */ +0x4f, 0xf1, 0x38, 0xa4, 0xe3, 0x83, 0x3d, 0xd7, /* O.8...=. */ +0x2c, 0x6a, 0x20, 0xde, 0x7d, 0xf1, 0x05, 0xb0, /* ,j .}... */ +0xbb, 0xe9, 0x1b, 0x00, 0xed, 0xd2, 0x1f, 0x6a, /* .......j */ +0xd3, 0xad, 0x87, 0x8c, 0xc1, 0x1e, 0xf1, 0x22, /* ......." */ +0x34, 0x59, 0x91, 0xf8, 0xfa, 0xe7, 0x18, 0xd6, /* 4Y...... */ +0x41, 0x5e, 0x58, 0xdb, 0x19, 0x84, 0x1a, 0xa3, /* A^X..... */ +0x79, 0xb7, 0x91, 0x92, 0x13, 0x6a, 0xba, 0xde, /* y....j.. */ +0x63, 0x00, 0x3c, 0xe9, 0xfa, 0x66, 0x70, 0x46, /* c.<..fpF */ +0x7e, 0xc3, 0x21, 0x6f, 0xda, 0x38, 0x00, 0x55, /* ~.!o.8.U */ +0x19, 0x8c, 0x80, 0x4b, 0x74, 0xa1, 0xab, 0x65, /* ...Kt..e */ +0x75, 0xc7, 0x75, 0xf1, 0xb2, 0xf8, 0xb6, 0x57, /* u.u....W */ +0xe4, 0xdb, 0xc5, 0xe5, 0x19, 0xf3, 0xc0, 0xea, /* ........ */ +0x49, 0x0d, 0xff, 0xb1, 0xe1, 0xbc, 0x3c, 0xee, /* I.....<. */ +0xc7, 0x71, 0x4e, 0x3d, 0xc9, 0xe4, 0x63, 0x20, /* .qN=..c */ +0xd1, 0x8b, 0xab, 0x1c, 0x65, 0xe8, 0x22, 0x37, /* ....e."7 */ +0x72, 0xff, 0x12, 0x3b, 0xb3, 0x32, 0x76, 0x3f, /* r..;.2v? */ +0xfa, 0x02, 0x7d, 0x4a, 0x1b, 0x6e, 0xd1, 0x94, /* ..}J.n.. */ +0xff, 0xee, 0xe5, 0xa3, 0x8c, 0x1c, 0xc6, 0x73, /* .......s */ +0xaf, 0x77, 0x34, 0xdb, 0x4e, 0x76, 0x3b, 0x30, /* .w4.Nv;0 */ +0x8d, 0x08, 0xf7, 0xcf, 0xbc, 0x45, 0x7c, 0xfc, /* .....E|. */ +0xdb, 0xcc, 0xbd, 0x62, 0xc6, 0x81, 0x8c, 0x48, /* ...b...H */ +0x08, 0x97, 0xc1, 0x5e, 0x34, 0xa9, 0x6f, 0xe5, /* ...^4.o. */ +0xc4, 0xda, 0x1a, 0x5f, 0x11, 0x6b, 0xaa, 0x37, /* ..._.k.7 */ +0x39, 0xbf, 0x4b, 0x74, 0x22, 0x57, 0xfc, 0xa4, /* 9.Kt"W.. */ +0x5b, 0xd8, 0x77, 0xe3, 0x20, 0x23, 0x10, 0xbc, /* [.w. #.. */ +0xd7, 0x69, 0xe9, 0x75, 0xb6, 0x76, 0x24, 0xda, /* .i.u.v$. */ +0xb5, 0x0a, 0x51, 0x66, 0xc4, 0x66, 0x0b, 0x7e, /* ..Qf.f.~ */ +0x46, 0xa7, 0x60, 0xa7, 0x78, 0x82, 0x74, 0x36, /* F.`.x.t6 */ +0xfc, 0xb8, 0xbd, 0x1b, 0x5c, 0x85, 0xe3, 0xd9, /* ....\... */ +0x60, 0x10, 0x68, 0x89, 0x28, 0x36, 0x49, 0xa5, /* `.h.(6I. */ +0x83, 0xbf, 0xb2, 0x8a, 0x2b, 0x16, 0x42, 0x98, /* ....+.B. */ +0x76, 0xf1, 0x7e, 0x96, 0xb2, 0xea, 0x62, 0xbf, /* v.~...b. */ +0xc1, 0x61, 0xd6, 0x79, 0xb2, 0x03, 0x04, 0x99, /* .a.y.... */ +0x0e, 0xdc, 0x31, 0xb5, 0xc5, 0x31, 0x3e, 0x98, /* ..1..1>. */ +0x7c, 0x54, 0x92, 0xbf, 0x71, 0x76, 0x4e, 0xfe, /* |T..qvN. */ +0x6c, 0x13, 0x7a, 0xa7, 0xb5, 0xe9, 0x44, 0x34, /* l.z...D4 */ +0x77, 0x70, 0x71, 0x1c, 0xbd, 0x2b, 0x1e, 0x28, /* wpq..+.( */ +0x98, 0x75, 0xfd, 0xc9, 0xb2, 0x51, 0xef, 0x8f, /* .u...Q.. */ +0xbc, 0x6a, 0x7e, 0x85, 0xb5, 0xfa, 0xe6, 0x7c, /* .j~....| */ +0x6a, 0xd2, 0xae, 0x68, 0xbb, 0x24, 0xb9, 0x9b, /* j..h.$.. */ +0x30, 0xf1, 0x7e, 0xa6, 0xe3, 0x0c, 0x0b, 0xac, /* 0.~..... */ +0x85, 0x20, 0x2b, 0x2d, 0x8f, 0x84, 0x8c, 0x56, /* . +-...V */ +0xec, 0xac, 0x18, 0x53, 0x8d, 0x52, 0x11, 0xd1, /* ...S.R.. */ +0xe1, 0x50, 0xae, 0xdd, 0x88, 0x84, 0xb6, 0x61, /* .P.....a */ +0xb1, 0x96, 0x4f, 0x72, 0x58, 0x11, 0x4d, 0xa5, /* ..OrX.M. */ +0x1c, 0xc9, 0x89, 0x44, 0x8e, 0x69, 0x2b, 0x44, /* ...D.i+D */ +0x85, 0x90, 0xc6, 0x92, 0xbc, 0xe5, 0x99, 0x51, /* .......Q */ +0xe0, 0xae, 0x45, 0xf9, 0x32, 0xf1, 0x46, 0x98, /* ..E.2.F. */ +0xbe, 0x68, 0xd4, 0x48, 0x92, 0x87, 0x60, 0x40, /* .h.H..`@ */ +0xd6, 0xf6, 0x69, 0xc3, 0x5c, 0x64, 0x3b, 0x8f, /* ..i.\d;. */ +0x66, 0x4c, 0x14, 0xe5, 0x5f, 0x7f, 0x28, 0x1b, /* fL.._.(. */ +0x9e, 0x05, 0x7e, 0x39, 0xb8, 0xe5, 0xe7, 0x3c, /* ..~9...< */ +0x79, 0xb8, 0xc0, 0x42, 0x76, 0x2a, 0xf4, 0xf6, /* y..Bv*.. */ +0xd7, 0x11, 0xc9, 0xe8, 0x44, 0xee, 0xce, 0x8f, /* ....D... */ +0x6c, 0x67, 0xba, 0x8b, 0x59, 0x36, 0x38, 0x43, /* lg..Y68C */ +0xb5, 0x08, 0x43, 0x36, 0xe0, 0xb1, 0xdd, 0xc6, /* ..C6.... */ +0x89, 0x38, 0xf3, 0x86, 0x90, 0x27, 0xb9, 0x1a, /* .8...'.. */ +0xf3, 0xa0, 0xb0, 0x02, 0xb1, 0x13, 0xed, 0xb7, /* ........ */ +0x9a, 0x21, 0xad, 0x0f, 0xbd, 0xd6, 0x35, 0xff, /* .!....5. */ +0xe2, 0x24, 0xb4, 0x95, 0x52, 0xcb, 0xe0, 0x09, /* .$..R... */ +0xa4, 0x70, 0xfe, 0x7f, 0x95, 0x08, 0x11, 0xa4, /* .p...... */ +0x70, 0x9f, 0xf7, 0x43, 0x6d, 0x24, 0x46, 0x12, /* p..Cm$F. */ +0x2c, 0x52, 0x9b, 0xf0, 0x4b, 0xfb, 0x89, 0x9e, /* ,R..K... */ +0x9e, 0xf1, 0xb6, 0x21, 0x95, 0xc1, 0x8a, 0x16, /* ...!.... */ +0xc3, 0xd6, 0xa6, 0xf4, 0xd7, 0x0f, 0x87, 0x15, /* ........ */ +0x16, 0x14, 0x71, 0x85, 0x8b, 0x10, 0x8a, 0x7a, /* ..q....z */ +0x95, 0x59, 0x92, 0x1f, 0x5a, 0x01, 0x97 /* .Y..Z.. */ +}; + +/* Frame (1173 bytes) */ +static const unsigned char pkt9[1173] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x04, 0x87, 0xe7, 0xd5, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2c, 0x88, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* ,....... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xf4, 0x12, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x18, /* .....FP. */ +0xff, 0xff, 0x7a, 0x92, 0x00, 0x00, 0x30, 0x9a, /* ..z...0. */ +0xd0, 0x8e, 0x56, 0x52, 0x40, 0x81, 0x0c, 0xd4, /* ..VR@... */ +0x37, 0x25, 0xce, 0xcd, 0x3c, 0x3c, 0x56, 0xca, /* 7%..<.;..V */ +0x7a, 0xa0, 0x1e, 0x6a, 0x87, 0x5e, 0xc5, 0x01, /* z..j.^.. */ +0x5c, 0x13, 0xc0, 0x30, 0x8a, 0x0a, 0x29, 0x09, /* \..0..). */ +0xce, 0x57, 0xdf, 0xd0, 0x04, 0x89, 0x63, 0xbc, /* .W....c. */ +0xde, 0x2f, 0xf1, 0x4e, 0xcb, 0xe6, 0x15, 0xf9, /* ./.N.... */ +0x80, 0xd8, 0x36, 0xf0, 0x7f, 0xdc, 0xde, 0x8b, /* ..6..... */ +0x94, 0xa5, 0xce, 0x27, 0xd7, 0x7d, 0x35, 0x80, /* ...'.}5. */ +0x6e, 0xd9, 0x78, 0x10, 0xdb, 0x67, 0xab, 0xc2, /* n.x..g.. */ +0xa8, 0x6b, 0x3f, 0x4e, 0xbd, 0x68, 0x6e, 0x48, /* .k?N.hnH */ +0x30, 0x24, 0xeb, 0xef, 0x94, 0x40, 0xf3, 0xa1, /* 0$...@.. */ +0x3f, 0xe7, 0x88, 0x2e, 0x38, 0x5f, 0xf3, 0x31, /* ?...8_.1 */ +0x88, 0x92, 0xe4, 0xa7, 0x23, 0xc6, 0xfb, 0x17, /* ....#... */ +0x60, 0xfc, 0x6a, 0xae, 0xa6, 0xe8, 0xd5, 0xa6, /* `.j..... */ +0xad, 0x4b, 0x65, 0x3d, 0x56, 0x08, 0xc6, 0xae, /* .Ke=V... */ +0x54, 0x07, 0xc1, 0xa5, 0xb0, 0x38, 0x8e, 0xb0, /* T....8.. */ +0xf6, 0x12, 0x3d, 0x24, 0x59, 0x41, 0xc2, 0xe9, /* ..=$YA.. */ +0x08, 0x56, 0x14, 0xbe, 0x4f, 0x83, 0x0b, 0x09, /* .V..O... */ +0x08, 0x1a, 0x02, 0xe3, 0xcb, 0xcc, 0x84, 0x70, /* .......p */ +0x4e, 0x3f, 0xa1, 0xdc, 0xee, 0x78, 0x30, 0x27, /* N?...x0' */ +0xb0, 0x1f, 0x01, 0xae, 0xbf, 0x34, 0x49, 0x1b, /* .....4I. */ +0xab, 0x88, 0x5d, 0x4d, 0x6d, 0xff, 0xc2, 0x01, /* ..]Mm... */ +0x73, 0xc2, 0x70, 0x25, 0x98, 0x93, 0x51, 0xc4, /* s.p%..Q. */ +0xfb, 0x56, 0x70, 0xa1, 0xfb, 0x45, 0xf5, 0xe8, /* .Vp..E.. */ +0x41, 0x7c, 0x58, 0x8d, 0x63, 0x95, 0x46, 0x5b, /* A|X.c.F[ */ +0x03, 0x7e, 0xda, 0x2a, 0x7e, 0x90, 0xf3, 0x64, /* .~.*~..d */ +0x8e, 0x95, 0x74, 0xe3, 0x30, 0x2c, 0x3a, 0xbe, /* ..t.0,:. */ +0xe3, 0x25, 0xa0, 0xb7, 0x25, 0xb5, 0xfe, 0xc0, /* .%..%... */ +0x53, 0xb5, 0xcc, 0xcb, 0x44, 0x56, 0xc5, 0xc3, /* S...DV.. */ +0xd2, 0xa6, 0xaf, 0x24, 0x8d, 0x73, 0x07, 0x13, /* ...$.s.. */ +0x04, 0x7b, 0xbf, 0x1f, 0x87, 0x7c, 0xe5, 0x52, /* .{...|.R */ +0xce, 0x4e, 0x7d, 0x36, 0x56, 0x13, 0x85, 0x6b, /* .N}6V..k */ +0x7e, 0xd7, 0x04, 0x44, 0xb1, 0x06, 0x06, 0xb8, /* ~..D.... */ +0x7b, 0x58, 0x65, 0x62, 0x33, 0x8b, 0x5d, 0xb2, /* {Xeb3.]. */ +0x53, 0x46, 0x34, 0x3a, 0x18, 0x18, 0x45, 0x4b, /* SF4:..EK */ +0x89, 0x9e, 0x1b, 0xc5, 0xfa, 0x6d, 0xf9, 0xb1, /* .....m.. */ +0x3d, 0x0b, 0x56, 0x75, 0x37, 0x72, 0x4b, 0x89, /* =.Vu7rK. */ +0xea, 0x15, 0x7c, 0x57, 0xce, 0x29, 0xd1, 0xbd, /* ..|W.).. */ +0x08, 0x22, 0x08, 0x05, 0x99, 0x03, 0x2a, 0xcf, /* ."....*. */ +0x2b, 0xc4, 0xb4, 0xef, 0x04, 0x91, 0x8b, 0xd0, /* +....... */ +0xc8, 0xfc, 0x4a, 0x32, 0x50, 0x84, 0x5d, 0x41, /* ..J2P.]A */ +0xd9, 0x35, 0x85, 0x86, 0x11, 0x4a, 0x5f, 0x09, /* .5...J_. */ +0x67, 0x94, 0x96, 0xd3, 0xe0, 0x76, 0xf8, 0x41, /* g....v.A */ +0x9d, 0x95, 0x88, 0x9d, 0x19, 0x91, 0x74, 0x36, /* ......t6 */ +0x2c, 0x17, 0xaa, 0x7e, 0x8b, 0x0f, 0x8e, 0x2e, /* ,..~.... */ +0x1d, 0xa3, 0x24, 0xc4, 0xc7, 0x16, 0xbc, 0x31, /* ..$....1 */ +0xdb, 0xcf, 0x4f, 0xab, 0x66, 0x17, 0xf4, 0xdc, /* ..O.f... */ +0x66, 0x67, 0x16, 0x95, 0xab, 0x88, 0x53, 0xad, /* fg....S. */ +0x02, 0x1e, 0x10, 0x14, 0x09, 0x1d, 0xd0, 0x04, /* ........ */ +0xd6, 0x2e, 0x3d, 0x65, 0x9c, 0xe0, 0x32, 0x47, /* ..=e..2G */ +0x0f, 0xfa, 0x49, 0x63, 0xfa, 0x1b, 0xf1, 0xf8, /* ..Ic.... */ +0x80, 0x73, 0x38, 0x42, 0x6d, 0x46, 0x30, 0x9c, /* .s8BmF0. */ +0x83, 0x05, 0x63, 0xd6, 0xd7, 0x5b, 0x27, 0x3d, /* ..c..['= */ +0x0b, 0xa1, 0xde, 0xd5, 0xf0, 0xed, 0xd1, 0xdb, /* ........ */ +0x5f, 0x4b, 0x9c, 0xa1, 0x87, 0xa3, 0xf8, 0x37, /* _K.....7 */ +0x10, 0xff, 0x16, 0x93, 0x5d, 0x6c, 0xa8, 0xcb, /* ....]l.. */ +0x85, 0xb5, 0xb0, 0x78, 0x30, 0x26, 0x19, 0xfc, /* ...x0&.. */ +0xce, 0xbd, 0xc3, 0x7d, 0x04, 0x46, 0xf8, 0xdc, /* ...}.F.. */ +0xdc, 0x12, 0xe6, 0xc7, 0x8e, 0x53, 0xdf, 0xd7, /* .....S.. */ +0xd9, 0xe9, 0x71, 0x04, 0xfc, 0x16, 0x63, 0x72, /* ..q...cr */ +0x04, 0xf4, 0x03, 0xe7, 0xde, 0xa3, 0xee, 0x04, /* ........ */ +0x7f, 0xb2, 0x2f, 0x4a, 0xc5, 0x6f, 0x0b, 0x09, /* ../J.o.. */ +0xc6, 0xde, 0x8f, 0x86, 0xfd, 0x5b, 0x26, 0x49, /* .....[&I */ +0x3a, 0x6f, 0xbd, 0x36, 0xe9, 0x7a, 0x5a, 0x1c, /* :o.6.zZ. */ +0x72, 0x81, 0xb2, 0x20, 0x6b, 0xe6, 0xb9, 0x29, /* r.. k..) */ +0x8f, 0x5d, 0x8d, 0xff, 0x10, 0xc5, 0xaa, 0x68, /* .].....h */ +0x9b, 0xbf, 0xd3, 0x66, 0x70, 0xe8, 0x93, 0xcb, /* ...fp... */ +0xad, 0xee, 0x44, 0xbf, 0x26, 0xdb, 0xef, 0x1d, /* ..D.&... */ +0xbd, 0x7c, 0x52, 0x6b, 0xdf, 0x1c, 0xef, 0x65, /* .|Rk...e */ +0xa4, 0xc2, 0x04, 0x95, 0xd7, 0xfe, 0x6f, 0xe8, /* ......o. */ +0xe1, 0xe0, 0x2d, 0xe5, 0xc1, 0xbd, 0x50, 0x9f, /* ..-...P. */ +0x44, 0x46, 0x17, 0xeb, 0xf0, 0x85, 0xfa, 0xd2, /* DF...... */ +0xa0, 0x0d, 0x2f, 0xcc, 0xfb, 0x3c, 0x9f, 0x79, /* ../..<.y */ +0x18, 0xf7, 0x11, 0x29, 0xb5, 0x84, 0xee, 0xbe, /* ...).... */ +0xa6, 0xcb, 0xb7, 0xce, 0x67, 0x9e, 0x8f, 0x3f, /* ....g..? */ +0x93, 0xba, 0x19, 0xb2, 0x9e, 0xe5, 0xe8, 0xe4, /* ........ */ +0xde, 0x9b, 0xae, 0x12, 0xde, 0x83, 0x7c, 0xfe, /* ......|. */ +0xf4, 0x04, 0xb2, 0x34, 0x37, 0xfc, 0xdb, 0xf0, /* ...47... */ +0x02, 0xfb, 0xfd, 0x83, 0x2f, 0x1a, 0x76, 0xc5, /* ..../.v. */ +0xa3, 0xd8, 0xd6, 0xc5, 0xb3, 0x30, 0x00, 0x77, /* .....0.w */ +0xe9, 0x1b, 0x2d, 0xa0, 0x9e, 0xe0, 0x1e, 0x76, /* ..-....v */ +0xf0, 0xfd, 0x20, 0x63, 0x86, 0xbc, 0xd3, 0x51, /* .. c...Q */ +0x27, 0x00, 0xbe, 0xca, 0xdf, 0x6d, 0xa6, 0xa9, /* '....m.. */ +0xc8, 0x15, 0xb8, 0x31, 0x70, 0x90, 0xa1, 0x45, /* ...1p..E */ +0xba, 0xa3, 0x66, 0xdf, 0x5b, 0x0b, 0x3b, 0xff, /* ..f.[.;. */ +0x2f, 0x4f, 0xae, 0x66, 0x08, 0x8f, 0xd9, 0x8a, /* /O.f.... */ +0x37, 0x55, 0xed, 0x03, 0x9b, 0xf9, 0x1f, 0x4e, /* 7U.....N */ +0x37, 0x40, 0xaa, 0x78, 0x6a, 0x33, 0x28, 0x5b, /* 7@.xj3([ */ +0xf1, 0x86, 0x42, 0x87, 0xcb, 0x20, 0xe9, 0xe4, /* ..B.. .. */ +0xf2, 0xb2, 0xb3, 0xcb, 0x1c, 0x68, 0xb3, 0xf2, /* .....h.. */ +0x37, 0xf2, 0x0b, 0xa4, 0xcc, 0x6c, 0xb7, 0xa6, /* 7....l.. */ +0x14, 0xf2, 0x8c, 0x8c, 0x9c, 0x28, 0x66, 0x45, /* .....(fE */ +0x0d, 0xed, 0x5b, 0xd5, 0xa7, 0x54, 0x73, 0x80, /* ..[..Ts. */ +0x18, 0x11, 0xb8, 0x61, 0xb0, 0x43, 0xf2, 0xcc, /* ...a.C.. */ +0x65, 0x46, 0xef, 0x9a, 0xb2, 0x5d, 0x66, 0x30, /* eF...]f0 */ +0x7a, 0xd0, 0xeb, 0x9c, 0xa7, 0x05, 0xfd, 0xfc, /* z....... */ +0x6e, 0xd4, 0x9e, 0x09, 0x35, 0x27, 0x21, 0x69, /* n...5'!i */ +0xa1, 0xa2, 0x79, 0xa2, 0xb1, 0x60, 0xfc, 0xe0, /* ..y..`.. */ +0x88, 0x3e, 0x6b, 0x5e, 0x27, 0x3b, 0xfc, 0xf2, /* .>k^';.. */ +0x32, 0x38, 0x10, 0xdc, 0xfe, 0x02, 0x44, 0xd1, /* 28....D. */ +0x1e, 0x09, 0x58, 0x9f, 0xfc, 0xd7, 0xba, 0xe8, /* ..X..... */ +0xb7, 0x4b, 0x3f, 0x15, 0x13, 0x0a, 0x73, 0x2d, /* .K?...s- */ +0xdb, 0x5a, 0x9b, 0x22, 0x31, 0x14, 0x9e, 0xf4, /* .Z."1... */ +0x79, 0xda, 0x87, 0x38, 0x13, 0x36, 0xba, 0x89, /* y..8.6.. */ +0xf6, 0x1f, 0xfb, 0xb4, 0x94, 0x13, 0x75, 0x6e, /* ......un */ +0xd7, 0x09, 0x47, 0x17, 0xaa, 0x02, 0x01, 0x09, /* ..G..... */ +0xa5, 0xb1, 0x16, 0x87, 0x27, 0x15, 0x39, 0x98, /* ....'.9. */ +0xcc, 0x20, 0x59, 0xe1, 0xea, 0xbb, 0xbc, 0x45, /* . Y....E */ +0xfa, 0x07, 0xe8, 0x43, 0x6c, 0x9d, 0x93, 0xb0, /* ...Cl... */ +0x17, 0xd2, 0xb3, 0xb6, 0x8f, 0xb0, 0x88, 0x8c, /* ........ */ +0x11, 0x39, 0x3e, 0x61, 0x27, 0x5c, 0x26, 0x8f, /* .9>a'\&. */ +0x14, 0x70, 0x8d, 0x2c, 0x78, 0xd0, 0x4d, 0x21, /* .p.,x.M! */ +0x7e, 0xb5, 0x28, 0x3c, 0x52, 0x8a, 0xb9, 0x8f, /* ~.(. */ +0x1b, 0x51, 0xac, 0xe1, 0xe7, 0xfa, 0x87, 0x8b, /* .Q...... */ +0xc3, 0x9f, 0x1b, 0xe7, 0x75, 0x1e, 0x3f, 0xbb, /* ....u.?. */ +0x3c, 0x57, 0x23, 0xdc, 0x55, 0x49, 0xd8, 0x0f, /* ...?T */ +0xa1, 0xc4, 0x28, 0xbb, 0x0b, 0x2e, 0xd9, 0x0b, /* ..(..... */ +0xd7, 0xb6, 0xee, 0x3c, 0xed, 0x53, 0xa0, 0x07, /* ...<.S.. */ +0x7a, 0x85, 0x46, 0x28, 0x25, 0xcd, 0x90, 0x53, /* z.F(%..S */ +0x30, 0x92, 0x70, 0x0b, 0x2a, 0x86, 0x4e, 0x82, /* 0.p.*.N. */ +0x4e, 0x68, 0xeb, 0x0b, 0x0d, 0xf4, 0x1f, 0x69, /* Nh.....i */ +0xc8, 0x44, 0xd0, 0xd9, 0xd9, 0x32, 0x02, 0xc9, /* .D...2.. */ +0x01, 0x85, 0x6a, 0x9e, 0x2a, 0x5a, 0x8d, 0xce, /* ..j.*Z.. */ +0x5f, 0xba, 0x2b, 0x8a, 0x7b, 0xaa, 0x6e, 0xf9, /* _.+.{.n. */ +0xf3, 0x53, 0x4c, 0xd5, 0x80, 0x3d, 0xcd, 0x18, /* .SL..=.. */ +0x91, 0x7f, 0x7d, 0x59, 0x8c, 0x3b, 0x10, 0xaa, /* ..}Y.;.. */ +0xda, 0x73, 0x56, 0x85, 0x3c, 0xf7, 0xfc, 0xc6, /* .sV.<... */ +0x6d, 0x2c, 0x3d, 0xd3, 0x92, 0x38, 0x1a, 0xac, /* m,=..8.. */ +0xd9, 0x92, 0xc1, 0x75, 0x89, 0x47, 0x5e, 0xc2, /* ...u.G^. */ +0x46, 0x60, 0x70, 0x73, 0xf0, 0xcc, 0x4b, 0xa9, /* F`ps..K. */ +0x72, 0x88, 0xd9, 0xa8, 0xff, 0x9c, 0xb7, 0x5b, /* r......[ */ +0xb0, 0x90, 0x7f, 0x5d, 0xa8, 0x35, 0x0c, 0x50, /* ...].5.P */ +0x1f, 0xad, 0xfa, 0x19, 0x64, 0x36, 0x6a, 0x83, /* ....d6j. */ +0x30, 0x05, 0x2a, 0x9a, 0xd5, 0x78, 0xf3, 0x93, /* 0.*..x.. */ +0xd2, 0x8c, 0x77, 0x6b, 0xdb, 0x2c, 0x60, 0x51, /* ..wk.,`Q */ +0xa0, 0x5f, 0xfd, 0x3d, 0x95, 0x8b, 0xb9, 0xfb, /* ._.=.... */ +0x72, 0x93, 0x5c, 0xf0, 0x0f, 0x74, 0xfe, 0x50, /* r.\..t.P */ +0x8a, 0x24, 0xdb, 0x81, 0x6a, 0x97, 0x33, 0x61, /* .$..j.3a */ +0x46, 0xe9, 0xaf, 0x68, 0x05, 0x22, 0x48, 0x9c, /* F..h."H. */ +0x6b, 0x62, 0x64, 0xa6, 0x0a, 0x42, 0x07, 0x9d, /* kbd..B.. */ +0x11, 0x4c, 0x68, 0x3a, 0x05, 0xc0, 0x26, 0xdb, /* .Lh:..&. */ +0xe2, 0xa8, 0x03, 0xd1, 0xd8, 0x44, 0x5c, 0xbe, /* .....D\. */ +0x24, 0x14, 0x3c, 0x68, 0x5b, 0xa2, 0xc3, 0xfc, /* $.6yj$ */ +0x62, 0x3c, 0x92, 0x5b, 0x19, 0x42, 0x24, 0xa2, /* b<.[.B$. */ +0x51, 0x1f, 0x21, 0x7a, 0x8c, 0x19, 0xb4, 0x00, /* Q.!z.... */ +0xa3, 0x36, 0x5f, 0x93, 0x51, 0x7a, 0x3c, 0x2d, /* .6_.Qz<- */ +0x3a, 0x84, 0x08, 0x41, 0x76, 0x3c, 0xe2, 0x4b, /* :..Av<.K */ +0x55, 0xbb, 0xcb, 0xbc, 0xb5, 0xf7, 0x8c, 0xd1, /* U....... */ +0x5c, 0xa8, 0x8d, 0x81, 0xbe, 0xf6, 0x34, 0x21, /* \.....4! */ +0xec, 0xec, 0x61, 0x97, 0xbe, 0x2c, 0x93, 0xd8, /* ..a..,.. */ +0xc9, 0x6a, 0x39, 0x8a, 0xc8, 0x0d, 0x58, 0xc9, /* .j9...X. */ +0xb0, 0x1c, 0x5c, 0x98, 0x86, 0x8f, 0x39, 0x98, /* ..\...9. */ +0xaa, 0xd1, 0xbb, 0x53, 0x21, 0xab, 0x4c, 0x33, /* ...S!.L3 */ +0xcb, 0xff, 0x95, 0x1a, 0x83, 0x45, 0x82, 0xcf, /* .....E.. */ +0x04, 0x4e, 0xac, 0x23, 0xad, 0x93, 0xe5, 0x1f, /* .N.#.... */ +0xcb, 0x63, 0x8f, 0xde, 0x94, 0x3e, 0x5f, 0xab, /* .c...>_. */ +0xe9, 0x2d, 0x2b, 0x23, 0x69, 0xbb, 0x38, 0xd2, /* .-+#i.8. */ +0x74, 0x7d, 0x2f, 0x2e, 0xc3, 0x43, 0x38, 0xb0, /* t}/..C8. */ +0xd2, 0xe5, 0xef, 0x5b, 0x3f, 0x67, 0x1d, 0xb3, /* ...[?g.. */ +0x1b, 0xfe, 0x71, 0xc6, 0x6e, 0x2b, 0x00, 0x64, /* ..q.n+.d */ +0x07, 0xcd, 0x61, 0x2c, 0x97, 0x52, 0x7f, 0x77, /* ..a,.R.w */ +0xf4, 0xef, 0x66, 0xe8, 0x9e, 0x8c, 0x3c, 0x60, /* ..f...<` */ +0x81, 0x9c, 0xe5, 0x41, 0x30, 0x72, 0xcf, 0x9c, /* ...A0r.. */ +0x75, 0xf4, 0xff, 0x5e, 0x85, 0x9a, 0x26, 0xe4, /* u..^..&. */ +0x61, 0xfe, 0x8b, 0x66, 0x4c, 0x53, 0xf4, 0xd6, /* a..fLS.. */ +0xb6, 0x84, 0xc0, 0x4a, 0xd8, 0xb6, 0xa7, 0xa9, /* ...J.... */ +0x9f, 0xf0, 0x2e, 0x40, 0xf0, 0x75, 0x5b, 0x3d, /* ...@.u[= */ +0x80, 0xac, 0x8b, 0xf7, 0xdf, 0x51, 0xef, 0xfa, /* .....Q.. */ +0xf4, 0xf4, 0x36, 0x79, 0x94, 0x9f, 0x65, 0xd2, /* ..6y..e. */ +0xdc, 0xb5, 0x19, 0xc3, 0x5d, 0x32, 0xda, 0x27, /* ....]2.' */ +0x68, 0xfd, 0x87, 0xcd, 0x80, 0x8b, 0x40, 0x6e, /* h.....@n */ +0x5c, 0x94, 0xbf, 0x02, 0x89, 0x05, 0x48, 0x01, /* \.....H. */ +0x99, 0x99, 0xe3, 0x87, 0x9c, 0x59, 0xdb, 0xac, /* .....Y.. */ +0x3a, 0x2c, 0x58, 0x15, 0x4d, 0xff, 0x31, 0xf5, /* :,X.M.1. */ +0x74, 0x36, 0x93, 0x96, 0xf4, 0x26, 0x25, 0xfa, /* t6...&%. */ +0x5c, 0x2f, 0x09, 0x47, 0xc7, 0xf9, 0xe7, 0x72, /* \/.G...r */ +0x69, 0xda, 0xe2, 0x00, 0xcc, 0x6c, 0xc9, 0xdd, /* i....l.. */ +0x5a, 0x73, 0x61, 0x1d, 0xf0, 0x01, 0x94, 0x66, /* Zsa....f */ +0x46, 0xed, 0xf5, 0x41, 0x28, 0xa8, 0xa8, 0x54, /* F..A(..T */ +0xab, 0x49, 0x1a, 0x98, 0xb2, 0x02, 0xd6, 0xb1, /* .I...... */ +0x82, 0x02, 0x85, 0xbf, 0x9c, 0x46, 0x85, 0x7f, /* .....F.. */ +0x4e, 0x1e, 0x4b, 0x64, 0xa3, 0x75, 0xf5, 0xc1, /* N.Kd.u.. */ +0xc4, 0x15, 0xc5, 0x1a, 0x01, 0xf6, 0xc8, 0xf0, /* ........ */ +0x66, 0x21, 0x50, 0x62, 0xf3, 0x23, 0xa4, 0xb7, /* f!Pb.#.. */ +0xa4, 0x49, 0x8c, 0x70, 0x91, 0x46, 0x95, 0x70, /* .I.p.F.p */ +0xdf, 0x4c, 0x3e, 0x9c, 0xf5, 0xaf, 0x61, 0x07, /* .L>...a. */ +0x3d, 0x46, 0xfc, 0xdf, 0xe7, 0x13, 0x11, 0x24, /* =F.....$ */ +0xcb, 0x0f, 0xcd, 0x17, 0x83, 0x2d, 0xef, 0xd2, /* .....-.. */ +0x06, 0x4b, 0x8f, 0x47, 0x78, 0xa4, 0xf6, 0x29, /* .K.Gx..) */ +0x73, 0xf3, 0x89, 0xad, 0xcc, 0xe6, 0x4b, 0x2f, /* s.....K/ */ +0x79, 0xab, 0x9c, 0x20, 0x1d, 0xd1, 0x79, 0x30, /* y.. ..y0 */ +0x2f, 0x1c, 0x8f, 0x6b, 0xcf, 0x0d, 0x76, 0xe6, /* /..k..v. */ +0x97, 0xc6, 0x09, 0xcb, 0xf4, 0xa4, 0x58, 0x6f, /* ......Xo */ +0x7d, 0xef, 0x82, 0x67, 0xd7, 0x73, 0xd0, 0x76, /* }..g.s.v */ +0xa8, 0x4b, 0x16, 0xda, 0x3c, 0x9e, 0x84, 0x29, /* .K..<..) */ +0x28, 0x77, 0xc0, 0x90, 0x50, 0x23, 0x63, 0x2e, /* (w..P#c. */ +0xaa, 0xaf, 0xf5, 0xaf, 0x68, 0xa0, 0x04, 0x73, /* ....h..s */ +0x44, 0x94, 0xf3, 0xf6, 0xac, 0x05, 0x8b, 0x68, /* D......h */ +0xfc, 0x4a, 0xe0, 0xa6, 0xca, 0xbf, 0x03, 0x2e, /* .J...... */ +0x49, 0xfd, 0xa7, 0xc7, 0xd4, 0xea, 0x0a, 0xcf, /* I....... */ +0xb6, 0xf8, 0x7d, 0xf1, 0xa4, 0x54, 0xe9, 0x8a, /* ..}..T.. */ +0xd5, 0x57, 0x8f, 0x5d, 0xf0, 0x0e, 0xf2, 0x2d, /* .W.]...- */ +0x5e, 0x1e, 0x01, 0x27, 0xf3, 0xd2, 0x79, 0x3c, /* ^..'..y< */ +0x3a, 0x7a, 0x61, 0x13, 0xc1, 0x16, 0xac, 0x89, /* :za..... */ +0xc1, 0x08, 0x04, 0xe9, 0xbe, 0x74, 0xf9, 0x00, /* .....t.. */ +0x16, 0xb6, 0x38, 0x49, 0x26, 0x1a, 0x17, 0xe6, /* ..8I&... */ +0xe5, 0x11, 0xb2, 0x59, 0x63, 0x1d, 0xbc, 0x38, /* ...Yc..8 */ +0xab, 0xbe, 0x81, 0x90, 0xc8, 0xf7, 0x9e, 0xf9, /* ........ */ +0xd8, 0xa9, 0x5e, 0x59, 0xcd, 0x03, 0xcb, 0x20, /* ..^Y... */ +0xcd, 0x33, 0xcc, 0xaa, 0x8f, 0x14, 0xe8, 0xaa, /* .3...... */ +0xa0, 0xb3, 0x21, 0xc9, 0x94, 0xeb, 0x69, 0x31, /* ..!...i1 */ +0x7c, 0x3d, 0x33, 0xff, 0xaa, 0x18, 0xe9, 0xe3, /* |=3..... */ +0x8b, 0x18, 0x32, 0x0b, 0xde, 0x61, 0xcf, 0xc8, /* ..2..a.. */ +0x77, 0x86, 0x92, 0x22, 0x27, 0x1b, 0xb5, 0x05, /* w.."'... */ +0x3e, 0x19, 0xd4, 0xe4, 0xb5, 0x33, 0xbc, 0x41, /* >....3.A */ +0x5d, 0x4e, 0x65, 0x71, 0xb9, 0x1b, 0x32, 0x2e, /* ]Neq..2. */ +0xd0, 0xe7, 0x24, 0xe2, 0x51, 0x5c, 0x45, 0xfa, /* ..$.Q\E. */ +0x41, 0xd9, 0xd4, 0x57, 0xe1, 0x82, 0xc0, 0x9c, /* A..W.... */ +0x78, 0xd5, 0x0d, 0x60, 0x62, 0x63, 0xe5, 0x01, /* x..`bc.. */ +0xa0, 0xff, 0x1b, 0x99, 0x77, 0x5c, 0xf8, 0x17, /* ....w\.. */ +0x5a, 0xf6, 0xee, 0x5c, 0x18, 0x15, 0xbc, 0xe9, /* Z..\.... */ +0x6c, 0x29, 0x4d, 0x1b, 0xb9, 0xd3, 0xb1, 0x74, /* l)M....t */ +0x3b, 0xb0, 0x17, 0xa0, 0x45, 0xac, 0xd2, 0x98, /* ;...E... */ +0xfe, 0xa8, 0xf9, 0x31, 0x0e, 0x09, 0x02, 0xff, /* ...1.... */ +0xf4, 0xd0, 0xb1, 0x8a, 0x3c, 0x67, 0x6f, 0x3d, /* .....Qv; */ +0x73, 0x46, 0xce, 0x4e, 0x83, 0x5d, 0xe0, 0x02, /* sF.N.].. */ +0x9c, 0xec, 0xf2, 0x8c, 0xd2, 0x5d, 0x3f, 0x59, /* .....]?Y */ +0x4a, 0xbd, 0x14, 0x59, 0x79, 0x23, 0x53, 0xae, /* J..Yy#S. */ +0x37, 0x68, 0x18, 0xfe, 0x3a, 0x1a, 0xa3, 0x62, /* 7h..:..b */ +0xdc, 0xcf, 0x3a, 0x89, 0x1c, 0x4b, 0xed, 0xe8, /* ..:..K.. */ +0x00, 0x34, 0x46, 0xbd, 0xbe, 0x1a, 0x2d, 0xb5, /* .4F...-. */ +0x30, 0x90, 0x44, 0x5d, 0x87, 0x37, 0x8e, 0x02, /* 0.D].7.. */ +0xd2, 0xa1, 0xaf, 0xb5, 0xff, 0x90, 0x8e, 0x56, /* .......V */ +0x0d, 0xe6, 0xc8, 0x31, 0xb1, 0x3b, 0x03, 0xdf, /* ...1.;.. */ +0xfb, 0x9c, 0x6a, 0x7d, 0x80, 0x2b, 0x9c, 0x35, /* ..j}.+.5 */ +0x96, 0xf9, 0xb6, 0x1d, 0xd7, 0x37, 0xaf, 0x3c, /* .....7.< */ +0x14, 0x07, 0xdf, 0xad, 0x8c, 0x91, 0x80, 0x4c, /* .......L */ +0x7f, 0x76, 0x58, 0x32, 0x56, 0x4d, 0xb4, 0xe6, /* .vX2VM.. */ +0x17, 0xd2, 0x01, 0xac, 0xe8, 0x34, 0x20, 0x31, /* .....4 1 */ +0xd9, 0x6e, 0xa4, 0x7e, 0x6f, 0x19, 0xe3, 0xec, /* .n.~o... */ +0x83, 0xf1, 0xdb, 0x7e, 0x27, 0x93, 0x96, 0x25, /* ...~'..% */ +0xf4, 0x37, 0x97, 0xbe, 0x60, 0xf2, 0x52, 0x20, /* .7..`.R */ +0x82, 0x3f, 0x6f, 0x3a, 0x82, 0x48, 0xee, 0xb1, /* .?o:.H.. */ +0x2d, 0x6a, 0x9e, 0xfb, 0x83, 0x6e, 0x15, 0x8f, /* -j...n.. */ +0x1a, 0x6c, 0x66, 0x56, 0x6e, 0x4d, 0x06, 0xa0, /* .lfVnM.. */ +0xcd, 0xc8, 0x51, 0x94, 0x65, 0xb1, 0x19, 0x5b, /* ..Q.e..[ */ +0x34, 0x8d, 0xc8, 0x1b, 0x76, 0x0e, 0x90, 0x16, /* 4...v... */ +0x6d, 0x2e, 0x4c, 0xa3, 0xf3, 0xb2, 0xb3, 0x48, /* m.L....H */ +0xd8, 0x96, 0xff, 0x79, 0xd4, 0xec, 0x15, 0x7b, /* ...y...{ */ +0x1d, 0x9b, 0xc1, 0xd5, 0x00, 0xf3, 0x6d, 0xae, /* ......m. */ +0x65, 0x1c, 0xbe, 0xab, 0xcb, 0x29, 0x28, 0x84, /* e....)(. */ +0xa3, 0x25, 0x8c, 0xd7, 0x37, 0xfe, 0x5b, 0x6e, /* .%..7.[n */ +0x98, 0x7a, 0xd7, 0x6a, 0x41, 0x12, 0x0f, 0x44, /* .z.jA..D */ +0xe3, 0xc7, 0x4a, 0x74, 0x5e, 0x83, 0xc5, 0x6c, /* ..Jt^..l */ +0x6b, 0x48, 0x58, 0x2e, 0xcf, 0x41, 0xff, 0x32, /* kHX..A.2 */ +0x33, 0x13, 0x1e, 0x28, 0xa7, 0xf7, 0x64, 0x96, /* 3..(..d. */ +0x51, 0xb1, 0xf6, 0xad, 0xeb, 0xb4, 0x7a, 0xc9, /* Q.....z. */ +0x0e, 0x00, 0xae, 0x00, 0x94, 0xfc, 0x37, 0x31, /* ......71 */ +0x6b, 0x0e, 0x7d, 0x40, 0x30, 0x10, 0xf6, 0xcc, /* k.}@0... */ +0x27, 0xa5, 0x37, 0xda, 0x4e, 0x35, 0xb7, 0xcb, /* '.7.N5.. */ +0xf1, 0xb9, 0x5f, 0xb7, 0x2f, 0x2d, 0xbd, 0x5f, /* .._./-._ */ +0x3d, 0x3c, 0x4d, 0x78, 0x63, 0x37, 0x77, 0x84, /* =>E. */ +0x8c, 0x39, 0x07, 0xa7, 0xc7, 0x88, 0x76, 0x36, /* .9....v6 */ +0x19, 0x61, 0x50, 0x1c, 0xf9, 0x91, 0x28, 0x9c, /* .aP...(. */ +0xb8, 0x22, 0x05, 0x31, 0x4b, 0xc8, 0x44, 0xbf, /* .".1K.D. */ +0x9c, 0x91, 0x8c, 0xea, 0x4c, 0x6d, 0x8b, 0x73, /* ....Lm.s */ +0xd7, 0xd9, 0x51, 0x03, 0x86, 0x77, 0xbb, 0x5f, /* ..Q..w._ */ +0xd1, 0xaa, 0x4d, 0x37, 0xaf, 0xff, 0x1b, 0x4f, /* ..M7...O */ +0x4d, 0xbe, 0x81, 0x15, 0x5e, 0x9f, 0x27, 0x87, /* M...^.'. */ +0x86, 0x46, 0xad, 0x10, 0x4e, 0x38, 0x32, 0x8c, /* .F..N82. */ +0x49, 0x5c, 0xa4, 0x33, 0x7c, 0xd4, 0xdd, 0xdd, /* I\.3|... */ +0x71, 0x03, 0x0d, 0xca, 0x96, 0x85, 0x1e, 0xa8, /* q....... */ +0x9a, 0xac, 0x8d, 0x60, 0x16, 0xd1, 0x65, 0xea, /* ...`..e. */ +0xeb, 0x3b, 0xa7, 0xc1, 0x02, 0x78, 0xe8, 0xd9, /* .;...x.. */ +0xb6, 0xd7, 0xc8, 0x87, 0xf9, 0xe2, 0x37, 0x30, /* ......70 */ +0x8d, 0x59, 0xcf, 0xba, 0x66, 0x5b, 0x00, 0xe9, /* .Y..f[.. */ +0xc3, 0x8b, 0xe6, 0xb6, 0xa0, 0xdc, 0x7b, 0x54, /* ......{T */ +0xa4, 0x9e, 0x91, 0x35, 0xc5, 0x68, 0x2a, 0x6e, /* ...5.h*n */ +0xc2, 0xef, 0xdb, 0x33, 0xdb, 0x4e, 0x44, 0x4f, /* ...3.NDO */ +0xec, 0x32, 0x0b, 0x86, 0x57, 0x33, 0xc6, 0xc1, /* .2..W3.. */ +0xa7, 0x3b, 0xd1, 0x11, 0x75, 0x51, 0x95, 0x0e, /* .;..uQ.. */ +0x38, 0x11, 0xfb, 0xd6, 0xa6, 0xd4, 0xbc, 0xe9, /* 8....... */ +0x1a, 0xdd, 0xa4, 0x7e, 0xe7, 0xe7, 0xbd, 0x7f, /* ...~.... */ +0x7e, 0x97, 0xf1, 0xcc, 0x5c, 0x08, 0xb1, 0x51, /* ~...\..Q */ +0x93, 0x6e, 0x63, 0x9f, 0xe9, 0x73, 0xd5, 0x34, /* .nc..s.4 */ +0x8a, 0x22, 0x0c, 0x11, 0x91, 0x6b, 0x27, 0x28, /* ."...k'( */ +0x4d, 0x88, 0xe5, 0x0b, 0x89, 0x29, 0x49, 0xaf, /* M....)I. */ +0x95, 0x1e, 0x9c, 0xb6, 0xe8, 0xb1, 0x2c, 0xba, /* ......,. */ +0xb8, 0x19, 0xef, 0x02, 0xc4, 0x6e, 0x69, 0x61, /* .....nia */ +0xce, 0x5c, 0x6c, 0x37, 0x7e, 0x56, 0xde, 0xc3, /* .\l7~V.. */ +0x7b, 0x71, 0xd8, 0x66, 0x97, 0x7e, 0xfa, 0x0d, /* {q.f.~.. */ +0x2a, 0x7c, 0x80, 0xce, 0xf7, 0x4f, 0x42, 0xd1, /* *|...OB. */ +0x13, 0x73, 0x3a, 0x7f, 0x23, 0x5a, 0x68, 0x8e, /* .s:.#Zh. */ +0xd7, 0x23, 0xbb, 0x52, 0xe7, 0x7c, 0xcf, 0x40, /* .#.R.|.@ */ +0x3d, 0xb6, 0x70, 0x3c, 0x7c, 0x07, 0x56, 0xb4, /* =.p<|.V. */ +0xae, 0xcd, 0x44, 0x30, 0x24, 0xc4, 0x45, 0x83, /* ..D0$.E. */ +0x53, 0x3c, 0x5f, 0x42, 0x93, 0x95, 0xc2, 0x06, /* S<_B.... */ +0xe3, 0x6d, 0x80, 0x53, 0xb0, 0x4f, 0xe7, 0x4c, /* .m.S.O.L */ +0x97, 0xb1, 0x27, 0x6e, 0x72, 0x7f, 0x86, 0xc5, /* ..'nr... */ +0xdb, 0xf1, 0xe8, 0xb8, 0x35, 0x67, 0x62, 0xbe, /* ....5gb. */ +0x23, 0x43, 0xd2, 0xb3, 0x15, 0xd5, 0x67, 0xfd, /* #C....g. */ +0x79, 0xf9, 0xe3, 0xed, 0x51, 0x20, 0xbb, 0xbb, /* y...Q .. */ +0x95, 0x84, 0xf7, 0x75, 0x95, 0x9b, 0xd7, 0xb3, /* ...u.... */ +0x44, 0xe6, 0x52, 0x80, 0x77, 0x50, 0xbc, 0xf9, /* D.R.wP.. */ +0xc9, 0xc4, 0xcf, 0x79, 0xd4, 0xba, 0x9b, 0xc6, /* ...y.... */ +0xeb, 0xed, 0x21, 0x16, 0xa0, 0x17, 0x9f, 0x9e, /* ..!..... */ +0x79, 0xdf, 0x4a, 0xa5, 0x7b, 0x9e, 0x7f, 0xb8, /* y.J.{... */ +0xf4, 0x06, 0xec, 0x46, 0xe4, 0x6e, 0xd0, 0x7b, /* ...F.n.{ */ +0x20, 0x22, 0xeb, 0xe0, 0xfc, 0x21, 0x8b, 0x67, /* "...!.g */ +0x2b, 0xbb, 0x12, 0x74, 0x56, 0xe3, 0x0b, 0xe1, /* +..tV... */ +0xff, 0x21, 0x82, 0x91, 0xbf, 0x9d, 0x94, 0xbf, /* .!...... */ +0x2e, 0x44, 0x6d, 0x9b, 0xb9, 0xa3, 0x98, 0x7a, /* .Dm....z */ +0xaf, 0x08, 0x8e, 0x3d, 0x18, 0x7b, 0xa4, 0x45, /* ...=.{.E */ +0xd3, 0xd5, 0xba, 0xbc, 0xac, 0x61, 0x08, 0x41, /* .....a.A */ +0x28, 0x9a, 0xfb, 0x76, 0x33, 0x4a, 0xb7, 0x3e, /* (..v3J.> */ +0xf9, 0x8b, 0xbe, 0x2a, 0xb3, 0x04, 0x44, 0x50, /* ...*..DP */ +0x97, 0x12, 0x4c, 0x8a, 0x98, 0xb5, 0xcc, 0xac, /* ..L..... */ +0x8d, 0xd8, 0x97, 0xf5, 0xcf, 0x59, 0x80, 0x4f, /* .....Y.O */ +0xb5, 0xfe, 0xcd, 0x4e, 0x0a, 0x64, 0x40, 0xc4, /* ...N.d@. */ +0x43, 0xbf, 0xfe, 0x87, 0x5a, 0x05, 0x96, 0xca, /* C...Z... */ +0x58, 0xa3, 0x3d, 0xd9, 0xd7, 0xbd, 0x97, 0x56, /* X.=....V */ +0x5c, 0x46, 0xb4, 0xcc, 0x30, 0x2a, 0xcd, 0x5b, /* \F..0*.[ */ +0xfc, 0x9e, 0xbf, 0x79, 0xfb, 0xbb, 0xf3, 0xe9, /* ...y.... */ +0x0f, 0xd1, 0x64, 0x82, 0x91, 0x90, 0x75, 0xfa, /* ..d...u. */ +0x85, 0xec, 0x61, 0xf7, 0x6b, 0x3d, 0xa0, 0x04, /* ..a.k=.. */ +0xb1, 0xc5, 0xe0, 0xad, 0xa8, 0x45, 0x6f, 0x20, /* .....Eo */ +0x36, 0x25, 0x5a, 0x0d, 0xf3, 0xc6, 0x58, 0xe4, /* 6%Z...X. */ +0x2d, 0xde, 0xdf, 0x58, 0xba, 0xda, 0x46, 0xe1, /* -..X..F. */ +0xce, 0xdd, 0x8a, 0x0e, 0x91, 0x27, 0xe7, 0xff, /* .....'.. */ +0xd8, 0xef, 0x0c, 0xbb, 0x1a, 0x11, 0x62, 0x97, /* ......b. */ +0x8a, 0xaf, 0xa3, 0x7b, 0x89, 0xb5, 0x97, 0x51, /* ...{...Q */ +0xea, 0x02, 0xba, 0xcf, 0xaf, 0x97, 0x4a, 0x17, /* ......J. */ +0x55, 0xcb, 0x2d, 0x0f, 0x75, 0x44, 0x9d, 0xe0, /* U.-.uD.. */ +0xb0, 0xd7, 0x7c, 0x92, 0x6f, 0x2a, 0x14, 0x41, /* ..|.o*.A */ +0xdb, 0x54, 0xab, 0x45, 0xf4, 0xb4, 0x13, 0xb5, /* .T.E.... */ +0x58, 0xd1, 0x58, 0x6e, 0xfa, 0x28, 0xb2, 0x02, /* X.Xn.(.. */ +0x27, 0x7e, 0xb6, 0xae, 0xc3, 0x9f, 0xd2, 0x94, /* '~...... */ +0x02, 0x12, 0xb9, 0x6f, 0xc3, 0x4f, 0xef, 0x03, /* ...o.O.. */ +0x0f, 0x1e, 0xab, 0xff, 0xb1, 0xac, 0x74, 0x96, /* ......t. */ +0xb7, 0xa7, 0x1d, 0x8e, 0xc5, 0xaa, 0x06, 0x03, /* ........ */ +0x02, 0x9d, 0x02, 0x03, 0x00, 0xeb, 0x40, 0xb3, /* ......@. */ +0xc1, 0x6c, 0xc5, 0x38, 0xd2, 0xa7, 0x40, 0x3f, /* .l.8..@? */ +0x43, 0xd8, 0x1a, 0x75, 0x1d, 0x98, 0xcf, 0x85, /* C..u.... */ +0xa4, 0x28, 0xc4, 0xed, 0xc3, 0x81, 0x9d, 0x91, /* .(...... */ +0xe3, 0xc7, 0xa3, 0x55, 0xd6, 0xa4, 0x0d, 0x8d, /* ...U.... */ +0x8a, 0xf0, 0x21, 0x16, 0x2c, 0x09, 0x26, 0x0e, /* ..!.,.&. */ +0xe6, 0x3c, 0x3f, 0x6d, 0x0a, 0x6f, 0xff, 0x4a, /* ...E. */ +0xb3, 0xb4, 0xcb, 0xa4, 0xba, 0x64, 0x0c, 0x7f, /* .....d.. */ +0xe7, 0x2c, 0x53, 0x12, 0x51, 0x92, 0x91, 0xcd, /* .,S.Q... */ +0x18, 0xa5, 0xc4, 0x01, 0x4e, 0x41, 0x95, 0xda, /* ....NA.. */ +0x6a, 0xc8, 0xc8, 0xf6, 0xab, 0x60, 0x81, 0x4f, /* j....`.O */ +0xb8, 0x0f, 0xfd, 0x95, 0x92, 0xca, 0xcc, 0x11, /* ........ */ +0x01, 0x36, 0x4d, 0xef, 0x9a, 0x19, 0x4d, 0x5a, /* .6M...MZ */ +0x61, 0x1c, 0xdf, 0x11, 0x9f, 0x48, 0x48, 0x7a, /* a....HHz */ +0x90, 0x0d, 0xa8, 0x27, 0xdb, 0xb2, 0x7e, 0x5d, /* ...'..~] */ +0x18, 0x59, 0x36, 0x6e, 0xb9, 0xde, 0x73, 0xf4, /* .Y6n..s. */ +0x70, 0x24, 0x42, 0xba, 0xc1, 0x0b, 0x14, 0x9b, /* p$B..... */ +0x95, 0x95, 0xe1, 0x67, 0xda, 0x50, 0x36, 0x60, /* ...g.P6` */ +0xa9, 0xc2, 0x55, 0xa6, 0xc8, 0x69, 0xed, 0xb3, /* ..U..i.. */ +0x19, 0xa1, 0xb9, 0xc3, 0x42, 0x74, 0x6a, 0xb3, /* ....Btj. */ +0xd6, 0x83, 0xe4, 0xf7, 0x61, 0x9f, 0x3d, 0xe9, /* ....a.=. */ +0x5f, 0xcd, 0x77, 0xc9, 0x69, 0xe4, 0xe7, 0x5d, /* _.w.i..] */ +0xae, 0x62, 0x4e, 0xa9, 0x02, 0xaa, 0xed, 0xc4, /* .bN..... */ +0xb4, 0x69, 0x0e, 0x61, 0x77, 0x1a, 0x63, 0xe2, /* .i.aw.c. */ +0xd6, 0x1b, 0x61, 0xa0, 0xaf, 0xfd, 0xce, 0x7d, /* ..a....} */ +0xe6, 0xc4, 0xf8, 0xfb, 0x7e, 0x9c, 0x8d, 0x46, /* ....~..F */ +0xf0, 0xbc, 0xd3, 0x51, 0x0e, 0xd9, 0x69, 0x8a, /* ...Q..i. */ +0xee, 0xd2, 0x89, 0xa0, 0x14, 0x62, 0x15, 0xc4, /* .....b.. */ +0xed, 0xc6, 0x95, 0x64, 0xfd, 0xf8, 0xb5, 0x90, /* ...d.... */ +0xa0, 0x96, 0x0c, 0x5c, 0x27, 0xf3, 0x60, 0x9d, /* ...\'.`. */ +0x70, 0xf7, 0x45, 0x22, 0x36, 0x53, 0x87, 0x5a, /* p.E"6S.Z */ +0x2e, 0xda, 0xe6, 0xd0, 0xa0, 0x85, 0x28, 0x89, /* ......(. */ +0xc9, 0x77, 0x08, 0xaa, 0x04, 0xf4, 0xf9, 0x51, /* .w.....Q */ +0x29, 0xc1, 0x55, 0x3e, 0xac, 0x14, 0xa8, 0x32, /* ).U>...2 */ +0x4c, 0x52, 0xff, 0xd5, 0x4e, 0x63, 0x7e, 0x08, /* LR..Nc~. */ +0x04, 0xda, 0x1a, 0x37, 0xa0, 0x36, 0xb9, 0x62, /* ...7.6.b */ +0x04, 0xbb, 0x78, 0x6a, 0xc8, 0xbd, 0xc6, 0xa1, /* ..xj.... */ +0x6b, 0x01, 0x5e, 0x4d, 0xd2, 0xf9, 0x94, 0xf8, /* k.^M.... */ +0x04, 0xe5, 0x07, 0x8f, 0xc8, 0x15, 0xe6, 0x93, /* ........ */ +0xd4, 0x6f, 0xb6, 0x60, 0x04, 0x0d, 0x55, 0xea, /* .o.`..U. */ +0x52, 0xa4, 0x05, 0xbb, 0xf8, 0x3b, 0xc9, 0xaf, /* R....;.. */ +0x67, 0x49, 0xc0, 0x16, 0x7e, 0x0f, 0x9b, 0x4d, /* gI..~..M */ +0x34, 0xb6, 0xef, 0x26, 0xaa, 0xa7, 0xfe, 0x67, /* 4..&...g */ +0x77, 0xe1, 0x1b, 0x45, 0x21, 0xd7, 0xda, 0xf4, /* w..E!... */ +0x7a, 0xae, 0xb2, 0xd3, 0xad, 0x5c, 0xc4, 0x9d, /* z....\.. */ +0x5c, 0xaf, 0x20, 0x8f, 0xcf, 0xa8, 0x2a, 0x2e, /* \. ...*. */ +0xa3, 0xc0, 0x0b, 0xbd, 0xf5, 0x3d, 0x0f, 0xd0, /* .....=.. */ +0x0d, 0x23 /* .# */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt15[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xcf, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x39, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +9...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xd4, 0xf5, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x18, /* .....FP. */ +0xff, 0xff, 0xae, 0x36, 0x00, 0x00, 0x9f, 0x98, /* ...6.... */ +0x12, 0xcc, 0x36, 0xc2, 0x98, 0xa8, 0x63, 0xff, /* ..6...c. */ +0xb0, 0x3d, 0x53, 0x91, 0xb3, 0xfa, 0x2a, 0xca, /* .=S...*. */ +0x80, 0x76, 0xff, 0x03, 0x13, 0x3c, 0xe9, 0x13, /* .v...<.. */ +0x9b, 0x7a, 0x3c, 0xc4, 0x80, 0x55, 0x67, 0x91, /* .z<..Ug. */ +0xe2, 0x5f, 0x96, 0x6c, 0x2c, 0xe4, 0x94, 0xf5, /* ._.l,... */ +0x26, 0xaf, 0x10, 0x9d, 0x41, 0x87, 0xc5, 0xd2, /* &...A... */ +0x00, 0xbf, 0x63, 0x0b, 0x89, 0x4c, 0x63, 0x2c, /* ..c..Lc, */ +0x14, 0xef, 0x05, 0x02, 0x0f, 0x99, 0x4e, 0xa8, /* ......N. */ +0x57, 0x83, 0x07, 0x04, 0x3c, 0xd8, 0x2b, 0xcb, /* W...<.+. */ +0x98, 0x34, 0x8f, 0xdd, 0x5a, 0xf7, 0xf3, 0x51, /* .4..Z..Q */ +0x25, 0xd8, 0x3c, 0xef, 0x2b, 0xdc, 0xd0, 0xa2, /* %.<.+... */ +0xec, 0xb1, 0xe7, 0xb7, 0xbd, 0x6d, 0x31, 0x90, /* .....m1. */ +0x25, 0x65, 0x7e, 0x6c, 0xbe, 0xf0, 0xe8, 0x78, /* %e~l...x */ +0x41, 0x04, 0x6c, 0x5e, 0xc8, 0x7f, 0x9b, 0x2f, /* A.l^.../ */ +0x20, 0x9e, 0xd3, 0xdf, 0x9b, 0x94, 0x47, 0x6f, /* .....Go */ +0x6e, 0x0a, 0xfe, 0xe3, 0xc8, 0x44, 0x2f, 0x72, /* n....D/r */ +0x9d, 0xec, 0x0c, 0xa7, 0xeb, 0x6e, 0xab, 0x6b, /* .....n.k */ +0xe7, 0x0b, 0x51, 0x54, 0xac, 0xb4, 0x14, 0x18, /* ..QT.... */ +0x21, 0xce, 0x4b, 0x2a, 0x88, 0x6a, 0x8f, 0x4a, /* !.K*.j.J */ +0x8c, 0xbd, 0xea, 0xaa, 0x14, 0x23, 0x23, 0x8d, /* .....##. */ +0x6b, 0xae, 0xb7, 0xb1, 0x67, 0xbc, 0xce, 0xf7, /* k...g... */ +0x0a, 0xc0, 0x7a, 0x42, 0xdd, 0x5a, 0xc5, 0x3a, /* ..zB.Z.: */ +0x58, 0x2a, 0xd4, 0x00, 0x83, 0x76, 0x66, 0x90, /* X*...vf. */ +0x9b, 0xa9, 0x39, 0xe4, 0xa2, 0xe6, 0xc9, 0xa6, /* ..9..... */ +0x5a, 0x86, 0xb3, 0x0b, 0x29, 0xa2, 0x21, 0xc0, /* Z...).!. */ +0x56, 0x99, 0x53, 0xae, 0xb9, 0x4a, 0x44, 0x4a, /* V.S..JDJ */ +0xb0, 0x10, 0x6a, 0x82, 0x70, 0xe8, 0x53, 0xa0, /* ..j.p.S. */ +0xae, 0xb0, 0xf3, 0x83, 0x63, 0x89, 0x9e, 0x9a, /* ....c... */ +0x40, 0x6f, 0xad, 0x94, 0xd6, 0x7d, 0x63, 0x77, /* @o...}cw */ +0x77, 0x5d, 0x5d, 0xb9, 0x7b, 0x53, 0x69, 0x01, /* w]].{Si. */ +0x41, 0xf6, 0x9a, 0x53, 0x5a, 0x6b, 0xf2, 0x06, /* A..SZk.. */ +0xb3, 0x4e, 0x4f, 0xa4, 0x66, 0x4c, 0x6f, 0x39, /* .NO.fLo9 */ +0xff, 0x0e, 0x23, 0xa3, 0x1e, 0x58, 0x03, 0xdd, /* ..#..X.. */ +0x2a, 0x1c, 0xad, 0x1f, 0x21, 0xc0, 0x5e, 0x48, /* *...!.^H */ +0x7c, 0x45, 0x02, 0xd5, 0x03, 0x5f, 0xe2, 0x1c, /* |E..._.. */ +0x4f, 0xfa, 0x64, 0x2f, 0xb0, 0x42, 0xff, 0x41, /* O.d/.B.A */ +0xef, 0x1d, 0x92, 0x2b, 0xe6, 0x38, 0xdc, 0x8d, /* ...+.8.. */ +0xf2, 0xbb, 0x25, 0x91, 0xbf, 0x06, 0x80, 0xa7, /* ..%..... */ +0xb8, 0xa0, 0xa7, 0x53, 0x8e, 0x82, 0x1e, 0x6c, /* ...S...l */ +0xa0, 0xcf, 0x9e, 0x4d, 0xb9, 0x7c, 0x45, 0x9e, /* ...M.|E. */ +0x68, 0xeb, 0x5f, 0x6a, 0xb3, 0xe5, 0xcd, 0xc5, /* h._j.... */ +0xdf, 0xdd, 0x78, 0x9c, 0x83, 0xe6, 0x76, 0x28, /* ..x...v( */ +0x2b, 0xa0, 0x7f, 0x78, 0x12, 0x30, 0x95, 0xe6, /* +..x.0.. */ +0xc6, 0xa5, 0x09, 0x64, 0x31, 0x95, 0xdd, 0xc2, /* ...d1... */ +0x50, 0x2b, 0x91, 0x52, 0x77, 0x2f, 0x5a, 0x7d, /* P+.Rw/Z} */ +0x26, 0x55, 0x67, 0x7b, 0xcd, 0xf4, 0x3d, 0xcc, /* &Ug{..=. */ +0x85, 0x1e, 0x3b, 0x93, 0x3f, 0x61, 0x16, 0xc3, /* ..;.?a.. */ +0x4b, 0x5e, 0xd2, 0xb1, 0xa0, 0x05, 0x0d, 0x01, /* K^...... */ +0xc8, 0xf2, 0x51, 0x64, 0xbd, 0x8f, 0xa9, 0x82, /* ..Qd.... */ +0xad, 0x38, 0xc3, 0x4a, 0x0d, 0xef, 0x3e, 0x5b, /* .8.J..>[ */ +0x01, 0xb0, 0x0b, 0x4d, 0x1d, 0x95, 0x6f, 0x0b, /* ...M..o. */ +0xdc, 0xf7, 0x80, 0x56, 0xf5, 0xc5, 0x48, 0x74, /* ...V..Ht */ +0xf0, 0xad, 0xd9, 0xab, 0x6d, 0x3a, 0x42, 0xe4, /* ....m:B. */ +0xe2, 0xa4, 0x75, 0xf5, 0xeb, 0x31, 0x92, 0x39, /* ..u..1.9 */ +0xd2, 0xc7, 0x70, 0xaa, 0x77, 0xed, 0xaf, 0xd8, /* ..p.w... */ +0x27, 0x61, 0x5c, 0x40, 0x07, 0xa2, 0x0c, 0x2e, /* 'a\@.... */ +0x63, 0x62, 0x30, 0xbb, 0x8b, 0x0d, 0xf7, 0xf5, /* cb0..... */ +0xba, 0x67, 0x80, 0xb9, 0x71, 0x05, 0x20, 0x47, /* .g..q. G */ +0xd1, 0xbe, 0x91, 0xec, 0xbd, 0xcd, 0x98, 0x0f, /* ........ */ +0x6f, 0xb5, 0x69, 0xba, 0x24, 0x14, 0xdb, 0x18, /* o.i.$... */ +0xd0, 0x04, 0xfc, 0x57, 0x2a, 0xd0, 0xb1, 0x4f, /* ...W*..O */ +0x0e, 0x71, 0x33, 0xce, 0xba, 0x38, 0xec, 0xec, /* .q3..8.. */ +0x3e, 0x79, 0x7a, 0x55, 0x99, 0xec, 0x85, 0xc6, /* >yzU.... */ +0xfa, 0x24, 0x6a, 0x51, 0xe3, 0x7a, 0x6d, 0xe6, /* .$jQ.zm. */ +0x42, 0x29, 0x0c, 0x09, 0xa6, 0x42, 0x88, 0x00, /* B)...B.. */ +0x0e, 0xe8, 0x1b, 0x99, 0xf6, 0x2f, 0xdd, 0xb4, /* ...../.. */ +0x79, 0x9c, 0x02, 0xa5, 0xba, 0x4b, 0x40, 0x06, /* y....K@. */ +0xc0, 0x33, 0x3f, 0xcc, 0xcc, 0x9e, 0x4d, 0x02, /* .3?...M. */ +0xb0, 0x2b, 0x92, 0x9c, 0x92, 0x8c, 0x48, 0xc1, /* .+....H. */ +0x20, 0x21, 0xa2, 0x4e, 0xcc, 0xa6, 0x5a, 0x35, /* !.N..Z5 */ +0xb0, 0x33, 0x4e, 0x5d, 0xe8, 0xe8, 0xda, 0xab, /* .3N].... */ +0xa3, 0xf6, 0xb0, 0x97, 0x24, 0xd1, 0x16, 0x92, /* ....$... */ +0xb6, 0x47, 0x0e, 0xb4, 0x4d, 0x1d, 0x98, 0x0e, /* .G..M... */ +0xf3, 0x24, 0x62, 0xa9, 0xb3, 0x2d, 0x8c, 0x63, /* .$b..-.c */ +0x27, 0x8c, 0xd7, 0xf6, 0x1c, 0x8c, 0x4e, 0xa1, /* '.....N. */ +0x52, 0xa7, 0x46, 0x38, 0x87, 0x34, 0x31, 0x06, /* R.F8.41. */ +0x58, 0x10, 0x30, 0x27, 0xae, 0x36, 0x8b, 0x05, /* X.0'.6.. */ +0x9f, 0xf9, 0xe9, 0x63, 0xda, 0x4d, 0xf0, 0x9a, /* ...c.M.. */ +0xb3, 0xca, 0x38, 0x15, 0xd1, 0xe5, 0x00, 0xed, /* ..8..... */ +0xf1, 0x25, 0x64, 0xc2, 0xeb, 0x18, 0xe2, 0xeb, /* .%d..... */ +0x38, 0xc8, 0xb2, 0xb8, 0x79, 0x38, 0x0b, 0xf0, /* 8...y8.. */ +0x8a, 0xec, 0x70, 0x31, 0xef, 0x99, 0x86, 0x87, /* ..p1.... */ +0xd0, 0x5f, 0x06, 0xe4, 0xb3, 0xc2, 0x10, 0x35, /* ._.....5 */ +0x78, 0xfd, 0xe4, 0xee, 0x31, 0x73, 0x07, 0xe4, /* x...1s.. */ +0x2a, 0x10, 0x1f, 0xa3, 0x17, 0x66, 0x5d, 0xe5, /* *....f]. */ +0x1f, 0x36, 0xf4, 0x47, 0x6b, 0xdb, 0x3a, 0x34, /* .6.Gk.:4 */ +0xa4, 0x39, 0x89, 0x6e, 0x0e, 0xf3, 0xb4, 0xff, /* .9.n.... */ +0x54, 0x06, 0x13, 0xcb, 0x99, 0xcb, 0xe8, 0xa1, /* T....... */ +0xc1, 0x13, 0x0b, 0xf6, 0xe3, 0x8e, 0x30, 0xeb, /* ......0. */ +0x42, 0x91, 0x0f, 0x8e, 0x66, 0x12, 0xf7, 0xc8, /* B...f... */ +0xcc, 0xc4, 0xb7, 0x84, 0x26, 0x9c, 0xa3, 0x94, /* ....&... */ +0x15, 0x43, 0x60, 0x82, 0x5f, 0xa9, 0xce, 0x98, /* .C`._... */ +0x94, 0x76, 0x9a, 0x21, 0xca, 0x25, 0x25, 0xa6, /* .v.!.%%. */ +0x83, 0x07, 0x91, 0xeb, 0xe5, 0xed, 0x87, 0x8a, /* ........ */ +0x45, 0x17, 0xb9, 0xc1, 0x92, 0xdb, 0xba, 0xd0, /* E....... */ +0xf8, 0x88, 0x79, 0x27, 0xe1, 0x38, 0x22, 0xe9, /* ..y'.8". */ +0x45, 0x4e, 0xce, 0x5b, 0x86, 0x6c, 0x2a, 0xb4, /* EN.[.l*. */ +0x03, 0xfe, 0x1c, 0xfa, 0x5c, 0x3a, 0x47, 0x96, /* ....\:G. */ +0x3a, 0xa4, 0xa9, 0x62, 0xce, 0xe0, 0x42, 0x33, /* :..b..B3 */ +0xf4, 0xad, 0x32, 0x0d, 0x97, 0xc9, 0xd6, 0xae, /* ..2..... */ +0x5b, 0xe7, 0x45, 0x2e, 0xf5, 0x76, 0x5d, 0xf9, /* [.E..v]. */ +0x1e, 0x6c, 0xeb, 0x0e, 0xab, 0x6e, 0x10, 0x6a, /* .l...n.j */ +0x19, 0x85, 0xff, 0x61, 0x73, 0xba, 0x89, 0x3b, /* ...as..; */ +0xad, 0x07, 0x28, 0x83, 0x39, 0xfa, 0x1b, 0x1a, /* ..(.9... */ +0xfb, 0x7e, 0x35, 0x68, 0xd1, 0xa0, 0x9e, 0x17, /* .~5h.... */ +0x93, 0x7b, 0xe2, 0xd5, 0x3e, 0xb2, 0x4c, 0x9b, /* .{..>.L. */ +0xf1, 0xa9, 0x1a, 0x74, 0xe6, 0x7d, 0x9d, 0x78, /* ...t.}.x */ +0x56, 0xdd, 0xd7, 0xd3, 0x37, 0x37, 0x45, 0x70, /* V...77Ep */ +0x0f, 0xa8, 0xcd, 0x5b, 0x41, 0xec, 0x6b, 0xb1, /* ...[A.k. */ +0x08, 0xbd, 0x6e, 0x48, 0xad, 0x96, 0x50, 0x4c, /* ..nH..PL */ +0x7f, 0xa2, 0xbb, 0x43, 0x25, 0x47, 0xb2, 0x41, /* ...C%G.A */ +0x7e, 0x0a, 0x7a, 0x26, 0x2c, 0x8b, 0x0e, 0x30, /* ~.z&,..0 */ +0x16, 0xbd, 0x7d, 0xb2, 0xd3, 0x54, 0xed, 0xfd, /* ..}..T.. */ +0x87, 0x3e, 0x56, 0x94, 0x83, 0x23, 0xd3, 0x05, /* .>V..#.. */ +0xe6, 0x16, 0x4e, 0xef, 0x3f, 0x7d, 0x9b, 0x90, /* ..N.?}.. */ +0x2d, 0x20, 0x0e, 0x81, 0xa3, 0x35, 0xe6, 0xe1, /* - ...5.. */ +0x8e, 0x34, 0xa4, 0xc3, 0x62, 0xc5, 0xd8, 0xc7, /* .4..b... */ +0x34, 0x48, 0x12, 0x7f, 0xad, 0xd0, 0x07, 0x51, /* 4H.....Q */ +0x8e, 0xfe, 0xa7, 0xc2, 0x36, 0x68, 0x56, 0xf8, /* ....6hV. */ +0x28, 0x55, 0x1a, 0x04, 0x16, 0xb7, 0xb5, 0x1c, /* (U...... */ +0x0e, 0x6b, 0xb6, 0x5b, 0xf9, 0x64, 0x56, 0x1c, /* .k.[.dV. */ +0x1f, 0x9e, 0x5a, 0xc6, 0x55, 0x7a, 0x6c, 0x45, /* ..Z.UzlE */ +0xd6, 0xd1, 0xc6, 0x52, 0x8a, 0x0f, 0x99, 0x23, /* ...R...# */ +0x37, 0x96, 0xf4, 0x2e, 0x5f, 0x21, 0x77, 0x46, /* 7..._!wF */ +0x78, 0x30, 0xa9, 0x9e, 0x91, 0xce, 0xd1, 0x3a, /* x0.....: */ +0xf6, 0x54, 0xa1, 0x87, 0x0a, 0x85, 0xdd, 0xb3, /* .T...... */ +0xe9, 0x66, 0xaf, 0x6e, 0x07, 0xfb, 0xc3, 0x92, /* .f.n.... */ +0xfa, 0x55, 0xa9, 0x14, 0x42, 0xbd, 0x14, 0x72, /* .U..B..r */ +0x48, 0x5c, 0x1d, 0xd2, 0x56, 0x95, 0x7a, 0x01, /* H\..V.z. */ +0xcb, 0x9e, 0x6b, 0xa0, 0x7c, 0x9e, 0xf5, 0x05, /* ..k.|... */ +0x94, 0xe1, 0x39, 0x5c, 0x9f, 0xc4, 0xf7, 0xb8, /* ..9\.... */ +0x16, 0xab, 0x76, 0x68, 0xef, 0x67, 0x3f, 0x3e, /* ..vh.g?> */ +0x15, 0x12, 0x94, 0x5d, 0x80, 0xcb, 0x14, 0x3e, /* ...]...> */ +0x9d, 0xa3, 0xe3, 0xa6, 0x83, 0xb6, 0xa2, 0x06, /* ........ */ +0x7c, 0x62, 0xfd, 0xe5, 0x19, 0x1e, 0xed, 0x8a, /* |b...... */ +0x73, 0x88, 0x9b, 0xf6, 0xeb, 0xe8, 0x18, 0x80, /* s....... */ +0x3b, 0xe9, 0xeb, 0x9e, 0xf7, 0x3c, 0x91, 0x5b, /* ;....<.[ */ +0xeb, 0xf7, 0x4b, 0xc1, 0x80, 0x55, 0x19, 0x8c, /* ..K..U.. */ +0x8e, 0x70, 0x27, 0xd4, 0xaa, 0x7c, 0xf3, 0xc3, /* .p'..|.. */ +0xbf, 0x62, 0x11, 0x92, 0x8e, 0x20, 0x94, 0x66, /* .b... .f */ +0x26, 0x79, 0xc4, 0x0b, 0x1c, 0xae, 0x2a, 0x13, /* &y....*. */ +0x53, 0xb4, 0x76, 0xe9, 0xd1, 0x70, 0x86, 0xd2, /* S.v..p.. */ +0x5b, 0x05, 0xa4, 0x18, 0x22, 0xe9, 0xd9, 0x2c, /* [...".., */ +0x4a, 0xc7, 0xab, 0x37, 0x28, 0x9b, 0xe0, 0xa8, /* J..7(... */ +0xc2, 0x17, 0xed, 0xd4, 0x91, 0x4a, 0x2c, 0x27, /* .....J,' */ +0xac, 0x98, 0xa6, 0xa4, 0x15, 0x34, 0x7b, 0x81, /* .....4{. */ +0x96, 0x6d, 0xe1, 0xe8, 0xfd, 0x28, 0x8b, 0x39, /* .m...(.9 */ +0xe1, 0x51, 0xa5, 0xaf, 0x2c, 0xf9, 0xa7, 0xdc, /* .Q..,... */ +0x6e, 0xd4, 0xf9, 0xcd, 0xa6, 0xb6, 0xb3, 0xff, /* n....... */ +0xfb, 0xe7, 0xa7, 0xea, 0xcb, 0xc5, 0x90, 0x09, /* ........ */ +0x6e, 0x30, 0x2f, 0x40, 0xff, 0x59, 0xbf, 0xc9, /* n0/@.Y.. */ +0x3a, 0x81, 0x61, 0xc8, 0x98, 0xc3, 0xf7, 0x1b, /* :.a..... */ +0x35, 0x03, 0x17, 0x2b, 0xcb, 0xdc, 0x12, 0xfc, /* 5..+.... */ +0x82, 0xc2, 0xd4, 0xa7, 0xb8, 0xd7, 0xf4, 0xf2, /* ........ */ +0xb2, 0xc4, 0x57, 0xab, 0xfb, 0x61, 0xc5, 0xb8, /* ..W..a.. */ +0x01, 0x72, 0xdb, 0xc3, 0xce, 0x86, 0x3a, 0x14, /* .r....:. */ +0x6f, 0x7c, 0xfe, 0xd4, 0x66, 0x4a, 0x4a, 0x7e, /* o|..fJJ~ */ +0xba, 0x75, 0xea, 0xde, 0x1c, 0xd0, 0xf6, 0x5d, /* .u.....] */ +0x9b, 0x54, 0x92, 0x92, 0x18, 0x6d, 0xe6, 0x66, /* .T...m.f */ +0x22, 0xf6, 0xe9, 0xbe, 0xcf, 0x93, 0x51, 0x6d, /* ".....Qm */ +0xee, 0x90, 0x12, 0x66, 0x5a, 0x10, 0xb9, 0x90, /* ...fZ... */ +0x96, 0x5a, 0x8a, 0xb9, 0x1f, 0x40, 0xf5, 0x1c, /* .Z...@.. */ +0xde, 0x11, 0xa6, 0xa7, 0x4b, 0xc7, 0x4e, 0xe3, /* ....K.N. */ +0x88, 0x9c, 0xb0, 0xe0, 0x73, 0x8c, 0x33, 0x99, /* ....s.3. */ +0x1d, 0x3a, 0x58, 0x9e, 0xa9, 0xff, 0x85, 0x5a, /* .:X....Z */ +0x49, 0x48, 0xc8, 0x64, 0x65, 0x0f, 0x05, 0xa5, /* IH.de... */ +0xbc, 0x8d, 0x09, 0x74, 0x21, 0xd8, 0x71, 0x07, /* ...t!.q. */ +0x81, 0xf4, 0x95, 0xdf, 0xbf, 0x55, 0x53, 0x7a, /* .....USz */ +0xa7, 0xf6, 0xb0, 0x47, 0x2f, 0xc1, 0xfc, 0x5d, /* ...G/..] */ +0x4d, 0x2f, 0xcf, 0xfe, 0xac, 0x80, 0x8c, 0xe9, /* M/...... */ +0x83, 0x83, 0x42, 0x98, 0x8f, 0xc9, 0x10, 0x1d, /* ..B..... */ +0x7c, 0x3c, 0xff, 0x54, 0x4a, 0x7c, 0xc9, 0xbc, /* |<.TJ|.. */ +0x97, 0x7a, 0xf2, 0x5d, 0x77, 0x2c, 0xaa, 0x37, /* .z.]w,.7 */ +0x5c, 0x0f, 0x25, 0x10, 0x6b, 0x2f, 0xe3, 0x23, /* \.%.k/.# */ +0x03, 0x0a, 0x5c, 0x83, 0xac, 0x42, 0x35, 0x83, /* ..\..B5. */ +0x76, 0x90, 0x87, 0x67, 0xc8, 0x69, 0x88, 0x0e, /* v..g.i.. */ +0xdc, 0x52, 0xbb, 0x5f, 0xf8, 0xa0, 0xec, 0x63, /* .R._...c */ +0xf1, 0x5f, 0xff, 0x45, 0x65, 0x98, 0x37, 0x85, /* ._.Ee.7. */ +0x1c, 0x37, 0x37, 0xb4, 0xbd, 0xce, 0x24, 0xc9, /* .77...$. */ +0xa6, 0x3d, 0x9e, 0xe8, 0xad, 0x21, 0x0e, 0x87, /* .=...!.. */ +0x42, 0x65, 0xa6, 0x86, 0x99, 0xcf, 0x4e, 0xa6, /* Be....N. */ +0x69, 0x9d, 0xca, 0xe6, 0xb9, 0xef, 0x90, 0xf1, /* i....... */ +0xe4, 0x4e /* .N */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt16[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xd0, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x38, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +8...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xda, 0xa9, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x10, /* .....FP. */ +0xff, 0xff, 0x14, 0x9b, 0x00, 0x00, 0xc9, 0xa4, /* ........ */ +0x5b, 0x75, 0xc0, 0x09, 0x50, 0x9d, 0x15, 0x10, /* [u..P... */ +0x72, 0x98, 0x3a, 0x18, 0xa1, 0xef, 0x85, 0x44, /* r.:....D */ +0xf6, 0xa8, 0x13, 0xda, 0x86, 0x42, 0x42, 0x9e, /* .....BB. */ +0xff, 0xfb, 0x72, 0x5f, 0x33, 0xeb, 0x08, 0xb0, /* ..r_3... */ +0x19, 0x26, 0x4e, 0x9f, 0x8c, 0xae, 0xbc, 0x4a, /* .&N....J */ +0xf2, 0x8f, 0x4e, 0x77, 0x18, 0xba, 0x51, 0x06, /* ..Nw..Q. */ +0x68, 0x7c, 0x1e, 0x78, 0x29, 0x7a, 0xc7, 0x0d, /* h|.x)z.. */ +0x05, 0xcf, 0x58, 0x2f, 0x38, 0x1e, 0xed, 0x5e, /* ..X/8..^ */ +0x05, 0x79, 0x9c, 0x21, 0xf4, 0xaf, 0x7b, 0x6d, /* .y.!..{m */ +0xf3, 0x4c, 0x9c, 0xd1, 0x0f, 0xf7, 0x91, 0x14, /* .L...... */ +0x20, 0xe6, 0x7a, 0x17, 0xc0, 0x04, 0x1b, 0x8a, /* .z..... */ +0x12, 0xe5, 0x10, 0xf7, 0xfa, 0x27, 0x18, 0x03, /* .....'.. */ +0xfe, 0xd1, 0x49, 0x99, 0xda, 0x8f, 0x79, 0xff, /* ..I...y. */ +0xc3, 0x0f, 0x31, 0x02, 0x2a, 0x9c, 0x59, 0xf7, /* ..1.*.Y. */ +0x3c, 0x08, 0xcf, 0xfd, 0x60, 0x0e, 0x90, 0x9c, /* <...`... */ +0x04, 0x00, 0x93, 0xe7, 0xe7, 0x65, 0xf2, 0x39, /* .....e.9 */ +0x8c, 0xea, 0x36, 0xc4, 0x24, 0x25, 0x09, 0x85, /* ..6.$%.. */ +0x9a, 0x20, 0xc5, 0x30, 0xe8, 0x19, 0x92, 0x58, /* . .0...X */ +0x6e, 0x47, 0xc5, 0xa6, 0x83, 0x0f, 0x23, 0xe6, /* nG....#. */ +0xe7, 0x4e, 0xa7, 0xfd, 0xf9, 0x5d, 0xf7, 0x3f, /* .N...].? */ +0x4e, 0xd4, 0xdd, 0x83, 0xac, 0x54, 0x34, 0x8e, /* N....T4. */ +0xdf, 0x6d, 0x99, 0x69, 0xcd, 0x73, 0x3a, 0x73, /* .m.i.s:s */ +0x18, 0x73, 0xc4, 0x75, 0x22, 0x0d, 0x90, 0x30, /* .s.u"..0 */ +0x5e, 0xa7, 0x7c, 0xf7, 0xe9, 0x2e, 0x09, 0x3f, /* ^.|....? */ +0x0d, 0x55, 0xba, 0x13, 0x7c, 0xd8, 0x46, 0x0e, /* .U..|.F. */ +0xc9, 0x89, 0x08, 0x88, 0x8e, 0xbd, 0x95, 0x58, /* .......X */ +0x36, 0x19, 0x58, 0xd0, 0x43, 0xc5, 0xd3, 0xb1, /* 6.X.C... */ +0x99, 0xc9, 0x19, 0xe7, 0x9d, 0x5e, 0xfe, 0xe5, /* .....^.. */ +0x61, 0xbe, 0xa9, 0x9d, 0xcb, 0x1f, 0xbe, 0xc9, /* a....... */ +0x3a, 0x21, 0xa0, 0x58, 0x21, 0x2e, 0xce, 0x89, /* :!.X!... */ +0x1b, 0xd5, 0x6c, 0x36, 0x87, 0xea, 0x25, 0x56, /* ..l6..%V */ +0xf5, 0x13, 0x79, 0xfd, 0xc5, 0xf1, 0x4a, 0x97, /* ..y...J. */ +0x73, 0x51, 0xc0, 0x6d, 0x8f, 0x35, 0x97, 0x52, /* sQ.m.5.R */ +0x03, 0xb2, 0x48, 0x2d, 0xd9, 0x4e, 0xbb, 0x3f, /* ..H-.N.? */ +0x79, 0xbc, 0x12, 0xeb, 0xa9, 0x56, 0xcf, 0xdb, /* y....V.. */ +0x6b, 0x47, 0x0b, 0x35, 0x98, 0x22, 0x6b, 0x17, /* kG.5."k. */ +0x42, 0x37, 0x89, 0x7b, 0x51, 0x26, 0x10, 0x6c, /* B7.{Q&.l */ +0x2a, 0x9a, 0xbf, 0x6b, 0xf0, 0x20, 0x40, 0xf9, /* *..k. @. */ +0x8c, 0x82, 0xa6, 0x56, 0xd8, 0x85, 0x87, 0xdf, /* ...V.... */ +0x4c, 0xdd, 0xa7, 0xb3, 0x91, 0xf8, 0x0d, 0x6a, /* L......j */ +0xb2, 0x32, 0x96, 0x15, 0x17, 0x2b, 0x0c, 0x0e, /* .2...+.. */ +0xfd, 0x9b, 0x7f, 0x9f, 0x57, 0xcc, 0xe0, 0x2d, /* ....W..- */ +0xd2, 0xe9, 0xbf, 0x41, 0x84, 0xef, 0x23, 0x02, /* ...A..#. */ +0xf4, 0x53, 0xff, 0xdb, 0xb4, 0x08, 0x9a, 0xf7, /* .S...... */ +0xb8, 0xd0, 0x62, 0x4b, 0x49, 0xa3, 0xc6, 0x03, /* ..bKI... */ +0x16, 0x78, 0x5f, 0xdc, 0xe2, 0xe1, 0x2e, 0xdb, /* .x_..... */ +0x63, 0xdc, 0xd9, 0x46, 0x8a, 0x7c, 0xbb, 0xc2, /* c..F.|.. */ +0x30, 0xb3, 0xfb, 0xb3, 0x2e, 0x67, 0x39, 0xc7, /* 0....g9. */ +0x2d, 0x9c, 0xc8, 0x2b, 0xee, 0x1b, 0xea, 0xad, /* -..+.... */ +0x92, 0x0e, 0x94, 0x43, 0xc7, 0xd9, 0x13, 0x24, /* ...C...$ */ +0x6e, 0x97, 0x72, 0xfe, 0x15, 0x8d, 0x52, 0xfb, /* n.r...R. */ +0xe4, 0x80, 0x53, 0xad, 0x25, 0x6c, 0xf0, 0x19, /* ..S.%l.. */ +0xbc, 0x54, 0x55, 0x77, 0x48, 0x3c, 0x36, 0xfc, /* .TUwH<6. */ +0xe1, 0x84, 0x39, 0x00, 0x9b, 0xd0, 0xc6, 0xc8, /* ..9..... */ +0x44, 0xf7, 0xb1, 0x08, 0xc9, 0x51, 0x02, 0x91, /* D....Q.. */ +0x4c, 0xa9, 0x9e, 0x5f, 0x8d, 0xbf, 0x3b, 0x0e, /* L.._..;. */ +0x9e, 0xd6, 0x0d, 0xaf, 0x52, 0xae, 0x01, 0x04, /* ....R... */ +0xcc, 0x3e, 0x28, 0xc8, 0xb9, 0xa8, 0x93, 0xee, /* .>(..... */ +0x78, 0x85, 0x9e, 0x1e, 0x39, 0xef, 0xb2, 0x05, /* x...9... */ +0xd6, 0x06, 0xed, 0x21, 0xbe, 0x0a, 0xe0, 0x44, /* ...!...D */ +0x5d, 0x60, 0xa6, 0x95, 0x48, 0xd5, 0x99, 0x62, /* ]`..H..b */ +0x65, 0x8f, 0xb1, 0x99, 0x2f, 0x76, 0x45, 0xb8, /* e.../vE. */ +0x0c, 0x26, 0x39, 0x4e, 0xd1, 0x16, 0x58, 0x52, /* .&9N..XR */ +0x5d, 0x2a, 0xe2, 0xf7, 0x19, 0xb1, 0xc0, 0x1b, /* ]*...... */ +0x1c, 0x2b, 0xd4, 0x61, 0xaa, 0x66, 0xe1, 0x0d, /* .+.a.f.. */ +0x89, 0x8e, 0xf9, 0x22, 0xec, 0xe9, 0x90, 0x1a, /* ...".... */ +0xcb, 0x6a, 0x53, 0x83, 0xc8, 0xca, 0x2d, 0x85, /* .jS...-. */ +0x17, 0x87, 0xe7, 0x91, 0x44, 0xf9, 0x96, 0x4c, /* ....D..L */ +0x44, 0x93, 0x6e, 0x5c, 0xd5, 0x40, 0x47, 0x65, /* D.n\.@Ge */ +0x62, 0x32, 0x36, 0x33, 0xcf, 0x0f, 0x2d, 0x7b, /* b263..-{ */ +0x40, 0xd5, 0x17, 0x71, 0xc4, 0x82, 0x5a, 0xdf, /* @..q..Z. */ +0x6c, 0x88, 0xfb, 0xf4, 0xb5, 0xe0, 0xf8, 0xde, /* l....... */ +0x0f, 0x5a, 0xfe, 0xed, 0x53, 0x44, 0xf9, 0xc7, /* .Z..SD.. */ +0x53, 0x2f, 0x67, 0x7e, 0xde, 0xd3, 0x0c, 0x5e, /* S/g~...^ */ +0xcf, 0x05, 0xcd, 0x6f, 0xd8, 0x7c, 0xf8, 0x9a, /* ...o.|.. */ +0x68, 0x35, 0xd7, 0x1a, 0x13, 0x2e, 0x08, 0xec, /* h5...... */ +0xc0, 0x63, 0xa3, 0x45, 0xb9, 0x1d, 0xcf, 0x0c, /* .c.E.... */ +0x7e, 0x51, 0xd6, 0xf6, 0x01, 0xa8, 0x9e, 0x39, /* ~Q.....9 */ +0x78, 0xb9, 0xd0, 0x91, 0x91, 0x9b, 0x4a, 0x25, /* x.....J% */ +0x2b, 0x1a, 0x2e, 0x23, 0x9f, 0x69, 0x38, 0x62, /* +..#.i8b */ +0xb7, 0x51, 0x37, 0x2a, 0xda, 0x83, 0x63, 0x6f, /* .Q7*..co */ +0xd1, 0x70, 0xdd, 0xa9, 0x41, 0x9a, 0x2d, 0xfd, /* .p..A.-. */ +0x8c, 0x21, 0x11, 0xfc, 0x1f, 0x86, 0x80, 0xef, /* .!...... */ +0x77, 0xa9, 0x2e, 0xff, 0xf6, 0x83, 0x02, 0xe4, /* w....... */ +0x8e, 0xe1, 0x03, 0x94, 0xe9, 0x42, 0x23, 0x23, /* .....B## */ +0xac, 0xc6, 0x66, 0xcc, 0x8c, 0x90, 0x07, 0x0a, /* ..f..... */ +0x7b, 0xd9, 0x03, 0x9c, 0x09, 0x94, 0x7c, 0x67, /* {.....|g */ +0x62, 0xd5, 0x75, 0x22, 0x1c, 0x80, 0xbe, 0x90, /* b.u".... */ +0xc4, 0x5d, 0x06, 0xf4, 0x33, 0x48, 0xef, 0x0d, /* .]..3H.. */ +0xe3, 0x31, 0x1a, 0x96, 0x08, 0xc0, 0xaa, 0x1b, /* .1...... */ +0xb9, 0x3b, 0xa7, 0xf0, 0xe9, 0x14, 0xf9, 0x0f, /* .;...... */ +0xbe, 0x59, 0x36, 0x93, 0xaf, 0x2f, 0xac, 0x7f, /* .Y6../.. */ +0xee, 0xef, 0xf1, 0xfa, 0xe7, 0x33, 0xd0, 0x5c, /* .....3.\ */ +0x81, 0xf8, 0x05, 0x66, 0xcb, 0x43, 0xc6, 0xf9, /* ...f.C.. */ +0xbe, 0x65, 0x69, 0x91, 0x81, 0x0a, 0xa5, 0xc9, /* .ei..... */ +0x80, 0xe1, 0x6b, 0xf4, 0x25, 0x2e, 0x62, 0xbd, /* ..k.%.b. */ +0xb9, 0xa1, 0xf8, 0x0a, 0x56, 0x76, 0x0e, 0x35, /* ....Vv.5 */ +0xcb, 0xd4, 0x3a, 0x3b, 0x12, 0xb4, 0x7f, 0x34, /* ..:;...4 */ +0xa8, 0x9c, 0x1b, 0x02, 0x00, 0x72, 0xd9, 0x2d, /* .....r.- */ +0x3a, 0xdb, 0x8b, 0xf2, 0xd1, 0xf9, 0x3f, 0x29, /* :.....?) */ +0xa2, 0x01, 0x69, 0xae, 0xd7, 0x9a, 0x36, 0xe6, /* ..i...6. */ +0x8f, 0x3d, 0xe1, 0x8d, 0x5b, 0x02, 0x09, 0x98, /* .=..[... */ +0x50, 0x6e, 0x00, 0xcf, 0x70, 0x45, 0x83, 0x87, /* Pn..pE.. */ +0xa9, 0x28, 0xa4, 0xf8, 0xb2, 0x20, 0x60, 0xd3, /* .(... `. */ +0x2e, 0x84, 0x56, 0x9b, 0x96, 0x15, 0x2c, 0xc7, /* ..V...,. */ +0x0c, 0x3c, 0xb0, 0xf3, 0x96, 0x09, 0x9e, 0xb5, /* .<...... */ +0x74, 0xe7, 0xd1, 0x63, 0xdc, 0xe0, 0xc0, 0x08, /* t..c.... */ +0x13, 0x0c, 0xeb, 0x18, 0xa1, 0x79, 0x1e, 0x0d, /* .....y.. */ +0x54, 0x68, 0x2a, 0x7e, 0x5d, 0x5e, 0xb0, 0x78, /* Th*~]^.x */ +0x65, 0x32, 0x20, 0x0b, 0x20, 0x31, 0xcc, 0x4d, /* e2 . 1.M */ +0xdd, 0xd1, 0xc6, 0xc2, 0x42, 0xe8, 0x88, 0xc4, /* ....B... */ +0xce, 0xe6, 0x31, 0x14, 0x5f, 0x42, 0x20, 0x10, /* ..1._B . */ +0xe3, 0x39, 0x96, 0x8a, 0x8c, 0xb5, 0xc8, 0x0a, /* .9...... */ +0x79, 0xa5, 0xcc, 0x05, 0x8e, 0x4a, 0x92, 0x75, /* y....J.u */ +0x3e, 0xd3, 0x33, 0xf2, 0xee, 0xfe, 0x0b, 0x42, /* >.3....B */ +0x3d, 0x1a, 0x7d, 0xcc, 0x33, 0x4a, 0x9e, 0x55, /* =.}.3J.U */ +0x4a, 0xc4, 0x41, 0x9d, 0xcb, 0xe9, 0xea, 0x4c, /* J.A....L */ +0x88, 0x8b, 0xf0, 0x33, 0xb1, 0xea, 0x72, 0x1f, /* ...3..r. */ +0x01, 0xcf, 0xd5, 0xff, 0x24, 0x9b, 0x6f, 0xf8, /* ....$.o. */ +0x64, 0x1e, 0x60, 0xdd, 0xad, 0x9d, 0xb1, 0xe7, /* d.`..... */ +0x0b, 0xf6, 0x52, 0xa1, 0x55, 0x4e, 0xcb, 0x1e, /* ..R.UN.. */ +0xea, 0x68, 0x27, 0x69, 0xa7, 0xa6, 0xe0, 0x00, /* .h'i.... */ +0xed, 0xa0, 0x79, 0x44, 0x18, 0x04, 0xa4, 0x81, /* ..yD.... */ +0xf9, 0x39, 0x88, 0x7f, 0x2e, 0xed, 0xdf, 0x5f, /* .9....._ */ +0xcd, 0x5f, 0x86, 0xd8, 0xd7, 0x8c, 0x19, 0xa0, /* ._...... */ +0x47, 0x1a, 0x12, 0x9b, 0x26, 0xd6, 0x35, 0x77, /* G...&.5w */ +0x85, 0x1b, 0xc6, 0x1c, 0xcb, 0xf0, 0x73, 0x76, /* ......sv */ +0xea, 0xf9, 0x42, 0x06, 0x60, 0x5c, 0xa5, 0xb1, /* ..B.`\.. */ +0xe6, 0xd9, 0x86, 0xb5, 0x80, 0xee, 0x51, 0x24, /* ......Q$ */ +0x5b, 0x3a, 0xd8, 0x14, 0xaf, 0x5a, 0x8c, 0xa4, /* [:...Z.. */ +0x83, 0xe3, 0x4e, 0x2f, 0xbc, 0x47, 0x3a, 0xe3, /* ..N/.G:. */ +0x06, 0x5e, 0x79, 0xc5, 0xd8, 0xf1, 0x87, 0xef, /* .^y..... */ +0x89, 0x67, 0x6e, 0x9d, 0x56, 0x7d, 0x34, 0x78, /* .gn.V}4x */ +0x67, 0x88, 0xa0, 0xcf, 0x56, 0x15, 0xc2, 0x61, /* g...V..a */ +0x79, 0xe8, 0xfd, 0x9d, 0x6f, 0xd5, 0xc3, 0x38, /* y...o..8 */ +0x95, 0x4b, 0x8d, 0x57, 0xa5, 0x18, 0x44, 0x26, /* .K.W..D& */ +0xdf, 0xcb, 0x9e, 0xbd, 0xa7, 0x2d, 0x18, 0x03, /* .....-.. */ +0x2f, 0x99, 0x2a, 0x82, 0xdc, 0xb1, 0xcc, 0x62, /* /.*....b */ +0x74, 0xdd, 0x02, 0x61, 0x37, 0x72, 0x88, 0x75, /* t..a7r.u */ +0xfe, 0xf7, 0x0d, 0x4a, 0x8f, 0x0d, 0xcc, 0x96, /* ...J.... */ +0x09, 0xe7, 0x11, 0xd1, 0x9b, 0xa6, 0xe9, 0xeb, /* ........ */ +0x2c, 0x91, 0x73, 0x29, 0x77, 0x67, 0x10, 0x64, /* ,.s)wg.d */ +0x8f, 0x6d, 0xc3, 0x64, 0xf7, 0xc2, 0x4b, 0x40, /* .m.d..K@ */ +0x01, 0x67, 0xc9, 0xce, 0x56, 0x5f, 0xe7, 0x57, /* .g..V_.W */ +0xf5, 0xd6, 0xeb, 0x28, 0xe3, 0x64, 0x55, 0x02, /* ...(.dU. */ +0x75, 0x16, 0x5e, 0x8e, 0x1d, 0xb7, 0xb6, 0x3e, /* u.^....> */ +0x7d, 0x17, 0x92, 0xae, 0xe1, 0x01, 0x4d, 0xeb, /* }.....M. */ +0xa5, 0x6e, 0x45, 0x80, 0x83, 0x99, 0x65, 0x7e, /* .nE...e~ */ +0xb9, 0x69, 0x24, 0x0b, 0x53, 0x8f, 0x47, 0x89, /* .i$.S.G. */ +0x5b, 0x48, 0x80, 0x79, 0x75, 0x3b, 0xe6, 0xe8, /* [H.yu;.. */ +0xd7, 0x8b, 0x31, 0xdb, 0x11, 0x6d, 0xea, 0xc1, /* ..1..m.. */ +0x33, 0xe1, 0xc9, 0x19, 0x07, 0xb8, 0xa1, 0x62, /* 3......b */ +0xfc, 0x23, 0x1d, 0x5a, 0x89, 0x24, 0x32, 0x33, /* .#.Z.$23 */ +0x96, 0x8b, 0xe1, 0x9d, 0x8a, 0x98, 0x04, 0xf1, /* ........ */ +0x32, 0x2b, 0xe1, 0xe0, 0xee, 0x8a, 0x80, 0xc7, /* 2+...... */ +0x7b, 0xc3, 0x82, 0x99, 0x7e, 0x75, 0x46, 0xbd, /* {...~uF. */ +0xbd, 0x8c, 0x1b, 0x49, 0x83, 0xe6, 0xb3, 0x65, /* ...I...e */ +0x2e, 0x4c, 0x14, 0x32, 0xbc, 0x1c, 0xd5, 0xa3, /* .L.2.... */ +0x6a, 0xc3, 0x2e, 0xb8, 0xdf, 0xe5, 0x15, 0x23, /* j......# */ +0xbc, 0xa6, 0xf4, 0x73, 0xa8, 0x74, 0xff, 0xbc, /* ...s.t.. */ +0x8b, 0x98, 0xa6, 0x6a, 0x9c, 0x90, 0x98, 0x38, /* ...j...8 */ +0x4f, 0x27, 0xb1, 0x6c, 0xd4, 0xde, 0x19, 0xe8, /* O'.l.... */ +0xa6, 0x62, 0x2e, 0x77, 0x70, 0x37, 0x57, 0x01, /* .b.wp7W. */ +0x3c, 0xd2, 0x35, 0xd8, 0x1b, 0x28, 0x2c, 0x64, /* <.5..(,d */ +0x16, 0x9c, 0x66, 0xd1, 0x57, 0xa6, 0x70, 0xf5, /* ..f.W.p. */ +0x10, 0x4f, 0xf2, 0x1e, 0xe6, 0x4c, 0x05, 0x15, /* .O...L.. */ +0x6d, 0xb5, 0x0d, 0x5e, 0x5b, 0x4e, 0xbb, 0xdd, /* m..^[N.. */ +0x5d, 0x81, 0xdf, 0xc5, 0x31, 0x47, 0xea, 0xa2, /* ]...1G.. */ +0x7a, 0x6c, 0xa9, 0xac, 0x5d, 0x26, 0x5d, 0xa1, /* zl..]&]. */ +0x87, 0x3e, 0xbf, 0x62, 0x7e, 0xa8, 0x16, 0x81, /* .>.b~... */ +0x30, 0x76, 0xad, 0x36, 0x22, 0xa9, 0x83, 0xc8, /* 0v.6"... */ +0xba, 0x16, 0x7c, 0x00, 0x09, 0x7e, 0x23, 0x99, /* ..|..~#. */ +0xaa, 0x66, 0xfa, 0x97, 0xa0, 0x65, 0xad, 0x56, /* .f...e.V */ +0x95, 0x23, 0x8d, 0xde, 0x9f, 0x8d, 0xa8, 0x5a, /* .#.....Z */ +0x9c, 0x32, 0xd4, 0x4b, 0xaf, 0xd3, 0x86, 0x38, /* .2.K...8 */ +0x60, 0x55, 0x3c, 0x44, 0x41, 0xe8, 0xa7, 0x9e, /* `U. */ +0x1c, 0xe0, 0x74, 0x31, 0x27, 0xd0, 0xe1, 0xa5, /* ..t1'... */ +0x74, 0x8f, 0x82, 0x07, 0x6f, 0x41, 0x2c, 0xf1, /* t...oA,. */ +0x4f, 0x72, 0x51, 0xb8, 0x1b, 0xb7, 0xb7, 0x44, /* OrQ....D */ +0xfc, 0x63, 0xe1, 0xbb, 0x7a, 0xbc, 0x6a, 0xf6, /* .c..z.j. */ +0x27, 0xd4, 0xfe, 0x0a, 0xbe, 0xcd, 0x0b, 0x8d, /* '....... */ +0x54, 0x51, 0xcb, 0xbc, 0x1a, 0xb6, 0xa6, 0x6f, /* TQ.....o */ +0x65, 0xa6, 0x99, 0xfc, 0x17, 0xb2, 0x6f, 0x88, /* e.....o. */ +0x4e, 0x5c, 0x87, 0x94, 0xb7, 0x14, 0x67, 0xf6, /* N\....g. */ +0x59, 0xf2, 0xe0, 0x84, 0x60, 0x63, 0x41, 0x3c, /* Y...`cA< */ +0x50, 0x12, 0xaf, 0x2b, 0x2f, 0xc2, 0x1a, 0x67, /* P..+/..g */ +0x7f, 0xe7, 0xe6, 0xbf, 0xb3, 0xd7, 0x3d, 0xea, /* ......=. */ +0x1e, 0x8b, 0x6d, 0x20, 0xe3, 0x30, 0x48, 0xd2, /* ..m .0H. */ +0xd2, 0x1f, 0x39, 0x77, 0x57, 0x19, 0xdd, 0xbe, /* ..9wW... */ +0x24, 0x1e, 0x5f, 0x6e, 0x1f, 0x54, 0xfa, 0x89, /* $._n.T.. */ +0xc6, 0x7d, 0xab, 0x8c, 0xed, 0x1a, 0x7c, 0x11, /* .}....|. */ +0x2d, 0xcb, 0xfb, 0xbe, 0xb1, 0x86, 0xa8, 0xb0, /* -....... */ +0xc5, 0x37, 0x55, 0xb1, 0xd7, 0x8e, 0xc9, 0xb7, /* .7U..... */ +0x19, 0xdd, 0xe5, 0x03, 0xa1, 0xbb, 0xea, 0x20, /* ....... */ +0x1d, 0x93, 0x0d, 0xa5, 0x98, 0x18, 0x1a, 0xae, /* ........ */ +0x9d, 0x70, 0xc6, 0x6a, 0x73, 0x2f, 0x1b, 0xec, /* .p.js/.. */ +0x6c, 0xfe, 0xa3, 0x01, 0xcf, 0xf1, 0x56, 0x68, /* l.....Vh */ +0xa5, 0x4d, 0xea, 0x7b, 0xda, 0xe5, 0xc8, 0x4a, /* .M.{...J */ +0x1b, 0x8e, 0x20, 0xb7, 0x4a, 0x93, 0xb9, 0xb1, /* .. .J... */ +0xb2, 0xf1, 0x53, 0x86, 0x6f, 0xe9, 0xa2, 0x36, /* ..S.o..6 */ +0x7f, 0x35, 0x19, 0x59, 0x7d, 0x2f, 0xb1, 0xd2, /* .5.Y}/.. */ +0x53, 0xf8, 0x6c, 0xf6, 0x14, 0x6e, 0xac, 0xc9, /* S.l..n.. */ +0x3c, 0xbe, 0x0f, 0x95, 0x08, 0x0e, 0xd3, 0x28, /* <......( */ +0x84, 0x02, 0x80, 0x9e, 0xaf, 0xa6, 0x2a, 0xe7, /* ......*. */ +0xa8, 0x2f, 0xac, 0x15, 0x04, 0xfc, 0x5e, 0x2c, /* ./....^, */ +0xce, 0x5a, 0x20, 0x68, 0xd4, 0x89, 0x15, 0xc3, /* .Z h.... */ +0xa2, 0x28, 0xcc, 0x8a, 0xdf, 0xf4, 0xc0, 0x56, /* .(.....V */ +0x4b, 0x8c, 0xba, 0xe5, 0xa9, 0x13, 0x5d, 0xbb, /* K.....]. */ +0xd3, 0x53, 0xd6, 0x23, 0x71, 0xe6, 0xfa, 0xe1, /* .S.#q... */ +0x2a, 0xd6, 0x91, 0x98, 0x4a, 0xb8, 0x21, 0x1a, /* *...J.!. */ +0xad, 0xfc, 0x56, 0x35, 0x61, 0x26, 0xe8, 0xad, /* ..V5a&.. */ +0x22, 0x9d, 0xe8, 0x1c, 0x57, 0xe3, 0xd2, 0xbf, /* "...W... */ +0x6a, 0xb6, 0xc3, 0x9e, 0x7d, 0xe7, 0x18, 0xca, /* j...}... */ +0x63, 0xf8, 0x4b, 0xeb, 0x74, 0x48, 0x49, 0xb6, /* c.K.tHI. */ +0x2e, 0x6d, 0x98, 0x1f, 0x48, 0x77, 0xa0, 0x59, /* .m..Hw.Y */ +0xae, 0xcd, 0xc9, 0xd1, 0xe0, 0x2e, 0x03, 0xa0, /* ........ */ +0xb9, 0x0f, 0x5d, 0xea, 0x88, 0x6b, 0x5a, 0x6a, /* ..]..kZj */ +0xac, 0x77, 0x2e, 0xac, 0xb6, 0x8e, 0x1f, 0xa3, /* .w...... */ +0xc3, 0x44, 0x55, 0xd3, 0x85, 0x18, 0x56, 0x29, /* .DU...V) */ +0x41, 0xf6, 0x9f, 0x59, 0xba, 0x7f, 0x58, 0xda, /* A..Y..X. */ +0x03, 0x6d, 0x57, 0xb2, 0x49, 0xf4, 0x1b, 0x95, /* .mW.I... */ +0x76, 0x4a, 0x94, 0x29, 0xd9, 0x81, 0x16, 0x99, /* vJ.).... */ +0xa2, 0xa4, 0xbc, 0x17, 0x2c, 0xe5, 0xbb, 0x6d, /* ....,..m */ +0xdf, 0xfc, 0x79, 0xf8, 0xa4, 0x28, 0xad, 0xe3, /* ..y..(.. */ +0xbc, 0xb9, 0xb8, 0x6d, 0x8c, 0xb9, 0x72, 0x42, /* ...m..rB */ +0xc4, 0xb0, 0x37, 0x55, 0x2c, 0x75, 0x0d, 0xa5, /* ..7U,u.. */ +0xc6, 0x78, 0x35, 0x79, 0xf4, 0x74, 0x1d, 0x26, /* .x5y.t.& */ +0x23, 0x9e, 0x76, 0x3b, 0xd2, 0x6b, 0xff, 0x7b, /* #.v;.k.{ */ +0xe1, 0x29, 0x7a, 0xb8, 0x79, 0x49, 0x48, 0x33, /* .)z.yIH3 */ +0xf0, 0xb4, 0x29, 0xaf, 0x2f, 0x7d, 0xbc, 0x26, /* ..)./}.& */ +0x52, 0xff, 0xae, 0x91, 0x7b, 0x12, 0x59, 0xa1, /* R...{.Y. */ +0xa2, 0x56, 0x0c, 0x3e, 0x57, 0x57, 0x98, 0x8c, /* .V.>WW.. */ +0xa7, 0x6f, 0x7f, 0x4c, 0x5d, 0xd3, 0x36, 0x8b, /* .o.L].6. */ +0xbc, 0x65, 0x61, 0xbb, 0x34, 0x7b, 0xcd, 0x59, /* .ea.4{.Y */ +0xfe, 0xba, 0x16, 0x9d, 0xff, 0x08, 0x7a, 0x5b, /* ......z[ */ +0xd5, 0x3e, 0x7d, 0x49, 0x11, 0x8f, 0x88, 0x36, /* .>}I...6 */ +0x16, 0x41, 0x79, 0xef, 0x73, 0x9f, 0x2d, 0x42, /* .Ay.s.-B */ +0xcf, 0x1f, 0x5e, 0xeb, 0xa9, 0x8a, 0x15, 0x06, /* ..^..... */ +0xa2, 0x8e, 0x5a, 0x42, 0xa5, 0x30, 0xb4, 0xe5, /* ..ZB.0.. */ +0x56, 0xe1, 0x87, 0x1f, 0x55, 0xa1, 0x35, 0x6a, /* V...U.5j */ +0xe7, 0xae, 0x1d, 0x6d, 0x45, 0xde, 0x7f, 0x8a, /* ...mE... */ +0x81, 0x8b, 0xf8, 0x63, 0x8e, 0xa9, 0x9c, 0x11, /* ...c.... */ +0x10, 0x23, 0xad, 0xc0, 0x7e, 0x6c, 0xd8, 0xb1, /* .#..~l.. */ +0x6f, 0x5d, 0x6d, 0xaa, 0x5b, 0x30, 0x5e, 0x3e, /* o]m.[0^> */ +0x0a, 0x14, 0x7d, 0xc2, 0x63, 0x8f, 0xee, 0xd8, /* ..}.c... */ +0x98, 0x44, 0x28, 0x86, 0x9f, 0x26, 0xfe, 0xa8, /* .D(..&.. */ +0xc5, 0x14, 0x8f, 0xdc, 0x0f, 0x2a, 0x84, 0x3c, /* .....*.< */ +0xd4, 0x7c, 0xec, 0x76, 0x09, 0x96, 0x8d, 0x0d, /* .|.v.... */ +0x15, 0x58, 0xdb, 0x07, 0x4e, 0x9d, 0xff, 0xdc, /* .X..N... */ +0x48, 0x81, 0xb0, 0x13, 0xc3, 0xf9, 0x00, 0xf7, /* H....... */ +0x26, 0x1d, 0x6e, 0xaa, 0xf4, 0x12, 0xe0, 0x27, /* &.n....' */ +0x67, 0x27, 0x6d, 0x7a, 0xd9, 0xde, 0x09, 0xe3, /* g'mz.... */ +0xdd, 0x2f, 0xc5, 0x77, 0x0d, 0x67, 0x85, 0x3a, /* ./.w.g.: */ +0x91, 0xbc, 0xf4, 0x88, 0x2e, 0xd3, 0xab, 0x44, /* .......D */ +0x54, 0x1b, 0xbe, 0xdf, 0x4d, 0x51, 0xa4, 0x83, /* T...MQ.. */ +0xe3, 0x23, 0xba, 0x94, 0x66, 0x99, 0x4b, 0xb3, /* .#..f.K. */ +0xe6, 0x36, 0xb7, 0x37, 0x2e, 0xfc, 0x42, 0x2c, /* .6.7..B, */ +0x8c, 0xf7, 0x71, 0x2e, 0x79, 0xf8, 0xa8, 0x88, /* ..q.y... */ +0xcc, 0x7e, 0x80, 0x15, 0x8f, 0xf1, 0x50, 0x97, /* .~....P. */ +0xcb, 0xce, 0xe0, 0x97, 0xae, 0x42, 0x67, 0xc2, /* .....Bg. */ +0x99, 0x56, 0x47, 0x26, 0xf1, 0xeb, 0xb8, 0x45, /* .VG&...E */ +0xc9, 0xf6, 0x32, 0x86, 0x3e, 0x4d, 0x7e, 0x77, /* ..2.>M~w */ +0x93, 0x18, 0x2e, 0xa2, 0xed, 0xf4, 0x69, 0x6b, /* ......ik */ +0x57, 0x11, 0xa0, 0x9d, 0x22, 0x91, 0x31, 0xbe, /* W...".1. */ +0xfc, 0x05, 0x70, 0xed, 0x5f, 0xd7, 0xa4, 0x37, /* ..p._..7 */ +0x4c, 0x0b, 0xa6, 0xc6, 0x38, 0xa7, 0x11, 0x1c, /* L...8... */ +0x56, 0xbb, 0xdd, 0x7d, 0xa4, 0x03, 0x41, 0xc6, /* V..}..A. */ +0xe5, 0x81, 0x52, 0x91, 0xb8, 0xdb, 0xc2, 0x72, /* ..R....r */ +0x58, 0x45, 0x00, 0x29, 0xc7, 0x34, 0x33, 0x27, /* XE.).43' */ +0x25, 0x4f, 0x79, 0x0c, 0x73, 0xb1, 0xba, 0x50, /* %Oy.s..P */ +0x29, 0xf9, 0x90, 0x8b, 0xe8, 0xe5, 0x71, 0xf4, /* ).....q. */ +0x28, 0x34, 0x0c, 0xb4, 0x6a, 0x1b, 0x54, 0xc3, /* (4..j.T. */ +0xad, 0x6a, 0x30, 0x58, 0xb8, 0xba, 0x3e, 0x6c, /* .j0X..>l */ +0x88, 0xc5, 0xf5, 0x85, 0x46, 0x6a, 0x4f, 0x75, /* ....FjOu */ +0x6c, 0x29, 0xf2, 0x20, 0x29, 0xf3, 0xf4, 0xd0, /* l). )... */ +0x93, 0x57, 0x2f, 0x93, 0xe6, 0x8f, 0x7b, 0x17, /* .W/...{. */ +0x3f, 0x5a, 0xca, 0x75, 0x07, 0xa6, 0x78, 0x82, /* ?Z.u..x. */ +0x11, 0xbc, 0x02, 0xe4, 0x7f, 0x33, 0xce, 0x37, /* .....3.7 */ +0x9d, 0x29, 0x38, 0xa5, 0x99, 0x75, 0x23, 0x0d, /* .)8..u#. */ +0x4f, 0x6e, 0x34, 0x90, 0x8d, 0xd1, 0xde, 0xd7, /* On4..... */ +0x45, 0x3e, 0x5c, 0x84, 0xaa, 0xb5, 0x43, 0x86, /* E>\...C. */ +0xa0, 0x38, 0x04, 0x77, 0xcd, 0xee, 0x65, 0x98, /* .8.w..e. */ +0xaf, 0x91, 0x91, 0xf4, 0x6d, 0x84, 0xae, 0x5c, /* ....m..\ */ +0xe2, 0x14, 0xed, 0x89, 0x92, 0xbf, 0x21, 0x4e, /* ......!N */ +0xbb, 0xe0, 0x72, 0x37, 0x77, 0xf7, 0x76, 0x57, /* ..r7w.vW */ +0x73, 0xca, 0x5c, 0x65, 0x0f, 0x11, 0x6e, 0xe4, /* s.\e..n. */ +0x93, 0x53, 0x7d, 0x1e, 0x03, 0x13, 0xc7, 0x84, /* .S}..... */ +0x3c, 0xe8, 0x6a, 0xa2, 0x5f, 0xb8, 0xd4, 0x2d, /* <.j._..- */ +0x7f, 0xe5, 0xd2, 0xb6, 0xbd, 0xb0, 0x7c, 0xf4, /* ......|. */ +0x0b, 0xe0, 0xf6, 0xc8, 0x13, 0x71, 0xa0, 0x1e, /* .....q.. */ +0xef, 0x24, 0x88, 0x1e, 0xdc, 0x37, 0x57, 0xe1, /* .$...7W. */ +0xc6, 0x23, 0xea, 0x89, 0xc8, 0x5c, 0x09, 0x7c, /* .#...\.| */ +0x40, 0xd8, 0x57, 0x7a, 0x5b, 0x94, 0x53, 0xea, /* @.Wz[.S. */ +0xdf, 0x38, 0x52, 0x73, 0xf3, 0xfc, 0xa0, 0x39, /* .8Rs...9 */ +0xcc, 0xf6, 0xfb, 0x31, 0x89, 0x7b, 0x20, 0xc9, /* ...1.{ . */ +0x6a, 0xf5, 0xba, 0x8a, 0x67, 0xab, 0xc4, 0xad, /* j...g... */ +0x88, 0x29, 0x3b, 0xd5, 0x4b, 0xb6, 0x91, 0x5f, /* .);.K.._ */ +0x51, 0x62, 0xf2, 0x8d, 0xa0, 0x60, 0x3d, 0x4a, /* Qb...`=J */ +0x4b, 0x03, 0x16, 0x00, 0x77, 0x55, 0x2a, 0x1e, /* K...wU*. */ +0xde, 0x16, 0x0d, 0x18, 0x18, 0xc5, 0x1c, 0x27, /* .......' */ +0x6c, 0x5c, 0xf0, 0x7e, 0x72, 0x51, 0xed, 0x86, /* l\.~rQ.. */ +0xcf, 0xf2, 0xfc, 0x65, 0x1e, 0xcf, 0x6f, 0x7b, /* ...e..o{ */ +0xe7, 0x1f, 0xcc, 0x15, 0x5d, 0xb8, 0x93, 0x52, /* ....]..R */ +0x87, 0x5c, 0xc4, 0xba, 0x6b, 0xb5, 0xdc, 0xfa, /* .\..k... */ +0xd9, 0xf1, 0x8c, 0x36, 0x41, 0x3a, 0x66, 0x93, /* ...6A:f. */ +0x3a, 0xdd, 0xf8, 0x6d, 0x77, 0x59, 0xb8, 0x0b, /* :..mwY.. */ +0x19, 0x06, 0x1e, 0x79, 0x76, 0xfa, 0xab, 0x25, /* ...yv..% */ +0xbb, 0xf6, 0x78, 0x7f, 0x79, 0x2c, 0x68, 0xb0, /* ..x.y,h. */ +0x96, 0x93, 0xcb, 0xaf, 0x3b, 0x93, 0xd6, 0x6f, /* ....;..o */ +0xe8, 0x72, 0x00, 0x32, 0xf3, 0x2b, 0xe7, 0x15, /* .r.2.+.. */ +0x1c, 0x44, 0xbf, 0xfa, 0x9d, 0xc7, 0xb0, 0x32, /* .D.....2 */ +0x29, 0x3b, 0x4e, 0x27, 0xfe, 0x51, 0x30, 0x28, /* );N'.Q0( */ +0x6b, 0x4b, 0x91, 0x42, 0x49, 0x11, 0x80, 0x6b, /* kK.BI..k */ +0x75, 0x05, 0x42, 0x25, 0x6f, 0x18, 0x77, 0x66, /* u.B%o.wf */ +0x0b, 0xf6, 0x9e, 0xf6, 0xcc, 0xed, 0xfe, 0x62, /* .......b */ +0x0a, 0x37, 0x85, 0x9f, 0x5d, 0xe4, 0xf5, 0xc1, /* .7..]... */ +0x84, 0xa6, 0xb3, 0x5d, 0x90, 0xdb, 0x05, 0x9a, /* ...].... */ +0xa3, 0x33, 0x9e, 0x9d, 0x13, 0xc6, 0x0e, 0xe6, /* .3...... */ +0x3c, 0x40, 0x1d, 0x44, 0x43, 0x72, 0xa9, 0x40, /* <@.DCr.@ */ +0x71, 0x4b, 0x2a, 0xe8, 0x4e, 0x0c, 0xba, 0x77, /* qK*.N..w */ +0x9b, 0xa8, 0xd7, 0x98, 0xc2, 0x33, 0xba, 0x7c, /* .....3.| */ +0xa5, 0xbe, 0x86, 0x4b, 0x9e, 0x64, 0x60, 0x87, /* ...K.d`. */ +0x3a, 0x5f, 0x8e, 0xc0, 0x8b, 0xf2, 0xd0, 0x2d, /* :_.....- */ +0x75, 0xf5, 0xe5, 0xac, 0x0c, 0x46, 0xfc, 0x8a, /* u....F.. */ +0xe8, 0x1e, 0xac, 0xdb, 0xd2, 0x8e, 0x9d, 0xff, /* ........ */ +0x12, 0xbd, 0x87, 0x3a, 0x45, 0x07, 0x3c, 0xf2, /* ...:E.<. */ +0x38, 0xd0, 0x20, 0x29, 0x33, 0x05, 0x92, 0x64, /* 8. )3..d */ +0x50, 0x02, 0x35, 0xcf, 0x48, 0x08, 0x9a, 0x4f, /* P.5.H..O */ +0xf2, 0xb4, 0xb3, 0x44, 0xb8, 0xcf, 0x56, 0x7c, /* ...D..V| */ +0xb6, 0x93, 0x01, 0xcb, 0x44, 0xc8, 0x51, 0x8d, /* ....D.Q. */ +0x28, 0x03, 0x72, 0x06, 0x32, 0xc7, 0x19, 0xe8, /* (.r.2... */ +0xa0, 0x7a, 0x6e, 0x20, 0xbe, 0x96, 0x92, 0xd5, /* .zn .... */ +0x41, 0x56, 0x8e, 0x30, 0xdf, 0x22, 0x1f, 0xeb, /* AV.0.".. */ +0xf6, 0x5b, 0x76, 0x22, 0x1e, 0x0c, 0x77, 0x05, /* .[v"..w. */ +0x62, 0xb4, 0x70, 0x92, 0x97, 0xd6, 0xf9, 0xa8, /* b.p..... */ +0x71, 0x44, 0xa6, 0xa4, 0x0f, 0xac, 0x06, 0x2a, /* qD.....* */ +0xf3, 0x45, 0x11, 0x08, 0x88, 0xd3, 0x40, 0x7a, /* .E....@z */ +0x43, 0x15, 0x38, 0x2a, 0x95, 0xab, 0x35, 0x94, /* C.8*..5. */ +0x21, 0x7a, 0xa8, 0xe4, 0x70, 0x3e, 0x6f, 0xaa, /* !z..p>o. */ +0x4c, 0x66, 0xad, 0x2c, 0xc8, 0x94, 0x86, 0xeb, /* Lf.,.... */ +0xc0, 0x4e, 0x7c, 0x79, 0x5c, 0x3a, 0x33, 0x64, /* .N|y\:3d */ +0x14, 0xc7 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt18[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xd2, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x36, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +6...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xe6, 0x11, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x10, /* .....FP. */ +0xff, 0xff, 0xe6, 0x3d, 0x00, 0x00, 0x10, 0x5c, /* ...=...\ */ +0xb3, 0x88, 0x07, 0xfb, 0x38, 0x31, 0xbc, 0x7e, /* ....81.~ */ +0x9f, 0x3a, 0x50, 0x15, 0xa4, 0x74, 0x03, 0x07, /* .:P..t.. */ +0x21, 0xa9, 0x03, 0xcb, 0x4b, 0xe4, 0x07, 0xff, /* !...K... */ +0x9d, 0x89, 0x95, 0xb2, 0x37, 0x85, 0x6a, 0x43, /* ....7.jC */ +0xc7, 0x52, 0x41, 0xe2, 0x3c, 0xed, 0x78, 0x06, /* .RA.<.x. */ +0x96, 0x3f, 0x03, 0x87, 0xd4, 0xc6, 0x0a, 0x96, /* .?...... */ +0x5e, 0x42, 0xec, 0x05, 0xd7, 0xc8, 0x76, 0xbb, /* ^B....v. */ +0xb9, 0x07, 0x0a, 0xc6, 0x7e, 0x6d, 0xe8, 0x35, /* ....~m.5 */ +0x9f, 0xd5, 0x4d, 0x80, 0x61, 0x0a, 0xc5, 0x3e, /* ..M.a..> */ +0xb4, 0x41, 0x8a, 0x65, 0x17, 0xcf, 0xd6, 0x5e, /* .A.e...^ */ +0x32, 0x7e, 0xfd, 0x03, 0x2e, 0x90, 0x36, 0xff, /* 2~....6. */ +0x2c, 0xf5, 0xb6, 0xa7, 0x13, 0x46, 0x10, 0x59, /* ,....F.Y */ +0x4b, 0x03, 0xf8, 0x0d, 0x74, 0xe7, 0x8e, 0x12, /* K...t... */ +0x00, 0x2d, 0xa5, 0xc1, 0x0b, 0xef, 0x94, 0x62, /* .-.....b */ +0x1b, 0x5a, 0x44, 0x2f, 0xbb, 0xb4, 0x89, 0xce, /* .ZD/.... */ +0xc1, 0xcb, 0xb1, 0x8e, 0x74, 0xdf, 0xc8, 0x9b, /* ....t... */ +0x68, 0xdf, 0xda, 0x88, 0x6c, 0x6e, 0x48, 0x68, /* h...lnHh */ +0xe9, 0x82, 0xcb, 0x61, 0xde, 0xa5, 0xb4, 0xa0, /* ...a.... */ +0x06, 0xb8, 0x43, 0x9d, 0x3e, 0xdd, 0x5d, 0x50, /* ..C.>.]P */ +0x51, 0xed, 0x1a, 0xb9, 0x01, 0xba, 0x66, 0xd1, /* Q.....f. */ +0x88, 0x98, 0xca, 0x0f, 0xc1, 0x75, 0xd6, 0x06, /* .....u.. */ +0x35, 0x3d, 0x3c, 0x83, 0x41, 0x4b, 0xe7, 0x25, /* 5=<.AK.% */ +0xdb, 0x64, 0xd6, 0xee, 0x85, 0xc3, 0x66, 0x83, /* .d....f. */ +0xec, 0x4d, 0xdd, 0x07, 0x3d, 0x13, 0xd1, 0x34, /* .M..=..4 */ +0x7f, 0x2c, 0x16, 0x7e, 0xed, 0x3e, 0xea, 0x88, /* .,.~.>.. */ +0x3b, 0x5e, 0x1d, 0x72, 0x97, 0x1f, 0x61, 0x8a, /* ;^.r..a. */ +0x55, 0xc4, 0xb7, 0x12, 0x01, 0x14, 0x90, 0xbf, /* U....... */ +0x42, 0x5d, 0x0b, 0x27, 0x0b, 0x53, 0x45, 0x12, /* B].'.SE. */ +0x69, 0x49, 0x6e, 0xf0, 0x36, 0xae, 0x7c, 0xd0, /* iIn.6.|. */ +0x3b, 0xee, 0xa9, 0xb5, 0xc3, 0x90, 0xf6, 0x7c, /* ;......| */ +0xd8, 0x5a, 0x8f, 0xe1, 0x30, 0xde, 0x0c, 0x79, /* .Z..0..y */ +0x21, 0x99, 0x63, 0x49, 0x64, 0xdd, 0xb3, 0xca, /* !.cId... */ +0x58, 0x35, 0x32, 0x0d, 0xd1, 0x21, 0x2d, 0x8c, /* X52..!-. */ +0xaa, 0xf4, 0x6a, 0x04, 0x81, 0x7b, 0x00, 0x2d, /* ..j..{.- */ +0xa4, 0x23, 0xcd, 0x86, 0x64, 0x2f, 0xe1, 0x38, /* .#..d/.8 */ +0xbb, 0x30, 0x18, 0x3b, 0x0f, 0x97, 0xc9, 0xfa, /* .0.;.... */ +0x8f, 0xd1, 0x2f, 0xa2, 0xdc, 0xb3, 0x7b, 0x13, /* ../...{. */ +0x7a, 0xd2, 0x1b, 0xd0, 0x7f, 0x4a, 0xd1, 0xc9, /* z....J.. */ +0x55, 0xb9, 0xbd, 0xd7, 0x3b, 0xfd, 0xc4, 0xf9, /* U...;... */ +0x4e, 0xd8, 0x6b, 0x65, 0xf5, 0x20, 0x0f, 0x84, /* N.ke. .. */ +0xe5, 0xef, 0xa1, 0x49, 0x33, 0x22, 0xa6, 0x5f, /* ...I3"._ */ +0xe8, 0xdf, 0x11, 0x61, 0x64, 0x85, 0x2c, 0x25, /* ...ad.,% */ +0x9f, 0x80, 0xfd, 0x3d, 0x2e, 0x5b, 0x7a, 0xc7, /* ...=.[z. */ +0xb9, 0xbc, 0x60, 0x63, 0xa3, 0x24, 0x0b, 0x31, /* ..`c.$.1 */ +0x91, 0xa4, 0x54, 0x0c, 0xc2, 0x92, 0x8a, 0xdb, /* ..T..... */ +0xf8, 0xfa, 0x7a, 0x6b, 0x33, 0x98, 0x88, 0x69, /* ..zk3..i */ +0x6d, 0xe3, 0x16, 0x7e, 0xbe, 0x0f, 0x4f, 0x30, /* m..~..O0 */ +0x60, 0xf8, 0x4b, 0x6e, 0xe8, 0xc3, 0x81, 0xce, /* `.Kn.... */ +0x88, 0xfc, 0xd6, 0x21, 0xa6, 0xf4, 0xf0, 0xd4, /* ...!.... */ +0xaa, 0x6f, 0x20, 0xda, 0xb9, 0x2e, 0x36, 0xfb, /* .o ...6. */ +0xe4, 0x7a, 0x48, 0xae, 0x36, 0x4f, 0x4c, 0x9c, /* .zH.6OL. */ +0xba, 0x01, 0x74, 0x57, 0x35, 0x40, 0xc3, 0x3e, /* ..tW5@.> */ +0xf2, 0x62, 0x2e, 0xe5, 0x7a, 0xea, 0xa9, 0x30, /* .b..z..0 */ +0x6d, 0x72, 0x6a, 0x6a, 0x2a, 0xac, 0xea, 0x4d, /* mrjj*..M */ +0xdb, 0xf9, 0x8f, 0x3a, 0xa0, 0x67, 0xd5, 0x88, /* ...:.g.. */ +0x6f, 0x1d, 0xa6, 0xf2, 0x44, 0xf8, 0x8e, 0xb4, /* o...D... */ +0xdd, 0x9f, 0xbc, 0xc5, 0xdb, 0x0d, 0xea, 0xfb, /* ........ */ +0xbc, 0x7c, 0xb7, 0x5a, 0x11, 0x55, 0x16, 0x34, /* .|.Z.U.4 */ +0xb4, 0xf4, 0x78, 0x70, 0xb4, 0xaf, 0x73, 0x5a, /* ..xp..sZ */ +0x18, 0x70, 0x21, 0xde, 0x7a, 0xf6, 0x34, 0x03, /* .p!.z.4. */ +0x33, 0x76, 0x67, 0xc0, 0xc7, 0xec, 0x5a, 0x12, /* 3vg...Z. */ +0xcc, 0x5e, 0xde, 0x82, 0xaa, 0xf3, 0x4b, 0xb5, /* .^....K. */ +0x13, 0xf1, 0x24, 0xde, 0x39, 0x9d, 0x88, 0xbe, /* ..$.9... */ +0xe3, 0x5e, 0xe1, 0x60, 0xe4, 0x18, 0x09, 0xe0, /* .^.`.... */ +0x28, 0x25, 0x73, 0x38, 0x09, 0x13, 0xd9, 0x8a, /* (%s8.... */ +0xc1, 0x7c, 0xf4, 0xe1, 0xa9, 0x48, 0x0b, 0x94, /* .|...H.. */ +0xb7, 0xa7, 0x81, 0xe1, 0x3f, 0xd1, 0x9a, 0x7e, /* ....?..~ */ +0xcb, 0x48, 0xab, 0xbf, 0x85, 0x5f, 0x8c, 0x51, /* .H..._.Q */ +0xfe, 0xf4, 0xdc, 0x50, 0x76, 0x1d, 0xc1, 0x8c, /* ...Pv... */ +0xf0, 0xdd, 0x84, 0x7f, 0x39, 0xb3, 0x99, 0x51, /* ....9..Q */ +0xe8, 0x3f, 0x3c, 0xf3, 0xa3, 0x0e, 0x6d, 0x62, /* .?<...mb */ +0x0c, 0xc7, 0x86, 0x4d, 0xd2, 0xc2, 0x0b, 0xba, /* ...M.... */ +0x93, 0x85, 0xcd, 0x39, 0x04, 0x29, 0x85, 0x68, /* ...9.).h */ +0x66, 0xd7, 0x84, 0x1c, 0x80, 0x72, 0x2f, 0xc3, /* f....r/. */ +0x49, 0x10, 0x45, 0x28, 0xcf, 0x21, 0x94, 0x29, /* I.E(.!.) */ +0xfb, 0x58, 0xcc, 0xa4, 0x37, 0x01, 0x03, 0xa3, /* .X..7... */ +0x59, 0x1c, 0x51, 0x29, 0xd3, 0x19, 0xd0, 0x0e, /* Y.Q).... */ +0xdf, 0x76, 0x24, 0x74, 0xde, 0xa1, 0xe5, 0xae, /* .v$t.... */ +0xb8, 0x50, 0xdd, 0xb8, 0x7c, 0x0c, 0xba, 0x0f, /* .P..|... */ +0x23, 0xbe, 0x9d, 0x09, 0x91, 0x86, 0x54, 0x74, /* #.....Tt */ +0x09, 0xf5, 0x2a, 0x9b, 0x10, 0x5a, 0x11, 0xff, /* ..*..Z.. */ +0x37, 0xe1, 0x60, 0x50, 0x28, 0x4f, 0xdf, 0x5e, /* 7.`P(O.^ */ +0x5c, 0x53, 0x3d, 0x90, 0x3b, 0xfa, 0x00, 0x09, /* \S=.;... */ +0x06, 0xf3, 0x14, 0x30, 0xb4, 0x67, 0x6b, 0xb4, /* ...0.gk. */ +0x7a, 0xf8, 0x22, 0xa8, 0x93, 0xe3, 0xcf, 0x12, /* z."..... */ +0x2d, 0x70, 0xa2, 0xa2, 0x96, 0xae, 0x11, 0xde, /* -p...... */ +0xb7, 0x0a, 0x82, 0xd7, 0x72, 0x46, 0xce, 0xe5, /* ....rF.. */ +0xfe, 0x2f, 0xac, 0xda, 0x27, 0x1f, 0xc5, 0x1a, /* ./..'... */ +0x78, 0x79, 0x4d, 0x27, 0x4c, 0x07, 0x62, 0xed, /* xyM'L.b. */ +0x18, 0xa6, 0xac, 0xdd, 0xa3, 0xde, 0x15, 0x6c, /* .......l */ +0x9c, 0x98, 0x08, 0x42, 0xf4, 0xc5, 0x26, 0x0f, /* ...B..&. */ +0x45, 0x2c, 0x6c, 0xd6, 0x97, 0x5f, 0xf9, 0x22, /* E,l.._." */ +0xec, 0x98, 0xbc, 0x61, 0xdd, 0xe3, 0x45, 0x37, /* ...a..E7 */ +0xd1, 0xc5, 0x70, 0x1b, 0x0c, 0x45, 0xb3, 0xb8, /* ..p..E.. */ +0x59, 0xf6, 0x89, 0xce, 0xa5, 0x10, 0xed, 0x05, /* Y....... */ +0x30, 0x65, 0xa7, 0x29, 0x30, 0x4d, 0xa3, 0x24, /* 0e.)0M.$ */ +0xd5, 0xb8, 0x76, 0x4e, 0xef, 0xb8, 0x59, 0x07, /* ..vN..Y. */ +0x70, 0xb6, 0xf1, 0x52, 0x8a, 0x08, 0x67, 0xca, /* p..R..g. */ +0x04, 0x05, 0x03, 0x91, 0x51, 0xa1, 0x08, 0x88, /* ....Q... */ +0x98, 0x6c, 0x8c, 0xbe, 0x13, 0xa5, 0xcf, 0xba, /* .l...... */ +0x4d, 0x11, 0x12, 0x84, 0xfd, 0x38, 0xd0, 0xd4, /* M....8.. */ +0xe2, 0x31, 0x1e, 0xa0, 0xf4, 0x33, 0x84, 0x5a, /* .1...3.Z */ +0x06, 0xed, 0xaa, 0x85, 0xc4, 0xb6, 0x6d, 0x26, /* ......m& */ +0x10, 0x24, 0x5e, 0x53, 0x86, 0xd5, 0xc9, 0x9e, /* .$^S.... */ +0xae, 0xb9, 0xec, 0x43, 0x6d, 0x6c, 0xce, 0xe3, /* ...Cml.. */ +0x49, 0x62, 0x66, 0xf9, 0x0e, 0xb8, 0xf9, 0x0f, /* Ibf..... */ +0xd5, 0xac, 0x5b, 0xfc, 0x32, 0xa8, 0xf5, 0x77, /* ..[.2..w */ +0xfc, 0x7a, 0xfa, 0xf2, 0xf5, 0x8f, 0x36, 0x9f, /* .z....6. */ +0x23, 0x50, 0xbb, 0x4a, 0x8e, 0x2f, 0xe0, 0x5b, /* #P.J./.[ */ +0xf7, 0x38, 0xa8, 0xb3, 0x57, 0x03, 0x15, 0xc5, /* .8..W... */ +0x05, 0x24, 0x6b, 0x1d, 0xc7, 0x53, 0x92, 0x33, /* .$k..S.3 */ +0x15, 0x1d, 0x23, 0xb7, 0x4d, 0xf9, 0x95, 0xf3, /* ..#.M... */ +0x33, 0xf0, 0xac, 0xc2, 0x75, 0x51, 0xc0, 0xa6, /* 3...uQ.. */ +0x0a, 0x40, 0x4d, 0x38, 0x19, 0xfd, 0x5a, 0xd4, /* .@M8..Z. */ +0xd7, 0xd6, 0xc1, 0x9d, 0x0d, 0x5b, 0x02, 0x70, /* .....[.p */ +0xf4, 0x61, 0x5c, 0xc6, 0xe8, 0xff, 0xa7, 0x20, /* .a\.... */ +0x04, 0x8b, 0x00, 0xaf, 0x77, 0x38, 0x9e, 0x6c, /* ....w8.l */ +0x8a, 0x69, 0x2c, 0xc5, 0xc2, 0x5f, 0x15, 0xf6, /* .i,.._.. */ +0x8b, 0x42, 0x0b, 0xcd, 0xc1, 0x11, 0x9f, 0x15, /* .B...... */ +0xe3, 0xdf, 0x78, 0x3c, 0x87, 0x88, 0x5c, 0xdb, /* ..x<..\. */ +0xeb, 0x92, 0x14, 0x6e, 0x5f, 0x41, 0x46, 0xce, /* ...n_AF. */ +0x33, 0x87, 0xaa, 0x3b, 0xa9, 0x8a, 0xa0, 0x80, /* 3..;.... */ +0xb3, 0x96, 0x36, 0x53, 0x72, 0x73, 0x35, 0xec, /* ..6Srs5. */ +0x1d, 0xc4, 0xb1, 0x9e, 0x0e, 0x3a, 0x7d, 0xb4, /* .....:}. */ +0x2d, 0xa8, 0xe6, 0x30, 0xd5, 0x58, 0xb3, 0x34, /* -..0.X.4 */ +0x77, 0x4d, 0x9c, 0x15, 0x07, 0x53, 0x1e, 0x19, /* wM...S.. */ +0x9b, 0xa0, 0xb5, 0xf6, 0x5b, 0xba, 0xed, 0x98, /* ....[... */ +0xa8, 0x80, 0x41, 0x24, 0xec, 0xdd, 0x8d, 0xde, /* ..A$.... */ +0xbc, 0xda, 0x6c, 0x9a, 0xee, 0x3b, 0x8d, 0x3c, /* ..l..;.< */ +0x19, 0x26, 0x8a, 0xab, 0xfd, 0x0d, 0x28, 0xe7, /* .&....(. */ +0xbe, 0xe1, 0x0c, 0xa4, 0xa0, 0x0b, 0x24, 0xb2, /* ......$. */ +0x71, 0x28, 0x77, 0x49, 0x2e, 0xef, 0x2e, 0x19, /* q(wI.... */ +0xc7, 0xd6, 0xc7, 0x47, 0xf2, 0x23, 0x6b, 0x5c, /* ...G.#k\ */ +0xc8, 0x84, 0x6d, 0xbd, 0xe9, 0x75, 0xdb, 0x4e, /* ..m..u.N */ +0xdb, 0x42, 0x69, 0x9f, 0x4b, 0x10, 0xd7, 0xec, /* .Bi.K... */ +0x46, 0x9d, 0x26, 0xcb, 0x23, 0x24, 0x83, 0x7c, /* F.&.#$.| */ +0xff, 0x2d, 0xc5, 0xe5, 0x14, 0x40, 0xea, 0x4e, /* .-...@.N */ +0xc9, 0x22, 0x1d, 0xd1, 0xe4, 0x20, 0xc0, 0x1f, /* ."... .. */ +0x6f, 0xa5, 0xc1, 0x25, 0xbf, 0x26, 0x3b, 0xb8, /* o..%.&;. */ +0x6a, 0x1f, 0xc0, 0x29, 0xa1, 0x3c, 0x05, 0x79, /* j..).<.y */ +0xea, 0x22, 0xb4, 0xd3, 0xc2, 0xe8, 0xa8, 0x6d, /* .".....m */ +0x42, 0x29, 0x6a, 0xba, 0xa0, 0x70, 0x3a, 0x6c, /* B)j..p:l */ +0x84, 0xee, 0xcf, 0x35, 0x9b, 0xfe, 0x1c, 0x0c, /* ...5.... */ +0xcc, 0xfe, 0x5c, 0x75, 0x37, 0xd3, 0x2b, 0x78, /* ..\u7.+x */ +0x47, 0x72, 0x3a, 0x12, 0x03, 0xe3, 0xc1, 0xfb, /* Gr:..... */ +0xb3, 0x98, 0x68, 0xca, 0xd6, 0xd6, 0xc0, 0xbb, /* ..h..... */ +0x02, 0xc9, 0x56, 0xec, 0x40, 0x09, 0x48, 0xca, /* ..V.@.H. */ +0xa2, 0x46, 0xfe, 0x6c, 0x86, 0xb9, 0x7a, 0x7c, /* .F.l..z| */ +0xfb, 0x66, 0x4a, 0x4d, 0xe7, 0xed, 0x9e, 0xde, /* .fJM.... */ +0xe9, 0xf8, 0x21, 0x1d, 0xc9, 0x7f, 0xce, 0xe1, /* ..!..... */ +0x7c, 0x7c, 0x94, 0x7c, 0xfb, 0x57, 0x79, 0x9c, /* ||.|.Wy. */ +0x0f, 0xd4, 0xc0, 0x2d, 0x83, 0x7c, 0xf0, 0xed, /* ...-.|.. */ +0x04, 0x72, 0xc5, 0x33, 0x79, 0xc2, 0x47, 0x02, /* .r.3y.G. */ +0x94, 0xda, 0x85, 0xdf, 0x13, 0x4d, 0xf8, 0x10, /* .....M.. */ +0xe0, 0x96, 0x79, 0x44, 0xf0, 0xd2, 0xef, 0x10, /* ..yD.... */ +0xc7, 0xd7, 0xe3, 0xc0, 0xd1, 0x8d, 0xd3, 0x81, /* ........ */ +0xb3, 0xde, 0xeb, 0x04, 0x4a, 0x50, 0x1c, 0xf7, /* ....JP.. */ +0xb3, 0xc2, 0xf5, 0x57, 0x55, 0x41, 0x07, 0x08, /* ...WUA.. */ +0x74, 0x91, 0x15, 0x8c, 0x98, 0xc2, 0x1a, 0xe5, /* t....... */ +0x34, 0xf4, 0x00, 0xea, 0xb9, 0x61, 0xc9, 0xe7, /* 4....a.. */ +0x31, 0x97, 0x31, 0x18, 0x85, 0xab, 0x60, 0x8a, /* 1.1...`. */ +0x28, 0x5f, 0xf3, 0xfd, 0x23, 0x25, 0x11, 0x17, /* (_..#%.. */ +0xe8, 0x9a, 0xec, 0x2b, 0x69, 0xb6, 0x14, 0x39, /* ...+i..9 */ +0x02, 0x63, 0xb7, 0x04, 0x16, 0x48, 0xd5, 0x0f, /* .c...H.. */ +0x8c, 0x75, 0xd1, 0x70, 0x7e, 0x77, 0xf6, 0x7a, /* .u.p~w.z */ +0x13, 0xf5, 0x14, 0x87, 0x20, 0xc5, 0x12, 0x8d, /* .... ... */ +0x69, 0xdb, 0x5b, 0x71, 0xa2, 0x02, 0x8a, 0xd6, /* i.[q.... */ +0x3d, 0x41, 0x90, 0x5a, 0xdd, 0x93, 0x69, 0x19, /* =A.Z..i. */ +0x7f, 0x2d, 0xe6, 0x71, 0xc4, 0x8b, 0xd3, 0xdc, /* .-.q.... */ +0x30, 0x4e, 0x8d, 0x42, 0x12, 0x27, 0x0f, 0x43, /* 0N.B.'.C */ +0xc2, 0x72, 0x21, 0x51, 0xe3, 0x3c, 0xde, 0x63, /* .r!Q.<.c */ +0x42, 0xe0, 0xbd, 0x25, 0x55, 0xf2, 0x1e, 0x66, /* B..%U..f */ +0x8a, 0x0a, 0xb3, 0xaf, 0xc3, 0xf5, 0xfb, 0xcc, /* ........ */ +0x4a, 0x20, 0x77, 0xfe, 0x59, 0x62, 0xf1, 0xe9, /* J w.Yb.. */ +0x6a, 0xba, 0x7d, 0x53, 0xe7, 0x33, 0xe3, 0xb5, /* j.}S.3.. */ +0x48, 0x3d, 0xbc, 0xb3, 0x9c, 0xc1, 0x77, 0xcf, /* H=....w. */ +0xff, 0x04, 0xd4, 0xe3, 0x86, 0x61, 0x2f, 0xc9, /* .....a/. */ +0xa1, 0x71, 0x09, 0xcd, 0x64, 0xe5, 0x43, 0x59, /* .q..d.CY */ +0xb4, 0x0f, 0x4c, 0xd3, 0xa5, 0x1a, 0x0e, 0x81, /* ..L..... */ +0xed, 0xf1, 0xa4, 0xd3, 0x2c, 0xcb, 0x02, 0xfc, /* ....,... */ +0x0f, 0xa7, 0x82, 0xa0, 0xa3, 0xea, 0x23, 0xb6, /* ......#. */ +0xa4, 0x78, 0xc5, 0x68, 0xeb, 0x45, 0x40, 0xab, /* .x.h.E@. */ +0x76, 0x97 /* v. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt19[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xd4, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x34, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +4...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xee, 0x5e, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x10, /* .^...FP. */ +0xff, 0xff, 0x2c, 0x82, 0x00, 0x00, 0xeb, 0x18, /* ..,..... */ +0x04, 0x87, 0x03, 0xc6, 0x8c, 0xb0, 0x78, 0x0a, /* ......x. */ +0xd2, 0x6a, 0xee, 0x03, 0x13, 0x3a, 0x49, 0xb1, /* .j...:I. */ +0x34, 0x07, 0x72, 0x5d, 0x1b, 0x11, 0xda, 0xf6, /* 4.r].... */ +0xd1, 0xe1, 0xe7, 0xff, 0xd8, 0x85, 0xd8, 0xbf, /* ........ */ +0x0a, 0xd1, 0x54, 0x5d, 0xd2, 0x0f, 0x7d, 0x6b, /* ..T]..}k */ +0xd7, 0x08, 0x02, 0xe8, 0x5f, 0x6c, 0x3b, 0x55, /* ...._l;U */ +0x68, 0x91, 0x60, 0xc9, 0x3b, 0xcb, 0x11, 0xbb, /* h.`.;... */ +0x14, 0x66, 0x59, 0x84, 0x24, 0x8c, 0x7e, 0x15, /* .fY.$.~. */ +0x19, 0x58, 0xa2, 0x43, 0x6d, 0xd4, 0x6c, 0xc0, /* .X.Cm.l. */ +0x2d, 0x20, 0xf6, 0x65, 0x8e, 0x18, 0x91, 0x68, /* - .e...h */ +0xad, 0xd8, 0x9b, 0x54, 0xe4, 0x28, 0xca, 0xdf, /* ...T.(.. */ +0xc2, 0xbd, 0x4d, 0xbc, 0xbe, 0xde, 0xc3, 0x4c, /* ..M....L */ +0x6f, 0x6a, 0x20, 0xe6, 0x2c, 0x8d, 0xc0, 0x1d, /* oj .,... */ +0xfc, 0xc5, 0xcf, 0x1f, 0x39, 0x38, 0xd2, 0x24, /* ....98.$ */ +0xff, 0x4d, 0x33, 0xa5, 0xfb, 0x30, 0x59, 0xce, /* .M3..0Y. */ +0xf8, 0x04, 0x37, 0xf3, 0x3f, 0x3e, 0xb8, 0xf1, /* ..7.?>.. */ +0x88, 0x09, 0xbe, 0xef, 0x32, 0x5f, 0x8b, 0x9a, /* ....2_.. */ +0xf7, 0xc3, 0xd4, 0x8a, 0x04, 0x59, 0xbe, 0xeb, /* .....Y.. */ +0x20, 0x52, 0x7c, 0x6b, 0xd6, 0xbb, 0x5d, 0xd4, /* R|k..]. */ +0x6e, 0x9e, 0xdc, 0xba, 0x06, 0xae, 0x2e, 0x38, /* n......8 */ +0x09, 0xc9, 0x36, 0x64, 0xd9, 0x78, 0xc7, 0x84, /* ..6d.x.. */ +0x84, 0x34, 0xb7, 0x89, 0x09, 0x76, 0x7a, 0xf3, /* .4...vz. */ +0xb1, 0xd9, 0x3f, 0x95, 0xe8, 0xb7, 0x7c, 0x7a, /* ..?...|z */ +0xec, 0x1c, 0xdf, 0x39, 0x46, 0x81, 0x42, 0x99, /* ...9F.B. */ +0x4a, 0x84, 0x28, 0x31, 0xa4, 0x4d, 0xd9, 0x12, /* J.(1.M.. */ +0xcb, 0xdb, 0xc2, 0x96, 0xc3, 0x1e, 0x0b, 0x84, /* ........ */ +0xd0, 0x6e, 0xbc, 0x62, 0xc3, 0xcc, 0xd8, 0xd0, /* .n.b.... */ +0xd0, 0x99, 0x8d, 0xf4, 0x62, 0xc2, 0x89, 0xdd, /* ....b... */ +0xfd, 0x58, 0xa0, 0x91, 0xf3, 0x62, 0x7b, 0xe3, /* .X...b{. */ +0x91, 0x5f, 0xad, 0x24, 0x8a, 0xc6, 0xa3, 0x8d, /* ._.$.... */ +0x9a, 0xd8, 0xf8, 0x60, 0x03, 0x90, 0xf0, 0x96, /* ...`.... */ +0x40, 0xc8, 0x25, 0xb2, 0x5b, 0xa5, 0x24, 0x8e, /* @.%.[.$. */ +0xa3, 0x73, 0xde, 0x2c, 0x5e, 0x87, 0xfc, 0x72, /* .s.,^..r */ +0x0b, 0x0c, 0x31, 0xc8, 0xf4, 0x76, 0xa8, 0xba, /* ..1..v.. */ +0x7c, 0x55, 0xb3, 0x2e, 0x3a, 0xfa, 0xea, 0x6b, /* |U..:..k */ +0xb3, 0xff, 0x86, 0xbd, 0x24, 0xd1, 0x97, 0xd9, /* ....$... */ +0x60, 0x57, 0xea, 0xc3, 0x2e, 0xa5, 0x3d, 0x88, /* `W....=. */ +0x8f, 0xe6, 0xaa, 0x50, 0xb4, 0x62, 0xb2, 0x33, /* ...P.b.3 */ +0x85, 0xa4, 0x4d, 0xae, 0x92, 0xea, 0x32, 0x7a, /* ..M...2z */ +0xea, 0x6b, 0xae, 0x5a, 0xba, 0x3c, 0xd7, 0xbf, /* .k.Z.<.. */ +0xd7, 0x67, 0xa4, 0x30, 0x1f, 0x7b, 0x19, 0x89, /* .g.0.{.. */ +0x75, 0x4b, 0xd9, 0x28, 0xee, 0x7b, 0x46, 0xda, /* uK.(.{F. */ +0xcf, 0xb1, 0x3f, 0xf1, 0xbc, 0x40, 0x82, 0x61, /* ..?..@.a */ +0x57, 0x35, 0x33, 0xb7, 0x5e, 0x0e, 0xd7, 0xf4, /* W53.^... */ +0x5f, 0x63, 0xb4, 0x85, 0x2e, 0x35, 0xc1, 0x8e, /* _c...5.. */ +0x31, 0xd8, 0xd8, 0xd1, 0x36, 0x5d, 0x96, 0x72, /* 1...6].r */ +0x7a, 0x62, 0xf3, 0x2c, 0x38, 0x20, 0x01, 0x0e, /* zb.,8 .. */ +0x9f, 0x29, 0x15, 0x3e, 0xea, 0xad, 0x6c, 0x3f, /* .).>..l? */ +0xd2, 0x8f, 0xa4, 0x1a, 0x3d, 0xd8, 0xb2, 0x18, /* ....=... */ +0xcc, 0x76, 0x9f, 0xa7, 0xc7, 0x0f, 0x5f, 0xc1, /* .v...._. */ +0xe2, 0x59, 0xea, 0x10, 0xb3, 0x9f, 0xb5, 0x29, /* .Y.....) */ +0x32, 0xd9, 0x95, 0x00, 0x85, 0x23, 0x3e, 0x5f, /* 2....#>_ */ +0x45, 0xaa, 0x0d, 0xd2, 0xdc, 0x3c, 0xd0, 0x5c, /* E....<.\ */ +0xdc, 0x11, 0x76, 0x9c, 0x33, 0x52, 0x44, 0x5b, /* ..v.3RD[ */ +0xc1, 0x13, 0xda, 0x6e, 0xf5, 0x37, 0xa3, 0x32, /* ...n.7.2 */ +0xcc, 0xcb, 0x38, 0x30, 0xa7, 0xdf, 0x04, 0x63, /* ..80...c */ +0xa2, 0xae, 0x9d, 0x1c, 0x02, 0x95, 0x90, 0x4f, /* .......O */ +0x34, 0x57, 0x22, 0x6f, 0xc7, 0xf9, 0x31, 0x12, /* 4W"o..1. */ +0x34, 0xef, 0x60, 0xf3, 0x90, 0x47, 0x9f, 0xb2, /* 4.`..G.. */ +0x0d, 0xda, 0x2e, 0xd0, 0x3d, 0x6e, 0x01, 0xd5, /* ....=n.. */ +0xad, 0x88, 0x1a, 0x85, 0xe7, 0x8b, 0x7e, 0x71, /* ......~q */ +0x21, 0x45, 0x07, 0x2a, 0x39, 0xdb, 0x38, 0xcf, /* !E.*9.8. */ +0xcd, 0x82, 0x60, 0x04, 0xf7, 0x03, 0xf7, 0xa1, /* ..`..... */ +0x51, 0xbd, 0x1c, 0x5a, 0x7b, 0xd0, 0x18, 0x3f, /* Q..Z{..? */ +0x0a, 0x49, 0xcb, 0x03, 0x68, 0xa9, 0xbd, 0xb5, /* .I..h... */ +0x34, 0x31, 0xdf, 0x2d, 0x1f, 0x43, 0xc4, 0x7e, /* 41.-.C.~ */ +0x6c, 0xc7, 0x67, 0xc9, 0x43, 0x99, 0x89, 0x89, /* l.g.C... */ +0xcc, 0x58, 0xce, 0x15, 0x6d, 0x95, 0x5c, 0x0e, /* .X..m.\. */ +0x52, 0xae, 0x25, 0x20, 0xf3, 0x9b, 0xba, 0xf2, /* R.% .... */ +0x32, 0x5f, 0xf3, 0xe3, 0x6a, 0x97, 0x59, 0x7d, /* 2_..j.Y} */ +0x31, 0x3b, 0x38, 0x37, 0x88, 0xe0, 0xd6, 0x4f, /* 1;87...O */ +0x30, 0x35, 0x2f, 0xc2, 0x8f, 0x03, 0xc2, 0xbf, /* 05/..... */ +0x5b, 0x64, 0xba, 0x7b, 0xa3, 0x54, 0xce, 0x28, /* [d.{.T.( */ +0x41, 0xad, 0x7a, 0x34, 0xcf, 0xf8, 0xe8, 0x25, /* A.z4...% */ +0xe7, 0x3c, 0x23, 0xba, 0x4b, 0xbc, 0x42, 0x15, /* .<#.K.B. */ +0x3f, 0xce, 0x04, 0x7a, 0x2e, 0xdc, 0xb8, 0x61, /* ?..z...a */ +0x24, 0x1a, 0x43, 0x47, 0x33, 0xf5, 0xc4, 0x4a, /* $.CG3..J */ +0xab, 0x2d, 0x4a, 0x6a, 0x38, 0xfa, 0x7d, 0xe6, /* .-Jj8.}. */ +0x4d, 0xb8, 0xf0, 0xb5, 0x3b, 0x6a, 0x66, 0x53, /* M...;jfS */ +0x21, 0x4c, 0x34, 0x04, 0x19, 0xf2, 0xd3, 0x7b, /* !L4....{ */ +0xaf, 0x4d, 0xa6, 0x37, 0x92, 0x27, 0x65, 0x54, /* .M.7.'eT */ +0xdc, 0x8c, 0x9b, 0x28, 0xc7, 0xc4, 0x75, 0x28, /* ...(..u( */ +0x4a, 0x38, 0x6c, 0xec, 0xfd, 0x06, 0x99, 0x74, /* J8l....t */ +0xf5, 0x49, 0x7b, 0x46, 0x69, 0xd6, 0x9b, 0xa4, /* .I{Fi... */ +0x52, 0xff, 0xf3, 0x92, 0x19, 0x7b, 0xbb, 0x30, /* R....{.0 */ +0x58, 0xb3, 0x94, 0x41, 0x09, 0x7a, 0x85, 0xd3, /* X..A.z.. */ +0x84, 0xfc, 0x98, 0x43, 0x04, 0xe2, 0x12, 0x15, /* ...C.... */ +0xd5, 0x25, 0xf7, 0xb7, 0x19, 0x56, 0x25, 0xa0, /* .%...V%. */ +0x2f, 0x8e, 0xb3, 0xf9, 0x06, 0x84, 0xac, 0x90, /* /....... */ +0x0a, 0x12, 0xee, 0xa0, 0x74, 0xb1, 0x5d, 0x29, /* ....t.]) */ +0xac, 0x2a, 0xbb, 0x4a, 0x22, 0x8f, 0x48, 0x12, /* .*.J".H. */ +0x1a, 0xd0, 0x8a, 0x10, 0x95, 0x48, 0xea, 0x5e, /* .....H.^ */ +0xee, 0x4b, 0xc6, 0xb6, 0x35, 0xa5, 0xe6, 0x6c, /* .K..5..l */ +0xaa, 0x88, 0xb5, 0x78, 0x29, 0xc1, 0x97, 0x00, /* ...x)... */ +0xa0, 0x53, 0x54, 0x7b, 0x20, 0x20, 0xce, 0x4c, /* .ST{ .L */ +0xa3, 0x59, 0x04, 0xbd, 0xf9, 0xd5, 0xd4, 0x10, /* .Y...... */ +0xbc, 0x62, 0x85, 0xc1, 0xf1, 0x27, 0x88, 0x93, /* .b...'.. */ +0xd6, 0xc2, 0x03, 0xae, 0xe8, 0x9e, 0xa5, 0x62, /* .......b */ +0xf6, 0x45, 0x34, 0x6d, 0x1e, 0xf0, 0xd1, 0x2d, /* .E4m...- */ +0x86, 0xb2, 0xa4, 0x3c, 0x48, 0x74, 0x26, 0xf1, /* ....... */ +0x2e, 0x13, 0xce, 0x67, 0x9f, 0xe7, 0x29, 0x5e, /* ...g..)^ */ +0xb6, 0x32, 0xfe, 0xd7, 0x9a, 0x86, 0xae, 0x61, /* .2.....a */ +0x9e, 0x33, 0x01, 0x93, 0x0e, 0x97, 0x99, 0x29, /* .3.....) */ +0x47, 0x99, 0x85, 0x70, 0x68, 0x60, 0x8b, 0x3d, /* G..ph`.= */ +0x8d, 0x38, 0x9c, 0x78, 0x98, 0xef, 0xaf, 0x22, /* .8.x..." */ +0x97, 0x01, 0xba, 0x73, 0x15, 0x89, 0x97, 0x5c, /* ...s...\ */ +0xce, 0x92, 0xe5, 0xbd, 0x7b, 0xe6, 0xcd, 0xe6, /* ....{... */ +0xc1, 0x4e, 0x4a, 0x25, 0xe6, 0x88, 0xc0, 0xb7, /* .NJ%.... */ +0xce, 0x0a, 0x92, 0x2b, 0x20, 0x73, 0x7e, 0x67, /* ...+ s~g */ +0xa9, 0x28, 0x13, 0xfb, 0x38, 0x27, 0x7b, 0x87, /* .(..8'{. */ +0xbc, 0xf0, 0xb1, 0x31, 0x07, 0x1d, 0x21, 0x45, /* ...1..!E */ +0x09, 0x01, 0x26, 0x5b, 0x5f, 0x5b, 0x48, 0x7a, /* ..&[_[Hz */ +0x6f, 0xe3, 0xb3, 0x93, 0x6d, 0x57, 0x61, 0xbe, /* o...mWa. */ +0x9d, 0xf8, 0xca, 0xe2, 0x5f, 0x6c, 0x70, 0x8b, /* ...._lp. */ +0xe4, 0x26, 0xb5, 0x1f, 0xaf, 0xff, 0xe0, 0xfe, /* .&...... */ +0x89, 0x2d, 0xe5, 0xd3, 0xd5, 0x44, 0xee, 0x28, /* .-...D.( */ +0x0c, 0xd2, 0x18, 0x16, 0xbd, 0x6d, 0xed, 0xc7, /* .....m.. */ +0x1a, 0x8d, 0x2b, 0x90, 0x3f, 0x1f, 0x5f, 0xa4, /* ..+.?._. */ +0x20, 0x2d, 0xfa, 0x5b, 0xd8, 0x3a, 0x03, 0xa0, /* -.[.:.. */ +0xe9, 0xc9, 0xcd, 0x20, 0xf9, 0xbc, 0xce, 0xb0, /* ... .... */ +0x7b, 0xb9, 0x9a, 0x0b, 0xc1, 0x28, 0x4a, 0xd8, /* {....(J. */ +0xb9, 0xc2, 0xef, 0x2b, 0xed, 0xb7, 0x3b, 0x82, /* ...+..;. */ +0x2f, 0x9d, 0xeb, 0xa2, 0xd2, 0xa2, 0xd3, 0x1a, /* /....... */ +0xfe, 0xe6, 0xa0, 0x63, 0x4b, 0x04, 0x23, 0xda, /* ...cK.#. */ +0xdc, 0x6e, 0xbe, 0x56, 0x2b, 0x9a, 0x19, 0x70, /* .n.V+..p */ +0x6f, 0xc0, 0xb7, 0xf1, 0x9e, 0xe9, 0xe9, 0xc8, /* o....... */ +0xda, 0x27, 0x6a, 0x7e, 0xce, 0xf6, 0xcf, 0x9f, /* .'j~.... */ +0x0d, 0x51, 0x78, 0x6b, 0x21, 0x71, 0x18, 0x43, /* .Qxk!q.C */ +0x3e, 0xdc, 0xbd, 0xfc, 0xe7, 0xba, 0x2d, 0xbe, /* >.....-. */ +0xe1, 0xff, 0x0c, 0x58, 0x81, 0xce, 0x8a, 0x83, /* ...X.... */ +0x51, 0xca, 0x79, 0x4d, 0xa1, 0x76, 0x0e, 0x9b, /* Q.yM.v.. */ +0xcd, 0xc2, 0x88, 0x2d, 0xe5, 0x8f, 0x58, 0x5b, /* ...-..X[ */ +0x7f, 0xf4, 0xce, 0xc3, 0xc5, 0x9d, 0x04, 0xf6, /* ........ */ +0x89, 0x02, 0x36, 0x38, 0x51, 0x36, 0x54, 0x33, /* ..68Q6T3 */ +0x37, 0xb4, 0x0f, 0x9e, 0x47, 0x2c, 0xaf, 0xa9, /* 7...G,.. */ +0xaa, 0xcf, 0x2d, 0x06, 0xfe, 0x3a, 0xb7, 0x88, /* ..-..:.. */ +0xc0, 0xd2, 0x3d, 0x7c, 0x9c, 0x62, 0xc6, 0xb9, /* ..=|.b.. */ +0x17, 0x71, 0x6f, 0x16, 0x6d, 0xca, 0x56, 0x90, /* .qo.m.V. */ +0xfd, 0x34, 0x57, 0xcf, 0xe6, 0x66, 0x2d, 0x1d, /* .4W..f-. */ +0xa6, 0x22, 0x67, 0xa6, 0xa8, 0x92, 0x5a, 0xf2, /* ."g...Z. */ +0x99, 0x9d, 0x34, 0xdb, 0x1c, 0x99, 0x6c, 0x8f, /* ..4...l. */ +0x54, 0xb8, 0xce, 0x77, 0x0a, 0xe8, 0x44, 0xcb, /* T..w..D. */ +0x67, 0xd1, 0x2d, 0xd3, 0xfa, 0x18, 0xe6, 0x29, /* g.-....) */ +0x65, 0xc5, 0x25, 0x9d, 0xf1, 0x00, 0xc5, 0x41, /* e.%....A */ +0xf4, 0xc1, 0x57, 0x35, 0xde, 0xe6, 0x55, 0x48, /* ..W5..UH */ +0xce, 0xc1, 0x56, 0x7f, 0xb4, 0xc0, 0x37, 0x08, /* ..V...7. */ +0x4c, 0x83, 0xb2, 0xcc, 0x9c, 0x15, 0x53, 0xa3, /* L.....S. */ +0x67, 0x1c, 0x17, 0x5d, 0xef, 0xc6, 0x71, 0x50, /* g..]..qP */ +0xd1, 0x76, 0xaf, 0x0a, 0x4e, 0x10, 0x2c, 0x70, /* .v..N.,p */ +0x23, 0x0e, 0x2f, 0xff, 0x72, 0xa5, 0x89, 0x7c, /* #./.r..| */ +0x52, 0xe8, 0xdd, 0xfd, 0x97, 0xa3, 0xca, 0xe9, /* R....... */ +0x2e, 0x05, 0xf5, 0x92, 0xff, 0xa9, 0x56, 0xb6, /* ......V. */ +0x72, 0x7c, 0x0d, 0xd6, 0x30, 0xe4, 0x32, 0x77, /* r|..0.2w */ +0x88, 0xfd, 0x74, 0xe9, 0x72, 0xef, 0x86, 0xb4, /* ..t.r... */ +0x0e, 0xfe, 0xb9, 0x54, 0x14, 0xb5, 0xd8, 0x40, /* ...T...@ */ +0xb7, 0xbf, 0x49, 0xe8, 0xb9, 0x90, 0x29, 0x23, /* ..I...)# */ +0x66, 0x07, 0xf5, 0xe9, 0xc5, 0xee, 0x3a, 0x5f, /* f.....:_ */ +0x47, 0xde, 0x01, 0x33, 0x0a, 0xa5, 0x8c, 0xd4, /* G..3.... */ +0x76, 0x1b, 0x28, 0x81, 0xc0, 0x88, 0x1c, 0xb2, /* v.(..... */ +0x82, 0xbb, 0x21, 0x32, 0xf9, 0x5f, 0x32, 0xd6, /* ..!2._2. */ +0x93, 0x70, 0x12, 0x85, 0x0b, 0x26, 0x74, 0x50, /* .p...&tP */ +0x12, 0xec, 0x43, 0x92, 0x70, 0xc5, 0xee, 0x23, /* ..C.p..# */ +0xc3, 0x87, 0xf3, 0xe9, 0xa1, 0x7e, 0xac, 0x30, /* .....~.0 */ +0x26, 0xe3, 0x9f, 0x79, 0xd9, 0xc1, 0xf9, 0x54, /* &..y...T */ +0x1f, 0x68, 0xf7, 0x6d, 0xa3, 0x6d, 0xdd, 0x0f, /* .h.m.m.. */ +0xe3, 0xca, 0xf5, 0x21, 0xc1, 0xc3, 0x94, 0xce, /* ...!.... */ +0x2c, 0x09, 0x56, 0x62, 0x73, 0x3e, 0xf5, 0xc3, /* ,.Vbs>.. */ +0xce, 0xfe, 0x78, 0x22, 0x2a, 0x1e, 0x30, 0x54, /* ..x"*.0T */ +0xb5, 0x7a, 0xf8, 0xba, 0xf9, 0x77, 0x64, 0x4c, /* .z...wdL */ +0x60, 0x17, 0x18, 0x77, 0xf2, 0x35, 0x9a, 0xc1, /* `..w.5.. */ +0xb0, 0x45, 0xea, 0x35, 0x9e, 0x2c, 0x95, 0xd8, /* .E.5.,.. */ +0x2c, 0xcf, 0xa0, 0xc1, 0x4c, 0xfe, 0x7d, 0x29, /* ,...L.}) */ +0xdc, 0x76, 0x7a, 0xaf, 0x8a, 0xff, 0xb4, 0x35, /* .vz....5 */ +0x7f, 0x87, 0x3d, 0x50, 0x2e, 0x29, 0xfa, 0x53, /* ..=P.).S */ +0x6d, 0xae, 0x23, 0xb9, 0x70, 0xc7, 0x5f, 0x1d, /* m.#.p._. */ +0x7b, 0xe3, 0xe8, 0xd7, 0x32, 0x63, 0x35, 0x9a, /* {...2c5. */ +0xbd, 0x8a, 0xa0, 0xef, 0x8e, 0x60, 0x47, 0x9c, /* .....`G. */ +0xc2, 0x4f, 0xc6, 0xed, 0x09, 0x53, 0xdb, 0x69, /* .O...S.i */ +0x3b, 0x94, 0xb2, 0xad, 0xa5, 0x43, 0x04, 0x4b, /* ;....C.K */ +0x94, 0xb5 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt20[1514] = { +0x02, 0x00, 0x00, 0x70, 0xca, 0x04, 0x5e, 0xe9, /* ...p..^. */ +0x1e, 0xa6, 0x21, 0x64, 0x08, 0x00, 0x45, 0x00, /* ..!d..E. */ +0x05, 0xdc, 0xe7, 0xd6, 0x00, 0x00, 0x33, 0x06, /* ......3. */ +0x2b, 0x32, 0x98, 0xc7, 0x13, 0xa1, 0xc0, 0xa8, /* +2...... */ +0x02, 0x03, 0x00, 0x50, 0xc9, 0xc1, 0xb1, 0x64, /* ...P...d */ +0xf8, 0x71, 0xfa, 0xdf, 0xdf, 0x46, 0x50, 0x10, /* .q...FP. */ +0xff, 0xff, 0xdc, 0xbe, 0x00, 0x00, 0xd6, 0x74, /* .......t */ +0xfa, 0xa6, 0x49, 0x1b, 0xbf, 0x68, 0x24, 0x74, /* ..I..h$t */ +0xfd, 0x96, 0x20, 0x2c, 0xbf, 0x7e, 0x6b, 0x71, /* .. ,.~kq */ +0x7b, 0x61, 0x02, 0x12, 0x4c, 0xc9, 0x71, 0x5d, /* {a..L.q] */ +0x14, 0x71, 0xdf, 0x6a, 0xd0, 0x9b, 0x72, 0x4d, /* .q.j..rM */ +0x8c, 0xaf, 0x91, 0x58, 0xda, 0xf1, 0x77, 0x59, /* ...X..wY */ +0xf4, 0xd9, 0x21, 0xa7, 0xe0, 0xe1, 0x20, 0xe3, /* ..!... . */ +0xc5, 0x47, 0x11, 0x1a, 0x56, 0x32, 0x06, 0x01, /* .G..V2.. */ +0x9a, 0x4c, 0xb8, 0x6b, 0xe9, 0x8c, 0x8d, 0x87, /* .L.k.... */ +0x92, 0x79, 0x4c, 0x37, 0xc3, 0x25, 0xc7, 0xab, /* .yL7.%.. */ +0x58, 0x29, 0x09, 0xcf, 0x63, 0xf3, 0x21, 0x59, /* X)..c.!Y */ +0x16, 0x6d, 0xaa, 0x59, 0x63, 0x80, 0x1a, 0x7f, /* .m.Yc... */ +0x60, 0x04, 0x01, 0x7a, 0xa3, 0x06, 0xcc, 0x36, /* `..z...6 */ +0xc7, 0xa1, 0xa5, 0xe7, 0x6b, 0x90, 0xe2, 0xdc, /* ....k... */ +0xdc, 0x0b, 0x0c, 0xe8, 0xad, 0x5a, 0xa4, 0x88, /* .....Z.. */ +0x26, 0x19, 0x32, 0x67, 0x0a, 0xff, 0xfe, 0x42, /* &.2g...B */ +0xda, 0x9e, 0x60, 0x21, 0xe2, 0xbf, 0x01, 0x6b, /* ..`!...k */ +0x65, 0xac, 0x3d, 0xe0, 0xe5, 0x71, 0x9e, 0x3d, /* e.=..q.= */ +0x60, 0x60, 0xe4, 0xd8, 0x89, 0x84, 0x1b, 0x3f, /* ``.....? */ +0xaa, 0xa2, 0x0a, 0x1e, 0xe5, 0x5a, 0x91, 0x13, /* .....Z.. */ +0xb3, 0x77, 0x3e, 0x5a, 0x87, 0xc3, 0xd9, 0x60, /* .w>Z...` */ +0xa0, 0x0a, 0x8c, 0xcc, 0xd0, 0x59, 0x8a, 0x43, /* .....Y.C */ +0x6f, 0x28, 0x5b, 0x6e, 0xa2, 0x58, 0xdc, 0x23, /* o([n.X.# */ +0xa9, 0x9e, 0x82, 0x76, 0x79, 0xfe, 0xf0, 0x5e, /* ...vy..^ */ +0x94, 0x65, 0x71, 0x83, 0x12, 0xd5, 0xcf, 0xa7, /* .eq..... */ +0x91, 0x33, 0xd4, 0x92, 0x9b, 0x8f, 0x51, 0x45, /* .3....QE */ +0x87, 0xe9, 0xdf, 0xde, 0xaf, 0xba, 0xbd, 0xa4, /* ........ */ +0x46, 0x13, 0x92, 0xd2, 0x9c, 0x80, 0x6b, 0xeb, /* F.....k. */ +0x1f, 0x68, 0x41, 0xa9, 0x51, 0x10, 0x5f, 0xf5, /* .hA.Q._. */ +0x9b, 0xdc, 0x44, 0xf5, 0xf4, 0x44, 0xd4, 0x5a, /* ..D..D.Z */ +0xe2, 0x15, 0xb9, 0x12, 0xf2, 0x17, 0xae, 0x0c, /* ........ */ +0x96, 0x35, 0x20, 0x1e, 0x5c, 0x86, 0xb8, 0x80, /* .5 .\... */ +0x48, 0xe0, 0x51, 0x6b, 0x84, 0x5c, 0x9d, 0x60, /* H.Qk.\.` */ +0x7b, 0x10, 0xe1, 0x0c, 0x73, 0x38, 0x7a, 0x27, /* {...s8z' */ +0x88, 0xbf, 0x1c, 0x96, 0x34, 0xd7, 0x79, 0x80, /* ....4.y. */ +0x10, 0xb3, 0x14, 0x11, 0x3a, 0x4c, 0xba, 0xb6, /* ....:L.. */ +0x31, 0x82, 0xea, 0xa1, 0xb9, 0x33, 0x02, 0x73, /* 1....3.s */ +0x7d, 0x88, 0xdb, 0xe2, 0xfb, 0xf3, 0x2d, 0x2a, /* }.....-* */ +0xd9, 0x5e, 0xf7, 0x6e, 0xac, 0xc2, 0xa0, 0x59, /* .^.n...Y */ +0x64, 0x8e, 0x46, 0x37, 0x0f, 0x6c, 0x7a, 0x52, /* d.F7.lzR */ +0x42, 0x21, 0x03, 0x38, 0x1b, 0xb7, 0xd7, 0x2b, /* B!.8...+ */ +0x2a, 0x88, 0x5a, 0x3c, 0xc8, 0xc4, 0xad, 0x52, /* *.Z<...R */ +0x44, 0xbb, 0x15, 0x1f, 0x0a, 0x46, 0xee, 0x6b, /* D....F.k */ +0xeb, 0xdd, 0xaa, 0x73, 0xc4, 0xbc, 0x0c, 0x10, /* ...s.... */ +0xc2, 0x44, 0x2c, 0x35, 0x61, 0xa5, 0x46, 0x85, /* .D,5a.F. */ +0x79, 0xa8, 0xa0, 0xb3, 0x82, 0x6f, 0x54, 0x2f, /* y....oT/ */ +0x25, 0xd0, 0xae, 0x33, 0x47, 0x9c, 0xae, 0xf6, /* %..3G... */ +0x9f, 0xba, 0x11, 0x78, 0x98, 0x52, 0x3c, 0x74, /* ...x.R nx_packet_append_ptr - received_packet -> nx_packet_prepend_ptr); + + /* Release the packet. */ + nx_packet_release(received_packet); + } + + while(packet_response_sent != NX_TRUE) + { + tx_thread_sleep(1); + } + + /* Receive response data from the server. Loop until all data is received. */ + while (1) + { + + /* Recieve the packet. */ + status = nx_tcp_socket_receive(&client_socket, &received_packet, NX_NO_WAIT); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + packet_received_counter++; + + /* Calculate the data size in current packet. */ + received_data_size += (UINT)(received_packet -> nx_packet_append_ptr - received_packet -> nx_packet_prepend_ptr); + + /* Release the packet. */ + nx_packet_release(received_packet); + } + else + { + break; + } + } + + /* Check the data size and ack number. */ + if ((received_data_size != 17844) || (packet_received_counter != 13)) + { + error_counter++; + } + + test_done = NX_TRUE; +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i = 0; + + /* Print out test information banner. */ + printf("NetX Test: TCP Out Of Order Ack Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the test data. */ + test_initialize(); + + /* Wait for tcp connection. */ + while(tcp_connected != NX_TRUE) + { + tx_thread_sleep(1); + } + + /* Start to send response. */ + while (i < RESPONSE_COUNT) + { + response_packet_inject((UCHAR *)response[i].response_pkt_data, response[i].response_pkt_size); + i++; + + /* Send reaming packet after HTTP client receives first packet. */ + if (i == 5) + { + while(packet_received_counter == 0) + { + tx_thread_sleep(1); + } + } + } + + packet_response_sent = NX_TRUE; + + /* Wait for test done. */ + while (test_done != NX_TRUE) + { + tx_thread_sleep(1); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void test_initialize() +{ + + response[0].response_pkt_data = (char *)&pkt5[0]; + response[0].response_pkt_size = sizeof(pkt5); + + response[1].response_pkt_data = (char *)&pkt6[0]; + response[1].response_pkt_size = sizeof(pkt6); + + response[2].response_pkt_data = (char *)&pkt7[0]; + response[2].response_pkt_size = sizeof(pkt7); + + response[3].response_pkt_data = (char *)&pkt8[0]; + response[3].response_pkt_size = sizeof(pkt8); + + response[4].response_pkt_data = (char *)&pkt9[0]; + response[4].response_pkt_size = sizeof(pkt9); + + response[5].response_pkt_data = (char *)&pkt12[0]; + response[5].response_pkt_size = sizeof(pkt12); + + response[6].response_pkt_data = (char *)&pkt13[0]; + response[6].response_pkt_size = sizeof(pkt13); + + response[7].response_pkt_data = (char *)&pkt14[0]; + response[7].response_pkt_size = sizeof(pkt14); + + response[8].response_pkt_data = (char *)&pkt15[0]; + response[8].response_pkt_size = sizeof(pkt15); + + response[9].response_pkt_data = (char *)&pkt16[0]; + response[9].response_pkt_size = sizeof(pkt16); + + response[10].response_pkt_data = (char *)&pkt17[0]; + response[10].response_pkt_size = sizeof(pkt17); + + response[11].response_pkt_data = (char *)&pkt18[0]; + response[11].response_pkt_size = sizeof(pkt18); + + response[12].response_pkt_data = (char *)&pkt19[0]; + response[12].response_pkt_size = sizeof(pkt19); + + response[13].response_pkt_data = (char *)&pkt20[0]; + response[13].response_pkt_size = sizeof(pkt20); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *header_ptr; +ULONG tcp_header_word_3; + + /* Do not process packets that are not TCP. */ + if ((packet_ptr -> nx_packet_length < 40) || (ip_ptr != &client_ip)) + return NX_TRUE; + + /* Get TCP header. */ + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + tcp_header_word_3 = header_ptr -> nx_tcp_header_word_3; + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check whether it is a SYN packet. */ + if ((tcp_header_word_3 & NX_TCP_CONTROL_MASK) == NX_TCP_SYN_BIT) + { + + /* Update the sequence number. */ + client_socket.nx_tcp_socket_tx_sequence = 4208975480; + + /* SYN packet, inject SYN + ACK. */ + response_packet_inject((UCHAR *)pkt2, sizeof(pkt2)); + } + + return NX_TRUE; +} + +static VOID response_packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&client_pool, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &client_pool, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&client_ip, my_packet); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_order_ack_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Out Of Order Ack Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_out_of_order_packet_max_test.c b/test/regression/netxduo_test/netx_tcp_out_of_order_packet_max_test.c new file mode 100644 index 00000000..3857f355 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_out_of_order_packet_max_test.c @@ -0,0 +1,319 @@ +/* This NetX test concentrates on out of order TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#define DEMO_STACK_SIZE 2048 + +#if defined(NX_TCP_MAX_OUT_OF_ORDER_PACKETS) && !defined(NX_DISABLE_IPV4) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_PACKET *operation_packet; +static CHAR *test_buffer = "ABCDEFGH"; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_order_packet_max_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +ULONG pool_size; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + operation_packet = NX_NULL; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + pool_size = (sizeof(NX_PACKET) + 256) * 16; + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, pool_size); + pointer = pointer + pool_size; + + if (status) + error_counter++; + + /* Create a packet pool. */ + pool_size = (sizeof(NX_PACKET) + 256) * (NX_TCP_MAX_OUT_OF_ORDER_PACKETS + 1); + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pointer, pool_size); + pointer = pointer + pool_size; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet[8]; +UINT i; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Out of Order Packet Max Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup callback function to drop packets. */ + advanced_packet_process_callback = my_packet_process; + + for(i = 0; i < sizeof(my_packet) / sizeof(NX_PACKET *); i++) + { + nx_packet_allocate(&pool_0, &my_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + nx_packet_data_append(my_packet[i], test_buffer + i, 1, &pool_0, NX_WAIT_FOREVER); + + /* Drop the first two packets. */ + if(i < 2) + { + operation_packet = my_packet[i]; + } + + nx_tcp_socket_send(&client_socket, my_packet[i], NX_WAIT_FOREVER); + } + + nx_tcp_socket_disconnect(&client_socket, NX_WAIT_FOREVER); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UCHAR recv_buffer[10]; +ULONG recv_len; +ULONG total_len = 0; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive until no data. */ + while(nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + nx_packet_data_retrieve(packet_ptr, recv_buffer + total_len, &recv_len); + nx_packet_release(packet_ptr); + total_len += recv_len; + } + + nx_tcp_socket_disconnect(&server_socket, NX_WAIT_FOREVER); + + /* Check received data. */ + if(total_len != strlen(test_buffer)) + { + error_counter++; + } + else if(memcmp(test_buffer, recv_buffer, total_len)) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if(packet_ptr == operation_packet) + { + operation_packet = NX_NULL; + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_order_packet_max_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Out of Order Packet Max Test..........................N/A\n"); + test_control_return(2); +} +#endif /* NX_TCP_MAX_OUT_OF_ORDER_PACKETS */ diff --git a/test/regression/netxduo_test/netx_tcp_out_of_order_packet_test.c b/test/regression/netxduo_test/netx_tcp_out_of_order_packet_test.c new file mode 100644 index 00000000..1cb6c2c1 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_out_of_order_packet_test.c @@ -0,0 +1,493 @@ +/* This NetX test concentrates on out of order TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_order_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Out of Order Packet Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_relinquish(); + + /* Loop to repeat things over and over again! */ + thread_0_counter = 0; + while ((thread_0_counter < 2000) && (!error_counter)) + { + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Set the gather flag to instruct the test driver to save the packets and reverse the order. */ + packet_gather = 1; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_suspend(&thread_0); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter) || (thread_0_counter != 2000) || (thread_1_counter != 2000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG sequence_increment = 1; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Supsend thread 0. */ + tx_thread_suspend(&thread_0); + nx_tcp_socket_state_wait(&server_socket, NX_TCP_ESTABLISHED, 2 * NX_IP_PERIODIC_RATE); + tx_thread_resume(&thread_0); + + /* Set all the sequence numbers the way we want them for our test. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00; + client_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00; + client_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00; + server_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00; + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00; + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00; + + /* Loop to create and establish server connections. */ + thread_1_counter = 0; + while ((thread_1_counter < 2000) && (!error_counter)) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + server_socket.nx_tcp_socket_rx_window_last_sent = 0; /* Force an ACK out! */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Set all the sequence numbers the way we want them for our test. */ + if ((server_socket.nx_tcp_socket_rx_sequence < 0xFFFFFF00) && + (server_socket.nx_tcp_socket_rx_sequence > 0x100)) + { + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + client_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + client_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00 + (sequence_increment++ & 0xFF); + } + + /* Resume thread 0. */ + tx_thread_resume(&thread_0); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_order_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Out of Order Packet Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_out_of_window_control_packet_test.c b/test/regression/netxduo_test/netx_tcp_out_of_window_control_packet_test.c new file mode 100644 index 00000000..70a1f6d5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_out_of_window_control_packet_test.c @@ -0,0 +1,334 @@ +/* This NetX test concentrates on processing out of window RST, URG, ACK packet when receive window is zero. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define WINDOW_SIZE 128 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static CHAR send_buff[WINDOW_SIZE]; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG ack_received = 0; +static ULONG urg_received = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static VOID tcp_urgent_data_callback(NX_TCP_SOCKET *socket_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_window_control_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + ack_received = 0; + urg_received = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Out of Window Control Packet Test....................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff, WINDOW_SIZE, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Sleep one second to make sure server has replied ACK. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Setup the TCP packet process function pointer. */ + ip_0.nx_ip_tcp_packet_receive = tcp_packet_receive; + + /* Send out of window URG packet. */ + _nx_tcp_packet_send_control(&client_socket, NX_TCP_URG_BIT, client_socket.nx_tcp_socket_tx_sequence + WINDOW_SIZE, + client_socket.nx_tcp_socket_rx_sequence, 0, 0, NX_NULL); + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure server is still in established state. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send out of window ACK packet. */ + _nx_tcp_packet_send_control(&client_socket, NX_TCP_ACK_BIT, client_socket.nx_tcp_socket_tx_sequence + WINDOW_SIZE, + client_socket.nx_tcp_socket_rx_sequence, 0, 0, NX_NULL); + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure server is still in established state. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send out of window RST packet. */ + _nx_tcp_packet_send_control(&client_socket, NX_TCP_RST_BIT, client_socket.nx_tcp_socket_tx_sequence + WINDOW_SIZE, + client_socket.nx_tcp_socket_rx_sequence, 0, 0, NX_NULL); + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure server is closed. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (error_counter || ack_received || (urg_received != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + tcp_urgent_data_callback, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static VOID tcp_urgent_data_callback(NX_TCP_SOCKET *socket_ptr) +{ + urg_received++; +} + + +static VOID tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; + + /* Get TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + /* Swap word 3. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Whether it is an ACK packet. */ + if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + ack_received++; + } + + /* Swap word 3. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_out_of_window_control_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Out of Window Control Packet Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test.c new file mode 100644 index 00000000..7345ddad --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test.c @@ -0,0 +1,362 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; +NX_PACKET *my_packet23; +char *msg = MSG; +ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 1............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet23, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 37 + Packet 2 contains bytes 38 - 75 + Packet 3 contains bytes 76 - 113 + Packet 4 contains bytes 76 - 85 + packet 23 contains bytes 38 - 113 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 38); + my_packet1 -> nx_packet_length = 38; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[38], 38); + my_packet2 -> nx_packet_length = 38; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[76], 38); + my_packet3 -> nx_packet_length = 38; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[76], 10); + my_packet4 -> nx_packet_length = 10; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 10; + + memcpy(my_packet23 -> nx_packet_prepend_ptr, &msg[38], 76); + my_packet23 -> nx_packet_length = 76; + my_packet23 -> nx_packet_append_ptr = my_packet23 -> nx_packet_prepend_ptr + 76; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the 3rd one. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 38; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Update the seq number and send the 4th one. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 38; + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Restore the Seq number for packet 2. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 23 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + +#ifdef __PRODUCT_NETXDUO__ + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= my_packet23 -> nx_packet_length; +#endif + status += nx_tcp_socket_send(&client_socket, my_packet23, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } + + if(client_socket.nx_tcp_socket_tx_sequence != seq2) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 114) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + +#ifndef NX_DISABLE_PACKET_INFO + /* Check packet pool state. */ + if(pool_0.nx_packet_pool_invalid_releases) + error_counter++; +#endif + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 1.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_10.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_10.c new file mode 100644 index 00000000..8364d98b --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_10.c @@ -0,0 +1,319 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_10_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 10............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 60 - 79 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 20 - 45 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[60], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[20], 26); + my_packet4 -> nx_packet_length = 26; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 26; + + /* Send the 1st one. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the 3rd one. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 20; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Send the 2nd one. */ + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Send the 4th one. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 80) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + server_socket.nx_tcp_socket_rx_sequence = client_socket.nx_tcp_socket_tx_sequence; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_10_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 10............................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_11.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_11.c new file mode 100644 index 00000000..aa0831ad --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_11.c @@ -0,0 +1,335 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_11_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; +CHAR *msg = MSG; +ULONG seq1, seq2; +ULONG bytes_available; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 11............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + + /* Packet 1 contains bytes 60 - 79 + Packet 2 contains bytes 20 - 39 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 0 - 29 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[60], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[0], 30); + my_packet4 -> nx_packet_length = 30; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 30; + + /* Send the 1st one. */ + client_socket.nx_tcp_socket_tx_sequence += 60; + seq1 = client_socket.nx_tcp_socket_tx_sequence; + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&server_socket, &bytes_available); + if (status || (bytes_available != 0)) + error_counter++; + + /* Update the seq number and send the 2th one. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 - 40; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the Seq number for packet 3. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 - 20; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 4. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 - 60; + +#ifdef __PRODUCT_NETXDUO__ + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes = 0; +#endif + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + client_socket.nx_tcp_socket_tx_sequence = seq1 + 20; + + if(status) + { + error_counter++; + } + + if(client_socket.nx_tcp_socket_tx_sequence != seq2) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* let thread0 run, so thread0 can send out out-of-order packets. */ + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 80) + error_counter++; + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_11_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 11............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_12.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_12.c new file mode 100644 index 00000000..26339452 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_12.c @@ -0,0 +1,347 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_12_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 12............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 20 - 39 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 30 - 49 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[30], 20); + my_packet4 -> nx_packet_length = 20; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 20; + + /* To avoid ACK loop. Drop the ACK from client to server. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_server; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Send the 2nd one */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Send the 3rd one */ + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Send the 4th one */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 10; + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } + +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 60) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + server_socket.nx_tcp_socket_rx_sequence = client_socket.nx_tcp_socket_tx_sequence; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check whether server receives an ACK packet in establish state. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) && + (packet_ptr -> nx_packet_length == 20)) + { + nx_packet_release(packet_ptr); + return; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_12_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 12............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_13.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_13.c new file mode 100644 index 00000000..66c22476 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_13.c @@ -0,0 +1,332 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_13_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + NX_PACKET *my_packet5; + char *msg = MSG; + ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 13............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 5 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet5, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 40 - 59 + Packet 3 contains bytes 80 - 99 + packet 4 contains bytes 45 - 79 + packet 5 contains bytes 20 - 44 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[80], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[45], 35); + my_packet4 -> nx_packet_length = 35; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 35; + + memcpy(my_packet5 -> nx_packet_prepend_ptr, &msg[20], 25); + my_packet5 -> nx_packet_length = 25; + my_packet5 -> nx_packet_append_ptr = my_packet5 -> nx_packet_prepend_ptr + 25; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Send the 2nd one */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 20; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Send the 3rd one */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 60; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Send the 4th one */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 25; + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Send the 5th one */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet5, NX_IP_PERIODIC_RATE); + client_socket.nx_tcp_socket_tx_sequence += 55; + + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 100) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_13_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 13............................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_14.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_14.c new file mode 100644 index 00000000..6591bdf5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_14.c @@ -0,0 +1,326 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "11122222333333344444444" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_14_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +char *msg = MSG; +ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 14............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* The full message to send is: 11122222333333344444444 + Packet 1 sends: 111 + Packet 2 sends: 111222223333333 + Packet 3 sends: 22222333333344444444 */ + + status = nx_packet_data_append(my_packet1, &msg[0], 3, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet2, &msg[0], 15, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet3, &msg[3], 20, &pool_0, TX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Store tx_seq before sending packet1. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Store tx_seq after sending packet1. */ + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Sleep 3 seconds to let remote send ACK. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1 to send packet2 with duplicate data. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq2 to send packet3. */ + client_socket.nx_tcp_socket_tx_sequence = seq2; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(2); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != strlen(MSG)) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_14_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 14............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_15.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_15.c new file mode 100644 index 00000000..0556c80f --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_15.c @@ -0,0 +1,350 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "11122222333333344444444555" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_15_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; +NX_PACKET *my_packet5; +char *msg = MSG; +ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 15............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet5, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* The full message to send is: 11122222333333344444444555 + Packet 1 sends: 111 + Packet 2 sends: 555 + Packet 3 sends: 111222223333333 + Packet 4 sends: 4444 + Packet 5 sends: 33444444 + */ + + status = nx_packet_data_append(my_packet1, &msg[0], 3, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet2, &msg[23], 3, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet3, &msg[0], 15, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet4, &msg[19], 4, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet5, &msg[13], 8, &pool_0, TX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Store tx_seq before sending packet1. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Sleep 1 second to let remote send ACK. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1+23 to send packet2 that is out of order. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 23; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1 to send packet3. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1+19 to send packet4 that is out of order. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 19; + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1+13 to send packet5 that is out of order. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 13; + status += nx_tcp_socket_send(&client_socket, my_packet5, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1+26 to fix tx_seq. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 26; + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; +ULONG total_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(2); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while(1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + break; + else + { + status = nx_packet_data_retrieve(packet_ptr, &rcv_buffer[total_length], &recv_length); + total_length += recv_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + tx_thread_relinquish(); + } + + if(total_length != strlen(MSG)) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, total_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_15_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 15............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_16.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_16.c new file mode 100644 index 00000000..feb3a93c --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_16.c @@ -0,0 +1,340 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG_LENGTH 1024 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG long_msg[MSG_LENGTH >> 2]; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_16_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status, i; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 16............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 3000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Init long_msg. */ + for (i = 1; i <= (MSG_LENGTH >> 2); i++) + { + long_msg[i - 1] = i; + } + + /* Fill in the packet with data. */ + /* The full message to send is: 0x0100000002000000......00010000 + Packet 1 sends: 0x0100000002000000......40000000 + Packet 2 sends: 0x0100000002000000......C0000000 + Packet 3 sends: 0x4100000042000000......00010000 */ + + status = nx_packet_data_append(my_packet1, (VOID *)(&long_msg[0]), 0x100, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet2, (VOID *)(&long_msg[0]), 0x300, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet3, (VOID *)(&long_msg[64]), 0x300, &pool_0, TX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Store tx_seq before sending packet1. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Sleep 3 seconds to let remote send ACK. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* Store tx_seq after sending packet1. */ + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Set the tx_seq to seq1 to send packet2 that is duplicated. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq2 to send packet3. */ + client_socket.nx_tcp_socket_tx_sequence = seq2; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[MSG_LENGTH]; +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; +ULONG total_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(2); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2000, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while(1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + break; + else + { + status = nx_packet_data_retrieve(packet_ptr, &rcv_buffer[total_length], &recv_length); + total_length += recv_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(total_length != MSG_LENGTH) + error_counter++; + + if(memcmp(rcv_buffer, (void*)long_msg, total_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_16_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Overlapping Packet Test 16............................N/A\n"); + + test_control_return(3); + +} + +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_17.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_17.c new file mode 100644 index 00000000..82fed792 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_17.c @@ -0,0 +1,341 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define MSG_LENGTH 1024 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG long_msg[MSG_LENGTH >> 2]; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_17_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status, i; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 17............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 3000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Init long_msg. */ + for (i = 1; i <= (MSG_LENGTH >> 2); i++) + { + long_msg[i - 1] = i; + } + + /* Fill in the packet with data. */ + /* The full message to send is: 0x0100000002000000......00010000 + Packet 1 sends: 0x0100000002000000......40000000 + Packet 2 sends: 0xC1000000C2000000......00010000 + Packet 3 sends: 0x0100000002000000......C0000000 */ + + status = nx_packet_data_append(my_packet1, (VOID *)(&long_msg[0]), 0x100, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet2, (VOID *)(&long_msg[192]), 0x100, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet3, (VOID *)(&long_msg[0]), 0x300, &pool_0, TX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Store tx_seq before sending packet1. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Sleep 3 seconds to let remote send ACK. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1+0x300 to send packet2 that is out of order. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 0x300; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1 to send packet3. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq1+0x0400 to fix tx_seq. */ + client_socket.nx_tcp_socket_tx_sequence = seq1 + 0x0400; + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[MSG_LENGTH]; +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; +ULONG total_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(2); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2000, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while(1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + break; + else + { + status = nx_packet_data_retrieve(packet_ptr, &rcv_buffer[total_length], &recv_length); + total_length += recv_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(total_length != MSG_LENGTH) + error_counter++; + + if(memcmp(rcv_buffer, (void*)long_msg, total_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_17_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Overlapping Packet Test 17............................N/A\n"); + + test_control_return(3); + +} + +#endif + diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_18.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_18.c new file mode 100644 index 00000000..04be4126 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_18.c @@ -0,0 +1,334 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "11122222333333344444444" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_18_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +char *msg = MSG; +ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 18............................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* The full message to send is: 11122222333333344444444 + Packet 1 sends: 111 + Packet 2 sends: 111222223333333 + Packet 3 sends: 22222333333344444444 */ + + status = nx_packet_data_append(my_packet1, &msg[0], 3, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet2, &msg[0], 15, &pool_0, TX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet3, &msg[3], 20, &pool_0, TX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Store tx_seq before sending packet1. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Store tx_seq after sending packet1. */ + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Set the tx_seq to seq1 to send packet2 with duplicate data. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Set the tx_seq to seq2 to send packet3. */ + client_socket.nx_tcp_socket_tx_sequence = seq2; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + +UINT status, actual_status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; +ULONG total_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, (ULONG *)&actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(2); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while(1) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + break; + else + { + status = nx_packet_data_retrieve(packet_ptr, &rcv_buffer[total_length], &recv_length); + total_length += recv_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(total_length != strlen(MSG)) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, total_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_18_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Overlapping Packet Test 18............................N/A\n"); + + test_control_return(3); + +} + +#endif + diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_2.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_2.c new file mode 100644 index 00000000..0291eb91 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_2.c @@ -0,0 +1,339 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_2_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet23; + char *msg = MSG; + ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 2............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet23, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 37 + Packet 2 contains bytes 38 - 75 + Packet 3 contains bytes 76 - 113 + packet 23 contains bytes 37 - 112 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 38); + my_packet1 -> nx_packet_length = 38; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[38], 38); + my_packet2 -> nx_packet_length = 38; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[76], 38); + my_packet3 -> nx_packet_length = 38; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet23 -> nx_packet_prepend_ptr, &msg[37], 76); + my_packet23 -> nx_packet_length = 76; + my_packet23 -> nx_packet_append_ptr = my_packet23 -> nx_packet_prepend_ptr + 76; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the 3rd one. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 38; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Restore the Seq num for packet 2. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the seq num for packet 23 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + + status += nx_tcp_socket_send(&client_socket, my_packet23, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } + + if(client_socket.nx_tcp_socket_tx_sequence != (seq2)) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 114) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 2.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_3.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_3.c new file mode 100644 index 00000000..a9e3d780 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_3.c @@ -0,0 +1,348 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_3_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet23; + char *msg = MSG; + ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 3............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet23, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 37 + Packet 2 contains bytes 38 - 75 + Packet 3 contains bytes 76 - 113 + packet 23 contains bytes 37 - 113 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 38); + my_packet1 -> nx_packet_length = 38; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[38], 38); + my_packet2 -> nx_packet_length = 38; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[76], 38); + my_packet3 -> nx_packet_length = 38; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 38; + + memcpy(my_packet23 -> nx_packet_prepend_ptr, &msg[37], 77); + my_packet23 -> nx_packet_length = 76; + my_packet23 -> nx_packet_append_ptr = my_packet23 -> nx_packet_prepend_ptr + 76; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the 3rd one. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 38; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Restore the Seq number for packet 2. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 23 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + +#ifdef __PRODUCT_NETXDUO__ + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= my_packet23 -> nx_packet_length; +#endif + status += nx_tcp_socket_send(&client_socket, my_packet23, NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + } + + if(client_socket.nx_tcp_socket_tx_sequence != seq2) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + /* let thread0 run, so thread0 can send out out-of-order packets. */ +#if 0 + tx_thread_relinquish(); +#endif + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if (recv_length != 114) + error_counter++; + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_3_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 3.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_4.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_4.c new file mode 100644 index 00000000..8279c702 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_4.c @@ -0,0 +1,360 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_4_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 4............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 20 - 39 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 20 - 39 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet4 -> nx_packet_length = 20; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 20; + + /* To avoid ACK loop. Drop the ACK from client to server. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_server; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet2 */ + status = nx_tcp_socket_send(&client_socket,my_packet2, NX_IP_PERIODIC_RATE); + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet3 */ + status = nx_tcp_socket_send(&client_socket,my_packet3, NX_IP_PERIODIC_RATE); + + /* Restore the Seq number for packet 4 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + +#ifdef __PRODUCT_NETXDUO__ + if(client_socket.nx_tcp_socket_tx_outstanding_bytes > my_packet4 -> nx_packet_length) + { + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= my_packet4 -> nx_packet_length; + } +#endif + /* Send the packet4 */ + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { +#if 0 + printf("thread_0: tcp_socket_send error, 0x%x\n", status); +#endif + error_counter++; + } + + if(client_socket.nx_tcp_socket_tx_sequence != seq2) + { +#if 0 + printf("thread_0: tcp_tx_seq != seq2 error\n"); +#endif + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 60) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check whether server receives an ACK packet in establish state. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) && + (packet_ptr -> nx_packet_length == 20)) + { + nx_packet_release(packet_ptr); + return; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_4_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 4.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_5.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_5.c new file mode 100644 index 00000000..09fda62c --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_5.c @@ -0,0 +1,348 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_5_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet123; + NX_PACKET *my_packet23; + char *msg = MSG; + ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 5............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create 5 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet123, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet23, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 40 - 59 + Packet 3 contains bytes 80 - 99 + packet 123 contains bytes 20 - 59 + packet 23 contains bytes 60 - 89 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[80], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet123 -> nx_packet_prepend_ptr, &msg[20], 40); + my_packet123 -> nx_packet_length = 40; + my_packet123 -> nx_packet_append_ptr = my_packet123 -> nx_packet_prepend_ptr + 40; + + memcpy(my_packet23 -> nx_packet_prepend_ptr, &msg[60], 30); + my_packet23 -> nx_packet_length = 30; + my_packet23 -> nx_packet_append_ptr = my_packet23 -> nx_packet_prepend_ptr + 30; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the 3rd one. */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 60; + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Restore the Seq number for packet 2. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 20; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 123 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= 20; + status += nx_tcp_socket_send(&client_socket, my_packet123, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 23 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 40; + +#ifdef __PRODUCT_NETXDUO__ + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= 10; +#endif + status += nx_tcp_socket_send(&client_socket, my_packet23, NX_IP_PERIODIC_RATE); + client_socket.nx_tcp_socket_tx_sequence += 10; + + if (status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 100) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_5_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 5.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_6.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_6.c new file mode 100644 index 00000000..db57b018 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_6.c @@ -0,0 +1,328 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_6_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + ULONG seq1, seq2; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 6............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create 4 packets */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if (status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 20 - 39 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 40 - 59 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet4 -> nx_packet_length = 20; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 20; + + /* Send the 1st one */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Send the packet2 */ + status = nx_tcp_socket_send(&client_socket,my_packet2, NX_IP_PERIODIC_RATE); + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the packet3 */ + status = nx_tcp_socket_send(&client_socket,my_packet3, NX_IP_PERIODIC_RATE); + seq2 = client_socket.nx_tcp_socket_tx_sequence; + + /* Restore the Seq num for packet 4 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + +#ifdef __PRODUCT_NETXDUO__ + if(client_socket.nx_tcp_socket_tx_outstanding_bytes > my_packet4 -> nx_packet_length) + { + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= my_packet4 -> nx_packet_length; + } +#endif + + /* Send the packet4 */ + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } + + if(client_socket.nx_tcp_socket_tx_sequence != seq2) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 60) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_6_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 6.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_7.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_7.c new file mode 100644 index 00000000..5d70c601 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_7.c @@ -0,0 +1,328 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "----------abcdefgh20----------ABCDEFGH40----------klmnopqr60----------KLMNOPQR80----------" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ +extern void (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_7_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet1; +NX_PACKET *my_packet2; +NX_PACKET *my_packet3; +NX_PACKET *my_packet4; +NX_PACKET *my_packet0; +char *msg = MSG; +ULONG seq1; +UINT old_threshold; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 7............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 5 packets */ + status = nx_packet_allocate(&pool_0, &my_packet0, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 0 contains bytes 0 - 19 + Packet 1 contains bytes 20 - 39 + Packet 2 contains bytes 40 - 59 + Packet 3 contains bytes 60 - 79 + Packet 4 contains bytes 0 - 19 */ + + memcpy(my_packet0 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet0 -> nx_packet_length = 20; + my_packet0 -> nx_packet_append_ptr = my_packet0 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[60], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet4 -> nx_packet_length = 20; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 20; + + /* Disable thread switch by IP thread. */ + tx_thread_preemption_change(tx_thread_identify(), 0, &old_threshold); + + seq1 = client_socket.nx_tcp_socket_tx_sequence; + + /* Send the my_packet0 */ + status = nx_tcp_socket_send(&client_socket, my_packet0, NX_IP_PERIODIC_RATE); + + /* send the my_packet2. */ + client_socket.nx_tcp_socket_tx_sequence += 20; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the Seq number for my_packet3. */ + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* send the my_packet1. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 20; + status += nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 4 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + +#ifdef __PRODUCT_NETXDUO__ + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= 20; +#endif + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } + + /* Restore the transmit sequence. */ + client_socket.nx_tcp_socket_tx_sequence += 60; + + /* Restore priority. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); +} + +static char rcv_buffer[200]; + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 80) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_7_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 7.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_8.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_8.c new file mode 100644 index 00000000..59fed687 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_8.c @@ -0,0 +1,319 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "1---------abcdefgh203---------ABCDEFGH405---------klmnopqr607---------KLMNOPQR809---------" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ +extern void (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_8_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + ULONG seq1; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 8............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets, packet 1-3 contains 3 segments of the outgoing message. Packet 4 contains a retran overlapping 1-3. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 20 - 39 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 0 - 59 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[0], 60); + my_packet4 -> nx_packet_length = 60; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 60; + + /* Send the my_packet3 */ + seq1 = client_socket.nx_tcp_socket_tx_sequence; + client_socket.nx_tcp_socket_tx_sequence += 40; + status = nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the my_packet1. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + status += nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Restore the Seq number for packet 2. */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + client_socket.nx_tcp_socket_tx_sequence += 20; + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Restore the seq number for packet 4 */ + client_socket.nx_tcp_socket_tx_sequence = seq1; + +#ifdef __PRODUCT_NETXDUO__ + /* Also reduce the outstanding byte count. */ + client_socket.nx_tcp_socket_tx_outstanding_bytes -= my_packet4 -> nx_packet_length; +#endif + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; + +static void thread_1_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 60) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_8_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 8.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_9.c b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_9.c new file mode 100644 index 00000000..7cd1e271 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_overlapping_packet_test_9.c @@ -0,0 +1,337 @@ +/* This NetX test concentrates on overlapping TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_TCP_ACK_EVERY_N_PACKETS) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +extern ULONG packet_gather; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_9_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + NX_PACKET *my_packet1; + NX_PACKET *my_packet2; + NX_PACKET *my_packet3; + NX_PACKET *my_packet4; + char *msg = MSG; + + /* Print out test information banner. */ + printf("NetX Test: TCP Overlapping Packet Test 9............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Create 4 packets, packet 1-3 contains 3 segments of the outgoing message. Packet 4 contains a retran overlapping 2. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet3, NX_TCP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_allocate(&pool_0, &my_packet4, NX_TCP_PACKET, NX_WAIT_FOREVER); + + if(status) + error_counter++; + + /* Fill in the packet with data. */ + /* Packet 1 contains bytes 0 - 19 + Packet 2 contains bytes 20 - 39 + Packet 3 contains bytes 40 - 59 + packet 4 contains bytes 25 - 30 */ + + memcpy(my_packet1 -> nx_packet_prepend_ptr, &msg[0], 20); + my_packet1 -> nx_packet_length = 20; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet2 -> nx_packet_prepend_ptr, &msg[20], 20); + my_packet2 -> nx_packet_length = 20; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet3 -> nx_packet_prepend_ptr, &msg[40], 20); + my_packet3 -> nx_packet_length = 20; + my_packet3 -> nx_packet_append_ptr = my_packet3 -> nx_packet_prepend_ptr + 20; + + memcpy(my_packet4 -> nx_packet_prepend_ptr, &msg[25], 6); + my_packet4 -> nx_packet_length = 6; + my_packet4 -> nx_packet_append_ptr = my_packet4 -> nx_packet_prepend_ptr + 6; + + /* To avoid ACK loop. Drop the ACK from client to server. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_server; + + /* Send the 1st one. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); + + /* Send the 2nd one. */ + status += nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); + + /* Send the 3rd one. */ + status += nx_tcp_socket_send(&client_socket, my_packet3, NX_IP_PERIODIC_RATE); + + /* Update the seq number and send the 4th one. */ + client_socket.nx_tcp_socket_tx_sequence -= 35; + + /* Send the 4th one. */ + status += nx_tcp_socket_send(&client_socket, my_packet4, NX_IP_PERIODIC_RATE); + + if(status) + { + error_counter++; + } +} + +static char rcv_buffer[200]; +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + ULONG recv_length = 0; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 60) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void my_tcp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + NX_TCP_HEADER *header_ptr; + + header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + + /* Check whether server receives an ACK packet in establish state. */ + if((header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && + (server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) && + (packet_ptr -> nx_packet_length == 20)) + { + nx_packet_release(packet_ptr); + return; + } + + NX_CHANGE_ULONG_ENDIAN(header_ptr -> nx_tcp_header_word_3); + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_overlapping_packet_test_9_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Overlapping Packet Test 9.............................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_packet_leak_test.c b/test/regression/netxduo_test/netx_tcp_packet_leak_test.c new file mode 100644 index 00000000..bd147ccb --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_packet_leak_test.c @@ -0,0 +1,345 @@ +/* This NetX test concentrates no packet leak after socket is deleted. */ + +#include "nx_api.h" +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 4096); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFF0000UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 2); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Packet Leak Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create the client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Prepare a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Disconnect from server. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unbind the client socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Verify no packet leak. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Create the server socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Listen the socket. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Accept connection from client. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Prepare a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error */ + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Disconnect from client. */ + status = nx_tcp_socket_disconnect(&server_socket, 5); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Delete the client socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error */ + if (status) + { + error_counter++; + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_packet_leak_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Packet Leak Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_packet_receive_function_test.c b/test/regression/netxduo_test/netx_tcp_packet_receive_function_test.c new file mode 100644 index 00000000..1a4d5814 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_packet_receive_function_test.c @@ -0,0 +1,451 @@ +/* This NetX test case test _nx_tcp_packet_receive function with non standard operation . */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UINT packet_count = 0; + +static NX_PACKET *my_packet1; +static NX_PACKET *my_packet2; +static NX_PACKET *copy_packet_1; +static NX_PACKET *copy_packet_2; +static NX_PACKET *copy_packet_3; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_packet_receive_function_test_application_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = _nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += _nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Packet Receive Function Test.........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 600, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + /* Determine if the timeout error occurred. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1,2,3,5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + memcpy(my_packet1 -> nx_packet_prepend_ptr,"ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28); + my_packet1 -> nx_packet_length = 28; + my_packet1 -> nx_packet_append_ptr = my_packet1 -> nx_packet_prepend_ptr + 28; + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet1, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Point to new receive function */ + ip_1.nx_ip_tcp_packet_receive = packet_receive; + + /* Allocate a new packet. */ + status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + memcpy(my_packet2 -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28); + my_packet2 -> nx_packet_length = 28; + my_packet2 -> nx_packet_append_ptr = my_packet2 -> nx_packet_prepend_ptr + 28; + + /* Send the packet. */ + status = nx_tcp_socket_send(&client_socket, my_packet2, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; +ULONG actual_status; +NX_PACKET *packet_ptr; +#ifndef NX_DISABLE_RX_SIZE_CHECKING +NX_PACKET *invalid_packet; +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 650, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + if(status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + +#ifndef NX_DISABLE_RX_SIZE_CHECKING + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &invalid_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check for error. */ + if((status != NX_SUCCESS)) + { + error_counter++; + } + + /* Set the packet length with invalid value. */ + memcpy(invalid_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28); + invalid_packet -> nx_packet_length = sizeof(NX_TCP_HEADER) - 1; + invalid_packet -> nx_packet_append_ptr = invalid_packet -> nx_packet_prepend_ptr + invalid_packet -> nx_packet_length; + + /* Directly call _nx_tcp_packet_receive invalid packet. */ + _nx_tcp_packet_receive(&ip_1, invalid_packet); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + { + error_counter++; + } +#endif + + /* Obtain the IP internal mutex before processing the IP event. */ + tx_mutex_get(&(ip_1.nx_ip_protection), TX_WAIT_FOREVER); + + /* Directly call _nx_tcp_packet_receive valid packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet_1); + + /* Directly call _nx_tcp_packet_receive valid packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet_2); + + /* Directly call _nx_tcp_packet_receive to receive packet with incorrect checksum. */ + _nx_tcp_packet_receive(&ip_1, copy_packet_3); + + /* Release the IP internal mutex. */ + tx_mutex_put(&(ip_1.nx_ip_protection)); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if(socket != &server_socket) + error_counter++; +} + +static void packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + UINT status; + + /* Only store the packet one time. */ + if (packet_count == 0) + { + + /* Update the packet prepend and length to include the IP header. */ + packet_ptr -> nx_packet_prepend_ptr -= 20; + packet_ptr -> nx_packet_length += 20; + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_1, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_1 -> nx_packet_prepend_ptr += 20; + copy_packet_1 -> nx_packet_length -= 20; + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_2, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_2 -> nx_packet_prepend_ptr += 20; + copy_packet_2 -> nx_packet_length -= 20; + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet_3, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet prepend and length. */ + copy_packet_3 -> nx_packet_prepend_ptr += 20; + copy_packet_3 -> nx_packet_length -= 20; + + /* Clear the checksum field. */ + *(copy_packet_3 -> nx_packet_prepend_ptr + 16) = 0; + *(copy_packet_3 -> nx_packet_prepend_ptr + 17) = 0; + } + + /* Update the packet count. */ + packet_count ++; + } + + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Stop the process. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_packet_receive_function_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Packet Receive Function Test..........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_queue_depth_notify_test.c b/test/regression/netxduo_test/netx_tcp_queue_depth_notify_test.c new file mode 100644 index 00000000..03397fa8 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_queue_depth_notify_test.c @@ -0,0 +1,359 @@ +/* This test cases verify that tcp queue depth nofity works. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY) || !defined(__PRODUCT_NETXDUO__) || defined(NX_DISABLE_IPV4) +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_queue_depth_nofity_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP queue depth notify test...............................N/A\n"); + test_control_return(3); +} +#else +#define DEMO_STACK_SIZE 2048 + +#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UINT op; +static UCHAR queue_depth_notify_called; +static TX_SEMAPHORE sema_0; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void my_queue_depth_notify(NX_TCP_SOCKET *socket_ptr); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_queue_depth_nofity_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + op = NX_RAMDRIVER_OP_BYPASS; + queue_depth_notify_called = NX_FALSE; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + + /* Create semaphore. */ + status = tx_semaphore_create(&sema_0, "Semaphore 0", 0); +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status, i; +ULONG actual_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: TCP queue depth notify test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Configure max_queue_depth to 2. */ + nx_tcp_socket_transmit_configure(&server_socket, 2, _nx_tcp_transmit_timer_rate, NX_TCP_MAXIMUM_RETRIES, NX_TCP_RETRY_SHIFT); + + /* Set callback function. */ + status = nx_tcp_socket_queue_depth_notify_set(&server_socket, my_queue_depth_notify); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_socket_queue_depth_notify_set(&server_socket, my_queue_depth_notify); + + /* Check for error. */ + if(status) + error_counter++; + + advanced_packet_process_callback = my_packet_process; + + for(i = 0; i < 3; i++) + { + if(i == 0) + { + + /* Drop the first packet. */ + op = NX_RAMDRIVER_OP_DROP; + } + else + { + + /* Bypass the following packts. */ + op = NX_RAMDRIVER_OP_BYPASS; + } + + /* Allocate packets */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + status = nx_packet_data_append(my_packet, MSG, 20, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Send the packet. */ + status = nx_tcp_socket_send(&server_socket, my_packet, 0); + + /* Check status. */ + if(status) + { + + /* Error on send! */ + if (status == NX_TX_QUEUE_DEPTH) + { + if(tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE)) + error_counter++; + else + i--; + } + else + error_counter++; + + nx_packet_release(my_packet); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unaccepted the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check for error. */ + if(status) + error_counter++; +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + while(!nx_tcp_socket_receive(&client_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE)) + nx_packet_release(my_packet); + + /* Call disconnect to send a FIN. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if(status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if(status) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter || (queue_depth_notify_called == NX_FALSE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + *operation_ptr = op; + + return NX_TRUE; +} + +VOID my_queue_depth_notify(NX_TCP_SOCKET *socket_ptr) +{ + queue_depth_notify_called = NX_TRUE; + tx_semaphore_put(&sema_0); + return; +} + +#endif diff --git a/test/regression/netxduo_test/netx_tcp_race_condition_test.c b/test/regression/netxduo_test/netx_tcp_race_condition_test.c new file mode 100644 index 00000000..a90d2121 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_race_condition_test.c @@ -0,0 +1,304 @@ +/* This NetX test concentrates when thread is suspended on send, the disconnect call will resume the sending thread. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "tx_thread.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_PACKET_DEBUG_INFO) && !defined(NX_ENABLE_INTERFACE_CAPABILITY) && !defined(NX_IPSEC_ENABLE) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_test; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buffer[20]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static UINT send_flag = NX_FALSE; + +TX_THREAD *_tx_thread_identify(VOID) +{ + +TX_THREAD *thread_ptr; + +TX_INTERRUPT_SAVE_AREA + + + /* Disable interrupts to put the timer on the created list. */ + TX_DISABLE + + /* Log this kernel call. */ + TX_EL_THREAD_IDENTIFY_INSERT + + /* Pickup thread pointer. */ + TX_THREAD_GET_CURRENT(thread_ptr); + + /* Restore interrupts. */ + TX_RESTORE + + if (thread_ptr == &thread_0) + { + + if (send_flag) + { + send_flag = NX_FALSE; + tx_thread_resume(&thread_test); + } + } + + /* Return the current thread pointer. */ + return(thread_ptr); +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_race_condition_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_test, "thread test", thread_test_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 15360); + pointer = pointer + 15360; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + +/* Define the test threads. */ +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Race Condition Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buffer, sizeof(send_buffer), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + send_flag = NX_TRUE; + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ +static void thread_test_entry(ULONG thread_input) +{ + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_race_condition_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Race Condition Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_race_condition_test2.c b/test/regression/netxduo_test/netx_tcp_race_condition_test2.c new file mode 100644 index 00000000..945b280e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_race_condition_test2.c @@ -0,0 +1,383 @@ +/* This NetX test concentrates when one thread is sending data, another thread disconnect the socket. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_test; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buffer[200]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static NX_PACKET *test_packet[20]; +static UINT test_packet_count; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_race_condition_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_test, "thread test", thread_test_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 15360); + pointer = pointer + 15360; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + +/* Define the test threads. */ +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Race Condition Test 2................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buffer, 200, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for (test_packet_count = 0; test_packet_count < 20; test_packet_count++) + { + status = nx_packet_allocate(&pool_0, &test_packet[test_packet_count], NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + { + break; + } + } + + /* Cover nx_tcp_socket_send_internal.c + [+ -] line 837 if (preempted == NX_TRUE) */ + tx_thread_resume(&thread_test); + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + else + { + error_counter++; + } + + tx_thread_resume(&thread_1); + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buffer, 100, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Window will be zero. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buffer, 20, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Cover nx_tcp_socket_send_internal.c + [+ -] line 1072 if (socket_ptr -> nx_tcp_socket_zero_window_probe_has_data == NX_FALSE) */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Cover nx_tcp_socket_send_internal.c + [+ -] line 846 if (send_packet != packet_ptr) */ + tx_thread_resume(&thread_test); + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + nx_packet_release(my_packet); + } + else + { + error_counter++; + } + + tx_thread_resume(&thread_1); + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ +static void thread_test_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *packet_ptr; + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + for (i = 0; i < test_packet_count; i++) + { + nx_packet_release(test_packet[i]); + } + + test_packet_count = 0; + + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + tx_thread_suspend(&thread_test); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(packet_ptr); + } + + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +UINT i; + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + for (i = 0 ; i < 2; i++) + { + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_suspend(&thread_1); + + /* Disconnect the server socket. */ + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + } + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_race_condition_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Race Condition Test 2.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_receive_cleanup_test.c b/test/regression/netxduo_test/netx_tcp_receive_cleanup_test.c new file mode 100644 index 00000000..15c4180f --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_receive_cleanup_test.c @@ -0,0 +1,261 @@ +/* This NetX test concentrates on the TCP Socket Receive Cleanup operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_receive_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Recieve Cleanup Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the client_socket port to 12. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_receive_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (server_socket.nx_tcp_socket_receive_suspended_count != 1) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NO_PACKET) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_receive_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (server_socket.nx_tcp_socket_receive_suspended_count != 0) + error_counter++; + + /* Check the error counter. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_receive_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (server_socket.nx_tcp_socket_receive_suspended_count != 0) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NO_PACKET) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_receive_suspended_count != 0) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (server_socket.nx_tcp_socket_receive_suspended_count != 1) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_receive_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Recieve Cleanup Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test.c b/test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test.c new file mode 100644 index 00000000..2d2246c6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test.c @@ -0,0 +1,265 @@ +/* This NetX test concentrates on the TCP Socket connect reset operation under interface deatch(tested receive suspension list). */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ntest_2_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_receive_under_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Receive Under Interface Detach Test..................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the client_socket port to 12. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(2, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Check the error counter. */ + if ((error_counter) || (ntest_2_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Resume the thread 2. */ + tx_thread_resume(&ntest_2); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status == NX_SUCCESS) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_2_entry(ULONG thread_input) +{ + +UINT status; + + /* Update the ntest_2_counter. */ + ntest_2_counter++; + + /* Check the TCP socket receive suspended count. */ + if (server_socket.nx_tcp_socket_receive_suspension_list == NX_NULL) + error_counter++; + + /* Detach the second interface for IP instance 2. */ + status = nx_ip_interface_detach(&ip_1, 1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Check the TCP socket receive suspended count. */ + if (server_socket.nx_tcp_socket_receive_suspension_list != NX_NULL) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_receive_under_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Receive Under Interface Detach Test...................N/A\n"); + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test2.c b/test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test2.c new file mode 100644 index 00000000..c918ab62 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_receive_under_interface_detach_test2.c @@ -0,0 +1,281 @@ +/* This NetX test concentrates on the TCP Socket connect reset operation under interface deatch(tested receive queue count). */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ntest_2_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_receive_under_interface_detach_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Receive Under Interface Detach Test2.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the client_socket port to 12. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(2, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Resume the thread 2. */ + tx_thread_resume(&ntest_2); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! This packe should not be sent. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + } + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Check the error counter. */ + if ((error_counter) || (ntest_2_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_2_entry(ULONG thread_input) +{ + +UINT status; + + /* Update the ntest_2_counter. */ + ntest_2_counter++; + + /* Check the TCP socket receive queue count. */ + if (server_socket.nx_tcp_socket_receive_queue_count != 1) + error_counter++; + + /* Detach the second interface for IP instance 2. */ + status = nx_ip_interface_detach(&ip_1, 1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Check the TCP socket receive queue count. */ + if (server_socket.nx_tcp_socket_receive_queue_count != 1) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_receive_under_interface_detach_test2_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Receive Under Interface Detach Test2..................N/A\n"); + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_reset_during_send_test.c b/test/regression/netxduo_test/netx_tcp_reset_during_send_test.c new file mode 100644 index 00000000..c1e5aef4 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_reset_during_send_test.c @@ -0,0 +1,275 @@ +/* This NetX test concentrates on sending TCP packets while socket is reset by peer. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_RESET_DISCONNECT) &&!defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +static UCHAR pool_area_0[20480]; +static UCHAR pool_area_1[20480]; + +static CHAR send_buff[3000]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_reset_during_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pool_area_0, sizeof(pool_area_0)); + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pool_area_1, sizeof(pool_area_1)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Reset During Send Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE << 1); + if (status != NX_NOT_CONNECTED) + { + error_counter++; + nx_packet_release(my_packet); + } + else if (my_packet -> nx_packet_length == sizeof(send_buff)) + { + + /* Partial data should be sent but not. */ + error_counter++; + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + error_counter++; + else + nx_packet_release(packet_ptr); + + /* Reset the connection. */ + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_reset_during_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Multiple Send Test....................................N/A\n"); + + test_control_return(3); + +} +#endif /* FEATURE_NX_IPV6 */ diff --git a/test/regression/netxduo_test/netx_tcp_retransmit_test.c b/test/regression/netxduo_test/netx_tcp_retransmit_test.c new file mode 100644 index 00000000..ccba24f4 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_retransmit_test.c @@ -0,0 +1,334 @@ +/* This case tests two TCP segments are sent but the first one is dropped. The peer can receive all segments. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#ifdef __PRODUCT_NETXDUO__ +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static ULONG drop_packet; +static UCHAR pool_area[20480]; +static UCHAR send_buffer[3000]; +static UCHAR recv_buffer[3000]; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +#endif /* FEATURE_NX_IPV6 */ + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_retransmit_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_packet = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pool_area, sizeof(pool_area)); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; +#endif + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + if(status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: TCP Retransmit Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the buffer. */ + for (i = 0; i < sizeof(send_buffer); i++) + { + send_buffer[i] = i & 0xFF; + } + memset(recv_buffer, 0, sizeof(recv_buffer)); + + /* Let server thread listen first. */ + tx_thread_relinquish(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Connect to server. */ +#ifdef FEATURE_NX_IPV6 + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); +#else + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Check the connection status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* The callback function is used to drop the first data packet to trigger retransmission. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, client_socket.nx_tcp_socket_connect_mss * 2, + &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* The packet will be fragmented into 2 TCP packets. Drop 1 packet. */ + drop_packet = 1; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG length; +ULONG total_length = 0; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Loop to receive the packet. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 2 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + nx_packet_data_retrieve(packet_ptr, &recv_buffer[total_length], &length); + total_length += length; + nx_packet_release(packet_ptr); + } + + /* Check data. */ + if ((total_length != client_socket.nx_tcp_socket_connect_mss * 2) || + (memcmp(send_buffer, recv_buffer, total_length))) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Skip packets from IP1*/ + if (ip_ptr != &ip_0) + { + return NX_TRUE; + } + + /* Skip none TCP packets. */ +#ifdef FEATURE_NX_IPV6 + if (packet_ptr -> nx_packet_length < 60) +#else + if (packet_ptr -> nx_packet_length < 40) +#endif + { + return NX_TRUE; + } + + if (drop_packet != 0) + { + + /* This packet should be dropped. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + drop_packet--; + } + + return NX_TRUE; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_retransmit_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Retransmit Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_retransmit_test_1.c b/test/regression/netxduo_test/netx_tcp_retransmit_test_1.c new file mode 100644 index 00000000..84d23948 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_retransmit_test_1.c @@ -0,0 +1,465 @@ +/* This case tests whether ACK number and window size is updated in retransmitted packet. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#ifdef __PRODUCT_NETXDUO__ +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static ULONG drop_packet; +static NX_PACKET *retransmission_packet; +static ULONG window_size; +static ULONG ack_number; +static ULONG retransmission_window_size; +static ULONG retransmission_ack_number; +static UCHAR pool_area[20480]; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +#endif /* FEATURE_NX_IPV6 */ + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static VOID test_cleanup(VOID); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_retransmit_test_1_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + drop_packet = 0; + retransmission_packet = NX_NULL; + window_size = 0; + ack_number = 0; + retransmission_window_size = 0; + retransmission_ack_number = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pool_area, sizeof(pool_area)); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; +#endif + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + if(status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +} + +/* Define the test threads. */ +static UCHAR send_buffer[3000]; + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +UINT old_threshold; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: TCP Retransmit Test 1....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let server thread listen first. */ + tx_thread_relinquish(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Connect to server. */ +#ifdef FEATURE_NX_IPV6 + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); +#else + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Check the connection status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* The callback function is used to drop the first data packet to trigger retransmission. */ + advanced_packet_process_callback = my_packet_process; + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, client_socket.nx_tcp_socket_tx_window_congestion, + &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* The packet will be fragmented into 4 TCP packet. Drop 4 packets. */ + drop_packet = 4; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_NO_WAIT); + if(status != NX_SUCCESS) + error_counter++; + + /* Disable preemption. */ + tx_thread_priority_change(tx_thread_identify(), 0, &old_threshold); + for (i = 0; i < 3; i++) + { + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + + status = nx_packet_data_append(packet_ptr, send_buffer, 100, + &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Send another pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + } + + /* Restore preemption. */ + tx_thread_priority_change(tx_thread_identify(), old_threshold, &old_threshold); + + /* Check ACK number and window size. */ + if ((window_size == retransmission_window_size) || + (ack_number == retransmission_ack_number)) + { + + /* Window size or ACK number is not updated. */ + error_counter++; + } + else if ((retransmission_ack_number != client_socket.nx_tcp_socket_rx_sequence) || +#ifdef NX_ENABLE_TCP_WINDOW_SCALING + (retransmission_window_size != (client_socket.nx_tcp_socket_rx_window_current << client_socket.nx_tcp_snd_win_scale_value))) +#else + (retransmission_window_size != client_socket.nx_tcp_socket_rx_window_current)) +#endif + { + + /* Window size or ACK number is not updated to current value of socket. */ + error_counter++; + } + + /* Coverage test for function _nx_tcp_cleanup_deferred. */ + test_cleanup(); + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1170, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, 100, &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&server_socket, packet_ptr, NX_NO_WAIT); + if(status != NX_SUCCESS) + error_counter++; + + /* Make sure thread 0 is the first thread waiting for NX_IP_TCP_CLEANUP_DEFERRED event. */ + tx_thread_suspend(&ntest_1); + nx_tcp_socket_disconnect(&server_socket, 1 * NX_IP_PERIODIC_RATE); +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_TCP_HEADER *header_ptr; + + /* Skip packets from IP1*/ + if (ip_ptr != &ip_0) + { + return NX_TRUE; + } + + /* Skip none TCP packets. */ +#ifdef FEATURE_NX_IPV6 + if (packet_ptr -> nx_packet_length < 60) +#else + if (packet_ptr -> nx_packet_length < 40) +#endif + { + return NX_TRUE; + } + + if (drop_packet != 0) + { + + /* This packet should be dropped. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + + if (drop_packet == 4) + { + retransmission_packet = packet_ptr; + + /* Get TCP header. */ +#ifdef FEATURE_NX_IPV6 + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 40); +#else + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); +#endif + + /* Get window size and ACK number. */ + ack_number = header_ptr -> nx_tcp_acknowledgment_number; + window_size = header_ptr -> nx_tcp_header_word_3; + NX_CHANGE_ULONG_ENDIAN(ack_number); + NX_CHANGE_ULONG_ENDIAN(window_size); + window_size = window_size & NX_LOWER_16_MASK; + } + + drop_packet--; + } + else if (packet_ptr == retransmission_packet) + { + + /* Get TCP header. */ +#ifdef FEATURE_NX_IPV6 + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 40); +#else + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); +#endif + + /* Get window size and ACK number. */ + retransmission_ack_number = header_ptr -> nx_tcp_acknowledgment_number; + retransmission_window_size = header_ptr -> nx_tcp_header_word_3; + NX_CHANGE_ULONG_ENDIAN(retransmission_ack_number); + NX_CHANGE_ULONG_ENDIAN(retransmission_window_size); + retransmission_window_size = retransmission_window_size & NX_LOWER_16_MASK; + + retransmission_packet = NX_NULL; + } + + return NX_TRUE; +} + + +static VOID test_cleanup(VOID) +{ +UINT old_threshold; +ULONG ip_events; + + /* Disable preemption. */ + tx_thread_priority_change(tx_thread_identify(), 0, &old_threshold); + + /* Wakeup thread 1. */ + tx_thread_resume(&ntest_1); + + /* Get NX_IP_TCP_CLEANUP_DEFERRED event. */ + tx_event_flags_get(&ip_1.nx_ip_events, NX_IP_TCP_CLEANUP_DEFERRED, TX_OR_CLEAR, &ip_events, TX_WAIT_FOREVER); + + /* Make sure _nx_tcp_cleanup_deferred is set. */ + if (ntest_1.tx_thread_suspend_cleanup != _nx_tcp_cleanup_deferred) + { + error_counter++; + } + + /* Delete IP_1 so IP thread is terminated. */ + tx_thread_terminate(&ntest_1); + + /* Restore preemption. */ + tx_thread_priority_change(tx_thread_identify(), old_threshold, &old_threshold); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_retransmit_test_1_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Retransmit Test 1.....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_send_disconnect_test.c b/test/regression/netxduo_test/netx_tcp_send_disconnect_test.c new file mode 100644 index 00000000..bdbc2590 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_send_disconnect_test.c @@ -0,0 +1,267 @@ +/* This NetX test concentrates when thread is suspended on send, the disconnect call will resume the sending thread. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buffer[1024]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 15360); + pointer = pointer + 15360; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Send Disconnect Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buffer, sizeof(send_buffer), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + /* Since packet is larger than peer's window size and peer doesn't receive any data, the send will fail. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status == NX_SUCCESS) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Sleep one second and let client thread send the packet first. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the client socket while it is transmitting. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Send Disconnect Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_send_fail_test.c b/test/regression/netxduo_test/netx_tcp_send_fail_test.c new file mode 100644 index 00000000..a2b93749 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_send_fail_test.c @@ -0,0 +1,466 @@ +/* This case tests TCP send fails. */ + +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET fake_socket; +static UCHAR send_buffer[1024]; +static UCHAR recv_buffer[1024]; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void window_update_notify(NX_TCP_SOCKET *client_socket); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_fail_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "Packet Pool 0", 1536, pointer, 8192); + pointer = pointer + 8192; + status += nx_packet_pool_create(&pool_1, "Packet Pool 1", 1536, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_256, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Send Fail Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a fake socket. */ + status = nx_tcp_socket_create(&ip_0, &fake_socket, "Fake Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup fake socket. */ + fake_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + fake_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + fake_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + fake_socket.nx_tcp_socket_next_hop_address = IP_ADDRESS(1, 2, 3, 5); + fake_socket.nx_tcp_socket_port = 12; + fake_socket.nx_tcp_socket_connect_port = 12; + fake_socket.nx_tcp_socket_rx_window_current = 128; +#ifdef NX_IPSEC_ENABLE + fake_socket.nx_tcp_socket_egress_sa = NX_NULL; +#endif /* NX_IPSEC_ENABLE */ + + /* Send a fake packet with no control bits set. */ + _nx_tcp_packet_send_control(&fake_socket, 0, 0, 0, 0, 0, NX_NULL); + +#ifndef NX_DISABLE_TCP_INFO + if (ip_1.nx_ip_tcp_receive_packets_dropped == 0) + error_counter++; +#endif /* NX_DISABLE_TCP_INFO */ + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_window_update_notify_set(&client_socket, window_update_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check the connection status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, send_buffer, sizeof(send_buffer), &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Let thread 1 consume all packets and then send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE << 2); + if(status != NX_NO_PACKET) + { + error_counter++; + } + else + { + nx_packet_release(packet_ptr); + } + + tx_thread_resume(&ntest_1); + +#ifndef NX_DISABLE_PACKET_CHAIN + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, send_buffer, server_socket.nx_tcp_socket_rx_window_default, &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Break the length of packet. */ + packet_ptr -> nx_packet_length += 65535; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_INVALID_PACKET) + { + error_counter++; + } + else + { + nx_packet_release(packet_ptr); + } +#endif /* NX_DISABLE_PACKET_CHAIN */ + + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, send_buffer, server_socket.nx_tcp_socket_rx_window_default, &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Break the length of packet. */ + packet_ptr -> nx_packet_length += client_socket.nx_tcp_socket_connect_mss + 10; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_INVALID_PACKET) + { + error_counter++; + } + else + { + nx_packet_release(packet_ptr); + } + + + /* Send one byte then send packet larger than window size. */ + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, send_buffer, 1, &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Init send buffer. */ + memset(send_buffer, 0xF0, sizeof(send_buffer)); + memset(recv_buffer, 0x00, sizeof(recv_buffer)); + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if(status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(packet_ptr, send_buffer, sizeof(send_buffer), &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +NX_PACKET *consume_pkt[10]; +ULONG consumed = 0; +UINT count; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 196, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* Sleep one second so client socket will waiting for window update to send the second packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Release packet. */ + nx_packet_release(packet_ptr); + + /* Allocate all packets until pool_0 is empty. */ + while (nx_packet_allocate(&pool_0, &consume_pkt[consumed], 0, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + consumed++; + + /* Wait until thread 0 timeout. */ + tx_thread_suspend(&ntest_1); + + /* Release all packets. */ + while (consumed--) + { + nx_packet_release(consume_pkt[consumed]); + } + +#ifndef NX_DISABLE_PACKET_CHAIN + tx_thread_sleep(NX_IP_PERIODIC_RATE >> 1); + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Release packet. */ + nx_packet_release(packet_ptr); +#endif /* NX_DISABLE_PACKET_CHAIN */ + + tx_thread_sleep(NX_IP_PERIODIC_RATE >> 1); + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Release packet. */ + nx_packet_release(packet_ptr); + + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_WAIT_FOREVER); + + /* Check for error. */ + if(status) + error_counter++; + + /* Release packet. */ + nx_packet_release(packet_ptr); + + count = 0; + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Copy data to recv_buffer. */ + memcpy(recv_buffer + count, packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + count += packet_ptr -> nx_packet_length; + + /* Release packet. */ + nx_packet_release(packet_ptr); + } + + /* Check data in received packet. */ + if (count != sizeof(send_buffer)) + error_counter++; + else if (memcmp(recv_buffer, send_buffer, sizeof(send_buffer))) + error_counter++; + +} + +static void window_update_notify(NX_TCP_SOCKET *client_socket) +{ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Send Fail Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_send_fail_test2.c b/test/regression/netxduo_test/netx_tcp_send_fail_test2.c new file mode 100644 index 00000000..2aab6bad --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_send_fail_test2.c @@ -0,0 +1,323 @@ +/* This NetX test concentrates on sending partial TCP data due to pool empty. + * The payload size of packet pool is 512. + * The window size is 800. + * Size of transmitting data is 1800. + * The transmitting data are placed in 4 packets, the packet pool has only one packet available. + * While the payload size of packet is smaller than the window size, TCP won't send all data until packet is available. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +#ifndef NX_PACKET_ALIGNMENT +#define NX_PACKET_ALIGNMENT sizeof(ULONG) +#endif /* NX_PACKET_ALIGNMENT */ + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +static CHAR send_buff[1800]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_fail_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool with 5 packets. */ + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)); + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, + ((512 + sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT - 1) & ~(NX_PACKET_ALIGNMENT - 1)) * 6); + pointer = pointer + (512 + NX_PACKET_ALIGNMENT + sizeof(NX_PACKET)) * 6; + + /* Create another packet pool. */ + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 1536, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Send Fail Test 2......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Verify only one packet available. */ + if (pool_0.nx_packet_pool_available != 2) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE << 1); + if (status != NX_NO_PACKET) + error_counter++; + + /* Verify partial data are sent. */ + if (my_packet -> nx_packet_length == sizeof(send_buff)) + error_counter++; + + nx_packet_release(my_packet); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +NX_PACKET *waste_ptr; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 800, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + + /* Verify only partial data are received. */ + if(packet_ptr -> nx_packet_length != server_socket.nx_tcp_socket_rx_window_default) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Waste a packet from pool 0. */ + status = nx_packet_allocate(&pool_0, &waste_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + error_counter++; + + /* Verify only one packet available. */ + if (pool_0.nx_packet_pool_available != 1) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_fail_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Send Fail Test 2......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_send_fail_test3.c b/test/regression/netxduo_test/netx_tcp_send_fail_test3.c new file mode 100644 index 00000000..441e6719 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_send_fail_test3.c @@ -0,0 +1,277 @@ +/* This NetX test concentrates on sending partial TCP data due to window size. The length of packet is verified after send. + * The payload size of packet pool is 1516. + * The MSS and window is 1460. + * Size of transmitting data is 1500. + * The transmitting data are received by peer. TCP won't send all data. */ + +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETX__) && !defined(NX_DISABLE_PACKET_CHAIN) +#define DEMO_STACK_SIZE 2048 + +#ifndef NX_PACKET_ALIGNMENT +#define NX_PACKET_ALIGNMENT sizeof(ULONG) +#endif /* NX_PACKET_ALIGNMENT */ + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +static CHAR send_buff[1500]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_fail_test3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 10240); + pointer = pointer + 10240; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Send Fail Test 3......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + if (status != NX_WINDOW_OVERFLOW) + error_counter++; + + /* Verify partial data are sent. */ + if (my_packet -> nx_packet_length != sizeof(send_buff) - 1460) + error_counter++; + + nx_packet_release(my_packet); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1460, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_send_fail_test3_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Send Fail Test 3......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_server_socket_accept_test.c b/test/regression/netxduo_test/netx_tcp_server_socket_accept_test.c new file mode 100644 index 00000000..f063ab8e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_server_socket_accept_test.c @@ -0,0 +1,275 @@ +/* This NetX test concentrates on the TCP Server Socket accept operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET server_socket_0; + +/* The 2 ports will hashed to the same index. */ +#define SERVER_PORT_0 0x00000100 +#define SERVER_PORT_1 0x00008100 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_server_socket_accept_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Server Socket Accept Test............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_0, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket_0, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept the server socket before listen. */ + status = nx_tcp_server_socket_accept(&server_socket_0, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_NOT_LISTEN_STATE) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_0, &server_socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept the server socket again. */ + status = nx_tcp_server_socket_accept(&server_socket_0, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_server_socket_accept_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Server Socket Accept Test.............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_simultaneous_test.c b/test/regression/netxduo_test/netx_tcp_simultaneous_test.c new file mode 100644 index 00000000..dc4f5eb4 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_simultaneous_test.c @@ -0,0 +1,348 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static UINT driver_packet_process_delay(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); +static UINT driver_packet_process_drop_always(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_simultaneous_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Simultaneous Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + if (status != NX_NOT_CONNECTED) + error_counter++; + + /* Verify server socket is in SYN RECEIVED state. */ + if (server_socket.nx_tcp_socket_state != NX_TCP_SYN_RECEIVED) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Delay the SYN packets to simulate simultaneous open. */ + advanced_packet_process_callback = driver_packet_process_delay; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&server_socket, 12, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&server_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + error_counter++; + + nx_packet_release(packet_ptr); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Drop the SYN packet from server socket always. */ + advanced_packet_process_callback = driver_packet_process_drop_always; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&server_socket, IP_ADDRESS(1, 2, 3, 4), 12, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_NOT_CONNECTED) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&server_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static UINT driver_packet_process_delay(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr) +{ + + if ((ip_ptr == &ip_1) && + (packet_ptr -> nx_packet_length > 40)) + { + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = 10; + } + + if ((ip_ptr == &ip_0) && + (packet_ptr -> nx_packet_length > 40)) + { + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = 10; + + /* Clear the callback function. */ + advanced_packet_process_callback = NX_NULL; + } + + return NX_TRUE; +} + + +static UINT driver_packet_process_drop_always(NX_IP *ip_ptr, NX_PACKET *packet_ptr, + UINT *operation_ptr, UINT *delay_ptr) +{ + + if ((ip_ptr == &ip_1) && + (packet_ptr -> nx_packet_length > 40)) + { + + /* Drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_simultaneous_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Simultaneous Test.....................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_small_packet_test.c b/test/regression/netxduo_test/netx_tcp_small_packet_test.c new file mode 100644 index 00000000..8716ba44 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_small_packet_test.c @@ -0,0 +1,159 @@ +/* This NetX test concentrates on TCP data packets. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#ifndef NX_DISABLE_IPV4 + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static ULONG syn_packet_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_small_packet_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_IP_PACKET, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TCP Small Packet Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + advanced_packet_process_callback = my_packet_process; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status == NX_SUCCESS) || (syn_packet_counter != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + syn_packet_counter++; + + return NX_TRUE; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_small_packet_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Small Packet Test.....................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_small_window_preempt_test.c b/test/regression/netxduo_test/netx_tcp_small_window_preempt_test.c new file mode 100644 index 00000000..6a78ece4 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_small_window_preempt_test.c @@ -0,0 +1,474 @@ +/* This NetX test concentrates on the small window TCP operation. This is the same + as the small window test... but instead the receiver keeps the receive queue empty + so the immediate ACK must come back from the socket data receive function. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_small_window_preempt_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG start_time; +ULONG end_time; + + + /* Print out test information banner. */ + printf("NetX Test: TCP Small Window Size Preemption Test....................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 128, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 132); + + /* Check for error. */ + if (status) + error_counter++; + + /* Send 5 packets... the 5th packet should block because of the window size. */ + + /* Allocate a 1st packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 2nd packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 3rd packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 4th packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 5th packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Remember the starting time. */ + start_time = tx_time_get(); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Get the end time. */ + end_time = tx_time_get(); + + /* Determine if the status is valid. */ + if ((status) || (end_time > (start_time+NX_IP_PERIODIC_RATE/10))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 132, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Receive five TCP messages from the socket - 1st packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 2nd packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 3rd packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 4th packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 5th packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_small_window_preempt_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Small Window Size Preemption Test.....................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_small_window_test.c b/test/regression/netxduo_test/netx_tcp_small_window_test.c new file mode 100644 index 00000000..a04c6566 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_small_window_test.c @@ -0,0 +1,546 @@ +/* This NetX test concentrates on the small window TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) +static UCHAR message[280]; +#endif /* NX_DISABLE_PACKET_CHAIN */ + + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +#endif + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_small_window_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG start_time; +ULONG end_time; + + + /* Let the other thread run first. */ + tx_thread_relinquish(); + + /* Print out test information banner. */ + printf("NetX Test: TCP Small Window Size Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 128, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_relinquish(); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write data that is larger than window size. */ + status = nx_packet_data_append(my_packet, message, sizeof(message), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Delay the packet sent out. */ + advanced_packet_process_callback = my_packet_process; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 1); + + advanced_packet_process_callback = NX_NULL; + + /* The timeout is one tick only, so only part of whole packet can be sent. */ + if (status) + { + nx_packet_release(my_packet); + } + else + { + error_counter++; + } + + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write data that is larger than window size. */ + status = nx_packet_data_append(my_packet, message, sizeof(message), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } +#endif /* NX_DISABLE_PACKET_CHAIN */ + + /* Send 5 packets... the 5th packet should block because of the window size. */ + /* Allocate a 1st packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 10); + + /* Determine if the status is valid. */ + if (status) + { + nx_packet_release(my_packet); + } + + /* Allocate a 2nd packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 3rd packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 4th packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 5th packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Remember the starting time. */ + start_time = tx_time_get(); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Get the end time. */ + end_time = tx_time_get(); + + /* Determine if the status is valid. */ + if ((status) || (end_time > (start_time+NX_IP_PERIODIC_RATE/10))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG expected_length; +ULONG loop; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 132, + NX_NULL, ntest_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) + + /* Receive five TCP messages from the socket - 1st packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + nx_packet_release(packet_ptr); + + expected_length = sizeof(message); + loop = 6; +#else + expected_length = 28; + loop = 5; +#endif /* NX_DISABLE_PACKET_CHAIN */ + while(loop > 0) + { + + /* Receive five TCP messages from the socket - 1st packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + expected_length -= packet_ptr -> nx_packet_length; + if(expected_length == 0) + { + expected_length = 28; + loop--; + } + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + + +#if !defined(NX_DISABLE_PACKET_CHAIN) && defined(__PRODUCT_NETXDUO__) +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Skip packet that is not TCP. */ + if(packet_ptr -> nx_packet_length < 40) + return NX_TRUE; + + /* Let driver drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + return NX_TRUE; +} +#endif +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_small_window_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Small Window Size Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_available_bytes_test.c b/test/regression/netxduo_test/netx_tcp_socket_available_bytes_test.c new file mode 100644 index 00000000..bc28590b --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_available_bytes_test.c @@ -0,0 +1,320 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_available_bytes_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +ULONG bytes_available; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket available bytes Test..........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&client_socket, &bytes_available); + if (status != NX_NOT_CONNECTED) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, 2 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + for (i = 0; i < 2; i++) + { + + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG bytes_available; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&server_socket, &bytes_available); + if (status != NX_NOT_CONNECTED) + error_counter++; + + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_suspend(&thread_1); + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&server_socket, &bytes_available); + if (status || (bytes_available != 28)) + error_counter++; + + tx_thread_suspend(&thread_1); + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&server_socket, &bytes_available); + if (status || (bytes_available != 28 * 2)) + error_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get the socket bytes available. */ + status = nx_tcp_socket_bytes_available(&server_socket, &bytes_available); + if (status != NX_NOT_CONNECTED) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_available_bytes_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket available bytes Test...........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_delete_test.c b/test/regression/netxduo_test/netx_tcp_socket_delete_test.c new file mode 100644 index 00000000..7de56bdf --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_delete_test.c @@ -0,0 +1,184 @@ +/* This NetX test concentrates on the TCP Socket unaccept operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_delete_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Delete Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete this socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a client socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the port. */ + status = nx_tcp_client_socket_bind(&client_socket, 80, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete this socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status != NX_STILL_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the port. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete this socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_listen_queue_test.c b/test/regression/netxduo_test/netx_tcp_socket_listen_queue_test.c new file mode 100644 index 00000000..4f1b2055 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_listen_queue_test.c @@ -0,0 +1,876 @@ +/* This NetX test concentrates on the TCP Socket unaccept operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV4) + +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; +static NX_TCP_SOCKET server_socket_0; +static NX_TCP_SOCKET server_socket_1; + +/* The 2 ports will hashed to the same index. */ +#define SERVER_PORT_0 0x00000100 +#define SERVER_PORT_1 0x00008100 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT v4_syn_counter = 0; +static UINT v6_syn_counter = 0; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NX_PACKET *v4_syn_packet; +static NX_PACKET *v4_rst_packet; +static NX_PACKET *v6_syn_packet; +static NX_PACKET *v6_rst_packet; +static NX_PACKET *copy_packet[20]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void tcp_checksum_compute(NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_listen_queue_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Listen Queue Test.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_0, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = nxd_tcp_client_socket_connect(&client_socket_0, &ipv6_address_2, SERVER_PORT_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_1, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Call connect to send a SYN with IPv6 address. */ + status = nxd_tcp_client_socket_connect(&client_socket_1, &ipv6_address_2, SERVER_PORT_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Call connect to send a SYN with IPv4 address. */ + nx_tcp_client_socket_connect(&client_socket_1, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT_1, NX_NO_WAIT); + + /* Sleep 500 ticks, Server socket receive packet. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +UINT i; +NX_IPV6_HEADER *ip_header_ptr; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_0, &server_socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT_0, &server_socket_0); + + /* Check for error. */ + if (status != NX_NOT_CLOSED) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_1, "Server Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_1, &server_socket_1, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the socket state. */ + if (server_socket_1.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Check the TCP port table. */ + if ((ip_1.nx_ip_tcp_port_table[1] != &server_socket_0) || (ip_1.nx_ip_tcp_port_table[1] -> nx_tcp_socket_bound_next != &server_socket_0)) + error_counter++; + + /* Sleep 0.5 second to receive the IPV4 SYN packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + /* Copy the IP header. */ + v4_syn_packet -> nx_packet_prepend_ptr -= 20; + v4_syn_packet -> nx_packet_length += 20; + + /* Copy the packet. */ + status = nx_packet_copy(v4_syn_packet, ©_packet[0], &pool_0, NX_NO_WAIT); + + /* Check status . */ + if (status) + { + error_counter ++; + } + else + { + + /* Update the packet IP header. */ + copy_packet[0] -> nx_packet_ip_header = copy_packet[0] -> nx_packet_prepend_ptr; + + /* Update the copy packet pointer. */ + copy_packet[0] -> nx_packet_prepend_ptr += 20; + copy_packet[0] -> nx_packet_length -= 20; + + tcp_checksum_compute(copy_packet[0]); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet[0]); + } + + /* Check the listen queue current count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_next -> nx_tcp_listen_queue_current != 1) + error_counter ++; + + /* Copy the IP header. */ + v4_rst_packet -> nx_packet_prepend_ptr -= 20; + v4_rst_packet -> nx_packet_length += 20; + + /* Copy the packet. */ + status = nx_packet_copy(v4_rst_packet, ©_packet[1], &pool_0, NX_NO_WAIT); + + /* Check status . */ + if (status) + { + error_counter ++; + } + else + { + + /* Update the packet IP header. */ + copy_packet[1] -> nx_packet_ip_header = copy_packet[1] -> nx_packet_prepend_ptr; + + /* Update the copy packet pointer. */ + copy_packet[1] -> nx_packet_prepend_ptr += 20; + copy_packet[1] -> nx_packet_length -= 20; + + tcp_checksum_compute(copy_packet[1]); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet[1]); + } + + /* Check the listen queue current count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_next -> nx_tcp_listen_queue_current != 0) + error_counter ++; + + /* Copy the IP header. */ + v6_syn_packet -> nx_packet_prepend_ptr -= 40; + v6_syn_packet -> nx_packet_length += 40; + + /* Copy the packet. */ + status = nx_packet_copy(v6_syn_packet, ©_packet[2], &pool_0, NX_NO_WAIT); + + /* Check status . */ + if (status) + { + error_counter ++; + } + else + { + + /* Update the packet IP header. */ + copy_packet[2] -> nx_packet_ip_header = copy_packet[2] -> nx_packet_prepend_ptr; + + /* Update the copy packet pointer. */ + copy_packet[2] -> nx_packet_prepend_ptr += 40; + copy_packet[2] -> nx_packet_length -= 40; + + tcp_checksum_compute(copy_packet[2]); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet[2]); + } + + /* Check the listen queue current count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_next -> nx_tcp_listen_queue_current != 1) + error_counter ++; + + /* Copy the IP header. */ + v6_rst_packet -> nx_packet_prepend_ptr -= 40; + v6_rst_packet -> nx_packet_length += 40; + + /* Copy the packet. */ + status = nx_packet_copy(v6_rst_packet, ©_packet[3], &pool_0, NX_NO_WAIT); + + /* Check status . */ + if (status) + { + error_counter ++; + } + else + { + + /* Update the packet IP header. */ + copy_packet[3] -> nx_packet_ip_header = copy_packet[3] -> nx_packet_prepend_ptr; + + /* Update the copy packet pointer. */ + copy_packet[3] -> nx_packet_prepend_ptr += 40; + copy_packet[3] -> nx_packet_length -= 40; + + tcp_checksum_compute(copy_packet[3]); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet[3]); + } + + /* Check the listen queue current count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_next -> nx_tcp_listen_queue_current != 0) + error_counter ++; + + /* Loop to recieve the SYN packet with different source address. */ + for (i = 4; i< 15; i++) + { + + /* Copy the packet. */ + status = nx_packet_copy(v6_syn_packet, ©_packet[i], &pool_0, NX_NO_WAIT); + + /* Check status . */ + if (status) + { + error_counter ++; + } + else + { + + /* Update the packet IP header. */ + copy_packet[i] -> nx_packet_ip_header = copy_packet[i] -> nx_packet_prepend_ptr; + + /* Update the source IP address. */ + if (i >= 6) + { + + /* Points to the base of IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER*)copy_packet[i] -> nx_packet_prepend_ptr; + + /* Update the address. */ + ip_header_ptr -> nx_ip_header_source_ip[3] += i; + } + + /* Update the copy packet pointer. */ + copy_packet[i] -> nx_packet_prepend_ptr += 40; + copy_packet[i] -> nx_packet_length -= 40; + + tcp_checksum_compute(copy_packet[i]); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet[i]); + } + } + + /* Check the listen queue current count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_next -> nx_tcp_listen_queue_current != 5) + error_counter ++; + + /* Loop to recieve the RST packet with different source address. */ + for (i = 14; i >= 4; i--) + { + + /* Copy the packet. */ + status = nx_packet_copy(v6_rst_packet, ©_packet[i], &pool_0, NX_NO_WAIT); + + /* Check status . */ + if (status) + { + error_counter ++; + } + else + { + + /* Update the packet IP header. */ + copy_packet[i] -> nx_packet_ip_header = copy_packet[i] -> nx_packet_prepend_ptr; + + /* Update the source IP address. */ + if (i >= 6) + { + + /* Points to the base of IPv6 header. */ + ip_header_ptr = (NX_IPV6_HEADER*)copy_packet[i] -> nx_packet_prepend_ptr; + + /* Update the address. */ + ip_header_ptr -> nx_ip_header_source_ip[3] += i; + } + + /* Update the copy packet pointer. */ + copy_packet[i] -> nx_packet_prepend_ptr += 40; + copy_packet[i] -> nx_packet_length -= 40; + + tcp_checksum_compute(copy_packet[i]); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet[i]); + } + } + + /* Check the listen queue current count. */ + if (ip_1.nx_ip_tcp_active_listen_requests -> nx_tcp_listen_next -> nx_tcp_listen_queue_current != 0) + error_counter ++; +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +UINT status; +NX_TCP_HEADER *tcp_header_ptr; +ULONG tcp_header_word_3; + + + /* Check the packet version. */ + if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) + { + + /* Get the TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Get the word. */ + tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_word_3); + + /* Check if the packet is an SYN packet. */ + if (tcp_header_word_3 & NX_TCP_SYN_BIT) + { + + /* Update the counter. */ + v4_syn_counter ++; + + /* Check the counter. */ + if (v4_syn_counter == 1) + { + + /* Update the packet prepend and length to include the IPv4 header. */ + packet_ptr -> nx_packet_prepend_ptr -= 20; + packet_ptr -> nx_packet_length += 20; + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, &v4_syn_packet, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet IP header. */ + v4_syn_packet -> nx_packet_ip_header = v4_syn_packet -> nx_packet_prepend_ptr; + + /* Update the packet prepend and length. */ + v4_syn_packet -> nx_packet_prepend_ptr += 20; + v4_syn_packet -> nx_packet_length -= 20; + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, &v4_rst_packet, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet IP header. */ + v4_rst_packet -> nx_packet_ip_header = v4_rst_packet -> nx_packet_prepend_ptr; + + /* Update the packet prepend and length. */ + v4_rst_packet -> nx_packet_prepend_ptr += 20; + v4_rst_packet -> nx_packet_length -= 20; + + /* Get the TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER *)v4_rst_packet -> nx_packet_prepend_ptr; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Clear the SYN bit and set the RST bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = (tcp_header_ptr -> nx_tcp_header_word_3 & (~NX_TCP_SYN_BIT)) | NX_TCP_RST_BIT; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Update the packet prepend and length to include the IPv4 header. */ + packet_ptr -> nx_packet_prepend_ptr += 20; + packet_ptr -> nx_packet_length -= 20; + } + } + } + else if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) + { + + /* Get the TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Get the word. */ + tcp_header_word_3 = tcp_header_ptr -> nx_tcp_header_word_3; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_word_3); + + /* Check if the packet is an SYN packet. */ + if (tcp_header_word_3 & NX_TCP_SYN_BIT) + { + + /* Update the counter. */ + v6_syn_counter ++; + + /* Check the counter. */ + if (v6_syn_counter == 1) + { + + /* Update the packet prepend and length to include the IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, &v6_syn_packet, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet IP header. */ + v6_syn_packet -> nx_packet_ip_header = v6_syn_packet -> nx_packet_prepend_ptr; + + /* Update the packet prepend and length. */ + v6_syn_packet -> nx_packet_prepend_ptr += 40; + v6_syn_packet -> nx_packet_length -= 40; + } + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, &v6_rst_packet, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet IP header. */ + v6_rst_packet -> nx_packet_ip_header = v6_rst_packet -> nx_packet_prepend_ptr; + + /* Update the packet prepend and length. */ + v6_rst_packet -> nx_packet_prepend_ptr += 40; + v6_rst_packet -> nx_packet_length -= 40; + + + /* Get the TCP header. */ + tcp_header_ptr = (NX_TCP_HEADER *)v6_rst_packet -> nx_packet_prepend_ptr; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Clear the SYN bit and set the RST bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = (tcp_header_ptr -> nx_tcp_header_word_3 & (~NX_TCP_SYN_BIT)) | NX_TCP_RST_BIT; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + } + + /* Update the packet prepend and length to include the IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + } + } + } + + tcp_checksum_compute(packet_ptr); + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + + +#if defined(__PRODUCT_NETXDUO__) +static void tcp_checksum_compute(NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG *source_ip, *dest_ip; +ULONG checksum; + + if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) + { + + /* Get IPv4 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 8); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 4); + } + else + { + + /* Get IPv6 addresses. */ + source_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 32); + dest_ip = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 16); + } + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); +} +#else +static void tcp_checksum_compute(PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG source_ip, dest_ip; +ULONG checksum; + + /* Get IPv4 addresses. */ + source_ip = *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 8); + dest_ip = *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr - 4); + + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Calculate the TCP checksum. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum. */ + checksum = _nx_tcp_checksum(packet_ptr, source_ip, dest_ip); + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); +} +#endif /* __PRODUCT_NETXDUO__ */ + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_listen_queue_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Listen Queue Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_socket_listen_test.c b/test/regression/netxduo_test/netx_tcp_socket_listen_test.c new file mode 100644 index 00000000..414e997d --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_listen_test.c @@ -0,0 +1,161 @@ +/* This NetX test concentrates on the TCP Socket unaccept operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET server_socket[NX_MAX_LISTEN_REQUESTS + 1]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_listen_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +UINT server_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Listen Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the server port. */ + server_port = 80; + + /* Loop to create the server socket. */ + for (i = 0; i < NX_MAX_LISTEN_REQUESTS; i++, server_port++) + { + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, server_port, &server_socket[i], 5, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket[i], "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this socket to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, server_port, &server_socket[i], 5, NX_NULL); + + /* Check for error. */ + if (status != NX_MAX_LISTEN) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_mss_test.c b/test/regression/netxduo_test/netx_tcp_socket_mss_test.c new file mode 100644 index 00000000..717a7697 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_mss_test.c @@ -0,0 +1,361 @@ +/* This NetX test concentrates on the TCP Socket MSS set and get operation. */ + +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +#define CLIENT_MSS 1280 +#define SERVER_MSS 640 +#define LARGE_MSS 2000 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +#define CLIENT_PORT 0x88 +#define SERVER_PORT 0x89 + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_mss_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG mss; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket MSS Set Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, CLIENT_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_socket_mss_get(&client_socket, &mss); + + /* Check for error. */ + if (status || (mss != NX_TCP_MSS_SIZE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set MSS smaller than the interface MSS. */ + status = nx_tcp_socket_mss_set(&client_socket, CLIENT_MSS); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_socket_mss_get(&client_socket, &mss); + + /* Check for error. */ + if (status || (mss != CLIENT_MSS)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set MSS larger than the interface MSS. */ + status = nx_tcp_socket_mss_set(&client_socket, LARGE_MSS); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcp_socket_mss_get(&client_socket, &mss); + + /* Check for error. */ + if (status || (mss != SERVER_MSS)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; +ULONG mss; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_socket_mss_get(&server_socket, &mss); + + /* Check for error. */ + if (status || (mss != CLIENT_MSS)) + error_counter++; + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Set MSS. */ + status = nx_tcp_socket_mss_set(&server_socket, SERVER_MSS); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + status = nx_tcp_socket_mss_peer_get(&server_socket, &mss); + + /* Check for error. */ + if (status || (mss != 1460)) + error_counter++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_mss_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket MSS Set Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_socket_receive_rst_test.c b/test/regression/netxduo_test/netx_tcp_socket_receive_rst_test.c new file mode 100644 index 00000000..8069ac6b --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_receive_rst_test.c @@ -0,0 +1,289 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_receive_rst_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +ULONG bytes_received = 0; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Receive RST Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, 2 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 2; i++) + { + status = nx_tcp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + } + else + { + bytes_received += my_packet -> nx_packet_length; + } + } + + /* Check received data. */ + if (bytes_received != 56) + { + error_counter++; + } + + /* Disconnect the server socket. */ + nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); + + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 2; i++) + { + + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&server_socket, packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + } + + /* Send RST. */ + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unlisten on the server port. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_receive_rst_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket Receive RST Test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_relisten_test.c b/test/regression/netxduo_test/netx_tcp_socket_relisten_test.c new file mode 100644 index 00000000..1bec5e8e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_relisten_test.c @@ -0,0 +1,484 @@ +/* This NetX test concentrates on the IPv4 TCP Socket relisten operation. */ + +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; +static NX_TCP_SOCKET server_socket_0; +static NX_TCP_SOCKET server_socket_1; + +/* The 2 ports will hashed to the same index. */ +#define SERVER_PORT_0 0x00000100 +#define SERVER_PORT_1 0x00008100 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT syn_counter = 0; +static NX_PACKET *copy_packet; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_relisten_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Relisten Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_0, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Should return some error message. */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &client_socket_0); + if (status != NX_ALREADY_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket_0, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_1, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Call connect to send a SYN */ + status = nx_tcp_client_socket_connect(&client_socket_1, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_0, &server_socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT_0, &server_socket_0); + + /* Check for error. */ + if (status != NX_NOT_CLOSED) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_1, "Server Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_1, &server_socket_1, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the socket state. */ + if (server_socket_1.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Check the TCP port table. */ + if ((ip_1.nx_ip_tcp_port_table[1] != &server_socket_0) || (ip_1.nx_ip_tcp_port_table[1] -> nx_tcp_socket_bound_next != &server_socket_0)) + error_counter++; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet); + + /* Relisten. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT_1, &server_socket_1); + + /* Check for error. */ + if (status != NX_CONNECTION_PENDING) + error_counter++; + + /* Check the socket state. */ + if (server_socket_1.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Check the mss value. */ + if (server_socket_1.nx_tcp_socket_peer_mss != 536) + error_counter++; + + /* Check the TCP port table. */ + if ((ip_1.nx_ip_tcp_port_table[1] != &server_socket_0) || (ip_1.nx_ip_tcp_port_table[1] -> nx_tcp_socket_bound_next != &server_socket_1)) + error_counter++; +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +UINT status; +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +ULONG old_m; +ULONG new_m; + + /* Update the counter. */ + syn_counter ++; + + /* Check the counter. */ + if (syn_counter == 1) + { + + /* Update the packet prepend and length to include the IPv4 header. */ + packet_ptr -> nx_packet_prepend_ptr -= 20; + packet_ptr -> nx_packet_length += 20; + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + +#ifdef __PRODUCT_NETXDUO__ + /* Update the packet IP header. */ + copy_packet -> nx_packet_ip_header = copy_packet -> nx_packet_prepend_ptr; +#endif /* __PRODUCT_NETXDUO__ */ + + /* Update the packet prepend and length. */ + copy_packet -> nx_packet_prepend_ptr += 20; + copy_packet -> nx_packet_length -= 20; + + /* Update the packet prepend and length to include the IPv4 header. */ + packet_ptr -> nx_packet_prepend_ptr += 20; + packet_ptr -> nx_packet_length -= 20; + + /* Get the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) copy_packet -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Get the old checksum (HC) in header. */ + checksum = tcp_header_ptr -> nx_tcp_header_word_4 >> 16; + + /* Get the old mss. */ + old_m = *option_word_1 & 0x0000FFFF;; + + /* Set the new TTL as 1. */ + new_m = 0; + + /* Update the mss value as zero. */ + *option_word_1 = NX_TCP_MSS_OPTION | new_m; + + /* Update the checksum, get the new checksum(HC'), + The new_m is ULONG value, so need get the lower value after invert. */ + checksum = ((~checksum) & 0xFFFF) + ((~old_m) & 0xFFFF) + new_m; + + /* Fold a 4-byte value into a two byte value */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Do it again in case previous operation generates an overflow */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Now store the new checksum in the IP header. */ + tcp_header_ptr -> nx_tcp_header_word_4 = ((tcp_header_ptr -> nx_tcp_header_word_4 & 0x0000FFFF) | ((~checksum) << 16)); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + } + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_relisten_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket Relisten Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_socket_relisten_test2.c b/test/regression/netxduo_test/netx_tcp_socket_relisten_test2.c new file mode 100644 index 00000000..38c573ac --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_relisten_test2.c @@ -0,0 +1,503 @@ +/* This NetX test concentrates on the IPv6 TCP Socket relisten operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#ifdef FEATURE_NX_IPV6 + +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; +static NX_TCP_SOCKET server_socket_0; +static NX_TCP_SOCKET server_socket_1; + +/* The 2 ports will hashed to the same index. */ +#define SERVER_PORT_0 0x00000100 +#define SERVER_PORT_1 0x00008100 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT syn_counter = 0; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NX_PACKET *copy_packet; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_relisten_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check IPv6 enable status. */ + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMP enable status. */ + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Relisten Test 2................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_0, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Should return some error message. */ + status = nx_tcp_server_socket_relisten(&ip_0, 12, &client_socket_0); + if (status != NX_ALREADY_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to send a SYN */ + status = nxd_tcp_client_socket_connect(&client_socket_0, &ipv6_address_2, SERVER_PORT_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_1, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Call connect to send a SYN */ + status = nxd_tcp_client_socket_connect(&client_socket_1, &ipv6_address_2, SERVER_PORT_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_0, &server_socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT_0, &server_socket_0); + + /* Check for error. */ + if (status != NX_NOT_CLOSED) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_1, "Server Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_1, &server_socket_1, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the socket state. */ + if (server_socket_1.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Check the TCP port table. */ + if ((ip_1.nx_ip_tcp_port_table[1] != &server_socket_0) || (ip_1.nx_ip_tcp_port_table[1] -> nx_tcp_socket_bound_next != &server_socket_0)) + error_counter++; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(&ip_1, copy_packet); + + /* Relisten. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT_1, &server_socket_1); + + /* Check for error. */ + if (status != NX_CONNECTION_PENDING) + error_counter++; + + /* Check the socket state. */ + if (server_socket_1.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Check the mss value. */ + if (server_socket_1.nx_tcp_socket_peer_mss != 1220) + error_counter++; + + /* Check the TCP port table. */ + if ((ip_1.nx_ip_tcp_port_table[1] != &server_socket_0) || (ip_1.nx_ip_tcp_port_table[1] -> nx_tcp_socket_bound_next != &server_socket_1)) + error_counter++; +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +UINT status; +NX_TCP_HEADER *tcp_header_ptr; +ULONG *option_word_1; +ULONG checksum; +ULONG old_m; +ULONG new_m; + + /* Update the counter. */ + syn_counter ++; + + /* Check the counter. */ + if (syn_counter == 1) + { + + /* Update the packet prepend and length to include the IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + /* Store the packet. */ + status = nx_packet_copy(packet_ptr, ©_packet, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + else + { + + /* Update the packet IP header. */ + copy_packet -> nx_packet_ip_header = copy_packet -> nx_packet_prepend_ptr; + + /* Update the packet prepend and length. */ + copy_packet -> nx_packet_prepend_ptr += 40; + copy_packet -> nx_packet_length -= 40; + + /* Update the packet prepend and length to include the IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get the TCP header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) copy_packet -> nx_packet_prepend_ptr; + option_word_1 = (ULONG *)(tcp_header_ptr + 1); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + + /* Get the old checksum (HC) in header. */ + checksum = tcp_header_ptr -> nx_tcp_header_word_4 >> 16; + + /* Get the old mss. */ + old_m = *option_word_1 & 0x0000FFFF;; + + /* Set the new TTL as 1. */ + new_m = 0; + + /* Update the mss value as zero. */ + *option_word_1 = NX_TCP_MSS_OPTION | new_m; + + /* Update the checksum, get the new checksum(HC'), + The new_m is ULONG value, so need get the lower value after invert. */ + checksum = ((~checksum) & 0xFFFF) + ((~old_m) & 0xFFFF) + new_m; + + /* Fold a 4-byte value into a two byte value */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Do it again in case previous operation generates an overflow */ + checksum = (checksum >> 16) + (checksum & 0xFFFF); + + /* Now store the new checksum in the IP header. */ + tcp_header_ptr -> nx_tcp_header_word_4 = ((tcp_header_ptr -> nx_tcp_header_word_4 & 0x0000FFFF) | ((~checksum) << 16)); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(*option_word_1); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + } + } + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_relisten_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Relisten Test 2................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_socket_send_internal_test.c b/test/regression/netxduo_test/netx_tcp_socket_send_internal_test.c new file mode 100644 index 00000000..5121b2f5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_send_internal_test.c @@ -0,0 +1,213 @@ +/* This NetX test concentrates on the branches coverage for _nx_tcp_socket_send_internal functions, + 697 [ + - ]: 1 : if (preempted == NX_TRUE) + + 706 [ + - ]: 1 : if (send_packet != packet_ptr) +*/ + +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET tcp_socket; +static UCHAR pool_area[8192]; +static UCHAR send_buffer[3000]; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static UINT thread1_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_send_internal_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + thread1_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pool_area, sizeof(pool_area)); + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket Send Internal Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &tcp_socket, "TCP Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + + /* Set TCP socket as establish. */ + tcp_socket.nx_tcp_socket_state = NX_TCP_ESTABLISHED; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_version = NX_IP_VERSION_V4; + tcp_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + tcp_socket.nx_tcp_socket_connect_interface = &ip_0.nx_ip_interface[0]; + tcp_socket.nx_tcp_socket_bound_next = &tcp_socket; + tcp_socket.nx_tcp_socket_tx_window_advertised = 65535; + tcp_socket.nx_tcp_socket_tx_window_congestion = 65535; + tcp_socket.nx_tcp_socket_tx_outstanding_bytes = 0; + tcp_socket.nx_tcp_socket_mss = 216; + tcp_socket.nx_tcp_socket_transmit_sent_head = NX_NULL; + + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data. */ + status = nx_packet_data_append(packet_ptr, send_buffer, 100, &pool_0, NX_NO_WAIT); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread1 to check the state. */ + tx_thread_relinquish(); + + /* Send packet, get the mutex after check the socket state, . */ + status = _nx_tcp_socket_send_internal(&tcp_socket, packet_ptr, 2 * NX_IP_PERIODIC_RATE); + + if(status != NX_NOT_CONNECTED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Determine if the test was successful. */ + if ((thread1_counter != 1) || (error_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ + + /* Update the counter. */ + thread1_counter ++; + + /* Place protection while we check the sequence number for the new TCP packet. */ + tx_mutex_get(&(ip_0.nx_ip_protection), TX_WAIT_FOREVER); + + /* Sleep one second. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Change the state. */ + tcp_socket.nx_tcp_socket_state = NX_TCP_CLOSED; + + /* Release the mutex before a blocking call. */ + tx_mutex_put(&(ip_0.nx_ip_protection)); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_send_internal_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket Send Internal Test.............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_socket_state_wait_test.c b/test/regression/netxduo_test/netx_tcp_socket_state_wait_test.c new file mode 100644 index 00000000..e758a973 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_state_wait_test.c @@ -0,0 +1,305 @@ +/* This NetX test concentrates on the TCP Socket state wait operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_state_wait_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket State Wait Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Clear the socket ID. */ + client_socket.nx_tcp_socket_id = NX_NULL; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, NX_NO_WAIT); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the socket ID. */ + client_socket.nx_tcp_socket_id = NX_TCP_ID; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_NOT_SUCCESSFUL) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete server socket*/ + nx_tcp_socket_disconnect(&server_socket, 0); + nx_tcp_server_socket_unaccept(&server_socket); + nx_tcp_server_socket_unlisten(&ip_1, 12); + nx_tcp_socket_delete(&server_socket); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create the TCP socket server in 500 ticks. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&server_socket, NX_TCP_SYN_SENT, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status != NX_PTR_ERROR) + { + error_counter++; + } + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_state_wait_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket State Wait Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_unaccept_test.c b/test/regression/netxduo_test/netx_tcp_socket_unaccept_test.c new file mode 100644 index 00000000..a24a66bc --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_unaccept_test.c @@ -0,0 +1,360 @@ +/* This NetX test concentrates on the TCP Socket unaccept operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; +static NX_TCP_SOCKET server_socket_0; +static NX_TCP_SOCKET server_socket_1; + +/* The 2 ports will hashed to the same index. */ +#define SERVER_PORT_0 0x00000100 +#define SERVER_PORT_1 0x00008100 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_unaccept_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT client_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Unaccept Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_0, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket_0, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT_0, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket_1, client_port, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket_1, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&client_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_0, &server_socket_0, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the socket state. */ + if (server_socket_0.nx_tcp_socket_state != NX_TCP_LISTEN_STATE) + error_counter++; + + /* Unaccept server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check the socket state. */ + if (server_socket_0.nx_tcp_socket_state != NX_TCP_CLOSED) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_relisten(&ip_1, SERVER_PORT_0, &server_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_0, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket_1, "Server Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT_1, &server_socket_1, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket_1, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket_1); + + /* Check for error. */ + if (status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_unaccept_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Socket Unaccept Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_socket_unbind_test.c b/test/regression/netxduo_test/netx_tcp_socket_unbind_test.c new file mode 100644 index 00000000..30174838 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_unbind_test.c @@ -0,0 +1,273 @@ +/* This NetX test concentrates on the TCP Socket Unbind operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; +static NX_TCP_SOCKET client_socket_2; +static NX_TCP_SOCKET client_socket_3; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +/* The 2 ports will hashed to the same index. */ +#define CLIENT_PORT_1 0x00000100 +#define CLIENT_PORT_2 0x00008100 + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_unbind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Unbind Cleanup Test 1.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket 0. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create a socket 1. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket 0. */ + status = nx_tcp_client_socket_bind(&client_socket_0, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket 1. */ + status = nx_tcp_client_socket_bind(&client_socket_1, CLIENT_PORT_2, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let socket 2 bind to CLIENT_PORT_1. */ + tx_thread_relinquish(); + + /* Unbind the socket 0. */ + status = nx_tcp_client_socket_unbind(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket 1. */ + status = nx_tcp_client_socket_unbind(&client_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 0. */ + status = nx_tcp_socket_delete(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 0. */ + status = nx_tcp_socket_delete(&client_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Let thread 1 finish jobs */ + tx_thread_relinquish(); + + /* Check status. */ + if ((error_counter)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket 2. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_2, "Client Socket 2", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Bind the socket 2 to the port socket 0 has bound to */ + status = nx_tcp_client_socket_bind(&client_socket_2, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket 2. */ + status = nx_tcp_client_socket_unbind(&client_socket_2); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 1. */ + status = nx_tcp_socket_delete(&client_socket_2); + + /* Check for error. */ + if (status) + error_counter++; + + +} + +static void thread_2_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket 3. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_3, "Client Socket 3", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket 3 to the port socket 0 has bound to */ + status = nx_tcp_client_socket_bind(&client_socket_3, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket 3. */ + status = nx_tcp_client_socket_unbind(&client_socket_3); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 3. */ + status = nx_tcp_socket_delete(&client_socket_3); + + /* Check for error. */ + if (status) + error_counter++; + +} diff --git a/test/regression/netxduo_test/netx_tcp_socket_unbind_test2.c b/test/regression/netxduo_test/netx_tcp_socket_unbind_test2.c new file mode 100644 index 00000000..16ddbfd5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_unbind_test2.c @@ -0,0 +1,192 @@ +/* This NetX test concentrates on the TCP Socket Unbind operation. */ + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET client_socket_0; +static NX_TCP_SOCKET client_socket_1; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +/* The 2 ports will hashed to the same index. */ +#define CLIENT_PORT_1 0x00000100 +#define CLIENT_PORT_2 0x00008100 + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_unbind_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Unbind Cleanup Test 2.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket 0. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket 0. */ + status = nx_tcp_client_socket_bind(&client_socket_0, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let socket 1 bind to CLIENT_PORT_1. */ + tx_thread_relinquish(); + + /* Unbind the socket 0. */ + status = nx_tcp_client_socket_unbind(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 0. */ + status = nx_tcp_socket_delete(&client_socket_0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Check status. */ + if ((error_counter)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket 2. */ + status = nx_tcp_socket_create(&ip_0, &client_socket_1, "Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Bind the socket 1 to the port socket 0 has bound to */ + status = nx_tcp_client_socket_bind(&client_socket_1, CLIENT_PORT_2, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unbind the socket 1. */ + status = nx_tcp_client_socket_unbind(&client_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket 1. */ + status = nx_tcp_socket_delete(&client_socket_1); + + /* Check for error. */ + if (status) + error_counter++; + +} + diff --git a/test/regression/netxduo_test/netx_tcp_socket_unlisten_test.c b/test/regression/netxduo_test/netx_tcp_socket_unlisten_test.c new file mode 100644 index 00000000..c6791e53 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_socket_unlisten_test.c @@ -0,0 +1,184 @@ +/* This NetX test concentrates on the TCP Socket unaccept operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET server_socket[2]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_socket_unlisten_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable TCP processing for IP instance. */ + status = nx_tcp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Socket Unlisten Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket[0], "Server Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 0x80, &server_socket[0], 5, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &server_socket[1], "Server Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_0, 0x81, &server_socket[1], 5, NX_NULL); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x82); + + /* Check for error. */ + if (status != NX_ENTRY_NOT_FOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x80); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_unlisten(&ip_0, 0x81); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_time_wait_to_close_test.c b/test/regression/netxduo_test/netx_tcp_time_wait_to_close_test.c new file mode 100644 index 00000000..3c747219 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_time_wait_to_close_test.c @@ -0,0 +1,242 @@ +/* This NetX test concentrates on TCP state change from TIME-WAIT to CLOSE. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_time_wait_to_close_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TCP TIME-WAIT to CLOSE Test..............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let server listen first. */ + tx_thread_relinquish(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Check server state. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_TIMED_WAIT) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for 2MSL. */ + tx_thread_sleep(_nx_tcp_2MSL_timer_rate + NX_IP_PERIODIC_RATE); + + /* Check server state. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + { + error_counter++; + } + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Let client disconnect first. */ + tx_thread_relinquish(); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_time_wait_to_close_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: TCP TIME-WAIT to CLOSE Test...............................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_tcp_transmit_cleanup_test.c b/test/regression/netxduo_test/netx_tcp_transmit_cleanup_test.c new file mode 100644 index 00000000..3417ceab --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_transmit_cleanup_test.c @@ -0,0 +1,427 @@ +/* This NetX test concentrates on the basic TCP operation. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; +static TX_THREAD thread_3; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +static void thread_3_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_transmit_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_3, "thread 3", thread_3_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT compare_port; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Transmit Cleanup Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&client_socket, thread_0_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Pickup the port for the client socket. */ + status = nx_tcp_client_socket_port_get(&client_socket, &compare_port); + + /* Check for error. */ + if ((status) || (client_port != compare_port)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. 220bytes. */ + my_packet -> nx_packet_length = 220; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 220; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_transmit_suspended_count != 0) + error_counter++; + + /* Send the packet out, the window size of server socket is 100! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_WINDOW_OVERFLOW) + error_counter++; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_transmit_suspended_count != 0) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. 220bytes. */ + my_packet -> nx_packet_length = 220; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 220; + + /* Check the TCP socket bind suspended count. */ + if (client_socket.nx_tcp_socket_transmit_suspended_count != 1) + error_counter++; + + /* Send the packet out, the window size of server socket is 100! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + /* Check status. */ + if (status != NX_WINDOW_OVERFLOW) + error_counter++; +#else + if (status != NX_ALREADY_SUSPENDED) + error_counter++; +#endif + + /* Check the TCP socket transmit suspended count. */ + if (client_socket.nx_tcp_socket_transmit_suspended_count != 1) + error_counter++; +} + +static void thread_2_entry(ULONG thread_input) +{ + + +#ifdef __PRODUCT_NETXDUO__ + /* Check the TCP socket transmit suspended count. */ + if (client_socket.nx_tcp_socket_transmit_suspended_count != 2) + error_counter++; +#else + if (client_socket.nx_tcp_socket_transmit_suspended_count != 1) + error_counter++; +#endif +} + +static void thread_3_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket(window size = 100). */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup a receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, thread_1_receive_notify); + + /* Check for error. */ + if (status) + error_counter++; + + /* Configure the socket further. */ + status = nx_tcp_socket_transmit_configure(&server_socket, 10, 300, 10, 0); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Resume the test thread. */ + tx_thread_resume(&thread_1); + tx_thread_resume(&thread_2); +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_transmit_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Transmit Cleanup Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_transmit_not_done_test.c b/test/regression/netxduo_test/netx_tcp_transmit_not_done_test.c new file mode 100644 index 00000000..f459b44d --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_transmit_not_done_test.c @@ -0,0 +1,299 @@ +/* This NetX test concentrates on the TCP transmitting packet is not done by driver before + * the socket is going to close. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_transmit_not_done_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Transmit Not Done Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Let driver delay the packet for 1 second. */ + advanced_packet_process_callback = packet_process; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Verify the packet is queued in the TX queue. */ + if (client_socket.nx_tcp_socket_transmit_sent_count != 1) + { + error_counter++; + } + + /* Wakeup server thread. */ + tx_thread_resume(&thread_1); + + /* Disconnect this socket without waiting. */ + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Wait 2 seconds and driver will release the transmitting packet. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Verify all packets are released. */ + if (pool_0.nx_packet_pool_available != pool_0.nx_packet_pool_total) + { + error_counter++; + } + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Let client thread run first. */ + tx_thread_suspend(&thread_1); + + /* Disconnect the server socket without waiting. */ + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Delay 1 second. */ + *operation_ptr = NX_RAMDRIVER_OP_DELAY; + *delay_ptr = NX_IP_PERIODIC_RATE; + + advanced_packet_process_callback = NX_NULL; + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_transmit_not_done_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Transmit Not Done Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_transmit_under_interface_detach_test.c b/test/regression/netxduo_test/netx_tcp_transmit_under_interface_detach_test.c new file mode 100644 index 00000000..1e46c34b --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_transmit_under_interface_detach_test.c @@ -0,0 +1,288 @@ +/* This NetX test concentrates on the TCP Socket connect reset operation under interface deatch(tested transmit queue count and transmit suspension list). */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined __PRODUCT_NETXDUO__ && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_TCP_SOCKET test_socket; + + +/* Define the counters used in the test application... */ + +static ULONG error_counter; +static ULONG ntest_2_counter; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_transmit_under_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2, 2, 3, 4), 0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2, 2, 3, 5), 0xFFFFFF00UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Transmit Under Interface Detach Test.................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 20, + NX_NULL, NX_NULL); + + /* Create a temp socket checked during interface detach. */ + status += nx_tcp_socket_create(&ip_0, &test_socket, "Test Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 20, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the client_socket port to 12. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_NO_WAIT); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(2, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Resume the thread 2. */ + tx_thread_resume(&ntest_2); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! This packe should not be sent. */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Check the error counter. */ + if ((error_counter) || (ntest_2_counter != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the test threads. */ + +static void ntest_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 20, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 2 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void ntest_2_entry(ULONG thread_input) +{ + +UINT status; + + /* Update the ntest_2_counter. */ + ntest_2_counter++; + + /* Check the TCP socket transmit suspended count. */ + if (client_socket.nx_tcp_socket_transmit_sent_count != 1) + error_counter++; + if (client_socket.nx_tcp_socket_transmit_suspension_list == NX_NULL) + error_counter++; + + /* Detach the second interface for IP instance 2. */ + status = nx_ip_interface_detach(&ip_0, 1); + + /* Check the status. */ + if (status) + error_counter++; + + /* Check the TCP socket transmit suspended count. */ + if (client_socket.nx_tcp_socket_transmit_sent_count != 0) + error_counter++; + if (client_socket.nx_tcp_socket_transmit_suspension_list != NX_NULL) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_transmit_under_interface_detach_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: TCP Transmit Under Interface Detach Test..................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv4_basic_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv4_basic_test.c new file mode 100644 index 00000000..18502231 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv4_basic_test.c @@ -0,0 +1,466 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_4 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V4,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020305; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020304; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Suspend thread 0. */ + tx_thread_suspend(&thread_0); + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_4 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_address_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_address_test.c new file mode 100644 index 00000000..b2e7aadd --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_address_test.c @@ -0,0 +1,419 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" + +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; +NXD_ADDRESS ipv6_address_5; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + ipv6_address_5.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_5.nxd_ip_address.v6[0] = 0x40010000; + ipv6_address_5.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_5.nxd_ip_address.v6[3] = 0x20000005; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 ADDRESS Processing Test....."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* Add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_5; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_5; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Suspend thread 0. */ + tx_thread_suspend(&thread_0); + + if ((client_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state == NX_TCP_ESTABLISHED)) + { + error_counter++; + } + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 ADDRESS Processing Test.................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_basic_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_basic_test.c new file mode 100644 index 00000000..58d66aff --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_basic_test.c @@ -0,0 +1,502 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Suspend thread 0. */ + tx_thread_suspend(&thread_0); + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_big_packet_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_big_packet_test.c new file mode 100644 index 00000000..5d155bff --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_big_packet_test.c @@ -0,0 +1,515 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[2000]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_big_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1660, pointer, 10248); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 Big Packet Test............."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2000, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 1460); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 1460; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 1460; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2000, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Suspend thread 0. */ + tx_thread_suspend(&thread_0); + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length += packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(recv_length != 1460) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_big_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 Big Packet Test.........................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_small_windows_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_small_windows_test.c new file mode 100644 index 00000000..7b52e94a --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv4_ipv6_small_windows_test.c @@ -0,0 +1,626 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_samll_windows_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_256); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; +ULONG start_time; +ULONG end_time; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 Small Windows Test.........."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 128, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Send 5 packets... the 5th packet should block because of the window size. */ + + /* Allocate a 1st packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 2nd packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 3rd packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 4th packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a 5th packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Remember the starting time. */ + start_time = tx_time_get(); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Get the end time. */ + end_time = tx_time_get(); + + /* Determine if the status is valid. */ + if ((status) || (end_time > (start_time+4))) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 128, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Suspend thread 0. */ + tx_thread_suspend(&thread_0); + + /* Receive five TCP messages from the socket - 1st packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 2nd packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 3rd packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 4th packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive five TCP messages from the socket - 5th packet. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if ((status) || (packet_ptr -> nx_packet_length != 28)) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv4_ipv6_samll_windows_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV4_6 Small Windows Test......................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv4_basic_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv4_basic_test.c new file mode 100644 index 00000000..d8d008c6 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv4_basic_test.c @@ -0,0 +1,521 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv6_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV6_4 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V4,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 4 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020305; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020304; + + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V4,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Supsend thread 0. */ + tx_thread_suspend(&thread_0); + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + tx_thread_resume(&thread_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv6_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV6_4 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv6_basic_test.c b/test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv6_basic_test.c new file mode 100644 index 00000000..1643ce13 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tunnel_ipv6_ipv6_basic_test.c @@ -0,0 +1,517 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static ULONG connections = 0; +static ULONG disconnections = 0; +static ULONG client_receives = 0; +static ULONG server_receives = 0; +static UINT client_port; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket); +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv6_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + connections = 0; + disconnections = 0; + client_receives = 0; + server_receives = 0; + client_port = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV6_6 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Get a free port for the client's use. */ + status = nx_tcp_free_port_find(&ip_0, 1, &client_port); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, client_port, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Wait for established state. */ + status = nx_tcp_socket_state_wait(&client_socket, NX_TCP_ESTABLISHED, 5 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 4 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Supsend thread 0. */ + tx_thread_suspend(&thread_0); + + /* Receive a TCP message from the socket. */ + if(server_socket.nx_tcp_socket_receive_queue_head) + { + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + tx_thread_resume(&thread_0); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; + else + connections++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; + else + disconnections++; +} + +static void thread_0_receive_notify(NX_TCP_SOCKET *client_socket) +{ + + client_receives++; +} + + +static void thread_1_receive_notify(NX_TCP_SOCKET *server_socket) +{ + + server_receives++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tunnel_ipv6_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL TCP IPV6_6 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_tx_queue_exceed_test.c b/test/regression/netxduo_test/netx_tcp_tx_queue_exceed_test.c new file mode 100644 index 00000000..748862d4 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_tx_queue_exceed_test.c @@ -0,0 +1,316 @@ +/* This NetX test concentrates on the TCP TX queue exceed. */ + +#include "nx_api.h" +#include "nx_tcp.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + +static UCHAR pool_area[1024 * 1024]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tx_queue_exceed_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pool_area, sizeof(pool_area)); + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP TX Queue Exceed Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Drop ACK from server to client. */ + ip_0.nx_ip_tcp_packet_receive = tcp_packet_receive; + + for (i = 0; i < NX_TCP_MAXIMUM_TX_QUEUE + 2; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "A", 1, &pool_0, 2 * NX_NO_WAIT); + if(status) + error_counter++; + + /* Send the packet out! */ + if (i == (NX_TCP_MAXIMUM_TX_QUEUE + 1)) + { + status = nx_tcp_socket_send(&client_socket, my_packet, NX_NO_WAIT); + } + else + { + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + } + + if (i < NX_TCP_MAXIMUM_TX_QUEUE) + { + + /* For first NX_TCP_MAXIMUM_TX_QUEUE packets, send should be always success. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + else + { + + /* Queue depth exceeded. */ + if (status != NX_TX_QUEUE_DEPTH) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + } + } + + /* Recover TCP packet process from server to client. */ + ip_0.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Wakeup server thread. */ + tx_thread_resume(&thread_1); + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Wait until client thread finishes testing. */ + tx_thread_suspend(&thread_1); + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static VOID tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + /* Drop packet from server to client. */ + nx_packet_release(packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_tx_queue_exceed_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP TX Queue Exceed Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_udp_random_port_test.c b/test/regression/netxduo_test/netx_tcp_udp_random_port_test.c new file mode 100644 index 00000000..aa1c97a3 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_udp_random_port_test.c @@ -0,0 +1,215 @@ +/* This NetX test concentrates on the TCP and UDP free port find. + * The port is random but not incremental. Follow section 3.3.1, RFC 6056. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_TCP_SOCKET tcp_socket[2]; +static NX_UDP_SOCKET udp_socket[2]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_udp_random_port_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&ip_0); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UCHAR not_incremental; +UINT status; +UINT previous_port; +UINT port; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: TCP UDP Random Port Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket. */ + nx_tcp_socket_create(&ip_0, &tcp_socket[0], "TCP Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + nx_tcp_socket_create(&ip_0, &tcp_socket[1], "TCP Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + status = nx_tcp_client_socket_bind(&tcp_socket[1], NX_ANY_PORT, NX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + /* TCP random port test. */ + not_incremental = NX_FALSE; + nx_tcp_client_socket_port_get(&tcp_socket[1], &previous_port); + + for (i = 0; i < TEST_LOOP; i++) + { + + previous_port++; + if (previous_port == NX_MAX_PORT) + { + previous_port = 1; + } + status = nx_tcp_client_socket_bind(&tcp_socket[i & 1], NX_ANY_PORT, NX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + nx_tcp_client_socket_port_get(&tcp_socket[i & 1], &port); + + /* Check whether free_port is increased by one of previous_port. */ + if (port != previous_port) + { + not_incremental = NX_TRUE; + } + + nx_tcp_client_socket_unbind(&tcp_socket[1 - (i & 1)]); + + previous_port = port; + } + + if (not_incremental == NX_FALSE) + { + error_counter++; + } + + /* Create a UDP socket. */ + nx_udp_socket_create(&ip_0, &udp_socket[0], "UDP Socket 0", NX_IP_NORMAL, + NX_FRAGMENT_OKAY, 0x80, 5); + nx_udp_socket_create(&ip_0, &udp_socket[1], "UDP Socket 1", NX_IP_NORMAL, + NX_FRAGMENT_OKAY, 0x80, 5); + + status = nx_udp_socket_bind(&udp_socket[1], NX_ANY_PORT, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + /* UDP random port test. */ + not_incremental = NX_FALSE; + nx_udp_socket_port_get(&udp_socket[1], &previous_port); + + for (i = 0; i < TEST_LOOP; i++) + { + + previous_port++; + if (previous_port == NX_MAX_PORT) + { + previous_port = 1; + } + status = nx_udp_socket_bind(&udp_socket[i & 1], NX_ANY_PORT, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + error_counter++; + + nx_udp_socket_port_get(&udp_socket[i & 1], &port); + + /* Check whether free_port is increased by one of previous_port. */ + if (port != previous_port) + { + not_incremental = NX_TRUE; + } + + nx_udp_socket_unbind(&udp_socket[1 - (i & 1)]); + + previous_port = port; + } + + if (not_incremental == NX_FALSE) + { + error_counter++; + } + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} diff --git a/test/regression/netxduo_test/netx_tcp_urgent_packet_test.c b/test/regression/netxduo_test/netx_tcp_urgent_packet_test.c new file mode 100644 index 00000000..f1ba24da --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_urgent_packet_test.c @@ -0,0 +1,337 @@ +/* This NetX test concentrates on the TCP urgent packet operation. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#include "nx_tcp.h" +#include "nx_ip.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +#define CLIENT_PORT 0x88 +#define SERVER_PORT 0x89 + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT urg_received = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static VOID tcp_urgent_data_callback(NX_TCP_SOCKET *socket_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_urgent_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + /* Check the status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check the status. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Urgent Packet Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, CLIENT_PORT, NX_NO_WAIT); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Call connect to establish connection. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), SERVER_PORT, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check the client and server socket state. */ + if ((client_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED) || (server_socket.nx_tcp_socket_state != NX_TCP_ESTABLISHED)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set the callback function. */ + ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check status. */ + if ((error_counter) || (urg_received != 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_status; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, 1 * NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, + tcp_urgent_data_callback, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; +} + +static VOID tcp_urgent_data_callback(NX_TCP_SOCKET *socket_ptr) +{ + urg_received++; +} + +static void my_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_TCP_HEADER *tcp_header_ptr; +ULONG checksum; +ULONG *source_ip, *dest_ip; + + /* Check if it is a data packet (TCP(20) + DATA(28)). */ + if (packet_ptr ->nx_packet_length == 48) + { + + /* Set the tcp header pointer. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr ->nx_packet_prepend_ptr; + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Set the URG bit. */ + tcp_header_ptr -> nx_tcp_header_word_3 = (tcp_header_ptr -> nx_tcp_header_word_3 | NX_TCP_URG_BIT); + + /* Swap the endianess. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr ->nx_tcp_header_word_3); + + /* Clear the checksum field. */ + tcp_header_ptr -> nx_tcp_header_word_4 = 0; + + /* Calculate the checksum . */ + dest_ip = &client_socket.nx_tcp_socket_connect_ip.nxd_ip_address.v4; + source_ip = &client_socket.nx_tcp_socket_connect_interface -> nx_interface_ip_address; + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + packet_ptr -> nx_packet_length, + source_ip, dest_ip); + checksum = ~checksum & NX_LOWER_16_MASK; + tcp_header_ptr -> nx_tcp_header_word_4 = (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + } + + /* Clear the callback function. */ + ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; + + /* Let server receive the packet. */ + _nx_tcp_packet_receive(ip_ptr, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_urgent_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Urgent Packet Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_window_update_test.c b/test/regression/netxduo_test/netx_tcp_window_update_test.c new file mode 100644 index 00000000..23ea06f5 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_window_update_test.c @@ -0,0 +1,314 @@ +/* If the ACK is a duplicate, the window size can be ignored. Page 72, Section 3.9, RFC 793. */ + +/* Procedure +1. Client socket connects to server socket. +2. Client sends five packets to server. The size of each packet is 1/5 of window size. Then the send window should be zero. +3. Drop the second packet from client to server. +4. Try to send 1/5 of window size from client to server without wait. It should fail since send window is zero. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static NX_PACKET *drop_packet = NX_NULL; + +/* Define the counters used in the test application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_window_update_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_512, + pointer, 2048, 2); + pointer = pointer + 2048; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if(status) + error_counter++; +} + +/* Define the test threads. */ +static UCHAR send_buffer[200]; + +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: TCP Window Update Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_relinquish(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; + + /* The callback function is used to drop the second data packet. */ + advanced_packet_process_callback = my_packet_process; + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 1 * NX_IP_PERIODIC_RATE); + + /* Check the connection status. */ + if(status != NX_SUCCESS) + error_counter++; + + /* Send two packets. */ + for(i = 0; i < 2; i++) + { + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, sizeof(send_buffer), &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, 0); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Wait ACK packet. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, sizeof(send_buffer), &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Drop the packet. */ + drop_packet = packet_ptr; + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, 0); + if(status != NX_SUCCESS) + error_counter++; + + /* Send two packets. */ + for(i = 0; i < 2; i++) + { + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, sizeof(send_buffer), &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Send the pacekt. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, 0); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Allocate a packet and fill data. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + else + { + status = nx_packet_data_append(packet_ptr, send_buffer, sizeof(send_buffer), &pool_0, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + } + + /* Send the pacekt. Since window is full, send call should not be successful. */ + status = nx_tcp_socket_send(&client_socket, packet_ptr, 0); + if(status == NX_SUCCESS) + error_counter++; + + /* Determine if the test was successful. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static void ntest_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, sizeof(send_buffer) * 5, + NX_NULL, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if(status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if(status) + error_counter++; +} + +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + if(packet_ptr == drop_packet) + { + + /* This packet should be dropped. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + drop_packet = NX_NULL; + return NX_TRUE; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_window_update_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Window Update Test....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test.c b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test.c new file mode 100644 index 00000000..b9677612 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test.c @@ -0,0 +1,488 @@ +/* This NetX test concentrates on the wrapping of RX and TX sequence numbers. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); +static void thread_1_disconnect_received(NX_TCP_SOCKET *server_socket); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + + /* Print out test information banner. */ + printf("NetX Test: TCP Wrapping RX/TX Sequence Test.........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + tx_thread_relinquish(); + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + tx_thread_relinquish(); + + /* Loop to repeat things over and over again! */ + thread_0_counter = 0; + while ((thread_0_counter < 2000) && (!error_counter)) + { + + /* Increment thread 0's counter. */ + thread_0_counter++; + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_suspend(&thread_0); + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Determine if the test was successful. */ + if ((error_counter) || (thread_0_counter != 2000) || (thread_1_counter != 2000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +ULONG sequence_increment = 1; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + + /* Check status... */ + if (status != NX_SUCCESS) + { + + error_counter++; + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, thread_1_disconnect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, thread_1_connect_received); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Supsend thread 0. */ + tx_thread_suspend(&thread_0); + nx_tcp_socket_state_wait(&server_socket, NX_TCP_ESTABLISHED, 2 * NX_IP_PERIODIC_RATE); + tx_thread_resume(&thread_0); + + /* Set all the sequence numbers the way we want them for our test. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00; + client_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00; + client_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00; + server_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00; + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00; + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00; + + /* Loop to create and establish server connections. */ + thread_1_counter = 0; + while ((thread_1_counter < 2000) && (!error_counter)) + { + + /* Increment thread 1's counter. */ + thread_1_counter++; + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Receive a TCP message from the socket. */ + server_socket.nx_tcp_socket_rx_window_last_sent = 0; /* Force an ACK out! */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + else + /* Release the packet. */ + nx_packet_release(packet_ptr); + + /* Set all the sequence numbers the way we want them for our test. */ + if ((server_socket.nx_tcp_socket_rx_sequence < 0xFFFFFF00) && + (server_socket.nx_tcp_socket_rx_sequence > 0x100)) + { + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + client_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + client_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_tx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFF00 + (sequence_increment & 0xFF); + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFF00 + (sequence_increment++ & 0xFF); + } + + /* Resume thread 0. */ + tx_thread_resume(&thread_0); + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup server socket for listening again. */ + status = nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + + /* Check for error. */ + if (status) + error_counter++; +} + + +static void thread_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) +{ + + /* Check for the proper socket and port. */ + if ((socket_ptr != &server_socket) || (port != 12)) + error_counter++; +} + + +static void thread_1_disconnect_received(NX_TCP_SOCKET *socket) +{ + + /* Check for proper disconnected socket. */ + if (socket != &server_socket) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Wrapping RX/TX Sequence Test..........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test2.c b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test2.c new file mode 100644 index 00000000..8b16494e --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test2.c @@ -0,0 +1,324 @@ +/* This NetX test concentrates on the wrapping of TX sequence numbers. */ +/* Client sends two packets with sequences: + * 0xFFFFFFEF ~ 0xFFFFFFFE, length is 16, + * 0xFFFFFFFF ~ 0x0000000E, length is 16. + * The seconds packet is dropped. + * Server will ACK 0xFFFFFFFF. + * + * Packets like following. + * + * | | | + * ---- -------- ---- + * ^ + * | + * ACK + */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Wrapping Sequence Test 2.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Set all the sequence numbers the way we want them for our test. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFFEF; + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFFEF; + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFFEF; + + for (i = 0; i < 2; i++) + { + + if (i == 1) + { + + /* Set driver filter to drop the second packet. */ + advanced_packet_process_callback = packet_process; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOP", 16, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 2; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOP", 16)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Simply drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Wrapping Sequence Test 2..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test3.c b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test3.c new file mode 100644 index 00000000..f6526a57 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test3.c @@ -0,0 +1,324 @@ +/* This NetX test concentrates on the wrapping of TX sequence numbers. */ +/* Client sends two packets with sequences: + * 0xFFFFFFFF ~ 0x0000000E, length is 16, + * 0x0000000F ~ 0x0000001E, length is 16. + * The seconds packet is dropped. + * Server will ACK 0x0000000F. + * + * Packets like following. + * + * | | | + * ---- -------- ---- + * ^ + * | + * ACK + */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Wrapping Sequence Test 3.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Set all the sequence numbers the way we want them for our test. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFFFF; + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFFFF; + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFFFF; + + for (i = 0; i < 2; i++) + { + + if (i == 1) + { + + /* Set driver filter to drop the second packet. */ + advanced_packet_process_callback = packet_process; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOP", 16, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 2; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOP", 16)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Simply drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test3_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Wrapping Sequence Test 3..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test4.c b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test4.c new file mode 100644 index 00000000..042a6ade --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_wrapping_sequence_test4.c @@ -0,0 +1,325 @@ +/* This NetX test concentrates on the wrapping of TX sequence numbers. */ +/* Client sends three packets with sequences: + * 0xFFFFFFDF ~ 0xFFFFFFEE, length is 16, + * 0xFFFFFFEF ~ 0xFFFFFFFE, length is 16. + * 0xFFFFFFFF ~ 0x0000000E, length is 16. + * The seconds packet is dropped. + * Server will ACK 0xFFFFFFF0. + * + * Packets like following. + * + * | | | | + * ---- -------- -------- ---- + * ^ + * | + * ACK + */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test4_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Wrapping Sequence Test 4.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 0x88, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Attempt to connect the socket. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Set all the sequence numbers the way we want them for our test. */ + client_socket.nx_tcp_socket_tx_sequence = 0xFFFFFFDF; + server_socket.nx_tcp_socket_rx_sequence = 0xFFFFFFDF; + server_socket.nx_tcp_socket_rx_sequence_acked = 0xFFFFFFDF; + + for (i = 0; i < 3; i++) + { + + if (i == 1) + { + + /* Set driver filter to drop the second packet. */ + advanced_packet_process_callback = packet_process; + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOP", 16, &pool_0, 2 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + } + + /* Disconnect this socket. */ + status = nx_tcp_socket_disconnect(&client_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(&client_socket); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG actual_status; +UINT i; + + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 65535, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + for (i = 0; i < 3; i++) + { + + /* Receive a TCP message from the socket. */ + status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + if(memcmp(packet_ptr -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOP", 16)) + error_counter++; + + nx_packet_release(packet_ptr); + } + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 5 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + if (status) + error_counter++; + + /* Unlisten on the server port 12. */ + status = nx_tcp_server_socket_unlisten(&ip_1, 12); + if (status) + error_counter++; + + /* Delete the socket. */ + status = nx_tcp_socket_delete(&server_socket); + if (status) + error_counter++; + +} + + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Simply drop the packet. */ + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_wrapping_sequence_test4_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Wrapping Sequence Test 4..............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_tcp_zero_window_probe_2_test.c b/test/regression/netxduo_test/netx_tcp_zero_window_probe_2_test.c new file mode 100644 index 00000000..1d1e9eb0 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_zero_window_probe_2_test.c @@ -0,0 +1,357 @@ +/* This case verifies bug reported by trac #138. + * https://192.168.100.2/trac/netx/ticket/138 */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define WINDOW_SIZE 200 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buff[WINDOW_SIZE << 1]; +static UCHAR recv_buff[WINDOW_SIZE << 1]; +static UCHAR zero_window_probe = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG packet_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_probe_test_2_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Zero Window Probe Test 2.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Generate the data for send_buff. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = i & 0xFF; + recv_buff[i] = 0; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Establish the connection. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff, WINDOW_SIZE, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff + WINDOW_SIZE, WINDOW_SIZE, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE * 5); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Check status. */ + if ((error_counter) || (zero_window_probe == NX_FALSE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +UINT total = 0; +ULONG bytes_copied; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Sleep three seconds. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * 3); + + /* Receive all data. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Retrieve data. */ + nx_packet_data_retrieve(packet_ptr, recv_buff + total, &bytes_copied); + total += bytes_copied; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if (total != sizeof(send_buff)) + { + error_counter++; + } + else if (memcmp(send_buff, recv_buff, total) != 0) + { + error_counter++; + } +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Ignore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Update the packet counter. */ + packet_counter ++; + + /* Check the packet information. */ + if (packet_counter == 1) + { + + /* Check the packet length. */ + if (packet_ptr -> nx_packet_length != (WINDOW_SIZE + 40)) + error_counter ++; + } + + /* Check the packet information. */ + else if (packet_counter == 2) + { + + /* Check the packet length. */ + if ((packet_ptr -> nx_packet_length == (1 + 40)) && + (*(packet_ptr -> nx_packet_append_ptr - 1) == send_buff[WINDOW_SIZE])) + { + zero_window_probe = NX_TRUE; + + /* Increase the receive window by one byte. */ + server_socket.nx_tcp_socket_rx_window_current++; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_probe_test_2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Zero Window Probe Test 2..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c b/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c new file mode 100644 index 00000000..6ed6e39b --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c @@ -0,0 +1,396 @@ +/* This case verifies bug reported by work item #2252. + https://expresslogic.visualstudio.com/X-Ware/_workitems/edit/2252/ +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define WINDOW_SIZE 200 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buff[WINDOW_SIZE << 1]; +static UCHAR recv_buff[WINDOW_SIZE << 1]; +static UCHAR zero_window_probe = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG client_packet_counter = 0; +static ULONG server_packet_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_probe_test_3_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Zero Window Probe Test 3.............................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Generate the data for send_buff. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = i & 0xFF; + recv_buff[i] = 0; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Establish the connection. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff, WINDOW_SIZE, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff + WINDOW_SIZE, WINDOW_SIZE, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE * 5); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +UINT total = 0; +ULONG bytes_copied; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Sleep three seconds. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * 3); + + /* Receive all data. */ + while (nx_tcp_socket_receive(&server_socket, &packet_ptr, NX_IP_PERIODIC_RATE) == NX_SUCCESS) + { + + /* Retrieve data. */ + nx_packet_data_retrieve(packet_ptr, recv_buff + total, &bytes_copied); + total += bytes_copied; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if (total != sizeof(send_buff)) + { + error_counter++; + } + else if (memcmp(send_buff, recv_buff, total) != 0) + { + error_counter++; + } + + /* Check status. */ + if ((error_counter) || (zero_window_probe == NX_FALSE) || (client_packet_counter != 4) +#ifndef NX_ENABLE_TCP_KEEPALIVE + || (server_packet_counter != 7) +#endif + ) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +//#define TEST_INFO + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +#ifdef TEST_INFO +NX_TCP_HEADER *header_ptr; +ULONG seq_number, ack_number, window_size; + + /* Get TCP header. */ +#ifdef FEATURE_NX_IPV6 + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 40); +#else + header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr + 20); +#endif + + /* Get window size and ACK number. */ + seq_number = header_ptr -> nx_tcp_sequence_number; + ack_number = header_ptr -> nx_tcp_acknowledgment_number; + window_size = header_ptr -> nx_tcp_header_word_3; + NX_CHANGE_ULONG_ENDIAN(seq_number); + NX_CHANGE_ULONG_ENDIAN(ack_number); + NX_CHANGE_ULONG_ENDIAN(window_size); + window_size = window_size & NX_LOWER_16_MASK; +#endif + + /* Ignore the server packet. */ + if (ip_ptr != &ip_0) + { + + server_packet_counter++; +#ifdef TEST_INFO + printf("\nserver %d seq: %d, ack: %d, window: %d, length: %d\n", server_packet_counter, seq_number, ack_number, window_size, packet_ptr -> nx_packet_length); +#endif + return NX_TRUE; + } + + /* Update the packet counter. */ + client_packet_counter++; +#ifdef TEST_INFO + printf("\nclient %d seq: %d, ack: %d, window: %d, length: %d", client_packet_counter, seq_number, ack_number, window_size, packet_ptr -> nx_packet_length); +#endif + + /* Check the packet information. */ + if (client_packet_counter == 1) + { + + /* Check the packet length. */ + if (packet_ptr -> nx_packet_length != (WINDOW_SIZE + 40)) + error_counter ++; + } + + /* Check the packet information. */ + else if (client_packet_counter == 2) + { + + /* Check the packet length. */ + if ((packet_ptr -> nx_packet_length == (1 + 40)) && + (*(packet_ptr -> nx_packet_append_ptr - 1) == send_buff[WINDOW_SIZE])) + { + + zero_window_probe = NX_TRUE; + + /* Increase the receive window by one byte. */ + server_socket.nx_tcp_socket_rx_window_current += WINDOW_SIZE; + } + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_probe_test_3_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Zero Window Probe Test 3..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_zero_window_probe_test.c b/test/regression/netxduo_test/netx_tcp_zero_window_probe_test.c new file mode 100644 index 00000000..7c602256 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_zero_window_probe_test.c @@ -0,0 +1,359 @@ +/* This case tests zero window probe is implemented. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define WINDOW_SIZE 200 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buff[WINDOW_SIZE]; +static UCHAR zero_window_probe = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static ULONG packet_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_probe_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create a packet pool with payload not four bytes aligned. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + /* Print out some test information banners. */ + printf("NetX Test: TCP Zero Window Probe Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Generate the data for send_buff. */ + for (i = 0; i < sizeof(send_buff); i++) + send_buff[i] = (CHAR)rand(); + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Establish the connection. */ + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Deal the packet with my routing. */ + advanced_packet_process_callback = client_driver_packet_process; + + /* Deal the packet with my routing. */ + ip_0.nx_ip_tcp_packet_receive = client_tcp_packet_receive; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff, WINDOW_SIZE/2, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, &send_buff[WINDOW_SIZE/2], WINDOW_SIZE/2, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Modify the advertised window to zero to act as that received the ACK with zero window.*/ + client_socket.nx_tcp_socket_tx_window_advertised = 0; + + /* Sleep two seconds. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((error_counter) || (zero_window_probe == NX_FALSE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; +} + +static UINT client_driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Ingore the server packet. */ + if (ip_ptr != &ip_0) + return NX_TRUE; + + /* Update the packet counter. */ + packet_counter ++; + + /* Check the packet information. */ + if (packet_counter == 1) + { + + /* Check the packet length. */ + if (packet_ptr -> nx_packet_length != (WINDOW_SIZE/2 + 40)) + error_counter ++; + } + + /* Check the packet information. */ + else if (packet_counter == 2) + { + + /* Check the packet length. */ + if (packet_ptr -> nx_packet_length != (WINDOW_SIZE/2 + 40)) + error_counter ++; + } + + /* Check the packet information. */ + else if (packet_counter == 3) + { + + /* Check the packet length. */ + if ((packet_ptr -> nx_packet_length == (1 + 40)) && + (*(packet_ptr -> nx_packet_append_ptr - 1) == send_buff[0])) + { + zero_window_probe = NX_TRUE; + } + } + + return NX_TRUE; +} + +static void client_tcp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_TCP_HEADER *tcp_header_ptr; + + /* Set the header. */ + tcp_header_ptr = (NX_TCP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); + + /* Check if the packet is an ACK packet. */ + if(tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) + { + + /* Release the ACK to let client socket timeout. */ + nx_packet_release(packet_ptr); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_probe_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Zero Window Probe Test................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_tcp_zero_window_test.c b/test/regression/netxduo_test/netx_tcp_zero_window_test.c new file mode 100644 index 00000000..c3462200 --- /dev/null +++ b/test/regression/netxduo_test/netx_tcp_zero_window_test.c @@ -0,0 +1,564 @@ +/* This case tests zero window probe is implemented. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_tcp.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define WINDOW_SIZE 128 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_TCP_SOCKET client_socket; +static NX_TCP_SOCKET server_socket; +static UCHAR send_buff[WINDOW_SIZE]; +static UCHAR recv_buff[WINDOW_SIZE]; +static UCHAR zero_window_probe; +static UCHAR zero_window_probe_ack; +#ifdef NX_ENABLE_DUAL_PACKET_POOL +static NX_PACKET_POOL my_auxiliary_pool; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ +static NX_PACKET_POOL no_packet_pool; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +#endif /* FEATURE_NX_IPV6 */ + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT advanced_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; +NX_PACKET *pkt_ptr; +UINT header_size = sizeof(NX_PACKET); + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + +#ifdef NX_PACKET_ALIGNMENT + pointer = (CHAR *)(((ALIGN_TYPE)pointer + NX_PACKET_ALIGNMENT - 1) / NX_PACKET_ALIGNMENT * NX_PACKET_ALIGNMENT); + header_size = (header_size + NX_PACKET_ALIGNMENT - 1) / NX_PACKET_ALIGNMENT * NX_PACKET_ALIGNMENT; +#endif /* NX_PACKET_ALIGNMENT */ + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + /* Create an auxiliary packet pool. */ + status = nx_packet_pool_create(&my_auxiliary_pool, "NetX Auxiliary Packet Pool", 256, pointer, (256 + header_size)); + pointer = pointer + 256 + header_size; + + if (status) + error_counter++; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + /* Create a packet pool with no packet. */ + status = nx_packet_pool_create(&no_packet_pool, "NetX No Packet Pool", 256, pointer, (256 + header_size)); + pointer = pointer + 256 + header_size; + + if (status) + error_counter++; + + /* Allocate the only one packet from pool. */ + nx_packet_allocate(&no_packet_pool, &pkt_ptr, NX_TCP_PACKET, NX_NO_WAIT); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create a packet pool with payload not four bytes aligned. */ + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_0); + status += nx_tcp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if(status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + if(status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ + +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; +ULONG tcp_transmit_window; +#ifdef NX_ENABLE_DUAL_PACKET_POOL +NX_PACKET *waste_packet; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + /* Print out some test information banners. */ + printf("NetX Test: TCP Zero Window Test......................................"); + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds for DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = 0x01; + recv_buff[i] = 0x00; + } + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&client_socket, 12, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 4; i++) +#else + for (i = 0; i < 2; i++) +#endif /* FEATURE_NX_IPV6 */ + { + + zero_window_probe = 0; + zero_window_probe_ack = 0; + + /* Attempt to connect the socket. */ +#ifdef FEATURE_NX_IPV6 + if (i > 1) + { + status = nxd_tcp_client_socket_connect(&client_socket, &ipv6_address_2, 12, 5 * NX_IP_PERIODIC_RATE); + } + else +#endif /* FEATURE_NX_IPV6 */ + { + + status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); + } + + /* Check for error. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, send_buff, WINDOW_SIZE, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Send the packet out! */ + status = nx_tcp_socket_send(&client_socket, my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Get TCP transmit window size. */ + status = nx_tcp_socket_info_get(&client_socket, NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, NX_NULL, + NX_NULL, &tcp_transmit_window, + NX_NULL); + + /* Check for error */ + if (status) + { + error_counter++; + } + + /* Check transmit window. */ + if (tcp_transmit_window != 0) + { + error_counter++; + } + + /* Sleep one second to make sure ACK is received. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write send_buff into the packet payload! */ + status = nx_packet_data_append(my_packet, "ABC", 3, &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + if (i & 1) + { + + /* Set both pools with no packets. */ + ip_0.nx_ip_default_packet_pool = &no_packet_pool; +#ifdef NX_ENABLE_DUAL_PACKET_POOL + ip_0.nx_ip_auxiliary_packet_pool = &my_auxiliary_pool; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Disable all interface capability. */ + nx_ip_interface_capability_set(&ip_0, 0, 0); +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + } +#ifdef NX_ENABLE_DUAL_PACKET_POOL + else + { + + /* Set the same pool with no packets. */ + ip_0.nx_ip_default_packet_pool = &my_auxiliary_pool; + ip_0.nx_ip_auxiliary_packet_pool = &my_auxiliary_pool; + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + /* Enable all TX checksum capability. */ + nx_ip_interface_capability_set(&ip_0, 0, NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM | + NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM); +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + } + + /* Allocate all packets from auxiliary pool. */ + status = nx_packet_allocate(&my_auxiliary_pool, &waste_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + /* Send the packet out! */ + /* Window is full, so it can't be sent. */ + status = nx_tcp_socket_send(&client_socket, my_packet, NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status == NX_SUCCESS) + { + + /* Packet should not be sent. */ + error_counter++; + } + +#ifdef NX_ENABLE_DUAL_PACKET_POOL + /* Release wasted packet. */ + nx_packet_release(waste_packet); +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + /* Use auxiliary packet pool and default pool together. */ + ip_0.nx_ip_default_packet_pool = &pool_0; +#ifdef NX_ENABLE_DUAL_PACKET_POOL + ip_0.nx_ip_auxiliary_packet_pool = &my_auxiliary_pool; +#endif /* NX_ENABLE_DUAL_PACKET_POOL */ + + /* Window is full, so it can't be sent until timeout. */ + status = nx_tcp_socket_send(&client_socket, my_packet, + (client_socket.nx_tcp_socket_timeout_max_retries + 2) * NX_IP_PERIODIC_RATE); + + /* Determine if the status is valid. */ + if (status) + { + nx_packet_release(my_packet); + } + else + { + + /* Packet should not be sent. */ + error_counter++; + } + + /* Whether socket is still established. */ + if (client_socket.nx_tcp_socket_state == NX_TCP_CLOSED) + { + + /* Connection is closed. */ + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set callback function to drop all zero window probe ACK. */ + advanced_packet_process_callback = advanced_packet_process; + tx_thread_sleep((client_socket.nx_tcp_socket_timeout_max_retries + 2) * NX_IP_PERIODIC_RATE); + + /* Whether socket is still established. */ + if (client_socket.nx_tcp_socket_state != NX_TCP_CLOSED) + { + error_counter++; + } + + /* Check zero window probe received. */ + if ((zero_window_probe != client_socket.nx_tcp_socket_timeout_max_retries) || + (zero_window_probe_ack != client_socket.nx_tcp_socket_timeout_max_retries)) + { + error_counter++; + } + + /* Clear callback function. */ + advanced_packet_process_callback = NX_NULL; + + /* Wakeup server thread. */ + tx_thread_resume(&thread_1); + } + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + /* Create a socket. */ + status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, WINDOW_SIZE, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + + /* Setup this thread to listen. */ + status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, NX_NULL); + + /* Check for error. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 4; i++) +#else + for (i = 0; i < 2; i++) +#endif /* FEATURE_NX_IPV6 */ + { + + /* Accept a client socket connection. */ + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + + /* Suspend server thread. */ + tx_thread_suspend(&thread_1); + + /* Reset connection. */ + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&server_socket); + nx_tcp_server_socket_relisten(&ip_1, 12, &server_socket); + } +} + +static UINT advanced_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Drop zero window probe from ip_0. */ + if (ip_ptr == &ip_0) + { + + /* Is the length match TCP zero window probe packet? */ + if ((packet_ptr -> nx_packet_length == 41) || + (packet_ptr -> nx_packet_length == 61)) + { + + /* Yes it is. */ + /* Check one byte data. */ + if (*(packet_ptr -> nx_packet_append_ptr - 1) == 'A') + { + + /* It's zero window probe packet. */ + zero_window_probe++; + } + } + return NX_TRUE; + } + + /* Is the length match TCP ACK packet? */ + if ((packet_ptr -> nx_packet_length == 40) || (packet_ptr -> nx_packet_length == 60)) + { + + /* Yes it is. Drop it. */ + zero_window_probe_ack++; + *operation_ptr = NX_RAMDRIVER_OP_DROP; + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tcp_zero_window_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TCP Zero Window Test......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_udp_basic_processing_test.c b/test/regression/netxduo_test/netx_udp_basic_processing_test.c new file mode 100644 index 00000000..2a34cda7 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_basic_processing_test.c @@ -0,0 +1,699 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG notify_calls = 0; +static ULONG total_packets = 2000; +static ULONG modify_packets = 0; +static ULONG invalid_packets; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +#ifdef FEATURE_NX_IPV6 +static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +#endif /* FEATURE_NX_IPV6 */ +static VOID udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + invalid_packets = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + status = nxd_ipv6_address_set(&ip_1, 0, &address_1, 64, NX_NULL); + + total_packets = 4000; + packet_process_callback = NX_NULL; +#endif /* FEATURE_NX_IPV6 */ + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Basic Processing Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Filter UDP packet. */ + ip_1.nx_ip_udp_packet_receive = udp_packet_receive; + + /* Let the IP threads and thread 1 execute. */ + tx_thread_relinquish(); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Send 1000 ipv4 packets without checksum. */ + thread_0_counter = 0; + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Now, enable the checksum. */ + status = nx_udp_socket_checksum_enable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send another 1000 ipv4 packets with checksum enabled. */ + while ((thread_0_counter < 2000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Now, disable the checksum. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + packet_process_callback = my_packet_process; + + /* Send another 1000 ipv6 packets without checksum enabled. */ + while ((thread_0_counter < 3000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Now, enable the checksum. */ + status = nx_udp_socket_checksum_enable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send another 1000 ipv6 packets with checksum enabled. */ + while ((thread_0_counter < 4000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } +#endif /* FEATURE_NX_IPV6 */ + + /* Get nothing from UDP socket. */ + status = nx_udp_socket_info_get(&socket_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP socket information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_UDP_INFO + + if ((packets_sent != total_packets) || (bytes_sent != total_packets*28)) + { + error_counter++; + } +#endif + +#if defined(NX_DISABLE_UDP_RX_CHECKSUM) + /* Modified packets are processed as normal packets. */ + modify_packets = 0; +#elif defined(NX_ENABLE_INTERFACE_CAPABILITY) + /* Packets with checksum error are dropped by driver directly. */ + if(ip_0.nx_ip_interface[0].nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM) + notify_calls += modify_packets; +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != total_packets) || (thread_1_counter != total_packets - modify_packets) || + (packets_received) || (bytes_received) || (packets_queued) || (receive_packets_dropped) || (checksum_errors) || (notify_calls != total_packets)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IP_INFO + if (invalid_packets != ip_0.nx_ip_invalid_transmit_packets) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_IP_INFO */ + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Get 4000 packets. */ + thread_1_counter = 0; + while (1) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + + +#ifdef FEATURE_NX_IPV6 +static UINT my_packet_process(NX_IP * ip_ptr,NX_PACKET * packet_ptr) +{ + + /* Check if it is a UDP packet with IPv6 header. */ + if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) && + (*(packet_ptr -> nx_packet_prepend_ptr + 6) == NX_PROTOCOL_UDP)) + { + + /* Yes it is a UDP packet with IPv6 header. */ +#ifndef NX_DISABLE_UDP_RX_CHECKSUM + /* Check if checksum field is 0. */ + if ((*(packet_ptr -> nx_packet_prepend_ptr + 46) == 0) && + (*(packet_ptr -> nx_packet_prepend_ptr + 47) == 0)) + { + + /* The checksum field is 0. */ + error_counter++; + } + else +#endif /* NX_DISABLE_UDP_RX_CHECKSUM */ + { + + /* Modify first 1000 packets. Set checksum field to 0. */ + if (modify_packets < 1000) + { + *(packet_ptr -> nx_packet_prepend_ptr + 46) = 0; + *(packet_ptr -> nx_packet_prepend_ptr + 47) = 0; + modify_packets++; + } + } + } + + return NX_TRUE; +} +#endif /* FEATURE_NX_IPV6 */ + + +static VOID udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_PACKET *invalid_pkt_ptr; + + /* Send a UDP packet with no interface. */ + if (nx_packet_copy(packet_ptr, &invalid_pkt_ptr, &pool_0, NX_NO_WAIT)) + { + error_counter++; + } + else + { + + /* Set interface to NULL. */ +#ifdef __PRODUCT_NETXDUO__ + invalid_pkt_ptr -> nx_packet_address.nx_packet_interface_ptr = NX_NULL; + invalid_packets++; + + /* Send the packet. */ + _nx_ip_packet_send(&ip_0, invalid_pkt_ptr, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL, + 0x80, NX_IP_UDP, NX_FRAGMENT_OKAY, IP_ADDRESS(1, 2, 3, 5)); +#else + invalid_pkt_ptr -> nx_packet_ip_interface = NX_NULL; + invalid_packets++; + + /* Send the packet. */ + _nx_ip_packet_send(&ip_0, invalid_pkt_ptr, IP_ADDRESS(1, 2, 3, 5), NX_IP_NORMAL, + 0x80, NX_IP_UDP, NX_FRAGMENT_OKAY); +#endif + } + + /* Process this packet. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_basic_processing_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: UDP Basic Processing Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_udp_bind_cleanup_test.c b/test/regression/netxduo_test/netx_udp_bind_cleanup_test.c new file mode 100644 index 00000000..5ea6461d --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_bind_cleanup_test.c @@ -0,0 +1,202 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_bind_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT free_port; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Bind Cleanup Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + error_counter++; + + /* Bind the UDP socket 0 to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket 1 to the same IP port to trigger the udp_bind_cleanup. */ + status = nx_udp_socket_bind(&socket_1, 0x88, 250); + + /* Check status. */ + if (!status) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Unbind the UDP socket 1. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_NOT_BOUND) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if ((status) || (error_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void thread_1_entry(ULONG thread_input) +{ +UINT status; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status != NX_SUCCESS) + error_counter++; + + /* Bind the UDP socket 1 to the same IP port to trigger the udp_bind_cleanup. */ + status = nx_udp_socket_bind(&socket_2, 0x88, 2 * NX_IP_PERIODIC_RATE); + if(status == NX_SUCCESS) + error_counter++; + + status = nx_udp_socket_unbind(&socket_2); + if(status != NX_NOT_BOUND) + error_counter++; + + status = nx_udp_socket_delete(&socket_2); + if(status != NX_SUCCESS) + error_counter++; + +} diff --git a/test/regression/netxduo_test/netx_udp_branch_test.c b/test/regression/netxduo_test/netx_udp_branch_test.c new file mode 100644 index 00000000..57cb6310 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_branch_test.c @@ -0,0 +1,477 @@ +/* This NetX test concentrates on the code coverage for UDP functions, + * _nx_udp_receive_cleanup.c + * _nx_udp_socket_unbind.c + * _nx_udp_packet_info_extract.c + */ + +#include "nx_api.h" +#include "tx_thread.h" +#include "nx_udp.h" +#include "nx_ip.h" +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#endif + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_test1; +static TX_THREAD thread_test2; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_UDP_SOCKET socket_0; + + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static CHAR *pointer; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_branch_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +NX_PACKET *my_packet; +NX_UDP_HEADER *udp_header_ptr; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; +#endif + + /* Enable UDP processing for IP instance. */ + status = nx_udp_enable(&ip_0); + + /* Check UDP enable status. */ + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + error_counter++; + + /* Test _nx_udp_packet_receive() */ + /* Hit condition: _tx_thread_current_ptr = NX_NULL + [ + - ][ + - ]: if ((_tx_thread_current_ptr) && (_tx_thread_system_state == 0)) line 199 and 263 */ + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24681234; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 9; + my_packet -> nx_packet_length = 9; + + _nx_udp_packet_receive(&ip_0, my_packet); + + /* Hit condition: _tx_thread_current_ptr = NX_NULL + [ + - ][ + - ]: if ((_tx_thread_current_ptr) && (_tx_thread_system_state == 0)) line 312 */ + _nx_udp_socket_bind(&socket_0, 0x1234, NX_NO_WAIT); + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24681234; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 9; + my_packet -> nx_packet_length = 9; + + _nx_udp_packet_receive(&ip_0, my_packet); + _nx_udp_socket_unbind(&socket_0); +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG thread_state; +ULONG system_state; +NX_PACKET *my_packet[2]; +NX_UDP_SOCKET *temp_socket; +TX_THREAD *temp_thread; +#ifdef __PRODUCT_NETXDUO__ +ULONG ip_address; +NX_PACKET *receive_packet; +#endif +NX_UDP_HEADER *udp_header_ptr; +#ifdef FEATURE_NX_IPV6 +NX_IPV6_HEADER *ipv6_header_ptr; +#endif + + /* Print out some test information banners. */ + printf("NetX Test: UDP Branch Test..........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + + /* Test _nx_udp_receive_cleanup(). */ + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = NX_UDP_ID; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = 0; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = 0; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = NX_UDP_ID; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = NX_UDP_ID; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = 0; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = 0; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + tx_thread_identify() -> tx_thread_suspended_next = &thread_test1; + tx_thread_identify() -> tx_thread_suspended_previous = &thread_test2; + thread_state = tx_thread_identify() -> tx_thread_state; + socket_0.nx_udp_socket_id = NX_UDP_ID; + socket_0.nx_udp_socket_receive_suspended_count ++; + tx_thread_identify() -> tx_thread_state = 0; + _nx_udp_receive_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + socket_0.nx_udp_socket_receive_suspension_list = TX_NULL; + + + + /* Test _nx_udp_bind_cleanup */ + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = NX_UDP_ID; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = 0; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = 0; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = NX_UDP_ID; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = NX_UDP_ID; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = 0; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID. */ + tx_thread_identify() -> tx_thread_suspend_cleanup = NX_NULL; + tx_thread_identify() -> tx_thread_suspend_control_block = NX_NULL; + socket_0.nx_udp_socket_id = 0; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + + /* Setup tx_thread_suspend_cleanup, socket_ptr, and socket ID to hit false condition of if (thread_ptr -> tx_thread_state == TX_TCP_IP) */ + tx_thread_identify() -> tx_thread_suspend_cleanup = suspend_cleanup; + tx_thread_identify() -> tx_thread_suspend_control_block = &socket_0; + socket_0.nx_udp_socket_id = NX_UDP_ID; + tx_thread_identify() -> tx_thread_suspended_next = tx_thread_identify(); + socket_0.nx_udp_socket_bound_previous = &socket_0; + socket_0.nx_udp_socket_bind_suspended_count ++; + thread_state = tx_thread_identify() -> tx_thread_state; + tx_thread_identify() -> tx_thread_state = 0; + _nx_udp_bind_cleanup(tx_thread_identify() NX_CLEANUP_ARGUMENT); + tx_thread_identify() -> tx_thread_state = thread_state; + + /* Recover. */ + tx_thread_identify() -> tx_thread_suspended_next = TX_NULL; + socket_0.nx_udp_socket_bound_previous = NX_NULL; + + + + /* Test _nx_udp_socket_unbind(). */ + /* Hit [ + + ][ - + ] condition + if ((socket_ptr -> nx_udp_socket_bound_next) || + (socket_ptr -> nx_udp_socket_bind_in_progress)) */ + temp_socket = socket_0.nx_udp_socket_bound_next; + socket_0.nx_udp_socket_bound_next = NX_NULL; + temp_thread = socket_0.nx_udp_socket_bind_in_progress; + socket_0.nx_udp_socket_bind_in_progress = tx_thread_identify(); + nx_udp_socket_bind(&socket_0, 1234, NX_NO_WAIT); + socket_0.nx_udp_socket_bound_next = temp_socket; + socket_0.nx_udp_socket_bind_in_progress = temp_thread; + + + /* Hit true condition of if (socket_ptr -> nx_udp_socket_receive_count)*/ + nx_udp_socket_bind(&socket_0, 1234, NX_NO_WAIT); + + /* Allocate the packet. queue two packet on receive list. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + nx_packet_allocate(&pool_0, &my_packet[1], 0, NX_NO_WAIT); + socket_0.nx_udp_socket_receive_head = my_packet[0]; + my_packet[0] -> nx_packet_queue_next = my_packet[1]; + my_packet[1] -> nx_packet_queue_next = NX_NULL; + socket_0.nx_udp_socket_receive_tail = my_packet[1]; + socket_0.nx_udp_socket_receive_count = 2; + + /* Recover. Unbind the socket. */ + _nx_udp_socket_unbind(&socket_0); + + + +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) + /* Hit false condition of if (status == NX_SUCCESS) in _nx_udp_packet_info_extract. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_ip_version = 0; + _nx_udp_packet_info_extract(my_packet[0], &ip_address, NX_NULL, NX_NULL, NX_NULL); + nx_packet_release(my_packet[0]); + + + /* Test _nx_udp_socket_receive() */ + /* Hit condition: + [ + - ][ + + ]: if ((!socket_ptr -> nx_udp_socket_disable_checksum && (*(temp_ptr + 1) & NX_LOWER_16_MASK)) || + [ + + ] ((*packet_ptr) -> nx_packet_ip_version == NX_IP_VERSION_V6)) */ + nx_udp_socket_bind(&socket_0, 1234, NX_NO_WAIT); + /* Allocate the packet. queue one packet on receive list. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 9; + my_packet[0] -> nx_packet_length = 9; + my_packet[0] -> nx_packet_ip_version = NX_IP_VERSION_V4; + my_packet[0] -> nx_packet_address.nx_packet_interface_ptr = &ip_0.nx_ip_interface[0]; + socket_0.nx_udp_socket_receive_count = 1; + socket_0.nx_udp_socket_receive_head = my_packet[0]; + my_packet[0] -> nx_packet_queue_next = NX_NULL; + socket_0.nx_udp_socket_receive_tail = my_packet[0]; + socket_0.nx_udp_socket_disable_checksum = 1; + _nx_udp_socket_receive(&socket_0, &receive_packet, 0); + nx_packet_release(receive_packet); + + /* Recover. Unbind the socket. */ + socket_0.nx_udp_socket_disable_checksum = 0; + _nx_udp_socket_unbind(&socket_0); +#endif /* __PRODUCT_NETXDUO__ */ + + + + /* Test _nx_udp_packet_receive() */ + /* Hit condition: + [ + - ][ + - ]: if ((_tx_thread_current_ptr) && (_tx_thread_system_state == 0)) line 199 and 263 */ + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24681234; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 9; + my_packet[0] -> nx_packet_length = 9; + + system_state = _tx_thread_system_state ; + _tx_thread_system_state = 1; + _nx_udp_packet_receive(&ip_0, my_packet[0]); + _tx_thread_system_state = system_state; + + + /* Hit condition: + [ + - ][ + - ]: if ((_tx_thread_current_ptr) && (_tx_thread_system_state == 0)) line 312 */ + nx_udp_socket_bind(&socket_0, 0x1234, NX_NO_WAIT); + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24681234; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 9; + my_packet[0] -> nx_packet_length = 9; + + system_state = _tx_thread_system_state ; + _tx_thread_system_state = 1; + _nx_udp_packet_receive(&ip_0, my_packet[0]); + _tx_thread_system_state = system_state; + _nx_udp_socket_unbind(&socket_0); + + +#ifndef NX_DISABLE_IPV4 +#ifdef __PRODUCT_NETXDUO__ + /* Hit condition: + [ + + ][ + - ]: if ((packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) && + : (ip_ptr -> nx_ip_icmpv4_packet_process)) line 334 */ + nx_udp_socket_bind(&socket_0, 0x0100, NX_NO_WAIT); + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], 0, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24688100; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 9; + my_packet[0] -> nx_packet_length = 9; + my_packet[0] -> nx_packet_ip_version = 4; + ip_0.nx_ip_icmpv4_packet_process = NX_NULL; + + _nx_udp_packet_receive(&ip_0, my_packet[0]); + _nx_udp_socket_unbind(&socket_0); +#endif +#endif + + +#ifdef FEATURE_NX_IPV6 + /* Hit condition: + [ + - ]: if ((ip_header -> nx_ip_header_destination_ip[0] & (ULONG)0xFF000000) != (ULONG)0xFF000000) line 359 */ + nx_udp_socket_bind(&socket_0, 0x0100, NX_NO_WAIT); + + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_IPv6_PACKET, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24688100; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 9; + my_packet[0] -> nx_packet_length = 9; + my_packet[0] -> nx_packet_ip_version = 6; + my_packet[0] -> nx_packet_ip_header = my_packet[0] -> nx_packet_prepend_ptr - 40; + ipv6_header_ptr = (NX_IPV6_HEADER *)my_packet[0] -> nx_packet_ip_header; + ipv6_header_ptr -> nx_ip_header_destination_ip[0] = 0xFF000000; + + _nx_udp_packet_receive(&ip_0, my_packet[0]); + _nx_udp_socket_unbind(&socket_0); +#endif + + /* Test packet_ptr -> nx_packet_length < sizeof(NX_UDP_HEADER) */ + /* Allocate the packet. */ + nx_packet_allocate(&pool_0, &my_packet[0], NX_IP_PACKET, NX_NO_WAIT); + udp_header_ptr = (NX_UDP_HEADER *)my_packet[0] -> nx_packet_prepend_ptr; + udp_header_ptr -> nx_udp_header_word_0 = 0x24688100; + udp_header_ptr -> nx_udp_header_word_1 = 0x00090000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + my_packet[0] -> nx_packet_append_ptr = my_packet[0] -> nx_packet_prepend_ptr + 8; + + /* Reset the packet length to make sure the packet length is small than NX_UDP_HEADER */ + my_packet[0] -> nx_packet_length = 7; + _nx_udp_packet_receive(&ip_0, my_packet[0]); + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static VOID suspend_cleanup(TX_THREAD *thread_ptr NX_CLEANUP_PARAMETER) +{ +} diff --git a/test/regression/netxduo_test/netx_udp_checksum_zero_test.c b/test/regression/netxduo_test/netx_udp_checksum_zero_test.c new file mode 100644 index 00000000..9ef30abc --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_checksum_zero_test.c @@ -0,0 +1,296 @@ +/* This NetX test concentrates on the calculated UDP checksum is zero. */ + + +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR msg[] = {0xF6, 0xBC}; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_checksum_zero_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Checksum Zero Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the IP threads and thread 1 execute. */ + tx_thread_relinquish(); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Write data into the packet. */ + status += nx_packet_data_append(my_packet, msg, sizeof(msg), &pool_0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Delete the UDP socket. */ + status += nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Check data. */ + if ((my_packet -> nx_packet_length != sizeof(msg)) || + (memcmp(my_packet -> nx_packet_prepend_ptr, msg, sizeof(msg)) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_checksum_zero_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: UDP Checksum Zero Test....................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_udp_fragment_test.c b/test/regression/netxduo_test/netx_udp_fragment_test.c new file mode 100644 index 00000000..bcf998a6 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_fragment_test.c @@ -0,0 +1,566 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + +static UCHAR send_buff[300]; +static UCHAR recv_buff[300]; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create two packet pools. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 5120); + pointer = pointer + 5120; + status = nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 256, pointer, 5120); + pointer = pointer + 5120; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + status = nxd_ipv6_address_set(&ip_1, 0, &address_1, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT i; +UINT status; +NX_PACKET *my_packet; +ULONG data_len; +#if !defined(NX_DISABLE_IP_INFO) && !defined(NX_DISABLE_PACKET_CHAIN) +ULONG fragment_failures = 0; +NX_PACKET *test_packet; +NX_PACKET *last_packet_1 = NX_NULL; +NX_PACKET *last_packet_2 = NX_NULL; +#endif + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Fragment Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Let thread 1 start to send. */ + tx_thread_resume(&thread_1); + +#ifdef NX_FRAGMENT_IMMEDIATE_ASSEMBLY + /* Receive a packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 3 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + + /* Check whether packet is in sequence. */ + nx_packet_data_retrieve(my_packet, recv_buff, &data_len); + if(data_len != sizeof(send_buff)) + error_counter++; + else if(memcmp(send_buff, recv_buff, data_len)) + error_counter++; + nx_packet_release(my_packet); + } + + /* Receive a packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 3 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + + /* Check whether packet is in sequence. */ + nx_packet_data_retrieve(my_packet, recv_buff, &data_len); + if(data_len != 3) + error_counter++; + else if(memcmp("ABC", recv_buff, data_len)) + error_counter++; + nx_packet_release(my_packet); + } + +#ifdef FEATURE_NX_IPV6 + /* Receive a packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 3 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + + /* Check whether packet is in sequence. */ + nx_packet_data_retrieve(my_packet, recv_buff, &data_len); + if(data_len != sizeof(send_buff)) + error_counter++; + else if(memcmp(send_buff, recv_buff, data_len)) + error_counter++; + nx_packet_release(my_packet); + } + + /* Receive a packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 3 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + else + { + + /* Check whether packet is in sequence. */ + nx_packet_data_retrieve(my_packet, recv_buff, &data_len); + if(data_len != 3) + error_counter++; + else if(memcmp("ABC", recv_buff, data_len)) + error_counter++; + nx_packet_release(my_packet); + } +#endif /* FEATURE_NX_IPV6 */ +#endif /* NX_FRAGMENT_IMMEDIATE_ASSEMBLY */ + + /* Receive packets. */ +#ifdef FEATURE_NX_IPV6 + for(i = 0; i < 2000; i++) +#else + for(i = 0; i < 1000; i++) +#endif /* FEATURE_NX_IPV6 */ + { + status = nx_udp_socket_receive(&socket_0, &my_packet, 3 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + break; + } + else + { + + /* Check whether packet is in sequence. */ + nx_packet_data_retrieve(my_packet, recv_buff, &data_len); + if(data_len != sizeof(send_buff)) + error_counter++; + else if(memcmp(send_buff, recv_buff, data_len)) + error_counter++; + nx_packet_release(my_packet); + } + } + +#if !defined(NX_DISABLE_IP_INFO) && !defined(NX_DISABLE_PACKET_CHAIN) + + /* Get the original failures. */ + fragment_failures = ip_0.nx_ip_fragment_failures; + + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, NX_WAIT_FOREVER); + + /* Allocate packet until no packet is available. */ + while (nx_packet_allocate(&pool_0, &test_packet, NX_UDP_PACKET, NX_NO_WAIT) == NX_SUCCESS) + { + last_packet_2 = last_packet_1; + last_packet_1 = test_packet; + } + + /* Make sure no ARP request is needed. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), + ip_1.nx_ip_interface[0].nx_interface_physical_address_msw, + ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw); + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Check whether */ + if (ip_0.nx_ip_fragment_failures != fragment_failures + 1) + { + error_counter++; + } + + /* Release one packet. It should not be able to send since packet is not enough. */ + nx_packet_release(last_packet_1); + + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, NX_WAIT_FOREVER); + + /* Make sure no ARP request is needed. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), + ip_1.nx_ip_interface[0].nx_interface_physical_address_msw, + ip_1.nx_ip_interface[0].nx_interface_physical_address_lsw); + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Check whether */ + if (ip_0.nx_ip_fragment_failures != fragment_failures + 2) + { + error_counter++; + } + + /* Release the second packet. It should be able to send packet. */ + nx_packet_release(last_packet_2); + + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_0, NX_WAIT_FOREVER); + + /* Modify the length of packet and keep append_ptr. The fragment process should discard this packet. */ + my_packet -> nx_packet_length += 256; + + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + /* Check whether */ + if (ip_0.nx_ip_fragment_failures != fragment_failures + 3) + { + error_counter++; + } + +#endif /* !NX_DISABLE_IP_INFO && !NX_DISABLE_PACKET_CHAIN */ + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Delete the UDP socket. */ + status += nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT i; +UINT status; +NX_PACKET *my_packet; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize send buffer. */ + for(i = 0; i < sizeof(send_buff); i++) + send_buff[i] = (UCHAR)(i & 0xFF); + +#ifdef NX_FRAGMENT_IMMEDIATE_ASSEMBLY + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_1, NX_NO_WAIT); + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(1, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a small packet. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, "ABC", 3, &pool_1, NX_NO_WAIT); + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(1, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_1, NX_NO_WAIT); + + /* Send the UDP packet. */ + status += nxd_udp_socket_send(&socket_1, my_packet, &address_0, 0x88); + + /* Check status. */ + if (status) + error_counter++; + + /* Create a small packet. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, "ABC", 3, &pool_1, NX_NO_WAIT); + + /* Send the UDP packet. */ + status += nxd_udp_socket_send(&socket_1, my_packet, &address_0, 0x88); + + /* Check status. */ + if (status) + error_counter++; +#endif /* FEATURE_NX_IPV6 */ +#endif /* NX_FRAGMENT_IMMEDIATE_ASSEMBLY */ + /* Send 1000 packets from user specified packet pool. */ + for(i = 0; i < 1000; i++) + { + + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_1, NX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status += nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(1, 2, 3, 4), 0x88); + + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + break; + } + tx_thread_relinquish(); + } + +#ifdef FEATURE_NX_IPV6 + /* Send 1000 packets from user specified packet pool. */ + for(i = 0; i < 1000; i++) + { + + /* Create a packet larger than MTU. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + status += nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_1, NX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status += nxd_udp_socket_send(&socket_1, my_packet, &address_0, 0x88); + + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + break; + } + tx_thread_relinquish(); + } +#endif /* FEATURE_NX_IPV6 */ + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Delete the UDP socket. */ + status += nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: UDP Fragment Test.........................................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_udp_fragmentation_processing_test.c b/test/regression/netxduo_test/netx_udp_fragmentation_processing_test.c new file mode 100644 index 00000000..501826a3 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_fragmentation_processing_test.c @@ -0,0 +1,2309 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_FRAGMENTATION) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_UDP_SOCKET socket_0; + +static UCHAR pool_area[(1536 + sizeof(NX_PACKET)) * 20]; + + +/* Define the packet data. */ +/* Frame (1514 bytes) */ +static const unsigned char pkt1[1514] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0xa4, 0x1f, /* ..s)_f.. */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x05, 0xdc, 0x3b, 0xd8, 0x20, 0x00, 0x40, 0x11, /* ..;. .@. */ +0x97, 0x6f, 0xc0, 0xa8, 0x00, 0x13, 0xc0, 0xa8, /* .o...... */ +0x00, 0x66, 0x1f, 0xf5, 0x1f, 0xf5, 0x0f, 0xa8, /* .f...... */ +0x90, 0x4e, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* .Nabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x78, 0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, /* wxyz.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt2[1514] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0xa4, 0x1f, /* ..s)_f.. */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x05, 0xdc, 0x3b, 0xd8, 0x20, 0xb9, 0x40, 0x11, /* ..;. .@. */ +0x96, 0xb6, 0xc0, 0xa8, 0x00, 0x13, 0xc0, 0xa8, /* ........ */ +0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .f...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +/* Frame (1082 bytes) */ +static const unsigned char pkt3[1082] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0xa4, 0x1f, /* ..s)_f.. */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x04, 0x2c, 0x3b, 0xd8, 0x01, 0x72, 0x40, 0x11, /* .,;..r@. */ +0xb7, 0xad, 0xc0, 0xa8, 0x00, 0x13, 0xc0, 0xa8, /* ........ */ +0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .f...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +#if 0 +/* Reassembled IPv4 (4008 bytes) */ +static const unsigned char pkt3_1[4008] = { +0x1f, 0xf5, 0x1f, 0xf5, 0x0f, 0xa8, 0x90, 0x4e, /* .......N */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* qrstuvwx */ +0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* yz...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ +}; +#endif + +/* Frame (1514 bytes) */ +static const unsigned char pkt4[1514] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0xa4, 0x1f, /* ..s)_f.. */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x05, 0xdc, 0x3b, 0xd9, 0x20, 0x00, 0x40, 0x11, /* ..;. .@. */ +0x97, 0x6e, 0xc0, 0xa8, 0x00, 0x13, 0xc0, 0xa8, /* .n...... */ +0x00, 0x66, 0x1f, 0xf5, 0x1f, 0xf5, 0x0f, 0xa8, /* .f...... */ +0x90, 0x4e, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* .Nabcdef */ +0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, /* ghijklmn */ +0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, /* opqrstuv */ +0x77, 0x78, 0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, /* wxyz.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt5[1514] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0xa4, 0x1f, /* ..s)_f.. */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x05, 0xdc, 0x3b, 0xd9, 0x20, 0xb9, 0x40, 0x11, /* ..;. .@. */ +0x96, 0xb5, 0xc0, 0xa8, 0x00, 0x13, 0xc0, 0xa8, /* ........ */ +0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .f...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +/* Frame (1082 bytes) */ +static const unsigned char pkt6[1082] = { +0x18, 0x03, 0x73, 0x29, 0x5f, 0x66, 0xa4, 0x1f, /* ..s)_f.. */ +0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ +0x04, 0x2c, 0x3b, 0xd9, 0x01, 0x72, 0x40, 0x11, /* .,;..r@. */ +0xb7, 0xac, 0xc0, 0xa8, 0x00, 0x13, 0xc0, 0xa8, /* ........ */ +0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .f...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00 /* .. */ +}; + +#if 0 +/* Reassembled IPv4 (4008 bytes) */ +static const unsigned char pkt6_1[4008] = { +0x1f, 0xf5, 0x1f, 0xf5, 0x0f, 0xa8, 0x90, 0x4e, /* .......N */ +0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, /* abcdefgh */ +0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* ijklmnop */ +0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* qrstuvwx */ +0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* yz...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ +}; +#endif + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_fragmentation_processing_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 0, 0, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pool_area, sizeof(pool_area)); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(192, 168, 0, 102), 0xFFFFF000UL, + &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(192, 168, 0, 19), 0xFFFFF000UL, + &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + /* Enable IP fragmentation logic on both IP instances. */ + status = nx_ip_fragment_enable(&ip_0); + status += nx_ip_fragment_enable(&ip_1); + + /* Check for IP fragment enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Fragmentation Processing Test........................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 8181, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Let thread 1 start to run. */ + tx_thread_resume(&thread_1); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + else + nx_packet_release(my_packet); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + error_counter++; + else + nx_packet_release(my_packet); + + /* Check status. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Send the second fragmentation of the frist packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt2 + 14), sizeof(pkt2) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Send the first fragmentation of the frist packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt1 + 14), sizeof(pkt1) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Send the second fragmentation of the second packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt5 + 14), sizeof(pkt5) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Send the first fragmentation of the second packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt4 + 14), sizeof(pkt4) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Send the third fragmentation of the first packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt3 + 14), sizeof(pkt3) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Send the third fragmentation of the second packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, NX_NO_WAIT); + status += nx_packet_data_append(my_packet, (void*)(pkt6 + 14), sizeof(pkt6) - 14, &pool_0, NX_NO_WAIT); + _nx_ip_packet_deferred_receive(&ip_0, my_packet); + + /* Check status. */ + if (status) + error_counter++; +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_fragmentation_processing_test_application_define(void *first_unused_memory) +#endif +{ + + printf("NetX Test: UDP Fragmentation Processing Test.........................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_FRAGMENTATION */ diff --git a/test/regression/netxduo_test/netx_udp_free_port_find_test.c b/test/regression/netxduo_test/netx_udp_free_port_find_test.c new file mode 100644 index 00000000..b23d3c2e --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_free_port_find_test.c @@ -0,0 +1,218 @@ +/* This NetX test concentrates on the UDP free port find operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET my_socket[NX_MAX_PORT - NX_SEARCH_PORT_START + 1]; +#ifdef __PRODUCT_NETXDUO__ +static NX_UDP_SOCKET my_socket_1; +#endif /* __PRODUCT_NETXDUO__ */ + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* The 2 ports will hashed to the same index. */ +#define CLIENT_PORT_1 0x00000100 +#define CLIENT_PORT_2 0x00008100 + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_free_port_find_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT free_port; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Free Port Find Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_socket_bind(&socket_0, CLIENT_PORT_1, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* CLIENT_PORT_1 has been bound. */ + status = nx_udp_free_port_find(&ip_0, CLIENT_PORT_1, &free_port); + if((status != NX_SUCCESS) && (free_port != CLIENT_PORT_1 + 1)) + error_counter++; + + /* CLIENT_PORT_2 and CLIENT_PORT_1 are mapped to the same index. */ + status = nx_udp_free_port_find(&ip_0, CLIENT_PORT_2, &free_port); + if ((status != NX_SUCCESS) || (free_port != CLIENT_PORT_2)) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Test port wrap around. */ + status = nx_udp_socket_bind(&socket_0, NX_MAX_PORT, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + status = nx_udp_free_port_find(&ip_0, NX_MAX_PORT, &free_port); + if ((status != NX_SUCCESS) || (free_port != NX_SEARCH_PORT_START)) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + if (status) + error_counter++; + + for(i = 0; i <= (NX_MAX_PORT - NX_SEARCH_PORT_START); i++) + { + status = nx_udp_socket_create(&ip_0, &my_socket[i], "Socket Array", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&my_socket[i], i + NX_SEARCH_PORT_START, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + status = nx_udp_free_port_find(&ip_0, NX_SEARCH_PORT_START, &free_port); + if(status != NX_NO_FREE_PORTS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Verify the port number ahead of NX_SEARCH_PORT_START. */ + status = nx_udp_socket_create(&ip_0, &my_socket_1, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&my_socket_1, (NX_SEARCH_PORT_START - 1), NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_free_port_find(&ip_0, (NX_SEARCH_PORT_START - 1), &free_port); + if(status != NX_NO_FREE_PORTS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + diff --git a/test/regression/netxduo_test/netx_udp_ipv4_interface2_test_1_test.c b/test/regression/netxduo_test/netx_udp_ipv4_interface2_test_1_test.c new file mode 100644 index 00000000..b8d82730 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_ipv4_interface2_test_1_test.c @@ -0,0 +1,511 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; + +static ULONG error_counter; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_ipv4_interface2_test_1_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2,2,3,4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2,2,3,5), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet; + UINT free_port; + ULONG udp_packets_sent, udp_bytes_sent, udp_packets_received, udp_bytes_received, udp_invalid_packets, udp_receive_packets_dropped, udp_checksum_errors; + ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP IPv4 Interface2 Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the IP threads and thread 1 execute. */ + tx_thread_relinquish(); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Send 1000 packets without checksum. */ + thread_0_counter = 0; + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Now, enable the checksum. */ + status = nx_udp_socket_checksum_enable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send another 1000 packets with checksum enabled. */ + while ((thread_0_counter < 2000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(2, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Get UDP socket information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_TCP_INFO + + if ((packets_sent != 2000) || (bytes_sent != 2000*28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 2000) || (thread_1_counter != 2000) || + (packets_received) || (bytes_received) || (packets_queued) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get nothing from UDP. */ + status = nx_udp_info_get(&ip_0, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP information. */ + status = nx_udp_info_get(&ip_0, &udp_packets_sent, &udp_bytes_sent, &udp_packets_received, &udp_bytes_received, + &udp_invalid_packets, &udp_receive_packets_dropped, &udp_checksum_errors); + +#ifndef NX_DISABLE_TCP_INFO + if ((udp_packets_sent != 2000) || (udp_bytes_sent != 2000*28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 2000) || (thread_1_counter != 2000) || + (udp_packets_received) || (udp_bytes_received) || (udp_invalid_packets) || (udp_receive_packets_dropped) || (udp_checksum_errors) || (notify_calls != 2000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + ULONG ip_address; + UINT port; + NX_PACKET *my_packet; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Get 1000 packets. */ + thread_1_counter = 0; + while (thread_1_counter < 1000) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nx_udp_source_extract(my_packet, &ip_address, &port); + + /* Check status. */ + if ((status) || (ip_address != IP_ADDRESS(2,2,3,4)) || (port != 0x88)) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Get another 1000 packets. */ + while (thread_1_counter < 2000) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_ipv4_interface2_test_1_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: UDP IPv4 Interface2 Test..................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_udp_ipv6_interface2_test_1_test.c b/test/regression/netxduo_test/netx_udp_ipv6_interface2_test_1_test.c new file mode 100644 index 00000000..acc34429 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_ipv6_interface2_test_1_test.c @@ -0,0 +1,592 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if defined(FEATURE_NX_IPV6) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; + +static ULONG error_counter; +static ULONG notify_calls = 0; + +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; +static NXD_ADDRESS ipv6_address_3; +static NXD_ADDRESS ipv6_address_4; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_ipv6_interface2_test_1_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(2,2,3,4), 0xFFFFFF00UL, _nx_ram_network_driver_512); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(2,2,3,5), 0xFFFFFF00UL, _nx_ram_network_driver_512); + + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP for IP Instance 0 and 1. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet; + UINT free_port; + ULONG udp_packets_sent, udp_bytes_sent, udp_packets_received, udp_bytes_received, udp_invalid_packets, udp_receive_packets_dropped, udp_checksum_errors; + ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP IPv6 Interface2 Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + +#ifndef NX_DISABLE_IPV6_DAD + /* Try to send before DAD done. */ + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &ipv6_address_4, 0x89, 0); + + if (status != NX_NO_INTERFACE_ADDRESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + nx_packet_release(my_packet); + + + /* Sleep for DAD */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* NX_DISABLE_IPV6_DAD */ + + /* Let other threads run. */ + tx_thread_resume(&thread_1); + tx_thread_relinquish(); + + /* Send 1000 packets without checksum. */ + thread_0_counter = 0; + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_4, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Now, enable the checksum. */ + status = nx_udp_socket_checksum_enable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send another 1000 packets with checksum enabled. */ + while ((thread_0_counter < 2000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_4, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Get UDP socket information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_TCP_INFO + + if ((packets_sent != 2000) || (bytes_sent != 2000*28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 2000) || (thread_1_counter != 2000) || + (packets_received) || (bytes_received) || (packets_queued) || (receive_packets_dropped) || (checksum_errors)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP information. */ + status = nx_udp_info_get(&ip_0, &udp_packets_sent, &udp_bytes_sent, &udp_packets_received, &udp_bytes_received, + &udp_invalid_packets, &udp_receive_packets_dropped, &udp_checksum_errors); + +#ifndef NX_DISABLE_TCP_INFO + if ((udp_packets_sent != 2000) || (udp_bytes_sent != 2000*28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 2000) || (thread_1_counter != 2000) || + (udp_packets_received) || (udp_bytes_received) || (udp_invalid_packets) || (udp_receive_packets_dropped) || (udp_checksum_errors) || (notify_calls != 2000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + UINT protocol, port, interface_index; + NX_PACKET *my_packet; + NXD_ADDRESS ipv6_address; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Get 1000 packets. */ + thread_1_counter = 0; + while (1) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nxd_udp_source_extract(my_packet, &ipv6_address, &port); + + /* Check status. */ + if ((status)|| (port != 0x88) || + (ipv6_address.nxd_ip_version != NX_IP_VERSION_V6)|| + (ipv6_address.nxd_ip_address.v6[0] != ipv6_address_3.nxd_ip_address.v6[0])|| + (ipv6_address.nxd_ip_address.v6[1] != ipv6_address_3.nxd_ip_address.v6[1])|| + (ipv6_address.nxd_ip_address.v6[2] != ipv6_address_3.nxd_ip_address.v6[2])|| + (ipv6_address.nxd_ip_address.v6[3] != ipv6_address_3.nxd_ip_address.v6[3])) + break; + + /* Get the source IP and port. */ + status = nxd_udp_packet_info_extract(my_packet, &ipv6_address, &protocol, &port, &interface_index); + + /* Check status. */ + if ((status)|| (port != 0x88) || (protocol != 0x11) || (interface_index != 1) || + (ipv6_address.nxd_ip_version != NX_IP_VERSION_V6)|| + (ipv6_address.nxd_ip_address.v6[0] != ipv6_address_3.nxd_ip_address.v6[0])|| + (ipv6_address.nxd_ip_address.v6[1] != ipv6_address_3.nxd_ip_address.v6[1])|| + (ipv6_address.nxd_ip_address.v6[2] != ipv6_address_3.nxd_ip_address.v6[2])|| + (ipv6_address.nxd_ip_address.v6[3] != ipv6_address_3.nxd_ip_address.v6[3])) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Get another 1000 packets. */ + while (thread_1_counter < 2000) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_ipv6_interface2_test_1_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: UDP IPv6 Interface2 Test..................................N/A\n"); + + test_control_return(3); + +} +#endif diff --git a/test/regression/netxduo_test/netx_udp_loopback_test.c b/test/regression/netxduo_test/netx_udp_loopback_test.c new file mode 100644 index 00000000..91dd1de1 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_loopback_test.c @@ -0,0 +1,358 @@ +/* This NetX test concentrates on the UDP send and recv through loopback interface. */ + + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_LOOPBACK_INTERFACE) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +static NXD_ADDRESS address_lo; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR recv_buf[28]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + status = nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Set loopback address. */ + address_lo.nxd_ip_version = NX_IP_VERSION_V4; + address_lo.nxd_ip_address.v4 = IP_ADDRESS(127, 0, 0, 1); +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Loopback Test........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 3; i++) +#else + for (i = 0; i < 2; i++) +#endif + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if (i == 0) + { + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(127, 0, 0, 1), 0x89, NX_LOOPBACK_INTERFACE); + } + else if (i == 1) + { + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_lo, 0x89, NX_LOOPBACK_INTERFACE); + } +#ifdef FEATURE_NX_IPV6 + else + { + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_0, 0x89, 0); + } +#endif /* FEATURE_NX_IPV6 */ + + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG bytes_copied; +UINT i; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + for (i = 0; i < 3; i++) +#else + for (i = 0; i < 2; i++) +#endif + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_extract_offset(my_packet, 0, recv_buf, 28, &bytes_copied); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(memcmp(recv_buf, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28) || (bytes_copied != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_loopback_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: UDP Loopback Test.........................................N/A\n"); + test_control_return(3); +} +#endif /* NX_DISABLE_LOOPBACK_INTERFACE */ diff --git a/test/regression/netxduo_test/netx_udp_multiple_ports_test.c b/test/regression/netxduo_test/netx_udp_multiple_ports_test.c new file mode 100644 index 00000000..ae6f061f --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_multiple_ports_test.c @@ -0,0 +1,617 @@ +/* This NetX test concentrates on sending to and receiving from multiple UDP ports. */ + + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; +static NX_UDP_SOCKET socket_3; +static NX_UDP_SOCKET socket_4; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter; +static ULONG thread_1_counter; +static ULONG error_counter; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_multiple_ports_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + notify_calls = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +ULONG udp_packets_sent, udp_bytes_sent, udp_packets_received, udp_bytes_received, udp_invalid_packets, udp_receive_packets_dropped, udp_checksum_errors; +ULONG packets_sent, bytes_sent, packets_received, bytes_received, packets_queued, receive_packets_dropped, checksum_errors; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Multiple Ports Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the IP threads and thread 1 execute. */ + tx_thread_relinquish(); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Send 1000 packets to four ports. */ + thread_0_counter = 0; + while ((thread_0_counter < 1000) && (error_counter == 0)) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xE9); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xC9); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xA9); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + + /* Relinquish to thread 1 so it can pickup the message. */ + tx_thread_relinquish(); + } + + /* Get UDP socket information. */ + status = nx_udp_socket_info_get(&socket_0, &packets_sent, &bytes_sent, &packets_received, &bytes_received, + &packets_queued, &receive_packets_dropped, &checksum_errors); + +#ifndef NX_DISABLE_TCP_INFO + if ((packets_sent != 1000*4) || (bytes_sent != 1000*4*28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 1000) || (thread_1_counter != 1000) || + (packets_received) || (bytes_received) || (packets_queued) || (receive_packets_dropped) || (checksum_errors)) + { + + error_counter++; + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get UDP information. */ + status = nx_udp_info_get(&ip_0, &udp_packets_sent, &udp_bytes_sent, &udp_packets_received, &udp_bytes_received, + &udp_invalid_packets, &udp_receive_packets_dropped, &udp_checksum_errors); + +#ifndef NX_DISABLE_TCP_INFO + if ((udp_packets_sent != 1000*4) || (udp_bytes_sent != 1000*4*28)) + { + error_counter++; + } +#endif + /* Check status. */ + if ((error_counter) || (status) || (thread_0_counter != 1000) || (thread_1_counter != 1000) || + (udp_packets_received) || (udp_bytes_received) || (udp_invalid_packets) || (udp_receive_packets_dropped) || (udp_checksum_errors) || (notify_calls != 1000)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_address; +UINT port; +NX_PACKET *my_packet; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Create another UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_2, 0xA9, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Create another UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_3, "Socket 3", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_3, 0xC9, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Create another UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_4, "Socket 4", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_4, 0xE9, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Get 1000 packets for each socket. */ + thread_1_counter = 0; + while (thread_1_counter < 1000) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_4, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nx_udp_source_extract(my_packet, &ip_address, &port); + + /* Check status. */ + if ((status) || (ip_address != IP_ADDRESS(1,2,3,4)) || (port != 0x88)) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Receive another UDP packet. */ + status = nx_udp_socket_receive(&socket_3, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nx_udp_source_extract(my_packet, &ip_address, &port); + + /* Check status. */ + if ((status) || (ip_address != IP_ADDRESS(1,2,3,4)) || (port != 0x88)) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Receive another UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nx_udp_source_extract(my_packet, &ip_address, &port); + + /* Check status. */ + if ((status) || (ip_address != IP_ADDRESS(1,2,3,4)) || (port != 0x88)) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Receive another UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Get the source IP and port. */ + status = nx_udp_source_extract(my_packet, &ip_address, &port); + + /* Check status. */ + if ((status) || (ip_address != IP_ADDRESS(1,2,3,4)) || (port != 0x88)) + break; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + break; + + /* Increment thread 1's counter. */ + thread_1_counter++; + } + + /* Unbind the UDP sockets. */ + status = nx_udp_socket_unbind(&socket_1); + status += nx_udp_socket_unbind(&socket_2); + status += nx_udp_socket_unbind(&socket_3); + status += nx_udp_socket_unbind(&socket_4); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_multiple_ports_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: UDP Multiple Ports Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_udp_nxe_api_test.c b/test/regression/netxduo_test/netx_udp_nxe_api_test.c new file mode 100644 index 00000000..7bb74767 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_nxe_api_test.c @@ -0,0 +1,1353 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "nx_udp.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_packet.h" + +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP invalid_ip; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +static NXD_ADDRESS invalid_address; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + /* Set the destination address. */ + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334458; + + /* Set the IPv6 address. */ + status += nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + + /* Check for status. */ + if (status) + error_counter++; + +#endif /* FEATURE_NX_IPV6 */ +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT socket_id; +NX_PACKET *my_packet; +NX_PACKET *unkown_packet = NX_NULL; +UINT free_port; +UINT port; +UINT protocol; +UINT if_index; +ULONG udp_packets_sent, udp_bytes_sent, udp_packets_received, udp_bytes_received, + udp_invalid_packets, udp_receive_packets_dropped, udp_checksum_errors, udp_packet_quiequed; +#ifdef FEATURE_NX_IPV6 +NXD_ADDRESS my_address; +NX_PACKET *my_packet_2; +#endif +ULONG my_address_2; +ULONG bytes_avalable; +#ifdef __PRODUCT_NETXDUO__ +UCHAR temp_interface_valid; +UCHAR *temp; +NX_PACKET *invalid_packet; +#endif /* __PRODUCT_NETXDUO__ */ +NX_UDP_SOCKET * temp_socket; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP NXE API Test.........................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Create udp socket without ip instance. */ + status = nx_udp_socket_create(NX_NULL, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create udp socket with invalid ip instance. */ + invalid_ip.nx_ip_id = 0; + status = nx_udp_socket_create(&invalid_ip, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create udp socket with NULL pointer. */ + status = nx_udp_socket_create(&ip_0, NX_NULL, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Create udp socket with wrong size. */ + status = _nxe_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5, 0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Create udp socket with invalid service type. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", 0xFFFFFFFF, NX_FRAGMENT_OKAY, 0x80, 5); + if(status != NX_OPTION_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create udp socket with invalid fragment option. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, 11111, 0x80, 5); + if(status != NX_OPTION_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create udp socket with invalid time to live option. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE_MASK+1, 5); + if(status != NX_OPTION_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create again. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_delete(&socket_0); + if(status != NX_STILL_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&socket_0, 0xFFFFFFFF, NX_IP_PERIODIC_RATE/10); + if(status != NX_INVALID_PORT) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with null socket. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(NX_NULL, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with null packet. */ + status = nxd_udp_socket_send(&socket_0, unkown_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the null packet with null socket. */ + status = nxd_udp_socket_send(NX_NULL, unkown_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with null address. */ + status = nxd_udp_socket_send(&socket_0, my_packet, 0, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with error socket ID. */ + socket_0.nx_udp_socket_id = 0; + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet_2, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append the packet. */ + status = nx_packet_data_append(my_packet_2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet whose IP vesion is IPv6. */ + my_packet_2 -> nx_packet_ip_version = NX_IP_VERSION_V6; + status = nx_udp_socket_send(&socket_0, my_packet_2, IP_ADDRESS(1, 2, 3, 5), 0x89); +#endif + + /* Send the the packet with unkown packet. */ + status = nx_udp_socket_send(&socket_0, unkown_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Send the packet with freed packet. */ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#endif + + /* Send the packet with unbound socket. */ + temp_socket = socket_0.nx_udp_socket_bound_next; + socket_0.nx_udp_socket_bound_next = NX_NULL; + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_NOT_BOUND) + { + + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_bound_next = temp_socket; + +#ifdef FEATURE_NX_IPV6 + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(&socket_0, unkown_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Send the the packet with invalid address. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(0, 0, 0, 0), 0x89); + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Send the the packet with invalid address. */ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(0, 0, 0 ,0), 0x89, 0); + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_source_send(NX_NULL, my_packet, IP_ADDRESS(1, 2, 3 ,5), 0x89, 0); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + +#ifdef FEATURE_NX_IPV6 + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(&socket_0, my_packet, NX_NULL, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with invalid socket id. */ + socket_0.nx_udp_socket_id = 0; + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + /* Send the the packet with freed packet. */ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; + + /* Fake one invalid address. */ + invalid_address.nxd_ip_version = 0x5; + invalid_address.nxd_ip_address.v4= 0; + + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &invalid_address, 0x89); + + /* Check status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet with invalid destination IP address. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &invalid_address, 0x89, 0); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Fake one invalid address. */ + invalid_address.nxd_ip_version = NX_IP_VERSION_V4; + invalid_address.nxd_ip_address.v4= 0; + + /* Send the the packet with invalid IP address. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &invalid_address, 0x89); + + /* Check status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the null packet. */ + status = nxd_udp_socket_source_send(&socket_0, unkown_packet, &address_1, 0x89, 0) ; + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet to null address. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, NX_NULL, 0x89, 0) ; + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet from an invalid interface index. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &invalid_address, 0x89, 123) ; + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet with invalid destination IP address. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &invalid_address, 0x89, 0); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Fake one invalid address. */ + invalid_address.nxd_ip_version = NX_IP_VERSION_V6; + invalid_address.nxd_ip_address.v6[0]= 0; + invalid_address.nxd_ip_address.v6[1]= 0; + invalid_address.nxd_ip_address.v6[2]= 0; + invalid_address.nxd_ip_address.v6[3]= 0; + + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &invalid_address, 0x89); + + /* Check status. */ + if (status != NX_IP_ADDRESS_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Send the packet with invalid destination IP address. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &invalid_address, 0x89, 0); + if(status != NX_IP_ADDRESS_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the packet from an invalid interface index. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, 0x89, 123) ; + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif + +#ifdef __PRODUCT_NETXDUO__ + /* Send the packet from an invalid interface index. */ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, NX_MAX_PHYSICAL_INTERFACES+1) ; + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + + temp_interface_valid = ip_0.nx_ip_interface[NX_MAX_PHYSICAL_INTERFACES - 1].nx_interface_valid; + ip_0.nx_ip_interface[NX_MAX_PHYSICAL_INTERFACES - 1].nx_interface_valid = NX_FALSE; + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, NX_MAX_PHYSICAL_INTERFACES-1) ; + if(status != NX_INVALID_INTERFACE) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_interface[NX_MAX_PHYSICAL_INTERFACES - 1].nx_interface_valid = temp_interface_valid; +#endif /* __PRODUCT_NETXDUO__ */ + + + /* Send the the packet with big number port. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xFFFFFFFF); + + /* Check status. */ + if (status != NX_INVALID_PORT) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Send the the packet with invalid port. */ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0xFFFFFFFF, 0); + if(status != NX_INVALID_PORT) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + +#ifdef FEATURE_NX_IPV6 + /* Send the the packet with invalid port. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0xFFFFFFFF); + + /* Check status. */ + if (status != NX_INVALID_PORT) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send the the packet with invalid port. */ + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, 0xFFFFFFFF, 0); + if(status != NX_INVALID_PORT) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif + + /* Send the the packet when udp disable. */ + ip_0.nx_ip_udp_packet_receive = NX_NULL; + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + if (status != NX_NOT_ENABLED) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup free port with null IP instance. */ + status = nx_udp_free_port_find(NX_NULL, 0, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup free port with invalid IP instance. */ + ip_0.nx_ip_id = 0; + status = nx_udp_free_port_find(&ip_0, 0, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + ip_0.nx_ip_id = NX_IP_ID; + + /* Pickup free port with UDP disabled. */ + status = nx_udp_free_port_find(&ip_0, 0x123, &free_port); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_udp_info_get(NX_NULL, &udp_packets_sent, &udp_bytes_sent, + &udp_packets_received, &udp_bytes_received, &udp_invalid_packets, + &udp_receive_packets_dropped, &udp_checksum_errors); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + invalid_ip.nx_ip_id = 0; + status = nx_udp_info_get(&invalid_ip, &udp_packets_sent, &udp_bytes_sent, + &udp_packets_received, &udp_bytes_received, &udp_invalid_packets, + &udp_receive_packets_dropped, &udp_checksum_errors); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_info_get(&ip_0, &udp_packets_sent, &udp_bytes_sent, + &udp_packets_received, &udp_bytes_received, &udp_invalid_packets, + &udp_receive_packets_dropped, &udp_checksum_errors); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&socket_0, 0x123, 10); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bytes_available(&socket_0, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_0.nx_udp_socket_id = 0; + status = nx_udp_socket_bytes_available(&socket_0, &bytes_avalable); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_socket_bytes_available(&socket_0, &bytes_avalable); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_checksum_disable(&socket_0); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_checksum_enable(&socket_0); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_delete(&socket_0); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_info_get(&socket_0, &udp_packets_sent, &udp_bytes_sent, + &udp_packets_received, &udp_bytes_received, &udp_packet_quiequed, + &udp_receive_packets_dropped, &udp_checksum_errors); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_udp_socket_port_get(&socket_0, &port); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_0.nx_udp_socket_id = 0; + status = nx_udp_socket_port_get(&socket_0, &port); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_socket_port_get(&socket_0, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_receive(&socket_0, &my_packet, NX_IP_PERIODIC_RATE); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_0.nx_udp_socket_id = 0; + status = nx_udp_socket_receive(&socket_0, &my_packet, NX_IP_PERIODIC_RATE); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_socket_receive(&socket_0, NX_NULL, NX_IP_PERIODIC_RATE); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3 ,5), 0x89, 0); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* __PRODUCT_NETXDUO__ */ + + status = nx_udp_socket_unbind(&socket_0); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + +#ifdef FEATURE_NX_IPV6 + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, 0x89, 0); + if(status != NX_NOT_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + /* Enable UDP traffic again. */ + status = nx_udp_enable(&ip_0); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable UDP again. */ + status = nx_udp_enable(&ip_0); + if(status != NX_ALREADY_ENABLED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_enable(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + invalid_ip.nx_ip_id = 0; + status = nx_udp_enable(&invalid_ip); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Send the the packet with invalid packet structure. */ + my_packet -> nx_packet_prepend_ptr = my_packet -> nx_packet_data_start; + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Test packet with underflow pointer. */ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, 0x89, 0); + if (status != NX_UNDERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* FEATURE_NX_IPV6 */ +#endif /* __PRODUCT_NETXDUO__ */ + + status = nx_udp_source_extract(my_packet, &my_address_2, &port); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_UNDERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } +#endif /* FEATURE_NX_IPV6 */ + + /* Send the the packet with invalid packet. */ + my_packet -> nx_packet_prepend_ptr = my_packet -> nx_packet_data_start + NX_UDP_PACKET; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_data_end + 1; + + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + /* Test packet with overflow packet. */ + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, 0x89, 0); + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif +#endif /* __PRODUCT_NETXDUO__ */ + + +#ifdef FEATURE_NX_IPV6 + /* Send the the packet with null socket. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status != NX_OVERFLOW) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + +#ifdef FEATURE_NX_IPV6 + status = nxd_udp_source_extract(my_packet, &address_1, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_udp_source_extract(my_packet, NX_NULL, &port); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + temp = my_packet -> nx_packet_ip_header; + my_packet -> nx_packet_ip_header = NX_NULL; + /* Extract info from an invalid packet. */ + status = nxd_udp_source_extract(my_packet, &address_1, &port); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Restore the packet. */ + my_packet -> nx_packet_ip_header = temp; + + /* Extract info from a NULL packet. */ + status = nxd_udp_packet_info_extract(NX_NULL, &my_address, &protocol, &port, &if_index); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif + /* Pickup free port from an invalid port. */ + status = nx_udp_free_port_find(&ip_0, 0, &free_port); + if(status != NX_INVALID_PORT) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup free port from an invalid port. */ + status = nx_udp_free_port_find(&ip_0, (NX_MAX_PORT + 1), &free_port); + if(status != NX_INVALID_PORT) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Pickup free port from with invalid pointer. */ + status = nx_udp_free_port_find(&ip_0, 0, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_packet_info_extract(NX_NULL, &my_address_2, &protocol, &port, &if_index); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bytes_available(NX_NULL, &bytes_avalable); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_checksum_disable(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_1.nx_udp_socket_id = 0; + status = nx_udp_socket_checksum_disable(&socket_1); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_checksum_enable(&socket_1); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_1.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_socket_checksum_enable(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_delete(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the socket with invalid ID. */ + socket_0.nx_udp_socket_id = 0; + status = nx_udp_socket_delete(&socket_0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_socket_info_get(NX_NULL, &udp_packets_sent, &udp_bytes_sent, + &udp_packets_received, &udp_bytes_received, &udp_packet_quiequed, + &udp_receive_packets_dropped, &udp_checksum_errors); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_1.nx_udp_socket_id = 0; + status = nx_udp_socket_info_get(&socket_1, &udp_packets_sent, &udp_bytes_sent, + &udp_packets_received, &udp_bytes_received, &udp_packet_quiequed, + &udp_receive_packets_dropped, &udp_checksum_errors); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_1.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_socket_port_get(NX_NULL, &port); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_receive(NX_NULL, &my_packet, NX_IP_PERIODIC_RATE/10); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_receive_notify(NX_NULL, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_id = socket_0.nx_udp_socket_id; + socket_0.nx_udp_socket_id = 0; + status = nx_udp_socket_receive_notify(&socket_0, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + socket_0.nx_udp_socket_id = NX_UDP_ID; + status = nx_udp_socket_receive_notify(&socket_0, NX_NULL); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = socket_id; + +#ifdef __PRODUCT_NETXDUO__ + status = nx_udp_socket_source_send(NX_NULL, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + invalid_packet = NX_NULL; + status = nx_udp_socket_source_send(&socket_0, invalid_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_data_end; + socket_0.nx_udp_socket_bound_next = NX_NULL; + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if(status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_bound_next = &socket_0; + +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_FREE; +#endif + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } +#ifdef __PRODUCT_NETXDUO__ + my_packet -> nx_packet_union_next.nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#else + my_packet -> nx_packet_tcp_queue_next = (NX_PACKET *)NX_PACKET_ALLOCATED; +#endif + + socket_0.nx_udp_socket_ip_ptr = NX_NULL; + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_ip_ptr = &ip_0; + + socket_0.nx_udp_socket_ip_ptr -> nx_ip_id = 0; + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_ip_ptr -> nx_ip_id = NX_IP_ID; +#endif /* __PRODUCT_NETXDUO__ */ + + status = nx_udp_socket_unbind(NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind with socket id mismatch. */ + socket_0.nx_udp_socket_id = 0; + status = nx_udp_socket_unbind(&socket_0); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + socket_0.nx_udp_socket_id = NX_UDP_ID; + + status = nx_udp_source_extract(NX_NULL, &my_address_2, &port); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_source_extract(my_packet, NX_NULL, &port); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_source_extract(my_packet, &my_address_2, NX_NULL); + if(status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef __PRODUCT_NETXDUO__ + temp = my_packet -> nx_packet_ip_header; + my_packet -> nx_packet_ip_header = NX_NULL; + status = nx_udp_source_extract(my_packet, &my_address_2, &port); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + my_packet -> nx_packet_ip_header = temp; + +#ifdef FEATURE_NX_IPV6 + temp = my_packet -> nx_packet_data_start; + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V6; + + /* Adjust the data start. */ + my_packet -> nx_packet_data_start = my_packet -> nx_packet_prepend_ptr - (sizeof(NX_UDP_HEADER) + sizeof(NX_IPV6_HEADER) - 1); + status = nx_udp_source_extract(my_packet, &my_address_2, &port); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + my_packet -> nx_packet_ip_version = NX_IP_VERSION_V4; + my_packet -> nx_packet_data_start = temp; +#endif + +#endif /* __PRODUCT_NETXDUO__ */ + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_nxe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: UDP NXE API Test..........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_udp_packet_receive_test.c b/test/regression/netxduo_test/netx_udp_packet_receive_test.c new file mode 100644 index 00000000..eade5c54 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_packet_receive_test.c @@ -0,0 +1,670 @@ +/* Here are the test points. + * socket's port is not equal to the source port + * multi threads suspend for the packet + * udp queue is full + * */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + +UINT packet_count; + +/* The 2 ports will hashed to the same index. */ +#define PORT_1 0x00000100 +#define PORT_2 0x00008100 + +#define QUEUE_SIZE 5 + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_packet_receive_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + packet_count = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 256*20); + pointer = pointer + 256*20; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + status += nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &address_1, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; +UINT port; +INT i; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Packet Receive Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#else + tx_thread_sleep(NX_IP_PERIODIC_RATE); +#endif + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test checksum enable/disable before bind. */ + + status = nx_udp_socket_checksum_disable(&socket_0); + if(status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_checksum_enable(&socket_0); + if(status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get socket port before bind. */ + status = nx_udp_socket_port_get(&socket_0, &port); + if(status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Receive packet before bind. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, NX_IP_PERIODIC_RATE/10); + if(status != NX_NOT_BOUND) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + +#ifdef FEATURE_NX_IPV6 + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, PORT_1, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Send packet to an invalid port (PORT_2) which is mapped to the same index with PORT_1. */ + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, PORT_2, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_suspend(&thread_0); +#endif + + + tx_thread_resume(&thread_1); + i = -2; + while(i < QUEUE_SIZE) + { + i++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), PORT_1, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + tx_thread_suspend(&thread_0); + + + /* Send a packet whose udp_header_word_1 will be modified. */ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), PORT_1, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), PORT_1, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_resume(&thread_1); + /* Suspend to trigger _nx_udp_receive_cleanup. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 2 * NX_IP_PERIODIC_RATE); + tx_thread_suspend(&thread_0); + + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +#ifdef FEATURE_NX_IPV6 +ULONG src_address; +UINT src_port; +#endif +UINT i; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, QUEUE_SIZE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 7 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + status = nx_udp_packet_info_extract(my_packet, &src_address, NX_NULL, &src_port, NX_NULL); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + + } + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + tx_thread_suspend(&thread_1); + i = 0; + while(i < QUEUE_SIZE) + { + i++; + + status = nx_udp_socket_receive(&socket_1, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + } + + /* Queue is empty, no more packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_NO_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_resume(&thread_0); + + /* Change udp receive function to my routine. */ + ip_1.nx_ip_udp_packet_receive = my_udp_packet_receive; + + tx_thread_suspend(&thread_1); + + /* Suspend to trigger _nx_udp_receive_cleanup. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_resume(&thread_0); + + +} + +static void thread_2_entry(ULONG thread_input) +{ + +#ifdef FEATURE_NX_IPV6 +UINT status; +NX_PACKET *my_packet; + + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 7 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_NO_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_resume(&thread_0); + +#endif + +} + +static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; + + if(packet_count == 0) + { + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + /* Change the udp packet length to maximum.*/ + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | 0xFFFF0000; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + _nx_udp_packet_receive(ip_ptr, packet_ptr); + packet_count++; + } + else + { + socket_1.nx_udp_socket_id = 1234; + _nx_udp_packet_receive(ip_ptr, packet_ptr); + socket_1.nx_udp_socket_id = NX_UDP_ID; + ip_1.nx_ip_udp_packet_receive = _nx_udp_packet_receive; + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_packet_receive_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: UDP Packet Receive Test...................................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_udp_packet_type_test.c b/test/regression/netxduo_test/netx_udp_packet_type_test.c new file mode 100644 index 00000000..196927d6 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_packet_type_test.c @@ -0,0 +1,663 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_udp.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_packet_type_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + +#ifndef NX_DISABLE_IPV4 + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; +#endif + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + status = nxd_ipv6_address_set(&ip_1, 0, &address_1, 64, NX_NULL); +#endif /* FEATURE_NX_IPV6 */ + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Packet Type Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_IPV4 + /**************************/ + /* Test IPv4 packet */ + /**************************/ + + /* Allocate a packet that can fill the UDP header, IPv4 header and physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 8 + 20 + 16, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet that can fill the UDP header and IPv4 header, can not fill physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 8 + 20, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait until thread 1 finished. */ + tx_thread_suspend(&thread_0); +#ifdef __PRODUCT_NETXDUO__ +#ifndef NX_DISABLE_ERROR_CHECKING + /* Allocate a packet that can fill the UDP header, can not fill IPv4 header and physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 8, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + nx_packet_release(my_packet); + + /* Allocate a packet that can not fill the UDP header, IPv4 header and physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait until thread 1 finished. */ + tx_thread_suspend(&thread_0); +#endif /* NX_DISABLE_ERROR_CHECKING */ +#endif /* __PRODUCT_NETXDUO__ */ +#endif /* NX_DISABLE_IPV4 */ + +#ifdef FEATURE_NX_IPV6 + + /**************************/ + /* Test IPv6 packet */ + /**************************/ + + /* Allocate a packet that can fill the UDP header, IPv6 header and physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 8 + 40 + 16, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + + /* Allocate a packet that can fill the UDP header and IPv6 header, can not fill physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 8 + 40, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Sleep 2 second to wait socket_1 receive the packet. */ + tx_thread_sleep(2 * NX_IP_PERIODIC_RATE); + + /* Allocate a packet that can fill the UDP header, can not fill IPv6 header and physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 8, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet that can not fill the UDP header, IPv6 header and physical header. */ + status = nx_packet_allocate(&pool_0, &my_packet, 0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &address_1, 0x89); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait until thread 1 finished. */ + tx_thread_suspend(&thread_0); +#endif /* NX_DISABLE_ERROR_CHECKING */ + +#endif /* FEATURE_NX_IPV6 */ + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 0 run. */ + tx_thread_resume(&thread_0); + +#ifndef NX_DISABLE_IPV4 + /**************************/ + /* Test IPv4 packet */ + /**************************/ + + /* Try to receive the first UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Try to receive the second UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 0 run. */ + tx_thread_resume(&thread_0); + +#ifdef __PRODUCT_NETXDUO__ +#ifndef NX_DISABLE_ERROR_CHECKING + /* Try to receive the third UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Try to receive the forth UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 0 run. */ + tx_thread_resume(&thread_0); +#endif /* NX_DISABLE_ERROR_CHECKING */ +#endif /* __PRODUCT_NETXDUO__ */ +#endif /* NX_DISABLE_IPV4 */ + +#ifdef FEATURE_NX_IPV6 + /**************************/ + /* Test IPv6 packet */ + /**************************/ + + /* Try to receive the first UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifndef NX_DISABLE_ERROR_CHECKING + /* Try to receive the second UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Try to receive the third UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Try to receive the forth UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let thread 0 run. */ + tx_thread_resume(&thread_0); +#endif +#endif + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} diff --git a/test/regression/netxduo_test/netx_udp_port_table_udpate_test.c b/test/regression/netxduo_test/netx_udp_port_table_udpate_test.c new file mode 100644 index 00000000..212f55d1 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_port_table_udpate_test.c @@ -0,0 +1,347 @@ +/* This NetX test concentrates on the UDP port table is updated + * when the receiving socket is not the header of port table. */ + + +#include "nx_api.h" +#include "nx_ip.h" +#include "nx_ram_network_driver_test_1500.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; + +static NX_PACKET *packet_copy; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT advanced_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_port_table_update_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the server thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP traffic. */ + status += nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable ICMP. */ + status += nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check for errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Port Table Update Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set driver callback function. */ + advanced_packet_process_callback = advanced_packet_process; + + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x8089); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT index = ((0x89 + (0x89 >> 8)) & NX_UDP_PORT_TABLE_MASK); + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + status += nx_udp_socket_create(&ip_1, &socket_2, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. The socket_1 and socket_2 is in the same port table. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + status += nx_udp_socket_bind(&socket_2, 0x8089, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Make sure the header of port table is socket_1. */ + if (ip_1.nx_ip_udp_port_table[index] != &socket_1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Suspend thread until socket_0 sends a UDP packet. */ + tx_thread_suspend(&thread_1); + + /* Inject the packet without IP thread. */ + _nx_ip_packet_receive(&ip_1, packet_copy); + + /* Verify the header of port table is updated to socket_2. */ + if (ip_1.nx_ip_udp_port_table[index] != &socket_2) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_2, &my_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + status += nx_udp_socket_unbind(&socket_2); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + status += nx_udp_socket_delete(&socket_2); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +static UINT advanced_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ + + /* Is this the UDP packet? */ + if (packet_ptr -> nx_packet_length == 56) + { + + /* Yes it is. Copy and drop it. */ + nx_packet_copy(packet_ptr, &packet_copy, &pool_0, NX_WAIT_FOREVER); + packet_copy -> nx_packet_ip_interface = &(ip_1.nx_ip_interface[0]); + *operation_ptr = NX_RAMDRIVER_OP_DROP; + advanced_packet_process_callback = NX_NULL; + + /* Resume thread 1. */ + tx_thread_resume(&thread_1); + } + + return NX_TRUE; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_port_table_update_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: UDP Port Table Update Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_udp_port_unreachable_test.c b/test/regression/netxduo_test/netx_udp_port_unreachable_test.c new file mode 100644 index 00000000..edf5c7ea --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_port_unreachable_test.c @@ -0,0 +1,296 @@ +/* This NetX test concentrates on the UDP port unreachable. */ + + +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_ICMPV4_ERROR_MESSAGE) && !defined(NX_DISABLE_ICMP_INFO) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_port_unreachable_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the client thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create an IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP traffic. */ + status += nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Enable ICMP. */ + status += nx_icmp_enable(&ip_0); + status += nx_icmp_enable(&ip_1); + + /* Check for errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Port Unreachable Test................................."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify the ICMPv4 error message is received. */ + if (ip_0.nx_ip_icmp_unhandled_messages != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Now create socket 1 and bind to port 0x8089. The hash value of 0x8089 is the same as 0x89. */ + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x8089, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Append data. */ + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify the ICMPv4 error message is received. */ + if (ip_0.nx_ip_icmp_unhandled_messages != 2) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_port_unreachable_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: UDP Port Unreachable Test.................................N/A\n"); + test_control_return(3); +} +#endif diff --git a/test/regression/netxduo_test/netx_udp_socket_bind_test.c b/test/regression/netxduo_test/netx_udp_socket_bind_test.c new file mode 100644 index 00000000..60d0afd4 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_socket_bind_test.c @@ -0,0 +1,170 @@ +/* This NetX test concentrates on the UDP free port find operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET my_socket[NX_MAX_PORT]; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_socket_bind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Socket Bind Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_socket_bind(&socket_0, 1234, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_SUCCESS) + error_counter++; + + /* Bind again. */ + status = nx_udp_socket_bind(&socket_0, 1234, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_ALREADY_BOUND) + error_counter++; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + if (status != NX_SUCCESS) + error_counter++; + + /* Use up the ports. */ + for(i = 0; i < NX_MAX_PORT; i++) + { + status = nx_udp_socket_create(&ip_0, &my_socket[i], "Socket Array", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&my_socket[i], i+1, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + /* Bind to any port. */ + status = nx_udp_socket_bind(&socket_0, NX_ANY_PORT, 2 * NX_IP_PERIODIC_RATE); + if(status != NX_NO_FREE_PORTS) + error_counter++; + + /* Bind to 1234. */ + status = nx_udp_socket_bind(&socket_0, 1234, NX_NO_WAIT); + if(status != NX_PORT_UNAVAILABLE) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + if (status) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + diff --git a/test/regression/netxduo_test/netx_udp_socket_delete_test.c b/test/regression/netxduo_test/netx_udp_socket_delete_test.c new file mode 100644 index 00000000..8597d57e --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_socket_delete_test.c @@ -0,0 +1,139 @@ +/* This NetX test concentrates on the UDP Socket Delete operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_socket_delete_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Socket Delete Test...................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + error_counter++; + + status = nx_udp_socket_bind(&socket_0, 1234, NX_NO_WAIT); + if(status != NX_SUCCESS) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + if (status != NX_STILL_BOUND) + error_counter++; + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + diff --git a/test/regression/netxduo_test/netx_udp_socket_unbind_receive_test.c b/test/regression/netxduo_test/netx_udp_socket_unbind_receive_test.c new file mode 100644 index 00000000..00fcb95e --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_socket_unbind_receive_test.c @@ -0,0 +1,143 @@ +/* This NetX test concentrates on the UDP socket unbind operation when other thread call receive. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_socket_unbind_receive_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: UDP Socket Unbind Receive Test............................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x80, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Let thread_1 to call socket receive. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Unbind the socket 0, thread 1 is receiving packet. */ + status = nx_udp_socket_unbind(&socket_0); + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + if (status) + error_counter++; + + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; + + /* Receive a UDP packet. */ + nx_udp_socket_receive(&socket_0, &my_packet, 2 * NX_IP_PERIODIC_RATE); +} diff --git a/test/regression/netxduo_test/netx_udp_socket_unbind_test.c b/test/regression/netxduo_test/netx_udp_socket_unbind_test.c new file mode 100644 index 00000000..a85e2667 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_socket_unbind_test.c @@ -0,0 +1,232 @@ +/* This NetX test concentrates on the UDP socket unbind operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static TX_THREAD thread_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; +static NX_UDP_SOCKET socket_2; +static NX_UDP_SOCKET socket_3; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* The 2 ports will hashed to the same index. */ +#define CLIENT_PORT_1 0x00000100 +#define CLIENT_PORT_2 0x00008100 + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void thread_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_socket_unbind_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out some test information banners. */ + printf("NetX Test: UDP Socket Unbind Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_3, "Socket 3", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, CLIENT_PORT_1, 2 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port which is mapped to the same index with CLIENT_PORT_1. */ + status = nx_udp_socket_bind(&socket_3, CLIENT_PORT_2, 2 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Let socket 1 bind to CLIENT_PORT_1 that socket 0 has bound to . */ + tx_thread_suspend(&thread_0); + + /* Unbind the socket 1, socket_1 is in bound process now. */ + status = nx_udp_socket_unbind(&socket_1); + if (status) + error_counter++; + + /* Let socket 1 and socket 2 bind to CLIENT_PORT_1 that socket 0 has bound to again. */ + tx_thread_resume(&thread_2); + tx_thread_suspend(&thread_0); + + /* Unbind the UDP socket. thread_1 and thread_2 is suspended for CLIENT_PORT_1 now, and */ + /* socket_3 is bound to the port which has the same hash index with CLIENT_PORT_1. */ + status = nx_udp_socket_unbind(&socket_0); + if (status) + error_counter++; + + status = nx_udp_socket_unbind(&socket_3); + status = nx_udp_socket_delete(&socket_3); + + /* Let thread 1 and thread 2 finish the job. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_udp_socket_bind(&socket_0, CLIENT_PORT_1, 2 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tx_thread_resume(&thread_2); + tx_thread_sleep(NX_IP_PERIODIC_RATE/2); + + status = nx_udp_socket_unbind(&socket_0); + if (status) + error_counter++; + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + if (status) + error_counter++; + + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status) + error_counter++; + + /* Bind the UDP socket to CLIENT_PORT_1 that socket_0 has bound to. */ + status = nx_udp_socket_bind(&socket_1, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_PORT_UNAVAILABLE) + error_counter++; + + tx_thread_resume(&thread_0); + /* Bind the UDP socket to CLIENT_PORT_1 that socket_0 has bound to. */ + status = nx_udp_socket_bind(&socket_1, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); +} + +static void thread_2_entry(ULONG thread_input) +{ +UINT status; + + /* Suspend this thread, resume thread_0. */ + tx_thread_resume(&thread_0); + tx_thread_suspend(&thread_2); + + status = nx_udp_socket_create(&ip_0, &socket_2, "Socket 2", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if(status) + error_counter++; + + /* Bind the socket to CLIENT_PORT_1 that socket_0 has bound to. */ + status = nx_udp_socket_bind(&socket_2, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_2); + + tx_thread_suspend(&thread_2); + status = nx_udp_socket_bind(&socket_2, CLIENT_PORT_1, 5 * NX_IP_PERIODIC_RATE); +} diff --git a/test/regression/netxduo_test/netx_udp_source_send_test.c b/test/regression/netxduo_test/netx_udp_source_send_test.c new file mode 100644 index 00000000..082315f9 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_source_send_test.c @@ -0,0 +1,545 @@ +/* This NetX test concentrates on the basic UDP operation. */ + + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); +#if defined(__PRODUCT_NETXDUO__) && (NX_MAX_PHYSICAL_INTERFACES > 1) && !defined(NX_DISABLE_IPV4) +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; + + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_0; +static NXD_ADDRESS address_1; +#endif /* FEATURE_NX_IPV6 */ + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static UCHAR recv_buf[28]; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_source_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* . */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFF000UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Set the second interface. */ + status += nx_ip_interface_attach(&ip_0, "Second Interface", IP_ADDRESS(1, 2, 4, 4), 0xFFFF0000UL, _nx_ram_network_driver_256); + status += nx_ip_interface_attach(&ip_1, "Second Interface", IP_ADDRESS(1, 2, 4, 5), 0xFFFF0000UL, _nx_ram_network_driver_256); + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check TCP enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + address_0.nxd_ip_version = NX_IP_VERSION_V6; + address_0.nxd_ip_address.v6[0] = 0x20010DB8; + address_0.nxd_ip_address.v6[1] = 0x00010001; + address_0.nxd_ip_address.v6[2] = 0x021122FF; + address_0.nxd_ip_address.v6[3] = 0xFE334456; + + address_1.nxd_ip_version = NX_IP_VERSION_V6; + address_1.nxd_ip_address.v6[0] = 0x20010DB8; + address_1.nxd_ip_address.v6[1] = 0x00010001; + address_1.nxd_ip_address.v6[2] = 0x021122FF; + address_1.nxd_ip_address.v6[3] = 0xFE334499; + + status += nxd_ipv6_address_set(&ip_0, 0, &address_0, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &address_1, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* Check for UDP enable errors. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT free_port; + + + /* Print out some test information banners. */ + printf("NetX Test: UDP Source Send Test......................................"); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Pickup the first free port for 0x88. */ + status = nx_udp_free_port_find(&ip_0, 0x88, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(1, 2, 3, 5), 0, 0); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set static route. */ + nx_ip_static_route_add(&ip_0, IP_ADDRESS(1, 2, 0, 0), 0xFFFF0000, IP_ADDRESS(1, 2, 3, 5)); + + status = nx_udp_socket_source_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89, 1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + +#ifdef FEATURE_NX_IPV6 + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_packet_data_append(my_packet, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_udp_socket_source_send(&socket_0, my_packet, &address_1, 0x89, 0); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +#endif + + tx_thread_resume(&thread_1); + + status = nx_packet_pool_delete(&pool_0); + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_0); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +ULONG bytes_copied; +ULONG src_address; +UINT src_port; +ULONG bytes_available; +UINT i; +UINT protocol; +UINT if_index; +NXD_ADDRESS nxd_src_address; + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Socket is not bound, should return an error message. */ + status = nx_udp_socket_bytes_available(&socket_1, &bytes_available); + if(status != NX_NOT_SUCCESSFUL) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_suspend(&thread_1); + + status = nx_udp_socket_bytes_available(&socket_1, &bytes_available); +#ifdef FEATURE_NX_IPV6 + if(status || bytes_available != 56) + error_counter++; +#else + if(status || bytes_available != 28) + error_counter++; +#endif + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Get source address and port. */ + status = nx_udp_packet_info_extract(my_packet, &src_address, NX_NULL, &src_port, NX_NULL); + if(status || (src_address != IP_ADDRESS(1, 2, 4, 4)) || src_port != 0x88) + { + printf("ERROR!\n"); + test_control_return(1); + + } + + status = nx_packet_data_extract_offset(my_packet, 0, recv_buf, 28, &bytes_copied); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + else if(memcmp(recv_buf, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28) || (bytes_copied != 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test function _nxd_udp_packet_info_extract . */ + my_packet -> nx_packet_address.nx_packet_interface_ptr = NX_NULL; + status = nxd_udp_packet_info_extract(my_packet, NX_NULL, &protocol, &src_port, &if_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + my_packet -> nx_packet_ip_version = 1; + status = nxd_udp_packet_info_extract(my_packet, NX_NULL, &protocol, &src_port, &if_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nxd_udp_packet_info_extract(my_packet, &nxd_src_address, &protocol, &src_port, &if_index); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_packet_info_extract(my_packet, &src_address, NX_NULL, &src_port, NX_NULL); + if(status != NX_INVALID_PACKET) + { + printf("ERROR!\n"); + test_control_return(1); + + } + + if(memcmp(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test function nxd_udp_packet_info_extract. */ + my_packet -> nx_packet_address.nx_packet_ipv6_address_ptr = NX_NULL; + status = nxd_udp_packet_info_extract(my_packet, &nxd_src_address, &protocol, &src_port, &if_index); + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#endif + + /* Use up the packet pool. */ + i = 0; + while(i < pool_0.nx_packet_pool_total) + { + i++; + nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 2 * NX_IP_PERIODIC_RATE); + } + + /* No packet, suspend the thread. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, 5 * NX_IP_PERIODIC_RATE); + if(status != NX_POOL_DELETED) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the UDP socket. */ + status = nx_udp_socket_delete(&socket_1); + + /* Check status. */ + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_source_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: UDP Source Send Test......................................N/A\n"); + test_control_return(3); +} +#endif /* __PRODUCT_NETXDUO__ */ diff --git a/test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv4_basic_test.c b/test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv4_basic_test.c new file mode 100644 index 00000000..fc6bd5d1 --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv4_basic_test.c @@ -0,0 +1,405 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined( NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +static ULONG notify_calls = 0; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv4_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet; + CHAR *msg = MSG; + UINT free_port; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV4_4 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V4,address_selector_0); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + /* Check for error. */ + if (status) + error_counter++; + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020305; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020304; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Supsend thread 0. */ + tx_thread_resume(&thread_0); + + tx_thread_relinquish(); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &packet_ptr, TX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv4_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV4_4 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv6_basic_test.c b/test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv6_basic_test.c new file mode 100644 index 00000000..63a8ef4f --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_tunnel_ipv4_ipv6_basic_test.c @@ -0,0 +1,429 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +static ULONG notify_calls = 0; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv4_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *my_packet; + CHAR *msg = MSG; + UINT free_port; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV4_6 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + /* Check for error. */ + if (status) + error_counter++; + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + +} + + +static void thread_1_entry(ULONG thread_input) +{ + + UINT status; + NX_PACKET *packet_ptr; + ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v4 = 0x02000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v4 = 0x01000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v4 = 0x02000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Supsend thread 0. */ + tx_thread_resume(&thread_0); + + tx_thread_relinquish(); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &packet_ptr, TX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv4_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV4_6 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv4_basic_test.c b/test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv4_basic_test.c new file mode 100644 index 00000000..a006afcd --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv4_basic_test.c @@ -0,0 +1,446 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) && !defined(NX_DISABLE_IPV4) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +static ULONG notify_calls = 0; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv6_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; +UINT free_port; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV6_4 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_0.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V4,address_selector_0); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + /* Check for error. */ + if (status) + error_counter++; + + /* Setup the ARP entry for the UDP send. */ + nx_arp_dynamic_entry_set(&ip_0, IP_ADDRESS(2, 2, 3, 5), 0, 0); + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_2, 0x89); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_src_tunnel_address.nxd_ip_address.v4 = 0x02020304; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_version = NX_IP_VERSION_V4; + address_selector_1.nx_selector_dst_tunnel_address.nxd_ip_address.v4 = 0x02020305; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V4,address_selector_1); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Supsend thread 0. */ + tx_thread_resume(&thread_0); + + tx_thread_relinquish(); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &packet_ptr, TX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv6_ipv4_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV6_4 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv6_basic_test.c b/test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv6_basic_test.c new file mode 100644 index 00000000..fba76a4d --- /dev/null +++ b/test/regression/netxduo_test/netx_udp_tunnel_ipv6_ipv6_basic_test.c @@ -0,0 +1,444 @@ +/* This NetX IPsec basic test using AES. */ + +#include "tx_api.h" +#include "nx_api.h" +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && defined(NX_TUNNEL_ENABLE) +#include "nx_ipv6.h" +#include "nx_tunnel.h" +#define DEMO_STACK_SIZE 4096 + +#define MSG "abcdefghijklmnopqrstuvwxyz" + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + +static ULONG notify_calls = 0; + +NXD_ADDRESS ipv6_address_1; +NXD_ADDRESS ipv6_address_2; +NXD_ADDRESS ipv6_address_3; +NXD_ADDRESS ipv6_address_4; + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG error_counter = 0; +static CHAR rcv_buffer[200]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +static NX_ADDRESS_SELECTOR address_selector_0; +static NX_ADDRESS_SELECTOR address_selector_1; +static NX_TUNNEL tunnel_0; +static NX_TUNNEL tunnel_1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv6_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + thread_0_counter = 0; + thread_1_counter = 0; + error_counter = 0; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); + pointer = pointer + 8192; + + if (status) + error_counter++; + + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + status += nx_ip_interface_attach(&ip_0,"Second Interface",IP_ADDRESS(2,2,3,4),0xFFFFFF00UL, _nx_ram_network_driver_1500); + status += nx_ip_interface_attach(&ip_1,"Second Interface",IP_ADDRESS(2,2,3,5),0xFFFFFF00UL, _nx_ram_network_driver_1500); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[3] = 0x10000001; + + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x20010000; + ipv6_address_2.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_2.nxd_ip_address.v6[3] = 0x10000002; + + ipv6_address_3.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_3.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_3.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_3.nxd_ip_address.v6[3] = 0x20000003; + + ipv6_address_4.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_4.nxd_ip_address.v6[0] = 0x30010000; + ipv6_address_4.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[2] = 0x00000000; + ipv6_address_4.nxd_ip_address.v6[3] = 0x20000004; + + /* Set interfaces' address */ + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 0, &ipv6_address_2, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_0, 1, &ipv6_address_3, 64, NX_NULL); + status += nxd_ipv6_address_set(&ip_1, 1, &ipv6_address_4, 64, NX_NULL); + + if (status) + error_counter++; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + status = nxd_ipv6_enable(&ip_1); + + /* Check IPv6 enable status. */ + if (status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + status = nxd_icmp_enable(&ip_1); + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check for UDP enable errors. */ + if (status) + error_counter++; + + status = nx_tunnel_enable(&ip_0); + status += nx_tunnel_enable(&ip_1); + + /* Check Tunnel enable status. */ + if (status) + error_counter++; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +CHAR *msg = MSG; +UINT free_port; + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV6_6 Basic Processing Test......."); + + /* Check for earlier error. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create TUNNEL. */ + address_selector_0.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_0.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_0.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_0.nx_selector_src_tunnel_address = ipv6_address_3; + address_selector_0.nx_selector_dst_tunnel_address = ipv6_address_4; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_0, &tunnel_0,NX_IP_VERSION_V6,address_selector_0); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Get the port that is actually bound to this socket. */ + status = nx_udp_socket_port_get(&socket_0, &free_port); + + /* Check status. */ + if ((status) || (free_port != 0x88)) + { + + printf("ERROR!\n"); + test_control_return(31); + } + + /* Disable checksum logic for this socket. */ + status = nx_udp_socket_checksum_disable(&socket_0); + + /* Check status. */ + if (status) + { + + printf("ERROR!\n"); + test_control_return(1); + } + /* Check for error. */ + if (status) + error_counter++; + + /* Let other threads run again. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, &msg[0], 26); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 26; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 26; + + /* Suspend thread1 */ + tx_thread_suspend(&thread_1); + + /* Send the UDP packet. */ + status = nxd_udp_socket_send(&socket_0, my_packet, &ipv6_address_2, 0x89); + + /* Determine if the status is valid. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + } + + tx_thread_resume(&thread_1); + + tx_thread_relinquish(); + +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +ULONG recv_length = 0; + + /* Create TUNNEL. */ + address_selector_1.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_src_address_end.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x20000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + + address_selector_1.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[0] = 0x30000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[1] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0x00000000; + address_selector_1.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0x00000000; + + /* add tunnel address. */ + address_selector_1.nx_selector_src_tunnel_address = ipv6_address_4; + address_selector_1.nx_selector_dst_tunnel_address = ipv6_address_3; + + /* Set up TUNNEL */ + status = nx_tunnel_create(&ip_1, &tunnel_1,NX_IP_VERSION_V6,address_selector_1); + + if (status) + error_counter++; + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Register the receive notify function. */ + status = nx_udp_socket_receive_notify(&socket_1, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Supsend thread 0. */ + tx_thread_resume(&thread_0); + + tx_thread_relinquish(); + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &packet_ptr, TX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + error_counter++; + else + { + if(packet_ptr -> nx_packet_length == 0) + error_counter++; + + memcpy(&rcv_buffer[recv_length], packet_ptr -> nx_packet_prepend_ptr, packet_ptr -> nx_packet_length); + recv_length = packet_ptr -> nx_packet_length; + + /* Release the packet. */ + nx_packet_release(packet_ptr); + } + + if(recv_length != 26) + error_counter++; + + if(memcmp(rcv_buffer, (void*)MSG, recv_length)) + error_counter++; + + /* Determine if the test was successful. */ + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + +} + +static void receive_packet_function(NX_UDP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &socket_1) + notify_calls++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_udp_tunnel_ipv6_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out some test information banners. */ + printf("NetX Test: TUNNEL UDP IPV6_6 Basic Processing Test...................N/A\n"); + + test_control_return(3); + +} +#endif /* NX_TUNNEL_ENABLE */ \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_utility_test.c b/test/regression/netxduo_test/netx_utility_test.c new file mode 100644 index 00000000..d5a1bc5c --- /dev/null +++ b/test/regression/netxduo_test/netx_utility_test.c @@ -0,0 +1,688 @@ +/* This NetX test concentrates on the utility functions. */ + +#include "nx_md5.h" +#include "tx_api.h" +#include "nx_api.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_utility_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + + +/* Define the test threads. */ + +static void ntest_0_entry(ULONG thread_input) +{ + +UINT status; +UINT string_length; +UINT number; +UCHAR input_buffer[256] = {0}; +UCHAR out_buffer[256] = {0}; +UINT bytes_copied; +UINT i; +UINT size; +NX_MD5 context; + + /* Print out test information banner. */ + printf("NetX Test: Utility Test.............................................."); + + /* Null string pointer. */ + status = _nx_utility_string_length_check(NX_NULL, &string_length, 10); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* The length of string is less than max length. */ + status = _nx_utility_string_length_check("test string", &string_length, sizeof("test string")); + + /* Check status. */ + if ((status != NX_SUCCESS) || (string_length != sizeof("test string") - 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* The length of string is equal to max length. */ + status = _nx_utility_string_length_check("test string", &string_length, sizeof("test string") - 1); + + /* Check status. */ + if ((status != NX_SUCCESS) || (string_length != sizeof("test string") - 1)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* The length of string is equal to max length. */ + status = _nx_utility_string_length_check("test string", &string_length, sizeof("test string") - 2); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify _nx_utility_string_to_uint(). */ + + /* Null string pointer. */ + status = _nx_utility_string_to_uint(NX_NULL, sizeof("4294967295") -1, &number); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Null string pointer. */ + status = _nx_utility_string_to_uint("4294967295", sizeof("4294967295") -1, NX_NULL); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Invalid string length. */ + status = _nx_utility_string_to_uint("4294967295", 0, &number); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify string "1234". */ + status = _nx_utility_string_to_uint("1234", sizeof("1234") -1, &number); + + /* Check status. */ + if ((status) || (number != 1234)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Verify max value number(Hex:FFFFFFFF, Decimal:4294967295). */ + status = _nx_utility_string_to_uint("4294967295", sizeof("4294967295") -1, &number); + + /* Check status. */ + if ((status) || (number != 4294967295)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test invalid string "4294967296". */ + status = _nx_utility_string_to_uint("4294967296", sizeof("4294967296") -1, &number); + + /* Check status. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test invalid string "4294967300". */ + status = _nx_utility_string_to_uint("4294967300", sizeof("4294967300") -1, &number); + + /* Check status. */ + if (status != NX_OVERFLOW) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test invalid string. */ + status = _nx_utility_string_to_uint("123+", sizeof("123+") -1, &number); + + /* Check status. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test invalid string. */ + status = _nx_utility_string_to_uint("123A", sizeof("123A") -1, &number); + + /* Check status. */ + if (status != NX_INVALID_PARAMETERS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Base64 encode test. */ + + /* Null name pointer. */ + status = _nx_utility_base64_encode(NX_NULL, sizeof("name:password") -1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* 0 name size. */ + status = _nx_utility_base64_encode("name:password", 0, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* NULL buffer pointer. */ + status = _nx_utility_base64_encode("name:password", sizeof("name:password") -1, NX_NULL, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* 0 buffer size. */ + status = _nx_utility_base64_encode("name:password", sizeof("name:password") -1, out_buffer, 0, &bytes_copied); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* NULL bytes copied pointer. */ + status = _nx_utility_base64_encode("name:password", sizeof("name:password") -1, out_buffer, sizeof(out_buffer), NX_NULL); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode name with small buffer. */ + status = _nx_utility_base64_encode("name:password", sizeof("name:password") -1, out_buffer, 20, &bytes_copied); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode name successfully. */ + status = _nx_utility_base64_encode("name:password", sizeof("name:password") -1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 20) || + (memcmp(out_buffer, "bmFtZTpwYXNzd29yZA==", 20) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode special character. */ + input_buffer[0] = 0x80; + input_buffer[1] = 0; + status = _nx_utility_base64_encode(input_buffer, 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 4) || + (memcmp(out_buffer, "gA==", 4) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode 1 character. */ + input_buffer[0] = 'a'; + input_buffer[1] = 0; + status = _nx_utility_base64_encode(input_buffer, 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 4) || + (memcmp(out_buffer, "YQ==", 4) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test array without null terminator. */ + input_buffer[0] = 'a'; + input_buffer[1] = 0xff; + status = _nx_utility_base64_encode(input_buffer, 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 4) || + (memcmp(out_buffer, "YQ==", 4) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode 2 characters. */ + input_buffer[0] = 'a'; + input_buffer[1] = 'b'; + input_buffer[2] = 0; + status = _nx_utility_base64_encode(input_buffer, 2, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 4) || + (memcmp(out_buffer, "YWI=", 4) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Test array without null terminator. */ + input_buffer[0] = 'a'; + input_buffer[1] = 'b'; + input_buffer[2] = 0xff; + status = _nx_utility_base64_encode(input_buffer, 2, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 4) || + (memcmp(out_buffer, "YWI=", 4) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Crash test. */ + for (i = 1; i <= 0xFF; i++) + { + input_buffer[0] = i; + input_buffer[1] = i; + input_buffer[2] = i; + input_buffer[3] = 0; + _nx_utility_base64_encode(input_buffer, 3, out_buffer, sizeof(out_buffer), &bytes_copied); + } + + /* Base64 decode test. */ + + /* Null name pointer. */ + status = _nx_utility_base64_decode(NX_NULL, sizeof("bmFtZTpwYXNzd29yZA==") -1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* 0 name size. */ + status = _nx_utility_base64_decode("bmFtZTpwYXNzd29yZA==", 0, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* NULL buffer pointer. */ + status = _nx_utility_base64_decode("bmFtZTpwYXNzd29yZA==", sizeof("bmFtZTpwYXNzd29yZA==") -1, NX_NULL, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* 0 buffer size. */ + status = _nx_utility_base64_decode("bmFtZTpwYXNzd29yZA==", sizeof("bmFtZTpwYXNzd29yZA==") -1, out_buffer, 0, &bytes_copied); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* NULL bytes copied pointer. */ + status = _nx_utility_base64_decode("bmFtZTpwYXNzd29yZA==", sizeof("bmFtZTpwYXNzd29yZA==") -1, out_buffer, sizeof(out_buffer), NX_NULL); + + /* Check status. */ + if (status != NX_PTR_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode name with small buffer. */ + status = _nx_utility_base64_decode("bmFtZTpwYXNzd29yZA==", sizeof("bmFtZTpwYXNzd29yZA==") -1, out_buffer, 13, &bytes_copied); + + /* Check status. */ + if (status != NX_SIZE_ERROR) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode name successfully. */ + status = _nx_utility_base64_decode("bmFtZTpwYXNzd29yZA==", sizeof("bmFtZTpwYXNzd29yZA==") -1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 13) || + (memcmp(out_buffer, "name:password", 13) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Encode special character. */ + status = _nx_utility_base64_decode("gA==", sizeof("gA==") - 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 1) || + (out_buffer[0] != 0x80)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Decode cut string. */ + status = _nx_utility_base64_decode("bmFt=TpwYXNzd29yZA==", sizeof("bmFt=TpwYXNzd29yZA==") -1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 3) || + (memcmp(out_buffer, "nam", 3) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Decode cut string. */ + status = _nx_utility_base64_decode("bmFt\0TpwYXNzd29yZA==", sizeof("bmFt\0TpwYXNzd29yZA==") -1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if ((status != NX_SUCCESS) || + (bytes_copied != 3) || + (memcmp(out_buffer, "nam", 3) != 0)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Crash test. */ + for (i = 1; i <= 0xFF; i++) + { + input_buffer[0] = i; + input_buffer[1] = i; + input_buffer[2] = i; + input_buffer[3] = 0; + _nx_utility_base64_decode(input_buffer, 3, out_buffer, sizeof(out_buffer), &bytes_copied); + } + + /* Read overflow test. */ + input_buffer[0] = '='; + input_buffer[1] = '='; + input_buffer[2] = 0; + status = _nx_utility_base64_decode(&input_buffer[1], 1, out_buffer, 0xffffffff, &bytes_copied); + + /* Check status. */ + if (status || bytes_copied != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_utility_base64_decode("==", sizeof("==") - 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status || bytes_copied != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_utility_base64_decode("T", sizeof("T") - 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status || bytes_copied != 0) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_utility_base64_decode("TQ", sizeof("TQ") - 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status || bytes_copied != 1 || out_buffer[0] != 'M') + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_utility_base64_decode("TQ=", sizeof("TQ=") - 1, out_buffer, sizeof(out_buffer), &bytes_copied); + + /* Check status. */ + if (status || bytes_copied != 1 || out_buffer[0] != 'M') + { + + printf("ERROR!\n"); + test_control_return(1); + } + + number = 0x1234; + size = _nx_utility_uint_to_string(number, 10, out_buffer, sizeof(out_buffer)); + if ((size != 4) || (memcmp(out_buffer, "4660", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 16, out_buffer, sizeof(out_buffer)); + if ((size != 4) || (memcmp(out_buffer, "1234", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 8, out_buffer, sizeof(out_buffer)); + if ((size != 5) || (memcmp(out_buffer, "11064", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + number = 0xffffffff; + size = _nx_utility_uint_to_string(number, 10, out_buffer, sizeof(out_buffer)); + if ((size != 10) || (memcmp(out_buffer, "4294967295", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 16, out_buffer, sizeof(out_buffer)); + if ((size != 8) || (memcmp(out_buffer, "ffffffff", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 8, out_buffer, sizeof(out_buffer)); + if ((size != 11) || (memcmp(out_buffer, "37777777777", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + number = 0; + size = _nx_utility_uint_to_string(number, 10, out_buffer, sizeof(out_buffer)); + if ((size != 1) || (memcmp(out_buffer, "0", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 16, out_buffer, sizeof(out_buffer)); + if ((size != 1) || (memcmp(out_buffer, "0", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 8, out_buffer, sizeof(out_buffer)); + if ((size != 1) || (memcmp(out_buffer, "0", size) != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + number = 0xffffffff; + size = _nx_utility_uint_to_string(number, 16, out_buffer, 8); + if (size != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 10, NX_NULL, 8); + if (size != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 10, out_buffer, 0); + if (size != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + size = _nx_utility_uint_to_string(number, 0, out_buffer, sizeof(out_buffer)); + if (size != 0) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_md5_initialize(NX_NULL); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_md5_update(NX_NULL, input_buffer, 1); + if (status != NX_PTR_ERROR) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = _nx_md5_update(&context, input_buffer, 0); + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + _nx_md5_initialize(&context); + context.nx_md5_bit_count[0] = 0xffffffff; + + status = _nx_md5_update(&context, input_buffer, 1); + if (status || context.nx_md5_bit_count[1] != 1) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + diff --git a/test/regression/pop3_test/netx_pop3_abnormal_packet_test.c b/test/regression/pop3_test/netx_pop3_abnormal_packet_test.c new file mode 100644 index 00000000..aa9e990e --- /dev/null +++ b/test/regression/pop3_test/netx_pop3_abnormal_packet_test.c @@ -0,0 +1,157 @@ +/* + This tests POP3 client process abnormal packet. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_pop3_client.h" +#else +#include "nx_pop3_client.h" +#endif +extern void test_control_return(UINT); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +static UINT error_counter = 0; + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up Client thread entry point. */ +static void client_thread_entry(ULONG info); + + +/* Set up the POP3 Client and POP3 server socket. */ + +static TX_THREAD client_thread; +static NX_POP3_CLIENT pop3_client; +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; + +/* Use the maximum size payload to insure no packets are dropped. */ +#define PAYLOAD_SIZE 1514 + +static char abnormal_packet[] = {0x0A}; + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + + /* Setup the working pointer. */ + free_memory_pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create a client thread. */ + tx_thread_create(&client_thread, "Client", client_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, 1, 1, + TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + + /* Create Client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "POP3 Client Packet Pool", + PAYLOAD_SIZE, free_memory_pointer, (PAYLOAD_SIZE * 10)); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + (PAYLOAD_SIZE * 10); + + /* Create IP instance for demo Client */ + status = nx_ip_create(&client_ip, "POP3 Client IP Instance", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, + &client_packet_pool, _nx_ram_network_driver_1024, free_memory_pointer, + 2048, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 2048; + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&client_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Client IP. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + +/* Define the application thread entry function. */ + +void client_thread_entry(ULONG info) +{ + +UINT status; +UCHAR *buffer_ptr; +UINT buffer_length; +CHAR test_buffer[11] = {0}; +CHAR *argument; + + NX_PARAMETER_NOT_USED(info); + + /* Print out test information banner. */ + printf("NetX Test: POP3 Abnormal Packet Test................................."); + + buffer_ptr = abnormal_packet; + buffer_length = sizeof(abnormal_packet); + test_buffer[0] = 0x0D; + argument = test_buffer + 1; + _nx_pop3_parse_response(buffer_ptr, 1, buffer_length, argument, 10, NX_FALSE, NX_FALSE); + + if (test_buffer[0] != 0x0D) + { + error_counter++; + } + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: POP3 Abnormal Packet Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/pop3_test/netx_pop3_mail_receive_test.c b/test/regression/pop3_test/netx_pop3_mail_receive_test.c new file mode 100644 index 00000000..6e23d0da --- /dev/null +++ b/test/regression/pop3_test/netx_pop3_mail_receive_test.c @@ -0,0 +1,612 @@ +/* + This is a small demo of POP3 Client on the high-performance NetX TCP/IP stack. + This demo relies on Thread, NetX and POP3 Client API to conduct + a POP3 mail session. + + The POP3 'server' is a TCP socket that sends responses and downloads a mail item + of three packets. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_pop3_client.h" +#else +#include "nx_pop3_client.h" +#endif +extern void test_control_return(UINT); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define SERVER_PORT 110 + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT nx_pop3_response_packet_send(NX_TCP_SOCKET *server_socket_ptr, INT packet_number); +static UINT pop3_initialize_responses(); + +/* Set up Client thread entry point. */ +static void client_thread_entry(ULONG info); +/* Set up Server thread entry point. */ +static void server_thread_entry(ULONG info); + + +/* Set up the POP3 Client and POP3 server socket. */ + +static TX_THREAD client_thread; +static NX_POP3_CLIENT pop3_client; +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD server_thread; +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_packet_pool; +static NX_IP server_ip; + +/* Use the maximum size payload to insure no packets are dropped. */ +#define PAYLOAD_SIZE 1514 + +/* Shared secret is the same as password. */ + +#define LOCALHOST "recipient@domain.com" +#define LOCALHOST_PASSWORD "testpwd" + +typedef struct POP3_RESPONSE_STRUCT +{ + char *pop3_response_pkt_data; + int pop3_response_pkt_size; +} POP3_RESPONSE; + +#define NUM_RESPONSES 10 +static POP3_RESPONSE pop3_response[NUM_RESPONSES]; + + +static char greeting[115] = { +0x2b, 0x4f, /* ..\...+O */ +0x4b, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x65, /* K mail.e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x20, /* gic.com */ +0x50, 0x4f, 0x50, 0x33, 0x20, 0x4d, 0x44, 0x61, /* POP3 MDa */ +0x65, 0x6d, 0x6f, 0x6e, 0x20, 0x31, 0x35, 0x2e, /* emon 15. */ +0x35, 0x2e, 0x33, 0x20, 0x72, 0x65, 0x61, 0x64, /* 5.3 read */ +0x79, 0x20, 0x3c, 0x4d, 0x44, 0x41, 0x45, 0x4d, /* y . */ +0x0a /* . */ +}; + +static int greeting_size = 115; + +static char user_ok[47] = { +0x2b, 0x4f, /* ...c..+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x2e, 0x2e, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x72, /* ... User */ +0x20, 0x6f, 0x6b, 0x0d, 0x0a /* ok.. */ +}; + +static int user_ok_size = 47; + +static char password_ok[83] = { +0x2b, 0x4f, /* ...p..+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x27, 0x73, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x62, /* 's mailb */ +0x6f, 0x78, 0x20, 0x68, 0x61, 0x73, 0x20, 0x31, /* ox has 1 */ +0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x6d, /* total m */ +0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, /* essages */ +0x28, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, 0x20, /* (187402 */ +0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x29, 0x0d, /* octets). */ +0x0a /* . */ +}; + +static int password_ok_size = 83; + +static char stat_ok[14] = { +0x2b, 0x4f, /* ..}...+O */ +0x4b, 0x20, 0x31, 0x20, 0x31, 0x38, 0x37, 0x34, /* K 1 1874 */ +0x30, 0x32, 0x0d, 0x0a /* 02.. */ +}; + +static int stat_ok_size = 14; + +static char retr_ok[19] = { +0x2b, 0x4f, /* ..Tv..+O */ +0x4b, 0x20, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, /* K 187402 */ +0x20, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x0d, /* octets. */ +0x0a /* . */ +}; + +static int retr_ok_size = 19; + + +static char first_data_packet[82] = { +0x52, 0x65, /* ..G...Re */ +0x74, 0x75, 0x72, 0x6e, 0x2d, 0x70, 0x61, 0x74, /* turn-pat */ +0x68, 0x3a, 0x20, 0x3c, 0x74, 0x65, 0x73, 0x74, /* h: ..Authe */ +0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* nticatio */ +0x6e, 0x2d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, /* n-Result */ +0x73, 0x3a, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, /* s: expre */ +0x73, 0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e +}; + +static int first_data_packet_size = 82; + +static char second_data_packet[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x6d, 0x69 +}; + +static int second_data_packet_size = 82; + +static char last_data_packet[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x0d, 0x0a, 0x2e, 0x0d, 0x0a +}; + +static int last_data_packet_size = 82; + +static char dele_ok[23] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, /* K messag */ +0x65, 0x20, 0x31, 0x20, 0x64, 0x65, 0x6c, 0x65, /* e 1 dele */ +0x74, 0x65, 0x64, 0x0d, 0x0a /* ted.. */ +}; + + +static int dele_ok_size = 23; + +static char quit_ok[93] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, /* express */ +0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, /* logic.co */ +0x6d, 0x20, 0x50, 0x4f, 0x50, 0x33, 0x20, 0x53, /* m POP3 S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, /* erver si */ +0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, /* gning of */ +0x66, 0x20, 0x28, 0x6d, 0x61, 0x69, 0x6c, 0x62, /* f (mailb */ +0x6f, 0x78, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, /* ox empty */ +0x29, 0x0d, 0x0a /* ).. */ +}; + +static int quit_ok_size = 93; + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_mail_receive_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + + /* Setup the working pointer. */ + free_memory_pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the Server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "Server Packet Pool", PAYLOAD_SIZE, free_memory_pointer , PAYLOAD_SIZE*10); + + free_memory_pointer = free_memory_pointer + PAYLOAD_SIZE*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(1,2,3,4), + 0xFFFFFF00UL, + &server_packet_pool, _nx_ram_network_driver_1024, + free_memory_pointer, DEMO_STACK_SIZE, 1); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&server_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Server IP. */ + nx_tcp_enable(&server_ip); + nx_icmp_enable(&server_ip); + + /* Create a client thread. */ + tx_thread_create(&client_thread, "Client", client_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, 1, 1, + TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + + /* Create Client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "POP3 Client Packet Pool", + PAYLOAD_SIZE, free_memory_pointer, (PAYLOAD_SIZE * 10)); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + (PAYLOAD_SIZE * 10); + + /* Create IP instance for demo Client */ + status = nx_ip_create(&client_ip, "POP3 Client IP Instance", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, + &client_packet_pool, _nx_ram_network_driver_1024, free_memory_pointer, + 2048, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 2048; + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&client_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Client IP. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + +/* Define the server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT i =0; + + /* Print out test information banner. */ + printf("NetX Test: POP3 Mail Receive Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + error_counter++; + } + + /* Create a socket as the server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + pop3_initialize_responses(); + + /* Bind the TCP socket to the POP3 port. */ + status = nx_tcp_server_socket_listen(&server_ip, 110, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES ) + { + + status = nx_pop3_response_packet_send(&server_socket, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* If this is the QUIT response, we're done */ + if (i == 9) + break; + + if ((i <4) || (i > 6)) + { + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +/* Define the application thread entry function. */ + +void client_thread_entry(ULONG info) +{ + +UINT status; +UINT mail_item, number_mail_items; +UINT bytes_downloaded = 0; +UINT final_packet = NX_FALSE; +ULONG total_size, mail_item_size, bytes_retrieved; +NX_PACKET *packet_ptr; + + NX_PARAMETER_NOT_USED(info); + + /* Let the IP instance get initialized with driver parameters. */ + tx_thread_sleep(10); + + /* Create a NetX POP3 Client instance with no byte or block memory pools. + Note that it uses its password for its APOP shared secret. */ + status = nx_pop3_client_create(&pop3_client, + NX_FALSE /* if true, enables Client to send APOP command to authenticate */, + &client_ip, &client_packet_pool, IP_ADDRESS(1,2,3,4), 110, + LOCALHOST, LOCALHOST_PASSWORD); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Find out how many items are in our mailbox. */ + status = nx_pop3_client_mail_items_get(&pop3_client, &number_mail_items, &total_size); + + /* If nothing in the mailbox, disconnect. */ + if (number_mail_items == 0) + { + error_counter++; + } + + /* Download all mail items. */ + mail_item = 1; + + while (mail_item <= number_mail_items) + { + + /* This submits a RETR request and gets the mail message size. */ + status = nx_pop3_client_mail_item_get(&pop3_client, mail_item, &mail_item_size); + + /* Loop to get the next mail message packet until the last mail item + packet is downloaded. */ + do + { + + status = nx_pop3_client_mail_item_message_get(&pop3_client, &packet_ptr, + &bytes_retrieved, + &final_packet); + + if (status != NX_SUCCESS) + { + break; + } + + nx_packet_release(packet_ptr); + + /* Determine if this is the last data packet. */ + if (final_packet) + { + /* It is. Let the server know it can delete this mail item. */ + status = nx_pop3_client_mail_item_delete(&pop3_client, mail_item); + + if (status != NX_SUCCESS) + { + break; + } + } + + /* Keep track of how much mail message data is left. */ + bytes_downloaded += bytes_retrieved; + + } while (final_packet == NX_FALSE); + + /* Get the next mail item. */ + mail_item++; + + tx_thread_sleep(10); + } + + /* Disconnect from the POP3 server. */ + status = nx_pop3_client_quit(&pop3_client); + + client_running = NX_FALSE; + + if (status != NX_SUCCESS) + error_counter++; + + /* Delete the POP3 Client. */ + status = nx_pop3_client_delete(&pop3_client); + + if (status != NX_SUCCESS) + error_counter++; + +} + +static UINT nx_pop3_response_packet_send(NX_TCP_SOCKET *server_socket_ptr, INT packet_number) +{ + +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, pop3_response[packet_number].pop3_response_pkt_data, + pop3_response[packet_number].pop3_response_pkt_size); + + response_packet -> nx_packet_length = pop3_response[packet_number].pop3_response_pkt_size; + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nx_tcp_socket_send(server_socket_ptr, response_packet, 100); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static UINT pop3_initialize_responses() +{ + + pop3_response[0].pop3_response_pkt_data = &greeting[0]; + pop3_response[0].pop3_response_pkt_size = greeting_size ; + + pop3_response[1].pop3_response_pkt_data = &user_ok[0]; + pop3_response[1].pop3_response_pkt_size = user_ok_size ; + + pop3_response[2].pop3_response_pkt_data = &password_ok[0]; + pop3_response[2].pop3_response_pkt_size = password_ok_size ; + + pop3_response[3].pop3_response_pkt_data = &stat_ok[0]; + pop3_response[3].pop3_response_pkt_size = stat_ok_size ; + + pop3_response[4].pop3_response_pkt_data = &retr_ok[0]; + pop3_response[4].pop3_response_pkt_size = retr_ok_size ; + + pop3_response[5].pop3_response_pkt_data = &first_data_packet[0]; + pop3_response[5].pop3_response_pkt_size = first_data_packet_size ; + + pop3_response[6].pop3_response_pkt_data = &second_data_packet[0]; + pop3_response[6].pop3_response_pkt_size = second_data_packet_size ; + + pop3_response[7].pop3_response_pkt_data = &last_data_packet[0]; + pop3_response[7].pop3_response_pkt_size = last_data_packet_size ; + + pop3_response[8].pop3_response_pkt_data = &dele_ok[0]; + pop3_response[8].pop3_response_pkt_size = dele_ok_size ; + + pop3_response[9].pop3_response_pkt_data = &quit_ok[0]; + pop3_response[9].pop3_response_pkt_size = quit_ok_size ; + + return NX_SUCCESS; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_mail_receive_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: POP3 Mail Receive Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/pop3_test/netx_pop3_packet_with_endmarker_test.c b/test/regression/pop3_test/netx_pop3_packet_with_endmarker_test.c new file mode 100644 index 00000000..ad1f8268 --- /dev/null +++ b/test/regression/pop3_test/netx_pop3_packet_with_endmarker_test.c @@ -0,0 +1,727 @@ +/* + This is a small demo of POP3 Client on the high-performance NetX TCP/IP stack. + This demo relies on Thread, NetX and POP3 Client API to conduct + a POP3 mail session. + + The POP3 'server' is a TCP socket that sends responses and downloads a mail item + of three packets. The third packet of the second mail item only contains the POP# + end marker so the bytes_received should be zero. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_pop3_client.h" +#else +#include "nx_pop3_client.h" +#endif +extern void test_control_return(UINT); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define SERVER_PORT 110 + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT nx_pop3_response_packet_send(NX_TCP_SOCKET *server_socket_ptr, INT packet_number); +static UINT pop3_initialize_responses(); + +/* Set up Client thread entry point. */ +static void client_thread_entry(ULONG info); +/* Set up Server thread entry point. */ +static void server_thread_entry(ULONG info); + + +/* Set up the POP3 Client and POP3 server socket. */ + +static TX_THREAD client_thread; +static NX_POP3_CLIENT pop3_client; +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD server_thread; +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_packet_pool; +static NX_IP server_ip; + +/* Use the maximum size payload to insure no packets are dropped. */ +#define PAYLOAD_SIZE 1514 + +/* Shared secret is the same as password. */ + +#define LOCALHOST "recipient@domain.com" +#define LOCALHOST_PASSWORD "testpwd" + +typedef struct POP3_RESPONSE_STRUCT +{ + char *pop3_response_pkt_data; + int pop3_response_pkt_size; +} POP3_RESPONSE; + +#define NUM_RESPONSES 15 +static POP3_RESPONSE pop3_response[NUM_RESPONSES]; + + +static char greeting[115] = { +0x2b, 0x4f, /* ..\...+O */ +0x4b, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x65, /* K mail.e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x20, /* gic.com */ +0x50, 0x4f, 0x50, 0x33, 0x20, 0x4d, 0x44, 0x61, /* POP3 MDa */ +0x65, 0x6d, 0x6f, 0x6e, 0x20, 0x31, 0x35, 0x2e, /* emon 15. */ +0x35, 0x2e, 0x33, 0x20, 0x72, 0x65, 0x61, 0x64, /* 5.3 read */ +0x79, 0x20, 0x3c, 0x4d, 0x44, 0x41, 0x45, 0x4d, /* y . */ +0x0a /* . */ +}; + +static int greeting_size = 115; + +static char user_ok[47] = { +0x2b, 0x4f, /* ...c..+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x2e, 0x2e, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x72, /* ... User */ +0x20, 0x6f, 0x6b, 0x0d, 0x0a /* ok.. */ +}; + +static int user_ok_size = 47; + +static char password_ok[83] = { +0x2b, 0x4f, /* ...p..+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x27, 0x73, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x62, /* 's mailb */ +0x6f, 0x78, 0x20, 0x68, 0x61, 0x73, 0x20, 0x31, /* ox has 1 */ +0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x6d, /* total m */ +0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, /* essages */ +0x28, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, 0x20, /* (187402 */ +0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x29, 0x0d, /* octets). */ +0x0a /* . */ +}; + +static int password_ok_size = 83; + +static char stat_ok[14] = { +0x2b, 0x4f, /* ..}...+O */ +0x4b, 0x20, 0x32, 0x20, 0x31, 0x38, 0x37, 0x34, /* K 2 1874 */ +0x30, 0x32, 0x0d, 0x0a /* 02.. */ +}; + +static int stat_ok_size = 14; + +static char retr_ok[19] = { +0x2b, 0x4f, /* ..Tv..+O */ +0x4b, 0x20, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, /* K 187402 */ +0x20, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x0d, /* octets. */ +0x0a /* . */ +}; + +static int retr_ok_size = 19; + + +static char first_data_packet[82] = { +0x52, 0x65, /* ..G...Re */ +0x74, 0x75, 0x72, 0x6e, 0x2d, 0x70, 0x61, 0x74, /* turn-pat */ +0x68, 0x3a, 0x20, 0x3c, 0x74, 0x65, 0x73, 0x74, /* h: ..Authe */ +0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* nticatio */ +0x6e, 0x2d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, /* n-Result */ +0x73, 0x3a, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, /* s: expre */ +0x73, 0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e +}; + +static int first_data_packet_size = 82; + +static char second_data_packet[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x6d, 0x69 +}; + +static int second_data_packet_size = 82; + +static char last_data_packet[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x0d, 0x0a, 0x2e, 0x0d, 0x0a +}; + +static int last_data_packet_size = 82; + +static char dele_ok[23] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, /* K messag */ +0x65, 0x20, 0x31, 0x20, 0x64, 0x65, 0x6c, 0x65, /* e 1 dele */ +0x74, 0x65, 0x64, 0x0d, 0x0a /* ted.. */ +}; + + +static int dele_ok_size = 23; + + +static char retr_ok2[19] = { +0x2b, 0x4f, /* ..Tv..+O */ +0x4b, 0x20, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, /* K 187402 */ +0x20, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x0d, /* octets. */ +0x0a /* . */ +}; + +static int retr_ok2_size = 19; + + +static char first_data_packet2[82] = { +0x52, 0x65, /* ..G...Re */ +0x74, 0x75, 0x72, 0x6e, 0x2d, 0x70, 0x61, 0x74, /* turn-pat */ +0x68, 0x3a, 0x20, 0x3c, 0x74, 0x65, 0x73, 0x74, /* h: ..Authe */ +0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* nticatio */ +0x6e, 0x2d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, /* n-Result */ +0x73, 0x3a, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, /* s: expre */ +0x73, 0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e +}; + +static int first_data_packet2_size = 82; + +static char second_data_packet2[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x6d, 0x69 +}; + +static int second_data_packet2_size = 82; + +static char last_data_packet2[5] = { + 0x0d, 0x0a, 0x2e, 0x0d, 0x0a +}; + +static int last_data_packet2_size = 5; + +static char dele_ok2[23] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, /* K messag */ +0x65, 0x20, 0x31, 0x20, 0x64, 0x65, 0x6c, 0x65, /* e 1 dele */ +0x74, 0x65, 0x64, 0x0d, 0x0a /* ted.. */ +}; + + +static int dele_ok2_size = 23; + + + +static char quit_ok[93] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, /* express */ +0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, /* logic.co */ +0x6d, 0x20, 0x50, 0x4f, 0x50, 0x33, 0x20, 0x53, /* m POP3 S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, /* erver si */ +0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, /* gning of */ +0x66, 0x20, 0x28, 0x6d, 0x61, 0x69, 0x6c, 0x62, /* f (mailb */ +0x6f, 0x78, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, /* ox empty */ +0x29, 0x0d, 0x0a /* ).. */ +}; + +static int quit_ok_size = 93; + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_packet_with_endmarker_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + + /* Setup the working pointer. */ + free_memory_pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the Server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "Server Packet Pool", PAYLOAD_SIZE, free_memory_pointer , PAYLOAD_SIZE*10); + + free_memory_pointer = free_memory_pointer + PAYLOAD_SIZE*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(1,2,3,4), + 0xFFFFFF00UL, + &server_packet_pool, _nx_ram_network_driver_1024, + free_memory_pointer, DEMO_STACK_SIZE, 1); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&server_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Server IP. */ + nx_tcp_enable(&server_ip); + nx_icmp_enable(&server_ip); + + /* Create a client thread. */ + tx_thread_create(&client_thread, "Client", client_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, 1, 1, + TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + + /* Create Client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "POP3 Client Packet Pool", + PAYLOAD_SIZE, free_memory_pointer, (PAYLOAD_SIZE * 10)); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + (PAYLOAD_SIZE * 10); + + /* Create IP instance for demo Client */ + status = nx_ip_create(&client_ip, "POP3 Client IP Instance", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, + &client_packet_pool, _nx_ram_network_driver_1024, free_memory_pointer, + 2048, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 2048; + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&client_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Client IP. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + +/* Define the server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT receive_packet; +UINT i =0; + + /* Print out test information banner. */ + printf("NetX Test: POP3_Packet_With_Endmarker_Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + error_counter++; + } + + /* Create a socket as the server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + pop3_initialize_responses(); + + /* Bind the TCP socket to the POP3 port. */ + status = nx_tcp_server_socket_listen(&server_ip, 110, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES ) + { + + /* Default TCP server not to send a packet. */ + receive_packet = NX_TRUE; + + status = nx_pop3_response_packet_send(&server_socket, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* If this is the QUIT response, we're done */ + if (i == 14) + { + break; + } + + /* In these iterations, the server sends a packet without expecting a + response. */ + if ( + (i == 4) || + (i == 5) || + (i == 6) || + (i == 9) || + (i == 10) || + (i == 11) + ) + { + + /* Set the flag not to receive a packet. */ + receive_packet = NX_FALSE; + } + + /* TCP server expects to receive a packet. */ + if (receive_packet) + { + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +/* Define the application thread entry function. */ + +void client_thread_entry(ULONG info) +{ + +UINT status; +UINT mail_item, number_mail_items; +UINT bytes_downloaded = 0; +UINT final_packet = NX_FALSE; +ULONG total_size, mail_item_size, bytes_retrieved; +NX_PACKET *packet_ptr; + + NX_PARAMETER_NOT_USED(info); + + /* Let the IP instance get initialized with driver parameters. */ + tx_thread_sleep(10); + + /* Create a NetX POP3 Client instance with no byte or block memory pools. + Note that it uses its password for its APOP shared secret. */ + status = nx_pop3_client_create(&pop3_client, + NX_FALSE /* if true, enables Client to send APOP command to authenticate */, + &client_ip, &client_packet_pool, IP_ADDRESS(1,2,3,4), 110, + LOCALHOST, LOCALHOST_PASSWORD); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Find out how many items are in our mailbox. */ + status = nx_pop3_client_mail_items_get(&pop3_client, &number_mail_items, &total_size); + + /* If nothing in the mailbox, disconnect. */ + if (number_mail_items == 0) + { + error_counter++; + } + + /* Download all mail items. */ + mail_item = 1; + + while (mail_item <= number_mail_items) + { + + /* This submits a RETR request and gets the mail message size. */ + status = nx_pop3_client_mail_item_get(&pop3_client, mail_item, &mail_item_size); + + /* Loop to get the next mail message packet until the last mail item + packet is downloaded. */ + do + { + + status = nx_pop3_client_mail_item_message_get(&pop3_client, &packet_ptr, + &bytes_retrieved, + &final_packet); + + if (status != NX_SUCCESS) + { + break; + } + + nx_packet_release(packet_ptr); + + /* Determine if this is the last data packet. */ + if (final_packet) + { + /* It is. If it is the second mail item verify that no data is reported in the packet. */ + if ((mail_item == 2) && (bytes_retrieved != 0)) + { + + error_counter++; + } + + /* Let the server know it can delete this mail item. */ + status = nx_pop3_client_mail_item_delete(&pop3_client, mail_item); + + if (status != NX_SUCCESS) + { + break; + } + } + + /* Keep track of how much mail message data is left. */ + bytes_downloaded += bytes_retrieved; + + } while (final_packet == NX_FALSE); + + bytes_downloaded = 0; + + /* Get the next mail item. */ + mail_item++; + + tx_thread_sleep(10); + } + + /* Disconnect from the POP3 server. */ + status = nx_pop3_client_quit(&pop3_client); + + client_running = NX_FALSE; + + if (status != NX_SUCCESS) + error_counter++; + + /* Delete the POP3 Client. */ + status = nx_pop3_client_delete(&pop3_client); + + if (status != NX_SUCCESS) + error_counter++; + +} + +static UINT nx_pop3_response_packet_send(NX_TCP_SOCKET *server_socket_ptr, INT packet_number) +{ + +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, pop3_response[packet_number].pop3_response_pkt_data, + pop3_response[packet_number].pop3_response_pkt_size); + + response_packet -> nx_packet_length = pop3_response[packet_number].pop3_response_pkt_size; + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nx_tcp_socket_send(server_socket_ptr, response_packet, 100); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static UINT pop3_initialize_responses() +{ + + pop3_response[0].pop3_response_pkt_data = &greeting[0]; + pop3_response[0].pop3_response_pkt_size = greeting_size ; + + pop3_response[1].pop3_response_pkt_data = &user_ok[0]; + pop3_response[1].pop3_response_pkt_size = user_ok_size ; + + pop3_response[2].pop3_response_pkt_data = &password_ok[0]; + pop3_response[2].pop3_response_pkt_size = password_ok_size ; + + pop3_response[3].pop3_response_pkt_data = &stat_ok[0]; + pop3_response[3].pop3_response_pkt_size = stat_ok_size ; + + pop3_response[4].pop3_response_pkt_data = &retr_ok[0]; + pop3_response[4].pop3_response_pkt_size = retr_ok_size ; + + pop3_response[5].pop3_response_pkt_data = &first_data_packet[0]; + pop3_response[5].pop3_response_pkt_size = first_data_packet_size ; + + pop3_response[6].pop3_response_pkt_data = &second_data_packet[0]; + pop3_response[6].pop3_response_pkt_size = second_data_packet_size ; + + pop3_response[7].pop3_response_pkt_data = &last_data_packet[0]; + pop3_response[7].pop3_response_pkt_size = last_data_packet_size ; + + pop3_response[8].pop3_response_pkt_data = &dele_ok[0]; + pop3_response[8].pop3_response_pkt_size = dele_ok_size ; + + + pop3_response[9].pop3_response_pkt_data = &retr_ok2[0]; + pop3_response[9].pop3_response_pkt_size = retr_ok2_size ; + + pop3_response[10].pop3_response_pkt_data = &first_data_packet2[0]; + pop3_response[10].pop3_response_pkt_size = first_data_packet2_size ; + + pop3_response[11].pop3_response_pkt_data = &second_data_packet2[0]; + pop3_response[11].pop3_response_pkt_size = second_data_packet2_size ; + + pop3_response[12].pop3_response_pkt_data = &last_data_packet2[0]; + pop3_response[12].pop3_response_pkt_size = last_data_packet2_size ; + + pop3_response[13].pop3_response_pkt_data = &dele_ok2[0]; + pop3_response[13].pop3_response_pkt_size = dele_ok2_size ; + + + pop3_response[14].pop3_response_pkt_data = &quit_ok[0]; + pop3_response[14].pop3_response_pkt_size = quit_ok_size ; + + return NX_SUCCESS; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_packet_with_endmarker_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: POP3_Packet_With_Endmarker_Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/pop3_test/netx_pop3_two_mails_received_test.c b/test/regression/pop3_test/netx_pop3_two_mails_received_test.c new file mode 100644 index 00000000..41f2ae31 --- /dev/null +++ b/test/regression/pop3_test/netx_pop3_two_mails_received_test.c @@ -0,0 +1,732 @@ +/* + This is a small demo of POP3 Client on the high-performance NetX TCP/IP stack. + This demo relies on Thread, NetX and POP3 Client API to conduct + a POP3 mail session. + + The POP3 'server' is a TCP socket that sends responses and downloads 2 mail items + of three packets each. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_pop3_client.h" +#else +#include "nx_pop3_client.h" +#endif +extern void test_control_return(UINT); +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 +#define SERVER_PORT 110 + +static UINT error_counter = 0; +static UINT client_running = NX_TRUE; + +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); +static UINT nx_pop3_response_packet_send(NX_TCP_SOCKET *server_socket_ptr, INT packet_number); +static UINT pop3_initialize_responses(); + +/* Set up Client thread entry point. */ +static void client_thread_entry(ULONG info); +/* Set up Server thread entry point. */ +static void server_thread_entry(ULONG info); + + +/* Set up the POP3 Client and POP3 server socket. */ + +static TX_THREAD client_thread; +static NX_POP3_CLIENT pop3_client; +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD server_thread; +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_packet_pool; +static NX_IP server_ip; + +/* Use the maximum size payload to insure no packets are dropped. */ +#define PAYLOAD_SIZE 1514 + +/* Shared secret is the same as password. */ + +#define LOCALHOST "recipient@domain.com" +#define LOCALHOST_PASSWORD "testpwd" + +typedef struct POP3_RESPONSE_STRUCT +{ + char *pop3_response_pkt_data; + int pop3_response_pkt_size; +} POP3_RESPONSE; + +#define NUM_RESPONSES 15 +static POP3_RESPONSE pop3_response[NUM_RESPONSES]; + + +static char greeting[115] = { +0x2b, 0x4f, /* ..\...+O */ +0x4b, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x65, /* K mail.e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x20, /* gic.com */ +0x50, 0x4f, 0x50, 0x33, 0x20, 0x4d, 0x44, 0x61, /* POP3 MDa */ +0x65, 0x6d, 0x6f, 0x6e, 0x20, 0x31, 0x35, 0x2e, /* emon 15. */ +0x35, 0x2e, 0x33, 0x20, 0x72, 0x65, 0x61, 0x64, /* 5.3 read */ +0x79, 0x20, 0x3c, 0x4d, 0x44, 0x41, 0x45, 0x4d, /* y . */ +0x0a /* . */ +}; + +static int greeting_size = 115; + +static char user_ok[47] = { +0x2b, 0x4f, /* ...c..+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x2e, 0x2e, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x72, /* ... User */ +0x20, 0x6f, 0x6b, 0x0d, 0x0a /* ok.. */ +}; + +static int user_ok_size = 47; + +static char password_ok[83] = { +0x2b, 0x4f, /* ...p..+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x27, 0x73, 0x20, 0x6d, 0x61, 0x69, 0x6c, 0x62, /* 's mailb */ +0x6f, 0x78, 0x20, 0x68, 0x61, 0x73, 0x20, 0x31, /* ox has 1 */ +0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x6d, /* total m */ +0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, /* essages */ +0x28, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, 0x20, /* (187402 */ +0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x29, 0x0d, /* octets). */ +0x0a /* . */ +}; + +static int password_ok_size = 83; + +static char stat_ok[14] = { +0x2b, 0x4f, /* ..}...+O */ +0x4b, 0x20, 0x32, 0x20, 0x31, 0x38, 0x37, 0x34, /* K 2 1874 */ +0x30, 0x32, 0x0d, 0x0a /* 02.. */ +}; + +static int stat_ok_size = 14; + +static char retr_ok[19] = { +0x2b, 0x4f, /* ..Tv..+O */ +0x4b, 0x20, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, /* K 187402 */ +0x20, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x0d, /* octets. */ +0x0a /* . */ +}; + +static int retr_ok_size = 19; + + +static char first_data_packet[82] = { +0x52, 0x65, /* ..G...Re */ +0x74, 0x75, 0x72, 0x6e, 0x2d, 0x70, 0x61, 0x74, /* turn-pat */ +0x68, 0x3a, 0x20, 0x3c, 0x74, 0x65, 0x73, 0x74, /* h: ..Authe */ +0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* nticatio */ +0x6e, 0x2d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, /* n-Result */ +0x73, 0x3a, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, /* s: expre */ +0x73, 0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e +}; + +static int first_data_packet_size = 82; + +static char second_data_packet[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x6d, 0x69 +}; + +static int second_data_packet_size = 82; + +static char last_data_packet[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x0d, 0x0a, 0x2e, 0x0d, 0x0a +}; + +static int last_data_packet_size = 82; + +static char dele_ok[23] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, /* K messag */ +0x65, 0x20, 0x31, 0x20, 0x64, 0x65, 0x6c, 0x65, /* e 1 dele */ +0x74, 0x65, 0x64, 0x0d, 0x0a /* ted.. */ +}; + + +static int dele_ok_size = 23; + + +static char retr_ok2[19] = { +0x2b, 0x4f, /* ..Tv..+O */ +0x4b, 0x20, 0x31, 0x38, 0x37, 0x34, 0x30, 0x32, /* K 187402 */ +0x20, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x0d, /* octets. */ +0x0a /* . */ +}; + +static int retr_ok2_size = 19; + + +static char first_data_packet2[82] = { +0x52, 0x65, /* ..G...Re */ +0x74, 0x75, 0x72, 0x6e, 0x2d, 0x70, 0x61, 0x74, /* turn-pat */ +0x68, 0x3a, 0x20, 0x3c, 0x74, 0x65, 0x73, 0x74, /* h: ..Authe */ +0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* nticatio */ +0x6e, 0x2d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, /* n-Result */ +0x73, 0x3a, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, /* s: expre */ +0x73, 0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e +}; + +static int first_data_packet2_size = 82; + +static char second_data_packet2[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x6d, 0x69 +}; + +static int second_data_packet2_size = 82; + +static char last_data_packet2[82] = { +0x65, 0x64, /* ......ed */ +0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, /* ;.. */ +0x20, 0x20, 0x20, 0x64, 0x3d, 0x67, 0x6d, 0x61, /* d=gma */ +0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x3b, 0x20, /* il.com; */ +0x73, 0x3d, 0x32, 0x30, 0x31, 0x32, 0x30, 0x31, /* s=201201 */ +0x31, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, /* 13;.. */ +0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x3d, 0x63, /* h=c */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, /* ontent-t */ +0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, /* ransfer- */ +0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, /* encoding */ +0x3a, 0x66, 0x72, 0x0d, 0x0a, 0x2e, 0x0d, 0x0a +}; + +static int last_data_packet2_size = 82; + +static char dele_ok2[23] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, /* K messag */ +0x65, 0x20, 0x31, 0x20, 0x64, 0x65, 0x6c, 0x65, /* e 1 dele */ +0x74, 0x65, 0x64, 0x0d, 0x0a /* ted.. */ +}; + + +static int dele_ok2_size = 23; + + + +static char quit_ok[93] = { +0x2b, 0x4f, /* ......+O */ +0x4b, 0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, /* K testre */ +0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, /* cipient@ */ +0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, /* expressl */ +0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, /* ogic.com */ +0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, /* express */ +0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, /* logic.co */ +0x6d, 0x20, 0x50, 0x4f, 0x50, 0x33, 0x20, 0x53, /* m POP3 S */ +0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, /* erver si */ +0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, /* gning of */ +0x66, 0x20, 0x28, 0x6d, 0x61, 0x69, 0x6c, 0x62, /* f (mailb */ +0x6f, 0x78, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, /* ox empty */ +0x29, 0x0d, 0x0a /* ).. */ +}; + +static int quit_ok_size = 93; + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_two_mails_received_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + + /* Setup the working pointer. */ + free_memory_pointer = (UCHAR *) first_unused_memory; + + /* Initialize NetX. */ + nx_system_initialize(); + + /* Create the Server thread. */ + status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE ; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "Server Packet Pool", PAYLOAD_SIZE, free_memory_pointer , PAYLOAD_SIZE*10); + + free_memory_pointer = free_memory_pointer + PAYLOAD_SIZE*10; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, + "Server IP", + IP_ADDRESS(1,2,3,4), + 0xFFFFFF00UL, + &server_packet_pool, _nx_ram_network_driver_1024, + free_memory_pointer, DEMO_STACK_SIZE, 1); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&server_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Server IP. */ + nx_tcp_enable(&server_ip); + nx_icmp_enable(&server_ip); + + /* Create a client thread. */ + tx_thread_create(&client_thread, "Client", client_thread_entry, 0, + free_memory_pointer, DEMO_STACK_SIZE, 1, 1, + TX_NO_TIME_SLICE, TX_AUTO_START); + + free_memory_pointer = free_memory_pointer + DEMO_STACK_SIZE; + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + + /* Create Client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "POP3 Client Packet Pool", + PAYLOAD_SIZE, free_memory_pointer, (PAYLOAD_SIZE * 10)); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + (PAYLOAD_SIZE * 10); + + /* Create IP instance for demo Client */ + status = nx_ip_create(&client_ip, "POP3 Client IP Instance", IP_ADDRESS(1,2,3,5), 0xFFFFFF00UL, + &client_packet_pool, _nx_ram_network_driver_1024, free_memory_pointer, + 2048, 1); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 2048; + + /* Enable ARP and supply ARP cache memory. */ + nx_arp_enable(&client_ip, (void *) free_memory_pointer, 1024); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 1024; + + /* Enable TCP and ICMP for Client IP. */ + nx_tcp_enable(&client_ip); + nx_icmp_enable(&client_ip); + + return; +} + +/* Define the server thread. */ +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +UINT receive_packet; +UINT i =0; + + /* Print out test information banner. */ + printf("NetX Test: POP3 Two Mail Items Received Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + error_counter++; + } + + /* Create a socket as the server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Load up the server 'responses'. */ + pop3_initialize_responses(); + + /* Bind the TCP socket to the POP3 port. */ + status = nx_tcp_server_socket_listen(&server_ip, 110, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Wait for Client requests */ + while ( i < NUM_RESPONSES ) + { + + /* Default TCP server not to send a packet. */ + receive_packet = NX_TRUE; + + status = nx_pop3_response_packet_send(&server_socket, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* If this is the QUIT response, we're done */ + if (i == 14) + { + break; + } + + + /* In these iterations, the server sends a packet without expecting a + response. */ + if ( + (i == 4) || + (i == 5) || + (i == 6) || + (i == 9) || + (i == 10) || + (i == 11) + ) + { + + /* Set the flag not to receive a packet. */ + receive_packet = NX_FALSE; + } + + /* TCP server expects to receive a packet. */ + if (receive_packet) + { + + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + nx_packet_release(my_packet); + } + } + + /* Advance the index for the next response. */ + i++; + } + + /* Wait for the client to terminate the connection. */ + while(client_running == NX_TRUE) + tx_thread_sleep(20); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(&server_socket); + + if(error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + }; +} + + +/* Define the application thread entry function. */ + +void client_thread_entry(ULONG info) +{ + +UINT status; +UINT mail_item, number_mail_items; +UINT bytes_downloaded = 0; +UINT final_packet = NX_FALSE; +ULONG total_size, mail_item_size, bytes_retrieved; +NX_PACKET *packet_ptr; + + NX_PARAMETER_NOT_USED(info); + + /* Let the IP instance get initialized with driver parameters. */ + tx_thread_sleep(10); + + /* Create a NetX POP3 Client instance with no byte or block memory pools. + Note that it uses its password for its APOP shared secret. */ + status = nx_pop3_client_create(&pop3_client, + NX_FALSE /* if true, enables Client to send APOP command to authenticate */, + &client_ip, &client_packet_pool, IP_ADDRESS(1,2,3,4), 110, + LOCALHOST, LOCALHOST_PASSWORD); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Find out how many items are in our mailbox. */ + status = nx_pop3_client_mail_items_get(&pop3_client, &number_mail_items, &total_size); + + /* If nothing in the mailbox, disconnect. */ + if (number_mail_items == 0) + { + error_counter++; + } + + /* Download all mail items. */ + mail_item = 1; + + while (mail_item <= number_mail_items) + { + + /* This submits a RETR request and gets the mail message size. */ + status = nx_pop3_client_mail_item_get(&pop3_client, mail_item, &mail_item_size); + + /* Loop to get the next mail message packet until the last mail item + packet is downloaded. */ + do + { + + status = nx_pop3_client_mail_item_message_get(&pop3_client, &packet_ptr, + &bytes_retrieved, + &final_packet); + + if (status != NX_SUCCESS) + { + break; + } + + nx_packet_release(packet_ptr); + + /* Determine if this is the last data packet. */ + if (final_packet) + { + /* It is. Let the server know it can delete this mail item. */ + status = nx_pop3_client_mail_item_delete(&pop3_client, mail_item); + + if (status != NX_SUCCESS) + { + break; + } + } + + /* Keep track of how much mail message data is left. */ + bytes_downloaded += bytes_retrieved; + + } while (final_packet == NX_FALSE); + + /* Get the next mail item. */ + mail_item++; + + /* Clear the download size before downloading the next mail item. */ + bytes_downloaded = 0; + + tx_thread_sleep(10); + } + + /* Tell the POP3 server we're leaving the session. This sends the QUIT command. */ + status = nx_pop3_client_quit(&pop3_client); + + if (status) + { + error_counter++; + } + + client_running = NX_FALSE; + + /* Disconnect and delete the POP3 Client. */ + nx_pop3_client_delete(&pop3_client); + +} + +static UINT nx_pop3_response_packet_send(NX_TCP_SOCKET *server_socket_ptr, INT packet_number) +{ + +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Write the response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, pop3_response[packet_number].pop3_response_pkt_data, + pop3_response[packet_number].pop3_response_pkt_size); + + response_packet -> nx_packet_length = pop3_response[packet_number].pop3_response_pkt_size; + + /* Adjust the write pointer. */ + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the packet with the correct port. */ + status = nx_tcp_socket_send(server_socket_ptr, response_packet, 100); + + /* Check the status. */ + if (status) + { + + error_counter++; + } + + return status; +} + +static UINT pop3_initialize_responses() +{ + + pop3_response[0].pop3_response_pkt_data = &greeting[0]; + pop3_response[0].pop3_response_pkt_size = greeting_size ; + + pop3_response[1].pop3_response_pkt_data = &user_ok[0]; + pop3_response[1].pop3_response_pkt_size = user_ok_size ; + + pop3_response[2].pop3_response_pkt_data = &password_ok[0]; + pop3_response[2].pop3_response_pkt_size = password_ok_size ; + + pop3_response[3].pop3_response_pkt_data = &stat_ok[0]; + pop3_response[3].pop3_response_pkt_size = stat_ok_size ; + + pop3_response[4].pop3_response_pkt_data = &retr_ok[0]; + pop3_response[4].pop3_response_pkt_size = retr_ok_size ; + + pop3_response[5].pop3_response_pkt_data = &first_data_packet[0]; + pop3_response[5].pop3_response_pkt_size = first_data_packet_size ; + + pop3_response[6].pop3_response_pkt_data = &second_data_packet[0]; + pop3_response[6].pop3_response_pkt_size = second_data_packet_size ; + + pop3_response[7].pop3_response_pkt_data = &last_data_packet[0]; + pop3_response[7].pop3_response_pkt_size = last_data_packet_size ; + + pop3_response[8].pop3_response_pkt_data = &dele_ok[0]; + pop3_response[8].pop3_response_pkt_size = dele_ok_size ; + + + pop3_response[9].pop3_response_pkt_data = &retr_ok2[0]; + pop3_response[9].pop3_response_pkt_size = retr_ok2_size ; + + pop3_response[10].pop3_response_pkt_data = &first_data_packet2[0]; + pop3_response[10].pop3_response_pkt_size = first_data_packet2_size ; + + pop3_response[11].pop3_response_pkt_data = &second_data_packet2[0]; + pop3_response[11].pop3_response_pkt_size = second_data_packet2_size ; + + pop3_response[12].pop3_response_pkt_data = &last_data_packet2[0]; + pop3_response[12].pop3_response_pkt_size = last_data_packet2_size ; + + pop3_response[13].pop3_response_pkt_data = &dele_ok2[0]; + pop3_response[13].pop3_response_pkt_size = dele_ok2_size ; + + + pop3_response[14].pop3_response_pkt_data = &quit_ok[0]; + pop3_response[14].pop3_response_pkt_size = quit_ok_size ; + + return NX_SUCCESS; +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pop3_two_mails_received_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: POP3 Two Mail Items Received Test.........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_IPCP_abnormal_packet_test.c b/test/regression/ppp_test/netx_ppp_IPCP_abnormal_packet_test.c new file mode 100644 index 00000000..6490641b --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_IPCP_abnormal_packet_test.c @@ -0,0 +1,279 @@ +/* This demo tests the abnormal IPCP packet. + +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_check; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_PPP ppp_0; +static NX_PPP ppp_1; +static UINT checkpoint; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG error_counter = 0; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_check_entry(ULONG thread_input); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void ppp_0_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the check thread. */ + tx_thread_create(&thread_check, "thread check", thread_check_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, + &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); +} + +static char ipcp_data_0[] = { +0x80, 0x21, 0x01, 0x07, 0x00, 0x16, +0x81, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x83, 0x06, 0x00, 0x00, 0x00, 0x00 +}; + +static char ipcp_data_1[] = { +0x80, 0x21, 0x01, 0x07, 0x00, 0x4C, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x03, 0x06, 0x00, 0x00, 0x00, 0x00, +0x81, 0x06, 0x00, 0x00, 0x00, 0x00, +0x83, 0x06, 0x00, 0x00, 0x00, 0x00 +}; + +extern void _nx_ppp_receive_packet_process(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr); + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *packet_ptr; +UINT i = 0; +UCHAR *data_ptr; +UINT data_size; + + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP Abnormal Packet Test............................."); + + if (error_counter) + { + printf("ERROR\n"); + test_control_return(1); + } + + checkpoint = NX_FALSE; + tx_thread_resume(&thread_check); + + for (i = 0; i < 2; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &packet_ptr, 0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + if (i == 0) + { + + /* NX_PPP_DNS_SERVER_OPTION before NX_PPP_IP_ADDRESS_OPTION. */ + data_ptr = ipcp_data_0; + data_size = sizeof(ipcp_data_0); + } + else + { + + /* Option length exceed the NX_PPP_OPTION_MESSAGE_LENGTH. */ + data_ptr = ipcp_data_1; + data_size = sizeof(ipcp_data_1); + } + + /* Write IPCP data into the packet payload. */ + nx_packet_data_append(packet_ptr, data_ptr, data_size, &pool_0, TX_WAIT_FOREVER); + + ppp_0.nx_ppp_ipcp_state = NX_PPP_IPCP_CONFIGURE_REQUEST_ACKED_STATE; + + /* Call PPP packet process function. */ + _nx_ppp_receive_packet_process(&ppp_0, packet_ptr); + + if ((i == 0) && (ppp_0.nx_ppp_peer_naked_list[0] != 18)) + { + error_counter++; + } + } + + checkpoint = NX_TRUE; + nx_ppp_delete(&ppp_0); +} + + +static void thread_check_entry(ULONG thread_input) +{ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((checkpoint != NX_TRUE) || error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + + error_counter++; + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + ppp_0_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + ppp_0_link_down_counter++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP Abnormal Packet Test........................................N/A\n"); + + test_control_return(3); +} +#endif + + + diff --git a/test/regression/ppp_test/netx_ppp_IPCP_nak_test.c b/test/regression/ppp_test/netx_ppp_IPCP_nak_test.c new file mode 100644 index 00000000..bc6a4aff --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_IPCP_nak_test.c @@ -0,0 +1,490 @@ +/* This tests that in NX_PPP_IPCP_CONFIGURE_REQUEST_ACKED_STATE state, we can send the correct NAK. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 +#define DEMO_DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static UINT error_counter = 0; +static UINT thread_1_alive = NX_TRUE; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_nak_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_0, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer. */ + status = nx_ppp_pap_enable(&ppp_1, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP NAK Test........................................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 30 * NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disable checksum logic for this socket. */ + nx_udp_socket_checksum_disable(&socket_0); + + /* Let receiver thread run. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + nx_packet_data_append(my_packet, DEMO_DATA, sizeof(DEMO_DATA), &pool_0, TX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + while(thread_1_alive) + tx_thread_sleep(50); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + /* Wait for the link to come up. */ + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 30 * NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + thread_1_alive = NX_FALSE; + + return; +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ +static UCHAR temp_data[8] = {0}; +static UCHAR temp_index = 0; +static UINT i = 0; +static UINT packet_drop = NX_FALSE; + +static UCHAR configure_request[] = {0x7E, 0xFF, 0x7D, 0x23, 0x80, 0x21, 0x7D, 0x21}; + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Discard IPCP Configure Request before NX_PPP_IPCP_CONFIGURE_REQUEST_ACKED_STATE. */ + if (ppp_0.nx_ppp_ipcp_state > NX_PPP_IPCP_INITIAL_STATE && + ppp_0.nx_ppp_ipcp_state < NX_PPP_IPCP_CONFIGURE_REQUEST_ACKED_STATE) + { + + if (byte == 0x7e) + { + + if (temp_index == 0) + { + packet_drop = NX_TRUE; + i = 0; + } + else + { + temp_index = 0; + } + } + + if (temp_index < 8) + { + temp_data[temp_index++] = byte; + } + else if (memcmp(temp_data, configure_request, 8) != 0) + { + packet_drop = NX_FALSE; + } + + if (packet_drop) + { + return; + } + else + { + for (;i < temp_index; i++) + { + nx_ppp_byte_receive(&ppp_0, temp_data[i]); + } + } + } + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} + + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_nak_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP NAK Test.........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_IPCP_retransmit_test.c b/test/regression/ppp_test/netx_ppp_IPCP_retransmit_test.c new file mode 100644 index 00000000..7d5edb19 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_IPCP_retransmit_test.c @@ -0,0 +1,425 @@ +/* This tests that in NX_PPP_IPCP_CONFIGURE_REQUEST_ACKED_STATE state, we can send the correct NAK. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 +#define DEMO_DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static UINT error_counter = 0; +static UINT thread_1_alive = NX_TRUE; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_retransmit_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP Retransmit Test.................................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &ip_status, 30 * NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disable checksum logic for this socket. */ + nx_udp_socket_checksum_disable(&socket_0); + + /* Let receiver thread run. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Write ABCs into the packet payload! */ + nx_packet_data_append(my_packet, DEMO_DATA, sizeof(DEMO_DATA), &pool_0, TX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + while(thread_1_alive) + tx_thread_sleep(50); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + /* Wait for the link to come up. */ + status = nx_ip_status_check(&ip_1, NX_IP_ADDRESS_RESOLVED, &ip_status, 30 * NX_IP_PERIODIC_RATE); + + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + thread_1_alive = NX_FALSE; + + return; +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ +static UCHAR temp_data[8] = {0}; +static UCHAR temp_index = 0; +static UINT i = 0; +static UINT packet_drop = NX_FALSE; +static UINT packet_end = NX_FALSE; + +static UCHAR configure_request_ack[] = {0x7E, 0xFF, 0x7D, 0x23, 0xc0, 0x21, 0x7D, 0x22}; + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Discard LCP Configure Request ACK before NX_PPP_IPCP_CONFIGURE_REQUEST_SENT_STATE. */ + if (ppp_0.nx_ppp_ipcp_state < NX_PPP_IPCP_CONFIGURE_REQUEST_SENT_STATE) + { + + if (byte == 0x7e) + { + + if (temp_index == 0) + { + packet_drop = NX_TRUE; + packet_end = NX_FALSE; + i = 0; + } + else + { + packet_end = NX_TRUE; + } + } + + if (temp_index < 8) + { + temp_data[temp_index++] = byte; + } + else if (memcmp(temp_data, configure_request_ack, 8) != 0) + { + packet_drop = NX_FALSE; + } + + if (packet_drop) + { + if (packet_end) + temp_index = 0; + return; + } + else + { + for (;i < temp_index; i++) + { + nx_ppp_byte_receive(&ppp_1, temp_data[i]); + } + + if (packet_end) + temp_index = 0; + } + } + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_retransmit_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP retransmit Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_IPCP_timeout.c b/test/regression/ppp_test/netx_ppp_IPCP_timeout.c new file mode 100644 index 00000000..2c0a6d7e --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_IPCP_timeout.c @@ -0,0 +1,362 @@ +/* This demo tests the nx_ppp_restart() function. To simulate a link down in the middle of the IPCP + negotiation, the thread_0/PPP_0 promotes the PPP 1 instance to LCP complete, and its IPCP state to STARTED. + Then the PPP0 instance is suspended as part of simulating link down. + + PPP_1 should go into a FAILED state after the max number of retries, and call the link down callback. + NetX PPP has a restart function which reinitializes the PPP instance so it can restart the PPP + protocol using nx_ppp_restart(). + + The process is started again, PPP 0 is resumed, and thread 0 promotes the PPP 1 instance ahead + to the LCP complete state, and ICP start state. After the second link down event, the test is complete. + + This test verifies that the NetX PPP properly clears and restarts a PPP instance, including resetting + the PPP state to restart the IPCP negotiation. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static ULONG error_counter = 0; +static UINT suspend_thread = NX_TRUE; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, 8192); + pointer = pointer + 8192; + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 4096); + pointer = pointer + 4096; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define the IP addresses. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP1", &ip_1, pointer, 2048, 1, &pool_1, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_1, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); + + /* Enable ICMP traffic. */ + nx_icmp_enable(&ip_0); + nx_icmp_enable(&ip_1); + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP Timeout/Restart Test............................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + do + { + + if (suspend_thread) + { + + if (ppp_1.nx_ppp_lcp_state >= 2) + { + + suspend_thread = NX_FALSE; + + /* PPP_1 is in the LCP completed state. Suspend PPP_0 thread so PPP_1 will not be able + to complete the IPCP protocol. */ + tx_thread_suspend(&(ppp_0.nx_ppp_thread)); + + ppp_1.nx_ppp_timeout = NX_PPP_PROTOCOL_TIMEOUT; + ppp_1.nx_ppp_lcp_state = NX_PPP_LCP_COMPLETED_STATE; + ppp_1.nx_ppp_ipcp_state = NX_PPP_IPCP_START_STATE; + + } + + } + + /* Determine if the two or more restarts have occurred */ + if (ppp_1_link_down_counter >= 2) + { + break; + } + + /* Wait for the link to come up (this should not happen if we are + testing the link down callback. */ + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, NX_IP_PERIODIC_RATE/2); + + } while (status != NX_SUCCESS) ; + + /* Determine if the test completed successfully. */ + if ((error_counter == 0) && (ppp_0_link_down_counter == 0) && (ppp_1_link_down_counter >= 2)) + { + printf("SUCCESS!\n"); + test_control_return(0); + } + else + { + printf("ERROR!\n"); + test_control_return(1); + } + +} + + +static void thread_1_entry(ULONG thread_input) +{ + + +UINT status; +ULONG ip_status; + + tx_thread_sleep(20); + do + { + + /* If this is the second restart, the test is complete. */ + if (ppp_1_link_down_counter > 1) + { + + return; + } + + /* Wait for the link to come up. */ + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, NX_IP_PERIODIC_RATE/2); + + } while (status != NX_SUCCESS); + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + + error_counter++; + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + if (ppp_ptr -> nx_ppp_ipcp_state != NX_PPP_IPCP_FAILED_STATE) + { + /* Error test should only restart from the IPCP FAILED state */ + error_counter++; + return; + } + + /* If this is the second restart, the test is complete. */ + if (ppp_1_link_down_counter > 1) + { + /* Success. Restart test is complete */ + return; + } + + /* Restart PPP 1. */ + nx_ppp_restart(ppp_ptr); + + if (ppp_1_link_down_counter == 1) + { + /* First restart. Wait for second restart to verify first restart succeeds */ + suspend_thread = NX_TRUE; + } + + return; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_IPCP_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP IPCP Timeout/Restart Test.............................N/A\n"); + + test_control_return(3); +} +#endif + + diff --git a/test/regression/ppp_test/netx_ppp_LCP_invalid_packet_test.c b/test/regression/ppp_test/netx_ppp_LCP_invalid_packet_test.c new file mode 100644 index 00000000..13581c2a --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_LCP_invalid_packet_test.c @@ -0,0 +1,238 @@ +/* This demo tests the invalid LCP packet. + +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG error_counter = 0; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void ppp_0_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_LCP_invalid_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, + &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); +} + +static char invalid_lcp_data_0[] = {0xc0, 0x21, 0x01, 0x1e, 0x00, 0x00}; +static char invalid_lcp_data_1[] = {0xc0, 0x21, 0x00, 0x00, 0x00, 0x00, 0x02, 0x16}; +extern void _nx_ppp_receive_packet_process(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr); + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *invalid_packet; +UINT i = 0; +UCHAR *data_ptr; +UINT data_size; + + + /* Print out test information banner. */ + printf("NetX Test: PPP LCP Invalid Packet Test..............................."); + + if (error_counter) + { + printf("ERROR\n"); + test_control_return(1); + } + + for (i = 0; i < 2; i++) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &invalid_packet, NX_IP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + error_counter++; + + if (i == 0) + { + + /* Invalid NX_PPP_LCP_CONFIGURE_REQUEST. */ + data_ptr = invalid_lcp_data_0; + data_size = sizeof(invalid_lcp_data_0); + } + else + { + + /* Invalid unsupported code ID. */ + data_ptr = invalid_lcp_data_1; + data_size = sizeof(invalid_lcp_data_1); + } + + /* Write invalid data into the packet payload. */ + nx_packet_data_append(invalid_packet, data_ptr, data_size, &pool_0, TX_WAIT_FOREVER); + + /* Call PPP packet process function. */ + _nx_ppp_receive_packet_process(&ppp_0, invalid_packet); + } + + if (ppp_0.nx_ppp_lcp_frames_received != 0) + { + error_counter++; + } + + /* Check status. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + nx_ppp_delete(&ppp_0); + test_control_return(0); + +} + + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + + error_counter++; + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + ppp_0_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + ppp_0_link_down_counter++; + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_LCP_invalid_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP LCP Invalid Packet Test...............................N/A\n"); + + test_control_return(3); +} +#endif + + + diff --git a/test/regression/ppp_test/netx_ppp_LCP_timeout.c b/test/regression/ppp_test/netx_ppp_LCP_timeout.c new file mode 100644 index 00000000..c8f786de --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_LCP_timeout.c @@ -0,0 +1,233 @@ +/* This demo tests the nx_ppp_restart() function. The PPP_1 instance is never started. + So PPP_0 fails to complete the LCP protocol. After so many attempts at the LCP + protocol, the PPP_0 should go into a FAILED state and call the link down callback. + NetX PPP has a restart function which reinitializes the PPP instance so it can + restart the PPP protocol again. + + This test runs until the second link down event occurs. This is considered a successful + outcome because it verifies the NetX PPP properly resets the LCP state, removes packets on + the receive queue, resets the buffer markers, and clears authentication status. + +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG error_counter = 0; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void ppp_0_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_LCP_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, + &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + + /* Print out test information banner. */ + printf("NetX Test: PPP LCP Timeout/Restart Test.............................."); + + if (error_counter) + { + printf("ERROR\n"); + test_control_return(1); + } + + do + { + + /* Wait for the link to come up. */ + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, NX_IP_PERIODIC_RATE); + + if (ppp_0_link_down_counter > 1) + { + /* Deleting the PPP_0 instance. Test is complete. */ + status = NX_SUCCESS; + break; + } + } while (status != NX_SUCCESS); + + + /* Check status. */ + if ((status) || (error_counter) || (ppp_0_link_down_counter != 2)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + printf("SUCCESS!\n"); + nx_ppp_delete(&ppp_0); + test_control_return(0); + +} + + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + + error_counter++; + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + ppp_0_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + ppp_0_link_down_counter++; + + if (ppp_ptr -> nx_ppp_protocol_retry_counter != NX_PPP_MAX_LCP_PROTOCOL_RETRIES) + { + /* Error with retry counter */ + error_counter++; + } + else if (ppp_ptr -> nx_ppp_lcp_state != NX_PPP_LCP_FAILED_STATE) + { + + /* Error: the PPP is not in the LCP failed state */ + error_counter++; + } + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); + + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_LCP_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP LCP Timeout/Restart Test..............................N/A\n"); + + test_control_return(3); +} +#endif + + + diff --git a/test/regression/ppp_test/netx_ppp_PAP_bad_password_test.c b/test/regression/ppp_test/netx_ppp_PAP_bad_password_test.c new file mode 100644 index 00000000..a9b426ed --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_PAP_bad_password_test.c @@ -0,0 +1,410 @@ +/* This tests 1) that PPP PAP authentication detects a bad password and handles with the NAK callback, + and 2) that the NAK callback permits the user PPP application to change the password and retry + PAP authentication. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static UINT login_attempts = 0; +static UINT nak_counter = 0; +static UINT error_counter = 0; +static UINT thread_1_alive = NX_TRUE; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void nak_authentication_notify(void); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_PAP_bad_password_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_0, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + status = nx_ppp_nak_authentication_notify(&ppp_0, nak_authentication_notify); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer. */ + status = nx_ppp_pap_enable(&ppp_1, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + status = nx_ppp_nak_authentication_notify(&ppp_1, nak_authentication_notify); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); + +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Bad Password Test................................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + + /* Check status. */ + if ((status) || (ppp_0.nx_ppp_authenticated == 0) || (ppp_1.nx_ppp_authenticated == 0) || + (nak_counter != 1) || (login_attempts != 2) || + (ppp_0_link_up_counter != 1) || (ppp_1_link_up_counter != 1) || + (ppp_0_link_down_counter != 0) || (ppp_1_link_down_counter != 0) || + (error_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete PPP 0, CHAP complete, we don't need to finish IPCP handshake.. */ + nx_ppp_delete(&ppp_0); + + while(thread_1_alive) + tx_thread_sleep(50); + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + tx_thread_sleep(50); + + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} + + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + if (login_attempts == 0) + { + /* Input a name and wrong password, called "myname" and "mypasswordd". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = 'd'; /* This password will not match the one in verify login; PAP should fail. */ + password[11] = (CHAR) 0; + } + else /* if (login_attempts >= 1) */ + { + + /* Try a corrected password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + } + + login_attempts++; + + return(NX_SUCCESS); +} + + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +static void nak_authentication_notify(void) +{ + + nak_counter ++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_PAP_bad_password_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Bad Password Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_PAP_bad_username_test.c b/test/regression/ppp_test/netx_ppp_PAP_bad_username_test.c new file mode 100644 index 00000000..578208a8 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_PAP_bad_username_test.c @@ -0,0 +1,413 @@ +/* This tests 1) that PPP PAP authentication detects a bad username and handles with the NAK callback, + and 2) that the NAK callback permits the user PPP application to change the username and retry + PAP authentication. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define the PPP_REGRESSION_TEST option to run in regression test environment. */ + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static UINT login_attempts = 0; +static UINT nak_counter = 0; +static UINT thread_1_alive = NX_TRUE; +static UINT error_counter = 0; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void nak_authentication_notify(void); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_PAP_bad_username_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_0, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + status = nx_ppp_nak_authentication_notify(&ppp_0, nak_authentication_notify); + + if (status) + error_counter++; + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, + &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer. */ + status = nx_ppp_pap_enable(&ppp_1, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + status = nx_ppp_nak_authentication_notify(&ppp_1, nak_authentication_notify); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, + &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP error */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); +} + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Bad Username Test................................."); + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Check status. */ + if ((status) || (nak_counter != 1) || (login_attempts != 2) || + (ppp_0_link_up_counter != 1) || (ppp_1_link_up_counter != 1) || + (ppp_0_link_down_counter != 0) || (ppp_1_link_down_counter != 0) || + (error_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + while (thread_1_alive) + { + tx_thread_sleep(50); + } + /* Delete PPP 0, PAP failed, we don't need to finish IPCP handshake.. */ + status = nx_ppp_delete(&ppp_0); + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + tx_thread_sleep(20); + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + tx_thread_sleep(50); + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} + + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + if (login_attempts == 0) + { + /* Input a wrong username and good password, called "yname" and "mypassword". */ + name[0] = 'y'; /* This username will not match the one in verify login; PAP should fail. */ + name[1] = 'n'; + name[2] = 'a'; + name[3] = 'm'; + name[4] = 'e'; + name[5] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = 'd'; + password[11] = (CHAR) 0; + } + else /* if (login_attempts >= 1)*/ + { + + /* Try a corrected username, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + } + + login_attempts++; + + return(NX_SUCCESS); +} + + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +static void nak_authentication_notify(void) +{ + nak_counter ++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_PAP_bad_username_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Bad Username Test.................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/ppp_test/netx_ppp_acfc_option_test.c b/test/regression/ppp_test/netx_ppp_acfc_option_test.c new file mode 100644 index 00000000..ab4abc28 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_acfc_option_test.c @@ -0,0 +1,431 @@ +/* This tests the processing of compressed Access and Control fields. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_COMPRESSION_ENABLE) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 +#define DEMO_DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_PPP ppp_0; +static NX_PPP ppp_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT thread_1_alive = NX_TRUE; +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); + +/* UDP packet data with Access and Control fields compressed. +00 21 45 00 00 38 00 21 00 00 80 11 32 a8 01 02 03 05 01 02 03 04 00 89 00 88 00 24 e9 8e 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 20 00 +*/ +static UCHAR udp_data[] = { +0x7e, 0x7d, 0x20, 0x21, 0x45, 0x7d, 0x20, 0x7d, 0x20, 0x38, 0x7d, 0x20, 0x7d, +0x21, 0x7d, 0x20, 0x7d, 0x20, 0x80, 0x7d, 0x31, 0x32, 0xa8, 0x7d, 0x21, 0x7d, 0x22, 0x7d, 0x23, +0x7d, 0x24, 0x7d, 0x21, 0x7d, 0x22, 0x7d, 0x23, 0x7d, 0x25, 0x7d, 0x20, 0x88, 0x7d, 0x20, 0x89, +0x7d, 0x20, 0x24, 0x7d, 0x20, 0x7d, 0x20, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, +0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, +0x5a, 0x20, 0x7d, 0x20, 0x6f, 0x5e, 0x7e, +}; + +static UINT udp_data_send = NX_FALSE; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_acfc_option_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 2 * NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + { + error_counter++; + } + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + { + error_counter++; + } + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + if (status) + { + error_counter++; + } +} + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + printf("NetX Test: PPP ACFC Option Test......................................"); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disable checksum logic for this socket. */ + nx_udp_socket_checksum_disable(&socket_0); + + /* Let receiver thread run. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the packet payload! */ + nx_packet_data_append(my_packet, DEMO_DATA, sizeof(DEMO_DATA), &pool_0, NX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Relinquish to thread 1. */ + tx_thread_relinquish(); + + /* Wait for the other thread to finish. */ + while(thread_1_alive) + { + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + } + + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ +UINT i; + + if (ppp_0.nx_ppp_ipcp_state < NX_PPP_IPCP_COMPLETED_STATE) + { + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); + } + else if (udp_data_send == NX_FALSE) + { + /* Modify the data to send compressed protocol field. */ + for (i = 0; i < sizeof(udp_data); i++) + { + nx_ppp_byte_receive(&ppp_1, udp_data[i]); + } + + udp_data_send = NX_TRUE; + } +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_acfc_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP ACFC Option Test......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/ppp_test/netx_ppp_chap_bad_secret_failed_retry_test.c b/test/regression/ppp_test/netx_ppp_chap_bad_secret_failed_retry_test.c new file mode 100644 index 00000000..c4fac994 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_chap_bad_secret_failed_retry_test.c @@ -0,0 +1,430 @@ +/* This is a test of the NetX Duo PPP CHAP authentication protocol. ppp_1 + has a different secret than ppp_0, therefore ppp_1 who is trying + to authenticate itself with ppp_0, needs to handle the NAK authentication failure. + In this test, both PPP instances restart() when notified of NAK/CHAP failure. PPP1 + reloads the responder value with the same secret and should not succeed on the next + CHAP authentication challenges. However it should be able to abort further attempts + after a certain number of retries (2). + */ + +#include "nx_ppp.h" +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + +/* Define the counters used in the demo application... */ + +static UINT ppp_0_retry_counter = 0; +static UINT ppp_1_retry_counter = 0; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_down_counter; +static UINT get_values_counter = 0; +static UINT nak_counter = 0; +static UINT nak_authentication_failed = NX_FALSE; +static UINT error_counter = 0; + + +static CHAR name_string[] = "username"; +static CHAR name_string_ppp1[] = "username"; // testing bad chap value; this makes no difference +static CHAR rand_value_string[] = "1234567"; +static CHAR system_string[] = "system"; +static CHAR system_string_ppp1[] = "system"; // testing bad chap value; this makes no difference +static CHAR secret_string[] = "secret"; +static CHAR secret_string_ppp1[] = "secret0"; // testing bad chap value; this mismatch will cause CHAP failure + + + +static UINT get_challenge_values(CHAR *rand_value, CHAR *id, CHAR *name); +static UINT get_responder_values(CHAR *system, CHAR *name, CHAR *secret); +static UINT get_responder_values_ppp1(CHAR *system, CHAR *name, CHAR *secret); +static UINT get_verification_values(CHAR *system, CHAR *name, CHAR *secret); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void nak_authentication_notify(void); + +/* Define thread prototype. */ +static void thread_0_entry(ULONG thread_input); + +/* Define what the initial system looks like. */ + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_chap_bad_secret_failed_retry_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for ppp_0. */ + status = nx_packet_pool_create(&pool_0, "Packet Pool 0", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Create a packet pool for ppp_1. */ + status = nx_packet_pool_create(&pool_1, "Packet Pool 1", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup CHAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_chap_enable(&ppp_0, get_challenge_values, get_responder_values, get_verification_values); + + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + status += nx_ppp_nak_authentication_notify(&ppp_0, nak_authentication_notify); + + /* Check status. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP1", &ip_1, pointer, 2048, 1, &pool_1, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Setup CHAP, this PPP instance will only respond to CHAP challenges. */ + status = nx_ppp_chap_enable(&ppp_1, NX_NULL, get_responder_values_ppp1, NX_NULL); + + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + status += nx_ppp_nak_authentication_notify(&ppp_1, nak_authentication_notify); + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status += nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check status. */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); + +} + +#define SEND_MESSAGE "1234567890123456789012345678901234567890123456789012345678901234567890ABCDEFGHIJ123456" + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + + /* Print out test information banner. */ + printf("NetX Test: PPP Chap Bad Secret Failed Retry Test....................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up and then realize PAP has failed. */ + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status != NX_NOT_SUCCESSFUL) || (ppp_0.nx_ppp_authenticated == 1) || (ppp_1.nx_ppp_authenticated == 1) || + (nak_authentication_failed != NX_TRUE) || (nak_counter != 2) || + (get_values_counter != 2) || (ppp_0_link_down_counter != 2) || + (ppp_0_retry_counter != 2) || (ppp_1_link_down_counter != 2) || + (ppp_1_retry_counter != 2) || (error_counter)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete PPP 0, CHAP failed, we don't need to finish IPCP handshake.. */ + nx_ppp_delete(&ppp_0); + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + + +/* Define the CHAP enable routines. */ +static UINT get_challenge_values(CHAR *rand_value, CHAR *id, CHAR *name) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string[i]; + } + name[i] = 0; + + *id = '1'; /* One byte */ + + for (i = 0; i< (NX_PPP_VALUE_SIZE-1); i++) + { + rand_value[i] = rand_value_string[i]; + } + rand_value[i] = 0; + + return(NX_SUCCESS); +} + +static UINT get_responder_values(CHAR *system, CHAR *name, CHAR *secret) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string[i]; + } + name[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + system[i] = system_string[i]; + } + system[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + secret[i] = secret_string[i]; + } + secret[i] = 0; + + return(NX_SUCCESS); +} + +/* Get PPP_1's idea of username/secret/system */ +static UINT get_responder_values_ppp1(CHAR *system, CHAR *name, CHAR *secret) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string_ppp1[i]; + } + name[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + system[i] = system_string_ppp1[i]; + } + system[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + + /* Keep setting the bad secret. */ + secret[i] = secret_string_ppp1[i]; + } + + secret[i] = 0; + + get_values_counter++; + + return(NX_SUCCESS); +} + +static UINT get_verification_values(CHAR *system, CHAR *name, CHAR *secret) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string[i]; + } + name[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + system[i] = system_string[i]; + } + system[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + secret[i] = secret_string[i]; + } + secret[i] = 0; + + return(NX_SUCCESS); +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + { + + ppp_0_link_down_counter++; + ppp_0_retry_counter++; + + /* In reality we'd probably try three times */ + if (ppp_0_retry_counter >= 2) + { + /* Error. */ + nak_authentication_failed = NX_TRUE; + } + else + { + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); + } + } + else + { + + ppp_1_link_down_counter++; + ppp_1_retry_counter++; + if (ppp_1_retry_counter >= 2) + { + /* Error. */ + nak_authentication_failed = NX_TRUE; + } + else + { + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); + } + } +} + +static void nak_authentication_notify(void) +{ + + nak_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_chap_bad_secret_failed_retry_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP Chap Bad Secret Failed Retry Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_chap_bad_secret_passed_on_retry_test.c b/test/regression/ppp_test/netx_ppp_chap_bad_secret_passed_on_retry_test.c new file mode 100644 index 00000000..21b2b79f --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_chap_bad_secret_passed_on_retry_test.c @@ -0,0 +1,474 @@ +/* This is a test of the NetX Duo PPP CHAP authentication protocol. ppp_1 + has a different secret than ppp_0, therefore ppp_1 who is trying + to authenticate itself with ppp_0, needs to handle the NAK authentication failure. + In this test, both PPP instances restart() when notified of NAK/CHAP failure. PPP1 + reloads the responder value with the correct secret and should succeed on the next + CHAP authentication challenge. + */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + +/* Define the counters used in the demo application... */ + +static UINT ppp_0_retry_counter = 0; +static UINT ppp_1_retry_counter = 0; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_down_counter; +static UINT get_values_counter = 0; +static UINT nak_counter = 0; +static UINT nak_authentication_failed = NX_FALSE; +static UINT error_counter = 0; +static UINT thread_1_alive = NX_TRUE; + + +static CHAR name_string[] = "username"; +static CHAR name_string_ppp1[] = "username"; /* testing bad chap value; this makes no difference */ +static CHAR rand_value_string[] = "1234567"; +static CHAR system_string[] = "system"; +static CHAR system_string_ppp1[] = "system"; /* testing bad chap value; this makes no difference */ +static CHAR secret_string[] = "secret"; +static CHAR secret_string_ppp1[] = "secret0"; /* testing bad chap value; this mismatch will cause CHAP failure */ + + +static UINT get_challenge_values(CHAR *rand_value, CHAR *id, CHAR *name); +static UINT get_responder_values(CHAR *system, CHAR *name, CHAR *secret); +static UINT get_responder_values_ppp1(CHAR *system, CHAR *name, CHAR *secret); +static UINT get_verification_values(CHAR *system, CHAR *name, CHAR *secret); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static void nak_authentication_notify(void); + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_chap_bad_secret_passed_on_retry_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for ppp_0. */ + status = nx_packet_pool_create(&pool_0, "Packet Pool 0", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create a packet pool for ppp_1. */ + status = nx_packet_pool_create(&pool_1, "Packet Pool 1", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Setup CHAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_chap_enable(&ppp_0, get_challenge_values, get_responder_values, get_verification_values); + + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + status += nx_ppp_nak_authentication_notify(&ppp_0, nak_authentication_notify); + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status += nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP CHAP enable error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP1", &ip_1, pointer, 2048, 1, &pool_1, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + + /* Setup CHAP, this PPP instance will only respond to CHAP challenges. */ + status = nx_ppp_chap_enable(&ppp_1, NX_NULL, get_responder_values_ppp1, NX_NULL); + + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + status += nx_ppp_nak_authentication_notify(&ppp_1, nak_authentication_notify); + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status += nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check status. */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Print out test information banner. */ + printf("NetX Test: PPP Chap Bad Secret Passed on Retry Test.................."); + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + + /* Check status. */ + if ((status) || (!ppp_0.nx_ppp_authenticated) || (!ppp_1.nx_ppp_authenticated) || + (get_values_counter != 2) || (nak_authentication_failed) || + (nak_counter != 1)|| (ppp_0_link_down_counter != 1) || + (ppp_0_retry_counter != 1) || (ppp_1_link_down_counter != 1) || + (ppp_1_retry_counter != 1) || nak_authentication_failed || (!ppp_1.nx_ppp_authenticated) || + (error_counter)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + while(thread_1_alive) + tx_thread_sleep(50); + + /* Delete PPP 0, CHAP complete, we don't need to finish IPCP handshake.. */ + nx_ppp_delete(&ppp_0); + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + + /* Delete PPP 1. CHAP complete, we don't need to finish IPCP handshake.. */ + nx_ppp_delete(&ppp_1); + + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define the CHAP enable routines. */ +static UINT get_challenge_values(CHAR *rand_value, CHAR *id, CHAR *name) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string[i]; + } + name[i] = 0; + + *id = '1'; /* One byte */ + + for (i = 0; i< (NX_PPP_VALUE_SIZE-1); i++) + { + rand_value[i] = rand_value_string[i]; + } + rand_value[i] = 0; + + return(NX_SUCCESS); +} + +static UINT get_responder_values(CHAR *system, CHAR *name, CHAR *secret) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string[i]; + } + name[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + system[i] = system_string[i]; + } + system[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + secret[i] = secret_string[i]; + } + secret[i] = 0; + + return(NX_SUCCESS); +} + +/* Get PPP_1's idea of username/secret/system */ +static UINT get_responder_values_ppp1(CHAR *system, CHAR *name, CHAR *secret) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string_ppp1[i]; + } + name[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + system[i] = system_string_ppp1[i]; + } + system[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + + /* Check if we are being asked for the secret for the first time. */ + if (get_values_counter == 0) + { + + /* Yes, start out with the 'bad' secret (CHAP should fail). */ + secret[i] = secret_string_ppp1[i]; + } + else + { + + /* We are not. Try the good secret now. */ + secret[i] = secret_string[i]; + } + + } + + secret[i] = 0; + + get_values_counter++; + + return(NX_SUCCESS); +} + +static UINT get_verification_values(CHAR *system, CHAR *name, CHAR *secret) +{ + +UINT i; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + name[i] = name_string[i]; + } + name[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + system[i] = system_string[i]; + } + system[i] = 0; + + for (i = 0; i< (NX_PPP_NAME_SIZE-1); i++) + { + secret[i] = secret_string[i]; + } + secret[i] = 0; + + return(NX_SUCCESS); +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + { + + ppp_0_link_down_counter++; + ppp_0_retry_counter++; + + /* We'd probably try three times. */ + if (ppp_0_retry_counter >= 2) + { + /* Error */ + ppp_0_retry_counter = 0; + nak_authentication_failed = NX_TRUE; + } + else + { + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); + } + } + else + { + + ppp_1_link_down_counter++; + ppp_1_retry_counter++; + if (ppp_1_retry_counter >= 2) + { + /* Error. */ + ppp_1_retry_counter = 0; + nak_authentication_failed = NX_TRUE; + } + else + { + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); + } + } +} + +static void nak_authentication_notify(void) +{ + + nak_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_chap_bad_secret_passed_on_retry_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP Chap Bad Secret Passed on Retry Test..................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/ppp_test/netx_ppp_check_boundary_test.c b/test/regression/ppp_test/netx_ppp_check_boundary_test.c new file mode 100644 index 00000000..95aab81a --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_check_boundary_test.c @@ -0,0 +1,426 @@ +/* This test should be done with the PACKET CHAIN option enabled. It tests that the PPP instance can + handle receiving chained packets, including when the data, CRC checksum and PPP frame closing sequence + occur on or around the packet buffer boundary. It should run to completion. + */ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_PACKET_CHAIN) && !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG thread_0_counter = 0; +static ULONG thread_1_counter = 0; +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static UINT error_counter = 0; +static UINT ppp_boundary_test_complete = NX_FALSE; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_check_boundary_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1024, pointer, 8192); + pointer = pointer + 8192; + status += nx_packet_pool_create(&pool_1, "NetX Main Packet Pool", 500, pointer, 8192); + pointer = pointer + 8192; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define the IP addresses. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP1", &ip_1, pointer, 2048, 1, &pool_1, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_1, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); + + /* Enable ICMP traffic. */ + nx_icmp_enable(&ip_0); + nx_icmp_enable(&ip_1); +} + + +UCHAR message[] = +"12345678901234567890123456789012345678901234567890" +"12345678901234567890123456789012345678901234567890" + +"12345678901234567890123456789012345678901234567890" +"12345678901234567890123456789012345678901234567890" + +"12345678901234567890123456789012345678901234567890" +"12345678901234567890123456789012345678901234567890" + +"12345678901234567890123456789012345678901234567890" +"12345678901234567890123456789012345678901234567890" + +"12345678901234567890123456789012345678901234567890" +"12345678901234567890123456789012345678901234567890" + +"12345678901234567890123456789012345678901234567890" +"12345678901234567890123456789012345678901234567890" +; + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; +UINT length; +UINT total; +UINT counter; + + + /* Print out test information banner. */ + printf("NetX Test: PPP Check Packet Boundary Test............................"); + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for address resolved. */ + nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Disable checksum logic for this socket. */ + nx_udp_socket_checksum_disable(&socket_0); + + /* Set the value. */ + length = 10; + total = strlen((const char *)message); + counter = total - length; + + /* Increase the size of message till we hit a boundary error (e.g. packet payload area exceeded). */ + while(length <= total) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_1, &my_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, &message[0], length, &pool_1, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + break; + } + + /* Increment thread 0's counter. */ + thread_0_counter++; + tx_thread_sleep(NX_IP_PERIODIC_RATE/10); + + length++; + } + + /* Let ppp_1 receive packets. */ + while (ppp_boundary_test_complete == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Delete ppp_0. */ + nx_ppp_delete(&ppp_0); + + /* Check status. */ + if (error_counter || (thread_0_counter != counter + 1) || (thread_0_counter != thread_1_counter) || (length != total + 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + /* Wait for address resolved. */ + nx_ip_status_check(&ip_1, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + while(1) + { + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + break; + } + + thread_1_counter++; + + if (thread_1_counter == 590) + thread_1_counter = 590; + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + nx_ppp_delete(&ppp_1); + ppp_boundary_test_complete = NX_TRUE; + +} + + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_check_boundary_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP Check Packet Boundary Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_pap_basic_test.c b/test/regression/ppp_test/netx_ppp_pap_basic_test.c new file mode 100644 index 00000000..4c978084 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_pap_basic_test.c @@ -0,0 +1,511 @@ +/* This tests the basic PPP logic with PAP authentication. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 +#define DEMO_DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_PPP ppp_0; +static NX_PPP ppp_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT thread_1_alive = NX_TRUE; +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_pap_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 2 * NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + { + error_counter++; + } + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + { + error_counter++; + } + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_0, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + { + error_counter++; + } + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer. */ + status = nx_ppp_pap_enable(&ppp_1, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + { + error_counter++; + } + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + if (status) + { + error_counter++; + } +} + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + printf("NetX Test: PPP PAP Basic Test........................................"); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disable checksum logic for this socket. */ + nx_udp_socket_checksum_disable(&socket_0); + + /* Let receiver thread run. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the packet payload! */ + nx_packet_data_append(my_packet, DEMO_DATA, sizeof(DEMO_DATA), &pool_0, NX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Relinquish to thread 1. */ + tx_thread_relinquish(); + + /* Wait for the other thread to finish. */ + while(thread_1_alive) + { + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_0, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + /* Check the echo data. */ + if (memcmp(my_packet -> nx_packet_prepend_ptr, DEMO_DATA, sizeof(DEMO_DATA)) != 0) + { + error_counter++; + } + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_1, my_packet, IP_ADDRESS(1, 2, 3, 4), 0x88); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + } + + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_pap_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Basic Test........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/ppp_test/netx_ppp_pap_null_name_password_test.c b/test/regression/ppp_test/netx_ppp_pap_null_name_password_test.c new file mode 100644 index 00000000..db6e2417 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_pap_null_name_password_test.c @@ -0,0 +1,340 @@ +/* This tests that PPP PAP authentication with empty username and password. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; + +static NX_IP ip_0; +static NX_IP ip_1; + +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; +static UINT nak_counter = 0; +static UINT error_counter = 0; +static UINT thread_1_done = NX_FALSE; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); + +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void nak_authentication_notify(void); + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_pap_null_name_password_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_0, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + status = nx_ppp_nak_authentication_notify(&ppp_0, nak_authentication_notify); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer. */ + status = nx_ppp_pap_enable(&ppp_1, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + status = nx_ppp_nak_authentication_notify(&ppp_1, nak_authentication_notify); + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, pointer, 2048, 1); + pointer = pointer + 2048; + + if (status) + error_counter++; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Null Name Password Test..........................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for address resolved. */ + status = nx_ip_status_check(&ip_0, NX_IP_ADDRESS_RESOLVED, &ip_status, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for thread1 finish. */ + while (thread_1_done != NX_TRUE) + { + tx_thread_sleep(1); + } + + /* Check status. */ + if ((status) || + (ppp_0.nx_ppp_authenticated != 1) || (ppp_1.nx_ppp_authenticated != 1) || + (ppp_0_link_up_counter != 1) || (ppp_1_link_up_counter != 1) || + (ppp_0_link_down_counter != 0) || (ppp_1_link_down_counter != 0) || + (error_counter != 0) || (nak_counter != 0)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete PPP instances. */ + nx_ppp_delete(&ppp_0); + nx_ppp_delete(&ppp_1); + + /* Output successful. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + /* Wait for address resolved. */ + status = nx_ip_status_check(&ip_1, NX_IP_ADDRESS_RESOLVED, &ip_status, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Update the flag. */ + thread_1_done = NX_TRUE; +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} + + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Input null name and null password. */ + name[0] = (CHAR)0; + password[0] = (CHAR) 0; + + return(NX_SUCCESS); +} + + +static UINT verify_login(CHAR *name, CHAR *password) +{ + + if ((name[0]) || (password[0])) + return(NX_PPP_ERROR); + else + return(NX_SUCCESS); +} + +static void nak_authentication_notify(void) +{ + + nak_counter ++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_pap_null_name_password_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP PAP Null Name Password Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/ppp_test/netx_ppp_pfc_option_test.c b/test/regression/ppp_test/netx_ppp_pfc_option_test.c new file mode 100644 index 00000000..e1b689c7 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_pfc_option_test.c @@ -0,0 +1,431 @@ +/* This tests the processing of compressed protocol field. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_COMPRESSION_ENABLE) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 +#define DEMO_DATA "ABCDEFGHIJKLMNOPQRSTUVWXYZ " + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_PPP ppp_0; +static NX_PPP ppp_1; +static NX_UDP_SOCKET socket_0; +static NX_UDP_SOCKET socket_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT thread_1_alive = NX_TRUE; +static ULONG ppp_0_link_up_counter; +static ULONG ppp_0_link_down_counter; +static ULONG ppp_1_link_up_counter; +static ULONG ppp_1_link_down_counter; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); +static void link_up_callback(NX_PPP *ppp_ptr); +static void link_down_callback(NX_PPP *ppp_ptr); +static UINT generate_login(CHAR *name, CHAR *password); +static UINT verify_login(CHAR *name, CHAR *password); + +/* UDP packet data with Protocol filed compressed. +00 21 45 00 00 38 21 00 00 80 11 32 a8 01 02 03 04 01 02 03 05 00 88 00 89 00 24 00 00 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 20 00 +*/ +static UCHAR udp_data[] = { +0x7e, 0xff, 0x7d, 0x23, 0x21, 0x45, 0x7d, 0x20, 0x7d, 0x20, 0x38, 0x7d, 0x20, 0x7d, +0x21, 0x7d, 0x20, 0x7d, 0x20, 0x80, 0x7d, 0x31, 0x32, 0xa8, 0x7d, 0x21, 0x7d, 0x22, 0x7d, 0x23, +0x7d, 0x24, 0x7d, 0x21, 0x7d, 0x22, 0x7d, 0x23, 0x7d, 0x25, 0x7d, 0x20, 0x88, 0x7d, 0x20, 0x89, +0x7d, 0x20, 0x24, 0x7d, 0x20, 0x7d, 0x20, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, +0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, +0x5a, 0x20, 0x7d, 0x20, 0x40, 0xc0, 0x7e, +}; + +static UINT udp_data_send = NX_FALSE; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_pfc_option_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 2 * NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + { + error_counter++; + } + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_0, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_0, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Register the link up/down callbacks. */ + status = nx_ppp_link_up_notify(&ppp_1, link_up_callback); + status += nx_ppp_link_down_notify(&ppp_1, link_down_callback); + + /* Check for PPP link up/down callback registration error(s). */ + if (status) + { + error_counter++; + } + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + if (status) + { + error_counter++; + } +} + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + printf("NetX Test: PPP PFC Option Test......................................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 0x88, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disable checksum logic for this socket. */ + nx_udp_socket_checksum_disable(&socket_0); + + /* Let receiver thread run. */ + tx_thread_relinquish(); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_UDP_PACKET, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Write ABCs into the packet payload! */ + nx_packet_data_append(my_packet, DEMO_DATA, sizeof(DEMO_DATA), &pool_0, NX_WAIT_FOREVER); + + /* Send the UDP packet. */ + status = nx_udp_socket_send(&socket_0, my_packet, IP_ADDRESS(1, 2, 3, 5), 0x89); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Relinquish to thread 1. */ + tx_thread_relinquish(); + + /* Wait for the other thread to finish. */ + while(thread_1_alive) + { + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; +NX_PACKET *my_packet; + + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_1, &socket_1, "Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_1, 0x89, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + thread_1_alive = NX_FALSE; + return; + } + + /* Receive a UDP packet. */ + status = nx_udp_socket_receive(&socket_1, &my_packet, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + + /* Release the packet. */ + status = nx_packet_release(my_packet); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + } + + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +static void ppp_0_serial_byte_output(UCHAR byte) +{ +UINT i; + + if (ppp_0.nx_ppp_ipcp_state < NX_PPP_IPCP_COMPLETED_STATE) + { + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); + } + else if (udp_data_send == NX_FALSE) + { + /* Modify the data to send compressed protocol field. */ + for (i = 0; i < sizeof(udp_data); i++) + { + nx_ppp_byte_receive(&ppp_1, udp_data[i]); + } + + udp_data_send = NX_TRUE; + } +} + +static void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + +static void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} + +static void link_up_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link up counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_up_counter++; + else + ppp_1_link_up_counter++; +} + +static void link_down_callback(NX_PPP *ppp_ptr) +{ + + /* Just increment the link down counter. */ + if (ppp_ptr == &ppp_0) + ppp_0_link_down_counter++; + else + ppp_1_link_down_counter++; + + /* Restart the PPP instance. */ + nx_ppp_restart(ppp_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_pfc_option_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP PFC Option Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/ppp_test/netx_ppp_request_dns_server_test.c b/test/regression/ppp_test/netx_ppp_request_dns_server_test.c new file mode 100644 index 00000000..2494bbe2 --- /dev/null +++ b/test/regression/ppp_test/netx_ppp_request_dns_server_test.c @@ -0,0 +1,289 @@ +/* This tests the use of requesting and processing primary and secondary DNS servers + as part of the IPCP handshake. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define demo stack size. */ + +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_PPP ppp_0; +static NX_PPP ppp_1; + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter = 0; +static UINT thread_1_alive = NX_TRUE; +static ULONG dns_address = 0 ; +static ULONG secondary_dns_address = 0; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +static void ppp_0_serial_byte_output(UCHAR byte); +static void ppp_1_serial_byte_output(UCHAR byte); +static void invalid_packet_handler(NX_PACKET *packet_ptr); + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_request_dns_server_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the thread 0. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the thread 1. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NX_PPP_MIN_PACKET_PAYLOAD, pointer, 2048); + pointer = pointer + 2048; + + /* Check for pool creation error. */ + if (status) + { + error_counter++; + } + + /* Create the first PPP instance. */ + status = nx_ppp_create(&ppp_0, "PPP 0", &ip_0, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_0_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_0, IP_ADDRESS(1, 2, 3, 4), IP_ADDRESS(1, 2, 3, 5)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Create the next PPP instance. */ + status = nx_ppp_create(&ppp_1, "PPP 1", &ip_1, pointer, 2048, 1, &pool_0, invalid_packet_handler, ppp_1_serial_byte_output); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + { + error_counter++; + } + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_1, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + { + error_counter++; + } + + /* Create another IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFF000UL, &pool_0, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create error. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + nx_udp_enable(&ip_0); + nx_udp_enable(&ip_1); + + /* Set up the PPP0 primary address. */ + status = nx_ppp_dns_address_set(&ppp_0, IP_ADDRESS(1,2,3,89)); + + /* Set the PPP0 secondary DNS server */ + status += nx_ppp_secondary_dns_address_set(&ppp_0, IP_ADDRESS(1,2,3,88)); + + /* Set PP1 primary DNS. Note that PPP_0 will overwrite this with its own primary DNS. */ + status += nx_ppp_dns_address_set(&ppp_1, IP_ADDRESS(1,2,3,79)); + + if (status) + { + error_counter++; + } +} + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + + + printf("NetX Test: PPP Request DNS Server Test..............................."); + + if (error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_0, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + /* Wait for the other thread to finish. */ + while(thread_1_alive) + { + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + + if (!secondary_dns_address || !dns_address || error_counter) + { + + printf("ERROR!\n"); + test_control_return(1); + + } + + printf("SUCCESS!\n"); + test_control_return(0); + + return; +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; +ULONG ip_status; + + + /* Wait for the link to come up. */ + do + { + + status = nx_ip_status_check(&ip_1, NX_IP_LINK_ENABLED, &ip_status, 20 * NX_IP_PERIODIC_RATE); + }while(status != NX_SUCCESS); + + + status = nx_ppp_dns_address_get(&ppp_1, &dns_address); + if (status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_ppp_secondary_dns_address_get(&ppp_1, &secondary_dns_address); + if (status != NX_SUCCESS) + { + error_counter++; + } + + thread_1_alive = NX_FALSE; + + return; + +} + +/* Define serial output routines. Normally these routines would + map to physical UART routines and the nx_ppp_byte_receive call + would be made from a UART receive interrupt. */ + +void ppp_0_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 1 input routine. */ + nx_ppp_byte_receive(&ppp_1, byte); +} + +void ppp_1_serial_byte_output(UCHAR byte) +{ + + /* Just feed the PPP 0 input routine. */ + nx_ppp_byte_receive(&ppp_0, byte); +} + + +void invalid_packet_handler(NX_PACKET *packet_ptr) +{ + /* Print out the non-PPP byte. In Windows, the string "CLIENT" will + be sent before Windows PPP starts. Once CLIENT is received, we need + to send "CLIENTSERVER" to establish communication. It's also possible + to receive modem commands here that might need some response to + continue. */ + nx_packet_release(packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ppp_request_dns_server_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPP Request DNS Server Test...............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/pppoe_test/netx_pppoe_ac_name_test.c b/test/regression/pppoe_test/netx_pppoe_ac_name_test.c new file mode 100644 index 00000000..0f3873d5 --- /dev/null +++ b/test/regression/pppoe_test/netx_pppoe_ac_name_test.c @@ -0,0 +1,473 @@ +/* This case tests processing AC name. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" +#include "nx_pppoe_server.h" +#include "nx_pppoe_client.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) && !defined(NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) + +/* Defined NX_PPP_PPPOE_ENABLE if use Express Logic's PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ + +/* If the driver is not initialized in other module, define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE to initialize the driver in PPPoE module . + In this demo, the driver has been initialized in IP module. */ + +/* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE: + If defined, enables the feature that controls the PPPoE session. + PPPoE server does not automatically response to the request until application call specific API. */ + +/* Define the block size. */ +#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 12) +#define DEMO_STACK_SIZE 2048 +#define PPPOE_THREAD_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD thread_server; +static TX_THREAD thread_client; + +/* Define the packet pool and IP instance for normal IP instnace. */ +static NX_PACKET_POOL pool_server; +static NX_IP ip_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_client; +static CHAR pool_buffer_server[NX_PACKET_POOL_SIZE]; +static CHAR pool_buffer_client[NX_PACKET_POOL_SIZE]; + +/* Define the PPP Server instance. */ +static NX_PPP ppp_server; +static NX_PPP ppp_client; + +/* Define the PPPoE Server instance. */ +static NX_PPPOE_SERVER pppoe_server; +static NX_PPPOE_CLIENT pppoe_client; + +/* Define the counters. */ +static CHAR *pointer; +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/***** Substitute your PPP driver entry function here *********/ +extern void _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr); + +/***** Substitute your Ethernet driver entry function here *********/ +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define the callback functions. */ +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr); +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); + +#define SERVER_ADDRESS IP_ADDRESS(192, 168, 10, 43) +#define CLIENT_ADDRESS IP_ADDRESS(192, 168, 10, 44) + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_ac_name_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_server, "Server Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_server, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_server, "Server IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_server, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_server, "PPP Server Instance", &ip_server, pointer, 2048, 1, &pool_server, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_server, ppp_server_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_server, SERVER_ADDRESS, CLIENT_ADDRESS); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_server, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_server); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_server, "thread server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_client, "Client Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_client, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_client, "Client IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_client, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_client, "PPP Client Instance", &ip_client, pointer, 2048, 1, &pool_client, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_client, ppp_client_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_client, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer.. */ + status = nx_ppp_pap_enable(&ppp_client, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_client, "thread client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + +} + +static UCHAR PADI[] = +{ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x88, 0x63, +0x11, 0x09, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x01, 0x00, 0x00, 0x01, 0x03, 0x00, 0x04, 0x64, 0x13, +0x85, 0x18, +}; + +static UCHAR PADR[] = +{ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x88, 0x63, +0x11, 0x19, 0x00, 0x00, 0x00, 0x14, 0x01, 0x01, 0x00, 0x00, 0x01, 0x03, 0x00, 0x04, 0x64, 0x13, +0x85, 0x18, 0x01, 0x02, 0x00, 0x04, 0x42, 0x52, 0x41, 0x53, +}; + +static void thread_client_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +NX_PACKET *recv_pkt; +ULONG ip_address; +ULONG network_mask; +NX_PACKET *send_packet; + + /* Create the PPPoE instance. */ + status = nx_pppoe_client_create(&pppoe_client, (UCHAR *)"PPPoE Client", &ip_client, 0, &pool_client, pointer, PPPOE_THREAD_SIZE, 4, _nx_ram_network_driver, pppoe_client_packet_receive); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Establish PPPoE Client sessione. */ + nx_packet_allocate(&pool_client, &send_packet, NX_PHYSICAL_HEADER, NX_NO_WAIT); + memcpy(send_packet -> nx_packet_prepend_ptr, PADI, sizeof(PADI)); + send_packet -> nx_packet_prepend_ptr += NX_PPPOE_SERVER_ETHER_HEADER_SIZE; + send_packet -> nx_packet_length = sizeof(PADI) - NX_PPPOE_SERVER_ETHER_HEADER_SIZE; + send_packet -> nx_packet_append_ptr = send_packet -> nx_packet_prepend_ptr + send_packet -> nx_packet_length; + _nx_pppoe_server_packet_deferred_receive(send_packet); + nx_packet_allocate(&pool_client, &send_packet, NX_PHYSICAL_HEADER, NX_NO_WAIT); + memcpy(send_packet -> nx_packet_prepend_ptr, PADR, sizeof(PADR)); + send_packet -> nx_packet_prepend_ptr += NX_PPPOE_SERVER_ETHER_HEADER_SIZE; + send_packet -> nx_packet_length = sizeof(PADR) - NX_PPPOE_SERVER_ETHER_HEADER_SIZE; + send_packet -> nx_packet_append_ptr = send_packet -> nx_packet_prepend_ptr + send_packet -> nx_packet_length; + pppoe_client.nx_pppoe_server_session.nx_pppoe_physical_address_msw = 0x11; + pppoe_client.nx_pppoe_server_session.nx_pppoe_physical_address_lsw = 0x22334456; + pppoe_client.nx_pppoe_state = NX_PPPOE_CLIENT_STATE_PADR_SENT; + _nx_pppoe_server_packet_deferred_receive(send_packet); + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_client, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check client IP address. */ + status = nx_ip_address_get(&ip_client, &ip_address, &network_mask); + if (status || ip_address != CLIENT_ADDRESS) + { + error_counter++; + } + + /* Ping test. */ + status = nx_icmp_ping(&ip_client, SERVER_ADDRESS, "abcd", 4, &recv_pkt, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(recv_pkt); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* PPPoE Client receive function. */ +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr) +{ + + /* Call PPP Client to receive the PPP data fame. */ + nx_ppp_packet_receive(&ppp_client, packet_ptr); +} + +/* PPP Client send function. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr) +{ + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_client_session_packet_send(&pppoe_client, packet_ptr); +} + +/* Define the server threads. */ + +static void thread_server_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +ULONG ip_address; +ULONG network_mask; +UCHAR ac_name[] = "BRAS"; + + /* Print out test information banner. */ + printf("NetX Test: PPPoE AC Name Test........................................"); + + /* Create the PPPoE instance. */ + status = nx_pppoe_server_create(&pppoe_server, (UCHAR *)"PPPoE Server", &ip_server, 0, _nx_ram_network_driver, &pool_server, pointer, PPPOE_THREAD_SIZE, 4); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set AC name. */ + nx_pppoe_server_ac_name_set(&pppoe_server, ac_name, sizeof(ac_name) - 1); + + /* Set the callback notify function. */ + status = nx_pppoe_server_callback_notify_set(&pppoe_server, NX_NULL, NX_NULL, NX_NULL, NX_NULL, pppoe_server_packet_receive, NX_NULL); + if (status) + { + error_counter++; + } + + /* Enable PPPoE Server. */ + status = nx_pppoe_server_enable(&pppoe_server); + if (status) + { + error_counter++; + } + + tx_thread_resume(&thread_client); + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_server, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check server IP address. */ + status = nx_ip_address_get(&ip_server, &ip_address, &network_mask); + if (status || ip_address != SERVER_ADDRESS) + { + error_counter++; + } +} + +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id) +{ + +NX_PACKET *packet_ptr; + + /* Get the notify that receive the PPPoE Session data. */ + + /* Call PPP Server to receive the PPP data fame. */ + packet_ptr = (NX_PACKET *)(packet_id); + nx_ppp_packet_receive(&ppp_server, packet_ptr); +} + +/* PPP Server send function. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr) +{ + +/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +UINT interfaceHandle = 0; + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_server_session_packet_send(&pppoe_server, interfaceHandle, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_ac_name_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPPoE AC Name Test........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/pppoe_test/netx_pppoe_api_extended_test.c b/test/regression/pppoe_test/netx_pppoe_api_extended_test.c new file mode 100644 index 00000000..6467696c --- /dev/null +++ b/test/regression/pppoe_test/netx_pppoe_api_extended_test.c @@ -0,0 +1,470 @@ +/* This case tests the APIs of PPPoE server and client. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" +#include "nx_pppoe_server.h" +#include "nx_pppoe_client.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) && !defined(NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) + +/* Define the block size. */ +#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 12) +#define DEMO_STACK_SIZE 2048 +#define PPPOE_THREAD_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD thread_server; +static TX_THREAD thread_client; + +/* Define the packet pool and IP instance for normal IP instnace. */ +static NX_PACKET_POOL pool_server; +static NX_IP ip_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_client; +static CHAR pool_buffer_server[NX_PACKET_POOL_SIZE]; +static CHAR pool_buffer_client[NX_PACKET_POOL_SIZE]; + +/* Define the PPP Server instance. */ +static NX_PPP ppp_server; +static NX_PPP ppp_client; + +/* Define the PPPoE Server instance. */ +static NX_PPPOE_SERVER pppoe_server; +static NX_PPPOE_CLIENT pppoe_client; + +/* Define the counters. */ +static CHAR *pointer; +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/***** Substitute your PPP driver entry function here *********/ +extern void _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr); + +/***** Substitute your Ethernet driver entry function here *********/ +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define the callback functions. */ +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr); +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); + +#define SERVER_ADDRESS IP_ADDRESS(192, 168, 10, 43) +#define CLIENT_ADDRESS IP_ADDRESS(192, 168, 10, 44) + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_api_extended_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_server, "Server Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_server, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_server, "Server IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_server, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_server, "PPP Server Instance", &ip_server, pointer, 2048, 1, &pool_server, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_server, ppp_server_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_server, SERVER_ADDRESS, CLIENT_ADDRESS); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_server, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_server); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_server, "thread server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_client, "Client Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_client, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_client, "Client IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_client, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_client, "PPP Client Instance", &ip_client, pointer, 2048, 1, &pool_client, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_client, ppp_client_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_client, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer.. */ + status = nx_ppp_pap_enable(&ppp_client, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_client, "thread client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + +} + +static void thread_client_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +NX_PACKET *recv_pkt; +ULONG ip_address; +ULONG network_mask; + + /* Create the PPPoE instance. */ + status = nx_pppoe_client_create(&pppoe_client, (UCHAR *)"PPPoE Client", &ip_client, 0, &pool_client, pointer, PPPOE_THREAD_SIZE, 4, _nx_ram_network_driver, pppoe_client_packet_receive); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set host unique. */ + status = nx_pppoe_client_host_uniq_set_extended(&pppoe_client, "220000000000000041000000", sizeof("220000000000000041000000") - 1); + if (status) + { + error_counter++; + } + + /* Set service name. */ + status = nx_pppoe_client_service_name_set_extended(&pppoe_client, "BRAS", sizeof("BRAS") - 1); + if (status) + { + error_counter++; + } + + /* Establish PPPoE Client sessione. */ + status = nx_pppoe_client_session_connect(&pppoe_client, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_client, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check client IP address. */ + status = nx_ip_address_get(&ip_client, &ip_address, &network_mask); + if (status || ip_address != CLIENT_ADDRESS) + { + error_counter++; + } + + /* Ping test. */ + status = nx_icmp_ping(&ip_client, SERVER_ADDRESS, "abcd", 4, &recv_pkt, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(recv_pkt); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* PPPoE Client receive function. */ +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr) +{ + + /* Call PPP Client to receive the PPP data fame. */ + nx_ppp_packet_receive(&ppp_client, packet_ptr); +} + +/* PPP Client send function. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr) +{ + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_client_session_packet_send(&pppoe_client, packet_ptr); +} + +/* Define the server threads. */ + +static void thread_server_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +UCHAR *nx_pppoe_service_name[] = +{ + "BRAS", + "PRINTER", + NX_NULL +}; +ULONG ip_address; +ULONG network_mask; + + + /* Print out test information banner. */ + printf("NetX Test: PPPoE API Extended Test..................................."); + + /* Create the PPPoE instance. */ + status = nx_pppoe_server_create(&pppoe_server, (UCHAR *)"PPPoE Server", &ip_server, 0, _nx_ram_network_driver, &pool_server, pointer, PPPOE_THREAD_SIZE, 4); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set the callback notify function. */ + status = nx_pppoe_server_callback_notify_set(&pppoe_server, NX_NULL, NX_NULL, NX_NULL, NX_NULL, pppoe_server_packet_receive, NX_NULL); + if (status) + { + error_counter++; + } + + /* Set service name. */ + status = nx_pppoe_server_service_name_set(&pppoe_server, nx_pppoe_service_name, 2); + if (status) + { + error_counter++; + } + + /* Set access concentrator name. */ + status = nx_pppoe_server_ac_name_set(&pppoe_server, (UCHAR *)"PPPoE Server AC", sizeof("PPPoE Server AC") - 1); + if (status) + { + error_counter++; + } + + /* Enable PPPoE Server. */ + status = nx_pppoe_server_enable(&pppoe_server); + if (status) + { + error_counter++; + } + + tx_thread_resume(&thread_client); + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_server, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check server IP address. */ + status = nx_ip_address_get(&ip_server, &ip_address, &network_mask); + if (status || ip_address != SERVER_ADDRESS) + { + error_counter++; + } +} + +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id) +{ + +NX_PACKET *packet_ptr; + + /* Get the notify that receive the PPPoE Session data. */ + + /* Call PPP Server to receive the PPP data fame. */ + packet_ptr = (NX_PACKET *)(packet_id); + nx_ppp_packet_receive(&ppp_server, packet_ptr); +} + +/* PPP Server send function. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr) +{ + +/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +UINT interfaceHandle = 0; + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_server_session_packet_send(&pppoe_server, interfaceHandle, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_api_extended_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPPoE API Extended Test...................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/pppoe_test/netx_pppoe_api_test.c b/test/regression/pppoe_test/netx_pppoe_api_test.c new file mode 100644 index 00000000..b32553ba --- /dev/null +++ b/test/regression/pppoe_test/netx_pppoe_api_test.c @@ -0,0 +1,463 @@ +/* This case tests the APIs of PPPoE server and client. */ + +#include "nx_pppoe_server.h" +#include "nx_pppoe_client.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) && !defined(NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) + +/* Define the block size. */ +#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 12) +#define DEMO_STACK_SIZE 2048 +#define PPPOE_THREAD_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD thread_server; +static TX_THREAD thread_client; + +/* Define the packet pool and IP instance for normal IP instnace. */ +static NX_PACKET_POOL pool_server; +static NX_IP ip_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_client; +static CHAR pool_buffer_server[NX_PACKET_POOL_SIZE]; +static CHAR pool_buffer_client[NX_PACKET_POOL_SIZE]; + +/* Define the PPP Server instance. */ +static NX_PPP ppp_server; +static NX_PPP ppp_client; + +/* Define the PPPoE Server instance. */ +static NX_PPPOE_SERVER pppoe_server; +static NX_PPPOE_CLIENT pppoe_client; + +/* Define the counters. */ +static CHAR *pointer; +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/***** Substitute your PPP driver entry function here *********/ +extern void _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr); + +/***** Substitute your Ethernet driver entry function here *********/ +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define the callback functions. */ +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr); +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); + +#define SERVER_ADDRESS IP_ADDRESS(192, 168, 10, 43) +#define CLIENT_ADDRESS IP_ADDRESS(192, 168, 10, 44) + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_api_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_server, "Server Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_server, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_server, "Server IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_server, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_server, "PPP Server Instance", &ip_server, pointer, 2048, 1, &pool_server, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_server, ppp_server_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_server, SERVER_ADDRESS, CLIENT_ADDRESS); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_server, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_server); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_server, "thread server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_client, "Client Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_client, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_client, "Client IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_client, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_client, "PPP Client Instance", &ip_client, pointer, 2048, 1, &pool_client, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_client, ppp_client_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_client, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer.. */ + status = nx_ppp_pap_enable(&ppp_client, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_client, "thread client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + +} + +static void thread_client_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +NX_PACKET *recv_pkt; +ULONG ip_address; +ULONG network_mask; + + /* Create the PPPoE instance. */ + status = nx_pppoe_client_create(&pppoe_client, (UCHAR *)"PPPoE Client", &ip_client, 0, &pool_client, pointer, PPPOE_THREAD_SIZE, 4, _nx_ram_network_driver, pppoe_client_packet_receive); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set host unique. */ + status = nx_pppoe_client_host_uniq_set(&pppoe_client, "220000000000000041000000"); + if (status) + { + error_counter++; + } + + /* Set service name. */ + status = nx_pppoe_client_service_name_set(&pppoe_client, "BRAS"); + if (status) + { + error_counter++; + } + + /* Establish PPPoE Client sessione. */ + status = nx_pppoe_client_session_connect(&pppoe_client, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_client, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check client IP address. */ + status = nx_ip_address_get(&ip_client, &ip_address, &network_mask); + if (status || ip_address != CLIENT_ADDRESS) + { + error_counter++; + } + + /* Ping test. */ + status = nx_icmp_ping(&ip_client, SERVER_ADDRESS, "abcd", 4, &recv_pkt, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(recv_pkt); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* PPPoE Client receive function. */ +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr) +{ + + /* Call PPP Client to receive the PPP data fame. */ + nx_ppp_packet_receive(&ppp_client, packet_ptr); +} + +/* PPP Client send function. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr) +{ + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_client_session_packet_send(&pppoe_client, packet_ptr); +} + +/* Define the server threads. */ + +static void thread_server_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +UCHAR *nx_pppoe_service_name[] = +{ + "BRAS", + "PRINTER", + NX_NULL +}; +ULONG ip_address; +ULONG network_mask; + + + /* Print out test information banner. */ + printf("NetX Test: PPPoE API Test............................................"); + + /* Create the PPPoE instance. */ + status = nx_pppoe_server_create(&pppoe_server, (UCHAR *)"PPPoE Server", &ip_server, 0, _nx_ram_network_driver, &pool_server, pointer, PPPOE_THREAD_SIZE, 4); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set the callback notify function. */ + status = nx_pppoe_server_callback_notify_set(&pppoe_server, NX_NULL, NX_NULL, NX_NULL, NX_NULL, pppoe_server_packet_receive, NX_NULL); + if (status) + { + error_counter++; + } + + /* Set service name. */ + status = nx_pppoe_server_service_name_set(&pppoe_server, nx_pppoe_service_name, 2); + if (status) + { + error_counter++; + } + + /* Enable PPPoE Server. */ + status = nx_pppoe_server_enable(&pppoe_server); + if (status) + { + error_counter++; + } + + tx_thread_resume(&thread_client); + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_server, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check server IP address. */ + status = nx_ip_address_get(&ip_server, &ip_address, &network_mask); + if (status || ip_address != SERVER_ADDRESS) + { + error_counter++; + } +} + +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id) +{ + +NX_PACKET *packet_ptr; + + /* Get the notify that receive the PPPoE Session data. */ + + /* Call PPP Server to receive the PPP data fame. */ + packet_ptr = (NX_PACKET *)(packet_id); + nx_ppp_packet_receive(&ppp_server, packet_ptr); +} + +/* PPP Server send function. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr) +{ + +/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +UINT interfaceHandle = 0; + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_server_session_packet_send(&pppoe_server, interfaceHandle, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPPoE API Test............................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/pppoe_test/netx_pppoe_basic_test.c b/test/regression/pppoe_test/netx_pppoe_basic_test.c new file mode 100644 index 00000000..59d2c211 --- /dev/null +++ b/test/regression/pppoe_test/netx_pppoe_basic_test.c @@ -0,0 +1,457 @@ +/* This case tests the basic connection of PPPoE server and client. */ + +#include "nx_pppoe_client.h" +#include "nx_pppoe_server.h" +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) && !defined(NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) + +/* Defined NX_PPP_PPPOE_ENABLE if use Express Logic's PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ + +/* If the driver is not initialized in other module, define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE to initialize the driver in PPPoE module . + In this demo, the driver has been initialized in IP module. */ + +/* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE: + If defined, enables the feature that controls the PPPoE session. + PPPoE server does not automatically response to the request until application call specific API. */ + +/* Define the block size. */ +#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 12) +#define DEMO_STACK_SIZE 2048 +#define PPPOE_THREAD_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD thread_server; +static TX_THREAD thread_client; + +/* Define the packet pool and IP instance for normal IP instnace. */ +static NX_PACKET_POOL pool_server; +static NX_IP ip_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_client; +static CHAR pool_buffer_server[NX_PACKET_POOL_SIZE]; +static CHAR pool_buffer_client[NX_PACKET_POOL_SIZE]; + +/* Define the PPP Server instance. */ +static NX_PPP ppp_server; +static NX_PPP ppp_client; + +/* Define the PPPoE Server instance. */ +static NX_PPPOE_SERVER pppoe_server; +static NX_PPPOE_CLIENT pppoe_client; + +/* Define the counters. */ +static CHAR *pointer; +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/***** Substitute your PPP driver entry function here *********/ +extern void _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr); + +/***** Substitute your Ethernet driver entry function here *********/ +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define the callback functions. */ +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr); +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); + +#define SERVER_ADDRESS IP_ADDRESS(192, 168, 10, 43) +#define CLIENT_ADDRESS IP_ADDRESS(192, 168, 10, 44) + +#define SERVICE_NAME_1 "test_service_1" +#define SERVICE_NAME_2 "test_service_2" + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_server, "Server Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_server, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_server, "Server IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_server, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_server, "PPP Server Instance", &ip_server, pointer, 2048, 1, &pool_server, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_server, ppp_server_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_server, SERVER_ADDRESS, CLIENT_ADDRESS); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_server, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_server); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_server, "thread server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_client, "Client Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_client, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_client, "Client IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_client, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_client, "PPP Client Instance", &ip_client, pointer, 2048, 1, &pool_client, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_client, ppp_client_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_client, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer.. */ + status = nx_ppp_pap_enable(&ppp_client, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_client, "thread client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + +} + +static void thread_client_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +NX_PACKET *recv_pkt; +ULONG ip_address; +ULONG network_mask; + + /* Create the PPPoE instance. */ + status = nx_pppoe_client_create(&pppoe_client, (UCHAR *)"PPPoE Client", &ip_client, 0, &pool_client, pointer, PPPOE_THREAD_SIZE, 4, _nx_ram_network_driver, pppoe_client_packet_receive); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set service name. */ + nx_pppoe_client_service_name_set(&pppoe_client, SERVICE_NAME_1); + + /* Establish PPPoE Client sessione. */ + status = nx_pppoe_client_session_connect(&pppoe_client, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_client, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check client IP address. */ + status = nx_ip_address_get(&ip_client, &ip_address, &network_mask); + if (status || ip_address != CLIENT_ADDRESS) + { + error_counter++; + } + + /* Ping test. */ + status = nx_icmp_ping(&ip_client, SERVER_ADDRESS, "abcd", 4, &recv_pkt, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(recv_pkt); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* PPPoE Client receive function. */ +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr) +{ + + /* Call PPP Client to receive the PPP data fame. */ + nx_ppp_packet_receive(&ppp_client, packet_ptr); +} + +/* PPP Client send function. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr) +{ + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_client_session_packet_send(&pppoe_client, packet_ptr); +} + +/* Define the server threads. */ + +static void thread_server_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +ULONG ip_address; +ULONG network_mask; +UCHAR *service_names[2]; +UINT service_names_count = 2; + + /* Print out test information banner. */ + printf("NetX Test: PPPoE Basic Test.........................................."); + + /* Create the PPPoE instance. */ + status = nx_pppoe_server_create(&pppoe_server, (UCHAR *)"PPPoE Server", &ip_server, 0, _nx_ram_network_driver, &pool_server, pointer, PPPOE_THREAD_SIZE, 4); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set the callback notify function. */ + status = nx_pppoe_server_callback_notify_set(&pppoe_server, NX_NULL, NX_NULL, NX_NULL, NX_NULL, pppoe_server_packet_receive, NX_NULL); + if (status) + { + error_counter++; + } + + /* Set service name. */ + service_names[0] = SERVICE_NAME_1; + service_names[1] = SERVICE_NAME_2; + nx_pppoe_server_service_name_set(&pppoe_server, service_names, service_names_count); + + /* Enable PPPoE Server. */ + status = nx_pppoe_server_enable(&pppoe_server); + if (status) + { + error_counter++; + } + + tx_thread_resume(&thread_client); + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_server, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check server IP address. */ + status = nx_ip_address_get(&ip_server, &ip_address, &network_mask); + if (status || ip_address != SERVER_ADDRESS) + { + error_counter++; + } +} + +static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id) +{ + +NX_PACKET *packet_ptr; + + /* Get the notify that receive the PPPoE Session data. */ + + /* Call PPP Server to receive the PPP data fame. */ + packet_ptr = (NX_PACKET *)(packet_id); + nx_ppp_packet_receive(&ppp_server, packet_ptr); +} + +/* PPP Server send function. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr) +{ + +/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +UINT interfaceHandle = 0; + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_server_session_packet_send(&pppoe_server, interfaceHandle, packet_ptr); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPPoE Basic Test..........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/pppoe_test/netx_pppoe_session_control_test.c b/test/regression/pppoe_test/netx_pppoe_session_control_test.c new file mode 100644 index 00000000..fbe55af9 --- /dev/null +++ b/test/regression/pppoe_test/netx_pppoe_session_control_test.c @@ -0,0 +1,542 @@ +/* This case tests the basic connection when session control is enabled. */ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_ppp.h" +#include "nx_pppoe_server.h" +#include "nx_pppoe_client.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) + +/* Defined NX_PPP_PPPOE_ENABLE if use Express Logic's PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ + +/* If the driver is not initialized in other module, define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE to initialize the driver in PPPoE module . + In this demo, the driver has been initialized in IP module. */ + +/* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE: + If defined, enables the feature that controls the PPPoE session. + PPPoE server does not automatically response to the request until application call specific API. */ + +/* Define the block size. */ +#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 20) +#define DEMO_STACK_SIZE 2048 +#define PPPOE_THREAD_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ +static TX_THREAD thread_server; +static TX_THREAD thread_client; + +/* Define the packet pool and IP instance for normal IP instnace. */ +static NX_PACKET_POOL pool_server; +static NX_IP ip_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_client; +static CHAR pool_buffer_server[NX_PACKET_POOL_SIZE]; +static CHAR pool_buffer_client[NX_PACKET_POOL_SIZE]; + +/* Define the PPP Server instance. */ +static NX_PPP ppp_server; +static NX_PPP ppp_client; + +/* Define the PPPoE Server instance. */ +static NX_PPPOE_SERVER pppoe_server; +static NX_PPPOE_CLIENT pppoe_client; + +/* Define the counters. */ +static CHAR *pointer; +static ULONG error_counter; + +/* Define thread prototypes. */ +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/***** Substitute your PPP driver entry function here *********/ +extern void _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr); + +/***** Substitute your Ethernet driver entry function here *********/ +extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr); + +/* Define the porting layer function for Express Logic's PPP. + Functions to be provided by PPP for calling by the PPPoE Stack. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr); +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); + +/* Define the callback functions. */ +static void PppDiscoverReq(UINT interfaceHandle); +static void PppOpenReq(UINT interfaceHandle, ULONG length, UCHAR *data); +static void PppCloseRsp(UINT interfaceHandle); +static void PppCloseReq(UINT interfaceHandle); +static void PppTransmitDataReq(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); +static void PppReceiveDataRsp(UINT interfaceHandle, UCHAR *data); + +#define SERVER_ADDRESS IP_ADDRESS(192, 168, 10, 43) +#define CLIENT_ADDRESS IP_ADDRESS(192, 168, 10, 44) + +#define SERVICE_NAME_1 "test_service_1" +#define SERVICE_NAME_2 "test_service_2" +#define SERVICES "test_service_1\0test_service_2" + +static UINT generate_login(CHAR *name, CHAR *password) +{ + + /* Make a name and password, called "myname" and "mypassword". */ + name[0] = 'm'; + name[1] = 'y'; + name[2] = 'n'; + name[3] = 'a'; + name[4] = 'm'; + name[5] = 'e'; + name[6] = (CHAR) 0; + + password[0] = 'm'; + password[1] = 'y'; + password[2] = 'p'; + password[3] = 'a'; + password[4] = 's'; + password[5] = 's'; + password[6] = 'w'; + password[7] = 'o'; + password[8] = 'r'; + password[9] = 'd'; + password[10] = (CHAR) 0; + + return(NX_SUCCESS); +} + +static UINT verify_login(CHAR *name, CHAR *password) +{ + +if ((name[0] == 'm') && + (name[1] == 'y') && + (name[2] == 'n') && + (name[3] == 'a') && + (name[4] == 'm') && + (name[5] == 'e') && + (name[6] == (CHAR) 0) && + (password[0] == 'm') && + (password[1] == 'y') && + (password[2] == 'p') && + (password[3] == 'a') && + (password[4] == 's') && + (password[5] == 's') && + (password[6] == 'w') && + (password[7] == 'o') && + (password[8] == 'r') && + (password[9] == 'd') && + (password[10] == (CHAR) 0)) + return(NX_SUCCESS); + else + return(NX_PPP_ERROR); +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_session_control_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_server, "Server Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_server, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_server, "Server IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_server, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_server, "PPP Server Instance", &ip_server, pointer, 2048, 1, &pool_server, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_server, ppp_server_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the server since it has both IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_server, SERVER_ADDRESS, CLIENT_ADDRESS); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the server since it will verify the name and password. */ + status = nx_ppp_pap_enable(&ppp_server, NX_NULL, verify_login); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_server); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_server, "thread server", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a packet pool for normal IP instance. */ + status = nx_packet_pool_create(&pool_client, "Client Packet Pool", + (1536 + sizeof(NX_PACKET)), + pool_buffer_client, NX_PACKET_POOL_SIZE); + + /* Check for error. */ + if (status) + error_counter++; + + /* Create an normal IP instance. */ + status = nx_ip_create(&ip_client, "Client IP Instance", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_client, nx_ppp_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for error. */ + if (status) + error_counter++; + + /* Create the PPP instance. */ + status = nx_ppp_create(&ppp_client, "PPP Client Instance", &ip_client, pointer, 2048, 1, &pool_client, NX_NULL, NX_NULL); + pointer = pointer + 2048; + + /* Check for PPP create error. */ + if (status) + error_counter++; + + /* Set the PPP packet send function. */ + status = nx_ppp_packet_send_set(&ppp_client, ppp_client_packet_send); + + /* Check for PPP packet send function set error. */ + if (status) + error_counter++; + + /* Define IP address. This PPP instance is effectively the client since it doesn't have any IP addresses. */ + status = nx_ppp_ip_address_assign(&ppp_client, IP_ADDRESS(0, 0, 0, 0), IP_ADDRESS(0, 0, 0, 0)); + + /* Check for PPP IP address assign error. */ + if (status) + error_counter++; + + /* Setup PAP, this PPP instance is effectively the since it generates the name and password for the peer.. */ + status = nx_ppp_pap_enable(&ppp_client, generate_login, NX_NULL); + + /* Check for PPP PAP enable error. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for Normal IP Instance. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable ICMP */ + status = nx_icmp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&thread_client, "thread client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_DONT_START); + pointer = pointer + DEMO_STACK_SIZE; + +} + +static void thread_client_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +NX_PACKET *recv_pkt; +ULONG ip_address; +ULONG network_mask; + + /* Create the PPPoE instance. */ + status = nx_pppoe_client_create(&pppoe_client, (UCHAR *)"PPPoE Client", &ip_client, 0, &pool_client, pointer, PPPOE_THREAD_SIZE, 4, _nx_ram_network_driver, pppoe_client_packet_receive); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set service name. */ + nx_pppoe_client_service_name_set(&pppoe_client, SERVICE_NAME_1); + + /* Establish PPPoE Client sessione. */ + status = nx_pppoe_client_session_connect(&pppoe_client, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_client, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check client IP address. */ + status = nx_ip_address_get(&ip_client, &ip_address, &network_mask); + if (status || ip_address != CLIENT_ADDRESS) + { + error_counter++; + } + + /* Ping test. */ + status = nx_icmp_ping(&ip_client, SERVER_ADDRESS, "abcd", 4, &recv_pkt, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + else + { + nx_packet_release(recv_pkt); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* PPPoE Client receive function. */ +static void pppoe_client_packet_receive(NX_PACKET *packet_ptr) +{ + + /* Call PPP Client to receive the PPP data fame. */ + nx_ppp_packet_receive(&ppp_client, packet_ptr); +} + +/* PPP Client send function. */ +static void ppp_client_packet_send(NX_PACKET *packet_ptr) +{ + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_client_session_packet_send(&pppoe_client, packet_ptr); +} + +/* Define the server threads. */ + +static void thread_server_entry(ULONG thread_input) +{ +UINT status; +ULONG ip_status; +ULONG ip_address; +ULONG network_mask; +#ifndef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE +UCHAR *service_names[2]; +UINT service_names_count = 2; +#endif + + /* Print out test information banner. */ + printf("NetX Test: PPPoE Session Control Test................................"); + + /* Create the PPPoE instance. */ + status = nx_pppoe_server_create(&pppoe_server, (UCHAR *)"PPPoE Server", &ip_server, 0, _nx_ram_network_driver, &pool_server, pointer, PPPOE_THREAD_SIZE, 4); + pointer = pointer + PPPOE_THREAD_SIZE; + if (status) + { + error_counter++; + } + + /* Set the callback notify function. */ + status = nx_pppoe_server_callback_notify_set(&pppoe_server, PppDiscoverReq, PppOpenReq, PppCloseRsp, PppCloseReq, PppTransmitDataReq, PppReceiveDataRsp); + if (status) + { + error_counter++; + return; + } + +#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE + + /* Call function to set the default service Name. */ + PppInitInd(sizeof(SERVICE_NAME_1), SERVICE_NAME_1); +#else + + /* Set the service Name. */ + service_names[0] = SERVICE_NAME_1; + service_names[1] = SERVICE_NAME_2; + nx_pppoe_server_service_name_set(&pppoe_server, service_names, service_names_count); +#endif + + /* Enable PPPoE Server. */ + status = nx_pppoe_server_enable(&pppoe_server); + if (status) + { + error_counter++; + } + + tx_thread_resume(&thread_client); + + /* Wait for the link to come up. */ + status = nx_ip_interface_status_check(&ip_server, 0, NX_IP_ADDRESS_RESOLVED, &ip_status, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + /* Check server IP address. */ + status = nx_ip_address_get(&ip_server, &ip_address, &network_mask); + if (status || ip_address != SERVER_ADDRESS) + { + error_counter++; + } +} + +void PppDiscoverReq(UINT interfaceHandle) +{ + + /* Receive the PPPoE Discovery Initiation Message. */ + +#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE + /* Call PPPoE function to allow TTP's software to define the Service Name field of the PADO packet. */ + PppDiscoverCnf(sizeof(SERVICES), SERVICES, interfaceHandle); +#endif /* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE */ +} + +void PppOpenReq(UINT interfaceHandle, ULONG length, UCHAR *data) +{ + + /* Get the notify that receive the PPPoE Discovery Request Message. */ + +#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE + /* Call PPPoE function to allow TTP's software to accept the PPPoE session. */ + PppOpenCnf(NX_TRUE, interfaceHandle); +#endif /* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE */ +} + +void PppCloseRsp(UINT interfaceHandle) +{ + + /* Get the notify that receive the PPPoE Discovery Terminate Message. */ + +#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE + /* Call PPPoE function to allow TTP's software to confirm that the handle has been freed. */ + PppCloseCnf(interfaceHandle); +#endif /* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE */ +} + +void PppCloseReq(UINT interfaceHandle) +{ + + /* Get the notify that PPPoE Discovery Terminate Message has been sent. */ + +} + +void PppReceiveDataRsp(UINT interfaceHandle, UCHAR *data) +{ + + /* Get the notify that the PPPoE Session data has been sent. */ + +} + +static void PppTransmitDataReq(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id) +{ + +NX_PACKET *packet_ptr; + + /* Get the notify that receive the PPPoE Session data. */ + + /* Call PPP Server to receive the PPP data fame. */ + packet_ptr = (NX_PACKET *)(packet_id); + nx_ppp_packet_receive(&ppp_server, packet_ptr); + +#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE + /* Call PPPoE function to confirm that the data has been processed. */ + PppTransmitDataCnf(interfaceHandle, data, 0); +#endif /* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE */ +} + +/* PPP Server send function. */ +static void ppp_server_packet_send(NX_PACKET *packet_ptr) +{ + +/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +UINT interfaceHandle = 0; + +#ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE +NX_PACKET *temp_packet = packet_ptr; + + while(packet_ptr) + { + + /* Call functions to be provided by PPPoE for TTP. */ + PppReceiveDataInd(interfaceHandle, (packet_ptr -> nx_packet_append_ptr - packet_ptr -> nx_packet_prepend_ptr), packet_ptr -> nx_packet_prepend_ptr); + + /* Move to the next packet structure. */ + packet_ptr = packet_ptr -> nx_packet_next; + } + + nx_packet_transmit_release(temp_packet); +#else + + /* Directly Call PPPoE send function to send out the data through PPPoE module. */ + nx_pppoe_server_session_packet_send(&pppoe_server, interfaceHandle, packet_ptr); +#endif /* NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE */ +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_pppoe_session_control_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: PPPoE Session Control Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_announce_timeout_test.c b/test/regression/ptp_test/netx_ptp_client_announce_timeout_test.c new file mode 100644 index 00000000..49ba4779 --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_announce_timeout_test.c @@ -0,0 +1,254 @@ +/* PTP Announce test. This test case validates on Announce timeout, PTP client will trigger an event. */ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; +static UCHAR ptp_sync_received = NX_FALSE; +static UCHAR ptp_announce_timeout = NX_FALSE; +static ULONG ptp_announce_tick = 0; +static ULONG ptp_announce_timeout_tick = 0; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_announce_timeout_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP Announce Timeout Test ................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + ASSERT_SUCCESS(status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + ASSERT_SUCCESS(status); +} + + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + + ptp_announce_tick = tx_time_get(); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + ASSERT_TRUE(ptp_sync_received == NX_FALSE); + ptp_sync_received = NX_TRUE; + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + + ASSERT_TRUE(ptp_announce_timeout == NX_FALSE); + ptp_announce_timeout = NX_TRUE; + ptp_announce_timeout_tick = tx_time_get(); + break; + } + default: + { + break; + } + } + + return(0); +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +UINT timeout_ticks; + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Set expected value. */ + expected_utc_offset = 0x1234; + expected_time.second_high = (delay_response_ts.second_high + follow_up_ts.second_high) / 2; + expected_time.second_low = (delay_response_ts.second_low + follow_up_ts.second_low) / 2; + expected_time.nanosecond = (delay_response_ts.nanosecond + follow_up_ts.nanosecond) / 2; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + nx_ptp_client_soft_clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Validate PTP clock synced. */ + ASSERT_TRUE(ptp_sync_received); + + /* Sleep until timeout. */ + timeout_ticks = NX_PTP_CLIENT_ANNOUNCE_RECEIPT_TIMEOUT * + (1 << NX_PTP_CLIENT_LOG_ANNOUNCE_INTERVAL) * + NX_IP_PERIODIC_RATE; + tx_thread_sleep(timeout_ticks); + + /* Validate PTP clock timeout. */ + ASSERT_TRUE(ptp_announce_timeout); + + /* Validate ticks elasped for Announce timeout. */ + ASSERT_TRUE((ptp_announce_timeout_tick - ptp_announce_tick) > (timeout_ticks - TX_TIMER_TICKS_PER_SECOND / NX_PTP_CLIENT_TIMER_TICKS_PER_SECOND)); + ASSERT_TRUE((ptp_announce_timeout_tick - ptp_announce_tick) <= timeout_ticks); + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +DELAY_REQUEST_CONTEXT context; +UINT status; + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &sync_ts); + + /* Send follow up. */ + send_follow_up(&generic_socket, &pool_0, &follow_up_ts); + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_WAIT_FOREVER); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &delay_response_ts); +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_api_test.c b/test/regression/ptp_test/netx_ptp_client_api_test.c new file mode 100644 index 00000000..71b5de61 --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_api_test.c @@ -0,0 +1,279 @@ +/* PTP API test. This test case extends the basic test case to cover API not tested by others. */ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_api_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP API Test ............................................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + ASSERT_SUCCESS(status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + ASSERT_SUCCESS(status); +} + + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; +NXD_ADDRESS address; +UCHAR *port_identity; +UINT port_identity_length; +UCHAR priority1, priority2; +UCHAR clock_class, clock_accuracy; +USHORT clock_variance; +UCHAR *grandmaster_identity; +UINT grandmaster_identity_length; +USHORT steps_removed; +UCHAR time_source; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + nx_ptp_client_master_info_get((NX_PTP_CLIENT_MASTER *)event_data, &address, &port_identity, + &port_identity_length, &priority1, &priority2, &clock_class, + &clock_accuracy, &clock_variance, &grandmaster_identity, + &grandmaster_identity_length, &steps_removed, &time_source); + ASSERT_TRUE(address.nxd_ip_address.v4 == IP_ADDRESS(1, 2, 3, 5)); + ASSERT_TRUE(address.nxd_ip_version == NX_IP_VERSION_V4); + ASSERT_TRUE(port_identity_length == NX_PTP_CLOCK_PORT_IDENTITY_SIZE); + ASSERT_SUCCESS(memcmp(port_identity, "\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x01", port_identity_length)); + ASSERT_TRUE(priority1 == 128); + ASSERT_TRUE(priority2 == 128); + ASSERT_TRUE(clock_class == 127); + ASSERT_TRUE(clock_accuracy == 0xfe); + ASSERT_TRUE(clock_variance == 0x7060); + ASSERT_TRUE(grandmaster_identity_length == NX_PTP_CLOCK_IDENTITY_SIZE); + ASSERT_SUCCESS(memcmp(grandmaster_identity, "\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x00", port_identity_length)); + ASSERT_TRUE(steps_removed == 0); + ASSERT_TRUE(time_source == 0xa0); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + break; + } + default: + { + break; + } + } + + return(0); +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PTP_TIME ts_zero = {0}; +NX_PTP_TIME ts_diff = {1, 1, 1}; + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Set expected value. */ + expected_utc_offset = 0x1234; + expected_time.second_high = (delay_response_ts.second_high + follow_up_ts.second_high) / 2; + expected_time.second_low = (delay_response_ts.second_low + follow_up_ts.second_low) / 2; + expected_time.nanosecond = (delay_response_ts.nanosecond + follow_up_ts.nanosecond) / 2; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + nx_ptp_client_soft_clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Set timestamp to all zero. */ + status = nx_ptp_client_time_set(&ptp_client, &ts_zero); + ASSERT_SUCCESS(status); + + /* start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Compare synced time. */ + ASSERT_TRUE(synced_utc_offset == expected_utc_offset); + + /* Set timestamp to all zero when PTP already started. */ + status = nx_ptp_client_time_set(&ptp_client, &ts_zero); + ASSERT_TRUE(status == NX_PTP_CLIENT_ALREADY_STARTED); + + /* Diff time. */ + status = nx_ptp_client_utility_time_diff(&synced_time, &expected_time, &ts_diff); + ASSERT_SUCCESS(status); + ASSERT_TRUE(ts_diff.second_high == 0); + ASSERT_TRUE(ts_diff.second_low == 0); + ASSERT_TRUE(ts_diff.nanosecond / 1000000 <= 1000 / NX_PTP_CLIENT_TIMER_TICKS_PER_SECOND); + + /* Cleanup */ + status = nx_ptp_client_stop(&ptp_client); + ASSERT_SUCCESS(status); + + status = nx_ptp_client_delete(&ptp_client); + ASSERT_SUCCESS(status); + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +DELAY_REQUEST_CONTEXT context; +UINT status; + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &sync_ts); + + /* Send follow up. */ + send_follow_up(&generic_socket, &pool_0, &follow_up_ts); + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_WAIT_FOREVER); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &delay_response_ts); +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_basic_test.c b/test/regression/ptp_test/netx_ptp_client_basic_test.c new file mode 100644 index 00000000..af7121ac --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_basic_test.c @@ -0,0 +1,234 @@ +/* PTP basic test. This test case validates basic procedure of PTP client synchronize. */ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_basic_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP Basic Test ..........................................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + ASSERT_SUCCESS(status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + ASSERT_SUCCESS(status); +} + + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + break; + } + default: + { + break; + } + } + + return(0); +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PTP_TIME ts_diff = {1, 1, 1}; + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Set expected value. */ + expected_utc_offset = 0x1234; + expected_time.second_high = (delay_response_ts.second_high + follow_up_ts.second_high) / 2; + expected_time.second_low = (delay_response_ts.second_low + follow_up_ts.second_low) / 2; + expected_time.nanosecond = (delay_response_ts.nanosecond + follow_up_ts.nanosecond) / 2; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + nx_ptp_client_soft_clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Compare synced time. */ + ASSERT_TRUE(synced_utc_offset == expected_utc_offset); + status = nx_ptp_client_utility_time_diff(&synced_time, &expected_time, &ts_diff); + ASSERT_SUCCESS(status); + ASSERT_TRUE(ts_diff.second_high == 0); + ASSERT_TRUE(ts_diff.second_low == 0); + ASSERT_TRUE(ts_diff.nanosecond / 1000000 <= 1000 / NX_PTP_CLIENT_TIMER_TICKS_PER_SECOND); + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +DELAY_REQUEST_CONTEXT context; +UINT status; + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &sync_ts); + + /* Send follow up. */ + send_follow_up(&generic_socket, &pool_0, &follow_up_ts); + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_WAIT_FOREVER); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &delay_response_ts); +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_calibrate_test.c b/test/regression/ptp_test/netx_ptp_client_calibrate_test.c new file mode 100644 index 00000000..6a9c892c --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_calibrate_test.c @@ -0,0 +1,348 @@ +/* PTP calibrate test. This test case validates calibration of PTP client with different values. */ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; +static UINT test_index; + +TEST_TIMESTAMP test_timestamps[] = +{ + + /* Basic */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x0, 0x0}, /* FollowUp_received */ + {0x0, 0x0, 0x0}, /* DelayRequest */ + }, + + /* offsetFromMaster is 0 */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp_received */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayRequest */ + }, + + /* offsetFromMaster is positive and less than 1s */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp_received */ + {0x0, 0x5F97CD71, 0x2494b710}, /* DelayRequest */ + }, + + /* offsetFromMaster is positive and larger than 1s but need to increase second */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD6F, 0x35efcce0}, /* FollowUp_received */ + {0x0, 0x5F97CD6F, 0x36765a10}, /* DelayRequest */ + }, + + /* offsetFromMaster is positive and less than 1s but the nanosecond will overflow */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD70, 0x35efcce0}, /* FollowUp_received */ + {0x0, 0x5F97CD70, 0x36765a10}, /* DelayRequest */ + }, + + /* offsetFromMaster is negative and less than 1s */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD71, 0x240e29f0}, /* FollowUp_received */ + {0x0, 0x5F97CD71, 0x2494b740}, /* DelayRequest */ + }, + + /* offsetFromMaster is negative and larger than 1s but need to decrease second */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD73, 0x3b4d1760}, /* FollowUp_received */ + {0x0, 0x5F97CD74, 0x00000040}, /* DelayRequest */ + }, + + /* offsetFromMaster is negative and less than 1s but need to decrease second */ + { + {0x0, 0x0, 0x0}, /* Sync */ + {0x0, 0x5F97CD71, 0x240e29e0}, /* FollowUp */ + {0x0, 0x5F97CD71, 0x2494b730}, /* DelayResponse */ + {0x0, 0x5F97CD71, 0x3b4d1760}, /* FollowUp_received */ + {0x0, 0x5F97CD72, 0x00000040}, /* DelayRequest */ + }, +}; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_calibrate_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP Calibrate Test ......................................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _netx_ptp_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + ASSERT_SUCCESS(status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + ASSERT_SUCCESS(status); +} + + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + break; + } + default: + { + break; + } + } + + return(0); +} + +/* Hijack callback function to modify timestamp. */ +static UINT clock_callback(NX_PTP_CLIENT *client_ptr, UINT operation, + NX_PTP_TIME *time_ptr, NX_PACKET *packet_ptr, + VOID *callback_data) +{ + if (operation == NX_PTP_CLIENT_CLOCK_PACKET_TS_PREPARE) + { + + /* Update DelayRequest timestamp. */ + clock_callback(client_ptr, NX_PTP_CLIENT_CLOCK_SET, + &test_timestamps[test_index].delay_request, NX_NULL, callback_data); + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + return(_netx_ptp_clock_callback(client_ptr, operation, time_ptr, packet_ptr, callback_data)); +#else + return(nx_ptp_client_soft_clock_callback(client_ptr, operation, time_ptr, packet_ptr, callback_data)); +#endif +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + for (test_index = 0; test_index < sizeof(test_timestamps) / sizeof(TEST_TIMESTAMP); test_index++) + { + + /* Start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Set expected value. */ + expected_utc_offset = 0x1234 + test_index; + calibrate_timestamp(&test_timestamps[test_index], &expected_time); + + /* Wake up server thread. */ + tx_thread_resume(&ntest_1); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Compare synced time. */ + ASSERT_TRUE(synced_utc_offset == expected_utc_offset); + ASSERT_SUCCESS(memcmp(&synced_time, &expected_time, sizeof(expected_time))); + + /* Stop the PTP client */ + status = nx_ptp_client_stop(&ptp_client); + ASSERT_SUCCESS(status); + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +DELAY_REQUEST_CONTEXT context; +UINT status; +UINT i; +UINT priority; + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + for (i = 0; i < sizeof(test_timestamps) / sizeof(TEST_TIMESTAMP); i++) + { + + /* Suspend current thread and wait for client thread. */ + tx_thread_suspend(tx_thread_identify()); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + /* Set the timestamp of FollowUp received. */ + clock_callback(&ptp_client, NX_PTP_CLIENT_CLOCK_SET, + &test_timestamps[i].sync_received, NX_NULL, NX_NULL); + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &test_timestamps[i].sync); + + /* Send follow up. */ + send_follow_up(&generic_socket, &pool_0, &test_timestamps[i].follow_up); + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_WAIT_FOREVER); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &test_timestamps[i].delay_response); + } +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_ipv6_test.c b/test/regression/ptp_test/netx_ptp_client_ipv6_test.c new file mode 100644 index 00000000..de3cea03 --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_ipv6_test.c @@ -0,0 +1,260 @@ +/* PTP IPv6 test. This test case validates PTP client synchronize over IPv6. + To run this test case, NetXDuo must be built with NX_ENABLE_IPV6_MULTICAST and FEATURE_NX_IPV6. +*/ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_ipv6_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP IPv6 Test ............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + ASSERT_SUCCESS(status); + +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) + /* Enable IPv6 for both IP instances. */ + status = nxd_ipv6_enable(&ip_0); + status += nxd_ipv6_enable(&ip_1); + + /* Check IPv6 enable status. */ + ASSERT_SUCCESS(status); + + /* Enable ICMPv6 processing for both IP instances. */ + status = nxd_icmp_enable(&ip_0); + status += nxd_icmp_enable(&ip_1); + + /* Check ICMPv6 enable status. */ + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + ASSERT_SUCCESS(status); +#endif +} + +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + break; + } + default: + { + break; + } + } + + return(0); +} +#endif + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) +UINT status; +NX_PTP_TIME ts_diff = {1, 1, 1}; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep for DAD. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Set expected value. */ + expected_utc_offset = 0x1234; + expected_time.second_high = (delay_response_ts.second_high + follow_up_ts.second_high) / 2; + expected_time.second_low = (delay_response_ts.second_low + follow_up_ts.second_low) / 2; + expected_time.nanosecond = (delay_response_ts.nanosecond + follow_up_ts.nanosecond) / 2; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + nx_ptp_client_soft_clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Compare synced time. */ + ASSERT_TRUE(synced_utc_offset == expected_utc_offset); + status = nx_ptp_client_utility_time_diff(&synced_time, &expected_time, &ts_diff); + ASSERT_SUCCESS(status); + ASSERT_TRUE(ts_diff.second_high == 0); + ASSERT_TRUE(ts_diff.second_low == 0); + ASSERT_TRUE(ts_diff.nanosecond / 1000000 <= 1000 / NX_PTP_CLIENT_TIMER_TICKS_PER_SECOND); +#endif + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) +DELAY_REQUEST_CONTEXT context; +UINT status; + + /* Set the IPv6 address. */ + status = nxd_ipv6_address_set(&ip_1, 0, NX_NULL, 10, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep for DAD. */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Set data through IPv6. */ + set_ip_version(NX_IP_VERSION_V6); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &sync_ts); + + /* Send follow up. */ + send_follow_up(&generic_socket, &pool_0, &follow_up_ts); + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_WAIT_FOREVER); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &delay_response_ts); +#endif +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_master_selection_test.c b/test/regression/ptp_test/netx_ptp_client_master_selection_test.c new file mode 100644 index 00000000..a17a6268 --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_master_selection_test.c @@ -0,0 +1,322 @@ +/* PTP master selection test. This test case validates, + 1. Event master will be triggered when different utc offset is announced. + 2. Master clock port identity must be same during sync. + 3. Master clock port can be changed after timeout. +*/ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_basic_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP Master Selection Test ................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + ASSERT_SUCCESS(status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + ASSERT_SUCCESS(status); +} + + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + break; + } + default: + { + break; + } + } + + return(0); +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +UINT i; +NX_PTP_TIME ts_zero = {0}; +UINT timeout_ticks; + + /* Set expected value. */ + expected_utc_offset = 0x1234; + expected_time.second_high = (delay_response_ts.second_high + follow_up_ts.second_high) / 2; + expected_time.second_low = (delay_response_ts.second_low + follow_up_ts.second_low) / 2; + expected_time.nanosecond = (delay_response_ts.nanosecond + follow_up_ts.nanosecond) / 2; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + nx_ptp_client_soft_clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + for (i = 0; i < 3; i++) + { + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + if (i < 2) + { + + /* start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + } + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Wake up server thread. */ + tx_thread_resume(&ntest_1); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Compare synced time. */ + if (i == 1) + { + + /* Time not synched. */ + ASSERT_TRUE(synced_utc_offset == 0xFFFF); + ASSERT_SUCCESS(memcmp(&synced_time, &ts_zero, sizeof(ts_zero))); + } + else + { + + /* Time synched. */ + ASSERT_TRUE(synced_utc_offset == expected_utc_offset); + ASSERT_SUCCESS(memcmp(&synced_time, &expected_time, sizeof(expected_time))); + } + + if (i == 0) + { + + /* Wake up server thread to send another Announce. */ + tx_thread_resume(&ntest_1); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + ASSERT_TRUE(synced_utc_offset == (expected_utc_offset + 1)); + + /* Stop the PTP client */ + status = nx_ptp_client_stop(&ptp_client); + ASSERT_SUCCESS(status); + } + else if (i == 1) + { + + /* Sleep until timeout. */ + timeout_ticks = NX_PTP_CLIENT_ANNOUNCE_RECEIPT_TIMEOUT * + (1 << NX_PTP_CLIENT_LOG_ANNOUNCE_INTERVAL) * + NX_IP_PERIODIC_RATE; + tx_thread_sleep(timeout_ticks); + } + } + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +DELAY_REQUEST_CONTEXT context; +UINT status; +UINT i; + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + for (i = 0; i < 3; i++) + { + + /* Suspend current thread and wait for client thread. */ + tx_thread_suspend(tx_thread_identify()); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + if (i == 1) + { + + /* Change the clock identify. */ + set_clock_id((UCHAR *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99"); + } + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &sync_ts); + + /* Send follow up. */ + send_follow_up(&generic_socket, &pool_0, &follow_up_ts); + + if (i == 1) + { + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_IP_PERIODIC_RATE); + ASSERT_TRUE(status == NX_NO_PACKET); + continue; + } + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_IP_PERIODIC_RATE); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &delay_response_ts); + + if (i == 0) + { + + /* Suspend current thread and wait for client thread. */ + tx_thread_suspend(tx_thread_identify()); + + /* Send another Announce with different utc offset. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset + 1); + } + } +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_client_two_steps_off_test.c b/test/regression/ptp_test/netx_ptp_client_two_steps_off_test.c new file mode 100644 index 00000000..f61c48c8 --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_client_two_steps_off_test.c @@ -0,0 +1,234 @@ +/* PTP two steps off test. This test case validates two steps off procedure of PTP client synchronize. */ + +#include "netx_ptp_utility.h" + +#define DEMO_STACK_SIZE 2048 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET generic_socket; +static NX_UDP_SOCKET event_socket; +static NX_PTP_CLIENT ptp_client; + +static NX_PTP_TIME sync_ts = {0x0, 0x5F97CD71, 0x240d93b2}; +static NX_PTP_TIME follow_up_ts = {0x0, 0x5F97CD71, 0x240e29e0}; +static NX_PTP_TIME delay_response_ts = {0x0, 0x5F97CD71, 0x2494b730}; +static NX_PTP_TIME synced_time; +static NX_PTP_TIME expected_time; +static USHORT synced_utc_offset; +static USHORT expected_utc_offset; +static UCHAR ptp_stack[2048]; + + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_ptp_client_two_steps_off_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: PTP Two Steps Off Test ..................................."); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the main thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + + if(status) + ASSERT_SUCCESS(status); + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + + if(status) + ASSERT_SUCCESS(status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check ARP enable status. */ + if(status) + ASSERT_SUCCESS(status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + + /* Check UDP enable status. */ + if(status) + ASSERT_SUCCESS(status); +} + + +/* PTP handler. */ +static UINT ptp_event_callback(NX_PTP_CLIENT *ptp_client_ptr, UINT event, VOID *event_data, VOID *callback_data) +{ +NX_PTP_DATE_TIME date; + + NX_PARAMETER_NOT_USED(callback_data); + + switch (event) + { + case NX_PTP_CLIENT_EVENT_MASTER: + { + DBGPRINTF("new MASTER clock!\r\n"); + break; + } + + case NX_PTP_CLIENT_EVENT_SYNC: + { + nx_ptp_client_sync_info_get((NX_PTP_CLIENT_SYNC *)event_data, NX_NULL, &synced_utc_offset); + DBGPRINTF("SYNC event: utc offset=%d\r\n", synced_utc_offset); + + /* read the PTP clock */ + nx_ptp_client_time_get(ptp_client_ptr, &synced_time); + + /* convert PTP time to UTC date and time */ + nx_ptp_client_utility_convert_time_to_date(&synced_time, -synced_utc_offset, &date); + + /* display the current time */ + DBGPRINTF("ts: %d%d.%d\r\n", synced_time.second_high, + synced_time.second_low, + synced_time.nanosecond); + DBGPRINTF("%2u/%02u/%u %02u:%02u:%02u.%09lu\r\n", date.day, date.month, date.year, + date.hour, date.minute, date.second, + date.nanosecond); + + break; + } + + case NX_PTP_CLIENT_EVENT_TIMEOUT: + { + DBGPRINTF("Master clock TIMEOUT!\r\n"); + break; + } + default: + { + break; + } + } + + return(0); +} + +/* Define the test threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NX_PTP_TIME ts_diff = {1, 1, 1}; + + /* Reset synced time. */ + memset(&synced_time, 0, sizeof(synced_time)); + synced_utc_offset = 0xFFFF; + + /* Set expected value. */ + expected_utc_offset = 0x1234; + expected_time.second_high = (delay_response_ts.second_high + sync_ts.second_high) / 2; + expected_time.second_low = (delay_response_ts.second_low + sync_ts.second_low) / 2; + expected_time.nanosecond = (delay_response_ts.nanosecond + sync_ts.nanosecond) / 2; + + /* Create the PTP client instance */ + status = nx_ptp_client_create(&ptp_client, &ip_0, 0, &pool_0, + 2, ptp_stack, sizeof(ptp_stack), + nx_ptp_client_soft_clock_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* start the PTP client */ + status = nx_ptp_client_start(&ptp_client, NX_NULL, 0, 0, 0, ptp_event_callback, NX_NULL); + ASSERT_SUCCESS(status); + + /* Sleep 5 seconds for sync up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Compare synced time. */ + ASSERT_TRUE(synced_utc_offset == expected_utc_offset); + status = nx_ptp_client_utility_time_diff(&synced_time, &expected_time, &ts_diff); + ASSERT_SUCCESS(status); + ASSERT_TRUE(ts_diff.second_high == 0); + ASSERT_TRUE(ts_diff.second_low == 0); + ASSERT_TRUE(ts_diff.nanosecond / 1000000 <= 1000 / NX_PTP_CLIENT_TIMER_TICKS_PER_SECOND); + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This thread acts as PTP server, accepting the connection. */ +static void ntest_1_entry(ULONG thread_input) +{ +DELAY_REQUEST_CONTEXT context; +UINT status; + + create_socket(&ip_1, &generic_socket, PTP_GENERAL_UDP_PORT); + create_socket(&ip_1, &event_socket, PTP_EVENT_UDP_PORT); + + /* Sleep 1 second to wait for PTP thread running. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Set two steps off. */ + set_two_steps(NX_FALSE); + + /* Send announce. */ + send_announce(&generic_socket, &pool_0, expected_utc_offset); + + /* Send sync. */ + send_sync(&event_socket, &pool_0, &sync_ts); + + /* Wait for delay request. */ + status = receive_delay_request(&event_socket, &context, NX_WAIT_FOREVER); + ASSERT_SUCCESS(status); + + /* Send delay response. */ + send_delay_response(&generic_socket, &pool_0, &context, &delay_response_ts); +} \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_utility.c b/test/regression/ptp_test/netx_ptp_utility.c new file mode 100644 index 00000000..a6f384ac --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_utility.c @@ -0,0 +1,526 @@ + +#include "netx_ptp_utility.h" + +#define NANOSECONDS_PER_SEC 1000000000L + +extern VOID _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* +Precision Time Protocol (IEEE1588) + 0000 .... = transportSpecific: 0x0 + .... 1011 = messageId: Announce Message (0xb) + 0000 .... = Reserved: 0 + .... 0010 = versionPTP: 2 + messageLength: 64 + subdomainNumber: 0 + Reserved: 0 + flags: 0x0000 + correction: 0.000000 nanoseconds + Reserved: 0 + ClockIdentity: 0x46e7c8fffe7161a1 + SourcePortID: 1 + sequenceId: 61 + control: Other Message (5) + logMessagePeriod: 1 + originTimestamp (seconds): 0 + originTimestamp (nanoseconds): 0 + originCurrentUTCOffset: 0 + priority1: 128 + grandmasterClockClass: 127 + grandmasterClockAccuracy: Accuracy Unknown (0xfe) + grandmasterClockVariance: 28768 + priority2: 128 + grandmasterClockIdentity: 0x46e7c8fffe7161a1 + localStepsRemoved: 0 + TimeSource: INTERNAL_OSCILLATOR (0xa0) +*/ +static UCHAR announce_data[] = \ +"\x0b\x02\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \ +"\x00\x00\x00\x00\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x01\x00\x3d" \ +"\x05\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x22\x80" \ +"\x7f\xfe\x70\x60\x80\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x00\xa0"; + +/* +Precision Time Protocol (IEEE1588) + 0000 .... = transportSpecific: 0x0 + .... 0000 = messageId: Sync Message (0x0) + 0000 .... = Reserved: 0 + .... 0010 = versionPTP: 2 + messageLength: 44 + subdomainNumber: 0 + Reserved: 0 + flags: 0x0200 + correction: 0.000000 nanoseconds + Reserved: 0 + ClockIdentity: 0x46e7c8fffe7161a1 + SourcePortID: 1 + sequenceId: 123 + control: Sync Message (0) + logMessagePeriod: 0 + originTimestamp (seconds): 1603784044 + originTimestamp (nanoseconds): 604899854 +*/ +static UCHAR sync_data[] = \ +"\x00\x02\x00\x2c\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00" \ +"\x00\x00\x00\x00\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x01\x00\x7b" \ +"\x00\x00\x00\x00\x5f\x97\xcd\x6c\x24\x0e\x0a\x0e"; + +/* +Precision Time Protocol (IEEE1588) + 0000 .... = transportSpecific: 0x0 + .... 1000 = messageId: Follow_Up Message (0x8) + 0000 .... = Reserved: 0 + .... 0010 = versionPTP: 2 + messageLength: 44 + subdomainNumber: 0 + Reserved: 0 + flags: 0x0400 + correction: 0.000000 nanoseconds + Reserved: 0 + ClockIdentity: 0x46e7c8fffe7161a1 + SourcePortID: 1 + sequenceId: 123 + control: Follow_Up Message (2) + logMessagePeriod: 0 + preciseOriginTimestamp (seconds): 1603784044 + preciseOriginTimestamp (nanoseconds): 604908000 +*/ +static UCHAR follow_up_data[] = \ +"\x08\x02\x00\x2c\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00" \ +"\x00\x00\x00\x00\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x01\x00\x7b" \ +"\x02\x00\x00\x00\x5f\x97\xcd\x6c\x24\x0e\x29\xe0"; + +/* +Precision Time Protocol (IEEE1588) + 0000 .... = transportSpecific: 0x0 + .... 1001 = messageId: Delay_Resp Message (0x9) + 0000 .... = Reserved: 0 + .... 0010 = versionPTP: 2 + messageLength: 54 + subdomainNumber: 0 + Reserved: 0 + flags: 0x0000 + correction: 0.000000 nanoseconds + Reserved: 0 + ClockIdentity: 0x46e7c8fffe7161a1 + SourcePortID: 1 + sequenceId: 1 + control: Delay_Resp Message (3) + logMessagePeriod: 0 + receiveTimestamp (seconds): 1603784044 + receiveTimestamp (nanoseconds): 613726000 + requestingSourcePortIdentity: 0x001122fffe334457 + requestingSourcePortId: 1 +*/ +static UCHAR delay_resp_data[] = \ +"\x09\x02\x00\x36\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \ +"\x00\x00\x00\x00\x46\xe7\xc8\xff\xfe\x71\x61\xa1\x00\x01\x00\x01" \ +"\x03\x00\x00\x00\x5f\x97\xcd\x6c\x24\x94\xb7\x30\x00\x11\x22\xff" \ +"\xfe\x33\x44\x57\x00\x01"; + +static UCHAR use_two_steps = NX_TRUE; +static NX_PTP_CLIENT *ptp_client_ptr = NX_NULL; +static NX_PTP_TIME ptp_timestamp = {0}; +static UCHAR use_ipv4 = NX_TRUE; + +static VOID send_udp_data(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, + UINT port, UCHAR *data, UINT size) +{ +NX_PACKET *packet_ptr; +UINT status; +#ifndef NX_DISABLE_IPV6 +NXD_ADDRESS ipv6_addr; +#endif + + /* Allocate a packet. */ + status = nx_packet_allocate(pool_ptr, &packet_ptr, NX_UDP_PACKET, NX_NO_WAIT); + ASSERT_SUCCESS(status); + + /* Append announce data. */ + status = nx_packet_data_append(packet_ptr, data, size, pool_ptr, NX_NO_WAIT); + ASSERT_SUCCESS(status); + + /* Send out the packet. */ + if (use_ipv4) + { + status = nx_udp_socket_send(socket_ptr, packet_ptr, PTP_IPV4_MULTICAST_ADDR, port); + } +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) + else + { + PTP_IPV6_MULTICAST_ADDR_SET(&ipv6_addr); + status = nxd_udp_socket_send(socket_ptr, packet_ptr, &ipv6_addr, port); + } +#endif + + ASSERT_SUCCESS(status); +} + +static VOID fill_timestamp(UCHAR *buffer, NX_PTP_TIME *ts) +{ + buffer[0] = (ts -> second_high >> 8) & 0xFF; + buffer[1] = ts -> second_high & 0xFF; + buffer[2] = (ts -> second_low >> 24) & 0xFF; + buffer[3] = (ts -> second_low >> 16) & 0xFF; + buffer[4] = (ts -> second_low >> 8) & 0xFF; + buffer[5] = ts -> second_low & 0xFF; + buffer[6] = (ts -> nanosecond >> 24) & 0xFF; + buffer[7] = (ts -> nanosecond >> 16) & 0xFF; + buffer[8] = (ts -> nanosecond >> 8) & 0xFF; + buffer[9] = ts -> nanosecond & 0xFF; +} + +VOID create_socket(NX_IP *ip_ptr, NX_UDP_SOCKET *socket_ptr, UINT port) +{ +UINT status; +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) +NXD_ADDRESS ipv6_addr; +#endif + + /* Create a UDP socket. */ + status = nx_udp_socket_create(ip_ptr, socket_ptr, "UDP Socket", NX_IP_NORMAL, + NX_FRAGMENT_OKAY, 0x80, 5); + ASSERT_SUCCESS(status); + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(socket_ptr, port, NX_NO_WAIT); + ASSERT_SUCCESS(status); + + /* Join multicast group. */ + status = nx_ipv4_multicast_interface_join(ip_ptr, PTP_IPV4_MULTICAST_ADDR, 0); + ASSERT_SUCCESS(status); + +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) + PTP_IPV6_MULTICAST_ADDR_SET(&ipv6_addr); + status = nxd_ipv6_multicast_interface_join(ip_ptr, &ipv6_addr, 0); + ASSERT_SUCCESS(status); +#endif +} + +VOID send_announce(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, USHORT utc_offset) +{ + + /* Adjust utc offset. */ + NX_CHANGE_USHORT_ENDIAN(utc_offset); + memcpy(&announce_data[44], &utc_offset, sizeof(utc_offset)); + + /* Send out announce packet. */ + send_udp_data(socket_ptr, pool_ptr, PTP_GENERAL_UDP_PORT, + announce_data, sizeof(announce_data)); +} + +VOID send_sync(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, NX_PTP_TIME *ts) +{ + if (use_two_steps) + { + sync_data[6] |= 0x2; + } + else + { + sync_data[6] &= 0xFD; + } + + + /* Adjust timestamp. */ + fill_timestamp(&sync_data[34], ts); + + /* Send out sync packet. */ + send_udp_data(socket_ptr, pool_ptr, PTP_EVENT_UDP_PORT, + sync_data, sizeof(sync_data)); +} + +VOID send_follow_up(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, NX_PTP_TIME *ts) +{ + + /* Adjust timestamp. */ + fill_timestamp(&follow_up_data[34], ts); + + /* Send out follow up packet. */ + send_udp_data(socket_ptr, pool_ptr, PTP_GENERAL_UDP_PORT, + follow_up_data, sizeof(follow_up_data)); +} + +VOID send_delay_response(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, + DELAY_REQUEST_CONTEXT *context, NX_PTP_TIME *ts) +{ + + /* Adjust timestamp. */ + fill_timestamp(&delay_resp_data[34], ts); + + /* Adjust clock ID and sequence ID. */ + memcpy(&delay_resp_data[30], context -> sequence_id, 2); + + memcpy(&delay_resp_data[sizeof(delay_resp_data) - 11], context -> clock_id, + NX_PTP_CLOCK_PORT_IDENTITY_SIZE); + + /* Send out delay resp packet. */ + send_udp_data(socket_ptr, pool_ptr, PTP_GENERAL_UDP_PORT, + delay_resp_data, sizeof(delay_resp_data)); +} + +UINT receive_delay_request(NX_UDP_SOCKET *socket_ptr, DELAY_REQUEST_CONTEXT *context, + UINT wait_option) +{ +NX_PACKET *packet_ptr; +NXD_ADDRESS ip_address; +ULONG bytes_copied; +UINT port; +UINT status; + + + status = nx_udp_socket_receive(socket_ptr, &packet_ptr, wait_option); + if (status) + { + return(status); + } + + status = nxd_udp_source_extract(packet_ptr, &ip_address, &port); + ASSERT_SUCCESS(status); + ASSERT_TRUE(port == PTP_EVENT_UDP_PORT); + + status = nx_packet_data_extract_offset(packet_ptr, 20, context -> clock_id, + NX_PTP_CLOCK_PORT_IDENTITY_SIZE, + &bytes_copied); + ASSERT_SUCCESS(status); + ASSERT_TRUE(bytes_copied == NX_PTP_CLOCK_PORT_IDENTITY_SIZE); + + status = nx_packet_data_extract_offset(packet_ptr, 30, context -> sequence_id, + 2, &bytes_copied); + ASSERT_SUCCESS(status); + ASSERT_TRUE(bytes_copied == 2); + + return(NX_SUCCESS); +} + + +VOID set_two_steps(UCHAR two_steps) +{ + use_two_steps = two_steps; +} + + +VOID set_clock_id(UCHAR *clock_id) +{ + + /* Adjust clock ID. */ + memcpy(&announce_data[20], clock_id, NX_PTP_CLOCK_PORT_IDENTITY_SIZE); + memcpy(&sync_data[20], clock_id, NX_PTP_CLOCK_PORT_IDENTITY_SIZE); + memcpy(&follow_up_data[20], clock_id, NX_PTP_CLOCK_PORT_IDENTITY_SIZE); + memcpy(&delay_resp_data[20], clock_id, NX_PTP_CLOCK_PORT_IDENTITY_SIZE); +} + + +VOID set_ip_version(UCHAR ip_version) +{ + if (ip_version == NX_IP_VERSION_V4) + { + use_ipv4 = NX_TRUE; + } +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) + else + { + use_ipv4 = NX_FALSE; + } +#endif +} + + +VOID calibrate_timestamp(TEST_TIMESTAMP *test_ts, NX_PTP_TIME *ts) +{ +ULONG64 second_low; +ULONG64 carry; +long long nanosecond; +NX_PTP_TIME *t1; + + /* Means of following symbols, + t1 is timestamp of Sync if two step is disabled, + or else, it is timestamp of FollowUp. + t2 is timestamp of Sync received. + t3 is timestamp of DelayRequest sent. Also equals client_clock in the test + t4 is timestamp of DelayRequest in DelayResponse packet. + + meanPathDelay between client and server is, + [(t2-t1)+(t4-t3)]/2 + + offsetFromMaster = client_clock - master_clock + = t2 - t1 - meanPathDelay - correctionField + + master_clock = [(t4+t3)-(t2-t1)]/2 + + Note, The recommendation that the timestamps themselves be + the best possible estimate of the time enables simple devices + that only need approximate time to ignore the correctionField. + */ + + if ((test_ts -> follow_up.second_high == 0) && + (test_ts -> follow_up.second_low == 0) && + (test_ts -> follow_up.nanosecond == 0)) + { + + /* No FollowUp timestamp. Use Sync timestamp. */ + t1 = &test_ts -> sync; + } + else + { + + /* Use FollowUp timestamp. */ + t1 = &test_ts -> follow_up; + } + + ts -> second_high = (test_ts -> delay_response.second_high + test_ts -> delay_request.second_high) - + (test_ts -> sync_received.second_high - t1 -> second_high); + if (ts -> second_high & 1) + { + carry = 0x100000000; + } + else + { + carry = 0; + } + ts -> second_high /= 2; + + second_low = carry + ((ULONG64)test_ts -> delay_response.second_low + (ULONG64)test_ts -> delay_request.second_low) - + ((ULONG64)test_ts -> sync_received.second_low - (ULONG64)t1 -> second_low); + if (second_low & 1) + { + carry = NANOSECONDS_PER_SEC; + } + else + { + carry = 0; + } + second_low /= 2; + + nanosecond = (carry + ((long long)test_ts -> delay_response.nanosecond + (long long)test_ts -> delay_request.nanosecond) - + ((long long)test_ts -> sync_received.nanosecond - (long long)t1 -> nanosecond)) / 2; + + /* Adjust according to carry. */ + while (nanosecond >= NANOSECONDS_PER_SEC) + { + nanosecond -= NANOSECONDS_PER_SEC; + second_low++; + } + + if (nanosecond < 0) + { + nanosecond += NANOSECONDS_PER_SEC; + if (second_low == 0) + { + ts -> second_high--; + second_low = 0xFFFFFFFF; + } + else + { + second_low--; + } + + } + + while (second_low > 0xFFFFFFFF) + { + second_low -= 0xFFFFFFFF; + ts -> second_high++; + } + + ts -> second_low = (ULONG)second_low; + ts -> nanosecond = (LONG)nanosecond; +} + +VOID _netx_ptp_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req) +{ +NX_PACKET *packet_ptr; + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if (driver_req -> nx_ip_driver_command == NX_LINK_PACKET_SEND) + { + packet_ptr = driver_req -> nx_ip_driver_packet; + if (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_PTP_TIMESTAMP) + { + + /* call notification callback */ + nx_ptp_client_packet_timestamp_notify(ptp_client_ptr, packet_ptr, &ptp_timestamp); + } + } +#endif + + _nx_ram_network_driver(driver_req); +} + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY +UINT _netx_ptp_clock_callback(NX_PTP_CLIENT *client_ptr, UINT operation, + NX_PTP_TIME *time_ptr, NX_PACKET *packet_ptr, + VOID *callback_data) +{ + + NX_PARAMETER_NOT_USED(callback_data); + + switch (operation) + { + + /* Save pointer to PTP client. */ + case NX_PTP_CLIENT_CLOCK_INIT: + ptp_client_ptr = client_ptr; + break; + + /* Set clock. */ + case NX_PTP_CLIENT_CLOCK_SET: + ptp_timestamp = *time_ptr; + break; + + /* Extract timestamp from packet. */ + case NX_PTP_CLIENT_CLOCK_PACKET_TS_EXTRACT: + *time_ptr = ptp_timestamp; + break; + + /* Get clock. */ + case NX_PTP_CLIENT_CLOCK_GET: + *time_ptr = ptp_timestamp; + break; + + /* Adjust clock. */ + case NX_PTP_CLIENT_CLOCK_ADJUST: + ptp_timestamp.nanosecond += time_ptr -> nanosecond; + if (ptp_timestamp.nanosecond >= NANOSECONDS_PER_SEC) + { + ptp_timestamp.nanosecond -= NANOSECONDS_PER_SEC; + if (ptp_timestamp.second_low == 0xFFFFFFFF) + { + ptp_timestamp.second_high++; + ptp_timestamp.second_low = 0; + } + else + { + ptp_timestamp.second_low++; + } + } + else if (ptp_timestamp.nanosecond < 0) + { + ptp_timestamp.nanosecond += NANOSECONDS_PER_SEC; + if (ptp_timestamp.second_low == 0) + { + ptp_timestamp.second_high--; + ptp_timestamp.second_low = 0xFFFFFFFF; + } + else + { + ptp_timestamp.second_low--; + } + } + break; + + /* Prepare timestamp for current packet. */ + case NX_PTP_CLIENT_CLOCK_PACKET_TS_PREPARE: + packet_ptr -> nx_packet_interface_capability_flag |= NX_INTERFACE_CAPABILITY_PTP_TIMESTAMP; + break; + + /* Update soft timer. */ + case NX_PTP_CLIENT_CLOCK_SOFT_TIMER_UPDATE: + break; + + default: + return(NX_PTP_PARAM_ERROR); + } + + return(NX_SUCCESS); +} +#endif \ No newline at end of file diff --git a/test/regression/ptp_test/netx_ptp_utility.h b/test/regression/ptp_test/netx_ptp_utility.h new file mode 100644 index 00000000..88eda3bd --- /dev/null +++ b/test/regression/ptp_test/netx_ptp_utility.h @@ -0,0 +1,70 @@ +#ifndef TEST_UTILITY_H +#define TEST_UTILITY_H + +#include "nxd_ptp_client.h" + +void test_control_return(UINT status); + +#ifdef DEBUG +#define DBGPRINTF(...) printf(##__VA_ARGS__) +#else +#define DBGPRINTF(...) +#endif + +#define ASSERT_DEBUG(c) printf("\n[%s:%d]Assert fail: %s\n", __FILE__, __LINE__, (c)); +#define ASSERT_TRUE(p) {if (!(p)) {ASSERT_DEBUG(#p);test_control_return(1);}} +#define ASSERT_SUCCESS(v) ASSERT_TRUE((v) == 0) + +/* Define the UDP ports */ +#define PTP_EVENT_UDP_PORT 319 +#define PTP_GENERAL_UDP_PORT 320 + +/* Define the IPv4 multicast address "224.0.1.129" */ +#define PTP_IPV4_MULTICAST_ADDR IP_ADDRESS(224,0,1,129) + +/* Define the IPv6 multicast address "ff0e::181" */ +#define PTP_IPV6_MULTICAST_ADDR_SET(x) { \ + (x) -> nxd_ip_version = NX_IP_VERSION_V6; \ + (x) -> nxd_ip_address.v6[0] = 0xff0e0000UL; \ + (x) -> nxd_ip_address.v6[1] = 0; \ + (x) -> nxd_ip_address.v6[2] = 0; \ + (x) -> nxd_ip_address.v6[3] = 0x181; } + +typedef struct +{ + + /* Timestamp from master. */ + NX_PTP_TIME sync; + NX_PTP_TIME follow_up; + NX_PTP_TIME delay_response; + + /* Timestamp from client. */ + NX_PTP_TIME sync_received; + NX_PTP_TIME delay_request; +} TEST_TIMESTAMP; + +typedef struct +{ + UCHAR clock_id[NX_PTP_CLOCK_PORT_IDENTITY_SIZE]; + UCHAR sequence_id[2]; +} DELAY_REQUEST_CONTEXT; + + +VOID create_socket(NX_IP *ip_ptr, NX_UDP_SOCKET *socket_ptr, UINT port); +VOID send_announce(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, USHORT utc_offset); +VOID send_sync(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, NX_PTP_TIME *ts); +VOID send_follow_up(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, NX_PTP_TIME *ts); +VOID send_delay_response(NX_UDP_SOCKET *socket_ptr, NX_PACKET_POOL *pool_ptr, + DELAY_REQUEST_CONTEXT *context, NX_PTP_TIME *ts); +UINT receive_delay_request(NX_UDP_SOCKET *socket_ptr, DELAY_REQUEST_CONTEXT *context, + UINT wait_option); +VOID set_two_steps(UCHAR two_steps); +VOID set_clock_id(UCHAR *clock_id); +VOID set_ip_version(UCHAR ip_version); +VOID calibrate_timestamp(TEST_TIMESTAMP *test_ts, NX_PTP_TIME *ts); +VOID _netx_ptp_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +UINT _netx_ptp_clock_callback(NX_PTP_CLIENT *client_ptr, UINT operation, + NX_PTP_TIME *time_ptr, NX_PACKET *packet_ptr, + VOID *callback_data); + +#endif /* TEST_UTILITY_H */ \ No newline at end of file diff --git a/test/regression/rtp_test/netx_rtcp_abnormal_packet_test.c b/test/regression/rtp_test/netx_rtcp_abnormal_packet_test.c new file mode 100644 index 00000000..66d809dc --- /dev/null +++ b/test/regression/rtp_test/netx_rtcp_abnormal_packet_test.c @@ -0,0 +1,337 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; + +/* Define the counters used in the test application... */ +static TX_SEMAPHORE semaphore_test_done; + +typedef struct PACKET_DATA_STRUCT{ + UCHAR *data; + ULONG length; +}PACKET_DATA; + +/* Define RTCP packet for testing. +--receiver report-- + version: RFC 1899 Version (2) + padding: True + reception report count: 1 + packet type: receiver report (201) + length: 7 + sender ssrc: 1052681868 + source 1: + identifier: 11478 + fraction lost: 255 + cumulative number of packets lost: -1 + extended highest sequence number received: 94974 + interarrival jitter: 444 + last SR timestamp: 0 + delay since last SR timestamp: 0 +--source description-- + version: RFC 1899 Version (2) + padding: False + source count: 1 + packet type: source description (202) + length: 5 + chunk 1: + indentifier: 1052681868 + sdes item: + type: CNAME (1) + length:13 + text: cn-test-cname + type: END (0) +*/ + +/* Invalid padding value. */ +static UCHAR test_rtcp_packet_data_0[]={ +0xa1, 0xc9, 0x00, 0x07, 0x3e, 0xbe, 0xa6, 0x8c, 0x00, 0x00, 0x2c, 0xd6, 0xff, 0xff, 0xff, 0xff, +0x00, 0x01, 0x72, 0xfe, 0x00, 0x00, 0x01, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid RTCP packet type. */ +static UCHAR test_rtcp_packet_data_1[]={ +0x81, 0x00, 0x00, 0x07, 0x3e, 0xbe, 0xa6, 0x8c, 0x00, 0x00, 0x2c, 0xd6, 0xff, 0xff, 0xff, 0xff, +0x00, 0x01, 0x72, 0xfe, 0x00, 0x00, 0x01, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid RR packet type version. */ +static UCHAR test_rtcp_packet_data_2[]={ +0x71, 0xc9, 0x00, 0x07, 0x3e, 0xbe, 0xa6, 0x8c, 0x00, 0x00, 0x2c, 0xd6, 0xff, 0xff, 0xff, 0xff, +0x00, 0x01, 0x72, 0xfe, 0x00, 0x00, 0x01, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid RR packet length. */ +static UCHAR test_rtcp_packet_data_3[]={ +0x81, 0xc9, 0x00, 0x06, 0x3e, 0xbe, 0xa6, 0x8c, 0x00, 0x00, 0x2c, 0xd6, 0xff, 0xff, 0xff, 0xff, +0x00, 0x01, 0x72, 0xfe, 0x00, 0x00, 0x01, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid SDES packet type version. */ +static UCHAR test_rtcp_packet_data_4[]={ +0x80, 0xc9, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c, +0x71, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid SDES packet length. */ +static UCHAR test_rtcp_packet_data_5[]={ +0x80, 0xc9, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c, +0x81, 0xca, 0x00, 0x06, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid SDES packet cname string length. */ +static UCHAR test_rtcp_packet_data_6[]={ +0x80, 0xc9, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0f, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid SDES packet without chunk item block. */ +static UCHAR test_rtcp_packet_data_7[]={ +0x80, 0xc9, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c, +0x81, 0xca, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c}; + +/* Tnvalid SDES packet without chunk block. */ +static UCHAR test_rtcp_packet_data_8[]={ +0x80, 0xc9, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c, +0x81, 0xca, 0x00, 0x00}; + +/* RR packet wrong ssrc. */ +static UCHAR test_rtcp_packet_data_9[]={ +0x81, 0xc9, 0x00, 0x07, 0x3e, 0xbe, 0xa6, 0x8c, 0x10, 0x00, 0x2c, 0xd6, 0xff, 0xff, 0xff, 0xff, +0x00, 0x01, 0x72, 0xfe, 0x00, 0x00, 0x01, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +/* Unsupported SDES item type. */ +static UCHAR test_rtcp_packet_data_10[]={ +0x80, 0xc9, 0x00, 0x01, 0x3e, 0xbe, 0xa6, 0x8c, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x02, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +/* Invalid header. */ +static UCHAR test_rtcp_packet_data_11[]={ +0x81, 0xc9, 0x00}; + +static PACKET_DATA test_rtcp_packet_data_list[]={ +{test_rtcp_packet_data_0, sizeof(test_rtcp_packet_data_0)}, +{test_rtcp_packet_data_1, sizeof(test_rtcp_packet_data_1)}, +{test_rtcp_packet_data_2, sizeof(test_rtcp_packet_data_2)}, +{test_rtcp_packet_data_3, sizeof(test_rtcp_packet_data_3)}, +{test_rtcp_packet_data_4, sizeof(test_rtcp_packet_data_4)}, +{test_rtcp_packet_data_5, sizeof(test_rtcp_packet_data_5)}, +{test_rtcp_packet_data_6, sizeof(test_rtcp_packet_data_6)}, +{test_rtcp_packet_data_7, sizeof(test_rtcp_packet_data_7)}, +{test_rtcp_packet_data_8, sizeof(test_rtcp_packet_data_8)}, +{test_rtcp_packet_data_9, sizeof(test_rtcp_packet_data_9)}, +{test_rtcp_packet_data_10, sizeof(test_rtcp_packet_data_10)}, +{test_rtcp_packet_data_11, sizeof(test_rtcp_packet_data_11)}, +{NX_NULL, 0} +}; + +static UCHAR rtcp_packet_is_processed = NX_FALSE; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static UINT test_rtcp_receiver_report_callback(NX_RTP_SESSION *session, NX_RTCP_RECEIVER_REPORT *report); +static UINT test_rtcp_sdes_callback(NX_RTCP_SDES_INFO *sdes_info); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTCP Abnormal Packet Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + tx_semaphore_create(&semaphore_test_done, "semaphore test done", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + nx_rtp_sender_rtcp_receiver_report_callback_set(&rtp_0, test_rtcp_receiver_report_callback); + nx_rtp_sender_rtcp_sdes_callback_set(&rtp_0, test_rtcp_sdes_callback); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + + /* Set session ssrc value the same as the source identifier in test_rtcp_packet_data packet. */ + rtp_session_0.nx_rtp_session_ssrc = 11478; + + CHECK_STATUS(0, status); + + status = tx_semaphore_get(&semaphore_test_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + CHECK_STATUS(NX_FALSE, rtcp_packet_is_processed); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *send_packet; +UINT status; +PACKET_DATA *test_data = test_rtcp_packet_data_list; + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTCP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + while(test_data->data) + { + status = nx_packet_allocate(&pool_0, &send_packet, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(send_packet, test_data->data, test_data->length, &pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_udp_socket_send(&rtp_client_socket, send_packet, RTP_SERVER_ADDRESS, rtp_0.nx_rtp_sender_rtcp_port); + CHECK_STATUS(0, status); + + test_data++; + } + + tx_semaphore_put(&semaphore_test_done); +} + +static UINT test_rtcp_receiver_report_callback(NX_RTP_SESSION *session, NX_RTCP_RECEIVER_REPORT *report) +{ + rtcp_packet_is_processed = NX_TRUE; + + return(NX_SUCCESS); +} + +static UINT test_rtcp_sdes_callback(NX_RTCP_SDES_INFO *sdes_info) +{ + rtcp_packet_is_processed = NX_TRUE; + + return NX_SUCCESS; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTCP Abnormal Packet Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtcp_basic_test.c b/test/regression/rtp_test/netx_rtcp_basic_test.c new file mode 100644 index 00000000..2b33d979 --- /dev/null +++ b/test/regression/rtp_test/netx_rtcp_basic_test.c @@ -0,0 +1,232 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_PAYLOAD_TYPE_AUDIO 97 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 +#define TEST_TIME_DURATION (6 * TX_TIMER_TICKS_PER_SECOND) + +static UCHAR test_rtp_packet_data[] = "test rtp packet data"; + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtcp_client_socket; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static NX_RTP_SESSION rtp_session_1; +static NX_RTP_SESSION rtp_session_2; + +/* Define the counters used in the test application... */ +static UINT rtcp_packet_counter = 0; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTCP Basic Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + rtp_session_0.nx_rtp_session_ssrc = 11478; + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_1, RTP_PAYLOAD_TYPE_AUDIO, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_2, RTP_PAYLOAD_TYPE_AUDIO, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* If more than one rtp packet is sent during the first tick, rtcp packet will also be sent more than once. + To make a stable test result, wait for a tick here to avoid this situation. */ + tx_thread_sleep(1); + + time_start = tx_time_get(); + + while(tx_time_get() - time_start < TEST_TIME_DURATION) + { + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + + CHECK_STATUS(0, status); + } + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Check rtcp packet count. */ + CHECK_STATUS(TEST_TIME_DURATION / (TX_TIMER_TICKS_PER_SECOND * NX_RTCP_INTERVAL) + 1, rtcp_packet_counter); + + status = nx_rtp_sender_session_delete(&rtp_session_2); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_delete(&rtp_session_1); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtcp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtcp_client_socket, RTP_CLIENT_RTCP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + while(nx_udp_socket_receive(&rtcp_client_socket, &received_packet, (NX_RTCP_INTERVAL + 1) * TX_TIMER_TICKS_PER_SECOND) == NX_SUCCESS) + { + rtcp_packet_counter++;; + nx_packet_release(received_packet); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTCP Basic Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtcp_packet_process_test.c b/test/regression/rtp_test/netx_rtcp_packet_process_test.c new file mode 100644 index 00000000..637bdc55 --- /dev/null +++ b/test/regression/rtp_test/netx_rtcp_packet_process_test.c @@ -0,0 +1,279 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; + +/* Define the counters used in the test application... */ +static TX_SEMAPHORE semaphore_test_done; + +/* Define RTCP packet for testing. +--receiver report-- + version: RFC 1899 Version (2) + padding: False + reception report count: 1 + packet type: receiver report (201) + length: 7 + sender ssrc: 1052681868 + source 1: + identifier: 11478 + fraction lost: 255 + cumulative number of packets lost: -1 + extended highest sequence number received: 94974 + interarrival jitter: 444 + last SR timestamp: 0 + delay since last SR timestamp: 0 +--source description-- + version: RFC 1899 Version (2) + padding: False + source count: 1 + packet type: source description (202) + length: 5 + chunk 1: + indentifier: 1052681868 + sdes item: + type: CNAME (1) + length:13 + text: cn-test-cname + type: END (0) +*/ +static UCHAR test_rtcp_packet_data[]={ +0x81, 0xc9, 0x00, 0x07, 0x3e, 0xbe, 0xa6, 0x8c, 0x00, 0x00, 0x2c, 0xd6, 0xff, 0xff, 0xff, 0xff, +0x00, 0x01, 0x72, 0xfe, 0x00, 0x00, 0x01, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x81, 0xca, 0x00, 0x05, 0x3e, 0xbe, 0xa6, 0x8c, 0x01, 0x0d, 0x63, 0x6e, 0x2d, 0x74, 0x65, 0x73, +0x74, 0x2d, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x00}; + +static UCHAR test_rtp_receiver_cname[] = "cn-test-cname"; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static UINT test_rtcp_receiver_report_callback(NX_RTP_SESSION *session, NX_RTCP_RECEIVER_REPORT *report); +static UINT test_rtcp_sdes_callback(NX_RTCP_SDES_INFO *sdes_info); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_packet_process_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTCP Packet Pocess Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + tx_semaphore_create(&semaphore_test_done, "semaphore test done", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + nx_rtp_sender_rtcp_receiver_report_callback_set(&rtp_0, test_rtcp_receiver_report_callback); + nx_rtp_sender_rtcp_sdes_callback_set(&rtp_0, test_rtcp_sdes_callback); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + + /* Set session ssrc value the same as the source identifier in test_rtcp_packet_data packet. */ + rtp_session_0.nx_rtp_session_ssrc = 11478; + + CHECK_STATUS(0, status); + + status = tx_semaphore_get(&semaphore_test_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = tx_semaphore_get(&semaphore_test_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = tx_semaphore_get(&semaphore_test_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *send_packet; +UINT status; + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTCP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_allocate(&pool_0, &send_packet, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(send_packet, test_rtcp_packet_data, sizeof(test_rtcp_packet_data), &pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_udp_socket_send(&rtp_client_socket, send_packet, RTP_SERVER_ADDRESS, rtp_0.nx_rtp_sender_rtcp_port); + CHECK_STATUS(0, status); + + /* Set rtcp receiver report callback to NULL. */ + status = nx_rtp_sender_rtcp_receiver_report_callback_set(&rtp_0, NX_NULL); + CHECK_STATUS(0, status); + + /* Set rtcp sdes callback to NULL. */ + status = nx_rtp_sender_rtcp_sdes_callback_set(&rtp_0, NX_NULL); + CHECK_STATUS(0, status); + + status = nx_packet_allocate(&pool_0, &send_packet, NX_UDP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(send_packet, test_rtcp_packet_data, sizeof(test_rtcp_packet_data), &pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_udp_socket_send(&rtp_client_socket, send_packet, RTP_SERVER_ADDRESS, rtp_0.nx_rtp_sender_rtcp_port); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_test_done); +} + +static UINT test_rtcp_receiver_report_callback(NX_RTP_SESSION *session, NX_RTCP_RECEIVER_REPORT *report) +{ + if((report->receiver_ssrc == 1052681868) && + (report->fraction_loss == 255) && + (report->packet_loss == -1) && + (report->extended_max = 94974) && + (report->jitter == 444) && + (report->last_sr == 0) && + (report->delay == 0)) + { + tx_semaphore_put(&semaphore_test_done); + } + + return(NX_SUCCESS); +} + +static UINT test_rtcp_sdes_callback(NX_RTCP_SDES_INFO *sdes_info) +{ + if((sdes_info->ssrc == 1052681868) && + (strncmp(sdes_info->cname, test_rtp_receiver_cname, sizeof(test_rtp_receiver_cname) - 1) == 0) && + (sdes_info->cname_length == sizeof(test_rtp_receiver_cname) - 1)) + { + tx_semaphore_put(&semaphore_test_done); + } + + return NX_SUCCESS; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_packet_process_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTCP Packet Process Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtcp_packet_send_test.c b/test/regression/rtp_test/netx_rtcp_packet_send_test.c new file mode 100644 index 00000000..424f8aa1 --- /dev/null +++ b/test/regression/rtp_test/netx_rtcp_packet_send_test.c @@ -0,0 +1,203 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 24 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +static UCHAR test_rtp_packet_data[] = "test rtp packet data"; +static UCHAR test_rtcp_packet_data[] = {0x80, 0xc8, 0x0, 0x6, 0x0, 0x0, 0x2c, 0xd6, 0x0, 0x0, 0x0, 0x7b, 0x0, 0x0, 0x1, 0xc8, 0x0, 0x0, 0x4, 0xd2, +0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x81, 0xca, 0x0, 0x8, 0x0, 0x0, 0x2c, 0xd6, 0x1, 0x17, 0x41, 0x7a, 0x75, +0x72, 0x65, 0x52, 0x54, 0x4f, 0x53, 0x40, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0, 0x0, 0x0}; + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtcp_client_socket; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; + +/* Define the counters used in the test application... */ + +static TX_SEMAPHORE semaphore_test_done; + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_packet_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTCP Packet Send Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + tx_semaphore_create(&semaphore_test_done, "semaphore test done", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + rtp_session_0.nx_rtp_session_ssrc = 11478; + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + + CHECK_STATUS(0, status); + + status = tx_semaphore_get(&semaphore_test_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtcp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtcp_client_socket, RTP_CLIENT_RTCP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_udp_socket_receive(&rtcp_client_socket, &received_packet, 5 * NX_IP_PERIODIC_RATE); + if ((status == NX_SUCCESS) && + (received_packet->nx_packet_length == sizeof(test_rtcp_packet_data)) && + (memcmp(received_packet->nx_packet_prepend_ptr, test_rtcp_packet_data, sizeof(test_rtcp_packet_data)) == 0)) + { + tx_semaphore_put(&semaphore_test_done); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtcp_packet_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTCP Packet Send Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_api_test.c b/test/regression/rtp_test/netx_rtp_api_test.c new file mode 100644 index 00000000..776e26de --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_api_test.c @@ -0,0 +1,152 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD test_thread; + +/* Define the ThreadX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; + +/* Define thread prototypes. */ + +static void test_entry(ULONG thread_input); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "Test thread", test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +void test_entry(ULONG thread_input) +{ +UINT status; +UINT rtp_port; + + + /* Print out test information banner. */ + printf("NetX Test: RTP API Test............................................"); + + memset(&rtp_0, 0, sizeof(NX_RTP_SENDER)); + + /* Test and check nx_rtp_sender_create */ + status = nx_rtp_sender_create(NX_NULL, NX_NULL, NX_NULL, NX_NULL, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_create(&rtp_0, NX_NULL, NX_NULL, NX_NULL, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_create(&rtp_0, &ip_0, NX_NULL, NX_NULL, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, NX_NULL, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_delete */ + status = nx_rtp_sender_delete(NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_port_get */ + status = nx_rtp_sender_port_get(NX_NULL, NX_NULL, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_port_get(&rtp_0, NX_NULL, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_session_create */ + status = nx_rtp_sender_session_create(NX_NULL, NX_NULL, 0, 0, NX_NULL, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_session_create(&rtp_0, NX_NULL, 0, 0, NX_NULL, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, 0, 0, NX_NULL, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_session_packet_allocate */ + status = nx_rtp_sender_session_packet_allocate(NX_NULL, NX_NULL, NX_WAIT_FOREVER); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, NX_NULL, NX_WAIT_FOREVER); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_session_sequence_number_get */ + status = nx_rtp_sender_session_sequence_number_get(NX_NULL, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_session_sequence_number_get(&rtp_session_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_session_ssrc_get */ + status = nx_rtp_sender_session_ssrc_get(NX_NULL, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_session_ssrc_get(&rtp_session_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check nx_rtp_sender_session_packet_send */ + status = nx_rtp_sender_session_packet_send(NX_NULL, NX_NULL, NX_NULL, 0, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtp_sender_session_packet_send(&rtp_session_0, NX_NULL, NX_NULL, 0, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test and check RTCP API functions */ + status = nx_rtp_sender_rtcp_receiver_report_callback_set(NX_NULL, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + status = nx_rtp_sender_rtcp_receiver_report_callback_set(&rtp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + status = nx_rtp_sender_rtcp_sdes_callback_set(NX_NULL, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + status = nx_rtp_sender_rtcp_sdes_callback_set(&rtp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP API Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_basic_test.c b/test/regression/rtp_test/netx_rtp_basic_test.c new file mode 100644 index 00000000..74afc3da --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_basic_test.c @@ -0,0 +1,264 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 10 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +static UCHAR test_rtp_packet_data[] = "test rtp packet data"; + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +static TX_SEMAPHORE semaphore_test_0_done; +static TX_SEMAPHORE semaphore_test_1_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Basic Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_0_done, "semaphore test 0", 0); + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; + + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* If more than one rtp packet is sent during the first tick, rtcp packet will also be sent more than once. + To make a stable test result, wait for a tick here to avoid this situation. */ + tx_thread_sleep(1); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Put the semaphore to notify thread 1 it is fine to check resource leakage. */ + tx_semaphore_put(&semaphore_test_0_done); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; +UCHAR *data; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + CHECK_STATUS((0x80 | RTP_PAYLOAD_TYPE), *data); + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + for (UINT i = 0; i < sizeof(test_rtp_packet_data); i++) + { + CHECK_STATUS(*(test_rtp_packet_data + i), data[i]); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); + + /* Wait for the check in test thread 0 done. */ + status = tx_semaphore_get(&semaphore_test_0_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Basic Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_free_udp_port_find_test.c b/test/regression/rtp_test/netx_rtp_free_udp_port_find_test.c new file mode 100644 index 00000000..8eea5e8d --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_free_udp_port_find_test.c @@ -0,0 +1,224 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 10 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +static NX_UDP_SOCKET udp_socket_0; +static NX_UDP_SOCKET udp_socket_1; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static UINT rtp_port; +static UINT rtcp_port; + +static NX_UDP_SOCKET my_socket[NX_MAX_PORT + 1]; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_free_udp_port_find_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Free UDP Port Find Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +UINT i; + + + /* Create the test udp socket for use */ + status = nx_udp_socket_create(&ip_0, &udp_socket_0, "Test Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + status += nx_udp_socket_create(&ip_0, &udp_socket_1, "Test Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + /* Test 1: occupy the initial rtp port to test if rtp sender can find and bind following ports */ + status = nx_udp_socket_bind(&udp_socket_0, NX_RTP_SENDER_INITIAL_RTP_PORT, NX_NO_WAIT); + status += nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + status += nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + CHECK_STATUS(NX_RTP_SENDER_INITIAL_RTP_PORT + 2, rtp_port); /* rtp port shall be an even number */ + CHECK_STATUS(NX_RTP_SENDER_INITIAL_RTP_PORT + 3, rtcp_port); /* rtcp port shall be an odd number next to rtp port */ + nx_udp_socket_unbind(&udp_socket_0); + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Test 2: occupy the initial rtcp port to test if rtp sender can find and bind following ports */ + status = nx_udp_socket_bind(&udp_socket_0, (NX_RTP_SENDER_INITIAL_RTP_PORT + 1), NX_NO_WAIT); + CHECK_STATUS(0, status); + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + status += nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + CHECK_STATUS(NX_RTP_SENDER_INITIAL_RTP_PORT + 2, rtp_port); /* rtp port shall be an even number */ + CHECK_STATUS(NX_RTP_SENDER_INITIAL_RTP_PORT + 3, rtcp_port); /* rtcp port shall be an odd number next to rtp port */ + nx_udp_socket_unbind(&udp_socket_0); + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Test 3: occupy the initial rtp port and the next rtcp port to test if rtp sender can find and bind following ports */ + status = nx_udp_socket_bind(&udp_socket_0, (NX_RTP_SENDER_INITIAL_RTP_PORT), NX_NO_WAIT); + status += nx_udp_socket_bind(&udp_socket_1, (NX_RTP_SENDER_INITIAL_RTP_PORT + 3), NX_NO_WAIT); + CHECK_STATUS(0, status); + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + status += nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + CHECK_STATUS(NX_RTP_SENDER_INITIAL_RTP_PORT + 4, rtp_port); /* rtp port shall be an even number */ + CHECK_STATUS(NX_RTP_SENDER_INITIAL_RTP_PORT + 5, rtcp_port); /* rtcp port shall be an odd number next to rtp port */ + nx_udp_socket_unbind(&udp_socket_0); + nx_udp_socket_unbind(&udp_socket_1); + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Test 4: occupy all odd ports and see no free ports. */ + for (i = (NX_RTP_SENDER_INITIAL_RTP_PORT + 1); i <= NX_MAX_PORT; i += 2) + { + status = nx_udp_socket_create(&ip_0, &my_socket[i], "Socket Array", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&my_socket[i], i, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(NX_NO_FREE_PORTS, status); + + /* Test 5: occupy all odd ports as well as port 65532 & 65534, unbind port 65533 and see no free ports. */ + status = nx_udp_socket_create(&ip_0, &my_socket[65534], "Socket Array", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&my_socket[65534], 65534, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_create(&ip_0, &my_socket[65532], "Socket Array", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_udp_socket_bind(&my_socket[65532], 65532, NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Unbind port 65533. */ + status = nx_udp_socket_unbind(&my_socket[65533]); + + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(NX_NO_FREE_PORTS, status); + + /* Finally, delete the sockets and check if there is memory leak. */ + nx_udp_socket_delete(&udp_socket_0); + nx_udp_socket_delete(&udp_socket_1); + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_free_udp_port_find_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Free UDP Port Find Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_multi_clients_test.c b/test/regression/rtp_test/netx_rtp_multi_clients_test.c new file mode 100644 index 00000000..06d0476a --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_multi_clients_test.c @@ -0,0 +1,380 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 20 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#define RTP_CLIENT_1_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define RTP_CLIENT_2_ADDRESS IP_ADDRESS(1, 2, 3, 6) +#define RTP_CLIENT_1_RTP_PORT 6002 +#define RTP_CLIENT_1_RTCP_PORT 6003 +#define RTP_CLIENT_2_RTP_PORT 6002 +#define RTP_CLIENT_2_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +/* Define the number of tests to do */ +#define TEST_CYCLES 5 + +static UCHAR test_rtp_packet_data[] = "test rtp packet data"; + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_UDP_SOCKET rtp_client_1_socket; +static NX_UDP_SOCKET rtp_client_2_socket; + +static TX_SEMAPHORE semaphore_test_1_done; +static TX_SEMAPHORE semaphore_test_2_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static NX_RTP_SESSION rtp_session_1; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_multi_clients_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Multi-Clients Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_1_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 2", RTP_CLIENT_2_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for all IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); + tx_semaphore_create(&semaphore_test_2_done, "semaphore test 2", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_1_ip_address; +NXD_ADDRESS client_2_ip_address; +NX_PACKET *send_packet; +UINT time_start; + + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_1_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_1_ip_address.nxd_ip_address.v4 = RTP_CLIENT_1_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_1_ip_address, + RTP_CLIENT_1_RTP_PORT, RTP_CLIENT_1_RTCP_PORT); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_2_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_2_ip_address.nxd_ip_address.v4 = RTP_CLIENT_2_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_1, RTP_PAYLOAD_TYPE, + 0, &client_2_ip_address, + RTP_CLIENT_2_RTP_PORT, RTP_CLIENT_2_RTCP_PORT); + CHECK_STATUS(0, status); + + /* Wait for client threads ready. */ + tx_thread_sleep(20); + + /* Begin test cycles */ + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_1, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_packet_send(&rtp_session_1, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + } + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait for the check in test thread 2 done. */ + status = tx_semaphore_get(&semaphore_test_2_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + status += nx_rtp_sender_session_delete(&rtp_session_1); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the first client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; +UCHAR *data; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_1_socket, "RTCP Client 1 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_1_socket, RTP_CLIENT_1_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Begin test cycles */ + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_1_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + CHECK_STATUS((0x80 | RTP_PAYLOAD_TYPE), *data); + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + for (UINT i = 0; i < sizeof(test_rtp_packet_data); i++) + { + CHECK_STATUS(*(test_rtp_packet_data + i), data[i]); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); +} + +/* Define the second client threads. */ +static void ntest_2_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; +UCHAR *data; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_2, &rtp_client_2_socket, "RTCP Client 2 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_2_socket, RTP_CLIENT_2_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Begin test cycles */ + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_2_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + CHECK_STATUS((0x80 | RTP_PAYLOAD_TYPE), *data); + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_1.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_1.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_1.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + for (UINT i = 0; i < sizeof(test_rtp_packet_data); i++) + { + CHECK_STATUS(*(test_rtp_packet_data + i), data[i]); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_2_done); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_multi_clients_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Multi-Clients Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_multi_interfaces_test.c b/test/regression/rtp_test/netx_rtp_multi_interfaces_test.c new file mode 100644 index 00000000..c572d898 --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_multi_interfaces_test.c @@ -0,0 +1,948 @@ +/* This case tests RTSP with RTP. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) && (NX_MAX_PHYSICAL_INTERFACES > 1) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_0_thread; +static TX_THREAD client_1_thread; +static NX_PACKET_POOL client_0_pool; +static NX_PACKET_POOL client_1_pool; +static NX_IP client_0_ip; +static NX_IP client_1_ip; +static NX_TCP_SOCKET rtsp_client_0; +static NX_TCP_SOCKET rtsp_client_1; +static NX_UDP_SOCKET rtp_client_0; +static NX_UDP_SOCKET rtp_client_1; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_0; +static NX_RTP_SESSION rtp_session_1; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_client_0_start; +static TX_SEMAPHORE semaphore_client_1_start; +static TX_SEMAPHORE semaphore_rtp_send_0; +static TX_SEMAPHORE semaphore_rtp_send_1; +static TX_EVENT_FLAGS_GROUP events_play; + + +static void thread_client_0_entry(ULONG thread_input); +static void thread_client_1_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_SERVER_1_ADDRESS IP_ADDRESS(10,3,3,4) +#define TEST_CLIENT_0_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_CLIENT_1_ADDRESS IP_ADDRESS(10,3,3,5) +#define RTSP_SERVER_PORT 554 + +#define RTSP_0_SESSION_ID 23754311 +#define RTSP_1_SESSION_ID 23754312 +#define RTP_0_RTP_PORT 49752 +#define RTP_0_RTCP_PORT 49753 +#define RTP_1_RTP_PORT 49754 +#define RTP_1_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_0 96 +#define RTP_PAYLOAD_TYPE_1 97 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 + +/* Define events for the server task */ +#define ALL_EVENTS ((ULONG)0xFFFFFFFF) +#define PLAY_0_EVENT ((ULONG)0x00000001) +#define PLAY_1_EVENT ((ULONG)0x00000002) +#define DONE_0_EVENT ((ULONG)0x00000004) +#define DONE_1_EVENT ((ULONG)0x00000008) + +static UCHAR rtsp_0_option_request[] = "\ +OPTIONS rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_1_option_request[] = "\ +OPTIONS rtsp://10.3.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_0_describe_request[] = "\ +DESCRIBE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_1_describe_request[] = "\ +DESCRIBE rtsp://10.3.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_0_setup_request[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_1_setup_request[] = "\ +SETUP rtsp://10.3.3.4:554/live.stream/trackID=1 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\r\n\ +"; + +static UCHAR rtsp_0_play_request[] = "\ +PLAY rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_1_play_request[] = "\ +PLAY rtsp://10.3.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754312\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_0_pause_request[] = "\ +PAUSE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_1_pause_request[] = "\ +PAUSE rtsp://10.3.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754312\r\n\r\n\ +"; + +static UCHAR rtsp_0_teardown_request[] = "\ +TEARDOWN rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_1_teardown_request[] = "\ +TEARDOWN rtsp://10.3.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754312\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_INDEX, + PLAY_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *client_0_rtsp_request_list[] = +{ +rtsp_0_option_request, +rtsp_0_describe_request, +rtsp_0_setup_request, +rtsp_0_play_request, +rtsp_0_teardown_request, +}; + +static UCHAR *client_1_rtsp_request_list[] = +{ +rtsp_1_option_request, +rtsp_1_describe_request, +rtsp_1_setup_request, +rtsp_1_play_request, +rtsp_1_teardown_request, +}; + +static UINT client_0_rtsp_request_size[] = +{ +sizeof(rtsp_0_option_request) - 1, +sizeof(rtsp_0_describe_request) - 1, +sizeof(rtsp_0_setup_request) - 1, +sizeof(rtsp_0_play_request) - 1, +sizeof(rtsp_0_teardown_request) - 1, +}; + +static UINT client_1_rtsp_request_size[] = +{ +sizeof(rtsp_1_option_request) - 1, +sizeof(rtsp_1_describe_request) - 1, +sizeof(rtsp_1_setup_request) - 1, +sizeof(rtsp_1_play_request) - 1, +sizeof(rtsp_1_teardown_request) - 1, +}; + +static UINT client_0_rtsp_request_num = sizeof(client_0_rtsp_request_size) / sizeof(UINT); +static UINT client_1_rtsp_request_num = sizeof(client_1_rtsp_request_size) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +m=audio 0 RTP/AVP 97\r\n\ +a=rtpmap:97 mpeg4-generic/44100/1\r\n\ +a=fmtp:97 SizeLength=13\r\n\ +a=control:trackID=1\r\n"; + +static UINT seq_0 = 0, seq_1 = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_multi_interfaces_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Attach a new ip interface to server ip. */ + status = nx_ip_interface_attach(&server_ip, "Test Server IP 1 Interface", TEST_SERVER_1_ADDRESS, + 0xFFFFFF00UL, _nx_ram_network_driver_1024); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_0_thread, "Test Client 0", thread_client_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + status = tx_thread_create(&client_1_thread, "Test Client 1", thread_client_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_0_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + status = nx_packet_pool_create(&client_1_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_0_ip, "Test Client IP 0", TEST_CLIENT_0_ADDRESS, + 0xFFFFFF00UL, &client_0_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_1_ip, "Test Client IP 1", TEST_CLIENT_1_ADDRESS, + 0xFFFFFF00UL, &client_1_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable arp */ + status = nx_arp_enable(&client_0_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + status = nx_arp_enable(&client_1_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_0_ip); + CHECK_STATUS(0, status); + status = nx_tcp_enable(&client_1_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_0_ip); + CHECK_STATUS(0, status); + status = nx_udp_enable(&client_1_ip); + CHECK_STATUS(0, status); + + /* Create semaphores and events group. */ + tx_semaphore_create(&semaphore_client_0_start, "semaphore client 0 start", 0); + tx_semaphore_create(&semaphore_client_1_start, "semaphore client 1 start", 0); + tx_semaphore_create(&semaphore_rtp_send_0, "semaphore rtp send 0", 0); + tx_semaphore_create(&semaphore_rtp_send_1, "semaphore rtp send 1", 0); + status = tx_event_flags_create(&events_play, "events play"); + CHECK_STATUS(0, status); +} + +void thread_client_0_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_0_ip, &rtsp_client_0, "Test Client 0 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_0, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_0_ip, &rtp_client_0, "RTCP Client 0 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_0, RTP_0_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_client_0_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_0, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < client_0_rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_0_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, client_0_rtsp_request_list[i], client_0_rtsp_request_size[i], &client_0_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_0, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_0_RTP_PORT, RTP_0_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_0.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/live.stream/trackID=0;seq=%d;rtptime=%d", + seq_0, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-", sizeof("Range: npt=0.0-") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send_0, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_0, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client_0, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_event_flags_set(&events_play, DONE_0_EVENT, TX_OR); + nx_tcp_client_socket_unbind(&rtsp_client_0); + nx_tcp_socket_delete(&rtsp_client_0); +} + +void thread_client_1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_1_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_1_ip, &rtsp_client_1, "Test Client 1 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_1, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_1_ip, &rtp_client_1, "RTCP Client 1 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_1, RTP_1_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_client_1_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_1, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < client_1_rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_1_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, client_1_rtsp_request_list[i], client_1_rtsp_request_size[i], &client_1_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_1, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=10.3.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_1_RTP_PORT, RTP_1_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_1.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://10.3.3.4:554/live.stream/trackID=1;seq=%d;rtptime=%d", + seq_1, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-", sizeof("Range: npt=0.0-") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send_1, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_1, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client_1, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_event_flags_set(&events_play, DONE_1_EVENT, TX_OR); + nx_tcp_client_socket_unbind(&rtsp_client_1); + nx_tcp_socket_delete(&rtsp_client_1); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +ULONG events = 0; +USHORT client_0_done = NX_FALSE; +USHORT client_1_done = NX_FALSE; + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Multi Interfaces Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_client_0_start); + tx_semaphore_put(&semaphore_client_1_start); + + while ((client_0_done) == (NX_FALSE) || (client_1_done == NX_FALSE)) + { + + /* Wait for events to do */ + tx_event_flags_get(&events_play, ALL_EVENTS, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); + + if (events & PLAY_0_EVENT) + { + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_0, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send_0); + } + + if (events & PLAY_1_EVENT) + { + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_1, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send_1); + } + + if (events & DONE_0_EVENT) + { + client_0_done = NX_TRUE; + } + + if (events & DONE_1_EVENT) + { + client_1_done = NX_TRUE; + } + } + + /* Stop and delete rtsp server */ + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + /* Check packet pool. */ + CHECK_STATUS(server_pool.nx_packet_pool_available, server_pool.nx_packet_pool_total); + CHECK_STATUS(client_0_pool.nx_packet_pool_available, client_0_pool.nx_packet_pool_total); + CHECK_STATUS(client_1_pool.nx_packet_pool_available, client_1_pool.nx_packet_pool_total); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + if (strstr(uri, "trackID=0")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_0, RTP_PAYLOAD_TYPE_0, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_0, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_0_SESSION_ID; + } + else if (strstr(uri, "trackID=1")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_1, RTP_PAYLOAD_TYPE_1, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_1, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_1_SESSION_ID; + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + + if (rtsp_client_ptr -> nx_rtsp_client_request_packet -> nx_packet_address.nx_packet_interface_ptr + == &(server_ip.nx_ip_interface[0])) + { + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_0, &seq_0); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, seq_0, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 0, 30000); + CHECK_STATUS(0, status); + + tx_event_flags_set(&events_play, PLAY_0_EVENT, TX_OR); + } + else if (rtsp_client_ptr -> nx_rtsp_client_request_packet -> nx_packet_address.nx_packet_interface_ptr + == &(server_ip.nx_ip_interface[1])) + { + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_1, &seq_1); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=1", sizeof("trackID=1") - 1, seq_1, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + tx_event_flags_set(&events_play, PLAY_1_EVENT, TX_OR); + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + + if (rtsp_client_ptr -> nx_rtsp_client_request_packet -> nx_packet_address.nx_packet_interface_ptr + == &(server_ip.nx_ip_interface[0])) + { + nx_rtp_sender_session_delete(&rtp_session_0); + } + else if (rtsp_client_ptr -> nx_rtsp_client_request_packet -> nx_packet_address.nx_packet_interface_ptr + == &(server_ip.nx_ip_interface[1])) + { + nx_rtp_sender_session_delete(&rtp_session_1); + } + else + { + return(NX_RTSP_SERVER_INVALID_REQUEST); + } + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_multi_interfaces_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Multi Interfaces Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_multicast_test.c b/test/regression/rtp_test/netx_rtp_multicast_test.c new file mode 100644 index 00000000..9741da2f --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_multicast_test.c @@ -0,0 +1,372 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 20 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define DEMO_MULTICAST_IP_ADDRESS IP_ADDRESS(224, 1, 0, 55) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#define RTP_CLIENT_1_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define RTP_CLIENT_2_ADDRESS IP_ADDRESS(1, 2, 3, 6) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +/* Define the number of tests to do */ +#define TEST_CYCLES 5 + +static UCHAR test_rtp_packet_data[] = "test rtp packet data"; + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; +static TX_THREAD ntest_2; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_IP ip_2; +static NX_UDP_SOCKET rtp_client_1_socket; +static NX_UDP_SOCKET rtp_client_2_socket; + +static TX_SEMAPHORE semaphore_test_1_done; +static TX_SEMAPHORE semaphore_test_2_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +static void ntest_2_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_multicast_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Multicast Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_2, "thread 2", ntest_2_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_1_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_2, "NetX IP Instance 2", RTP_CLIENT_2_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 2. */ + status = nx_arp_enable(&ip_2, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for all IP instances. */ + status = nx_udp_enable(&ip_0); + status += nx_udp_enable(&ip_1); + status += nx_udp_enable(&ip_2); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); + tx_semaphore_create(&semaphore_test_2_done, "semaphore test 2", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; + + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&ip_0); + status = nx_igmp_multicast_join(&ip_0, DEMO_MULTICAST_IP_ADDRESS); + CHECK_STATUS(0, status); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = DEMO_MULTICAST_IP_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* Wait for client threads ready. */ + tx_thread_sleep(20); + + /* Begin test cycles */ + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + } + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait for the check in test thread 2 done. */ + status = tx_semaphore_get(&semaphore_test_2_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* Define the first client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; +UCHAR *data; + + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&ip_1); + status += nx_igmp_multicast_join(&ip_1, DEMO_MULTICAST_IP_ADDRESS); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_1_socket, "RTCP Client 1 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_1_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Begin test cycles */ + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_1_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + CHECK_STATUS((0x80 | RTP_PAYLOAD_TYPE), *data); + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + for (UINT i = 0; i < sizeof(test_rtp_packet_data); i++) + { + CHECK_STATUS(*(test_rtp_packet_data + i), data[i]); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); +} + +/* Define the second client threads. */ +static void ntest_2_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; +UCHAR *data; + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&ip_2); + status += nx_igmp_multicast_join(&ip_2, DEMO_MULTICAST_IP_ADDRESS); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_2, &rtp_client_2_socket, "RTCP Client 2 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_2_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Begin test cycles */ + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_2_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + CHECK_STATUS((0x80 | RTP_PAYLOAD_TYPE), *data); + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + for (UINT i = 0; i < sizeof(test_rtp_packet_data); i++) + { + CHECK_STATUS(*(test_rtp_packet_data + i), data[i]); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_2_done); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_multicast_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Multicast Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_session_aac_send_test.c b/test/regression/rtp_test/netx_rtp_session_aac_send_test.c new file mode 100644 index 00000000..f35422d6 --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_session_aac_send_test.c @@ -0,0 +1,383 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 10 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +/* Define the number of tests to do */ +#define TEST_CYCLES 4 + +static UCHAR test_rtp_packet_data[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* Test data */ +}; /* test_rtp_packet_data */ + +static UCHAR test_long_rtp_packet_data[] = { /* Test data */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +}; /* test_long_rtp_packet_data */ + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +static TX_SEMAPHORE semaphore_test_0_done; +static TX_SEMAPHORE semaphore_test_1_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_aac_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Session AAC Send Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_0_done, "semaphore test 0", 0); + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); +} + +static UINT validate_rtp_aac_data(UCHAR *data, UINT data_length) +{ +UINT i; +UCHAR *data_ptr = data; +ULONG size; + + + /* The first 2 bytes are always 0x0010 */ + if (data_ptr[0] != 0x00 || data_ptr[1] != 0x10) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 2; + + /* Compute data size and compare with passed data length */ + size = (ULONG)(data_ptr[0] << 5 | data_ptr[1] >> 3); + if (size != (data_length - 4)) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 2; + + /* Check aac data */ + i = 0; + while (data_ptr < (data + data_length)) + { + if (*data_ptr != test_rtp_packet_data[i]) + { + return(NX_NOT_SUCCESSFUL); + } + + i++; + data_ptr++; + } + + return(NX_SUCCESS); +} + +static UINT validate_long_rtp_aac_data(UCHAR *data, UINT data_length) +{ +UCHAR *data_ptr = data; +ULONG size; +static ULONG offset = 0; + + + /* The first 2 bytes are always 0x0010 */ + if (data_ptr[0] != 0x00 || data_ptr[1] != 0x10) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 2; + + /* Compute data size and compare with passed data length */ + size = (ULONG)(data_ptr[0] << 5 | data_ptr[1] >> 3); + if (size != (data_length - 4)) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 2; + + /* Check aac data */ + while (data_ptr < (data + data_length)) + { + if (*data_ptr != test_long_rtp_packet_data[offset]) + { + return(NX_NOT_SUCCESSFUL); + } + + offset++; + data_ptr++; + } + + return(NX_SUCCESS); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; +ULONG temp_socket_id; + + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* If more than one rtp packet is sent during the first tick, rtcp packet will also be sent more than once. + To make a stable test result, wait for a tick here to avoid this situation. */ + tx_thread_sleep(1); + + /* ---- Test cycle 1 ---- */ + + /* Send aac data. */ + status = nx_rtp_sender_session_aac_send(&rtp_session_0, test_rtp_packet_data, sizeof(test_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* ---- Test cycle 2 ~ 4 ---- */ + + /* Send aac data. */ + status = nx_rtp_sender_session_aac_send(&rtp_session_0, test_long_rtp_packet_data, sizeof(test_long_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Put the semaphore to notify thread 1 it is fine to check resource leakage. */ + tx_semaphore_put(&semaphore_test_0_done); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT j; +UINT status; +UCHAR *data; +UINT test_data_pos = 0; +ULONG offset = 0; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + if (i == 1 || i == 2) + { + CHECK_STATUS((RTP_PAYLOAD_TYPE), *data); + } + else + { + CHECK_STATUS((NX_RTP_HEADER_MARKER_BIT | RTP_PAYLOAD_TYPE), *data); + } + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + if (i == 0) + { + status = validate_rtp_aac_data(data, received_packet -> nx_packet_length - 12); + CHECK_STATUS(NX_SUCCESS, status); + } + else if (i >= 1 && i <= 3) + { + status = validate_long_rtp_aac_data(data, received_packet -> nx_packet_length - 12); + if (status) + CHECK_STATUS(NX_SUCCESS, status); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); + + /* Wait for the check in test thread 0 done. */ + status = tx_semaphore_get(&semaphore_test_0_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_aac_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Session AAC Send Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_session_h264_send_test.c b/test/regression/rtp_test/netx_rtp_session_h264_send_test.c new file mode 100644 index 00000000..d78613f3 --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_session_h264_send_test.c @@ -0,0 +1,499 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 10 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +/* Define the number of tests to do */ +#define TEST_CYCLES (6 + 8) /* 6 packets, 8 slices */ + +/* Define h264 test data */ +static UCHAR test_rtp_packet_data[] = { 0x00, 0x00, 0x01, 0x65, /* h264 header started with 0x000001 */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* Test data */ +}; /* test_rtp_packet_data */ + +static UCHAR test_medium_rtp_packet_data[] = { 0x00, 0x00, 0x00, 0x01, 0x65, /* h264 header started with 0x00000001 */ + + /* Test data */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +}; /* test_rtp_packet_data */ + +static UCHAR test_long_rtp_packet_data[] = { 0x00, 0x00, 0x00, 0x01, 0x65, /* h264 header started with 0x00000001 */ + + /* Test data */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +}; /* test_rtp_packet_data */ + +static UCHAR test_rtp_packet_slices_data[] = { 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, +}; /* test_rtp_packet_data */ + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +static TX_SEMAPHORE semaphore_test_0_done; +static TX_SEMAPHORE semaphore_test_1_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_h264_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Session H264 Send Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_0_done, "semaphore test 0", 0); + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); +} + +static UINT validate_rtp_h264_data(UCHAR *data, UINT data_length) +{ +UINT i; +UCHAR *data_ptr = data; + + + /* In single NAL mode, the first byte shall be the same as the first pointful byte in the source h264 header*/ + if (data_ptr[0] != 0x65) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check h264 image data */ + i = 0; + while (data_ptr < (data + data_length)) + { + if (*data_ptr != test_rtp_packet_data[4 + i]) /* Skip 4 header bytes */ + { + return(NX_NOT_SUCCESSFUL); + } + + i++; + data_ptr++; + } + + return(NX_SUCCESS); +} + +static UINT validate_rtp_h264_fragmentation_data(UINT index, UCHAR *data, UINT data_length) +{ +UCHAR *test_data; +UCHAR *data_ptr = data; +static ULONG offset = 0; + + + /* 0x7C: high priority and FU-A mode */ + if (data_ptr[0] != 0x7C) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + switch (index) + { + case 1: + test_data = test_medium_rtp_packet_data; + /* 0x85: start bit set and IDR picture */ + if (data_ptr[0] != 0x85) + { + return(NX_NOT_SUCCESSFUL); + } + break; + + case 3: + test_data = test_long_rtp_packet_data; + /* 0x85: start bit set and IDR picture */ + if (data_ptr[0] != 0x85) + { + return(NX_NOT_SUCCESSFUL); + } + break; + + case 4: + test_data = test_long_rtp_packet_data; + /* 0x05: IDR picture */ + if (data_ptr[0] != 0x05) + { + return(NX_NOT_SUCCESSFUL); + } + break; + + case 2: + test_data = test_medium_rtp_packet_data; + /* 0x45: end bit set and IDR picture */ + if (data_ptr[0] != 0x45) + { + return(NX_NOT_SUCCESSFUL); + } + break; + case 5: + test_data = test_long_rtp_packet_data; + /* 0x45: end bit set and IDR picture */ + if (data_ptr[0] != 0x45) + { + return(NX_NOT_SUCCESSFUL); + } + break; + + default: + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check JPEG image data */ + while (data_ptr < (data + data_length)) + { + if (*data_ptr != test_data[5 + offset]) /* Skip 5 header bytes */ + { + return(NX_NOT_SUCCESSFUL); + } + + offset++; + data_ptr++; + } + + /* Clear offset for long data test */ + if (index == 2) + { + offset = 0; + } + + return(NX_SUCCESS); +} + +static UINT validate_rtp_h264_slice_data(UCHAR *data, UINT data_length) +{ +UINT i; +UCHAR *data_ptr = data; + + + /* In single NAL mode, the first byte shall be the same as the first pointful byte in the source h264 header*/ + if (data_ptr[0] != 0x61) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check h264 image data */ + i = 0; + while (1) + { + if (*data_ptr != test_rtp_packet_data[4 + i]) /* Skip 4 header bytes */ + { + return(NX_NOT_SUCCESSFUL); + } + + if (data_ptr >= (data + data_length - 4)) /* Skip 4 byte h264 header */ + { + break; + } + + i++; + data_ptr++; + } + + return(NX_SUCCESS); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; +ULONG temp_socket_id; + + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* If more than one rtp packet is sent during the first tick, rtcp packet will also be sent more than once. + To make a stable test result, wait for a tick here to avoid this situation. */ + tx_thread_sleep(1); + + /* ---- Test cycle 1 ---- */ + + /* Send h264 data. */ + status = nx_rtp_sender_session_h264_send(&rtp_session_0, test_rtp_packet_data, sizeof(test_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* ---- Test cycle 2 ~ 3 ---- */ + /* Send h264 data. */ + status = nx_rtp_sender_session_h264_send(&rtp_session_0, test_medium_rtp_packet_data, sizeof(test_medium_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* ---- Test cycle 4 ~ 6 ---- */ + + /* Send h264 data. */ + status = nx_rtp_sender_session_h264_send(&rtp_session_0, test_long_rtp_packet_data, sizeof(test_long_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* ---- Test cycle 7 ~ 14 ---- */ + + /* Send h264 data. */ + status = nx_rtp_sender_session_h264_send(&rtp_session_0, test_rtp_packet_slices_data, sizeof(test_rtp_packet_slices_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Put the semaphore to notify thread 1 it is fine to check resource leakage. */ + tx_semaphore_put(&semaphore_test_0_done); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT j; +UINT status; +UCHAR *data; +UINT test_data_pos = 0; +ULONG offset = 0; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + if (i == 0 || i == 2 || i == 5 || i == 13) + { + CHECK_STATUS((NX_RTP_HEADER_MARKER_BIT | RTP_PAYLOAD_TYPE), *data); + } + else + { + CHECK_STATUS((RTP_PAYLOAD_TYPE), *data); + } + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + if (i == 0) + { + status = validate_rtp_h264_data(data, received_packet -> nx_packet_length - 12); + CHECK_STATUS(NX_SUCCESS, status); + } + else if (i >= 1 && i <= 5) + { + status = validate_rtp_h264_fragmentation_data(i, data, received_packet -> nx_packet_length - 12); + CHECK_STATUS(NX_SUCCESS, status); + } + else + { + status = validate_rtp_h264_slice_data(data, received_packet -> nx_packet_length - 12); + if (status) + CHECK_STATUS(NX_SUCCESS, status); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); + + /* Wait for the check in test thread 0 done. */ + status = tx_semaphore_get(&semaphore_test_0_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_h264_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Session H264 Send Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_session_jpeg_send_test.c b/test/regression/rtp_test/netx_rtp_session_jpeg_send_test.c new file mode 100644 index 00000000..5225ac01 --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_session_jpeg_send_test.c @@ -0,0 +1,558 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 10 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +/* Define the number of tests to do */ +#define TEST_CYCLES 4 + +/* Define jpeg test data */ +#define TEST_JPEG_Q_TABLE_SIZE 64 +#define TEST_JPEG_Q_TABLE_START_POS (2 + 2 + 0x10 + 5) +#define TEST_JPEG_IMAGE_DATA_START_POS (TEST_JPEG_Q_TABLE_START_POS + TEST_JPEG_Q_TABLE_SIZE + 2 + 0x11 + 2 + 0x0C) +static UCHAR test_rtp_packet_data[] = { 0xFF, 0xD8, /* JPEG file header */ + + /* APP0 */ + 0xFF, 0xE0, 0x00, 0x10, + 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, + + /* Quntization tables */ + 0xFF, 0xDB, 0x00, 0x43, + 0x00, + 0x07, 0x05, 0x05, 0x06, 0x05, 0x04, 0x07, 0x06, 0x06, 0x06, 0x08, 0x07, 0x07, 0x08, 0x0B, 0x12, + 0x0B, 0x0B, 0x0A, 0x0A, 0x0B, 0x16, 0x0F, 0x10, 0x0D, 0x12, 0x1A, 0x16, 0x1B, 0x1A, 0x19, 0x16, + 0x19, 0x18, 0x1C, 0x20, 0x28, 0x22, 0x1C, 0x1E, 0x26, 0x1E, 0x18, 0x19, 0x23, 0x30, 0x24, 0x26, + 0x2A, 0x2B, 0x2D, 0x2E, 0x2D, 0x1B, 0x22, 0x32, 0x35, 0x31, 0x2C, 0x35, 0x28, 0x2C, 0x2D, 0x2C, + + /* Baseline information */ + 0xFF, 0xC0, 0x00, 0x11, + 0x08, 0x00, 0x84, 0x00, 0x84, 0x03, 0x01, 0x21, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, + + 0xFF, 0xDA, /* JPEG image data begin marker */ + 0x00, 0x0C, + 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, /* Data header */ + + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* Test data */ + 0xFF, 0xD9 /* JPEG image data end marker*/ +}; /* test_rtp_packet_data */ + +#define TEST_LONG_JPEG_Q_TABLE_1_START_POS (2 + 2 + 0x10 + 5) +#define TEST_LONG_JPEG_Q_TABLE_2_START_POS (TEST_LONG_JPEG_Q_TABLE_1_START_POS + TEST_JPEG_Q_TABLE_SIZE + 5) +#define TEST_LONG_JPEG_BASELINE_INFO_START_POS (TEST_LONG_JPEG_Q_TABLE_2_START_POS + TEST_JPEG_Q_TABLE_SIZE) +#define TEST_LONG_JPEG_HUFFMAN_TABLE_START_POS (TEST_LONG_JPEG_BASELINE_INFO_START_POS + 2 + 0x11) +#define TEST_LONG_JPEG_IMAGE_DATA_START_POS (TEST_LONG_JPEG_HUFFMAN_TABLE_START_POS + 2 + 0x1C + 2 + 0x3E + 2 + 0x19 + 2 + 0x23 + 2 + 0x0C) +static UCHAR test_long_rtp_packet_data[] = { 0xFF, 0xD8, /* JPEG file header */ + + /* APP0 */ + 0xFF, 0xE0, 0x00, 0x10, + 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, + + /* Quntization tables */ + 0xFF, 0xDB, 0x00, 0x43, + 0x00, + 0x07, 0x05, 0x05, 0x06, 0x05, 0x04, 0x07, 0x06, 0x06, 0x06, 0x08, 0x07, 0x07, 0x08, 0x0B, 0x12, + 0x0B, 0x0B, 0x0A, 0x0A, 0x0B, 0x16, 0x0F, 0x10, 0x0D, 0x12, 0x1A, 0x16, 0x1B, 0x1A, 0x19, 0x16, + 0x19, 0x18, 0x1C, 0x20, 0x28, 0x22, 0x1C, 0x1E, 0x26, 0x1E, 0x18, 0x19, 0x23, 0x30, 0x24, 0x26, + 0x2A, 0x2B, 0x2D, 0x2E, 0x2D, 0x1B, 0x22, 0x32, 0x35, 0x31, 0x2C, 0x35, 0x28, 0x2C, 0x2D, 0x2C, + 0xFF, 0xDB, 0x00, 0x43, + 0x01, + 0x07, 0x08, 0x08, 0x0B, 0x09, 0x0B, 0x15, 0x0B, 0x0B, 0x15, 0x2C, 0x1D, 0x19, 0x1D, 0x2C, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + + /* Baseline information */ + 0xFF, 0xC0, 0x00, 0x11, + 0x08, 0x00, 0x84, 0x00, 0x84, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, + + /* Huffman tables */ + 0xFF, 0xC4, 0x00, 0x1C, + 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x01, 0x02, 0x08, + 0xFF, 0xC4, 0x00, 0x3E, + 0x10, 0x00, 0x02, 0x01, 0x03, 0x02, 0x03, 0x05, 0x04, 0x06, 0x08, 0x06, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x06, 0x21, 0x31, 0x13, 0x41, 0x51, 0x61, + 0x71, 0x07, 0x22, 0x32, 0x72, 0x14, 0x42, 0x81, 0x91, 0xA1, 0xC1, 0x23, 0x33, 0x43, 0x52, 0x62, + 0xB1, 0xD1, 0xE1, 0x15, 0x24, 0x34, 0x92, 0xA2, 0xF0, 0x44, 0xB2, 0xF1, + 0xFF, 0xC4, 0x00, 0x19, + 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x03, 0x01, 0x04, 0x05, + 0xFF, 0xC4, 0x00, 0x23, + 0x11, 0x00, 0x02, 0x02, 0x02, 0x01, 0x03, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x11, 0x03, 0x31, 0x21, 0x12, 0x22, 0x41, 0x04, 0x13, 0x32, 0x51, 0x61, + 0xF0, + + 0xFF, 0xDA, /* JPEG image data begin marker */ + 0x00, 0x0C, + 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3F, 0x00, /* Data header */ + + /* Test data */ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0xFF, 0xD9 /* JPEG image data end marker*/ +}; /* test_rtp_packet_data */ + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +static TX_SEMAPHORE semaphore_test_0_done; +static TX_SEMAPHORE semaphore_test_1_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern VOID _nx_ram_network_driver_256(NX_IP_DRIVER *driver_req_ptr); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_jpeg_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Session JPEG Send Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_0_done, "semaphore test 0", 0); + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); +} + +static UINT validate_rtp_jpeg_data(UCHAR *data, UINT data_length) +{ +UINT i; +ULONG size_offset; +UCHAR *data_ptr = data; + + + /* The first byte is always 0 */ + if (data_ptr[0] != 0x00) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Compute size_offset and compare with target offset */ + size_offset = (ULONG)(data_ptr[0] << 16 | data_ptr[1] << 8 | data_ptr[2]); + if (size_offset != 0) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 3; + + /* Check rtp/jpeg type, for YUV420 (0x21 in jpeg image), type shall be 0 */ + if (data_ptr[0] != 0x00) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check Q value */ + if (data_ptr[0] != 0xFF) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check jpeg image width and height */ + if ((data_ptr[0] != (0x84 >> 3)) || (data_ptr[1] != (0x84 >> 3))) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 2; + + /* Check quantization table header */ + if (data_ptr[0] != 0x00 || data_ptr[1] != 0x00 || data_ptr[2] != 0x00 || data_ptr[3] != 0x40) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 4; + + /* Check the quantization table */ + for (i = 0; i < TEST_JPEG_Q_TABLE_SIZE; i++) + { + if (data_ptr[i] != test_rtp_packet_data[TEST_JPEG_Q_TABLE_START_POS + i]) + { + return(NX_NOT_SUCCESSFUL); + } + } + data_ptr += TEST_JPEG_Q_TABLE_SIZE; + + /* Check JPEG image data */ + i = 0; + while (data_ptr < (data + data_length)) + { + if (*data_ptr != test_rtp_packet_data[TEST_JPEG_IMAGE_DATA_START_POS + i]) + { + return(NX_NOT_SUCCESSFUL); + } + + i++; + data_ptr++; + } + + return(NX_SUCCESS); +} + +static UINT validate_long_rtp_jpeg_data(UCHAR *data, UINT data_length) +{ +UINT i; +ULONG size_offset; +UCHAR *data_ptr = data; +static ULONG offset = 0; + + /* The first byte is always 0 */ + if (data_ptr[0] != 0x00) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Compute size_offset and compare with target offset */ + size_offset = (ULONG)(data_ptr[0] << 16 | data_ptr[1] << 8 | data_ptr[2]); + if (size_offset != offset) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 3; + + /* Check rtp/jpeg type, for YUV422 (0x22 in jpeg image), type shall be 1 */ + if (data_ptr[0] != 0x01) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check Q value */ + if (data_ptr[0] != 0xFF) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr++; + + /* Check jpeg image width and height */ + if ((data_ptr[0] != (0x84 >> 3)) || (data_ptr[1] != (0x84 >> 3))) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 2; + + /* Only first fragmented packet contains quantization tables */ + if (offset == 0) + { + + /* Check quantization table header */ + if (data_ptr[0] != 0x00 || data_ptr[1] != 0x00 || data_ptr[2] != 0x00 || data_ptr[3] != 0x80) + { + return(NX_NOT_SUCCESSFUL); + } + data_ptr += 4; + + /* Check both 2 quantization tables */ + for (i = 0; i < TEST_JPEG_Q_TABLE_SIZE; i++) + { + if (data_ptr[i] != test_long_rtp_packet_data[TEST_LONG_JPEG_Q_TABLE_1_START_POS + i]) + { + return(NX_NOT_SUCCESSFUL); + } + + if (data_ptr[TEST_JPEG_Q_TABLE_SIZE + i] != test_long_rtp_packet_data[TEST_LONG_JPEG_Q_TABLE_2_START_POS + i]) + { + return(NX_NOT_SUCCESSFUL); + } + } + data_ptr += TEST_JPEG_Q_TABLE_SIZE * 2; + } + + /* Check JPEG image data */ + while (data_ptr < (data + data_length)) + { + if (*data_ptr != test_long_rtp_packet_data[TEST_LONG_JPEG_IMAGE_DATA_START_POS + offset]) + { + return(NX_NOT_SUCCESSFUL); + } + + offset++; + data_ptr++; + } + + return(NX_SUCCESS); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; +ULONG temp_socket_id; + + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* If more than one rtp packet is sent during the first tick, rtcp packet will also be sent more than once. + To make a stable test result, wait for a tick here to avoid this situation. */ + tx_thread_sleep(1); + + /* ---- Test cycle 1 ---- */ + + /* Send jpeg data. */ + status = nx_rtp_sender_session_jpeg_send(&rtp_session_0, test_rtp_packet_data, sizeof(test_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* ---- Test cycle 2 ~ 4 ---- */ + + /* Send jpeg data. */ + status = nx_rtp_sender_session_jpeg_send(&rtp_session_0, test_long_rtp_packet_data, sizeof(test_long_rtp_packet_data), TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_SUCCESS, status); + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Put the semaphore to notify thread 1 it is fine to check resource leakage. */ + tx_semaphore_put(&semaphore_test_0_done); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT j; +UINT status; +UCHAR *data; +UINT test_data_pos = 0; +ULONG offset = 0; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + if (i == 1 || i == 2) + { + CHECK_STATUS((RTP_PAYLOAD_TYPE), *data); + } + else + { + CHECK_STATUS((NX_RTP_HEADER_MARKER_BIT | RTP_PAYLOAD_TYPE), *data); + } + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + if (i == 0) + { + status = validate_rtp_jpeg_data(data, received_packet -> nx_packet_length - 12); + CHECK_STATUS(NX_SUCCESS, status); + } + else if (i >= 1 && i <= 3) + { + status = validate_long_rtp_jpeg_data(data, received_packet -> nx_packet_length - 12); + if (status) + CHECK_STATUS(NX_SUCCESS, status); + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); + + /* Wait for the check in test thread 0 done. */ + status = tx_semaphore_get(&semaphore_test_0_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_jpeg_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Session JPEG Send Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtp_test/netx_rtp_session_packet_send_test.c b/test/regression/rtp_test/netx_rtp_session_packet_send_test.c new file mode 100644 index 00000000..a23b1057 --- /dev/null +++ b/test/regression/rtp_test/netx_rtp_session_packet_send_test.c @@ -0,0 +1,355 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" + +#define DEMO_STACK_SIZE 4096 + +#define NUM_PACKETS 10 +#define PACKET_SIZE 1536 +#define PACKET_POOL_SIZE (NUM_PACKETS * (PACKET_SIZE + sizeof(NX_PACKET))) + +#define RTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define RTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTP_CLIENT_RTP_PORT 6002 +#define RTP_CLIENT_RTCP_PORT 6003 +#define RTP_PAYLOAD_TYPE 96 +#define CNAME "AzureRTOS@microsoft.com" + +/* Define test data. */ +#define TEST_TIMESTAMP 1234 +#define TEST_MSW 123 +#define TEST_LSW 456 + +#define TEST_SAMPLE_FACTOR 2 + +/* Define the number of tests to do */ +#define TEST_CYCLES 7 + +static UCHAR test_rtp_packet_data[] = "test rtp packet data"; +static UCHAR test_long_rtp_packet_data[200]; + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD ntest_0; +static TX_THREAD ntest_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_IP ip_1; +static NX_UDP_SOCKET rtp_client_socket; + +static TX_SEMAPHORE semaphore_test_0_done; +static TX_SEMAPHORE semaphore_test_1_done; + +/* Define rtp sender control block. */ +static NX_RTP_SENDER rtp_0; +static NX_RTP_SESSION rtp_session_0; +static UINT rtp_port; +static UINT rtcp_port; + + +/* Define thread prototypes. */ + +static void ntest_0_entry(ULONG thread_input); +static void ntest_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT status); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_packet_send_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTP Session Packet Send Test............................................"); + + /* Setup the working pointer. */ + pointer = (CHAR *)first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", PACKET_SIZE, pointer, PACKET_POOL_SIZE); + pointer = pointer + PACKET_POOL_SIZE; + CHECK_STATUS(0, status); + + /* Create server IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", RTP_SERVER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Create client IP instance. */ + status = nx_ip_create(&ip_1, "NetX IP Instance 1", RTP_CLIENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&ip_0); + CHECK_STATUS(0, status); + status = nx_udp_enable(&ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores for test done notification */ + tx_semaphore_create(&semaphore_test_0_done, "semaphore test 0", 0); + tx_semaphore_create(&semaphore_test_1_done, "semaphore test 1", 0); +} + +/* Define server threads. */ +static void ntest_0_entry(ULONG thread_input) +{ +UINT status; +NXD_ADDRESS client_ip_address; +NX_PACKET *send_packet; +UINT time_start; +ULONG temp_socket_id; + + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_0, &ip_0, &pool_0, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Get the udp port pair for rtp and rtcp */ + status = nx_rtp_sender_port_get(&rtp_0, &rtp_port, &rtcp_port); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = RTP_CLIENT_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_0, &rtp_session_0, RTP_PAYLOAD_TYPE, + 0, &client_ip_address, + RTP_CLIENT_RTP_PORT, RTP_CLIENT_RTCP_PORT); + CHECK_STATUS(0, status); + + /* If more than one rtp packet is sent during the first tick, rtcp packet will also be sent more than once. + To make a stable test result, wait for a tick here to avoid this situation. */ + tx_thread_sleep(1); + + /* ---- Test cycle 1 ---- */ + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(send_packet, (void*)test_rtp_packet_data, sizeof(test_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + +#ifndef TX_DISABLE_ERROR_CHECKING + /* Reserver the rtp socket id, set the rtp socket id to 0 to force the send fail */ + temp_socket_id = rtp_session_0.nx_rtp_sender -> nx_rtp_sender_rtp_socket.nx_udp_socket_id; + rtp_session_0.nx_rtp_sender -> nx_rtp_sender_rtp_socket.nx_udp_socket_id = 0; + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Recover the socket id */ + rtp_session_0.nx_rtp_sender -> nx_rtp_sender_rtp_socket.nx_udp_socket_id = temp_socket_id; + + /* Check if the function can return error status when prepend pointer is incorrect */ + send_packet -> nx_packet_prepend_ptr--; + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(NX_UNDERFLOW, status); + + /* Set back prepend pointer to correct position and check the send function could execute correctly */ + send_packet -> nx_packet_prepend_ptr++; +#endif /* TX_DISABLE_ERROR_CHECKING */ + + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + /* ---- Test cycle 2 ~ 4 ---- */ + send_packet = NX_NULL; + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet many times to have 3 fragmentation packets. */ + for (UINT i = 0; i < sizeof(test_long_rtp_packet_data); i++) + { + test_long_rtp_packet_data[i] = i % 100; + } + status = nx_packet_data_append(send_packet, (void*)test_long_rtp_packet_data, sizeof(test_long_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + /* ---- Test cycle 5 ~ 7 ---- */ + send_packet = NX_NULL; + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &send_packet, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + status = nx_packet_data_append(send_packet, (void*)test_long_rtp_packet_data, sizeof(test_long_rtp_packet_data), rtp_0.nx_rtp_sender_ip_ptr->nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Set the sample factor to trigger sample-based mode, and then send fragmentation packets in order to observer timestamp automatical change */ + status = nx_rtp_sender_session_sample_factor_set(&rtp_session_0, TEST_SAMPLE_FACTOR); + status = nx_rtp_sender_session_packet_send(&rtp_session_0, send_packet, TEST_TIMESTAMP, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + /* Wait for the check in test thread 1 done. */ + status = tx_semaphore_get(&semaphore_test_1_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Delete and release resources */ + status = nx_rtp_sender_session_delete(&rtp_session_0); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_delete(&rtp_0); + CHECK_STATUS(0, status); + + /* Put the semaphore to notify thread 1 it is fine to check resource leakage. */ + tx_semaphore_put(&semaphore_test_0_done); +} + +/* Define the client threads. */ +static void ntest_1_entry(ULONG thread_input) +{ +NX_PACKET *received_packet; +UINT status; +UCHAR *data; +UINT test_data_pos = 0; + + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&ip_1, &rtp_client_socket, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_socket, RTP_CLIENT_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for (UINT i = 0; i < TEST_CYCLES; i++) + { + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_socket, &received_packet, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + /* Validate RTP payload data */ + data = received_packet -> nx_packet_prepend_ptr; + + /* Check RTP version byte */ + CHECK_STATUS(0x80, *data); + + /* Move to check RTP data byte for payload type with marker */ + data++; + if (i == 1 || i == 2) + { + CHECK_STATUS((RTP_PAYLOAD_TYPE), *data); + } + else + { + CHECK_STATUS((NX_RTP_HEADER_MARKER_BIT | RTP_PAYLOAD_TYPE), *data); + } + + /* Move to check RTP data bytes for sequence number */ + data++; + CHECK_STATUS((rtp_session_0.nx_rtp_session_sequence_number - 1), (data[0] << 8 | data[1])); + + /* Move to check RTP data bytes for time stamp */ + data += 2; + CHECK_STATUS(rtp_session_0.nx_rtp_session_rtp_timestamp, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for ssrc */ + data += 4; + CHECK_STATUS(rtp_session_0.nx_rtp_session_ssrc, (ULONG)(data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3])); + + /* Move to check RTP data bytes for data payload */ + data += 4; + if (i == 0) + { + for (UINT j = 0; j < sizeof(test_rtp_packet_data); j++) + { + CHECK_STATUS(*(test_rtp_packet_data + j), data[j]); + } + } + else if (i >= 1 && i <= 6) + { + + /* Check fragmentation packets in frame-based mode */ + while (data < received_packet -> nx_packet_append_ptr) + { + CHECK_STATUS(test_long_rtp_packet_data[test_data_pos], *data); + test_data_pos++; + data++; + } + + /* Check and reset test data position for following test to use */ + if (i == 3 || i == 6) + { + test_data_pos = 0; + } + } + + /* Release the receive packet when the check finishes. */ + nx_packet_release(received_packet); + } + + /* Set the flag to notify test thread 0 that the check finishes. */ + tx_semaphore_put(&semaphore_test_1_done); + + /* Wait for the check in test thread 0 done. */ + status = tx_semaphore_get(&semaphore_test_0_done, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check if there is memory leak. */ + CHECK_STATUS(pool_0.nx_packet_pool_total, pool_0.nx_packet_pool_available); + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtp_session_packet_send_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTP Session Packet Send Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_api_test.c b/test/regression/rtsp_test/netx_rtsp_api_test.c new file mode 100644 index 00000000..24069021 --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_api_test.c @@ -0,0 +1,312 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_ERROR_CHECKING) && defined(__PRODUCT_NETXDUO__) +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 + +#define TEST_RTSP_STACK_SIZE 2048 +#define TEST_RTSP_SERVER_PORT 554 +#define TEST_RTSP_SERVER_PRIORITY 3 + +/* Define the ThreadX object control blocks... */ + +static TX_THREAD test_thread; + +/* Define the ThreadX object control blocks... */ + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define rtsp server control block. */ +static NX_RTSP_SERVER rtsp_0; + +static UCHAR rtsp_stack[TEST_RTSP_STACK_SIZE]; + +/* Define thread prototypes. */ + +static void test_entry(ULONG thread_input); + +static UINT describe_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + return 0; +} + +static UINT setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ + return 0; +} + +static UINT play_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return 0; +} + +static UINT set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return 0; +} + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_api_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&test_thread, "Test thread", test_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); +} + +void test_entry(ULONG thread_input) +{ +UINT status; +UCHAR test_sdp[] = "test_sdp"; +UCHAR test_track_id[] = "test_track_id"; +NX_RTSP_CLIENT *client_ptr; +NX_RTSP_CLIENT_REQUEST test_request; +NX_PACKET test_packet; + + + /* Print out test information banner. */ + printf("NetX Test: RTSP API Test............................................."); + + memset(&rtsp_0, 0, sizeof(NX_RTSP_SERVER)); + + /* Test nx_rtsp_server_create. */ + status = nx_rtsp_server_create(NX_NULL, "RTSP Server", sizeof("RTSP Server") - 1, &ip_0, &pool_0, rtsp_stack, + TEST_RTSP_STACK_SIZE, TEST_RTSP_SERVER_PRIORITY, TEST_RTSP_SERVER_PORT, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_create(&rtsp_0, "RTSP Server", sizeof("RTSP Server") - 1, NX_NULL, &pool_0, rtsp_stack, + TEST_RTSP_STACK_SIZE, TEST_RTSP_SERVER_PRIORITY, TEST_RTSP_SERVER_PORT, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_create(&rtsp_0, "RTSP Server", sizeof("RTSP Server") - 1, &ip_0, NX_NULL, rtsp_stack, + TEST_RTSP_STACK_SIZE, TEST_RTSP_SERVER_PRIORITY, TEST_RTSP_SERVER_PORT, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_create(&rtsp_0, "RTSP Server", sizeof("RTSP Server") - 1, &ip_0, &pool_0, NX_NULL, + TEST_RTSP_STACK_SIZE, TEST_RTSP_SERVER_PRIORITY, TEST_RTSP_SERVER_PORT, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + status = nx_rtsp_server_create(&rtsp_0, "RTSP Server", sizeof("RTSP Server") - 1, &ip_0, &pool_0, rtsp_stack, + TEST_RTSP_STACK_SIZE, TEST_RTSP_SERVER_PRIORITY, TEST_RTSP_SERVER_PORT, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + + /* Test nx_rtsp_server_delete. */ + status = nx_rtsp_server_delete(NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_delete(&rtsp_0); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test nx_rtsp_server_start. */ + status = nx_rtsp_server_start(NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_start(&rtsp_0); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Test nx_rtsp_server_stop. */ + status = nx_rtsp_server_stop(NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_stop(&rtsp_0); + CHECK_STATUS(NX_PTR_ERROR, status); + + /* Initialize the client structure. */ + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + client_ptr = &(rtsp_0.nx_rtsp_server_client_list[0]); + client_ptr -> nx_rtsp_client_server_ptr = &rtsp_0; + client_ptr -> nx_rtsp_client_request_ptr = &test_request; + client_ptr -> nx_rtsp_client_response_packet = &test_packet; + + /* Test nx_rtsp_server_sdp_set. */ + test_request.nx_rtsp_client_request_method = NX_RTSP_METHOD_SETUP; + status = nx_rtsp_server_sdp_set(NX_NULL, test_sdp, sizeof(test_sdp) - 1); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_sdp_set(client_ptr, NX_NULL, sizeof(test_sdp) - 1); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_sdp_set(client_ptr, test_sdp, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = NX_NULL; + status = nx_rtsp_server_sdp_set(client_ptr, test_sdp, sizeof(test_sdp) - 1); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = &rtsp_0; + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_sdp_set(client_ptr, test_sdp, sizeof(test_sdp) - 1); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + client_ptr -> nx_rtsp_client_response_packet = NX_NULL; + status = nx_rtsp_server_sdp_set(client_ptr, test_sdp, sizeof(test_sdp) - 1); + CHECK_STATUS(NX_RTSP_SERVER_NO_PACKET, status); + client_ptr -> nx_rtsp_client_response_packet = &test_packet; + test_request.nx_rtsp_client_request_method = NX_RTSP_METHOD_PLAY; + status = nx_rtsp_server_sdp_set(client_ptr, test_sdp, sizeof(test_sdp) - 1); + CHECK_STATUS(NX_RTSP_SERVER_INVALID_REQUEST, status); + + /* Test nx_rtsp_server_rtp_info_set. */ + status = nx_rtsp_server_rtp_info_set(NX_NULL, test_track_id, sizeof(test_track_id) - 1, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_rtp_info_set(client_ptr, NX_NULL, sizeof(test_track_id) - 1, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_rtp_info_set(client_ptr, test_track_id, 0, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = NX_NULL; + status = nx_rtsp_server_rtp_info_set(client_ptr, test_track_id, sizeof(test_track_id) - 1, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = &rtsp_0; + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_rtp_info_set(client_ptr, test_track_id, sizeof(test_track_id) - 1, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + client_ptr -> nx_rtsp_client_response_packet = NX_NULL; + status = nx_rtsp_server_rtp_info_set(client_ptr, test_track_id, sizeof(test_track_id) - 1, 0, 0); + CHECK_STATUS(NX_RTSP_SERVER_NO_PACKET, status); + client_ptr -> nx_rtsp_client_response_packet = &test_packet; + test_request.nx_rtsp_client_request_method = NX_RTSP_METHOD_PAUSE; + status = nx_rtsp_server_rtp_info_set(client_ptr, test_track_id, sizeof(test_track_id) - 1, 0, 0); + CHECK_STATUS(NX_RTSP_SERVER_INVALID_REQUEST, status); + + /* Test nx_rtsp_server_range_npt_set. */ + status = nx_rtsp_server_range_npt_set(NX_NULL, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = NX_NULL; + status = nx_rtsp_server_range_npt_set(client_ptr, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = &rtsp_0; + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_range_npt_set(client_ptr, 0, 0); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + test_request.nx_rtsp_client_request_method = NX_RTSP_METHOD_DESCRIBE; + status = nx_rtsp_server_range_npt_set(client_ptr, 0, 0); + CHECK_STATUS(NX_RTSP_SERVER_INVALID_REQUEST, status); + test_request.nx_rtsp_client_request_method = NX_RTSP_METHOD_PLAY; + status = nx_rtsp_server_range_npt_set(client_ptr, 1, 0); + CHECK_STATUS(NX_RTSP_SERVER_INVALID_PARAMETER, status); + + /* Test nx_rtsp_server_error_response_send. */ + status = nx_rtsp_server_error_response_send(NX_NULL, 200); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = NX_NULL; + status = nx_rtsp_server_error_response_send(client_ptr, 200); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = &rtsp_0; + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_error_response_send(client_ptr, 200); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + client_ptr -> nx_rtsp_client_response_packet = NX_NULL; + status = nx_rtsp_server_error_response_send(client_ptr, 200); + CHECK_STATUS(NX_RTSP_SERVER_NO_PACKET, status); + client_ptr -> nx_rtsp_client_response_packet = &test_packet; + status = nx_rtsp_server_error_response_send(client_ptr, 0); + CHECK_STATUS(NX_RTSP_SERVER_INVALID_PARAMETER, status); + + /* Test nx_rtsp_server_keepalive_update. */ + status = nx_rtsp_server_keepalive_update(NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = NX_NULL; + status = nx_rtsp_server_keepalive_update(client_ptr); + CHECK_STATUS(NX_PTR_ERROR, status); + client_ptr -> nx_rtsp_client_server_ptr = &rtsp_0; + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_keepalive_update(client_ptr); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Test nx_rtsp_server_describe_callback_set. */ + status = nx_rtsp_server_describe_callback_set(NX_NULL, describe_teardown_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_describe_callback_set(&rtsp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_describe_callback_set(&rtsp_0, describe_teardown_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Test nx_rtsp_server_teardown_callback_set. */ + status = nx_rtsp_server_teardown_callback_set(NX_NULL, describe_teardown_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_teardown_callback_set(&rtsp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_teardown_callback_set(&rtsp_0, describe_teardown_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Test nx_rtsp_server_setup_callback_set. */ + status = nx_rtsp_server_setup_callback_set(NX_NULL, setup_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_setup_callback_set(&rtsp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_setup_callback_set(&rtsp_0, setup_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Test nx_rtsp_server_play_callback_set. */ + status = nx_rtsp_server_play_callback_set(NX_NULL, play_pause_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_play_callback_set(&rtsp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_play_callback_set(&rtsp_0, play_pause_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Test nx_rtsp_server_pause_callback_set. */ + status = nx_rtsp_server_pause_callback_set(NX_NULL, play_pause_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_pause_callback_set(&rtsp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_pause_callback_set(&rtsp_0, play_pause_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Test nx_rtsp_server_set_parameter_callback_set. */ + status = nx_rtsp_server_set_parameter_callback_set(NX_NULL, set_parameter_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + status = nx_rtsp_server_set_parameter_callback_set(&rtsp_0, NX_NULL); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = 0; + status = nx_rtsp_server_set_parameter_callback_set(&rtsp_0, set_parameter_callback); + CHECK_STATUS(NX_PTR_ERROR, status); + rtsp_0.nx_rtsp_server_id = NX_RTSP_SERVER_ID; + + /* Return the test result. */ + printf("SUCCESS!\n"); + test_control_return(0); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_api_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP API Test.............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_client_timeout_test.c b/test/regression/rtsp_test/netx_rtsp_client_timeout_test.c new file mode 100644 index 00000000..d164d577 --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_client_timeout_test.c @@ -0,0 +1,952 @@ +/* This case tests: + 1. Client 0 and client 1 connect to RTSP server; + 2. CLient 2 tries to connect to RTSP server but fails because the NX_RTSP_SERVER_MAX_CLIENTS is 2; + 3. Client 0 is timeout after NX_RTSP_SERVER_ACTIVITY_TIMEOUT; + 4. Client 1 keeps alive by calling the nx_rtsp_server_keepalive_update(); + 5. Client 2 connects to RTSP server successfully because client 0 is disconnected after timeout. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nx_rtsp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && (NX_RTSP_SERVER_MAX_CLIENTS == 2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; +static UCHAR thread_2_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread_0; +static NX_PACKET_POOL client_pool_0; +static NX_IP client_ip_0; +static NX_TCP_SOCKET rtsp_client_0; + +static TX_THREAD client_thread_1; +static NX_PACKET_POOL client_pool_1; +static NX_IP client_ip_1; +static NX_TCP_SOCKET rtsp_client_1; + +static TX_THREAD client_thread_2; +static NX_TCP_SOCKET rtsp_client_2; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_0_done; +static TX_SEMAPHORE semaphore_client_1_done; +static TX_SEMAPHORE semaphore_client_2_done; +static TX_SEMAPHORE semaphore_client_connected; +static TX_SEMAPHORE semaphore_client_disconnected; + +static void thread_client_0_entry(ULONG thread_input); +static void thread_client_1_entry(ULONG thread_input); +static void thread_client_2_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_0_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_CLIENT_1_ADDRESS IP_ADDRESS(1,2,3,6) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID_0 23754311 +#define RTSP_SESSION_ID_1 23754312 +#define RTSP_SESSION_ID_2 23754313 + +#define RTP_SERVER_RTP_PORT 6002 +#define RTP_SERVER_RTCP_PORT 6003 +#define RTP_0_RTP_PORT 49752 +#define RTP_0_RTCP_PORT 49753 +#define RTP_1_RTP_PORT 49754 +#define RTP_1_RTCP_PORT 49755 +#define RTP_2_RTP_PORT 49756 +#define RTP_2_RTCP_PORT 49757 + +#define RTP_0_SSRC 1111 +#define RTP_1_SSRC 2222 +#define RTP_2_SSRC 3333 +#define RTP_0_VIDEO_SEQ 1234 +#define RTP_1_VIDEO_SEQ 1235 +#define RTP_2_VIDEO_SEQ 1236 +#define RTP_TIMESTAMP_INIT_VALUE 40 + +static UCHAR rtsp_option_request_0[] = "\ +OPTIONS rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_option_request_1[] = "\ +OPTIONS rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_option_request_2[] = "\ +OPTIONS rtsp://1.2.3.4:554/stream2 RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request_0[] = "\ +DESCRIBE rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request_1[] = "\ +DESCRIBE rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request_2[] = "\ +DESCRIBE rtsp://1.2.3.4:554/stream2 RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://1.2.3.4:554/stream0/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://1.2.3.4:554/stream1/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_2[] = "\ +SETUP rtsp://1.2.3.4:554/stream2/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49756-49757\r\n\r\n\ +"; + +static UCHAR rtsp_play_request_0[] = "\ +PLAY rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_play_request_1[] = "\ +PLAY rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754312\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_play_request_2[] = "\ +PLAY rtsp://1.2.3.4:554/stream2 RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754313\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_INDEX, + PLAY_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list_0[] = +{ +rtsp_option_request_0, +rtsp_describe_request_0, +rtsp_setup_request_0, +rtsp_play_request_0, +}; + +static UCHAR *rtsp_request_list_1[] = +{ +rtsp_option_request_1, +rtsp_describe_request_1, +rtsp_setup_request_1, +rtsp_play_request_1, +}; + +static UCHAR *rtsp_request_list_2[] = +{ +rtsp_option_request_2, +rtsp_describe_request_2, +rtsp_setup_request_2, +rtsp_play_request_2, +}; + +static UINT rtsp_request_size_0[] = +{ +sizeof(rtsp_option_request_0) - 1, +sizeof(rtsp_describe_request_0) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_play_request_0) - 1, +}; + +static UINT rtsp_request_size_1[] = +{ +sizeof(rtsp_option_request_1) - 1, +sizeof(rtsp_describe_request_1) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request_1) - 1, +}; + +static UINT rtsp_request_size_2[] = +{ +sizeof(rtsp_option_request_2) - 1, +sizeof(rtsp_describe_request_2) - 1, +sizeof(rtsp_setup_request_2) - 1, +sizeof(rtsp_play_request_2) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size_0) / sizeof(UINT); + +static NX_RTSP_CLIENT *rtsp_client_ptr_0 = NX_NULL, *rtsp_client_ptr_1 = NX_NULL, *rtsp_client_ptr_2 = NX_NULL; + +static UINT disconnect_count = 0; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +"; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_client_timeout_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_0, "Test Client 0", thread_client_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_0, "Test Client Packet Pool 0", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_0, "Test Client IP 0", TEST_CLIENT_0_ADDRESS, + 0xFFFFFF00UL, &client_pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_1, "Test Client 1", thread_client_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_1, "Test Client Packet Pool 1", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_1, "Test Client IP 1", TEST_CLIENT_1_ADDRESS, + 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_2, "Test Client 2", thread_client_2_entry, 0, + thread_2_stack, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_0_done, "semaphore client 0 done", 0); + tx_semaphore_create(&semaphore_client_1_done, "semaphore client 1 done", 0); + tx_semaphore_create(&semaphore_client_2_done, "semaphore client 2 done", 0); + tx_semaphore_create(&semaphore_client_connected, "semaphore client connected", 0); + tx_semaphore_create(&semaphore_client_disconnected, "semaphore client disconnected", 0); +} + +void thread_client_0_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_0, &rtsp_client_0, "Test Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_0, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_0, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_client_connected); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_0, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list_0[i], rtsp_request_size_0[i], &client_pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_0, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%d", + RTP_0_RTP_PORT, RTP_0_RTCP_PORT, RTP_SERVER_RTP_PORT, RTP_SERVER_RTCP_PORT, RTP_0_SSRC); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/stream0/trackID=0;seq=%d;rtptime=%d", + RTP_0_VIDEO_SEQ, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + tx_thread_sleep((NX_RTSP_SERVER_ACTIVITY_TIMEOUT + 5) * NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_0_done); +} + +void thread_client_1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_1, &rtsp_client_1, "Test Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_1, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_1, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_client_connected); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_1, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list_1[i], rtsp_request_size_1[i], &client_pool_1, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_1, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%d", + RTP_1_RTP_PORT, RTP_1_RTCP_PORT, RTP_SERVER_RTP_PORT, RTP_SERVER_RTCP_PORT, RTP_1_SSRC); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/stream1/trackID=0;seq=%d;rtptime=%d", + RTP_1_VIDEO_SEQ, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + while (i < (NX_RTSP_SERVER_ACTIVITY_TIMEOUT + 5)) + { + nx_rtsp_server_keepalive_update(rtsp_client_ptr_1); + tx_thread_sleep(NX_IP_PERIODIC_RATE); + i++; + } + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_1_done); +} + +void thread_client_2_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_0, &rtsp_client_2, "Test Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_2, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait until other clients are connected. */ + tx_semaphore_get(&semaphore_client_connected, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_client_connected, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_2, &server_ip_address, RTSP_SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(NX_NOT_CONNECTED, status); + + /* Wait until one client is disconnected. */ + tx_semaphore_get(&semaphore_client_disconnected, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_2, &server_ip_address, RTSP_SERVER_PORT, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_0, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list_2[i], rtsp_request_size_2[i], &client_pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_2, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_2, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%d", + RTP_2_RTP_PORT, RTP_2_RTCP_PORT, RTP_SERVER_RTP_PORT, RTP_SERVER_RTCP_PORT, RTP_2_SSRC); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/stream2/trackID=0;seq=%d;rtptime=%d", + RTP_2_VIDEO_SEQ, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_2_done); +} + + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: RTSP Client Timeout Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + nx_rtsp_server_start(&rtsp_server); + + tx_semaphore_put(&semaphore_server_start); + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_client_0_done, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_client_1_done, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_client_2_done, NX_WAIT_FOREVER); + + if ((disconnect_count != 1) || rtsp_server.nx_rtsp_server_connected_client_count != 2) + { + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_0.nx_packet_pool_available != client_pool_0.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_1.nx_packet_pool_available != client_pool_1.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status = NX_SUCCESS; + + transport_ptr -> server_rtp_port = RTP_SERVER_RTP_PORT; + transport_ptr -> server_rtcp_port = RTP_SERVER_RTCP_PORT; + + if (strstr(uri, "stream0")) + { + + /* Obtain generated ssrc */ + transport_ptr -> rtp_ssrc = RTP_0_SSRC; + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID_0; + + /* Store the client pointer. */ + rtsp_client_ptr_0 = rtsp_client_ptr; + } + else if (strstr(uri, "stream1")) + { + + /* Obtain generated ssrc */ + transport_ptr -> rtp_ssrc = RTP_1_SSRC; + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID_1; + + /* Store the client pointer. */ + rtsp_client_ptr_1 = rtsp_client_ptr; + } + else if (strstr(uri, "stream2")) + { + + /* Obtain generated ssrc */ + transport_ptr -> rtp_ssrc = RTP_2_SSRC; + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID_2; + + /* Store the client pointer. */ + rtsp_client_ptr_2 = rtsp_client_ptr; + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + if (strstr(uri, "stream0")) + { + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, RTP_0_VIDEO_SEQ, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + } + else if (strstr(uri, "stream1")) + { + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, RTP_1_VIDEO_SEQ, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + } + else if (strstr(uri, "stream2")) + { + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, RTP_2_VIDEO_SEQ, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + if (rtsp_client_ptr != rtsp_client_ptr_0) + { + error_counter++; + } + disconnect_count++; + tx_semaphore_put(&semaphore_client_disconnected); + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_client_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP Client Timeout Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_delete_beforehand_test.c b/test/regression/rtsp_test/netx_rtsp_delete_beforehand_test.c new file mode 100644 index 00000000..fd23fc1e --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_delete_beforehand_test.c @@ -0,0 +1,695 @@ +/* This case tests RTSP with RTP. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_TCP_SOCKET rtsp_client; +static NX_UDP_SOCKET rtp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_video; +static NX_RTP_SESSION rtp_session_audio; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_done; +static TX_SEMAPHORE semaphore_play; +static TX_SEMAPHORE semaphore_rtp_send; +static TX_SEMAPHORE semaphore_pause_received; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID 23754311 +#define RTP_VIDEO_RTP_PORT 49752 +#define RTP_VIDEO_RTCP_PORT 49753 +#define RTP_AUDIO_RTP_PORT 49754 +#define RTP_AUDIO_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_PAYLOAD_TYPE_AUDIO 97 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 + +static UCHAR rtsp_option_request[] = "\ +OPTIONS rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request[] = "\ +DESCRIBE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=1 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_play_request[] = "\ +PLAY rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_pause_request[] = "\ +PAUSE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request[] = "\ +TEARDOWN rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_0_INDEX, + SETUP_1_INDEX, + PLAY_INDEX, + PAUSE_INDEX, +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list[] = +{ +rtsp_option_request, +rtsp_describe_request, +rtsp_setup_request_0, +rtsp_setup_request_1, +rtsp_play_request, +rtsp_pause_request, +}; + +static UINT rtsp_request_size[] = +{ +sizeof(rtsp_option_request) - 1, +sizeof(rtsp_describe_request) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request) - 1, +sizeof(rtsp_pause_request) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +m=audio 0 RTP/AVP 97\r\n\ +a=rtpmap:97 mpeg4-generic/44100/1\r\n\ +a=fmtp:97 SizeLength=13\r\n\ +a=control:trackID=1\r\n"; + +static UINT video_seq = 0, audio_seq = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_delete_beforehand_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_done, "semaphore client done", 0); + tx_semaphore_create(&semaphore_play, "semaphore play", 0); + tx_semaphore_create(&semaphore_rtp_send, "semaphore rtp send", 0); + tx_semaphore_create(&semaphore_pause_received, "semaphore teardown received", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; +ULONG content_length = 0; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip, &rtsp_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip, &rtp_client, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Since the test for teardown command is changed, break after send the request. */ + if (i == (rtsp_request_num - 1)) + { + + tx_semaphore_get(&semaphore_pause_received, NX_WAIT_FOREVER); + + /* Delete the server before nx_rtsp_server_disconnect called. + This test is to see if the server can be deleted normally. */ + nx_rtsp_server_delete(&rtsp_server); + break; + } + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the Content-length field. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Content-Length: "); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + /* Skip 16 bytes field header. */ + buffer_ptr += 16; + + /* Convert the length into a numeric value. */ + while ((buffer_ptr < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr >= '0') && (*buffer_ptr <= '9')) + { + + /* Update the content length. */ + content_length = content_length * 10; + content_length += (UINT)(*buffer_ptr) - '0'; + + /* Move the buffer pointer forward. */ + buffer_ptr++; + } + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + /* Skip 4 bytes terminators. */ + buffer_ptr += 4; + + /* Check content length. */ + CHECK_STATUS(content_length, (packet_ptr -> nx_packet_append_ptr - buffer_ptr)); + + /* Check the sdp information. */ + status = memcmp(buffer_ptr, sdp, (ULONG)strlen(sdp)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_video.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_audio.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://1.2.3.4:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-30.0", sizeof("Range: npt=0.0-30.0") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PAUSE_INDEX) + { + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=10.0-30.0", sizeof("Range: npt=10.0-30.0") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_done); + nx_tcp_client_socket_unbind(&rtsp_client); + nx_tcp_socket_delete(&rtsp_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Delete Beforehand Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 5, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_play, NX_WAIT_FOREVER); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_video, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_video, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send); + + tx_semaphore_get(&semaphore_client_done, NX_WAIT_FOREVER); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + if (strstr(uri, "trackID=0")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_video, RTP_PAYLOAD_TYPE_VIDEO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_video, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID; + } + else if (strstr(uri, "trackID=1")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_audio, RTP_PAYLOAD_TYPE_AUDIO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_audio, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_video, &video_seq); + nx_rtp_sender_session_sequence_number_get(&rtp_session_audio, &audio_seq); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=1", sizeof("trackID=1") - 1, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 0, 30000); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play); + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + return(NX_NOT_SUCCESSFUL); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 10000, 30000); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_pause_received); + + return(status); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_delete_beforehand_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Delete Beforehand Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_error_response_test.c b/test/regression/rtsp_test/netx_rtsp_error_response_test.c new file mode 100644 index 00000000..fa331ec4 --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_error_response_test.c @@ -0,0 +1,402 @@ +/* This case tests sending error response. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_TCP_SOCKET rtsp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_done; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTSP_SERVER_PORT 554 + +static UCHAR rtsp_setup_request_tcp[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP/TCP;unicast;interleaved=0-1\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_multicast[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;multicast;destination=225.219.201.15;port=7000-7001;ttl=127\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_unicast_error_id[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\ +Session: 23754322\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_unicast_no_port[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_set_parameter[] = "\ +SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/1.0\r\n\ +CSeq: 5\r\n\ +Session: 23754311\r\n\ +Content-length: 20\r\n\ +Content-type: text/parameters\r\n\ +\r\n\ +barparam: barstuff\r\n\ +"; + +static UCHAR error_response_461[] = "RTSP/1.0 461 UNSUPPORTED TRANSPORT\r\nCSeq: 5\r\nServer: RTSP Server\r\n\r\n"; + +static UCHAR error_response_454[] = "RTSP/1.0 454 SESSION NOT FOUND\r\nCSeq: 5\r\nServer: RTSP Server\r\n\r\n"; + +static UCHAR error_response_458[] = "RTSP/1.0 458 PARAMETER IS READONLY\r\nCSeq: 5\r\nServer: RTSP Server\r\n\r\n"; + +static UCHAR *rtsp_request_list[] = +{ +rtsp_setup_request_tcp, +rtsp_setup_request_multicast, +rtsp_setup_request_unicast_error_id, +rtsp_setup_request_unicast_no_port, +rtsp_setup_request_set_parameter, +}; + +static UINT rtsp_request_size[] = +{ +sizeof(rtsp_setup_request_tcp) - 1, +sizeof(rtsp_setup_request_multicast) - 1, +sizeof(rtsp_setup_request_unicast_error_id) - 1, +sizeof(rtsp_setup_request_unicast_no_port) - 1, +sizeof(rtsp_setup_request_set_parameter) - 1, +}; + +static UCHAR *rtsp_response_list[] = +{ +error_response_461, +error_response_461, +error_response_454, +error_response_461, +error_response_458, +}; + +static UINT rtsp_response_size[] = +{ +sizeof(error_response_461) - 1, +sizeof(error_response_461) - 1, +sizeof(error_response_454) - 1, +sizeof(error_response_461) - 1, +sizeof(error_response_458) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size) / sizeof(UINT); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_error_response_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_done, "semaphore client done", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip, &rtsp_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + for (i = 0 ; i < rtsp_request_num; i++) + { + + status = nxd_tcp_client_socket_connect(&rtsp_client, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + for (j = 0; j < NX_RTSP_SERVER_MAX_CLIENTS; j++) + { + rtsp_server.nx_rtsp_server_client_list[j].nx_rtsp_client_session_id = 23754311; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from server. */ + status = nx_tcp_socket_receive(&rtsp_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, rtsp_response_list[i], rtsp_response_size[i]); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + nx_tcp_socket_disconnect(&rtsp_client, NX_IP_PERIODIC_RATE); + } + + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_done); + nx_tcp_client_socket_unbind(&rtsp_client); + nx_tcp_socket_delete(&rtsp_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTSP Error Response Test.................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + nx_rtsp_server_start(&rtsp_server); + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_client_done, NX_WAIT_FOREVER); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ +UINT status; + + status = nx_rtsp_server_error_response_send(rtsp_client_ptr, NX_RTSP_STATUS_CODE_PARAMETER_IS_READONLY); + CHECK_STATUS(0, status); + + return(NX_RTSP_STATUS_CODE_PARAMETER_IS_READONLY); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_error_response_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP Error Response Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_multiple_clients_test.c b/test/regression/rtsp_test/netx_rtsp_multiple_clients_test.c new file mode 100644 index 00000000..5f178f3f --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_multiple_clients_test.c @@ -0,0 +1,871 @@ +/* This case tests RTSP server connects with multiple clients. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" +#if defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" +#endif + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && (NX_RTSP_SERVER_MAX_CLIENTS >= 2) + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread_0; +static NX_PACKET_POOL client_pool_0; +static NX_IP client_ip_0; +static NX_TCP_SOCKET rtsp_client_0; +static NX_UDP_SOCKET rtp_client_0; + +static TX_THREAD client_thread_1; +static NX_PACKET_POOL client_pool_1; +static NX_IP client_ip_1; +static NX_TCP_SOCKET rtsp_client_1; +static NX_UDP_SOCKET rtp_client_1; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_0; +static NX_RTP_SESSION rtp_session_1; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_0_done; +static TX_SEMAPHORE semaphore_client_1_done; +static TX_SEMAPHORE semaphore_play_0; +static TX_SEMAPHORE semaphore_rtp_0_send; +static TX_SEMAPHORE semaphore_play_1; +static TX_SEMAPHORE semaphore_rtp_1_send; + +static void thread_client_0_entry(ULONG thread_input); +static void thread_client_1_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_0_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_CLIENT_1_ADDRESS IP_ADDRESS(1,2,3,6) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID_0 23754311 +#define RTSP_SESSION_ID_1 23754312 +#define RTP_0_RTP_PORT 49752 +#define RTP_0_RTCP_PORT 49753 +#define RTP_1_RTP_PORT 49754 +#define RTP_1_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 + +static UCHAR rtsp_option_request_0[] = "\ +OPTIONS rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_option_request_1[] = "\ +OPTIONS rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request_0[] = "\ +DESCRIBE rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request_1[] = "\ +DESCRIBE rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://1.2.3.4:554/stream0/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://1.2.3.4:554/stream1/trackID=0 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\r\n\ +"; + +static UCHAR rtsp_play_request_0[] = "\ +PLAY rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_play_request_1[] = "\ +PLAY rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754312\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request_0[] = "\ +TEARDOWN rtsp://1.2.3.4:554/stream0 RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request_1[] = "\ +TEARDOWN rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754312\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_INDEX, + PLAY_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list_0[] = +{ +rtsp_option_request_0, +rtsp_describe_request_0, +rtsp_setup_request_0, +rtsp_play_request_0, +rtsp_teardown_request_0, +}; + +static UCHAR *rtsp_request_list_1[] = +{ +rtsp_option_request_1, +rtsp_describe_request_1, +rtsp_setup_request_1, +rtsp_play_request_1, +rtsp_teardown_request_1, +}; + +static UINT rtsp_request_size_0[] = +{ +sizeof(rtsp_option_request_0) - 1, +sizeof(rtsp_describe_request_0) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_play_request_0) - 1, +sizeof(rtsp_teardown_request_0) - 1, +}; + +static UINT rtsp_request_size_1[] = +{ +sizeof(rtsp_option_request_1) - 1, +sizeof(rtsp_describe_request_1) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request_1) - 1, +sizeof(rtsp_teardown_request_1) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size_0) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +"; + +static UINT video_seq_0 = 0, video_seq_1 = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_multiple_clients_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_0, "Test Client 0", thread_client_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_0, "Test Client Packet Pool 0", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_0, "Test Client IP 0", TEST_CLIENT_0_ADDRESS, + 0xFFFFFF00UL, &client_pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_1, "Test Client 1", thread_client_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_1, "Test Client Packet Pool 1", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_1, "Test Client IP 1", TEST_CLIENT_1_ADDRESS, + 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_0_done, "semaphore client 0 done", 0); + tx_semaphore_create(&semaphore_client_1_done, "semaphore client 1 done", 0); + tx_semaphore_create(&semaphore_play_0, "semaphore play 0", 0); + tx_semaphore_create(&semaphore_rtp_0_send, "semaphore rtp 0 send", 0); + tx_semaphore_create(&semaphore_play_1, "semaphore play 1", 0); + tx_semaphore_create(&semaphore_rtp_1_send, "semaphore rtp 1 send", 0); +} + +void thread_client_0_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_0, &rtsp_client_0, "Test Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_0, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip_0, &rtp_client_0, "RTCP Client Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_0, RTP_0_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_0, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_0, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list_0[i], rtsp_request_size_0[i], &client_pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_0, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_0_RTP_PORT, RTP_0_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_0.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/stream0/trackID=0;seq=%d;rtptime=%d", + video_seq_0, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_0_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_0, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client_0, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_0_done); + nx_tcp_client_socket_unbind(&rtsp_client_0); + nx_tcp_socket_delete(&rtsp_client_0); +} + +void thread_client_1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_1, &rtsp_client_1, "Test Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_1, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip_1, &rtp_client_1, "RTCP Client Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_1, RTP_1_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_1, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_1, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list_1[i], rtsp_request_size_1[i], &client_pool_1, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_1, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_1_RTP_PORT, RTP_1_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_1.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/stream1/trackID=0;seq=%d;rtptime=%d", + video_seq_1, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_1_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_1, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client_1, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_1_done); + nx_tcp_client_socket_unbind(&rtsp_client_1); + nx_tcp_socket_delete(&rtsp_client_1); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: RTSP Multiple Clients Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Start RTSP server. */ + nx_rtsp_server_start(&rtsp_server); + + tx_semaphore_put(&semaphore_server_start); + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_play_0, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_play_1, NX_WAIT_FOREVER); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_0, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_1, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_0_send); + tx_semaphore_put(&semaphore_rtp_1_send); + + tx_semaphore_get(&semaphore_client_0_done, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_client_1_done, NX_WAIT_FOREVER); + + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_0.nx_packet_pool_available != client_pool_0.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_1.nx_packet_pool_available != client_pool_1.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + if (strstr(uri, "stream0")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_0, RTP_PAYLOAD_TYPE_VIDEO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_0, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID_0; + } + else if (strstr(uri, "stream1")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_1, RTP_PAYLOAD_TYPE_VIDEO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_1, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID_1; + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + if (strstr(uri, "stream0")) + { + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_0, &video_seq_0); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq_0, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play_0); + } + else if (strstr(uri, "stream1")) + { + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_1, &video_seq_1); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq_1, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play_1); + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + if (strstr(uri, "stream0")) + { + nx_rtp_sender_session_delete(&rtp_session_0); + } + else if (strstr(uri, "stream1")) + { + nx_rtp_sender_session_delete(&rtp_session_1); + } + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_multiple_clients_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP Multiple Clients Test................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_multiple_request_test.c b/test/regression/rtsp_test/netx_rtsp_multiple_request_test.c new file mode 100644 index 00000000..f927a97e --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_multiple_request_test.c @@ -0,0 +1,359 @@ +/* This case tests RTSP request in multiple packets. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_TCP_SOCKET rtsp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_done; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTSP_SERVER_PORT 554 + +#define TEST_LOOP 3 + +/* Test packet, length = 157 = 54 + 11 + 19 + 20 + 30 + 20. */ +static UCHAR test_data[] = "\ +SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/1.0\r\n\ +CSeq: 421\r\n\ +Session: 23754311\r\n\ +Content-length: 20\r\n\ +Content-type: text/parameters\r\n\ +\r\n\ +barparam: barstuff\r\n\ +"; + +static UCHAR expected_response[] = "RTSP/1.0 200 OK\r\nCSeq: 421\r\nServer: RTSP Server\r\n\r\n"; + +static UINT test_size[TEST_LOOP][3] = +{ + {50, 39, 68}, // Conten-length in multiple packets. + {69, 70, 18}, // Content in multiple packets. + {39, 98, 20}, // Header in multiple packets and content in another packet +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_multiple_request_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_done, "semaphore client done", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip, &rtsp_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + for (i = 0 ; i < TEST_LOOP; i++) + { + + status = nxd_tcp_client_socket_connect(&rtsp_client, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + for (j = 0; j < NX_RTSP_SERVER_MAX_CLIENTS; j++) + { + rtsp_server.nx_rtsp_server_client_list[j].nx_rtsp_client_session_id = 23754311; + } + + /* Send data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, test_data, test_size[i][0], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send data 1. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, test_data + test_size[i][0], test_size[i][1], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send data 2. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, test_data + test_size[i][0] + test_size[i][1], test_size[i][2], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from server. */ + status = nx_tcp_socket_receive(&rtsp_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, expected_response, sizeof(expected_response) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + nx_tcp_socket_disconnect(&rtsp_client, NX_IP_PERIODIC_RATE); + } + + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_done); + nx_tcp_client_socket_unbind(&rtsp_client); + nx_tcp_socket_delete(&rtsp_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: RTSP Multiple Request Test................................"); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + nx_rtsp_server_start(&rtsp_server); + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_client_done, NX_WAIT_FOREVER); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + + if ((parameter_length != 20) || (memcmp(parameter_ptr, "barparam: barstuff", sizeof("barparam: barstuff") - 1) != 0)) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_multiple_request_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP Multiple Request Test................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_rtp_basic_test.c b/test/regression/rtsp_test/netx_rtsp_rtp_basic_test.c new file mode 100644 index 00000000..5bd35c79 --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_rtp_basic_test.c @@ -0,0 +1,704 @@ +/* This case tests RTSP with RTP. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_TCP_SOCKET rtsp_client; +static NX_UDP_SOCKET rtp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_video; +static NX_RTP_SESSION rtp_session_audio; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_done; +static TX_SEMAPHORE semaphore_play; +static TX_SEMAPHORE semaphore_rtp_send; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID 23754311 +#define RTP_VIDEO_RTP_PORT 49752 +#define RTP_VIDEO_RTCP_PORT 49753 +#define RTP_AUDIO_RTP_PORT 49754 +#define RTP_AUDIO_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_PAYLOAD_TYPE_AUDIO 97 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 + +static UCHAR rtsp_option_request[] = "\ +OPTIONS rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request[] = "\ +DESCRIBE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=1 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_play_request[] = "\ +PLAY rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_pause_request[] = "\ +PAUSE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request[] = "\ +TEARDOWN rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_0_INDEX, + SETUP_1_INDEX, + PLAY_INDEX, + PAUSE_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list[] = +{ +rtsp_option_request, +rtsp_describe_request, +rtsp_setup_request_0, +rtsp_setup_request_1, +rtsp_play_request, +rtsp_pause_request, +rtsp_teardown_request, +}; + +static UINT rtsp_request_size[] = +{ +sizeof(rtsp_option_request) - 1, +sizeof(rtsp_describe_request) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request) - 1, +sizeof(rtsp_pause_request) - 1, +sizeof(rtsp_teardown_request) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +m=audio 0 RTP/AVP 97\r\n\ +a=rtpmap:97 mpeg4-generic/44100/1\r\n\ +a=fmtp:97 SizeLength=13\r\n\ +a=control:trackID=1\r\n"; + +static UINT video_seq = 0, audio_seq = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_done, "semaphore client done", 0); + tx_semaphore_create(&semaphore_play, "semaphore play", 0); + tx_semaphore_create(&semaphore_rtp_send, "semaphore rtp send", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; +ULONG content_length = 0; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip, &rtsp_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip, &rtp_client, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the Content-length field. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Content-Length: "); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + /* Skip 16 bytes field header. */ + buffer_ptr += 16; + + /* Convert the length into a numeric value. */ + while ((buffer_ptr < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr >= '0') && (*buffer_ptr <= '9')) + { + + /* Update the content length. */ + content_length = content_length * 10; + content_length += (UINT)(*buffer_ptr) - '0'; + + /* Move the buffer pointer forward. */ + buffer_ptr++; + } + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + /* Skip 4 bytes terminators. */ + buffer_ptr += 4; + + /* Check content length. */ + CHECK_STATUS(content_length, (packet_ptr -> nx_packet_append_ptr - buffer_ptr)); + + /* Check the sdp information. */ + status = memcmp(buffer_ptr, sdp, (ULONG)strlen(sdp)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_video.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=1.2.3.4;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_audio.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://1.2.3.4:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-30.0", sizeof("Range: npt=0.0-30.0") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PAUSE_INDEX) + { + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=10.0-30.0", sizeof("Range: npt=10.0-30.0") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_done); + nx_tcp_client_socket_unbind(&rtsp_client); + nx_tcp_socket_delete(&rtsp_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Basic Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_play, NX_WAIT_FOREVER); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_video, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_video, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send); + + tx_semaphore_get(&semaphore_client_done, NX_WAIT_FOREVER); + + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + if (strstr(uri, "trackID=0")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_video, RTP_PAYLOAD_TYPE_VIDEO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_video, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID; + } + else if (strstr(uri, "trackID=1")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_audio, RTP_PAYLOAD_TYPE_AUDIO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_audio, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_video, &video_seq); + nx_rtp_sender_session_sequence_number_get(&rtp_session_audio, &audio_seq); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=1", sizeof("trackID=1") - 1, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 0, 30000); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play); + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + + nx_rtp_sender_session_delete(&rtp_session_video); + nx_rtp_sender_session_delete(&rtp_session_audio); + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 10000, 30000); + CHECK_STATUS(0, status); + + return(status); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Basic Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_rtp_ipv6_basic_test.c b/test/regression/rtsp_test/netx_rtsp_rtp_ipv6_basic_test.c new file mode 100644 index 00000000..52b2d792 --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_rtp_ipv6_basic_test.c @@ -0,0 +1,722 @@ +/* This case tests RTSP with RTP. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if defined(FEATURE_NX_IPV6) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static NX_TCP_SOCKET rtsp_client; +static NX_UDP_SOCKET rtp_client; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_video; +static NX_RTP_SESSION rtp_session_audio; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_done; +static TX_SEMAPHORE semaphore_play; +static TX_SEMAPHORE semaphore_rtp_send; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID 23754311 +#define RTP_VIDEO_RTP_PORT 49752 +#define RTP_VIDEO_RTCP_PORT 49753 +#define RTP_AUDIO_RTP_PORT 49754 +#define RTP_AUDIO_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_PAYLOAD_TYPE_AUDIO 97 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 + +static NXD_ADDRESS server_ip_address; +static NXD_ADDRESS client_ip_address; + +static UCHAR rtsp_option_request[] = "\ +OPTIONS rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request[] = "\ +DESCRIBE rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://[2001::4]:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://[2001::4]:554/live.stream/trackID=1 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;unicast;client_port=49754-49755\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_play_request[] = "\ +PLAY rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_pause_request[] = "\ +PAUSE rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request[] = "\ +TEARDOWN rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_0_INDEX, + SETUP_1_INDEX, + PLAY_INDEX, + PAUSE_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list[] = +{ +rtsp_option_request, +rtsp_describe_request, +rtsp_setup_request_0, +rtsp_setup_request_1, +rtsp_play_request, +rtsp_pause_request, +rtsp_teardown_request, +}; + +static UINT rtsp_request_size[] = +{ +sizeof(rtsp_option_request) - 1, +sizeof(rtsp_describe_request) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request) - 1, +sizeof(rtsp_pause_request) - 1, +sizeof(rtsp_teardown_request) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +m=audio 0 RTP/AVP 97\r\n\ +a=rtpmap:97 mpeg4-generic/44100/1\r\n\ +a=fmtp:97 SizeLength=13\r\n\ +a=control:trackID=1\r\n"; + +static UINT video_seq = 0, audio_seq = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable IPv6 */ + nxd_ipv6_enable(&server_ip); + + /* Set server ip primary link local address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010000; + server_ip_address.nxd_ip_address.v6[1] = 0; + server_ip_address.nxd_ip_address.v6[2] = 0; + server_ip_address.nxd_ip_address.v6[3] = 4; + status = nxd_ipv6_address_set(&server_ip, 0, &server_ip_address, 64, NULL); + CHECK_STATUS(0, status); + + status = nxd_icmp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable IPv6 */ + nxd_ipv6_enable(&client_ip); + + /* Set client ip primary link local address. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + client_ip_address.nxd_ip_address.v6[0] = 0x20010000; + client_ip_address.nxd_ip_address.v6[1] = 0; + client_ip_address.nxd_ip_address.v6[2] = 0; + client_ip_address.nxd_ip_address.v6[3] = 3; + status = nxd_ipv6_address_set(&client_ip, 0, &client_ip_address, 64, NULL); + CHECK_STATUS(0, status); + + status = nxd_icmp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_done, "semaphore client done", 0); + tx_semaphore_create(&semaphore_play, "semaphore play", 0); + tx_semaphore_create(&semaphore_rtp_send, "semaphore rtp send", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; +ULONG content_length = 0; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&client_ip, &rtsp_client, "Test Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip, &rtp_client, "RTCP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the Content-length field. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Content-Length: "); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + /* Skip 16 bytes field header. */ + buffer_ptr += 16; + + /* Convert the length into a numeric value. */ + while ((buffer_ptr < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr >= '0') && (*buffer_ptr <= '9')) + { + + /* Update the content length. */ + content_length = content_length * 10; + content_length += (UINT)(*buffer_ptr) - '0'; + + /* Move the buffer pointer forward. */ + buffer_ptr++; + } + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + /* Skip 4 bytes terminators. */ + buffer_ptr += 4; + + /* Check content length. */ + CHECK_STATUS(content_length, (packet_ptr -> nx_packet_append_ptr - buffer_ptr)); + + /* Check the sdp information. */ + status = memcmp(buffer_ptr, sdp, (ULONG)strlen(sdp)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=2001:0000:0000:0000:0000:0000:0000:0004;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_video.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;unicast;source=2001:0000:0000:0000:0000:0000:0000:0004;client_port=%d-%d;server_port=%d-%d;ssrc=%ld", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, + rtp_server.nx_rtp_sender_rtp_port, + rtp_server.nx_rtp_sender_rtcp_port, + rtp_session_audio.nx_rtp_session_ssrc); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://[2001::4]:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://[2001::4]:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-30.0", sizeof("Range: npt=0.0-30.0") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PAUSE_INDEX) + { + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=10.0-30.0", sizeof("Range: npt=10.0-30.0") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_done); + nx_tcp_client_socket_unbind(&rtsp_client); + nx_tcp_socket_delete(&rtsp_client); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP IPv6 Basic Test......................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Start RTSP server. */ + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_start(&rtsp_server); + CHECK_STATUS(0, status); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_play, NX_WAIT_FOREVER); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_video, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_video, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send); + + tx_semaphore_get(&semaphore_client_done, NX_WAIT_FOREVER); + + status = nx_rtsp_server_stop(&rtsp_server); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + if (strstr(uri, "trackID=0")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_video, RTP_PAYLOAD_TYPE_VIDEO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_video, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID; + } + else if (strstr(uri, "trackID=1")) + { + /* Setup rtp sender session */ + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_audio, RTP_PAYLOAD_TYPE_AUDIO, + transport_ptr -> interface_index, &(transport_ptr -> client_ip_address), + transport_ptr -> client_rtp_port, transport_ptr -> client_rtcp_port); + CHECK_STATUS(0, status); + + /* Obtain generated ssrc */ + status = nx_rtp_sender_session_ssrc_get(&rtp_session_audio, &(transport_ptr -> rtp_ssrc)); + CHECK_STATUS(0, status); + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_video, &video_seq); + nx_rtp_sender_session_sequence_number_get(&rtp_session_audio, &audio_seq); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=1", sizeof("trackID=1") - 1, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 0, 30000); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play); + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + + nx_rtp_sender_session_delete(&rtp_session_video); + nx_rtp_sender_session_delete(&rtp_session_audio); + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + status = nx_rtsp_server_range_npt_set(rtsp_client_ptr, 10000, 30000); + CHECK_STATUS(0, status); + + return(status); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP IPv6 Basic Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_rtp_ipv6_multicast_test.c b/test/regression/rtsp_test/netx_rtsp_rtp_ipv6_multicast_test.c new file mode 100644 index 00000000..75c62b66 --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_rtp_ipv6_multicast_test.c @@ -0,0 +1,931 @@ +/* This case tests RTSP with RTP in multicast mode. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if defined(NX_ENABLE_IPV6_MULTICAST) && defined(FEATURE_NX_IPV6) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread_0; +static NX_PACKET_POOL client_pool_0; +static NX_IP client_ip_0; +static NX_TCP_SOCKET rtsp_client_0; +static NX_UDP_SOCKET rtp_client_0; + +static TX_THREAD client_thread_1; +static NX_PACKET_POOL client_pool_1; +static NX_IP client_ip_1; +static NX_TCP_SOCKET rtsp_client_1; +static NX_UDP_SOCKET rtp_client_1; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_video; +static NX_RTP_SESSION rtp_session_audio; + +static UINT error_counter; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_0_done; +static TX_SEMAPHORE semaphore_client_1_done; +static TX_SEMAPHORE semaphore_play; +static TX_SEMAPHORE semaphore_rtp_send; + +static NXD_ADDRESS group_address[8]; +static NXD_ADDRESS server_ip_address; +static NXD_ADDRESS client_0_ip_address; +static NXD_ADDRESS client_1_ip_address; + +static void thread_client_0_entry(ULONG thread_input); +static void thread_client_1_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +/* Define ipv6 multicast group address. */ +#define GROUP_ADDRESS_0 0xff020000 +#define GROUP_ADDRESS_1 0x00000000 +#define GROUP_ADDRESS_2 0x00000000 +#define GROUP_ADDRESS_3 0x01020301 + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_0_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_CLIENT_1_ADDRESS IP_ADDRESS(1,2,3,6) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID 23754311 +#define RTP_VIDEO_RTP_PORT 49752 +#define RTP_VIDEO_RTCP_PORT 49753 +#define RTP_AUDIO_RTP_PORT 49754 +#define RTP_AUDIO_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_PAYLOAD_TYPE_AUDIO 97 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 +#define TEST_TTL 128 + +static UCHAR rtsp_option_request[] = "\ +OPTIONS rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request[] = "\ +DESCRIBE rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://[2001::4]:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;multicast;port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://[2001::4]:554/live.stream/trackID=1 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;multicast;port=49754-49755\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_play_request[] = "\ +PLAY rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_pause_request[] = "\ +PAUSE rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request[] = "\ +TEARDOWN rtsp://[2001::4]:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_0_INDEX, + SETUP_1_INDEX, + PLAY_INDEX, + PAUSE_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list[] = +{ +rtsp_option_request, +rtsp_describe_request, +rtsp_setup_request_0, +rtsp_setup_request_1, +rtsp_play_request, +rtsp_pause_request, +rtsp_teardown_request, +}; + +static UINT rtsp_request_size[] = +{ +sizeof(rtsp_option_request) - 1, +sizeof(rtsp_describe_request) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request) - 1, +sizeof(rtsp_pause_request) - 1, +sizeof(rtsp_teardown_request) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 6002 RTP/AVP 96\r\n\ +c=IN IP4 ff02:0000:0000:0000:0000:0000:0102:0301/20\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +m=audio 6002 RTP/AVP 97\r\n\ +c=IN IP4 ff02:0000:0000:0000:0000:0000:0102:0301/20\r\n\ +a=rtpmap:97 mpeg4-generic/44100/1\r\n\ +a=fmtp:97 SizeLength=13\r\n\ +a=control:trackID=1\r\n"; + +static UINT video_seq = 0, audio_seq = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_multicast_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable IPv6 */ + nxd_ipv6_enable(&server_ip); + + /* Set server ip primary link local address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010000; + server_ip_address.nxd_ip_address.v6[1] = 0; + server_ip_address.nxd_ip_address.v6[2] = 0; + server_ip_address.nxd_ip_address.v6[3] = 4; + status = nxd_ipv6_address_set(&server_ip, 0, &server_ip_address, 64, NULL); + CHECK_STATUS(0, status); + + status = nxd_icmp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_0, "Test Client 0", thread_client_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_0, "Test Client Packet Pool 0", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_0, "Test Client IP 0", TEST_CLIENT_0_ADDRESS, + 0xFFFFFF00UL, &client_pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable IPv6 */ + nxd_ipv6_enable(&client_ip_0); + + /* Set client 0 ip primary link local address. */ + client_0_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + client_0_ip_address.nxd_ip_address.v6[0] = 0x20010000; + client_0_ip_address.nxd_ip_address.v6[1] = 0; + client_0_ip_address.nxd_ip_address.v6[2] = 0; + client_0_ip_address.nxd_ip_address.v6[3] = 3; + status = nxd_ipv6_address_set(&client_ip_0, 0, &client_0_ip_address, 64, NULL); + CHECK_STATUS(0, status); + + status = nxd_icmp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_1, "Test Client 1", thread_client_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_1, "Test Client Packet Pool 1", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_1, "Test Client IP 1", TEST_CLIENT_1_ADDRESS, + 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable IPv6 */ + nxd_ipv6_enable(&client_ip_1); + + /* Set client 1 ip primary link local address. */ + client_1_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + client_1_ip_address.nxd_ip_address.v6[0] = 0x20010000; + client_1_ip_address.nxd_ip_address.v6[1] = 0; + client_1_ip_address.nxd_ip_address.v6[2] = 0; + client_1_ip_address.nxd_ip_address.v6[3] = 2; + status = nxd_ipv6_address_set(&client_ip_1, 0, &client_1_ip_address, 64, NULL); + CHECK_STATUS(0, status); + + status = nxd_icmp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_0_done, "semaphore client 0 done", 0); + tx_semaphore_create(&semaphore_client_1_done, "semaphore client 1 done", 0); + tx_semaphore_create(&semaphore_play, "semaphore play", 0); + tx_semaphore_create(&semaphore_rtp_send, "semaphore rtp send", 0); +} + +void thread_client_0_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&client_ip_0); + status = nxd_ipv6_multicast_interface_join(&client_ip_0, &group_address[0], 0); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_create(&client_ip_0, &rtsp_client_0, "Test Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_0, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip_0, &rtp_client_0, "RTCP Client Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_0, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_0, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_0, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_0, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=FF02:0000:0000:0000:0000:0000:0102:0301;port=%d-%d;ttl=%d", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=FF02:0000:0000:0000:0000:0000:0102:0301;port=%d-%d;ttl=%d", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://[2001::4]:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://[2001::4]:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-", sizeof("Range: npt=0.0-") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_0, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PAUSE_INDEX) + { + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr != NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client_0, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_0_done); + nx_tcp_client_socket_unbind(&rtsp_client_0); + nx_tcp_socket_delete(&rtsp_client_0); +} + +void thread_client_1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&client_ip_1); + status = nxd_ipv6_multicast_interface_join(&client_ip_1, &group_address[0], 0); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_create(&client_ip_1, &rtsp_client_1, "Test Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_1, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip_1, &rtp_client_1, "RTCP Client Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_1, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_1, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_1, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool_1, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_1, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=FF02:0000:0000:0000:0000:0000:0102:0301;port=%d-%d;ttl=%d", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=FF02:0000:0000:0000:0000:0000:0102:0301;port=%d-%d;ttl=%d", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://[2001::4]:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://[2001::4]:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_1, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + } + + nx_tcp_socket_disconnect(&rtsp_client_1, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_1_done); + nx_tcp_client_socket_unbind(&rtsp_client_1); + nx_tcp_socket_delete(&rtsp_client_1); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +NXD_ADDRESS client_ip_address; + + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Multicast Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set the group address . */ + group_address[0].nxd_ip_version = NX_IP_VERSION_V6; + group_address[0].nxd_ip_address.v6[0] = GROUP_ADDRESS_0; + group_address[0].nxd_ip_address.v6[1] = GROUP_ADDRESS_1; + group_address[0].nxd_ip_address.v6[2] = GROUP_ADDRESS_2; + group_address[0].nxd_ip_address.v6[3] = GROUP_ADDRESS_3; + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&server_ip); + CHECK_STATUS(0, status); + status = nxd_ipv6_multicast_interface_join(&server_ip, &group_address[0], 0); + CHECK_STATUS(0, status); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + client_ip_address.nxd_ip_address.v6[0] = GROUP_ADDRESS_0; + client_ip_address.nxd_ip_address.v6[1] = GROUP_ADDRESS_1; + client_ip_address.nxd_ip_address.v6[2] = GROUP_ADDRESS_2; + client_ip_address.nxd_ip_address.v6[3] = GROUP_ADDRESS_3; + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_video, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_audio, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT); + CHECK_STATUS(0, status); + + /* Start RTSP server. */ + nx_rtsp_server_start(&rtsp_server); + + tx_semaphore_put(&semaphore_server_start); + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_play, NX_WAIT_FOREVER); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_video, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_video, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send); + tx_semaphore_put(&semaphore_rtp_send); + + tx_semaphore_get(&semaphore_client_0_done, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_client_1_done, NX_WAIT_FOREVER); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_0.nx_packet_pool_available != client_pool_0.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_1.nx_packet_pool_available != client_pool_1.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + transport_ptr -> client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + transport_ptr -> client_ip_address.nxd_ip_address.v6[0] = GROUP_ADDRESS_0; + transport_ptr -> client_ip_address.nxd_ip_address.v6[1] = GROUP_ADDRESS_1; + transport_ptr -> client_ip_address.nxd_ip_address.v6[2] = GROUP_ADDRESS_2; + transport_ptr -> client_ip_address.nxd_ip_address.v6[3] = GROUP_ADDRESS_3; + transport_ptr -> multicast_ttl = TEST_TTL; + + if (strstr(uri, "trackID=0")) + { + transport_ptr -> client_rtp_port = RTP_VIDEO_RTP_PORT; + transport_ptr -> client_rtcp_port = RTP_VIDEO_RTCP_PORT; + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID; + } + else if (strstr(uri, "trackID=1")) + { + transport_ptr -> client_rtp_port = RTP_AUDIO_RTP_PORT; + transport_ptr -> client_rtcp_port = RTP_AUDIO_RTCP_PORT; + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_video, &video_seq); + nx_rtp_sender_session_sequence_number_get(&rtp_session_audio, &audio_seq); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=1", sizeof("trackID=1") - 1, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play); + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + + nx_rtp_sender_session_delete(&rtp_session_video); + nx_rtp_sender_session_delete(&rtp_session_audio); + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_multicast_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Multicast Test...................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/rtsp_test/netx_rtsp_rtp_multicast_test.c b/test/regression/rtsp_test/netx_rtsp_rtp_multicast_test.c new file mode 100644 index 00000000..963f8bbc --- /dev/null +++ b/test/regression/rtsp_test/netx_rtsp_rtp_multicast_test.c @@ -0,0 +1,886 @@ +/* This case tests RTSP with RTP in multicast mode. */ +#include "tx_api.h" +#include "nx_api.h" +#include "netxtestcontrol.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_rtp_sender.h" +#include "nx_rtsp_server.h" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UCHAR rtsp_stack[DEMO_STACK_SIZE]; + +static TX_THREAD client_thread_0; +static NX_PACKET_POOL client_pool_0; +static NX_IP client_ip_0; +static NX_TCP_SOCKET rtsp_client_0; +static NX_UDP_SOCKET rtp_client_0; + +static TX_THREAD client_thread_1; +static NX_PACKET_POOL client_pool_1; +static NX_IP client_ip_1; +static NX_TCP_SOCKET rtsp_client_1; +static NX_UDP_SOCKET rtp_client_1; + +static TX_THREAD server_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_RTSP_SERVER rtsp_server; +static NX_RTP_SENDER rtp_server; +static NX_RTP_SESSION rtp_session_video; +static NX_RTP_SESSION rtp_session_audio; + +static UINT error_counter; + +static UINT connected_client_num = 0; + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_0_done; +static TX_SEMAPHORE semaphore_client_1_done; +static TX_SEMAPHORE semaphore_play; +static TX_SEMAPHORE semaphore_rtp_send; + +static void thread_client_0_entry(ULONG thread_input); +static void thread_client_1_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr); +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length); +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length); +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length); +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr); + +#define TEST_MULTICAST_ADDRESS IP_ADDRESS(224, 1, 0, 55) +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_0_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_CLIENT_1_ADDRESS IP_ADDRESS(1,2,3,6) +#define RTSP_SERVER_PORT 554 + +#define RTSP_SESSION_ID 23754311 +#define RTP_VIDEO_RTP_PORT 49752 +#define RTP_VIDEO_RTCP_PORT 49753 +#define RTP_AUDIO_RTP_PORT 49754 +#define RTP_AUDIO_RTCP_PORT 49755 + +#define RTP_PAYLOAD_TYPE_VIDEO 96 +#define RTP_PAYLOAD_TYPE_AUDIO 97 +#define RTP_TIMESTAMP_INIT_VALUE 40 +#define CNAME "AzureRTOS@microsoft.com" +#define TEST_MSW 123 +#define TEST_LSW 456 +#define TEST_TTL 128 + +static UCHAR rtsp_option_request[] = "\ +OPTIONS rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 2\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\r\n\ +"; + +static UCHAR rtsp_describe_request[] = "\ +DESCRIBE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 3\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Accept: application/sdp\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_0[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=0 RTSP/1.0\r\n\ +CSeq: 4\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;multicast;port=49752-49753\r\n\r\n\ +"; + +static UCHAR rtsp_setup_request_1[] = "\ +SETUP rtsp://1.2.3.4:554/live.stream/trackID=1 RTSP/1.0\r\n\ +CSeq: 5\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Transport: RTP/AVP;multicast;port=49754-49755\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_play_request[] = "\ +PLAY rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 6\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\ +Range: npt=0.000-\r\n\r\n\ +"; + +static UCHAR rtsp_pause_request[] = "\ +PAUSE rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 7\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +static UCHAR rtsp_teardown_request[] = "\ +TEARDOWN rtsp://1.2.3.4:554/live.stream RTSP/1.0\r\n\ +CSeq: 8\r\n\ +User-Agent: LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)\r\n\ +Session: 23754311\r\n\r\n\ +"; + +typedef enum +{ + OPTION_INDEX, + DESCRIBE_INDEX, + SETUP_0_INDEX, + SETUP_1_INDEX, + PLAY_INDEX, + PAUSE_INDEX, + TEARDOWN_INDEX +}REQUEST_INDEX; + +static UCHAR *rtsp_request_list[] = +{ +rtsp_option_request, +rtsp_describe_request, +rtsp_setup_request_0, +rtsp_setup_request_1, +rtsp_play_request, +rtsp_pause_request, +rtsp_teardown_request, +}; + +static UINT rtsp_request_size[] = +{ +sizeof(rtsp_option_request) - 1, +sizeof(rtsp_describe_request) - 1, +sizeof(rtsp_setup_request_0) - 1, +sizeof(rtsp_setup_request_1) - 1, +sizeof(rtsp_play_request) - 1, +sizeof(rtsp_pause_request) - 1, +sizeof(rtsp_teardown_request) - 1, +}; + +static UINT rtsp_request_num = sizeof(rtsp_request_size) / sizeof(UINT); + +static UCHAR rtp_data[] = "rtp data for test"; + +static CHAR *sdp="v=0\r\ns=MPEG-1 or 2 Audio, streamed by the NetX RTSP Server\r\n\ +m=video 6002 RTP/AVP 96\r\n\ +c=IN IP4 224.1.0.1/20\r\n\ +a=rtpmap:96 H264/90000\r\n\ +a=fmtp:96 profile-level-id=42A01E; packetization-mode=1\r\n\ +a=control:trackID=0\r\n\ +m=audio 6002 RTP/AVP 97\r\n\ +c=IN IP4 224.1.0.1/20\r\n\ +a=rtpmap:97 mpeg4-generic/44100/1\r\n\ +a=fmtp:97 SizeLength=13\r\n\ +a=control:trackID=1\r\n"; + +static UINT video_seq = 0, audio_seq = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_multicast_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&server_ip); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_0, "Test Client 0", thread_client_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_0, "Test Client Packet Pool 0", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_0, "Test Client IP 0", TEST_CLIENT_0_ADDRESS, + 0xFFFFFF00UL, &client_pool_0, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip_0); + CHECK_STATUS(0, status); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread_1, "Test Client 1", thread_client_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + CHECK_STATUS(0, status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_1, "Test Client Packet Pool 1", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + CHECK_STATUS(0, status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_1, "Test Client IP 1", TEST_CLIENT_1_ADDRESS, + 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + CHECK_STATUS(0, status); + + status = nx_arp_enable(&client_ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + CHECK_STATUS(0, status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Enable UDP processing for both IP instances. */ + status = nx_udp_enable(&client_ip_1); + CHECK_STATUS(0, status); + + /* Create semaphores. */ + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_0_done, "semaphore client 0 done", 0); + tx_semaphore_create(&semaphore_client_1_done, "semaphore client 1 done", 0); + tx_semaphore_create(&semaphore_play, "semaphore play", 0); + tx_semaphore_create(&semaphore_rtp_send, "semaphore rtp send", 0); +} + +void thread_client_0_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&client_ip_0); + status = nx_igmp_multicast_join(&client_ip_0, TEST_MULTICAST_ADDRESS); + CHECK_STATUS(0, status); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_0, &rtsp_client_0, "Test Client Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_0, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip_0, &rtp_client_0, "RTCP Client Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_0, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_0, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_0, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool_0, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_0, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_0, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=224.1.0.55;port=%d-%d;ttl=%d", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=224.1.0.55;port=%d-%d;ttl=%d", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://1.2.3.4:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, "Range: npt=0.0-", sizeof("Range: npt=0.0-") - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_0, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PAUSE_INDEX) + { + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Range"); + if (buffer_ptr != NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + + tx_thread_sleep(2); + } + + nx_tcp_socket_disconnect(&rtsp_client_0, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_0_done); + nx_tcp_client_socket_unbind(&rtsp_client_0); + nx_tcp_socket_delete(&rtsp_client_0); +} + +void thread_client_1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UCHAR *buffer_ptr; +UCHAR temp_string[256]; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&client_ip_1); + status = nx_igmp_multicast_join(&client_ip_1, TEST_MULTICAST_ADDRESS); + CHECK_STATUS(0, status); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nx_tcp_socket_create(&client_ip_1, &rtsp_client_1, "Test Client Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + CHECK_STATUS(0, status); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&rtsp_client_1, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Create the rtp client socket. */ + status = nx_udp_socket_create(&client_ip_1, &rtp_client_1, "RTCP Client Socket 1", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + CHECK_STATUS(0, status); + + status = nx_udp_socket_bind(&rtp_client_1, RTP_VIDEO_RTP_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Wait test server started. */ + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + status = nxd_tcp_client_socket_connect(&rtsp_client_1, &server_ip_address, RTSP_SERVER_PORT, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + for ( i = 0; i < rtsp_request_num; i++) + { + + /* Send RTSP request data. */ + status = nx_packet_allocate(&client_pool_1, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_packet_data_append(packet_ptr, rtsp_request_list[i], rtsp_request_size[i], &client_pool_1, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + status = nx_tcp_socket_send(&rtsp_client_1, packet_ptr, NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Receive the response from RTSP server. */ + status = nx_tcp_socket_receive(&rtsp_client_1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Check response status code. */ + status = memcmp(packet_ptr -> nx_packet_prepend_ptr, "RTSP/1.0 200 OK", sizeof("RTSP/1.0 200 OK") - 1); + CHECK_STATUS(0, status); + + /* Terminate the string. */ + *(packet_ptr -> nx_packet_append_ptr) = NX_NULL; + memset(temp_string, 0, sizeof(temp_string)); + + if (i == DESCRIBE_INDEX) + { + + /* Check the SDP. */ + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "\r\n\r\n"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr + 4, sdp, sizeof(sdp) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_0_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=224.1.0.55;port=%d-%d;ttl=%d", + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == SETUP_1_INDEX) + { + + sprintf(temp_string, "Transport: RTP/AVP;multicast;destination=224.1.0.55;port=%d-%d;ttl=%d", + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT, TEST_TTL); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "Transport"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else if (i == PLAY_INDEX) + { + + sprintf(temp_string, + "RTP-Info: url=rtsp://1.2.3.4:554/live.stream/trackID=0;seq=%d;rtptime=%d,url=rtsp://1.2.3.4:554/live.stream/trackID=1;seq=%d;rtptime=%d", + video_seq, RTP_TIMESTAMP_INIT_VALUE, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + + buffer_ptr = strstr(packet_ptr -> nx_packet_prepend_ptr, "RTP-Info"); + if (buffer_ptr == NX_NULL) + { + error_counter++; + CHECK_STATUS(0, error_counter); + } + + status = memcmp(buffer_ptr, temp_string, strlen(temp_string)); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + + tx_semaphore_get(&semaphore_rtp_send, NX_WAIT_FOREVER); + + /* Receive rtp data packet. */ + status = nx_udp_socket_receive(&rtp_client_1, &packet_ptr, 5 * TX_TIMER_TICKS_PER_SECOND); + CHECK_STATUS(0, status); + + status = memcmp(packet_ptr -> nx_packet_prepend_ptr + 12, rtp_data, sizeof(rtp_data) - 1); + CHECK_STATUS(0, status); + + nx_packet_release(packet_ptr); + } + else + { + nx_packet_release(packet_ptr); + } + + tx_thread_sleep(2); + } + + nx_tcp_socket_disconnect(&rtsp_client_1, NX_IP_PERIODIC_RATE); + + /* Set the flag. */ + tx_semaphore_put(&semaphore_client_1_done); + nx_tcp_client_socket_unbind(&rtsp_client_1); + nx_tcp_socket_delete(&rtsp_client_1); +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *packet_ptr; +NXD_ADDRESS client_ip_address; + + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Multicast Test..................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Enable IGMP & join in multicast group. */ + status = nx_igmp_enable(&server_ip); + status = nx_igmp_multicast_join(&server_ip, TEST_MULTICAST_ADDRESS); + CHECK_STATUS(0, status); + + /* Create RTSP server. */ + status = nx_rtsp_server_create(&rtsp_server, "RTSP Server", sizeof("RTSP Server") - 1,&server_ip, &server_pool, rtsp_stack, DEMO_STACK_SIZE, 3, RTSP_SERVER_PORT, rtsp_disconnect_callback); + CHECK_STATUS(0, status); + + /* Set callback functions. */ + nx_rtsp_server_describe_callback_set(&rtsp_server, rtsp_describe_callback); + nx_rtsp_server_setup_callback_set(&rtsp_server, rtsp_setup_callback); + nx_rtsp_server_play_callback_set(&rtsp_server, rtsp_play_callback); + nx_rtsp_server_teardown_callback_set(&rtsp_server, rtsp_teardown_callback); + nx_rtsp_server_pause_callback_set(&rtsp_server, rtsp_pause_callback); + nx_rtsp_server_set_parameter_callback_set(&rtsp_server, rtsp_set_parameter_callback); + + /* Create RTP sender. */ + status = nx_rtp_sender_create(&rtp_server, &server_ip, &server_pool, CNAME, sizeof(CNAME) - 1); + CHECK_STATUS(0, status); + + /* Setup rtp sender session. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + client_ip_address.nxd_ip_address.v4 = TEST_MULTICAST_ADDRESS; + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_video, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_VIDEO_RTP_PORT, RTP_VIDEO_RTCP_PORT); + CHECK_STATUS(0, status); + + status = nx_rtp_sender_session_create(&rtp_server, &rtp_session_audio, RTP_PAYLOAD_TYPE_VIDEO, + 0, &client_ip_address, + RTP_AUDIO_RTP_PORT, RTP_AUDIO_RTCP_PORT); + CHECK_STATUS(0, status); + + /* Start RTSP server. */ + nx_rtsp_server_start(&rtsp_server); + + tx_semaphore_put(&semaphore_server_start); + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_play, NX_WAIT_FOREVER); + + /* Allocate a packet */ + status = nx_rtp_sender_session_packet_allocate(&rtp_session_video, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Copy payload data into the packet. */ + status = nx_packet_data_append(packet_ptr, rtp_data, sizeof(rtp_data) - 1, rtp_server.nx_rtp_sender_ip_ptr -> nx_ip_default_packet_pool, 5 * NX_IP_PERIODIC_RATE); + CHECK_STATUS(0, status); + + /* Send packet. */ + status = nx_rtp_sender_session_packet_send(&rtp_session_video, packet_ptr, RTP_TIMESTAMP_INIT_VALUE, TEST_MSW, TEST_LSW, 1); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_rtp_send); + tx_semaphore_put(&semaphore_rtp_send); + + tx_semaphore_get(&semaphore_client_0_done, NX_WAIT_FOREVER); + tx_semaphore_get(&semaphore_client_1_done, NX_WAIT_FOREVER); + + status = nx_rtsp_server_delete(&rtsp_server); + CHECK_STATUS(0, status); + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_0.nx_packet_pool_available != client_pool_0.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool_1.nx_packet_pool_available != client_pool_1.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT rtsp_describe_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ +UINT status; + + status = nx_rtsp_server_sdp_set(rtsp_client_ptr, sdp, strlen(sdp)); + return(status); +} + +static UINT rtsp_setup_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, NX_RTSP_TRANSPORT *transport_ptr) +{ +UINT status; +UINT rtp_port, rtcp_port; + + /* Get the created and found ports */ + status = nx_rtp_sender_port_get(&rtp_server, &rtp_port, &rtcp_port); + if (status) + { + return(status); + } + transport_ptr -> server_rtp_port = rtp_port; + transport_ptr -> server_rtcp_port = rtcp_port; + + transport_ptr -> client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + transport_ptr -> client_ip_address.nxd_ip_address.v4 = TEST_MULTICAST_ADDRESS; + transport_ptr -> multicast_ttl = TEST_TTL; + + if (strstr(uri, "trackID=0")) + { + transport_ptr -> client_rtp_port = RTP_VIDEO_RTP_PORT; + transport_ptr -> client_rtcp_port = RTP_VIDEO_RTCP_PORT; + + /* Set static session ID for test. */ + rtsp_client_ptr -> nx_rtsp_client_session_id = RTSP_SESSION_ID; + + connected_client_num++; + } + else if (strstr(uri, "trackID=1")) + { + transport_ptr -> client_rtp_port = RTP_AUDIO_RTP_PORT; + transport_ptr -> client_rtcp_port = RTP_AUDIO_RTCP_PORT; + } + else + { + status = NX_RTSP_SERVER_INVALID_REQUEST; + } + + return(status); +} + +static UINT rtsp_play_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ +UINT status; + + /* Retrieve the sequence number through rtp sender functions */ + nx_rtp_sender_session_sequence_number_get(&rtp_session_video, &video_seq); + nx_rtp_sender_session_sequence_number_get(&rtp_session_audio, &audio_seq); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=0", sizeof("trackID=0") - 1, video_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + status = nx_rtsp_server_rtp_info_set(rtsp_client_ptr, "trackID=1", sizeof("trackID=1") - 1, audio_seq, RTP_TIMESTAMP_INIT_VALUE); + CHECK_STATUS(0, status); + + tx_semaphore_put(&semaphore_play); + + return(status); +} + +static UINT rtsp_teardown_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length) +{ + if (connected_client_num > 0) + { + connected_client_num--; + if (connected_client_num == 0) + { + nx_rtp_sender_session_delete(&rtp_session_video); + nx_rtp_sender_session_delete(&rtp_session_audio); + } + } + + return(NX_SUCCESS); +} + +static UINT rtsp_pause_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *range_ptr, UINT range_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_set_parameter_callback(NX_RTSP_CLIENT *rtsp_client_ptr, UCHAR *uri, UINT uri_length, UCHAR *parameter_ptr, ULONG parameter_length) +{ + return(NX_SUCCESS); +} + +static UINT rtsp_disconnect_callback(NX_RTSP_CLIENT *rtsp_client_ptr) +{ + return(NX_SUCCESS); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_rtsp_rtp_multicast_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: RTSP RTP Multicast Test...................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/smtp_test/netx_smtp_abnormal_packet_test.c b/test/regression/smtp_test/netx_smtp_abnormal_packet_test.c new file mode 100644 index 00000000..ddd21517 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_abnormal_packet_test.c @@ -0,0 +1,515 @@ +/* This tests processing abnormal packet. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_PLAIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT packet_number); + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + +static char invliad_response_220_greetings_pkt[] = { +0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, /* ...v..22 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x45, 0x53, 0x4d, 0x54, 0x50, /* om ESMTP */ +0x20, 0x4d, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, /* MDaemon */ +0x20, 0x31, 0x33, 0x2e, 0x30, 0x2e, 0x33, 0x3b, /* 13.0.3; */ +0x20, 0x53, 0x61, 0x74, 0x2c, 0x20, 0x32, 0x33, /* Sat, 23 */ +0x20, 0x4d, 0x61, 0x72, 0x20, 0x32, 0x30, 0x31, /* Mar 201 */ +0x33, 0x20, 0x32, 0x32, 0x3a, 0x35, 0x38, 0x3a, /* 3 22:58: */ +0x31, 0x35, 0x20, 0x2d, 0x30, 0x37, 0x30, 0x30, /* 15 -0700 */ +0x0d, 0x0a, 0x32, 0x32, 0x30, 0x2d, 0x41, 0x6c, /* ..220-Al */ +0x6c, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, /* l transa */ +0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, /* ctions a */ +0x6e, 0x64, 0x20, 0x49, 0x50, 0x20, 0x61, 0x64, /* nd IP ad */ +0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x20, /* dresses */ +0x61, 0x72, 0x65, 0x20, 0x6c, 0x6f, 0x67, 0x67, /* are logg */ +0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x32, 0x32, 0x30, /* ed...220 */ +0x2d, 0x2a, 0x0d, 0x0a, 0x32, 0x32, 0x30, 0x20, /* -*..220 */ +0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, /* Unauthor */ +0x69, 0x7a, 0x65, 0x64, 0x20, 0x72, 0x65, 0x6c, /* ized rel */ +0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, /* aying is */ +0x20, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x6c, /* strictl */ +0x79, 0x20, 0x70, 0x72, 0x6f, 0x68, 0x69, 0x62, /* y prohib */ +0x69, 0x74, 0x65, 0x64, 0x2e, 0x0d, 0x0a /* ited... */ +}; + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +static UINT msg_count = 0; + +static SMTP_TEST smtp_test[9]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Abnormal Packet Test................................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +UINT i; +ULONG actual_status; +NX_PACKET *my_packet; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < msg_count; i++) + { + + if (i != 0) + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Release the packet. */ + nx_packet_release(my_packet); + } + + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, 200); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + smtp_test[msg_count].smtp_test_pkt_data = &invliad_response_220_greetings_pkt[0]; + smtp_test[msg_count++].smtp_test_pkt_size = sizeof(invliad_response_220_greetings_pkt); + + smtp_test[msg_count].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[msg_count++].smtp_test_pkt_size = response_221_bye_size; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Abnormal Packet Test.................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/smtp_test/netx_smtp_auth_logon_function_test.c b/test/regression/smtp_test/netx_smtp_auth_logon_function_test.c new file mode 100644 index 00000000..50e82e87 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_auth_logon_function_test.c @@ -0,0 +1,591 @@ +/* This NetX test concentrates on the basic SMTP operation. The Server supports + auth login, auth plain and will send a one packet response to the EHLO message. The Client + then authenticates itself by AUTH LOGIN, sends a message of three packets, and quits. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_LOGIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + +/* This is the one packet 250 EHLO message */ +extern char response_250_ehlo_pkt[145]; +extern int response_250_ehlo_size; + +extern char response_334_username_pkt[18]; +extern int response_334_username_size; + +extern char response_334_password_pkt[18]; +extern int response_334_password_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 10 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_logon_function_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Auth Logon Function Test............................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait for a client response first...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* This is the message data. We need to parse for the End Of Message marker. */ + if (i == 8) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, 200); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_size; + smtp_test[2].smtp_test_pkt_data = &response_334_username_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_334_username_size; + smtp_test[3].smtp_test_pkt_data = &response_334_password_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_334_password_size; + smtp_test[4].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[5].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[7].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[8].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[9].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[9].smtp_test_pkt_size = response_221_bye_size; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_logon_function_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Auth Logon Function Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/smtp_test/netx_smtp_auth_no_type_function_test.c b/test/regression/smtp_test/netx_smtp_auth_no_type_function_test.c new file mode 100644 index 00000000..2dd4db63 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_auth_no_type_function_test.c @@ -0,0 +1,586 @@ +/* This NetX test concentrates on the basic SMTP operation. The Server supports + auth login, auth plain and will send a one packet response to the EHLO message. The Client + then authenticates itself by AUTH LOGIN, sends a message of three packets, and quits. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_LOGIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + +/* This is the one packet 250 EHLO message */ +extern char response_250_ehlo_auth_no_type_pkt[145]; +extern int response_250_ehlo_auth_no_type_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 9 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_no_type_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Auth Logon Function Test............................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait for a client response first...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* This is the message data. We need to parse for the End Of Message marker. */ + if (i == 7) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, 200); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_auth_no_type_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_auth_no_type_size; + smtp_test[2].smtp_test_pkt_data = &response_334_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_334_size; + smtp_test[3].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[4].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[5].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[7].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[8].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_221_bye_size; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_no_type_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Auth Logon Function Test.............................N/A\n"); + + test_control_return(3); +} +#endif + + diff --git a/test/regression/smtp_test/netx_smtp_auth_no_type_test.c b/test/regression/smtp_test/netx_smtp_auth_no_type_test.c new file mode 100644 index 00000000..120be6e9 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_auth_no_type_test.c @@ -0,0 +1,586 @@ +/* This NetX test concentrates on the basic SMTP operation. The Server supports + auth login, auth plain and will send a one packet response to the EHLO message. The Client + then authenticates itself by AUTH LOGIN, sends a message of three packets, and quits. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_LOGIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + +/* This is the one packet 250 EHLO message */ +extern char response_250_ehlo_auth_no_type_pkt[145]; +extern int response_250_ehlo_auth_no_type_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 9 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_no_type_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Auth No Type Test...................................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait for a client response first...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* This is the message data. We need to parse for the End Of Message marker. */ + if (i == 7) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, 200); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_auth_no_type_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_auth_no_type_size; + smtp_test[2].smtp_test_pkt_data = &response_334_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_334_size; + smtp_test[3].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[4].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[5].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[7].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[8].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_221_bye_size; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_no_type_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Auth No Type Test....................................N/A\n"); + + test_control_return(3); +} +#endif + + diff --git a/test/regression/smtp_test/netx_smtp_auth_none_test.c b/test/regression/smtp_test/netx_smtp_auth_none_test.c new file mode 100644 index 00000000..6b9771c7 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_auth_none_test.c @@ -0,0 +1,575 @@ +/* This NetX tests an SMTP Server configured for no authentication (the server + response to EHLO message contains no AUTH parameters). The client if configured + for LOGIN or PLAIN authentication can still try to authenticate itself but the + server may send an error message which will cause the client to abort. + + In this test case, the Client is configured for AUTH NONE, so the Client should + skip the authentication step and go directly to MAIL. The simulated server response + expects to go from EHLO to MAIL, skipping authentication. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* Set the authentication type to none. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_NONE + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + +/* This is the one packet 250 EHLO message */ +extern char response_250_ehlo_noauth_pkt[145]; +extern int response_250_ehlo_noauth_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 7 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_none_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; + + printf("NetX Test: SMTP No Authentication Test..............................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(1) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + } + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait for a client response first...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* This is the message data. We need to parse for the End Of Message marker. */ + if (i == 5) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_noauth_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_noauth_size; + + smtp_test[2].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[3].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[4].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[5].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[6].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_221_bye_size; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_auth_none_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP No Authentication Test...............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/smtp_test/netx_smtp_basic_function_test.c b/test/regression/smtp_test/netx_smtp_basic_function_test.c new file mode 100644 index 00000000..bb4cd4b8 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_basic_function_test.c @@ -0,0 +1,584 @@ +/* This NetX test concentrates on the basic SMTP operation. The Server supports + auth login, auth plain and will send a one packet response to the EHLO message. The Client + then authenticates itself by AUTH LOGIN, sends a message of three packets, and quits. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_PLAIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + +/* This is the one packet 250 EHLO message */ +extern char response_250_ehlo_pkt[145]; +extern int response_250_ehlo_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 9 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_basic_function_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Basic Function Test.................................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait for a client response first...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* This is the message data. We need to parse for the End Of Message marker. */ + if (i == 7) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, 200); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_size; + smtp_test[2].smtp_test_pkt_data = &response_334_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_334_size; + smtp_test[3].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[4].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[5].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[7].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[8].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_221_bye_size; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_basic_function_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Basic Function Test..................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/smtp_test/netx_smtp_invalid_release_test.c b/test/regression/smtp_test/netx_smtp_invalid_release_test.c new file mode 100644 index 00000000..d2b81ab1 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_invalid_release_test.c @@ -0,0 +1,557 @@ +/* This NetX test concentrates on validating a bug in _nx_smtp_rsp_greeting. The packet released + in _nx_smtp_utility_read_server_code can be released again. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 0, 0, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 0, 0, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_PLAIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + +/* This is the one packet 250 EHLO message */ +extern char response_250_ehlo_pkt[145]; +extern int response_250_ehlo_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 1 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_invalid_release_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + return; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; +} + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Invalid Release Test................................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + /* Create a mail instance with the above text message and recipient info. */ + nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + error_counter++; + } + + /* Check invalid packet release count. */ + if (client_packet_pool.nx_packet_pool_invalid_releases != 0) + { + error_counter++; + } + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait for a client response first...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 100 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* This is the message data. We need to parse for the End Of Message marker. */ + if (i == 7) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + nx_tcp_socket_disconnect(&server_socket, NX_NO_WAIT); + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, 200); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + + smtp_test[0].smtp_test_pkt_data = "2200"; /* Invalid value */ + smtp_test[0].smtp_test_pkt_size = 4; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_invalid_release_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Invalid Release Test.................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c b/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c new file mode 100644 index 00000000..444affe5 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c @@ -0,0 +1,654 @@ +/* This NetX tests the SMTP client for handling a server 250 reply to EHLO which has multiple + 250 parameters but none of them have the 'final' 250 code e.g. 250 followed by space. + Therefore the SMTP client should abort the connection. The simulated server should not + count a failed nx_tcp_socket_receive() if it is sending the 'last' EHLO packet because + the Client is 'mute' waiting for the 250 packet with the last 250 marker. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 2, 41, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 2, 41, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* This uses one packet for the server's EHLO response to client. Otherwise it sends + two packets for the EHLO response. */ + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_PLAIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_client; +#endif /* FEATURE_NX_IPV6 */ +#else +static ULONG server_ip_address; +#endif + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + + +/* These next two are the first and second packets of the EHLO message */ +extern char response_250_ehlo_first_pkt[145]; +extern int response_250_ehlo_first_size; + +extern char response_250_ehlo_notlast_pkt[10]; +extern int response_250_ehlo_notlast_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 10 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_missing_last_250_EHLO_message_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010DB8; + server_ip_address.nxd_ip_address.v6[1] = 0x00010001; + server_ip_address.nxd_ip_address.v6[2] = 0x021122FF; + server_ip_address.nxd_ip_address.v6[3] = 0xFE334456; + + address_client.nxd_ip_version = NX_IP_VERSION_V6; + address_client.nxd_ip_address.v6[0] = 0x20010DB8; + address_client.nxd_ip_address.v6[1] = 0x00010001; + address_client.nxd_ip_address.v6[2] = 0x021122FF; + address_client.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&client_ip, 0, &server_ip_address, 64, NX_NULL); + status = nxd_ipv6_address_set(&server_ip, 0, &address_client, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + printf("NetX Test: SMTP Missing Last Packet EHLO Message Test................"); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. This mail should not succeed! */ + if (status == NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + // jlc restore tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait to hear from client...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, 50 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + if (i != 3) + { + error_counter++; + } + + break; + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + if (i == 8) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + /* Release the packet. */ + nx_packet_release(my_packet); + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Check if this if the first EHLO packet. */ + if (i == 1) + { + + /* It is. Wait a beat and send the second one. */ + i++; + tx_thread_sleep(2); + + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + } + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_first_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_first_size; + smtp_test[2].smtp_test_pkt_data = &response_250_ehlo_notlast_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_250_ehlo_notlast_size; + smtp_test[3].smtp_test_pkt_data = &response_334_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_334_size; + smtp_test[4].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[5].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[7].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[8].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[9].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[9].smtp_test_pkt_size = response_221_bye_size; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_missing_last_250_EHLO_message_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Missing Last Packet EHLO Message Test................N/A\n"); + + test_control_return(3); +} +#endif + + diff --git a/test/regression/smtp_test/netx_smtp_two_packet_EHLO_auth_last_message_test.c b/test/regression/smtp_test/netx_smtp_two_packet_EHLO_auth_last_message_test.c new file mode 100644 index 00000000..6a44c09b --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_two_packet_EHLO_auth_last_message_test.c @@ -0,0 +1,665 @@ +/* This NetX tests the SMTP client for handling a server 250 reply to EHLO which has multiple + 250 parameters. The AUTH parameters are located in the second packet, not the first! + + Note that the Client authentication type must be PLAIN for the sequence to succeed. */ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 2, 41, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 2, 41, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_PLAIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_client; +#endif /* FEATURE_NX_IPV6 */ +#else +static ULONG server_ip_address; +#endif + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + + +/* These next two are the first and second packets of the EHLO message */ +extern char response_250_ehlo_first_no_auth_pkt[145]; +extern int response_250_ehlo_first_no_auth_size; + +extern char response_250_ehlo_last_with_auth_pkt[42]; +extern int response_250_ehlo_last_with_auth_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 10 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_two_packet_EHLO_auth_last_message_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010DB8; + server_ip_address.nxd_ip_address.v6[1] = 0x00010001; + server_ip_address.nxd_ip_address.v6[2] = 0x021122FF; + server_ip_address.nxd_ip_address.v6[3] = 0xFE334456; + + address_client.nxd_ip_version = NX_IP_VERSION_V6; + address_client.nxd_ip_address.v6[0] = 0x20010DB8; + address_client.nxd_ip_address.v6[1] = 0x00010001; + address_client.nxd_ip_address.v6[2] = 0x021122FF; + address_client.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&client_ip, 0, &server_ip_address, 64, NX_NULL); + status = nxd_ipv6_address_set(&server_ip, 0, &address_client, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Two Packet EHLO Message Auth Last Test..............."); + + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD and let server set up. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + /* Check for earlier errors. */ + if(error_counter) + { + + return; + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait to hear from client...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + if (i == 2) + { + + /* The Client should be muted; it is waiting for the + second part of the EHLO message. */ + + /* But we still want to send the next part of the EHLO message. */ + } + else + { + /* If this is not the EHLO message, this is an error. */ + error_counter++; + continue; + } + } + else if (i == 2) + { + + /* The server should not receive a packet. The Client is not supposed to respond yet. */ + error_counter++; + continue; + } + + else if (i == 3) + { + + /* The server should not receive another EHLO message. */ + if (!memcmp(my_packet -> nx_packet_prepend_ptr, "EHLO", 4)) + { + + error_counter++; + continue; + } + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + if (i == 8) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + + if (my_packet) + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_first_no_auth_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_first_no_auth_size; + smtp_test[2].smtp_test_pkt_data = &response_250_ehlo_last_with_auth_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_250_ehlo_last_with_auth_size; + smtp_test[3].smtp_test_pkt_data = &response_334_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_334_size; + smtp_test[4].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[5].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[7].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[8].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[9].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[9].smtp_test_pkt_size = response_221_bye_size; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_two_packet_EHLO_auth_last_message_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Two Packet EHLO Message Auth Last Test...............N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/smtp_test/netx_smtp_two_packet_EHLO_message_test.c b/test/regression/smtp_test/netx_smtp_two_packet_EHLO_message_test.c new file mode 100644 index 00000000..3b771b05 --- /dev/null +++ b/test/regression/smtp_test/netx_smtp_two_packet_EHLO_message_test.c @@ -0,0 +1,666 @@ +/* This NetX tests the SMTP client for handling a server 250 reply to EHLO which has multiple + 250 parameters. It is supposed to parse the entire message over one or more packets for + the last 250 code. The last 250 code is followed by a space after the 250 code. The previous + 250 codes should have hyphens after them as per the SMTP protocol in RFC 2821*/ + + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_smtp_client.h" +#else +#include "nx_smtp_client.h" +#endif + +#define DEMO_STACK_SIZE 2048 +#define SERVER_IPADR IP_ADDRESS(10, 2, 41, 1) +#define CLIENT_IPADR IP_ADDRESS(10, 2, 41, 10) + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_client; +static TX_THREAD thread_server; + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static NX_IP server_ip; + + +static NX_PACKET_POOL server_packet_pool; +static NX_TCP_SOCKET server_socket; +static NX_SMTP_CLIENT smtp_client; + +#define SUBJECT_LINE "NetX Duo SMTP Client Demo" +#define MAIL_BODY ".NetX Duo SMTP client is a simple SMTP client implementation \r\n" \ + ".that allow embedded devices to send email to an SMTP server. \r\n" \ + "This feature is intended to allow a device to send simple status\r\n " \ + "reports using the most universal Internet application email.\r\n" \ + "The rest of this narrative is merely to supply this most interesting quote: \r\n" \ + "Perhaps the most vivid recollection of my youth is that of the local wheelmen, \r\n" \ + "led by my father, stopping at our home to eat pone, sip mint juleps, and flog \r\n" \ + "the field hands. This more than anything cultivated my life-long aversion \r\n" \ + "to bicycles. ~~ Tennessee Williams.\r\n\r\n" \ + "Nothing compares to the simple pleasure of a bike ride. --John F. Kennedy, (surely you've heard of him?)\r\n\r\n" \ + "Perhaps the most vivid recollection of my youth is that of being flogged \r\n" \ + "by the local wheelmen, along with the field hands, the postman, and a \r\n" \ + "young Tennessee Williams. This more than anything cultivated my life-long " \ + "aversion to his plays. -Truman Capote\r\n" \ + "When I see an adult on a bicycle, I do not despair for the future of the human race. H.G. Wells \r\n" \ + "during the Second World War, if the United States had retooled its \r\n" \ + "factories for manufacturing bicycles instead of munitions, we'd be one of \r\n" \ + "the healthiest, least oil-dependent, and most environmentally-sound \r\n" \ + "constituents in the Nazi empire today. -Ralph Nader." + + +#define PASSWORD "testpwd" +#define RECIPIENT_ADDRESS "recipient@domain.com" +#define LOCAL_DOMAIN "domain.com" +#define FROM_ADDRESS "recipient@domain.com" +#define USERNAME FROM_ADDRESS +#define SMTP_SERVER_PORT 25 + + +/* This uses one packet for the server's EHLO response to client. Otherwise it sends + two packets for the EHLO response. */ + +/* See the NetX Duo SMTP Client User Guide for how to set the authentication type. */ +#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_PLAIN + +#if defined(__PRODUCT_NETXDUO__) +static NXD_ADDRESS server_ip_address; +#ifdef FEATURE_NX_IPV6 +static NXD_ADDRESS address_client; +#endif /* FEATURE_NX_IPV6 */ +#else +static ULONG server_ip_address; +#endif + +static UINT server_complete = NX_FALSE; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG notify_calls = 0; + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(struct NX_IP_DRIVER_STRUCT *driver_req); +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr); + +/* SMTP Tests. */ +static void smtp_test_initialize(); + +/* Send SMTP server response. */ +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number); + + +extern char response_220_greetings_pkt[185]; +extern int response_220_greetings_size; + + +/* These next two are the first and second packets of the EHLO message */ +extern char response_250_ehlo_first_pkt[145]; +extern int response_250_ehlo_first_size; + +extern char response_250_ehlo_last_pkt[10]; +extern int response_250_ehlo_last_size; + +extern char response_334_pkt[6]; +extern int response_334_size; + +extern char response_235_auth_passed_pkt[85]; +extern int response_235_auth_passed_size; + +extern char response_250_sender_ok_pkt[40]; +extern int response_250_sender_ok_size; + +extern char response_250_recipient_ok_pkt[43]; +extern int response_250_recipient_ok_size; + +extern char response_354_enter_mail_pkt[40]; +extern int response_354_enter_mail_size; + +extern char response_250_message_saved_pkt[92]; +extern int response_250_message_saved_size; + +extern char response_221_bye_pkt[80]; +extern int response_221_bye_size; + + +typedef struct SMTP_TEST_STRUCT +{ + char *smtp_test_pkt_data; + int smtp_test_pkt_size; +} SMTP_TEST; + + +#define MSG_COUNT 10 + +static SMTP_TEST smtp_test[MSG_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_two_packet_ehlo_message_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SMTP client thread. */ + tx_thread_create(&thread_client, "thread client", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + tx_thread_create(&thread_server, "thread server", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create server packet pool. */ + status = nx_packet_pool_create(&server_packet_pool, "NetX Main Packet Pool", 1536, pointer, 10*1536); + pointer = pointer + (10*1536); + + /* Check for pool creation error. */ + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "SMTP CLient IP", CLIENT_IPADR, 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&server_ip, "SMTP Server IP", SERVER_IPADR, 0xFFFFFF00UL, &server_packet_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + status += nx_tcp_enable(&server_ip); + + /* Check for TCP enable errors. */ + if (status) + error_counter++; + + +#ifdef FEATURE_NX_IPV6 + /* Enable IPv6 traffic. */ + status += nxd_ipv6_enable(&client_ip); + status += nxd_ipv6_enable(&server_ip); + + /* Enable ICMP processing for both IP instances. */ + status += nxd_icmp_enable(&client_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check enable status. */ + if (status) + error_counter++; + + /* Set source and destination address with global address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010DB8; + server_ip_address.nxd_ip_address.v6[1] = 0x00010001; + server_ip_address.nxd_ip_address.v6[2] = 0x021122FF; + server_ip_address.nxd_ip_address.v6[3] = 0xFE334456; + + address_client.nxd_ip_version = NX_IP_VERSION_V6; + address_client.nxd_ip_address.v6[0] = 0x20010DB8; + address_client.nxd_ip_address.v6[1] = 0x00010001; + address_client.nxd_ip_address.v6[2] = 0x021122FF; + address_client.nxd_ip_address.v6[3] = 0xFE334499; + + status = nxd_ipv6_address_set(&client_ip, 0, &server_ip_address, 64, NX_NULL); + status = nxd_ipv6_address_set(&server_ip, 0, &address_client, 64, NX_NULL); + +#endif /* FEATURE_NX_IPV6 */ + + /* The demo client username and password is the authentication + data used when the server attempts to authentication the client. */ + +#if defined(__PRODUCT_NETXDUO__) + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_IPADR; + + status = nxd_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + &server_ip_address, SMTP_SERVER_PORT); +#else + server_ip_address = SERVER_IPADR; + + status = nx_smtp_client_create(&smtp_client, &client_ip, &client_packet_pool, + USERNAME, + PASSWORD, + FROM_ADDRESS, + LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, + server_ip_address, SMTP_SERVER_PORT); +#endif + + if (status != NX_SUCCESS) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +ULONG actual_status; +UINT wait_timeout = 300; + + + printf("NetX Test: SMTP Two Packet EHLO Message Test........................."); + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&client_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Let the server get set up first. */ + tx_thread_sleep(20); + + /* The SMTP test initialize. */ + smtp_test_initialize(); + + + /* Create a mail instance with the above text message and recipient info. */ + status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, + SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY)); + + /* Create a mail instance with the above text message and recipient info. */ + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Give the server time to disconnect. */ + while(wait_timeout) + { + + if (server_complete) + break; + + tx_thread_sleep(20); + + wait_timeout -= 20; + } + + /* Release threadx resources used by client. */ + status = nx_smtp_client_delete(&smtp_client); + + /* Return the test result. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +/* This thread task simulates SMTP server response to client requests. */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +ULONG port; +ULONG peer_address; +UINT i; +UCHAR *work_ptr; +ULONG actual_status; + + /* Check for earlier errors. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef FEATURE_NX_IPV6 + /* Sleep 5 seconds to finish DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); +#endif /* FEATURE_NX_IPV6 */ + + /* Ensure the IP instance has been initialized. */ + status = nx_ip_status_check(&server_ip, NX_IP_INITIALIZE_DONE, &actual_status, 100); + + /* Check status...*/ + if(status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the SMTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket 1", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 8000, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Register the receive notify function. */ + status = nx_tcp_socket_receive_notify(&server_socket, receive_packet_function); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the SMTP port. */ + status = nx_tcp_server_socket_listen(&server_ip, SMTP_SERVER_PORT, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_server_socket_accept(&server_socket, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the SMTP server to receive the SMTP Client query and send the SMTP response. */ + for (i = 0; i < MSG_COUNT; i++ ) + { + + if (i == 0) + { + /* This is the greeting, we don't wait to hear from client...*/ + } + else + { + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + + if (i == 2) + { + + /* The Client should be muted; it is waiting for the + second part of the EHLO message. */ + + /* But we still want to send the next part of the EHLO message. */ + } + else + { + /* If this is not the EHLO message, this is an error. */ + error_counter++; + continue; + } + } + else if (i == 2) + { + + /* The server should not receive a packet. The Client is not supposed to respond yet. */ + error_counter++; + continue; + } + + else if (i == 3) + { + + /* The server should not receive another EHLO message. */ + if (!memcmp(my_packet -> nx_packet_prepend_ptr, "EHLO", 4)) + { + + error_counter++; + continue; + } + } + + /* Get the SMTP client TCP port. */ + status = nx_tcp_socket_peer_info_get(&server_socket, &peer_address, &port); + + /* Check status. */ + if (status) + { + error_counter++; + } + + + if (i == 8) + { + /* Look for 0x0D 0x0A 0x2E 0x0d 0x0A indiating end of mail message. */ + work_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length - 5; + + if ((*work_ptr == 0x0D) && + (*(work_ptr + 1) == 0x0A) && + (*(work_ptr + 2) == 0x2E) && + (*(work_ptr + 3) == 0x0D) && + (*(work_ptr + 4) == 0x0A)) + + { + + /* Done iwth message, wait for QUIT command from client. */ + } + else + { + + /* Stay in this state. */ + + i--; + nx_packet_release(my_packet); + continue; + } + } + if (my_packet) + { + + /* Release the packet. */ + nx_packet_release(my_packet); + } + } + /* Send the SMTP response packet. */ + status = nx_smtp_response_packet_send(&server_socket, port, i); + + /* Check status. */ + if (status) + { + error_counter++; + } + + } + + /* Wait for Client process last message. */ + tx_thread_sleep(20); + + /* Unlisten and Unbind the TCP socket. */ + + status = nx_tcp_server_socket_unaccept(&server_socket); + status += nx_tcp_server_socket_unlisten(&server_ip, SMTP_SERVER_PORT); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + server_complete = NX_TRUE; + +} + +static void receive_packet_function(NX_TCP_SOCKET *socket_ptr) +{ + + if (socket_ptr == &server_socket) + notify_calls++; +} + +static UINT nx_smtp_response_packet_send(NX_TCP_SOCKET *server_socket, UINT port, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&server_packet_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return status; + } + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + smtp_test[packet_number].smtp_test_pkt_data, + smtp_test[packet_number].smtp_test_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = smtp_test[packet_number].smtp_test_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + + /* Send the TCP packet with the correct port. */ + status = nx_tcp_socket_send(server_socket, response_packet, 100); + + /* Check the status. */ + if (status) + { + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + +static void smtp_test_initialize() +{ + smtp_test[0].smtp_test_pkt_data = &response_220_greetings_pkt[0]; + smtp_test[0].smtp_test_pkt_size = response_220_greetings_size; + smtp_test[1].smtp_test_pkt_data = &response_250_ehlo_first_pkt[0]; + smtp_test[1].smtp_test_pkt_size = response_250_ehlo_first_size; + smtp_test[2].smtp_test_pkt_data = &response_250_ehlo_last_pkt[0]; + smtp_test[2].smtp_test_pkt_size = response_250_ehlo_last_size; + smtp_test[3].smtp_test_pkt_data = &response_334_pkt[0]; + smtp_test[3].smtp_test_pkt_size = response_334_size; + smtp_test[4].smtp_test_pkt_data = &response_235_auth_passed_pkt[0]; + smtp_test[4].smtp_test_pkt_size = response_235_auth_passed_size; + + smtp_test[5].smtp_test_pkt_data = &response_250_sender_ok_pkt[0]; + smtp_test[5].smtp_test_pkt_size = response_250_sender_ok_size; + smtp_test[6].smtp_test_pkt_data = &response_250_recipient_ok_pkt[0]; + smtp_test[6].smtp_test_pkt_size = response_250_recipient_ok_size; + smtp_test[7].smtp_test_pkt_data = &response_354_enter_mail_pkt[0]; + smtp_test[7].smtp_test_pkt_size = response_354_enter_mail_size; + + smtp_test[8].smtp_test_pkt_data = &response_250_message_saved_pkt[0]; + smtp_test[8].smtp_test_pkt_size = response_250_message_saved_size; + + smtp_test[9].smtp_test_pkt_data = &response_221_bye_pkt[0]; + smtp_test[9].smtp_test_pkt_size = response_221_bye_size; + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_smtp_two_packet_ehlo_message_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SMTP Two Packet EHLO Message Test.........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/smtp_test/smtp_server_packets.c b/test/regression/smtp_test/smtp_server_packets.c new file mode 100644 index 00000000..af021d4e --- /dev/null +++ b/test/regression/smtp_test/smtp_server_packets.c @@ -0,0 +1,299 @@ +/* Frame (239 bytes) */ +char response_220_greetings_pkt[185] = { +0x32, 0x32, /* ...v..22 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x45, 0x53, 0x4d, 0x54, 0x50, /* om ESMTP */ +0x20, 0x4d, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, /* MDaemon */ +0x20, 0x31, 0x33, 0x2e, 0x30, 0x2e, 0x33, 0x3b, /* 13.0.3; */ +0x20, 0x53, 0x61, 0x74, 0x2c, 0x20, 0x32, 0x33, /* Sat, 23 */ +0x20, 0x4d, 0x61, 0x72, 0x20, 0x32, 0x30, 0x31, /* Mar 201 */ +0x33, 0x20, 0x32, 0x32, 0x3a, 0x35, 0x38, 0x3a, /* 3 22:58: */ +0x31, 0x35, 0x20, 0x2d, 0x30, 0x37, 0x30, 0x30, /* 15 -0700 */ +0x0d, 0x0a, 0x32, 0x32, 0x30, 0x2d, 0x41, 0x6c, /* ..220-Al */ +0x6c, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, /* l transa */ +0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, /* ctions a */ +0x6e, 0x64, 0x20, 0x49, 0x50, 0x20, 0x61, 0x64, /* nd IP ad */ +0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x20, /* dresses */ +0x61, 0x72, 0x65, 0x20, 0x6c, 0x6f, 0x67, 0x67, /* are logg */ +0x65, 0x64, 0x2e, 0x0d, 0x0a, 0x32, 0x32, 0x30, /* ed...220 */ +0x2d, 0x2a, 0x0d, 0x0a, 0x32, 0x32, 0x30, 0x20, /* -*..220 */ +0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, /* Unauthor */ +0x69, 0x7a, 0x65, 0x64, 0x20, 0x72, 0x65, 0x6c, /* ized rel */ +0x61, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, /* aying is */ +0x20, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x6c, /* strictl */ +0x79, 0x20, 0x70, 0x72, 0x6f, 0x68, 0x69, 0x62, /* y prohib */ +0x69, 0x74, 0x65, 0x64, 0x2e, 0x0d, 0x0a /* ited... */ +}; + +int response_220_greetings_size = 185; + +/* Frame (80 bytes) */ +char response_221_bye_pkt[80] = { +0x32, 0x32, /* .%^...22 */ +0x31, 0x20, 0x53, 0x65, 0x65, 0x20, 0x79, 0x61, /* 1 See ya */ +0x20, 0x69, 0x6e, 0x20, 0x63, 0x79, 0x62, 0x65, /* in cybe */ +0x72, 0x73, 0x70, 0x61, 0x63, 0x65, 0x0d, 0x0a /* rspace.. */ +}; + +int response_221_bye_size = 80; + +/* Frame (85 bytes with all headers) */ +char response_235_auth_passed_pkt[31] = { + +0x32, 0x33, /* .p.K..23 */ +0x35, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, /* 5 Authen */ +0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* tication */ +0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, /* success */ +0x66, 0x75, 0x6c, 0x0d, 0x0a /* ful.. */ +}; + +int response_235_auth_passed_size = 31; + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_first_pkt[145] = { + +0x32, 0x35, /* .25 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, /* om Hello */ +0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x63, /* testrec */ +0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, 0x65, /* ipient@e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, /* gic.com, */ +0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, /* pleased */ +0x20, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x65, 0x74, /* to meet */ +0x20, 0x79, 0x6f, 0x75, 0x0d, 0x0a, 0x32, 0x35, /* you..25 */ +0x30, 0x2d, 0x45, 0x54, 0x52, 0x4e, 0x0d, 0x0a, /* 0-ETRN.. */ +0x32, 0x35, 0x30, 0x2d, 0x41, 0x55, 0x54, 0x48, /* 250-AUTH */ +0x20, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x20, 0x43, /* LOGIN C */ +0x52, 0x41, 0x4d, 0x2d, 0x4d, 0x44, 0x35, 0x20, /* RAM-MD5 */ +0x50, 0x4c, 0x41, 0x49, 0x4e, 0x0d, 0x0a, 0x32, /* PLAIN..2 */ +0x35, 0x30, 0x2d, 0x38, 0x42, 0x49, 0x54, 0x4d, /* 50-8BITM */ +0x49, 0x4d, 0x45, 0x0d, 0x0a, 0x32, 0x35, 0x30, /* IME..250 */ +0x2D, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* SIZE.. */ +}; + +int response_250_ehlo_first_size = 145; + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_last_pkt[10] = { + +0x32, 0x35, 0x30, /* 250 */ +0x20, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* [sp]SIZE.. */ +}; + +int response_250_ehlo_last_size = 10; + +/************************************************************************/ + + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_first_no_auth_pkt[145] = { + +0x32, 0x35, /* .25 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, /* om Hello */ +0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x63, /* testrec */ +0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, 0x65, /* ipient@e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, /* gic.com, */ +0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, /* pleased */ +0x20, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x65, 0x74, /* to meet */ +0x20, 0x79, 0x6f, 0x75, 0x0d, 0x0a, 0x32, 0x35, /* you..25 */ +0x30, 0x2d, 0x45, 0x54, 0x52, 0x4e, 0x0d, 0x0a, /* 0-ETRN.. */ +0x32, 0x35, 0x30, 0x2d, 0x45, 0x55, 0x54, 0x48, /* 250-DUTH */ +0x20, 0x4d, 0x4f, 0x47, 0x49, 0x4e, 0x20, 0x43, /* MOGIN C */ +0x52, 0x41, 0x4d, 0x2d, 0x4d, 0x44, 0x35, 0x20, /* RAM-MD5 */ +0x51, 0x4c, 0x41, 0x49, 0x4e, 0x0d, 0x0a, 0x32, /* QLAIN..2 */ +0x35, 0x30, 0x2d, 0x38, 0x42, 0x49, 0x54, 0x4d, /* 50-8BITM */ +0x49, 0x4d, 0x45, 0x0d, 0x0a, 0x32, 0x35, 0x30, /* IME..250 */ +0x2D, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* SIZE.. */ +}; + +int response_250_ehlo_first_no_auth_size = 145; + + +/************************************************************************/ + + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_auth_no_type_pkt[145] = { + +0x32, 0x35, /* .25 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, /* om Hello */ +0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x63, /* testrec */ +0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, 0x65, /* ipient@e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, /* gic.com, */ +0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, /* pleased */ +0x20, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x65, 0x74, /* to meet */ +0x20, 0x79, 0x6f, 0x75, 0x0d, 0x0a, 0x32, 0x35, /* you..25 */ +0x30, 0x2d, 0x45, 0x54, 0x52, 0x4e, 0x0d, 0x0a, /* 0-ETRN.. */ +0x32, 0x35, 0x30, 0x2d, 0x41, 0x55, 0x54, 0x48, /* 250-AUTH */ +0x20, 0x4d, 0x4f, 0x47, 0x49, 0x4e, 0x20, 0x43, /* MOGIN C */ +0x52, 0x41, 0x4d, 0x2d, 0x4d, 0x44, 0x35, 0x20, /* RAM-MD5 */ +0x51, 0x4c, 0x41, 0x49, 0x4e, 0x0d, 0x0a, 0x32, /* QLAIN..2 */ +0x35, 0x30, 0x2d, 0x38, 0x42, 0x49, 0x54, 0x4d, /* 50-8BITM */ +0x49, 0x4d, 0x45, 0x0d, 0x0a, 0x32, 0x35, 0x30, /* IME..250 */ +0x20, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* SIZE.. */ +}; + +int response_250_ehlo_auth_no_type_size = 145; + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_last_with_auth_pkt[42] = { + +0x32, 0x35, 0x30, 0x2d, 0x41, 0x55, 0x54, 0x48, /* 250-AUTH */ +0x20, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x20, 0x43, /* LOGIN C */ +0x52, 0x41, 0x4d, 0x2d, 0x4d, 0x44, 0x35, 0x20, /* RAM-MD5 */ +0x50, 0x4c, 0x41, 0x49, 0x4e, 0x0d, 0x0a, 0x20, /* PLAIN.. */ +0x32, 0x35, 0x30, 0x20, 0x53, 0x49, 0x5a, 0x45, /* 250 SIZE */ +0x0d, 0x0a /* .. */ +}; + +int response_250_ehlo_last_with_auth_size = 42; +/************************************************************************/ + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_notlast_pkt[10] = { + +0x32, 0x35, 0x30, /* 250 */ +0x2d, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* [sp]SIZE.. */ +}; + +int response_250_ehlo_notlast_size = 10; + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_pkt[145] = { + +0x32, 0x35, /* ...L..25 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, /* om Hello */ +0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x63, /* testrec */ +0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, 0x65, /* ipient@e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, /* gic.com, */ +0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, /* pleased */ +0x20, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x65, 0x74, /* to meet */ +0x20, 0x79, 0x6f, 0x75, 0x0d, 0x0a, 0x32, 0x35, /* you..25 */ +0x30, 0x2d, 0x45, 0x54, 0x52, 0x4e, 0x0d, 0x0a, /* 0-ETRN.. */ +0x32, 0x35, 0x30, 0x2d, 0x41, 0x55, 0x54, 0x48, /* 250-AUTH */ +0x20, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x20, 0x43, /* LOGIN C */ +0x52, 0x41, 0x4d, 0x2d, 0x4d, 0x44, 0x35, 0x20, /* RAM-MD5 */ +0x50, 0x4c, 0x41, 0x49, 0x4e, 0x0d, 0x0a, 0x32, /* PLAIN..2 */ +0x35, 0x30, 0x2d, 0x38, 0x42, 0x49, 0x54, 0x4d, /* 50-8BITM */ +0x49, 0x4d, 0x45, 0x0d, 0x0a, 0x32, 0x35, 0x30, /* IME..250 */ +0x20, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* SIZE.. */ +}; + +int response_250_ehlo_size = 145; + +/* Frame (199 bytes with ETH, IP and TCP headers) */ +char response_250_ehlo_noauth_pkt[145] = { + +0x32, 0x35, /* ...L..25 */ +0x30, 0x2d, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, /* 0-expres */ +0x73, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x63, /* slogic.c */ +0x6f, 0x6d, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, /* om Hello */ +0x20, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x63, /* testrec */ +0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x40, 0x65, /* ipient@e */ +0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x6c, 0x6f, /* xpresslo */ +0x67, 0x69, 0x63, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, /* gic.com, */ +0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, /* pleased */ +0x20, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x65, 0x74, /* to meet */ +0x20, 0x79, 0x6f, 0x75, 0x0d, 0x0a, 0x32, 0x35, /* you..25 */ +0x30, 0x2d, 0x45, 0x54, 0x52, 0x4e, 0x0d, 0x0a, /* 0-ETRN.. */ +0x32, 0x35, 0x30, 0x2d, 0x44, 0x55, 0x54, 0x48, /* 250-CUTH */ +0x20, 0x4E, 0x4f, 0x47, 0x49, 0x4e, 0x20, 0x43, /* NOGIN C */ +0x52, 0x41, 0x4d, 0x2d, 0x4d, 0x44, 0x35, 0x20, /* RAM-MD5 */ +0x52, 0x4c, 0x41, 0x49, 0x4e, 0x0d, 0x0a, 0x32, /* SLAIN..2 */ +0x35, 0x30, 0x2d, 0x38, 0x42, 0x49, 0x54, 0x4d, /* 50-8BITM */ +0x49, 0x4d, 0x45, 0x0d, 0x0a, 0x32, 0x35, 0x30, /* IME..250 */ +0x20, 0x53, 0x49, 0x5a, 0x45, 0x0d, 0x0a /* SIZE.. */ +}; + +int response_250_ehlo_noauth_size = 145; + +/* Frame (92 bytes) */ +char response_250_message_saved_pkt[38] = { +0x32, 0x35, /* .+....25 */ +0x30, 0x20, 0x4f, 0x6b, 0x2c, 0x20, 0x6d, 0x65, /* 0 Ok, me */ +0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x73, 0x61, /* ssage sa */ +0x76, 0x65, 0x64, 0x20, 0x3c, 0x4d, 0x65, 0x73, /* ved .. */ +}; + +int response_250_message_saved_size = 38; + +/* Frame (97 bytes) */ +char response_250_recipient_ok_pkt[43] = { + +0x32, 0x35, /* .,.N..25 */ +0x30, 0x20, 0x3c, 0x72, 0x65, 0x63, 0x69, 0x70, /* 0 , Recip */ +0x69, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6b, 0x0d, /* ient ok. */ +0x0a /* . */ +}; + +int response_250_recipient_ok_size = 43; + +/* Frame (94 bytes all headers) */ +char response_250_sender_ok_pkt[40] = { +0x32, 0x35, /* .ME9..25 */ +0x30, 0x20, 0x3c, 0x72, 0x65, 0x63, 0x69, 0x70, /* 0 , Sende */ +0x72, 0x20, 0x6f, 0x6b, 0x0d, 0x0a /* r ok.. */ +}; + +int response_250_sender_ok_size = 40; + +/* Frame (72 bytes) */ +char response_334_password_pkt[72] = { +0x33, 0x33, /* ......33 */ +0x34, 0x20, 0x55, 0x47, 0x46, 0x7a, 0x63, 0x33, /* 4 UGFzc3 */ +0x64, 0x76, 0x63, 0x6d, 0x51, 0x36, 0x0d, 0x0a /* dvcmQ6.. */ +}; + +int response_334_password_size = 18; + +/* Frame (72 bytes) */ +char response_334_username_pkt[18] = { +0x33, 0x33, /* ......33 */ +0x34, 0x20, 0x56, 0x58, 0x4e, 0x6c, 0x63, 0x6d, /* 4 VXNlcm */ +0x35, 0x68, 0x62, 0x57, 0x55, 0x36, 0x0d, 0x0a /* 5hbWU6.. */ +}; + +int response_334_username_size = 18; + +/* Frame (94 bytes) */ +char response_354_enter_mail_pkt[40] = { + +0x33, 0x35, /* 35 */ +0x34, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x20, /* 4 Enter */ +0x6d, 0x61, 0x69, 0x6c, 0x2c, 0x20, 0x65, 0x6e, /* mail, en */ +0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x3c, /* d with < */ +0x43, 0x52, 0x4c, 0x46, 0x3e, 0x2e, 0x3c, 0x43, /* CRLF>... */ +}; + +int response_354_enter_mail_size = 40; + +/* Frame (60 bytes with all headers) */ +char response_334_pkt[6] = +{ +0x33, 0x33, 0x34, 0x20, 0x0d, 0x0a /* 334 */ +}; + + +int response_334_size = 6; + diff --git a/test/regression/smtp_test/smtp_test_files.mk b/test/regression/smtp_test/smtp_test_files.mk new file mode 100644 index 00000000..2f86999c --- /dev/null +++ b/test/regression/smtp_test/smtp_test_files.mk @@ -0,0 +1,15 @@ +SMTP_TEST_LIB_SRCS = \ + netx_smtp_basic_function_test.c \ + smtp_250_ehlo_first_pkt.c \ + smtp_250_ehlo_last_pkt.c \ + smtp_250_ehlo_ok_pkt.c \ + smtp_220_greetings_ok.c \ + smtp_334_pkt.c \ + smtp_235_auth_passed.c \ + smtp_250_sender_ok.c \ + smtp_250_recipient_ok.c \ + smtp_354_enter_mail_pkt.c \ + smtp_250_message_saved.c \ + smtp_221_bye_pkt.c \ + +SMTP_TEST_LIB_OBJS = $(SMTP_TEST_LIB_SRCS:.c=.obj) diff --git a/test/regression/snmp_test/GetSet_IPv4v6Address.c b/test/regression/snmp_test/GetSet_IPv4v6Address.c new file mode 100644 index 00000000..3ce585e4 --- /dev/null +++ b/test/regression/snmp_test/GetSet_IPv4v6Address.c @@ -0,0 +1,57 @@ +/* SNMP_TESTING_GetSet_IPv4Addresses_LargeIntegers.pcap */ + +/* Frame 420 Set IPv4 address request 241.254.3.129 (89 bytes) */ + const unsigned char set_ipv4_address_request_pkt[47] = { +0x30, 0x2d, 0x02, 0x01, 0x00, 0x04, /* .X0-.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1f, 0x02, 0x01, 0x7a, 0x02, 0x01, 0x00, /* ....z... */ +0x02, 0x01, 0x00, 0x30, 0x14, 0x30, 0x12, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, /* .+...... */ +0x01, 0x03, 0x00, 0x40, 0x04, 0xf1, 0xfe, 0x03, /* ...@.... */ +0x81 /* . */ +}; + + int set_ipv4_address_request_size = 47; + +/* Frame 430 Get Request (84 bytes) */ + const unsigned char get_ipv4_address_request_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x00, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x7b, 0x02, 0x01, 0x00, 0x02, /* ...{.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, 0x01, /* +....... */ +0x03, 0x00, 0x05, 0x00 /* .... */ +}; + + + int get_ipv4_address_request_size = 42; + +/* SNMP Testing_GetSet_IPv6_Addresses.pcapng */ + +/* Frame 88 set IPv6 address 2001:0db7:0:f101:abcd:0064:0: 0207 (102 bytes) */ + const unsigned char set_ipv6_address_request_pkt[60] = { +0x30, 0x3a, 0x02, 0x01, 0x00, 0x04, /* .e0:.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x2c, 0x02, 0x02, 0x00, 0x80, 0x02, 0x01, /* .,...... */ +0x00, 0x02, 0x01, 0x00, 0x30, 0x20, 0x30, 0x1e, /* ....0 0. */ +0x06, 0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, /* ..+..... */ +0x01, 0x01, 0x03, 0x01, 0x04, 0x10, 0x20, 0x01, /* ...... . */ +0x0d, 0xb7, 0x00, 0x00, 0xf1, 0x01, 0xab, 0xcd, /* ........ */ +0x00, 0x64, 0x00, 0x00, 0x02, 0x07 /* .d.... */ +}; + +int set_ipv6_address_request_size = 60; + +/* Frame 183 Get IPv6 address request (85 bytes) */ + const unsigned char get_ipv6_address_request_pkt[43] = { +0x30, 0x29, 0x02, 0x01, 0x00, 0x04, /* .T0).... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1c, 0x02, 0x02, 0x00, 0x81, 0x02, 0x01, 0x00, /* ........ */ +0x02, 0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, /* .+...... */ +0x01, 0x03, 0x01, 0x05, 0x00 /* ..... */ +}; + +int get_ipv6_address_request_size = 43; + + diff --git a/test/regression/snmp_test/GetSet_Integers_Large_and_Neg_Numbers.c b/test/regression/snmp_test/GetSet_Integers_Large_and_Neg_Numbers.c new file mode 100644 index 00000000..281e1d67 --- /dev/null +++ b/test/regression/snmp_test/GetSet_Integers_Large_and_Neg_Numbers.c @@ -0,0 +1,79 @@ +/* Get_Integers_Large_and_Neg_Numbers.c */ + +/* Set 255 1.3.6.1.2.1.4.1.0 Frame 28223 (85 bytes) */ +const unsigned char set_request_integer_255_pkt[43] = { +0x30, 0x29, 0x02, 0x01, 0x00, 0x04, /* .T0).... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1b, 0x02, 0x01, 0x69, 0x02, 0x01, 0x00, /* ....i... */ +0x02, 0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, /* ...0.0.. */ +0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x01, /* .+...... */ +0x00, 0x02, 0x02, 0x00, 0xff /* ..... */ +}; + +int set_request_integer_255_size = 43; + + +/* /* Get request 1.3.6.1.2.1.4.1.0 Frame 28256 Frame(82 bytes) */ +const unsigned char get_request_integer_255_pkt[40] = { +0x30, 0x26, 0x02, 0x01, 0x00, 0x04, /* .Q0&.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x19, 0x02, 0x01, 0x6a, 0x02, 0x01, 0x00, 0x02, /* ...j.... */ +0x01, 0x00, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x08, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x01, 0x00, /* +....... */ +0x05, 0x00 /* .. */ +}; + +int get_request_integer_255_size = 40; + +/* Set request neg 255 1.3.6.1.2.1.4.1.0 Frame 29094(85 bytes) */ +const unsigned char set_request_integer_neg255_pkt[43] = { +0x30, 0x29, 0x02, 0x01, 0x00, 0x04, /* .T0).... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1b, 0x02, 0x01, 0x70, 0x02, 0x01, 0x00, /* ....p... */ +0x02, 0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, /* ...0.0.. */ +0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x01, /* .+...... */ +0x00, 0x02, 0x02, 0xff, 0x01 /* ..... */ +}; + +int set_request_integer_neg255_size = 43; + + +/* Get request 1.3.6.1.2.1.4.1.0 Frame 29127 (82 bytes) */ +const unsigned char get_request_integer_neg255_pkt[40] = { +0x30, 0x26, 0x02, 0x01, 0x00, 0x04, /* .Q0&.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x19, 0x02, 0x01, 0x71, 0x02, 0x01, 0x00, 0x02, /* ...q.... */ +0x01, 0x00, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x08, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x01, 0x00, /* +....... */ +0x05, 0x00 /* .. */ +}; + + +int get_request_integer_neg255_size = 40; + + + +/* Set request -2345325 1.3.6.1.2.1.4.1.0 Frame 29488 (86 bytes) */ +unsigned char set_request_integer_neg2345345_pkt[44] = { +0x30, 0x2a, 0x02, 0x01, 0x00, 0x04, /* .U0*.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1c, 0x02, 0x01, 0x72, 0x02, 0x01, 0x00, /* ....r... */ +0x02, 0x01, 0x00, 0x30, 0x11, 0x30, 0x0f, 0x06, /* ...0.0.. */ +0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x01, /* .+...... */ +0x00, 0x02, 0x03, 0xdc, 0x36, 0x7f /* ....6. */ +}; + +int set_request_integer_neg2345345_size = 44; + +/* Get request -2345325 1.3.6.1.2.1.4.1.0 Frame 29567 (82 bytes) */ +const unsigned char get_request_integer_neg2345345_pkt[40] = { +0x30, 0x26, 0x02, 0x01, 0x00, 0x04, /* .Q0&.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x19, 0x02, 0x01, 0x73, 0x02, 0x01, 0x00, 0x02, /* ...s.... */ +0x01, 0x00, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x08, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x01, 0x00, /* +....... */ +0x05, 0x00 /* .. */ +}; + +int get_request_integer_neg2345345_size = 40; + diff --git a/test/regression/snmp_test/GetSet_OctetStrings.c b/test/regression/snmp_test/GetSet_OctetStrings.c new file mode 100644 index 00000000..9ccdcd94 --- /dev/null +++ b/test/regression/snmp_test/GetSet_OctetStrings.c @@ -0,0 +1,58 @@ +/* SNMP_Testing_GET_SET_OctetStrings.pcap */ + +/* Frame 162 */ +const unsigned char set_request_octet_string_pkt[47] = { +0x30, 0x2d, 0x02, 0x01, 0x00, 0x04, /* .X0-.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1f, 0x02, 0x01, 0x74, 0x02, 0x01, 0x00, /* ....t... */ +0x02, 0x01, 0x00, 0x30, 0x14, 0x30, 0x12, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, /* .+...... */ +0x01, 0x02, 0x00, 0x04, 0x04, 0xff, 0x00, 0xf1, /* ........ */ +0xf2 /* . */ +}; + +int set_request_octet_string_size = 47; + + + +/* Frame (258) */ +const unsigned char get_request_octet_string_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x00, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x75, 0x02, 0x01, 0x00, 0x02, /* ...u.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, 0x01, /* +....... */ +0x02, 0x00, 0x05, 0x00 /* .... */ +}; + +int get_request_octet_string_size = 42; + + + +/* Frame 518 (88 bytes) */ +const unsigned char set_request_octet_string_leading_zero_pkt[64] = { +0x30, 0x2c, 0x02, 0x01, 0x00, 0x04, /* .W0,.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1e, 0x02, 0x01, 0x76, 0x02, 0x01, 0x00, /* ....v... */ +0x02, 0x01, 0x00, 0x30, 0x13, 0x30, 0x11, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, /* .+...... */ +0x01, 0x02, 0x00, 0x04, 0x03, 0x00, 0xf1, 0xf2 /* ........ */ +}; + + +int set_request_octet_string_leading_zero_size = 46; + + + +/* Frame 607(84 bytes) */ +const unsigned char get_request_octet_string_leading_zero_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x00, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x77, 0x02, 0x01, 0x00, 0x02, /* ...w.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, 0x01, /* +....... */ +0x02, 0x00, 0x05, 0x00 /* .... */ +}; + +int get_request_octet_string_leading_zero_size = 42; + diff --git a/test/regression/snmp_test/Get_Miscellaneous_Data_type.c b/test/regression/snmp_test/Get_Miscellaneous_Data_type.c new file mode 100644 index 00000000..5137cd82 --- /dev/null +++ b/test/regression/snmp_test/Get_Miscellaneous_Data_type.c @@ -0,0 +1,137 @@ +/* SNMP_TEsting_getset_counter32.pcapng */ + +/* set request counter 32 Frame 50 (89 bytes) */ +const unsigned char set_request_counter32_pkt[47] = { +0x30, 0x2d, 0x02, 0x01, 0x01, 0x04, /* .X0-.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1f, 0x02, 0x01, 0x6e, 0x02, 0x01, 0x00, /* ....n... */ +0x02, 0x01, 0x00, 0x30, 0x14, 0x30, 0x12, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, /* .+...... */ +0x01, 0x0a, 0x00, 0x41, 0x04, 0x01, 0xd2, 0x08, /* ...A.... */ +0xa5 /* . */ +}; + +int set_request_counter32_size = 47; + + +/* Get request counter 32 Frame 239 (84 bytes) */ + const unsigned char get_request_counter32_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x6f, 0x02, 0x01, 0x00, 0x02, /* ...o.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x0a, 0x00, 0x05, 0x00 /* .... */ +}; + +int get_request_counter32_size= 42; + +/* SNMP_TEsting_GetSet_Counter64.pcapng */ + +/* Set Counter64 Frame 186(90 bytes) */ +const unsigned char set_request_counter64_pkt[48] = { +0x30, 0x2e, 0x02, 0x01, 0x01, 0x04, /* .Y0..... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x20, 0x02, 0x01, 0x6a, 0x02, 0x01, 0x00, /* . ..j... */ +0x02, 0x01, 0x00, 0x30, 0x15, 0x30, 0x13, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, /* .+...... */ +0x01, 0x0b, 0x00, 0x46, 0x05, 0x00, 0xb6, 0x0b, /* ...F.... */ +0x60, 0xd7 /* `. */ +}; + +int set_request_counter64_size = 48; + + + +/* Get request counter 64 Frame 187(84 bytes) */ +const unsigned char get_request_counter64_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x6b, 0x02, 0x01, 0x00, 0x02, /* ...k.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x0b, 0x00, 0x05, 0x00 /* .... */ +}; + + +int get_request_counter64_size = 42; + +const unsigned char set_request_counter64_5bytes_pkt[49] = { +0x30, 0x2f, 0x02, 0x01, 0x01, 0x04, /* .Z0/.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x21, 0x02, 0x01, 0x72, 0x02, 0x01, 0x00, /* .!..r... */ +0x02, 0x01, 0x00, 0x30, 0x16, 0x30, 0x14, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, /* .+...... */ +0x01, 0x0b, 0x00, 0x46, 0x06, 0x00, 0xd2, 0x42, /* ...F...B */ +0x39, 0x88, 0xd7 /* 9.. */ +}; + +int set_request_counter64_5bytes_size = 49; + +const unsigned char get_request_counter64_5bytes_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x73, 0x02, 0x01, 0x00, 0x02, /* ...s.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x0b, 0x00, 0x05, 0x00 /* .... */ +}; + +int get_request_counter64_5bytes_size = 42; + +/* SNMP_TESTING_GetSet_timertic.pcapng */ + +/* Set request timertic Frame 832 (89 bytes) */ +const unsigned char set_request_timertic_pkt[47] = { +0x30, 0x2d, 0x02, 0x01, 0x01, 0x04, /* .X0-.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x1f, 0x02, 0x01, 0x56, 0x02, 0x01, 0x00, /* ....V... */ +0x02, 0x01, 0x00, 0x30, 0x14, 0x30, 0x12, 0x06, /* ...0.0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, /* .+...... */ +0x01, 0x09, 0x00, 0x43, 0x04, 0x01, 0xd2, 0x08, /* ...C.... */ +0xa5 /* . */ +}; + +int set_request_timertic_size = 47; + + +/* Get request timertic Frame 1740 (84 bytes) */ +const unsigned char get_request_timertic_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* .S0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x57, 0x02, 0x01, 0x00, 0x02, /* ...W.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x09, 0x00, 0x05, 0x00 /* .... */ +}; + +int get_request_timertic_size = 42; + +/* SNMP_TESTING_GetSet_String.pcapng */ + +/* Set request string Frame 74(95 bytes) */ +const unsigned char set_request_string_pkt[53] = { +0x30, 0x33, 0x02, 0x01, 0x01, 0x04, /* .^03.... */ +0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, /* .private */ +0xa3, 0x25, 0x02, 0x01, 0x70, 0x02, 0x01, 0x00, /* .%..p... */ +0x02, 0x01, 0x00, 0x30, 0x1a, 0x30, 0x18, 0x06, /* ...0.0.. */ +0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x01, /* .+...... */ +0x00, 0x04, 0x0c, 0x6d, 0x79, 0x20, 0x73, 0x79, /* ...my sy */ +0x73, 0x74, 0x65, 0x6d, 0x20, 0x69, 0x64 /* stem id */ +}; + +int set_request_string_size = 53; + + +/* Get request string Frame 184(82 bytes) */ +const unsigned char get_request_string_pkt[40] = { +0x30, 0x26, 0x02, 0x01, 0x01, 0x04, /* .Q0&.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x19, 0x02, 0x01, 0x71, 0x02, 0x01, 0x00, 0x02, /* ...q.... */ +0x01, 0x00, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x08, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x01, 0x00, /* +....... */ +0x05, 0x00 /* .. */ +}; + +int get_request_string_size = 40; + diff --git a/test/regression/snmp_test/get_snmp_v3_request.c b/test/regression/snmp_test/get_snmp_v3_request.c new file mode 100644 index 00000000..db685cab --- /dev/null +++ b/test/regression/snmp_test/get_snmp_v3_request.c @@ -0,0 +1,94 @@ +/* Frame (101 bytes) */ +const unsigned char get_v3_request_packet[101] = { +0x00, 0xcf, 0x54, 0x85, 0xc3, 0x01, 0xe0, 0x69, /* ..T....i */ +0x95, 0x6f, 0x7e, 0xed, 0x08, 0x00, 0x45, 0x00, /* .o~...E. */ +0x00, 0x57, 0x38, 0xb3, 0x00, 0x00, 0x80, 0x11, /* .W8..... */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0x59, 0xc0, 0x02, /* .....Y.. */ +0x02, 0x42, 0xea, 0x38, 0x00, 0xa1, 0x00, 0x43, /* .B.8...C */ +0x84, 0xf4, 0x30, 0x39, 0x02, 0x01, 0x03, 0x30, /* ..09...0 */ +0x0e, 0x02, 0x01, 0x0a, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x10, 0x30, 0x0e, 0x04, 0x00, 0x02, 0x01, 0x00, /* .0...... */ +0x02, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, /* ........ */ +0x00, 0x30, 0x12, 0x04, 0x00, 0x04, 0x00, 0xa0, /* .0...... */ +0x0c, 0x02, 0x02, 0x00, 0xb4, 0x02, 0x01, 0x00, /* ........ */ +0x02, 0x01, 0x00, 0x30, 0x00 /* ...0. */ +}; + +int v3_request_size = 101; + +const unsigned char v3_report_packet[147] = { +0xe0, 0x69, 0x95, 0x6f, 0x7e, 0xed, 0x00, 0xcf, /* .i.o~... */ +0x54, 0x85, 0xc3, 0x01, 0x08, 0x00, 0x45, 0x00, /* T.....E. */ +0x00, 0x85, 0x00, 0x28, 0x40, 0x00, 0x80, 0x11, /* ...(@... */ +0x75, 0xa0, 0xc0, 0x02, 0x02, 0x42, 0xc0, 0x02, /* u....B.. */ +0x02, 0x59, 0x00, 0xa1, 0xea, 0x38, 0x00, 0x71, /* .Y...8.q */ +0x3e, 0x53, 0x30, 0x82, 0x00, 0x65, 0x02, 0x01, /* >S0..e.. */ +0x03, 0x30, 0x82, 0x00, 0x0d, 0x02, 0x01, 0x0a, /* .0...... */ +0x02, 0x02, 0x01, 0xf0, 0x04, 0x01, 0x00, 0x02, /* ........ */ +0x01, 0x03, 0x04, 0x1d, 0x30, 0x82, 0x00, 0x19, /* ....0... */ +0x04, 0x0b, 0x80, 0x00, 0x0d, 0xfe, 0x03, 0x00, /* ........ */ +0x77, 0x23, 0x23, 0x46, 0x69, 0x02, 0x01, 0x00, /* w##Fi... */ +0x02, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, /* ........ */ +0x00, 0x30, 0x82, 0x00, 0x2e, 0x04, 0x0b, 0x80, /* .0...... */ +0x00, 0x0d, 0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, /* .....w## */ +0x46, 0x69, 0x04, 0x00, 0xa8, 0x1d, 0x02, 0x02, /* Fi...... */ +0x00, 0xb4, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, /* ........ */ +0x30, 0x11, 0x30, 0x0f, 0x06, 0x0a, 0x2b, 0x06, /* 0.0...+. */ +0x01, 0x06, 0x03, 0x0f, 0x01, 0x01, 0x04, 0x00, /* ........ */ +0x41, 0x01, 0x01 /* A.. */ +}; + +int v3_report_size = 147; + +const unsigned char get_v3_next_request_packet[141] = { +0x00, 0xcf, 0x54, 0x85, 0xc3, 0x01, 0xe0, 0x69, /* ..T....i */ +0x95, 0x6f, 0x7e, 0xed, 0x08, 0x00, 0x45, 0x00, /* .o~...E. */ +0x00, 0x7f, 0x38, 0xb4, 0x00, 0x00, 0x80, 0x11, /* ..8..... */ +0x00, 0x00, 0xc0, 0x02, 0x02, 0x59, 0xc0, 0x02, /* .....Y.. */ +0x02, 0x42, 0xea, 0x38, 0x00, 0xa1, 0x00, 0x6b, /* .B.8...k */ +0x85, 0x1c, 0x30, 0x61, 0x02, 0x01, 0x03, 0x30, /* ..0a...0 */ +0x0e, 0x02, 0x01, 0x0b, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x20, 0x30, 0x1e, 0x04, 0x0b, 0x80, 0x00, 0x0d, /* 0...... */ +0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69, /* ...w##Fi */ +0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, /* ........ */ +0x6a, 0x61, 0x6e, 0x65, 0x74, 0x04, 0x00, 0x04, /* janet... */ +0x00, 0x30, 0x2a, 0x04, 0x0b, 0x80, 0x00, 0x0d, /* .0*..... */ +0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69, /* ...w##Fi */ +0x04, 0x00, 0xa1, 0x19, 0x02, 0x02, 0x00, 0xb5, /* ........ */ +0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x0d, /* ......0. */ +0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, /* 0...+... */ +0x01, 0x01, 0x03, 0x05, 0x00 /* ..... */ +}; + +int v3_next_request_size = 141; + +const unsigned char v3_response_packet[154] = { +0xe0, 0x69, 0x95, 0x6f, 0x7e, 0xed, 0x00, 0xcf, /* .i.o~... */ +0x54, 0x85, 0xc3, 0x01, 0x08, 0x00, 0x45, 0x00, /* T.....E. */ +0x00, 0x8c, 0x00, 0x2e, 0x40, 0x00, 0x80, 0x11, /* ....@... */ +0x75, 0x93, 0xc0, 0x02, 0x02, 0x42, 0xc0, 0x02, /* u....B.. */ +0x02, 0x59, 0x00, 0xa1, 0xea, 0x38, 0x00, 0x78, /* .Y...8.x */ +0x44, 0x29, 0x30, 0x82, 0x00, 0x6c, 0x02, 0x01, /* D)0..l.. */ +0x03, 0x30, 0x82, 0x00, 0x0d, 0x02, 0x01, 0x0b, /* .0...... */ +0x02, 0x02, 0x01, 0xf0, 0x04, 0x01, 0x00, 0x02, /* ........ */ +0x01, 0x03, 0x04, 0x22, 0x30, 0x82, 0x00, 0x1e, /* ..."0... */ +0x04, 0x0b, 0x80, 0x00, 0x0d, 0xfe, 0x03, 0x00, /* ........ */ +0x77, 0x23, 0x23, 0x46, 0x69, 0x02, 0x01, 0x00, /* w##Fi... */ +0x02, 0x01, 0x00, 0x04, 0x05, 0x6a, 0x61, 0x6e, /* .....jan */ +0x65, 0x74, 0x04, 0x00, 0x04, 0x00, 0x30, 0x82, /* et....0. */ +0x00, 0x30, 0x04, 0x0b, 0x80, 0x00, 0x0d, 0xfe, /* .0...... */ +0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69, 0x04, /* ..w##Fi. */ +0x00, 0xa2, 0x1f, 0x02, 0x02, 0x00, 0xb5, 0x02, /* ........ */ +0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x82, 0x00, /* .....0.. */ +0x11, 0x30, 0x82, 0x00, 0x0d, 0x06, 0x08, 0x2b, /* .0.....+ */ +0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x43, /* .......C */ +0x01, 0x01 /* .. */ +}; + +int v3_response_size = 154; + + + + diff --git a/test/regression/snmp_test/netx_snmp_abnormal_packet_test.c b/test/regression/snmp_test/netx_snmp_abnormal_packet_test.c new file mode 100644 index 00000000..2645860a --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_abnormal_packet_test.c @@ -0,0 +1,489 @@ +/* This tests processing abornal packet. + */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#define DEMO_STACK_SIZE 4096 + +#if !defined(NX_DISABLE_IPV4) + +static NX_SNMP_SECURITY_KEY my_privacy_key; +static NX_SNMP_SECURITY_KEY my_authentication_key; + +static UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +static UINT query_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ +#define QUERY_COUNT 4 + +/* To show byte by byte comparison of pre-recorded response with SNMP agent, define this option. +#define VERBOSE +*/ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +static unsigned char test_get_request_pkt_v1[] = { +0x30, 0x28, 0x02, 0x01, 0x00, 0x04, /* ..0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x29, 0x02, 0x01, 0x00, 0x02, /* ...).... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x1e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x02, 0x00, 0x05, 0x00 /* .... */ +}; + +static unsigned char test_get_request_pkt_v3[] = { +0x30, 0x73, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, 0x04, 0x14, 0xa2, 0xd6, 0x5e, 0x02, 0x03, 0x00, +0xff, 0xe3, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, 0x26, 0x30, 0x24, 0x04, 0x11, 0x80, 0x00, +0x1f, 0x88, 0x80, 0xb1, 0x98, 0x19, 0x38, 0x12, 0x6f, 0x40, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, +0x01, 0x06, 0x02, 0x01, 0x00, 0x04, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x04, 0x00, 0x04, 0x00, +0x30, 0x33, 0x04, 0x11, 0x80, 0x00, 0x1f, 0x88, 0x80, 0xb1, 0x98, 0x19, 0x38, 0x12, 0x6f, 0x40, +0x60, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xa0, 0x1c, 0x02, 0x04, 0x4c, 0x1f, 0xe2, 0x4d, 0x02, +0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x30, 0x1e, 0x06, 0x0a, +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, +0x02, 0x00, 0x05, 0x00 +}; + +static unsigned char test_get_request_pkt_v3_1[] = { +0x30, 0x73, 0x02, 0x01, 0x03, 0x30, 0x11, 0x02, 0x04, 0x14, 0xa2, 0xd6, 0x5e, 0x02, 0x03, 0x00, +0xff, 0xe3, 0x04, 0x01, 0x07, 0x02, 0x01, 0x03, 0x04, 0x00, 0x30, 0x24, 0x04, 0x11, 0x80, 0x00, +0x1f, 0x88, 0x80, 0xb1, 0x98, 0x19, 0x38, 0x12, 0x6f, 0x40, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, +0x01, 0x06, 0x02, 0x01, 0x00, 0x04, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x04, 0x00, 0x04, 0x00, +0x30, 0x33, 0x04, 0x11, 0x80, 0x00, 0x1f, 0x88, 0x80, 0xb1, 0x98, 0x19, 0x38, 0x12, 0x6f, 0x40, +0x60, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xa0, 0x1c, 0x02, 0x04, 0x4c, 0x1f, 0xe2, 0x4d, 0x02, +0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x30, 0x1e, 0x06, 0x0a, +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, +0x02, 0x00, 0x05, 0x00 +}; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + +static UCHAR context_engine[] = {0x80, 0x00, 0x1f, 0x88, 0x80, 0xb1, 0x98, 0x19, 0x38, 0x12, 0x6f, 0x40, 0x60, 0x00, 0x00, 0x00, 0x00}; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 15000); + pointer = pointer + 10000; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "public", &agent_ip, pointer, 4096, &pool_0, + v3_mib2_username_processing, v3_mib2_get_processing, + v3_mib2_getnext_processing, v3_mib2_set_processing); + pointer = pointer + 4096; + + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_context_engine_set(&my_agent, context_engine, sizeof(context_engine)); + + status += nx_snmp_agent_v3_context_boots_set(&my_agent, 6); + + if (status) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_SNMP_TRAP_OBJECT trap_list[7]; +NX_SNMP_OBJECT_DATA trap_data0; +NX_SNMP_OBJECT_DATA trap_data1; +UINT counter = 133; + + + printf("NetX Test: SNMP Abnormal Packet Test................................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!query_response_complete) + { + tx_thread_sleep(20); + } + + trap_list[0].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.1.0"; + trap_list[0].nx_snmp_object_data = &trap_data0; + trap_data0.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data0.nx_snmp_object_data_msw = counter++; + + trap_list[1].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.7.0"; + trap_list[1].nx_snmp_object_data = &trap_data1; + trap_data1.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data1.nx_snmp_object_data_msw = counter++; + + /* Null terminate the list. */ + trap_list[2].nx_snmp_object_string_ptr = NX_NULL; + trap_list[2].nx_snmp_object_data = NX_NULL; + + my_agent.nx_snmp_agent_interface_index = 500; + status = nx_snmp_agent_trap_send(&my_agent, SNMP_MANAGER_ADDRESS, (UCHAR *)"trap", (UCHAR *) "1.3.6.1.2.1.1.3.0", NX_SNMP_TRAP_COLDSTART, 0, tx_time_get(), &trap_list[0]); + + if (status == NX_SUCCESS) + { + error_counter++; + } + +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_snmp_agent_set_interface(&my_agent, 200); + if (status == NX_SUCCESS) + { + error_counter++; + } +#endif + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +UINT i; +USHORT request_id = 1; + + + /* Let the agent get set up first! */ + tx_thread_sleep(30); + + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to an IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 0, 100); + + /* Check status. */ + if (status) + { + + error_counter++; + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + + return; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + if (i == 1) + { + my_agent.nx_snmp_agent_v3_message_security_options = 0x02; + nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)("privpassword"), &my_privacy_key); + nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + } + + if (i == 2) + { + my_agent.nx_snmp_agent_v3_message_security_options = 0x01; + nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)("authpassword"), &my_authentication_key); + nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + } + + if (i == 3) + { + my_agent.nx_snmp_agent_v3_security_authentication_size = 0x0C; + } + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + request_id++; + } + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &query_packet, NX_UDP_PACKET, 100); + + /* Check status. */ + if (status) + { + return status; + } + + + memset(query_packet -> nx_packet_prepend_ptr, 0, (query_packet -> nx_packet_data_end - query_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(query_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + nx_packet_release(query_packet); + + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = test_get_request_pkt_v3; + snmp_query[0].snmp_query_pkt_size = sizeof(test_get_request_pkt_v3); + snmp_query[1].snmp_query_pkt_data = test_get_request_pkt_v1; + snmp_query[1].snmp_query_pkt_size = sizeof(test_get_request_pkt_v1); + snmp_query[2].snmp_query_pkt_data = test_get_request_pkt_v1; + snmp_query[2].snmp_query_pkt_size = sizeof(test_get_request_pkt_v1); + snmp_query[3].snmp_query_pkt_data = test_get_request_pkt_v3_1; + snmp_query[3].snmp_query_pkt_size = sizeof(test_get_request_pkt_v3_1); +} + + +/* Define the application's GET processing routine. */ + +UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + error_counter++; + + /* Return the status. */ + return(NX_SUCCESS); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + + /* Return the status. */ + return(NX_SUCCESS); +} + + +/* Define the application's SET processing routine. */ + +UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + + /* Return the status. */ + return(NX_SUCCESS); +} + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + return(NX_SUCCESS); + +} + +/* Define the application's update routine. */ + +VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_abnormal_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP Abnormal Packet Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_basic_v2_test.c b/test/regression/snmp_test/netx_snmp_basic_v2_test.c new file mode 100644 index 00000000..a45d297e --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_basic_v2_test.c @@ -0,0 +1,668 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + three requests, Get, Get Next, and Get Bulk, and the SNMP agent responds. A successful + result means the Agent received and sent the expected number of messages, and no + internal SNMP errors were encountered. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "small_mib_helper.h" // was demo_snmp_helper.h in the old MIB + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +extern MIB_ENTRY mib2_mib[]; + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +#define QUERY_COUNT 3 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char simple_get_query_pkt[82]; +extern int simple_get_query_size; +extern char simple_get_next_query_pkt[82]; +extern int simple_get_next_query_size; +#if 1 +extern char simple_get_bulk_query_pkt[76]; +extern int simple_get_bulk_query_size; +#endif + + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_basic_v2_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + printf("NetX Test: SNMP Basic V2 Test........................................"); + + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + /* Check for correct internal counters of SNMP processing. */ + if ((v2_my_agent.nx_snmp_agent_get_requests != 1) || + (v2_my_agent.nx_snmp_agent_getnext_requests != 1) || + (v2_my_agent.nx_snmp_agent_getbulk_requests != 1) || + //(v2_my_agent.nx_snmp_agent_total_get_variables != 8) || + (v2_my_agent.nx_snmp_agent_packets_received != 3) || + (v2_my_agent.nx_snmp_agent_packets_sent != 3) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 3)) + { + error_counter++; + + printf("ERROR1!\n"); + test_control_return(1); + } + + /* Check for errors processing the requests. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + v2_my_agent.nx_snmp_agent_request_errors || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests || + v2_my_agent.nx_snmp_agent_no_such_name_errors) + { + + error_counter++; + + printf("ERROR2!\n"); + test_control_return(1); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + + printf("ERROR3!\n"); + test_control_return(1); + //break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + + printf("ERROR4!\n"); + test_control_return(1); + //break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &simple_get_query_pkt[0]; + snmp_query[0].snmp_query_pkt_size = simple_get_query_size; + + + snmp_query[1].snmp_query_pkt_data = &simple_get_next_query_pkt[0]; + snmp_query[1].snmp_query_pkt_size = simple_get_next_query_size; +#if 1 + snmp_query[2].snmp_query_pkt_data = &simple_get_bulk_query_pkt[0]; + snmp_query[2].snmp_query_pkt_size = simple_get_bulk_query_size; +#endif +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + if (mib2_mib[i].object_get_octet_callback) + { + + /* Call the get octet function (has a length input). */ + status = (mib2_mib[i].object_get_octet_callback)(mib2_mib[i].object_value_ptr, object_data, mib2_mib[i].length); + } + else if (mib2_mib[i].object_get_callback) + { + + /* Call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + error_counter++; + + printf("ERROR5!\n"); + test_control_return(1); + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + //return(NX_SNMP_ERROR_NOSUCHNAME); + + printf("ERROR6!\n"); + test_control_return(1); + } + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Call either the get octet or get callback, depending what is registered in the table entry. */ + if (mib2_mib[i].object_get_octet_callback) + { + + /* Call the get octet function (has a length input). */ + status = (mib2_mib[i].object_get_octet_callback)(mib2_mib[i].object_value_ptr, object_data, mib2_mib[i].length); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else if (mib2_mib[i].object_get_callback) + { + + /* Call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + error_counter++; + + printf("ERROR7!\n"); + test_control_return(1); + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_basic_v2_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP Basic V2 Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_no_security_function_test.c b/test/regression/snmp_test/netx_snmp_no_security_function_test.c new file mode 100644 index 00000000..8eac7c5f --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_no_security_function_test.c @@ -0,0 +1,827 @@ +// JLC THIS TEST IS BADLY DONE, TEST IT PROPERLY, NOT BYTE BY BYTE! + +/* This NetX test is a simple contact between agent and browser with no security. Note that + NX_SNMP_FUNCTION_TESTING must be defined in nxd_snmp.c or else timer tick data (boot time, SysTimerTick, will not match the + 'pre-recorded' data that the NetX SNMP Agent responses re compared with, and the test will fail. + */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" + + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define VERBOSE // jlc disable +#define DEMO_STACK_SIZE 2048 + +UCHAR *current_object_requested; +UINT aquery_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ + +#define NX_SNMP_ID_OFFSET 17 /* Size of top snmp header, version, public string */ + /* data header, and request id block; assumes public string is 'public' */ +#define QUERY_COUNT 2 +#define RESPONSE_COUNT 2 + + +UCHAR asysDescr[] = "NetX SNMP Agent"; /* sysDescr:OctetString RO */ +UCHAR asysObjectID[] = "1.3.6.1.2.1.1"; /* sysObjectID:ObjectID RO */ +LONG asysUpTime = 0; /* sysUpTime:TimeTicks RO */ +UCHAR asysContact[128] = "NetX sysContact Name"; /* sysContact:OctetString RW */ +UCHAR asysName[128] = "NetX sysName"; /* sysName:OctetString RW */ + +/* This is for SNMPv3 discovery/synchronization. */ +ULONG ausmStatsUnknownEngineIDs = 0; /* usmStatsUnknownEngineIDs:Counter RO */ +ULONG ausmStatsNotInTimeWindows = 0; /* usmStatsNotInTimeWindows:Counter RO */ +ULONG ausmStatsUnsupportedSec = 01; +ULONG ausmStatsUnknownUsername = 0; + +/* Define application MIB data structure. Actual application structures would certainly vary. */ + +typedef struct NOSEC_MIB_ENTRY_STRUCT +{ + + UCHAR *object_name; + void *object_value_ptr; + UINT (*object_get_callback)(VOID *source_ptr, NX_SNMP_OBJECT_DATA *object_data); + UINT (*object_set_callback)(VOID *destination_ptr, NX_SNMP_OBJECT_DATA *object_data); +} NOSEC_MIB_ENTRY; + +/* Define the actual MIB-2. */ + +static NOSEC_MIB_ENTRY mib2_mib[] = { + + /* OBJECT ID OBJECT VARIABLE GET ROUTINE SET ROUTINE */ + + {(UCHAR *) "1.3.6.1.2.1.1.1.0", asysDescr, nx_snmp_object_string_get, NX_NULL}, + {(UCHAR *) "1.3.6.1.2.1.1.2.0", asysObjectID, nx_snmp_object_id_get, NX_NULL}, + {(UCHAR *) "1.3.6.1.2.1.1.3.0", &asysUpTime, nx_snmp_object_timetics_get, NX_NULL}, + {(UCHAR *) "1.3.6.1.2.1.1.4.0", asysContact, nx_snmp_object_string_get, nx_snmp_object_string_set}, + {(UCHAR *) "1.3.6.1.2.1.1.5.0", asysName, nx_snmp_object_string_get, nx_snmp_object_string_set}, + + /* Subset of usm variable bindings for SNMPv3 discovery messages and synchronization: */ + {(UCHAR *) "1.3.6.1.6.3.15.1.1.1.0", &ausmStatsUnsupportedSec, nx_snmp_object_counter_get, nx_snmp_object_counter_set}, + {(UCHAR *) "1.3.6.1.6.3.15.1.1.2.0", &ausmStatsNotInTimeWindows, nx_snmp_object_counter_get, nx_snmp_object_counter_set}, + {(UCHAR *) "1.3.6.1.6.3.15.1.1.3.0", &ausmStatsUnknownUsername, nx_snmp_object_counter_get, nx_snmp_object_counter_set}, + {(UCHAR *) "1.3.6.1.6.3.15.1.1.4.0", &ausmStatsUnknownEngineIDs, nx_snmp_object_counter_get, nx_snmp_object_counter_set}, + {(UCHAR *) "1.3.6.1.7", (UCHAR *) "1.3.6.1.7", nx_snmp_object_end_of_mib, NX_NULL}, + {NX_NULL, NX_NULL, NX_NULL, NX_NULL} +}; + +/* To show byte by byte comparison of pre-recorded response with SNMP agent, define this option. +#define VERBOSE +*/ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_nosec_agent; +static NX_PACKET_POOL nosec_pool; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + + +UCHAR acontext_engine_id[] = {0x80, 0x00, 0x0d, 0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69}; +UINT acontext_engine_size = 11; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); +static UINT check_valid_response(NX_PACKET *agent_packet, UINT packet_number, UINT *valid); + + +static UINT nosec_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT nosec_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT nosec_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT nosec_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID nosec_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char get_v3_request_packet[101]; +extern int v3_request_size; +extern char get_v3_next_request_packet[141]; +extern int v3_next_request_size; +extern char v3_report_packet[147]; +extern int v3_report_size; +extern char v3_response_packet[154]; +extern int v3_response_size; + + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + +typedef struct SNMP_RESPONSE_STRUCT +{ + char *snmp_response_pkt_data; + int snmp_response_pkt_size; +} SNMP_RESPONSE; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; +static SNMP_RESPONSE snmp_response[RESPONSE_COUNT]; + +#define SNMP_START_OFFSET (14 + 20 + 8) // ethernet, ip and udp headers + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_security_no_security_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + printf("NetX Test: SNMP No Security Function Test............................"); + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&nosec_pool, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Check for IP create errors. */ + if (status) + { + +#ifdef VERBOSE + printf("\npacket create error 0x%x \n", status); +#endif + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &nosec_pool, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &nosec_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + +#ifdef VERBOSE + printf("\nIP create error 0x%x \n", status); +#endif + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_nosec_agent, "public", &agent_ip, pointer, 4096, &nosec_pool, + nosec_mib2_username_processing, nosec_mib2_get_processing, + nosec_mib2_getnext_processing, nosec_mib2_set_processing); + pointer = pointer + 4096; + + if (status) + { + +#ifdef VERBOSE + printf("\nagent create error 0x%x \n", status); +#endif + printf("ERROR!\n"); + test_control_return(1); + } + + if (my_nosec_agent.nx_snmp_agent_v3_enabled == NX_TRUE) + { + ULONG boot_count; + + /* Make sure boot time and engine boot ID match the pre-recorded data. */ + boot_count = 0x1; + status = nx_snmp_agent_context_engine_set(&my_nosec_agent, acontext_engine_id, acontext_engine_size); + status |= nx_snmp_agent_v3_context_boots_set(&my_nosec_agent, boot_count); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + } + else + { + +#ifdef VERBOSE + printf("\n agent not enabled for V3 \n"); +#endif + printf("ERROR!\n"); + test_control_return(1); + } + +} + +/* Define the SNMP Agent thread. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + tx_thread_sleep(20); + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_nosec_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!aquery_response_complete) + { + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + + // tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; +UINT valid = NX_TRUE; + + /* Let the agent get set up first! */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to the IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + +#ifdef VERBOSE + printf("\n UDP socket create error 0x%x \n", status); +#endif + error_counter++; + + /* Indicate the query response is complete. */ + aquery_response_complete = NX_TRUE; + + return; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + +#ifdef VERBOSE + printf("\n%d query packet send error 0x%x \n",i, status); +#endif + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + +#ifdef VERBOSE + printf("\n%d socket receive error 0x%x \n",i, status); +#endif + error_counter++; + break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + if (status) + { + +#ifdef VERBOSE + printf("\n%d packet extract error 0x%x \n",i, status); +#endif + error_counter++; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the query response is complete. */ + aquery_response_complete = NX_TRUE; + +} + + +/* Determines if we got a valid response using known SNMP query and response data. */ +UINT check_valid_response(NX_PACKET *agent_packet, UINT packet_number, UINT *valid) +{ + +UINT data_size; +UCHAR *work_ptr; +UINT j; + + + work_ptr = (UCHAR *)(&snmp_response[packet_number].snmp_response_pkt_data[0] + SNMP_START_OFFSET); + + data_size = snmp_response[packet_number].snmp_response_pkt_size - SNMP_START_OFFSET; + + if (data_size == 0) + { + return 1; /* Invalid data */ + } + + for (j = 0; j < data_size; j++) + { + + /* For each test , initialize outcome as successful test. */ + *valid = NX_TRUE; + +#ifdef VERBOSE + printf("%d. 0%x 0%x ", j, *(agent_packet -> nx_packet_prepend_ptr + j), work_ptr[j]); +#endif + + /* It is unlikely this logic is needed as long as NX_SNMP_FUNCTION_TESTING is defined, + and the sysUpTime is always updated to 1. */ + + if (*(agent_packet -> nx_packet_prepend_ptr + j) != work_ptr[j]) + { + + /* There is no way to match certain variables such as 'engine boot time' with system time of the pre-recorded + data. Ignore this data */ + + if (packet_number == 1) + { + + /* Case 1: the 'work' packet timer tick data is two bytes */ + if (j == 109) + { + + /* Determine if the time value is 1 byte or 2 bytes. */ + if ((work_ptr[j] == 2) && (*(agent_packet -> nx_packet_prepend_ptr+j) == 1)) + { + /* 2 bytes. Skip an extra byte. We do this by bumping the work pointer by one. */ + work_ptr = (UCHAR *)(&snmp_response[packet_number].snmp_response_pkt_data[0] + SNMP_START_OFFSET + 1); + } + + /* For either cast, skip the time value. */ + j++; +#ifdef VERBOSE + printf("Packet %d skipping %d'th element for comparison\n", packet_number, j); +#endif + + continue; + } + /* Case 2: both have same length of timer tick data, but different value. */ + else if (j == 110) + { + + /* Just skip over the current index. */ +#ifdef VERBOSE + printf("Packet %d skipping timer tick data at %d'th index for comparison\n", packet_number, j); +#endif + + /* Are they both two bytes long? */ + if (work_ptr[j-1] == 2) + { + + /* Yes. Skip an extra index in addition + to the current one. */ +#ifdef VERBOSE + printf("Packet %d two byte timer tick: skip one more index to %d'th index\n", packet_number, j); +#endif + + j++; + } + + continue; + } + else + { + + /* Else invalid or unexpected data. */ + return(1); + } + } + else + { + + /* Else invalid or unexpected data. */ + return(1); + } + } +#ifdef VERBOSE + printf("\n"); +#endif + + } + + return NX_SUCCESS; + +} + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&nosec_pool, &query_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + +#ifdef VERBOSE + printf("\n packet allocate error 0x%x \n", status); +#endif + return status; + } + + /* Write the SNMP query messages into the packet payload! */ + snmp_query[packet_number].snmp_query_pkt_data += SNMP_START_OFFSET; + memcpy(query_packet -> nx_packet_prepend_ptr, snmp_query[packet_number].snmp_query_pkt_data, snmp_query[packet_number].snmp_query_pkt_size - SNMP_START_OFFSET); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size - SNMP_START_OFFSET; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + { + +#ifdef VERBOSE + printf("\n socket send error 0x%x \n", status); +#endif + nx_packet_release(query_packet); + } + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = &get_v3_request_packet[0]; + snmp_query[0].snmp_query_pkt_size = v3_request_size; + snmp_query[1].snmp_query_pkt_data = &get_v3_next_request_packet[0]; + snmp_query[1].snmp_query_pkt_size = v3_next_request_size; + + snmp_response[0].snmp_response_pkt_data = &v3_report_packet[0]; + snmp_response[0].snmp_response_pkt_size = v3_report_size; + snmp_response[1].snmp_response_pkt_data = &v3_response_packet[0]; + snmp_response[1].snmp_response_pkt_size = v3_response_size; + +} + + +/* Define the application's GET processing routine. */ +UINT nosec_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT nosec_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT nosec_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT nosec_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + nosec_mib2_variable_update(&agent_ip, &my_nosec_agent); + + return NX_SUCCESS; + +} + + +/* Define the application's update routine. */ + +VOID nosec_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + + /* Update the snmp parameters. */ + asysUpTime = 1; /* This is necessary to compare pre-recorded data with SNMP agent response! */ +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_security_no_security_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP No Security Function Test............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_setget_integers_test.c b/test/regression/snmp_test/netx_snmp_setget_integers_test.c new file mode 100644 index 00000000..aab54a81 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_setget_integers_test.c @@ -0,0 +1,668 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a set request for an OID that specifies an IPv4 address. Then it sends a GET request + for the same OID and compares it to what it just set it to. It sends another SET + and GET request for an IPv6 address and compares the IPv6 retrieved from the MIB + to be correct if NETX Duo is in use only. + + The MIB database is defined in snmp_demo_helper.h. The SNMP browser queries are + provided in GetSetIPv4v6Address.c. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +extern MIB_ENTRY mib2_mib[]; + + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +INT integer_data[] = {255, -255, -2345345, 1234}; +#define QUERY_COUNT 7 + + + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char set_request_integer_255_pkt[43]; +extern int set_request_integer_255_size; +extern char get_request_integer_255_pkt[40]; +extern int get_request_integer_255_size; + +extern char set_request_integer_neg255_pkt[43]; +extern int set_request_integer_neg255_size; +extern char get_request_integer_neg255_pkt[40]; +extern int get_request_integer_neg255_size; + +extern char set_request_integer_neg2345345_pkt[44]; +extern int set_request_integer_neg2345345_size; +extern char get_request_integer_neg2345345_pkt[40]; +extern int get_request_integer_neg2345345_size; + +extern char get_request_v1_1234_packet[]; +extern int get_request_v1_1234_packet_size; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_integers_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + printf("NetX Test: SNMP Set Get Integer Test................................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + /* Check for correct internal counters of SNMP processing. */ + if ((v2_my_agent.nx_snmp_agent_get_requests != 4) || + (v2_my_agent.nx_snmp_agent_set_requests != 3) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 4) || + (v2_my_agent.nx_snmp_agent_packets_received != 7) || + (v2_my_agent.nx_snmp_agent_packets_sent != 7) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 7)) + + { + error_counter++; + } + + /* Check for errors processing the requests. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + v2_my_agent.nx_snmp_agent_request_errors || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests || + v2_my_agent.nx_snmp_agent_no_such_name_errors) + { + + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet to the SNMP Agent with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &set_request_integer_255_pkt[0]; + snmp_query[0].snmp_query_pkt_size = set_request_integer_255_size; + + + snmp_query[1].snmp_query_pkt_data = &get_request_integer_255_pkt[0]; + snmp_query[1].snmp_query_pkt_size = get_request_integer_255_size; + + snmp_query[2].snmp_query_pkt_data = &set_request_integer_neg255_pkt[0]; + snmp_query[2].snmp_query_pkt_size = set_request_integer_neg255_size; + + snmp_query[3].snmp_query_pkt_data = &get_request_integer_neg255_pkt[0]; + snmp_query[3].snmp_query_pkt_size = get_request_integer_neg255_size; + + snmp_query[4].snmp_query_pkt_data = &set_request_integer_neg2345345_pkt[0]; + snmp_query[4].snmp_query_pkt_size = set_request_integer_neg2345345_size; + + snmp_query[5].snmp_query_pkt_data = &get_request_integer_neg2345345_pkt[0]; + snmp_query[5].snmp_query_pkt_size = get_request_integer_neg2345345_size; + + snmp_query[6].snmp_query_pkt_data = &get_request_v1_1234_packet[0]; + snmp_query[6].snmp_query_pkt_size = get_request_v1_1234_packet_size; + +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +static UINT get_request_count = 0; + + /* Increment the get request count. */ + get_request_count++; + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + error_counter++; + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + error_counter++; + } + + + /* Check for correct (expected) value. */ + if (integer_data[get_request_count - 1] != (INT)object_data -> nx_snmp_object_data_msw) + { + error_counter++; + + } + + /* Return the status of the get handler (not necessarily the data checking). */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} + + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_integers_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP Set Get Integer Test.................................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_setget_ip_address_test.c b/test/regression/snmp_test/netx_snmp_setget_ip_address_test.c new file mode 100644 index 00000000..1ad3dd31 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_setget_ip_address_test.c @@ -0,0 +1,721 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a set request for an OID that specifies an IPv4 address. Then it sends a GET request + for the same OID and compares it to what it just set it to. It sends another SET + and GET request for an IPv6 address and compares the IPv6 retrieved from the MIB + to be correct if NETX Duo is in use only. + + The MIB database is defined in snmp_demo_helper.h. The SNMP browser queries are + provided in GetSetIPv4v6Address.c. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + + +#define DEMO_STACK_SIZE 2048 + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +extern MIB_ENTRY mib2_mib[]; + + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 +#define QUERY_COUNT 4 +#else +#define QUERY_COUNT 2 +#endif /* FEATURE_NX_IPV6 */ +#else +#define QUERY_COUNT 2 +#endif /* __PRODUCT_NETXDUO__ */ + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + +#define OID_IPV4_ADDRESS "1.3.6.1.2.1.3.1.1.3.0" +#define GET_IP_ADDRESS IP_ADDRESS(241,254,3,129) + +#ifdef __PRODUCT_NETXDUO__ +#define OID_IPV6_ADDRESS "1.3.6.1.2.1.3.1.1.3.1" + +const unsigned char test_ipv6_address[16] = { + 0x20, 0x01, 0x0d, 0xb7, 0x00, 0x00, 0xf1, 0x01, + 0xab, 0xcd, 0x00, 0x64, 0x00, 0x00, 0x02, 0x07 +}; +#endif + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char set_ipv4_address_request_pkt[47]; +extern int set_ipv4_address_request_size; +extern char get_ipv4_address_request_pkt[42]; +extern int get_ipv4_address_request_size; + +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 +extern char set_ipv6_address_request_pkt[60]; +extern int set_ipv6_address_request_size; +extern char get_ipv6_address_request_pkt[43]; +extern int get_ipv6_address_request_size; +#endif +#endif + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_ip_address_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + printf("NetX Test: SNMP Set Get IP Address Test.............................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + /* Check for correct internal counters of SNMP processing. */ +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 + if ((v2_my_agent.nx_snmp_agent_get_requests != 2) || + (v2_my_agent.nx_snmp_agent_set_requests != 2) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 2) || + (v2_my_agent.nx_snmp_agent_packets_received != 4) || + (v2_my_agent.nx_snmp_agent_packets_sent != 4) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 4)) +#else + if ((v2_my_agent.nx_snmp_agent_get_requests != 1) || + (v2_my_agent.nx_snmp_agent_set_requests != 1) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 1) || + (v2_my_agent.nx_snmp_agent_packets_received != 2) || + (v2_my_agent.nx_snmp_agent_packets_sent != 2) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 2)) +#endif /* FEATURE_NX_IPV6 */ +#else + if ((v2_my_agent.nx_snmp_agent_get_requests != 1) || + (v2_my_agent.nx_snmp_agent_set_requests != 1) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 1) || + (v2_my_agent.nx_snmp_agent_packets_received != 2) || + (v2_my_agent.nx_snmp_agent_packets_sent != 2) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 2)) + +#endif /* __PRODUCT_NETXDUO__ */ + { + error_counter++; + } + + /* Check for errors processing the requests. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + v2_my_agent.nx_snmp_agent_request_errors || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests || + v2_my_agent.nx_snmp_agent_no_such_name_errors) + { + + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet to the SNMP Agent with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &set_ipv4_address_request_pkt[0]; + snmp_query[0].snmp_query_pkt_size = set_ipv4_address_request_size; + + + snmp_query[1].snmp_query_pkt_data = &get_ipv4_address_request_pkt[0]; + snmp_query[1].snmp_query_pkt_size = get_ipv4_address_request_size; + +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 + snmp_query[2].snmp_query_pkt_data = &set_ipv6_address_request_pkt[0]; + snmp_query[2].snmp_query_pkt_size = set_ipv6_address_request_size; + + snmp_query[3].snmp_query_pkt_data = &get_ipv6_address_request_pkt[0]; + snmp_query[3].snmp_query_pkt_size = get_ipv6_address_request_size; +#endif +#endif +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +UINT temp; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + error_counter++; + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. Octet strings (as opposed to null terminated strings) + require a different get function. */ + + if (mib2_mib[i].object_get_octet_callback) + { + + /* Call the get octet function (has a length input). */ + status = (mib2_mib[i].object_get_octet_callback)(mib2_mib[i].object_value_ptr, object_data, mib2_mib[i].length); + } + else if (mib2_mib[i].object_get_callback) + { + + /* Call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + error_counter++; + } + + temp = memcmp(object_requested, OID_IPV4_ADDRESS, strlen(OID_IPV4_ADDRESS)); + if (temp == 0) + { + + if ((ULONG)object_data -> nx_snmp_object_data_msw != GET_IP_ADDRESS) + { + error_counter++; + } + } + +#ifdef __PRODUCT_NETXDUO__ +#ifdef FEATURE_NX_IPV6 + temp = memcmp(object_requested, OID_IPV6_ADDRESS, strlen(OID_IPV6_ADDRESS)); + if (temp == 0) + { + + UINT i = 0; + + for (i = 0; i< object_data ->nx_snmp_object_octet_string_size; i++) + { + if (object_data -> nx_snmp_object_octet_string[i] != test_ipv6_address[i]) + { + error_counter++; + break; + } + } + } + +#endif +#endif + + /* Return the status of the get handler (not necessarily the data checking). */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_ip_address_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP Set Get IP Address Test..............................N/A\n"); + test_control_return(3); +} +#endif + + diff --git a/test/regression/snmp_test/netx_snmp_setget_misc_test.c b/test/regression/snmp_test/netx_snmp_setget_misc_test.c new file mode 100644 index 00000000..d83aca4e --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_setget_misc_test.c @@ -0,0 +1,734 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a set request for an OID that specifies an IPv4 address. Then it sends a GET request + for the same OID and compares it to what it just set it to. It sends another SET + and GET request for an IPv6 address and compares the IPv6 retrieved from the MIB + to be correct if NETX Duo is in use only. + + The MIB database is defined in snmp_demo_helper.h. The SNMP browser queries are + provided in GetSetIPv4v6Address.c. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + + +#define DEMO_STACK_SIZE 2048 + +extern MIB_ENTRY mib2_mib[]; + + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + /* counter32, counter64 msb counter 64 lsb, timertic */ +//ULONG test_data[] = {30541989, 30541989}; +#define COUNTER32_VAL 30541989 +#define COUNTER64_VAL 3054198999 +#define COUNTER64_VAL0 0xD2 // part of number stored in msw +#define COUNTER64_VAL1 0x423988D7 // part of number stored in lsw +#define TIMERTIC_VAL 30541989 +#define STRING_TEST "my system id" +#define QUERY_COUNT 10 + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char set_request_counter32_pkt[47]; +extern int set_request_counter32_size; +extern char get_request_counter32_pkt[42]; +extern int get_request_counter32_size; + +extern char set_request_counter64_pkt[48]; +extern int set_request_counter64_size; +extern char get_request_counter64_pkt[42]; +extern int get_request_counter64_size; + +extern char set_request_counter64_5bytes_pkt[49]; +extern int set_request_counter64_5bytes_size; +extern char get_request_counter64_5bytes_pkt[42]; +extern int get_request_counter64_5bytes_size; + +extern char set_request_timertic_pkt[47]; +extern int set_request_timertic_size; +extern char get_request_timertic_pkt[42]; +extern int get_request_timertic_size; + + +extern char set_request_string_pkt[53]; +extern int set_request_string_size; +extern char get_request_string_pkt[40]; +extern int get_request_string_size; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_misc_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + printf("NetX Test: SNMP Set Get Miscellaneous Data Type Test................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + /* Check for correct internal counters of SNMP processing. */ + if ((v2_my_agent.nx_snmp_agent_get_requests != 5) || + (v2_my_agent.nx_snmp_agent_set_requests != 5) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 5) || + (v2_my_agent.nx_snmp_agent_packets_received != 10) || + (v2_my_agent.nx_snmp_agent_packets_sent != 10) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 10)) + + { + error_counter++; + } + + /* Check for errors processing the requests. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + v2_my_agent.nx_snmp_agent_request_errors || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests || + v2_my_agent.nx_snmp_agent_no_such_name_errors) + { + + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet to the SNMP Agent with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &set_request_counter32_pkt[0]; + snmp_query[0].snmp_query_pkt_size = set_request_counter32_size; + + snmp_query[1].snmp_query_pkt_data = &get_request_counter32_pkt[0]; + snmp_query[1].snmp_query_pkt_size = get_request_counter32_size; + + + snmp_query[2].snmp_query_pkt_data = &set_request_counter64_pkt[0]; + snmp_query[2].snmp_query_pkt_size = set_request_counter64_size; + + snmp_query[3].snmp_query_pkt_data = &get_request_counter64_pkt[0]; + snmp_query[3].snmp_query_pkt_size = get_request_counter64_size; + + + snmp_query[4].snmp_query_pkt_data = &set_request_counter64_5bytes_pkt[0]; + snmp_query[4].snmp_query_pkt_size = set_request_counter64_5bytes_size; + + snmp_query[5].snmp_query_pkt_data = &get_request_counter64_5bytes_pkt[0]; + snmp_query[5].snmp_query_pkt_size = get_request_counter64_5bytes_size; + + + snmp_query[6].snmp_query_pkt_data = &set_request_timertic_pkt[0]; + snmp_query[6].snmp_query_pkt_size = set_request_timertic_size; + + snmp_query[7].snmp_query_pkt_data = &get_request_timertic_pkt[0]; + snmp_query[7].snmp_query_pkt_size = get_request_timertic_size; + + + snmp_query[8].snmp_query_pkt_data = &set_request_string_pkt[0]; + snmp_query[8].snmp_query_pkt_size = set_request_string_size; + + snmp_query[9].snmp_query_pkt_data = &get_request_string_pkt[0]; + snmp_query[9].snmp_query_pkt_size = get_request_string_size; + +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +UINT length = 0; +static UINT get_request_count = 0; + + /* Increment the get request count. */ + get_request_count++; + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + error_counter++; + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + if (mib2_mib[i].object_get_octet_callback) + { + + /* Yes, call the get octet function. */ + status = (mib2_mib[i].object_get_octet_callback)(mib2_mib[i].object_value_ptr, object_data, length); + } + /* Determine if the entry has a get function. */ + else if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + error_counter++; + } + + + /* Check for correct (expected) value. */ + if (get_request_count == 1) + { + if (COUNTER32_VAL != (INT)object_data -> nx_snmp_object_data_msw) + { + error_counter++; + } + } + else if (get_request_count == 2) + { + if (COUNTER64_VAL != (ULONG)object_data -> nx_snmp_object_data_lsw) + { + error_counter++; + } + } + else if (get_request_count == 3) + { + if ((COUNTER64_VAL0 != (ULONG)object_data -> nx_snmp_object_data_msw) || + (COUNTER64_VAL1 != (ULONG)object_data -> nx_snmp_object_data_lsw)) + { + error_counter++; + } + } + + if (get_request_count == 4) + { + if (TIMERTIC_VAL != (INT)object_data -> nx_snmp_object_data_msw) + { + error_counter++; + } + } + else if (get_request_count == 5) + { + if (memcmp(object_data -> nx_snmp_object_octet_string, STRING_TEST, strlen(STRING_TEST))) + { + error_counter++; + } + } + + /* Return the status of the get handler (not necessarily the data checking). */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_misc_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP Set Get Miscellaneous Data Type Test.................N/A\n"); + test_control_return(3); +} +#endif + + diff --git a/test/regression/snmp_test/netx_snmp_setget_octet_strings_test.c b/test/regression/snmp_test/netx_snmp_setget_octet_strings_test.c new file mode 100644 index 00000000..4f3df041 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_setget_octet_strings_test.c @@ -0,0 +1,681 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a set request for an OID that specifies an IPv4 address. Then it sends a GET request + for the same OID and compares it to what it just set it to. It sends another SET + and GET request for an IPv6 address and compares the IPv6 retrieved from the MIB + to be correct if NETX Duo is in use only. + + The MIB database is defined in snmp_demo_helper.h. The SNMP browser queries are + provided in GetSetIPv4v6Address.c. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 2048 + +extern MIB_ENTRY mib2_mib[]; + + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +#define QUERY_COUNT 4 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + +#define OID_OCTETSTRING_ADDRESS "1.3.6.1.2.1.3.1.1.2.0" + + +const unsigned char test_first_string[4] = {0xff, 0x00, 0xf1, 0xf2}; +const unsigned char test_second_string[3] = {0x00, 0xf1, 0xf2}; + + + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char set_request_octet_string_pkt[47]; +extern int set_request_octet_string_size; +extern char get_request_octet_string_pkt[42]; +extern int get_request_octet_string_size; + +extern char set_request_octet_string_leading_zero_pkt[46]; +extern int set_request_octet_string_leading_zero_size; +extern char get_request_octet_string_leading_zero_pkt[42]; +extern int get_request_octet_string_leading_zero_size; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_octet_strings_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + printf("NetX Test: SNMP Set Get Octet String Test............................"); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + /* Check for correct internal counters of SNMP processing. */ + if ((v2_my_agent.nx_snmp_agent_get_requests != 2) || + (v2_my_agent.nx_snmp_agent_set_requests != 2) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 2) || + (v2_my_agent.nx_snmp_agent_packets_received != 4) || + (v2_my_agent.nx_snmp_agent_packets_sent != 4) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 4)) + { + error_counter++; + } + + /* Check for errors processing the requests. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + v2_my_agent.nx_snmp_agent_request_errors || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests || + v2_my_agent.nx_snmp_agent_no_such_name_errors) + { + + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet to the SNMP Agent with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &set_request_octet_string_pkt[0]; + snmp_query[0].snmp_query_pkt_size = set_request_octet_string_size; + + + snmp_query[1].snmp_query_pkt_data = &get_request_octet_string_pkt[0]; + snmp_query[1].snmp_query_pkt_size = get_request_octet_string_size; + + snmp_query[2].snmp_query_pkt_data = &set_request_octet_string_leading_zero_pkt[0]; + snmp_query[2].snmp_query_pkt_size = set_request_octet_string_leading_zero_size; + + snmp_query[3].snmp_query_pkt_data = &get_request_octet_string_leading_zero_pkt[0]; + snmp_query[3].snmp_query_pkt_size = get_request_octet_string_leading_zero_size; +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +static UINT get_query_count = 0; + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + error_counter++; + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + /* Determine if the entry has a get function. Octet strings (as opposed to null terminated strings) + require a different get function. */ + + if (mib2_mib[i].object_get_octet_callback) + { + + /* Call the get octet function (has a length input). */ + status = (mib2_mib[i].object_get_octet_callback)(mib2_mib[i].object_value_ptr, object_data, mib2_mib[i].length); + } + else if (mib2_mib[i].object_get_callback) + { + + /* Call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + error_counter++; + } + + get_query_count++; + + if ((object_data -> nx_snmp_object_octet_string_size == 0) || (object_data -> nx_snmp_object_octet_string_size > NX_SNMP_MAX_OCTET_STRING)) + { + error_counter++; + return NX_SNMP_ERROR_TOOBIG; + } + + if (get_query_count == 1) + { + + for (i = 0; i < object_data -> nx_snmp_object_octet_string_size; i++) + { + if (test_first_string[i] != object_data-> nx_snmp_object_octet_string[i]) + { + error_counter++; + break; + } + } + } + else if (get_query_count == 2) + { + + for (i = 0; i < object_data -> nx_snmp_object_octet_string_size; i++) + { + if (test_second_string[i] != object_data-> nx_snmp_object_octet_string[i]) + { + error_counter++; + break; + } + } + } + + + /* Return the status of the get handler (not necessarily the data checking). */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + if (mib2_mib[i].object_set_callback) + { + + /* Call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_setget_octet_strings_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP Set Get Octet String Test............................N/A\n"); + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v1_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v1_buffer_overwrite_test.c new file mode 100644 index 00000000..26d8a7cd --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v1_buffer_overwrite_test.c @@ -0,0 +1,504 @@ +/* This NetX test concentrates on the basic SNMPv1 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v1_buffer_overwrite_packet1[1514]; +extern int v1_buffer_overwrite_packet1_size; +extern unsigned char v1_buffer_overwrite_packet2[54]; +extern int v1_buffer_overwrite_packet2_size; +extern unsigned char v1_buffer_overwrite_packet3[54]; +extern int v1_buffer_overwrite_packet3_size; +extern unsigned char v1_buffer_overwrite_packet4[]; +extern int v1_buffer_overwrite_packet4_size; + +#define QUERY_COUNT 4 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v1_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + status = nx_ip_fragment_enable(&agent_ip); + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V1 Buffer Overwrite Test............................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + /* Make sure the buffer is not overwrote. */ + if (memcmp(mib2_mib[0].object_name, "1.3.6.1.2.1.1.1.0", sizeof("1.3.6.1.2.1.1.1.0") - 1) != 0) + { + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v1_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v1_buffer_overwrite_packet1_size; + + snmp_query[1].snmp_query_pkt_data = &v1_buffer_overwrite_packet2[0]; + snmp_query[1].snmp_query_pkt_size = v1_buffer_overwrite_packet2_size; + + snmp_query[2].snmp_query_pkt_data = &v1_buffer_overwrite_packet3[0]; + snmp_query[2].snmp_query_pkt_size = v1_buffer_overwrite_packet3_size; + + snmp_query[3].snmp_query_pkt_data = &v1_buffer_overwrite_packet4[0]; + snmp_query[3].snmp_query_pkt_size = v1_buffer_overwrite_packet4_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* If the object data type is string. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_ANS1_OCTET_STRING) + { + + /* Check the string length of the object value. */ + if (object_data -> nx_snmp_object_octet_string_size > mib2_mib[i].length) + { + return(NX_SNMP_ERROR_TOOBIG); + } + } + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v1_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V1 Buffer Overwrite Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v1_object_id_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v1_object_id_buffer_overwrite_test.c new file mode 100644 index 00000000..a0c14bde --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v1_object_id_buffer_overwrite_test.c @@ -0,0 +1,426 @@ +/* This NetX test concentrates on the basic SNMPv1 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v1_object_id_buffer_overwrite_packet[1422]; +extern int v1_object_id_buffer_overwrite_packet_size; + +#define QUERY_COUNT 1 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v1_object_id_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + status = nx_ip_fragment_enable(&agent_ip); + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V1 Object ID Buffer Overwrite Test..................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v1_object_id_buffer_overwrite_packet[0]; + snmp_query[0].snmp_query_pkt_size = v1_object_id_buffer_overwrite_packet_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + + + NX_PARAMETER_NOT_USED(agent_ptr); + NX_PARAMETER_NOT_USED(object_requested); + NX_PARAMETER_NOT_USED(object_data); + return(NX_SUCCESS); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v1_object_id_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V1 Object ID Buffer Overwrite Test...................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v1_packet_double_release_test.c b/test/regression/snmp_test/netx_snmp_v1_packet_double_release_test.c new file mode 100644 index 00000000..ccedec0b --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v1_packet_double_release_test.c @@ -0,0 +1,461 @@ +/* This NetX test concentrates on the basic SNMPv1 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + +extern unsigned char v1_double_release_packet[1421]; +extern int v1_double_release_packet_size; + +#define QUERY_COUNT 1 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v1_packet_double_release_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V1 Packet Double Release Test........................"); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Check if there is invalid packet release. */ + if (pool_0.nx_packet_pool_invalid_releases) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v1_double_release_packet[0]; + snmp_query[0].snmp_query_pkt_size = v1_double_release_packet_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v1_packet_double_release_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V1 Packet Double Release Test........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v2_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v2_buffer_overwrite_test.c new file mode 100644 index 00000000..dc3a91df --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v2_buffer_overwrite_test.c @@ -0,0 +1,477 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v2_buffer_overwrite_packet1[1514]; +extern int v2_buffer_overwrite_packet1_size; +extern unsigned char v2_buffer_overwrite_packet2[54]; +extern int v2_buffer_overwrite_packet2_size; + +#define QUERY_COUNT 2 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + status = nx_ip_fragment_enable(&agent_ip); + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V2 Buffer Overwrite Test............................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v2_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v2_buffer_overwrite_packet1_size; + + snmp_query[1].snmp_query_pkt_data = &v2_buffer_overwrite_packet2[0]; + snmp_query[1].snmp_query_pkt_size = v2_buffer_overwrite_packet2_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V2 Buffer Overwrite Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c b/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c new file mode 100644 index 00000000..af45837f --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c @@ -0,0 +1,616 @@ +// JLC THIS TEST IS OBSOLETE. Several other tests do the exact same thing. REMOVE IT. Removed +// references to "v3" and handshake protocol. This is a V2 query and there is no handshaking +// + +/* This NetX test concentrates on the SNMPv2 get bulk request. The first exchange is to 'contact' + the SNMP agent. Then the manager makes a bulk request. The test is successful if the internal + statistics show the correct number of variables requested, requests received, and bulk responses + sent, and there are no internal errors. This does not require packet chaining. + */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +UINT query_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ +#define QUERY_COUNT 1 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char get_next_request_packet[39]; +extern int get_next_request_size; +extern char get_bulk_request_packet[40]; +extern int get_bulk_request_size; + + + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_get_bulk_request_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 10*1000); + pointer = pointer + 10*1000; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "public", &agent_ip, pointer, 4096, &pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + pointer = pointer + 4096; + + + if (status) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + printf("NetX Test: SNMP V2 Get Bulk Request Test............................."); + tx_thread_sleep(20); + + if (error_counter) + { + printf("ERROR0!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!query_response_complete) + { + tx_thread_sleep(100); + } + + tx_thread_sleep(50); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT i; +USHORT request_id = 1; + + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to an IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 0, 100); + + /* Check status. */ + if (status) + { + + error_counter++; + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + + return; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, NX_WAIT_FOREVER); + + /* Check status. We should only get one response. */ + if (status) + { + error_counter++; + break; + } + + /* Check for errors on discovery/report exchange. */ + if (i == 0) + { + if ((my_agent.nx_snmp_agent_total_get_variables != 1) || (my_agent.nx_snmp_agent_getnext_requests != 1)) + { + error_counter++; + + break; + } + /* Allow variability in size due to unpredictable variables (timer). */ + if ((agent_packet -> nx_packet_length <= 47) || (agent_packet -> nx_packet_length >= 56)) + { + error_counter++; + break; + } + } + + /* Check for errors on the completion of get bulk request. */ + if (i == 1) + { + if ((my_agent.nx_snmp_agent_getbulk_requests != 1) || (my_agent.nx_snmp_agent_getresponse_sent !=2) || + (my_agent.nx_snmp_agent_total_get_variables != 6)) + { + error_counter++; + break; + } + + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Check for other general errors. */ + if (my_agent.nx_snmp_agent_request_errors || my_agent.nx_snmp_agent_internal_errors) + { + + error_counter++; + } + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &query_packet, NX_UDP_PACKET, 100); + + /* Check status. */ + if (status) + { + return status; + } + + + memset(query_packet -> nx_packet_prepend_ptr, 0, (query_packet -> nx_packet_data_end - query_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(query_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + nx_packet_release(query_packet); + + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = &get_next_request_packet[0]; + snmp_query[0].snmp_query_pkt_size = get_next_request_size; + //snmp_query[1].snmp_query_pkt_data = &get_bulk_request_packet[0]; + //snmp_query[1].snmp_query_pkt_size = get_bulk_request_size; + + +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +//extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + //sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_get_bulk_request_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V2 Get Bulk Request Test.............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v2_send_trap_test.c b/test/regression/snmp_test/netx_snmp_v2_send_trap_test.c new file mode 100644 index 00000000..34cd7000 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v2_send_trap_test.c @@ -0,0 +1,670 @@ +/* This SNMP Agent test sends a V2 trap with a non null trap list. A successful result is the correction + number of messages/packets sent and no internal errors. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + + +extern MIB_ENTRY mib2_mib[]; + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +#define QUERY_COUNT 1 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char simple_get_query_pkt[82]; +extern int simple_get_query_size; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_send_trap_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_SNMP_TRAP_OBJECT trap_list[7]; +NX_SNMP_OBJECT_DATA trap_data0; +NX_SNMP_OBJECT_DATA trap_data1; +NX_SNMP_OBJECT_DATA trap_data2; +NX_SNMP_OBJECT_DATA trap_data3; +NX_SNMP_OBJECT_DATA trap_data4; +NX_SNMP_OBJECT_DATA trap_data5; +UINT counter = 133; + + + printf("NetX Test: SNMP V2 Send Trap Test...................................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + + /* Now send the traps. */ + /* Send trap to indicate the link is up. */ + trap_list[0].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.1.0"; + trap_list[0].nx_snmp_object_data = &trap_data0; + trap_data0.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data0.nx_snmp_object_data_msw = counter++; + + trap_list[1].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.7.0"; + trap_list[1].nx_snmp_object_data = &trap_data1; + trap_data1.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data1.nx_snmp_object_data_msw = counter++; + + /* Null terminate the list. */ + trap_list[2].nx_snmp_object_string_ptr = NX_NULL; + trap_list[2].nx_snmp_object_data = NX_NULL; +#if 1 + trap_list[2].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.8.0"; + trap_list[2].nx_snmp_object_data = &trap_data2; + trap_data2.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data2.nx_snmp_object_data_msw = tx_time_get(); + + trap_list[3].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.9.0"; + trap_list[3].nx_snmp_object_data = &trap_data3; + trap_data3.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data3.nx_snmp_object_data_msw = counter++; + + trap_list[4].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.10.0.1"; + trap_list[4].nx_snmp_object_data = &trap_data4; + trap_data4.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data4.nx_snmp_object_data_msw = tx_time_get(); + + + trap_list[5].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.10.0.2"; + trap_list[5].nx_snmp_object_data = &trap_data5; + trap_data5.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data5.nx_snmp_object_data_msw = counter++; + + /* Null terminate the list. */ + trap_list[6].nx_snmp_object_string_ptr = NX_NULL; + trap_list[6].nx_snmp_object_data = NX_NULL; +#endif + + status = nx_snmp_agent_trapv2_send(&v2_my_agent, SNMP_MANAGER_ADDRESS, (UCHAR *)"trap", NX_SNMP_TRAP_COLDSTART, tx_time_get(), &trap_list[0]); + + if (status) + { + error_counter++; + } + + + /* Check for correct internal counters of SNMP processing. */ + if ((v2_my_agent.nx_snmp_agent_get_requests != 1) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 1) || + (v2_my_agent.nx_snmp_agent_packets_received != 1) || + (v2_my_agent.nx_snmp_agent_packets_sent != 2) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 1) || + (v2_my_agent.nx_snmp_agent_traps_sent != 1)) + { + error_counter++; + } + + + /* Check for errors processing the request and sending the trap. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + v2_my_agent.nx_snmp_agent_request_errors || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests) + { + + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &simple_get_query_pkt[0]; + snmp_query[0].snmp_query_pkt_size = simple_get_query_size; + +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_send_trap_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V2 Send Trap Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v2_unknown_oid_test.c b/test/regression/snmp_test/netx_snmp_v2_unknown_oid_test.c new file mode 100644 index 00000000..0af1e812 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v2_unknown_oid_test.c @@ -0,0 +1,634 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +static UINT v2query_response_complete = NX_FALSE; + +static UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +#define QUERY_COUNT 2 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v2_my_agent; +static NX_PACKET_POOL v2_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + + +extern char simple_get_query_unknown_oid_pkt[82]; +extern int simple_get_query_unknown_oid_size; +extern char simple_get_query_pkt[82]; +extern int simple_get_query_size; + + + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_unknown_oid_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v2_pool_0, "NetX Main Packet Pool", 1000, pointer, 4096); + pointer = pointer + 4096; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v2_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v2_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v2_pool_0, + v2_mib2_username_processing, v2_mib2_get_processing, + v2_mib2_getnext_processing, v2_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + printf("NetX Test: SNMP V2 Unknown OID Test.................................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v2_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v2query_response_complete == NX_FALSE) + { + tx_thread_sleep(100); + } + + /* Check for correct internal counters of SNMP processing. */ + if ((v2_my_agent.nx_snmp_agent_get_requests != 1) || + (v2_my_agent.nx_snmp_agent_total_get_variables != 2) || + (v2_my_agent.nx_snmp_agent_packets_received != 2) || + (v2_my_agent.nx_snmp_agent_packets_sent != 2) || + (v2_my_agent.nx_snmp_agent_getresponse_sent != 2)) + { + error_counter++; + } + + /* Check for errors processing the requests. */ + if (v2_my_agent.nx_snmp_agent_invalid_packets || + v2_my_agent.nx_snmp_agent_internal_errors || + v2_my_agent.nx_snmp_agent_allocation_errors || + (v2_my_agent.nx_snmp_agent_request_errors != 1) || + v2_my_agent.nx_snmp_agent_too_big_errors || + v2_my_agent.nx_snmp_agent_username_errors || + v2_my_agent.nx_snmp_agent_unknown_requests) + { + + error_counter++; + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT port; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v2query_response_complete = NX_TRUE; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 200); + + /* Check status for known OIDs. */ + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* The first request is for an unknown OID. */ + else if (i == 0) + { + if ((v2_my_agent.nx_snmp_agent_no_such_name_errors != 1) && + (v2_my_agent.nx_snmp_agent_request_errors != 1)) + { + + /* The SNMP agent should increase it's counter of unknown OIDs. */ + error_counter++; + } + } + + /* Get the SNMP agent UDP port. */ + status = nx_udp_packet_info_extract(agent_packet, NX_NULL ,NX_NULL, &port, NX_NULL); + + /* Check status. */ + + if (status) + { + + error_counter++; + v2query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Indicate the test is complete. */ + v2query_response_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(&snmp_manager_socket); + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v2_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &simple_get_query_unknown_oid_pkt[0]; + + snmp_query[0].snmp_query_pkt_size = simple_get_query_unknown_oid_size; + + + snmp_query[1].snmp_query_pkt_data = &simple_get_query_pkt[0]; + snmp_query[1].snmp_query_pkt_size = simple_get_query_size; + + // snmp_query[2].snmp_query_pkt_data = &simple_get_bulk_query_pkt[0]; + // snmp_query[2].snmp_query_pkt_size = simple_get_bulk_query_size; + +} + + +/* Define the application's GET processing routine. */ + +UINT v2_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v2_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v2_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v2_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v2_mib2_variable_update(&agent_ip, &v2_my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID v2_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return;; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v2_unknown_oid_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V2 Unknown OID Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v3_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v3_buffer_overwrite_test.c new file mode 100644 index 00000000..8afe0f6d --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_buffer_overwrite_test.c @@ -0,0 +1,520 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +//NX_SNMP_SECURITY_KEY my_authentication_key; + +NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +static UCHAR context_engine_id[] = {0x80, 0x00, 0x0d, 0xfe, 0x03, 0x00, 0x11, 0x23, 0x23, 0x44, 0x55}; +static UINT context_engine_size = 11; +static UCHAR context_name[] = {0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c}; +static UINT context_name_size = 7; + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v3_buffer_overwrite_packet1[1514]; +extern int v3_buffer_overwrite_packet1_size; +extern unsigned char v3_buffer_overwrite_packet2[54]; +extern int v3_buffer_overwrite_packet2_size; + +#define QUERY_COUNT 2 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + status = nx_ip_fragment_enable(&agent_ip); + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V3 Buffer Overwrite Test............................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + +#ifdef AUTHENTICATION_REQUIRED + /* Create an authentication key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"authpassword", &my_authentication_key); + if (status) + { + error_counter++; + } + + /* Use the authentication key. */ + status = nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + if (status) + { + error_counter++; + } +#endif + + /* Create a privacy key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"privpassword", &my_privacy_key); + if (status) + { + error_counter++; + } + +#if 0 + /* Use the privacy key. */ + status = nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + if (status) + { + error_counter++; + } +#endif + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if (nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v3_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v3_buffer_overwrite_packet1_size; + + snmp_query[1].snmp_query_pkt_data = &v3_buffer_overwrite_packet2[0]; + snmp_query[1].snmp_query_pkt_size = v3_buffer_overwrite_packet2_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 Buffer Overwrite Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v3_decrypt_pdu_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v3_decrypt_pdu_buffer_overwrite_test.c new file mode 100644 index 00000000..b0f5873c --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_decrypt_pdu_buffer_overwrite_test.c @@ -0,0 +1,524 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +//NX_SNMP_SECURITY_KEY my_authentication_key; + +NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +static UCHAR context_engine_id[] = {0x80, 0x00, 0x0d, 0xfe, 0x03, 0x00, 0x11, 0x23, 0x23, 0x44, 0x55}; +static UINT context_engine_size = 11; +static UCHAR context_name[] = {0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c}; +static UINT context_name_size = 7; + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v3_decrypt_pdu_buffer_overwrite_packet1[1514]; +extern int v3_decrypt_pdu_buffer_overwrite_packet1_size; +extern unsigned char v3_decrypt_pdu_buffer_overwrite_packet2[54]; +extern int v3_decrypt_pdu_buffer_overwrite_packet2_size; + +#define QUERY_COUNT 2 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_decrypt_pdu_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + status = nx_ip_fragment_enable(&agent_ip); + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V3 Decrypt PDU Buffer Overwrite Test................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_context_engine_set(&my_agent, context_engine_id, context_engine_size); + if (status != NX_SUCCESS) + { + error_counter++; + } + +#ifdef AUTHENTICATION_REQUIRED + /* Create an authentication key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"authpassword", &my_authentication_key); + if (status) + { + error_counter++; + } + + /* Use the authentication key. */ + status = nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + if (status) + { + error_counter++; + } +#endif + + /* Create a privacy key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"privpassword", &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Use the privacy key. */ + status = nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if ((nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT)) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v3_decrypt_pdu_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v3_decrypt_pdu_buffer_overwrite_packet1_size; + + snmp_query[1].snmp_query_pkt_data = &v3_decrypt_pdu_buffer_overwrite_packet2[0]; + snmp_query[1].snmp_query_pkt_size = v3_decrypt_pdu_buffer_overwrite_packet2_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_decrypt_pdu_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 Decrypt PDU Buffer Overwrite Test.................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_buffer_overwrite_test.c new file mode 100644 index 00000000..4e176c8e --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_buffer_overwrite_test.c @@ -0,0 +1,517 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + //NX_SNMP_SECURITY_KEY my_authentication_key; + +NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +static UCHAR context_engine_id[] = {0x80, 0x00, 0x03, 0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x44, 0x55}; +static UINT context_engine_size = 11; +static UCHAR context_name[] = {0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c}; +static UINT context_name_size = 7; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v3_encrypt_pdu_buffer_overwrite_packet1[1063]; +extern int v3_encrypt_pdu_buffer_overwrite_packet1_size; + +#define QUERY_COUNT 1 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_encrypt_pdu_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V3 Encrypt PDU Buffer Overwrite Test................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + +#ifdef AUTHENTICATION_REQUIRED + status = nx_snmp_agent_v3_context_boots_set(&my_agent, 1); + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_context_engine_set(&my_agent, context_engine_id, context_engine_size); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create an authentication key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"authpassword", &my_authentication_key); + if (status) + { + error_counter++; + } + + /* Use the authentication key. */ + status = nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + if (status) + { + error_counter++; + } +#endif + + /* Create a privacy key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"privpassword", &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Use the privacy key. */ + status = nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if ((nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT)) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v3_encrypt_pdu_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v3_encrypt_pdu_buffer_overwrite_packet1_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_encrypt_pdu_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 Encrypt PDU Buffer Overwrite Test.................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test.c new file mode 100644 index 00000000..8f4429ce --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test.c @@ -0,0 +1,525 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_FRAGMENTATION) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + +NX_SNMP_SECURITY_KEY my_authentication_key; + +NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +static UCHAR context_engine_id[] = {0x80, 0x00, 0x03, 0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x44, 0x55}; +static UINT context_engine_size = 11; +static UCHAR context_name[] = {0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c}; +static UINT context_name_size = 7; + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_PACKET_POOL pool_1; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v3_encrypt_pdu_padding_buffer_overwrite_packet1[165]; +extern int v3_encrypt_pdu_padding_buffer_overwrite_packet1_size; + +#define QUERY_COUNT 1 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_1, "SNMP Packet Pool", 176, pointer, (sizeof(NX_PACKET) + 176) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 176) * 10; + + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + status = nx_ip_fragment_enable(&agent_ip); + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V3 Encrypt PDU Padding Buffer Overwrite Test........."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_1, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_v3_context_boots_set(&my_agent, 1); + + if (status) + { + error_counter++; + } + /* Create an authentication key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"authpassword", &my_authentication_key); + if (status) + { + error_counter++; + } + + /* Use the authentication key. */ + status = nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + if (status) + { + error_counter++; + } + + /* Create a privacy key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"privpassword", &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Use the privacy key. */ + status = nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + my_agent.nx_snmp_agent_v3_context_engine_size = 6; + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_1.nx_packet_pool_available) + { + if ((nx_packet_allocate(&pool_1, &packet_ptr, 0, NX_NO_WAIT)) || + (packet_ptr -> nx_packet_pool_owner != &pool_1)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v3_encrypt_pdu_padding_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v3_encrypt_pdu_padding_buffer_overwrite_packet1_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 Encrypt PDU Padding Buffer Overwrite Test.........N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/netx_snmp_v3_md5_failed_security_test.c b/test/regression/snmp_test/netx_snmp_v3_md5_failed_security_test.c new file mode 100644 index 00000000..41d97529 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_md5_failed_security_test.c @@ -0,0 +1,660 @@ +/* This NetX test concentrates on the SNMPv3 operation with MD5 security. The test uses a different authentiation and + encryption password than is received from the SNMP Manager. The test is successful if the SNMP Agent rejects the SNMP + manager response, sets an authentication error to notify the calling application authentication failed, and does not send a + response back to the SNMP Manager. + */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#define DEMO_STACK_SIZE 4096 + +#if !defined(NX_DISABLE_IPV4) + +extern MIB_ENTRY mib2_mib[]; + +static NX_SNMP_SECURITY_KEY my_authentication_key; +static NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +static UINT query_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ +#define QUERY_COUNT 2 + +/* To show byte by byte comparison of pre-recorded response with SNMP agent, define this option. +#define VERBOSE +*/ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char get_request_priv_pkt[59]; +extern int get_request_priv_size; +extern char getnext_request_priv_pkt[127]; +extern int getnext_request_priv_size; + + + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_md5_failed_security_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1000, pointer, 10000); + pointer = pointer + 10000; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "public", &agent_ip, pointer, 4096, &pool_0, + v3_mib2_username_processing, v3_mib2_get_processing, + v3_mib2_getnext_processing, v3_mib2_set_processing); + pointer = pointer + 4096; + + + if (status) + { + error_counter++; + } + + + /* Create an authentication key using MD5 and register it with the agent. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)("authpassword2"), &my_authentication_key); + + /* Register the authentication key with the agent. */ + status |= nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a privacy key and register it with the SNMP agent. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)("privpassword2"), &my_privacy_key); + + status |= nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + + if (status |= NX_SUCCESS) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + printf("NetX Test: SNMP V3 with Failed MD5 Security Test....................."); + tx_thread_sleep(20); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize our boot up count to 1. */ + status = nx_snmp_agent_v3_context_boots_set(&my_agent, 1); + + if (status) + { + error_counter++; + } + + /* Reset the system clock so we can reasonably fit in the 150 second Time Window. */ + tx_time_set(0); + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!query_response_complete) + { + tx_thread_sleep(100); + } + + tx_thread_sleep(50); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT i; +USHORT request_id = 1; + + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to an IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 0, 100); + + /* Check status. */ + if (status) + { + + error_counter++; + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + + return; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 100); + + /* Check status. We should only get one response. */ + if (status && (i == 0)) + { + error_counter++; + break; + } + + /* Check for errors on discovery/report exchange. */ + if (i == 0) + { + if ((my_agent.nx_snmp_agent_reports_sent != 1) || (my_agent.nx_snmp_agent_unknown_engineid_count != 1)) + { + error_counter++; + break; + } + /* Allow variability in size due to unpredictable variables (timer). */ + if ((agent_packet -> nx_packet_length <= 105) || (agent_packet -> nx_packet_length >= 109)) + { + error_counter++; + break; + } + } + + /* Check for errors on the completion of V3 handshake. */ + if (i == 1) + { + /* When authentication fails, SNMP should set an authentication error and send another report. */ + if ((my_agent.nx_snmp_agent_authentication_errors == 0) || (my_agent.nx_snmp_agent_reports_sent > 1)) + { + error_counter++; + break; + } + + } + + if (status == NX_SUCCESS) + { + + /* Release the packet. */ + nx_packet_release(agent_packet); + } + + request_id++; + } + + /* Check for other general errors. */ + if (my_agent.nx_snmp_agent_request_errors || my_agent.nx_snmp_agent_internal_errors) + { + + error_counter++; + } + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &query_packet, NX_UDP_PACKET, 100); + + /* Check status. */ + if (status) + { + return status; + } + + + memset(query_packet -> nx_packet_prepend_ptr, 0, (query_packet -> nx_packet_data_end - query_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(query_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + nx_packet_release(query_packet); + + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = &get_request_priv_pkt[0]; + snmp_query[0].snmp_query_pkt_size = get_request_priv_size; + snmp_query[1].snmp_query_pkt_data = &getnext_request_priv_pkt[0]; + snmp_query[1].snmp_query_pkt_size = getnext_request_priv_size; + + +} + + +/* Define the application's GET processing routine. */ + +UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v3_mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_md5_failed_security_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 with Failed MD5 Security Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v3_md5_security_extended_test.c b/test/regression/snmp_test/netx_snmp_v3_md5_security_extended_test.c new file mode 100644 index 00000000..2234f652 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_md5_security_extended_test.c @@ -0,0 +1,668 @@ +/* This NetX test concentrates on the SNMPv3 operation with MD5 security. The test examines the response packet length + and internal statistics of processing a v3 response to pass the test. + */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#define DEMO_STACK_SIZE 4096 + +#if !defined(NX_DISABLE_IPV4) + +extern MIB_ENTRY mib2_mib[]; + +static NX_SNMP_SECURITY_KEY my_authentication_key; +static NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +static UINT query_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ +#define QUERY_COUNT 2 + +/* To show byte by byte comparison of pre-recorded response with SNMP agent, define this option. +#define VERBOSE +*/ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char get_request_priv_pkt[59]; +extern int get_request_priv_size; +extern char getnext_request_priv_pkt[127]; +extern int getnext_request_priv_size; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_md5_security_extended_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 15000); + pointer = pointer + 10000; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "public", &agent_ip, pointer, 4096, &pool_0, + v3_mib2_username_processing, v3_mib2_get_processing, + v3_mib2_getnext_processing, v3_mib2_set_processing); + pointer = pointer + 4096; + + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_v3_context_boots_set(&my_agent, 1); + + if (status) + { + error_counter++; + } + /* Create an authentication key using MD5 and register it with the agent. */ + status = nx_snmp_agent_md5_key_create_extended(&my_agent, (UCHAR *)("authpassword"), 12, &my_authentication_key); + + /* Register the authentication key with the agent. */ + status |= nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a privacy key and register it with the SNMP agent. */ + status = nx_snmp_agent_md5_key_create_extended(&my_agent, (UCHAR *)("privpassword"), 12, &my_privacy_key); + + status |= nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + + if (status |= NX_SUCCESS) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + printf("NetX Test: SNMP V3 with MD5 Security Extended Test..................."); + tx_thread_sleep(20); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!query_response_complete) + { + tx_thread_sleep(20); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT i; +USHORT request_id = 1; + + + /* Let the agent get set up first! */ + tx_thread_sleep(30); + + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to an IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 0, 100); + + /* Check status. */ + if (status) + { + + error_counter++; + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + + return; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 100); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Check for errors on discovery/report exchange. */ + if (i == 0) + { + if ((my_agent.nx_snmp_agent_reports_sent != 1) || (my_agent.nx_snmp_agent_unknown_engineid_count != 1)) + { + error_counter++; + break; + } + /* Allow variability in size due to unpredictable variables (timer). */ + if ((agent_packet -> nx_packet_length <= 105) || (agent_packet -> nx_packet_length >= 109)) + { + error_counter++; + break; + } + } + + /* Check for errors on the completion of V3 handshake. */ + if (i == 1) + { + if ((my_agent.nx_snmp_agent_getresponse_sent != 1) ||(my_agent.nx_snmp_agent_getnext_requests != 1)) + { + error_counter++; + break; + } + + if ((agent_packet -> nx_packet_length <= 136) || (agent_packet -> nx_packet_length >= 140)) + { + error_counter++; + break; + } + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Check for general errors. */ + if (my_agent.nx_snmp_agent_request_errors || my_agent.nx_snmp_agent_internal_errors) + { + + error_counter++; + } + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &query_packet, NX_UDP_PACKET, 100); + + /* Check status. */ + if (status) + { + return status; + } + + + memset(query_packet -> nx_packet_prepend_ptr, 0, (query_packet -> nx_packet_data_end - query_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(query_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + nx_packet_release(query_packet); + + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = &get_request_priv_pkt[0]; + snmp_query[0].snmp_query_pkt_size = get_request_priv_size; + snmp_query[1].snmp_query_pkt_data = &getnext_request_priv_pkt[0]; + snmp_query[1].snmp_query_pkt_size = getnext_request_priv_size; + + +} + + +/* Define the application's GET processing routine. */ + +UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +UINT object_requested_length; +UINT object_name_length; + + + /* Get the object requested length. */ + _nx_utility_string_length_check(object_requested, &object_requested_length, NX_SNMP_MAX_OCTET_STRING); + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* Get the object name length. */ + _nx_utility_string_length_check(mib2_mib[i].object_name, &object_name_length, NX_SNMP_MAX_OCTET_STRING); + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare_extended(object_requested, object_requested_length, mib2_mib[i].object_name, object_name_length); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +UINT object_requested_length; +UINT object_name_length; +UINT object_value_length; + + + /* Get the object requested length. */ + _nx_utility_string_length_check(object_requested, &object_requested_length, NX_SNMP_MAX_OCTET_STRING); + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* Get the object name length. */ + _nx_utility_string_length_check(mib2_mib[i].object_name, &object_name_length, NX_SNMP_MAX_OCTET_STRING); + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare_extended(object_requested, object_requested_length, mib2_mib[i].object_name, object_name_length); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy_extended(mib2_mib[i].object_name, object_name_length, object_requested, NX_SNMP_MAX_OCTET_STRING + 1); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Get the object name length. */ + _nx_utility_string_length_check(mib2_mib[i].object_value_ptr, &object_value_length, NX_SNMP_MAX_OCTET_STRING); + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy_extended(mib2_mib[i].object_value_ptr, object_value_length, object_requested, NX_SNMP_MAX_OCTET_STRING + 1); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; +UINT object_requested_length; +UINT object_name_length; + + + /* Get the object requested length. */ + _nx_utility_string_length_check(object_requested, &object_requested_length, NX_MAX_STRING_LENGTH); + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* Get the object name length. */ + _nx_utility_string_length_check(mib2_mib[i].object_name, &object_name_length, NX_MAX_STRING_LENGTH); + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare_extended(object_requested, object_requested_length, mib2_mib[i].object_name, object_name_length); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v3_mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + // sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_md5_security_extended_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 with MD5 Security Extended Test...................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v3_md5_security_test.c b/test/regression/snmp_test/netx_snmp_v3_md5_security_test.c new file mode 100644 index 00000000..5faa5e3b --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_md5_security_test.c @@ -0,0 +1,641 @@ +/* This NetX test concentrates on the SNMPv3 operation with MD5 security. The test examines the response packet length + and internal statistics of processing a v3 response to pass the test. + */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#define DEMO_STACK_SIZE 4096 + +#if !defined(NX_DISABLE_IPV4) + +extern MIB_ENTRY mib2_mib[]; + +static NX_SNMP_SECURITY_KEY my_authentication_key; +static NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +static UINT query_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ +#define QUERY_COUNT 2 + +/* To show byte by byte comparison of pre-recorded response with SNMP agent, define this option. +#define VERBOSE +*/ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter = 0; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char get_request_priv_pkt[59]; +extern int get_request_priv_size; +extern char getnext_request_priv_pkt[127]; +extern int getnext_request_priv_size; + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_md5_security_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1500, pointer, 15000); + pointer = pointer + 10000; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "public", &agent_ip, pointer, 4096, &pool_0, + v3_mib2_username_processing, v3_mib2_get_processing, + v3_mib2_getnext_processing, v3_mib2_set_processing); + pointer = pointer + 4096; + + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_v3_context_boots_set(&my_agent, 1); + + if (status) + { + error_counter++; + } + /* Create an authentication key using MD5 and register it with the agent. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)("authpassword"), &my_authentication_key); + + /* Register the authentication key with the agent. */ + status |= nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Create a privacy key and register it with the SNMP agent. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)("privpassword"), &my_privacy_key); + + status |= nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + + if (status |= NX_SUCCESS) + { + error_counter++; + } + + return; + +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + printf("NetX Test: SNMP V3 with MD5 Security Test............................"); + tx_thread_sleep(20); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!query_response_complete) + { + tx_thread_sleep(20); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT i; +USHORT request_id = 1; + + + /* Let the agent get set up first! */ + tx_thread_sleep(30); + + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to an IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 0, 100); + + /* Check status. */ + if (status) + { + + error_counter++; + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + + return; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 100); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Check for errors on discovery/report exchange. */ + if (i == 0) + { + if ((my_agent.nx_snmp_agent_reports_sent != 1) || (my_agent.nx_snmp_agent_unknown_engineid_count != 1)) + { + error_counter++; + break; + } + /* Allow variability in size due to unpredictable variables (timer). */ + if ((agent_packet -> nx_packet_length <= 105) || (agent_packet -> nx_packet_length >= 109)) + { + error_counter++; + break; + } + } + + /* Check for errors on the completion of V3 handshake. */ + if (i == 1) + { + if ((my_agent.nx_snmp_agent_getresponse_sent != 1) ||(my_agent.nx_snmp_agent_getnext_requests != 1)) + { + error_counter++; + break; + } + + if ((agent_packet -> nx_packet_length <= 136) || (agent_packet -> nx_packet_length >= 140)) + { + error_counter++; + break; + } + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Check for general errors. */ + if (my_agent.nx_snmp_agent_request_errors || my_agent.nx_snmp_agent_internal_errors) + { + + error_counter++; + } + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &query_packet, NX_UDP_PACKET, 100); + + /* Check status. */ + if (status) + { + return status; + } + + + memset(query_packet -> nx_packet_prepend_ptr, 0, (query_packet -> nx_packet_data_end - query_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(query_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, SNMP_AGENT_ADDRESS, 161); + + /* Check the status. */ + if (status) + nx_packet_release(query_packet); + + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = &get_request_priv_pkt[0]; + snmp_query[0].snmp_query_pkt_size = get_request_priv_size; + snmp_query[1].snmp_query_pkt_data = &getnext_request_priv_pkt[0]; + snmp_query[1].snmp_query_pkt_size = getnext_request_priv_size; + + +} + + +/* Define the application's GET processing routine. */ + +UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v3_mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + // sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_md5_security_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 with MD5 Security Test............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v3_no_security_function_test.c b/test/regression/snmp_test/netx_snmp_v3_no_security_function_test.c new file mode 100644 index 00000000..0ed15cab --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_no_security_function_test.c @@ -0,0 +1,660 @@ +/* This NetX test concentrates on the SNMPv3 operation with no security. The test examines the response packet length + and internal statistics of processing a v3 response to pass the test. + */ + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + + +extern MIB_ENTRY mib2_mib[]; + +static UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + + +static UINT query_response_complete = NX_FALSE; /* to synchronize when the agent sends the SNMP trap */ +#define QUERY_COUNT 2 + +/* To show byte by byte comparison of pre-recorded response with SNMP agent, define this option. +#define VERBOSE +*/ + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; +static NX_UDP_SOCKET snmp_manager_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + + +static UCHAR context_engine_id[] = {0x80, 0x00, 0x0d, 0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69}; +static UINT context_engine_size = 11; + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern char v3_nosec_getrequest_pkt[58]; +extern int v3_nosec_getrequest_size; +extern char v3_nosec_getnext_request_pkt[98]; +extern int v3_nosec_getnext_request_size; + + + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_no_security_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + status = tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + status += tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for IP create errors. */ + /* Check for IP create errors. */ + if (status) + { + error_counter++; + test_control_return(1); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1000, pointer, 8192); + pointer = pointer + 8192; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Create an IP instance. */ + status = nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer , 2048, 1); + + pointer += 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, pointer, 2048, 1); + + pointer += 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "public", &agent_ip, pointer, 4096, &pool_0, + v3_mib2_username_processing, v3_mib2_get_processing, + v3_mib2_getnext_processing, v3_mib2_set_processing); + pointer = pointer + 4096; + + + if (status) + { + error_counter++; + } + + return; +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +ULONG boot_count = 0x1; +UINT version = NX_SNMP_VERSION_3; +UINT i; + + + printf("NetX Test: SNMP V3 No Security Test.................................."); + tx_thread_sleep(20); + + if (error_counter) + { + error_counter++; + } + + /* Make sure boot time and engine boot ID match the pre-recorded data. */ + status = nx_snmp_agent_context_engine_set(&my_agent, context_engine_id, context_engine_size); + status |= nx_snmp_agent_v3_context_boots_set(&my_agent, boot_count); + + if (status) + { + error_counter++; + + } + + /* Otherwise, store the context engine. */ + for (i = 0; i < context_engine_size; i++) + { + + /* Check each byte of the context engine. */ + if (my_agent.nx_snmp_agent_v3_context_engine[i] != context_engine_id[i]) + { + error_counter++; + } + } + + /* Check the context engine length. */ + if (my_agent.nx_snmp_agent_v3_context_engine_size != context_engine_size) + { + error_counter++; + } + + if (my_agent.nx_snmp_agent_v3_context_engine_boots != boot_count) + { + error_counter++; + } + + /* Reset the system clock so we can reasonably fit in the 150 second Time Window. */ + tx_time_set(0); + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + while (!query_response_complete) + tx_thread_sleep(50); + + /* Verify that we are receiving SNMPv3 packets. */ + status = nx_snmp_agent_current_version_get(&my_agent, &version); + + if (status || (version != NX_SNMP_VERSION_3)) + { + error_counter++; + } + + if (error_counter ) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT i; +USHORT request_id = 1; + + /* Let the agent get set up first! */ + tx_thread_sleep(100); + + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Bind the UDP socket to the IP port. */ + status |= nx_udp_socket_bind(&snmp_manager_socket, 161, 100); + + /* Check status. */ + if (status) + { + + error_counter++; + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + + error_counter++; + } + + /* Load the test data. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent.. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 100); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Check for errors on discovery/report exchange. */ + if (i == 0) + { + if ((my_agent.nx_snmp_agent_reports_sent != 1) || (my_agent.nx_snmp_agent_unknown_engineid_count != 1)) + { + error_counter++; + break; + } + + /* Allow variability for size of certain timer variables (unpredictable). */ + if ((agent_packet -> nx_packet_length < 108) || (agent_packet -> nx_packet_length > 112)) + { + error_counter++; + break; + } + } + + /* Check for errors on the completion of V3 handshake. */ + if (i == 1) + { + if ((my_agent.nx_snmp_agent_getresponse_sent != 1) ||(my_agent.nx_snmp_agent_getnext_requests != 1)) + { + error_counter++; + break; + } + + /* Allow variability for size of certain timer variables (unpredictable). */ + if ((agent_packet -> nx_packet_length < 110) || (agent_packet -> nx_packet_length > 114)) + { + error_counter++; + break; + } + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + request_id++; + } + + /* Check for general errors. */ + if (my_agent.nx_snmp_agent_request_errors || my_agent.nx_snmp_agent_internal_errors) + { + + error_counter++; + } + + /* Indicate the query response is complete. */ + query_response_complete = NX_TRUE; + +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *query_packet; + + /* Allocate a response packet. */ + status = nx_packet_allocate(&pool_0, &query_packet, NX_UDP_PACKET, 100); + + /* Check status. */ + if (status) + { + return status; + } + + memset(query_packet -> nx_packet_prepend_ptr, 0, (query_packet -> nx_packet_data_end - query_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(query_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + query_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + query_packet -> nx_packet_append_ptr = query_packet -> nx_packet_prepend_ptr + query_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, query_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + nx_packet_release(query_packet); + + return status; +} + + +static void snmp_test_initialize() +{ + + /* Contact - no security*/ + snmp_query[0].snmp_query_pkt_data = &v3_nosec_getrequest_pkt[0]; + snmp_query[0].snmp_query_pkt_size = v3_nosec_getrequest_size; + snmp_query[1].snmp_query_pkt_data = &v3_nosec_getnext_request_pkt[0]; + snmp_query[1].snmp_query_pkt_size = v3_nosec_getnext_request_size; + +} + + +/* Define the application's GET processing routine. */ + +UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v3_mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + //sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_no_security_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 No Security Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v3_nosec_traplist_test.c b/test/regression/snmp_test/netx_snmp_v3_nosec_traplist_test.c new file mode 100644 index 00000000..73b0aa6d --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_nosec_traplist_test.c @@ -0,0 +1,895 @@ +/* This SNMP Agent test sends a V3 trap with a non null trap list. A successful result is the correction + number of messages/packets sent, no internal errors and successful search of all the items in the trap list + sent to the SNMP Agent. */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + + +extern MIB_ENTRY mib2_mib[]; + +static UINT v3query_response_complete = NX_FALSE; +static UINT v3_trap_test_complete = NX_FALSE; + +static UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +#define QUERY_COUNT 2 +#define OID_COUNT 7 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static TX_THREAD thread_manager; +static NX_SNMP_AGENT v3_my_agent; +static NX_PACKET_POOL v3_pool_0; +static NX_IP agent_ip; +static NX_IP manager_ip; + +static NX_UDP_SOCKET snmp_manager_socket; +static NX_UDP_SOCKET snmp_manager_trap_socket; + +#define SNMP_MANAGER_ADDRESS IP_ADDRESS(10,0,0,1) +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10,0,0,10) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + + +/* Send SNMP manager query. */ +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT request_id, UINT packet_number); + +extern unsigned char trap_v3_nosec_get_request_pkt[58]; +extern int trap_v3_nosec_get_request_size; +extern unsigned char trap_v3_nosec_get_next_request_pkt[94]; +extern int trap_v3_nosec_get_next_request_size; +extern unsigned char trap_v3_nosec_pkt[218]; +extern int trap_v3_nosec_size; + +typedef struct SNMP_QUERY_STRUCT +{ + unsigned char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_nosec_traplist_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the SNMP Manager thread. */ + tx_thread_create(&thread_manager, "Manager thread", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&v3_pool_0, "NetX Main Packet Pool", 1000, pointer, 10000); + pointer = pointer + 10000; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &v3_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Create another IP instance. */ + status += nx_ip_create(&manager_ip, "Manager IP", SNMP_MANAGER_ADDRESS, 0xFFFFFF00UL, &v3_pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status += nx_arp_enable(&manager_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + status += nx_udp_enable(&manager_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&v3_my_agent, "SNMP Agent", &agent_ip, pointer, 4096, &v3_pool_0, + v3_mib2_username_processing, v3_mib2_get_processing, + v3_mib2_getnext_processing, v3_mib2_set_processing); + + if (status) + { + error_counter++; + } + + return; +} + + + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +NX_SNMP_TRAP_OBJECT trap_list[7]; +NX_SNMP_OBJECT_DATA trap_data0; +NX_SNMP_OBJECT_DATA trap_data1; +NX_SNMP_OBJECT_DATA trap_data2; +NX_SNMP_OBJECT_DATA trap_data3; +NX_SNMP_OBJECT_DATA trap_data4; +NX_SNMP_OBJECT_DATA trap_data5; +UINT counter = 99; + + + printf("NetX Test: SNMP V3 No Security Trap List Test........................"); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Reset the system clock so we can reasonably fit in the 150 second Time Window. */ + tx_time_set(0); + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&v3_my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Wait for the 'manager' to finish querying the Agent. */ + while (v3query_response_complete == NX_FALSE) + { + tx_thread_sleep(50); + } + + /* Now send the trap. */ + trap_list[0].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.1.0"; + trap_list[0].nx_snmp_object_data = &trap_data0; + trap_data0.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data0.nx_snmp_object_data_msw = counter++; + + trap_list[1].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.7.0"; + trap_list[1].nx_snmp_object_data = &trap_data1; + trap_data1.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data1.nx_snmp_object_data_msw = counter++; + + trap_list[2].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.8.0"; + trap_list[2].nx_snmp_object_data = &trap_data2; + trap_data2.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data2.nx_snmp_object_data_msw = tx_time_get(); + + trap_list[3].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.9.0"; + trap_list[3].nx_snmp_object_data = &trap_data3; + trap_data3.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data3.nx_snmp_object_data_msw = counter++; + + trap_list[4].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.10.0"; + trap_list[4].nx_snmp_object_data = &trap_data4; + trap_data4.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data4.nx_snmp_object_data_msw = tx_time_get(); + + + trap_list[5].nx_snmp_object_string_ptr = (UCHAR *) "1.3.6.1.2.1.2.2.1.10.0.2"; + trap_list[5].nx_snmp_object_data = &trap_data5; + trap_data5.nx_snmp_object_data_type = NX_SNMP_INTEGER; + trap_data5.nx_snmp_object_data_msw = counter++; + + /* Null terminate the list. */ + trap_list[6].nx_snmp_object_string_ptr = NX_NULL; + trap_list[6].nx_snmp_object_data = NX_NULL; + + status = nx_snmp_agent_trapv3_send(&v3_my_agent, SNMP_MANAGER_ADDRESS, (UCHAR *)"trap", NX_SNMP_TRAP_COLDSTART, tx_time_get(), &trap_list[0]); + + if (status) + { + error_counter++; + } + + /* Check for correct internal counters of SNMP processing. */ + if ((v3_my_agent.nx_snmp_agent_reports_sent != 1) || + (v3_my_agent.nx_snmp_agent_total_get_variables != 2) || + (v3_my_agent.nx_snmp_agent_packets_received != 2) || + (v3_my_agent.nx_snmp_agent_packets_sent != 3) || + (v3_my_agent.nx_snmp_agent_getresponse_sent != 1) || + (v3_my_agent.nx_snmp_agent_traps_sent != 1)) + { + error_counter++; + } + + /* Check for errors processing the request and sending the trap. */ + if (v3_my_agent.nx_snmp_agent_invalid_packets || + v3_my_agent.nx_snmp_agent_internal_errors || + v3_my_agent.nx_snmp_agent_allocation_errors || + v3_my_agent.nx_snmp_agent_request_errors || + v3_my_agent.nx_snmp_agent_too_big_errors || + v3_my_agent.nx_snmp_agent_username_errors || + v3_my_agent.nx_snmp_agent_unknown_requests) + { + + error_counter++; + } + + while (v3_trap_test_complete == NX_FALSE) + { + tx_thread_sleep(50); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; + +} + +/* SNMP Manager thread */ +static void thread_1_entry(ULONG thread_input) +{ + +NX_PACKET *agent_packet; +UINT i; +USHORT request_id = 1; +UINT oids_found = 0; +UCHAR *work_ptr; + + /* Let the agent get set up first! */ + tx_thread_sleep(50); + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_socket, "Manager Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v3query_response_complete = NX_TRUE; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_socket, 161, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v3query_response_complete = NX_TRUE; + return; + } + + /* Create a UDP socket act as the DNS server. */ + status = nx_udp_socket_create(&manager_ip, &snmp_manager_trap_socket, "Manager Trap Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + error_counter++; + v3query_response_complete = NX_TRUE; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&snmp_manager_trap_socket, 162, 200); + + + /* Check status. */ + if (status) + { + error_counter++; + v3query_response_complete = NX_TRUE; + return; + } + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Send the SNMP manager query packet. */ + status = nx_snmp_query_packet_send(&snmp_manager_socket, request_id, i); + + /* Check status. */ + if (status) + { + + error_counter++; + v3query_response_complete = NX_TRUE; + break; + } + + /* Receive the SNMP agent response. */ + status = nx_udp_socket_receive(&snmp_manager_socket, &agent_packet, 400); + + /* Check status. */ + if (status) + { + + error_counter++; + v3query_response_complete = NX_TRUE; + break; + } + + /* Release the packet. */ + nx_packet_release(agent_packet); + + tx_thread_sleep(100); + + request_id++; + } + + /* Indicate the handshake is complete. */ + v3query_response_complete = NX_TRUE; + + /* Check for errors, ending the test. */ + if (error_counter) + { + return; + } + + /* Receive the SNMP agent trap */ + status = nx_udp_socket_receive(&snmp_manager_trap_socket, &agent_packet, 400); + + /* Check received packet status. */ + if (status) + { + + error_counter++; + } + else + { + + /* Got a packet, now compare it for correct content. */ + work_ptr = agent_packet -> nx_packet_prepend_ptr + 80; /* Move past all the SNMP global headers etc to the data section. */ + + /* Search for the correct trap items in the list. */ + while ((work_ptr < agent_packet -> nx_packet_prepend_ptr + agent_packet -> nx_packet_length) && (oids_found <= OID_COUNT)) + { + + if ((oids_found == 0) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x02) && + (*(work_ptr + 3) == 0x01) && + (*(work_ptr + 4) == 0x01) && + (*(work_ptr + 5) == 0x03) && + (*(work_ptr + 6) == 0x00) && + (*(work_ptr + 7) == 0x43) && + (*(work_ptr + 8) == 0x02)) + /* This OID data is the system time, it is variable so skip it. */ + { + oids_found++; + /* Skip over this OID and value to the next OID */ + work_ptr += 11; + + continue; + } + + + else if ((oids_found == 1) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x06) && + (*(work_ptr + 3) == 0x03) && + (*(work_ptr + 4) == 0x01) && + (*(work_ptr + 5) == 0x01) && + (*(work_ptr + 6) == 0x04) && + (*(work_ptr + 7) == 0x01) && + (*(work_ptr + 8) == 0x00) && + (*(work_ptr + 9) == 0x06) && + (*(work_ptr + 10) == 0x0a) && + (*(work_ptr + 11) == 0x2b) && + (*(work_ptr + 12) == 0x06) && + (*(work_ptr + 13) == 0x01) && + (*(work_ptr + 14) == 0x06) && + (*(work_ptr + 15) == 0x03)) + + /* This OID's data is another OID, no need to check past the base of the OID 1.3.6.1.6.3, + common to all OIDs. The rest depends on the MIB. */ + { + oids_found++; + + work_ptr += 20; /* Skip past the OID and its data which itself is an OID */ + + continue; + } + + + else if ((oids_found == 2) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x02) && + (*(work_ptr + 3) == 0x01) && + (*(work_ptr + 4) == 0x02) && + (*(work_ptr + 5) == 0x02) && + (*(work_ptr + 6) == 0x01) && + (*(work_ptr + 7) == 0x01) && + (*(work_ptr + 8) == 0x00) && + (*(work_ptr + 9) == 0x02) && + (*(work_ptr + 10) == 0x01) && + (*(work_ptr + 11) == 0x63)) + /* This is a preset counter field so we know the data size and the data set to 99. */ + { + oids_found++; + + work_ptr += 11; /* Skip past the OID and its data */ + + continue; + + } + + + else if ((oids_found == 3) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x02) && + (*(work_ptr + 3) == 0x01) && + (*(work_ptr + 4) == 0x02) && + (*(work_ptr + 5) == 0x02) && + (*(work_ptr + 6) == 0x01) && + (*(work_ptr + 7) == 0x07) && + (*(work_ptr + 8) == 0x00) && + (*(work_ptr + 9) == 0x02) && + (*(work_ptr + 10) == 0x01) && + (*(work_ptr + 11) == 0x64)) + /* This is the preset counter field so we know the data size and the data is incremented by 1. */ + { + oids_found++; + + work_ptr += 11; /* Skip past the OID and its data */ + + continue; + } + + + else if ((oids_found == 4) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x02) && + (*(work_ptr + 3) == 0x01) && + (*(work_ptr + 4) == 0x02) && + (*(work_ptr + 5) == 0x02) && + (*(work_ptr + 6) == 0x01) && + (*(work_ptr + 7) == 0x08) && + (*(work_ptr + 8) == 0x00) && + (*(work_ptr + 9) == 0x02) && + (*(work_ptr + 10) == 0x02)) + /* This should be a two byte data field and timer data (timer ticks) is variable so leave it off */ + { + oids_found++; + + work_ptr += 11; /* Skip past the OID and its data */ + + continue; + + } + + + else if ((oids_found == 5) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x02) && + (*(work_ptr + 3) == 0x01) && + (*(work_ptr + 4) == 0x02) && + (*(work_ptr + 5) == 0x02) && + (*(work_ptr + 6) == 0x01) && + (*(work_ptr + 7) == 0x09) && + (*(work_ptr + 8) == 0x00) && + (*(work_ptr + 9) == 0x02) && + (*(work_ptr + 10) == 0x01) && + (*(work_ptr + 11) == 0x65)) + /* This is the preset counter field so we know the data size and the data is incremented by 1. */ + { + oids_found++; + + work_ptr += 11; /* Skip past the OID and its data */ + + continue; + } + + else if ((oids_found == 6) && + (*work_ptr == 0x06) && + (*(work_ptr + 1) == 0x01) && + (*(work_ptr + 2) == 0x02) && + (*(work_ptr + 3) == 0x01) && + (*(work_ptr + 4) == 0x02) && + (*(work_ptr + 5) == 0x02) && + (*(work_ptr + 6) == 0x01) && + (*(work_ptr + 7) == 0x0a) && + (*(work_ptr + 8) == 0x00) && + (*(work_ptr + 9) == 0x02) && + (*(work_ptr + 10) == 0x02)) + /* This should be a two byte data field and timer data (timer ticks) is variable so leave it off */ + { + oids_found++; + + break; + } + + work_ptr++; + } + } + + if (oids_found != OID_COUNT) + { + + error_counter++; + } + + /* Indicate the test is complete. */ + v3_trap_test_complete = NX_TRUE; + + /* Unbind the UDP socket. */ + status = nx_udp_socket_unbind(&snmp_manager_socket); + + /* Delete the UDP socket. */ + status |= nx_udp_socket_delete(&snmp_manager_socket); + + if (status) + { + error_counter++; + } + + return; +} + + +static UINT nx_snmp_query_packet_send(NX_UDP_SOCKET *snmp_manager_socket, UINT snmp_request_id, UINT packet_number) +{ +UINT status; +NX_PACKET *response_packet; + + + /* Allocate a response packet. */ + status = nx_packet_allocate(&v3_pool_0, &response_packet, NX_UDP_PACKET, 200); + + /* Check status. */ + if (status) + { + + error_counter++; + return(1); + } + + memset(response_packet -> nx_packet_prepend_ptr, 0, (response_packet -> nx_packet_data_end - response_packet -> nx_packet_prepend_ptr)); + + /* Write the SMTP response messages into the packet payload! */ + memcpy(response_packet -> nx_packet_prepend_ptr, + snmp_query[packet_number].snmp_query_pkt_data, + snmp_query[packet_number].snmp_query_pkt_size); + + /* Adjust the write pointer. */ + response_packet -> nx_packet_length = snmp_query[packet_number].snmp_query_pkt_size; + response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; + + /* Send the UDP packet with the correct port. */ + status = nx_udp_socket_send(snmp_manager_socket, response_packet, IP_ADDRESS(10, 0, 0, 10), 161); + + /* Check the status. */ + if (status) + { + + error_counter++; + nx_packet_release(response_packet); + } + + return status; +} + + +static void snmp_test_initialize() +{ + + snmp_query[0].snmp_query_pkt_data = &trap_v3_nosec_get_request_pkt[0]; + snmp_query[0].snmp_query_pkt_size = trap_v3_nosec_get_request_size; + snmp_query[1].snmp_query_pkt_data = &trap_v3_nosec_get_next_request_pkt[0]; + snmp_query[1].snmp_query_pkt_size = trap_v3_nosec_get_next_request_size; + +} + + +/* Define the application's GET processing routine. */ + +UINT v3_mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT v3_mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT v3_mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT v3_mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + v3_mib2_variable_update(&agent_ip, &v3_my_agent); + + return NX_SUCCESS; + +} + +extern ULONG sysUpTime; +/* Define the application's update routine. */ + +VOID v3_mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + sysUpTime = tx_time_get(); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_nosec_traplist_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 No Security Trap List Test........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/snmp_test/netx_snmp_v3_object_id_buffer_overwrite_test.c b/test/regression/snmp_test/netx_snmp_v3_object_id_buffer_overwrite_test.c new file mode 100644 index 00000000..6c08c555 --- /dev/null +++ b/test/regression/snmp_test/netx_snmp_v3_object_id_buffer_overwrite_test.c @@ -0,0 +1,517 @@ +/* This NetX test concentrates on the basic SNMPv2 operation. The 'manager' sends + a request for an unknown item ("oid"). The SNMP agent should not responds, but + set an internal error and be able to respond to the next request. + + The MIB database is defined in demo_snmp_helper.h */ + + +#include "tx_api.h" +#include "nx_api.h" +#if defined(__PRODUCT_NETXDUO__) +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif +#include "nx_udp.h" +#include "small_mib_helper.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +extern MIB_ENTRY mib2_mib[]; + //NX_SNMP_SECURITY_KEY my_authentication_key; + +NX_SNMP_SECURITY_KEY my_privacy_key; + +static UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +static UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +static VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); + +static UCHAR context_engine_id[] = {0x80, 0x00, 0x03, 0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x44, 0x55}; +static UINT context_engine_size = 11; +static UCHAR context_name[] = {0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c}; +static UINT context_name_size = 7; + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_agent; +static NX_SNMP_AGENT my_agent; +static NX_PACKET_POOL pool_0; +static NX_IP agent_ip; + +#define SNMP_AGENT_ADDRESS IP_ADDRESS(10, 128, 16, 17) + + +/* Define the counters used in the demo application... */ + +static UINT status; +static ULONG error_counter; +static ULONG snmp_stack[DEMO_STACK_SIZE / sizeof(ULONG)]; + + +/* Define thread prototypes. */ + +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +static void snmp_test_initialize(); + +/* Inject SNMP manager query. */ +static VOID packet_inject(UCHAR *data_ptr, UINT data_size); + + +extern unsigned char v3_object_id_buffer_overwrite_packet1[1514]; +extern int v3_object_id_buffer_overwrite_packet1_size; + +#define QUERY_COUNT 1 + +typedef struct SNMP_QUERY_STRUCT +{ + char *snmp_query_pkt_data; + int snmp_query_pkt_size; +} SNMP_QUERY; + + +static SNMP_QUERY snmp_query[QUERY_COUNT]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_object_id_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the SNMP agent thread. */ + tx_thread_create(&thread_agent, "Agent thread", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, (sizeof(NX_PACKET) + 1536) * 10); + pointer = pointer + (sizeof(NX_PACKET) + 1536) * 10; + + /* Create an IP instance. */ + status += nx_ip_create(&agent_ip, "Agent IP", SNMP_AGENT_ADDRESS, 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for IP create errors. */ + if (status) + { + error_counter++; + } + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&agent_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for ARP enable errors. */ + if (status) + { + error_counter++; + } + + /* Enable UDP traffic. */ + status = nx_udp_enable(&agent_ip); + + /* Check for UDP enable errors. */ + if (status) + { + error_counter++; + } +} + +/* Define the test threads. */ + +static void thread_0_entry(ULONG thread_input) +{ + +UINT status; +UINT i; +NX_PACKET *packet_ptr; + + printf("NetX Test: SNMP V3 Object ID Buffer OverWrite Test..................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create an SNMP agent instance. */ + status = nx_snmp_agent_create(&my_agent, "SNMP Agent", &agent_ip, snmp_stack, sizeof(snmp_stack), &pool_0, + mib2_username_processing, mib2_get_processing, + mib2_getnext_processing, mib2_set_processing); + + if (status) + { + error_counter++; + } + +#ifdef AUTHENTICATION_REQUIRED + status = nx_snmp_agent_v3_context_boots_set(&my_agent, 1); + if (status) + { + error_counter++; + } + + status = nx_snmp_agent_context_engine_set(&my_agent, context_engine_id, context_engine_size); + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Create an authentication key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"authpassword", &my_authentication_key); + if (status) + { + error_counter++; + } + + /* Use the authentication key. */ + status = nx_snmp_agent_authenticate_key_use(&my_agent, &my_authentication_key); + if (status) + { + error_counter++; + } +#endif + + /* Create a privacy key. */ + status = nx_snmp_agent_md5_key_create(&my_agent, (UCHAR *)"privpassword", &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Use the privacy key. */ + status = nx_snmp_agent_privacy_key_use(&my_agent, &my_privacy_key); + if (status) + { + error_counter++; + } + + /* Start the SNMP instance. */ + status = nx_snmp_agent_start(&my_agent); + + /* Return the test result. */ + if (status) + { + error_counter++; + } + + /* Load the test data up. */ + snmp_test_initialize(); + + /* Send SNMP queries to the agent. */ + for (i = 0; i < QUERY_COUNT; i++ ) + { + + /* Inject the SNMP manager query packet. */ + packet_inject(snmp_query[i].snmp_query_pkt_data, snmp_query[i].snmp_query_pkt_size); + } + + /* Wait for processing snmp packet. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the packet pool is not corrupted. */ + while (pool_0.nx_packet_pool_available) + { + if ((nx_packet_allocate(&pool_0, &packet_ptr, 0, NX_NO_WAIT)) || + (packet_ptr -> nx_packet_pool_owner != &pool_0)) + { + error_counter++; + break; + } + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +static VOID packet_inject(UCHAR *data_ptr, UINT data_size) +{ +UINT status; +NX_PACKET *my_packet; + + status = nx_packet_allocate(&pool_0, &my_packet, NX_RECEIVE_PACKET, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Make sure IP header is 4-byte aligned. */ + my_packet -> nx_packet_prepend_ptr += 2; + my_packet -> nx_packet_append_ptr += 2; + + /* Fill in the packet with data. Skip the MAC header. */ + status = nx_packet_data_append(my_packet, data_ptr, data_size, &pool_0, NX_NO_WAIT); + + /* Check status */ + if(status) + error_counter ++; + + /* Skip the MAC header. */ + my_packet -> nx_packet_length -= 14; + my_packet -> nx_packet_prepend_ptr += 14; + + /* Directly receive the TCP packet. */ + _nx_ip_packet_deferred_receive(&agent_ip, my_packet); +} + +static void snmp_test_initialize() +{ + snmp_query[0].snmp_query_pkt_data = &v3_object_id_buffer_overwrite_packet1[0]; + snmp_query[0].snmp_query_pkt_size = v3_object_id_buffer_overwrite_packet1_size; +} + + +/* Define the application's GET processing routine. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's GETNEXT processing routine. */ + +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the next entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Is the next entry the mib greater? */ + if (status == NX_SNMP_NEXT_ENTRY) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SNMP_NEXT_ENTRY) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Copy the new name into the object. */ + nx_snmp_object_copy(mib2_mib[i].object_name, object_requested); + + /* Determine if the entry has a get function. */ + if (mib2_mib[i].object_get_callback) + { + + /* Yes, call the get function. */ + status = (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data); + + /* Determine if the object data indicates an end-of-mib condition. */ + if (object_data -> nx_snmp_object_data_type == NX_SNMP_END_OF_MIB_VIEW) + { + + /* Copy the name supplied in the mib table. */ + nx_snmp_object_copy(mib2_mib[i].object_value_ptr, object_requested); + } + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + /* Return the status. */ + return(status); +} + + +/* Define the application's SET processing routine. */ + +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data) +{ + +UINT i; +UINT status; + + + /* Loop through the sample MIB to see if we have information for the supplied variable. */ + i = 0; + status = NX_SNMP_ERROR; + while (mib2_mib[i].object_name) + { + + /* See if we have found the matching entry. */ + status = nx_snmp_object_compare(object_requested, mib2_mib[i].object_name); + + /* Was it found? */ + if (status == NX_SUCCESS) + { + + /* Yes it was found. */ + break; + } + + /* Move to the next index. */ + i++; + } + + /* Determine if a not found condition is present. */ + if (status != NX_SUCCESS) + { + + /* The object was not found - return an error. */ + return(NX_SNMP_ERROR_NOSUCHNAME); + } + + + /* Determine if the entry has a set function. */ + if (mib2_mib[i].object_set_callback) + { + + /* Yes, call the set function. */ + status = (mib2_mib[i].object_set_callback)(mib2_mib[i].object_value_ptr, object_data); + } + else + { + + /* No get function, return no access. */ + status = NX_SNMP_ERROR_NOACCESS; + } + + + /* Return the status. */ + return(status); +} + +/* Create an error code if matching user not found. */ +#define USER_NOT_FOUND 1 + +/* Define the username callback routine routine. Usernames should be + associated with permissions (public or private string) and what version + of SNMP the user is configured for. The username callback should verify + the incoming username MIB access permissions. */ +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username) +{ + + mib2_variable_update(&agent_ip, &my_agent); + + return NX_SUCCESS; + +} + +/* Define the application's update routine. */ + +VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) +{ + + /* Update the snmp parameters. */ + return; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_snmp_v3_object_id_buffer_overwrite_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: SNMP V3 Object ID Buffer OverWrite Test...................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/snmp_test/small_mib_helper.c b/test/regression/snmp_test/small_mib_helper.c new file mode 100644 index 00000000..7a898ab1 --- /dev/null +++ b/test/regression/snmp_test/small_mib_helper.c @@ -0,0 +1,116 @@ + +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { +#endif + +#include "small_mib_helper.h" + +/* Define function prototypes. */ + +UINT mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +UINT mib2_getnext_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +UINT mib2_set_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data); +UINT mib2_username_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +//UINT mib2_username_processing_public(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +//UINT mib2_username_processing_admin(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +//UINT mib2_username_processing_view(NX_SNMP_AGENT *agent_ptr, UCHAR *username); +//VOID mib2_variable_update(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); +//VOID mib2_variable_update_public(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr); +//VOID mib2_variable_update_view(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) ; +//VOID mib2_variable_update_admin(NX_IP *ip_ptr, NX_SNMP_AGENT *agent_ptr) ; + + +/* Define the MIB-2 "system" group. */ + +UCHAR sysDescr[] = "NetX SNMP Agent"; /* sysDescr:OctetString RO */ +UCHAR sysObjectID[] = "1.3.6.1.2.1.1"; /* sysObjectID:ObjectID RO */ +ULONG sysUpTime = 0; /* sysUpTime:TimeTicks RO */ +UCHAR sysContact[128] = "NetX sysContact Name"; /* sysContact:OctetString RW */ +UCHAR sysName[128] = "NetX sysName"; /* sysName:OctetString RW */ +UCHAR sysLocation[128] = "NetX sysLocation"; /* sysLocation:OctetString RW */ +ULONG sysServices = 1; /* sysServices:Integer RW */ + +ULONG ipForwarding = 0; /* ipForwarding:Integer RW */ +ULONG ipDefaultTTL = NX_IP_TIME_TO_LIVE; /* ipDefaultTTL:Integer RW */ + +/* Define the MIB-2 "interfaces" group, assuming one interface. Update of these variables could be added to the + underlying application driver, but for now simple defaults are used. */ +ULONG ifLastChange = 2048; /* ifLastChange:TimeTicks RO */ +ULONG ifInOctets = 155; /* ifInOctets:Counter RO */ +ULONG64 ifInUcastPkts = 0; /* ifInUcastPkts:Counter RO */ + +UCHAR ifDescr[] = "NetX Physical Interface"; /* ifDescr:OctetString RO */ +#if 0 +ULONG ifNumber = 1; /* ifNumber:Integer RO */ +ULONG ifIndex = 1; /* ifIndex:Integer RO */ +ULONG ifType = 1; /* ifType:Integer RO */ +ULONG ifMtu = 2048; /* ifMTU:Integer RO */ +ULONG ifSpeed = 1000000; /* ifSpeed:Guage RO */ +UCHAR ifPhysAddress[] = {0x00,0x04,0xac,0xe3,0x1d,0xc5};/* ifPhysAddress:OctetString RO */ +ULONG ifAdminStatus = IFADMINSTATUS_UP; /* ifAdminStatus:Integer RW */ +ULONG ifOperStatus = 1; /* ifOperStatus:Integer RO */ +ULONG ifInNUcastPkts = 0; /* ifInNUcastPkts:Counter RO */ +ULONG ifInDiscards = 0; /* ifInDiscards:Counter RO */ +ULONG ifInErrors = 0; /* ifInErrors:Counter RO */ +ULONG ifInUnknownProtos = 0; /* ifInUnknownProtos:Counter RO */ +ULONG ifOutOctets = 0; /* ifOutOctets:Counter RO */ +ULONG ifOutUcastPkts = 0; /* ifOutUcastPkts:Counter RO */ +ULONG ifOutNUcastPkts = 0; /* ifOutNUcastPkts:Counter RO */ +ULONG ifOutDiscards = 0; /* ifOutDiscards:Counter RO */ +ULONG ifOutErrors = 0; /* ifOutErrors:Counter RO */ +ULONG ifOutQLen = 0; /* ifOutQLen:Guage RO */ +UCHAR ifSpecific[] = "1.3.6.1.2.1.1"; /* ifSpecific:ObjectID RO */ +#endif +/* Define the MIB-2 "address translation" group, assuming one address translation. */ + +//ULONG atIfIndex = 1; /* atIfIndex:Integer RW */ +UCHAR atPhysAddress[] = {0x00,0x04,0xac,0xe3,0x1d,0xc5};/* atPhysAddress:OctetString RW */ +ULONG atNetworkAddress = 0; /* atNetworkAddress:NetworkAddr RW */ +UCHAR atIPv6NetworkAddress[16]; /* atNetworkAddress:NetworkAddr IPv6 RW */ + + +/* Define the MIB-2 "ip" group. */ +//ULONG ipForwarding = 0; /* ipForwarding:Integer RW */ +ULONG oid_var = 1234U; + + +/* Define the actual MIB-2. */ + +MIB_ENTRY mib2_mib[] = { + + /* OBJECT ID OBJECT VARIABLE LENGTH OF OBJECT VARIABLE GET ROUTINE/ GET_OCTET_ROUTINE SET ROUTINE LENGTH */ +#if 1 + {(UCHAR *) "1.3.6.1.2.1.1.1.0", sysDescr, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysDescr)}, + {(UCHAR *) "1.3.6.1.2.1.1.2.0", sysObjectID, nx_snmp_object_id_get, NX_NULL, NX_NULL, sizeof(sysObjectID)}, + {(UCHAR *) "1.3.6.1.2.1.1.3.0", &sysUpTime, nx_snmp_object_timetics_get, NX_NULL, NX_NULL, sizeof(sysUpTime)}, + {(UCHAR *) "1.3.6.1.2.1.1.4.0", sysContact, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysContact)}, + {(UCHAR *) "1.3.6.1.2.1.1.5.0", sysName, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysName)}, + {(UCHAR *) "1.3.6.1.2.1.1.6.0", sysLocation, nx_snmp_object_string_get, NX_NULL, nx_snmp_object_string_set, sizeof(sysLocation)}, + {(UCHAR *) "1.3.6.1.2.1.1.7.0", &sysServices, nx_snmp_object_integer_get, NX_NULL, NX_NULL, sizeof(sysServices)}, +#endif + {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.0", &atNetworkAddress, nx_snmp_object_ip_address_get, NX_NULL, nx_snmp_object_ip_address_set, sizeof(atNetworkAddress)}, +#ifdef FEATURE_NX_IPV6 + /* Either GET method should work. IPv6 addresses are handled as octet strings and accept any IPv6 address format e.g. addresses with '::'s are accepted as is. */ + {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.1", &atIPv6NetworkAddress, nx_snmp_object_ipv6_address_get, NX_NULL, nx_snmp_object_ipv6_address_set, sizeof(atIPv6NetworkAddress)}, + {(UCHAR *) "1.3.6.1.2.1.3.1.1.3.2", &atIPv6NetworkAddress, NX_NULL, nx_snmp_object_octet_string_get, nx_snmp_object_octet_string_set, sizeof(atIPv6NetworkAddress)}, +#endif + + {(UCHAR *) "1.3.6.1.2.1.2.2.1.2.0", ifDescr, nx_snmp_object_string_get, NX_NULL, NX_NULL, sizeof(ifDescr)}, + {(UCHAR *) "1.3.6.1.2.1.3.1.1.2.0", &atPhysAddress, NX_NULL, nx_snmp_object_octet_string_get, nx_snmp_object_octet_string_set, sizeof(atPhysAddress)}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.9.0", &ifLastChange, nx_snmp_object_timetics_get, NX_NULL, nx_snmp_object_timetics_set, sizeof(ifLastChange)}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.10.0", &ifInOctets, nx_snmp_object_counter_get, NX_NULL, nx_snmp_object_counter_set, sizeof(ifInOctets)}, + {(UCHAR *) "1.3.6.1.2.1.2.2.1.11.0", &ifInUcastPkts, nx_snmp_object_counter64_get, NX_NULL, nx_snmp_object_counter64_set, sizeof(ifInUcastPkts)}, + + {(UCHAR *) "1.3.6.1.2.1.4.1.0", &ipForwarding, nx_snmp_object_integer_get, NX_NULL, nx_snmp_object_integer_set, sizeof(ipForwarding)}, + {(UCHAR *) "1.3.6.1.2.1.4.2.0", &ipDefaultTTL, nx_snmp_object_integer_get, NX_NULL, NX_NULL, sizeof(ipDefaultTTL)}, + {(UCHAR *) "1.3.6.1.4.1.51000.1.4.0", &oid_var, nx_snmp_object_integer_get, NX_NULL, NX_NULL, sizeof(oid_var)}, + + {(UCHAR *) "1.3.6.1.7", (UCHAR *) "1.3.6.1.7", nx_snmp_object_end_of_mib, NX_NULL, NX_NULL, sizeof("1.3.6.1.7") - 1}, + {NX_NULL, NX_NULL, NX_NULL, NX_NULL, NX_NULL, 0} + +}; diff --git a/test/regression/snmp_test/small_mib_helper.h b/test/regression/snmp_test/small_mib_helper.h new file mode 100644 index 00000000..ad6126ba --- /dev/null +++ b/test/regression/snmp_test/small_mib_helper.h @@ -0,0 +1,40 @@ +/* This is an include file for the NetX SNMP demo programs for setting up the MIB for + user callback functions. It is not part of the official release of NetX SNMP Agent. */ + +#ifndef SMALL_MIB_HELPER_H +#define SMALL_MIB_HELPER_H + +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ + +#ifdef __cplusplus + +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { + +#endif + +/* Include necessary digest and encryption files. */ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_snmp.h" +#else +#include "nx_snmp.h" +#endif + +/* Define application MIB data structure. Actual application structures would certainly vary. */ + +typedef struct MIB_ENTRY_STRUCT +{ + + UCHAR *object_name; + void *object_value_ptr; + UINT (*object_get_callback)(VOID *source_ptr, NX_SNMP_OBJECT_DATA *object_data); + UINT (*object_get_octet_callback)(VOID *source_ptr, NX_SNMP_OBJECT_DATA *object_data, UINT length); + UINT (*object_set_callback)(VOID *destination_ptr, NX_SNMP_OBJECT_DATA *object_data); + UINT length; +} MIB_ENTRY; + +#endif /* SMALL_MIB_HELPER_H */ diff --git a/test/regression/snmp_test/snmp_manager_packets.c b/test/regression/snmp_test/snmp_manager_packets.c new file mode 100644 index 00000000..a5fcb0db --- /dev/null +++ b/test/regression/snmp_test/snmp_manager_packets.c @@ -0,0 +1,1980 @@ +/* Frame (83 bytes) SNMPv2 GET REQUEST + community: public + data: get-request (0) +*/ +const unsigned char simple_get_query_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* ..0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x29, 0x02, 0x01, 0x00, 0x02, /* ...).... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x02, 0x00, 0x05, 0x00 /* .... */ +}; + +int simple_get_query_size = 42; + + +/* Frame (81 bytes) SNMPv2 GET NEXT REQUEST + community: public + data: get-next request (1) +*/ +const unsigned char simple_get_next_query_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* ..0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa1, /* .public. */ +0x1b, 0x02, 0x01, 0x2b, 0x02, 0x01, 0x00, 0x02, /* ...+.... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x01, 0x00, 0x05, 0x00 /* .... */ +}; + +int simple_get_next_query_size = 42; + + +/* Frame (76 bytes) SNMPv2 GET BULK REQUEST + community: public + data: getBulkRequest (5) + getBulkRequest +*/ + +const unsigned char simple_get_bulk_query_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* ..0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa5, /* .public. */ +0x1b, 0x02, 0x01, 0x2c, 0x02, 0x01, 0x00, 0x02, /* ...,.... */ +0x01, 0x0a, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, /* +....... */ +0x02, 0x00, 0x05, 0x00 /* .... */ +}; + +int simple_get_bulk_query_size = 42; + +/* Frame (83 bytes) SNMPv2 GET REQUEST for unknown item + community: public + data: get-request (0) +*/ +const unsigned char simple_get_query_unknown_oid_pkt[42] = { +0x30, 0x28, 0x02, 0x01, 0x01, 0x04, /* ..0(.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, /* .public. */ +0x1b, 0x02, 0x01, 0x29, 0x02, 0x01, 0x00, 0x02, /* ...).... */ +0x01, 0x00, 0x30, 0x10, 0x30, 0x0e, 0x06, 0x0a, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x018, 0x02, 0x01, /* +....... */ +0x02, 0x00, 0x05, 0x00 /* .... */ +}; + +int simple_get_query_unknown_oid_size = 42; + +const unsigned char simple_send_trap_pkt[76] = { +0x30, 0x82, 0x00, 0x48, 0x02, 0x01, /* 9.0..H.. */ +0x01, 0x04, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, /* ...publi */ +0x63, 0xa7, 0x3b, 0x02, 0x01, 0x13, 0x02, 0x01, /* c.;..... */ +0x00, 0x02, 0x01, 0x00, 0x30, 0x82, 0x00, 0x2e, /* ....0... */ +0x30, 0x82, 0x00, 0x0e, 0x06, 0x08, 0x2b, 0x06, /* 0.....+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x43, 0x02, /* ......C. */ +0x07, 0x97, 0x30, 0x82, 0x00, 0x18, 0x06, 0x0a, /* ..0..... */ +0x2b, 0x06, 0x01, 0x06, 0x03, 0x01, 0x01, 0x04, /* +....... */ +0x01, 0x00, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x06, /* ....+... */ +0x03, 0x01, 0x01, 0x05, 0x01, 0x00 /* ...... */ +}; + +int simple_send_trap_size = 76; + +/***************** SNMP V3 No security handshake ************/ +const unsigned char v3_nosec_getrequest_pkt[58] = { +0x30, 0x38, 0x02, 0x01, 0x03, 0x30, /* ..08...0 */ +0x0e, 0x02, 0x01, 0x1c, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x10, 0x30, 0x0e, 0x04, 0x00, 0x02, 0x01, 0x00, /* .0...... */ +0x02, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, /* ........ */ +0x00, 0x30, 0x11, 0x04, 0x00, 0x04, 0x00, 0xa0, /* .0...... */ +0x0b, 0x02, 0x01, 0x71, 0x02, 0x01, 0x00, 0x02, /* ...q.... */ +0x01, 0x00, 0x30, 0x00 /* ..0. */ +}; + +int v3_nosec_getrequest_size = 58; + +/* Frame (140 bytes) */ +const unsigned char v3_nosec_getnext_request_pkt[98] = { +0x30, 0x60, 0x02, 0x01, 0x03, 0x30, /* ..0`...0 */ +0x0e, 0x02, 0x01, 0x1d, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x20, 0x30, 0x1e, 0x04, 0x0b, 0x80, 0x00, 0x0d, /* 0...... */ +0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69, /* ...w##Fi */ +0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x05, /* ........ */ +0x6a, 0x61, 0x6e, 0x65, 0x74, 0x04, 0x00, 0x04, /* janet... */ +0x00, 0x30, 0x29, 0x04, 0x0b, 0x80, 0x00, 0x0d, /* .0)..... */ +0xfe, 0x03, 0x00, 0x77, 0x23, 0x23, 0x46, 0x69, /* ...w##Fi */ +0x04, 0x00, 0xa1, 0x18, 0x02, 0x01, 0x72, 0x02, /* ......r. */ +0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x30, /* .....0.0 */ +0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, /* ...+.... */ +0x01, 0x03, 0x05, 0x00 /* .... */ +}; + +int v3_nosec_getnext_request_size = 98; + +/*********v3 with auth/priv function test********************/ + +unsigned char get_request_priv_pkt[59] = { +0x30, 0x39, 0x02, 0x01, 0x03, 0x30, /* ..09...0 */ +0x0e, 0x02, 0x01, 0x04, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x10, 0x30, 0x0e, 0x04, 0x00, 0x02, 0x01, 0x00, /* .0...... */ +0x02, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, /* ........ */ +0x00, 0x30, 0x12, 0x04, 0x00, 0x04, 0x00, 0xa0, /* .0...... */ +0x0c, 0x02, 0x02, 0x00, 0x9b, 0x02, 0x01, 0x00, /* ........ */ +0x02, 0x01, 0x00, 0x30, 0x00 /* ...0. */ +}; + +int get_request_priv_size = 59; + + +unsigned char getnext_request_priv_pkt[123] = { +0x30, 0x79, 0x02, 0x01, 0x03, 0x30, /* .40y...0 */ +0x0e, 0x02, 0x01, 0x06, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x07, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x32, 0x30, 0x30, 0x04, 0x09, 0x80, 0x00, 0x03, /* 200..... */ +0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, 0x01, /* ....d... */ +0x01, 0x02, 0x01, 0x0d, 0x04, 0x05, 0x6a, 0x61, /* ......ja */ +0x6e, 0x65, 0x74, 0x04, 0x0c, 0x9d, 0x1d, 0xbe, /* net..... */ +0x6b, 0xee, 0x12, 0x22, 0xcb, 0x90, 0xe8, 0x41, /* k.."...A */ +0xfc, 0x04, 0x08, 0x00, 0x00, 0x00, 0xc8, 0x00, /* ........ */ +0x00, 0x00, 0x22, 0x04, 0x30, 0x0a, 0x5a, 0x42, /* ..".0.ZB */ +0xe6, 0x83, 0xe2, 0x86, 0x36, 0x60, 0xdc, 0x19, /* ....6`.. */ +0x36, 0x8a, 0x2d, 0xd6, 0x8e, 0xee, 0x68, 0xe9, /* 6.-...h. */ +0x08, 0xa8, 0xb3, 0xea, 0x61, 0x1d, 0xf1, 0xa3, /* ....a... */ +0x19, 0xc8, 0xda, 0x90, 0x70, 0x25, 0x74, 0x84, /* ....p%t. */ +0x97, 0x48, 0xcb, 0x9a, 0x6b, 0x22, 0xd3, 0x45, /* .H..k".E */ +0xee, 0x72, 0x52, 0x38, 0x03 /* .rR8. */ +}; + +int getnext_request_priv_size = 123; + + +/************************************************************/ + +//unsigned char trap_v3_nosec_get_request_pkt[100] = { +unsigned char trap_v3_nosec_get_request_pkt[58] = { +0x30, 0x38, 0x02, 0x01, 0x03, 0x30, /* ..08...0 */ +0x0e, 0x02, 0x01, 0x04, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x10, 0x30, 0x0e, 0x04, 0x00, 0x02, 0x01, 0x00, /* .0...... */ +0x02, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, /* ........ */ +0x00, 0x30, 0x11, 0x04, 0x00, 0x04, 0x00, 0xa0, /* .0...... */ +0x0b, 0x02, 0x01, 0x26, 0x02, 0x01, 0x00, 0x02, /* ...&.... */ +0x01, 0x00, 0x30, 0x00 /* ..0. */ +}; + +int trap_v3_nosec_get_request_size = 58; + +/* Frame (136 bytes) */ +unsigned char trap_v3_nosec_get_next_request_pkt[94] = { +0x30, 0x5c, 0x02, 0x01, 0x03, 0x30, /* ..0\...0 */ +0x0e, 0x02, 0x01, 0x05, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x04, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x1e, 0x30, 0x1c, 0x04, 0x09, 0x80, 0x00, 0x03, /* .0...... */ +0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, 0x01, /* ....d... */ +0x00, 0x02, 0x01, 0x00, 0x04, 0x05, 0x6a, 0x61, /* ......ja */ +0x6e, 0x65, 0x74, 0x04, 0x00, 0x04, 0x00, 0x30, /* net....0 */ +0x27, 0x04, 0x09, 0x80, 0x00, 0x03, 0x10, 0x01, /* '....... */ +0xc0, 0xa8, 0x64, 0xaf, 0x04, 0x00, 0xa1, 0x18, /* ..d..... */ +0x02, 0x01, 0x27, 0x02, 0x01, 0x00, 0x02, 0x01, /* ..'..... */ +0x00, 0x30, 0x0d, 0x30, 0x0b, 0x06, 0x07, 0x2b, /* .0.0...+ */ +0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x05, 0x00 /* ........ */ +}; + +int trap_v3_nosec_get_next_request_size = 94; + +/* Frame (260 bytes) */ +unsigned char trap_v3_nosec_pkt[218] = { +0x30, 0x82, 0x00, 0xd6, 0x02, 0x01, /* ..0..... */ +0x03, 0x30, 0x0d, 0x02, 0x01, 0x00, 0x02, 0x02, /* .0...... */ +0x01, 0xf0, 0x04, 0x01, 0x00, 0x02, 0x01, 0x03, /* ........ */ +0x04, 0x1f, 0x30, 0x1d, 0x04, 0x09, 0x80, 0x00, /* ..0..... */ +0x03, 0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, /* .....d.. */ +0x01, 0x01, 0x02, 0x01, 0x03, 0x04, 0x06, 0x70, /* .......p */ +0x75, 0x62, 0x6c, 0x69, 0x63, 0x04, 0x00, 0x04, /* ublic... */ +0x00, 0x30, 0x82, 0x00, 0x9f, 0x04, 0x09, 0x80, /* .0...... */ +0x00, 0x03, 0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, /* ......d. */ +0x04, 0x00, 0xa7, 0x82, 0x00, 0x8e, 0x02, 0x01, /* ........ */ +0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, /* .......0 */ +0x82, 0x00, 0x81, 0x30, 0x0e, 0x06, 0x08, 0x2b, /* ...0...+ */ +0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x43, /* .......C */ +0x02, 0x01, 0x41, 0x30, 0x18, 0x06, 0x0a, 0x2b, /* ..A0...+ */ +0x06, 0x01, 0x06, 0x03, 0x01, 0x01, 0x04, 0x01, /* ........ */ +0x00, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x06, 0x03, /* ...+.... */ +0x01, 0x01, 0x05, 0x04, 0x00, 0x30, 0x0f, 0x06, /* .....0.. */ +0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, 0x02, /* .+...... */ +0x01, 0x01, 0x00, 0x02, 0x01, 0x63, 0x30, 0x0f, /* .....c0. */ +0x06, 0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x02, /* ..+..... */ +0x02, 0x01, 0x07, 0x00, 0x02, 0x01, 0x64, 0x30, /* ......d0 */ +0x10, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, /* ...+.... */ +0x02, 0x02, 0x01, 0x08, 0x00, 0x02, 0x02, 0x01, /* ........ */ +0x41, 0x30, 0x0f, 0x06, 0x0a, 0x2b, 0x06, 0x01, /* A0...+.. */ +0x02, 0x01, 0x02, 0x02, 0x01, 0x09, 0x00, 0x02, /* ........ */ +0x01, 0x65, 0x30, 0x10, 0x06, 0x0a, 0x2b, 0x06, /* .e0...+. */ +0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x0a, 0x00, /* ........ */ +0x02, 0x02, 0x01, 0x41 /* ...A */ +}; + +int trap_v3_nosec_size = 218; + +/************************************************************/ + +unsigned char get_next_request_packet[39] = { +0x30, 0x25, 0x02, 0x01, 0x01, 0x04, /* ..0%.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x65, 0xa1, /* .publie. */ +0x18, 0x02, 0x01, 0x20, 0x02, 0x01, 0x00, 0x02, /* ... .... */ +0x01, 0x00, 0x30, 0x0d, 0x30, 0x0b, 0x06, 0x07, /* ..0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x05, /* +....... */ +0x00 /* . */ +}; +int get_next_request_size = 39; + +unsigned char get_bulk_request_packet[40] = { +0x30, 0x26, 0x02, 0x01, 0x01, 0x04, /* ..0&.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x65, 0xa5, /* .publie. */ +0x19, 0x02, 0x01, 0x21, 0x02, 0x01, 0x00, 0x02, /* ...!.... */ +0x01, 0x64, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x08, /* .d0.0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x0b, 0x1e, 0x00, /* +....... */ +0x05, 0x00 /* .. */ +}; + +int get_bulk_request_size = 40; + + +/************************************************************/ + +unsigned char get_next_request_v1_packet[293] = { +0x30, 0x82, 0x01, 0x21, 0x02, 0x01, /* ."0..!.. */ +0x00, 0x04, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, /* ...publi */ +0x63, 0xa1, 0x82, 0x01, 0x12, 0x02, 0x02, 0x17, /* c....... */ +0x61, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, /* a......0 */ +0x82, 0x01, 0x04, 0x30, 0x0b, 0x06, 0x07, 0x2b, /* ...0...+ */ +0x06, 0x01, 0x02, 0x01, 0x04, 0x01, 0x05, 0x00, /* ........ */ +0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, /* 0...+... */ +0x01, 0x04, 0x02, 0x05, 0x00, 0x30, 0x0b, 0x06, /* .....0.. */ +0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x03, /* .+...... */ +0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, /* ..0...+. */ +0x01, 0x02, 0x01, 0x04, 0x04, 0x05, 0x00, 0x30, /* .......0 */ +0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, /* ...+.... */ +0x04, 0x05, 0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, /* ....0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x06, 0x05, /* +....... */ +0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, /* .0...+.. */ +0x02, 0x01, 0x04, 0x07, 0x05, 0x00, 0x30, 0x0b, /* ......0. */ +0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, /* ..+..... */ +0x08, 0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, /* ...0...+ */ +0x06, 0x01, 0x02, 0x01, 0x04, 0x09, 0x05, 0x00, /* ........ */ +0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, /* 0...+... */ +0x01, 0x04, 0x0a, 0x05, 0x00, 0x30, 0x0b, 0x06, /* .....0.. */ +0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x0b, /* .+...... */ +0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, /* ..0...+. */ +0x01, 0x02, 0x01, 0x04, 0x0c, 0x05, 0x00, 0x30, /* .......0 */ +0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, /* ...+.... */ +0x04, 0x0d, 0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, /* ....0... */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x0e, 0x05, /* +....... */ +0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, /* .0...+.. */ +0x02, 0x01, 0x04, 0x0f, 0x05, 0x00, 0x30, 0x0b, /* ......0. */ +0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, /* ..+..... */ +0x10, 0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, /* ...0...+ */ +0x06, 0x01, 0x02, 0x01, 0x04, 0x11, 0x05, 0x00, /* ........ */ +0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, 0x01, 0x02, /* 0...+... */ +0x01, 0x04, 0x12, 0x05, 0x00, 0x30, 0x0b, 0x06, /* .....0.. */ +0x07, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x13, /* .+...... */ +0x05, 0x00, 0x30, 0x0b, 0x06, 0x07, 0x2b, 0x06, /* ..0...+. */ +0x01, 0x02, 0x01, 0x04, 0x17, 0x05, 0x00 /* ....... */ +}; + +int get_next_request_v1_size = 293; + + +/* Frame (83 bytes) */ +unsigned char getbulk_request_v2_packet[41] = { +0x30, 0x27, 0x02, 0x01, 0x01, 0x04, /* ..0'.... */ +0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa5, /* .public. */ +0x1a, 0x02, 0x02, 0x00, 0xb4, 0x02, 0x01, 0x00, /* ........ */ +0x02, 0x01, 0x1e, 0x30, 0x0e, 0x30, 0x0c, 0x06, /* ...0.0.. */ +0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x0b, 0x0f, /* .+...... */ +0x00, 0x05, 0x00 /* ... */ +}; + +int getbulk_request_v2_size = 41; + +/* Get request 1.3.6.1.4.1.51000.1.4.0 */ +unsigned char get_request_v1_1234_packet[] = { +0x30, 0x2c, 0x02, 0x01, 0x00, 0x04, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, 0x1f, 0x02, +0x04, 0x48, 0xcc, 0x8f, 0xd9, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x11, 0x30, 0x0f, 0x06, +0x0b, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x83, 0x8e, 0x38, 0x01, 0x04, 0x00, 0x05, 0x00, +}; + +int get_request_v1_1234_packet_size = sizeof(get_request_v1_1234_packet); + + + +/* Frame (1514 bytes) */ +unsigned char v1_buffer_overwrite_packet1[1514] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0xdc, 0x6f, 0x35, 0x20, 0x00, 0x80, 0x11, /* ..o5 ... */ +0xaa, 0x5f, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xf2, 0xaa, 0x00, 0xa1, 0x05, 0xdc, /* ........ */ +0x2f, 0x3c, 0x30, 0x40, 0x02, 0x01, 0x00, 0x04, /* /<0@.... */ +0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, /* .usernam */ +0x65, 0xa0, 0x00, 0x02, 0x1b, 0x00, 0x00, 0x00, /* e....... */ +0xc0, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* .AAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x84, /* ......0. */ +0x01, 0xff, 0xff, 0xff, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0e, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x05, 0x00, /* ........ */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82 /* .. */ +}; + +int v1_buffer_overwrite_packet1_size = sizeof(v1_buffer_overwrite_packet1); + +/* Frame (54 bytes) */ +unsigned char v1_buffer_overwrite_packet2[54] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x00, 0x28, 0x6f, 0x35, 0x00, 0xb9, 0x80, 0x11, /* .(o5.... */ +0xcf, 0x5a, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x01, 0x06, 0x82, 0x00, 0x08 /* ...... */ +}; + +int v1_buffer_overwrite_packet2_size = sizeof(v1_buffer_overwrite_packet2); + +/* Frame (1421 bytes) */ /* MSRC 81075, _nx_snmp_utility_object_id_set(). */ +unsigned char v1_buffer_overwrite_packet3[1421] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0x7f, 0x6a, 0x35, 0x00, 0x00, 0x80, 0x11, /* ..j5.... */ +0xcf, 0xbc, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xef, 0x9e, 0x00, 0xa1, 0x05, 0x6b, /* .......k */ +0xdf, 0x2c, 0x30, 0x40, 0x02, 0x01, 0x00, 0x04, /* ..0@.... */ +0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, /* .usernam */ +0x65, 0xa3, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, /* e....... */ +0xc0, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, /* .......0 */ +0x84, 0x00, 0x00, 0x05, 0x40, 0x30, 0x16, 0x06, /* ....@0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x0d, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x07, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x30, 0x07, 0x06, 0x02, /* ....0... */ +0x2b, 0x06, 0x06, 0x00, 0x40 /* +...@ */ +}; + +int v1_buffer_overwrite_packet3_size = sizeof(v1_buffer_overwrite_packet3); + +unsigned char v1_buffer_overwrite_packet4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x15, 0x5d, 0x64, 0x68, 0x04, 0x08, 0x00, 0x45, 0x00, +0x01, 0x59, 0x41, 0x92, 0x00, 0x00, 0x80, 0x11, 0xfc, 0x85, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, +0x10, 0x11, 0xcd, 0x85, 0x00, 0xa1, 0x01, 0x45, 0x00, 0x00, 0x30, 0x40, 0x02, 0x01, 0x00, 0x04, +0x82, 0x00, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0xa3, 0x00, 0x02, 0x04, 0x00, +0x00, 0x00, 0xc0, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x84, 0x00, 0x00, 0x02, 0x00, 0x30, +0x84, 0x00, 0x00, 0x01, 0x02, 0x06, 0x82, 0x00, 0x0a, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x03, 0x01, +0x01, 0x02, 0x00, 0x04, 0x82, 0x00, 0xf0, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, +0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x30, 0x0e, 0x06, 0x82, 0x00, 0x0a, 0x2b, 0x06, 0x01, +0x02, 0x01, 0x03, 0x01, 0x01, 0x02, 0x00, +}; + +int v1_buffer_overwrite_packet4_size = sizeof(v1_buffer_overwrite_packet4); + + +/* Frame (1421 bytes) */ +unsigned char v1_double_release_packet[1421] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0x7f, 0x6a, 0x35, 0x00, 0x00, 0x80, 0x11, /* ..j5.... */ +0xcf, 0xbc, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xef, 0x9e, 0x00, 0xa1, 0x05, 0x6b, /* .......k */ +0xdf, 0x2b, 0x30, 0x40, 0x02, 0x01, 0x00, 0x04, /* ..0@.... */ +0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, /* .usernam */ +0x65, 0xa3, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, /* e....... */ +0xc0, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, /* .......0 */ +0x84, 0x00, 0x00, 0x05, 0x40, 0x30, 0x16, 0x06, /* ....@0.. */ +0x02, 0x2b, 0x06, 0x07, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x0d, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x07, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x30, 0x07, 0x06, 0x02, /* ....0... */ +0x2b, 0x06, 0x06, 0x00, 0x40 /* +...@ */ +}; + +int v1_double_release_packet_size = sizeof(v1_double_release_packet); + +/* Frame (1421 bytes) */ /* _nx_snmp_utility_object_id_set(). */ +unsigned char v1_object_id_buffer_overwrite_packet[1422] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0x80, 0x6a, 0x35, 0x00, 0x00, 0x80, 0x11, /* ..j5.... */ +0xcf, 0xbb, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xef, 0x9e, 0x00, 0xa1, 0x05, 0x6b, /* .......k */ +0xdf, 0x2b, 0x30, 0x40, 0x02, 0x01, 0x00, 0x04, /* ..0@.... */ +0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, /* .usernam */ +0x65, 0xa3, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, /* e....... */ +0xc0, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, /* .......0 */ +0x84, 0x00, 0x00, 0x05, 0x40, 0x30, 0x16, 0x06, /* ....@0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x16, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x10, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* ........ */ +0x00, 0x01, 0x02, 0x03, 0x04, 0x30, 0x0d, 0x06, /* .....0.. */ +0x02, 0x2b, 0x06, 0x06, 0x07, 0x2b, 0x06, 0x01, /* .+...+.. */ +0x02, 0x03, 0x04, 0x05, 0x30, 0x07, 0x06, 0x02, /* ....0... */ +0x2b, 0x06, 0x06, 0x00, 0x40, 0x00 /* +...@ */ +}; + +int v1_object_id_buffer_overwrite_packet_size = sizeof(v1_object_id_buffer_overwrite_packet); + +/* Frame (1514 bytes) */ +unsigned char v2_buffer_overwrite_packet1[1514] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0xdc, 0x6f, 0x32, 0x20, 0x00, 0x80, 0x11, /* ..o2 ... */ +0xaa, 0x62, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xd1, 0xbe, 0x00, 0xa1, 0x05, 0xdc, /* ........ */ +0x4e, 0x28, 0x30, 0x40, 0x02, 0x01, 0x02, 0x04, /* N(0@.... */ +0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, /* .usernam */ +0x65, 0xa0, 0x00, 0x02, 0x1b, 0x00, 0x00, 0x00, /* e....... */ +0xc0, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* .AAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x84, /* ......0. */ +0x01, 0xff, 0xff, 0xff, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0e, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x05, 0x00, /* ........ */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82 /* .. */ +}; + +int v2_buffer_overwrite_packet1_size = sizeof(v2_buffer_overwrite_packet1); + +/* Frame (54 bytes) */ +unsigned char v2_buffer_overwrite_packet2[54] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x00, 0x28, 0x6f, 0x32, 0x00, 0xb9, 0x80, 0x11, /* .(o2.... */ +0xcf, 0x5d, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x01, 0x06, 0x82, 0x00, 0x08 /* ...... */ +}; + +int v2_buffer_overwrite_packet2_size = sizeof(v2_buffer_overwrite_packet2); + +/* Frame (1514 bytes) */ +unsigned char v3_buffer_overwrite_packet1[1514] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0xdc, 0x04, 0xf6, 0x20, 0x00, 0x80, 0x11, /* .... ... */ +0x14, 0x9f, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xed, 0x5f, 0x00, 0xa1, 0x05, 0xdc, /* ..._.... */ +0xb2, 0xa7, 0x30, 0x40, 0x02, 0x01, 0x03, 0x30, /* ..0@...0 */ +0x40, 0x02, 0x04, 0x00, 0x00, 0x00, 0xc0, 0x02, /* @....... */ +0x04, 0x00, 0x00, 0x00, 0xc1, 0x04, 0x01, 0x00, /* ........ */ +0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x04, 0x01, /* ........ */ +0x30, 0x43, 0x04, 0x09, 0x80, 0x00, 0x03, 0x10, /* 0C...... */ +0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, 0x04, 0x00, /* ...d.... */ +0x00, 0x00, 0xc4, 0x02, 0x04, 0x00, 0x00, 0x00, /* ........ */ +0xc5, 0x04, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, /* ...usern */ +0x61, 0x6d, 0x65, 0x04, 0x02, 0x78, 0x33, 0x04, /* ame..x3. */ +0x02, 0x78, 0x34, 0x30, 0x41, 0x04, 0x02, 0x78, /* .x40A..x */ +0x35, 0x04, 0x02, 0x78, 0x36, 0xa0, 0x00, 0x02, /* 5..x6... */ +0x1f, 0x00, 0x00, 0x00, 0xc6, 0x41, 0x41, 0x41, /* .....AAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x30, 0x84, /* ......0. */ +0x01, 0xff, 0xff, 0xff, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0e, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x05, 0x00, /* ........ */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82 /* .. */ +}; + +int v3_buffer_overwrite_packet1_size = sizeof(v3_buffer_overwrite_packet1); + +/* Frame (54 bytes) */ +unsigned char v3_buffer_overwrite_packet2[54] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x00, 0x28, 0x04, 0xf6, 0x00, 0xb9, 0x80, 0x11, /* .(o2.... */ +0x39, 0x9a, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x01, 0x06, 0x82, 0x00, 0x08 /* ...... */ +}; + +int v3_buffer_overwrite_packet2_size = sizeof(v3_buffer_overwrite_packet2); + +/* Frame (1514 bytes) */ +unsigned char v3_decrypt_pdu_buffer_overwrite_packet1[1514] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0xdc, 0x6f, 0x37, 0x20, 0x00, 0x80, 0x11, /* ..o7 ... */ +0xaa, 0x5d, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xfc, 0xed, 0x00, 0xa1, 0x05, 0xdc, /* ........ */ +0x5c, 0x9e, 0x30, 0x40, 0x02, 0x01, 0x03, 0x30, /* \.0@...0 */ +0x41, 0x02, 0x04, 0x00, 0x00, 0x00, 0xa2, 0x02, /* A....... */ +0x04, 0x00, 0x00, 0x00, 0xa3, 0x04, 0x01, 0x02, /* ........ */ +0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x04, 0xcc, /* ........ */ +0x30, 0x44, 0x04, 0x00, 0x02, 0x04, 0x00, 0x00, /* 0D...... */ +0x00, 0xa5, 0x02, 0x04, 0x00, 0x00, 0x00, 0xa6, /* ........ */ +0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x82, /* ........ */ +0x05, 0xa0, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* ..zzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a /* zz */ +}; + +int v3_decrypt_pdu_buffer_overwrite_packet1_size = sizeof(v3_decrypt_pdu_buffer_overwrite_packet1); + +/* Frame (54 bytes) */ +unsigned char v3_decrypt_pdu_buffer_overwrite_packet2[54] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x00, 0x28, 0x6f, 0x37, 0x00, 0xb9, 0x80, 0x11, /* .(o7.... */ +0xcf, 0x58, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* ..zzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a, /* zzzzzzzz */ +0x7a, 0x7a, 0x7a, 0x7a, 0x7a, 0x7a /* zzzzzz */ +}; + +int v3_decrypt_pdu_buffer_overwrite_packet2_size = sizeof(v3_decrypt_pdu_buffer_overwrite_packet2); + +/* Frame (165 bytes) */ +unsigned char v3_encrypt_pdu_buffer_overwrite_packet1[187] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x00, 0xad, 0x04, 0xfb, 0x00, 0x00, 0x80, 0x11, /* ........ */ +0x39, 0xc9, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xf8, 0x7e, 0x00, 0xa1, 0x00, 0x99, /* ...~.... */ +0x42, 0xd1, 0x30, 0x40, 0x02, 0x01, 0x03, 0x30, /* .&0@...0 */ +0x40, 0x02, 0x04, 0x00, 0x00, 0x00, 0xc0, 0x02, /* @....... */ +0x04, 0x00, 0x00, 0x00, 0xc1, 0x04, 0x01, 0x02, /* ........ */ +0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x04, 0x01, /* ........ */ +0x30, 0x43, 0x04, 0x09, 0x80, 0x00, 0x03, 0x10, /* 0C...... */ +0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, 0x04, 0x00, /* ...d.... */ +0x00, 0x00, 0xc4, 0x02, 0x04, 0x00, 0x00, 0x00, /* ........ */ +0xc5, 0x04, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, /* ...usern */ +0x61, 0x6d, 0x65, 0x04, 0x02, 0x78, 0x33, 0x04, /* ame..x3. */ +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x04, 0x10, 0x0a, 0xe5, 0x7e, 0x60, 0x3a, /* .....~`: */ +0xe5, 0x40, 0x4f, 0x94, 0x31, 0x9c, 0x18, 0x6f, /* .@O.1..o */ +0x10, 0x7d, 0x61, 0x04, 0x02, 0x78, 0x35, 0x04, /* .}a..x5. */ +0x02, 0x78, 0x36, 0xa0, 0x00, 0x02, 0x04, 0x00, /* .x6..... */ +0x00, 0x00, 0xc6, 0x02, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x30, 0x84, 0x01, 0xff, 0xff, 0xff, 0x30, /* .0.....0 */ +0x84, 0x00, 0x00, 0x00, 0x0e, 0x06, 0x82, 0x00, /* ........ */ +0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, /* .+...... */ +0x00, 0xaa, 0x00 /* ... */ +}; + +int v3_encrypt_pdu_buffer_overwrite_packet1_size = sizeof(v3_encrypt_pdu_buffer_overwrite_packet1); + +/* Frame (165 bytes) */ +unsigned char v3_encrypt_pdu_padding_buffer_overwrite_packet1[165] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x00, 0x97, 0x6a, 0x34, 0x00, 0x00, 0x80, 0x11, /* ..j4.... */ +0xd4, 0xa5, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xc8, 0xcb, 0x00, 0xa1, 0x00, 0x83, /* ........ */ +0x2c, 0xa9, 0x30, 0x79, 0x02, 0x01, 0x03, 0x30, /* .40y...0 */ +0x0e, 0x02, 0x01, 0x06, 0x02, 0x03, 0x00, 0xff, /* ........ */ +0xf0, 0x04, 0x01, 0x07, 0x02, 0x01, 0x03, 0x04, /* ........ */ +0x32, 0x30, 0x30, 0x04, 0x09, 0x80, 0x00, 0x03, /* 200..... */ +0x10, 0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, 0x01, /* ....d... */ +0x01, 0x02, 0x01, 0x0d, 0x04, 0x05, 0x6a, 0x61, /* ......ja */ +0x6e, 0x65, 0x74, 0x04, 0x0c, 0x9d, 0x1d, 0xbe, /* net..... */ +0x6b, 0xee, 0x12, 0x22, 0xcb, 0x90, 0xe8, 0x41, /* k.."...A */ +0xfc, 0x04, 0x08, 0x00, 0x00, 0x00, 0xc8, 0x00, /* ........ */ +0x00, 0x00, 0x22, 0x04, 0x30, 0x0a, 0x5a, 0x42, /* ..".0.ZB */ +0xe6, 0x83, 0xe2, 0x86, 0x36, 0x60, 0xdc, 0x19, /* ....6`.. */ +0x36, 0x8a, 0x2d, 0xd6, 0x8e, 0xee, 0x68, 0xe9, /* 6.-...h. */ +0x08, 0xa8, 0xb3, 0xea, 0x61, 0x1d, 0xf1, 0xa3, /* ....a... */ +0x19, 0xc8, 0xda, 0x90, 0x70, 0x25, 0x74, 0x84, /* ....p%t. */ +0x97, 0x48, 0xcb, 0x9a, 0x6b, 0x22, 0xd3, 0x45, /* .H..k".E */ +0xee, 0x72, 0x52, 0x38, 0x03 /* .rR8. */ +}; + +int v3_encrypt_pdu_padding_buffer_overwrite_packet1_size = sizeof(v3_encrypt_pdu_padding_buffer_overwrite_packet1); + +/* Frame (165 bytes) */ +unsigned char v3_object_id_buffer_overwrite_packet1[1514] = { +0x00, 0x00, 0x5e, 0x00, 0x01, 0x02, 0xc8, 0xd9, /* ..^..... */ +0xd2, 0x24, 0x23, 0x53, 0x08, 0x00, 0x45, 0x00, /* .$#S..E. */ +0x05, 0xdc, 0x50, 0x9e, 0x20, 0x00, 0x80, 0x11, /* ..P. ... */ +0xc8, 0xf6, 0x0a, 0xac, 0xd6, 0x3f, 0x0a, 0x80, /* .....?.. */ +0x10, 0x11, 0xd2, 0x5c, 0x00, 0xa1, 0x05, 0xdc, /* ...\.... */ +0xcb, 0x49, 0x30, 0x40, 0x02, 0x01, 0x03, 0x30, /* .I0@...0 */ +0x40, 0x02, 0x04, 0x00, 0x00, 0x00, 0xc0, 0x02, /* @....... */ +0x04, 0x00, 0x00, 0x00, 0xc1, 0x04, 0x01, 0x02, /* ........ */ +0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x04, 0x01, /* ........ */ +0x30, 0x43, 0x04, 0x09, 0x80, 0x00, 0x03, 0x10, /* 0C...... */ +0x01, 0xc0, 0xa8, 0x64, 0xaf, 0x02, 0x04, 0x00, /* ...d.... */ +0x00, 0x00, 0xc4, 0x02, 0x25, 0x00, 0x00, 0x00, /* ....%... */ +0xc5, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* .AAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, /* AAAAAAAA */ +0x41, 0x41, 0x04, 0x08, 0x75, 0x73, 0x65, 0x72, /* AA..user */ +0x6e, 0x61, 0x6d, 0x65, 0x04, 0x02, 0x78, 0x33, /* name..x3 */ +0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0x04, 0x08, 0xbc, 0x50, 0x68, 0x68, /* .....Phh */ +0x15, 0xb3, 0x2c, 0x9d, 0x04, 0x02, 0x78, 0x35, /* ..,...x5 */ +0x04, 0x02, 0x78, 0x36, 0xa0, 0x00, 0x02, 0x04, /* ..x6.... */ +0x00, 0x00, 0x00, 0xc6, 0x02, 0x01, 0x00, 0x02, /* ........ */ +0x01, 0x00, 0x30, 0x84, 0x01, 0xff, 0xff, 0xff, /* ..0..... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, /* ....+... */ +0x01, 0x01, 0x03, 0x00, 0x30, 0x84, 0x00, 0x00, /* ....0... */ +0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, 0x2b, 0x06, /* ......+. */ +0x01, 0x02, 0x01, 0x01, 0x03, 0x00, 0x30, 0x84, /* ......0. */ +0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, 0x00, 0x08, /* ........ */ +0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x03, 0x00, /* +....... */ +0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x82, /* 0....... */ +0x00, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, /* ..+..... */ +0x03, 0x00, 0x30, 0x84, 0x00, 0x00, 0x00, 0x0c, /* ..0..... */ +0x06, 0x82 /* .. */ +}; + +int v3_object_id_buffer_overwrite_packet1_size = sizeof(v3_object_id_buffer_overwrite_packet1); + diff --git a/test/regression/sntp_test/netx_sntp_client_broadcast_basic_test.c b/test/regression/sntp_test/netx_sntp_client_broadcast_basic_test.c new file mode 100644 index 00000000..62175ad5 --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_broadcast_basic_test.c @@ -0,0 +1,334 @@ +#include "nx_api.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server reply. */ + +static char pkt_data[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbb, 0xce, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0xff, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + 0x02, 0xb2, 0x25, 0x02, 0x06, 0xec, 0x00, 0x00, + 0x07, 0xdd, 0x00, 0x00, 0x06, 0x6e, 0x89, 0xbd, + 0x04, 0x0a, 0xd6, 0x4b, 0xd7, 0xeb, 0xb3, 0x25, + 0xe0, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xd6, 0x4b, 0xd8, 0x5a, 0xab, 0x25, + 0x19, 0x86 }; + +static UINT pkt_size = 90; + +static ULONG expected_seconds = 0xd64bd85a; +static ULONG expected_milliseconds = 0x2a7; +static ULONG tolerance_milliseconds = 200; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) +#define SERVER_IP_ADDRESS_2 SERVER_IP_ADDRESS + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_broadcast_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT spin; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds, microseconds, fraction; + + printf("NetX Test: NETX SNTP Client Broadcast Basic Test....................."); + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Use the IPv4 service to initialize the Client and set IPv4 SNTP broadcast address. */ + status = nx_sntp_client_initialize_broadcast(&sntp_client, NX_NULL, SERVER_IP_ADDRESS); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_broadcast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + + spin = NX_TRUE; + + /* Now check periodically for time changes. */ + while(spin) + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + if ((status == NX_SUCCESS) && (server_status == NX_TRUE)) + { + + /* Server status is good. Now get the Client local time. */ + + /* Call extended function to display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time_extended(&sntp_client, &seconds, &fraction, &buffer[0], sizeof(buffer)); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status == NX_SUCCESS) + { + if (!((seconds == expected_seconds) && (milliseconds > (expected_milliseconds - tolerance_milliseconds)) && + (milliseconds < (expected_milliseconds + tolerance_milliseconds)))) + { + error_counter++; + break; + } + } + else + { + error_counter++; + break; + } + + /* Display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &fraction, &buffer[0]); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status == NX_SUCCESS) + { + if ((seconds == expected_seconds) && (milliseconds > (expected_milliseconds - tolerance_milliseconds)) && + (milliseconds < (expected_milliseconds + tolerance_milliseconds))) + { + break; + } + else + { + error_counter++; + break; + } + } + + } + else + { + + /* Wait a short bit to check again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + } + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_broadcast_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Broadcast Basic Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_client_ipv6_broadcast_basic_test.c b/test/regression/sntp_test/netx_sntp_client_ipv6_broadcast_basic_test.c new file mode 100644 index 00000000..897162aa --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_ipv6_broadcast_basic_test.c @@ -0,0 +1,339 @@ +#include "nx_api.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server reply. */ + +static char pkt_data[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0xfe, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, + 0x29, 0xff, 0xfe, 0x1e, 0xaa, 0x4f, 0xff, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x7b, + 0x00, 0x7b, 0x00, 0x38, 0x7d, 0x9b, 0x25, 0x02, + 0x06, 0xec, 0x00, 0x00, 0x07, 0xe9, 0x00, 0x00, + 0x03, 0x09, 0x89, 0xbd, 0x04, 0x0a, 0xd6, 0x4f, + 0xad, 0x4d, 0x78, 0xae, 0xb7, 0xbc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x4f, + 0xad, 0x57, 0x70, 0x86, 0x42, 0x10 }; + + +static UINT pkt_size = 110; + +static ULONG expected_seconds = 0xd64fad57; +static ULONG expected_milliseconds = 0x1c2; +static ULONG tolerance_milliseconds = 200; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_ipv6_broadcast_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT spin; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds, microseconds, fraction; +NXD_ADDRESS sntp_server_address; +NXD_ADDRESS client_ip_address; + + printf("NetX Test: NETX SNTP Client IPv6 Broadcast Basic Test................"); + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Set up IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + + status += nxd_icmp_enable(&client_ip); + + if (status != NX_SUCCESS) + error_counter++; + + client_ip_address.nxd_ip_address.v6[0] = 0xfe800000; + client_ip_address.nxd_ip_address.v6[1] = 0x00000000; + client_ip_address.nxd_ip_address.v6[2] = 0x020c29ff; + client_ip_address.nxd_ip_address.v6[3] = 0xfe6a2e7b; + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + + /* Set the IPv6 server address. */ + sntp_server_address.nxd_ip_address.v6[0] = 0xfe800000; + sntp_server_address.nxd_ip_address.v6[1] = 0x00000000; + sntp_server_address.nxd_ip_address.v6[2] = 0x020c29ff; + sntp_server_address.nxd_ip_address.v6[3] = 0xfe1eaa4f; + sntp_server_address.nxd_ip_version = NX_IP_VERSION_V6; + + + status = nxd_ipv6_address_set(&client_ip, 0, &client_ip_address, 64, NX_NULL); + + /* Check for link local address set error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_sleep(4 * NX_IP_PERIODIC_RATE); + + status = nxd_sntp_client_initialize_broadcast(&sntp_client, &sntp_server_address, NX_NULL); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_broadcast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + + spin = NX_TRUE; + + /* Now check periodically for time changes. */ + while(spin) + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + if ((status == NX_SUCCESS) && (server_status == NX_TRUE)) + { + + /* Server status is good. Now get the Client local time. */ + + /* Display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &fraction, &buffer[0]); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status == NX_SUCCESS) + { + if ((seconds == expected_seconds) && (milliseconds > (expected_milliseconds - tolerance_milliseconds)) && + (milliseconds < (expected_milliseconds + tolerance_milliseconds))) + { + break; + } + else + { + error_counter++; + break; + } + } + + } + else + { + + /* Wait a short bit to check again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + } + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_ipv6_broadcast_basic_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NETX SNTP Client IPv6 Broadcast Basic Test................N/A\n"); + test_control_return(3); + +} +#endif + diff --git a/test/regression/sntp_test/netx_sntp_client_ipv6_unicast_basic_test.c b/test/regression/sntp_test/netx_sntp_client_ipv6_unicast_basic_test.c new file mode 100644 index 00000000..790c287a --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_ipv6_unicast_basic_test.c @@ -0,0 +1,339 @@ +#include "nx_api.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif +extern void test_control_return(UINT status); +#if defined(FEATURE_NX_IPV6) && !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server reply. */ + + +static char pkt_data[110] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0xfe, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, + 0x29, 0xff, 0xfe, 0x1e, 0xaa, 0x4f, 0xfe, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, + 0x29, 0xff, 0xfe, 0x6a, 0x2e, 0x7b, 0x00, 0x7b, + 0x00, 0x7b, 0x00, 0x38, 0x6a, 0x24, 0x1c, 0x02, + 0x00, 0xec, 0x00, 0x00, 0x07, 0xd9, 0x00, 0x00, + 0x06, 0xdf, 0x89, 0xbd, 0x04, 0x0a, 0xd6, 0x4f, + 0xa9, 0x4b, 0x78, 0x72, 0x04, 0xf2, 0xd2, 0xc9, + 0x6b, 0x90, 0xa1, 0x32, 0xdb, 0x1e, 0xd6, 0x4f, + 0xac, 0xd8, 0x9e, 0x7d, 0xc4, 0x3a, 0xd6, 0x4f, + 0xac, 0xd8, 0x9e, 0x82, 0xf1, 0x51 }; + +static UINT pkt_size = 110; + +static ULONG expected_seconds = 0xd64facd8; +static ULONG expected_milliseconds = 0x275; +static ULONG tolerance_milliseconds = 200; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_ipv6_unicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT spin; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds, microseconds, fraction; +NXD_ADDRESS sntp_server_address; +NXD_ADDRESS client_ip_address; + + printf("NetX Test: NETX SNTP Client IPv6 Unicast Basic Test.................."); + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Set up IPv6 services. */ + status = nxd_ipv6_enable(&client_ip); + + status += nxd_icmp_enable(&client_ip); + + if (status != NX_SUCCESS) + error_counter++; + + client_ip_address.nxd_ip_address.v6[0] = 0xfe800000; + client_ip_address.nxd_ip_address.v6[1] = 0x00000000; + client_ip_address.nxd_ip_address.v6[2] = 0x020c29ff; + client_ip_address.nxd_ip_address.v6[3] = 0xfe6a2e7b; + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + + /* Set the IPv6 server address. */ + sntp_server_address.nxd_ip_address.v6[0] = 0xfe800000; + sntp_server_address.nxd_ip_address.v6[1] = 0x00000000; + sntp_server_address.nxd_ip_address.v6[2] = 0x020c29ff; + sntp_server_address.nxd_ip_address.v6[3] = 0xfe1eaa4f; + sntp_server_address.nxd_ip_version = NX_IP_VERSION_V6; + + + status = nxd_ipv6_address_set(&client_ip, 0, &client_ip_address, 64, NX_NULL); + + /* Check for link local address set error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_sleep(4 * NX_IP_PERIODIC_RATE); + + /* Use the IPv4 service to initialize the Client and set the IPv4 SNTP server. */ + status = nxd_sntp_client_initialize_unicast(&sntp_client, &sntp_server_address); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_unicast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + + spin = NX_TRUE; + + /* Now check periodically for time changes. */ + while(spin) + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + if ((status == NX_SUCCESS) && (server_status == NX_TRUE)) + { + + /* Server status is good. Now get the Client local time. */ + + /* Display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &fraction, &buffer[0]); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status == NX_SUCCESS) + { + if ((seconds == expected_seconds) && (milliseconds > (expected_milliseconds - tolerance_milliseconds)) && + (milliseconds < (expected_milliseconds + tolerance_milliseconds))) + { + break; + } + else + { + error_counter++; + break; + } + } + + } + else + { + + /* Wait a short bit to check again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + } + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_ipv6_unicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: NETX SNTP Client IPv6 Unicast Basic Test..................N/A\n"); + test_control_return(3); + +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_client_kod_test.c b/test/regression/sntp_test/netx_sntp_client_kod_test.c new file mode 100644 index 00000000..a9b03587 --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_kod_test.c @@ -0,0 +1,269 @@ +#include "nx_api.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server KOD packet("DENY"). */ +static char pkt_data[90] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbc, 0xa3, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0x2a, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + 0x7f, 0xa0, 0x1c, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x00, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x44, 0x45, + 0x4e, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 }; + +static UINT pkt_size = 90; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) +#define SERVER_IP_ADDRESS_2 SERVER_IP_ADDRESS + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +static UINT kiss_of_death_test(NX_SNTP_CLIENT* client_ptr, UINT code); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_kod_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + kiss_of_death_test, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + + +static UINT kiss_of_death_test(NX_SNTP_CLIENT* client_ptr, UINT code) +{ + if (code != NX_SNTP_KOD_DENY) + { + error_counter++; + } + + return(1); +} + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +ULONG base_seconds; +ULONG base_fraction; + + printf("NetX Test: NETX SNTP Client KOD Test................................."); + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Use the IPv4 service to initialize the Client and set the IPv4 SNTP server. */ + status = nx_sntp_client_initialize_unicast(&sntp_client, SERVER_IP_ADDRESS); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_unicast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_kod_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client KOD Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_client_packet_chain_test.c b/test/regression/sntp_test/netx_sntp_client_packet_chain_test.c new file mode 100644 index 00000000..0abb3503 --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_packet_chain_test.c @@ -0,0 +1,389 @@ +#include "nx_api.h" +#include "nx_ip.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "nxd_sntp_client.h" + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server reply. */ +static char pkt_data[90] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbc, 0xa3, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0x2a, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + 0x7f, 0xa0, 0x1c, 0x02, 0x00, 0xec, 0x00, 0x00, + 0x07, 0xdd, 0x00, 0x00, 0x06, 0x6e, 0x89, 0xbd, + 0x04, 0x0a, 0xd6, 0x4b, 0xd7, 0xeb, 0xb3, 0x25, + 0xe0, 0x52, 0xd2, 0xc9, 0x6b, 0x90, 0xa1, 0x32, + 0xdb, 0x1e, 0xd6, 0x4b, 0xd8, 0x5b, 0x20, 0x27, + 0x62, 0xa4, 0xd6, 0x4b, 0xd8, 0x5b, 0x20, 0x2c, + 0x4b, 0x46 }; + +static UINT pkt_size = 90; + +static ULONG expected_seconds = 0xd64bd85b; +static ULONG expected_milliseconds = 0x88; +static ULONG tolerance_milliseconds = 200; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) +#define SERVER_IP_ADDRESS_2 SERVER_IP_ADDRESS + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT spin; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds, microseconds, fraction; +ULONG expected_fraction; +NX_PACKET *packet_ptr; + + printf("NetX Test: NETX SNTP Client Packet Chain Test........................"); + + status = nx_sntp_client_delete(&sntp_client); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Use the IPv4 service to initialize the Client and set the IPv4 SNTP server. */ + status = nx_sntp_client_initialize_unicast(&sntp_client, SERVER_IP_ADDRESS); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_unicast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + + spin = NX_TRUE; + + /* Now check periodically for time changes. */ + while(spin) + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + if ((status == NX_SUCCESS) && (server_status == NX_TRUE)) + { + + /* Server status is good. Now get the Client local time. */ + + /* Display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &fraction, &buffer[0]); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status == NX_SUCCESS) + { + if ((seconds == expected_seconds) && ((INT)milliseconds > (INT)(expected_milliseconds - tolerance_milliseconds)) && + (milliseconds < (expected_milliseconds + tolerance_milliseconds))) + { + + /* Get extended local time. */ + status = nx_sntp_client_get_local_time_extended(&sntp_client, &seconds, &fraction, &buffer[0], sizeof(buffer)); + if (status == NX_SUCCESS) + { + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + /* Compare microseconds with milliseconds. */ + if (((microseconds + 500) / 1000) != milliseconds) + { + error_counter++; + } + + /* Convert microseconds to fraction. */ + nx_sntp_client_utility_usecs_to_fraction(microseconds, &expected_fraction); + + /* Compare expected_fraction with fraction. */ + if (expected_fraction != fraction) + { + error_counter++; + } + } + else + { + error_counter++; + } + break; + } + else + { + error_counter++; + break; + } + } + + } + else + { + + /* Wait a short bit to check again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + } + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + /* Make sure the packet pool is not corrupted. */ + while (client_packet_pool.nx_packet_pool_available) + { + if (nx_packet_allocate(&client_packet_pool, &packet_ptr, 0, NX_NO_WAIT) || + (packet_ptr -> nx_packet_pool_owner != &client_packet_pool)) + { + + error_counter++; + break; + } + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* First, fill data in packet chain by setting the offset of header to the end of packet. */ + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(&client_packet_pool, &my_packet, + client_packet_pool.nx_packet_pool_payload_size - 28, /* 20 (IPv4) + UDP (8)*/ + 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + if (nx_packet_data_append(my_packet, pkt_data + 14, pkt_size - 14, + &client_packet_pool, 5 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + return; + } + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Packet Chain Test........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_client_seconds_to_date_test.c b/test/regression/sntp_test/netx_sntp_client_seconds_to_date_test.c new file mode 100644 index 00000000..e40d20eb --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_seconds_to_date_test.c @@ -0,0 +1,130 @@ +#include +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT status); + +#ifdef __linux__ +#define LOOP 1000 +#define NTP_UTC_DIFF 2208988800 +#define START_YEAR 2015 +#define START_UTC 1420075385 +#define SECONDS_TEN_YEARS 315360000 + + +extern UINT _nx_sntp_client_utility_convert_seconds_to_date(NX_SNTP_TIME *current_NTP_time_ptr, + UINT current_year, + NX_SNTP_DATE_TIME *current_date_time_ptr); +static TX_THREAD sntp_client_thread; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_seconds_to_date_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + NX_NULL, free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; +} + + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT i; +NX_SNTP_TIME sntp_time; +NX_SNTP_DATE_TIME date_time; +time_t utc; +struct tm *tm_value; + + printf("NetX Test: NETX SNTP Client Seconds To Date Test....................."); + + srand(time(0)); + sntp_time.fraction = 0; + for (i = 0; i < LOOP; i++) + { + if (i == 0) + { + sntp_time.seconds = 3818415600; /* Bug verification. */ + utc = sntp_time.seconds - NTP_UTC_DIFF; + } + else + { + utc = (rand() % SECONDS_TEN_YEARS) + START_UTC; + sntp_time.seconds = NTP_UTC_DIFF + utc; + } + + /* Convert time by by gmtime and SNTP utility. */ + tm_value = gmtime(&utc); + _nx_sntp_client_utility_convert_seconds_to_date(&sntp_time, + START_YEAR, + &date_time); + + /* Compare result. */ + if (((tm_value -> tm_year + 1900) != date_time.year) || + ((tm_value -> tm_mon + 1) != date_time.month) || + (tm_value -> tm_mday != date_time.day) || + (tm_value -> tm_hour != date_time.hour) || + (tm_value -> tm_min != date_time.minute) || + (tm_value -> tm_sec != date_time.second) || + (date_time.millisecond != 0)) + { + error_counter++; + break; + } + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_seconds_to_date_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Seconds To Date Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_client_unicast_basic_test.c b/test/regression/sntp_test/netx_sntp_client_unicast_basic_test.c new file mode 100644 index 00000000..d3b08f0d --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_unicast_basic_test.c @@ -0,0 +1,355 @@ +#include "nx_api.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server reply. */ +static char pkt_data[90] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbc, 0xa3, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0x2a, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + 0x7f, 0xa0, 0x1c, 0x02, 0x00, 0xec, 0x00, 0x00, + 0x07, 0xdd, 0x00, 0x00, 0x06, 0x6e, 0x89, 0xbd, + 0x04, 0x0a, 0xd6, 0x4b, 0xd7, 0xeb, 0xb3, 0x25, + 0xe0, 0x52, 0xd2, 0xc9, 0x6b, 0x90, 0xa1, 0x32, + 0xdb, 0x1e, 0xd6, 0x4b, 0xd8, 0x5b, 0x20, 0x27, + 0x62, 0xa4, 0xd6, 0x4b, 0xd8, 0x5b, 0x20, 0x2c, + 0x4b, 0x46 }; + +static UINT pkt_size = 90; + +static ULONG expected_seconds = 0xd64bd85b; +static ULONG expected_milliseconds = 0x88; +static ULONG tolerance_milliseconds = 200; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) +#define SERVER_IP_ADDRESS_2 SERVER_IP_ADDRESS + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_unicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT spin; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds, microseconds, fraction; +ULONG expected_fraction; + + printf("NetX Test: NETX SNTP Client Unicast Basic Test......................."); + + status = nx_sntp_client_delete(&sntp_client); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Use the IPv4 service to initialize the Client and set the IPv4 SNTP server. */ + status = nx_sntp_client_initialize_unicast(&sntp_client, SERVER_IP_ADDRESS); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_unicast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + + spin = NX_TRUE; + + /* Now check periodically for time changes. */ + while(spin) + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + if ((status == NX_SUCCESS) && (server_status == NX_TRUE)) + { + + /* Server status is good. Now get the Client local time. */ + + /* Display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &fraction, &buffer[0]); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status == NX_SUCCESS) + { + if ((seconds == expected_seconds) && ((INT)milliseconds > (INT)(expected_milliseconds - tolerance_milliseconds)) && + (milliseconds < (expected_milliseconds + tolerance_milliseconds))) + { + + /* Get extended local time. */ + status = nx_sntp_client_get_local_time_extended(&sntp_client, &seconds, &fraction, &buffer[0], sizeof(buffer)); + if (status == NX_SUCCESS) + { + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + /* Compare microseconds with milliseconds. */ + if (((microseconds + 500) / 1000) != milliseconds) + { + error_counter++; + } + + /* Convert microseconds to fraction. */ + nx_sntp_client_utility_usecs_to_fraction(microseconds, &expected_fraction); + + /* Compare expected_fraction with fraction. */ + if (expected_fraction != fraction) + { + error_counter++; + } + } + else + { + error_counter++; + } + break; + } + else + { + error_counter++; + break; + } + } + + } + else + { + + /* Wait a short bit to check again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + } + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_unicast_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Unicast Basic Test.......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_client_unicast_display_date_test.c b/test/regression/sntp_test/netx_sntp_client_unicast_display_date_test.c new file mode 100644 index 00000000..16b44e1d --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_client_unicast_display_date_test.c @@ -0,0 +1,361 @@ +#include "nx_api.h" +#include "nx_ip.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT status); +#if !defined(NX_DISABLE_IPV4) +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* NTP server reply. */ +static char pkt_data[90] = { + + /* Ethernet header */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, + + /* IP layer */ + 0x45, 0x00, 0x00, 0x4c, + 0x00, 0x00, 0x40, 0x00, + 0x40, 0x11, 0xbc, 0xa3, + 0xc0, 0xa8, 0x7e, 0x82, + 0xc0, 0xa8, 0x7e, 0x2a, + + /* UDP header */ + 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, 0x28, 0x3f, + + /* SNTP data */ + 0x1c, // flags was 28 which= server mode 4 and version 3 + 0x2, // stratum + 0x3, // poll interval + 0xf9, // clock precision + 0x0, 0x0,0x4,0x23, // root delay + 0x0, 0x0,0x8,0xf3, // root dispersion + 0x82,0x95,0x11,0x8, // ref ID + + /* for March 30, 2017, 16:14:23.665 */ + 0xdc,0x87,0xab,0xc1, 0x16,0xe4,0xbc,0x59, // ref timestamp + + 0xdc,0x87,0xad,0x5f, 0xa7,0x00,0x68,0x0, // origin timestamp + + 0xdc,0x87,0xad,0x5f, 0xa7,0xc9,0xfd,0x90, // receive timestamp + + 0xdc,0x87,0xad,0x5f, 0xa7,0xcc,0x42,0x36 +}; + +static UINT pkt_size = 90; + + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static NX_SNTP_CLIENT sntp_client; + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) +#define SERVER_IP_ADDRESS_2 SERVER_IP_ADDRESS + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); + +static void inject_sntp_server_reply(); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_unicast_display_date_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* If 1000 ticks per second, the precision should be 1ms. */ +#if (NX_IP_PERIODIC_RATE == 1000) +#define EXPECTED_DATE0 "Mar 30, 2017 16:14:23.655 UTC " +#define EXPECTED_DATE1 "Mar 30, 2017 16:14:23.656 UTC " +#define EXPECTED_DATE2 "Mar 30, 2017 16:14:23.657 UTC " +#define EXPECTED_DATE3 "Mar 30, 2017 16:14:23.658 UTC " +#define EXPECTED_DATE4 "Mar 30, 2017 16:14:23.659 UTC " +#define EXPECTED_DATE5 "Mar 30, 2017 16:14:23.660 UTC " +#define EXPECTED_DATE6 "Mar 30, 2017 16:14:23.661 UTC " +#else +#define EXPECTED_DATE0 "Mar 30, 2017 16:14:23.655 UTC " +#define EXPECTED_DATE1 "Mar 30, 2017 16:14:23.665 UTC " +#define EXPECTED_DATE2 "Mar 30, 2017 16:14:23.675 UTC " +#define EXPECTED_DATE3 "Mar 30, 2017 16:14:23.685 UTC " +#define EXPECTED_DATE4 "Mar 30, 2017 16:14:23.695 UTC " +#define EXPECTED_DATE5 "Mar 30, 2017 16:14:23.705 UTC " +#define EXPECTED_DATE6 "Mar 30, 2017 16:14:23.715 UTC " +#endif + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds; +UINT loops; +UINT display_done = NX_FALSE; + + + printf("NetX Test: NETX SNTP Client Unicast Display Date Test................"); + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + /* Use the IPv4 service to initialize the Client and set the IPv4 SNTP server. */ + status = nx_sntp_client_initialize_unicast(&sntp_client, SERVER_IP_ADDRESS); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Set the base time which is quite old but should suffice. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_run_unicast(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + inject_sntp_server_reply(); + loops = 0; + do + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + if ((status == NX_SUCCESS) && (server_status == NX_TRUE)) + { + + /* Server status is good. Now get the Client local time. */ + + /* Display the local time in years, months, date format. */ + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &milliseconds, &buffer[0]); + + if (status == NX_SUCCESS) + { + + status = nx_sntp_client_utility_display_date_time(&sntp_client, &buffer[0], BUFSIZE); + + if (status != NX_SUCCESS) + { + error_counter++; + } + else + { + if (!memcmp(&buffer[0], EXPECTED_DATE0, strlen(EXPECTED_DATE0)) || + !memcmp(&buffer[0], EXPECTED_DATE1, strlen(EXPECTED_DATE0)) || + !memcmp(&buffer[0], EXPECTED_DATE2, strlen(EXPECTED_DATE0)) || + !memcmp(&buffer[0], EXPECTED_DATE3, strlen(EXPECTED_DATE0)) || + !memcmp(&buffer[0], EXPECTED_DATE4, strlen(EXPECTED_DATE0)) || + !memcmp(&buffer[0], EXPECTED_DATE5, strlen(EXPECTED_DATE0)) || + !memcmp(&buffer[0], EXPECTED_DATE6, strlen(EXPECTED_DATE0))) + { + + display_done = NX_TRUE; + break; + } + else + { +printf("date: %s.\n", buffer); + error_counter++; + } + } + } + + } + else + { + + /* Wait a short bit to check again. */ + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + } + + loops++; + + } while((loops < 4) && (display_done == NX_FALSE)); + + /* We can stop the SNTP service if for example we think the SNTP service has stopped. */ + status = nx_sntp_client_stop(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + status = nx_sntp_client_delete(&sntp_client); + + if (status != NX_SUCCESS) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +void inject_sntp_server_reply() +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 5 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_client_unicast_display_date_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Unicast Display Date Test................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/sntp_test/netx_sntp_forward_unicast_update_test.c b/test/regression/sntp_test/netx_sntp_forward_unicast_update_test.c new file mode 100644 index 00000000..16582cf2 --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_forward_unicast_update_test.c @@ -0,0 +1,322 @@ +/* + netx_sntp_forward_unicast_update_test.c + + This demonstrates the time update notify feature in NetX SNTP Client. The Client + connects to the SNTP server in unicast mode (simulated server) and sends a unicast + request. If a valid reply is received, the time update notify callback should be called + for a successful completion. + + */ + + +#include +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT result); + +#if !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) + +/* Set up generic network driver for demo program. */ +void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Application defined services of the NetX SNTP Client. */ + +UINT leap_second_handler(NX_SNTP_CLIENT *client_ptr, UINT leap_indicator); +VOID client_time_update_notify(NX_SNTP_TIME_MESSAGE *time_update_ptr, NX_SNTP_TIME *local_time); +static void inject_sntp_server_reply(char *pkt_data, UINT size); + +static UINT time_updates_received = 0; +static UINT error_counter = 0; + + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD demo_client_thread; +static NX_SNTP_CLIENT demo_client; + +/* NTP server reply. */ +static char broadcast_data_1[90] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbc, 0xa3, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0x2a, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + 0x7f, 0xa0, 0x1c, 0x02, 0x00, 0xec, 0x00, 0x00, + 0x07, 0xdd, 0x00, 0x00, 0x06, 0x6e, + 0x89, 0xbd, 0x04, 0x0a, + 0xd6, 0x4b, 0xd7, 0xeb, + 0xb3, 0x25, 0xe0, 0x52, + 0xd2, 0xc9, 0x6b, 0x90, + 0xa1, 0x32, 0xdb, 0x1e, + 0xd6, 0x4b, 0xd8, 0x5b, + 0x20, 0x27, 0x62, 0xa4, + 0xd6, 0x4b, 0xd8, 0x5b, + 0x20, 0x2c, 0x4b, 0x46 + }; + + +static UINT pkt1_size = 90; + + + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) + + +/* Set up client thread entry point. */ +void demo_client_thread_entry(ULONG info); + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_forward_unicast_update_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver, //_nx_ram_network_driver, + free_memory_pointer, 2048, 1); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + free_memory_pointer = free_memory_pointer + 2048; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 2048; + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + status |= nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + /* Create the client thread */ + status = tx_thread_create(&demo_client_thread, "SNTP Client Thread", demo_client_thread_entry, + (ULONG)(&demo_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + + /* Check for errors */ + if (status != TX_SUCCESS) + { + + error_counter++; + } + + /* Update pointer to unallocated (free) memory. */ + free_memory_pointer = free_memory_pointer + 2048; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&demo_client, &client_ip, 0, &client_packet_pool, + leap_second_handler, + NULL,/* no kiss of death handler */ + NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + error_counter++; + } + + tx_thread_resume(&demo_client_thread); + + return; +} + + +/* Define the client thread. */ +void demo_client_thread_entry(ULONG info) +{ + +UINT status; + + + printf("NetX Test: NETX SNTP Client Time Update Notify Test.................."); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(20); + + status = nx_sntp_client_set_time_update_notify(&demo_client, client_time_update_notify); + + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Set up client time updates. */ + + /* Initialize the Client for unicast mode to poll the SNTP server once an hour. */ + /* Use the IPv4 service to set up the Client and set the IPv4 SNTP server. */ + status = nx_sntp_client_initialize_unicast(&demo_client, SERVER_IP_ADDRESS); + + + /* Check for error. */ + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_sntp_client_run_unicast(&demo_client); + + if (status != NX_SUCCESS) + { + + printf("ERROR!\n"); + test_control_return(1); + } + + /* Receive the server response. */ + inject_sntp_server_reply(broadcast_data_1, pkt1_size); + + tx_thread_sleep(100); + + /* To return resources to NetX and ThreadX stop the SNTP client and delete the client instance. */ + status = nx_sntp_client_delete(&demo_client); + + if (status != NX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if (error_counter || (time_updates_received != 1)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/* This application defined handler for handling an impending leap second is not + required by the SNTP Client. The default handler below only logs the event for + every time stamp received with the leap indicator set. */ + +UINT leap_second_handler(NX_SNTP_CLIENT *client_ptr, UINT leap_indicator) +{ + + /* Handle the leap second handler... */ + + return NX_SUCCESS; +} + +void inject_sntp_server_reply(char *pkt_data, UINT size) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Allocate the packet and let the client IP stack receive it. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Load the data simulating the server reply */ + my_packet -> nx_packet_length = size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + /* Send to the Client stack*/ + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} + +VOID client_time_update_notify(NX_SNTP_TIME_MESSAGE *time_update_ptr, NX_SNTP_TIME *local_time) +{ + + time_updates_received++; + return; +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_forward_unicast_update_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Time Update Notify Test..................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/sntp_test/netx_sntp_request_unicast_test.c b/test/regression/sntp_test/netx_sntp_request_unicast_test.c new file mode 100644 index 00000000..083299a9 --- /dev/null +++ b/test/regression/sntp_test/netx_sntp_request_unicast_test.c @@ -0,0 +1,419 @@ +/* + netx_sntp_request_unicast_rest.c + + This test tests that the nx_sntp_client_request_unicast_time service sends an asynchronous unicast + SNTP request independently of the SNTP CLient periodic polling of the SNTP server. It also verifies + that the SNTP Client when it receives the server response correctly updates the local clock. + + Note that for this test to work correctly, the following configuration option must be defined in the + preprocessor options: + + #define NX_SNTP_CLIENT_MIN_TIME_ADJUSTMENT 1000 +*/ + +#include "nx_api.h" +#include "nx_ip.h" +#include +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_sntp_client.h" +#else +#include "nx_sntp_client.h" +#endif + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) + +/* Define SNTP packet size. */ +#define NX_SNTP_CLIENT_PACKET_SIZE (NX_UDP_PACKET + 100) + +/* Define SNTP packet pool size. */ +#ifdef __PRODUCT_NETXDUO__ +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET) + NX_PACKET_ALIGNMENT)) +#else +#define NX_SNTP_CLIENT_PACKET_POOL_SIZE (4 * (NX_SNTP_CLIENT_PACKET_SIZE + sizeof(NX_PACKET))) +#endif + +/* NTP server reply. */ +static char pkt_data[90] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbc, 0xa3, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0x2a, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + /* checksum*/ + 0x7f, 0xa0, +/* start of NTP word */ + /* stratum*//* peer_clock_precision*/ + 0x1c, 0x02, 0x00, 0xec, + /* root delay*/ + 0x00, 0x00, 0x07, 0xdd, + /* clock dispersion */ + 0x00, 0x00, 0x06, 0x6e, + 0x89, 0xbd, 0x04, 0x0a, + 0xd6, 0x4b, 0xd7, 0xeb, + 0xb3, 0x25, 0xe0, 0x52, + 0xd2, 0xc9, 0x6b, 0x90, + 0xa1, 0x32, 0xdb, 0x1e, + 0xd6, 0x4b, 0xd8, 0x5b, + 0x20, 0x27, 0x62, 0xa4, + /* seconds */ + 0xd6, 0x4b, 0xd8, 0x5b, + /* fraction */ + 0x20, 0x2c, 0x4b, 0x46 }; + +static UINT pkt_size = 90; + + +static char pkt_data_asynch[90] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0x00, 0x0c, + 0x29, 0x1e, 0xaa, 0x4f, 0x08, 0x00, 0x45, 0x00, + 0x00, 0x4c, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, + 0xbc, 0xa3, 0xc0, 0xa8, 0x7e, 0x82, 0xc0, 0xa8, + 0x7e, 0x2a, 0x00, 0x7b, 0x00, 0x7b, 0x00, 0x38, + /* checksum*/ + 0x7f, 0x9f, + /* stratum*//* peer_clock_precision*/ + 0x1c, 0x02, 0x00, 0xec, + /* root delay*/ + 0x00, 0x00, 0x07, 0xdd, + /* clock dispersion */ + 0x00, 0x00, 0x06, 0x6e, + 0x89, 0xbd, 0x04, 0x0a, + 0xd6, 0x4b, 0xd7, 0xeb, + 0xb3, 0x25, 0xe0, 0x52, + 0xd2, 0xc9, 0x6b, 0x90, + 0xa1, 0x32, 0xdb, 0x1e, + 0xd6, 0x4b, 0xd8, 0x5b, + 0x20, 0x27, 0x62, 0xa4, + /* seconds */ + 0xd6, 0x4b, 0xd8, 0x5c, + /* fraction */ + 0x20, 0x2c, 0x4b, 0x46 +}; + +static UINT pkt_size_asynch = 90; + + +static ULONG expected_seconds_asynch = 0xd64bd85c; +static ULONG expected_milliseconds_asynch = 0x88; +static ULONG tolerance_milliseconds_asynch = 20; + +static UINT send_unicast = NX_FALSE; +static UINT asynch_unicast_processed = NX_FALSE; + +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +/* Set up client thread and network resources. */ + +static NX_PACKET_POOL client_packet_pool; +static NX_IP client_ip; +static TX_THREAD sntp_client_thread; +static TX_THREAD sntp_server_thread; +static NX_SNTP_CLIENT sntp_client; +static NX_SNTP_CLIENT sntp_server; + +#define CLIENT_IP_ADDRESS IP_ADDRESS(192,168,126,42) +#define SERVER_IP_ADDRESS IP_ADDRESS(192,168,126,130) +#define SERVER_IP_ADDRESS_2 SERVER_IP_ADDRESS + +/* Set up the SNTP network and address index; */ +static UINT iface_index; + +static UINT error_counter; + +/* Set up client thread entry point. */ +static void sntp_client_thread_entry(ULONG info); +static void sntp_server_thread_entry(ULONG info); +static void inject_sntp_server_reply(char *pkt_data, UINT size); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_request_unicast_test_application_define(void * first_unused_memory) +#endif +{ + +UINT status; +UCHAR *free_memory_pointer; + + error_counter = 0; + + free_memory_pointer = (UCHAR *)first_unused_memory; + + /* Create client packet pool. */ + status = nx_packet_pool_create(&client_packet_pool, "SNTP Client Packet Pool", + NX_SNTP_CLIENT_PACKET_SIZE, free_memory_pointer, + NX_SNTP_CLIENT_PACKET_POOL_SIZE); + free_memory_pointer = free_memory_pointer + NX_SNTP_CLIENT_PACKET_POOL_SIZE; + + /* Check for errors. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Create Client IP instances */ + status = nx_ip_create(&client_ip, "SNTP IP Instance", CLIENT_IP_ADDRESS, + 0xFFFFFF00UL, &client_packet_pool, _nx_ram_network_driver_1500, + free_memory_pointer, 2048, 1); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + /* Enable ARP and supply ARP cache memory. */ + status = nx_arp_enable(&client_ip, (void **) free_memory_pointer, 2048); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Enable UDP for client. */ + status = nx_udp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + status = nx_icmp_enable(&client_ip); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + + /* Create the server thread */ + status = tx_thread_create(&sntp_server_thread, "SNTP Server Thread", sntp_server_thread_entry, + (ULONG)(&sntp_server), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* Create the client thread */ + status = tx_thread_create(&sntp_client_thread, "SNTP Client Thread", sntp_client_thread_entry, + (ULONG)(&sntp_client), free_memory_pointer, 2048, + 4, 4, TX_NO_TIME_SLICE, TX_DONT_START); + free_memory_pointer = free_memory_pointer + 2048; + + /* Check for errors */ + if (status != TX_SUCCESS) + error_counter++; + + /* set the SNTP network interface to the primary interface. */ + iface_index = 0; + + /* Create the SNTP Client to run in broadcast mode.. */ + status = nx_sntp_client_create(&sntp_client, &client_ip, iface_index, &client_packet_pool, + NX_NULL, + NX_NULL, + NX_NULL /* no random_number_generator callback */); + + /* Check for error. */ + if (status != NX_SUCCESS) + error_counter++; + + tx_thread_resume(&sntp_client_thread); + + return; +} + +/* Define size of buffer to display client's local time. */ +#define BUFSIZE 50 + +/* Define the client thread. */ +void sntp_client_thread_entry(ULONG info) +{ + +UINT status; +UINT server_status; +CHAR buffer[BUFSIZE]; +ULONG base_seconds; +ULONG base_fraction; +ULONG seconds, milliseconds, microseconds, fraction; + + printf("NetX Test: NETX SNTP Client Request Unicast Test....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give other threads (IP instance) a chance to initialize. */ + tx_thread_sleep(100); + + /* Use the IPv4 service to initialize the Client and set the IPv4 SNTP server. */ + status = nx_sntp_client_initialize_unicast(&sntp_client, SERVER_IP_ADDRESS); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + /* Set the base time which is approximately the number of seconds since the turn of the last century. */ + base_seconds = 0xd2c96b90; /* Jan 24, 2012 UTC */ + base_fraction = 0xa132db1e; + + /* Apply to the SNTP Client local time. */ + status = nx_sntp_client_set_local_time(&sntp_client, base_seconds, base_fraction); + + /* Check for error. */ + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_sntp_client_run_unicast(&sntp_client); + + if(status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + inject_sntp_server_reply(&pkt_data[0], pkt_size); + + /* Set the 'server' thread to wait for next unicast request. */ + tx_thread_resume(&sntp_server_thread); + + do + { + + /* First verify we have a valid SNTP service running. */ + status = nx_sntp_client_receiving_updates(&sntp_client, &server_status); + + tx_thread_sleep(100); + + } while (status != NX_SUCCESS); + + /* Server status is good. */ + + /* Tell the server it's ok to 'respond'to next unicast request. */ + send_unicast = NX_TRUE; + + /* Request a unicast update independently of the SNTP Client thread - wait option 5 seconds. */ + status = nx_sntp_client_request_unicast_time(&sntp_client, 500); + + if (status == NX_SUCCESS) + { + + asynch_unicast_processed = NX_TRUE; + + status = nx_sntp_client_get_local_time(&sntp_client, &seconds, &fraction, &buffer[0]); + + /* Convert fraction to microseconds. */ + nx_sntp_client_utility_fraction_to_usecs(fraction, µseconds); + + milliseconds = ((microseconds + 500) / 1000); + + if (status) + { + + error_counter++; + } + else if ( + (seconds != expected_seconds_asynch) || + (milliseconds < (expected_milliseconds_asynch - tolerance_milliseconds_asynch)) || + (milliseconds > (expected_milliseconds_asynch + tolerance_milliseconds_asynch)) + ) + { + + error_counter++; + } + } + + nx_sntp_client_stop(&sntp_client); + + nx_sntp_client_delete(&sntp_client); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + +/* This should emulate a SNTP server. */ +void sntp_server_thread_entry(ULONG info) +{ + + + /* Wait for next unicast request (should be the asynchronous request). */ + while(!send_unicast) + tx_thread_sleep(10); + + /* Keep sending till the asynch unicast server message is processed. */ + while(!asynch_unicast_processed) + { + + inject_sntp_server_reply(&pkt_data_asynch[0], pkt_size_asynch); + tx_thread_sleep(10); + } +} + + +void inject_sntp_server_reply(char *pkt_data, UINT size) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Allocate the packet and let the client IP stack receive it. */ + status = nx_packet_allocate(client_ip.nx_ip_default_packet_pool, &my_packet, 0, 500); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + /* Load the data simulating the server reply */ + my_packet -> nx_packet_length = size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + /* Send to the Client stack*/ + _nx_ip_packet_deferred_receive(&client_ip, my_packet); + +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_sntp_request_unicast_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: NETX SNTP Client Request Unicast Test.....................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/tahi_test/netx_tahi.h b/test/regression/tahi_test/netx_tahi.h new file mode 100644 index 00000000..a4b2f0ba --- /dev/null +++ b/test/regression/tahi_test/netx_tahi.h @@ -0,0 +1,95 @@ +#ifndef _NETX_TAHI_H_ +#define _NETX_TAHI_H_ + + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_dhcpv6_client.h" +#endif +#endif + +#define TITLE 1 /* This entry contains the name of the test. */ +#define INJECT 2 /* This entry contains packet that needs to be injected into the system.*/ +#define CHECK 3 /* This entry contains packet that needs to be matched. */ +#define WAIT 4 /* This entry is to place a wait. */ +#define DUMP 5 /* This entry flushes the incoming packet queue. */ +#define CLEANUP 6 /* This is a marker, indicating the beginning sequeuence of cleanup procedure. */ + +#define N_CHECK 7 /* This entry contains packet that do not want to be received. */ + +#ifdef NX_IPSEC_ENABLE +#define D_CHECK 8 /* This entry contains packet that needs to be matched after decryption. */ +#define ASSEMBLE 9 /* This entry contains packet that needs to be assembled. */ +#define AD_CHECK 10 /* This entry contains packet that needs to be assembled and be matched after decryption. */ +#define TD_CHECK 11 /* This entry contains packet that needs to be matched after decryption which is tunneled. */ +#endif + +#define DHCPV6_CONFIRM 12 +#define DHCPV6_RELEASE 13 +#define DHCPV6_REBOOT 14 +#define DHCPV6_INFO_REQUEST 15 +#define DHCPV6_DNS 16 + +#define CLEAN_HOP_LIMIT 20 /* This is a marker, indicating the hop limit should be initial to 0xff. */ +#define NS_UNSPEC 21 /* This is a marker, indicating the NS is being check. */ +#define CHECK_V6REQUEST 22 /* This is a marker, indicating the ping6_request has been send. */ +#define REBOOT 23 /* This is a marker, indicating the reboot process. */ + + +#define NS 31 /* NS packet. */ +#define NA 32 /* NA packet. */ +#define RS 33 /* RS packet. */ +#define ER 34 /* ECHO REPLY packet. */ +#define RELEASE 35 /* DHCPV6 RELEASE packet. */ +#define DECLINE 36 /* DHCPV6 DECLINE packet. */ +#define REQUEST 37 /* DHCPV6 DECLINE packet. */ +#define ANY 38 /* ANY packet. */ + + + +/* Define the protocol value for pmtu.p2 or icmp.p2 ping6 process. */ +#define PMTU 0 +#define ICMP 1 + +typedef struct TAHI_TEST_SEQ_struct +{ + /* The command. Only INJECT and CHECK carries valid pkt_data and pkt_size. */ + int command; + + /* Only INJECT and CHECK carries valid pkt_data and pkt_size. */ + /* For TITLE, pkt_data carries a const string, which is used as the name of the test case. */ + char *pkt_data; + int pkt_size; + + /* Used for CHECK and WAIT. */ + /* WAIT command: wait this amount of time. */ + /* CHECK command: during the timeout period, check any incoming packets against the pkt_data in this entry. */ + int timeout; + + /*Used in D_CHECK to lookup the sa */ + /* Next layer protocol*/ + UCHAR protocol; + + /* Used when the next layer protocol is UDP*/ + ULONG src_port; + ULONG dst_port; + + /*Used when the next layer protocol is ICMP or ICMPv6*/ + UINT option; +} TAHI_TEST_SEQ; + +typedef struct TAHI_TEST_SUITE_struct +{ + TAHI_TEST_SEQ *test_case; + int test_case_size; +} TAHI_TEST_SUITE; + + +void netx_tahi_run_test_case(NX_IP *ip_0, TAHI_TEST_SEQ *test_case, int test_case_size); +#ifdef __PRODUCT_NETXDUO__ +void netx_tahi_set_dhcpv6(NX_DHCPV6 *dhcpv6_client_ptr); +#endif +void netx_tahi_set_dhcpv6_reboot(void (*dhcpv6_reboot)()); +void netx_tahi_set_dhcpv6_info_request(void (*dhcpv6_info_request)()); +void netx_tahi_set_dhcpv6_dns(void (*dhcpv6_dns)()); diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_002.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_002.c new file mode 100644 index 00000000..630731e0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_002.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_001[]; +extern TAHI_TEST_SEQ tahi_dhcpv6_01_002[]; +extern int tahi_dhcpv6_01_001_size; +extern int tahi_dhcpv6_01_002_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_002_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_001[0], tahi_dhcpv6_01_001_size); + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_002[0], tahi_dhcpv6_01_002_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_003.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_003.c new file mode 100644 index 00000000..161914cc --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_003.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_003[]; +extern int tahi_dhcpv6_01_003_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_003_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_003[0], tahi_dhcpv6_01_003_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_004.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_004.c new file mode 100644 index 00000000..a98342f2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_004.c @@ -0,0 +1,165 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_004[]; +extern int tahi_dhcpv6_01_004_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_004_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_004[0], tahi_dhcpv6_01_004_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif + diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_005.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_005.c new file mode 100644 index 00000000..c792acab --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_005.c @@ -0,0 +1,165 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_005[]; +extern int tahi_dhcpv6_01_005_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_005_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_005[0], tahi_dhcpv6_01_005_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif + diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_006.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_006.c new file mode 100644 index 00000000..9c0b378f --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_006.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_006[]; +extern int tahi_dhcpv6_01_006_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_006_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_006[0], tahi_dhcpv6_01_006_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_007.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_007.c new file mode 100644 index 00000000..1b27f6f2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_007.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_007[]; +extern int tahi_dhcpv6_01_007_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_007_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_007[0], tahi_dhcpv6_01_007_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_007_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-007 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_008.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_008.c new file mode 100644 index 00000000..15f5317f --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_008.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_008[]; +extern int tahi_dhcpv6_01_008_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_008_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_008[0], tahi_dhcpv6_01_008_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_009.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_009.c new file mode 100644 index 00000000..ebc74078 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_009.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_009[]; +extern int tahi_dhcpv6_01_009_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_009_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_009[0], tahi_dhcpv6_01_009_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_010.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_010.c new file mode 100644 index 00000000..a5b2afb3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_010.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_010[]; +extern int tahi_dhcpv6_01_010_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_010_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_010[0], tahi_dhcpv6_01_010_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_011.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_011.c new file mode 100644 index 00000000..f80404cd --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_011.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_011[]; +extern int tahi_dhcpv6_01_011_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_011_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_011[0], tahi_dhcpv6_01_011_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_012.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_012.c new file mode 100644 index 00000000..805647c2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_012.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_012[]; +extern int tahi_dhcpv6_01_012_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_012_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_012[0], tahi_dhcpv6_01_012_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_013.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_013.c new file mode 100644 index 00000000..cb71c845 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_013.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_013[]; +extern int tahi_dhcpv6_01_013_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_013_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_013[0], tahi_dhcpv6_01_013_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_014.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_014.c new file mode 100644 index 00000000..8d2ea0a6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_014.c @@ -0,0 +1,229 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_reboot(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_014[]; +extern int tahi_dhcpv6_01_014_size; + +static CHAR *pointer; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_014_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_reboot(my_dhcpv6_reboot); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_014[0], tahi_dhcpv6_01_014_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_reboot() +{ + +NXD_ADDRESS ipv6_address; +UINT status; + + + nx_dhcpv6_client_delete(&dhcp_client); + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + status = nx_dhcpv6_request_solicit(&dhcp_client); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_019.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_019.c new file mode 100644 index 00000000..62abe383 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_019.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_019[]; +extern int tahi_dhcpv6_01_019_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_019_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_019[0], tahi_dhcpv6_01_019_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_020.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_020.c new file mode 100644 index 00000000..976c0a1a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_020.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_020[]; +extern int tahi_dhcpv6_01_020_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_020_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_020[0], tahi_dhcpv6_01_020_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_021.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_021.c new file mode 100644 index 00000000..95aeb263 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_021.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_021[]; +extern int tahi_dhcpv6_01_021_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_021_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_021[0], tahi_dhcpv6_01_021_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_022.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_022.c new file mode 100644 index 00000000..3cef6e50 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_022.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_022[]; +extern int tahi_dhcpv6_01_022_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_022_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_022[0], tahi_dhcpv6_01_022_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_023.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_023.c new file mode 100644 index 00000000..dcafa5b6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_023.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_023[]; +extern int tahi_dhcpv6_01_023_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_023_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_023[0], tahi_dhcpv6_01_023_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_024.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_024.c new file mode 100644 index 00000000..ebbc8cee --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_024.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_024[]; +extern int tahi_dhcpv6_01_024_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_024_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_024[0], tahi_dhcpv6_01_024_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_025.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_025.c new file mode 100644 index 00000000..532f728d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_025.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_025[]; +extern int tahi_dhcpv6_01_025_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_025_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_025[0], tahi_dhcpv6_01_025_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_026.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_026.c new file mode 100644 index 00000000..836b2e7e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_026.c @@ -0,0 +1,165 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_026[]; +extern int tahi_dhcpv6_01_026_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_026_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_026[0], tahi_dhcpv6_01_026_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif + diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_027.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_027.c new file mode 100644 index 00000000..962ca3a0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_027.c @@ -0,0 +1,165 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_027[]; +extern int tahi_dhcpv6_01_027_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_027_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_027[0], tahi_dhcpv6_01_027_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif + diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_028.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_028.c new file mode 100644 index 00000000..7d4bd6c3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_028.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_028[]; +extern int tahi_dhcpv6_01_028_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_028_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_028[0], tahi_dhcpv6_01_028_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_029.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_029.c new file mode 100644 index 00000000..39ed185f --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_029.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_029[]; +extern int tahi_dhcpv6_01_029_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_029_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_029[0], tahi_dhcpv6_01_029_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_029_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-029 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_030.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_030.c new file mode 100644 index 00000000..3b852a0a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_030.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_030[]; +extern int tahi_dhcpv6_01_030_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_030_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_030[0], tahi_dhcpv6_01_030_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_031.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_031.c new file mode 100644 index 00000000..971fd9a3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_031.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_031[]; +extern int tahi_dhcpv6_01_031_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_031_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_031[0], tahi_dhcpv6_01_031_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_032.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_032.c new file mode 100644 index 00000000..f5dd59b4 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_032.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_032[]; +extern int tahi_dhcpv6_01_032_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_032_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_032[0], tahi_dhcpv6_01_032_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_033.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_033.c new file mode 100644 index 00000000..d616f34d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_033.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_033[]; +extern int tahi_dhcpv6_01_033_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_033_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_033[0], tahi_dhcpv6_01_033_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_034.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_034.c new file mode 100644 index 00000000..b522121e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_034.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_034[]; +extern int tahi_dhcpv6_01_034_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_034_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_034[0], tahi_dhcpv6_01_034_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_035.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_035.c new file mode 100644 index 00000000..111d8cb8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_035.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_035[]; +extern int tahi_dhcpv6_01_035_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_035_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_035[0], tahi_dhcpv6_01_035_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_036.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_036.c new file mode 100644 index 00000000..a6e14f66 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_036.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_036[]; +extern int tahi_dhcpv6_01_036_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_036_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_036[0], tahi_dhcpv6_01_036_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_037.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_037.c new file mode 100644 index 00000000..31af0942 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_037.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_037[]; +extern int tahi_dhcpv6_01_037_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_037_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_037[0], tahi_dhcpv6_01_037_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_038.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_038.c new file mode 100644 index 00000000..098f649f --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_038.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_038[]; +extern int tahi_dhcpv6_01_038_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_038_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_038[0], tahi_dhcpv6_01_038_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_039.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_039.c new file mode 100644 index 00000000..e714af7b --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_039.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_039[]; +extern int tahi_dhcpv6_01_039_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_039_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_039[0], tahi_dhcpv6_01_039_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_040.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_040.c new file mode 100644 index 00000000..4697cdac --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_040.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_040[]; +extern int tahi_dhcpv6_01_040_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_040_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_040[0], tahi_dhcpv6_01_040_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_041.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_041.c new file mode 100644 index 00000000..9f9afec2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_041.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_041[]; +extern int tahi_dhcpv6_01_041_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_041_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_041[0], tahi_dhcpv6_01_041_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_042.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_042.c new file mode 100644 index 00000000..051860bb --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_042.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_042[]; +extern int tahi_dhcpv6_01_042_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_042_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_042[0], tahi_dhcpv6_01_042_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_043.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_043.c new file mode 100644 index 00000000..430712b9 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_043.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_043[]; +extern int tahi_dhcpv6_01_043_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_043_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_043[0], tahi_dhcpv6_01_043_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_044.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_044.c new file mode 100644 index 00000000..c622621c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_044.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_044[]; +extern int tahi_dhcpv6_01_044_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_044_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_044[0], tahi_dhcpv6_01_044_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_045.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_045.c new file mode 100644 index 00000000..e9a1a333 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_045.c @@ -0,0 +1,177 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_045[]; +extern int tahi_dhcpv6_01_045_size; + +static void my_icmpv6_ra_flag_callback(NX_IP *ip_ptr, UINT ra_flag); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_045_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Set icmpv6 ra flag. */ + status = nxd_icmpv6_ra_flag_callback_set(&ip_0, my_icmpv6_ra_flag_callback); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_045[0], tahi_dhcpv6_01_045_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +static void my_icmpv6_ra_flag_callback(NX_IP *ip_ptr, UINT ra_flag) +{ + ; +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_046.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_046.c new file mode 100644 index 00000000..54546dee --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_046.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_046[]; +extern int tahi_dhcpv6_01_046_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_046_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_046[0], tahi_dhcpv6_01_046_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_047.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_047.c new file mode 100644 index 00000000..f835b4a4 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_047.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_047[]; +extern int tahi_dhcpv6_01_047_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_047_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_047[0], tahi_dhcpv6_01_047_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_048.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_048.c new file mode 100644 index 00000000..d5232397 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_048.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_048[]; +extern int tahi_dhcpv6_01_048_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_048_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_048[0], tahi_dhcpv6_01_048_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_049.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_049.c new file mode 100644 index 00000000..6ccbd255 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_049.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_049[]; +extern int tahi_dhcpv6_01_049_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_049_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_049[0], tahi_dhcpv6_01_049_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_050.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_050.c new file mode 100644 index 00000000..03f50529 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_050.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_050[]; +extern int tahi_dhcpv6_01_050_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_050_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_050[0], tahi_dhcpv6_01_050_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_051.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_051.c new file mode 100644 index 00000000..0fe125c9 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_051.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_051[]; +extern int tahi_dhcpv6_01_051_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_051_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_051[0], tahi_dhcpv6_01_051_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_052.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_052.c new file mode 100644 index 00000000..f57f15d8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_052.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_052[]; +extern int tahi_dhcpv6_01_052_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_052_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_052[0], tahi_dhcpv6_01_052_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_053.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_053.c new file mode 100644 index 00000000..e57cea95 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_053.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_053[]; +extern int tahi_dhcpv6_01_053_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_053_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_053[0], tahi_dhcpv6_01_053_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_054.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_054.c new file mode 100644 index 00000000..f441c048 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_054.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_054[]; +extern int tahi_dhcpv6_01_054_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_054_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_054[0], tahi_dhcpv6_01_054_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_055.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_055.c new file mode 100644 index 00000000..7ab7da19 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_055.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_055[]; +extern int tahi_dhcpv6_01_055_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_055_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_055[0], tahi_dhcpv6_01_055_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_056.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_056.c new file mode 100644 index 00000000..558936b4 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_056.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_056[]; +extern int tahi_dhcpv6_01_056_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_056_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_056[0], tahi_dhcpv6_01_056_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_057.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_057.c new file mode 100644 index 00000000..e4bee39e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_057.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_057[]; +extern int tahi_dhcpv6_01_057_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_057_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_057[0], tahi_dhcpv6_01_057_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_058.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_058.c new file mode 100644 index 00000000..45d38fbc --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_058.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_058[]; +extern int tahi_dhcpv6_01_058_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_058_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_058[0], tahi_dhcpv6_01_058_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_059.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_059.c new file mode 100644 index 00000000..e0342c8c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_059.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_059[]; +extern int tahi_dhcpv6_01_059_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_059_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_059[0], tahi_dhcpv6_01_059_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_060.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_060.c new file mode 100644 index 00000000..c3553779 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_060.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_060[]; +extern int tahi_dhcpv6_01_060_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_060_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_060[0], tahi_dhcpv6_01_060_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_060_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-060 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_061.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_061.c new file mode 100644 index 00000000..70c3469e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_061.c @@ -0,0 +1,174 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_061[]; +extern int tahi_dhcpv6_01_061_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_061_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_061[0], tahi_dhcpv6_01_061_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_061_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-061 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_062.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_062.c new file mode 100644 index 00000000..256cf047 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_062.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_062[]; +extern int tahi_dhcpv6_01_062_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_062_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_062[0], tahi_dhcpv6_01_062_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_062_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-062 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_063.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_063.c new file mode 100644 index 00000000..779b23af --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_063.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_063[]; +extern int tahi_dhcpv6_01_063_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_063_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_063[0], tahi_dhcpv6_01_063_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_063_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-063 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_064.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_064.c new file mode 100644 index 00000000..4d7aa12e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_064.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_064[]; +extern int tahi_dhcpv6_01_064_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_064_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_064[0], tahi_dhcpv6_01_064_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_064_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-064 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_065.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_065.c new file mode 100644 index 00000000..8a751c33 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_065.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_065[]; +extern int tahi_dhcpv6_01_065_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_065_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_065[0], tahi_dhcpv6_01_065_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_066.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_066.c new file mode 100644 index 00000000..f61fcf28 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_066.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_066[]; +extern int tahi_dhcpv6_01_066_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_066_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_066[0], tahi_dhcpv6_01_066_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_067.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_067.c new file mode 100644 index 00000000..469483c3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_067.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +extern void test_control_return(UINT status); +#if (NX_DHCPV6_MAX_IA_ADDRESS >= 2) /* This test case works OK when NX_DHCPV6_MAX_IA_ADDRESS is 2, default is 1. */ +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_067[]; +extern int tahi_dhcpv6_01_067_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_067_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_067[0], tahi_dhcpv6_01_067_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_067_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-067 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_068.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_068.c new file mode 100644 index 00000000..c00a3192 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_068.c @@ -0,0 +1,339 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static ULONG original_xid; +static UCHAR original_cid[18]; +static UINT renew_count; + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_068[]; +extern int tahi_dhcpv6_01_068_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_068_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + renew_count = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_068[0], tahi_dhcpv6_01_068_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + else if((message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) && (renew_count == 0)) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + renew_count++; + } + else if((message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) || + (message_type == NX_DHCPV6_MESSAGE_TYPE_REBIND)) + { + + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa4e49600 + message_type; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_069.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_069.c new file mode 100644 index 00000000..75513a92 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_069.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_069[]; +extern int tahi_dhcpv6_01_069_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_069_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_069[0], tahi_dhcpv6_01_069_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_070.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_070.c new file mode 100644 index 00000000..d5d58b31 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_070.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_070[]; +extern int tahi_dhcpv6_01_070_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_070_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_070[0], tahi_dhcpv6_01_070_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_071.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_071.c new file mode 100644 index 00000000..098f48c3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_071.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_071[]; +extern int tahi_dhcpv6_01_071_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_071_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_071[0], tahi_dhcpv6_01_071_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_072.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_072.c new file mode 100644 index 00000000..f6e054d5 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_072.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_072[]; +extern int tahi_dhcpv6_01_072_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_072_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_072[0], tahi_dhcpv6_01_072_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_073.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_073.c new file mode 100644 index 00000000..db60a848 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_073.c @@ -0,0 +1,331 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_073[]; +extern int tahi_dhcpv6_01_073_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; +static UINT solicit_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_073_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + solicit_count = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_073[0], tahi_dhcpv6_01_073_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if((message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) && (solicit_count == 0)) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + solicit_count++; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915201; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_074.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_074.c new file mode 100644 index 00000000..2a87aa2e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_074.c @@ -0,0 +1,340 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_074[]; +extern int tahi_dhcpv6_01_074_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; +static UINT confirm_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_074_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + confirm_count = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_074[0], tahi_dhcpv6_01_074_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if((message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT)) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + if(confirm_count == 0) + { + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else + { + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa4e49601; + } + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_CONFIRM) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + confirm_count++; + } + + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_075.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_075.c new file mode 100644 index 00000000..5f65aa43 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_075.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_075[]; +extern int tahi_dhcpv6_01_075_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_075_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_075[0], tahi_dhcpv6_01_075_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_076.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_076.c new file mode 100644 index 00000000..f15aa770 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_076.c @@ -0,0 +1,332 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_076[]; +extern int tahi_dhcpv6_01_076_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; +static UINT renew_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_076_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + renew_count = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_076[0], tahi_dhcpv6_01_076_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + if(renew_count == 0) + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + else + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa4e49603; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + renew_count++; + } + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_077.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_077.c new file mode 100644 index 00000000..a5d5fc93 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_077.c @@ -0,0 +1,333 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_077[]; +extern int tahi_dhcpv6_01_077_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; +static UINT renew_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_077_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + renew_count = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_077[0], tahi_dhcpv6_01_077_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + if(renew_count == 0) + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + else + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa4e49603; + } + else if((message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) || + (message_type == NX_DHCPV6_MESSAGE_TYPE_REBIND)) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + renew_count++; + } + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_078.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_078.c new file mode 100644 index 00000000..9c7b877d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_078.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_078[]; +extern int tahi_dhcpv6_01_078_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_078_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_078[0], tahi_dhcpv6_01_078_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_079.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_079.c new file mode 100644 index 00000000..a3ebc952 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_079.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_079[]; +extern int tahi_dhcpv6_01_079_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_079_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_079[0], tahi_dhcpv6_01_079_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_080.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_080.c new file mode 100644 index 00000000..fa5eabe7 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_080.c @@ -0,0 +1,167 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_080[]; +extern int tahi_dhcpv6_01_080_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_080_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_080[0], tahi_dhcpv6_01_080_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_081.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_081.c new file mode 100644 index 00000000..ccc73fd0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_081.c @@ -0,0 +1,175 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_081[]; +extern int tahi_dhcpv6_01_081_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_081_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_081[0], tahi_dhcpv6_01_081_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_081_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 01-081 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_082.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_082.c new file mode 100644 index 00000000..f7bd3a9b --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_082.c @@ -0,0 +1,318 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_082[]; +extern int tahi_dhcpv6_01_082_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_082_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_082[0], tahi_dhcpv6_01_082_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa4e49601; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_DECLINE) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_083.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_083.c new file mode 100644 index 00000000..33b77aca --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_083.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_083[]; +extern int tahi_dhcpv6_01_083_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_083_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_083[0], tahi_dhcpv6_01_083_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_084.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_084.c new file mode 100644 index 00000000..85e98beb --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_084.c @@ -0,0 +1,314 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_084[]; +extern int tahi_dhcpv6_01_084_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_084_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_084[0], tahi_dhcpv6_01_084_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_085.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_085.c new file mode 100644 index 00000000..262b9a19 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_085.c @@ -0,0 +1,311 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_085[]; +extern int tahi_dhcpv6_01_085_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_085_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_085[0], tahi_dhcpv6_01_085_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the cid. */ + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_086.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_086.c new file mode 100644 index 00000000..e2355c80 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_086.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_086[]; +extern int tahi_dhcpv6_01_086_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_086_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_086[0], tahi_dhcpv6_01_086_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_087.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_087.c new file mode 100644 index 00000000..3344be89 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_087.c @@ -0,0 +1,325 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_087[]; +extern int tahi_dhcpv6_01_087_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_087_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_087[0], tahi_dhcpv6_01_087_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_REPLY) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + } + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_088.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_088.c new file mode 100644 index 00000000..6d12efbb --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_088.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_088[]; +extern int tahi_dhcpv6_01_088_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_088_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_088[0], tahi_dhcpv6_01_088_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_089.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_089.c new file mode 100644 index 00000000..5db5f8e7 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_089.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_089[]; +extern int tahi_dhcpv6_01_089_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_089_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_089[0], tahi_dhcpv6_01_089_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_090.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_090.c new file mode 100644 index 00000000..48a33001 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_090.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_090[]; +extern int tahi_dhcpv6_01_090_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_090_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_090[0], tahi_dhcpv6_01_090_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_091.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_091.c new file mode 100644 index 00000000..e79817f2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_091.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_091[]; +extern int tahi_dhcpv6_01_091_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_091_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_091[0], tahi_dhcpv6_01_091_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_092.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_092.c new file mode 100644 index 00000000..480d2fdf --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_092.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_092[]; +extern int tahi_dhcpv6_01_092_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_092_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_092[0], tahi_dhcpv6_01_092_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_CONFIRM) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_093.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_093.c new file mode 100644 index 00000000..d7a9041d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_093.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_093[]; +extern int tahi_dhcpv6_01_093_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_093_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_093[0], tahi_dhcpv6_01_093_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_RENEW) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_094.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_094.c new file mode 100644 index 00000000..65655de8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_094.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_094[]; +extern int tahi_dhcpv6_01_094_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_094_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_094[0], tahi_dhcpv6_01_094_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_REBIND) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_095.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_095.c new file mode 100644 index 00000000..c09410a8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_095.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_095[]; +extern int tahi_dhcpv6_01_095_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_095_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_095[0], tahi_dhcpv6_01_095_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_DECLINE) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_096.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_096.c new file mode 100644 index 00000000..ffe10425 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_096.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_096[]; +extern int tahi_dhcpv6_01_096_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_096_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_096[0], tahi_dhcpv6_01_096_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_RELEASE) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_097.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_097.c new file mode 100644 index 00000000..e110530c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_097.c @@ -0,0 +1,325 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_097[]; +extern int tahi_dhcpv6_01_097_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_097_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_097[0], tahi_dhcpv6_01_097_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + /* 12 reley-forw. */ + if(message_type != 12) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_098.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_098.c new file mode 100644 index 00000000..3b82bcd1 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_098.c @@ -0,0 +1,325 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_098[]; +extern int tahi_dhcpv6_01_098_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_098_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_098[0], tahi_dhcpv6_01_098_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + /* 12 reley-reply. */ + if(message_type != 13) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_099.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_099.c new file mode 100644 index 00000000..8f46f203 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_01_099.c @@ -0,0 +1,324 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_01_099[]; +extern int tahi_dhcpv6_01_099_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_01_099_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_01_099[0], tahi_dhcpv6_01_099_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + if(message_type != NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + } + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_002.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_002.c new file mode 100644 index 00000000..67c59ba9 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_002.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_002[]; +extern int tahi_dhcpv6_04_002_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_002_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_002[0], tahi_dhcpv6_04_002_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_003.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_003.c new file mode 100644 index 00000000..e7682ff2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_003.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_003[]; +extern int tahi_dhcpv6_04_003_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_003_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_003[0], tahi_dhcpv6_04_003_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_004.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_004.c new file mode 100644 index 00000000..90c6a1e7 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_004.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_004[]; +extern int tahi_dhcpv6_04_004_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_004_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_004[0], tahi_dhcpv6_04_004_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_005.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_005.c new file mode 100644 index 00000000..35fd1645 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_005.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_005[]; +extern int tahi_dhcpv6_04_005_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_005_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_005[0], tahi_dhcpv6_04_005_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_006.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_006.c new file mode 100644 index 00000000..e4aa1a33 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_006.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_006[]; +extern int tahi_dhcpv6_04_006_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_006_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_006[0], tahi_dhcpv6_04_006_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_007.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_007.c new file mode 100644 index 00000000..6f8eddff --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_007.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_007[]; +extern int tahi_dhcpv6_04_007_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_007_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_007[0], tahi_dhcpv6_04_007_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_008.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_008.c new file mode 100644 index 00000000..d275ddf1 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_008.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_008[]; +extern int tahi_dhcpv6_04_008_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_008_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_008[0], tahi_dhcpv6_04_008_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_009.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_009.c new file mode 100644 index 00000000..25684a7c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_009.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_009[]; +extern int tahi_dhcpv6_04_009_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_009_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_009[0], tahi_dhcpv6_04_009_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_010.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_010.c new file mode 100644 index 00000000..a03fd355 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_010.c @@ -0,0 +1,437 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; +static ULONG confirm_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_010[]; +extern int tahi_dhcpv6_04_010_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_010_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + confirm_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_010[0], tahi_dhcpv6_04_010_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 1, NX_IP_VERSION_V6); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_CONFIRM) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + + confirm_counter = 1; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + + if(confirm_counter == 0) + { + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xf907; + } + else if(confirm_counter == 1) + { + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x9d14; + } + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_012.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_012.c new file mode 100644 index 00000000..0d3b3036 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_012.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_012[]; +extern int tahi_dhcpv6_04_012_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_012_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_012[0], tahi_dhcpv6_04_012_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_013.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_013.c new file mode 100644 index 00000000..7a7694d0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_013.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_013[]; +extern int tahi_dhcpv6_04_013_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_013_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_013[0], tahi_dhcpv6_04_013_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_014.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_014.c new file mode 100644 index 00000000..471b2b44 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_014.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_014[]; +extern int tahi_dhcpv6_04_014_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_014_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_014[0], tahi_dhcpv6_04_014_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_015.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_015.c new file mode 100644 index 00000000..34ca1bf1 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_015.c @@ -0,0 +1,164 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_015[]; +extern int tahi_dhcpv6_04_015_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_015_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_015[0], tahi_dhcpv6_04_015_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_016.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_016.c new file mode 100644 index 00000000..7ce00379 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_016.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_016[]; +extern int tahi_dhcpv6_04_016_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_016_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_016[0], tahi_dhcpv6_04_016_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_017.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_017.c new file mode 100644 index 00000000..9282ea43 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_017.c @@ -0,0 +1,166 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_017[]; +extern int tahi_dhcpv6_04_017_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_017_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_017[0], tahi_dhcpv6_04_017_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_018.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_018.c new file mode 100644 index 00000000..aa9032ec --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_018.c @@ -0,0 +1,178 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_018[]; +extern int tahi_dhcpv6_04_018_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_018_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_018[0], tahi_dhcpv6_04_018_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_018_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 04-018 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_019.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_019.c new file mode 100644 index 00000000..5cc97cf6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_019.c @@ -0,0 +1,178 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + +extern void test_control_return(UINT status); +#ifdef NX_ENABLE_IPV6_ADDRESS_CHANGE_NOTIFY + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_019[]; +extern int tahi_dhcpv6_04_019_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_019_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6(&dhcp_client); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_019[0], tahi_dhcpv6_04_019_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_019_define(void * first_unused_memory) +#endif +{ + printf("NetX Test: TAHI dhcpv6 04-019 TEST.......................N/A!\n"); + test_control_return(3); +} +#endif +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_020.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_020.c new file mode 100644 index 00000000..335547f6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_020.c @@ -0,0 +1,417 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_020[]; +extern int tahi_dhcpv6_04_020_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_020_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_020[0], tahi_dhcpv6_04_020_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 0, NX_IP_VERSION_V6); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xd12a; + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_021.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_021.c new file mode 100644 index 00000000..5eeeb264 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_021.c @@ -0,0 +1,417 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_021[]; +extern int tahi_dhcpv6_04_021_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_021_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_021[0], tahi_dhcpv6_04_021_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 0, NX_IP_VERSION_V6); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa213; + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_022.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_022.c new file mode 100644 index 00000000..fa732398 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_022.c @@ -0,0 +1,434 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; +static ULONG renew_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_022[]; +extern int tahi_dhcpv6_04_022_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_022_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + renew_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_022[0], tahi_dhcpv6_04_022_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 1, NX_IP_VERSION_V6); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + renew_counter = 1; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + if(renew_counter == 0) + { + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x4d19; + } + else if(renew_counter == 1) + { + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x2139; + } + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_026.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_026.c new file mode 100644 index 00000000..745c2828 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_026.c @@ -0,0 +1,163 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_026[]; +extern int tahi_dhcpv6_04_026_size; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_026_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_026[0], tahi_dhcpv6_04_026_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_027.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_027.c new file mode 100644 index 00000000..c9f702bb --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_04_027.c @@ -0,0 +1,229 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_reboot(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_04_027[]; +extern int tahi_dhcpv6_04_027_size; + +static CHAR *pointer; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_04_027_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_reboot(my_dhcpv6_reboot); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + status = nx_dhcpv6_request_solicit(&dhcp_client); + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_04_027[0], tahi_dhcpv6_04_027_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_reboot() +{ + +NXD_ADDRESS ipv6_address; +UINT status; + + + nx_dhcpv6_client_delete(&dhcp_client); + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + status = nx_dhcpv6_request_solicit(&dhcp_client); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_002.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_002.c new file mode 100644 index 00000000..5d15fe46 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_002.c @@ -0,0 +1,418 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_002[]; +extern int tahi_dhcpv6_07_002_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_002_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_002[0], tahi_dhcpv6_07_002_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 0, NX_IP_VERSION_V6); +} + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e0b; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x5515; + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_003.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_003.c new file mode 100644 index 00000000..67d4741c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_003.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_003[]; +extern int tahi_dhcpv6_07_003_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_003_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_003[0], tahi_dhcpv6_07_003_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_004.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_004.c new file mode 100644 index 00000000..0297e8fe --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_004.c @@ -0,0 +1,414 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_004[]; +extern int tahi_dhcpv6_07_004_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_004_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_004[0], tahi_dhcpv6_07_004_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 0, NX_IP_VERSION_V6); +} + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e0b; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xa113; + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_005.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_005.c new file mode 100644 index 00000000..a81c55af --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_005.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_005[]; +extern int tahi_dhcpv6_07_005_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_005_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_005[0], tahi_dhcpv6_07_005_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_006.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_006.c new file mode 100644 index 00000000..11b012ec --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_006.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_006[]; +extern int tahi_dhcpv6_07_006_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_006_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_006[0], tahi_dhcpv6_07_006_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_007.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_007.c new file mode 100644 index 00000000..1b7dfd32 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_007.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_007[]; +extern int tahi_dhcpv6_07_007_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_007_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_007[0], tahi_dhcpv6_07_007_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_008.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_008.c new file mode 100644 index 00000000..7891000a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_008.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_008[]; +extern int tahi_dhcpv6_07_008_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_008_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_008[0], tahi_dhcpv6_07_008_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_009.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_009.c new file mode 100644 index 00000000..0cc446f6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_009.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_009[]; +extern int tahi_dhcpv6_07_009_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_009_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_009[0], tahi_dhcpv6_07_009_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_010.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_010.c new file mode 100644 index 00000000..4a1defdc --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_010.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_010[]; +extern int tahi_dhcpv6_07_010_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_010_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_010[0], tahi_dhcpv6_07_010_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_011.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_011.c new file mode 100644 index 00000000..97de9030 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_011.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_011[]; +extern int tahi_dhcpv6_07_011_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_011_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_011[0], tahi_dhcpv6_07_011_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_012.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_012.c new file mode 100644 index 00000000..c19aeb5b --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_012.c @@ -0,0 +1,414 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_012[]; +extern int tahi_dhcpv6_07_012_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_012_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_012[0], tahi_dhcpv6_07_012_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 0, NX_IP_VERSION_V6); +} + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e0b; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x910b; + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_013.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_013.c new file mode 100644 index 00000000..45fc0d34 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_013.c @@ -0,0 +1,414 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" +#include "nxd_dns.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; +static NX_DNS dns_client; + +static ULONG error_counter; + +static CHAR *pointer; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_dns(); +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_013[]; +extern int tahi_dhcpv6_07_013_size; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_013_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a DNS instance for the Client. */ + status = nx_dns_create(&dns_client, &ip_0, (UCHAR *)"DNS Client"); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_dns(my_dhcpv6_dns); + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_013[0], tahi_dhcpv6_07_013_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + +void my_dhcpv6_dns() +{ + +UINT status; +NXD_ADDRESS dns_ipv6_server_address; +NXD_ADDRESS host_ipv6_address; + + + /* Get the dns server address. */ + status = nx_dhcpv6_get_DNS_server_address(&dhcp_client, 0, &dns_ipv6_server_address); + + /* Yes, get the address of DNS server. */ + if (status == NX_SUCCESS) + { + /* Add the address. */ + status = nxd_dns_server_add(&dns_client, &dns_ipv6_server_address); + + } + + /* Send the DNS query to get the ipv6 address of the .*/ + status = nxd_dns_host_by_name_get(&dns_client, (UCHAR *)"dhcpv6.test.example.com", &host_ipv6_address, 0, NX_IP_VERSION_V6); +} + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e0b; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x4d19; + + /* Modify the UDP source port to be the same value 30000(0x7530) with the packet captured by wireshark. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + udp_header_ptr -> nx_udp_header_word_0 = ((udp_header_ptr -> nx_udp_header_word_0 & 0x0000FFFF) | 0x75300000); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_014.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_014.c new file mode 100644 index 00000000..e42c896d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_014.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_014[]; +extern int tahi_dhcpv6_07_014_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_014_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_014[0], tahi_dhcpv6_07_014_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_015.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_015.c new file mode 100644 index 00000000..75b77a97 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_015.c @@ -0,0 +1,323 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +static void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_015[]; +extern int tahi_dhcpv6_07_015_size; + +static UCHAR original_cid[18]; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_015_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = my_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = my_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_015[0], tahi_dhcpv6_07_015_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + + +UINT my_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + /* Modify the xid to be the same with Tahi test packet. */ + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e0b; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + + return NX_TRUE; + +} + +void my_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0 + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_016.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_016.c new file mode 100644 index 00000000..513a1acb --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_016.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_016[]; +extern int tahi_dhcpv6_07_016_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_016_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_016[0], tahi_dhcpv6_07_016_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_017.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_017.c new file mode 100644 index 00000000..88a410c0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_017.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_017[]; +extern int tahi_dhcpv6_07_017_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_017_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_017[0], tahi_dhcpv6_07_017_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_018.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_018.c new file mode 100644 index 00000000..c978e4f6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_018.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_018[]; +extern int tahi_dhcpv6_07_018_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_018_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_018[0], tahi_dhcpv6_07_018_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_019.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_019.c new file mode 100644 index 00000000..9b98945e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_019.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_019[]; +extern int tahi_dhcpv6_07_019_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_019_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_019[0], tahi_dhcpv6_07_019_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_020.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_020.c new file mode 100644 index 00000000..499cc706 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_020.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_020[]; +extern int tahi_dhcpv6_07_020_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_020_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_020[0], tahi_dhcpv6_07_020_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_021.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_021.c new file mode 100644 index 00000000..dc559422 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_021.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_021[]; +extern int tahi_dhcpv6_07_021_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_021_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_021[0], tahi_dhcpv6_07_021_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_022.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_022.c new file mode 100644 index 00000000..1850fbd5 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_022.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_022[]; +extern int tahi_dhcpv6_07_022_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_022_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_022[0], tahi_dhcpv6_07_022_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_023.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_023.c new file mode 100644 index 00000000..e96417d7 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_023.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_023[]; +extern int tahi_dhcpv6_07_023_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_023_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_023[0], tahi_dhcpv6_07_023_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_024.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_024.c new file mode 100644 index 00000000..20020013 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_024.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_024[]; +extern int tahi_dhcpv6_07_024_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_024_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_024[0], tahi_dhcpv6_07_024_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_025.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_025.c new file mode 100644 index 00000000..f8f74e59 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_025.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_025[]; +extern int tahi_dhcpv6_07_025_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_025_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_025[0], tahi_dhcpv6_07_025_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_026.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_026.c new file mode 100644 index 00000000..3886bfc9 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_026.c @@ -0,0 +1,176 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_026[]; +extern int tahi_dhcpv6_07_026_size; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_026_define(void * first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_026[0], tahi_dhcpv6_07_026_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_027.c b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_027.c new file mode 100644 index 00000000..90c5b0cb --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_dhcpv6_test_07_027.c @@ -0,0 +1,238 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_udp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nxd_dhcpv6_client.h" + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define DHCPV6_IANA_ID 0xC0DEDBAD + +static TX_THREAD dhcpv6_client_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_DHCPV6 dhcp_client; + +static ULONG error_counter; + +static void dhcpv6_client_thread_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +extern UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); +extern void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +static void my_dhcpv6_info_request(); +static void my_dhcpv6_reboot(); + +extern TAHI_TEST_SEQ tahi_dhcpv6_07_027[]; +extern int tahi_dhcpv6_07_027_size; + +CHAR *pointer; +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_dhcpv6_test_07_027_define(void * first_unused_memory) +#endif +{ +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + if(status) + error_counter++; + + status = nx_udp_enable(&ip_0); + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + if(status) + error_counter++; + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create the main thread. */ + tx_thread_create(&dhcpv6_client_thread, "dhcpv6 client thread", dhcpv6_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + +} + +void dhcpv6_client_thread_entry(ULONG thread_input) +{ +NXD_ADDRESS ipv6_address; +UINT status; + + status = nxd_ipv6_address_set(&ip_0, 0, NX_NULL, 10, NX_NULL); + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + netx_tahi_set_dhcpv6_info_request(my_dhcpv6_info_request); + + netx_tahi_set_dhcpv6_reboot(my_dhcpv6_reboot); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + + advanced_packet_process_callback = tahi_dhcpv6_packet_process; + ip_0.nx_ip_udp_packet_receive = tahi_dhcpv6_udp_packet_receive; + + netx_tahi_run_test_case(&ip_0, &tahi_dhcpv6_07_027[0], tahi_dhcpv6_07_027_size); + + nx_dhcpv6_client_delete(&dhcp_client); + + test_control_return(0xdeadbeef); +} + + +void my_dhcpv6_info_request() +{ + nx_dhcpv6_request_inform_request(&dhcp_client); +} + +void my_dhcpv6_reboot() +{ + +NXD_ADDRESS ipv6_address; +UINT status; + + + nx_dhcpv6_client_delete(&dhcp_client); + + /* Create a DHCPv6 Client. */ + status = nx_dhcpv6_client_create(&dhcp_client, &ip_0, "DHCPv6 Client", &pool_0, pointer, 2048, NX_NULL, NX_NULL); + pointer += 2048; + if(status) + error_counter++; + + /* Create a Link Layer Plus Time DUID for the DHCPv6 Client. Set time ID field + to NULL; the DHCPv6 Client API will supply one. */ + status = nx_dhcpv6_create_client_duid(&dhcp_client, NX_DHCPV6_DUID_TYPE_LINK_TIME, + NX_DHCPV6_HW_TYPE_IEEE_802, 0); + if(status) + error_counter++; + + /* Create the DHCPv6 client's Identity Association (IA-NA) now. */ + status = nx_dhcpv6_create_client_iana(&dhcp_client, DHCPV6_IANA_ID, 0xFFFFFFFF, 0xFFFFFFFF); + if(status) + error_counter++; + + memset(&ipv6_address,0x0, sizeof(NXD_ADDRESS)); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6 ; + + /* Create an IA address option. */ + if((ipv6_address.nxd_ip_address.v6[0] != 0) || + (ipv6_address.nxd_ip_address.v6[1] != 0) || + (ipv6_address.nxd_ip_address.v6[2] != 0) || + (ipv6_address.nxd_ip_address.v6[3] != 0)) + { + + status = nx_dhcpv6_create_client_ia(&dhcp_client, &ipv6_address, 0xFFFFFFFF, + 0xFFFFFFFF); + + if (status != NX_SUCCESS) + { + return; + } + } + + /* Set the list of desired options to enabled. */ + nx_dhcpv6_request_option_timezone(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_DNS_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_time_server(&dhcp_client, NX_TRUE); + nx_dhcpv6_request_option_domain_name(&dhcp_client, NX_TRUE); + + /* Wait to finish the DAD. */ + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + + /* Start the NetX DHCPv6 Client. */ + status = nx_dhcpv6_start(&dhcp_client); + if(status) + error_counter++; +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_run_test_case.c b/test/regression/tahi_test/netx_tahi_run_test_case.c new file mode 100644 index 00000000..ea6e54c6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_run_test_case.c @@ -0,0 +1,1165 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_udp.h" +#include "nxd_dhcpv6_client.h" +#ifdef NX_IPSEC_ENABLE +#include "nx_ipsec.h" +#endif + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define MAX_PACKET_SIZE 1600 + +/* Define the ThreadX and NetX object control blocks... */ + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static ULONG original_xid; +static UCHAR original_cid[18]; + +/* Define thread prototypes. */ +extern void test_control_return(UINT status); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static UINT in_cleanup_process; +static TX_MUTEX pkt_capture_mutex; +static TX_SEMAPHORE pkt_count_sem; +static int pkt_capture_flag = 0; +static UCHAR packet_data[MAX_PACKET_SIZE]; +#ifdef NX_IPSEC_ENABLE +static NX_PACKET *assemble_pkt; +static UCHAR assemble_pkt_data[MAX_PACKET_SIZE]; +static UINT fragment_cnt = 0; +#endif + + +static NX_PACKET *incoming_pkts = NX_NULL; +static NX_PACKET *incoming_pkts_tail = NX_NULL; + +static NX_DHCPV6 *tahi_dhcpv6_client_ptr; +static void (*tahi_dhcpv6_reboot)(); +static void (*tahi_dhcpv6_info_request)(); +static void (*tahi_dhcpv6_dns)(); + +static void perform_check(char *pkt_data, int pkt_size, int timeout) +{ +UINT status; +NX_PACKET *current_pkt; +ULONG start_time, current_time, time_remaining; +ULONG bytes_copied; + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + if(status == NX_SUCCESS) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if(current_pkt) + { + + /* A packet has been queued. Examine the content of the packet. */ + status = nx_packet_data_retrieve(current_pkt, packet_data, &bytes_copied); + + if((status != NX_SUCCESS) || + ((UINT)(pkt_size - 14) != bytes_copied) || + (memcmp(pkt_data + 14, packet_data, bytes_copied) != 0)) + { + /* Not a match. */ + + /* Compute new timeout value. */ + current_time = tx_time_get(); + time_remaining = timeout - (current_time - start_time); + if(time_remaining > 0x80000000) + { + /* Underflow */ + time_remaining = 0; + error_counter = 1; + } + nx_packet_release(current_pkt); + continue; + } + else + { + /* Packet is a match. Get out of this CHECK state. */ + time_remaining = 0; + nx_packet_release(current_pkt); + continue; + } + } + } + else + { + /* Timeout */ + error_counter = 1; + time_remaining = 0; + } + } +} + +static void perform_null_check(int pkt_data, int pkt_size, int timeout) +{ +UINT status; +NX_PACKET *current_pkt; +ULONG start_time, current_time, time_remaining; +NX_UDP_HEADER *udp_header_ptr; +ULONG dst_port; + + + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + /* Did not receive any packet. */ + if (status != NX_SUCCESS) + break; + + /* Compute the amount of time to wait for. */ + current_time = tx_time_get(); + + /* Compute remaining ticks. */ + time_remaining = timeout - (current_time - start_time); + if(time_remaining > 0x80000000) + { + /* Underflow */ + time_remaining = 0; + } + + /* Receive a packet. */ + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if (!current_pkt) + continue; + + /* Check this is a IPV6 packet. */ +/* + if (*(current_pkt -> nx_packet_prepend_ptr - 2) != 0x86 || + *(current_pkt -> nx_packet_prepend_ptr - 1) != 0xdd) + continue;*/ + + + /* Check next header ia a ICMPv6 header. */ + if (*(current_pkt -> nx_packet_prepend_ptr + 6) != 0x3a) + continue; + + /* Get destination UDP port */ + udp_header_ptr = (NX_UDP_HEADER*)(current_pkt-> nx_packet_prepend_ptr + 40); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + + switch(pkt_data) + { + case NA: + if (*(current_pkt -> nx_packet_prepend_ptr + 40) == 0x88) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + + case NS: + if (*(current_pkt -> nx_packet_prepend_ptr + 40) == 0x87) + { + if (pkt_size == NS_UNSPEC) + { + CHECK_UNSPECIFIED_ADDRESS((ULONG *)(current_pkt -> nx_packet_prepend_ptr + 8)); + break; + } + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + + case RS: + if (*(current_pkt -> nx_packet_prepend_ptr + 40) == 0x85) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + + case ER: + if (*(current_pkt -> nx_packet_prepend_ptr + 40) == 0x81) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + case RELEASE: + if ((((dst_port & 0x0000FFFF) == 0x00000222) || ((dst_port & 0x0000FFFF) == 0x00000223)) && + (*(current_pkt -> nx_packet_prepend_ptr + 48) == 0x08)) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + case DECLINE: + if ((((dst_port & 0x0000FFFF) == 0x00000222) || ((dst_port & 0x0000FFFF) == 0x00000223)) && + (*(current_pkt -> nx_packet_prepend_ptr + 48) == 0x09)) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + case REQUEST: + if ((((dst_port & 0x0000FFFF) == 0x00000222) || ((dst_port & 0x0000FFFF) == 0x00000223)) && + (*(current_pkt -> nx_packet_prepend_ptr + 48) == 0x03)) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + + case ANY: + if(((dst_port & 0x0000FFFF) == 0x00000222) || ((dst_port & 0x0000FFFF) == 0x00000223)) + { + error_counter = 1; + time_remaining = 0; + nx_packet_release(current_pkt); + } + break; + + + + default: + break; + } + } +} + +#ifdef NX_IPSEC_ENABLE +static void perform_decrypt_check(NX_IP *ip_ptr, char *pkt_data, int pkt_size, int timeout, int is_tunneled, + UCHAR protocol, ULONG src_port, ULONG dst_port, UINT option) +{ + UINT status; + NX_PACKET *current_pkt; + ULONG start_time, current_time, time_remaining; + NX_IPSEC_SA *egress_sa_ptr; + UCHAR *iv_ptr_cur, *iv_ptr_data; + UCHAR *input_payload_ptr_cur, *input_payload_ptr_data; + UINT input_payload_size; + NX_IPV6_HEADER *ipv6_header; + NXD_ADDRESS src_addr, dest_addr; + ULONG data_offset; + UINT icv_size, iv_size; /* in bytes */ + NX_IPSEC_SA *cur_sa_ptr; + NX_IPSEC_ESP_HEADER *esp_header_ptr; + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + if(status == NX_SUCCESS) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if(current_pkt) + { + + /* A packet has been queued. Examine the header of the packet. + Include IPv6 header and ESP header in transport mode. */ + if(((UINT)(pkt_size - 14) != current_pkt -> nx_packet_length) || + (memcmp(pkt_data + 14, current_pkt -> nx_packet_prepend_ptr, 40) != 0)) + { + /* Not a match. */ + + /* Compute new timeout value. */ + current_time = tx_time_get(); + time_remaining = timeout - (current_time - start_time); + if(time_remaining > 0x80000000) + { + /* Underflow */ + time_remaining = 0; + error_counter = 1; + } + nx_packet_release(current_pkt); + continue; + } + else + { + + /* Get SA. */ + ipv6_header = (NX_IPV6_HEADER*)(current_pkt -> nx_packet_prepend_ptr); + + src_addr.nxd_ip_version = NX_IP_VERSION_V6; + dest_addr.nxd_ip_version = NX_IP_VERSION_V6; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ipv6_header -> nx_ip_header_destination_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ipv6_header -> nx_ip_header_source_ip); + + COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_source_ip, + src_addr.nxd_ip_address.v6); + + + COPY_IPV6_ADDRESS(ipv6_header -> nx_ip_header_destination_ip, + dest_addr.nxd_ip_address.v6); + + /* Get SA. */ + if (is_tunneled == NX_TRUE) + { + cur_sa_ptr = ip_ptr -> nx_ip_ipsec_egress_sa_ptr; + status = NX_IPSEC_TRAFFIC_BYPASS; + + esp_header_ptr = (NX_IPSEC_ESP_HEADER*)(current_pkt -> nx_packet_prepend_ptr + 40); + + if (cur_sa_ptr != NX_NULL) + { + do + { + + /* Determine if the SA has been found based on traffic selection. */ + if (CHECK_IPV6_ADDRESSES_SAME(dest_addr.nxd_ip_address.v6, + cur_sa_ptr -> nx_ipsec_tunnel_exit_address.nxd_ip_address.v6) && + esp_header_ptr -> nx_ipsec_esp_spi == cur_sa_ptr -> nx_ipsec_sa_spi) + { + + status = NX_IPSEC_TRAFFIC_PROTECT; + egress_sa_ptr = cur_sa_ptr; + break; + } + else + { + + /* Move to the next entry in the SA list. */ + cur_sa_ptr = cur_sa_ptr -> nx_ipsec_sa_created_next; + } + } while (cur_sa_ptr != ip_ptr -> nx_ip_ipsec_egress_sa_ptr); + } + } + else + { + status = _nx_ipsec_sa_egress_lookup(ip_ptr, &src_addr, &dest_addr, + protocol, src_port, dst_port, + &data_offset, &egress_sa_ptr, option); + } + + if (status != NX_IPSEC_TRAFFIC_PROTECT) + { + nx_packet_release(current_pkt); + continue; + } + + /* Packet is a match. Decrypt packets. */ + icv_size = egress_sa_ptr -> nx_ipsec_sa_integrity_method -> nx_crypto_ICV_size_in_bits >> 3; + iv_size = egress_sa_ptr -> nx_ipsec_sa_encryption_method -> nx_crypto_IV_size_in_bits >> 3; + iv_ptr_data = (UCHAR *)pkt_data + 14 + 40 + sizeof(NX_IPSEC_ESP_HEADER); + iv_ptr_cur = current_pkt -> nx_packet_prepend_ptr + 40 + sizeof(NX_IPSEC_ESP_HEADER); + input_payload_size = pkt_size - 14 - 40 - sizeof(NX_IPSEC_ESP_HEADER) - icv_size - iv_size; + input_payload_ptr_data = iv_ptr_data + iv_size; + input_payload_ptr_cur = iv_ptr_cur + iv_size; + + status = _nx_ipsec_cryption_process(egress_sa_ptr, egress_sa_ptr -> nx_ipsec_sa_encryption_method, NX_CRYPTO_DECRYPT, + (CHAR) egress_sa_ptr -> nx_ipsec_sa_encryption_method -> nx_crypto_algorithm, + egress_sa_ptr -> nx_ipsec_sa_encrypt_key_string, + egress_sa_ptr -> nx_ipsec_sa_encrypt_key_len_in_bits, + iv_ptr_data, (egress_sa_ptr -> nx_ipsec_sa_encryption_method -> nx_crypto_IV_size_in_bits >> 3), + egress_sa_ptr -> nx_ipsec_sa_encryption_method -> nx_crypto_block_size_in_bytes, + input_payload_ptr_data, input_payload_size, + input_payload_ptr_data, input_payload_size, current_pkt); + + if (status != NX_SUCCESS) + { + nx_packet_release(current_pkt); + continue; + } + + status = _nx_ipsec_cryption_process(egress_sa_ptr, egress_sa_ptr -> nx_ipsec_sa_encryption_method, NX_CRYPTO_DECRYPT, + (CHAR) egress_sa_ptr -> nx_ipsec_sa_encryption_method -> nx_crypto_algorithm, + egress_sa_ptr -> nx_ipsec_sa_encrypt_key_string, + egress_sa_ptr -> nx_ipsec_sa_encrypt_key_len_in_bits, + iv_ptr_cur, iv_size, + egress_sa_ptr -> nx_ipsec_sa_encryption_method -> nx_crypto_block_size_in_bytes, + input_payload_ptr_cur, input_payload_size, + input_payload_ptr_cur, input_payload_size, current_pkt); + + if (status != NX_SUCCESS) + { + nx_packet_release(current_pkt); + continue; + } + + if (memcmp(input_payload_ptr_cur, input_payload_ptr_data, input_payload_size) == 0) + { + time_remaining = 0; + } + + nx_packet_release(current_pkt); + continue; + } + } + } + else + { + /* Timeout */ + if(pkt_data != NX_NULL) + { + /* We expect a packet. */ + + + error_counter = 1; + } + time_remaining = 0; + } + } +} + + + + +static void perform_assemble(NX_IP *ip_ptr, char *pkt_data, int pkt_size, int timeout, int is_last) +{ + UINT status; + NX_PACKET *current_pkt; + ULONG start_time, current_time, time_remaining; + + /* Compute the amount of time to wait for. */ + start_time = current_time = tx_time_get(); + + /* timeout value is expressed in terms of seconds. Convert it to ticks. */ + time_remaining = timeout - (current_time - start_time); + + + while(time_remaining > 0) + { + /* Wait for a packet. */ + status = tx_semaphore_get(&pkt_count_sem, time_remaining); + + if(status == NX_SUCCESS) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + current_pkt = incoming_pkts; + if(incoming_pkts) + { + incoming_pkts = incoming_pkts -> nx_packet_queue_next; + } + else + { + incoming_pkts_tail = NX_NULL; + } + tx_mutex_put(&pkt_capture_mutex); + + if(current_pkt) + { + + /* A packet has been queued. Examine the header of the packet. + Include IPv6 header and Fragmentation header in transport mode. */ + if(((UINT)(pkt_size - 14) != current_pkt -> nx_packet_length) || + (memcmp(pkt_data + 14, current_pkt -> nx_packet_prepend_ptr, 40) != 0)) + { + /* Not a match. */ + + /* Compute new timeout value. */ + current_time = tx_time_get(); + time_remaining = timeout - (current_time - start_time); + if(time_remaining > 0x80000000) + { + /* Underflow */ + time_remaining = 0; + error_counter = 1; + } + nx_packet_release(current_pkt); + continue; + } + else + { + /* Packet is a match. Assemble packet. */ + + if (fragment_cnt == 0) + { + /* Allocate a packet. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &assemble_pkt, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + nx_packet_release(current_pkt); + continue; + } + + memcpy(assemble_pkt_data, pkt_data, 54); + + /* Copy IPv6 header. */ + memcpy(assemble_pkt -> nx_packet_append_ptr, current_pkt -> nx_packet_prepend_ptr, 40); + assemble_pkt -> nx_packet_append_ptr += 40; + + /* Initial packet length to IPv6 header length. */ + assemble_pkt -> nx_packet_length = 40; + } + + memcpy(assemble_pkt_data + (assemble_pkt -> nx_packet_length + 14), pkt_data + 62, pkt_size - 62); + + /* Append packet data. */ + memcpy(assemble_pkt -> nx_packet_append_ptr, current_pkt -> nx_packet_prepend_ptr + 48, current_pkt -> nx_packet_length - 48); + assemble_pkt -> nx_packet_append_ptr += current_pkt -> nx_packet_length - 48; + + /* Increase packet length by data. */ + assemble_pkt -> nx_packet_length += current_pkt -> nx_packet_length - 48; + + fragment_cnt++; + + /* Put assembled packet to incoming packet chain. */ + if (is_last == NX_TRUE) + { + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + + if(incoming_pkts == NX_NULL) + { + incoming_pkts = assemble_pkt; + } + else + { + incoming_pkts_tail -> nx_packet_queue_next = assemble_pkt; + } + incoming_pkts_tail = assemble_pkt; + + assemble_pkt -> nx_packet_queue_next = NX_NULL; + + tx_mutex_put(&pkt_capture_mutex); + + tx_semaphore_put(&pkt_count_sem); + + fragment_cnt = 0; + + } + + time_remaining = 0; + nx_packet_release(current_pkt); + continue; + } + } + } + else + { + /* Timeout */ + if(pkt_data != NX_NULL) + { + /* We expect a packet. */ + + + error_counter = 1; + } + time_remaining = 0; + } + } +} +#endif + +static void inject_packet(NX_IP *ip_ptr, char *pkt_data, int pkt_size) +{ + +UINT status; +NX_PACKET *my_packet; + + /* Now, this packet is a received one, allocate the packet and let the IP stack receives it. */ + /* Allocate a packet. */ + status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &my_packet, 0, NX_WAIT_FOREVER); + + /* Check status. */ + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + my_packet -> nx_packet_length = pkt_size - 14; + memcpy(my_packet -> nx_packet_prepend_ptr + 16, pkt_data + 14, my_packet -> nx_packet_length); + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + my_packet -> nx_packet_length; + + my_packet -> nx_packet_prepend_ptr += 16; + my_packet -> nx_packet_append_ptr += 16; + + _nx_ip_packet_deferred_receive(ip_ptr, my_packet); + +} + +static void dump_packets(void) +{ + + NX_PACKET *tmp_pkt; + + tmp_pkt = incoming_pkts; + + while(tmp_pkt) + { + tx_semaphore_get(&pkt_count_sem, 0); + incoming_pkts = tmp_pkt -> nx_packet_queue_next; + nx_packet_release(tmp_pkt); + tmp_pkt = incoming_pkts; + } + incoming_pkts = NX_NULL; + +} + +/* Make sure the packet initial is right. */ +static void clean_hop_limit(NX_IP *ip_ptr) +{ + + /* Add by wangyang for the simulation TAHI test in VS. */ + ip_ptr -> nx_ipv6_hop_limit = 0xff; +} + +/* Do ping6 process. */ +static void perform_check_v6request(NX_IP *ip_ptr, UCHAR flag, UINT length, char *pkt_data, int pkt_size, int timeout) +{ + + /* Define the variable for ping6 process. */ + NXD_ADDRESS ping6add1; + CHAR ping6data1[1452]= "12"; + NX_PACKET *my_packet; + int i; + + /* flag = 0 means pmtu.p2 ping6 test. */ + /* flag = 1 means icmp.p2 ping6 test. */ + if (flag == 0) + { + ping6add1.nxd_ip_version = NX_IP_VERSION_V6; + ping6add1.nxd_ip_address.v6[0] = 0xFF1E0000; + ping6add1.nxd_ip_address.v6[1] = 0x00000000; + ping6add1.nxd_ip_address.v6[2] = 0x00000000; + ping6add1.nxd_ip_address.v6[3] = 0x00010002; + + for(i = 0; i < 1452; i++) + ping6data1[i] = '0'; + } + else + { + ping6add1.nxd_ip_version = NX_IP_VERSION_V6; + ping6add1.nxd_ip_address.v6[0] = 0xfe800000; + ping6add1.nxd_ip_address.v6[1] = 0x00000000; + ping6add1.nxd_ip_address.v6[2] = 0x020000ff; + ping6add1.nxd_ip_address.v6[3] = 0xfe000100; + } + + /* used for icmp.p2 test and do ping6 process. */ + nxd_icmp_ping(ip_ptr, &ping6add1, ping6data1, length, &my_packet, 0); + + /* Invoke the check function to check the ping6 request packet. */ + perform_check(pkt_data, pkt_size, timeout); +} + +/* Reboot process. */ +static void perform_reboot(NX_IP *ip_ptr) +{ + +static NXD_ADDRESS ipv6_address_1; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + nx_ip_fragment_disable(ip_ptr); + + if(ip_ptr -> nx_ipv6_address[0].nxd_ipv6_address[0]) + nxd_ipv6_address_delete(ip_ptr, 0); + if(ip_ptr -> nx_ipv6_address[1].nxd_ipv6_address[0]) + nxd_ipv6_address_delete(ip_ptr, 1); + + ip_ptr -> nx_ipv6_packet_receive = NULL; + + /* nx_ipv6_hop_limit make sure the after reboot process the limit is back to the 0xff. */ + ip_ptr -> nx_ipv6_hop_limit = 0xff; + + /* nx_ip_packet_id affects the fragment identifier. */ + ip_ptr -> nx_ip_packet_id = NX_INIT_PACKET_ID; + + /* nx_ip_icmp_sequence affects the ping6 request sequence. */ + ip_ptr -> nx_ip_icmp_sequence = 0; + + /* Enable IPv6 */ + nxd_ipv6_enable(ip_ptr); + + /* Enable ICMPv6 */ + nxd_icmp_enable(ip_ptr); + + nx_ip_fragment_enable(ip_ptr); + + nxd_ipv6_address_set(ip_ptr, 0, &ipv6_address_1,64, NX_NULL); +} + +static void dhcpv6_confirm() +{ + nx_dhcpv6_request_confirm(tahi_dhcpv6_client_ptr); +} + +static void dhcpv6_release() +{ + nx_dhcpv6_request_release(tahi_dhcpv6_client_ptr); +} + +void netx_tahi_set_dhcpv6(NX_DHCPV6 *dhcpv6_client_ptr) +{ + tahi_dhcpv6_client_ptr = dhcpv6_client_ptr; +} + +void netx_tahi_set_dhcpv6_dns(void (*dhcpv6_dns)()) +{ + tahi_dhcpv6_dns = dhcpv6_dns; +} + +void netx_tahi_set_dhcpv6_reboot(void (*dhcpv6_reboot)()) +{ + tahi_dhcpv6_reboot = dhcpv6_reboot; +} + +void netx_tahi_set_dhcpv6_info_request(void (*dhcpv6_info_request)()) +{ + tahi_dhcpv6_info_request = dhcpv6_info_request; +} + +extern ULONG test_control_successful_tests; +extern ULONG test_control_failed_tests; +static int steps; +void netx_tahi_run_test_case(NX_IP *ip_ptr, TAHI_TEST_SEQ *test_case, int test_case_size) +{ + + int i; + + /* Init the semaphore and mutex. */ + tx_mutex_create(&pkt_capture_mutex, "TAHI PKT CAPTURE", 0); + tx_semaphore_create(&pkt_count_sem, "TAHI_PKT COUNT SEM", 0); + + /* Set the flag to queue up packets. */ + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + pkt_capture_flag = 1; + tx_mutex_put(&pkt_capture_mutex); + + packet_process_callback = packet_process; + + in_cleanup_process = 0; + error_counter = 0; + for(steps = 0; steps < test_case_size; steps++) + { + + /* If error has occured, skip all the test steps and start the cleanup process. */ + if(error_counter && !in_cleanup_process) + { + if(test_case[steps].command != CLEANUP) + continue; + } + + switch(test_case[steps].command) + { + case CLEANUP: + /* This is a marker. Nothing needs to be done here. */ + in_cleanup_process = 1; + continue; + + case TITLE: + printf("NetX Test: TAHI %s TEST", test_case[steps].pkt_data); + + /* Align the output. */ + for (i = test_case[steps].pkt_size; i <= 47; i++) + printf("."); + break; + case INJECT: + inject_packet(ip_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size); + break; + case WAIT: + tx_thread_sleep(test_case[steps].timeout * NX_IP_PERIODIC_RATE); + break; + case CHECK: + perform_check(test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2); + break; + case N_CHECK: + perform_null_check((int)test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE); + break; + case DUMP: + dump_packets(); + break; + case CLEAN_HOP_LIMIT: + clean_hop_limit(ip_ptr); + break; + case CHECK_V6REQUEST: + perform_check_v6request(ip_ptr,test_case[steps].protocol, test_case[steps].option, test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2); + break; + case REBOOT: + perform_reboot(ip_ptr); + break; + case DHCPV6_REBOOT: + perform_reboot(ip_ptr); + tahi_dhcpv6_reboot(); + break; + case DHCPV6_INFO_REQUEST: + tahi_dhcpv6_info_request(); + break; + case DHCPV6_DNS: + tahi_dhcpv6_dns(); + break; + case DHCPV6_CONFIRM: + dhcpv6_confirm(); + break; + case DHCPV6_RELEASE: + dhcpv6_release(); + break; +#ifdef NX_IPSEC_ENABLE + case D_CHECK: + perform_decrypt_check(ip_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2, NX_FALSE, + test_case[steps].protocol, test_case[steps].src_port, test_case[steps].dst_port, test_case[steps].option); + break; + case ASSEMBLE: + perform_assemble(ip_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2, NX_FALSE); + break; + case AD_CHECK: + perform_assemble(ip_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2, NX_TRUE); + perform_decrypt_check(ip_ptr, (CHAR *)assemble_pkt_data, assemble_pkt -> nx_packet_length + 14, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2, NX_FALSE, + (UCHAR)test_case[steps].protocol, test_case[steps].src_port, test_case[steps].dst_port, test_case[steps].option); + break; + case TD_CHECK: + perform_decrypt_check(ip_ptr, test_case[steps].pkt_data, test_case[steps].pkt_size, test_case[steps].timeout* NX_IP_PERIODIC_RATE + 2, NX_TRUE, + test_case[steps].protocol, test_case[steps].src_port, test_case[steps].dst_port, test_case[steps].option); + break; +#endif + default: + break; + } + } + /* Set the flag to queue up packets. */ + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + pkt_capture_flag = 0; + tx_mutex_put(&pkt_capture_mutex); + dump_packets(); + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_failed_tests++; + } + else + { + printf("SUCCESS!\n"); + test_control_successful_tests++; + } + + tx_mutex_delete(&pkt_capture_mutex); + tx_semaphore_delete(&pkt_count_sem); +} + +static UINT packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + tx_mutex_get(&pkt_capture_mutex, TX_WAIT_FOREVER); + if(pkt_capture_flag == 0) + { + nx_packet_release(packet_ptr); + tx_mutex_put(&pkt_capture_mutex); + return NX_NULL; + } + + if(incoming_pkts == NX_NULL) + { + incoming_pkts = packet_ptr; + } + else + { + incoming_pkts_tail -> nx_packet_queue_next = packet_ptr; + } + incoming_pkts_tail = packet_ptr; + + packet_ptr -> nx_packet_queue_next = NX_NULL; + + tx_mutex_put(&pkt_capture_mutex); + + tx_semaphore_put(&pkt_count_sem); + + return NX_NULL; +} + +UINT tahi_dhcpv6_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) +{ +NX_UDP_HEADER *udp_header_ptr; +ULONG src_dst_port; +ULONG message_type; +NX_IPV6_HEADER *ip_header; +ULONG checksum; +ULONG *ip_src_addr, *ip_dest_addr; +UCHAR cid[18] = {0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, + 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, 0x22, 0x33, + 0x44, 0x56}; + + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr + 40); + src_dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(src_dst_port); + + + /* From port 546(client) to 547(server). Check if this is a DHCPv6 packet sent from client to server*/ + if(src_dst_port == 0x02220223) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + /* Get message type. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + + if(message_type == NX_DHCPV6_MESSAGE_TYPE_SOLICIT) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e01; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x900e0803; + } + else if((message_type == NX_DHCPV6_MESSAGE_TYPE_CONFIRM) || + (message_type == NX_DHCPV6_MESSAGE_TYPE_RENEW) || + (message_type == NX_DHCPV6_MESSAGE_TYPE_REBIND) || + (message_type == NX_DHCPV6_MESSAGE_TYPE_RELEASE) || + (message_type == NX_DHCPV6_MESSAGE_TYPE_DECLINE)) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x66915200 + message_type; + } + else if(message_type == NX_DHCPV6_MESSAGE_TYPE_INFORM_REQUEST) + { + /* Record original xid, modify the xid to be the same with Tahi test packet. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 9, 3, &original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0x12f03e0b; + } + + /* Record original cid, modify the cid to be the same with Tahi test packet. */ + memcpy(original_cid, (packet_ptr -> nx_packet_prepend_ptr + 12), 18); + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + } + /* dst port 53, dns */ + else if((src_dst_port & 0x0000FFFF) == 0x00000035) + { + packet_ptr -> nx_packet_prepend_ptr += 40; + packet_ptr -> nx_packet_length -= 40; + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr = &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the transmit ID to be the same with the packet captured by wireshark. */ + *(USHORT *)(packet_ptr -> nx_packet_prepend_ptr + 8) = 0xf907; + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + packet_ptr -> nx_packet_prepend_ptr -= 40; + packet_ptr -> nx_packet_length += 40; + + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_source_ip); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_header -> nx_ip_header_destination_ip); + + } + + return NX_TRUE; + +} + +void tahi_dhcpv6_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +ULONG *ip_src_addr, *ip_dest_addr; +ULONG dst_port; +NX_UDP_HEADER *udp_header_ptr; +ULONG checksum; +NX_IPV6_HEADER *ip_header; +ULONG message_type; + + udp_header_ptr = (NX_UDP_HEADER*)(packet_ptr -> nx_packet_prepend_ptr); + dst_port = udp_header_ptr -> nx_udp_header_word_0; + NX_CHANGE_ULONG_ENDIAN(dst_port); + + /* Check if this is a DHCPv6 packet sent to client. */ + if((dst_port & 0x0000FFFF) == 0x00000222) + { + + /* Get IP address for checksum computing. */ + ip_header = (NX_IPV6_HEADER *)(packet_ptr -> nx_packet_ip_header); + ip_src_addr = &(ip_header -> nx_ip_header_source_ip[0]); + ip_dest_addr= &(ip_header -> nx_ip_header_destination_ip[0]); + + + /* Modify the xid and cid. */ + _nx_dhcpv6_utility_get_data(packet_ptr -> nx_packet_prepend_ptr + 8, 1, &message_type); + NX_CHANGE_ULONG_ENDIAN(original_xid); + *(ULONG *)(packet_ptr -> nx_packet_prepend_ptr + 8) = original_xid + message_type; + memcpy(packet_ptr -> nx_packet_prepend_ptr + 12, original_cid, 18); + + + /* Compute the checksum. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Yes, we need to compute the UDP checksum. */ + checksum = _nx_ip_checksum_compute(packet_ptr, + NX_PROTOCOL_UDP, + packet_ptr -> nx_packet_length, + ip_src_addr, + ip_dest_addr); + checksum = ~checksum & NX_LOWER_16_MASK; + + /* If the computed checksum is zero, it is transmitted as all ones. */ + /* RFC 768, page 2. */ + if(checksum == 0) + checksum = 0xFFFF; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 & 0xFFFF0000; + + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | checksum; + + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_1.c b/test/regression/tahi_test/netx_tahi_test_1.c new file mode 100644 index 00000000..49d01ffc --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_1.c @@ -0,0 +1,305 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_01_001[]; +extern TAHI_TEST_SEQ tahi_01_002[]; +extern TAHI_TEST_SEQ tahi_01_003[]; +extern TAHI_TEST_SEQ tahi_01_004[]; +extern TAHI_TEST_SEQ tahi_01_005[]; +extern TAHI_TEST_SEQ tahi_01_006[]; +extern TAHI_TEST_SEQ tahi_01_007[]; +extern TAHI_TEST_SEQ tahi_01_008[]; +extern TAHI_TEST_SEQ tahi_01_009[]; +extern TAHI_TEST_SEQ tahi_01_010[]; +extern TAHI_TEST_SEQ tahi_01_011[]; +extern TAHI_TEST_SEQ tahi_01_012[]; +extern TAHI_TEST_SEQ tahi_01_013[]; +extern TAHI_TEST_SEQ tahi_01_014[]; +extern TAHI_TEST_SEQ tahi_01_015[]; +extern TAHI_TEST_SEQ tahi_01_016[]; +extern TAHI_TEST_SEQ tahi_01_017[]; +extern TAHI_TEST_SEQ tahi_01_018[]; +extern TAHI_TEST_SEQ tahi_01_019[]; +extern TAHI_TEST_SEQ tahi_01_020[]; +extern TAHI_TEST_SEQ tahi_01_021[]; +extern TAHI_TEST_SEQ tahi_01_022[]; +extern TAHI_TEST_SEQ tahi_01_023[]; +extern TAHI_TEST_SEQ tahi_01_024[]; +extern TAHI_TEST_SEQ tahi_01_025[]; +extern TAHI_TEST_SEQ tahi_01_026[]; +extern TAHI_TEST_SEQ tahi_01_027[]; +extern TAHI_TEST_SEQ tahi_01_028[]; +extern TAHI_TEST_SEQ tahi_01_029[]; +extern TAHI_TEST_SEQ tahi_01_030[]; +extern TAHI_TEST_SEQ tahi_01_031[]; +extern TAHI_TEST_SEQ tahi_01_032[]; +extern TAHI_TEST_SEQ tahi_01_033[]; +extern TAHI_TEST_SEQ tahi_01_034[]; +extern TAHI_TEST_SEQ tahi_01_035[]; +extern TAHI_TEST_SEQ tahi_01_036[]; +extern TAHI_TEST_SEQ tahi_01_037[]; +extern TAHI_TEST_SEQ tahi_01_038[]; +extern TAHI_TEST_SEQ tahi_01_039[]; +extern TAHI_TEST_SEQ tahi_01_040[]; +extern TAHI_TEST_SEQ tahi_01_041[]; +extern TAHI_TEST_SEQ tahi_01_042[]; +extern TAHI_TEST_SEQ tahi_01_043[]; +extern TAHI_TEST_SEQ tahi_01_044[]; +extern TAHI_TEST_SEQ tahi_01_045[]; +extern TAHI_TEST_SEQ tahi_01_046[]; +extern TAHI_TEST_SEQ tahi_01_047[]; +extern TAHI_TEST_SEQ tahi_01_048[]; +extern TAHI_TEST_SEQ tahi_01_049[]; +extern TAHI_TEST_SEQ tahi_01_050[]; +extern TAHI_TEST_SEQ tahi_01_051[]; +extern TAHI_TEST_SEQ tahi_01_052[]; +extern TAHI_TEST_SEQ tahi_01_053[]; +extern TAHI_TEST_SEQ tahi_01_054[]; + +extern int tahi_01_001_size; +extern int tahi_01_002_size; +extern int tahi_01_003_size; +extern int tahi_01_004_size; +extern int tahi_01_005_size; +extern int tahi_01_006_size; +extern int tahi_01_007_size; +extern int tahi_01_008_size; +extern int tahi_01_009_size; +extern int tahi_01_010_size; +extern int tahi_01_011_size; +extern int tahi_01_012_size; +extern int tahi_01_013_size; +extern int tahi_01_014_size; +extern int tahi_01_015_size; +extern int tahi_01_016_size; +extern int tahi_01_017_size; +extern int tahi_01_018_size; +extern int tahi_01_019_size; +extern int tahi_01_020_size; +extern int tahi_01_021_size; +extern int tahi_01_022_size; +extern int tahi_01_023_size; +extern int tahi_01_024_size; +extern int tahi_01_025_size; +extern int tahi_01_026_size; +extern int tahi_01_027_size; +extern int tahi_01_028_size; +extern int tahi_01_029_size; +extern int tahi_01_030_size; +extern int tahi_01_031_size; +extern int tahi_01_032_size; +extern int tahi_01_033_size; +extern int tahi_01_034_size; +extern int tahi_01_035_size; +extern int tahi_01_036_size; +extern int tahi_01_037_size; +extern int tahi_01_038_size; +extern int tahi_01_039_size; +extern int tahi_01_040_size; +extern int tahi_01_041_size; +extern int tahi_01_042_size; +extern int tahi_01_043_size; +extern int tahi_01_044_size; +extern int tahi_01_045_size; +extern int tahi_01_046_size; +extern int tahi_01_047_size; +extern int tahi_01_048_size; +extern int tahi_01_049_size; +extern int tahi_01_050_size; +extern int tahi_01_051_size; +extern int tahi_01_052_size; +extern int tahi_01_053_size; +extern int tahi_01_054_size; + +static TAHI_TEST_SUITE test_suite[54]; +static void build_test_suite(void) +{ + +#if 1 + test_suite[0].test_case = &tahi_01_001[0]; test_suite[0].test_case_size = tahi_01_001_size; + test_suite[1].test_case = &tahi_01_002[0]; test_suite[1].test_case_size = tahi_01_002_size; + test_suite[2].test_case = &tahi_01_003[0]; test_suite[2].test_case_size = tahi_01_003_size; + test_suite[3].test_case = &tahi_01_004[0]; test_suite[3].test_case_size = tahi_01_004_size; + test_suite[4].test_case = &tahi_01_005[0]; test_suite[4].test_case_size = tahi_01_005_size; + test_suite[5].test_case = &tahi_01_006[0]; test_suite[5].test_case_size = tahi_01_006_size; + test_suite[6].test_case = &tahi_01_007[0]; test_suite[6].test_case_size = tahi_01_007_size; + test_suite[7].test_case = &tahi_01_008[0]; test_suite[7].test_case_size = tahi_01_008_size; + test_suite[8].test_case = &tahi_01_009[0]; test_suite[8].test_case_size = tahi_01_009_size; + test_suite[9].test_case = &tahi_01_010[0]; test_suite[9].test_case_size = tahi_01_010_size; + test_suite[10].test_case = &tahi_01_011[0]; test_suite[10].test_case_size = tahi_01_011_size; + test_suite[11].test_case = &tahi_01_012[0]; test_suite[11].test_case_size = tahi_01_012_size; +#endif + test_suite[12].test_case = &tahi_01_013[0]; test_suite[12].test_case_size = tahi_01_013_size; + test_suite[13].test_case = &tahi_01_014[0]; test_suite[13].test_case_size = tahi_01_014_size; + test_suite[14].test_case = &tahi_01_015[0]; test_suite[14].test_case_size = tahi_01_015_size; + test_suite[15].test_case = &tahi_01_016[0]; test_suite[15].test_case_size = tahi_01_016_size; + test_suite[16].test_case = &tahi_01_017[0]; test_suite[16].test_case_size = tahi_01_017_size; + test_suite[17].test_case = &tahi_01_018[0]; test_suite[17].test_case_size = tahi_01_018_size; + test_suite[18].test_case = &tahi_01_019[0]; test_suite[18].test_case_size = tahi_01_019_size; + test_suite[19].test_case = &tahi_01_020[0]; test_suite[19].test_case_size = tahi_01_020_size; + test_suite[20].test_case = &tahi_01_021[0]; test_suite[20].test_case_size = tahi_01_021_size; + test_suite[21].test_case = &tahi_01_022[0]; test_suite[21].test_case_size = tahi_01_022_size; + test_suite[22].test_case = &tahi_01_023[0]; test_suite[22].test_case_size = tahi_01_023_size; + test_suite[23].test_case = &tahi_01_024[0]; test_suite[23].test_case_size = tahi_01_024_size; + test_suite[24].test_case = &tahi_01_025[0]; test_suite[24].test_case_size = tahi_01_025_size; + test_suite[25].test_case = &tahi_01_026[0]; test_suite[25].test_case_size = tahi_01_026_size; + test_suite[26].test_case = &tahi_01_027[0]; test_suite[26].test_case_size = tahi_01_027_size; + test_suite[27].test_case = &tahi_01_028[0]; test_suite[27].test_case_size = tahi_01_028_size; + test_suite[28].test_case = &tahi_01_029[0]; test_suite[28].test_case_size = tahi_01_029_size; + test_suite[29].test_case = &tahi_01_030[0]; test_suite[29].test_case_size = tahi_01_030_size; + test_suite[30].test_case = &tahi_01_031[0]; test_suite[30].test_case_size = tahi_01_031_size; + test_suite[31].test_case = &tahi_01_032[0]; test_suite[31].test_case_size = tahi_01_032_size; + test_suite[32].test_case = &tahi_01_033[0]; test_suite[32].test_case_size = tahi_01_033_size; + test_suite[33].test_case = &tahi_01_034[0]; test_suite[33].test_case_size = tahi_01_034_size; + test_suite[34].test_case = &tahi_01_035[0]; test_suite[34].test_case_size = tahi_01_035_size; + test_suite[35].test_case = &tahi_01_036[0]; test_suite[35].test_case_size = tahi_01_036_size; + test_suite[36].test_case = &tahi_01_037[0]; test_suite[36].test_case_size = tahi_01_037_size; + test_suite[37].test_case = &tahi_01_038[0]; test_suite[37].test_case_size = tahi_01_038_size; + test_suite[38].test_case = &tahi_01_039[0]; test_suite[38].test_case_size = tahi_01_039_size; + test_suite[39].test_case = &tahi_01_040[0]; test_suite[39].test_case_size = tahi_01_040_size; + test_suite[40].test_case = &tahi_01_041[0]; test_suite[40].test_case_size = tahi_01_041_size; + test_suite[41].test_case = &tahi_01_042[0]; test_suite[41].test_case_size = tahi_01_042_size; + test_suite[42].test_case = &tahi_01_043[0]; test_suite[42].test_case_size = tahi_01_043_size; + test_suite[43].test_case = &tahi_01_044[0]; test_suite[43].test_case_size = tahi_01_044_size; + test_suite[44].test_case = &tahi_01_045[0]; test_suite[44].test_case_size = tahi_01_045_size; + test_suite[45].test_case = &tahi_01_046[0]; test_suite[45].test_case_size = tahi_01_046_size; + test_suite[46].test_case = &tahi_01_047[0]; test_suite[46].test_case_size = tahi_01_047_size; + test_suite[47].test_case = &tahi_01_048[0]; test_suite[47].test_case_size = tahi_01_048_size; + test_suite[48].test_case = &tahi_01_049[0]; test_suite[48].test_case_size = tahi_01_049_size; + test_suite[49].test_case = &tahi_01_050[0]; test_suite[49].test_case_size = tahi_01_050_size; + test_suite[50].test_case = &tahi_01_051[0]; test_suite[50].test_case_size = tahi_01_051_size; + test_suite[51].test_case = &tahi_01_052[0]; test_suite[51].test_case_size = tahi_01_052_size; + test_suite[52].test_case = &tahi_01_053[0]; test_suite[52].test_case_size = tahi_01_053_size; + test_suite[53].test_case = &tahi_01_054[0]; test_suite[53].test_case_size = tahi_01_054_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_1_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_01.c b/test/regression/tahi_test/netx_tahi_test_2_01.c new file mode 100644 index 00000000..4a3408d9 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_01.c @@ -0,0 +1,525 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_001[]; +extern TAHI_TEST_SEQ tahi_02_002[]; +extern TAHI_TEST_SEQ tahi_02_003[]; +extern TAHI_TEST_SEQ tahi_02_004[]; +extern TAHI_TEST_SEQ tahi_02_005[]; +extern TAHI_TEST_SEQ tahi_02_006[]; +extern TAHI_TEST_SEQ tahi_02_007[]; +extern TAHI_TEST_SEQ tahi_02_008[]; +extern TAHI_TEST_SEQ tahi_02_009[]; +extern TAHI_TEST_SEQ tahi_02_010[]; +extern TAHI_TEST_SEQ tahi_02_011[]; +extern TAHI_TEST_SEQ tahi_02_012[]; +extern TAHI_TEST_SEQ tahi_02_013[]; +extern TAHI_TEST_SEQ tahi_02_014[]; +extern TAHI_TEST_SEQ tahi_02_015[]; +extern TAHI_TEST_SEQ tahi_02_016[]; +extern TAHI_TEST_SEQ tahi_02_017[]; +extern TAHI_TEST_SEQ tahi_02_018[]; +extern TAHI_TEST_SEQ tahi_02_019[]; +extern TAHI_TEST_SEQ tahi_02_020[]; +extern TAHI_TEST_SEQ tahi_02_021[]; +extern TAHI_TEST_SEQ tahi_02_022[]; +extern TAHI_TEST_SEQ tahi_02_023[]; +extern TAHI_TEST_SEQ tahi_02_024[]; +extern TAHI_TEST_SEQ tahi_02_025[]; +extern TAHI_TEST_SEQ tahi_02_026[]; +extern TAHI_TEST_SEQ tahi_02_027[]; +extern TAHI_TEST_SEQ tahi_02_028[]; +extern TAHI_TEST_SEQ tahi_02_029[]; +extern TAHI_TEST_SEQ tahi_02_030[]; +extern TAHI_TEST_SEQ tahi_02_031[]; +extern TAHI_TEST_SEQ tahi_02_032[]; +extern TAHI_TEST_SEQ tahi_02_033[]; +extern TAHI_TEST_SEQ tahi_02_034[]; +extern TAHI_TEST_SEQ tahi_02_035[]; +extern TAHI_TEST_SEQ tahi_02_036[]; +extern TAHI_TEST_SEQ tahi_02_037[]; +extern TAHI_TEST_SEQ tahi_02_038[]; +extern TAHI_TEST_SEQ tahi_02_039[]; +extern TAHI_TEST_SEQ tahi_02_040[]; +extern TAHI_TEST_SEQ tahi_02_041[]; +extern TAHI_TEST_SEQ tahi_02_042[]; +extern TAHI_TEST_SEQ tahi_02_043[]; +extern TAHI_TEST_SEQ tahi_02_044[]; +extern TAHI_TEST_SEQ tahi_02_045[]; +extern TAHI_TEST_SEQ tahi_02_046[]; +extern TAHI_TEST_SEQ tahi_02_047[]; +extern TAHI_TEST_SEQ tahi_02_048[]; +extern TAHI_TEST_SEQ tahi_02_049[]; +extern TAHI_TEST_SEQ tahi_02_050[]; +extern TAHI_TEST_SEQ tahi_02_051[]; +extern TAHI_TEST_SEQ tahi_02_052[]; +extern TAHI_TEST_SEQ tahi_02_053[]; +extern TAHI_TEST_SEQ tahi_02_054[]; +extern TAHI_TEST_SEQ tahi_02_055[]; +extern TAHI_TEST_SEQ tahi_02_056[]; +extern TAHI_TEST_SEQ tahi_02_057[]; +extern TAHI_TEST_SEQ tahi_02_058[]; +extern TAHI_TEST_SEQ tahi_02_059[]; +extern TAHI_TEST_SEQ tahi_02_060[]; +extern TAHI_TEST_SEQ tahi_02_061[]; +extern TAHI_TEST_SEQ tahi_02_062[]; +extern TAHI_TEST_SEQ tahi_02_063[]; +extern TAHI_TEST_SEQ tahi_02_064[]; +extern TAHI_TEST_SEQ tahi_02_065[]; +extern TAHI_TEST_SEQ tahi_02_066[]; +extern TAHI_TEST_SEQ tahi_02_067[]; +extern TAHI_TEST_SEQ tahi_02_068[]; +extern TAHI_TEST_SEQ tahi_02_069[]; +extern TAHI_TEST_SEQ tahi_02_070[]; +extern TAHI_TEST_SEQ tahi_02_071[]; +extern TAHI_TEST_SEQ tahi_02_072[]; +extern TAHI_TEST_SEQ tahi_02_073[]; +extern TAHI_TEST_SEQ tahi_02_074[]; +extern TAHI_TEST_SEQ tahi_02_075[]; +extern TAHI_TEST_SEQ tahi_02_076[]; +extern TAHI_TEST_SEQ tahi_02_077[]; +extern TAHI_TEST_SEQ tahi_02_078[]; +extern TAHI_TEST_SEQ tahi_02_079[]; +extern TAHI_TEST_SEQ tahi_02_080[]; +extern TAHI_TEST_SEQ tahi_02_081[]; +extern TAHI_TEST_SEQ tahi_02_082[]; +extern TAHI_TEST_SEQ tahi_02_083[]; +extern TAHI_TEST_SEQ tahi_02_084[]; +extern TAHI_TEST_SEQ tahi_02_085[]; +extern TAHI_TEST_SEQ tahi_02_086[]; +extern TAHI_TEST_SEQ tahi_02_087[]; +extern TAHI_TEST_SEQ tahi_02_088[]; +extern TAHI_TEST_SEQ tahi_02_089[]; +extern TAHI_TEST_SEQ tahi_02_090[]; +extern TAHI_TEST_SEQ tahi_02_091[]; +extern TAHI_TEST_SEQ tahi_02_092[]; +extern TAHI_TEST_SEQ tahi_02_093[]; +extern TAHI_TEST_SEQ tahi_02_094[]; +extern TAHI_TEST_SEQ tahi_02_095[]; +extern TAHI_TEST_SEQ tahi_02_096[]; +extern TAHI_TEST_SEQ tahi_02_097[]; +extern TAHI_TEST_SEQ tahi_02_098[]; +extern TAHI_TEST_SEQ tahi_02_099[]; + +extern TAHI_TEST_SEQ tahi_02_100[]; +extern TAHI_TEST_SEQ tahi_02_101[]; +extern TAHI_TEST_SEQ tahi_02_102[]; +extern TAHI_TEST_SEQ tahi_02_103[]; +extern TAHI_TEST_SEQ tahi_02_104[]; +extern TAHI_TEST_SEQ tahi_02_105[]; +extern TAHI_TEST_SEQ tahi_02_106[]; +extern TAHI_TEST_SEQ tahi_02_107[]; +extern TAHI_TEST_SEQ tahi_02_108[]; +extern TAHI_TEST_SEQ tahi_02_109[]; +extern TAHI_TEST_SEQ tahi_02_110[]; +extern TAHI_TEST_SEQ tahi_02_111[]; +extern TAHI_TEST_SEQ tahi_02_112[]; +extern TAHI_TEST_SEQ tahi_02_113[]; +extern TAHI_TEST_SEQ tahi_02_114[]; +extern TAHI_TEST_SEQ tahi_02_115[]; +extern TAHI_TEST_SEQ tahi_02_116[]; +extern TAHI_TEST_SEQ tahi_02_117[]; +extern TAHI_TEST_SEQ tahi_02_118[]; +extern TAHI_TEST_SEQ tahi_02_119[]; +extern TAHI_TEST_SEQ tahi_02_120[]; +extern TAHI_TEST_SEQ tahi_02_121[]; +extern TAHI_TEST_SEQ tahi_02_122[]; +extern TAHI_TEST_SEQ tahi_02_123[]; +extern TAHI_TEST_SEQ tahi_02_124[]; +extern TAHI_TEST_SEQ tahi_02_125[]; +extern TAHI_TEST_SEQ tahi_02_126[]; + +extern int tahi_02_001_size; +extern int tahi_02_002_size; +extern int tahi_02_003_size; +extern int tahi_02_004_size; +extern int tahi_02_005_size; +extern int tahi_02_006_size; +extern int tahi_02_007_size; +extern int tahi_02_008_size; +extern int tahi_02_009_size; +extern int tahi_02_010_size; +extern int tahi_02_011_size; +extern int tahi_02_012_size; +extern int tahi_02_013_size; +extern int tahi_02_014_size; +extern int tahi_02_015_size; +extern int tahi_02_016_size; +extern int tahi_02_017_size; +extern int tahi_02_018_size; +extern int tahi_02_019_size; +extern int tahi_02_020_size; +extern int tahi_02_021_size; +extern int tahi_02_022_size; +extern int tahi_02_023_size; +extern int tahi_02_024_size; +extern int tahi_02_025_size; +extern int tahi_02_026_size; +extern int tahi_02_027_size; +extern int tahi_02_028_size; +extern int tahi_02_029_size; +extern int tahi_02_030_size; +extern int tahi_02_031_size; +extern int tahi_02_032_size; +extern int tahi_02_033_size; +extern int tahi_02_034_size; +extern int tahi_02_035_size; +extern int tahi_02_036_size; +extern int tahi_02_037_size; +extern int tahi_02_038_size; +extern int tahi_02_039_size; +extern int tahi_02_040_size; +extern int tahi_02_041_size; +extern int tahi_02_042_size; +extern int tahi_02_043_size; +extern int tahi_02_044_size; +extern int tahi_02_045_size; +extern int tahi_02_046_size; +extern int tahi_02_047_size; +extern int tahi_02_048_size; +extern int tahi_02_049_size; +extern int tahi_02_050_size; +extern int tahi_02_051_size; +extern int tahi_02_052_size; +extern int tahi_02_053_size; +extern int tahi_02_054_size; +extern int tahi_02_055_size; +extern int tahi_02_056_size; +extern int tahi_02_057_size; +extern int tahi_02_058_size; +extern int tahi_02_059_size; +extern int tahi_02_060_size; +extern int tahi_02_061_size; +extern int tahi_02_062_size; +extern int tahi_02_063_size; +extern int tahi_02_064_size; +extern int tahi_02_065_size; +extern int tahi_02_066_size; +extern int tahi_02_067_size; +extern int tahi_02_068_size; +extern int tahi_02_069_size; +extern int tahi_02_070_size; +extern int tahi_02_071_size; +extern int tahi_02_072_size; +extern int tahi_02_073_size; +extern int tahi_02_074_size; +extern int tahi_02_075_size; +extern int tahi_02_076_size; +extern int tahi_02_077_size; +extern int tahi_02_078_size; +extern int tahi_02_079_size; +extern int tahi_02_080_size; +extern int tahi_02_081_size; +extern int tahi_02_082_size; +extern int tahi_02_083_size; +extern int tahi_02_084_size; +extern int tahi_02_085_size; +extern int tahi_02_086_size; +extern int tahi_02_087_size; +extern int tahi_02_088_size; +extern int tahi_02_089_size; +extern int tahi_02_090_size; +extern int tahi_02_091_size; +extern int tahi_02_092_size; +extern int tahi_02_093_size; +extern int tahi_02_094_size; +extern int tahi_02_095_size; +extern int tahi_02_096_size; +extern int tahi_02_097_size; +extern int tahi_02_098_size; +extern int tahi_02_099_size; + +extern int tahi_02_100_size; +extern int tahi_02_101_size; +extern int tahi_02_102_size; +extern int tahi_02_103_size; +extern int tahi_02_104_size; +extern int tahi_02_105_size; +extern int tahi_02_106_size; +extern int tahi_02_107_size; +extern int tahi_02_108_size; +extern int tahi_02_109_size; +extern int tahi_02_110_size; +extern int tahi_02_111_size; +extern int tahi_02_112_size; +extern int tahi_02_113_size; +extern int tahi_02_114_size; +extern int tahi_02_115_size; +extern int tahi_02_116_size; +extern int tahi_02_117_size; +extern int tahi_02_118_size; +extern int tahi_02_119_size; +extern int tahi_02_120_size; +extern int tahi_02_121_size; +extern int tahi_02_122_size; +extern int tahi_02_123_size; +extern int tahi_02_124_size; +extern int tahi_02_125_size; +extern int tahi_02_126_size; + +static TAHI_TEST_SUITE test_suite[126]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_001[0]; test_suite[0].test_case_size = tahi_02_001_size; + test_suite[1].test_case = &tahi_02_002[0]; test_suite[1].test_case_size = tahi_02_002_size; + test_suite[2].test_case = &tahi_02_003[0]; test_suite[2].test_case_size = tahi_02_003_size; + test_suite[3].test_case = &tahi_02_004[0]; test_suite[3].test_case_size = tahi_02_004_size; + test_suite[4].test_case = &tahi_02_005[0]; test_suite[4].test_case_size = tahi_02_005_size; + test_suite[5].test_case = &tahi_02_006[0]; test_suite[5].test_case_size = tahi_02_006_size; + test_suite[6].test_case = &tahi_02_007[0]; test_suite[6].test_case_size = tahi_02_007_size; + test_suite[7].test_case = &tahi_02_008[0]; test_suite[7].test_case_size = tahi_02_008_size; + test_suite[8].test_case = &tahi_02_009[0]; test_suite[8].test_case_size = tahi_02_009_size; + test_suite[9].test_case = &tahi_02_010[0]; test_suite[9].test_case_size = tahi_02_010_size; + test_suite[10].test_case = &tahi_02_011[0]; test_suite[10].test_case_size = tahi_02_011_size; + test_suite[11].test_case = &tahi_02_012[0]; test_suite[11].test_case_size = tahi_02_012_size; + test_suite[12].test_case = &tahi_02_013[0]; test_suite[12].test_case_size = tahi_02_013_size; + test_suite[13].test_case = &tahi_02_014[0]; test_suite[13].test_case_size = tahi_02_014_size; + test_suite[14].test_case = &tahi_02_015[0]; test_suite[14].test_case_size = tahi_02_015_size; + test_suite[15].test_case = &tahi_02_016[0]; test_suite[15].test_case_size = tahi_02_016_size; + test_suite[16].test_case = &tahi_02_017[0]; test_suite[16].test_case_size = tahi_02_017_size; + test_suite[17].test_case = &tahi_02_018[0]; test_suite[17].test_case_size = tahi_02_018_size; + test_suite[18].test_case = &tahi_02_019[0]; test_suite[18].test_case_size = tahi_02_019_size; + test_suite[19].test_case = &tahi_02_020[0]; test_suite[19].test_case_size = tahi_02_020_size; + test_suite[20].test_case = &tahi_02_021[0]; test_suite[20].test_case_size = tahi_02_021_size; + test_suite[21].test_case = &tahi_02_022[0]; test_suite[21].test_case_size = tahi_02_022_size; + test_suite[22].test_case = &tahi_02_023[0]; test_suite[22].test_case_size = tahi_02_023_size; + test_suite[23].test_case = &tahi_02_024[0]; test_suite[23].test_case_size = tahi_02_024_size; + test_suite[24].test_case = &tahi_02_025[0]; test_suite[24].test_case_size = tahi_02_025_size; + test_suite[25].test_case = &tahi_02_026[0]; test_suite[25].test_case_size = tahi_02_026_size; + test_suite[26].test_case = &tahi_02_027[0]; test_suite[26].test_case_size = tahi_02_027_size; + test_suite[27].test_case = &tahi_02_028[0]; test_suite[27].test_case_size = tahi_02_028_size; + test_suite[28].test_case = &tahi_02_029[0]; test_suite[28].test_case_size = tahi_02_029_size; + test_suite[29].test_case = &tahi_02_030[0]; test_suite[29].test_case_size = tahi_02_030_size; + test_suite[30].test_case = &tahi_02_031[0]; test_suite[30].test_case_size = tahi_02_031_size; + test_suite[31].test_case = &tahi_02_032[0]; test_suite[31].test_case_size = tahi_02_032_size; + test_suite[32].test_case = &tahi_02_033[0]; test_suite[32].test_case_size = tahi_02_033_size; + test_suite[33].test_case = &tahi_02_034[0]; test_suite[33].test_case_size = tahi_02_034_size; + test_suite[34].test_case = &tahi_02_035[0]; test_suite[34].test_case_size = tahi_02_035_size; + test_suite[35].test_case = &tahi_02_036[0]; test_suite[35].test_case_size = tahi_02_036_size; + test_suite[36].test_case = &tahi_02_037[0]; test_suite[36].test_case_size = tahi_02_037_size; + test_suite[37].test_case = &tahi_02_038[0]; test_suite[37].test_case_size = tahi_02_038_size; + test_suite[38].test_case = &tahi_02_039[0]; test_suite[38].test_case_size = tahi_02_039_size; + test_suite[39].test_case = &tahi_02_040[0]; test_suite[39].test_case_size = tahi_02_040_size; + test_suite[40].test_case = &tahi_02_041[0]; test_suite[40].test_case_size = tahi_02_041_size; + test_suite[41].test_case = &tahi_02_042[0]; test_suite[41].test_case_size = tahi_02_042_size; + test_suite[42].test_case = &tahi_02_043[0]; test_suite[42].test_case_size = tahi_02_043_size; + test_suite[43].test_case = &tahi_02_044[0]; test_suite[43].test_case_size = tahi_02_044_size; + test_suite[44].test_case = &tahi_02_045[0]; test_suite[44].test_case_size = tahi_02_045_size; + test_suite[45].test_case = &tahi_02_046[0]; test_suite[45].test_case_size = tahi_02_046_size; + test_suite[46].test_case = &tahi_02_047[0]; test_suite[46].test_case_size = tahi_02_047_size; + test_suite[47].test_case = &tahi_02_048[0]; test_suite[47].test_case_size = tahi_02_048_size; + test_suite[48].test_case = &tahi_02_049[0]; test_suite[48].test_case_size = tahi_02_049_size; + test_suite[49].test_case = &tahi_02_050[0]; test_suite[49].test_case_size = tahi_02_050_size; + test_suite[50].test_case = &tahi_02_051[0]; test_suite[50].test_case_size = tahi_02_051_size; + test_suite[51].test_case = &tahi_02_052[0]; test_suite[51].test_case_size = tahi_02_052_size; + test_suite[52].test_case = &tahi_02_053[0]; test_suite[52].test_case_size = tahi_02_053_size; + test_suite[53].test_case = &tahi_02_054[0]; test_suite[53].test_case_size = tahi_02_054_size; + test_suite[54].test_case = &tahi_02_055[0]; test_suite[54].test_case_size = tahi_02_055_size; + test_suite[55].test_case = &tahi_02_056[0]; test_suite[55].test_case_size = tahi_02_056_size; + test_suite[56].test_case = &tahi_02_057[0]; test_suite[56].test_case_size = tahi_02_057_size; + test_suite[57].test_case = &tahi_02_058[0]; test_suite[57].test_case_size = tahi_02_058_size; + test_suite[58].test_case = &tahi_02_059[0]; test_suite[58].test_case_size = tahi_02_059_size; + test_suite[59].test_case = &tahi_02_060[0]; test_suite[59].test_case_size = tahi_02_060_size; + test_suite[60].test_case = &tahi_02_061[0]; test_suite[60].test_case_size = tahi_02_061_size; + test_suite[61].test_case = &tahi_02_062[0]; test_suite[61].test_case_size = tahi_02_062_size; + test_suite[62].test_case = &tahi_02_063[0]; test_suite[62].test_case_size = tahi_02_063_size; + test_suite[63].test_case = &tahi_02_064[0]; test_suite[63].test_case_size = tahi_02_064_size; + test_suite[64].test_case = &tahi_02_065[0]; test_suite[64].test_case_size = tahi_02_065_size; + test_suite[65].test_case = &tahi_02_066[0]; test_suite[65].test_case_size = tahi_02_066_size; + test_suite[66].test_case = &tahi_02_067[0]; test_suite[66].test_case_size = tahi_02_067_size; + test_suite[67].test_case = &tahi_02_068[0]; test_suite[67].test_case_size = tahi_02_068_size; + test_suite[68].test_case = &tahi_02_069[0]; test_suite[68].test_case_size = tahi_02_069_size; + test_suite[69].test_case = &tahi_02_070[0]; test_suite[69].test_case_size = tahi_02_070_size; + test_suite[70].test_case = &tahi_02_071[0]; test_suite[70].test_case_size = tahi_02_071_size; + test_suite[71].test_case = &tahi_02_072[0]; test_suite[71].test_case_size = tahi_02_072_size; + test_suite[72].test_case = &tahi_02_073[0]; test_suite[72].test_case_size = tahi_02_073_size; + test_suite[73].test_case = &tahi_02_074[0]; test_suite[73].test_case_size = tahi_02_074_size; + test_suite[74].test_case = &tahi_02_075[0]; test_suite[74].test_case_size = tahi_02_075_size; + test_suite[75].test_case = &tahi_02_076[0]; test_suite[75].test_case_size = tahi_02_076_size; + test_suite[76].test_case = &tahi_02_077[0]; test_suite[76].test_case_size = tahi_02_077_size; + test_suite[77].test_case = &tahi_02_078[0]; test_suite[77].test_case_size = tahi_02_078_size; + test_suite[78].test_case = &tahi_02_079[0]; test_suite[78].test_case_size = tahi_02_079_size; + test_suite[79].test_case = &tahi_02_080[0]; test_suite[79].test_case_size = tahi_02_080_size; + test_suite[80].test_case = &tahi_02_081[0]; test_suite[80].test_case_size = tahi_02_081_size; + test_suite[81].test_case = &tahi_02_082[0]; test_suite[81].test_case_size = tahi_02_082_size; + test_suite[82].test_case = &tahi_02_083[0]; test_suite[82].test_case_size = tahi_02_083_size; + test_suite[83].test_case = &tahi_02_084[0]; test_suite[83].test_case_size = tahi_02_084_size; + test_suite[84].test_case = &tahi_02_085[0]; test_suite[84].test_case_size = tahi_02_085_size; + test_suite[85].test_case = &tahi_02_086[0]; test_suite[85].test_case_size = tahi_02_086_size; + test_suite[86].test_case = &tahi_02_087[0]; test_suite[86].test_case_size = tahi_02_087_size; + test_suite[87].test_case = &tahi_02_088[0]; test_suite[87].test_case_size = tahi_02_088_size; + test_suite[88].test_case = &tahi_02_089[0]; test_suite[88].test_case_size = tahi_02_089_size; + test_suite[89].test_case = &tahi_02_090[0]; test_suite[89].test_case_size = tahi_02_090_size; + test_suite[90].test_case = &tahi_02_091[0]; test_suite[90].test_case_size = tahi_02_091_size; + test_suite[91].test_case = &tahi_02_092[0]; test_suite[91].test_case_size = tahi_02_092_size; + test_suite[92].test_case = &tahi_02_093[0]; test_suite[92].test_case_size = tahi_02_093_size; + test_suite[93].test_case = &tahi_02_094[0]; test_suite[93].test_case_size = tahi_02_094_size; + test_suite[94].test_case = &tahi_02_095[0]; test_suite[94].test_case_size = tahi_02_095_size; + test_suite[95].test_case = &tahi_02_096[0]; test_suite[95].test_case_size = tahi_02_096_size; + test_suite[96].test_case = &tahi_02_097[0]; test_suite[96].test_case_size = tahi_02_097_size; + test_suite[97].test_case = &tahi_02_098[0]; test_suite[97].test_case_size = tahi_02_098_size; + test_suite[98].test_case = &tahi_02_099[0]; test_suite[98].test_case_size = tahi_02_099_size; + test_suite[99].test_case = &tahi_02_100[0]; test_suite[99].test_case_size = tahi_02_100_size; + test_suite[100].test_case = &tahi_02_101[0]; test_suite[100].test_case_size = tahi_02_101_size; + test_suite[101].test_case = &tahi_02_102[0]; test_suite[101].test_case_size = tahi_02_102_size; + test_suite[102].test_case = &tahi_02_103[0]; test_suite[102].test_case_size = tahi_02_103_size; + test_suite[103].test_case = &tahi_02_104[0]; test_suite[103].test_case_size = tahi_02_104_size; + test_suite[104].test_case = &tahi_02_105[0]; test_suite[104].test_case_size = tahi_02_105_size; + test_suite[105].test_case = &tahi_02_106[0]; test_suite[105].test_case_size = tahi_02_106_size; + test_suite[106].test_case = &tahi_02_107[0]; test_suite[106].test_case_size = tahi_02_107_size; + test_suite[107].test_case = &tahi_02_108[0]; test_suite[107].test_case_size = tahi_02_108_size; + test_suite[108].test_case = &tahi_02_109[0]; test_suite[108].test_case_size = tahi_02_109_size; + test_suite[109].test_case = &tahi_02_110[0]; test_suite[109].test_case_size = tahi_02_110_size; + test_suite[110].test_case = &tahi_02_111[0]; test_suite[110].test_case_size = tahi_02_111_size; + test_suite[111].test_case = &tahi_02_112[0]; test_suite[111].test_case_size = tahi_02_112_size; + test_suite[112].test_case = &tahi_02_113[0]; test_suite[112].test_case_size = tahi_02_113_size; + test_suite[113].test_case = &tahi_02_114[0]; test_suite[113].test_case_size = tahi_02_114_size; + test_suite[114].test_case = &tahi_02_115[0]; test_suite[114].test_case_size = tahi_02_115_size; + test_suite[115].test_case = &tahi_02_116[0]; test_suite[115].test_case_size = tahi_02_116_size; + test_suite[116].test_case = &tahi_02_117[0]; test_suite[116].test_case_size = tahi_02_117_size; + test_suite[117].test_case = &tahi_02_118[0]; test_suite[117].test_case_size = tahi_02_118_size; + test_suite[118].test_case = &tahi_02_119[0]; test_suite[118].test_case_size = tahi_02_119_size; + test_suite[119].test_case = &tahi_02_120[0]; test_suite[119].test_case_size = tahi_02_120_size; + test_suite[120].test_case = &tahi_02_121[0]; test_suite[120].test_case_size = tahi_02_121_size; + test_suite[121].test_case = &tahi_02_122[0]; test_suite[121].test_case_size = tahi_02_122_size; + test_suite[122].test_case = &tahi_02_123[0]; test_suite[122].test_case_size = tahi_02_123_size; + test_suite[123].test_case = &tahi_02_124[0]; test_suite[123].test_case_size = tahi_02_124_size; + test_suite[124].test_case = &tahi_02_125[0]; test_suite[124].test_case_size = tahi_02_125_size; + test_suite[125].test_case = &tahi_02_126[0]; test_suite[125].test_case_size = tahi_02_126_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_1_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_02.c b/test/regression/tahi_test/netx_tahi_test_2_02.c new file mode 100644 index 00000000..9934045d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_02.c @@ -0,0 +1,146 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_127[]; + + +extern int tahi_02_127_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_127[0]; test_suite[0].test_case_size = tahi_02_127_size; +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_2_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64,NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif + diff --git a/test/regression/tahi_test/netx_tahi_test_2_03.c b/test/regression/tahi_test/netx_tahi_test_2_03.c new file mode 100644 index 00000000..81950654 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_03.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_128[]; + +extern int tahi_02_128_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_128[0]; test_suite[0].test_case_size = tahi_02_128_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_3_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64,NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_04.c b/test/regression/tahi_test/netx_tahi_test_2_04.c new file mode 100644 index 00000000..1c637062 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_04.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_129[]; + +extern int tahi_02_129_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_129[0]; test_suite[0].test_case_size = tahi_02_129_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_4_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_05.c b/test/regression/tahi_test/netx_tahi_test_2_05.c new file mode 100644 index 00000000..51b69ce3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_05.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_130[]; + +extern int tahi_02_130_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_130[0]; test_suite[0].test_case_size = tahi_02_130_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_5_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_06.c b/test/regression/tahi_test/netx_tahi_test_2_06.c new file mode 100644 index 00000000..f6996502 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_06.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_131[]; + +extern int tahi_02_131_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_131[0]; test_suite[0].test_case_size = tahi_02_131_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_6_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_07.c b/test/regression/tahi_test/netx_tahi_test_2_07.c new file mode 100644 index 00000000..8dc5312a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_07.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_132[]; + +extern int tahi_02_132_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_132[0]; test_suite[0].test_case_size = tahi_02_132_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_7_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_08.c b/test/regression/tahi_test/netx_tahi_test_2_08.c new file mode 100644 index 00000000..4847345d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_08.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_133[]; + +extern int tahi_02_133_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_133[0]; test_suite[0].test_case_size = tahi_02_133_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_8_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_09.c b/test/regression/tahi_test/netx_tahi_test_2_09.c new file mode 100644 index 00000000..eab3df75 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_09.c @@ -0,0 +1,145 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_134[]; + +extern int tahi_02_134_size; + + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_02_134[0]; test_suite[0].test_case_size = tahi_02_134_size; + +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_9_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_10.c b/test/regression/tahi_test/netx_tahi_test_2_10.c new file mode 100644 index 00000000..a37f2b7a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_10.c @@ -0,0 +1,240 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_135[]; +extern TAHI_TEST_SEQ tahi_02_136[]; +extern TAHI_TEST_SEQ tahi_02_137[]; +extern TAHI_TEST_SEQ tahi_02_138[]; +extern TAHI_TEST_SEQ tahi_02_139[]; +extern TAHI_TEST_SEQ tahi_02_140[]; +extern TAHI_TEST_SEQ tahi_02_141[]; +extern TAHI_TEST_SEQ tahi_02_142[]; +extern TAHI_TEST_SEQ tahi_02_143[]; +extern TAHI_TEST_SEQ tahi_02_144[]; +extern TAHI_TEST_SEQ tahi_02_145[]; +extern TAHI_TEST_SEQ tahi_02_146[]; +extern TAHI_TEST_SEQ tahi_02_147[]; +extern TAHI_TEST_SEQ tahi_02_148[]; +extern TAHI_TEST_SEQ tahi_02_149[]; +extern TAHI_TEST_SEQ tahi_02_150[]; +extern TAHI_TEST_SEQ tahi_02_151[]; +extern TAHI_TEST_SEQ tahi_02_152[]; +extern TAHI_TEST_SEQ tahi_02_153[]; +extern TAHI_TEST_SEQ tahi_02_154[]; +extern TAHI_TEST_SEQ tahi_02_155[]; +extern TAHI_TEST_SEQ tahi_02_156[]; +extern TAHI_TEST_SEQ tahi_02_157[]; +extern TAHI_TEST_SEQ tahi_02_158[]; +extern TAHI_TEST_SEQ tahi_02_159[]; +extern TAHI_TEST_SEQ tahi_02_160[]; +extern TAHI_TEST_SEQ tahi_02_161[]; +extern TAHI_TEST_SEQ tahi_02_162[]; +extern TAHI_TEST_SEQ tahi_02_163[]; +extern TAHI_TEST_SEQ tahi_02_164[]; +extern TAHI_TEST_SEQ tahi_02_165[]; +extern TAHI_TEST_SEQ tahi_02_166[]; +extern TAHI_TEST_SEQ tahi_02_167[]; + +extern int tahi_02_135_size; +extern int tahi_02_136_size; +extern int tahi_02_137_size; +extern int tahi_02_138_size; +extern int tahi_02_139_size; +extern int tahi_02_140_size; +extern int tahi_02_141_size; +extern int tahi_02_142_size; +extern int tahi_02_143_size; +extern int tahi_02_144_size; +extern int tahi_02_145_size; +extern int tahi_02_146_size; +extern int tahi_02_147_size; +extern int tahi_02_148_size; +extern int tahi_02_149_size; +extern int tahi_02_150_size; +extern int tahi_02_151_size; +extern int tahi_02_152_size; +extern int tahi_02_153_size; +extern int tahi_02_154_size; +extern int tahi_02_155_size; +extern int tahi_02_156_size; +extern int tahi_02_157_size; +extern int tahi_02_158_size; +extern int tahi_02_159_size; +extern int tahi_02_160_size; +extern int tahi_02_161_size; +extern int tahi_02_162_size; +extern int tahi_02_163_size; +extern int tahi_02_164_size; +extern int tahi_02_165_size; +extern int tahi_02_166_size; +extern int tahi_02_167_size; + + +static TAHI_TEST_SUITE test_suite[33]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_02_135[0]; test_suite[0].test_case_size = tahi_02_135_size; + test_suite[1].test_case = &tahi_02_136[0]; test_suite[1].test_case_size = tahi_02_136_size; + test_suite[2].test_case = &tahi_02_137[0]; test_suite[2].test_case_size = tahi_02_137_size; + test_suite[3].test_case = &tahi_02_138[0]; test_suite[3].test_case_size = tahi_02_138_size; + test_suite[4].test_case = &tahi_02_139[0]; test_suite[4].test_case_size = tahi_02_139_size; + test_suite[5].test_case = &tahi_02_140[0]; test_suite[5].test_case_size = tahi_02_140_size; + test_suite[6].test_case = &tahi_02_141[0]; test_suite[6].test_case_size = tahi_02_141_size; + test_suite[7].test_case = &tahi_02_142[0]; test_suite[7].test_case_size = tahi_02_142_size; + test_suite[8].test_case = &tahi_02_143[0]; test_suite[8].test_case_size = tahi_02_143_size; + test_suite[9].test_case = &tahi_02_144[0]; test_suite[9].test_case_size = tahi_02_144_size; + test_suite[10].test_case = &tahi_02_145[0]; test_suite[10].test_case_size = tahi_02_145_size; + test_suite[11].test_case = &tahi_02_146[0]; test_suite[11].test_case_size = tahi_02_146_size; + test_suite[12].test_case = &tahi_02_147[0]; test_suite[12].test_case_size = tahi_02_147_size; /* line:620 */ + test_suite[13].test_case = &tahi_02_148[0]; test_suite[13].test_case_size = tahi_02_148_size; + test_suite[14].test_case = &tahi_02_149[0]; test_suite[14].test_case_size = tahi_02_149_size; + test_suite[15].test_case = &tahi_02_150[0]; test_suite[15].test_case_size = tahi_02_150_size; + test_suite[16].test_case = &tahi_02_151[0]; test_suite[16].test_case_size = tahi_02_151_size; /* line:102 */ + test_suite[17].test_case = &tahi_02_152[0]; test_suite[17].test_case_size = tahi_02_152_size; + test_suite[18].test_case = &tahi_02_153[0]; test_suite[18].test_case_size = tahi_02_153_size; + test_suite[19].test_case = &tahi_02_154[0]; test_suite[19].test_case_size = tahi_02_154_size; + test_suite[20].test_case = &tahi_02_155[0]; test_suite[20].test_case_size = tahi_02_155_size; + test_suite[21].test_case = &tahi_02_156[0]; test_suite[21].test_case_size = tahi_02_156_size; + test_suite[22].test_case = &tahi_02_157[0]; test_suite[22].test_case_size = tahi_02_157_size; + test_suite[23].test_case = &tahi_02_158[0]; test_suite[23].test_case_size = tahi_02_158_size; + test_suite[24].test_case = &tahi_02_159[0]; test_suite[24].test_case_size = tahi_02_159_size; + test_suite[25].test_case = &tahi_02_160[0]; test_suite[25].test_case_size = tahi_02_160_size; + test_suite[26].test_case = &tahi_02_161[0]; test_suite[26].test_case_size = tahi_02_161_size; + test_suite[27].test_case = &tahi_02_162[0]; test_suite[27].test_case_size = tahi_02_162_size; + test_suite[28].test_case = &tahi_02_163[0]; test_suite[28].test_case_size = tahi_02_163_size; + test_suite[29].test_case = &tahi_02_164[0]; test_suite[29].test_case_size = tahi_02_164_size; + test_suite[30].test_case = &tahi_02_165[0]; test_suite[30].test_case_size = tahi_02_165_size; + test_suite[31].test_case = &tahi_02_166[0]; test_suite[31].test_case_size = tahi_02_166_size; + test_suite[32].test_case = &tahi_02_167[0]; test_suite[32].test_case_size = tahi_02_167_size; //line:142 +} + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_10_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; + + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + /* Clear the flags. */ + test_control_return(0xdeadbeef); + +} + + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_2_11.c b/test/regression/tahi_test/netx_tahi_test_2_11.c new file mode 100644 index 00000000..c1748701 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_2_11.c @@ -0,0 +1,348 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_02_168[]; +extern TAHI_TEST_SEQ tahi_02_169[]; +extern TAHI_TEST_SEQ tahi_02_170[]; +extern TAHI_TEST_SEQ tahi_02_171[]; +extern TAHI_TEST_SEQ tahi_02_172[]; +extern TAHI_TEST_SEQ tahi_02_173[]; +extern TAHI_TEST_SEQ tahi_02_174[]; +extern TAHI_TEST_SEQ tahi_02_175[]; +extern TAHI_TEST_SEQ tahi_02_176[]; +extern TAHI_TEST_SEQ tahi_02_177[]; +extern TAHI_TEST_SEQ tahi_02_178[]; +extern TAHI_TEST_SEQ tahi_02_179[]; +extern TAHI_TEST_SEQ tahi_02_180[]; +extern TAHI_TEST_SEQ tahi_02_181[]; +extern TAHI_TEST_SEQ tahi_02_182[]; +extern TAHI_TEST_SEQ tahi_02_183[]; +extern TAHI_TEST_SEQ tahi_02_184[]; +extern TAHI_TEST_SEQ tahi_02_185[]; +extern TAHI_TEST_SEQ tahi_02_186[]; +extern TAHI_TEST_SEQ tahi_02_187[]; +extern TAHI_TEST_SEQ tahi_02_188[]; +extern TAHI_TEST_SEQ tahi_02_189[]; +extern TAHI_TEST_SEQ tahi_02_190[]; +extern TAHI_TEST_SEQ tahi_02_191[]; +extern TAHI_TEST_SEQ tahi_02_192[]; +extern TAHI_TEST_SEQ tahi_02_193[]; +extern TAHI_TEST_SEQ tahi_02_194[]; +extern TAHI_TEST_SEQ tahi_02_195[]; +extern TAHI_TEST_SEQ tahi_02_196[]; +extern TAHI_TEST_SEQ tahi_02_197[]; +extern TAHI_TEST_SEQ tahi_02_198[]; +extern TAHI_TEST_SEQ tahi_02_199[]; +extern TAHI_TEST_SEQ tahi_02_200[]; +extern TAHI_TEST_SEQ tahi_02_201[]; +extern TAHI_TEST_SEQ tahi_02_202[]; +extern TAHI_TEST_SEQ tahi_02_203[]; +extern TAHI_TEST_SEQ tahi_02_204[]; +extern TAHI_TEST_SEQ tahi_02_205[]; +extern TAHI_TEST_SEQ tahi_02_206[]; +extern TAHI_TEST_SEQ tahi_02_207[]; +extern TAHI_TEST_SEQ tahi_02_208[]; +extern TAHI_TEST_SEQ tahi_02_209[]; +extern TAHI_TEST_SEQ tahi_02_210[]; +extern TAHI_TEST_SEQ tahi_02_211[]; +extern TAHI_TEST_SEQ tahi_02_212[]; +extern TAHI_TEST_SEQ tahi_02_213[]; +extern TAHI_TEST_SEQ tahi_02_214[]; +extern TAHI_TEST_SEQ tahi_02_215[]; +extern TAHI_TEST_SEQ tahi_02_216[]; +extern TAHI_TEST_SEQ tahi_02_217[]; +extern TAHI_TEST_SEQ tahi_02_218[]; +extern TAHI_TEST_SEQ tahi_02_219[]; +extern TAHI_TEST_SEQ tahi_02_220[]; +extern TAHI_TEST_SEQ tahi_02_221[]; +extern TAHI_TEST_SEQ tahi_02_222[]; +extern TAHI_TEST_SEQ tahi_02_223[]; +extern TAHI_TEST_SEQ tahi_02_224[]; +extern TAHI_TEST_SEQ tahi_02_225[]; +extern TAHI_TEST_SEQ tahi_02_226[]; +extern TAHI_TEST_SEQ tahi_02_227[]; +extern TAHI_TEST_SEQ tahi_02_228[]; +extern TAHI_TEST_SEQ tahi_02_229[]; + +extern TAHI_TEST_SEQ tahi_02_230[]; +extern TAHI_TEST_SEQ tahi_02_231[]; +extern TAHI_TEST_SEQ tahi_02_232[]; +extern TAHI_TEST_SEQ tahi_02_233[]; +extern TAHI_TEST_SEQ tahi_02_234[]; +extern TAHI_TEST_SEQ tahi_02_235[]; +extern TAHI_TEST_SEQ tahi_02_236[]; + +extern int tahi_02_168_size; +extern int tahi_02_169_size; +extern int tahi_02_170_size; +extern int tahi_02_171_size; +extern int tahi_02_172_size; +extern int tahi_02_173_size; +extern int tahi_02_174_size; +extern int tahi_02_175_size; +extern int tahi_02_176_size; +extern int tahi_02_177_size; +extern int tahi_02_178_size; +extern int tahi_02_179_size; +extern int tahi_02_180_size; +extern int tahi_02_181_size; +extern int tahi_02_182_size; +extern int tahi_02_183_size; +extern int tahi_02_184_size; +extern int tahi_02_185_size; +extern int tahi_02_186_size; +extern int tahi_02_187_size; +extern int tahi_02_188_size; +extern int tahi_02_189_size; +extern int tahi_02_190_size; +extern int tahi_02_191_size; +extern int tahi_02_192_size; +extern int tahi_02_193_size; +extern int tahi_02_194_size; +extern int tahi_02_195_size; +extern int tahi_02_196_size; +extern int tahi_02_197_size; +extern int tahi_02_198_size; +extern int tahi_02_199_size; +extern int tahi_02_200_size; +extern int tahi_02_201_size; +extern int tahi_02_202_size; +extern int tahi_02_203_size; +extern int tahi_02_204_size; +extern int tahi_02_205_size; +extern int tahi_02_206_size; +extern int tahi_02_207_size; +extern int tahi_02_208_size; +extern int tahi_02_209_size; +extern int tahi_02_210_size; +extern int tahi_02_211_size; +extern int tahi_02_212_size; +extern int tahi_02_213_size; +extern int tahi_02_214_size; +extern int tahi_02_215_size; +extern int tahi_02_216_size; +extern int tahi_02_217_size; +extern int tahi_02_218_size; +extern int tahi_02_219_size; + +extern int tahi_02_220_size; +extern int tahi_02_221_size; +extern int tahi_02_222_size; +extern int tahi_02_223_size; +extern int tahi_02_224_size; +extern int tahi_02_225_size; +extern int tahi_02_226_size; +extern int tahi_02_227_size; +extern int tahi_02_228_size; +extern int tahi_02_229_size; + +extern int tahi_02_230_size; +extern int tahi_02_231_size; +extern int tahi_02_232_size; +extern int tahi_02_233_size; +extern int tahi_02_234_size; +extern int tahi_02_235_size; +extern int tahi_02_236_size; + +static TAHI_TEST_SUITE test_suite[69]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_02_168[0]; test_suite[0].test_case_size = tahi_02_168_size; + test_suite[1].test_case = &tahi_02_169[0]; test_suite[1].test_case_size = tahi_02_169_size; + test_suite[2].test_case = &tahi_02_170[0]; test_suite[2].test_case_size = tahi_02_170_size; + test_suite[3].test_case = &tahi_02_171[0]; test_suite[3].test_case_size = tahi_02_171_size; + test_suite[4].test_case = &tahi_02_172[0]; test_suite[4].test_case_size = tahi_02_172_size; + test_suite[5].test_case = &tahi_02_173[0]; test_suite[5].test_case_size = tahi_02_173_size; + test_suite[6].test_case = &tahi_02_174[0]; test_suite[6].test_case_size = tahi_02_174_size; + test_suite[7].test_case = &tahi_02_175[0]; test_suite[7].test_case_size = tahi_02_175_size; + test_suite[8].test_case = &tahi_02_176[0]; test_suite[8].test_case_size = tahi_02_176_size; + test_suite[9].test_case = &tahi_02_177[0]; test_suite[9].test_case_size = tahi_02_177_size; + test_suite[10].test_case = &tahi_02_178[0]; test_suite[10].test_case_size = tahi_02_178_size; + test_suite[11].test_case = &tahi_02_179[0]; test_suite[11].test_case_size = tahi_02_179_size; + test_suite[12].test_case = &tahi_02_180[0]; test_suite[12].test_case_size = tahi_02_180_size; + test_suite[13].test_case = &tahi_02_181[0]; test_suite[13].test_case_size = tahi_02_181_size; + test_suite[14].test_case = &tahi_02_182[0]; test_suite[14].test_case_size = tahi_02_182_size; + test_suite[15].test_case = &tahi_02_183[0]; test_suite[15].test_case_size = tahi_02_183_size; + test_suite[16].test_case = &tahi_02_184[0]; test_suite[16].test_case_size = tahi_02_184_size; + test_suite[17].test_case = &tahi_02_185[0]; test_suite[17].test_case_size = tahi_02_185_size; + test_suite[18].test_case = &tahi_02_186[0]; test_suite[18].test_case_size = tahi_02_186_size; + test_suite[19].test_case = &tahi_02_187[0]; test_suite[19].test_case_size = tahi_02_187_size; + test_suite[20].test_case = &tahi_02_188[0]; test_suite[20].test_case_size = tahi_02_188_size; + test_suite[21].test_case = &tahi_02_189[0]; test_suite[21].test_case_size = tahi_02_189_size; + test_suite[22].test_case = &tahi_02_190[0]; test_suite[22].test_case_size = tahi_02_190_size; + test_suite[23].test_case = &tahi_02_191[0]; test_suite[23].test_case_size = tahi_02_191_size; + test_suite[24].test_case = &tahi_02_192[0]; test_suite[24].test_case_size = tahi_02_192_size; + test_suite[25].test_case = &tahi_02_193[0]; test_suite[25].test_case_size = tahi_02_193_size; + test_suite[26].test_case = &tahi_02_194[0]; test_suite[26].test_case_size = tahi_02_194_size; + test_suite[27].test_case = &tahi_02_195[0]; test_suite[27].test_case_size = tahi_02_195_size; + test_suite[28].test_case = &tahi_02_196[0]; test_suite[28].test_case_size = tahi_02_196_size; + test_suite[29].test_case = &tahi_02_197[0]; test_suite[29].test_case_size = tahi_02_197_size; + test_suite[30].test_case = &tahi_02_198[0]; test_suite[30].test_case_size = tahi_02_198_size; + test_suite[31].test_case = &tahi_02_199[0]; test_suite[31].test_case_size = tahi_02_199_size; + test_suite[32].test_case = &tahi_02_200[0]; test_suite[32].test_case_size = tahi_02_200_size; + test_suite[33].test_case = &tahi_02_201[0]; test_suite[33].test_case_size = tahi_02_201_size; + test_suite[34].test_case = &tahi_02_202[0]; test_suite[34].test_case_size = tahi_02_202_size; + test_suite[35].test_case = &tahi_02_203[0]; test_suite[35].test_case_size = tahi_02_203_size; + test_suite[36].test_case = &tahi_02_204[0]; test_suite[36].test_case_size = tahi_02_204_size; + test_suite[37].test_case = &tahi_02_205[0]; test_suite[37].test_case_size = tahi_02_205_size; + test_suite[38].test_case = &tahi_02_206[0]; test_suite[38].test_case_size = tahi_02_206_size; + test_suite[39].test_case = &tahi_02_207[0]; test_suite[39].test_case_size = tahi_02_207_size; + test_suite[40].test_case = &tahi_02_208[0]; test_suite[40].test_case_size = tahi_02_208_size; + test_suite[41].test_case = &tahi_02_209[0]; test_suite[41].test_case_size = tahi_02_209_size; + test_suite[42].test_case = &tahi_02_210[0]; test_suite[42].test_case_size = tahi_02_210_size; + test_suite[43].test_case = &tahi_02_211[0]; test_suite[43].test_case_size = tahi_02_211_size; + test_suite[44].test_case = &tahi_02_212[0]; test_suite[44].test_case_size = tahi_02_212_size; + test_suite[45].test_case = &tahi_02_213[0]; test_suite[45].test_case_size = tahi_02_213_size; + test_suite[46].test_case = &tahi_02_214[0]; test_suite[46].test_case_size = tahi_02_214_size; + test_suite[47].test_case = &tahi_02_215[0]; test_suite[47].test_case_size = tahi_02_215_size; + test_suite[48].test_case = &tahi_02_216[0]; test_suite[48].test_case_size = tahi_02_216_size; + test_suite[49].test_case = &tahi_02_217[0]; test_suite[49].test_case_size = tahi_02_217_size; + test_suite[50].test_case = &tahi_02_218[0]; test_suite[50].test_case_size = tahi_02_218_size; + test_suite[51].test_case = &tahi_02_219[0]; test_suite[51].test_case_size = tahi_02_219_size; + test_suite[52].test_case = &tahi_02_220[0]; test_suite[52].test_case_size = tahi_02_220_size; + test_suite[53].test_case = &tahi_02_221[0]; test_suite[53].test_case_size = tahi_02_221_size; + test_suite[54].test_case = &tahi_02_222[0]; test_suite[54].test_case_size = tahi_02_222_size; + test_suite[55].test_case = &tahi_02_223[0]; test_suite[55].test_case_size = tahi_02_223_size; + test_suite[56].test_case = &tahi_02_224[0]; test_suite[56].test_case_size = tahi_02_224_size; + test_suite[57].test_case = &tahi_02_225[0]; test_suite[57].test_case_size = tahi_02_225_size; + test_suite[58].test_case = &tahi_02_226[0]; test_suite[58].test_case_size = tahi_02_226_size; + test_suite[59].test_case = &tahi_02_227[0]; test_suite[59].test_case_size = tahi_02_227_size; + test_suite[60].test_case = &tahi_02_228[0]; test_suite[60].test_case_size = tahi_02_228_size; + test_suite[61].test_case = &tahi_02_229[0]; test_suite[61].test_case_size = tahi_02_229_size; + test_suite[62].test_case = &tahi_02_230[0]; test_suite[62].test_case_size = tahi_02_230_size; + test_suite[63].test_case = &tahi_02_231[0]; test_suite[63].test_case_size = tahi_02_231_size; + test_suite[64].test_case = &tahi_02_232[0]; test_suite[64].test_case_size = tahi_02_232_size; + test_suite[65].test_case = &tahi_02_233[0]; test_suite[65].test_case_size = tahi_02_233_size; + test_suite[66].test_case = &tahi_02_234[0]; test_suite[66].test_case_size = tahi_02_234_size; + test_suite[67].test_case = &tahi_02_235[0]; test_suite[67].test_case_size = tahi_02_235_size; + test_suite[68].test_case = &tahi_02_236[0]; test_suite[68].test_case_size = tahi_02_236_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_2_11_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_01.c b/test/regression/tahi_test/netx_tahi_test_3_01.c new file mode 100644 index 00000000..4f77948a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_01.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_001[]; + +extern int tahi_03_001_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_001[0];test_suite[0].test_case_size = tahi_03_001_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_1_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_02.c b/test/regression/tahi_test/netx_tahi_test_3_02.c new file mode 100644 index 00000000..243beb8b --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_02.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_002[]; + +extern int tahi_03_002_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_002[0];test_suite[0].test_case_size = tahi_03_002_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_2_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_03.c b/test/regression/tahi_test/netx_tahi_test_3_03.c new file mode 100644 index 00000000..4c18fe60 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_03.c @@ -0,0 +1,134 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_003[]; + +extern int tahi_03_003_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_003[0];test_suite[0].test_case_size = tahi_03_003_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_3_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + +} + + +static void thread_0_entry(ULONG thread_input) +{ + + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + test_control_return(0xdeadbeef); +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_04.c b/test/regression/tahi_test/netx_tahi_test_3_04.c new file mode 100644 index 00000000..17b7312d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_04.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_004[]; + +extern int tahi_03_004_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_004[0];test_suite[0].test_case_size = tahi_03_004_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_4_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_05.c b/test/regression/tahi_test/netx_tahi_test_3_05.c new file mode 100644 index 00000000..c83737f2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_05.c @@ -0,0 +1,134 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_005[]; + +extern int tahi_03_005_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_005[0];test_suite[0].test_case_size = tahi_03_005_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_5_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_06.c b/test/regression/tahi_test/netx_tahi_test_3_06.c new file mode 100644 index 00000000..8ee174ba --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_06.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_006[]; + +extern int tahi_03_006_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_006[0];test_suite[0].test_case_size = tahi_03_006_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_6_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_07.c b/test/regression/tahi_test/netx_tahi_test_3_07.c new file mode 100644 index 00000000..27bc8903 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_07.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_007[]; + +extern int tahi_03_007_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_007[0];test_suite[0].test_case_size = tahi_03_007_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_7_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_08.c b/test/regression/tahi_test/netx_tahi_test_3_08.c new file mode 100644 index 00000000..3b51c4d3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_08.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_008[]; + +extern int tahi_03_008_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_008[0];test_suite[0].test_case_size = tahi_03_008_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_8_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_09.c b/test/regression/tahi_test/netx_tahi_test_3_09.c new file mode 100644 index 00000000..894dd97d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_09.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_009[]; + +extern int tahi_03_009_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_009[0];test_suite[0].test_case_size = tahi_03_009_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_9_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_10.c b/test/regression/tahi_test/netx_tahi_test_3_10.c new file mode 100644 index 00000000..7458d544 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_10.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_010[]; + +extern int tahi_03_010_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_010[0];test_suite[0].test_case_size = tahi_03_010_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_10_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_11.c b/test/regression/tahi_test/netx_tahi_test_3_11.c new file mode 100644 index 00000000..8c38fee1 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_11.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_011[]; + +extern int tahi_03_011_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_011[0];test_suite[0].test_case_size = tahi_03_011_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_11_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_12.c b/test/regression/tahi_test/netx_tahi_test_3_12.c new file mode 100644 index 00000000..0ad915cf --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_12.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_012[]; + +extern int tahi_03_012_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_012[0];test_suite[0].test_case_size = tahi_03_012_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_12_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_13.c b/test/regression/tahi_test/netx_tahi_test_3_13.c new file mode 100644 index 00000000..378f4136 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_13.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_013[]; + +extern int tahi_03_013_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_013[0];test_suite[0].test_case_size = tahi_03_013_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_13_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_14.c b/test/regression/tahi_test/netx_tahi_test_3_14.c new file mode 100644 index 00000000..5e5071ab --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_14.c @@ -0,0 +1,134 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_014[]; + +extern int tahi_03_014_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_014[0];test_suite[0].test_case_size = tahi_03_014_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_14_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_15.c b/test/regression/tahi_test/netx_tahi_test_3_15.c new file mode 100644 index 00000000..60c2fdc8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_15.c @@ -0,0 +1,134 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_015[]; + +extern int tahi_03_015_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_015[0];test_suite[0].test_case_size = tahi_03_015_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_15_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_16.c b/test/regression/tahi_test/netx_tahi_test_3_16.c new file mode 100644 index 00000000..eafe8225 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_16.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_016[]; + +extern int tahi_03_016_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_016[0];test_suite[0].test_case_size = tahi_03_016_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_16_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_17.c b/test/regression/tahi_test/netx_tahi_test_3_17.c new file mode 100644 index 00000000..0f14d9c0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_17.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_017[]; + +extern int tahi_03_017_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_017[0];test_suite[0].test_case_size = tahi_03_017_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_17_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_18.c b/test/regression/tahi_test/netx_tahi_test_3_18.c new file mode 100644 index 00000000..42b55e9d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_18.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_018[]; + +extern int tahi_03_018_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_018[0];test_suite[0].test_case_size = tahi_03_018_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_18_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_19.c b/test/regression/tahi_test/netx_tahi_test_3_19.c new file mode 100644 index 00000000..58d2786d --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_19.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_019[]; + +extern int tahi_03_019_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_019[0];test_suite[0].test_case_size = tahi_03_019_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_19_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_20.c b/test/regression/tahi_test/netx_tahi_test_3_20.c new file mode 100644 index 00000000..41cd922b --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_20.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_020[]; + +extern int tahi_03_020_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_020[0];test_suite[0].test_case_size = tahi_03_020_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_20_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_21.c b/test/regression/tahi_test/netx_tahi_test_3_21.c new file mode 100644 index 00000000..e4ad9526 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_21.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_021[]; + +extern int tahi_03_021_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_021[0];test_suite[0].test_case_size = tahi_03_021_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_21_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64,NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_22.c b/test/regression/tahi_test/netx_tahi_test_3_22.c new file mode 100644 index 00000000..21a1b751 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_22.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_022[]; + +extern int tahi_03_022_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_022[0];test_suite[0].test_case_size = tahi_03_022_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_22_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_23.c b/test/regression/tahi_test/netx_tahi_test_3_23.c new file mode 100644 index 00000000..1e22d972 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_23.c @@ -0,0 +1,134 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_023[]; + +extern int tahi_03_023_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_023[0];test_suite[0].test_case_size = tahi_03_023_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_23_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64,NX_NULL); + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_24.c b/test/regression/tahi_test/netx_tahi_test_3_24.c new file mode 100644 index 00000000..39bbc823 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_24.c @@ -0,0 +1,134 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_024[]; + +extern int tahi_03_024_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_024[0];test_suite[0].test_case_size = tahi_03_024_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_24_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + + nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + test_control_return(0xdeadbeef); +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_25.c b/test/regression/tahi_test/netx_tahi_test_3_25.c new file mode 100644 index 00000000..a7adbb77 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_25.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_025[]; + +extern int tahi_03_025_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_025[0];test_suite[0].test_case_size = tahi_03_025_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_25_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64,NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_26.c b/test/regression/tahi_test/netx_tahi_test_3_26.c new file mode 100644 index 00000000..c87c2e42 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_26.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_026[]; + +extern int tahi_03_026_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_026[0];test_suite[0].test_case_size = tahi_03_026_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_26_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_27.c b/test/regression/tahi_test/netx_tahi_test_3_27.c new file mode 100644 index 00000000..34858e64 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_27.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_027[]; + +extern int tahi_03_027_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_027[0];test_suite[0].test_case_size = tahi_03_027_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_27_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_28.c b/test/regression/tahi_test/netx_tahi_test_3_28.c new file mode 100644 index 00000000..8b782f10 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_28.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_028[]; + +extern int tahi_03_028_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_028[0];test_suite[0].test_case_size = tahi_03_028_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_28_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_29.c b/test/regression/tahi_test/netx_tahi_test_3_29.c new file mode 100644 index 00000000..0e709366 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_29.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_029[]; + +extern int tahi_03_029_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_029[0];test_suite[0].test_case_size = tahi_03_029_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_29_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_30.c b/test/regression/tahi_test/netx_tahi_test_3_30.c new file mode 100644 index 00000000..34b7afa4 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_30.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_030[]; + +extern int tahi_03_030_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_030[0];test_suite[0].test_case_size = tahi_03_030_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_30_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_31.c b/test/regression/tahi_test/netx_tahi_test_3_31.c new file mode 100644 index 00000000..f13867f5 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_31.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_031[]; + +extern int tahi_03_031_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_031[0];test_suite[0].test_case_size = tahi_03_031_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_31_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_32.c b/test/regression/tahi_test/netx_tahi_test_3_32.c new file mode 100644 index 00000000..481bbf08 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_32.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_032[]; + +extern int tahi_03_032_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_032[0];test_suite[0].test_case_size = tahi_03_032_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_32_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_33.c b/test/regression/tahi_test/netx_tahi_test_3_33.c new file mode 100644 index 00000000..5df8c945 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_33.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_033[]; + +extern int tahi_03_033_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_033[0];test_suite[0].test_case_size = tahi_03_033_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_33_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_34.c b/test/regression/tahi_test/netx_tahi_test_3_34.c new file mode 100644 index 00000000..389ec470 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_34.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_034[]; + +extern int tahi_03_034_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_034[0];test_suite[0].test_case_size = tahi_03_034_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_34_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_35.c b/test/regression/tahi_test/netx_tahi_test_3_35.c new file mode 100644 index 00000000..72d7038c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_35.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_035[]; + +extern int tahi_03_035_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_035[0];test_suite[0].test_case_size = tahi_03_035_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_35_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_36.c b/test/regression/tahi_test/netx_tahi_test_3_36.c new file mode 100644 index 00000000..ff87d14f --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_36.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_036[]; + +extern int tahi_03_036_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_036[0];test_suite[0].test_case_size = tahi_03_036_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_36_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_37.c b/test/regression/tahi_test/netx_tahi_test_3_37.c new file mode 100644 index 00000000..9b9ea1f3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_37.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_037[]; + +extern int tahi_03_037_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_037[0];test_suite[0].test_case_size = tahi_03_037_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_37_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_38.c b/test/regression/tahi_test/netx_tahi_test_3_38.c new file mode 100644 index 00000000..5a4cba71 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_38.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_038[]; + +extern int tahi_03_038_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_038[0];test_suite[0].test_case_size = tahi_03_038_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_38_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_39.c b/test/regression/tahi_test/netx_tahi_test_3_39.c new file mode 100644 index 00000000..380b4980 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_39.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_039[]; + +extern int tahi_03_039_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_039[0];test_suite[0].test_case_size = tahi_03_039_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_39_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_40.c b/test/regression/tahi_test/netx_tahi_test_3_40.c new file mode 100644 index 00000000..2261a1c8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_40.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_040[]; + +extern int tahi_03_040_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_040[0];test_suite[0].test_case_size = tahi_03_040_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_40_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_41.c b/test/regression/tahi_test/netx_tahi_test_3_41.c new file mode 100644 index 00000000..ff53aa97 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_41.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_041[]; + +extern int tahi_03_041_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_041[0];test_suite[0].test_case_size = tahi_03_041_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_41_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_42.c b/test/regression/tahi_test/netx_tahi_test_3_42.c new file mode 100644 index 00000000..94199e20 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_42.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_042[]; + +extern int tahi_03_042_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_042[0];test_suite[0].test_case_size = tahi_03_042_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_42_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_43.c b/test/regression/tahi_test/netx_tahi_test_3_43.c new file mode 100644 index 00000000..c5444738 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_43.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_043[]; + +extern int tahi_03_043_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_043[0];test_suite[0].test_case_size = tahi_03_043_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_43_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_44.c b/test/regression/tahi_test/netx_tahi_test_3_44.c new file mode 100644 index 00000000..3b5c7085 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_44.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_044[]; + +extern int tahi_03_044_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_044[0];test_suite[0].test_case_size = tahi_03_044_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_44_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_45.c b/test/regression/tahi_test/netx_tahi_test_3_45.c new file mode 100644 index 00000000..a7f74972 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_3_45.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_03_045[]; + +extern int tahi_03_045_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_03_045[0];test_suite[0].test_case_size = tahi_03_045_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_3_45_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_10.c b/test/regression/tahi_test/netx_tahi_test_4_10.c new file mode 100644 index 00000000..af66b9b3 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_10.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_010[]; + +extern int tahi_04_010_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_010[0];test_suite[0].test_case_size = tahi_04_010_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_10_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_11.c b/test/regression/tahi_test/netx_tahi_test_4_11.c new file mode 100644 index 00000000..06f32e44 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_11.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_011[]; + +extern int tahi_04_011_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_011[0];test_suite[0].test_case_size = tahi_04_011_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_11_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_12.c b/test/regression/tahi_test/netx_tahi_test_4_12.c new file mode 100644 index 00000000..f928c0f1 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_12.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_012[]; + +extern int tahi_04_012_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_012[0];test_suite[0].test_case_size = tahi_04_012_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_12_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_13.c b/test/regression/tahi_test/netx_tahi_test_4_13.c new file mode 100644 index 00000000..adb744df --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_13.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_013[]; + +extern int tahi_04_013_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_013[0];test_suite[0].test_case_size = tahi_04_013_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_13_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_14.c b/test/regression/tahi_test/netx_tahi_test_4_14.c new file mode 100644 index 00000000..a30335d9 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_14.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_014[]; + +extern int tahi_04_014_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_014[0];test_suite[0].test_case_size = tahi_04_014_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_14_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_15.c b/test/regression/tahi_test/netx_tahi_test_4_15.c new file mode 100644 index 00000000..0b396aea --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_15.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_015[]; + +extern int tahi_04_015_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_015[0];test_suite[0].test_case_size = tahi_04_015_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_15_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", (1536 + NX_IPSEC_MAX_HEADER_SIZE), pointer, (1536 + NX_IPSEC_MAX_HEADER_SIZE) * 16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_16.c b/test/regression/tahi_test/netx_tahi_test_4_16.c new file mode 100644 index 00000000..e0520ae2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_16.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_016[]; + +extern int tahi_04_016_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_016[0];test_suite[0].test_case_size = tahi_04_016_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_16_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", (1536 + NX_IPSEC_MAX_HEADER_SIZE), pointer, (1536 + NX_IPSEC_MAX_HEADER_SIZE)*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_2.c b/test/regression/tahi_test/netx_tahi_test_4_2.c new file mode 100644 index 00000000..ce54b5e2 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_2.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_002[]; + +extern int tahi_04_002_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_002[0];test_suite[0].test_case_size = tahi_04_002_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_2_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_3.c b/test/regression/tahi_test/netx_tahi_test_4_3.c new file mode 100644 index 00000000..f04f322b --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_3.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_003[]; + +extern int tahi_04_003_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_003[0];test_suite[0].test_case_size = tahi_04_003_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_3_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_4.c b/test/regression/tahi_test/netx_tahi_test_4_4.c new file mode 100644 index 00000000..8a6d638a --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_4.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_004[]; + +extern int tahi_04_004_size; + +static TAHI_TEST_SUITE test_suite[15]; +static void build_test_suite(void) +{ + test_suite[2].test_case = &tahi_04_004[0];test_suite[2].test_case_size = tahi_04_004_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_4_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_5.c b/test/regression/tahi_test/netx_tahi_test_4_5.c new file mode 100644 index 00000000..c4705505 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_5.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_005[]; + +extern int tahi_04_005_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_005[0];test_suite[0].test_case_size = tahi_04_005_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_5_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_6.c b/test/regression/tahi_test/netx_tahi_test_4_6.c new file mode 100644 index 00000000..95ccba40 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_6.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_006[]; + +extern int tahi_04_006_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_006[0];test_suite[0].test_case_size = tahi_04_006_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_6_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_7.c b/test/regression/tahi_test/netx_tahi_test_4_7.c new file mode 100644 index 00000000..5ca40c49 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_7.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_007[]; + +extern int tahi_04_007_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_007[0];test_suite[0].test_case_size = tahi_04_007_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_7_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_8.c b/test/regression/tahi_test/netx_tahi_test_4_8.c new file mode 100644 index 00000000..263fb63e --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_8.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_008[]; + +extern int tahi_04_008_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_008[0];test_suite[0].test_case_size = tahi_04_008_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_8_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_4_9.c b/test/regression/tahi_test/netx_tahi_test_4_9.c new file mode 100644 index 00000000..3f0a5be6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_4_9.c @@ -0,0 +1,150 @@ +#include "tx_api.h" +#include "nx_api.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) +#include "netx_tahi.h" +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_04_009[]; + +extern int tahi_04_009_size; + +static TAHI_TEST_SUITE test_suite[1]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_04_009[0];test_suite[0].test_case_size = tahi_04_009_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_4_9_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += _nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_5.c b/test/regression/tahi_test/netx_tahi_test_5.c new file mode 100644 index 00000000..7ae4010c --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_5.c @@ -0,0 +1,208 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" +#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +static NXD_ADDRESS ipv6_address_1; + + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the test threads. */ + +extern TAHI_TEST_SEQ tahi_05_002[]; +extern TAHI_TEST_SEQ tahi_05_003[]; +extern TAHI_TEST_SEQ tahi_05_004[]; +extern TAHI_TEST_SEQ tahi_05_005[]; +extern TAHI_TEST_SEQ tahi_05_006[]; +extern TAHI_TEST_SEQ tahi_05_007[]; +extern TAHI_TEST_SEQ tahi_05_008[]; +extern TAHI_TEST_SEQ tahi_05_009[]; +extern TAHI_TEST_SEQ tahi_05_010[]; +extern TAHI_TEST_SEQ tahi_05_012[]; +extern TAHI_TEST_SEQ tahi_05_013[]; +extern TAHI_TEST_SEQ tahi_05_014[]; +extern TAHI_TEST_SEQ tahi_05_015[]; +extern TAHI_TEST_SEQ tahi_05_017[]; +extern TAHI_TEST_SEQ tahi_05_018[]; +extern TAHI_TEST_SEQ tahi_05_020[]; +extern TAHI_TEST_SEQ tahi_05_021[]; +extern TAHI_TEST_SEQ tahi_05_022[]; +extern TAHI_TEST_SEQ tahi_05_024[]; +extern TAHI_TEST_SEQ tahi_05_025[]; + +extern int tahi_05_002_size; +extern int tahi_05_003_size; +extern int tahi_05_004_size; +extern int tahi_05_005_size; +extern int tahi_05_006_size; +extern int tahi_05_007_size; +extern int tahi_05_008_size; +extern int tahi_05_009_size; +extern int tahi_05_010_size; +extern int tahi_05_012_size; +extern int tahi_05_013_size; +extern int tahi_05_014_size; +extern int tahi_05_015_size; +extern int tahi_05_017_size; +extern int tahi_05_018_size; +extern int tahi_05_020_size; +extern int tahi_05_021_size; +extern int tahi_05_022_size; +extern int tahi_05_024_size; +extern int tahi_05_025_size; + + +static TAHI_TEST_SUITE test_suite[20]; +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_05_002[0];test_suite[0].test_case_size = tahi_05_002_size; + test_suite[1].test_case = &tahi_05_003[0];test_suite[1].test_case_size = tahi_05_003_size; + test_suite[2].test_case = &tahi_05_004[0];test_suite[2].test_case_size = tahi_05_004_size; + test_suite[3].test_case = &tahi_05_005[0];test_suite[3].test_case_size = tahi_05_005_size; + test_suite[4].test_case = &tahi_05_006[0];test_suite[4].test_case_size = tahi_05_006_size; + test_suite[5].test_case = &tahi_05_007[0];test_suite[5].test_case_size = tahi_05_007_size; + test_suite[6].test_case = &tahi_05_008[0];test_suite[6].test_case_size = tahi_05_008_size; + test_suite[7].test_case = &tahi_05_009[0];test_suite[7].test_case_size = tahi_05_009_size; + test_suite[8].test_case = &tahi_05_010[0];test_suite[8].test_case_size = tahi_05_010_size; + test_suite[9].test_case = &tahi_05_012[0];test_suite[9].test_case_size = tahi_05_012_size; + test_suite[10].test_case = &tahi_05_013[0];test_suite[10].test_case_size = tahi_05_013_size; + test_suite[11].test_case = &tahi_05_014[0];test_suite[11].test_case_size = tahi_05_014_size; + test_suite[12].test_case = &tahi_05_015[0];test_suite[12].test_case_size = tahi_05_015_size; + test_suite[13].test_case = &tahi_05_017[0];test_suite[13].test_case_size = tahi_05_017_size; + test_suite[14].test_case = &tahi_05_018[0];test_suite[14].test_case_size = tahi_05_018_size; + test_suite[15].test_case = &tahi_05_020[0];test_suite[15].test_case_size = tahi_05_020_size; + test_suite[16].test_case = &tahi_05_021[0];test_suite[16].test_case_size = tahi_05_021_size; + test_suite[17].test_case = &tahi_05_022[0];test_suite[17].test_case_size = tahi_05_022_size; + test_suite[18].test_case = &tahi_05_024[0];test_suite[18].test_case_size = tahi_05_024_size; + test_suite[19].test_case = &tahi_05_025[0];test_suite[19].test_case_size = tahi_05_025_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_5_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + /* Enable IPv6 */ + status = nxd_ipv6_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_udp_enable(&ip_0); + + /* Check fragment enable status. */ + if(status) + error_counter++; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); + + if(status) + error_counter++; +} + + +static void thread_0_entry(ULONG thread_input) +{ + int num_suite; + int i; + + + num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); + + for(i = 0; i < num_suite; i++) + { + if(test_suite[i].test_case) + netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); + } + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec.c b/test/regression/tahi_test/netx_tahi_test_ipsec.c new file mode 100644 index 00000000..292704c5 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_ipsec.c @@ -0,0 +1,625 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" + +#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ipsec.h" +#include "nx_crypto.h" +#include "nx_crypto_3des.h" +#include "nx_crypto_aes.h" +#include "nx_crypto_des.h" +#include "nx_crypto_dh.h" +#include "nx_crypto_hmac_md5.h" +#include "nx_crypto_hmac_sha1.h" +#include "nx_crypto_md5.h" +#include "nx_crypto_null.h" +#include "nx_crypto_sha1.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define IPSEC_MAX_END_NODE 10 +#define IPSEC_SA_LIFETIME 5000 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +/* Define IPSEC related data. */ + +static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; +static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_aes_xcbc_mac[32]; +static UCHAR ingress_aes_xcbc_mac[32]; +static ULONG egress_spi[IPSEC_MAX_END_NODE]; +static ULONG ingress_spi[IPSEC_MAX_END_NODE]; +static UCHAR ingress_aes_ctr[32]; +static UCHAR egress_aes_ctr[32]; + +/* Define the Crypto Method */ + +static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; +static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; +static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; + + +/* 3DES, encrypt */ +static NX_CRYPTO_METHOD crypto_method_t_des = +{ + NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used */ + (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ + sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ + NX_NULL, /* 3DES-CBC cleanup routine, not used */ + _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ +}; + +/* HMAC SHA1 */ +static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = +{ + NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ + 0, /* IV size in bits, not used */ + NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ + 0, /* Block size in bytes, not used */ + 0, /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ +}; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void init_para(); +static UINT clean_sa(); +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); + +static UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_ipsec_001[]; +extern TAHI_TEST_SEQ tahi_ipsec_002[]; +extern TAHI_TEST_SEQ tahi_ipsec_003[]; +extern TAHI_TEST_SEQ tahi_ipsec_004[]; +extern TAHI_TEST_SEQ tahi_ipsec_005[]; + +extern int tahi_ipsec_001_size; +extern int tahi_ipsec_002_size; +extern int tahi_ipsec_003_size; +extern int tahi_ipsec_004_size; +extern int tahi_ipsec_005_size; + +static TAHI_TEST_SUITE test_suite[10]; + +static void build_test_suite(void) +{ + test_suite[0].test_case = &tahi_ipsec_001[0]; test_suite[0].test_case_size = tahi_ipsec_001_size; + test_suite[1].test_case = &tahi_ipsec_002[0]; test_suite[1].test_case_size = tahi_ipsec_002_size; + test_suite[2].test_case = &tahi_ipsec_003[0]; test_suite[2].test_case_size = tahi_ipsec_003_size; + test_suite[3].test_case = &tahi_ipsec_004[0]; test_suite[3].test_case_size = tahi_ipsec_004_size; + test_suite[4].test_case = &tahi_ipsec_005[0]; test_suite[4].test_case_size = tahi_ipsec_005_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_ipsec_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + + /* Check IP create status. */ + if(status) + error_counter++; + + pointer = pointer + 2048; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Enable IPv6 */ + status += nx_ipsec_enable(&ip_0); + + /* Enable UDP */ + status += nx_udp_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + /* Set ipv6 version and address. */ + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; + ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + + init_para(); + + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + + create_sa(0,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + create_sa(1,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[1], egress_3des_cbc[1], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[1], egress_hmac_sha1[1], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[1], &egress_3des[1], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[1], &metadata_egress_hmac_sha1[1], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); + + + clean_sa(); + create_sa(2,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[2], egress_3des_cbc[2], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[2], egress_hmac_sha1[2], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[2], &egress_3des[2], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[2], &metadata_egress_hmac_sha1[2], sizeof(NX_SHA1_HMAC)); + create_sa(3,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[3], egress_3des_cbc[3], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[3], egress_hmac_sha1[3], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[3], &egress_3des[3], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[3], &metadata_egress_hmac_sha1[3], sizeof(NX_SHA1_HMAC)); + + netx_tahi_run_test_case(&ip_0, test_suite[2].test_case, test_suite[2].test_case_size); + + + clean_sa(); + create_sa(0,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[3].test_case, test_suite[3].test_case_size); + +#if 0 + clean_sa(); + create_sa(0,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); +#endif + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +/* Initialize parameters for IPSec. */ +static void init_para() +{ + UINT i; + + /* Setup addresses of selectors. */ + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; + memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + } + + /*Setup destination IP address. */ + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; + memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 8-2 */ + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + + /* Used by test case 9-2 */ + + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + + /* Used by test case 22 */ + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 23 */ + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); + + /* Used by test case 24-1 */ + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 24-2 */ + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + + /* Setup SPI. */ + ingress_spi[0] = 0x1000; + egress_spi[0] = 0x2000; + ingress_spi[1] = 0x3000; + egress_spi[1] = 0x4000; + ingress_spi[2] = 0x1000; + egress_spi[2] = 0x2000; + ingress_spi[3] = 0x1000; + egress_spi[3] = 0x3000; + ingress_spi[4] = 0x1000; + egress_spi[4] = 0x2000; + ingress_spi[5] = 0x1000; + egress_spi[5] = 0x2000; + ingress_spi[6] = 0x1000; + egress_spi[6] = 0x2000; + ingress_spi[7] = 0x1000; + egress_spi[7] = 0x2000; + ingress_spi[8] = 0x1000; + egress_spi[8] = 0x2000; + ingress_spi[9] = 0x3000; + egress_spi[9] = 0x4000; + + /* Setup encryption key. */ + memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); + memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); + + memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); + memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); + + memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); + memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); + + memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); + memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); + + memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); + memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); + + /* Setup selectors. */ + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; + +} + + +/* Clean SA for IPSec. */ +static UINT clean_sa() +{ + + UINT status = 0, i; + + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + if(ingress_sa[i].nx_ipsec_sa_id) + status = _nxe_ipsec_sa_delete(&ingress_sa[i]); + if(egress_sa[i].nx_ipsec_sa_id) + status += _nxe_ipsec_sa_delete(&egress_sa[i]); + + } + + return status; +} + +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) +{ + nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), + sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, + sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); + return; +} + +/* Create SA for IPSec. */ +UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) +{ + + UINT status; + + status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], + sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, + sa_encryption_key_ingress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, + sa_integrity_key_ingress, sa_integrity_key_len_in_bits); + + if (status) + error_counter++; + + status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], + sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, + sa_encryption_key_egress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, + sa_integrity_key_egress, sa_integrity_key_len_in_bits); + if (status) + error_counter++; + + return status; +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec_2.c b/test/regression/tahi_test/netx_tahi_test_ipsec_2.c new file mode 100644 index 00000000..f154b5c6 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_ipsec_2.c @@ -0,0 +1,899 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" + +#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ipsec.h" +#include "nx_crypto.h" +#include "nx_crypto_3des.h" +#include "nx_crypto_aes.h" +#include "nx_crypto_des.h" +#include "nx_crypto_dh.h" +#include "nx_crypto_hmac_md5.h" +#include "nx_crypto_hmac_sha1.h" +#include "nx_crypto_md5.h" +#include "nx_crypto_null.h" +#include "nx_crypto_sha1.h" + + + + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define IPSEC_MAX_END_NODE 10 +#define IPSEC_SA_LIFETIME 5000 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; + + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +static NXD_ADDRESS tunnel_entry_address; +static NXD_ADDRESS tunnel_exit_address; + +/* Define IPSEC related data. */ + +static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; +static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_aes_xcbc_mac[32]; +static UCHAR ingress_aes_xcbc_mac[32]; +static ULONG egress_spi[IPSEC_MAX_END_NODE]; +static ULONG ingress_spi[IPSEC_MAX_END_NODE]; +static UCHAR ingress_aes_ctr[32]; +static UCHAR egress_aes_ctr[32]; + +/* Define the Crypto Method */ + +static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; + +static NX_CRYPTO_AES egress_aes[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_AES ingress_aes[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_AES egress_aes_xcbc; +static NX_CRYPTO_AES ingress_aes_xcbc; + +static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; +static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; + +/* NULL encrypt */ +static NX_CRYPTO_METHOD crypto_method_null = +{ + NX_CRYPTO_ENCRYPTION_NULL, /* Name of the crypto algorithm */ + 0, /* Key size in bits, not used */ + 0, /* IV size in bits, not used */ + 0, /* ICV size in bits, not used */ + 4, /* Block size in bytes */ + 0, /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_null_operation /* NULL operation */ +}; + + +/* 3DES, encrypt */ +static NX_CRYPTO_METHOD crypto_method_t_des = +{ + NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used */ + (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ + sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ + NX_NULL, /* 3DES-CBC cleanup routine, not used */ + _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ +}; + +/* AES-CBC. */ +static NX_CRYPTO_METHOD crypto_method_aes_cbc = +{ + NX_CRYPTO_ENCRYPTION_AES_CBC, /* AES crypto algorithm */ + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_AES_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used. */ + (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ + sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ + NX_NULL, /* AES-CBC cleanup routine, not used. */ + _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ + +}; + +/* AES-CTR. */ +static NX_CRYPTO_METHOD crypto_method_aes_ctr = +{ + NX_CRYPTO_ENCRYPTION_AES_CTR, /* AES crypto algorithm */ + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_AES_CTR_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used. */ + (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ + sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ + NX_NULL, /* AES-CBC cleanup routine, not used. */ + _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ +}; + +/* HMAC SHA1 */ +static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = +{ + NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ + 0, /* IV size in bits, not used */ + NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ + 0, /* Block size in bytes, not used */ + 0, /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ +}; + +/* AES_XCBC_96 */ +static NX_CRYPTO_METHOD crypto_method_aes_xcbc_mac = +{ + NX_CRYPTO_AUTHENTICATION_AES_XCBC_MAC_96, /* AES_XCBC_MAC algorithm */ + NX_CRYPTO_AES_XCBC_MAC_KEY_LEN_IN_BITS, /* Key size in bits */ + 0, /* IV size in bits, not used */ + NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ + 0, /* Block size in bytes, not used */ + sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_aes_xcbc_mac_operation /* AES_XCBC_MAC operation */ +}; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void init_para(); +static UINT clean_sa(); +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); + +static UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_ipsec_006[]; +extern TAHI_TEST_SEQ tahi_ipsec_007[]; +extern TAHI_TEST_SEQ tahi_ipsec_008[]; +/* +extern TAHI_TEST_SEQ tahi_ipsec_008_02[]; +*/ +extern TAHI_TEST_SEQ tahi_ipsec_009[]; +extern TAHI_TEST_SEQ tahi_ipsec_009_02[]; +extern TAHI_TEST_SEQ tahi_ipsec_010[]; +extern TAHI_TEST_SEQ tahi_ipsec_011[]; +extern TAHI_TEST_SEQ tahi_ipsec_012[]; +extern TAHI_TEST_SEQ tahi_ipsec_013[]; +extern TAHI_TEST_SEQ tahi_ipsec_014[]; +extern TAHI_TEST_SEQ tahi_ipsec_015[]; +extern TAHI_TEST_SEQ tahi_ipsec_016[]; +extern TAHI_TEST_SEQ tahi_ipsec_017[]; +extern TAHI_TEST_SEQ tahi_ipsec_018[]; +extern TAHI_TEST_SEQ tahi_ipsec_019[]; +extern TAHI_TEST_SEQ tahi_ipsec_020[]; +extern TAHI_TEST_SEQ tahi_ipsec_021[]; +extern TAHI_TEST_SEQ tahi_ipsec_022[]; +extern TAHI_TEST_SEQ tahi_ipsec_023[]; +extern TAHI_TEST_SEQ tahi_ipsec_024[]; +extern TAHI_TEST_SEQ tahi_ipsec_025[]; +extern TAHI_TEST_SEQ tahi_ipsec_026[]; + +extern int tahi_ipsec_006_size; +extern int tahi_ipsec_007_size; +extern int tahi_ipsec_008_size; +//extern int tahi_ipsec_008_02_size; +extern int tahi_ipsec_009_size; +extern int tahi_ipsec_009_02_size; +extern int tahi_ipsec_010_size; +extern int tahi_ipsec_011_size; +extern int tahi_ipsec_012_size; +extern int tahi_ipsec_013_size; +extern int tahi_ipsec_014_size; +extern int tahi_ipsec_015_size; +extern int tahi_ipsec_016_size; +extern int tahi_ipsec_017_size; +extern int tahi_ipsec_018_size; +extern int tahi_ipsec_019_size; +extern int tahi_ipsec_020_size; +extern int tahi_ipsec_021_size; +extern int tahi_ipsec_022_size; +extern int tahi_ipsec_023_size; +extern int tahi_ipsec_024_size; +extern int tahi_ipsec_025_size; +extern int tahi_ipsec_026_size; + +static TAHI_TEST_SUITE test_suite[30]; + +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_ipsec_006[0]; test_suite[0].test_case_size = tahi_ipsec_006_size; + test_suite[1].test_case = &tahi_ipsec_007[0]; test_suite[1].test_case_size = tahi_ipsec_007_size; + test_suite[2].test_case = &tahi_ipsec_008[0]; test_suite[2].test_case_size = tahi_ipsec_008_size; +// test_suite[3].test_case = &tahi_ipsec_008_02[0]; test_suite[3].test_case_size = tahi_ipsec_008_02_size; + test_suite[4].test_case = &tahi_ipsec_009[0]; test_suite[4].test_case_size = tahi_ipsec_009_size; + test_suite[5].test_case = &tahi_ipsec_009_02[0]; test_suite[5].test_case_size = tahi_ipsec_009_02_size; + test_suite[6].test_case = &tahi_ipsec_010[0]; test_suite[6].test_case_size = tahi_ipsec_010_size; + // test_suite[7].test_case = &tahi_ipsec_011[0]; test_suite[7].test_case_size = tahi_ipsec_011_size; + test_suite[8].test_case = &tahi_ipsec_012[0]; test_suite[8].test_case_size = tahi_ipsec_012_size; + test_suite[9].test_case = &tahi_ipsec_013[0]; test_suite[9].test_case_size = tahi_ipsec_013_size; + test_suite[10].test_case = &tahi_ipsec_014[0]; test_suite[10].test_case_size = tahi_ipsec_014_size; + test_suite[11].test_case = &tahi_ipsec_015[0]; test_suite[11].test_case_size = tahi_ipsec_015_size; + test_suite[12].test_case = &tahi_ipsec_016[0]; test_suite[12].test_case_size = tahi_ipsec_016_size; + test_suite[13].test_case = &tahi_ipsec_017[0]; test_suite[13].test_case_size = tahi_ipsec_017_size; + test_suite[14].test_case = &tahi_ipsec_018[0]; test_suite[14].test_case_size = tahi_ipsec_018_size; + test_suite[15].test_case = &tahi_ipsec_019[0]; test_suite[15].test_case_size = tahi_ipsec_019_size; +// test_suite[16].test_case = &tahi_ipsec_020[0]; test_suite[16].test_case_size = tahi_ipsec_020_size; +// test_suite[17].test_case = &tahi_ipsec_021[0]; test_suite[17].test_case_size = tahi_ipsec_021_size; + test_suite[18].test_case = &tahi_ipsec_022[0]; test_suite[18].test_case_size = tahi_ipsec_022_size; + test_suite[19].test_case = &tahi_ipsec_023[0]; test_suite[19].test_case_size = tahi_ipsec_023_size; + test_suite[20].test_case = &tahi_ipsec_024[0]; test_suite[20].test_case_size = tahi_ipsec_024_size; + test_suite[21].test_case = &tahi_ipsec_025[0]; test_suite[21].test_case_size = tahi_ipsec_025_size; + test_suite[22].test_case = &tahi_ipsec_026[0]; test_suite[22].test_case_size = tahi_ipsec_026_size; + +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_ipsec_2_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); + pointer = pointer + 1536*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Enable IPv6 */ + status += nx_ipsec_enable(&ip_0); + + /* Enable UDP */ + status += nx_udp_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + /* Set ipv6 version and address. */ + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; + ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ +UINT status = 0; + + init_para(); + + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[2].test_case, test_suite[2].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); + + clean_sa(); + create_sa(5, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[5].test_case, test_suite[5].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[6].test_case, test_suite[6].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[8].test_case, test_suite[8].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[9].test_case, test_suite[8].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[10].test_case, test_suite[10].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_aes_xcbc_mac, + ingress_aes_xcbc_mac, egress_aes_xcbc_mac, + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &ingress_aes_xcbc, &egress_aes_xcbc, sizeof(NX_CRYPTO_AES)); + netx_tahi_run_test_case(&ip_0, test_suite[11].test_case, test_suite[11].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_null, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + 0, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + NX_NULL, NX_NULL, 0); + netx_tahi_run_test_case(&ip_0, test_suite[12].test_case, test_suite[12].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_aes_cbc, &crypto_method_aes_cbc, + ingress_aes_cbc[0], egress_aes_cbc[0], + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[13].test_case, test_suite[13].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_aes_ctr, &crypto_method_aes_ctr, + ingress_aes_ctr, egress_aes_ctr, + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[14].test_case, test_suite[14].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_null, &crypto_method_null, + ingress_3des_cbc[0], egress_3des_cbc[0], + 0, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + NX_NULL, NX_NULL, 0, + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[15].test_case, test_suite[15].test_case_size); + + +//----------------------------Tunnel Mode test-------------------------------// + + clean_sa(); + create_sa(6, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + //Setup the tunnel source and destination address on IPSEC_TUNNEL_MODE + tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; + tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; + tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; + + tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; + tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; + tunnel_exit_address.nxd_ip_address.v6[3] = 0x00000001; + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[6], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[18].test_case, test_suite[18].test_case_size); + + + tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; + tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; + tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; + + tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; + tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; + tunnel_exit_address.nxd_ip_address.v6[3] = 0x0000000e; + + clean_sa(); + create_sa(7, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[19].test_case, test_suite[19].test_case_size); + + clean_sa(); + create_sa(8, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + create_sa(9, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[9], egress_3des_cbc[9], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[9], egress_hmac_sha1[9], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[9], &egress_3des[9], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[8], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + status += _nx_ipsec_sa_tunnel_create(&egress_sa[9], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[20].test_case, test_suite[20].test_case_size); + + clean_sa(); + create_sa(7, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[21].test_case, test_suite[21].test_case_size); + + clean_sa(); + create_sa(7, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[22].test_case, test_suite[22].test_case_size); + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +/* Initialize parameters for IPSec. */ +static void init_para() +{ + UINT i; + + /* Setup addresses of selectors. */ + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; + memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + + ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + } + + /*Setup destination IP address. */ + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; + memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 8-2 */ + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + + /* Used by test case 9-2 */ + + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + + /* Used by test case 22 */ + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 23 */ + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); + + /* Used by test case 24-1 */ + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 24-2 */ + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + + /* Setup SPI. */ + ingress_spi[0] = 0x1000; + egress_spi[0] = 0x2000; + ingress_spi[1] = 0x3000; + egress_spi[1] = 0x4000; + ingress_spi[2] = 0x1000; + egress_spi[2] = 0x2000; + ingress_spi[3] = 0x1000; + egress_spi[3] = 0x3000; + ingress_spi[4] = 0x1000; + egress_spi[4] = 0x2000; + ingress_spi[5] = 0x1000; + egress_spi[5] = 0x2000; + ingress_spi[6] = 0x1000; + egress_spi[6] = 0x2000; + ingress_spi[7] = 0x1000; + egress_spi[7] = 0x2000; + ingress_spi[8] = 0x1000; + egress_spi[8] = 0x2000; + ingress_spi[9] = 0x3000; + egress_spi[9] = 0x4000; + + /* Setup encryption key. */ + memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); + memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); + + memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); + memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); + + memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); + memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); + + memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); + memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); + + memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); + memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); + + /* Setup selectors. */ + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; + +} + + +/* Clean SA for IPSec. */ +static UINT clean_sa() +{ + + UINT status = 0, i; + + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + if(ingress_sa[i].nx_ipsec_sa_id) + status = nx_ipsec_sa_delete(&ingress_sa[i]); + if(egress_sa[i].nx_ipsec_sa_id) + status += nx_ipsec_sa_delete(&egress_sa[i]); + + } + + return status; +} + +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) +{ + nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), + sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, + sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); + return; +} + +/* Create SA for IPSec. */ +UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) +{ + + UINT status; + + status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], + sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, + sa_encryption_key_ingress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, + sa_integrity_key_ingress, sa_integrity_key_len_in_bits); + + if (status) + error_counter++; + + status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], + sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, + sa_encryption_key_egress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, + sa_integrity_key_egress, sa_integrity_key_len_in_bits); + if (status) + error_counter++; + + return status; +} + +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec_udp.c b/test/regression/tahi_test/netx_tahi_test_ipsec_udp.c new file mode 100644 index 00000000..674d27c8 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_ipsec_udp.c @@ -0,0 +1,671 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" + +#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ipsec.h" +#include "nx_crypto.h" +#include "nx_crypto_3des.h" +#include "nx_crypto_aes.h" +#include "nx_crypto_des.h" +#include "nx_crypto_dh.h" +#include "nx_crypto_hmac_md5.h" +#include "nx_crypto_hmac_sha1.h" +#include "nx_crypto_md5.h" +#include "nx_crypto_null.h" +#include "nx_crypto_sha1.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define IPSEC_MAX_END_NODE 10 +#define IPSEC_SA_LIFETIME 5000 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_UDP_SOCKET socket_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +/* Define IPSEC related data. */ + +static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; +static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_aes_xcbc_mac[32]; +static UCHAR ingress_aes_xcbc_mac[32]; +static ULONG egress_spi[IPSEC_MAX_END_NODE]; +static ULONG ingress_spi[IPSEC_MAX_END_NODE]; +static UCHAR ingress_aes_ctr[32]; +static UCHAR egress_aes_ctr[32]; + +/* Define the Crypto Method */ + +static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; +static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; +static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; + + +/* 3DES, encrypt */ +static NX_CRYPTO_METHOD crypto_method_t_des = +{ + NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used */ + (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ + sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ + NX_NULL, /* 3DES-CBC cleanup routine, not used */ + _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ +}; + +/* HMAC SHA1 */ +static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = +{ + NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ + 0, /* IV size in bits, not used */ + NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ + 0, /* Block size in bytes, not used */ + 0, /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ +}; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void init_para(); +static UINT clean_sa(); +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); + +static UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); +extern UINT _nxd_udp_socket_send(NX_UDP_SOCKET *socket_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *ip_address, UINT port); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_ipsec_udp_001[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_002[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_004[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_005[]; + +extern int tahi_ipsec_udp_001_size; +extern int tahi_ipsec_udp_002_size; +extern int tahi_ipsec_udp_004_size; +extern int tahi_ipsec_udp_005_size; + +static TAHI_TEST_SUITE test_suite[10]; + +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_ipsec_udp_001[0]; test_suite[0].test_case_size = tahi_ipsec_udp_001_size; + test_suite[1].test_case = &tahi_ipsec_udp_002[0]; test_suite[1].test_case_size = tahi_ipsec_udp_002_size; + /* + test_suite[2].test_case = &tahi_ipsec_udp_003[0]; test_suite[2].test_case_size = tahi_ipsec_udp_003_size; + */ + test_suite[3].test_case = &tahi_ipsec_udp_004[0]; test_suite[3].test_case_size = tahi_ipsec_udp_004_size; + test_suite[4].test_case = &tahi_ipsec_udp_005[0]; test_suite[4].test_case_size = tahi_ipsec_udp_005_size; +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_ipsec_udp_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create udp process thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1640, pointer, 1640*16); + pointer = pointer + 1640*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Enable IPv6 */ + status += nx_ipsec_enable(&ip_0); + + /* Enable UDP */ + status += nx_udp_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + /* Set ipv6 version and address. */ + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; + ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ + + init_para(); + + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + + create_sa(0,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + create_sa(1,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[1], egress_3des_cbc[1], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[1], egress_hmac_sha1[1], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[1], &egress_3des[1], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[1], &metadata_egress_hmac_sha1[1], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); + + clean_sa(); + create_sa(0,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[3].test_case, test_suite[3].test_case_size); + +#if 0 + clean_sa(); + create_sa(0,NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des,&crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); +#endif + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +/* Initialize parameters for IPSec. */ +static void init_para() +{ + UINT i; + + /* Setup addresses of selectors. */ + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; + memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + } + + /*Setup destination IP address. */ + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; + memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 8-2 */ + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + + /* Used by test case 9-2 */ + + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + + /* Used by test case 22 */ + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 23 */ + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); + + /* Used by test case 24-1 */ + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 24-2 */ + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + + + /* Setup SPI. */ + ingress_spi[0] = 0x1000; + egress_spi[0] = 0x2000; + ingress_spi[1] = 0x3000; + egress_spi[1] = 0x4000; + ingress_spi[2] = 0x1000; + egress_spi[2] = 0x2000; + ingress_spi[3] = 0x1000; + egress_spi[3] = 0x3000; + ingress_spi[4] = 0x1000; + egress_spi[4] = 0x2000; + ingress_spi[5] = 0x1000; + egress_spi[5] = 0x2000; + ingress_spi[6] = 0x1000; + egress_spi[6] = 0x2000; + ingress_spi[7] = 0x1000; + egress_spi[7] = 0x2000; + ingress_spi[8] = 0x1000; + egress_spi[8] = 0x2000; + ingress_spi[9] = 0x3000; + egress_spi[9] = 0x4000; + + /* Setup encryption key. */ + memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); + memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); + + memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); + memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); + + + memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); + memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); + + memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); + memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); + + memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); + memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); + + /* Setup selectors. */ + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; + +} + + +/* Clean SA for IPSec. */ +static UINT clean_sa() +{ + + UINT status = 0, i; + + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + if(ingress_sa[i].nx_ipsec_sa_id) + status = nx_ipsec_sa_delete(&ingress_sa[i]); + if(egress_sa[i].nx_ipsec_sa_id) + status += nx_ipsec_sa_delete(&egress_sa[i]); + + } + + return status; +} + +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) +{ + + nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), + sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, + sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); + + return; +} + +/* Create SA for IPSec. */ +UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) +{ + + UINT status; + + status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], + sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, + sa_encryption_key_ingress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, + sa_integrity_key_ingress, sa_integrity_key_len_in_bits); + + if (status) + error_counter++; + + status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], + sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, + sa_encryption_key_egress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, + sa_integrity_key_egress, sa_integrity_key_len_in_bits); + if (status) + error_counter++; + + return status; +} + + +/* Process udp packet. */ +static void thread_1_entry(ULONG thread_input) +{ + + NX_PACKET *tx_packet, *rx_packet; + UINT status; + NX_IPV6_HEADER *ipv6_header; + NXD_ADDRESS ipv6_address; /* Destination Addresses. */ + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + if (status) + { + error_counter++; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 7, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + while(1) + { + status = nx_udp_socket_receive(&socket_0, &rx_packet, TX_WAIT_FOREVER); + if (status == NX_SUCCESS) + { + status = nx_packet_allocate(&pool_0, &tx_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + break; + } + + status = nx_packet_data_append(tx_packet, rx_packet -> nx_packet_prepend_ptr, rx_packet -> nx_packet_length, &pool_0, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + nx_packet_release(rx_packet); + break; + } + + ipv6_header = (NX_IPV6_HEADER*)(rx_packet -> nx_packet_ip_header); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + memcpy(ipv6_address.nxd_ip_address.v6, ipv6_header -> nx_ip_header_source_ip, (sizeof(ULONG) << 2)); + + status = _nxd_udp_socket_send(&socket_0, tx_packet, &ipv6_address, 100 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + nx_packet_release(tx_packet); + } + + nx_packet_release(rx_packet); + } + } +} +#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c b/test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c new file mode 100644 index 00000000..5881dbe0 --- /dev/null +++ b/test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c @@ -0,0 +1,968 @@ +#include "tx_api.h" +#include "nx_api.h" +#include "netx_tahi.h" + +#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE + +#include "nx_tcp.h" +#include "nx_ip.h" +#include "nx_ipv6.h" +#include "nx_icmpv6.h" +#include "nx_ipsec.h" +#include "nx_crypto.h" +#include "nx_crypto_3des.h" +#include "nx_crypto_aes.h" +#include "nx_crypto_des.h" +#include "nx_crypto_dh.h" +#include "nx_crypto_hmac_md5.h" +#include "nx_crypto_hmac_sha1.h" +#include "nx_crypto_md5.h" +#include "nx_crypto_null.h" +#include "nx_crypto_sha1.h" + +#define DEMO_STACK_SIZE 2048 +#define TEST_INTERFACE 0 +#define IPSEC_MAX_END_NODE 10 +#define IPSEC_SA_LIFETIME 5000 + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD thread_0; +static TX_THREAD thread_1; + +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; +static NX_UDP_SOCKET socket_0; + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; +static NXD_ADDRESS ipv6_address_1; +static NXD_ADDRESS ipv6_address_2; + +static NXD_ADDRESS tunnel_entry_address; +static NXD_ADDRESS tunnel_exit_address; + +/* Define IPSEC related data. */ + +static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; +static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; +static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; +static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; +static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; +static UCHAR egress_aes_xcbc_mac[32]; +static UCHAR ingress_aes_xcbc_mac[32]; +static ULONG egress_spi[IPSEC_MAX_END_NODE]; +static ULONG ingress_spi[IPSEC_MAX_END_NODE]; +static UCHAR ingress_aes_ctr[32]; +static UCHAR egress_aes_ctr[32]; + +/* Define the Crypto Method */ + +static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; + +static NX_CRYPTO_AES egress_aes[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_AES ingress_aes[IPSEC_MAX_END_NODE]; +static NX_CRYPTO_AES egress_aes_xcbc; +static NX_CRYPTO_AES ingress_aes_xcbc; + +static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; +static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; + +/* NULL encrypt */ +static NX_CRYPTO_METHOD crypto_method_null = +{ + NX_CRYPTO_ENCRYPTION_NULL, /* Name of the crypto algorithm */ + 0, /* Key size in bits, not used */ + 0, /* IV size in bits, not used */ + 0, /* ICV size in bits, not used */ + 4, /* Block size in bytes */ + 0, /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_null_operation /* NULL operation */ +}; + +/* 3DES, encrypt */ +static NX_CRYPTO_METHOD crypto_method_t_des = +{ + NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used */ + (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ + sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ + NX_NULL, /* 3DES-CBC cleanup routine, not used */ + _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ +}; + +/* AES-CBC. */ +static NX_CRYPTO_METHOD crypto_method_aes_cbc = +{ + NX_CRYPTO_ENCRYPTION_AES_CBC, /* AES crypto algorithm */ + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_AES_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used. */ + (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ + sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ + NX_NULL, /* AES-CBC cleanup routine, not used. */ + _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ + +}; + +/* AES-CTR. */ +static NX_CRYPTO_METHOD crypto_method_aes_ctr = +{ + NX_CRYPTO_ENCRYPTION_AES_CTR, /* AES crypto algorithm */ + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ + NX_CRYPTO_AES_CTR_IV_LEN_IN_BITS, /* IV size in bits */ + 0, /* ICV size in bits, not used. */ + (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ + sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ + _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ + NX_NULL, /* AES-CBC cleanup routine, not used. */ + _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ +}; + +/* HMAC SHA1 */ +static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = +{ + NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ + 0, /* IV size in bits, not used */ + NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ + 0, /* Block size in bytes, not used */ + 0, /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ +}; + +/* AES_XCBC_96 */ +static NX_CRYPTO_METHOD crypto_method_aes_xcbc_mac = +{ + NX_CRYPTO_AUTHENTICATION_AES_XCBC_MAC_96, /* AES_XCBC_MAC algorithm */ + NX_CRYPTO_AES_XCBC_MAC_KEY_LEN_IN_BITS, /* Key size in bits */ + 0, /* IV size in bits, not used */ + NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ + 0, /* Block size in bytes, not used */ + sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ + NX_NULL, /* Initialization routine, not used */ + NX_NULL, /* Cleanup routine, not used */ + _nx_ipsec_crypto_method_aes_xcbc_mac_operation /* AES_XCBC_MAC operation */ +}; + +/* Define thread prototypes. */ +static void thread_0_entry(ULONG thread_input); +static void thread_1_entry(ULONG thread_input); +extern void test_control_return(UINT status); +extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void init_para(); +static UINT clean_sa(); +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); + +static UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); +extern UINT _nxd_udp_socket_send(NX_UDP_SOCKET *socket_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *ip_address, UINT port); + +/* Define the test threads. */ +extern TAHI_TEST_SEQ tahi_ipsec_udp_006[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_007[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_008[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_009[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_009_02[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_010[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_011[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_012[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_013[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_014[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_015[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_016[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_017[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_018[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_019[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_020[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_021[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_022[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_023[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_024[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_025[]; +extern TAHI_TEST_SEQ tahi_ipsec_udp_026[]; + +extern int tahi_ipsec_udp_006_size; +extern int tahi_ipsec_udp_007_size; +extern int tahi_ipsec_udp_008_size; +/* +extern int tahi_ipsec_udp_008_02_size; +*/ +extern int tahi_ipsec_udp_009_size; +extern int tahi_ipsec_udp_009_02_size; +extern int tahi_ipsec_udp_010_size; +extern int tahi_ipsec_udp_011_size; +extern int tahi_ipsec_udp_012_size; +extern int tahi_ipsec_udp_013_size; +extern int tahi_ipsec_udp_014_size; +extern int tahi_ipsec_udp_015_size; +extern int tahi_ipsec_udp_016_size; +extern int tahi_ipsec_udp_017_size; +extern int tahi_ipsec_udp_018_size; +extern int tahi_ipsec_udp_019_size; +extern int tahi_ipsec_udp_020_size; +extern int tahi_ipsec_udp_021_size; +extern int tahi_ipsec_udp_022_size; +extern int tahi_ipsec_udp_023_size; +extern int tahi_ipsec_udp_024_size; +extern int tahi_ipsec_udp_025_size; +extern int tahi_ipsec_udp_026_size; + +static TAHI_TEST_SUITE test_suite[30]; + +static void build_test_suite(void) +{ + + test_suite[0].test_case = &tahi_ipsec_udp_006[0]; test_suite[0].test_case_size = tahi_ipsec_udp_006_size; + test_suite[1].test_case = &tahi_ipsec_udp_007[0]; test_suite[1].test_case_size = tahi_ipsec_udp_007_size; + test_suite[2].test_case = &tahi_ipsec_udp_008[0]; test_suite[2].test_case_size = tahi_ipsec_udp_008_size; + // test_suite[3].test_case = &tahi_ipsec_udp_008_02[0]; test_suite[3].test_case_size = tahi_ipsec_udp_008_02_size; + test_suite[4].test_case = &tahi_ipsec_udp_009[0]; test_suite[4].test_case_size = tahi_ipsec_udp_009_size; + test_suite[5].test_case = &tahi_ipsec_udp_009_02[0]; test_suite[5].test_case_size = tahi_ipsec_udp_009_02_size; + test_suite[6].test_case = &tahi_ipsec_udp_010[0]; test_suite[6].test_case_size = tahi_ipsec_udp_010_size; + test_suite[7].test_case = &tahi_ipsec_udp_011[0]; test_suite[7].test_case_size = tahi_ipsec_udp_011_size; + test_suite[8].test_case = &tahi_ipsec_udp_012[0]; test_suite[8].test_case_size = tahi_ipsec_udp_012_size; + test_suite[9].test_case = &tahi_ipsec_udp_013[0]; test_suite[9].test_case_size = tahi_ipsec_udp_013_size; + test_suite[10].test_case = &tahi_ipsec_udp_014[0]; test_suite[10].test_case_size = tahi_ipsec_udp_014_size; + test_suite[11].test_case = &tahi_ipsec_udp_015[0]; test_suite[11].test_case_size = tahi_ipsec_udp_015_size; + test_suite[12].test_case = &tahi_ipsec_udp_016[0]; test_suite[12].test_case_size = tahi_ipsec_udp_016_size; + test_suite[13].test_case = &tahi_ipsec_udp_017[0]; test_suite[13].test_case_size = tahi_ipsec_udp_017_size; + test_suite[14].test_case = &tahi_ipsec_udp_018[0]; test_suite[14].test_case_size = tahi_ipsec_udp_018_size; + test_suite[15].test_case = &tahi_ipsec_udp_019[0]; test_suite[15].test_case_size = tahi_ipsec_udp_019_size; + // test_suite[16].test_case = &tahi_ipsec_udp_020[0]; test_suite[16].test_case_size = tahi_ipsec_udp_020_size; + // test_suite[17].test_case = &tahi_ipsec_udp_021[0]; test_suite[17].test_case_size = tahi_ipsec_udp_021_size; + test_suite[18].test_case = &tahi_ipsec_udp_022[0]; test_suite[18].test_case_size = tahi_ipsec_udp_022_size; + test_suite[19].test_case = &tahi_ipsec_udp_023[0]; test_suite[19].test_case_size = tahi_ipsec_udp_023_size; + test_suite[20].test_case = &tahi_ipsec_udp_024[0]; test_suite[20].test_case_size = tahi_ipsec_udp_024_size; + test_suite[21].test_case = &tahi_ipsec_udp_025[0]; test_suite[21].test_case_size = tahi_ipsec_udp_025_size; + test_suite[22].test_case = &tahi_ipsec_udp_026[0]; test_suite[22].test_case_size = tahi_ipsec_udp_026_size; + +} + + +/* Define what the initial system looks like. */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tahi_test_ipsec_udp_2_define(void *first_unused_memory) +#endif +{ + CHAR *pointer; + UINT status; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + error_counter = 0; + memset(&test_suite, 0, sizeof(test_suite)); + + build_test_suite(); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create udp process thread. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create a packet pool. */ + status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1600, pointer, 1600*16); + pointer = pointer + 1600*16; + + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, + pointer, 2048, 1); + pointer = pointer + 2048; + + /* Enable ICMP for IP Instance 0 and 1. */ + status = nxd_icmp_enable(&ip_0); + + /* Check ARP enable status. */ + if(status) + error_counter++; + + /* Enable IPv6 */ + status += nxd_ipv6_enable(&ip_0); + + /* Enable IPv6 */ + status += nx_ipsec_enable(&ip_0); + + /* Enable UDP */ + status += nx_udp_enable(&ip_0); + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status += nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable fragment processing for IP Instance 0. */ + status = nx_ip_fragment_enable(&ip_0); + + /* Set ipv6 version and address. */ + ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; + ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; + ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); + + /* Set ipv6 version and address. */ + ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; + ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; + ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; + ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; + ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; + + status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); + + /* Check fragment enable status. */ + if(status) + error_counter++; +} + +static void thread_0_entry(ULONG thread_input) +{ +UINT status = 0; + init_para(); + + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[2].test_case, test_suite[2].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); + + clean_sa(); + create_sa(5, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[5].test_case, test_suite[5].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[6].test_case, test_suite[6].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[7].test_case, test_suite[7].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[8].test_case, test_suite[8].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[9].test_case, test_suite[8].test_case_size); + netx_tahi_run_test_case(&ip_0, test_suite[10].test_case, test_suite[10].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_aes_xcbc_mac, + ingress_aes_xcbc_mac, egress_aes_xcbc_mac, + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &ingress_aes_xcbc, &egress_aes_xcbc, sizeof(NX_CRYPTO_AES)); + netx_tahi_run_test_case(&ip_0, test_suite[11].test_case, test_suite[11].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_null, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + 0, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + NX_NULL, NX_NULL, 0); + netx_tahi_run_test_case(&ip_0, test_suite[12].test_case, test_suite[12].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_aes_cbc, &crypto_method_aes_cbc, + ingress_aes_cbc[0], egress_aes_cbc[0], + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[13].test_case, test_suite[13].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_aes_ctr, &crypto_method_aes_ctr, + ingress_aes_ctr, egress_aes_ctr, + NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[14].test_case, test_suite[14].test_case_size); + + clean_sa(); + create_sa(0, NX_IPSEC_TRANSPORT_MODE, + &crypto_method_null, &crypto_method_null, + ingress_3des_cbc[0], egress_3des_cbc[0], + 0, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + NX_NULL, NX_NULL, 0, + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + netx_tahi_run_test_case(&ip_0, test_suite[15].test_case, test_suite[15].test_case_size); + +//----------------------------Tunnel Mode test-------------------------------// + + clean_sa(); + create_sa(6, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + //Setup the tunnel source and destination address on IPSEC_TUNNEL_MODE + tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; + tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; + tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; + + tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; + tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; + tunnel_exit_address.nxd_ip_address.v6[3] = 0x00000001; + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[6], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[18].test_case, test_suite[18].test_case_size); + + + tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; + tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; + tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; + + tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; + tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; + tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; + tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; + tunnel_exit_address.nxd_ip_address.v6[3] = 0x0000000e; + + clean_sa(); + create_sa(7, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[19].test_case, test_suite[19].test_case_size); + + clean_sa(); + create_sa(8, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + create_sa(9, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[9], egress_3des_cbc[9], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[9], egress_hmac_sha1[9], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[9], &egress_3des[9], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[8], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + status += _nx_ipsec_sa_tunnel_create(&egress_sa[9], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[20].test_case, test_suite[20].test_case_size); + + clean_sa(); + create_sa(7, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[21].test_case, test_suite[21].test_case_size); + + + clean_sa(); + create_sa(7, NX_IPSEC_TUNNEL_MODE, + &crypto_method_t_des, &crypto_method_t_des, + ingress_3des_cbc[0], egress_3des_cbc[0], + NX_CRYPTO_3DES_KEY_LEN_IN_BITS, + &crypto_method_hmac_sha1, + ingress_hmac_sha1[0], egress_hmac_sha1[0], + NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, + &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), + &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); + + status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); + if (status) + error_counter++; + netx_tahi_run_test_case(&ip_0, test_suite[22].test_case, test_suite[22].test_case_size); + + test_control_return(0xdeadbeef); + + /* Clear the flags. */ + +} + +/* Initialize parameters for IPSec. */ +static void init_para() +{ + UINT i; + + /* Setup addresses of selectors. */ + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; + egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; + memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); + + ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; + ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; + } + + /*Setup destination IP address. */ + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; + memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 8-2 */ + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; + + /* Used by test case 9-2 */ + + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); + memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; + ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; + + /* Used by test case 22 */ + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + /* Used by test case 23 */ + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; + memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; + egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); + + + /* Used by test case 24-1 */ + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; + memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + + /* Used by test case 24-2 */ + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, + &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; + memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, + &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); + + + /* Setup SPI. */ + ingress_spi[0] = 0x1000; + egress_spi[0] = 0x2000; + ingress_spi[1] = 0x3000; + egress_spi[1] = 0x4000; + ingress_spi[2] = 0x1000; + egress_spi[2] = 0x2000; + ingress_spi[3] = 0x1000; + egress_spi[3] = 0x3000; + ingress_spi[4] = 0x1000; + egress_spi[4] = 0x2000; + ingress_spi[5] = 0x1000; + egress_spi[5] = 0x2000; + ingress_spi[6] = 0x1000; + egress_spi[6] = 0x2000; + ingress_spi[7] = 0x1000; + egress_spi[7] = 0x2000; + ingress_spi[8] = 0x1000; + egress_spi[8] = 0x2000; + ingress_spi[9] = 0x3000; + egress_spi[9] = 0x4000; + + /* Setup encryption key. */ + memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); + memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); + + memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); + memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); + memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); + memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); + + memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); + memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); + + memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); + memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); + + memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); + memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); + memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); + memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); + + memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); + memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); + + /* Setup selectors. */ + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; + ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; + + egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; + egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; + +} + + +/* Clean SA for IPSec. */ +static UINT clean_sa() +{ + + UINT status = 0, i; + + for(i = 0; i < IPSEC_MAX_END_NODE; i++) + { + if(ingress_sa[i].nx_ipsec_sa_id) + status = nx_ipsec_sa_delete(&ingress_sa[i]); + if(egress_sa[i].nx_ipsec_sa_id) + status += nx_ipsec_sa_delete(&egress_sa[i]); + + } + + return status; +} + +static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) +{ + + nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), + sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, + sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); + + return; +} + +/* Create SA for IPSec. */ +UINT create_sa(UINT index, UCHAR sa_mode, + NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, + UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, + UINT sa_encryption_key_len_in_bits, + NX_CRYPTO_METHOD* sa_integrity_method, + UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, + UINT sa_integrity_key_len_in_bits, + VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, + VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) +{ + + UINT status; + + status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], + sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, + sa_encryption_key_ingress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, + sa_integrity_key_ingress, sa_integrity_key_len_in_bits); + + if (status) + error_counter++; + + status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, + NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, + (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], + sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, + sa_encryption_key_egress, sa_encryption_key_len_in_bits, + sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, + sa_integrity_key_egress, sa_integrity_key_len_in_bits); + if (status) + error_counter++; + + return status; +} + +/* Process udp packet. */ +static void thread_1_entry(ULONG thread_input) +{ + + NX_PACKET *tx_packet, *rx_packet; + UINT status; + NX_IPV6_HEADER *ipv6_header; + NXD_ADDRESS ipv6_address; /* Destination Addresses. */ + + /* Create a UDP socket. */ + status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + if (status) + { + error_counter++; + return; + } + + /* Bind the UDP socket to the IP port. */ + status = nx_udp_socket_bind(&socket_0, 7, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + return; + } + + while(1) + { + status = nx_udp_socket_receive(&socket_0, &rx_packet, TX_WAIT_FOREVER); + if (status == NX_SUCCESS) + { + status = nx_packet_allocate(&pool_0, &tx_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + break; + } + + status = nx_packet_data_append(tx_packet, rx_packet -> nx_packet_prepend_ptr, rx_packet -> nx_packet_length, &pool_0, TX_WAIT_FOREVER); + if (status != NX_SUCCESS) + { + nx_packet_release(rx_packet); + break; + } + + ipv6_header = (NX_IPV6_HEADER*)(rx_packet -> nx_packet_ip_header); + ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; + memcpy(ipv6_address.nxd_ip_address.v6, ipv6_header -> nx_ip_header_source_ip, (sizeof(ULONG) << 2)); + + status = _nxd_udp_socket_send(&socket_0, tx_packet, &ipv6_address, 100 * NX_IP_PERIODIC_RATE); + if (status != NX_SUCCESS) + { + nx_packet_release(tx_packet); + } + + nx_packet_release(rx_packet); + } + } +} + +#endif diff --git a/test/regression/tahi_test/tahi.a b/test/regression/tahi_test/tahi.a new file mode 100644 index 00000000..eb97f477 Binary files /dev/null and b/test/regression/tahi_test/tahi.a differ diff --git a/test/regression/tahi_test/tahi.so b/test/regression/tahi_test/tahi.so new file mode 100644 index 00000000..1a3ca331 Binary files /dev/null and b/test/regression/tahi_test/tahi.so differ diff --git a/test/regression/tahi_test/tahi64.a b/test/regression/tahi_test/tahi64.a new file mode 100644 index 00000000..5cf04352 Binary files /dev/null and b/test/regression/tahi_test/tahi64.a differ diff --git a/test/regression/tahi_test/tahi64.so b/test/regression/tahi_test/tahi64.so new file mode 100644 index 00000000..81bd9e19 Binary files /dev/null and b/test/regression/tahi_test/tahi64.so differ diff --git a/test/regression/tahi_test/tahi_01_001.c b/test/regression/tahi_test/tahi_01_001.c new file mode 100644 index 00000000..88798462 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_001.c @@ -0,0 +1,32 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_01_001[] = { + {TITLE, "01-001", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {CHECK, &pkt1[0], sizeof(pkt1), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} + +}; + +int tahi_01_001_size = sizeof(tahi_01_001) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_01_002.c b/test/regression/tahi_test/tahi_01_002.c new file mode 100644 index 00000000..8a0f66ed --- /dev/null +++ b/test/regression/tahi_test/tahi_01_002.c @@ -0,0 +1,368 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x40, 0x00, /* ......@. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt4[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x50, 0x00, /* ......P. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x70, 0x00, /* ......p. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0xf0, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x04, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +TAHI_TEST_SEQ tahi_01_002[] = { + {TITLE, "01-002", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo Request, Invalid version */ + {N_CHECK, (char *)NS, 0, 5}, /* No response in 5 seconds */ + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, /* Send valid Echo Request */ + {CHECK, &pkt3[0], sizeof(pkt3), 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 10}, + {CHECK, &pkt21[0], sizeof(pkt21), 10}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_002_size = sizeof(tahi_01_002) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_003.c b/test/regression/tahi_test/tahi_01_003.c new file mode 100644 index 00000000..c70a7362 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_003.c @@ -0,0 +1,173 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x62, 0x00, /* ......b. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt8[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + +TAHI_TEST_SEQ tahi_01_003[] = { + {TITLE, "01-003", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_003_size = sizeof(tahi_01_003) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_004.c b/test/regression/tahi_test/tahi_01_004.c new file mode 100644 index 00000000..5264ce12 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_004.c @@ -0,0 +1,175 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x03, /* ......`. */ +0x45, 0x67, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* Eg..:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt8[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_01_004[] = { + {TITLE, "01-004", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_004_size = sizeof(tahi_01_004) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_005.c b/test/regression/tahi_test/tahi_01_005.c new file mode 100644 index 00000000..ca1707e7 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_005.c @@ -0,0 +1,167 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x33, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x25, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, +0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, +0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, +0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, +0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, +0x2b }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x33, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x32, 0x25, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, +0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, +0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, +0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, +0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, +0x2b }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt7[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +#if 0 +static char pkt8[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_01_005[] = { + {TITLE, "01-005", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + {WAIT, NX_NULL, 0, 10}, +#if 0 + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, +#endif + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_005_size = sizeof(tahi_01_005) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_006.c b/test/regression/tahi_test/tahi_01_006.c new file mode 100644 index 00000000..41b09e1d --- /dev/null +++ b/test/regression/tahi_test/tahi_01_006.c @@ -0,0 +1,165 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x32, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x5e, 0x26, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, +0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, +0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, +0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, +0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x32, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x5d, 0x26, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, +0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, +0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, +0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, +0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt7[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +#if 0 +static char pkt8[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_01_006[] = { + {TITLE, "01-006", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + {WAIT, NX_NULL, 0, 10}, +#if 0 + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, +#endif + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_006_size = sizeof(tahi_01_006) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_007.c b/test/regression/tahi_test/tahi_01_007.c new file mode 100644 index 00000000..325ba22a --- /dev/null +++ b/test/regression/tahi_test/tahi_01_007.c @@ -0,0 +1,106 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3b, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_01_007[] = { + {TITLE, "01-007", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 10}, + {WAIT, NX_NULL, 0, 10}, +#if 0 + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, +#endif + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_007_size = sizeof(tahi_01_007) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_008.c b/test/regression/tahi_test/tahi_01_008.c new file mode 100644 index 00000000..fe40398b --- /dev/null +++ b/test/regression/tahi_test/tahi_01_008.c @@ -0,0 +1,7481 @@ + +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + + +/* Frame (60 bytes) */ +static char pkt1[60] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x06, 0x8f, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (108 bytes) */ +static char pkt4[108] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x36, 0x3a, 0xff, 0xfe, 0x80, /* ...6:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x04, 0x01, /* ........ */ +0x3e, 0x4a, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, /* >J....`. */ +0x00, 0x00, 0x00, 0x06, 0x8f, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (108 bytes) */ +static char pkt7[108] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x36, 0x3a, 0xff, 0xfe, 0x80, /* ...6:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x04, 0x01, /* ........ */ +0x3d, 0x4a, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, /* =J....`. */ +0x00, 0x00, 0x00, 0x06, 0x90, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* Frame (60 bytes) */ +static char pkt8[60] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x06, 0x90, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (60 bytes) */ +static char pkt11[60] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x06, 0x91, 0xff, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +/* Frame (108 bytes) */ +static char pkt12[108] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x36, 0x3a, 0xff, 0xfe, 0x80, /* ...6:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x04, 0x01, /* ........ */ +0x3c, 0x4a, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, /* . ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt22[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x35, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5!@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt28[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_01_042[] = { + {TITLE, "01-042", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 10}, + {WAIT, NX_NULL, 0, 10}, + //{CHECK, &pkt26[0], sizeof(pkt26), 5}, + //{CHECK, &pkt27[0], sizeof(pkt27), 5}, + //{CHECK, &pkt28[0], sizeof(pkt28), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_042_size = sizeof(tahi_01_042) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_043.c b/test/regression/tahi_test/tahi_01_043.c new file mode 100644 index 00000000..e1a8d386 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_043.c @@ -0,0 +1,491 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xdf, 0xf3, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x2c, 0xff, 0xfe, 0x80, /* ... ,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x40, 0x00, 0x00, 0x01, 0xfb, 0x02, 0x02, /* .@...... */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt13[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x21, 0x00, 0x00, 0x01, 0xfb, 0x01, 0x01, /* .!...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt14[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x01, 0xfb, 0x80, 0x00, /* ........ */ +0xda, 0x99, 0x01, 0xfb, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (88 bytes) */ +static char pkt14_1[88] = { +0x80, 0x00, 0xda, 0x99, 0x01, 0xfb, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ........ */ +}; +#endif + +/* Frame (142 bytes) */ +static char pkt15[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0x40, 0xfe, 0x80, /* ...X:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0xd9, 0x99, 0x01, 0xfb, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt22[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x35, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5!@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt28[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_01_043[] = { + {TITLE, "01-043", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 10}, + {WAIT, NX_NULL, 0, 10}, + //{CHECK, &pkt26[0], sizeof(pkt26), 5}, + //{CHECK, &pkt27[0], sizeof(pkt27), 5}, + //{CHECK, &pkt28[0], sizeof(pkt28), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_043_size = sizeof(tahi_01_043) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_044.c b/test/regression/tahi_test/tahi_01_044.c new file mode 100644 index 00000000..a5379efa --- /dev/null +++ b/test/regression/tahi_test/tahi_01_044.c @@ -0,0 +1,489 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xdf, 0xf3, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt12[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x0b, 0xb7, 0x80, 0x00, /* ........ */ +0xd9, 0x4a, 0x03, 0x4a, 0x00, 0x00, 0x01, 0x01, /* .J.J.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt13[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x21, 0x00, 0x00, 0x0b, 0xb8, 0x01, 0x01, /* .!...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x2c, 0xff, 0xfe, 0x80, /* ... ,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x40, 0x00, 0x00, 0x0b, 0xb7, 0x02, 0x02, /* .@...... */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (142 bytes) */ +static char pkt15[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0xfe, 0x80, /* ...X:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0xf3, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x0b, 0xb7, 0x80, 0x00, /* ........ */ +0xd9, 0x4a, 0x03, 0x4a, 0x00, 0x00, 0x01, 0x01, /* .J.J.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt25[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x35, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5!@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + + + + + + + + + + +TAHI_TEST_SEQ tahi_01_044[] = { + {TITLE, "01-044", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, //step10 + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + + + {WAIT, NX_NULL, 0, 60}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, //step20 + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + + //{CHECK, &pkt19[0], sizeof(pkt19), 6}, //Received NS + {CHECK, &pkt20[0], sizeof(pkt20), 6}, + //{CHECK, &pkt21[0], sizeof(pkt21), 1}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + //{CHECK, &pkt23[0], sizeof(pkt23), 1}, + {CHECK, &pkt24[0], sizeof(pkt24), 2}, + + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + //{CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_044_size = sizeof(tahi_01_044) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_045.c b/test/regression/tahi_test/tahi_01_045.c new file mode 100644 index 00000000..00b0f156 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_045.c @@ -0,0 +1,484 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xdf, 0xf3, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt12[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x03, 0xa2, 0x80, 0x00, /* ........ */ +0xd8, 0xf2, 0x03, 0xa2, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt13[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, /* ........ */ +0x00, 0x34, 0x00, 0x56, 0x00, 0x78, 0xfe, 0x80, /* .4.V.x.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x21, 0x00, 0x00, 0x03, 0xa2, 0x01, 0x01, /* .!...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x2c, 0xff, 0xfe, 0x80, /* ... ,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x40, 0x00, 0x00, 0x03, 0xa2, 0x02, 0x02, /* .@...... */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (142 bytes) */ +static char pkt15[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0xfe, 0x80, /* ...X:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0xfb, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x03, 0xa2, 0x80, 0x00, /* ........ */ +0xd8, 0xf2, 0x03, 0xa2, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt25[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x35, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5!@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + + + + + + +TAHI_TEST_SEQ tahi_01_045[] = { + {TITLE, "01-045", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, //step 10 + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 65}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + + //{CHECK, &pkt19[0], sizeof(pkt19), 6}, //Received NS step 20 + {CHECK, &pkt20[0], sizeof(pkt20), 6}, + //{CHECK, &pkt21[0], sizeof(pkt21), 2}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + //{CHECK, &pkt23[0], sizeof(pkt23), 2}, + {CHECK, &pkt24[0], sizeof(pkt24), 2}, + + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 10}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_045_size = sizeof(tahi_01_045) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_046.c b/test/regression/tahi_test/tahi_01_046.c new file mode 100644 index 00000000..2858d844 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_046.c @@ -0,0 +1,483 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xdf, 0xf3, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt12[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x03, 0xf9, 0x80, 0x00, /* ........ */ +0xd8, 0x9b, 0x03, 0xf9, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt13[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x21, 0x00, 0x00, 0x03, 0xf9, 0x01, 0x01, /* .!...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x2c, 0xff, 0xfe, 0x80, /* ... ,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x40, 0x00, 0x00, 0x03, 0xf9, 0x02, 0x02, /* .@...... */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (142 bytes) */ +static char pkt15[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0xfe, 0x80, /* ...X:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0xfb, 0x70, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* .p....`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x03, 0xf9, 0x80, 0x00, /* ........ */ +0xd8, 0x9b, 0x03, 0xf9, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt25[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x35, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5!@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + + + + + + + +TAHI_TEST_SEQ tahi_01_046[] = { + {TITLE, "01-046", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, //step10 + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 65}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + //{CHECK, &pkt19[0], sizeof(pkt19), 6}, + {CHECK, &pkt20[0], sizeof(pkt20), 6}, //step20 + //{CHECK, &pkt21[0], sizeof(pkt21), 1}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + //{CHECK, &pkt23[0], sizeof(pkt23), 1}, + {CHECK, &pkt24[0], sizeof(pkt24), 2}, + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 10}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_046_size = sizeof(tahi_01_046) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_047.c b/test/regression/tahi_test/tahi_01_047.c new file mode 100644 index 00000000..1d2e40f5 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_047.c @@ -0,0 +1,1052 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xdf, 0xf3, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt12[126] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x48, 0x3a, 0xff, 0xfe, 0x80, /* ...H:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x18, 0xe0, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt13[126] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x48, 0x3a, 0x40, 0xfe, 0x80, /* ...H:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x17, 0xe0, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (582 bytes) */ +static char pkt14[582] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x10, 0x2c, 0xff, 0xfe, 0x80, /* ....,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, /* ........ */ +0x8b, 0xec, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (582 bytes) */ +static char pkt15[582] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x10, 0x2c, 0xff, 0xfe, 0x80, /* ....,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x02, 0x09, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03 /* ...... */ +}; + +/* Frame (482 bytes) */ +static char pkt16[482] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x01, 0xac, 0x2c, 0xff, 0xfe, 0x80, /* ....,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x04, 0x10, 0x00, 0x00, 0x01, 0x00, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03 /* .. */ +}; + +#if 0 +/* Reassembled IPv6 (1460 bytes) */ +static char pkt16_1[1460] = { +0x80, 0x00, 0x8b, 0xec, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03 /* .... */ +}; +#endif + +/* Frame (1514 bytes) */ +static char pkt17[1514] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x8a, 0xec, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, /* ........ */ +0x03, 0x03 /* .. */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt24[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x35, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5!@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* u5...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt28[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt29[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt30[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_01_047[] = { + {TITLE, "01-047", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {CHECK, &pkt27[0], sizeof(pkt27), 10}, + {WAIT, NX_NULL, 0, 10}, + //{CHECK, &pkt28[0], sizeof(pkt28), 5}, + //{CHECK, &pkt29[0], sizeof(pkt29), 5}, + //{CHECK, &pkt30[0], sizeof(pkt30), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_047_size = sizeof(tahi_01_047) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_048.c b/test/regression/tahi_test/tahi_01_048.c new file mode 100644 index 00000000..b59e3302 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_048.c @@ -0,0 +1,395 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x42, 0x5c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x08, 0xe0, 0x80, 0x00, +0x44, 0xb8, 0x08, 0xe0, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x21, 0x00, 0x00, 0x08, 0xe0, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x40, 0x00, 0x00, 0x08, 0xe0, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x58, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x43, 0xb8, 0x08, 0xe0, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt16[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt17[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x0d, 0xc3, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt23[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +#if 0 +static char pkt24[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_01_048[] = { + {TITLE, "01-048", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NS, 0, 55}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 10}, + {WAIT, NX_NULL, 0, 10}, + //{CHECK, &pkt24[0], sizeof(pkt24), 5}, + //{CHECK, &pkt25[0], sizeof(pkt25), 5}, + //{CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_048_size = sizeof(tahi_01_048) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_049.c b/test/regression/tahi_test/tahi_01_049.c new file mode 100644 index 00000000..e4a8f5a7 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_049.c @@ -0,0 +1,467 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (102 bytes) */ +static char pkt1[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x5c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* B\@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt3[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt8[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, /* ...(,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x04, 0xc5, 0x80, 0x00, /* ........ */ +0x48, 0xd3, 0x04, 0xc5, 0x00, 0x00, 0x01, 0x01, /* H....... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (142 bytes) */ +static char pkt11[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0x3f, 0xfe, /* ...X:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0x6b, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* k.....`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, /* ...(,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x04, 0xc5, 0x80, 0x00, /* ........ */ +0x48, 0xd3, 0x04, 0xc5, 0x00, 0x00, 0x01, 0x01, /* H....... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt12[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, /* ...(,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x21, 0x00, 0x00, 0x04, 0xc5, 0x01, 0x01, /* .!...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x2c, 0xff, 0x3f, 0xfe, /* ... ,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x40, 0x00, 0x00, 0x04, 0xc5, 0x02, 0x02, /* .@...... */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (88 bytes) */ +static char pkt13_1[88] = { +0x80, 0x00, 0x48, 0xd3, 0x04, 0xc5, 0x00, 0x00, /* ..H..... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ........ */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt20[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x0d, 0xc3, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_01_049[] = { + {TITLE, "01-049", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, //step 10 + {CHECK, &pkt9[0], sizeof(pkt9), 65}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 10}, + {WAIT, NX_NULL, 0, 10}, //step 20 + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 10}, + {WAIT, NX_NULL, 0, 10}, + //{CHECK, &pkt24[0], sizeof(pkt24), 5}, + //{CHECK, &pkt25[0], sizeof(pkt25), 5}, + //{CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_049_size = sizeof(tahi_01_049) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_050.c b/test/regression/tahi_test/tahi_01_050.c new file mode 100644 index 00000000..e438cc24 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_050.c @@ -0,0 +1,411 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (102 bytes) */ +static char pkt1[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x5c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* B\@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt3[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt8[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, /* ...(,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x26, 0x80, 0x00, /* .....&.. */ +0x48, 0x72, 0x05, 0x26, 0x00, 0x00, 0x01, 0x01, /* Hr.&.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ..`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (142 bytes) */ +static char pkt11[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0x3f, 0xfe, /* ...X:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0x6b, 0x47, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* kG....`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, /* ...(,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x26, 0x80, 0x00, /* .....&.. */ +0x48, 0x72, 0x05, 0x26, 0x00, 0x00, 0x01, 0x01, /* Hr.&.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt18[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x0d, 0xc3, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + + +TAHI_TEST_SEQ tahi_01_050[] = { + {TITLE, "01-050", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, //step 10 + {CHECK, &pkt9[0], sizeof(pkt9), 65}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 10}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {CHECK, &pkt22[0], sizeof(pkt22), 10}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_050_size = sizeof(tahi_01_050) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_051.c b/test/regression/tahi_test/tahi_01_051.c new file mode 100644 index 00000000..4cbf3e40 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_051.c @@ -0,0 +1,412 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (102 bytes) */ +static char pkt1[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x5c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* B\@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt3[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt8[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x83, 0x80, 0x00, /* ........ */ +0xd7, 0x11, 0x05, 0x83, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (142 bytes) */ +static char pkt11[142] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0xfe, 0x80, /* ...X:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0xf9, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0xfe, 0x80, /* ...(,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x83, 0x80, 0x00, /* ........ */ +0xd7, 0x11, 0x05, 0x83, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt18[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x0d, 0xc3, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + + + +TAHI_TEST_SEQ tahi_01_051[] = { + {TITLE, "01-051", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, //step10 + {CHECK, &pkt9[0], sizeof(pkt9), 65}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 10}, + //{WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt22[0], sizeof(pkt22), 10}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_051_size = sizeof(tahi_01_051) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_052.c b/test/regression/tahi_test/tahi_01_052.c new file mode 100644 index 00000000..e24a7810 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_052.c @@ -0,0 +1,343 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (102 bytes) */ +static char pkt1[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x5c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, /* B\@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, /* @...'... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* '.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt3[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt7[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (94 bytes) */ +static char pkt8[94] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x28, 0x2c, 0xff, 0x3f, 0xfe, /* ...(,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x21, 0x00, 0x00, 0x04, 0xad, 0x01, 0x01, /* .!...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x3e, 0x08, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* >. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt14[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x89, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x03, 0x04, /* u5...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x0d, 0xc3, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* id...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* hd...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_01_052[] = { + {TITLE, "01-052", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NS, 0, 65}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 10}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 10}, + + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_052_size = sizeof(tahi_01_052) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_01_053.c b/test/regression/tahi_test/tahi_01_053.c new file mode 100644 index 00000000..7a456e96 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_053.c @@ -0,0 +1,181 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (75 bytes) */ +static char pkt1[75] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x15, 0x2c, 0xff, 0xfe, 0x80, /* ....,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x0e, 0x80, 0x00, /* ........ */ +0xe0, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x02, 0x03, 0x04 /* ... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (123 bytes) */ +static char pkt4[123] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x45, 0x3a, 0xff, 0xfe, 0x80, /* ...E:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x04, 0x00, /* ........ */ +0xfb, 0x4a, 0x00, 0x00, 0x00, 0x04, 0x60, 0x00, /* .J....`. */ +0x00, 0x00, 0x00, 0x15, 0x2c, 0xff, 0xfe, 0x80, /* ....,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x0e, 0x80, 0x00, /* ........ */ +0xe0, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x02, 0x03, 0x04 /* ... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt8[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_01_053[] = { + {TITLE, "01-053", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + + {CHECK, &pkt8[0], sizeof(pkt8), 10}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_053_size = sizeof(tahi_01_053) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_01_054.c b/test/regression/tahi_test/tahi_01_054.c new file mode 100644 index 00000000..7ab9be58 --- /dev/null +++ b/test/regression/tahi_test/tahi_01_054.c @@ -0,0 +1,177 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (78 bytes) */ +static char pkt1[78] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x2c, 0xff, 0xfe, 0x80, /* ....,... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x00, 0x00, 0x00, 0x05, 0x1a, 0x80, 0x00, /* ........ */ +0x07, 0xef, 0x05, 0x1a, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x06, 0xef, 0x05, 0x1a, 0x00, 0x00, 0x00, 0x01, /* ........ */ +0x02, 0x03, 0x04, 0x05, 0x06, 0x07 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xcd, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt8[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_01_054[] = { + {TITLE, "01-054", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + {WAIT, NX_NULL, 0, 10}, + //{CHECK, &pkt8[0], sizeof(pkt8), 5}, + //{CHECK, &pkt9[0], sizeof(pkt9), 5}, + //{CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_01_054_size = sizeof(tahi_01_054) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_001.c b/test/regression/tahi_test/tahi_02_001.c new file mode 100644 index 00000000..455abe9b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_001.c @@ -0,0 +1,88 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_001[] = { + {TITLE, "02-001", 6, 0}, + + {WAIT, NX_NULL, 0, 14}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_001_size = sizeof(tahi_02_001) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_002.c b/test/regression/tahi_test/tahi_02_002.c new file mode 100644 index 00000000..19d62e46 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_002.c @@ -0,0 +1,72 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_002[] = { + {TITLE, "02-002", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_002_size = sizeof(tahi_02_002) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_003.c b/test/regression/tahi_test/tahi_02_003.c new file mode 100644 index 00000000..4c088174 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_003.c @@ -0,0 +1,135 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_003[] = { + {TITLE, "02-003", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_003_size = sizeof(tahi_02_003) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_004.c b/test/regression/tahi_test/tahi_02_004.c new file mode 100644 index 00000000..c6b54801 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_004.c @@ -0,0 +1,132 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_004[] = { + {TITLE, "02-004", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_004_size = sizeof(tahi_02_004) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_005.c b/test/regression/tahi_test/tahi_02_005.c new file mode 100644 index 00000000..ddcfe0ea --- /dev/null +++ b/test/regression/tahi_test/tahi_02_005.c @@ -0,0 +1,200 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf0, 0x00, 0x00, 0x00, 0x03, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xef, 0x00, 0x00, 0x00, 0x04, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xee, 0x00, 0x00, 0x00, 0x05, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf0, 0x00, 0x00, 0x00, 0x03, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xef, 0x00, 0x00, 0x00, 0x04, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xee, 0x00, 0x00, 0x00, 0x05, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_005[] = { + {TITLE, "02-005", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_005_size = sizeof(tahi_02_005) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_006.c b/test/regression/tahi_test/tahi_02_006.c new file mode 100644 index 00000000..2b276e93 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_006.c @@ -0,0 +1,407 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf0, 0x00, 0x00, 0x00, 0x03, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x4e, 0x00, 0x00, 0x00, 0x04, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xef, 0x00, 0x00, 0x00, 0x04, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x4d, 0x00, 0x00, 0x00, 0x05, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xee, 0x00, 0x00, 0x00, 0x05, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x4c, 0x00, 0x00, 0x00, 0x06, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf0, 0x00, 0x00, 0x00, 0x03, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xef, 0x00, 0x00, 0x00, 0x04, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xee, 0x00, 0x00, 0x00, 0x05, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xce, 0xa4, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x4e, 0x00, 0x00, 0x00, 0x04, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x4d, 0x00, 0x00, 0x00, 0x05, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x4c, 0x00, 0x00, 0x00, 0x06, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt25[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x55, 0x9c, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt26[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt29[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt30[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_006[] = { + {TITLE, "02-006", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {CHECK, &pkt27[0], sizeof(pkt27), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_006_size = sizeof(tahi_02_006) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_007.c b/test/regression/tahi_test/tahi_02_007.c new file mode 100644 index 00000000..7084cfd2 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_007.c @@ -0,0 +1,210 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe5, 0x27, 0x40, 0x00, 0x00, 0x64, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x93, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe5, 0xa7, 0x40, 0x00, 0x00, 0x64, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0x40, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x93, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_007[] = { + {TITLE, "02-007", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 4}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 4}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_007_size = sizeof(tahi_02_007) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_008.c b/test/regression/tahi_test/tahi_02_008.c new file mode 100644 index 00000000..b7b68b37 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_008.c @@ -0,0 +1,279 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x6e, 0xca, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0xd2, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_008[] = { + {TITLE, "02-008", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {WAIT, NX_NULL, 0, 8}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_008_size = sizeof(tahi_02_008) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_009.c b/test/regression/tahi_test/tahi_02_009.c new file mode 100644 index 00000000..674e2872 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_009.c @@ -0,0 +1,297 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x6e, 0xca, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0xd2, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0xd2, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt15[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_009[] = { + {TITLE, "02-009", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {WAIT, NX_NULL, 0, 8}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {WAIT, NX_NULL, 0, 8}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_009_size = sizeof(tahi_02_009) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_010.c b/test/regression/tahi_test/tahi_02_010.c new file mode 100644 index 00000000..4bfa28ca --- /dev/null +++ b/test/regression/tahi_test/tahi_02_010.c @@ -0,0 +1,367 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb9, 0x3a, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x13, 0x88, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_010[] = { + {TITLE, "02-010", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 3}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {N_CHECK, (char *)NS, 0, 11}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 6}, + {CHECK, &pkt17[0], sizeof(pkt17), 6}, + {CHECK, &pkt18[0], sizeof(pkt18), 6}, + {N_CHECK, (char *)NS, 0, 6}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 6}, + {CHECK, &pkt22[0], sizeof(pkt22), 10}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 7}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_010_size = sizeof(tahi_02_010) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_011.c b/test/regression/tahi_test/tahi_02_011.c new file mode 100644 index 00000000..cbea5b09 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_011.c @@ -0,0 +1,367 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb9, 0x3a, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x13, 0x88, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_011[] = { + {TITLE, "02-011", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 3}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {N_CHECK, (char *)NS, 0, 11}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 6}, + {CHECK, &pkt17[0], sizeof(pkt17), 6}, + {CHECK, &pkt18[0], sizeof(pkt18), 6}, + {N_CHECK, (char *)NS, 0, 6}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 6}, + {CHECK, &pkt22[0], sizeof(pkt22), 10}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 7}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_011_size = sizeof(tahi_02_011) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_012.c b/test/regression/tahi_test/tahi_02_012.c new file mode 100644 index 00000000..305a74e9 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_012.c @@ -0,0 +1,469 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x4d, 0x33, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xa1, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x7d, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt13[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x4d, 0x33, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xa1, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x7d, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt14[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x4d, 0x34, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xa2, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x7d, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt15[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x4d, 0x34, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xa2, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x7d, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_012[] = { + {TITLE, "02-012", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {WAIT, NX_NULL, 0, 46}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {CHECK, &pkt18[0], sizeof(pkt18), 7}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {WAIT, NX_NULL, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_012_size = sizeof(tahi_02_012) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_013.c b/test/regression/tahi_test/tahi_02_013.c new file mode 100644 index 00000000..d915746d --- /dev/null +++ b/test/regression/tahi_test/tahi_02_013.c @@ -0,0 +1,336 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd7, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_013[] = { + {TITLE, "02-013", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {CHECK, &pkt14[0], sizeof(pkt14), 7}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_013_size = sizeof(tahi_02_013) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_014.c b/test/regression/tahi_test/tahi_02_014.c new file mode 100644 index 00000000..d508e252 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_014.c @@ -0,0 +1,336 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x66, 0x08, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x32, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x32, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_014[] = { + {TITLE, "02-014", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {WAIT, NX_NULL, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {CHECK, &pkt14[0], sizeof(pkt14), 7}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_014_size = sizeof(tahi_02_014) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_015.c b/test/regression/tahi_test/tahi_02_015.c new file mode 100644 index 00000000..11d49d8e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_015.c @@ -0,0 +1,336 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x63, 0xea, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x1e, 0x8a, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x32, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x32, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1a, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1a, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1a, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_015[] = { + {TITLE, "02-015", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {WAIT, NX_NULL, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {CHECK, &pkt14[0], sizeof(pkt14), 7}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_015_size = sizeof(tahi_02_015) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_016.c b/test/regression/tahi_test/tahi_02_016.c new file mode 100644 index 00000000..fa8d33ce --- /dev/null +++ b/test/regression/tahi_test/tahi_02_016.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x11, 0x04, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_02_016[] = { + {TITLE, "02-016", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_016_size = sizeof(tahi_02_016) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_017.c b/test/regression/tahi_test/tahi_02_017.c new file mode 100644 index 00000000..6d865413 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_017.c @@ -0,0 +1,31 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xac, 0x76, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_017[] = { + {TITLE, "02-017", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_017_size = sizeof(tahi_02_017) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_018.c b/test/regression/tahi_test/tahi_02_018.c new file mode 100644 index 00000000..e4cb4f20 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_018.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_02_018[] = { + {TITLE, "02-018", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_018_size = sizeof(tahi_02_018) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_019.c b/test/regression/tahi_test/tahi_02_019.c new file mode 100644 index 00000000..908b9769 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_019.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_02_019[] = { + {TITLE, "02-019", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_019_size = sizeof(tahi_02_019) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_020.c b/test/regression/tahi_test/tahi_02_020.c new file mode 100644 index 00000000..f3767d75 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_020.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_02_020[] = { + {TITLE, "02-020", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_020_size = sizeof(tahi_02_020) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_021.c b/test/regression/tahi_test/tahi_02_021.c new file mode 100644 index 00000000..a1a4f261 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_021.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x01, +0xa9, 0xeb, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_02_021[] = { + {TITLE, "02-021", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_021_size = sizeof(tahi_02_021) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_022.c b/test/regression/tahi_test/tahi_02_022.c new file mode 100644 index 00000000..901a4628 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_022.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_02_022[] = { + {TITLE, "02-022", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_022_size = sizeof(tahi_02_022) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_023.c b/test/regression/tahi_test/tahi_02_023.c new file mode 100644 index 00000000..4c8caf37 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_023.c @@ -0,0 +1,33 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x41, 0x4a, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_023[] = { + {TITLE, "02-023", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {N_CHECK, (char *)NA, 0, 2}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_023_size = sizeof(tahi_02_023) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_024.c b/test/regression/tahi_test/tahi_02_024.c new file mode 100644 index 00000000..07f5ab21 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_024.c @@ -0,0 +1,113 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_024[] = { + {TITLE, "02-024", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_024_size = sizeof(tahi_02_024) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_025.c b/test/regression/tahi_test/tahi_02_025.c new file mode 100644 index 00000000..acb23dc4 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_025.c @@ -0,0 +1,113 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_025[] = { + {TITLE, "02-025", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_025_size = sizeof(tahi_02_025) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_026.c b/test/regression/tahi_test/tahi_02_026.c new file mode 100644 index 00000000..05f88652 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_026.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xab, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_026[] = { + {TITLE, "02-026", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_026_size = sizeof(tahi_02_026) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_027.c b/test/regression/tahi_test/tahi_02_027.c new file mode 100644 index 00000000..c7061f73 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_027.c @@ -0,0 +1,150 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_027[] = { + {TITLE, "02-027", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_027_size = sizeof(tahi_02_027) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_028.c b/test/regression/tahi_test/tahi_02_028.c new file mode 100644 index 00000000..8a83ac9c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_028.c @@ -0,0 +1,150 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_028[] = { + {TITLE, "02-028", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_028_size = sizeof(tahi_02_028) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_029.c b/test/regression/tahi_test/tahi_02_029.c new file mode 100644 index 00000000..d7607b89 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_029.c @@ -0,0 +1,86 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xab, 0xf5, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_029[] = { + {TITLE, "02-029", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_029_size = sizeof(tahi_02_029) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_030.c b/test/regression/tahi_test/tahi_02_030.c new file mode 100644 index 00000000..05625599 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_030.c @@ -0,0 +1,229 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_030[] = { + {TITLE, "02-030", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 8}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {N_CHECK, (char *)NS, 0, 8}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_030_size = sizeof(tahi_02_030) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_031.c b/test/regression/tahi_test/tahi_02_031.c new file mode 100644 index 00000000..d767cedd --- /dev/null +++ b/test/regression/tahi_test/tahi_02_031.c @@ -0,0 +1,190 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x0a, 0x4c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_031[] = { + {TITLE, "02-031", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_031_size = sizeof(tahi_02_031) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_032.c b/test/regression/tahi_test/tahi_02_032.c new file mode 100644 index 00000000..13ac62ab --- /dev/null +++ b/test/regression/tahi_test/tahi_02_032.c @@ -0,0 +1,229 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_032[] = { + {TITLE, "02-032", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 8}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {N_CHECK, (char *)NS, 0, 8}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_032_size = sizeof(tahi_02_032) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_033.c b/test/regression/tahi_test/tahi_02_033.c new file mode 100644 index 00000000..75438502 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_033.c @@ -0,0 +1,190 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x2d, 0xd9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_033[] = { + {TITLE, "02-033", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_033_size = sizeof(tahi_02_033) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_034.c b/test/regression/tahi_test/tahi_02_034.c new file mode 100644 index 00000000..26019430 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_034.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_034[] = { + {TITLE, "02-034", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_034_size = sizeof(tahi_02_034) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_035.c b/test/regression/tahi_test/tahi_02_035.c new file mode 100644 index 00000000..72b914d7 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_035.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x0a, 0x4c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_035[] = { + {TITLE, "02-035", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_035_size = sizeof(tahi_02_035) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_036.c b/test/regression/tahi_test/tahi_02_036.c new file mode 100644 index 00000000..cfbc81fb --- /dev/null +++ b/test/regression/tahi_test/tahi_02_036.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_036[] = { + {TITLE, "02-036", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_036_size = sizeof(tahi_02_036) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_037.c b/test/regression/tahi_test/tahi_02_037.c new file mode 100644 index 00000000..69efb4f6 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_037.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x2d, 0xd9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_037[] = { + {TITLE, "02-037", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 46}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {CHECK, &pkt11[0], sizeof(pkt11), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_037_size = sizeof(tahi_02_037) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_038.c b/test/regression/tahi_test/tahi_02_038.c new file mode 100644 index 00000000..6469747c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_038.c @@ -0,0 +1,166 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_038[] = { + {TITLE, "02-038", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_038_size = sizeof(tahi_02_038) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_039.c b/test/regression/tahi_test/tahi_02_039.c new file mode 100644 index 00000000..0b253f33 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_039.c @@ -0,0 +1,150 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x0a, 0x4c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_039[] = { + {TITLE, "02-039", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_039_size = sizeof(tahi_02_039) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_040.c b/test/regression/tahi_test/tahi_02_040.c new file mode 100644 index 00000000..836d8ddc --- /dev/null +++ b/test/regression/tahi_test/tahi_02_040.c @@ -0,0 +1,165 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_040[] = { + {TITLE, "02-040", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_040_size = sizeof(tahi_02_040) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_041.c b/test/regression/tahi_test/tahi_02_041.c new file mode 100644 index 00000000..a6ee376d --- /dev/null +++ b/test/regression/tahi_test/tahi_02_041.c @@ -0,0 +1,178 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x2d, 0xd9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_041[] = { + {TITLE, "02-041", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_041_size = sizeof(tahi_02_041) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_042.c b/test/regression/tahi_test/tahi_02_042.c new file mode 100644 index 00000000..ec4a8eb8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_042.c @@ -0,0 +1,266 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x0c, 0x55, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x88, 0x00, +0x42, 0xb1, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x49, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x81, 0x00, +0x48, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_042[] = { + {TITLE, "02-042", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 9}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_042_size = sizeof(tahi_02_042) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_043.c b/test/regression/tahi_test/tahi_02_043.c new file mode 100644 index 00000000..a5b8b58c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_043.c @@ -0,0 +1,267 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x88, 0x00, +0x42, 0xb1, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x49, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x81, 0x00, +0x48, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_043[] = { + {TITLE, "02-043", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 9}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_043_size = sizeof(tahi_02_043) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_044.c b/test/regression/tahi_test/tahi_02_044.c new file mode 100644 index 00000000..754ac287 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_044.c @@ -0,0 +1,227 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xc8, 0xda, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x69, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0x68, 0x64, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x6e, 0x18, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x88, 0x00, +0x42, 0xb1, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x49, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x81, 0x00, +0x48, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_044[] = { + {TITLE, "02-044", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 9}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_044_size = sizeof(tahi_02_044) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_045.c b/test/regression/tahi_test/tahi_02_045.c new file mode 100644 index 00000000..e7bbc3f8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_045.c @@ -0,0 +1,87 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x14, 0x9e, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_045[] = { + {TITLE, "02-045", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_045_size = sizeof(tahi_02_045) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_046.c b/test/regression/tahi_test/tahi_02_046.c new file mode 100644 index 00000000..0e816538 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_046.c @@ -0,0 +1,87 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_046[] = { + {TITLE, "02-046", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_046_size = sizeof(tahi_02_046) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_047.c b/test/regression/tahi_test/tahi_02_047.c new file mode 100644 index 00000000..4b02a739 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_047.c @@ -0,0 +1,87 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_047[] = { + {TITLE, "02-047", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_047_size = sizeof(tahi_02_047) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_048.c b/test/regression/tahi_test/tahi_02_048.c new file mode 100644 index 00000000..7797857d --- /dev/null +++ b/test/regression/tahi_test/tahi_02_048.c @@ -0,0 +1,87 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x01, +0x14, 0x9d, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_048[] = { + {TITLE, "02-048", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_048_size = sizeof(tahi_02_048) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_049.c b/test/regression/tahi_test/tahi_02_049.c new file mode 100644 index 00000000..4f5a0f2c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_049.c @@ -0,0 +1,87 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_049[] = { + {TITLE, "02-049", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_049_size = sizeof(tahi_02_049) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_050.c b/test/regression/tahi_test/tahi_02_050.c new file mode 100644 index 00000000..6f91f08a --- /dev/null +++ b/test/regression/tahi_test/tahi_02_050.c @@ -0,0 +1,87 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x56, 0x1a, 0x20, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_050[] = { + {TITLE, "02-050", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_050_size = sizeof(tahi_02_050) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_051.c b/test/regression/tahi_test/tahi_02_051.c new file mode 100644 index 00000000..a55ed8aa --- /dev/null +++ b/test/regression/tahi_test/tahi_02_051.c @@ -0,0 +1,88 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x52, 0x96, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_051[] = { + {TITLE, "02-051", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_051_size = sizeof(tahi_02_051) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_052.c b/test/regression/tahi_test/tahi_02_052.c new file mode 100644 index 00000000..b3312a8e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_052.c @@ -0,0 +1,86 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0x87, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_052[] = { + {TITLE, "02-052", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_052_size = sizeof(tahi_02_052) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_053.c b/test/regression/tahi_test/tahi_02_053.c new file mode 100644 index 00000000..ad1dadf3 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_053.c @@ -0,0 +1,86 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xed, 0x86, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_053[] = { + {TITLE, "02-053", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_053_size = sizeof(tahi_02_053) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_054.c b/test/regression/tahi_test/tahi_02_054.c new file mode 100644 index 00000000..8faf01f1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_054.c @@ -0,0 +1,86 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xcd, 0x86, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_054[] = { + {TITLE, "02-054", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_054_size = sizeof(tahi_02_054) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_055.c b/test/regression/tahi_test/tahi_02_055.c new file mode 100644 index 00000000..95beeee0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_055.c @@ -0,0 +1,86 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_055[] = { + {TITLE, "02-055", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_055_size = sizeof(tahi_02_055) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_056.c b/test/regression/tahi_test/tahi_02_056.c new file mode 100644 index 00000000..4055f4be --- /dev/null +++ b/test/regression/tahi_test/tahi_02_056.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x10, 0x90, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_056[] = { + {TITLE, "02-056", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_056_size = sizeof(tahi_02_056) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_057.c b/test/regression/tahi_test/tahi_02_057.c new file mode 100644 index 00000000..5082f934 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_057.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xf0, 0x8f, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_057[] = { + {TITLE, "02-057", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_057_size = sizeof(tahi_02_057) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_058.c b/test/regression/tahi_test/tahi_02_058.c new file mode 100644 index 00000000..4d983186 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_058.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd0, 0x8f, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_058[] = { + {TITLE, "02-058", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_058_size = sizeof(tahi_02_058) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_059.c b/test/regression/tahi_test/tahi_02_059.c new file mode 100644 index 00000000..0b8b7488 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_059.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xb0, 0x8f, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_059[] = { + {TITLE, "02-059", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_059_size = sizeof(tahi_02_059) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_060.c b/test/regression/tahi_test/tahi_02_060.c new file mode 100644 index 00000000..96bb47d1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_060.c @@ -0,0 +1,175 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_060[] = { + {TITLE, "02-060", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 8}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_060_size = sizeof(tahi_02_060) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_061.c b/test/regression/tahi_test/tahi_02_061.c new file mode 100644 index 00000000..5b1c18f0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_061.c @@ -0,0 +1,175 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xcd, 0x86, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_061[] = { + {TITLE, "02-061", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {N_CHECK, (char *)NS, 0, 8}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_061_size = sizeof(tahi_02_061) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_062.c b/test/regression/tahi_test/tahi_02_062.c new file mode 100644 index 00000000..ecab9479 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_062.c @@ -0,0 +1,112 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xed, 0x86, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_062[] = { + {TITLE, "02-062", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_062_size = sizeof(tahi_02_062) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_063.c b/test/regression/tahi_test/tahi_02_063.c new file mode 100644 index 00000000..54f729f5 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_063.c @@ -0,0 +1,112 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0x87, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_063[] = { + {TITLE, "02-063", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_063_size = sizeof(tahi_02_063) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_064.c b/test/regression/tahi_test/tahi_02_064.c new file mode 100644 index 00000000..29b38eb2 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_064.c @@ -0,0 +1,86 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xb0, 0x8f, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_064[] = { + {TITLE, "02-064", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_064_size = sizeof(tahi_02_064) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_065.c b/test/regression/tahi_test/tahi_02_065.c new file mode 100644 index 00000000..60409dcb --- /dev/null +++ b/test/regression/tahi_test/tahi_02_065.c @@ -0,0 +1,188 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x10, 0x90, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_065[] = { + {TITLE, "02-065", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_065_size = sizeof(tahi_02_065) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_066.c b/test/regression/tahi_test/tahi_02_066.c new file mode 100644 index 00000000..2e80de7b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_066.c @@ -0,0 +1,188 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xf0, 0x8f, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_066[] = { + {TITLE, "02-066", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_066_size = sizeof(tahi_02_066) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_067.c b/test/regression/tahi_test/tahi_02_067.c new file mode 100644 index 00000000..f37ba4b9 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_067.c @@ -0,0 +1,188 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd0, 0x8f, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_067[] = { + {TITLE, "02-067", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_067_size = sizeof(tahi_02_067) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_068.c b/test/regression/tahi_test/tahi_02_068.c new file mode 100644 index 00000000..b9771624 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_068.c @@ -0,0 +1,188 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xb0, 0x8f, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_068[] = { + {TITLE, "02-068", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_068_size = sizeof(tahi_02_068) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_069.c b/test/regression/tahi_test/tahi_02_069.c new file mode 100644 index 00000000..92900a55 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_069.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0x87, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_069[] = { + {TITLE, "02-069", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_069_size = sizeof(tahi_02_069) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_070.c b/test/regression/tahi_test/tahi_02_070.c new file mode 100644 index 00000000..f6e8a784 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_070.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xed, 0x86, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_070[] = { + {TITLE, "02-070", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_070_size = sizeof(tahi_02_070) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_071.c b/test/regression/tahi_test/tahi_02_071.c new file mode 100644 index 00000000..a60b6547 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_071.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xcd, 0x86, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_071[] = { + {TITLE, "02-071", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_071_size = sizeof(tahi_02_071) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_072.c b/test/regression/tahi_test/tahi_02_072.c new file mode 100644 index 00000000..65cd7522 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_072.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_072[] = { + {TITLE, "02-072", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_072_size = sizeof(tahi_02_072) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_073.c b/test/regression/tahi_test/tahi_02_073.c new file mode 100644 index 00000000..c3e445e1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_073.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x6d, 0xe6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_073[] = { + {TITLE, "02-073", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_073_size = sizeof(tahi_02_073) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_074.c b/test/regression/tahi_test/tahi_02_074.c new file mode 100644 index 00000000..0fa35dd6 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_074.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4d, 0xe6, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_074[] = { + {TITLE, "02-074", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_074_size = sizeof(tahi_02_074) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_075.c b/test/regression/tahi_test/tahi_02_075.c new file mode 100644 index 00000000..d4b982fa --- /dev/null +++ b/test/regression/tahi_test/tahi_02_075.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0xe6, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_075[] = { + {TITLE, "02-075", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_075_size = sizeof(tahi_02_075) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_076.c b/test/regression/tahi_test/tahi_02_076.c new file mode 100644 index 00000000..1d16ff81 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_076.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0xe6, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_076[] = { + {TITLE, "02-076", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_076_size = sizeof(tahi_02_076) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_077.c b/test/regression/tahi_test/tahi_02_077.c new file mode 100644 index 00000000..0df99217 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_077.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x74, 0x9e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_077[] = { + {TITLE, "02-077", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_077_size = sizeof(tahi_02_077) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_078.c b/test/regression/tahi_test/tahi_02_078.c new file mode 100644 index 00000000..3a3a198f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_078.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_078[] = { + {TITLE, "02-078", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_078_size = sizeof(tahi_02_078) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_079.c b/test/regression/tahi_test/tahi_02_079.c new file mode 100644 index 00000000..0b9ce50a --- /dev/null +++ b/test/regression/tahi_test/tahi_02_079.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd4, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_079[] = { + {TITLE, "02-079", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_079_size = sizeof(tahi_02_079) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_080.c b/test/regression/tahi_test/tahi_02_080.c new file mode 100644 index 00000000..74d47ab8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_080.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xb4, 0xfd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_080[] = { + {TITLE, "02-080", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_080_size = sizeof(tahi_02_080) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_081.c b/test/regression/tahi_test/tahi_02_081.c new file mode 100644 index 00000000..110eb005 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_081.c @@ -0,0 +1,188 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x77, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_081[] = { + {TITLE, "02-081", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_081_size = sizeof(tahi_02_081) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_082.c b/test/regression/tahi_test/tahi_02_082.c new file mode 100644 index 00000000..1268bb54 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_082.c @@ -0,0 +1,188 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x57, 0xa7, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_082[] = { + {TITLE, "02-082", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_082_size = sizeof(tahi_02_082) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_083.c b/test/regression/tahi_test/tahi_02_083.c new file mode 100644 index 00000000..b976b199 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_083.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x10, 0x90, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_083[] = { + {TITLE, "02-083", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_083_size = sizeof(tahi_02_083) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_084.c b/test/regression/tahi_test/tahi_02_084.c new file mode 100644 index 00000000..18cf42fc --- /dev/null +++ b/test/regression/tahi_test/tahi_02_084.c @@ -0,0 +1,123 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xf0, 0x8f, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_084[] = { + {TITLE, "02-084", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_084_size = sizeof(tahi_02_084) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_085.c b/test/regression/tahi_test/tahi_02_085.c new file mode 100644 index 00000000..7adc3ea8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_085.c @@ -0,0 +1,190 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd0, 0x8f, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_085[] = { + {TITLE, "02-085", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_085_size = sizeof(tahi_02_085) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_086.c b/test/regression/tahi_test/tahi_02_086.c new file mode 100644 index 00000000..eff14812 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_086.c @@ -0,0 +1,190 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xb0, 0x8f, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_086[] = { + {TITLE, "02-086", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_086_size = sizeof(tahi_02_086) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_087.c b/test/regression/tahi_test/tahi_02_087.c new file mode 100644 index 00000000..405f1fda --- /dev/null +++ b/test/regression/tahi_test/tahi_02_087.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0x87, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_087[] = { + {TITLE, "02-087", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_087_size = sizeof(tahi_02_087) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_088.c b/test/regression/tahi_test/tahi_02_088.c new file mode 100644 index 00000000..aca75c81 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_088.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xed, 0x86, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_088[] = { + {TITLE, "02-088", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_088_size = sizeof(tahi_02_088) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_089.c b/test/regression/tahi_test/tahi_02_089.c new file mode 100644 index 00000000..183e5714 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_089.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xcd, 0x86, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_089[] = { + {TITLE, "02-089", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_089_size = sizeof(tahi_02_089) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_090.c b/test/regression/tahi_test/tahi_02_090.c new file mode 100644 index 00000000..b7a6d354 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_090.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_090[] = { + {TITLE, "02-090", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_090_size = sizeof(tahi_02_090) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_091.c b/test/regression/tahi_test/tahi_02_091.c new file mode 100644 index 00000000..43ef5af6 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_091.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x6d, 0xe6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_091[] = { + {TITLE, "02-091", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_091_size = sizeof(tahi_02_091) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_092.c b/test/regression/tahi_test/tahi_02_092.c new file mode 100644 index 00000000..2a940086 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_092.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4d, 0xe6, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_092[] = { + {TITLE, "02-092", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_092_size = sizeof(tahi_02_092) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_093.c b/test/regression/tahi_test/tahi_02_093.c new file mode 100644 index 00000000..cc80cbe3 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_093.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0xe6, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_093[] = { + {TITLE, "02-093", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_093_size = sizeof(tahi_02_093) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_094.c b/test/regression/tahi_test/tahi_02_094.c new file mode 100644 index 00000000..b04de34b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_094.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0xe6, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_094[] = { + {TITLE, "02-094", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_094_size = sizeof(tahi_02_094) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_095.c b/test/regression/tahi_test/tahi_02_095.c new file mode 100644 index 00000000..fbaea35c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_095.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x74, 0x9e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_095[] = { + {TITLE, "02-095", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_095_size = sizeof(tahi_02_095) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_096.c b/test/regression/tahi_test/tahi_02_096.c new file mode 100644 index 00000000..369bc08f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_096.c @@ -0,0 +1,286 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt5[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x55, 0xcc, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb1, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x83, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt6[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x55, 0xcc, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb1, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x83, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt7[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x55, 0xcd, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb2, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x83, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt8[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x55, 0xcd, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb2, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x83, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_096[] = { + {TITLE, "02-096", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {CHECK, &pkt12[0], sizeof(pkt12), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_096_size = sizeof(tahi_02_096) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_097.c b/test/regression/tahi_test/tahi_02_097.c new file mode 100644 index 00000000..14d89ea6 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_097.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd4, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_097[] = { + {TITLE, "02-097", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_097_size = sizeof(tahi_02_097) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_098.c b/test/regression/tahi_test/tahi_02_098.c new file mode 100644 index 00000000..4199e7cf --- /dev/null +++ b/test/regression/tahi_test/tahi_02_098.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xb4, 0xfd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_098[] = { + {TITLE, "02-098", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_098_size = sizeof(tahi_02_098) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_099.c b/test/regression/tahi_test/tahi_02_099.c new file mode 100644 index 00000000..dc5c6d99 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_099.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x77, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_099[] = { + {TITLE, "02-099", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_099_size = sizeof(tahi_02_099) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_100.c b/test/regression/tahi_test/tahi_02_100.c new file mode 100644 index 00000000..3db80a24 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_100.c @@ -0,0 +1,151 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x57, 0xa7, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_100[] = { + {TITLE, "02-100", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {N_CHECK, (char *)NS, 0, 46}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_100_size = sizeof(tahi_02_100) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_101.c b/test/regression/tahi_test/tahi_02_101.c new file mode 100644 index 00000000..dcb1cfd3 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_101.c @@ -0,0 +1,127 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x10, 0x90, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_101[] = { + {TITLE, "02-101", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_101_size = sizeof(tahi_02_101) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_102.c b/test/regression/tahi_test/tahi_02_102.c new file mode 100644 index 00000000..27d70a14 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_102.c @@ -0,0 +1,127 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xf0, 0x8f, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_102[] = { + {TITLE, "02-102", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_102_size = sizeof(tahi_02_102) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_103.c b/test/regression/tahi_test/tahi_02_103.c new file mode 100644 index 00000000..469aea81 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_103.c @@ -0,0 +1,203 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd0, 0x8f, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_103[] = { + {TITLE, "02-103", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_103_size = sizeof(tahi_02_103) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_104.c b/test/regression/tahi_test/tahi_02_104.c new file mode 100644 index 00000000..12329b10 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_104.c @@ -0,0 +1,203 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xb0, 0x8f, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_104[] = { + {TITLE, "02-104", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_104_size = sizeof(tahi_02_104) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_105.c b/test/regression/tahi_test/tahi_02_105.c new file mode 100644 index 00000000..b0ee823e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_105.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0x87, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_105[] = { + {TITLE, "02-105", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_105_size = sizeof(tahi_02_105) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_106.c b/test/regression/tahi_test/tahi_02_106.c new file mode 100644 index 00000000..ffc44535 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_106.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xed, 0x86, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_106[] = { + {TITLE, "02-106", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_106_size = sizeof(tahi_02_106) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_107.c b/test/regression/tahi_test/tahi_02_107.c new file mode 100644 index 00000000..10813f94 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_107.c @@ -0,0 +1,204 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xcd, 0x86, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_107[] = { + {TITLE, "02-107", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_107_size = sizeof(tahi_02_107) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_108.c b/test/regression/tahi_test/tahi_02_108.c new file mode 100644 index 00000000..6cb88e72 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_108.c @@ -0,0 +1,204 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_108[] = { + {TITLE, "02-108", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_108_size = sizeof(tahi_02_108) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_109.c b/test/regression/tahi_test/tahi_02_109.c new file mode 100644 index 00000000..cfb53762 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_109.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x6d, 0xe6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_109[] = { + {TITLE, "02-109", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_109_size = sizeof(tahi_02_109) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_110.c b/test/regression/tahi_test/tahi_02_110.c new file mode 100644 index 00000000..3f321e3e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_110.c @@ -0,0 +1,165 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4d, 0xe6, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_110[] = { + {TITLE, "02-110", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {CHECK, &pkt9[0], sizeof(pkt9), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_110_size = sizeof(tahi_02_110) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_111.c b/test/regression/tahi_test/tahi_02_111.c new file mode 100644 index 00000000..b367fdf1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_111.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0xe6, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_111[] = { + {TITLE, "02-111", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_111_size = sizeof(tahi_02_111) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_112.c b/test/regression/tahi_test/tahi_02_112.c new file mode 100644 index 00000000..372fdc88 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_112.c @@ -0,0 +1,204 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0d, 0xe6, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xdd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_112[] = { + {TITLE, "02-112", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {N_CHECK, (char *)NS, 0, 9}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_112_size = sizeof(tahi_02_112) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_113.c b/test/regression/tahi_test/tahi_02_113.c new file mode 100644 index 00000000..7ed1f2fa --- /dev/null +++ b/test/regression/tahi_test/tahi_02_113.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x74, 0x9e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_113[] = { + {TITLE, "02-113", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_113_size = sizeof(tahi_02_113) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_114.c b/test/regression/tahi_test/tahi_02_114.c new file mode 100644 index 00000000..fe29f3a2 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_114.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_114[] = { + {TITLE, "02-114", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_114_size = sizeof(tahi_02_114) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_115.c b/test/regression/tahi_test/tahi_02_115.c new file mode 100644 index 00000000..1a4a8bc6 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_115.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd4, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_115[] = { + {TITLE, "02-115", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_115_size = sizeof(tahi_02_115) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_116.c b/test/regression/tahi_test/tahi_02_116.c new file mode 100644 index 00000000..610e4775 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_116.c @@ -0,0 +1,165 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xb4, 0xfd, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_116[] = { + {TITLE, "02-116", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {CHECK, &pkt9[0], sizeof(pkt9), 7}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_116_size = sizeof(tahi_02_116) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_117.c b/test/regression/tahi_test/tahi_02_117.c new file mode 100644 index 00000000..cd9693b9 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_117.c @@ -0,0 +1,127 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x77, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_117[] = { + {TITLE, "02-117", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_117_size = sizeof(tahi_02_117) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_118.c b/test/regression/tahi_test/tahi_02_118.c new file mode 100644 index 00000000..82c99398 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_118.c @@ -0,0 +1,127 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x57, 0xa7, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_118[] = { + {TITLE, "02-118", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_118_size = sizeof(tahi_02_118) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_119.c b/test/regression/tahi_test/tahi_02_119.c new file mode 100644 index 00000000..a2039b56 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_119.c @@ -0,0 +1,282 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x71, 0x4e, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_119[] = { + {TITLE, "02-119", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_119_size = sizeof(tahi_02_119) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_120.c b/test/regression/tahi_test/tahi_02_120.c new file mode 100644 index 00000000..f952178b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_120.c @@ -0,0 +1,282 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd1, 0x4e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_120[] = { + {TITLE, "02-120", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_120_size = sizeof(tahi_02_120) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_121.c b/test/regression/tahi_test/tahi_02_121.c new file mode 100644 index 00000000..d6f2963f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_121.c @@ -0,0 +1,282 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xb1, 0x4e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_121[] = { + {TITLE, "02-121", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_121_size = sizeof(tahi_02_121) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_122.c b/test/regression/tahi_test/tahi_02_122.c new file mode 100644 index 00000000..eb749479 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_122.c @@ -0,0 +1,282 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x91, 0x4e, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_122[] = { + {TITLE, "02-122", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_122_size = sizeof(tahi_02_122) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_123.c b/test/regression/tahi_test/tahi_02_123.c new file mode 100644 index 00000000..ce39734f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_123.c @@ -0,0 +1,417 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xce, 0xa4, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt20[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x57, 0x1e, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb6, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x85, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt21[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x57, 0x1e, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb6, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x85, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt22[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x57, 0x1f, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb7, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x85, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt23[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x57, 0x1f, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xb7, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x85, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +TAHI_TEST_SEQ tahi_02_123[] = { + {TITLE, "02-123", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_123_size = sizeof(tahi_02_123) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_124.c b/test/regression/tahi_test/tahi_02_124.c new file mode 100644 index 00000000..19cf6258 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_124.c @@ -0,0 +1,283 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2e, 0xa5, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_124[] = { + {TITLE, "02-124", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_124_size = sizeof(tahi_02_124) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_125.c b/test/regression/tahi_test/tahi_02_125.c new file mode 100644 index 00000000..8917daaa --- /dev/null +++ b/test/regression/tahi_test/tahi_02_125.c @@ -0,0 +1,283 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x0e, 0xa5, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_125[] = { + {TITLE, "02-125", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_125_size = sizeof(tahi_02_125) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_126.c b/test/regression/tahi_test/tahi_02_126.c new file mode 100644 index 00000000..cfc25ded --- /dev/null +++ b/test/regression/tahi_test/tahi_02_126.c @@ -0,0 +1,283 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xbe, 0x5d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, +0x86, 0xa0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xea, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xee, 0xa4, 0x40, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xeb, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xd5, 0x9b, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_126[] = { + {TITLE, "02-126", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {N_CHECK, (char *)NS, 0, 2}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 10}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_126_size = sizeof(tahi_02_126) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_127.c b/test/regression/tahi_test/tahi_02_127.c new file mode 100644 index 00000000..c7e14f9a --- /dev/null +++ b/test/regression/tahi_test/tahi_02_127.c @@ -0,0 +1,88 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_127[] = { + {TITLE, "02-127", 6, 0}, + + {WAIT, NX_NULL, 0, 14}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_127_size = sizeof(tahi_02_127) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_128.c b/test/regression/tahi_test/tahi_02_128.c new file mode 100644 index 00000000..60c38340 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_128.c @@ -0,0 +1,91 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_128[] = { + {TITLE, "02-128", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 8}, + {CHECK, &pkt2[0], sizeof(pkt2), 8}, + {CHECK, &pkt3[0], sizeof(pkt3), 8}, + {CHECK, &pkt4[0], sizeof(pkt4), 8}, + {CHECK, &pkt5[0], sizeof(pkt5), 8}, + {CHECK, &pkt6[0], sizeof(pkt6), 8}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_128_size = sizeof(tahi_02_128) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_129.c b/test/regression/tahi_test/tahi_02_129.c new file mode 100644 index 00000000..69a4dba2 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_129.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_129[] = { + {TITLE, "02-129", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {CHECK, &pkt4[0], sizeof(pkt4), 300}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)RS, 0, 5}, + {WAIT, NX_NULL , 0, 3}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_129_size = sizeof(tahi_02_129) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_130.c b/test/regression/tahi_test/tahi_02_130.c new file mode 100644 index 00000000..3e13c193 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_130.c @@ -0,0 +1,210 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa0, 0x49, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_130[] = { + {TITLE, "02-130", 6, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 300}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)RS, 0, 5}, + {WAIT , NX_NULL, 0, 3}, + {DUMP,NX_NULL,0,0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT , NX_NULL, 0, 11}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_130_size = sizeof(tahi_02_130) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_131.c b/test/regression/tahi_test/tahi_02_131.c new file mode 100644 index 00000000..08496773 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_131.c @@ -0,0 +1,96 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x58, 0xcb, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_131[] = { + {TITLE, "02-131", 6, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 300}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_131_size = sizeof(tahi_02_131) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_132.c b/test/regression/tahi_test/tahi_02_132.c new file mode 100644 index 00000000..88320c1f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_132.c @@ -0,0 +1,96 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0x02, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa0, 0x49, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_132[] = { + {TITLE, "02-132", 6, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 300}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_132_size = sizeof(tahi_02_132) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_133.c b/test/regression/tahi_test/tahi_02_133.c new file mode 100644 index 00000000..81fd50f8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_133.c @@ -0,0 +1,96 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x00, 0x00, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_133[] = { + {TITLE, "02-133", 6, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 300}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_133_size = sizeof(tahi_02_133) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_134.c b/test/regression/tahi_test/tahi_02_134.c new file mode 100644 index 00000000..e9dffd34 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_134.c @@ -0,0 +1,96 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x01, +0xa0, 0x48, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_02_134[] = { + {TITLE, "02-134", 6, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 300}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 3}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_134_size = sizeof(tahi_02_134) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_135.c b/test/regression/tahi_test/tahi_02_135.c new file mode 100644 index 00000000..46c01220 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_135.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0x79, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_135[] = { + {TITLE, "02-135", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RS */ + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_135_size = sizeof(tahi_02_135) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_136.c b/test/regression/tahi_test/tahi_02_136.c new file mode 100644 index 00000000..40a45fd3 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_136.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x85, 0x00, +0x79, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_136[] = { + {TITLE, "02-136", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_136_size = sizeof(tahi_02_136) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_137.c b/test/regression/tahi_test/tahi_02_137.c new file mode 100644 index 00000000..31c242d8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_137.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x85, 0x00, +0x12, 0x18, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_137[] = { + {TITLE, "02-137", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_137_size = sizeof(tahi_02_137) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_138.c b/test/regression/tahi_test/tahi_02_138.c new file mode 100644 index 00000000..372a0430 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_138.c @@ -0,0 +1,414 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x1d, 0xd6, 0x40, 0x00, 0x00, 0x2d, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x24, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x07, 0x26, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x1c, 0xd5, 0x40, 0x00, 0x00, 0x2d, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x23, 0x2d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x22, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x22, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x22, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x96, 0x92, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_138[] = { + {TITLE, "02-138", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {N_CHECK, (char *)NS, 0, 3}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {CHECK, &pkt21[0], sizeof(pkt21), 3}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_138_size = sizeof(tahi_02_138) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_139.c b/test/regression/tahi_test/tahi_02_139.c new file mode 100644 index 00000000..f5e09399 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_139.c @@ -0,0 +1,91 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x34, 0x0e, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + + +TAHI_TEST_SEQ tahi_02_139[] = { + {TITLE, "02-139", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_139_size = sizeof(tahi_02_139) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_140.c b/test/regression/tahi_test/tahi_02_140.c new file mode 100644 index 00000000..bd190c5b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_140.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0x02, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x7b, 0x8c, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + + +TAHI_TEST_SEQ tahi_02_140[] = { + {TITLE, "02-140", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_140_size = sizeof(tahi_02_140) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_141.c b/test/regression/tahi_test/tahi_02_141.c new file mode 100644 index 00000000..1b0d15fa --- /dev/null +++ b/test/regression/tahi_test/tahi_02_141.c @@ -0,0 +1,93 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x00, 0x00, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + + +TAHI_TEST_SEQ tahi_02_141[] = { + {TITLE, "02-141", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_141_size = sizeof(tahi_02_141) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_142.c b/test/regression/tahi_test/tahi_02_142.c new file mode 100644 index 00000000..f8f4d142 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_142.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x01, +0x7b, 0x8b, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + + +TAHI_TEST_SEQ tahi_02_142[] = { + {TITLE, "02-142", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_142_size = sizeof(tahi_02_142) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_143.c b/test/regression/tahi_test/tahi_02_143.c new file mode 100644 index 00000000..71370553 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_143.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x7b, 0x8c, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + + +TAHI_TEST_SEQ tahi_02_143[] = { + {TITLE, "02-143", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_143_size = sizeof(tahi_02_143) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_144.c b/test/regression/tahi_test/tahi_02_144.c new file mode 100644 index 00000000..507a4286 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_144.c @@ -0,0 +1,93 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xac, 0x4d, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, +0x01, 0x23, 0x45, 0x67, 0x89, 0xab }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + + +TAHI_TEST_SEQ tahi_02_144[] = { + {TITLE, "02-144", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {WAIT, NX_NULL, 0, 4}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_144_size = sizeof(tahi_02_144) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_145.c b/test/regression/tahi_test/tahi_02_145.c new file mode 100644 index 00000000..7178abf4 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_145.c @@ -0,0 +1,387 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x81, 0xf3, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xa4, 0xed, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + +TAHI_TEST_SEQ tahi_02_145[] = { + {TITLE, "02-145", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + + {CLEANUP,NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_145_size = sizeof(tahi_02_145) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_146.c b/test/regression/tahi_test/tahi_02_146.c new file mode 100644 index 00000000..20d11b75 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_146.c @@ -0,0 +1,387 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x72, 0xf3, 0x0f, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x0f, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xa4, 0xed, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x0f, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x0f, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + +TAHI_TEST_SEQ tahi_02_146[] = { + {TITLE, "02-146", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + + {CLEANUP,NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_146_size = sizeof(tahi_02_146) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_147.c b/test/regression/tahi_test/tahi_02_147.c new file mode 100644 index 00000000..cebe7779 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_147.c @@ -0,0 +1,7811 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x1a, 0x2a, 0x40, 0x00, 0x07, 0x08, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0x6e, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt27[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0x6e, 0x40, 0x00, 0x00, 0x14, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt30[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt31[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt32[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt33[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt34[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt35[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt36[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt37[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt38[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt39[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt40[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt41[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt42[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt43[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt44[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt45[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt46[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt47[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt48[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt49[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt50[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt51[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt52[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt53[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt54[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt55[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt56[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt57[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt58[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt59[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt60[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt61[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt62[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt63[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt64[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt65[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt66[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt67[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt68[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt69[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt70[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt71[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt72[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt73[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt74[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt75[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt76[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt77[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt78[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt79[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt80[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt81[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt82[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt83[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt84[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt85[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt86[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt87[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt88[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt89[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt90[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt91[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt92[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt93[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt94[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt95[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt96[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt97[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt98[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt99[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt100[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt101[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt102[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt103[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt104[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt105[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt106[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt107[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt108[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt109[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt110[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt111[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt112[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt113[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt114[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt115[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt116[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt117[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt118[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt119[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt120[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt121[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt122[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt123[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt124[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt125[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt126[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt127[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt128[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt129[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt130[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt131[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt132[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt133[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt134[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt135[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt136[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt137[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt138[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt139[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt140[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt141[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt142[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt143[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt144[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt145[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt146[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt147[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt148[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt149[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt150[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt151[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt152[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt153[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt154[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt155[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt156[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt157[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt158[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt159[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt160[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt161[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt162[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt163[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt164[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt165[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt166[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt167[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt168[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt169[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt170[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt171[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt172[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt173[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt174[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt175[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt176[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt177[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt178[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt179[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt180[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt181[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt182[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt183[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt184[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt185[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt186[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt187[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt188[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt189[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt190[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt191[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt192[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt193[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt194[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt195[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt196[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt197[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt198[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt199[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt200[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt201[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt202[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt203[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt204[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt205[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt206[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt207[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt208[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt209[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt210[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt211[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt212[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt213[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt214[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt215[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt216[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt217[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt218[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt219[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt220[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt221[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt222[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt223[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt224[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt225[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt226[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt227[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt228[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt229[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt230[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt231[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt232[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt233[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt234[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt235[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt236[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt237[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt238[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt239[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt240[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt241[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt242[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt243[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt244[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt245[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt246[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt247[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt248[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt249[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt250[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt251[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt252[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt253[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt254[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt255[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt256[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt257[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt258[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt259[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt260[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt261[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt262[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt263[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt264[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt265[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt266[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt267[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt268[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt269[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt270[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt271[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt272[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt273[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt274[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt275[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt276[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt277[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt278[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt279[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt280[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt281[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt282[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt283[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt284[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt285[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt286[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt287[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt288[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt289[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt290[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt291[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt292[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt293[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt294[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt295[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt296[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt297[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt298[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt299[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt300[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt301[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt302[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt303[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt304[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt305[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt306[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt307[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt308[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt309[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt310[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt311[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt312[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt313[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt314[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt315[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt316[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt317[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt318[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt319[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt320[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt321[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt322[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt323[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt324[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt325[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt326[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt327[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt328[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt329[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt330[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt331[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt332[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt333[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt334[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt335[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt336[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt337[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt338[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt339[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt340[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt341[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt342[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt343[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt344[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt345[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt346[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt347[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt348[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt349[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt350[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt351[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt352[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt353[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt354[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt355[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt356[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt357[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt358[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt359[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt360[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt361[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt362[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt363[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt364[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt365[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt366[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt367[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt368[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt369[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt370[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt371[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt372[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt373[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt374[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt375[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt376[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt377[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt378[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt379[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt380[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt381[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt382[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt383[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt384[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt385[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt386[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt387[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt388[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt389[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt390[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt391[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt392[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt393[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt394[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt395[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt396[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt397[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt398[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt399[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt400[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt401[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt402[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt403[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt404[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt405[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt406[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt407[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt408[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt409[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt410[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt411[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt412[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt413[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt414[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt415[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt416[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt417[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt418[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt419[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt420[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt421[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt422[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt423[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt424[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt425[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt426[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt427[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt428[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt429[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt430[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt431[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt432[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt433[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt434[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt435[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt436[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt437[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt438[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt439[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt440[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt441[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt442[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt443[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt444[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt445[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt446[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt447[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt448[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt449[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt450[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt451[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt452[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt453[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt454[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt455[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt456[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt457[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt458[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt459[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt460[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt461[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt462[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt463[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt464[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt465[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt466[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt467[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt468[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt469[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt470[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt471[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt472[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt473[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt474[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt475[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt476[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt477[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt478[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt479[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt480[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt481[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt482[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt483[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt484[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt485[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt486[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt487[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt488[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt489[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt490[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt491[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt492[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt493[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt494[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt495[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt496[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt497[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt498[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt499[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt500[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt501[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt502[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt503[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt504[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt505[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt506[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt507[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt508[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt509[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt510[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt511[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt512[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt513[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt514[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt515[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt516[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt517[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt518[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt519[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt520[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt521[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt522[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt523[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt524[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt525[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt526[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt527[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt528[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt529[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt530[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt531[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt532[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt533[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt534[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt535[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt536[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt537[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt538[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt539[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt540[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt541[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt542[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt543[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt544[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt545[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt546[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt547[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt548[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt549[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt550[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt551[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt552[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt553[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt554[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt555[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt556[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt557[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt558[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt559[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt560[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt561[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt562[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt563[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt564[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt565[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt566[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt567[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt568[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt569[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt570[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt571[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt572[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt573[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt574[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt575[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt576[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt577[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt578[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt579[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt580[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt581[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt582[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt583[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt584[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt585[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt586[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt587[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt588[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt589[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; +#endif + +static char pkt590[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt591[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt592[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt593[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt594[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt595[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt596[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt597[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt598[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt599[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt600[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt601[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt602[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt603[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt604[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt605[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt606[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt607[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt608[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt609[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt610[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt611[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt612[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt613[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt614[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt615[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt616[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt617[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt618[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt619[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt620[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + +TAHI_TEST_SEQ tahi_02_147[] = { + {TITLE, "02-147", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + {WAIT, NX_NULL, 0, 5}, /* NS */ + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo request */ + {CHECK, &pkt5[0], sizeof(pkt5), 2}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 2}, /* Echo reply */ + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* RA */ + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* Echo request */ + {CHECK, &pkt10[0], sizeof(pkt10), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* Echo request */ + {CHECK, &pkt12[0], sizeof(pkt12), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, /* Echo request */ + {CHECK, &pkt14[0], sizeof(pkt14), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* Echo request */ + {CHECK, &pkt16[0], sizeof(pkt16), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* Echo request */ + {CHECK, &pkt18[0], sizeof(pkt18), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* Echo request */ + {CHECK, &pkt20[0], sizeof(pkt20), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, /* Echo request */ + {CHECK, &pkt22[0], sizeof(pkt22), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, /* Echo request */ + {CHECK, &pkt24[0], sizeof(pkt24), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, /* Echo request */ + {CHECK, &pkt26[0], sizeof(pkt26), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, /* Echo request */ + {CHECK, &pkt28[0], sizeof(pkt28), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 1}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, /* RA */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt30[0], sizeof(pkt30), 0}, /* Echo request */ + {CHECK, &pkt31[0], sizeof(pkt31), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt32[0], sizeof(pkt32), 0}, /* Echo request */ + {CHECK, &pkt33[0], sizeof(pkt33), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt34[0], sizeof(pkt34), 0}, /* Echo request */ + {CHECK, &pkt35[0], sizeof(pkt35), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt36[0], sizeof(pkt36), 0}, /* Echo request */ + {CHECK, &pkt37[0], sizeof(pkt37), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt38[0], sizeof(pkt38), 0}, /* Echo request */ + {CHECK, &pkt39[0], sizeof(pkt39), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt40[0], sizeof(pkt40), 0}, /* Echo request */ + {CHECK, &pkt41[0], sizeof(pkt41), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt42[0], sizeof(pkt42), 0}, /* Echo request */ + {CHECK, &pkt43[0], sizeof(pkt43), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt44[0], sizeof(pkt44), 0}, /* Echo request */ + {CHECK, &pkt45[0], sizeof(pkt45), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt46[0], sizeof(pkt46), 0}, /* Echo request */ + {CHECK, &pkt47[0], sizeof(pkt47), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt48[0], sizeof(pkt48), 0}, /* Echo request */ + {CHECK, &pkt49[0], sizeof(pkt49), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt50[0], sizeof(pkt50), 0}, /* Echo request */ + {CHECK, &pkt51[0], sizeof(pkt51), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt52[0], sizeof(pkt52), 0}, /* Echo request */ + {CHECK, &pkt53[0], sizeof(pkt53), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt54[0], sizeof(pkt54), 0}, /* Echo request */ + {CHECK, &pkt55[0], sizeof(pkt55), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt56[0], sizeof(pkt56), 0}, /* Echo request */ + {CHECK, &pkt57[0], sizeof(pkt57), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt58[0], sizeof(pkt58), 0}, /* Echo request */ + {CHECK, &pkt59[0], sizeof(pkt59), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt60[0], sizeof(pkt60), 0}, /* Echo request */ + {CHECK, &pkt61[0], sizeof(pkt61), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt62[0], sizeof(pkt62), 0}, /* Echo request */ + {CHECK, &pkt63[0], sizeof(pkt63), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt64[0], sizeof(pkt64), 0}, /* Echo request */ + {CHECK, &pkt65[0], sizeof(pkt65), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt66[0], sizeof(pkt66), 0}, /* Echo request */ + {CHECK, &pkt67[0], sizeof(pkt67), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt68[0], sizeof(pkt68), 0}, /* Echo request */ + {CHECK, &pkt69[0], sizeof(pkt69), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt70[0], sizeof(pkt70), 0}, /* Echo request */ + {CHECK, &pkt71[0], sizeof(pkt71), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt72[0], sizeof(pkt72), 0}, /* Echo request */ + {CHECK, &pkt73[0], sizeof(pkt73), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt74[0], sizeof(pkt74), 0}, /* Echo request */ + {CHECK, &pkt75[0], sizeof(pkt75), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt76[0], sizeof(pkt76), 0}, /* Echo request */ + {CHECK, &pkt77[0], sizeof(pkt77), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt78[0], sizeof(pkt78), 0}, /* Echo request */ + {CHECK, &pkt79[0], sizeof(pkt79), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt80[0], sizeof(pkt80), 0}, /* Echo request */ + {CHECK, &pkt81[0], sizeof(pkt81), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt82[0], sizeof(pkt82), 0}, /* Echo request */ + {CHECK, &pkt83[0], sizeof(pkt83), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt84[0], sizeof(pkt84), 0}, /* Echo request */ + {CHECK, &pkt85[0], sizeof(pkt85), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt86[0], sizeof(pkt86), 0}, /* Echo request */ + {CHECK, &pkt87[0], sizeof(pkt87), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt88[0], sizeof(pkt88), 0}, /* Echo request */ + {CHECK, &pkt89[0], sizeof(pkt89), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt90[0], sizeof(pkt90), 0}, /* Echo request */ + {CHECK, &pkt91[0], sizeof(pkt91), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt92[0], sizeof(pkt92), 0}, /* Echo request */ + {CHECK, &pkt93[0], sizeof(pkt93), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt94[0], sizeof(pkt94), 0}, /* Echo request */ + {CHECK, &pkt95[0], sizeof(pkt95), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt96[0], sizeof(pkt96), 0}, /* Echo request */ + {CHECK, &pkt97[0], sizeof(pkt97), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt98[0], sizeof(pkt98), 0}, /* Echo request */ + {CHECK, &pkt99[0], sizeof(pkt99), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt100[0], sizeof(pkt100), 0}, /* Echo request */ + {CHECK, &pkt101[0], sizeof(pkt101), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt102[0], sizeof(pkt102), 0}, /* Echo request */ + {CHECK, &pkt103[0], sizeof(pkt103), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt104[0], sizeof(pkt104), 0}, /* Echo request */ + {CHECK, &pkt105[0], sizeof(pkt105), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt106[0], sizeof(pkt106), 0}, /* Echo request */ + {CHECK, &pkt107[0], sizeof(pkt107), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt108[0], sizeof(pkt108), 0}, /* Echo request */ + {CHECK, &pkt109[0], sizeof(pkt109), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt110[0], sizeof(pkt110), 0}, /* Echo request */ + {CHECK, &pkt111[0], sizeof(pkt111), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt112[0], sizeof(pkt112), 0}, /* Echo request */ + {CHECK, &pkt113[0], sizeof(pkt113), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt114[0], sizeof(pkt114), 0}, /* Echo request */ + {CHECK, &pkt115[0], sizeof(pkt115), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt116[0], sizeof(pkt116), 0}, /* Echo request */ + {CHECK, &pkt117[0], sizeof(pkt117), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt118[0], sizeof(pkt118), 0}, /* Echo request */ + {CHECK, &pkt119[0], sizeof(pkt119), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt120[0], sizeof(pkt120), 0}, /* Echo request */ + {CHECK, &pkt121[0], sizeof(pkt121), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt122[0], sizeof(pkt122), 0}, /* Echo request */ + {CHECK, &pkt123[0], sizeof(pkt123), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt124[0], sizeof(pkt124), 0}, /* Echo request */ + {CHECK, &pkt125[0], sizeof(pkt125), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt126[0], sizeof(pkt126), 0}, /* Echo request */ + {CHECK, &pkt127[0], sizeof(pkt127), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt128[0], sizeof(pkt128), 0}, /* Echo request */ + {CHECK, &pkt129[0], sizeof(pkt129), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt130[0], sizeof(pkt130), 0}, /* Echo request */ + {CHECK, &pkt131[0], sizeof(pkt131), 2}, /* Echo reply */ + + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt132[0], sizeof(pkt132), 0}, /* Echo request */ + {CHECK, &pkt133[0], sizeof(pkt133), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt134[0], sizeof(pkt134), 0}, /* Echo request */ + {CHECK, &pkt135[0], sizeof(pkt135), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt136[0], sizeof(pkt136), 0}, /* Echo request */ + {CHECK, &pkt137[0], sizeof(pkt137), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt138[0], sizeof(pkt138), 0}, /* Echo request */ + {CHECK, &pkt139[0], sizeof(pkt139), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt140[0], sizeof(pkt140), 0}, /* Echo request */ + {CHECK, &pkt141[0], sizeof(pkt141), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt142[0], sizeof(pkt142), 0}, /* Echo request */ + {CHECK, &pkt143[0], sizeof(pkt143), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt144[0], sizeof(pkt144), 0}, /* Echo request */ + {CHECK, &pkt145[0], sizeof(pkt145), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt146[0], sizeof(pkt146), 0}, /* Echo request */ + {CHECK, &pkt147[0], sizeof(pkt147), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt148[0], sizeof(pkt148), 0}, /* Echo request */ + {CHECK, &pkt149[0], sizeof(pkt149), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt150[0], sizeof(pkt150), 0}, /* Echo request */ + {CHECK, &pkt151[0], sizeof(pkt151), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt152[0], sizeof(pkt152), 0}, /* Echo request */ + {CHECK, &pkt153[0], sizeof(pkt153), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt154[0], sizeof(pkt154), 0}, /* Echo request */ + {CHECK, &pkt155[0], sizeof(pkt155), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt156[0], sizeof(pkt156), 0}, /* Echo request */ + {CHECK, &pkt157[0], sizeof(pkt157), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt158[0], sizeof(pkt158), 0}, /* Echo request */ + {CHECK, &pkt159[0], sizeof(pkt159), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt160[0], sizeof(pkt160), 0}, /* Echo request */ + {CHECK, &pkt161[0], sizeof(pkt161), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt162[0], sizeof(pkt162), 0}, /* Echo request */ + {CHECK, &pkt163[0], sizeof(pkt163), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt164[0], sizeof(pkt164), 0}, /* Echo request */ + {CHECK, &pkt165[0], sizeof(pkt165), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt166[0], sizeof(pkt166), 0}, /* Echo request */ + {CHECK, &pkt167[0], sizeof(pkt167), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt168[0], sizeof(pkt168), 0}, /* Echo request */ + {CHECK, &pkt169[0], sizeof(pkt169), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt170[0], sizeof(pkt170), 0}, /* Echo request */ + {CHECK, &pkt171[0], sizeof(pkt171), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt172[0], sizeof(pkt172), 0}, /* Echo request */ + {CHECK, &pkt173[0], sizeof(pkt173), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt174[0], sizeof(pkt174), 0}, /* Echo request */ + {CHECK, &pkt175[0], sizeof(pkt175), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt176[0], sizeof(pkt176), 0}, /* Echo request */ + {CHECK, &pkt177[0], sizeof(pkt177), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt178[0], sizeof(pkt178), 0}, /* Echo request */ + {CHECK, &pkt179[0], sizeof(pkt179), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt180[0], sizeof(pkt180), 0}, /* Echo request */ + {CHECK, &pkt181[0], sizeof(pkt181), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt182[0], sizeof(pkt182), 0}, /* Echo request */ + {CHECK, &pkt183[0], sizeof(pkt183), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt184[0], sizeof(pkt184), 0}, /* Echo request */ + {CHECK, &pkt185[0], sizeof(pkt185), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt186[0], sizeof(pkt186), 0}, /* Echo request */ + {CHECK, &pkt187[0], sizeof(pkt187), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt188[0], sizeof(pkt188), 0}, /* Echo request */ + {CHECK, &pkt189[0], sizeof(pkt189), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt190[0], sizeof(pkt190), 0}, /* Echo request */ + {CHECK, &pkt191[0], sizeof(pkt191), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt192[0], sizeof(pkt192), 0}, /* Echo request */ + {CHECK, &pkt193[0], sizeof(pkt193), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt194[0], sizeof(pkt194), 0}, /* Echo request */ + {CHECK, &pkt195[0], sizeof(pkt195), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt196[0], sizeof(pkt196), 0}, /* Echo request */ + {CHECK, &pkt197[0], sizeof(pkt197), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt198[0], sizeof(pkt198), 0}, /* Echo request */ + {CHECK, &pkt199[0], sizeof(pkt199), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt200[0], sizeof(pkt200), 0}, /* Echo request */ + {CHECK, &pkt201[0], sizeof(pkt201), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt202[0], sizeof(pkt202), 0}, /* Echo request */ + {CHECK, &pkt203[0], sizeof(pkt203), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt204[0], sizeof(pkt204), 0}, /* Echo request */ + {CHECK, &pkt205[0], sizeof(pkt205), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt206[0], sizeof(pkt206), 0}, /* Echo request */ + {CHECK, &pkt207[0], sizeof(pkt207), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt208[0], sizeof(pkt208), 0}, /* Echo request */ + {CHECK, &pkt209[0], sizeof(pkt209), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt210[0], sizeof(pkt210), 0}, /* Echo request */ + {CHECK, &pkt211[0], sizeof(pkt211), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt212[0], sizeof(pkt212), 0}, /* Echo request */ + {CHECK, &pkt213[0], sizeof(pkt213), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt214[0], sizeof(pkt214), 0}, /* Echo request */ + {CHECK, &pkt215[0], sizeof(pkt215), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt216[0], sizeof(pkt216), 0}, /* Echo request */ + {CHECK, &pkt217[0], sizeof(pkt217), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt218[0], sizeof(pkt218), 0}, /* Echo request */ + {CHECK, &pkt219[0], sizeof(pkt219), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt220[0], sizeof(pkt220), 0}, /* Echo request */ + {CHECK, &pkt221[0], sizeof(pkt221), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt222[0], sizeof(pkt222), 0}, /* Echo request */ + {CHECK, &pkt223[0], sizeof(pkt223), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt224[0], sizeof(pkt224), 0}, /* Echo request */ + {CHECK, &pkt225[0], sizeof(pkt225), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt226[0], sizeof(pkt226), 0}, /* Echo request */ + {CHECK, &pkt227[0], sizeof(pkt227), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt228[0], sizeof(pkt228), 0}, /* Echo request */ + {CHECK, &pkt229[0], sizeof(pkt229), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt230[0], sizeof(pkt230), 0}, /* Echo request */ + {CHECK, &pkt231[0], sizeof(pkt231), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt232[0], sizeof(pkt232), 0}, /* Echo request */ + {CHECK, &pkt233[0], sizeof(pkt233), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt234[0], sizeof(pkt234), 0}, /* Echo request */ + {CHECK, &pkt235[0], sizeof(pkt235), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt236[0], sizeof(pkt236), 0}, /* Echo request */ + {CHECK, &pkt237[0], sizeof(pkt237), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt238[0], sizeof(pkt238), 0}, /* Echo request */ + {CHECK, &pkt239[0], sizeof(pkt239), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt240[0], sizeof(pkt240), 0}, /* Echo request */ + {CHECK, &pkt241[0], sizeof(pkt241), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt242[0], sizeof(pkt242), 0}, /* Echo request */ + {CHECK, &pkt243[0], sizeof(pkt243), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt244[0], sizeof(pkt244), 0}, /* Echo request */ + {CHECK, &pkt245[0], sizeof(pkt245), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt246[0], sizeof(pkt246), 0}, /* Echo request */ + {CHECK, &pkt247[0], sizeof(pkt247), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt248[0], sizeof(pkt248), 0}, /* Echo request */ + {CHECK, &pkt249[0], sizeof(pkt249), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt250[0], sizeof(pkt250), 0}, /* Echo request */ + {CHECK, &pkt251[0], sizeof(pkt251), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt252[0], sizeof(pkt252), 0}, /* Echo request */ + {CHECK, &pkt253[0], sizeof(pkt253), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt254[0], sizeof(pkt254), 0}, /* Echo request */ + {CHECK, &pkt255[0], sizeof(pkt255), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt256[0], sizeof(pkt256), 0}, /* Echo request */ + {CHECK, &pkt257[0], sizeof(pkt257), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt258[0], sizeof(pkt258), 0}, /* Echo request */ + {CHECK, &pkt259[0], sizeof(pkt259), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt260[0], sizeof(pkt260), 0}, /* Echo request */ + {CHECK, &pkt261[0], sizeof(pkt261), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt262[0], sizeof(pkt262), 0}, /* Echo request */ + {CHECK, &pkt263[0], sizeof(pkt263), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt264[0], sizeof(pkt264), 0}, /* Echo request */ + {CHECK, &pkt265[0], sizeof(pkt265), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt266[0], sizeof(pkt266), 0}, /* Echo request */ + {CHECK, &pkt267[0], sizeof(pkt267), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt268[0], sizeof(pkt268), 0}, /* Echo request */ + {CHECK, &pkt269[0], sizeof(pkt269), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt270[0], sizeof(pkt270), 0}, /* Echo request */ + {CHECK, &pkt271[0], sizeof(pkt271), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt272[0], sizeof(pkt272), 0}, /* Echo request */ + {CHECK, &pkt273[0], sizeof(pkt273), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt274[0], sizeof(pkt274), 0}, /* Echo request */ + {CHECK, &pkt275[0], sizeof(pkt275), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt276[0], sizeof(pkt276), 0}, /* Echo request */ + {CHECK, &pkt277[0], sizeof(pkt277), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt278[0], sizeof(pkt278), 0}, /* Echo request */ + {CHECK, &pkt279[0], sizeof(pkt279), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt280[0], sizeof(pkt280), 0}, /* Echo request */ + {CHECK, &pkt281[0], sizeof(pkt281), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt282[0], sizeof(pkt282), 0}, /* Echo request */ + {CHECK, &pkt283[0], sizeof(pkt283), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt284[0], sizeof(pkt284), 0}, /* Echo request */ + {CHECK, &pkt285[0], sizeof(pkt285), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt286[0], sizeof(pkt286), 0}, /* Echo request */ + {CHECK, &pkt287[0], sizeof(pkt287), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt288[0], sizeof(pkt288), 0}, /* Echo request */ + {CHECK, &pkt289[0], sizeof(pkt289), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt290[0], sizeof(pkt290), 0}, /* Echo request */ + {CHECK, &pkt291[0], sizeof(pkt291), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt292[0], sizeof(pkt292), 0}, /* Echo request */ + {CHECK, &pkt293[0], sizeof(pkt293), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt294[0], sizeof(pkt294), 0}, /* Echo request */ + {CHECK, &pkt295[0], sizeof(pkt295), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt296[0], sizeof(pkt296), 0}, /* Echo request */ + {CHECK, &pkt297[0], sizeof(pkt297), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt298[0], sizeof(pkt298), 0}, /* Echo request */ + {CHECK, &pkt299[0], sizeof(pkt299), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt300[0], sizeof(pkt300), 0}, /* Echo request */ + {CHECK, &pkt301[0], sizeof(pkt301), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt302[0], sizeof(pkt302), 0}, /* Echo request */ + {CHECK, &pkt303[0], sizeof(pkt303), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt304[0], sizeof(pkt304), 0}, /* Echo request */ + {CHECK, &pkt305[0], sizeof(pkt305), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt306[0], sizeof(pkt306), 0}, /* Echo request */ + {CHECK, &pkt307[0], sizeof(pkt307), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt308[0], sizeof(pkt308), 0}, /* Echo request */ + {CHECK, &pkt309[0], sizeof(pkt309), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt310[0], sizeof(pkt310), 0}, /* Echo request */ + {CHECK, &pkt311[0], sizeof(pkt311), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt312[0], sizeof(pkt312), 0}, /* Echo request */ + {CHECK, &pkt313[0], sizeof(pkt313), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt314[0], sizeof(pkt314), 0}, /* Echo request */ + {CHECK, &pkt315[0], sizeof(pkt315), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt316[0], sizeof(pkt316), 0}, /* Echo request */ + {CHECK, &pkt317[0], sizeof(pkt317), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt318[0], sizeof(pkt318), 0}, /* Echo request */ + {CHECK, &pkt319[0], sizeof(pkt319), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt320[0], sizeof(pkt320), 0}, /* Echo request */ + {CHECK, &pkt321[0], sizeof(pkt321), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt322[0], sizeof(pkt322), 0}, /* Echo request */ + {CHECK, &pkt323[0], sizeof(pkt323), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt324[0], sizeof(pkt324), 0}, /* Echo request */ + {CHECK, &pkt325[0], sizeof(pkt325), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt326[0], sizeof(pkt326), 0}, /* Echo request */ + {CHECK, &pkt327[0], sizeof(pkt327), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt328[0], sizeof(pkt328), 0}, /* Echo request */ + {CHECK, &pkt329[0], sizeof(pkt329), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt330[0], sizeof(pkt330), 0}, /* Echo request */ + {CHECK, &pkt331[0], sizeof(pkt331), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt332[0], sizeof(pkt332), 0}, /* Echo request */ + {CHECK, &pkt333[0], sizeof(pkt333), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt334[0], sizeof(pkt334), 0}, /* Echo request */ + {CHECK, &pkt335[0], sizeof(pkt335), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt336[0], sizeof(pkt336), 0}, /* Echo request */ + {CHECK, &pkt337[0], sizeof(pkt337), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt338[0], sizeof(pkt338), 0}, /* Echo request */ + {CHECK, &pkt339[0], sizeof(pkt339), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt340[0], sizeof(pkt340), 0}, /* Echo request */ + {CHECK, &pkt341[0], sizeof(pkt341), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt342[0], sizeof(pkt342), 0}, /* Echo request */ + {CHECK, &pkt343[0], sizeof(pkt343), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt344[0], sizeof(pkt344), 0}, /* Echo request */ + {CHECK, &pkt345[0], sizeof(pkt345), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt346[0], sizeof(pkt346), 0}, /* Echo request */ + {CHECK, &pkt347[0], sizeof(pkt347), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt348[0], sizeof(pkt348), 0}, /* Echo request */ + {CHECK, &pkt349[0], sizeof(pkt349), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt350[0], sizeof(pkt350), 0}, /* Echo request */ + {CHECK, &pkt351[0], sizeof(pkt351), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt352[0], sizeof(pkt352), 0}, /* Echo request */ + {CHECK, &pkt353[0], sizeof(pkt353), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt354[0], sizeof(pkt354), 0}, /* Echo request */ + {CHECK, &pkt355[0], sizeof(pkt355), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt356[0], sizeof(pkt356), 0}, /* Echo request */ + {CHECK, &pkt357[0], sizeof(pkt357), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt358[0], sizeof(pkt358), 0}, /* Echo request */ + {CHECK, &pkt359[0], sizeof(pkt359), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt360[0], sizeof(pkt360), 0}, /* Echo request */ + {CHECK, &pkt361[0], sizeof(pkt361), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt362[0], sizeof(pkt362), 0}, /* Echo request */ + {CHECK, &pkt363[0], sizeof(pkt363), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt364[0], sizeof(pkt364), 0}, /* Echo request */ + {CHECK, &pkt365[0], sizeof(pkt365), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt366[0], sizeof(pkt366), 0}, /* Echo request */ + {CHECK, &pkt367[0], sizeof(pkt367), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt368[0], sizeof(pkt368), 0}, /* Echo request */ + {CHECK, &pkt369[0], sizeof(pkt369), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt370[0], sizeof(pkt370), 0}, /* Echo request */ + {CHECK, &pkt371[0], sizeof(pkt371), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt372[0], sizeof(pkt372), 0}, /* Echo request */ + {CHECK, &pkt373[0], sizeof(pkt373), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt374[0], sizeof(pkt374), 0}, /* Echo request */ + {CHECK, &pkt375[0], sizeof(pkt375), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt376[0], sizeof(pkt376), 0}, /* Echo request */ + {CHECK, &pkt377[0], sizeof(pkt377), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt378[0], sizeof(pkt378), 0}, /* Echo request */ + {CHECK, &pkt379[0], sizeof(pkt379), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt380[0], sizeof(pkt380), 0}, /* Echo request */ + {CHECK, &pkt381[0], sizeof(pkt381), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt382[0], sizeof(pkt382), 0}, /* Echo request */ + {CHECK, &pkt383[0], sizeof(pkt383), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt384[0], sizeof(pkt384), 0}, /* Echo request */ + {CHECK, &pkt385[0], sizeof(pkt385), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt386[0], sizeof(pkt386), 0}, /* Echo request */ + {CHECK, &pkt387[0], sizeof(pkt387), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt388[0], sizeof(pkt388), 0}, /* Echo request */ + {CHECK, &pkt389[0], sizeof(pkt389), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt390[0], sizeof(pkt390), 0}, /* Echo request */ + {CHECK, &pkt391[0], sizeof(pkt391), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt392[0], sizeof(pkt392), 0}, /* Echo request */ + {CHECK, &pkt393[0], sizeof(pkt393), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt394[0], sizeof(pkt394), 0}, /* Echo request */ + {CHECK, &pkt395[0], sizeof(pkt395), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt396[0], sizeof(pkt396), 0}, /* Echo request */ + {CHECK, &pkt397[0], sizeof(pkt397), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt398[0], sizeof(pkt398), 0}, /* Echo request */ + {CHECK, &pkt399[0], sizeof(pkt399), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt400[0], sizeof(pkt400), 0}, /* Echo request */ + {CHECK, &pkt401[0], sizeof(pkt401), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt402[0], sizeof(pkt402), 0}, /* Echo request */ + {CHECK, &pkt403[0], sizeof(pkt403), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt404[0], sizeof(pkt404), 0}, /* Echo request */ + {CHECK, &pkt405[0], sizeof(pkt405), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt406[0], sizeof(pkt406), 0}, /* Echo request */ + {CHECK, &pkt407[0], sizeof(pkt407), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt408[0], sizeof(pkt408), 0}, /* Echo request */ + {CHECK, &pkt409[0], sizeof(pkt409), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt410[0], sizeof(pkt410), 0}, /* Echo request */ + {CHECK, &pkt411[0], sizeof(pkt411), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt412[0], sizeof(pkt412), 0}, /* Echo request */ + {CHECK, &pkt413[0], sizeof(pkt413), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt414[0], sizeof(pkt414), 0}, /* Echo request */ + {CHECK, &pkt415[0], sizeof(pkt415), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt416[0], sizeof(pkt416), 0}, /* Echo request */ + {CHECK, &pkt417[0], sizeof(pkt417), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt418[0], sizeof(pkt418), 0}, /* Echo request */ + {CHECK, &pkt419[0], sizeof(pkt419), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt420[0], sizeof(pkt420), 0}, /* Echo request */ + {CHECK, &pkt421[0], sizeof(pkt421), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt422[0], sizeof(pkt422), 0}, /* Echo request */ + {CHECK, &pkt423[0], sizeof(pkt423), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt424[0], sizeof(pkt424), 0}, /* Echo request */ + {CHECK, &pkt425[0], sizeof(pkt425), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt426[0], sizeof(pkt426), 0}, /* Echo request */ + {CHECK, &pkt427[0], sizeof(pkt427), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt428[0], sizeof(pkt428), 0}, /* Echo request */ + {CHECK, &pkt429[0], sizeof(pkt429), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt430[0], sizeof(pkt430), 0}, /* Echo request */ + {CHECK, &pkt431[0], sizeof(pkt431), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt432[0], sizeof(pkt432), 0}, /* Echo request */ + {CHECK, &pkt433[0], sizeof(pkt433), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt434[0], sizeof(pkt434), 0}, /* Echo request */ + {CHECK, &pkt435[0], sizeof(pkt435), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt436[0], sizeof(pkt436), 0}, /* Echo request */ + {CHECK, &pkt437[0], sizeof(pkt437), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt438[0], sizeof(pkt438), 0}, /* Echo request */ + {CHECK, &pkt439[0], sizeof(pkt439), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt440[0], sizeof(pkt440), 0}, /* Echo request */ + {CHECK, &pkt441[0], sizeof(pkt441), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt442[0], sizeof(pkt442), 0}, /* Echo request */ + {CHECK, &pkt443[0], sizeof(pkt443), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt444[0], sizeof(pkt444), 0}, /* Echo request */ + {CHECK, &pkt445[0], sizeof(pkt445), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt446[0], sizeof(pkt446), 0}, /* Echo request */ + {CHECK, &pkt447[0], sizeof(pkt447), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt448[0], sizeof(pkt448), 0}, /* Echo request */ + {CHECK, &pkt449[0], sizeof(pkt449), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt450[0], sizeof(pkt450), 0}, /* Echo request */ + {CHECK, &pkt451[0], sizeof(pkt451), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt452[0], sizeof(pkt452), 0}, /* Echo request */ + {CHECK, &pkt453[0], sizeof(pkt453), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt454[0], sizeof(pkt454), 0}, /* Echo request */ + {CHECK, &pkt455[0], sizeof(pkt455), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt456[0], sizeof(pkt456), 0}, /* Echo request */ + {CHECK, &pkt457[0], sizeof(pkt457), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt458[0], sizeof(pkt458), 0}, /* Echo request */ + {CHECK, &pkt459[0], sizeof(pkt459), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt460[0], sizeof(pkt460), 0}, /* Echo request */ + {CHECK, &pkt461[0], sizeof(pkt461), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt462[0], sizeof(pkt462), 0}, /* Echo request */ + {CHECK, &pkt463[0], sizeof(pkt463), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt464[0], sizeof(pkt464), 0}, /* Echo request */ + {CHECK, &pkt465[0], sizeof(pkt465), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt466[0], sizeof(pkt466), 0}, /* Echo request */ + {CHECK, &pkt467[0], sizeof(pkt467), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt468[0], sizeof(pkt468), 0}, /* Echo request */ + {CHECK, &pkt469[0], sizeof(pkt469), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt470[0], sizeof(pkt470), 0}, /* Echo request */ + {CHECK, &pkt471[0], sizeof(pkt471), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt472[0], sizeof(pkt472), 0}, /* Echo request */ + {CHECK, &pkt473[0], sizeof(pkt473), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt474[0], sizeof(pkt474), 0}, /* Echo request */ + {CHECK, &pkt475[0], sizeof(pkt475), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt476[0], sizeof(pkt476), 0}, /* Echo request */ + {CHECK, &pkt477[0], sizeof(pkt477), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt478[0], sizeof(pkt478), 0}, /* Echo request */ + {CHECK, &pkt479[0], sizeof(pkt479), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt480[0], sizeof(pkt480), 0}, /* Echo request */ + {CHECK, &pkt481[0], sizeof(pkt481), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt482[0], sizeof(pkt482), 0}, /* Echo request */ + {CHECK, &pkt483[0], sizeof(pkt483), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt484[0], sizeof(pkt484), 0}, /* Echo request */ + {CHECK, &pkt485[0], sizeof(pkt485), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt486[0], sizeof(pkt486), 0}, /* Echo request */ + {CHECK, &pkt487[0], sizeof(pkt487), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt488[0], sizeof(pkt488), 0}, /* Echo request */ + {CHECK, &pkt489[0], sizeof(pkt489), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt490[0], sizeof(pkt490), 0}, /* Echo request */ + {CHECK, &pkt491[0], sizeof(pkt491), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt492[0], sizeof(pkt492), 0}, /* Echo request */ + {CHECK, &pkt493[0], sizeof(pkt493), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt494[0], sizeof(pkt494), 0}, /* Echo request */ + {CHECK, &pkt495[0], sizeof(pkt495), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt496[0], sizeof(pkt496), 0}, /* Echo request */ + {CHECK, &pkt497[0], sizeof(pkt497), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt498[0], sizeof(pkt498), 0}, /* Echo request */ + {CHECK, &pkt499[0], sizeof(pkt499), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt500[0], sizeof(pkt500), 0}, /* Echo request */ + {CHECK, &pkt501[0], sizeof(pkt501), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt502[0], sizeof(pkt502), 0}, /* Echo request */ + {CHECK, &pkt503[0], sizeof(pkt503), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt504[0], sizeof(pkt504), 0}, /* Echo request */ + {CHECK, &pkt505[0], sizeof(pkt505), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt506[0], sizeof(pkt506), 0}, /* Echo request */ + {CHECK, &pkt507[0], sizeof(pkt507), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt508[0], sizeof(pkt508), 0}, /* Echo request */ + {CHECK, &pkt509[0], sizeof(pkt509), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt510[0], sizeof(pkt510), 0}, /* Echo request */ + {CHECK, &pkt511[0], sizeof(pkt511), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt512[0], sizeof(pkt512), 0}, /* Echo request */ + {CHECK, &pkt513[0], sizeof(pkt513), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt514[0], sizeof(pkt514), 0}, /* Echo request */ + {CHECK, &pkt515[0], sizeof(pkt515), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt516[0], sizeof(pkt516), 0}, /* Echo request */ + {CHECK, &pkt517[0], sizeof(pkt517), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt518[0], sizeof(pkt518), 0}, /* Echo request */ + {CHECK, &pkt519[0], sizeof(pkt519), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt520[0], sizeof(pkt520), 0}, /* Echo request */ + {CHECK, &pkt521[0], sizeof(pkt521), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt522[0], sizeof(pkt522), 0}, /* Echo request */ + {CHECK, &pkt523[0], sizeof(pkt523), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt524[0], sizeof(pkt524), 0}, /* Echo request */ + {CHECK, &pkt525[0], sizeof(pkt525), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt526[0], sizeof(pkt526), 0}, /* Echo request */ + {CHECK, &pkt527[0], sizeof(pkt527), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt528[0], sizeof(pkt528), 0}, /* Echo request */ + {CHECK, &pkt529[0], sizeof(pkt529), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt530[0], sizeof(pkt530), 0}, /* Echo request */ + {CHECK, &pkt531[0], sizeof(pkt531), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt532[0], sizeof(pkt532), 0}, /* Echo request */ + {CHECK, &pkt533[0], sizeof(pkt533), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt534[0], sizeof(pkt534), 0}, /* Echo request */ + {CHECK, &pkt535[0], sizeof(pkt535), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt536[0], sizeof(pkt536), 0}, /* Echo request */ + {CHECK, &pkt537[0], sizeof(pkt537), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt538[0], sizeof(pkt538), 0}, /* Echo request */ + {CHECK, &pkt539[0], sizeof(pkt539), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt540[0], sizeof(pkt540), 0}, /* Echo request */ + {CHECK, &pkt541[0], sizeof(pkt541), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt542[0], sizeof(pkt542), 0}, /* Echo request */ + {CHECK, &pkt543[0], sizeof(pkt543), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt544[0], sizeof(pkt544), 0}, /* Echo request */ + {CHECK, &pkt545[0], sizeof(pkt545), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt546[0], sizeof(pkt546), 0}, /* Echo request */ + {CHECK, &pkt547[0], sizeof(pkt547), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt548[0], sizeof(pkt548), 0}, /* Echo request */ + {CHECK, &pkt549[0], sizeof(pkt549), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt550[0], sizeof(pkt550), 0}, /* Echo request */ + {CHECK, &pkt551[0], sizeof(pkt551), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt552[0], sizeof(pkt552), 0}, /* Echo request */ + {CHECK, &pkt553[0], sizeof(pkt553), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt554[0], sizeof(pkt554), 0}, /* Echo request */ + {CHECK, &pkt555[0], sizeof(pkt555), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt556[0], sizeof(pkt556), 0}, /* Echo request */ + {CHECK, &pkt557[0], sizeof(pkt557), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt558[0], sizeof(pkt558), 0}, /* Echo request */ + {CHECK, &pkt559[0], sizeof(pkt559), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt560[0], sizeof(pkt560), 0}, /* Echo request */ + {CHECK, &pkt561[0], sizeof(pkt561), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt562[0], sizeof(pkt562), 0}, /* Echo request */ + {CHECK, &pkt563[0], sizeof(pkt563), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt564[0], sizeof(pkt564), 0}, /* Echo request */ + {CHECK, &pkt565[0], sizeof(pkt565), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt566[0], sizeof(pkt566), 0}, /* Echo request */ + {CHECK, &pkt567[0], sizeof(pkt567), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt568[0], sizeof(pkt568), 0}, /* Echo request */ + {CHECK, &pkt569[0], sizeof(pkt569), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt570[0], sizeof(pkt570), 0}, /* Echo request */ + {CHECK, &pkt571[0], sizeof(pkt571), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt572[0], sizeof(pkt572), 0}, /* Echo request */ + {CHECK, &pkt573[0], sizeof(pkt573), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt574[0], sizeof(pkt574), 0}, /* Echo request */ + {CHECK, &pkt575[0], sizeof(pkt575), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt576[0], sizeof(pkt576), 0}, /* Echo request */ + {CHECK, &pkt577[0], sizeof(pkt577), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt578[0], sizeof(pkt578), 0}, /* Echo request */ + {CHECK, &pkt579[0], sizeof(pkt579), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt580[0], sizeof(pkt580), 0}, /* Echo request */ + {CHECK, &pkt581[0], sizeof(pkt581), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt582[0], sizeof(pkt582), 0}, /* Echo request */ + {CHECK, &pkt583[0], sizeof(pkt583), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt584[0], sizeof(pkt584), 0}, /* Echo request */ + {CHECK, &pkt585[0], sizeof(pkt585), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt586[0], sizeof(pkt586), 0}, /* Echo request */ + {CHECK, &pkt587[0], sizeof(pkt587), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt588[0], sizeof(pkt588), 0}, /* Echo request */ + {CHECK, &pkt599[0], sizeof(pkt599), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt590[0], sizeof(pkt590), 0}, /* Echo request */ + {CHECK, &pkt591[0], sizeof(pkt591), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt592[0], sizeof(pkt592), 0}, /* Echo request */ + {CHECK, &pkt593[0], sizeof(pkt593), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt594[0], sizeof(pkt594), 0}, /* Echo request */ + {CHECK, &pkt595[0], sizeof(pkt595), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt596[0], sizeof(pkt596), 0}, /* Echo request */ + {CHECK, &pkt597[0], sizeof(pkt597), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt598[0], sizeof(pkt598), 0}, /* Echo request */ + {CHECK, &pkt599[0], sizeof(pkt599), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt600[0], sizeof(pkt600), 0}, /* Echo request */ + {CHECK, &pkt601[0], sizeof(pkt601), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt602[0], sizeof(pkt602), 0}, /* Echo request */ + {CHECK, &pkt603[0], sizeof(pkt603), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt604[0], sizeof(pkt604), 0}, /* Echo request */ + {CHECK, &pkt605[0], sizeof(pkt605), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt606[0], sizeof(pkt606), 0}, /* Echo request */ + {CHECK, &pkt607[0], sizeof(pkt607), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt608[0], sizeof(pkt608), 0}, /* Echo request */ + {CHECK, &pkt609[0], sizeof(pkt609), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + {INJECT, &pkt610[0], sizeof(pkt610), 0}, /* Echo request */ + {WAIT, NX_NULL, 0, 2}, /* NS */ + + {INJECT, &pkt613[0], sizeof(pkt613), 0}, /* NA */ + {INJECT, &pkt614[0], sizeof(pkt614), 0}, /* Echo request */ + {CHECK, &pkt615[0], sizeof(pkt615), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 11}, /* NS */ + + {INJECT, &pkt620[0], sizeof(pkt620), 0}, /* RA */ + + {CLEANUP,NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_147_size = sizeof(tahi_02_147) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_148.c b/test/regression/tahi_test/tahi_02_148.c new file mode 100644 index 00000000..61205e89 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_148.c @@ -0,0 +1,512 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x40, 0xf2, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0x82, 0x40, 0x00, 0x00, 0x00, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe3, 0x81, 0x40, 0x00, 0x00, 0x00, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt30[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt31[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt32[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt33[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt34[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt35[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x96, 0x92, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt36[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_148[] = { + {TITLE, "02-148", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + {INJECT, &pkt30[0], sizeof(pkt30), 0}, + {CHECK, &pkt31[0], sizeof(pkt31), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt35[0], sizeof(pkt35), 0}, + {INJECT, &pkt36[0], sizeof(pkt36), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_148_size = sizeof(tahi_02_148) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_149.c b/test/regression/tahi_test/tahi_02_149.c new file mode 100644 index 00000000..d369966a --- /dev/null +++ b/test/regression/tahi_test/tahi_02_149.c @@ -0,0 +1,516 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x40, 0xf2, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe4, 0x7d, 0x40, 0x00, 0x00, 0x05, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xe3, 0x7c, 0x40, 0x00, 0x00, 0x05, 0x00, 0x09, +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt30[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt31[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt32[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt33[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt34[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt35[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x96, 0x92, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt36[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_149[] = { + {TITLE, "02-149", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 2}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 2}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {WAIT, NX_NULL, 0, 7}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 7}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {N_CHECK, (char *)NS, 0, 2}, //Maybe fail, because it will send the wrong destination address NS packet. + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + {INJECT, &pkt30[0], sizeof(pkt30), 0}, + {CHECK, &pkt31[0], sizeof(pkt31), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt35[0], sizeof(pkt35), 0}, + {INJECT, &pkt36[0], sizeof(pkt36), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_149_size = sizeof(tahi_02_149) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_150.c b/test/regression/tahi_test/tahi_02_150.c new file mode 100644 index 00000000..6801890e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_150.c @@ -0,0 +1,719 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (102 bytes) */ +static char pkt1[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x21, 0xeb, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* !.@..... */ +0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, /* '....... */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt4[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ..`..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt8[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt9[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt12[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt30[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt34[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt35[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt36[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt37[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* y......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt38[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt39[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt40[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt41[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xa4, 0xed, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt42[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* z......# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt43[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt44[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt45[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (102 bytes) */ +static char pkt46[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, /* u0...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + + + + + +TAHI_TEST_SEQ tahi_02_150[] = { + {TITLE, "02-150", 6, 0}, + {WAIT, NX_NULL , 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo Request, Invalid version */ + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, //step 10 + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, //step 20 + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, //step 30 + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt26[0], sizeof(pkt26), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + {CHECK, &pkt29[0], sizeof(pkt29), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt31[0], sizeof(pkt31), 0}, //RATE_10 Success should be comment out this line //step 40 + {CHECK, &pkt30[0], sizeof(pkt30), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt32[0], sizeof(pkt32), 0}, //RATE_20 Success should be comment out this line + {CHECK, &pkt33[0], sizeof(pkt33), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt34[0], sizeof(pkt34), 0}, + {CHECK, &pkt35[0], sizeof(pkt35), 2}, + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt36[0], sizeof(pkt36), 0}, + + /* The following packets are received after PASS. No need to check. */ +#if 0 + {CHECK, &pkt38[0], sizeof(pkt38), 2}, /* NS */ + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt41[0], sizeof(pkt41), 0}, /* NA */ + {INJECT, &pkt42[0], sizeof(pkt42), 0}, /* Echo request */ + {CHECK, &pkt43[0], sizeof(pkt43), 2}, /* NS */ + {WAIT, NX_NULL, 0, 6}, /* NS */ +#endif + + {INJECT, &pkt46[0], sizeof(pkt46), 0}, /* RA */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_150_size = sizeof(tahi_02_150) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_151.c b/test/regression/tahi_test/tahi_02_151.c new file mode 100644 index 00000000..c1d51525 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_151.c @@ -0,0 +1,1320 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xac, 0xba, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x9c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xad, 0x86, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt26[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt28[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt29[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt30[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt31[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt32[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt33[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt34[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt35[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt36[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt37[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt38[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt39[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt40[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt41[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt42[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt43[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt44[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt45[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt46[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt47[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt48[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt49[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt50[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt51[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt52[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt53[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt54[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt55[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt56[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt57[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt58[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt59[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt60[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt61[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt62[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt63[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt64[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt65[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt66[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt67[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt68[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt69[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt70[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt71[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt72[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt73[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt74[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt75[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt76[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt77[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt78[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt79[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt80[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt81[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt82[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt83[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt84[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt85[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt86[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt87[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt88[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt89[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt90[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt91[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt92[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt93[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt94[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt95[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt96[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt97[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xa4, 0xed, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt98[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt99[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt100[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt101[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt102[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_151[] = { + {TITLE, "02-151", 6, 0}, + {WAIT, NX_NULL , 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + {INJECT, &pkt2[0], sizeof(pkt2), 0}, /* Echo request */ + {CHECK, &pkt3[0], sizeof(pkt3), 2}, /* NS */ + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* NA */ + {CHECK, &pkt5[0], sizeof(pkt5), 2}, /* Echo reply */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* Echo request */ + {CHECK, &pkt7[0], sizeof(pkt7), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, /* NS */ + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* Echo request */ + {CHECK, &pkt10[0], sizeof(pkt10), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, /* NS */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo request */ + {CHECK, &pkt13[0], sizeof(pkt13), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, /* Echo request */ + {CHECK, &pkt15[0], sizeof(pkt15), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* Echo request */ + {CHECK, &pkt17[0], sizeof(pkt17), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo request */ + {CHECK, &pkt19[0], sizeof(pkt19), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, /* Echo request */ + {CHECK, &pkt21[0], sizeof(pkt21), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, /* Echo request */ + {CHECK, &pkt23[0], sizeof(pkt23), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, /* Echo request */ + {CHECK, &pkt25[0], sizeof(pkt25), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt26[0], sizeof(pkt26), 0}, /* Echo request */ + {CHECK, &pkt27[0], sizeof(pkt27), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt28[0], sizeof(pkt28), 0}, /* Echo request */ + {CHECK, &pkt29[0], sizeof(pkt29), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt30[0], sizeof(pkt30), 0}, /* Echo request */ + {CHECK, &pkt31[0], sizeof(pkt31), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt32[0], sizeof(pkt32), 0}, /* Echo request */ + {CHECK, &pkt33[0], sizeof(pkt33), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt34[0], sizeof(pkt34), 0}, /* Echo request */ + {CHECK, &pkt35[0], sizeof(pkt35), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt36[0], sizeof(pkt36), 0}, /* Echo request */ + {CHECK, &pkt37[0], sizeof(pkt37), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt38[0], sizeof(pkt38), 0}, /* Echo request */ + {CHECK, &pkt39[0], sizeof(pkt39), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt40[0], sizeof(pkt40), 0}, /* Echo request */ + {CHECK, &pkt41[0], sizeof(pkt41), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt42[0], sizeof(pkt42), 0}, /* Echo request */ + {CHECK, &pkt43[0], sizeof(pkt43), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt44[0], sizeof(pkt44), 0}, /* Echo request */ + {CHECK, &pkt45[0], sizeof(pkt45), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt46[0], sizeof(pkt46), 0}, /* Echo request */ + {CHECK, &pkt47[0], sizeof(pkt47), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt48[0], sizeof(pkt48), 0}, /* Echo request */ + {CHECK, &pkt49[0], sizeof(pkt49), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt50[0], sizeof(pkt50), 0}, /* Echo request */ + {CHECK, &pkt51[0], sizeof(pkt51), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt52[0], sizeof(pkt52), 0}, /* Echo request */ + {CHECK, &pkt53[0], sizeof(pkt53), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt54[0], sizeof(pkt54), 0}, /* Echo request */ + {CHECK, &pkt55[0], sizeof(pkt55), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt56[0], sizeof(pkt56), 0}, /* Echo request */ + {CHECK, &pkt57[0], sizeof(pkt57), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt58[0], sizeof(pkt58), 0}, /* Echo request */ + {CHECK, &pkt59[0], sizeof(pkt59), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt60[0], sizeof(pkt60), 0}, /* Echo request */ + {CHECK, &pkt61[0], sizeof(pkt61), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt62[0], sizeof(pkt62), 0}, /* Echo request */ + {CHECK, &pkt63[0], sizeof(pkt63), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt64[0], sizeof(pkt64), 0}, /* Echo request */ + {CHECK, &pkt65[0], sizeof(pkt65), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt66[0], sizeof(pkt66), 0}, /* Echo request */ + {CHECK, &pkt67[0], sizeof(pkt67), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt68[0], sizeof(pkt68), 0}, /* Echo request */ + {CHECK, &pkt69[0], sizeof(pkt69), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt70[0], sizeof(pkt70), 0}, /* Echo request */ + {CHECK, &pkt71[0], sizeof(pkt71), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt72[0], sizeof(pkt72), 0}, /* Echo request */ + {CHECK, &pkt73[0], sizeof(pkt73), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt74[0], sizeof(pkt74), 0}, /* Echo request */ + {CHECK, &pkt75[0], sizeof(pkt75), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt76[0], sizeof(pkt76), 0}, /* Echo request */ + {CHECK, &pkt77[0], sizeof(pkt77), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt78[0], sizeof(pkt78), 0}, /* Echo request */ + {CHECK, &pkt79[0], sizeof(pkt79), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt80[0], sizeof(pkt80), 0}, /* Echo request */ //RATE_10 should be comment out this line + {CHECK, &pkt81[0], sizeof(pkt81), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt82[0], sizeof(pkt82), 0}, /* Echo request */ + {CHECK, &pkt83[0], sizeof(pkt83), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt84[0], sizeof(pkt84), 0}, /* Echo request */ + {CHECK, &pkt85[0], sizeof(pkt85), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt86[0], sizeof(pkt86), 0}, /* Echo request */ + {CHECK, &pkt87[0], sizeof(pkt87), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt88[0], sizeof(pkt88), 0}, /* Echo request */ + {CHECK, &pkt89[0], sizeof(pkt89), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt90[0], sizeof(pkt90), 0}, /* Echo request */ + {CHECK, &pkt91[0], sizeof(pkt91), 2}, /* Echo reply */ + {N_CHECK, (char *)NS, NS_UNSPEC, 1}, + {INJECT, &pkt92[0], sizeof(pkt92), 0}, /* Echo request */ + {CHECK, &pkt93[0], sizeof(pkt93), 2}, /* Echo reply */ + + /* The following packets are received after PASS. No need to check. */ +#if 0 + {CHECK, &pkt94[0], sizeof(pkt94), 1}, /* NS */ + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt97[0], sizeof(pkt97), 0}, /* NA */ + {INJECT, &pkt98[0], sizeof(pkt98), 0}, /* Echo request */ + {CHECK, &pkt99[0], sizeof(pkt99), 2}, /* NS */ + {WAIT, NX_NULL, 0, 6}, /* NS */ +#endif + + {INJECT, &pkt102[0], sizeof(pkt102), 0},/* RA */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_151_size = sizeof(tahi_02_151) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_152.c b/test/regression/tahi_test/tahi_02_152.c new file mode 100644 index 00000000..3c1400a1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_152.c @@ -0,0 +1,115 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xcd, 0xed, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_152[] = { + {TITLE, "02-152", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo Request, Invalid version */ + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 2}, + {CHECK, &pkt4[0], sizeof(pkt4), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_152_size = sizeof(tahi_02_152) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_153.c b/test/regression/tahi_test/tahi_02_153.c new file mode 100644 index 00000000..1f3480e3 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_153.c @@ -0,0 +1,128 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xcd, 0xed, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_153[] = { + {TITLE, "02-153", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo Request, Invalid version */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {CHECK, &pkt5[0], sizeof(pkt5), 7}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_153_size = sizeof(tahi_02_153) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_154.c b/test/regression/tahi_test/tahi_02_154.c new file mode 100644 index 00000000..2c1a439f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_154.c @@ -0,0 +1,166 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xad, 0xcd, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_154[] = { + {TITLE, "02-154", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {CHECK, &pkt8[0], sizeof(pkt8), 7}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_154_size = sizeof(tahi_02_154) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_155.c b/test/regression/tahi_test/tahi_02_155.c new file mode 100644 index 00000000..5b8c466b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_155.c @@ -0,0 +1,205 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xcd, 0xed, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +TAHI_TEST_SEQ tahi_02_155[] = { + {TITLE, "02-155", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 7}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_155_size = sizeof(tahi_02_155) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_156.c b/test/regression/tahi_test/tahi_02_156.c new file mode 100644 index 00000000..d2c1ba20 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_156.c @@ -0,0 +1,206 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x6f, 0x97, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_156[] = { + {TITLE, "02-156", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 2}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 2}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {N_CHECK, (char *)NS, 0, 7}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_156_size = sizeof(tahi_02_156) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_157.c b/test/regression/tahi_test/tahi_02_157.c new file mode 100644 index 00000000..6dcd4275 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_157.c @@ -0,0 +1,343 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt5[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x5a, 0x38, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xcc, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x8e, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt6[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x5a, 0x38, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xcc, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x8e, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt7[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x5a, 0x39, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xcd, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x8e, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt8[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x5a, 0x39, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x72, 0xcd, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x8e, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xad, 0xcd, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_157[] = { + {TITLE, "02-157", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* Echo request */ + {CHECK, &pkt10[0], sizeof(pkt10), 2}, /* Echo reply */ + {CHECK, &pkt11[0], sizeof(pkt11), 7}, /* NS */ + {INJECT, &pkt12[0], sizeof(pkt12), 0},/* RA */ + {INJECT, &pkt13[0], sizeof(pkt13), 0},/* Echo request */ + {CHECK, &pkt14[0], sizeof(pkt14), 2}, /* Echo reply */ + {CHECK, &pkt15[0], sizeof(pkt15), 7}, /* NS */ + + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0},/* RA */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_157_size = sizeof(tahi_02_157) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_158.c b/test/regression/tahi_test/tahi_02_158.c new file mode 100644 index 00000000..0ebf96ba --- /dev/null +++ b/test/regression/tahi_test/tahi_02_158.c @@ -0,0 +1,274 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt7[86] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xcd, 0xed, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt16[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, /* u0...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + +TAHI_TEST_SEQ tahi_02_158[] = { + {TITLE, "02-158", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + + {WAIT, NX_NULL, 0, 45}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* Echo request */ + {CHECK, &pkt6[0], sizeof(pkt6), 2}, /* Echo reply */ + {CHECK, &pkt7[0], sizeof(pkt7), 7}, /* NS */ + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* RA */ + {CHECK, &pkt9[0], sizeof(pkt9), 2}, /* NS */ + {CHECK, &pkt10[0], sizeof(pkt10), 2}, /* NS */ + {WAIT, NX_NULL, 0, 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0},/* Echo request */ + {CHECK, &pkt13[0], sizeof(pkt13), 2}, /* NS */ + {CHECK, &pkt14[0], sizeof(pkt14), 2}, /* NS */ + {CHECK, &pkt15[0], sizeof(pkt15), 2}, /* NS */ + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0},/* RA */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_158_size = sizeof(tahi_02_158) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_159.c b/test/regression/tahi_test/tahi_02_159.c new file mode 100644 index 00000000..1ca16d05 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_159.c @@ -0,0 +1,273 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* N....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, /* ........ */ +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt7[86] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x6f, 0x97, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* o.@..... */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8 /* '..... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, /* .R.....# */ +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef /* Eg.... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, /* ........ */ +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* l'...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt16[102] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, /* ...0:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, /* u0...... */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + +TAHI_TEST_SEQ tahi_02_159[] = { + {TITLE, "02-159", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + + {WAIT, NX_NULL, 0, 45}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* Echo request */ + {CHECK, &pkt6[0], sizeof(pkt6), 2}, /* Echo reply */ + {CHECK, &pkt7[0], sizeof(pkt7), 7}, /* NS */ + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* RA */ + {CHECK, &pkt9[0], sizeof(pkt9), 2}, /* NS */ + {CHECK, &pkt10[0], sizeof(pkt10), 2}, /* NS */ + {WAIT, NX_NULL, 0, 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0},/* Echo request */ + {CHECK, &pkt13[0], sizeof(pkt13), 2}, /* NS */ + {CHECK, &pkt14[0], sizeof(pkt14), 2}, /* NS */ + {CHECK, &pkt15[0], sizeof(pkt15), 2}, /* NS */ + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0},/* RA */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_159_size = sizeof(tahi_02_159) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_160.c b/test/regression/tahi_test/tahi_02_160.c new file mode 100644 index 00000000..2b1d4844 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_160.c @@ -0,0 +1,169 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xad, 0xcd, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_160[] = { + {TITLE, "02-160", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* Echo request */ + {CHECK, &pkt7[0], sizeof(pkt7), 2}, /* Echo reply */ + {CHECK, &pkt8[0], sizeof(pkt8), 7}, /* NS */ + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* RA */ + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_160_size = sizeof(tahi_02_160) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_161.c b/test/regression/tahi_test/tahi_02_161.c new file mode 100644 index 00000000..f6168a58 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_161.c @@ -0,0 +1,169 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xcd, 0xed, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_161[] = { + {TITLE, "02-161", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + + {WAIT, NX_NULL, 0, 45}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* Echo request */ + {CHECK, &pkt7[0], sizeof(pkt7), 2}, /* Echo reply */ + {CHECK, &pkt8[0], sizeof(pkt8), 7}, /* NS */ + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* RA */ + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_161_size = sizeof(tahi_02_161) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_162.c b/test/regression/tahi_test/tahi_02_162.c new file mode 100644 index 00000000..9a5564f8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_162.c @@ -0,0 +1,169 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xcd, 0xed, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x97, 0x93, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_162[] = { + {TITLE, "02-162", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + + {WAIT, NX_NULL, 0, 45}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* Echo request */ + {CHECK, &pkt7[0], sizeof(pkt7), 2}, /* Echo reply */ + {CHECK, &pkt8[0], sizeof(pkt8), 7}, /* NS */ + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* RA */ + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_162_size = sizeof(tahi_02_162) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ + diff --git a/test/regression/tahi_test/tahi_02_163.c b/test/regression/tahi_test/tahi_02_163.c new file mode 100644 index 00000000..a8906665 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_163.c @@ -0,0 +1,235 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xce, 0xa4, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_163[] = { + {TITLE, "02-163", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + {WAIT, NX_NULL, 0, 3}, /* NS */ + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* Echo request */ + {CHECK, &pkt9[0], sizeof(pkt9), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* NA */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* Echo request */ + {CHECK, &pkt12[0], sizeof(pkt12), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 11}, /* NS */ + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_163_size = sizeof(tahi_02_163) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_164.c b/test/regression/tahi_test/tahi_02_164.c new file mode 100644 index 00000000..14482252 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_164.c @@ -0,0 +1,237 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xce, 0xa4, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa0, 0x49, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + +TAHI_TEST_SEQ tahi_02_164[] = { + {TITLE, "02-164", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + {WAIT, NX_NULL, 0, 3}, /* NS */ + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* Echo request */ + {CHECK, &pkt9[0], sizeof(pkt9), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0},/* NA */ + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* Echo request */ + {CHECK, &pkt12[0], sizeof(pkt12), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 11}, /* NS */ + + {INJECT, &pkt16[0], sizeof(pkt16), 0},/* RA */ + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_164_size = sizeof(tahi_02_164) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_165.c b/test/regression/tahi_test/tahi_02_165.c new file mode 100644 index 00000000..44861ad4 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_165.c @@ -0,0 +1,236 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xce, 0xa4, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x80, 0x29, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xc0, 0xc0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_165[] = { + {TITLE, "02-165", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* Echo request */ + {CHECK, &pkt2[0], sizeof(pkt2), 2}, /* NS */ + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* NA */ + {CHECK, &pkt4[0], sizeof(pkt4), 2}, /* Echo reply */ + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + {CHECK, &pkt6[0], sizeof(pkt6), 2}, /* NS */ + {WAIT, NX_NULL, 0, 3}, /* DAD */ + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* Echo request */ + {CHECK, &pkt9[0], sizeof(pkt9), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0},/* NA */ + {INJECT, &pkt11[0], sizeof(pkt11), 0},/* Echo request */ + {CHECK, &pkt12[0], sizeof(pkt12), 2}, /* Echo reply */ + {CHECK, &pkt13[0], sizeof(pkt13), 6}, /* NS */ + + {INJECT, &pkt16[0], sizeof(pkt16), 0},/* RA */ + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_165_size = sizeof(tahi_02_165) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_166.c b/test/regression/tahi_test/tahi_02_166.c new file mode 100644 index 00000000..c2cf88d0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_166.c @@ -0,0 +1,154 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf1, 0xdd, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt2[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x34, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_166[] = { + {TITLE, "02-166", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, /* Echo request */ + {CHECK, &pkt3[0], sizeof(pkt3), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* NA */ + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* Echo request */ + {CHECK, &pkt6[0], sizeof(pkt6), 2}, /* Echo reply */ + {WAIT, NX_NULL, 0, 11}, /* NS */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0},/* RA */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_166_size = sizeof(tahi_02_166) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_167.c b/test/regression/tahi_test/tahi_02_167.c new file mode 100644 index 00000000..0011aa20 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_167.c @@ -0,0 +1,185 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x20, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x60, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd9, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +TAHI_TEST_SEQ tahi_02_167[] = { + {TITLE, "02-167", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo request */ + {CHECK, &pkt5[0], sizeof(pkt5), 2}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 2}, /* Echo reply */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* RA */ + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* Echo request */ + {CHECK, &pkt10[0], sizeof(pkt10), 2}, /* NS */ + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 2}, /* Echo reply */ + + {WAIT, NX_NULL, 0, 14}, + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_167_size = sizeof(tahi_02_167) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_168.c b/test/regression/tahi_test/tahi_02_168.c new file mode 100644 index 00000000..b0b03415 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_168.c @@ -0,0 +1,88 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_02_168[] = { + {TITLE, "02-168", 6, 0}, + + {WAIT, NX_NULL, 0, 14}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_168_size = sizeof(tahi_02_168) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_169.c b/test/regression/tahi_test/tahi_02_169.c new file mode 100644 index 00000000..339c8b86 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_169.c @@ -0,0 +1,516 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9a, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd9, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x5e, 0x6f, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x34, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x64, 0x47, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x89, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe4, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt26[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x64, 0x47, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x89, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe4, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt27[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x64, 0x48, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x8a, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe4, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt28[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x64, 0x48, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x8a, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe4, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt29[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt30[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt31[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_169[] = { + {TITLE, "02-169", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt31[0], sizeof(pkt31), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_169_size = sizeof(tahi_02_169) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_170.c b/test/regression/tahi_test/tahi_02_170.c new file mode 100644 index 00000000..962941d2 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_170.c @@ -0,0 +1,391 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x68, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xfc, 0x94, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1d, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xd9, 0x0b, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x5e, 0x6f, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x34, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x33, 0x75, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_170[] = { + {TITLE, "02-170", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_170_size = sizeof(tahi_02_170) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_171.c b/test/regression/tahi_test/tahi_02_171.c new file mode 100644 index 00000000..236dd96e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_171.c @@ -0,0 +1,318 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xda, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_171[] = { + {TITLE, "02-171", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 11}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_171_size = sizeof(tahi_02_171) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_172.c b/test/regression/tahi_test/tahi_02_172.c new file mode 100644 index 00000000..31d0fad8 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_172.c @@ -0,0 +1,326 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xf9, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_172[] = { + {TITLE, "02-172", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 11}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_172_size = sizeof(tahi_02_172) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_173.c b/test/regression/tahi_test/tahi_02_173.c new file mode 100644 index 00000000..09da3e3e --- /dev/null +++ b/test/regression/tahi_test/tahi_02_173.c @@ -0,0 +1,319 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xc8, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x01, +0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_173[] = { + {TITLE, "02-173", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 11}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_173_size = sizeof(tahi_02_173) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_174.c b/test/regression/tahi_test/tahi_02_174.c new file mode 100644 index 00000000..9cc248d1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_174.c @@ -0,0 +1,318 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xd9, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_174[] = { + {TITLE, "02-174", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 11}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_174_size = sizeof(tahi_02_174) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_175.c b/test/regression/tahi_test/tahi_02_175.c new file mode 100644 index 00000000..f67c01ee --- /dev/null +++ b/test/regression/tahi_test/tahi_02_175.c @@ -0,0 +1,318 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xda, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xd5, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_175[] = { + {TITLE, "02-175", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 11}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_175_size = sizeof(tahi_02_175) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_176.c b/test/regression/tahi_test/tahi_02_176.c new file mode 100644 index 00000000..b80583ed --- /dev/null +++ b/test/regression/tahi_test/tahi_02_176.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x50, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_176[] = { + {TITLE, "02-176", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_176_size = sizeof(tahi_02_176) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_177.c b/test/regression/tahi_test/tahi_02_177.c new file mode 100644 index 00000000..c998c8b3 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_177.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x96, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_177[] = { + {TITLE, "02-177", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_177_size = sizeof(tahi_02_177) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_178.c b/test/regression/tahi_test/tahi_02_178.c new file mode 100644 index 00000000..69473026 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_178.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xda, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_178[] = { + {TITLE, "02-178", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_178_size = sizeof(tahi_02_178) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_179.c b/test/regression/tahi_test/tahi_02_179.c new file mode 100644 index 00000000..d400c2bf --- /dev/null +++ b/test/regression/tahi_test/tahi_02_179.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x01, +0x97, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_179[] = { + {TITLE, "02-179", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_179_size = sizeof(tahi_02_179) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_180.c b/test/regression/tahi_test/tahi_02_180.c new file mode 100644 index 00000000..60a9e1fb --- /dev/null +++ b/test/regression/tahi_test/tahi_02_180.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_180[] = { + {TITLE, "02-180", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_180_size = sizeof(tahi_02_180) / sizeof(TAHI_TEST_SEQ); + + #endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_181.c b/test/regression/tahi_test/tahi_02_181.c new file mode 100644 index 00000000..696029ed --- /dev/null +++ b/test/regression/tahi_test/tahi_02_181.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xdf, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_181[] = { + {TITLE, "02-181", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_181_size = sizeof(tahi_02_181) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_182.c b/test/regression/tahi_test/tahi_02_182.c new file mode 100644 index 00000000..520336ec --- /dev/null +++ b/test/regression/tahi_test/tahi_02_182.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xdf, 0xd5, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_182[] = { + {TITLE, "02-182", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_182_size = sizeof(tahi_02_182) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_183.c b/test/regression/tahi_test/tahi_02_183.c new file mode 100644 index 00000000..e96c711b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_183.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x27, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xda, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_183[] = { + {TITLE, "02-183", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_183_size = sizeof(tahi_02_183) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_184.c b/test/regression/tahi_test/tahi_02_184.c new file mode 100644 index 00000000..6d3eaf78 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_184.c @@ -0,0 +1,275 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x97, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_184[] = { + {TITLE, "02-184", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_184_size = sizeof(tahi_02_184) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_185.c b/test/regression/tahi_test/tahi_02_185.c new file mode 100644 index 00000000..7a39df86 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_185.c @@ -0,0 +1,408 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_185[] = { + {TITLE, "02-185", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_185_size = sizeof(tahi_02_185) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_186.c b/test/regression/tahi_test/tahi_02_186.c new file mode 100644 index 00000000..44a7e408 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_186.c @@ -0,0 +1,416 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x68, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xa2, 0x71, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_186[] = { + {TITLE, "02-186", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_186_size = sizeof(tahi_02_186) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_187.c b/test/regression/tahi_test/tahi_02_187.c new file mode 100644 index 00000000..26163db0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_187.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_187[] = { + {TITLE, "02-187", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_187_size = sizeof(tahi_02_187) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_188.c b/test/regression/tahi_test/tahi_02_188.c new file mode 100644 index 00000000..e12bfe23 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_188.c @@ -0,0 +1,417 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xfe, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_188[] = { + {TITLE, "02-188", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_188_size = sizeof(tahi_02_188) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_189.c b/test/regression/tahi_test/tahi_02_189.c new file mode 100644 index 00000000..68e4d2a7 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_189.c @@ -0,0 +1,410 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xcd, 0xd5, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x01, +0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_189[] = { + {TITLE, "02-189", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_189_size = sizeof(tahi_02_189) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_190.c b/test/regression/tahi_test/tahi_02_190.c new file mode 100644 index 00000000..d0cf7608 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_190.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x14, 0x00, 0x00, 0x00, 0x01, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_190[] = { + {TITLE, "02-190", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_190_size = sizeof(tahi_02_190) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_191.c b/test/regression/tahi_test/tahi_02_191.c new file mode 100644 index 00000000..8e54b9da --- /dev/null +++ b/test/regression/tahi_test/tahi_02_191.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x55, 0x97, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_191[] = { + {TITLE, "02-191", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_191_size = sizeof(tahi_02_191) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_192.c b/test/regression/tahi_test/tahi_02_192.c new file mode 100644 index 00000000..707a168a --- /dev/null +++ b/test/regression/tahi_test/tahi_02_192.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9c, 0x14, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_192[] = { + {TITLE, "02-192", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_192_size = sizeof(tahi_02_192) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_193.c b/test/regression/tahi_test/tahi_02_193.c new file mode 100644 index 00000000..f8575aae --- /dev/null +++ b/test/regression/tahi_test/tahi_02_193.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_193[] = { + {TITLE, "02-193", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_193_size = sizeof(tahi_02_193) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_194.c b/test/regression/tahi_test/tahi_02_194.c new file mode 100644 index 00000000..c256ed28 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_194.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x01, +0x9d, 0x14, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_194[] = { + {TITLE, "02-194", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_194_size = sizeof(tahi_02_194) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_195.c b/test/regression/tahi_test/tahi_02_195.c new file mode 100644 index 00000000..c57e27da --- /dev/null +++ b/test/regression/tahi_test/tahi_02_195.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_195[] = { + {TITLE, "02-195", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_195_size = sizeof(tahi_02_195) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_196.c b/test/regression/tahi_test/tahi_02_196.c new file mode 100644 index 00000000..9abc8ea1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_196.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xe5, 0x10, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_196[] = { + {TITLE, "02-196", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_196_size = sizeof(tahi_02_196) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_197.c b/test/regression/tahi_test/tahi_02_197.c new file mode 100644 index 00000000..a3f5a614 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_197.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x3f, 0x34, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_197[] = { + {TITLE, "02-197", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_197_size = sizeof(tahi_02_197) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_198.c b/test/regression/tahi_test/tahi_02_198.c new file mode 100644 index 00000000..62bfd3c1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_198.c @@ -0,0 +1,541 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x27, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x65, 0x67, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x8e, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe6, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt24[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x65, 0x67, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x8e, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe6, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt25[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x65, 0x68, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x8f, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe6, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt26[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x65, 0x68, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x8f, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe6, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt28[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt29[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt30[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt31[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt32[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt33[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_198[] = { + {TITLE, "02-198", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + {CHECK, &pkt29[0], sizeof(pkt29), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt33[0], sizeof(pkt33), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_198_size = sizeof(tahi_02_198) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_199.c b/test/regression/tahi_test/tahi_02_199.c new file mode 100644 index 00000000..544127c4 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_199.c @@ -0,0 +1,409 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x16, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x00, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_199[] = { + {TITLE, "02-199", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_199_size = sizeof(tahi_02_199) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_200.c b/test/regression/tahi_test/tahi_02_200.c new file mode 100644 index 00000000..94b16377 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_200.c @@ -0,0 +1,582 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd9, 0x50, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa2, 0xa2, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa2, 0xa2, 0x87, 0x00, +0x68, 0x23, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x48, 0x9e, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa2, 0xa2 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd8, 0x50, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9a, 0x12, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa2, 0xa2 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt24[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe1, 0xa7, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt25[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd9, 0x50, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd8, 0x50, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x87, 0x00, +0x66, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x87, 0x00, +0x66, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt29[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x87, 0x00, +0x66, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt30[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt31[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt32[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt33[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt34[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt35[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt36[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt37[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt38[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt39[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt40[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt41[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt42[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_200[] = { + {TITLE, "02-200", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {CHECK, &pkt26[0], sizeof(pkt26), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt30[0], sizeof(pkt30), 0}, + {INJECT, &pkt31[0], sizeof(pkt31), 0}, + {CHECK, &pkt32[0], sizeof(pkt32), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt36[0], sizeof(pkt36), 0}, + {INJECT, &pkt37[0], sizeof(pkt37), 0}, + {CHECK, &pkt38[0], sizeof(pkt38), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt42[0], sizeof(pkt42), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_200_size = sizeof(tahi_02_200) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_201.c b/test/regression/tahi_test/tahi_02_201.c new file mode 100644 index 00000000..7931ff7c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_201.c @@ -0,0 +1,410 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x92, 0x30, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_201[] = { + {TITLE, "02-201", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_201_size = sizeof(tahi_02_201) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_202.c b/test/regression/tahi_test/tahi_02_202.c new file mode 100644 index 00000000..9fef3418 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_202.c @@ -0,0 +1,413 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x50, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x4b, 0x81, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_202[] = { + {TITLE, "02-202", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_202_size = sizeof(tahi_02_202) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_203.c b/test/regression/tahi_test/tahi_02_203.c new file mode 100644 index 00000000..afcc9271 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_203.c @@ -0,0 +1,410 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xfb, 0x6b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_203[] = { + {TITLE, "02-203", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_203_size = sizeof(tahi_02_203) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_204.c b/test/regression/tahi_test/tahi_02_204.c new file mode 100644 index 00000000..52cb92ae --- /dev/null +++ b/test/regression/tahi_test/tahi_02_204.c @@ -0,0 +1,385 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_204[] = { + {TITLE, "02-204", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 2}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_204_size = sizeof(tahi_02_204) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_205.c b/test/regression/tahi_test/tahi_02_205.c new file mode 100644 index 00000000..f27281bf --- /dev/null +++ b/test/regression/tahi_test/tahi_02_205.c @@ -0,0 +1,307 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_205[] = { + {TITLE, "02-205", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_205_size = sizeof(tahi_02_205) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_206.c b/test/regression/tahi_test/tahi_02_206.c new file mode 100644 index 00000000..3d2f8dae --- /dev/null +++ b/test/regression/tahi_test/tahi_02_206.c @@ -0,0 +1,320 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_206[] = { + {TITLE, "02-206", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {CHECK, &pkt13[0], sizeof(pkt13), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_206_size = sizeof(tahi_02_206) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_207.c b/test/regression/tahi_test/tahi_02_207.c new file mode 100644 index 00000000..8b7df889 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_207.c @@ -0,0 +1,328 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xfe, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_207[] = { + {TITLE, "02-207", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {CHECK, &pkt13[0], sizeof(pkt13), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_207_size = sizeof(tahi_02_207) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_208.c b/test/regression/tahi_test/tahi_02_208.c new file mode 100644 index 00000000..f093452a --- /dev/null +++ b/test/regression/tahi_test/tahi_02_208.c @@ -0,0 +1,496 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb0, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xf8, 0xde, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x04, 0xb0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x21, 0x2b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_208[] = { + {TITLE, "02-208", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {CHECK, &pkt13[0], sizeof(pkt13), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_208_size = sizeof(tahi_02_208) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_209.c b/test/regression/tahi_test/tahi_02_209.c new file mode 100644 index 00000000..218894a0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_209.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_209[] = { + {TITLE, "02-209", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_209_size = sizeof(tahi_02_209) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_210.c b/test/regression/tahi_test/tahi_02_210.c new file mode 100644 index 00000000..5308c9bc --- /dev/null +++ b/test/regression/tahi_test/tahi_02_210.c @@ -0,0 +1,334 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_210[] = { + {TITLE, "02-210", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {CHECK, &pkt14[0], sizeof(pkt14), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_210_size = sizeof(tahi_02_210) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_211.c b/test/regression/tahi_test/tahi_02_211.c new file mode 100644 index 00000000..4f74e4db --- /dev/null +++ b/test/regression/tahi_test/tahi_02_211.c @@ -0,0 +1,342 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xfe, 0xc6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_211[] = { + {TITLE, "02-211", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {CHECK, &pkt14[0], sizeof(pkt14), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_211_size = sizeof(tahi_02_211) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_212.c b/test/regression/tahi_test/tahi_02_212.c new file mode 100644 index 00000000..88201a1c --- /dev/null +++ b/test/regression/tahi_test/tahi_02_212.c @@ -0,0 +1,510 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb0, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xf8, 0xde, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x04, 0xb0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_212[] = { + {TITLE, "02-212", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {CHECK, &pkt14[0], sizeof(pkt14), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_212_size = sizeof(tahi_02_212) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_213.c b/test/regression/tahi_test/tahi_02_213.c new file mode 100644 index 00000000..55f90d2f --- /dev/null +++ b/test/regression/tahi_test/tahi_02_213.c @@ -0,0 +1,410 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_213[] = { + {TITLE, "02-213", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {N_CHECK, (char *)NS, 0, 7}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_213_size = sizeof(tahi_02_213) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_214.c b/test/regression/tahi_test/tahi_02_214.c new file mode 100644 index 00000000..3c6f2389 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_214.c @@ -0,0 +1,411 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe3, 0xa9, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_214[] = { + {TITLE, "02-214", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {N_CHECK, (char *)NS, 0, 7}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_214_size = sizeof(tahi_02_214) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_215.c b/test/regression/tahi_test/tahi_02_215.c new file mode 100644 index 00000000..866688ab --- /dev/null +++ b/test/regression/tahi_test/tahi_02_215.c @@ -0,0 +1,372 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x7d, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_215[] = { + {TITLE, "02-215", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_215_size = sizeof(tahi_02_215) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_216.c b/test/regression/tahi_test/tahi_02_216.c new file mode 100644 index 00000000..d9a99caa --- /dev/null +++ b/test/regression/tahi_test/tahi_02_216.c @@ -0,0 +1,380 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xdf, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_216[] = { + {TITLE, "02-216", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_216_size = sizeof(tahi_02_216) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_217.c b/test/regression/tahi_test/tahi_02_217.c new file mode 100644 index 00000000..38936b60 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_217.c @@ -0,0 +1,548 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb0, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xd9, 0xbf, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x04, 0xb0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_217[] = { + {TITLE, "02-217", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_217_size = sizeof(tahi_02_217) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_218.c b/test/regression/tahi_test/tahi_02_218.c new file mode 100644 index 00000000..9a1d4830 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_218.c @@ -0,0 +1,403 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_218[] = { + {TITLE, "02-218", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt20[0], sizeof(pkt20), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_218_size = sizeof(tahi_02_218) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_219.c b/test/regression/tahi_test/tahi_02_219.c new file mode 100644 index 00000000..7bbe2304 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_219.c @@ -0,0 +1,404 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_219[] = { + {TITLE, "02-219", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt20[0], sizeof(pkt20), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_219_size = sizeof(tahi_02_219) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_220.c b/test/regression/tahi_test/tahi_02_220.c new file mode 100644 index 00000000..a5cae6c2 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_220.c @@ -0,0 +1,539 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt12[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x66, 0x72, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x93, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe8, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt13[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x66, 0x72, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x93, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe8, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt14[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x66, 0x73, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x94, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe8, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt15[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x66, 0x73, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x94, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe8, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x7d, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt27[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt28[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt29[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt30[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt31[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt32[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_220[] = { + {TITLE, "02-220", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {CHECK, &pkt24[0], sizeof(pkt24), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + {CHECK, &pkt29[0], sizeof(pkt29), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt32[0], sizeof(pkt32), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_220_size = sizeof(tahi_02_220) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_221.c b/test/regression/tahi_test/tahi_02_221.c new file mode 100644 index 00000000..9616d2e1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_221.c @@ -0,0 +1,412 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xdf, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_221[] = { + {TITLE, "02-221", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt20[0], sizeof(pkt20), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_221_size = sizeof(tahi_02_221) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_222.c b/test/regression/tahi_test/tahi_02_222.c new file mode 100644 index 00000000..c31ed56d --- /dev/null +++ b/test/regression/tahi_test/tahi_02_222.c @@ -0,0 +1,580 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb0, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xd9, 0xbf, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x04, 0xb0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_222[] = { + {TITLE, "02-222", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 2}, + {CHECK, &pkt20[0], sizeof(pkt20), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_222_size = sizeof(tahi_02_222) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_223.c b/test/regression/tahi_test/tahi_02_223.c new file mode 100644 index 00000000..c14502b1 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_223.c @@ -0,0 +1,407 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_223[] = { + {TITLE, "02-223", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt16[0], sizeof(pkt16), 7}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_223_size = sizeof(tahi_02_223) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_224.c b/test/regression/tahi_test/tahi_02_224.c new file mode 100644 index 00000000..3e0fd563 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_224.c @@ -0,0 +1,408 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt25[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt28[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_224[] = { + {TITLE, "02-224", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt16[0], sizeof(pkt16), 7}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 2}, + {WAIT, NX_NULL, 0, 5}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_224_size = sizeof(tahi_02_224) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_225.c b/test/regression/tahi_test/tahi_02_225.c new file mode 100644 index 00000000..db68dee0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_225.c @@ -0,0 +1,446 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x7d, 0xf6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0 }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt27[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt28[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt29[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt30[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt31[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_225[] = { + {TITLE, "02-225", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 7}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {CHECK, &pkt23[0], sizeof(pkt23), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt31[0], sizeof(pkt31), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_225_size = sizeof(tahi_02_225) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_226.c b/test/regression/tahi_test/tahi_02_226.c new file mode 100644 index 00000000..c89d97b7 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_226.c @@ -0,0 +1,454 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x70, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xdf, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x04, 0x08, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt27[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt28[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt29[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt30[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt31[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_226[] = { + {TITLE, "02-226", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 7}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {CHECK, &pkt23[0], sizeof(pkt23), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt31[0], sizeof(pkt31), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_226_size = sizeof(tahi_02_226) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_227.c b/test/regression/tahi_test/tahi_02_227.c new file mode 100644 index 00000000..16c3bf7b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_227.c @@ -0,0 +1,622 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb0, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xd9, 0xbf, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x04, 0xb0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, +0xd9, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x68, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt27[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt28[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt29[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt30[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt31[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_227[] = { + {TITLE, "02-227", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 2}, + {WAIT, NX_NULL, 0, 45}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 2}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 2}, + {CHECK, &pkt17[0], sizeof(pkt17), 7}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 3}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 2}, + {CHECK, &pkt23[0], sizeof(pkt23), 7}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 2}, + {WAIT, NX_NULL, 0, 6}, + + {INJECT, &pkt31[0], sizeof(pkt31), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_227_size = sizeof(tahi_02_227) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_228.c b/test/regression/tahi_test/tahi_02_228.c new file mode 100644 index 00000000..59e16481 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_228.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x55, 0x97, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_228[] = { + {TITLE, "02-228", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_228_size = sizeof(tahi_02_228) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_229.c b/test/regression/tahi_test/tahi_02_229.c new file mode 100644 index 00000000..1cb86746 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_229.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9c, 0x14, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_229[] = { + {TITLE, "02-229", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_229_size = sizeof(tahi_02_229) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_230.c b/test/regression/tahi_test/tahi_02_230.c new file mode 100644 index 00000000..a1e04f3b --- /dev/null +++ b/test/regression/tahi_test/tahi_02_230.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_230[] = { + {TITLE, "02-230", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_230_size = sizeof(tahi_02_230) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_231.c b/test/regression/tahi_test/tahi_02_231.c new file mode 100644 index 00000000..72170205 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_231.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x01, +0x9d, 0x14, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_231[] = { + {TITLE, "02-231", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_231_size = sizeof(tahi_02_231) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_232.c b/test/regression/tahi_test/tahi_02_232.c new file mode 100644 index 00000000..74194179 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_232.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_232[] = { + {TITLE, "02-232", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_232_size = sizeof(tahi_02_232) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_233.c b/test/regression/tahi_test/tahi_02_233.c new file mode 100644 index 00000000..7418e730 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_233.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0xe5, 0x10, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_233[] = { + {TITLE, "02-233", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_233_size = sizeof(tahi_02_233) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_234.c b/test/regression/tahi_test/tahi_02_234.c new file mode 100644 index 00000000..a71c7ee5 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_234.c @@ -0,0 +1,440 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x3f, 0x34, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x70, 0x93, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x99, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe9, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt22[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x70, 0x93, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x99, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xe9, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt23[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x70, 0x94, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x9a, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe9, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt24[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x70, 0x94, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x73, 0x9a, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xe9, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt25[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_234[] = { + {TITLE, "02-234", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_234_size = sizeof(tahi_02_234) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_235.c b/test/regression/tahi_test/tahi_02_235.c new file mode 100644 index 00000000..4ee581a0 --- /dev/null +++ b/test/regression/tahi_test/tahi_02_235.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x27, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x15, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_235[] = { + {TITLE, "02-235", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_235_size = sizeof(tahi_02_235) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_02_236.c b/test/regression/tahi_test/tahi_02_236.c new file mode 100644 index 00000000..cfa009ea --- /dev/null +++ b/test/regression/tahi_test/tahi_02_236.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x41, 0xf3, 0x40, 0x00, 0x07, 0x08, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6c, 0x27, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x4e, 0xa4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xec, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0xa0, 0xa0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xeb, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x89, 0x00, +0x9d, 0x16, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x00, +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xda, 0x51, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt13[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, +0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe5, 0xab, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xb0, 0xb0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xdb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x81, 0x00, +0xda, 0x52, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + +#if 0 +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0xb0, 0xb0, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x87, 0x00, +0x6a, 0xab, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0xa0, 0xa0, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa0, 0xa0, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x10, 0xac, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +TAHI_TEST_SEQ tahi_02_236[] = { + {TITLE, "02-236", 6, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 2}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 2}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 2}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 2}, + {WAIT, NX_NULL, 0, 4}, + {DUMP, NX_NULL, 0, 0}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 2}, + {WAIT, NX_NULL, 0, 11}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_02_236_size = sizeof(tahi_02_236) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_001.c b/test/regression/tahi_test/tahi_03_001.c new file mode 100644 index 00000000..c57973f3 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_001.c @@ -0,0 +1,94 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x16, +0x17, 0xc9, 0x6b, 0x1a, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x23, 0xcf, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_001[] = { + {TITLE, "03-001", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_001_size = sizeof(tahi_03_001) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_002.c b/test/regression/tahi_test/tahi_03_002.c new file mode 100644 index 00000000..4b86ffab --- /dev/null +++ b/test/regression/tahi_test/tahi_03_002.c @@ -0,0 +1,161 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x35, 0x9e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_002[] = { + {TITLE, "03-002", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_002_size = sizeof(tahi_03_002) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_003.c b/test/regression/tahi_test/tahi_03_003.c new file mode 100644 index 00000000..40543bb7 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_003.c @@ -0,0 +1,136 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + + +TAHI_TEST_SEQ tahi_03_003[] = { + {TITLE, "03-003", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {N_CHECK, (char *)RS, 0, 13}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_003_size = sizeof(tahi_03_003) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_004.c b/test/regression/tahi_test/tahi_03_004.c new file mode 100644 index 00000000..a98e8b4e --- /dev/null +++ b/test/regression/tahi_test/tahi_03_004.c @@ -0,0 +1,139 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x54, 0x9e, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_004[] = { + {TITLE, "03-004", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_004_size = sizeof(tahi_03_004) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_005.c b/test/regression/tahi_test/tahi_03_005.c new file mode 100644 index 00000000..d0cfa17b --- /dev/null +++ b/test/regression/tahi_test/tahi_03_005.c @@ -0,0 +1,136 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x8c, 0x72, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_005[] = { + {TITLE, "03-005", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {N_CHECK, (char *)RS, 0, 13}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_005_size = sizeof(tahi_03_005) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_006.c b/test/regression/tahi_test/tahi_03_006.c new file mode 100644 index 00000000..6e161d6b --- /dev/null +++ b/test/regression/tahi_test/tahi_03_006.c @@ -0,0 +1,138 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_006[] = { + {TITLE, "03-006", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_006_size = sizeof(tahi_03_006) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_007.c b/test/regression/tahi_test/tahi_03_007.c new file mode 100644 index 00000000..fbbb3d9e --- /dev/null +++ b/test/regression/tahi_test/tahi_03_007.c @@ -0,0 +1,201 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xfe, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_007[] = { + {TITLE, "03-007", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_007_size = sizeof(tahi_03_007) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_008.c b/test/regression/tahi_test/tahi_03_008.c new file mode 100644 index 00000000..6e55a569 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_008.c @@ -0,0 +1,201 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xac, 0x76, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_008[] = { + {TITLE, "03-008", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_008_size = sizeof(tahi_03_008) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_009.c b/test/regression/tahi_test/tahi_03_009.c new file mode 100644 index 00000000..b7951c26 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_009.c @@ -0,0 +1,201 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0x13, 0x8e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_009[] = { + {TITLE, "03-009", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_009_size = sizeof(tahi_03_009) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_010.c b/test/regression/tahi_test/tahi_03_010.c new file mode 100644 index 00000000..ee822db6 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_010.c @@ -0,0 +1,164 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x01, +0xd0, 0x02, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_010[] = { + {TITLE, "03-010", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_010_size = sizeof(tahi_03_010) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_011.c b/test/regression/tahi_test/tahi_03_011.c new file mode 100644 index 00000000..8ea36dd4 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_011.c @@ -0,0 +1,164 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_011[] = { + {TITLE, "03-011", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_011_size = sizeof(tahi_03_011) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_012.c b/test/regression/tahi_test/tahi_03_012.c new file mode 100644 index 00000000..73a0cd7e --- /dev/null +++ b/test/regression/tahi_test/tahi_03_012.c @@ -0,0 +1,201 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xf3, 0x90, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_012[] = { + {TITLE, "03-012", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 120}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_012_size = sizeof(tahi_03_012) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_013.c b/test/regression/tahi_test/tahi_03_013.c new file mode 100644 index 00000000..e493af55 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_013.c @@ -0,0 +1,202 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_013[] = { + {TITLE, "03-013", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_013_size = sizeof(tahi_03_013) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_014.c b/test/regression/tahi_test/tahi_03_014.c new file mode 100644 index 00000000..99c702d8 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_014.c @@ -0,0 +1,173 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_014[] = { + {TITLE, "03-014", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {N_CHECK, (char *)RS, 0, 13}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_014_size = sizeof(tahi_03_014) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_015.c b/test/regression/tahi_test/tahi_03_015.c new file mode 100644 index 00000000..382bed85 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_015.c @@ -0,0 +1,111 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcc, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_015[] = { + {TITLE, "03-015", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {N_CHECK, (char *)RS, 0, 13}, + + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_015_size = sizeof(tahi_03_015) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_03_016.c b/test/regression/tahi_test/tahi_03_016.c new file mode 100644 index 00000000..7f26c43f --- /dev/null +++ b/test/regression/tahi_test/tahi_03_016.c @@ -0,0 +1,139 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xef, 0x03, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_016[] = { + {TITLE, "03-016", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_016_size = sizeof(tahi_03_016) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_017.c b/test/regression/tahi_test/tahi_03_017.c new file mode 100644 index 00000000..3ecbab93 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_017.c @@ -0,0 +1,165 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xef, 0x03, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_017[] = { + {TITLE, "03-017", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_017_size = sizeof(tahi_03_017) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_018.c b/test/regression/tahi_test/tahi_03_018.c new file mode 100644 index 00000000..08481760 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_018.c @@ -0,0 +1,202 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x01, +0xef, 0x02, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_018[] = { + {TITLE, "03-018", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_018_size = sizeof(tahi_03_018) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_019.c b/test/regression/tahi_test/tahi_03_019.c new file mode 100644 index 00000000..c32cd346 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_019.c @@ -0,0 +1,202 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xff, 0xff, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_019[] = { + {TITLE, "03-019", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_019_size = sizeof(tahi_03_019) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_020.c b/test/regression/tahi_test/tahi_03_020.c new file mode 100644 index 00000000..3404718d --- /dev/null +++ b/test/regression/tahi_test/tahi_03_020.c @@ -0,0 +1,284 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x87, 0xd0, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x6a, 0x09, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x6f, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt3[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x87, 0xd0, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x6a, 0x09, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x6f, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x00 }; + +static char pkt4[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x87, 0xd1, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x6a, 0x0a, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x6f, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; + +static char pkt5[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0xc9, 0xa1, 0xaf, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe7, 0x87, 0xd1, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, +0x00, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd3, +0x15, 0xe4, 0x11, 0x0a, 0x6a, 0x0a, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbd, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x23, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x23, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x34, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x6f, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x00 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xaf, 0x03, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_020[] = { + {TITLE, "03-020", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_020_size = sizeof(tahi_03_020) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_021.c b/test/regression/tahi_test/tahi_03_021.c new file mode 100644 index 00000000..d1707d13 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_021.c @@ -0,0 +1,152 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x12, 0x91, 0x20, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_021[] = { + {TITLE, "03-021", 6, 0}, + + {CHECK, &pkt2[0], sizeof(pkt2), 130}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_021_size = sizeof(tahi_03_021) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_022.c b/test/regression/tahi_test/tahi_03_022.c new file mode 100644 index 00000000..a940752b --- /dev/null +++ b/test/regression/tahi_test/tahi_03_022.c @@ -0,0 +1,202 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xef, 0x04, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_022[] = { + {TITLE, "03-022", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_022_size = sizeof(tahi_03_022) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_023.c b/test/regression/tahi_test/tahi_03_023.c new file mode 100644 index 00000000..ac1bad27 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_023.c @@ -0,0 +1,174 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xcf, 0x04, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_023[] = { + {TITLE, "03-023", 6, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 130}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {N_CHECK, (char *)RS, 0, 13}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_023_size = sizeof(tahi_03_023) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_024.c b/test/regression/tahi_test/tahi_03_024.c new file mode 100644 index 00000000..a79f4c08 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_024.c @@ -0,0 +1,111 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xf0, 0x03, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_024[] = { + {TITLE, "03-024", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {N_CHECK, (char *)RS, 0, 13}, + + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_024_size = sizeof(tahi_03_024) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_03_025.c b/test/regression/tahi_test/tahi_03_025.c new file mode 100644 index 00000000..7145da57 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_025.c @@ -0,0 +1,165 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_025[] = { + {TITLE, "03-025", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {INJECT, &pkt2[0], sizeof(pkt2), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_025_size = sizeof(tahi_03_025) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_026.c b/test/regression/tahi_test/tahi_03_026.c new file mode 100644 index 00000000..1e8a8012 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_026.c @@ -0,0 +1,202 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcd, 0x79, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0xe2, 0x51, 0x60, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_026[] = { + {TITLE, "03-026", 6, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 130}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_026_size = sizeof(tahi_03_026) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_027.c b/test/regression/tahi_test/tahi_03_027.c new file mode 100644 index 00000000..265db57c --- /dev/null +++ b/test/regression/tahi_test/tahi_03_027.c @@ -0,0 +1,167 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xd2, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_027[] = { + {TITLE, "03-027", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_027_size = sizeof(tahi_03_027) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_028.c b/test/regression/tahi_test/tahi_03_028.c new file mode 100644 index 00000000..99c346c8 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_028.c @@ -0,0 +1,141 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf3, 0xd6, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x4e, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x4e, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x4e, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x20, 0xd0, 0x20, 0x00, 0x00, 0x00, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_028[] = { + {TITLE, "03-028", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_028_size = sizeof(tahi_03_028) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_029.c b/test/regression/tahi_test/tahi_03_029.c new file mode 100644 index 00000000..c2b65974 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_029.c @@ -0,0 +1,141 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x75, 0x16, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcf, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcf, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcf, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x23, 0x4f, 0x20, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_029[] = { + {TITLE, "03-029", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_029_size = sizeof(tahi_03_029) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_030.c b/test/regression/tahi_test/tahi_03_030.c new file mode 100644 index 00000000..799e74f2 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_030.c @@ -0,0 +1,185 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xd2, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xd2, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_030[] = { + {TITLE, "03-030", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {WAIT, NX_NULL, 0, 30}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_030_size = sizeof(tahi_03_030) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_031.c b/test/regression/tahi_test/tahi_03_031.c new file mode 100644 index 00000000..c7621bb9 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_031.c @@ -0,0 +1,316 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xf6, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xe6, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, +0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x84, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x84, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x53, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt18[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt19[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x53, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_031[] = { + {TITLE, "03-031", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 5}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 15}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_031_size = sizeof(tahi_03_031) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_032.c b/test/regression/tahi_test/tahi_03_032.c new file mode 100644 index 00000000..e30ec7ce --- /dev/null +++ b/test/regression/tahi_test/tahi_03_032.c @@ -0,0 +1,342 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x58, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa3, 0xd5, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x84, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x84, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x53, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt17[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt18[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x53, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6d, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x01, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_032[] = { + {TITLE, "03-032", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 5}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {WAIT, NX_NULL, 0, 16}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {N_CHECK, (char *)NA, 0, 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 14}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_032_size = sizeof(tahi_03_032) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_033.c b/test/regression/tahi_test/tahi_03_033.c new file mode 100644 index 00000000..de886c0e --- /dev/null +++ b/test/regression/tahi_test/tahi_03_033.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2e, 0x2c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0x80, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_033[] = { + {TITLE, "03-033", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_033_size = sizeof(tahi_03_033) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_034.c b/test/regression/tahi_test/tahi_03_034.c new file mode 100644 index 00000000..b860071f --- /dev/null +++ b/test/regression/tahi_test/tahi_03_034.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x75, 0x6a, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_034[] = { + {TITLE, "03-034", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_034_size = sizeof(tahi_03_034) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_035.c b/test/regression/tahi_test/tahi_03_035.c new file mode 100644 index 00000000..00c621d4 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_035.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xe2, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_035[] = { + {TITLE, "03-035", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_035_size = sizeof(tahi_03_035) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_036.c b/test/regression/tahi_test/tahi_03_036.c new file mode 100644 index 00000000..ec56b95c --- /dev/null +++ b/test/regression/tahi_test/tahi_03_036.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xed, 0xeb, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x80, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_036[] = { + {TITLE, "03-036", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_036_size = sizeof(tahi_03_036) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_037.c b/test/regression/tahi_test/tahi_03_037.c new file mode 100644 index 00000000..d883f83f --- /dev/null +++ b/test/regression/tahi_test/tahi_03_037.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x6d, 0xec, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x00, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_037[] = { + {TITLE, "03-037", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_037_size = sizeof(tahi_03_037) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_038.c b/test/regression/tahi_test/tahi_03_038.c new file mode 100644 index 00000000..6edfcd14 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_038.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf5, 0xeb, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x78, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_038[] = { + {TITLE, "03-038", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_038_size = sizeof(tahi_03_038) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_039.c b/test/regression/tahi_test/tahi_03_039.c new file mode 100644 index 00000000..965918f9 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_039.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2e, 0x14, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_039[] = { + {TITLE, "03-039", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_039_size = sizeof(tahi_03_039) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_040.c b/test/regression/tahi_test/tahi_03_040.c new file mode 100644 index 00000000..a81b5ff2 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_040.c @@ -0,0 +1,115 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xec, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_040[] = { + {TITLE, "03-040", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_040_size = sizeof(tahi_03_040) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_041.c b/test/regression/tahi_test/tahi_03_041.c new file mode 100644 index 00000000..27a579e6 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_041.c @@ -0,0 +1,141 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2e, 0x00, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt9[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x94, 0xd2, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_041[] = { + {TITLE, "03-041", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_041_size = sizeof(tahi_03_041) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_042.c b/test/regression/tahi_test/tahi_03_042.c new file mode 100644 index 00000000..521c8260 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_042.c @@ -0,0 +1,421 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, +0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt10[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xba, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, +0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt23[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt26[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt27[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt28[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_042[] = { + {TITLE, "03-042", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 8}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 41}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_042_size = sizeof(tahi_03_042) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_043.c b/test/regression/tahi_test/tahi_03_043.c new file mode 100644 index 00000000..c80ed526 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_043.c @@ -0,0 +1,248 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xd9, 0xb3, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x2a, 0x30, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf5, 0x97, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x1c, 0x3e, 0x00, 0x00, +0x1c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_043[] = { + {TITLE, "03-043", 6, 0}, + + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 7204}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_043_size = sizeof(tahi_03_043) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_044.c b/test/regression/tahi_test/tahi_03_044.c new file mode 100644 index 00000000..83f565af --- /dev/null +++ b/test/regression/tahi_test/tahi_03_044.c @@ -0,0 +1,329 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0x9c, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, +0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2d, 0xd8, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, +0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt12[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt14[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt19[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_03_044[] = { + {TITLE, "03-044", 6, 0}, + {CHECK, &pkt1[0], sizeof(pkt1), 130}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 18}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 4}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_044_size = sizeof(tahi_03_044) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_03_045.c b/test/regression/tahi_test/tahi_03_045.c new file mode 100644 index 00000000..5d315ed9 --- /dev/null +++ b/test/regression/tahi_test/tahi_03_045.c @@ -0,0 +1,346 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt4[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xf5, 0x97, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x1c, 0x3e, 0x00, 0x00, +0x1c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt8[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt9[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x2e, 0x00, 0x40, 0x00, 0x07, 0x0d, 0x00, 0x00, +0x75, 0x35, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, +0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt14[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt15[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt16[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt19[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x88, 0x00, +0x53, 0x55, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0x62, 0x6e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt23[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x85, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +TAHI_TEST_SEQ tahi_03_045[] = { + {TITLE, "03-045", 6, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 130}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {WAIT, NX_NULL, 0, 2}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 7203}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {N_CHECK, (char *)NA, 0, 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_03_045_size = sizeof(tahi_03_045) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_002.c b/test/regression/tahi_test/tahi_04_002.c new file mode 100644 index 00000000..32fb14c4 --- /dev/null +++ b/test/regression/tahi_test/tahi_04_002.c @@ -0,0 +1,195 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xa8, 0x26, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, +0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xa7, 0x26, 0xff, 0xff, 0x00, 0x01, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, +0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 }; + +TAHI_TEST_SEQ tahi_04_002[] = { + {TITLE, "04-002", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_002_size = sizeof(tahi_04_002) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_003.c b/test/regression/tahi_test/tahi_04_003.c new file mode 100644 index 00000000..974879d8 --- /dev/null +++ b/test/regression/tahi_test/tahi_04_003.c @@ -0,0 +1,499 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd4, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +TAHI_TEST_SEQ tahi_04_003[] = { + {TITLE, "04-003", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_003_size = sizeof(tahi_04_003) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_004.c b/test/regression/tahi_test/tahi_04_004.c new file mode 100644 index 00000000..00b8233a --- /dev/null +++ b/test/regression/tahi_test/tahi_04_004.c @@ -0,0 +1,555 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +TAHI_TEST_SEQ tahi_04_004[] = { + {TITLE, "04-004", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_004_size = sizeof(tahi_04_004) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_005.c b/test/regression/tahi_test/tahi_04_005.c new file mode 100644 index 00000000..e617e6d8 --- /dev/null +++ b/test/regression/tahi_test/tahi_04_005.c @@ -0,0 +1,4970 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" +/* Frame (70 bytes) */ +static const unsigned char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (118 bytes) */ +static const unsigned char pkt5[118] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, /* ...@:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x9b, 0x8d, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, /* ........ */ +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* u0...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, /* @..'.... */ +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* :.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* W.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt12[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xd9, 0x66, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* .f...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt13[86] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt14[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xf5, 0x26, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .&`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt15[70] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0xd8, 0x66, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* .f...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt16[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x75, 0x67, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ug...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt17[1514] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0x74, 0x67, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* tg...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt18[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* td...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt19[1514] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, /* ........ */ +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sd...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt20[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x73, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt21[1514] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x81, 0x00, /* ........ */ +0x72, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* rb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1294 bytes) */ +static const unsigned char pkt22[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, /* "..3DV.. */ +0xd2, 0x44, 0x00, 0x00, 0x05, 0x78, 0x60, 0x00, /* .D...x`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, /* ........ */ +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sd...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt23[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x75, 0x67, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ug...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt24[1514] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0x74, 0x67, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* tg...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt25[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* td...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1414 bytes) */ +static const unsigned char pkt26[1414] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0x50, 0x2c, 0xff, 0x3f, 0xfe, /* ...P,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sd...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (170 bytes) */ +static const unsigned char pkt27[170] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x74, 0x2c, 0xff, 0x3f, 0xfe, /* ...t,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x05, 0x48, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* .H...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Reassembled IPv6 (1460 bytes) */ +static const unsigned char pkt27_1[1460] = { +0x81, 0x00, 0x73, 0x64, 0xff, 0xff, 0x00, 0x01, /* ..sd.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01 /* .... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt28[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x73, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt29[1514] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x81, 0x00, /* ........ */ +0x72, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* rb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt30[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt31[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (1294 bytes) */ +static const unsigned char pkt32[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, /* "..3DV.. */ +0xd2, 0xbc, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x81, 0x00, /* ........ */ +0x72, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* rb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt33[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x75, 0x67, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ug...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt34[1514] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0x74, 0x67, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* tg...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt35[86] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0x92, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt36[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0xf5, 0x26, 0x60, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .&`...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt37[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* td...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1414 bytes) */ +static const unsigned char pkt38[1414] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0x50, 0x2c, 0xff, 0x3f, 0xfe, /* ...P,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, /* ........ */ +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sd...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (170 bytes) */ +static const unsigned char pkt39[170] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x74, 0x2c, 0xff, 0x3f, 0xfe, /* ...t,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x05, 0x48, 0x00, 0x00, 0x00, 0x02, 0x01, 0x01, /* .H...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Reassembled IPv6 (1460 bytes) */ +static const unsigned char pkt39_1[1460] = { +0x81, 0x00, 0x73, 0x64, 0xff, 0xff, 0x00, 0x01, /* ..sd.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01 /* .... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt40[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt41[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (1514 bytes) */ +static const unsigned char pkt42[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x73, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* sb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (1294 bytes) */ +static const unsigned char pkt43[1294] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x81, 0x00, /* ........ */ +0x72, 0x62, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* rb...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (290 bytes) */ +static const unsigned char pkt44[290] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x03, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa3, 0xa3, 0x3a, 0x00, /* ......:. */ +0x04, 0xd0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Reassembled IPv6 (1460 bytes) */ +static const unsigned char pkt44_1[1460] = { +0x81, 0x00, 0x72, 0x62, 0xff, 0xff, 0x00, 0x01, /* ..rb.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01 /* .... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt45[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xd3, 0x71, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .q....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt46[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xfc, 0xc4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt47[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xd9, 0x66, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* .f...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt48[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0xd8, 0x66, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* .f...... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt49[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0x92, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt50[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0x92, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt51[86] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0x92, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt52[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt53[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt54[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt55[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + +TAHI_TEST_SEQ tahi_04_005[] = { + {TITLE, "04-005", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, //step10 + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, //step 20 + {WAIT, NX_NULL, 0, 7}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {N_CHECK, (char *)NS, 0, 6}, //19:03:42 vRecv(Link0,ucast_ns_tn1_from_global ucast_ns_tn1_from_linklocal ucast_ns_tn1_from_linklocal_sll ucast_ns_tn1_from_global_sll) timeout:6 + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {N_CHECK, (char *)NS, 0, 6}, //19:03:48 + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, //step 30 + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + {N_CHECK, (char *)NS, 0, 7}, //19:03:55 + + + {INJECT, &pkt28[0], sizeof(pkt28), 0}, + {CHECK, &pkt29[0], sizeof(pkt29), 5}, + + {CHECK, &pkt30[0], sizeof(pkt30), 10}, + {INJECT, &pkt31[0], sizeof(pkt31), 0}, + {N_CHECK, (char *)NS, 0, 7}, //19:04:08 + + {INJECT, &pkt32[0], sizeof(pkt32), 0}, + {INJECT, &pkt33[0], sizeof(pkt33), 0}, + {CHECK, &pkt34[0], sizeof(pkt34), 5}, //STEP 40 + + {CHECK, &pkt35[0], sizeof(pkt35), 10}, + {INJECT, &pkt36[0], sizeof(pkt36), 0}, + {N_CHECK, (char *)NS, 0, 6}, //19:04:19 + + {INJECT, &pkt37[0], sizeof(pkt37), 0}, + {CHECK, &pkt38[0], sizeof(pkt38), 5}, + {CHECK, &pkt39[0], sizeof(pkt39), 5}, + {WAIT, NX_NULL, 0, 6}, //19:04:26 + + {INJECT, &pkt42[0], sizeof(pkt42), 0}, + {CHECK, &pkt43[0], sizeof(pkt43), 5}, + {CHECK, &pkt44[0], sizeof(pkt44), 5}, //STEP 50 + {WAIT, NX_NULL, 0, 6}, //19:04:26 + + {CHECK, &pkt45[0], sizeof(pkt45), 5}, + {INJECT, &pkt46[0], sizeof(pkt46), 0}, + {INJECT, &pkt47[0], sizeof(pkt47), 0}, + {CHECK, &pkt48[0], sizeof(pkt48), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_005_size = sizeof(tahi_04_005) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_006.c b/test/regression/tahi_test/tahi_04_006.c new file mode 100644 index 00000000..9d34baf5 --- /dev/null +++ b/test/regression/tahi_test/tahi_04_006.c @@ -0,0 +1,1087 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x0a, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x09, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0xff, +0xa5, 0x91, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x09, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x0a, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x09, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xb0, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +TAHI_TEST_SEQ tahi_04_006[] = { + {TITLE, "04-006", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_006_size = sizeof(tahi_04_006) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_007.c b/test/regression/tahi_test/tahi_04_007.c new file mode 100644 index 00000000..b23042af --- /dev/null +++ b/test/regression/tahi_test/tahi_04_007.c @@ -0,0 +1,2320 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x85, 0xe6, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xe6, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xea, 0x41, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x84, 0xe6, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x85, 0xe6, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x84, 0xe6, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +#if 0 +static char pkt19[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt21[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt25[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt26[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt27[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt28[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt29[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt30[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt31[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt32[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt33[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt34[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt35[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt36[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xf6, 0xe9, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt37[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xf5, 0xe9, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt38[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x5b, 0x45, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0xf5, 0xe9, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt39[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0xf6, 0xe9, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt40[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt41[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0xf5, 0xe9, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt42[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +TAHI_TEST_SEQ tahi_04_007[] = { + {TITLE, "04-007", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + {REBOOT, NX_NULL, 0, 0}, + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + {INJECT, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 5}, + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + {CHECK, &pkt30[0], sizeof(pkt30), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt32[0], sizeof(pkt32), 0}, + {CHECK, &pkt33[0], sizeof(pkt33), 5}, + {INJECT, &pkt34[0], sizeof(pkt34), 0}, + {CHECK, &pkt35[0], sizeof(pkt35), 5}, + + {INJECT, &pkt36[0], sizeof(pkt36), 0}, + {CHECK, &pkt37[0], sizeof(pkt37), 5}, + + {INJECT, &pkt38[0], sizeof(pkt38), 0}, + {INJECT, &pkt39[0], sizeof(pkt39), 0}, + {INJECT, &pkt40[0], sizeof(pkt40), 0}, + {CHECK, &pkt41[0], sizeof(pkt41), 5}, + {CHECK, &pkt42[0], sizeof(pkt42), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_007_size = sizeof(tahi_04_007) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_008.c b/test/regression/tahi_test/tahi_04_008.c new file mode 100644 index 00000000..5ce7c0b2 --- /dev/null +++ b/test/regression/tahi_test/tahi_04_008.c @@ -0,0 +1,1666 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x0a, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x09, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xa6, 0x18, 0x00, 0x00, 0x05, 0x78, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x09, 0x36, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x74, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x05, 0x48, 0x00, 0x00, 0x00, 0x01, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x43, 0xbb, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x02, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +TAHI_TEST_SEQ tahi_04_008[] = { + {TITLE, "04-008", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_008_size = sizeof(tahi_04_008) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_009.c b/test/regression/tahi_test/tahi_04_009.c new file mode 100644 index 00000000..f470188c --- /dev/null +++ b/test/regression/tahi_test/tahi_04_009.c @@ -0,0 +1,1007 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd4, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xe1, 0x8e, 0x00, 0x00, 0x00, 0x38, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd4, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +TAHI_TEST_SEQ tahi_04_009[] = { + {TITLE, "04-009", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_009_size = sizeof(tahi_04_009) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_010.c b/test/regression/tahi_test/tahi_04_010.c new file mode 100644 index 00000000..cbd0a67e --- /dev/null +++ b/test/regression/tahi_test/tahi_04_010.c @@ -0,0 +1,1007 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd4, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xdc, 0xc7, 0x00, 0x00, 0x04, 0xff, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0xd4, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0xd3, 0x9f, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +TAHI_TEST_SEQ tahi_04_010[] = { + {TITLE, "04-010", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_010_size = sizeof(tahi_04_010) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_011.c b/test/regression/tahi_test/tahi_04_011.c new file mode 100644 index 00000000..0a416709 --- /dev/null +++ b/test/regression/tahi_test/tahi_04_011.c @@ -0,0 +1,1682 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xd2, 0xa4, 0x00, 0x00, 0x05, 0x18, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xd4, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xe8, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xa6, 0xa2, 0x00, 0x00, 0x05, 0xdc, 0x60, 0x00, +0x00, 0x00, 0x04, 0xf0, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x74, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, +0x73, 0x64, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xd4, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xe8, 0x00, 0x00, 0x00, 0x02, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01 }; + +TAHI_TEST_SEQ tahi_04_011[] = { + {TITLE, "04-011", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_011_size = sizeof(tahi_04_011) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_012.c b/test/regression/tahi_test/tahi_04_012.c new file mode 100644 index 00000000..309297cc --- /dev/null +++ b/test/regression/tahi_test/tahi_04_012.c @@ -0,0 +1,1683 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x5b, 0x2d, 0x00, 0x00, 0x05, 0x18, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt16[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xd4, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xe8, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x29, 0x1c, 0x1f, 0xff, 0xff, 0xff, 0x60, 0x00, +0x00, 0x00, 0x04, 0xf0, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt20[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt21[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xd4, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xe8, 0x00, 0x00, 0x00, 0x02, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +TAHI_TEST_SEQ tahi_04_012[] = { + {TITLE, "04-012", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_012_size = sizeof(tahi_04_012) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_013.c b/test/regression/tahi_test/tahi_04_013.c new file mode 100644 index 00000000..1e731ccb --- /dev/null +++ b/test/regression/tahi_test/tahi_04_013.c @@ -0,0 +1,979 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x45, 0x1b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, +0x27, 0x10, 0x00, 0x00, 0x03, 0xe8, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0x00 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, +0x55, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x01, 0x00, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +static char pkt17[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x54, 0x45, 0xff, 0xff, 0x00, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, +0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, +0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }; + +static char pkt18[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, +0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, +0x06, 0x06 }; + +TAHI_TEST_SEQ tahi_04_013[] = { + {TITLE, "04-013", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_013_size = sizeof(tahi_04_013) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_014.c b/test/regression/tahi_test/tahi_04_014.c new file mode 100644 index 00000000..bef012db --- /dev/null +++ b/test/regression/tahi_test/tahi_04_014.c @@ -0,0 +1,7101 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +/* Frame (70 bytes) */ +static char pkt1[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (118 bytes) */ +static char pkt5[118] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, /* ...@:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x19, 0x15, 0x00, 0x00, 0x02, 0x58, 0x00, 0x09, /* .....X.. */ +0x27, 0xc0, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x4e, 0x20, 0x00, 0x00, /* @...N .. */ +0x4e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* N ....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* z....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .l....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* W.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* y....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (1454 bytes) */ +static char pkt12[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1454 bytes) */ +static char pkt13[1454] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1294 bytes) */ +static char pkt14[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, /* "..3DV.. */ +0xb4, 0x86, 0x00, 0x00, 0x05, 0x18, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0x40, 0x3f, 0xfe, /* ...x:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (1454 bytes) */ +static char pkt15[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt16[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt17[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt17_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt18[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt19[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt20[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x02, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt20_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (1454 bytes) */ +static char pkt23[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt24[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt25[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt25_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt26[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt27[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt28[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt28_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt29[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt30[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt31[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x05, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt31_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt32[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt33[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt34[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x06, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt34_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt35[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt36[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt37[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x07, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt37_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt38[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt39[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt40[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x08, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt40_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt41[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt42[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt43[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x09, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt43_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt44[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt45[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt46[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt46_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; +#endif + +/* Frame (1454 bytes) */ +static char pkt47[1454] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0x78, 0x3a, 0xff, 0x3f, 0xfe, /* ...x:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x92, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (1318 bytes) */ +static char pkt48[1318] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xf0, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x81, 0x00, /* ........ */ +0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (206 bytes) */ +static char pkt49[206] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x98, 0x2c, 0xff, 0x3f, 0xfe, /* ....,.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x02, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3a, 0x00, /* ......:. */ +0x04, 0xe8, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1400 bytes) */ +static char pkt49_1[1400] = { +0x81, 0x00, 0x91, 0xbe, 0xff, 0xff, 0x00, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ........ */ +}; + +/* Frame (78 bytes) */ +static char pkt50[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt51[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt52[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_04_014[] = { + {TITLE, "04-014", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, //step 10 + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {WAIT, NX_NULL, 0, 30}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, //step 20 + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 6}, + + +#if 0 + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, +#endif + {WAIT, NX_NULL, 0, 30}, //19:07:48 + + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {WAIT, NX_NULL, 0, 30}, //19:08:19 step 30 + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + {CHECK, &pkt28[0], sizeof(pkt28), 5}, + {WAIT, NX_NULL, 0, 30}, //19:08:50 + + {INJECT, &pkt29[0], sizeof(pkt29), 0}, + {CHECK, &pkt30[0], sizeof(pkt30), 5}, + {CHECK, &pkt31[0], sizeof(pkt31), 5}, + {WAIT, NX_NULL, 0, 30}, //19:09:20 + + {INJECT, &pkt32[0], sizeof(pkt32), 0}, + {CHECK, &pkt33[0], sizeof(pkt33), 5}, //step 40 + {CHECK, &pkt34[0], sizeof(pkt34), 5}, + {WAIT, NX_NULL, 0, 30}, //19:09:51 + + {INJECT, &pkt35[0], sizeof(pkt35), 0}, + {CHECK, &pkt36[0], sizeof(pkt36), 5}, + {CHECK, &pkt37[0], sizeof(pkt37), 5}, + {WAIT, NX_NULL, 0, 30}, //19:10:22 + + {INJECT, &pkt38[0], sizeof(pkt38), 0}, + {CHECK, &pkt39[0], sizeof(pkt39), 5}, + {CHECK, &pkt40[0], sizeof(pkt40), 5}, + {WAIT, NX_NULL, 0, 30}, //19:10:52 step 50 + + {INJECT, &pkt41[0], sizeof(pkt41), 0}, + {CHECK, &pkt42[0], sizeof(pkt42), 5}, + {CHECK, &pkt43[0], sizeof(pkt43), 5}, + {WAIT, NX_NULL, 0, 30}, //19:11:23 + + {INJECT, &pkt44[0], sizeof(pkt44), 0}, + {CHECK, &pkt45[0], sizeof(pkt45), 5}, + {CHECK, &pkt46[0], sizeof(pkt46), 5}, + {WAIT, NX_NULL, 0, 30}, + + {INJECT, &pkt47[0], sizeof(pkt47), 0}, + {CHECK, &pkt48[0], sizeof(pkt48), 5}, //step 60 + {CHECK, &pkt49[0], sizeof(pkt49), 5}, + {WAIT, NX_NULL, 0, 40}, + + //{CHECK, &pkt50[0], sizeof(pkt50), 5}, + //{CHECK, &pkt51[0], sizeof(pkt51), 5}, + //{CHECK, &pkt52[0], sizeof(pkt52), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_014_size = sizeof(tahi_04_014) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_015.c b/test/regression/tahi_test/tahi_04_015.c new file mode 100644 index 00000000..fde9294e --- /dev/null +++ b/test/regression/tahi_test/tahi_04_015.c @@ -0,0 +1,2007 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x56, 0x44, 0x56, 0x00, 0x00, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x9d, 0x1d, 0x00, 0x00, 0x05, 0xaa, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x56, 0x44, 0x56, 0x00, 0x00, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x80, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0xe0, 0x55, 0x44, 0x56, 0x00, 0x01, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x44, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x05, 0x78, 0x00, 0x00, 0x00, 0x01, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x32, 0x42, 0x00, 0x00, 0x05, 0x78, 0x60, 0x00, +0x00, 0x00, 0x05, 0x80, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0xe0, 0x55, 0x44, 0x56, 0x00, 0x01, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x54, 0x44, 0x56, 0x00, 0x02, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x74, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x05, 0x48, 0x00, 0x00, 0x00, 0x02, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x80, 0x00, +0x4a, 0x21, 0x44, 0x56, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x34, 0x4a, 0x00, 0x00, 0x05, 0x14, 0x60, 0x00, +0x00, 0x00, 0x05, 0x50, 0x3a, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x80, 0x00, +0x4a, 0x21, 0x44, 0x56, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xe8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, +0x4a, 0x20, 0x44, 0x56, 0x00, 0x04, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x78, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x04, 0xe0, 0x00, 0x00, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt23[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xc9, 0x3c, 0x00, 0x00, 0x05, 0x46, 0x60, 0x00, +0x00, 0x00, 0x04, 0xe8, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, +0x4a, 0x20, 0x44, 0x56, 0x00, 0x04, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt24[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xe8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x80, 0x00, +0x4a, 0x1f, 0x44, 0x56, 0x00, 0x05, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt25[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x78, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x04, 0xe0, 0x00, 0x00, 0x00, 0x04, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +TAHI_TEST_SEQ tahi_04_015[] = { + {TITLE, "04-015", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt12[0], sizeof(pkt12), 5, PMTU, 0, 0, 1452}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt14[0], sizeof(pkt14), 5, PMTU, 0, 0, 1452}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt17[0], sizeof(pkt17), 5, PMTU, 0, 0, 1452}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1352 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt19[0], sizeof(pkt19), 5, PMTU, 0, 0, 1352}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1352 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt21[0], sizeof(pkt21), 5, PMTU, 0, 0, 1352}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1352 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt24[0], sizeof(pkt24), 5, PMTU, 0, 0, 1352}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_015_size = sizeof(tahi_04_015) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_04_016.c b/test/regression/tahi_test/tahi_04_016.c new file mode 100644 index 00000000..8e8bf5bd --- /dev/null +++ b/test/regression/tahi_test/tahi_04_016.c @@ -0,0 +1,2183 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_ENABLE_IPV6_PATH_MTU_DISCOVERY) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x09, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x08, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x40, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xa2, 0x1d, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, +0x75, 0x30, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +#if 0 +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x7a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0x1c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x57, 0x0b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x56, 0x44, 0x56, 0x00, 0x00, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x9c, 0xff, 0x00, 0x00, 0x05, 0xc8, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x3a, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x56, 0x44, 0x56, 0x00, 0x00, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xa0, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0xe0, 0x55, 0x44, 0x56, 0x00, 0x01, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt15[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x24, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x05, 0x98, 0x00, 0x00, 0x00, 0x01, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x31, 0xfa, 0x00, 0x00, 0x05, 0xa0, 0x60, 0x00, +0x00, 0x00, 0x05, 0xa0, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0xe0, 0x55, 0x44, 0x56, 0x00, 0x01, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt17[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x54, 0x44, 0x56, 0x00, 0x02, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x4c, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x05, 0x70, 0x00, 0x00, 0x00, 0x02, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x32, 0x49, 0x00, 0x00, 0x05, 0x78, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x54, 0x44, 0x56, 0x00, 0x02, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x90, 0xce, 0x00, 0x00, 0x05, 0x50, 0x60, 0x00, +0x00, 0x00, 0x05, 0x78, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, +0xe0, 0x54, 0x44, 0x56, 0x00, 0x02, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0x28, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, +0xe0, 0x53, 0x44, 0x56, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt22[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x9c, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x05, 0x20, 0x00, 0x00, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +static char pkt23[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x33, 0x10, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0x28, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, +0xe0, 0x53, 0x44, 0x56, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x91, 0x45, 0x00, 0x00, 0x05, 0x28, 0x60, 0x00, +0x00, 0x00, 0x05, 0x28, 0x2c, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, +0xe0, 0x53, 0x44, 0x56, 0x00, 0x03, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt25[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x80, 0x00, +0xe0, 0x52, 0x44, 0x56, 0x00, 0x04, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }; + +static char pkt26[] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x1e, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x3a, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x04, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30 }; + +TAHI_TEST_SEQ tahi_04_016[] = { + {TITLE, "04-016", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt12[0], sizeof(pkt12), 5, PMTU, 0, 0, 1452}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt14[0], sizeof(pkt14), 5, PMTU, 0, 0, 1452}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt17[0], sizeof(pkt17), 5, PMTU, 0, 0, 1452}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, //Send Packet Too Big message from TR1 + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt21[0], sizeof(pkt21), 5, PMTU, 0, 0, 1452}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, //Send Packet Too Big message from TR1 + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 size=1452 addr=FF1E::1:2 if=fxp0 '' */ + {CHECK_V6REQUEST, &pkt25[0], sizeof(pkt25), 5, PMTU, 0, 0, 1452}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_04_016_size = sizeof(tahi_04_016) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_002.c b/test/regression/tahi_test/tahi_05_002.c new file mode 100644 index 00000000..b95c982f --- /dev/null +++ b/test/regression/tahi_test/tahi_05_002.c @@ -0,0 +1,418 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (64 bytes) */ +static char pkt12[64] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0a, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x80, 0x00, /* ........ */ +0xa3, 0x96, 0x44, 0x56, 0x00, 0x00, 0x31, 0x32 /* ..DV..12 */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt14[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt21[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + +/* This test still has some problems: + for example, it does not send Echo Request by NetX Duo. */ + +TAHI_TEST_SEQ tahi_05_002[] = { + {TITLE, "05-002", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + /* vRemote(ping6.rmt) ``/usr/local/v6eval//bin/netx//ping6.rmt -t netx -u root -p v6eval -d cuad0 -o 1 if=fxp0 addr=fe80::0200:00ff:fe00:0100 */ + {CHECK_V6REQUEST, &pkt12[0], sizeof(pkt12), 5, ICMP, 0, 0, 2}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {CHECK, &pkt16[0], sizeof(pkt16), 10}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + {WAIT, NX_NULL, 0, 3}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, //step 20 + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + + {CHECK, &pkt23[0], sizeof(pkt23), 10}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_002_size = sizeof(tahi_05_002) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_003.c b/test/regression/tahi_test/tahi_05_003.c new file mode 100644 index 00000000..1e7b0498 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_003.c @@ -0,0 +1,173 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt6[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt7[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt8[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + +TAHI_TEST_SEQ tahi_05_003[] = { + {TITLE, "05-003", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + + {CHECK, &pkt8[0], sizeof(pkt8), 10}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_003_size = sizeof(tahi_05_003) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_05_004.c b/test/regression/tahi_test/tahi_05_004.c new file mode 100644 index 00000000..555a9e5c --- /dev/null +++ b/test/regression/tahi_test/tahi_05_004.c @@ -0,0 +1,399 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt13[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt14[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt18[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt20[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt21[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_004[] = { + {TITLE, "05-004", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CHECK, &pkt15[0], sizeof(pkt15), 10}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {CHECK, &pkt22[0], sizeof(pkt22), 10}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_004_size = sizeof(tahi_05_004) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_005.c b/test/regression/tahi_test/tahi_05_005.c new file mode 100644 index 00000000..dbf6ace6 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_005.c @@ -0,0 +1,375 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0x80, 0x32, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt13[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt19[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt20[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt21[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt23[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt25[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt26[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +TAHI_TEST_SEQ tahi_05_005[] = { + {TITLE, "05-005", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + + {CHECK, &pkt24[0], sizeof(pkt24), 10}, //Change this timeout = 10, just for the RATE_100 test in VS, the normal value is 5. + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_005_size = sizeof(tahi_05_005) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_006.c b/test/regression/tahi_test/tahi_05_006.c new file mode 100644 index 00000000..ccaad327 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_006.c @@ -0,0 +1,167 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x7f, 0x36, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + + +TAHI_TEST_SEQ tahi_05_006[] = { + {TITLE, "05-006", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)ER, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_006_size = sizeof(tahi_05_006) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_05_007.c b/test/regression/tahi_test/tahi_05_007.c new file mode 100644 index 00000000..dd8aa078 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_007.c @@ -0,0 +1,167 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0x7f, 0x35, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt6[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + + +TAHI_TEST_SEQ tahi_05_007[] = { + {TITLE, "05-007", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {N_CHECK, (char *)ER, 0, 5}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {CLEAN_HOP_LIMIT, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_007_size = sizeof(tahi_05_007) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_05_008.c b/test/regression/tahi_test/tahi_05_008.c new file mode 100644 index 00000000..5ccbaf32 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_008.c @@ -0,0 +1,351 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x6b, 0xa2, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcf, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xcf, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x1a, 0x9a, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, +0xad, 0xe6, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x30, 0xc4, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x19, 0x9a, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt12[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x72, 0x82, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + +static char pkt13[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x1a, 0x9a, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt14[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x19, 0x9a, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt15[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0xad, 0x2a, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0xad, 0x2a, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, +0xad, 0x2a, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt18[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0x49, 0x38, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt19[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + +static char pkt20[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt21[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff }; + +static char pkt22[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt23[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt24[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + + +TAHI_TEST_SEQ tahi_05_008[] = { + {TITLE, "05-008", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_008_size = sizeof(tahi_05_008) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_009.c b/test/regression/tahi_test/tahi_05_009.c new file mode 100644 index 00000000..6d903641 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_009.c @@ -0,0 +1,766 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1514 bytes) */ +static char pkt12[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x23, 0x28, /* "..3DV#( */ +0x23, 0x28, 0x05, 0xb4, 0x47, 0x9a, 0xff, 0xff, /* #(..G... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff /* .. */ +}; + +/* Frame (1294 bytes) */ +static char pkt13[1294] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x04, /* ........ */ +0x22, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* ".....`. */ +0x00, 0x00, 0x05, 0xb4, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x23, 0x28, /* "..3DV#( */ +0x23, 0x28, 0x05, 0xb4, 0x47, 0x9a, 0xff, 0xff, /* #(..G... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt16[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt23[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + + + + +TAHI_TEST_SEQ tahi_05_009[] = { + {TITLE, "05-009", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_009_size = sizeof(tahi_05_009) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_010.c b/test/regression/tahi_test/tahi_05_010.c new file mode 100644 index 00000000..004151be --- /dev/null +++ b/test/regression/tahi_test/tahi_05_010.c @@ -0,0 +1,765 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1514 bytes) */ +static char pkt12[1514] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x05, 0xb4, 0x11, 0x40, 0x3f, 0xfe, /* .....@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x23, 0x28, /* "..3DV#( */ +0x23, 0x28, 0x05, 0xb4, 0xba, 0x9c, 0xff, 0xff, /* #(...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff /* .. */ +}; + +/* Frame (1294 bytes) */ +static char pkt13[1294] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x04, /* ........ */ +0x95, 0x20, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* . ....`. */ +0x00, 0x00, 0x05, 0xb4, 0x11, 0x40, 0x3f, 0xfe, /* .....@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x23, 0x28, /* "..3DV#( */ +0x23, 0x28, 0x05, 0xb4, 0xba, 0x9c, 0xff, 0xff, /* #(...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt16[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt23[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + + + +TAHI_TEST_SEQ tahi_05_010[] = { + {TITLE, "05-010", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 5}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_010_size = sizeof(tahi_05_010) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_012.c b/test/regression/tahi_test/tahi_05_012.c new file mode 100644 index 00000000..386eb8c5 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_012.c @@ -0,0 +1,438 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (75 bytes) */ +static char pkt12[75] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x15, 0x2c, 0x40, 0x3f, 0xfe, /* ....,@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0xf0, 0x00, 0x03, 0x5f, 0x80, 0x00, /* ....._.. */ +0xe7, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01 /* ... */ +}; + +/* Frame (123 bytes) */ +static char pkt13[123] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x45, 0x3a, 0xff, 0x3f, 0xfe, /* ...E:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, /* ........ */ +0xef, 0xaf, 0x00, 0x00, 0x00, 0x04, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x15, 0x2c, 0x40, 0x3f, 0xfe, /* ....,@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0xf0, 0x00, 0x03, 0x5f, 0x80, 0x00, /* ....._.. */ +0xe7, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01 /* ... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt16[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt23[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + + +TAHI_TEST_SEQ tahi_05_012[] = { + {TITLE, "05-012", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, //step 20 + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_012_size = sizeof(tahi_05_012) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_013.c b/test/regression/tahi_test/tahi_05_013.c new file mode 100644 index 00000000..7fbfb57e --- /dev/null +++ b/test/regression/tahi_test/tahi_05_013.c @@ -0,0 +1,437 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x18, 0x3c, 0x40, 0x3f, 0xfe, /* ....<@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfc, 0x00, /* "..3DV.. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0x8c, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt13[126] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x48, 0x3a, 0xff, 0x3f, 0xfe, /* ...H:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01, /* ........ */ +0x6e, 0xa7, 0x00, 0x00, 0x00, 0x28, 0x60, 0x00, /* n....(`. */ +0x00, 0x00, 0x00, 0x18, 0x3c, 0x40, 0x3f, 0xfe, /* ....<@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfc, 0x00, /* "..3DV.. */ +0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0x8c, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt16[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt23[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_013[] = { + {TITLE, "05-013", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_013_size = sizeof(tahi_05_013) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_014.c b/test/regression/tahi_test/tahi_05_014.c new file mode 100644 index 00000000..e7c73bee --- /dev/null +++ b/test/regression/tahi_test/tahi_05_014.c @@ -0,0 +1,417 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (74 bytes) */ +static char pkt12[74] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x14, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x00, /* "..3DV.. */ +0x93, 0x0c, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01 /* .. */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt14[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt21[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_014[] = { + {TITLE, "05-014", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_014_size = sizeof(tahi_05_014) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_015.c b/test/regression/tahi_test/tahi_05_015.c new file mode 100644 index 00000000..d2093e89 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_015.c @@ -0,0 +1,569 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1294 bytes) */ +static char pkt12[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, 0x28, /* ......#( */ +0x23, 0x28, 0x04, 0xd8, 0xb0, 0x69, 0xff, 0xff, /* #(...i.. */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt14[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt21[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_015[] = { + {TITLE, "05-015", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_015_size = sizeof(tahi_05_015) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_017.c b/test/regression/tahi_test/tahi_05_017.c new file mode 100644 index 00000000..c870656f --- /dev/null +++ b/test/regression/tahi_test/tahi_05_017.c @@ -0,0 +1,947 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xe7, 0x73, 0xfe, 0x00, 0x00, 0x5a, 0x00, 0x00, /* .s...Z.. */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (582 bytes) */ +static char pkt12[582] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x10, 0x2c, 0x40, 0xfe, 0x80, /* ....,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x03, 0xe9, 0x80, 0x00, /* ........ */ +0x0e, 0x35, 0x03, 0xe9, 0x00, 0x00, 0x01, 0x01, /* .5...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (574 bytes) */ +static char pkt13[574] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x08, 0x2c, 0x40, 0xfe, 0x80, /* ....,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x02, 0x08, 0x00, 0x00, 0x03, 0xe9, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1032 bytes) */ +static char pkt13_1[1032] = { +0x80, 0x00, 0x0e, 0x35, 0x03, 0xe9, 0x00, 0x00, /* ...5.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ........ */ +}; +#endif + +/* Frame (1086 bytes) */ +static char pkt14[1086] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0x08, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x0d, 0x35, 0x03, 0xe9, 0x00, 0x00, 0x01, 0x01, /* .5...... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (862 bytes) */ +static char pkt15[862] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x03, 0x28, 0x2c, 0x40, 0xfe, 0x80, /* ...(,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3a, 0x00, /* ......:. */ +0x00, 0x01, 0xf0, 0x00, 0x03, 0xe9, 0x80, 0x00, /* ........ */ +0x13, 0x75, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .u...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt17[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt18[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt22[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt24[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt25[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt28[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + +TAHI_TEST_SEQ tahi_05_017[] = { + {TITLE, "05-017", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 0}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt26[0], sizeof(pkt26), 0}, + {CHECK, &pkt27[0], sizeof(pkt27), 0}, + {CHECK, &pkt28[0], sizeof(pkt28), 0}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_017_size = sizeof(tahi_05_017) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_018.c b/test/regression/tahi_test/tahi_05_018.c new file mode 100644 index 00000000..1d1741fc --- /dev/null +++ b/test/regression/tahi_test/tahi_05_018.c @@ -0,0 +1,569 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1294 bytes) */ +static char pkt12[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x11, 0x40, 0x00, 0x00, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x23, 0x28, /* "..3DV#( */ +0x23, 0x28, 0x04, 0xd8, 0x02, 0x55, 0xff, 0xff, /* #(...U.. */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt14[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt21[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_018[] = { + {TITLE, "05-018", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_018_size = sizeof(tahi_05_018) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_020.c b/test/regression/tahi_test/tahi_05_020.c new file mode 100644 index 00000000..41a73642 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_020.c @@ -0,0 +1,948 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xe7, 0x73, 0xfe, 0x00, 0x00, 0x5a, 0x00, 0x00, /* .s...Z.. */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (582 bytes) */ +static char pkt12[582] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x10, 0x2c, 0x40, 0xfe, 0x80, /* ....,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x04, 0x70, 0x80, 0x00, /* .....p.. */ +0x0d, 0xae, 0x04, 0x70, 0x00, 0x00, 0x01, 0x01, /* ...p.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (574 bytes) */ +static char pkt13[574] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x08, 0x2c, 0x40, 0xfe, 0x80, /* ....,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x02, 0x08, 0x00, 0x00, 0x04, 0x70, 0x02, 0x02, /* .....p.. */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1032 bytes) */ +static char pkt13_1[1032] = { +0x80, 0x00, 0x0d, 0xae, 0x04, 0x70, 0x00, 0x00, /* .....p.. */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ........ */ +}; +#endif + +/* Frame (1086 bytes) */ +static char pkt14[1086] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0x08, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x0c, 0xae, 0x04, 0x70, 0x00, 0x00, 0x01, 0x01, /* ...p.... */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (862 bytes) */ +static char pkt15[862] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x03, 0x28, 0x2c, 0x40, 0x00, 0x00, /* ...(,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0xf0, 0x00, 0x04, 0x70, 0x80, 0x00, /* .....p.. */ +0x13, 0x75, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .u...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt17[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt18[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt22[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt24[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt25[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt28[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_020[] = { + {TITLE, "05-020", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {N_CHECK, (char *)NS, 0, 65}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {WAIT, NX_NULL, 0, 10}, //step 20 + + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {WAIT, NX_NULL, 0, 10}, //step 30 + + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + {CHECK, &pkt28[0], sizeof(pkt28), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_020_size = sizeof(tahi_05_020) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_021.c b/test/regression/tahi_test/tahi_05_021.c new file mode 100644 index 00000000..a33be1bf --- /dev/null +++ b/test/regression/tahi_test/tahi_05_021.c @@ -0,0 +1,569 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1294 bytes) */ +static char pkt12[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3c, 0x40, 0x00, 0x00, /* ....<@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x87, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0xcd, 0x5b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .[...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt14[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt21[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_021[] = { + {TITLE, "05-021", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, //step 20 + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_021_size = sizeof(tahi_05_021) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_022.c b/test/regression/tahi_test/tahi_05_022.c new file mode 100644 index 00000000..ae602e05 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_022.c @@ -0,0 +1,736 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1294 bytes) */ +static char pkt12[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x11, 0x40, 0xff, 0x02, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x23, 0x28, /* "..3DV#( */ +0x23, 0x28, 0x04, 0xd8, 0x03, 0x50, 0xff, 0xff, /* #(...P.. */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +#if 0 +/* Frame (1294 bytes) */ +static char pkt13[1294] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x01, 0x04, /* ........ */ +0xb2, 0x45, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* .E....`. */ +0x00, 0x00, 0x04, 0xd8, 0x11, 0x40, 0xff, 0x02, /* .....@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x28, 0x23, /* "..3DV(# */ +0x28, 0x23, 0x50, 0x03, 0xd8, 0x04, 0xff, 0xff, /* (#P..... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt16[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt23[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + + +TAHI_TEST_SEQ tahi_05_022[] = { + {TITLE, "05-022", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + {CHECK, &pkt17[0], sizeof(pkt17), 10}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {N_CHECK, (char *)NS, 0, 3}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {N_CHECK, (char *)NS, 0, 5}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {CHECK, &pkt24[0], sizeof(pkt24), 10}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_022_size = sizeof(tahi_05_022) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_024.c b/test/regression/tahi_test/tahi_05_024.c new file mode 100644 index 00000000..fc35ceab --- /dev/null +++ b/test/regression/tahi_test/tahi_05_024.c @@ -0,0 +1,1203 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xe7, 0x73, 0xfe, 0x00, 0x00, 0x5a, 0x00, 0x00, /* .s...Z.. */ +0x27, 0x10, 0x00, 0x00, 0x03, 0xed, 0x01, 0x01, /* '....... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (582 bytes) */ +static char pkt12[582] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x10, 0x2c, 0x40, 0xfe, 0x80, /* ....,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0x00, 0x00, 0x05, 0x1b, 0x80, 0x00, /* ........ */ +0x0d, 0x03, 0x05, 0x1b, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01 /* ...... */ +}; + +/* Frame (574 bytes) */ +static char pkt13[574] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x02, 0x08, 0x2c, 0x40, 0xfe, 0x80, /* ....,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x02, 0x08, 0x00, 0x00, 0x05, 0x1b, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +#if 0 +/* Reassembled IPv6 (1032 bytes) */ +static char pkt13_1[1032] = { +0x80, 0x00, 0x0d, 0x03, 0x05, 0x1b, 0x00, 0x00, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ........ */ +}; +#endif + +/* Frame (1086 bytes) */ +static char pkt14[1086] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0x08, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x0c, 0x03, 0x05, 0x1b, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* ........ */ +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* ........ */ +0x02, 0x02, 0x02, 0x02, 0x02, 0x02 /* ...... */ +}; + +/* Frame (862 bytes) */ +static char pkt15[862] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x03, 0x28, 0x2c, 0x40, 0xff, 0x02, /* ...(,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x00, 0x01, 0xf0, 0x00, 0x05, 0x1b, 0x80, 0x00, /* ........ */ +0x13, 0x75, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .u...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +#if 0 +/* Frame (910 bytes) */ +static char pkt16[910] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x03, 0x58, 0x3a, 0xff, 0xfe, 0x80, /* ...X:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x03, 0x01, /* ........ */ +0xdc, 0x31, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* .1....`. */ +0x00, 0x00, 0x03, 0x28, 0x2c, 0x40, 0xff, 0x02, /* ...(,@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x01, 0x00, 0xf0, 0x00, 0x05, 0x1b, 0x80, 0x00, /* ........ */ +0x13, 0x75, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .u...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +/* Reassembled IPv6 (1056 bytes) */ +static char pkt16_1[1056] = { +0x80, 0x00, 0x13, 0x75, 0x00, 0x00, 0x00, 0x00, /* ...u.... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ........ */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt18[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt19[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt23[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt25[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt26[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt28[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt29[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_024[] = { + {TITLE, "05-024", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {N_CHECK, (char *)NS, 0, 65}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {WAIT, NX_NULL, 0, 10}, //step 20 + + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + {CHECK, &pkt28[0], sizeof(pkt28), 5}, + {CHECK, &pkt29[0], sizeof(pkt29), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_024_size = sizeof(tahi_05_024) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_05_025.c b/test/regression/tahi_test/tahi_05_025.c new file mode 100644 index 00000000..fb21dde3 --- /dev/null +++ b/test/regression/tahi_test/tahi_05_025.c @@ -0,0 +1,737 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#include "netx_tahi.h" + +/* Frame (68 bytes) */ +static char pkt1[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt2[86] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xab, 0x68, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .h...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt3[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x2d, 0x86, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* -....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt4[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x24, 0x64, 0xfe, 0x00, 0x00, 0x1e, 0x00, 0x00, /* $d...... */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x36, 0xee, 0x85, 0x00, 0x36, /* @..6...6 */ +0xee, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (68 bytes) */ +static char pkt8[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x01, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0x1f, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .j....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x5b, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ...... */ +}; + +/* Frame (68 bytes) */ +static char pkt11[68] = { +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (1294 bytes) */ +static char pkt12[1294] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x04, 0xd8, 0x3c, 0x40, 0xff, 0x02, /* ....<@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x87, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0xce, 0x56, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .V...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; + +#if 0 +/* Frame (1294 bytes) */ +static char pkt13[1294] = { +0x33, 0x33, 0xff, 0x00, 0x01, 0x00, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x04, 0xd8, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x04, 0x02, /* ........ */ +0xed, 0x0f, 0x00, 0x00, 0x00, 0x2a, 0x60, 0x00, /* .....*`. */ +0x00, 0x00, 0x04, 0xd8, 0x3c, 0x40, 0xff, 0x02, /* ....<@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0x01, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3a, 0x00, /* "..3DV:. */ +0x87, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* ........ */ +0xce, 0x56, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* .V...... */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff, 0xff, 0xff /* ...... */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt14[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0xe4, 0x05, 0xa0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt15[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, /* ........ */ +0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt16[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x8c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x87, 0x00, /* ........ */ +0xd7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .o....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x01, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xea, 0x60, 0x00, 0x00, 0x03, 0xe8, 0x01, 0x01, /* .`...... */ +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x6f, 0x04, 0xa0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* o....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x02, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x55 /* .."3DU */ +}; + +/* Frame (68 bytes) */ +static char pkt22[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0x01, 0x00, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0x40, 0xfe, 0x80, /* ....:@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x19, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (68 bytes) */ +static char pkt23[68] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x0e, 0x3a, 0xfe, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x81, 0x00, /* ........ */ +0x18, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, /* ........ */ +0xff, 0xff, 0xff, 0xff /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x00, 0x11, /* .."3DU.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x87, 0x00, /* ........ */ +0xa9, 0xec, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0x01, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + + +TAHI_TEST_SEQ tahi_05_025[] = { + {TITLE, "05-025", 6, 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 5}, + {INJECT, &pkt3[0], sizeof(pkt3), 0}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, //step 10 + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {N_CHECK, (char *)NS, 0, 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, //step 20 + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 10}, + + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_05_025_size = sizeof(tahi_05_025) / sizeof(TAHI_TEST_SEQ); + +#endif /* NX_TAHI_ENABLE */ diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_001.c b/test/regression/tahi_test/tahi_dhcpv6_01_001.c new file mode 100644 index 00000000..84dec2b8 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_001.c @@ -0,0 +1,28 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +static char pkt1[] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 +}; + +TAHI_TEST_SEQ tahi_dhcpv6_01_001[] = { + {TITLE, "dhcpv6 01-001", 13, 0}, + {WAIT, NX_NULL, 0, 5}, + {CHECK, &pkt1[0], sizeof(pkt1), 5}, + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} + +}; + +int tahi_dhcpv6_01_001_size = sizeof(tahi_dhcpv6_01_001) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_002.c b/test/regression/tahi_test/tahi_dhcpv6_01_002.c new file mode 100644 index 00000000..55137585 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_002.c @@ -0,0 +1,403 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt6[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_002[] = { + {TITLE, "dhcpv6 01-002", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_002_size = sizeof(tahi_dhcpv6_01_002) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_003.c b/test/regression/tahi_test/tahi_dhcpv6_01_003.c new file mode 100644 index 00000000..7ec2afe5 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_003.c @@ -0,0 +1,382 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt14[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (162 bytes) */ +static char pkt16[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0x73, 0xbc, 0x07, 0x52, /* .".ls..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (164 bytes) */ +static char pkt19[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc3, 0xf5, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_003[] = { + {TITLE, "dhcpv6 01-003", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_003_size = sizeof(tahi_dhcpv6_01_003) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_004.c b/test/regression/tahi_test/tahi_dhcpv6_01_004.c new file mode 100644 index 00000000..8c13cadc --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_004.c @@ -0,0 +1,489 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (164 bytes) */ +static char pkt1[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc0, 0x0d, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt3[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt8[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt10[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt18[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt19[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0x73, 0xbc, 0x07, 0x52, /* .".ls..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_004[] = { + {TITLE, "dhcpv6 01-004", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 10}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_004_size = sizeof(tahi_dhcpv6_01_004) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_005.c b/test/regression/tahi_test/tahi_dhcpv6_01_005.c new file mode 100644 index 00000000..07a7611e --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_005.c @@ -0,0 +1,490 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (162 bytes) */ +static char pkt17[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0x73, 0xbc, 0x07, 0x52, /* .".ls..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_005[] = { + {TITLE, "dhcpv6 01-005", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 15}, /* Wait for the second RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 25}, /* Wait for the REBIND. */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + + {WAIT, NX_NULL, 0, 10}, /* Wait for the REBIND. */ + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_005_size = sizeof(tahi_dhcpv6_01_005) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_006.c b/test/regression/tahi_test/tahi_dhcpv6_01_006.c new file mode 100644 index 00000000..6caf21d5 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_006.c @@ -0,0 +1,399 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (110 bytes) */ +static char pkt15[110] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0xfe, 0x80, /* ...8.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x38, 0x04, 0x95, 0x07, 0x52, /* .".8...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x0d, /* ........ */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ + }; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_006[] = { + {TITLE, "dhcpv6 01-006", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {N_CHECK, (char *)ER, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_006_size = sizeof(tahi_dhcpv6_01_006) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_007.c b/test/regression/tahi_test/tahi_dhcpv6_01_007.c new file mode 100644 index 00000000..62f14a75 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_007.c @@ -0,0 +1,319 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt9[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (110 bytes) */ +static char pkt10[110] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0xfe, 0x80, /* ...8.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x38, 0x04, 0x95, 0x07, 0x52, /* .".8...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x0d, /* ........ */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ + }; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_007[] = { + {TITLE, "dhcpv6 01-007", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {N_CHECK, (char *)ER, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_007_size = sizeof(tahi_dhcpv6_01_007) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_008.c b/test/regression/tahi_test/tahi_dhcpv6_01_008.c new file mode 100644 index 00000000..ed715e1b --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_008.c @@ -0,0 +1,193 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_008[] = { + {TITLE, "dhcpv6 01-008", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_008_size = sizeof(tahi_dhcpv6_01_008) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_009.c b/test/regression/tahi_test/tahi_dhcpv6_01_009.c new file mode 100644 index 00000000..bb29a98f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_009.c @@ -0,0 +1,255 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_009[] = { + {TITLE, "dhcpv6 01-009", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_009_size = sizeof(tahi_dhcpv6_01_009) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_010.c b/test/regression/tahi_test/tahi_dhcpv6_01_010.c new file mode 100644 index 00000000..78770d31 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_010.c @@ -0,0 +1,281 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x01, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x83, 0x00, 0x00, 0x5c, 0x99, 0x97, 0x02, 0x3e, /* ...\...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j%...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* K....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (194 bytes) */ +static char pkt7[194] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x8c, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x04, /* ........ */ + 0x86, 0x07, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x01, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x83, 0x00, 0x00, 0x5c, 0x99, 0x97, 0x02, 0x3e, /* ...\...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_010[] = { + {TITLE, "dhcpv6 01-010", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_010_size = sizeof(tahi_dhcpv6_01_010) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_011.c b/test/regression/tahi_test/tahi_dhcpv6_01_011.c new file mode 100644 index 00000000..48197770 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_011.c @@ -0,0 +1,194 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_011[] = { + {TITLE, "dhcpv6 01-011", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_011_size = sizeof(tahi_dhcpv6_01_011) / sizeof(TAHI_TEST_SEQ); + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_012.c b/test/regression/tahi_test/tahi_dhcpv6_01_012.c new file mode 100644 index 00000000..90e5d810 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_012.c @@ -0,0 +1,193 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_012[] = { + {TITLE, "dhcpv6 01-012", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_012_size = sizeof(tahi_dhcpv6_01_012) / sizeof(TAHI_TEST_SEQ); + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_013.c b/test/regression/tahi_test/tahi_dhcpv6_01_013.c new file mode 100644 index 00000000..fb7e1bef --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_013.c @@ -0,0 +1,193 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_013[] = { + {TITLE, "dhcpv6 01-013", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_013_size = sizeof(tahi_dhcpv6_01_013) / sizeof(TAHI_TEST_SEQ); + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_014.c b/test/regression/tahi_test/tahi_dhcpv6_01_014.c new file mode 100644 index 00000000..2635d1a2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_014.c @@ -0,0 +1,377 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt12[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (118 bytes) */ +static char pkt14[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt15[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt16[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_014[] = { + {TITLE, "dhcpv6 01-014", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {DHCPV6_REBOOT, NX_NULL, 0, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 20}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + {CHECK, &pkt9[0], sizeof(pkt9), 10}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + {CHECK, &pkt14[0], sizeof(pkt14), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_014_size = sizeof(tahi_dhcpv6_01_014) / sizeof(TAHI_TEST_SEQ); + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_019.c b/test/regression/tahi_test/tahi_dhcpv6_01_019.c new file mode 100644 index 00000000..bc08506a --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_019.c @@ -0,0 +1,195 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_019[] = { + {TITLE, "dhcpv6 01-019", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_019_size = sizeof(tahi_dhcpv6_01_019) / sizeof(TAHI_TEST_SEQ); + + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_020.c b/test/regression/tahi_test/tahi_dhcpv6_01_020.c new file mode 100644 index 00000000..6d0ab43f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_020.c @@ -0,0 +1,216 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_020[] = { + {TITLE, "dhcpv6 01-020", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_020_size = sizeof(tahi_dhcpv6_01_020) / sizeof(TAHI_TEST_SEQ); + + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_021.c b/test/regression/tahi_test/tahi_dhcpv6_01_021.c new file mode 100644 index 00000000..c5332afc --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_021.c @@ -0,0 +1,256 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_021[] = { + {TITLE, "dhcpv6 01-021", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_021_size = sizeof(tahi_dhcpv6_01_021) / sizeof(TAHI_TEST_SEQ); + + +#endif + diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_022.c b/test/regression/tahi_test/tahi_dhcpv6_01_022.c new file mode 100644 index 00000000..dbe6ce1e --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_022.c @@ -0,0 +1,373 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_022[] = { + {TITLE, "dhcpv6 01-022", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_022_size = sizeof(tahi_dhcpv6_01_022) / sizeof(TAHI_TEST_SEQ); + + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_023.c b/test/regression/tahi_test/tahi_dhcpv6_01_023.c new file mode 100644 index 00000000..78cec2dc --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_023.c @@ -0,0 +1,194 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_023[] = { + {TITLE, "dhcpv6 01-023", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_023_size = sizeof(tahi_dhcpv6_01_023) / sizeof(TAHI_TEST_SEQ); + + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_024.c b/test/regression/tahi_test/tahi_dhcpv6_01_024.c new file mode 100644 index 00000000..42b9ab1c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_024.c @@ -0,0 +1,258 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_024[] = { + {TITLE, "dhcpv6 01-024", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 5}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_024_size = sizeof(tahi_dhcpv6_01_024) / sizeof(TAHI_TEST_SEQ); + + + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_025.c b/test/regression/tahi_test/tahi_dhcpv6_01_025.c new file mode 100644 index 00000000..94da4cd2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_025.c @@ -0,0 +1,430 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt14[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_025[] = { + {TITLE, "dhcpv6 01-025", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_025_size = sizeof(tahi_dhcpv6_01_025) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_026.c b/test/regression/tahi_test/tahi_dhcpv6_01_026.c new file mode 100644 index 00000000..909888a9 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_026.c @@ -0,0 +1,366 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_026[] = { + {TITLE, "dhcpv6 01-026", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_026_size = sizeof(tahi_dhcpv6_01_026) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_027.c b/test/regression/tahi_test/tahi_dhcpv6_01_027.c new file mode 100644 index 00000000..f325f473 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_027.c @@ -0,0 +1,418 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_027[] = { + {TITLE, "dhcpv6 01-027", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 15}, /* Wait for the second RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 25}, /* Wait for the REBIND. */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_027_size = sizeof(tahi_dhcpv6_01_027) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_028.c b/test/regression/tahi_test/tahi_dhcpv6_01_028.c new file mode 100644 index 00000000..dad43707 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_028.c @@ -0,0 +1,410 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_028[] = { + {TITLE, "dhcpv6 01-028", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_028_size = sizeof(tahi_dhcpv6_01_028) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_029.c b/test/regression/tahi_test/tahi_dhcpv6_01_029.c new file mode 100644 index 00000000..33ca9341 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_029.c @@ -0,0 +1,320 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt9[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt10[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt11[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + + +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_029[] = { + {TITLE, "dhcpv6 01-029", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_029_size = sizeof(tahi_dhcpv6_01_029) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_030.c b/test/regression/tahi_test/tahi_dhcpv6_01_030.c new file mode 100644 index 00000000..f758cfc4 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_030.c @@ -0,0 +1,623 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (70 bytes) */ +static char pkt1[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt6[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt11[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xd5, 0x30, 0x07, 0x08, /* .".l.0.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, /* .2...... */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, /* ........ */ + 0x0d, 0xac, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt19[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xf5, 0xcb, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt20[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xf1, 0xe3, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt21[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xea, 0x13, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt22[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xda, 0x73, 0x05, 0x52, /* .#.n.s.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .X...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt23[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xbb, 0x33, 0x05, 0x52, /* .#.n.3.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x3a, 0x98, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* :....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt24[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x7c, 0xb3, 0x05, 0x52, /* .#.n|..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x79, 0x18, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* y....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt25[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xff, 0xb2, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0xf6, 0x18, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt26[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xf5, 0xcb, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0xff, 0xff, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x09, 0xc4, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x00, 0x0d, 0xac, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt27[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt28[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt30[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_030[] = { + {TITLE, "dhcpv6 01-030", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for the RENEW. */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the RENEW. */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 40}, /* Wait for the RENEW. */ + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 80}, /* Wait for the RENEW. */ + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 160}, /* Wait for the RENEW. */ + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {WAIT, NX_NULL, 0, 320}, /* Wait for the RENEW. */ + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {WAIT, NX_NULL, 0, 600}, /* Wait for the RENEW. */ + {CHECK, &pkt26[0], sizeof(pkt26), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_030_size = sizeof(tahi_dhcpv6_01_030) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_031.c b/test/regression/tahi_test/tahi_dhcpv6_01_031.c new file mode 100644 index 00000000..32d7b6ce --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_031.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_031[] = { + {TITLE, "dhcpv6 01-031", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_031_size = sizeof(tahi_dhcpv6_01_031) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_032.c b/test/regression/tahi_test/tahi_dhcpv6_01_032.c new file mode 100644 index 00000000..caa420f3 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_032.c @@ -0,0 +1,192 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_032[] = { + {TITLE, "dhcpv6 01-032", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_032_size = sizeof(tahi_dhcpv6_01_032) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_033.c b/test/regression/tahi_test/tahi_dhcpv6_01_033.c new file mode 100644 index 00000000..945e9f09 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_033.c @@ -0,0 +1,212 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_033[] = { + {TITLE, "dhcpv6 01-033", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_033_size = sizeof(tahi_dhcpv6_01_033) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_034.c b/test/regression/tahi_test/tahi_dhcpv6_01_034.c new file mode 100644 index 00000000..283ea604 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_034.c @@ -0,0 +1,292 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x67, 0x4d, 0x01, 0x3e, /* .#.@gM.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x61, 0x0d, 0x01, 0x3e, /* .#.@a..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x54, 0x8d, 0x01, 0x3e, /* .#.@T..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x18, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x3b, 0x8d, 0x01, 0x3e, /* .#.@;..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x31, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* 1....... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt11[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x0c, 0xad, 0x01, 0x3e, /* .#.@...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x60, 0x7c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* `|...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_034[] = { + {TITLE, "dhcpv6 01-034", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 32}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {WAIT, NX_NULL, 0, 64}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {WAIT, NX_NULL, 0, 128}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_034_size = sizeof(tahi_dhcpv6_01_034) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_035.c b/test/regression/tahi_test/tahi_dhcpv6_01_035.c new file mode 100644 index 00000000..2d3339a7 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_035.c @@ -0,0 +1,329 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (70 bytes) */ +static char pkt1[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt3[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt6[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x99, 0xdc, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x96, 0xbc, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_035[] = { + {TITLE, "dhcpv6 01-035", 13, 0}, + + {CHECK, &pkt5[0], sizeof(pkt5), 30}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_035_size = sizeof(tahi_dhcpv6_01_035) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_036.c b/test/regression/tahi_test/tahi_dhcpv6_01_036.c new file mode 100644 index 00000000..6b631dd0 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_036.c @@ -0,0 +1,274 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt5[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_036[] = { + {TITLE, "dhcpv6 01-036", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {CHECK, &pkt4[0], sizeof(pkt4), 5}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_036_size = sizeof(tahi_dhcpv6_01_036) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_037.c b/test/regression/tahi_test/tahi_dhcpv6_01_037.c new file mode 100644 index 00000000..aa35d621 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_037.c @@ -0,0 +1,253 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_037[] = { + {TITLE, "dhcpv6 01-037", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_037_size = sizeof(tahi_dhcpv6_01_037) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_038.c b/test/regression/tahi_test/tahi_dhcpv6_01_038.c new file mode 100644 index 00000000..863e56d1 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_038.c @@ -0,0 +1,254 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_038[] = { + {TITLE, "dhcpv6 01-038", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_038_size = sizeof(tahi_dhcpv6_01_038) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_039.c b/test/regression/tahi_test/tahi_dhcpv6_01_039.c new file mode 100644 index 00000000..fab9ef4f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_039.c @@ -0,0 +1,363 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x99, 0xdc, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x96, 0xbc, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x90, 0x7c, 0x03, 0x08, /* .#.n.|.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x84, 0xc4, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x17, 0xd4, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_039[] = { + {TITLE, "dhcpv6 01-039", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {WAIT, NX_NULL, 0, 32}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_039_size = sizeof(tahi_dhcpv6_01_039) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_040.c b/test/regression/tahi_test/tahi_dhcpv6_01_040.c new file mode 100644 index 00000000..53afad52 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_040.c @@ -0,0 +1,473 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x99, 0xdc, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x96, 0xbc, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x90, 0x7c, 0x03, 0x08, /* .#.n.|.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x84, 0xc4, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x17, 0xd4, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt12[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x79, 0x0c, 0x03, 0x08, /* .#.ny... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x23, 0x8c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* #....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt13[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x6d, 0x54, 0x03, 0x08, /* .#.nmT.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x2f, 0x44, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* /D...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x61, 0x9c, 0x03, 0x08, /* .#.na... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x3a, 0xfc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* :....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x55, 0xe4, 0x03, 0x08, /* .#.nU... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x46, 0xb4, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* F....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_040[] = { + {TITLE, "dhcpv6 01-040", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {WAIT, NX_NULL, 0, 4}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {WAIT, NX_NULL, 0, 30}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 30}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {WAIT, NX_NULL, 0, 30}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {WAIT, NX_NULL, 0, 30}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 30}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {N_CHECK, (CHAR *)REQUEST, 0, 100}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_040_size = sizeof(tahi_dhcpv6_01_040) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_041.c b/test/regression/tahi_test/tahi_dhcpv6_01_041.c new file mode 100644 index 00000000..fa43f98c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_041.c @@ -0,0 +1,428 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt14[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_041[] = { + {TITLE, "dhcpv6 01-041", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_041_size = sizeof(tahi_dhcpv6_01_041) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_042.c b/test/regression/tahi_test/tahi_dhcpv6_01_042.c new file mode 100644 index 00000000..11fed417 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_042.c @@ -0,0 +1,429 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt14[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_042[] = { + {TITLE, "dhcpv6 01-042", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_042_size = sizeof(tahi_dhcpv6_01_042) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_043.c b/test/regression/tahi_test/tahi_dhcpv6_01_043.c new file mode 100644 index 00000000..ebda42dd --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_043.c @@ -0,0 +1,454 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt14[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt18[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd3, 0xc7, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_043[] = { + {TITLE, "dhcpv6 01-043", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_043_size = sizeof(tahi_dhcpv6_01_043) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_044.c b/test/regression/tahi_test/tahi_dhcpv6_01_044.c new file mode 100644 index 00000000..e3db9c82 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_044.c @@ -0,0 +1,522 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt6[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt20[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt21[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt22[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt23[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd3, 0xc7, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt26[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_044[] = { + {TITLE, "dhcpv6 01-044", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt8[0], sizeof(pkt8), 10}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CHECK, &pkt23[0], sizeof(pkt23), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_044_size = sizeof(tahi_dhcpv6_01_044) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_045.c b/test/regression/tahi_test/tahi_dhcpv6_01_045.c new file mode 100644 index 00000000..31dc03a9 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_045.c @@ -0,0 +1,555 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (110 bytes) */ +static char pkt7[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt19[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt20[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt21[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt22[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt23[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd3, 0xc7, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt26[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt27[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt28[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt30[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_045[] = { + {TITLE, "dhcpv6 01-045", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt6[0], sizeof(pkt6), 10}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {CHECK, &pkt18[0], sizeof(pkt18), 10}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CHECK, &pkt23[0], sizeof(pkt23), 10}, + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_045_size = sizeof(tahi_dhcpv6_01_045) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_046.c b/test/regression/tahi_test/tahi_dhcpv6_01_046.c new file mode 100644 index 00000000..5715fc41 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_046.c @@ -0,0 +1,365 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_046[] = { + {TITLE, "dhcpv6 01-046", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_046_size = sizeof(tahi_dhcpv6_01_046) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_047.c b/test/regression/tahi_test/tahi_dhcpv6_01_047.c new file mode 100644 index 00000000..31d88a2d --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_047.c @@ -0,0 +1,391 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_047[] = { + {TITLE, "dhcpv6 01-047", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 15}, /* Wait for the RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_047_size = sizeof(tahi_dhcpv6_01_047) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_048.c b/test/regression/tahi_test/tahi_dhcpv6_01_048.c new file mode 100644 index 00000000..d71f6c51 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_048.c @@ -0,0 +1,555 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xae, 0x2a, 0x07, 0x08, /* .".l.*.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x28, 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, /* .(...... */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, /* .....@.. */ + 0x23, 0x28, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* #(...... */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xce, 0xc5, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xca, 0xdd, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt16[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc3, 0x0d, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xb3, 0x6d, 0x05, 0x52, /* .#.n.m.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .X...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt18[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x94, 0x2d, 0x05, 0x52, /* .#.n.-.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x3a, 0x98, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* :....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt19[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x55, 0xad, 0x05, 0x52, /* .#.nU..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x79, 0x18, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* y....... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt20[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xd8, 0xac, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0xf6, 0x18, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt21[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xce, 0xc5, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0xff, 0xff, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x28, /* .......( */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_048[] = { + {TITLE, "dhcpv6 01-048", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 55}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 15}, /* Wait for the RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 25}, /* Wait for the RENEW. */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 45}, /* Wait for the RENEW. */ + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {WAIT, NX_NULL, 0, 85}, /* Wait for the RENEW. */ + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {WAIT, NX_NULL, 0, 165}, /* Wait for the RENEW. */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 325}, /* Wait for the RENEW. */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 605}, /* Wait for the RENEW. */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_048_size = sizeof(tahi_dhcpv6_01_048) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_049.c b/test/regression/tahi_test/tahi_dhcpv6_01_049.c new file mode 100644 index 00000000..112604a2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_049.c @@ -0,0 +1,441 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xb4, 0xf6, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x05, /* .d...... */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, /* .....@.. */ + 0x23, 0x28, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* #(...... */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xd5, 0x91, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, /* .......d */ + 0x00, 0x00, 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xd1, 0xa9, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, /* .......d */ + 0x00, 0x00, 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt16[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc9, 0xd9, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, /* .......d */ + 0x00, 0x00, 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xba, 0x39, 0x05, 0x52, /* .#.n.9.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .X...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, /* .......d */ + 0x00, 0x00, 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, /* ...@..#( */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt18[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x90, 0xef, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, 0x00, 0x06, /* .@..#(.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt19[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x8d, 0x07, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, 0x00, 0x06, /* .@..#(.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt20[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x85, 0x37, 0x06, 0x52, /* .#.\.7.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x1f, 0x40, 0x00, 0x00, 0x23, 0x28, 0x00, 0x06, /* .@..#(.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; +#endif + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_049[] = { + {TITLE, "dhcpv6 01-049", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 95}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the RENEW. */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 40}, /* Wait for the RENEW. */ + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {WAIT, NX_NULL, 0, 80}, /* Wait for the REBIND. */ + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the REBIND. */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_049_size = sizeof(tahi_dhcpv6_01_049) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_050.c b/test/regression/tahi_test/tahi_dhcpv6_01_050.c new file mode 100644 index 00000000..daf278c0 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_050.c @@ -0,0 +1,615 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (110 bytes) */ +static char pkt8[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt10[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt12[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0x14, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x01, 0x90, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt20[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x16, 0xb0, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt21[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x12, 0xc8, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt22[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0x0d, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt23[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xce, 0x25, 0x06, 0x52, /* .#.\.%.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt24[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xc6, 0x55, 0x06, 0x52, /* .#.\.U.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt25[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xb6, 0xb5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .X...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt26[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x97, 0x75, 0x06, 0x52, /* .#.\.u.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x3a, 0x98, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* :....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt27[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x58, 0xf5, 0x06, 0x52, /* .#.\X..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x79, 0x18, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* y....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x90, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt28[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt30[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_050[] = { + {TITLE, "dhcpv6 01-050", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 10}, + + {WAIT, NX_NULL, 0, 50}, /* Wait for the RENEW. */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the REBIND. */ + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_050_size = sizeof(tahi_dhcpv6_01_050) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_051.c b/test/regression/tahi_test/tahi_dhcpv6_01_051.c new file mode 100644 index 00000000..637da40f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_051.c @@ -0,0 +1,442 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xce, 0xed, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_051[] = { + {TITLE, "dhcpv6 01-051", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 50}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the REBIND. */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the REBIND. */ + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_051_size = sizeof(tahi_dhcpv6_01_051) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_052.c b/test/regression/tahi_test/tahi_dhcpv6_01_052.c new file mode 100644 index 00000000..850069c5 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_052.c @@ -0,0 +1,508 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xe4, 0x80, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x07, 0xd0, 0x00, 0x00, /* ........ */ + 0x0b, 0xb8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x05, 0x1c, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x01, 0x34, 0x05, 0x52, /* .#.n.4.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, /* ........ */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xc0, 0x79, 0x06, 0x52, /* .#.\.y.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xbc, 0x91, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt18[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xb4, 0xc1, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt19[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xa5, 0x21, 0x06, 0x52, /* .#.\.!.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .X...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt20[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x85, 0xe1, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x3a, 0x98, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* :....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt21[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x47, 0x61, 0x06, 0x52, /* .#.\Ga.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x79, 0x18, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* y....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt22[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xca, 0x60, 0x06, 0x52, /* .#.\.`.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0xf6, 0x18, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt23[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xc0, 0x79, 0x06, 0x52, /* .#.\.y.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0xff, 0xff, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x07, 0xd0, 0x00, 0x00, 0x0b, 0xb8, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_052[] = { + {TITLE, "dhcpv6 01-052", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {WAIT, NX_NULL, 0, 50}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the REBIND. */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the REBIND. */ + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the REBIND. */ + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {WAIT, NX_NULL, 0, 40}, /* Wait for the REBIND. */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 80}, /* Wait for the REBIND. */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 160}, /* Wait for the REBIND. */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 320}, /* Wait for the REBIND. */ + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 640}, /* Wait for the REBIND. */ + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_052_size = sizeof(tahi_dhcpv6_01_052) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_053.c b/test/regression/tahi_test/tahi_dhcpv6_01_053.c new file mode 100644 index 00000000..c74df802 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_053.c @@ -0,0 +1,517 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt7[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt10[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt12[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0x78, 0x07, 0x08, /* .".l.x.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x01, 0x2c, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* .,...... */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt20[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x14, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, /* ...d..., */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt21[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x2c, 0x05, 0x52, /* .#.n.,.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, /* ...d..., */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt22[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0x71, 0x06, 0x52, /* .#.\.q.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x06, /* .d...,.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt23[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xce, 0x89, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x06, /* .d...,.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt24[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xc6, 0xb9, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x06, /* .d...,.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt25[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xb7, 0x19, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .X...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x06, /* .d...,.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt26[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x97, 0xd9, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x3a, 0x98, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* :....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x06, /* .d...,.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_053[] = { + {TITLE, "dhcpv6 01-053", 13, 0}, + + {CHECK, &pkt9[0], sizeof(pkt9), 30}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 10}, + + {WAIT, NX_NULL, 0, 46}, /* Wait for the RENEW. */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the REBIND. */ + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the REBIND. */ + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {WAIT, NX_NULL, 0, 20}, /* Wait for the REBIND. */ + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + {WAIT, NX_NULL, 0, 40}, /* Wait for the REBIND. */ + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {WAIT, NX_NULL, 0, 80}, /* Wait for the REBIND. */ + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_053_size = sizeof(tahi_dhcpv6_01_053) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_054.c b/test/regression/tahi_test/tahi_dhcpv6_01_054.c new file mode 100644 index 00000000..e1be45be --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_054.c @@ -0,0 +1,482 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (110 bytes) */ +static char pkt8[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt10[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt12[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt20[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + + +#if 0 +/* Frame (152 bytes) */ +static char pkt21[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt22[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt23[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x07, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt24[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x10, 0xe7, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt25[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0a, 0xa7, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x0c, 0x1c, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; +#endif + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_054[] = { + {TITLE, "dhcpv6 01-054", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_054_size = sizeof(tahi_dhcpv6_01_054) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_055.c b/test/regression/tahi_test/tahi_dhcpv6_01_055.c new file mode 100644 index 00000000..6a0e4a4c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_055.c @@ -0,0 +1,530 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt20[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (152 bytes) */ +static char pkt22[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt23[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt24[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x07, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt26[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt27[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt30[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_055[] = { + {TITLE, "dhcpv6 01-055", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + {N_CHECK, (char *)ER, 0, 15}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_055_size = sizeof(tahi_dhcpv6_01_055) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_056.c b/test/regression/tahi_test/tahi_dhcpv6_01_056.c new file mode 100644 index 00000000..b7c25a9d --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_056.c @@ -0,0 +1,331 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; +#endif + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_056[] = { + {TITLE, "dhcpv6 01-056", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_056_size = sizeof(tahi_dhcpv6_01_056) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_057.c b/test/regression/tahi_test/tahi_dhcpv6_01_057.c new file mode 100644 index 00000000..700a09f1 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_057.c @@ -0,0 +1,461 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt3[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt9[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt17[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt18[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt19[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt20[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x07, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt21[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x10, 0xe7, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt22[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0a, 0xa7, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x0c, 0x1c, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_057[] = { + {TITLE, "dhcpv6 01-057", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 4}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_057_size = sizeof(tahi_dhcpv6_01_057) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_058.c b/test/regression/tahi_test/tahi_dhcpv6_01_058.c new file mode 100644 index 00000000..23800783 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_058.c @@ -0,0 +1,407 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (126 bytes) */ +static char pkt16[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0x4c, 0x07, 0x52, /* .".HgL.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x03, 0x00, 0x00 /* ...... */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_058[] = { + {TITLE, "dhcpv6 01-058", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {N_CHECK, (CHAR *)RELEASE, 0 , 15}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_058_size = sizeof(tahi_dhcpv6_01_058) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_059.c b/test/regression/tahi_test/tahi_dhcpv6_01_059.c new file mode 100644 index 00000000..b2df2878 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_059.c @@ -0,0 +1,525 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt9[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt17[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt18[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt19[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt20[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x07, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt21[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x10, 0xe7, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt22[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0a, 0xa7, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x0c, 0x1c, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + +TAHI_TEST_SEQ tahi_dhcpv6_01_059[] = { + {TITLE, "dhcpv6 01-059", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 10}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + {WAIT, NX_NULL, 0, 4}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_059_size = sizeof(tahi_dhcpv6_01_059) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_060.c b/test/regression/tahi_test/tahi_dhcpv6_01_060.c new file mode 100644 index 00000000..fe448818 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_060.c @@ -0,0 +1,296 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt9[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt10[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt11[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt12[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x13, 0x07, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt13[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0f, 0xe7, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_060[] = { + {TITLE, "dhcpv6 01-060", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_060_size = sizeof(tahi_dhcpv6_01_060) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_061.c b/test/regression/tahi_test/tahi_dhcpv6_01_061.c new file mode 100644 index 00000000..9fe0a958 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_061.c @@ -0,0 +1,350 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt9[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt12[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x13, 0x07, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt17[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0f, 0xe7, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_061[] = { + {TITLE, "dhcpv6 01-061", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {N_CHECK, (CHAR *)ER, 0, 15}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_061_size = sizeof(tahi_dhcpv6_01_061) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_062.c b/test/regression/tahi_test/tahi_dhcpv6_01_062.c new file mode 100644 index 00000000..e3aaeba7 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_062.c @@ -0,0 +1,360 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt9[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt12[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt13[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x13, 0x07, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0f, 0xe7, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt17[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x09, 0xa7, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x0c, 0x1c, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_062[] = { + {TITLE, "dhcpv6 01-062", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_062_size = sizeof(tahi_dhcpv6_01_062) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_063.c b/test/regression/tahi_test/tahi_dhcpv6_01_063.c new file mode 100644 index 00000000..92055ba2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_063.c @@ -0,0 +1,367 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt9[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt12[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt13[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x13, 0x07, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x0f, 0xe7, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x05, 0xdc, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt17[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x09, 0xa7, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x0c, 0x1c, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_063[] = { + {TITLE, "dhcpv6 01-063", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 4}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_063_size = sizeof(tahi_dhcpv6_01_063) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_064.c b/test/regression/tahi_test/tahi_dhcpv6_01_064.c new file mode 100644 index 00000000..bf9e04f8 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_064.c @@ -0,0 +1,392 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (126 bytes) */ +static char pkt17[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0x4c, 0x07, 0x52, /* .".HgL.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x03, 0x00, 0x00 /* ...... */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_064[] = { + {TITLE, "dhcpv6 01-064", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + + {N_CHECK, (CHAR *)DECLINE, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_064_size = sizeof(tahi_dhcpv6_01_064) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_065.c b/test/regression/tahi_test/tahi_dhcpv6_01_065.c new file mode 100644 index 00000000..1b3efdc4 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_065.c @@ -0,0 +1,144 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (70 bytes) */ +static char pkt1[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt2[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (126 bytes) */ +static char pkt5[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x48, 0x0d, 0xb6, 0x02, 0x3e, /* .".H...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x02, 0x00, 0x00 /* ...... */ + }; + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_065[] = { + {TITLE, "dhcpv6 01-065", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 30}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_065_size = sizeof(tahi_dhcpv6_01_065) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_066.c b/test/regression/tahi_test/tahi_dhcpv6_01_066.c new file mode 100644 index 00000000..5f71a6c9 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_066.c @@ -0,0 +1,362 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt9[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt13[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt16[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xce, 0xed, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt17[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xc7, 0x1d, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_066[] = { + {TITLE, "dhcpv6 01-066", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {WAIT, NX_NULL, 0, 50}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 20}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_066_size = sizeof(tahi_dhcpv6_01_066) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_067.c b/test/regression/tahi_test/tahi_dhcpv6_01_067.c new file mode 100644 index 00000000..970ac765 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_067.c @@ -0,0 +1,497 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (146 bytes) */ +static char pkt1[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xb7, 0x7d, 0x06, 0x52, /* .#.\.}.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x1b, 0x58, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .X...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (110 bytes) */ +static char pkt2[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt11[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt12[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt13[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (198 bytes) */ +static char pkt18[198] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x90, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x90, 0xc5, 0x88, 0x07, 0x52, /* .".....R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x54, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .T...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x20, 0x3f, 0xfe, /* ..... ?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, /* ....ff.. */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x0d, /* .d...... */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, /* ........ */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ + }; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x00, 0x66, 0x66, 0x00, 0x11, /* 33..ff.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x66, 0x66, 0x87, 0x00, /* ....ff.. */ + 0x67, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* g.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66 /* ....ff */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x00, 0x66, 0x66, 0x00, 0x11, /* 33..ff.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x66, 0x66, 0x87, 0x00, /* ....ff.. */ + 0x67, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* g.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66 /* ....ff */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x00, 0x66, 0x66, 0x00, 0x11, /* 33..ff.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x66, 0x66, 0x87, 0x00, /* ....ff.. */ + 0x67, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* g.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66 /* ....ff */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x80, 0x00, /* ....ff.. */ + 0xea, 0xae, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x3f, 0xfe, /* ....ff?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe9, 0xae, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_067[] = { + {TITLE, "dhcpv6 01-067", 13, 0}, + + {CHECK, &pkt9[0], sizeof(pkt9), 30}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + {WAIT, NX_NULL, 0, 47}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + + {CHECK, &pkt19[0], sizeof(pkt19), 20}, + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {INJECT, &pkt24[0], sizeof(pkt24), 0}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + + {INJECT, &pkt26[0], sizeof(pkt26), 0}, + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_067_size = sizeof(tahi_dhcpv6_01_067) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_068.c b/test/regression/tahi_test/tahi_dhcpv6_01_068.c new file mode 100644 index 00000000..0d50eaa7 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_068.c @@ -0,0 +1,709 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt8[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt10[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt18[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt19[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0x74, 0x6b, 0x07, 0x52, /* .".ltk.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x19, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .....P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x64, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* .d...... */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (164 bytes) */ +static char pkt25[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc4, 0xa4, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x19, /* ........ */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x64, /* ...2...d */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt26[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc0, 0xbc, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x19, /* ........ */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x64, /* ...2...d */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt27[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xb8, 0xec, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x19, /* ........ */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x64, /* ...2...d */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt28[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0x80, 0x02, 0x06, 0x96, /* .#.\.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, /* ........ */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x64, 0x00, 0x06, /* .2...d.. */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt29[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x78, 0x3f, 0x01, 0x96, /* .#.@x?.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt30[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0xdb, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt31[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0x13, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt32[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x75, 0x83, 0x01, 0x96, /* .#.@u... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (118 bytes) */ +static char pkt34[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x72, 0x63, 0x01, 0x96, /* .#.@rc.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt35[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0x23, 0x01, 0x96, /* .#.@l#.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt36[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x5f, 0xa3, 0x01, 0x96, /* .#.@_... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x18, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_068[] = { + {TITLE, "dhcpv6 01-068", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + + {WAIT, NX_NULL, 0, 45}, + {CHECK, &pkt18[0], sizeof(pkt18), 5}, + {INJECT, &pkt19[0], sizeof(pkt19), 0}, + + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + {WAIT, NX_NULL, 0, 5}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + {CHECK, &pkt23[0], sizeof(pkt23), 5}, + {CHECK, &pkt24[0], sizeof(pkt24), 5}, + + + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt25[0], sizeof(pkt25), 5}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt26[0], sizeof(pkt26), 5}, + {WAIT, NX_NULL, 0, 20}, + {CHECK, &pkt27[0], sizeof(pkt27), 5}, + {WAIT, NX_NULL, 0, 40}, + {CHECK, &pkt28[0], sizeof(pkt28), 5}, + + + {INJECT, &pkt33[0], sizeof(pkt33), 0}, + {N_CHECK, (CHAR *)ER, 0 , 10}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_068_size = sizeof(tahi_dhcpv6_01_068) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_069.c b/test/regression/tahi_test/tahi_dhcpv6_01_069.c new file mode 100644 index 00000000..19049f25 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_069.c @@ -0,0 +1,528 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt10[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt12[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt20[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt21[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0x75, 0x6a, 0x07, 0x52, /* .".luj.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, /* ........ */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt22[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x78, 0x3f, 0x01, 0x96, /* .#.@x?.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt23[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0xdb, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt24[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0x13, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (118 bytes) */ +static char pkt26[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x75, 0x83, 0x01, 0x96, /* .#.@u... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt27[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x72, 0x63, 0x01, 0x96, /* .#.@rc.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt28[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0x23, 0x01, 0x96, /* .#.@l#.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_069[] = { + {TITLE, "dhcpv6 01-069", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 5}, + + {WAIT, NX_NULL, 0, 50}, + + {CHECK, &pkt20[0], sizeof(pkt20), 5}, + {INJECT, &pkt21[0], sizeof(pkt21), 0}, + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt25[0], sizeof(pkt25), 0}, + + {N_CHECK, (CHAR *)ER, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_069_size = sizeof(tahi_dhcpv6_01_069) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_070.c b/test/regression/tahi_test/tahi_dhcpv6_01_070.c new file mode 100644 index 00000000..1a864484 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_070.c @@ -0,0 +1,452 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt9[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (126 bytes) */ +static char pkt18[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0xd9, 0x07, 0x52, /* .".Hg..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, /* ........ */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt19[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_070[] = { + {TITLE, "dhcpv6 01-070", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + + {WAIT, NX_NULL, 0, 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + {WAIT, NX_NULL, 0, 50}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_070_size = sizeof(tahi_dhcpv6_01_070) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_071.c b/test/regression/tahi_test/tahi_dhcpv6_01_071.c new file mode 100644 index 00000000..4f5f4d72 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_071.c @@ -0,0 +1,313 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt12[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt13[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (110 bytes) */ +static char pkt15[110] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0xfe, 0x80, /* ...8.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x38, 0x87, 0xb4, 0x07, 0x08, /* .".8.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x0d, /* ........ */ + 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 /* ...... */ + }; + +/* Frame (164 bytes) */ +static char pkt16[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0xd0, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0xc8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_071[] = { + {TITLE, "dhcpv6 01-071", 13, 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 30}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_071_size = sizeof(tahi_dhcpv6_01_071) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_072.c b/test/regression/tahi_test/tahi_dhcpv6_01_072.c new file mode 100644 index 00000000..d835f7f4 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_072.c @@ -0,0 +1,324 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt8[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (110 bytes) */ +static char pkt10[110] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x11, 0x40, 0xfe, 0x80, /* ...8.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x38, 0x87, 0xb0, 0x07, 0x08, /* .".8.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x0d, /* ........ */ + 0x00, 0x04, 0x00, 0x05, 0x00, 0x00 /* ...... */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt12[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0xd0, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0xc8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt13[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9a, 0x40, 0x03, 0x08, /* .#.n.@.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0x58, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .X...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x97, 0x20, 0x03, 0x08, /* .#.n. .. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0x78, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .x...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x90, 0xe0, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_072[] = { + {TITLE, "dhcpv6 01-072", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_072_size = sizeof(tahi_dhcpv6_01_072) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_073.c b/test/regression/tahi_test/tahi_dhcpv6_01_073.c new file mode 100644 index 00000000..6ad57f53 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_073.c @@ -0,0 +1,324 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt7[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (126 bytes) */ +static char pkt9[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0xea, 0x6b, 0x07, 0x08, /* .".H.k.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00 /* ...... */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xcb, 0xc1, 0x01, 0x52, /* .#.@...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt11[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xcb, 0x5d, 0x01, 0x52, /* .#.@.].R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt12[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xca, 0x95, 0x01, 0x52, /* .#.@...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_073[] = { + {TITLE, "dhcpv6 01-073", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_073_size = sizeof(tahi_dhcpv6_01_073) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_074.c b/test/regression/tahi_test/tahi_dhcpv6_01_074.c new file mode 100644 index 00000000..2b3d44f3 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_074.c @@ -0,0 +1,439 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt6[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x5c, 0xf7, 0x2e, 0x07, 0x08, /* .".\.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt14[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt15[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (154 bytes) */ +static char pkt16[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0x73, 0xe9, 0x07, 0x52, /* .".ds..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x04, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (118 bytes) */ +static char pkt17[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x78, 0x3f, 0x01, 0x96, /* .#.@x?.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt18[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0xdb, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt19[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0x13, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt20[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x75, 0x83, 0x01, 0x96, /* .#.@u... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt21[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x72, 0x63, 0x01, 0x96, /* .#.@rc.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt22[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0x23, 0x01, 0x96, /* .#.@l#.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_074[] = { + {TITLE, "dhcpv6 01-074", 13, 0}, + + {WAIT, NX_NULL, 0, 20}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 10}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_074_size = sizeof(tahi_dhcpv6_01_074) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_075.c b/test/regression/tahi_test/tahi_dhcpv6_01_075.c new file mode 100644 index 00000000..0f79a093 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_075.c @@ -0,0 +1,536 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt21[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (162 bytes) */ +static char pkt22[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0x73, 0xbc, 0x07, 0x52, /* .".ls..R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt25[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x4d, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* M.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (164 bytes) */ +static char pkt28[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc3, 0xf5, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt29[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc0, 0x0d, 0x05, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_075[] = { + {TITLE, "dhcpv6 01-075", 13, 0}, + + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt7[0], sizeof(pkt7), 10}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + {CHECK, &pkt19[0], sizeof(pkt19), 10}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt21[0], sizeof(pkt21), 5}, + {INJECT, &pkt22[0], sizeof(pkt22), 0}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, + {CHECK, &pkt24[0], sizeof(pkt24), 10}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_075_size = sizeof(tahi_dhcpv6_01_075) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_076.c b/test/regression/tahi_test/tahi_dhcpv6_01_076.c new file mode 100644 index 00000000..a39f1e8a --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_076.c @@ -0,0 +1,479 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt5[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt8[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt9[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt10[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (126 bytes) */ +static char pkt15[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0x4c, 0x07, 0x52, /* .".HgL.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x03, 0x00, 0x00 /* ...... */ + }; + +/* Frame (164 bytes) */ +static char pkt16[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc5, 0xf5, 0x03, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc5, 0x91, 0x03, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt18[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc4, 0xc9, 0x03, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt19[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc3, 0x39, 0x03, 0x96, /* .#.n.9.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_076[] = { + {TITLE, "dhcpv6 01-076", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {WAIT, NX_NULL, 0, 50}, /* Wait for the RENEW. */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + + {CHECK, &pkt16[0], sizeof(pkt16), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_076_size = sizeof(tahi_dhcpv6_01_076) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_077.c b/test/regression/tahi_test/tahi_dhcpv6_01_077.c new file mode 100644 index 00000000..203e385e --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_077.c @@ -0,0 +1,478 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt12[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (126 bytes) */ +static char pkt13[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0x4c, 0x07, 0x52, /* .".HgL.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x03, 0x00, 0x00 /* ...... */ + }; + +/* Frame (164 bytes) */ +static char pkt14[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc5, 0xf5, 0x03, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc5, 0x91, 0x03, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt16[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc4, 0xc9, 0x03, 0x96, /* .#.n.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt17[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0xc3, 0x39, 0x03, 0x96, /* .#.n.9.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_077[] = { + {TITLE, "dhcpv6 01-077", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 50}, /* Wait for the RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {WAIT, NX_NULL, 0, 10}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 20}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_077_size = sizeof(tahi_dhcpv6_01_077) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_078.c b/test/regression/tahi_test/tahi_dhcpv6_01_078.c new file mode 100644 index 00000000..d22e8790 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_078.c @@ -0,0 +1,395 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (102 bytes) */ +static char pkt11[102] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0x40, 0xfe, 0x80, /* ...0.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x30, 0x04, 0xb6, 0x07, 0x52, /* .".0...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ + }; + +/* Frame (164 bytes) */ +static char pkt12[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt13[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x0f, 0xa8, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x07, 0xd0, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt14[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_078[] = { + {TITLE, "dhcpv6 01-078", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for the RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_078_size = sizeof(tahi_dhcpv6_01_078) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_079.c b/test/regression/tahi_test/tahi_dhcpv6_01_079.c new file mode 100644 index 00000000..d1067327 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_079.c @@ -0,0 +1,386 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (146 bytes) */ +static char pkt12[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (102 bytes) */ +static char pkt13[102] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0x40, 0xfe, 0x80, /* ...0.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x30, 0x04, 0xb6, 0x07, 0x52, /* .".0...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ + }; + +/* Frame (146 bytes) */ +static char pkt14[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_079[] = { + {TITLE, "dhcpv6 01-079", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for the RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {WAIT, NX_NULL, 0, 10}, /* Wait for the RENEW. */ + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 20}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_079_size = sizeof(tahi_dhcpv6_01_079) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_080.c b/test/regression/tahi_test/tahi_dhcpv6_01_080.c new file mode 100644 index 00000000..02025fb3 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_080.c @@ -0,0 +1,331 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (70 bytes) */ +static char pkt1[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt2[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt5[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt7[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (126 bytes) */ +static char pkt16[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0x4c, 0x07, 0x52, /* .".HgL.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x03, 0x00, 0x00 /* ...... */ + }; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_080[] = { + {TITLE, "dhcpv6 01-080", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 30}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + {N_CHECK, (CHAR *)RELEASE, 0 , 10}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {N_CHECK, (CHAR *)ER, 0, 15}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_080_size = sizeof(tahi_dhcpv6_01_080) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_081.c b/test/regression/tahi_test/tahi_dhcpv6_01_081.c new file mode 100644 index 00000000..58267742 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_081.c @@ -0,0 +1,323 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (126 bytes) */ +static char pkt15[126] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x48, 0x67, 0x4c, 0x07, 0x52, /* .".HgL.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x14, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x03, 0x00, 0x00 /* ...... */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_081[] = { + {TITLE, "dhcpv6 01-081", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {INJECT, &pkt15[0], sizeof(pkt15), 0}, + + {N_CHECK, (CHAR *)DECLINE, 0 , 10}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, + {N_CHECK, (CHAR *)ER, 0, 15}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_081_size = sizeof(tahi_dhcpv6_01_081) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_082.c b/test/regression/tahi_test/tahi_dhcpv6_01_082.c new file mode 100644 index 00000000..79d2d82d --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_082.c @@ -0,0 +1,189 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x78, 0x3f, 0x01, 0x96, /* .#.@x?.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (128 bytes) */ +static char pkt4[128] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x4a, 0x11, 0x40, 0xfe, 0x80, /* ...J.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x4a, 0xe1, 0xea, 0x02, 0x96, /* .".J.... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x28, /* "3DV...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8 /* ...d.... */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0xdb, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x77, 0x13, 0x01, 0x96, /* .#.@w... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x75, 0x83, 0x01, 0x96, /* .#.@u... */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x72, 0x63, 0x01, 0x96, /* .#.@rc.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0x23, 0x01, 0x96, /* .#.@l#.. */ + 0xe4, 0xa4, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_082[] = { + {TITLE, "dhcpv6 01-082", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_082_size = sizeof(tahi_dhcpv6_01_082) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_083.c b/test/regression/tahi_test/tahi_dhcpv6_01_083.c new file mode 100644 index 00000000..bebec755 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_083.c @@ -0,0 +1,250 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (128 bytes) */ +static char pkt7[128] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x4a, 0x11, 0x40, 0xfe, 0x80, /* ...J.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x4a, 0xb4, 0xfe, 0x02, 0x3e, /* .".J...> */ + 0xf0, 0x12, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8 /* ...d.... */ +}; + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt11[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x67, 0x4d, 0x01, 0x3e, /* .#.@gM.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt12[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x61, 0x0d, 0x01, 0x3e, /* .#.@a..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt13[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x54, 0x8d, 0x01, 0x3e, /* .#.@T..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x18, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_083[] = { + {TITLE, "dhcpv6 01-083", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_083_size = sizeof(tahi_dhcpv6_01_083) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_084.c b/test/regression/tahi_test/tahi_dhcpv6_01_084.c new file mode 100644 index 00000000..c7bc0d23 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_084.c @@ -0,0 +1,1555 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (118 bytes) */ +static char pkt1[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x3b, 0x8d, 0x01, 0x3e, /* .#.@;..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x31, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* 1....... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt2[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x0c, 0xad, 0x01, 0x3e, /* .#.@...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x60, 0x7c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* `|...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xdd, 0xcc, 0x01, 0x3e, /* .#.@...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x8f, 0x5c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .\...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xae, 0xec, 0x01, 0x3e, /* .#.@...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xbe, 0x3c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .<...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x80, 0x0c, 0x01, 0x3e, /* .#.@...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xed, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt11[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt12[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt13[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt14[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt15[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt16[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt17[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt18[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt19[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt20[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt21[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt22[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt23[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt24[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt25[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt26[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt27[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt28[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt29[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt30[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt31[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt32[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt33[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt34[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt35[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt36[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt37[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt38[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt39[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt40[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt41[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt42[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt43[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt44[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt45[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt46[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt47[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt48[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt49[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt50[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt51[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt52[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt53[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt54[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt55[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt56[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt57[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt58[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt59[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt60[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt61[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt62[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt63[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt64[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt65[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0xff, 0xff, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (110 bytes) */ +static char pkt66[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt67[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt68[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt69[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt70[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt71[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt72[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (146 bytes) */ +static char pkt73[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0xb4, 0x01, 0x02, 0x3e, /* .".\...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ +}; + +/* Frame (118 bytes) */ +static char pkt74[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (70 bytes) */ +static char pkt75[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (118 bytes) */ +static char pkt76[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (70 bytes) */ +static char pkt77[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (118 bytes) */ +static char pkt78[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt79[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt80[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt81[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt82[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt83[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt84[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_084[] = { + {TITLE, "dhcpv6 01-084", 13, 0}, + + {CHECK, &pkt71[0], sizeof(pkt71), 30}, + {INJECT, &pkt73[0], sizeof(pkt73), 0}, + {CHECK, &pkt74[0], sizeof(pkt74), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_084_size = sizeof(tahi_dhcpv6_01_084) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_085.c b/test/regression/tahi_test/tahi_dhcpv6_01_085.c new file mode 100644 index 00000000..a8e93850 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_085.c @@ -0,0 +1,235 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x0a, 0xc8, 0x02, 0x00, /* .".\.... */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_085[] = { + {TITLE, "dhcpv6 01-085", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_085_size = sizeof(tahi_dhcpv6_01_085) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_086.c b/test/regression/tahi_test/tahi_dhcpv6_01_086.c new file mode 100644 index 00000000..a9ce32f2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_086.c @@ -0,0 +1,325 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static const unsigned char pkt1[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ +0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ +0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt2[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static const unsigned char pkt3[118] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (146 bytes) */ +static const unsigned char pkt4[146] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ +0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ +0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ +0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ +0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ +0x00, 0xc8 /* .. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt5[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (136 bytes) */ +static const unsigned char pkt6[136] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x52, 0x11, 0x40, 0xfe, 0x80, /* ...R.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ +0x02, 0x22, 0x00, 0x52, 0xb3, 0x6b, 0x07, 0x08, /* .".R.k.. */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x28, /* "3DV...( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ........ */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt7[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +#if 0 +/* Frame (164 bytes) */ +static const unsigned char pkt8[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt9[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x99, 0xdc, 0x03, 0x08, /* .#.n.... */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt10[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x96, 0xbc, 0x03, 0x08, /* .#.n.... */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x05, 0xdc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt11[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt12[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt13[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt14[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt15[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt16[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_086[] = { + {TITLE, "dhcpv6 01-086", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_086_size = sizeof(tahi_dhcpv6_01_086) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_087.c b/test/regression/tahi_test/tahi_dhcpv6_01_087.c new file mode 100644 index 00000000..8432833c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_087.c @@ -0,0 +1,271 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static const unsigned char pkt1[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ +0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ +0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt2[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static const unsigned char pkt3[118] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (146 bytes) */ +static const unsigned char pkt4[146] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ +0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ +0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ +0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ +0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ +0x00, 0xc8 /* .. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt5[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (146 bytes) */ +static const unsigned char pkt6[146] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ +0x02, 0x22, 0x00, 0x5c, 0x05, 0xc7, 0x07, 0x00, /* .".\.... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ +0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ +0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ +0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ +0x00, 0xc8 /* .. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt7[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +#if 0 +/* Frame (164 bytes) */ +static const unsigned char pkt8[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt9[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x99, 0xdc, 0x03, 0x08, /* .#.n.... */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x02, 0xbc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt10[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x96, 0xbc, 0x03, 0x08, /* .#.n.... */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x05, 0xdc, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; + +/* Frame (164 bytes) */ +static const unsigned char pkt11[164] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x6e, 0x90, 0x7c, 0x03, 0x08, /* .#.n.|.. */ +0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x0c, 0x1c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ +0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ +0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ +0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ +0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ +0x00, 0x29, 0x00, 0x18 /* .).. */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_087[] = { + {TITLE, "dhcpv6 01-087", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_087_size = sizeof(tahi_dhcpv6_01_087) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_088.c b/test/regression/tahi_test/tahi_dhcpv6_01_088.c new file mode 100644 index 00000000..8e7ba817 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_088.c @@ -0,0 +1,347 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x50, 0x00, 0x00, 0x00, 0x32, 0x00, 0x05, /* .P...2.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0xd0, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0xc8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9a, 0x40, 0x03, 0x08, /* .#.n.@.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0x58, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .X...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x97, 0x20, 0x03, 0x08, /* .#.n. .. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0x78, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .x...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_088[] = { + {TITLE, "dhcpv6 01-088", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (CHAR *)ER, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_088_size = sizeof(tahi_dhcpv6_01_088) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_089.c b/test/regression/tahi_test/tahi_dhcpv6_01_089.c new file mode 100644 index 00000000..5dda2f0c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_089.c @@ -0,0 +1,291 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (162 bytes) */ +static char pkt6[162] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x6c, 0x11, 0x40, 0xfe, 0x80, /* ...l.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x6c, 0xf6, 0xdc, 0x07, 0x08, /* .".l.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* .d...... */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0xd0, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0xc8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9a, 0x40, 0x03, 0x08, /* .#.n.@.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0x58, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .X...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x97, 0x20, 0x03, 0x08, /* .#.n. .. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0x78, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .x...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt12[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x90, 0xe0, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0b, 0xb8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_089[] = { + {TITLE, "dhcpv6 01-089", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {N_CHECK, (CHAR *)ER, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_089_size = sizeof(tahi_dhcpv6_01_089) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_090.c b/test/regression/tahi_test/tahi_dhcpv6_01_090.c new file mode 100644 index 00000000..37b46f6e --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_090.c @@ -0,0 +1,405 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt2[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x85, 0x28, 0x03, 0x08, /* .#.n.(.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x17, 0x70, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .p...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt9[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt11[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (108 bytes) */ +static char pkt16[108] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x36, 0x11, 0x01, 0xfe, 0x80, /* ...6.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x36, 0x96, 0xe3, 0x01, 0x00, /* .".6.... */ + 0x00, 0x64, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x03, 0x00, 0x0c, /* ........ */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, 0x00, 0x04, /* ...P.... */ + 0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_090[] = { + {TITLE, "dhcpv6 01-090", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + + {WAIT, NX_NULL, 0, 2}, + {INJECT, &pkt16[0], sizeof(pkt16), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_090_size = sizeof(tahi_dhcpv6_01_090) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_091.c b/test/regression/tahi_test/tahi_dhcpv6_01_091.c new file mode 100644 index 00000000..c1c70b44 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_091.c @@ -0,0 +1,215 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt10[126] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x40, 0xfe, 0x80, /* ...H.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x48, 0xd8, 0x84, 0x03, 0x00, /* .".H.... */ + 0x00, 0x65, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .e...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_091[] = { + {TITLE, "dhcpv6 01-091", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 2}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_091_size = sizeof(tahi_dhcpv6_01_091) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_092.c b/test/regression/tahi_test/tahi_dhcpv6_01_092.c new file mode 100644 index 00000000..3073b85c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_092.c @@ -0,0 +1,431 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt2[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt3[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt11[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt12[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt13[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (108 bytes) */ +static char pkt18[108] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x36, 0x11, 0x01, 0xfe, 0x80, /* ...6.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x36, 0x94, 0x60, 0x04, 0x00, /* .".6.`.. */ + 0x00, 0x69, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .i...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x03, 0x00, 0x0c, /* ........ */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, /* ........ */ + 0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_092[] = { + {TITLE, "dhcpv6 01-092", 13, 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 30}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_092_size = sizeof(tahi_dhcpv6_01_092) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_093.c b/test/regression/tahi_test/tahi_dhcpv6_01_093.c new file mode 100644 index 00000000..268646b1 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_093.c @@ -0,0 +1,250 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt10[126] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x01, 0xfe, 0x80, /* ...H.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x48, 0xd6, 0x7f, 0x05, 0x00, /* .".H.... */ + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .j...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_093[] = { + {TITLE, "dhcpv6 01-093", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_093_size = sizeof(tahi_dhcpv6_01_093) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_094.c b/test/regression/tahi_test/tahi_dhcpv6_01_094.c new file mode 100644 index 00000000..df2a7d15 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_094.c @@ -0,0 +1,313 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (70 bytes) */ +static char pkt1[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt2[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt5[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt7[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (108 bytes) */ +static char pkt11[108] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x36, 0x11, 0x01, 0xfe, 0x80, /* ...6.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x36, 0x91, 0xdd, 0x06, 0x00, /* .".6.... */ + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .j...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x03, 0x00, 0x0c, /* ........ */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, 0x00, 0x04, /* ...P.... */ + 0x00, 0x00, 0x00, 0x00 /* .... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_094[] = { + {TITLE, "dhcpv6 01-094", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 30}, + {INJECT, &pkt5[0], sizeof(pkt5), 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 5}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_094_size = sizeof(tahi_dhcpv6_01_094) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_095.c b/test/regression/tahi_test/tahi_dhcpv6_01_095.c new file mode 100644 index 00000000..854b267a --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_095.c @@ -0,0 +1,299 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt10[126] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x01, 0xfe, 0x80, /* ...H.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x48, 0xd2, 0x7d, 0x09, 0x00, /* .".H.}.. */ + 0x00, 0x6c, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .l...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_095[] = { + {TITLE, "dhcpv6 01-095", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_095_size = sizeof(tahi_dhcpv6_01_095) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_096.c b/test/regression/tahi_test/tahi_dhcpv6_01_096.c new file mode 100644 index 00000000..cc8a5e87 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_096.c @@ -0,0 +1,301 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (126 bytes) */ +static char pkt10[126] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x48, 0x11, 0x01, 0xfe, 0x80, /* ...H.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x48, 0xd3, 0x7e, 0x08, 0x00, /* .".H.~.. */ + 0x00, 0x6b, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .k...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x0d, /* .2...P.. */ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_01_096[] = { + {TITLE, "dhcpv6 01-096", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_096_size = sizeof(tahi_dhcpv6_01_096) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_097.c b/test/regression/tahi_test/tahi_dhcpv6_01_097.c new file mode 100644 index 00000000..5eb50eff --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_097.c @@ -0,0 +1,310 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (192 bytes) */ +static char pkt10[192] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa4, 0xa4, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x8a, 0x11, 0x20, 0x3f, 0xfe, /* ..... ?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa4, 0xa4, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x23, /* .......# */ + 0x02, 0x22, 0x00, 0x8a, 0x08, 0xfd, 0x0c, 0x00, /* ."...... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x01, /* ?....... */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0xa5, 0xa5, /* ........ */ + 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, /* ........ */ + 0x00, 0x09, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x64, /* ...\...d */ + 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, /* ........ */ + 0x00, 0x03, 0x0d, 0x40, 0x00, 0x11, 0x22, 0x33, /* ...@.."3 */ + 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* DV...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, /* .."..3DV */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ........ */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_097[] = { + {TITLE, "dhcpv6 01-097", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_097_size = sizeof(tahi_dhcpv6_01_097) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_098.c b/test/regression/tahi_test/tahi_dhcpv6_01_098.c new file mode 100644 index 00000000..3782b16c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_098.c @@ -0,0 +1,311 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (200 bytes) */ +static char pkt10[200] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x92, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x23, /* .......# */ + 0x02, 0x22, 0x00, 0x92, 0x36, 0xf8, 0x0d, 0x00, /* ."..6... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, /* ........ */ + 0x00, 0x12, 0x00, 0x04, 0x01, 0x01, 0x01, 0x01, /* ........ */ + 0x00, 0x09, 0x00, 0x5c, 0x07, 0x00, 0x00, 0x68, /* ...\...h */ + 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, /* ........ */ + 0x00, 0x03, 0x0d, 0x40, 0x00, 0x11, 0x22, 0x33, /* ...@.."3 */ + 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* DV...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, /* .."..3DV */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 /* ........ */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_098[] = { + {TITLE, "dhcpv6 01-098", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_098_size = sizeof(tahi_dhcpv6_01_098) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_01_099.c b/test/regression/tahi_test/tahi_dhcpv6_01_099.c new file mode 100644 index 00000000..6598035b --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_01_099.c @@ -0,0 +1,218 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (146 bytes) */ +static char pkt4[146] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x5c, 0x1a, 0x77, 0x02, 0x3e, /* .".\.w.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (154 bytes) */ +static char pkt6[154] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x64, 0x11, 0x40, 0xfe, 0x80, /* ...d.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x64, 0xf7, 0x0d, 0x07, 0x08, /* .".d.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (116 bytes) */ +static char pkt10[116] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x3e, 0x11, 0x01, 0xfe, 0x80, /* ...>.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x22, 0x00, 0x3e, 0x5b, 0x9d, 0x0b, 0x00, /* .".>[... */ + 0x00, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x06, /* ........ */ + 0x00, 0x02, 0x00, 0x17, 0x00, 0x0d, 0x00, 0x04, /* ........ */ + 0x00, 0x00, 0x00, 0x00 /* .... */ +}; + + + + +TAHI_TEST_SEQ tahi_dhcpv6_01_099[] = { + {TITLE, "dhcpv6 01-099", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR *)ANY, 0, 10}, + + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_01_099_size = sizeof(tahi_dhcpv6_01_099) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_002.c b/test/regression/tahi_test/tahi_dhcpv6_04_002.c new file mode 100644 index 00000000..ebd250d6 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_002.c @@ -0,0 +1,150 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt4[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_002[] = { + {TITLE, "dhcpv6 04-002", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_002_size = sizeof(tahi_dhcpv6_04_002) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_003.c b/test/regression/tahi_test/tahi_dhcpv6_04_003.c new file mode 100644 index 00000000..dbb07b85 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_003.c @@ -0,0 +1,260 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt9[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6a, 0x6d, 0x01, 0x3e, /* .#.@jm.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_003[] = { + {TITLE, "dhcpv6 04-003", 13, 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_003_size = sizeof(tahi_dhcpv6_04_003) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_004.c b/test/regression/tahi_test/tahi_dhcpv6_04_004.c new file mode 100644 index 00000000..7f4c9494 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_004.c @@ -0,0 +1,221 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt3[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt7[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_04_004[] = { + {TITLE, "dhcpv6 04-004", 13, 0}, + + {CHECK, &pkt5[0], sizeof(pkt5), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_004_size = sizeof(tahi_dhcpv6_04_004) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_005.c b/test/regression/tahi_test/tahi_dhcpv6_04_005.c new file mode 100644 index 00000000..3f226216 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_005.c @@ -0,0 +1,191 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_005[] = { + {TITLE, "dhcpv6 04-005", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_005_size = sizeof(tahi_dhcpv6_04_005) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_006.c b/test/regression/tahi_test/tahi_dhcpv6_04_006.c new file mode 100644 index 00000000..773bbba9 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_006.c @@ -0,0 +1,256 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_006[] = { + {TITLE, "dhcpv6 04-006", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_006_size = sizeof(tahi_dhcpv6_04_006) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_007.c b/test/regression/tahi_test/tahi_dhcpv6_04_007.c new file mode 100644 index 00000000..8a1e52a1 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_007.c @@ -0,0 +1,255 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (168 bytes) */ +static char pkt4[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x72, 0xcf, 0x6c, 0x02, 0x3e, /* .".r.l.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt6[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x34, 0x03, 0x08, /* .#.n.4.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (164 bytes) */ +static char pkt7[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9b, 0x6c, 0x03, 0x08, /* .#.n.l.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* .,...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_007[] = +{ + {TITLE, "dhcpv6 04-007", 13, 0}, + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_007_size = sizeof(tahi_dhcpv6_04_007) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_008.c b/test/regression/tahi_test/tahi_dhcpv6_04_008.c new file mode 100644 index 00000000..4d0b2069 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_008.c @@ -0,0 +1,370 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt6[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0x70, 0x81, 0x07, 0x08, /* .".xp... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt10[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt11[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt12[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt13[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_008[] = { + {TITLE, "dhcpv6 04-008", 13, 0}, + {WAIT, NX_NULL, 0, 15}, + {CHECK, &pkt3[0], sizeof(pkt3), 10}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_008_size = sizeof(tahi_dhcpv6_04_008) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_009.c b/test/regression/tahi_test/tahi_dhcpv6_04_009.c new file mode 100644 index 00000000..6cb4a45b --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_009.c @@ -0,0 +1,312 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (168 bytes) */ +static char pkt4[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x72, 0xcf, 0x6c, 0x02, 0x3e, /* .".r.l.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (176 bytes) */ +static char pkt6[176] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x7a, 0xac, 0x03, 0x07, 0x08, /* .".z.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt10[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt11[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt12[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt13[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt14[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd3, 0xc7, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_009[] = { + {TITLE, "dhcpv6 04-009", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {WAIT, NX_NULL, 0, 5}, /* Wait for the valid address state. */ + + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_009_size = sizeof(tahi_dhcpv6_04_009) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_010.c b/test/regression/tahi_test/tahi_dhcpv6_04_010.c new file mode 100644 index 00000000..b1498b0c --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_010.c @@ -0,0 +1,587 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt8[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt9[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt11[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0x70, 0x81, 0x07, 0x08, /* .".xp... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x58, 0x1d, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* X.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt18[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x22, 0x9a, 0x07, 0xf9, /* .5.1"... */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +#if 0 +/* Frame (103 bytes) */ +static char pkt19[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x21, 0x4a, 0x09, 0x49, /* .5.1!J.I */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (103 bytes) */ +static char pkt20[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x1d, 0xea, 0x0c, 0xa9, /* .5.1.... */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt21[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (146 bytes) */ +static char pkt22[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x83, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (146 bytes) */ +static char pkt23[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd6, 0x1f, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .d...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (146 bytes) */ +static char pkt24[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd5, 0x57, 0x04, 0x52, /* .#.\.W.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .,...(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; +#endif + +/* Frame (103 bytes) */ +static char pkt25[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x15, 0xf6, 0x14, 0x9d, /* .5.1.... */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +#if 0 +/* Frame (146 bytes) */ +static char pkt26[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd3, 0xc7, 0x04, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, /* ........ */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +/* Frame (78 bytes) */ +static char pkt27[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt28[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt30[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_010[] = { + {TITLE, "dhcpv6 04-010", 13, 0}, + + {CHECK, &pkt8[0], sizeof(pkt8), 30}, /* DHCPv6 Solicit */ + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* DHCPv6 Reply */ + {CHECK, &pkt10[0], sizeof(pkt10), 5}, /* DHCPv6 Request */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* DHCPv6 Reply */ + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, /* D */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, /* A */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, /* D */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt16[0], sizeof(pkt16), 20}, /* NS */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + {CHECK, &pkt18[0], sizeof(pkt18), 15}, /* Check DNS Query */ + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, /* RA */ + + {DHCPV6_CONFIRM, NX_NULL, 0, 0}, /* DHCPv6 Confirm */ + {CHECK, &pkt22[0], sizeof(pkt22), 5}, /* DHCPv6 Reply */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt25[0], sizeof(pkt25), 5}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_010_size = sizeof(tahi_dhcpv6_04_010) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_012.c b/test/regression/tahi_test/tahi_dhcpv6_04_012.c new file mode 100644 index 00000000..26512aeb --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_012.c @@ -0,0 +1,309 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (182 bytes) */ +static char pkt6[182] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x80, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x80, 0x70, 0x50, 0x07, 0x08, /* ."..pP.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_012[] = { + {TITLE, "dhcpv6 04-012", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + /* DAD */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_012_size = sizeof(tahi_dhcpv6_04_012) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_013.c b/test/regression/tahi_test/tahi_dhcpv6_04_013.c new file mode 100644 index 00000000..3551baee --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_013.c @@ -0,0 +1,308 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (168 bytes) */ +static char pkt4[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x72, 0xcf, 0x6c, 0x02, 0x3e, /* .".r.l.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (184 bytes) */ +static char pkt6[184] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x82, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x82, 0xab, 0xd2, 0x07, 0x08, /* ."...... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_013[] = { + {TITLE, "dhcpv6 04-013", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + /* DAD */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_013_size = sizeof(tahi_dhcpv6_04_013) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_014.c b/test/regression/tahi_test/tahi_dhcpv6_04_014.c new file mode 100644 index 00000000..fd684cfd --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_014.c @@ -0,0 +1,361 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (182 bytes) */ +static char pkt6[182] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x80, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x80, 0x70, 0x50, 0x07, 0x08, /* ."..pP.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + +/* Frame (146 bytes) */ +static char pkt12[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_014[] = { + {TITLE, "dhcpv6 04-014", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + /* DAD */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 10}, + + {WAIT, NX_NULL, 0, 30}, /* Wait for REBIND. */ + {CHECK, &pkt12[0], sizeof(pkt12), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_014_size = sizeof(tahi_dhcpv6_04_014) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_015.c b/test/regression/tahi_test/tahi_dhcpv6_04_015.c new file mode 100644 index 00000000..074bf49b --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_015.c @@ -0,0 +1,359 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (168 bytes) */ +static char pkt4[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x72, 0xcf, 0x6c, 0x02, 0x3e, /* .".r.l.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (184 bytes) */ +static char pkt6[184] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x82, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x82, 0xab, 0xd2, 0x07, 0x08, /* ."...... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x30, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .0...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x20, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* . ?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (164 bytes) */ +static char pkt10[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +#if 0 +/* Frame (164 bytes) */ +static char pkt11[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x13, 0x90, 0x05, 0x52, /* .#.n...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x03, 0xe8, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; +#endif + +/* Frame (146 bytes) */ +static char pkt12[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0xff, 0xfe, 0x80, /* ...\.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xd2, 0xd5, 0x06, 0x52, /* .#.\...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, 0xc0, 0xde, /* .....(.. */ + 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, /* .....2.. */ + 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x00, 0x00, /* ........ */ + 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x06, /* .d...... */ + 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, 0x00, 0x29, /* .......) */ + 0x00, 0x18 /* .. */ + }; + +#if 0 +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_04_015[] = { + {TITLE, "dhcpv6 04-015", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + /* DAD */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 45}, /* Wait for RENEW. */ + {CHECK, &pkt10[0], sizeof(pkt10), 10}, + + {WAIT, NX_NULL, 0, 30}, /* Wait for REBIND. */ + {CHECK, &pkt12[0], sizeof(pkt12), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_015_size = sizeof(tahi_dhcpv6_04_015) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_016.c b/test/regression/tahi_test/tahi_dhcpv6_04_016.c new file mode 100644 index 00000000..b98ba95f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_016.c @@ -0,0 +1,414 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt6[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0x70, 0x81, 0x07, 0x08, /* .".xp... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_016[] = { + {TITLE, "dhcpv6 04-016", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + /* DAD */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for DAD. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_016_size = sizeof(tahi_dhcpv6_04_016) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_017.c b/test/regression/tahi_test/tahi_dhcpv6_04_017.c new file mode 100644 index 00000000..ee1b37fb --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_017.c @@ -0,0 +1,330 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (168 bytes) */ +static char pkt4[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x72, 0xcf, 0x6c, 0x02, 0x3e, /* .".r.l.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (168 bytes) */ +static char pkt6[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x72, 0xac, 0x24, 0x07, 0x08, /* .".r.$.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x80, 0x00, /* ........ */ + 0xa5, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x96, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x30, 0xf3, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* 0.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xa4, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .G...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0xc3, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt15[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x16, 0x5f, 0x08, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt16[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x97, 0x08, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_04_017[] = { + {TITLE, "dhcpv6 04-017", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + /* DAD */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {WAIT, NX_NULL, 0, 5}, /* Wait for DAD. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {INJECT, &pkt12[0], sizeof(pkt12), 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {DHCPV6_RELEASE, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 10}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_017_size = sizeof(tahi_dhcpv6_04_017) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_018.c b/test/regression/tahi_test/tahi_dhcpv6_04_018.c new file mode 100644 index 00000000..8509dd42 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_018.c @@ -0,0 +1,375 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt2[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt4[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt7[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt8[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt9[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0x70, 0x81, 0x07, 0x08, /* .".xp... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt12[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt13[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt14[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_018[] = { + {TITLE, "dhcpv6 04-018", 13, 0}, + + {CHECK, &pkt6[0], sizeof(pkt6), 30}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {INJECT, &pkt11[0], sizeof(pkt11), 0}, + + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_018_size = sizeof(tahi_dhcpv6_04_018) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_019.c b/test/regression/tahi_test/tahi_dhcpv6_04_019.c new file mode 100644 index 00000000..01e8d221 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_019.c @@ -0,0 +1,334 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (168 bytes) */ +static char pkt4[168] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x72, 0x11, 0x40, 0xfe, 0x80, /* ...r.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x72, 0xcf, 0x6c, 0x02, 0x3e, /* .".r.l.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (176 bytes) */ +static char pkt6[176] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x7a, 0x11, 0x40, 0xfe, 0x80, /* ...z.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x7a, 0xac, 0x03, 0x07, 0x08, /* .".z.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* .......t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0xc5, 0xb9, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt9[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0xc3, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +#if 0 +/* Frame (152 bytes) */ +static char pkt10[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x15, 0x5f, 0x09, 0x52, /* .#.b._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x00, 0x64, 0x00, 0x03, 0x00, 0x28, /* ...d...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (152 bytes) */ +static char pkt11[152] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x11, 0xff, 0xfe, 0x80, /* ...b.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x62, 0x14, 0x97, 0x09, 0x52, /* .#.b...R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x08, /* ........ */ + 0x00, 0x02, 0x01, 0x2c, 0x00, 0x03, 0x00, 0x28, /* ...,...( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ + }; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_019[] = { + {TITLE, "dhcpv6 04-019", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + {INJECT, &pkt4[0], sizeof(pkt4), 0}, + {CHECK, &pkt5[0], sizeof(pkt5), 5}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, + {INJECT, &pkt8[0], sizeof(pkt8), 0}, + + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_019_size = sizeof(tahi_dhcpv6_04_019) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_020.c b/test/regression/tahi_test/tahi_dhcpv6_04_020.c new file mode 100644 index 00000000..f1f6c252 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_020.c @@ -0,0 +1,330 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt6[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0x70, 0x81, 0x07, 0x08, /* .".xp... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x58, 0x1d, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* X.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt12[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0xff, 0xc1, 0x2a, 0xd1, /* .5.1..*. */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_020[] = { + {TITLE, "dhcpv6 04-020", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, /* DHCPv6 Solicit */ + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* DHCPv6 Reply */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* DHCPv6 Request */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* DHCPv6 Reply */ + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* D */ + {CHECK, &pkt8[0], sizeof(pkt8), 5}, /* A */ + {CHECK, &pkt9[0], sizeof(pkt9), 5}, /* D */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt10[0], sizeof(pkt10), 20}, /* NS */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 15}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_020_size = sizeof(tahi_dhcpv6_04_020) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_021.c b/test/regression/tahi_test/tahi_dhcpv6_04_021.c new file mode 100644 index 00000000..b19a6756 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_021.c @@ -0,0 +1,336 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (188 bytes) */ +static char pkt4[188] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x86, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x86, 0x48, 0xe0, 0x02, 0x3e, /* ."..H..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x00, 0x18, /* ....?>.. */ + 0x00, 0x12, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, /* ...test. */ + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, /* example. */ + 0x63, 0x6f, 0x6d, 0x00 /* com. */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (196 bytes) */ +static char pkt6[196] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x8e, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x8e, 0x25, 0x77, 0x07, 0x08, /* ."..%w.. */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x00, 0x18, /* ....?>.. */ + 0x00, 0x12, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, /* ...test. */ + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, /* example. */ + 0x63, 0x6f, 0x6d, 0x00 /* com. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x58, 0x1d, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* X.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt12[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x16, 0xf1, 0x13, 0xa2, /* .5.1.... */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt14[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt15[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt17[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_021[] = { + {TITLE, "dhcpv6 04-021", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, /* DHCPv6 Solicit */ + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* DHCPv6 Reply */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* DHCPv6 Request */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* DHCPv6 Reply */ + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* D */ + {CHECK, &pkt8[0], sizeof(pkt8), 5}, /* A */ + {CHECK, &pkt9[0], sizeof(pkt9), 5}, /* D */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt10[0], sizeof(pkt10), 20}, /* NS */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 15}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_021_size = sizeof(tahi_dhcpv6_04_021) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_022.c b/test/regression/tahi_test/tahi_dhcpv6_04_022.c new file mode 100644 index 00000000..c3b8a408 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_022.c @@ -0,0 +1,615 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x5e, 0x00, 0xc0, 0x0b, 0xb8, 0x00, 0x00, /* B^...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (166 bytes) */ +static char pkt4[166] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x70, 0x11, 0x40, 0xfe, 0x80, /* ...p.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x22, /* "..3DV." */ + 0x02, 0x22, 0x00, 0x70, 0x93, 0xea, 0x02, 0x3e, /* .".p...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (164 bytes) */ +static char pkt5[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x9c, 0x98, 0x03, 0x08, /* .#.n.... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt6[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0x70, 0x81, 0x07, 0x08, /* .".xp... */ + 0x0e, 0x90, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ....?> */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x00, 0xab, 0xcd, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xab, 0xcd, 0x87, 0x00, /* ........ */ + 0xdd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x58, 0x1d, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* X.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt12[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x11, 0x46, 0x19, 0x4d, /* .5.1.F.M */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +#if 0 +/* Frame (103 bytes) */ +static char pkt13[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x0f, 0xb6, 0x1a, 0xdd, /* .5.1.... */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (103 bytes) */ +static char pkt14[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x0c, 0x56, 0x1e, 0x3d, /* .5.1.V.= */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; +#endif + +/* Frame (164 bytes) */ +static char pkt15[164] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x6e, 0x11, 0xff, 0xfe, 0x80, /* ...n.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x6e, 0x17, 0x78, 0x05, 0x52, /* .#.n.x.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xc8, /* ...d.... */ + 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, 0x00, 0x1f, /* ........ */ + 0x00, 0x29, 0x00, 0x18 /* .).. */ + }; + +/* Frame (174 bytes) */ +static char pkt16[174] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x78, 0x11, 0x40, 0xfe, 0x80, /* ...x.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x78, 0xee, 0x5f, 0x07, 0x52, /* .".x._.R */ + 0x91, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8, 0x00, 0x0d, 0x00, 0x04, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x17, 0x00, 0x10, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3e, 0x3f /* ....>? */ + }; + +#if 0 +/* Frame (103 bytes) */ +static char pkt17[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0xfc, 0x61, 0x2e, 0x31, /* .5.1.a.1 */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (103 bytes) */ +static char pkt18[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0xfb, 0x11, 0x2f, 0x81, /* .5.1../. */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x12, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x12, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x12, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x5b, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* [.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt25[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3e, 0x3f, 0x00, 0x11, /* 33..>?.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3e, 0x3f, 0x87, 0x00, /* ....>?.. */ + 0x5d, 0xba, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ].....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3e, 0x3f, 0x01, 0x01, /* ....>?.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3e, 0x3f, 0x3f, 0xfe, /* ....>??. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x88, 0x00, /* ........ */ + 0x5a, 0x1b, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* Z.....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3e, 0x3f, 0x02, 0x01, /* ....>?.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt27[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3e, 0x3f, 0x75, 0x30, /* ....>?u0 */ + 0x00, 0x35, 0x00, 0x31, 0xf2, 0x70, 0x39, 0x21, /* .5.1.p9! */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +#if 0 +/* Frame (103 bytes) */ +static char pkt28[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3e, 0x3f, 0x75, 0x30, /* ....>?u0 */ + 0x00, 0x35, 0x00, 0x31, 0xf0, 0xe0, 0x3a, 0xb1, /* .5.1..:. */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt30[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt31[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt34[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_04_022[] = { + {TITLE, "dhcpv6 04-022", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, /* DHCPv6 Solicit */ + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* DHCPv6 Reply */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* DHCPv6 Request */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* DHCPv6 Reply */ + + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* D */ + {CHECK, &pkt8[0], sizeof(pkt8), 5}, /* A */ + {CHECK, &pkt9[0], sizeof(pkt9), 5}, /* D */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt10[0], sizeof(pkt10), 20}, /* NS */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 15}, /* Check DNS Query */ + + {WAIT, NX_NULL, 0 , 40}, /* Wait RENEW. */ + {CHECK, &pkt15[0], sizeof(pkt15), 15}, /* DHCPv6 Renew */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* DHCPv6 Replay */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt25[0], sizeof(pkt25), 20}, /* NS */ + {INJECT, &pkt26[0], sizeof(pkt26), 0}, /* NA */ + {CHECK, &pkt27[0], sizeof(pkt27), 20}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_022_size = sizeof(tahi_dhcpv6_04_022) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_026.c b/test/regression/tahi_test/tahi_dhcpv6_04_026.c new file mode 100644 index 00000000..112044f9 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_026.c @@ -0,0 +1,164 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt2[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt3[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_026[] = { + {TITLE, "dhcpv6 04-026", 13, 0}, + + {CHECK, &pkt3[0], sizeof(pkt3), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_026_size = sizeof(tahi_dhcpv6_04_026) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_04_027.c b/test/regression/tahi_test/tahi_dhcpv6_04_027.c new file mode 100644 index 00000000..d69a3611 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_04_027.c @@ -0,0 +1,386 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (70 bytes) */ +static char pkt1[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt2[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt3[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt4[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt5[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt6[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt13[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x42, 0x9e, 0x00, 0x80, 0x0b, 0xb8, 0x00, 0x00, /* B....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0x80, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, /* @...8@.. */ + 0x1c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* . ....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (118 bytes) */ +static char pkt15[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6d, 0x29, 0x01, 0x3e, /* .#.@m).> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (118 bytes) */ +static char pkt16[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6c, 0xc5, 0x01, 0x3e, /* .#.@l..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (118 bytes) */ +static char pkt17[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0xfe, 0x80, /* ...@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0x6b, 0xfd, 0x01, 0x3e, /* .#.@k..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x03, 0x00, 0x0c, /* "3DV.... */ + 0xc0, 0xde, 0xdb, 0xad, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, /* ........ */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt18[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt19[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_04_027[] = { + {TITLE, "dhcpv6 04-027", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 30}, + {DHCPV6_REBOOT, NX_NULL, 0, 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, /* RS */ + {INJECT, &pkt13[0], sizeof(pkt13), 0}, /* RA */ + + {CHECK, &pkt15[0], sizeof(pkt15), 30}, + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_04_027_size = sizeof(tahi_dhcpv6_04_027) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_002.c b/test/regression/tahi_test/tahi_dhcpv6_07_002.c new file mode 100644 index 00000000..862c9d53 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_002.c @@ -0,0 +1,555 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt8[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt10[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt15[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt16[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x9f, 0xef, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x9c, 0x50, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt19[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x59, 0x71, 0x15, 0x55, /* .5.1Yq.U */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (103 bytes) */ +static char pkt25[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x57, 0xa1, 0x17, 0x25, /* .5.1W..% */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt26[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt27[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt30[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt31[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt32[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt34[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt35[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_002[] = { + {TITLE, "dhcpv6 07-002", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 20}, /* RS */ + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* RA */ + + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* Echo Request */ + {CHECK, &pkt12[0], sizeof(pkt12), 5}, /* NS */ + {INJECT, &pkt13[0], sizeof(pkt13), 0}, /* NA */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, /* Start DHCPv6 Information */ + {CHECK, &pkt15[0], sizeof(pkt15), 5}, /* DHCPv6 Information */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* DHCPv6 Reply */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt17[0], sizeof(pkt17), 5}, /* NS */ + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* NA */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_002_size = sizeof(tahi_dhcpv6_07_002) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_003.c b/test/regression/tahi_test/tahi_dhcpv6_07_003.c new file mode 100644 index 00000000..34e918a2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_003.c @@ -0,0 +1,469 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (86 bytes) */ +static char pkt9[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt12[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt15[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (110 bytes) */ +static char pkt17[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt23[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xe7, 0x48, 0x0b, 0x3e, /* .#.0.H.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x18, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt26[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_003[] = { + {TITLE, "dhcpv6 07-003", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_003_size = sizeof(tahi_dhcpv6_07_003) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_004.c b/test/regression/tahi_test/tahi_dhcpv6_07_004.c new file mode 100644 index 00000000..f9cf3bd2 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_004.c @@ -0,0 +1,455 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x9f, 0xef, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x9c, 0x50, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt12[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x5b, 0x25, 0x13, 0xa1, /* .5.1[%.. */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (103 bytes) */ +static char pkt18[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x59, 0x95, 0x15, 0x31, /* .5.1Y..1 */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt19[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_004[] = { + {TITLE, "dhcpv6 07-004", 13, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, /* Start DHCPv6 Information */ + {CHECK, &pkt8[0], sizeof(pkt8), 5}, /* DHCPv6 Information */ + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* DHCPv6 Replay */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt10[0], sizeof(pkt10), 5}, /* NS */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 5}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_004_size = sizeof(tahi_dhcpv6_07_004) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_005.c b/test/regression/tahi_test/tahi_dhcpv6_07_005.c new file mode 100644 index 00000000..7c4a7af8 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_005.c @@ -0,0 +1,458 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (104 bytes) */ +static char pkt9[104] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x32, 0x11, 0x01, 0xfe, 0x80, /* ...2.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x27, /* "..3DV.' */ + 0x83, 0x00, 0x00, 0x32, 0x39, 0x36, 0x07, 0x3e, /* ...296.> */ + 0xf0, 0x12, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, 0x00, 0x10, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ......?> */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x6a, 0x25, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* j%...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x4b, 0xa1, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, /* K....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (152 bytes) */ +static char pkt12[152] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x62, 0x3a, 0xff, 0xfe, 0x80, /* ...b:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x04, /* ........ */ + 0x86, 0x31, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, /* .1....`. */ + 0x00, 0x00, 0x00, 0x32, 0x11, 0x01, 0xfe, 0x80, /* ...2.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x27, /* "..3DV.' */ + 0x83, 0x00, 0x00, 0x32, 0x39, 0x36, 0x07, 0x3e, /* ...296.> */ + 0xf0, 0x12, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, 0x00, 0x10, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ......?> */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt19[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt20[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt21[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt25[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt26[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_005[] = { + {TITLE, "dhcpv6 07-005", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {CHECK, &pkt10[0], sizeof(pkt10), 5}, /* NS */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 5}, /* Dest unreachable */ + + {INJECT, &pkt13[0], sizeof(pkt13), 0}, /* NA */ + {INJECT, &pkt14[0], sizeof(pkt14), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, /* RA */ + {INJECT, &pkt22[0], sizeof(pkt22), 0}, /* NA */ + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, /* Echo Request */ + {CHECK, &pkt24[0], sizeof(pkt24), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_005_size = sizeof(tahi_dhcpv6_07_005) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_006.c b/test/regression/tahi_test/tahi_dhcpv6_07_006.c new file mode 100644 index 00000000..95bd97c7 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_006.c @@ -0,0 +1,531 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt7[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt14[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt18[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt23[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt27[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt28[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt30[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_006[] = { + {TITLE, "dhcpv6 07-006", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 20}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* Echo Request */ + {CHECK, &pkt11[0], sizeof(pkt11), 5}, /* NS */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* NA */ + {CHECK, &pkt13[0], sizeof(pkt13), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* NA */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, /* RA */ + {INJECT, &pkt24[0], sizeof(pkt24), 0}, /* NA */ + + {INJECT, &pkt25[0], sizeof(pkt25), 0}, /* Echo Request */ + {CHECK, &pkt26[0], sizeof(pkt26), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_006_size = sizeof(tahi_dhcpv6_07_006) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_007.c b/test/regression/tahi_test/tahi_dhcpv6_07_007.c new file mode 100644 index 00000000..3718b921 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_007.c @@ -0,0 +1,385 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt9[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt12[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt15[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt17[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_007[] = { + {TITLE, "dhcpv6 07-007", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* NA */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* RA */ + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* NA */ + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* Echo Request */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_007_size = sizeof(tahi_dhcpv6_07_007) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_008.c b/test/regression/tahi_test/tahi_dhcpv6_07_008.c new file mode 100644 index 00000000..de2c3df6 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_008.c @@ -0,0 +1,519 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt6[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt7[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt9[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt13[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt17[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt20[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt22[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt26[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt27[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt28[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt30[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt31[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_008[] = { + {TITLE, "dhcpv6 07-008", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 20}, + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* Echo Request */ + {CHECK, &pkt10[0], sizeof(pkt10), 5}, /* NS */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {CHECK, &pkt12[0], sizeof(pkt12), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, /* NA */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, /* RA */ + {INJECT, &pkt23[0], sizeof(pkt23), 0}, /* NA */ + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, /* Echo Request */ + {CHECK, &pkt25[0], sizeof(pkt25), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_008_size = sizeof(tahi_dhcpv6_07_008) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_009.c b/test/regression/tahi_test/tahi_dhcpv6_07_009.c new file mode 100644 index 00000000..179655a4 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_009.c @@ -0,0 +1,467 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt9[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt14[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt17[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_009[] = { + {TITLE, "dhcpv6 07-009", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* NA */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* RA */ + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* NA */ + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* Echo Request */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_009_size = sizeof(tahi_dhcpv6_07_009) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_010.c b/test/regression/tahi_test/tahi_dhcpv6_07_010.c new file mode 100644 index 00000000..72dc498d --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_010.c @@ -0,0 +1,467 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt9[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt14[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt17[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_010[] = { + {TITLE, "dhcpv6 07-010", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* NA */ + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* RA */ + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* NA */ + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* Echo Request */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_010_size = sizeof(tahi_dhcpv6_07_010) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_011.c b/test/regression/tahi_test/tahi_dhcpv6_07_011.c new file mode 100644 index 00000000..c6bc9a3e --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_011.c @@ -0,0 +1,468 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt9[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt10[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt11[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt12[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt13[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt14[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xe7, 0x48, 0x0b, 0x3e, /* .#.0.H.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x18, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt15[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xce, 0x48, 0x0b, 0x3e, /* .#.0.H.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x31, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* 1....... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0x9f, 0x68, 0x0b, 0x3e, /* .#.0.h.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x60, 0x7c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* `|...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt17[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0x70, 0x88, 0x0b, 0x3e, /* .#.0p..> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x8f, 0x5c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .\...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (110 bytes) */ +static char pkt20[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt24[86] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xdf, 0x98, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt25[86] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xdf, 0x98, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xdf, 0x98, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_011[] = { + {TITLE, "dhcpv6 07-011", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {CHECK, &pkt9[0], sizeof(pkt9), 5}, + {WAIT, NX_NULL, 0, 2}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + {WAIT, NX_NULL, 0, 4}, + {CHECK, &pkt11[0], sizeof(pkt11), 5}, + {WAIT, NX_NULL, 0, 8}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {WAIT, NX_NULL, 0, 16}, + {CHECK, &pkt13[0], sizeof(pkt13), 5}, + {WAIT, NX_NULL, 0, 32}, + {CHECK, &pkt14[0], sizeof(pkt14), 5}, + {WAIT, NX_NULL, 0, 64}, + {CHECK, &pkt15[0], sizeof(pkt15), 5}, + {WAIT, NX_NULL, 0, 120}, + {CHECK, &pkt16[0], sizeof(pkt16), 5}, + {WAIT, NX_NULL, 0, 120}, + {CHECK, &pkt17[0], sizeof(pkt17), 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* NA */ + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, /* RA */ + {INJECT, &pkt21[0], sizeof(pkt21), 0}, /* NA */ + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, /* Echo Request */ + {CHECK, &pkt23[0], sizeof(pkt23), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_011_size = sizeof(tahi_dhcpv6_07_011) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_012.c b/test/regression/tahi_test/tahi_dhcpv6_07_012.c new file mode 100644 index 00000000..a2903f7e --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_012.c @@ -0,0 +1,458 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt7[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt14[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt15[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x9f, 0xef, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x9c, 0x50, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt18[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x63, 0x35, 0x0b, 0x91, /* .5.1c5.. */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt21[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (103 bytes) */ +static char pkt24[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x61, 0x65, 0x0d, 0x61, /* .5.1ae.a */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt25[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_012[] = { + {TITLE, "dhcpv6 07-012", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 20}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, /* RA */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* Echo Request */ + {CHECK, &pkt11[0], sizeof(pkt11), 5}, /* NS */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* NA */ + {CHECK, &pkt13[0], sizeof(pkt13), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, /* Start DHCPv6 Information */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, /* DHCPv6 Information */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* DHCPv6 Reply */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, /* NS */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + {CHECK, &pkt18[0], sizeof(pkt18), 5}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_012_size = sizeof(tahi_dhcpv6_07_012) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_013.c b/test/regression/tahi_test/tahi_dhcpv6_07_013.c new file mode 100644 index 00000000..f1606db8 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_013.c @@ -0,0 +1,543 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (78 bytes) */ +static char pkt1[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +#if 0 +/* Frame (70 bytes) */ +static char pkt5[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt6[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt7[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt8[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt9[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt13[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt14[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (144 bytes) */ +static char pkt15[144] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5a, 0x11, 0x40, 0xfe, 0x80, /* ...Z.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x5a, 0xd4, 0x86, 0x07, 0x3e, /* .".Z...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e, 0x00, 0x18, 0x00, 0x12, 0x04, 0x74, /* ?>.....t */ + 0x65, 0x73, 0x74, 0x07, 0x65, 0x78, 0x61, 0x6d, /* est.exam */ + 0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00 /* ple.com. */ + }; + +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* 33..?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0x3f, 0x3e, 0x87, 0x00, /* ....?>.. */ + 0x9f, 0xef, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x01, 0x01, /* ....?>.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0x3f, 0x3e, 0x86, 0xdd, 0x60, 0x00, /* ..?>..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x3f, 0xfe, /* ....?>?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x9c, 0x50, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .P....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x02, 0x01, /* ....?>.. */ + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e /* ....?> */ +}; + +/* Frame (103 bytes) */ +static char pkt18[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x55, 0x79, 0x19, 0x4d, /* .5.1Uy.M */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt21[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt22[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (103 bytes) */ +static char pkt24[103] = { + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3e, 0x00, 0x11, /* ....?>.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x31, 0x11, 0xff, 0x3f, 0xfe, /* ...1..?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e, 0x75, 0x30, /* ....?>u0 */ + 0x00, 0x35, 0x00, 0x31, 0x53, 0xe9, 0x1a, 0xdd, /* .5.1S... */ + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x06, 0x64, 0x68, 0x63, 0x70, 0x76, /* ...dhcpv */ + 0x36, 0x04, 0x74, 0x65, 0x73, 0x74, 0x07, 0x65, /* 6.test.e */ + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03, 0x63, /* xample.c */ + 0x6f, 0x6d, 0x00, 0x00, 0x1c, 0x00, 0x01 /* om..... */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt25[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt26[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt29[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt30[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt31[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt32[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt34[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_013[] = { + {TITLE, "dhcpv6 07-013", 13, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 20}, + {INJECT, &pkt7[0], sizeof(pkt7), 0}, /* RA */ + {WAIT, NX_NULL, 0 ,5}, /* Wait for the DAD. */ + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* Echo Request */ + {CHECK, &pkt11[0], sizeof(pkt11), 5}, /* NS */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* NA */ + {CHECK, &pkt13[0], sizeof(pkt13), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, /* Start DHCPv6 Information */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, /* DHCPv6 Information */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* DHCPv6 Reply */ + + {DHCPV6_DNS, NX_NULL, 0, 0}, /* Start DNS Query */ + {CHECK, &pkt16[0], sizeof(pkt16), 5}, /* NS */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + {CHECK, &pkt18[0], sizeof(pkt18), 5}, /* Check DNS Query */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_013_size = sizeof(tahi_dhcpv6_07_013) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_014.c b/test/regression/tahi_test/tahi_dhcpv6_07_014.c new file mode 100644 index 00000000..d9598513 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_014.c @@ -0,0 +1,542 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +#if 0 +/* Frame (78 bytes) */ +static const unsigned char pkt1[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt2[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt3[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt4[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static const unsigned char pkt5[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ +0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static const unsigned char pkt6[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt7[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static const unsigned char pkt8[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt9[86] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt10[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt11[70] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt12[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (104 bytes) */ +static const unsigned char pkt13[104] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x32, 0x11, 0x40, 0xfe, 0x80, /* ...2.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ +0x02, 0x22, 0x00, 0x32, 0xdb, 0xee, 0x07, 0x3e, /* .".2...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x17, 0x00, 0x10, /* "3DV.... */ +0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ +0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x3f, 0x3e /* ......?> */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt14[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt15[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt16[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static const unsigned char pkt17[86] = { +0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ +0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt18[86] = { +0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ +0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt19[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt20[86] = { +0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ +0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt21[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; +#endif + +/* Frame (110 bytes) */ +static const unsigned char pkt22[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt23[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt24[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt25[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ +0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static const unsigned char pkt26[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt27[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt28[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt29[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt30[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt31[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt32[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt33[70] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_014[] = { + {TITLE, "dhcpv6 07-014", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* Echo Request */ + {CHECK, &pkt9[0], sizeof(pkt9), 5}, /* NS */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* NA */ + {CHECK, &pkt11[0], sizeof(pkt11), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, /* DHCP Information-Request */ + {INJECT, &pkt13[0], sizeof(pkt13), 0}, /* DHCP Reply */ + {CHECK, &pkt14[0], sizeof(pkt14), 5}, /* DHCP Information-Request */ + + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* NA */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, /* RA */ + {INJECT, &pkt23[0], sizeof(pkt23), 0}, /* NA */ + + {INJECT, &pkt24[0], sizeof(pkt24), 0}, /* Echo Request */ + {CHECK, &pkt25[0], sizeof(pkt25), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_014_size = sizeof(tahi_dhcpv6_07_014) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_015.c b/test/regression/tahi_test/tahi_dhcpv6_07_015.c new file mode 100644 index 00000000..1170b869 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_015.c @@ -0,0 +1,422 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (110 bytes) */ +static const unsigned char pkt1[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ +0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ +0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static const unsigned char pkt2[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static const unsigned char pkt3[78] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ +0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static const unsigned char pkt4[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt5[86] = { +0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ +0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt6[86] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ +0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt7[70] = { +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ +0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt8[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (122 bytes) */ +static const unsigned char pkt9[122] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ +0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ +0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ +0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ +0x02, 0x22, 0x00, 0x44, 0x0f, 0xe2, 0x07, 0x00, /* .".D.... */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ +0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ +0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ +0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ +0x3f, 0x3e /* ?> */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt10[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt11[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt12[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static const unsigned char pkt13[86] = { +0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ +0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt14[86] = { +0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ +0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt15[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt16[86] = { +0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ +0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt17[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; +#endif + +/* Frame (110 bytes) */ +static const unsigned char pkt18[110] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ +0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ +0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ +0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ +0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static const unsigned char pkt19[86] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ +0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ +0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt20[70] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ +0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ +0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static const unsigned char pkt21[70] = { +0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ +0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ +0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static const unsigned char pkt22[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt23[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; + +/* Frame (102 bytes) */ +static const unsigned char pkt24[102] = { +0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ +0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ +0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ +0x02, 0x23, 0x00, 0x30, 0xe7, 0x48, 0x0b, 0x3e, /* .#.0.H.> */ +0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ +0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ +0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ +0x18, 0x9c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ +0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_07_015[] = { + {TITLE, "dhcpv6 07-015", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + {CHECK, &pkt10[0], sizeof(pkt10), 5}, + + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* RA */ + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* NA */ + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, /* Echo Request */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, /* Echo Reply */ + + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_015_size = sizeof(tahi_dhcpv6_07_015) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_016.c b/test/regression/tahi_test/tahi_dhcpv6_07_016.c new file mode 100644 index 00000000..70ba7b39 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_016.c @@ -0,0 +1,424 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0x40, 0xfe, 0x80, /* ...@.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xda, 0xa5, 0x01, 0x00, /* .#.@.... */ + 0x00, 0x64, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .d...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50 /* .2...P */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_016[] = { + {TITLE, "dhcpv6 07-016", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_016_size = sizeof(tahi_dhcpv6_07_016) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_017.c b/test/regression/tahi_test/tahi_dhcpv6_07_017.c new file mode 100644 index 00000000..b95060c5 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_017.c @@ -0,0 +1,424 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (118 bytes) */ +static char pkt10[118] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x40, 0x11, 0x40, 0xfe, 0x80, /* ...@.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x40, 0xd8, 0xa4, 0x03, 0x00, /* .#.@.... */ + 0x00, 0x65, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .e...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x0c, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* ........ */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50 /* .2...P */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_017[] = { + {TITLE, "dhcpv6 07-017", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_017_size = sizeof(tahi_dhcpv6_07_017) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_018.c b/test/regression/tahi_test/tahi_dhcpv6_07_018.c new file mode 100644 index 00000000..54dbe551 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_018.c @@ -0,0 +1,424 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (128 bytes) */ +static char pkt10[128] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x4a, 0x11, 0x40, 0xfe, 0x80, /* ...J.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x4a, 0xa2, 0x42, 0x04, 0x00, /* .#.J.B.. */ + 0x00, 0x69, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .i...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x18, /* ........ */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ........ */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_018[] = { + {TITLE, "dhcpv6 07-018", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_018_size = sizeof(tahi_dhcpv6_07_018) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_019.c b/test/regression/tahi_test/tahi_dhcpv6_07_019.c new file mode 100644 index 00000000..d3f49111 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_019.c @@ -0,0 +1,497 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +#if 0 +/* Frame (102 bytes) */ +static char pkt1[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt2[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt3[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt4[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt5[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt6[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt7[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (70 bytes) */ +static char pkt8[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt9[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt10[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt11[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt12[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt13[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (146 bytes) */ +static char pkt14[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xe3, 0x35, 0x05, 0x00, /* .#.\.5.. */ + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .j...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt16[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt20[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt21[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt26[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt29[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_019[] = { + {TITLE, "dhcpv6 07-019", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt3[0], sizeof(pkt3), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0}, /* Echo Request */ + {CHECK, &pkt9[0], sizeof(pkt9), 5}, /* NS */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* NA */ + {CHECK, &pkt11[0], sizeof(pkt11), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt12[0], sizeof(pkt12), 5}, + {INJECT, &pkt13[0], sizeof(pkt13), 0}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* NA */ + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt20[0], sizeof(pkt20), 0}, /* RA */ + {INJECT, &pkt21[0], sizeof(pkt21), 0}, /* NA */ + + {INJECT, &pkt22[0], sizeof(pkt22), 0}, /* Echo Request */ + {CHECK, &pkt23[0], sizeof(pkt23), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_019_size = sizeof(tahi_dhcpv6_07_019) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_020.c b/test/regression/tahi_test/tahi_dhcpv6_07_020.c new file mode 100644 index 00000000..44318d6f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_020.c @@ -0,0 +1,424 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (128 bytes) */ +static char pkt10[128] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x4a, 0x11, 0x40, 0xfe, 0x80, /* ...J.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x4a, 0x59, 0x6f, 0x06, 0x00, /* .#.JYo.. */ + 0x00, 0x6a, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .j...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x03, 0x00, 0x28, /* .......( */ + 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, 0x00, 0x32, /* .......2 */ + 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x18, /* ...P.... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, /* ?....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0xcd, /* ........ */ + 0x00, 0x00, 0x1b, 0x58, 0x00, 0x00, 0x2a, 0xf8 /* ...X..*. */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_020[] = { + {TITLE, "dhcpv6 07-020", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_020_size = sizeof(tahi_dhcpv6_07_020) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_021.c b/test/regression/tahi_test/tahi_dhcpv6_07_021.c new file mode 100644 index 00000000..f7e92d62 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_021.c @@ -0,0 +1,428 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (146 bytes) */ +static char pkt10[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xdf, 0x33, 0x09, 0x00, /* .#.\.3.. */ + 0x00, 0x6c, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .l...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, /* 333.3DV. */ + 0x11, 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, /* ."3DV..` */ + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, /* .....:.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* ........ */ + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, /* ....3DV. */ + 0x00, 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, /* ........ */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ + 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44 /* ."..3D */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_021[] = { + {TITLE, "dhcpv6 07-021", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_021_size = sizeof(tahi_dhcpv6_07_021) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_022.c b/test/regression/tahi_test/tahi_dhcpv6_07_022.c new file mode 100644 index 00000000..a1e037fa --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_022.c @@ -0,0 +1,428 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (146 bytes) */ +static char pkt10[146] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5c, 0x11, 0x40, 0xfe, 0x80, /* ...\.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x5c, 0xe0, 0x34, 0x08, 0x00, /* .#.\.4.. */ + 0x00, 0x6b, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .k...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x02, 0x00, 0x0e, /* ........ */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x03, /* ........ */ + 0x00, 0x28, 0x00, 0x01, 0x8a, 0x92, 0x00, 0x00, /* .(...... */ + 0x00, 0x32, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, /* .2...P.. */ + 0x00, 0x18, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xab, 0xcd, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* .....d.. */ + 0x00, 0xc8 /* .. */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_022[] = { + {TITLE, "dhcpv6 07-021", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_022_size = sizeof(tahi_dhcpv6_07_022) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_023.c b/test/regression/tahi_test/tahi_dhcpv6_07_023.c new file mode 100644 index 00000000..8de5df27 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_023.c @@ -0,0 +1,421 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (90 bytes) */ +static char pkt10[90] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa2, 0xa2, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x24, 0x11, 0x40, 0xfe, 0x80, /* ...$.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x24, 0x18, 0x1b, 0x0b, 0x00, /* .#.$.... */ + 0x00, 0x66, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* .f...... */ + 0x00, 0x01, 0x00, 0x04, 0x93, 0xe0, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa2, 0xa2, 0x00, 0x06, 0x00, 0x02, /* ........ */ + 0x00, 0x17 /* .. */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_023[] = { + {TITLE, "dhcpv6 07-023", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_023_size = sizeof(tahi_dhcpv6_07_023) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_024.c b/test/regression/tahi_test/tahi_dhcpv6_07_024.c new file mode 100644 index 00000000..6853975f --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_024.c @@ -0,0 +1,427 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (140 bytes) */ +static char pkt10[140] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa4, 0xa4, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x56, 0x11, 0x20, 0x3f, 0xfe, /* ...V. ?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa4, 0xa4, 0xff, 0x05, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x02, 0x23, /* .......# */ + 0x02, 0x23, 0x00, 0x56, 0x32, 0xb7, 0x0c, 0x00, /* .#.V2... */ + 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, 0x01, 0x01, /* ?....... */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0xa5, 0xa5, /* ........ */ + 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0xb3, 0xb3, /* ........ */ + 0x00, 0x09, 0x00, 0x28, 0x01, 0x00, 0x00, 0x64, /* ...(...d */ + 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, /* ........ */ + 0x00, 0x03, 0x0d, 0x40, 0x00, 0x11, 0x22, 0x33, /* ...@.."3 */ + 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* DV...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1 /* .... */ +}; + +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt12[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt15[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt16[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt20[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt21[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt22[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt23[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt25[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_024[] = { + {TITLE, "dhcpv6 07-024", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt11[0], sizeof(pkt11), 0}, /* NA */ + {INJECT, &pkt12[0], sizeof(pkt12), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt16[0], sizeof(pkt16), 0}, /* RA */ + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* NA */ + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_024_size = sizeof(tahi_dhcpv6_07_024) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_025.c b/test/regression/tahi_test/tahi_dhcpv6_07_025.c new file mode 100644 index 00000000..0f98b912 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_025.c @@ -0,0 +1,475 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (122 bytes) */ +static char pkt9[122] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0xfe, 0x80, /* ...D.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x22, 0x00, 0x44, 0x1f, 0x91, 0x07, 0x3e, /* .".D...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, /* "3DV.... */ + 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x17, /* ........ */ + 0x00, 0x10, 0x3f, 0xfe, 0x05, 0x01, 0xff, 0xff, /* ..?..... */ + 0x01, 0x00, 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, /* ........ */ + 0x3f, 0x3e /* ?> */ + }; + +/* Frame (148 bytes) */ +static char pkt10[148] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x5e, 0x11, 0x40, 0xfe, 0x80, /* ...^.@.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x23, /* "..3DV.# */ + 0x02, 0x23, 0x00, 0x5e, 0xc3, 0x33, 0x0d, 0x00, /* .#.^.3.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0xa2, 0xa2, /* ........ */ + 0x00, 0x12, 0x00, 0x04, 0x01, 0x01, 0x01, 0x01, /* ........ */ + 0x00, 0x09, 0x00, 0x28, 0x07, 0x00, 0x00, 0x68, /* ...(...h */ + 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, /* ........ */ + 0x00, 0x03, 0x0d, 0x40, 0x00, 0x11, 0x22, 0x33, /* ...@.."3 */ + 0x44, 0x56, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, /* DV...... */ + 0x00, 0x01, 0x00, 0x06, 0x1a, 0x80, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0xa1, 0xa1 /* .... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x22, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* "....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt12[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x22, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* "....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0x22, 0xa7, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* "....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt15[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt16[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt17[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + +/* Frame (110 bytes) */ +static char pkt19[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt22[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_025[] = { + {TITLE, "dhcpv6 07-025", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + {INJECT, &pkt9[0], sizeof(pkt9), 0}, + + {INJECT, &pkt10[0], sizeof(pkt10), 0}, + + {N_CHECK, (CHAR*)ANY, 0, 1}, + + {INJECT, &pkt14[0], sizeof(pkt14), 0}, /* NA */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* RA */ + {INJECT, &pkt20[0], sizeof(pkt20), 0}, /* NA */ + + {INJECT, &pkt21[0], sizeof(pkt21), 0}, /* Echo Request */ + {CHECK, &pkt22[0], sizeof(pkt22), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_025_size = sizeof(tahi_dhcpv6_07_025) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_026.c b/test/regression/tahi_test/tahi_dhcpv6_07_026.c new file mode 100644 index 00000000..04441dc4 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_026.c @@ -0,0 +1,462 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt9[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt10[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt11[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt12[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt13[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt14[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt15[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt16[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt17[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt18[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt19[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt20[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt21[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt23[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt24[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt25[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt26[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt27[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (70 bytes) */ +static char pkt28[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; +#endif + + +TAHI_TEST_SEQ tahi_dhcpv6_07_026[] = { + {TITLE, "dhcpv6 07-026", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + {INJECT, &pkt9[0], sizeof(pkt9), 0}, /* NA */ + {INJECT, &pkt10[0], sizeof(pkt10), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt17[0], sizeof(pkt17), 0}, /* RA */ + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* NA */ + + {INJECT, &pkt19[0], sizeof(pkt19), 0}, /* Echo Request */ + {CHECK, &pkt20[0], sizeof(pkt20), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_026_size = sizeof(tahi_dhcpv6_07_026) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_dhcpv6_07_027.c b/test/regression/tahi_test/tahi_dhcpv6_07_027.c new file mode 100644 index 00000000..b042ec44 --- /dev/null +++ b/test/regression/tahi_test/tahi_dhcpv6_07_027.c @@ -0,0 +1,612 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) +#include "netx_tahi.h" + + + +/* Frame (110 bytes) */ +static char pkt1[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt2[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt3[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt4[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt5[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt6[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt7[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt8[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +#if 0 +/* Frame (102 bytes) */ +static char pkt9[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt10[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (78 bytes) */ +static char pkt11[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt12[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt13[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt14[70] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, /* ........ */ + 0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (110 bytes) */ +static char pkt15[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* 33...... */ + 0x00, 0x00, 0xa6, 0xa6, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa6, 0xa6, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0x96, 0x52, 0x00, 0x40, 0x0b, 0xb8, 0x00, 0x00, /* .R.@.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa6, 0x03, 0x04, /* ........ */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, /* @....d.. */ + 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .H....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +#if 0 +/* Frame (78 bytes) */ +static char pkt16[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; + +/* Frame (78 bytes) */ +static char pkt17[78] = { + 0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, /* 33.3DV.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, /* ...3DV.. */ + 0x88, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 /* "..3DV */ +}; +#endif + +/* Frame (70 bytes) */ +static char pkt18[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, /* ....:@?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0xe9, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt19[86] = { + 0x33, 0x33, 0xff, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0x00, 0xa1, 0xa1, 0x87, 0x00, /* ........ */ + 0xdb, 0x28, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* .(....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x01, 0x01, /* ........ */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt20[86] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, /* .."3DV.. */ + 0x00, 0x00, 0xa1, 0xa1, 0x86, 0xdd, 0x60, 0x00, /* ......`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, /* "..3DV.. */ + 0x75, 0x26, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* u&....?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x02, 0x01, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt21[70] = { + 0x00, 0x00, 0x00, 0x00, 0xa1, 0xa1, 0x00, 0x11, /* ........ */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, /* "..3DV?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, /* ........ */ + 0x00, 0xff, 0xfe, 0x00, 0xa1, 0xa1, 0x81, 0x00, /* ........ */ + 0xe8, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .z...... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (102 bytes) */ +static char pkt22[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0xe4, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt23[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x73, 0xb4, 0x20, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* s. ...?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt24[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0x3f, 0xfe, /* ....:.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x3f, 0xfe, /* ....7~?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x94, 0xde, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* ........ */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (86 bytes) */ +static char pkt25[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt26[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xff, 0x80, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x00, 0x64, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .d...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (86 bytes) */ +static char pkt27[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (86 bytes) */ +static char pkt28[86] = { + 0x33, 0x33, 0xff, 0xec, 0x37, 0x7e, 0x00, 0x11, /* 33..7~.. */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, /* ... :.?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x01, 0xff, 0xec, 0x37, 0x7e, 0x87, 0x00, /* ....7~.. */ + 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x01, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56 /* .."3DV */ +}; + +/* Frame (102 bytes) */ +static char pkt29[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfe, 0xb8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x01, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* .,...... */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt30[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfd, 0x28, 0x0b, 0x3e, /* .#.0.(.> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x02, 0xbc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + +/* Frame (110 bytes) */ +static char pkt31[110] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, /* ...8:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, /* ........ */ + 0xe3, 0xef, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, /* ........ */ + 0xd4, 0xbe, 0xd9, 0xec, 0x37, 0x7e, 0x03, 0x04, /* ....7~.. */ + 0x40, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, /* ......?. */ + 0x05, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ +}; + +/* Frame (86 bytes) */ +static char pkt32[86] = { + 0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0xd4, 0xbe, /* 33...... */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, /* ... :... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xff, 0x02, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x88, 0x00, /* ........ */ + 0x02, 0xb1, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x80, /* .. ..... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x02, 0x01, /* ....7~.. */ + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11 /* ..3wU. */ +}; + +/* Frame (70 bytes) */ +static char pkt33[70] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0xd4, 0xbe, /* .."3DV.. */ + 0xd9, 0xec, 0x37, 0x7e, 0x86, 0xdd, 0x60, 0x00, /* ..7~..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0xfe, 0x80, /* ....7~.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, /* "..3DV.. */ + 0x23, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* #....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +/* Frame (70 bytes) */ +static char pkt34[70] = { + 0x00, 0x11, 0x33, 0x77, 0x55, 0x11, 0x00, 0x11, /* ..3wU... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, /* ....:... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xbe, /* ........ */ + 0xd9, 0xff, 0xfe, 0xec, 0x37, 0x7e, 0x81, 0x00, /* ....7~.. */ + 0x22, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, /* "....... */ + 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 /* ...... */ +}; + +#if 0 +/* Frame (102 bytes) */ +static char pkt35[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xfa, 0x08, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x05, 0xdc, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; + +/* Frame (102 bytes) */ +static char pkt36[102] = { + 0x33, 0x33, 0x00, 0x01, 0x00, 0x02, 0x00, 0x11, /* 33...... */ + 0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ + 0x00, 0x00, 0x00, 0x30, 0x11, 0xff, 0xfe, 0x80, /* ...0.... */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ + 0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x22, /* ......." */ + 0x02, 0x23, 0x00, 0x30, 0xf3, 0xc8, 0x0b, 0x3e, /* .#.0...> */ + 0xf0, 0x12, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x01, /* ........ */ + 0x00, 0x01, 0xac, 0x7d, 0x87, 0x3a, 0x00, 0x11, /* ...}.:.. */ + 0x22, 0x33, 0x44, 0x56, 0x00, 0x08, 0x00, 0x02, /* "3DV.... */ + 0x0c, 0x1c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x17, /* ........ */ + 0x00, 0x1f, 0x00, 0x29, 0x00, 0x18 /* ...).. */ + }; +#endif + + + + +TAHI_TEST_SEQ tahi_dhcpv6_07_027[] = { + {TITLE, "dhcpv6 07-027", 13, 0}, + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt4[0], sizeof(pkt4), 0}, /* Echo Request */ + {CHECK, &pkt5[0], sizeof(pkt5), 5}, /* NS */ + {INJECT, &pkt6[0], sizeof(pkt6), 0}, /* NA */ + {CHECK, &pkt7[0], sizeof(pkt7), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt8[0], sizeof(pkt8), 5}, + + {DHCPV6_REBOOT, NX_NULL, 0, 0}, + + {CHECK, &pkt14[0], sizeof(pkt14), 25}, /* RS */ + {INJECT, &pkt15[0], sizeof(pkt15), 0}, /* RA */ + + {WAIT, NX_NULL, 0, 5}, + + {INJECT, &pkt18[0], sizeof(pkt18), 0}, /* Echo Request */ + {CHECK, &pkt19[0], sizeof(pkt19), 5}, /* NS */ + {INJECT, &pkt20[0], sizeof(pkt20), 0}, /* NA */ + {CHECK, &pkt21[0], sizeof(pkt21), 5}, /* Echo Reply */ + + {DHCPV6_INFO_REQUEST, NX_NULL, 0, 0}, + {CHECK, &pkt22[0], sizeof(pkt22), 5}, + + {INJECT, &pkt23[0], sizeof(pkt23), 0}, /* NA */ + {INJECT, &pkt24[0], sizeof(pkt24), 0}, /* Echo Request */ + + {WAIT, NX_NULL, 0, 10}, + + {INJECT, &pkt31[0], sizeof(pkt31), 0}, /* RA */ + {INJECT, &pkt32[0], sizeof(pkt32), 0}, /* NA */ + + {INJECT, &pkt33[0], sizeof(pkt33), 0}, /* Echo Request */ + {CHECK, &pkt34[0], sizeof(pkt34), 5}, /* Echo Reply */ + + {CLEANUP, NX_NULL, 0, 0}, + {DUMP, NX_NULL, 0, 0} +}; + +int tahi_dhcpv6_07_027_size = sizeof(tahi_dhcpv6_07_027) / sizeof(TAHI_TEST_SEQ); +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_001.c b/test/regression/tahi_test/tahi_ipsec_001.c new file mode 100644 index 00000000..2ed33b24 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_001.c @@ -0,0 +1,163 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x27, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, +0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x21, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x5e, 0xde, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x81, 0x00, +0x26, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, +0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; + +TAHI_TEST_SEQ tahi_ipsec_001[] = { + {TITLE, "IPSEC-001", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 5, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 6, 0, 0, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5, 0, 0, 0, 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0, 0, 0, 0, 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_001_size = sizeof(tahi_ipsec_001) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_002.c b/test/regression/tahi_test/tahi_ipsec_002.c new file mode 100644 index 00000000..8bb858fc --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_002.c @@ -0,0 +1,147 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, +0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xc3, 0xcd, +0x45, 0xa5, 0x4a, 0x1b, 0x5b, 0xd7, 0xe6, 0x82, +0x6a, 0x43, 0x30, 0xff, 0x58, 0x56, 0x10, 0x1d, +0xc6, 0xa4, 0xd9, 0x5a, 0x04, 0xb8, 0x51, 0x57, +0x41, 0xc2, 0x27, 0xa8, 0xcb, 0x42, 0xc7, 0x31, +0x8d, 0x69, 0x1d, 0xa1, 0x5d, 0xb4, 0xd4, 0xb6, +0x44, 0xa2 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xdb, +0x7b, 0x6d, 0x40, 0x42, 0xc4, 0xc7, 0x26, 0x1a, +0x21, 0x3d, 0xd3, 0xda, 0xe0, 0x04, 0xe7, 0xb1, +0x81, 0x65, 0x20, 0x0d, 0x06, 0x0d, 0x84, 0x03, +0x47, 0x76, 0x0e, 0xdc, 0x29, 0x06, 0xa5, 0x9d, +0x92, 0xe3 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x46, 0xf6, +0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xa2, 0x3c, +0xec, 0x11, 0xcf, 0x7c, 0x42, 0xf6, 0xce, 0xdb, +0x38, 0x12, 0x60, 0x8a, 0xe8, 0x72, 0xdb, 0xfd, +0x2b, 0x4e, 0x7b, 0xda, 0xda, 0x51, 0x89, 0xf5, +0xc5, 0xc1, 0x10, 0xde, 0xf2, 0xed, 0x59, 0x45, +0x70, 0x17, 0xdb, 0x80, 0xd8, 0x7f, 0xd8, 0xb7, +0x4c, 0x7a }; + +#if 0 +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_002[] = { + {TITLE, "IPSEC-002", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, + {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_002_size = sizeof(tahi_ipsec_002) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_003.c b/test/regression/tahi_test/tahi_ipsec_003.c new file mode 100644 index 00000000..4d83247a --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_003.c @@ -0,0 +1,121 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x5b, +0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0xb1, 0x48, +0xcd, 0x18, 0xfd, 0x0e, 0x2d, 0xca, 0x81, 0x91, +0x6e, 0xa3, 0xcd, 0xe8, 0x52, 0x37, 0xd6, 0x5a, +0x75, 0x88, 0xfd, 0x12, 0xef, 0x19, 0x37, 0x2e, +0x7a, 0xdc, 0xe6, 0xab, 0xb5, 0xb6, 0xd3, 0x45, +0x26, 0x57, 0x12, 0x65, 0xd9, 0x81, 0x94, 0xef, +0xe2, 0x0b }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x27, 0x10, +0x7a, 0x69, 0x00, 0x16, 0xf2, 0x33, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x6c, 0x32, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x78, 0x7f, +0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0xd1, 0xa6, +0x97, 0x51, 0xa3, 0x0c, 0x3b, 0xff, 0x3d, 0xbc, +0x2f, 0x72, 0x15, 0xca, 0x85, 0x0c, 0xed, 0xc9, +0x3c, 0x16, 0x8f, 0x22, 0xa8, 0x06, 0xab, 0x70, +0xeb, 0x41, 0xc7, 0xff, 0xe4, 0x23, 0x6f, 0x98, +0x04, 0x25, 0xc4, 0xcd, 0x08, 0xff, 0xbb, 0x52, +0x6c, 0xf4, 0x91, 0x3e, 0x2b, 0xe6, 0xe6, 0x4f, +0x75, 0xba, 0x6c, 0x35, 0x90, 0x24, 0xfe, 0xf7, +0xc7, 0x7e, 0xf3, 0x12, 0x2b, 0xd3, 0x7e, 0x8b, +0x76, 0x0e, 0x09, 0x89, 0x8a, 0x7a, 0x80, 0x3f, +0x7f, 0x8c, 0xbc, 0x58, 0x2b, 0x4a, 0x11, 0x11, +0x37, 0x20, 0x9b, 0xc6, 0x4c, 0xa1, 0x3b, 0xd4, +0x7e, 0x55 }; + +TAHI_TEST_SEQ tahi_ipsec_003[] = { + {TITLE, "IPSEC-003", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_PROTOCOL_ICMPV6, 0, 0, 0x8100}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_PROTOCOL_ICMPV6, 0, 0, 0x0104}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_003_size = sizeof(tahi_ipsec_003) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_004.c b/test/regression/tahi_test/tahi_ipsec_004.c new file mode 100644 index 00000000..ffaa6733 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_004.c @@ -0,0 +1,119 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68, 0x48, +0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0xdd, 0x46, +0x5c, 0xea, 0xe5, 0x8d, 0x53, 0x63, 0x0c, 0xcb, +0x5e, 0xe8, 0x1e, 0x3a, 0x6d, 0xe6, 0xb1, 0x43, +0x1c, 0x50, 0x0d, 0x1e, 0x29, 0x06, 0x0b, 0xb3, +0xa0, 0xfe, 0x3c, 0x53, 0x3d, 0xb6, 0x4d, 0x5a, +0x36, 0xdf, 0x54, 0x0e, 0x93, 0x89, 0x8e, 0x44, +0x31, 0x72 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0x5a, 0x47, +0x8b, 0x08, 0x88, 0x5b, 0xd1, 0xce, 0x49, 0xfd, +0xe6, 0x6b }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb7, +0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0xef, 0x55, +0xca, 0x2d, 0xc0, 0x4a, 0x54, 0x46, 0x0f, 0x51, +0xfc, 0x9b, 0xf7, 0xd4, 0xfa, 0x10, 0xc4, 0x76, +0xae, 0xed, 0xce, 0x73, 0x41, 0x51, 0xe9, 0x20, +0xde, 0xf7, 0x03, 0x8c, 0x11, 0xbe, 0x1d, 0x64, +0x4d, 0xa5, 0x0d, 0x19, 0x89, 0x0f, 0x2a, 0xbd, +0x91, 0xfe }; + +TAHI_TEST_SEQ tahi_ipsec_004[] = { + {TITLE, "IPSEC-004", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_004_size = sizeof(tahi_ipsec_004) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_005.c b/test/regression/tahi_test/tahi_ipsec_005.c new file mode 100644 index 00000000..d0905769 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_005.c @@ -0,0 +1,1411 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x43, +0x0e, 0xfc, 0xdf, 0xe1, 0x55, 0x09, 0xe6, 0x10, +0x1c, 0xc7, 0x9e, 0xb4, 0x3b, 0xdc, 0x58, 0x5a, +0x0d, 0xf0, 0x56, 0x9e, 0x35, 0xab, 0x9c, 0x42, +0x33, 0xef, 0x87, 0x87, 0xa1, 0x2f, 0x31, 0xc4, +0x34, 0xd0, 0x88, 0x89, 0x32, 0x99, 0x11, 0x19, +0x61, 0x85, 0x5d, 0x0b, 0x92, 0x64, 0x77, 0xd0, +0xc3, 0x9c, 0x91, 0x5b, 0xbb, 0xd3, 0xed, 0xef, +0x48, 0x68, 0xdb, 0x33, 0xfd, 0x86, 0x3e, 0x83, +0xdd, 0xb3, 0x27, 0x52, 0xa7, 0x79, 0xb8, 0xfe, +0x24, 0x35, 0xb7, 0x6c, 0x19, 0xbc, 0x97, 0x9d, +0x95, 0xdf, 0x8d, 0xc0, 0x29, 0xab, 0xbc, 0x8a, +0x94, 0xce, 0x29, 0xd7, 0x14, 0xa2, 0xc4, 0x26, +0xa3, 0x23, 0xcf, 0xf0, 0xce, 0x0c, 0x42, 0x81, +0xd1, 0x39, 0x01, 0xbd, 0xfc, 0x76, 0xe6, 0xaa, +0x64, 0x1c, 0x18, 0x81, 0x2d, 0x46, 0x1e, 0x21, +0xf8, 0x5d, 0x77, 0xf4, 0x45, 0x94, 0x8b, 0xaf, +0x9a, 0x6a, 0x78, 0x2e, 0xc2, 0x9c, 0xf2, 0xa2, +0xb6, 0xfb, 0x98, 0xf2, 0x02, 0xc5, 0x58, 0x96, +0xc0, 0x13, 0xe5, 0xa9, 0xc4, 0xdc, 0x6b, 0xce, +0x07, 0xad, 0x54, 0xd3, 0x24, 0x0a, 0x05, 0x6f, +0xb8, 0x9b, 0x17, 0xc1, 0xc0, 0x1f, 0xec, 0x08, +0x76, 0x4f, 0x9e, 0x7f, 0x94, 0x22, 0xa0, 0x84, +0xca, 0xe5, 0xd7, 0x16, 0x73, 0x3d, 0x85, 0xd9, +0x0d, 0x18, 0xcf, 0x42, 0x4e, 0x59, 0x6d, 0x77, +0x45, 0x63, 0xd7, 0x4c, 0xe8, 0x12, 0xfa, 0x1b, +0x28, 0x8c, 0xdb, 0xe0, 0xcc, 0x46, 0xad, 0xc1, +0x2c, 0xb6, 0xab, 0xdb, 0x57, 0xd6, 0x08, 0x52, +0x54, 0x69, 0x96, 0x7c, 0x56, 0x4d, 0x8e, 0x9b, +0x6a, 0x23, 0xca, 0x67, 0xca, 0x05, 0xc4, 0x25, +0xba, 0x9f, 0xa0, 0x65, 0x4f, 0x4e, 0xee, 0x68, +0xa7, 0x8a, 0x5b, 0x5f, 0xfb, 0x76, 0x20, 0x7b, +0x3c, 0x88, 0xb3, 0xde, 0xdd, 0x59, 0x68, 0xc7, +0x55, 0x7d, 0x02, 0x70, 0x7f, 0xb2, 0x43, 0x2f, +0x40, 0xde, 0x25, 0x1a, 0xf9, 0xfa, 0xa3, 0x14, +0x87, 0xe3, 0xea, 0xff, 0xfd, 0xd6, 0xa3, 0x6f, +0xfe, 0x30, 0x0c, 0x61, 0xf2, 0x3f, 0xae, 0x7a, +0x6b, 0xc3, 0x29, 0x4b, 0x5e, 0xd2, 0x51, 0x32, +0x2a, 0x82, 0x3c, 0x16, 0x39, 0x72, 0x5d, 0x21, +0xd4, 0x14, 0x35, 0x5e, 0xdc, 0x62, 0x54, 0x77, +0x62, 0xf7, 0x0a, 0x7d, 0xc3, 0x7e, 0x88, 0xb1, +0xd2, 0x81, 0x83, 0x17, 0x2d, 0x54, 0x28, 0x21, +0x90, 0x36, 0xc0, 0x23, 0x89, 0x4d, 0x03, 0xf6, +0xea, 0x5b, 0x7e, 0x11, 0xf6, 0xe4, 0xeb, 0x7b, +0x26, 0xef, 0xa2, 0x48, 0xf9, 0xdd, 0xd1, 0xdd, +0xfd, 0x55, 0x33, 0x16, 0x73, 0xdb, 0x31, 0x26, +0x13, 0x26, 0xa8, 0x59, 0xef, 0x20, 0x12, 0xa6, +0x4a, 0x29, 0x33, 0x6a, 0x14, 0x12, 0xb5, 0x6d, +0x51, 0x49, 0xc0, 0xcf, 0x47, 0xd6, 0x0f, 0x0f, +0xef, 0x47, 0x59, 0x46, 0xbe, 0xe1, 0x72, 0x29, +0x76, 0xe3, 0xae, 0x62, 0x91, 0xb1, 0x6a, 0x66, +0x77, 0x65, 0x52, 0x89, 0xdd, 0x16, 0x6a, 0xbd, +0xae, 0xe4, 0x6e, 0x54, 0x8e, 0x40, 0x75, 0x30, +0xf1, 0xc9, 0x0b, 0x30, 0x15, 0x5d, 0x4b, 0x27, +0xe6, 0x35, 0x24, 0x19, 0x46, 0xdf, 0x7d, 0x7d, +0x73, 0xb6, 0x0c, 0x63, 0x15, 0x24, 0x01, 0xd2, +0xf1, 0x5a, 0xda, 0xb9, 0xf6, 0xe8, 0xf5, 0x97, +0x99, 0x51, 0x79, 0x4c, 0x3b, 0xbd, 0xa8, 0x92, +0x24, 0xf8, 0xb9, 0xcc, 0x27, 0xd5, 0xa4, 0xa2, +0xca, 0xec, 0x87, 0x00, 0x21, 0x3a, 0x73, 0x1e, +0x48, 0x22, 0x1d, 0x5f, 0x01, 0x5c, 0x95, 0x6e, +0xf1, 0xd0, 0x2a, 0x71, 0xa9, 0x2b, 0xee, 0x51, +0xaf, 0x9d, 0xd8, 0x76, 0xa2, 0x4b, 0xea, 0x90, +0xf4, 0xf6, 0xb6, 0x89, 0x9d, 0xf8, 0x17, 0x41, +0x5d, 0xa5, 0x72, 0xd9, 0xb0, 0xb8, 0x72, 0x0e, +0x4a, 0x51, 0x86, 0xcb, 0xe5, 0x10, 0xd2, 0x25, +0x95, 0x47, 0x1c, 0xd1, 0x7d, 0x7a, 0x94, 0xf6, +0x42, 0x8b, 0xd8, 0xbb, 0xbc, 0xe1, 0x00, 0x88, +0x23, 0x06, 0x80, 0xeb, 0xde, 0x21, 0xb0, 0xf1, +0xd7, 0x2f, 0x04, 0x3c, 0x09, 0x8e, 0xae, 0x6b, +0x68, 0x2e, 0x39, 0xa9, 0x5b, 0x53, 0x1a, 0xca, +0xbd, 0x0d, 0x77, 0xb5, 0x48, 0xf8, 0x50, 0x29, +0x6d, 0x6f, 0x72, 0xab, 0x77, 0x5f, 0xa5, 0x2e, +0xe0, 0x7c, 0x59, 0x5f, 0xe4, 0x52, 0x45, 0x57, +0x54, 0x62, 0x9b, 0xf5, 0x50, 0xea, 0xc1, 0x83, +0x35, 0x89, 0x64, 0x5a, 0x77, 0xd6, 0x10, 0x21, +0x7d, 0x20, 0x93, 0x01, 0x01, 0x85, 0x12, 0x7f, +0xaa, 0xeb, 0x8a, 0xda, 0xfa, 0x32, 0x45, 0xd7, +0x10, 0x6d, 0x65, 0xdf, 0x81, 0x47, 0x17, 0x44, +0x52, 0xc2, 0xd6, 0x13, 0x8f, 0xd6, 0xef, 0x40, +0xe4, 0x4d, 0xf5, 0xca, 0x2d, 0xc4, 0xbd, 0x31, +0x2d, 0xc3, 0x98, 0xd9, 0x6d, 0x39, 0x4f, 0xe1, +0x83, 0xba, 0xae, 0xf3, 0x96, 0x2b, 0x52, 0x1b, +0x54, 0xe9, 0x7c, 0x98, 0x29, 0x54, 0xe8, 0x23, +0x8b, 0x38, 0x95, 0xe5, 0xc0, 0x18, 0xca, 0xa8, +0x28, 0xc3, 0x65, 0xdf, 0x66, 0x8e, 0x12, 0x9c, +0xbd, 0x03, 0x7f, 0xba, 0xbe, 0x7c, 0x53, 0xf3, +0x56, 0xb0, 0xb3, 0xe3, 0xf2, 0x0d, 0x46, 0x6c, +0xc0, 0x8b, 0x24, 0x73, 0xd1, 0xea, 0xc1, 0xfe, +0x1c, 0xca, 0x79, 0xa0, 0x7e, 0x92, 0x78, 0x7d, +0x64, 0x7c, 0x77, 0xf0, 0x6f, 0x32, 0x3b, 0x68, +0xdf, 0x41, 0x57, 0x0d, 0x79, 0x18, 0x2c, 0xea, +0x40, 0x75, 0x2a, 0xb2, 0x89, 0xf5, 0xfa, 0xb8, +0x7a, 0x66, 0x7a, 0xaa, 0x23, 0x24, 0x8c, 0xdd, +0x77, 0x41, 0xf4, 0x89, 0x16, 0xf4, 0x83, 0x19, +0x00, 0x96, 0x19, 0x02, 0x61, 0x3c, 0x96, 0x3f, +0x60, 0x22, 0xdc, 0x2e, 0x98, 0xa2, 0x42, 0xf2, +0x89, 0x61, 0x3d, 0x63, 0x2a, 0x27, 0x1a, 0x6c, +0x0a, 0xc5, 0x1e, 0x5e, 0xd3, 0xde, 0xa5, 0xf4, +0x5a, 0x9d, 0xe5, 0xe9, 0x18, 0x4a, 0x6b, 0xd8, +0xdd, 0xaf, 0x4d, 0xca, 0x5d, 0x26, 0x18, 0x68, +0x28, 0x53, 0x14, 0x08, 0x3b, 0xce, 0x57, 0x6b, +0xf9, 0xd3, 0x73, 0xcb, 0x01, 0xbc, 0x70, 0x92, +0x6b, 0xa5, 0xb7, 0xa1, 0x77, 0x7d, 0x3c, 0xa5, +0x23, 0xaf, 0x20, 0xa1, 0x96, 0x99, 0xa3, 0x87, +0xdc, 0x1d, 0xad, 0xf0, 0x60, 0xc4, 0x02, 0xc1, +0x38, 0xe8, 0x4e, 0xf4, 0xc5, 0x8c, 0x50, 0xde, +0x9a, 0x1a, 0x9b, 0x68, 0xca, 0x96, 0xb4, 0x37, +0x3b, 0x2b, 0xe6, 0x04, 0xb1, 0x89, 0x4f, 0x27, +0xd6, 0x08, 0x15, 0x6c, 0x72, 0x4b, 0x6e, 0xbe, +0x85, 0x9c, 0x43, 0x72, 0xc0, 0x43, 0xe3, 0x26, +0xe0, 0x0a, 0xb6, 0x9e, 0x05, 0xe2, 0x33, 0x7f, +0xec, 0x52, 0x87, 0x9e, 0x58, 0x41, 0x5d, 0xbf, +0x12, 0x51, 0x8e, 0xa6, 0x19, 0xdf, 0xc5, 0xf4, +0xea, 0x98, 0x27, 0x72, 0xaa, 0x19, 0xa4, 0xae, +0x80, 0x84, 0x15, 0x8d, 0xb6, 0x04, 0xdd, 0x4a, +0x4f, 0xd4, 0x51, 0xa9, 0x5e, 0x03, 0xb5, 0x96, +0x54, 0x10, 0x66, 0x97, 0x38, 0x87, 0x0f, 0xa3, +0xc5, 0x7f, 0x24, 0x23, 0x46, 0x3d, 0xd4, 0x91, +0x06, 0x0c, 0x23, 0xe6, 0x40, 0x0d, 0x2f, 0x1c, +0x7b, 0xe2, 0x48, 0x06, 0x3a, 0x45, 0x38, 0x51, +0xae, 0xd8, 0xfb, 0xa9, 0xb6, 0x12, 0x47, 0xbb, +0xa9, 0x60, 0xeb, 0x62, 0x61, 0x6f, 0xfd, 0xc9, +0xf2, 0x67, 0xb0, 0xb4, 0x51, 0x3c, 0x5a, 0x48, +0xaf, 0x69, 0x18, 0xe2, 0xa0, 0x61, 0x5a, 0xc7, +0x0d, 0x0f, 0xe5, 0x09, 0x95, 0xed, 0x43, 0xba, +0x0a, 0xfc, 0xd3, 0xfb, 0xe7, 0x85, 0x1e, 0x63, +0xfe, 0x09, 0x6d, 0xe3, 0x2d, 0xd1, 0x72, 0x0e, +0x1d, 0x39, 0x8c, 0x89, 0x82, 0x9f, 0x92, 0x23, +0x25, 0xe5, 0xdb, 0xce, 0x84, 0x6d, 0xce, 0x98, +0x0f, 0x3f, 0x40, 0x89, 0x47, 0xbe, 0xf2, 0x51, +0xce, 0x82, 0x20, 0x02, 0x6a, 0xb9, 0x9a, 0x9f, +0x1e, 0x77, 0xdc, 0x66, 0x3f, 0x82, 0x26, 0xe3, +0x10, 0x6d, 0x02, 0xc9, 0x39, 0x09, 0xca, 0x2b, +0x0e, 0x8b, 0x7d, 0x91, 0x45, 0x52, 0x46, 0x0e, +0x59, 0x86, 0xc4, 0x1f, 0x3f, 0xa3, 0x88, 0x59, +0x0f, 0xa8, 0x4d, 0xe4, 0xd0, 0xa7, 0x41, 0x58, +0x9e, 0x9e, 0x09, 0x37, 0x55, 0xda, 0x32, 0x03, +0x48, 0x1e, 0xe7, 0x03, 0x6c, 0xb2, 0xb6, 0x21, +0xbb, 0x85, 0x0c, 0x55, 0xc1, 0xa1, 0x36, 0xf4, +0xa9, 0xb7, 0xbe, 0xc7, 0xfa, 0x95, 0x9f, 0xd5, +0x5c, 0x8e, 0x16, 0x99, 0x3c, 0x83, 0x2f, 0x4f, +0x54, 0x78, 0xaf, 0xb1, 0x33, 0xf9, 0xf0, 0x78, +0x21, 0x7f, 0x74, 0x29, 0x29, 0xa2, 0xdd, 0xd3, +0xaa, 0x56, 0xdb, 0x33, 0x9d, 0x46, 0xc1, 0xeb, +0x80, 0xd7, 0x98, 0xb5, 0x4f, 0x56, 0x56, 0x94, +0x3c, 0x4f, 0xb3, 0x3d, 0x9a, 0x88, 0xa4, 0xc3, +0x92, 0x56, 0x8b, 0xc0, 0xe4, 0xb7, 0xb1, 0x0c, +0xc4, 0x6a, 0x1c, 0x0f, 0x4c, 0x18, 0x03, 0xdc, +0x2d, 0xaa, 0x1c, 0xea, 0x52, 0xe2, 0x02, 0x12, +0x88, 0xdc, 0xa2, 0xe1, 0xa1, 0xb8, 0x0e, 0xcc, +0x7b, 0x19, 0x28, 0xac, 0x7d, 0xe6, 0x0c, 0xb1, +0xc6, 0x4b, 0xcc, 0x00, 0xde, 0x65, 0x69, 0xd6, +0xd4, 0xd6, 0x75, 0x12, 0xad, 0xaf, 0x2f, 0x8f, +0x56, 0x0f, 0xb2, 0xc9, 0x0a, 0xd9, 0xb9, 0x2a, +0x18, 0xc5, 0x79, 0x32, 0x96, 0xa3, 0x62, 0x36, +0x4c, 0xbe, 0xcd, 0xa8, 0x3e, 0x39, 0xc7, 0xdf, +0x69, 0x0f, 0x83, 0x36, 0x6e, 0x60, 0xf7, 0x49, +0x82, 0x40, 0x5d, 0xb7, 0xf8, 0x91, 0x99, 0xa0, +0x22, 0x9f, 0xec, 0xf2, 0x96, 0x49, 0x25, 0xa5, +0xa3, 0x0a, 0xd5, 0x11, 0x3b, 0xd7, 0xaf, 0x4f, +0x6b, 0x22, 0x83, 0x76, 0x81, 0x2e, 0x58, 0xb5, +0x72, 0x57, 0xe9, 0x3c, 0x5e, 0x62, 0x72, 0x7f, +0x9f, 0xf0, 0x71, 0xdd, 0x4c, 0xf9, 0x21, 0xf4, +0x68, 0x2e, 0x60, 0xb7, 0x9d, 0x0d, 0xa2, 0x69, +0x43, 0xf4, 0x7a, 0x89, 0x5c, 0x70, 0xe8, 0xb3, +0x96, 0x01, 0xb0, 0xf8, 0xda, 0xee, 0xbc, 0xea, +0x0f, 0x1c, 0xce, 0x13, 0xc9, 0x70, 0xf0, 0x6e, +0x21, 0x0f, 0x84, 0xaf, 0xf1, 0x43, 0xbe, 0xda, +0x28, 0x5f, 0x5f, 0x84, 0xf8, 0x3f, 0x83, 0x64, +0x03, 0x66, 0xff, 0x63, 0x0e, 0x40, 0xdc, 0x69, +0xcb, 0x85, 0xe4, 0x6a, 0x03, 0xc8, 0x70, 0x83, +0x47, 0xf2, 0xa8, 0x60, 0x50, 0x9b, 0xd3, 0x48, +0x51, 0xf5, 0xa7, 0xfc, 0xf3, 0x6c, 0x21, 0xc1, +0xa2, 0x67, 0xab, 0x44, 0xa7, 0x05, 0x93, 0xc5, +0x9d, 0x60, 0x1c, 0x61, 0x39, 0x7e, 0xe1, 0x35, +0x83, 0x27, 0x67, 0xbf, 0x5c, 0x72, 0xdb, 0x1c, +0xc3, 0x06, 0x78, 0xa4, 0x79, 0x86, 0xa0, 0x52, +0x9f, 0xc7, 0xaa, 0xe2, 0x23, 0xb5, 0x35, 0x63, +0x5b, 0x52, 0x54, 0x2d, 0x5d, 0xdb, 0x33, 0x34, +0x5d, 0x6d, 0x9d, 0xab, 0x23, 0x87, 0x1c, 0xdd, +0x06, 0x1a }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2b, 0xa5, +0xa3, 0x70, 0xf1, 0xba, 0xe4, 0x28, 0xf6, 0x3a, +0x99, 0x01, 0x2a, 0xa2, 0x79, 0x13, 0x04, 0xe5, +0xc9, 0x4b, 0x4f, 0x51, 0x13, 0xef, 0x95, 0xc4, +0x13, 0x28, 0xb2, 0x3c, 0xac, 0xdf, 0x21, 0x13, +0xf4, 0x33, 0xec, 0x69, 0xea, 0xe2, 0x39, 0xba, +0x0c, 0x9d, 0x9c, 0xa1, 0x61, 0xd8, 0xd3, 0x69, +0xb2, 0x77, 0x14, 0xde, 0x9f, 0x8f, 0x3c, 0xe4, +0xb0, 0x90, 0x59, 0xbe, 0xd9, 0x77, 0x44, 0xd1, +0x98, 0x6c, 0x77, 0x13, 0x4d, 0xc6, 0xab, 0x68, +0xc4, 0xe9, 0xac, 0x72, 0x1f, 0x2c, 0x3b, 0x13, +0xfe, 0xcd, 0x16, 0x4b, 0xb5, 0x65, 0xb4, 0x38, +0x33, 0xc1, 0x48, 0x2a, 0x84, 0xe4, 0xdd, 0x2a, +0x3c, 0x91, 0xb2, 0x87, 0x0f, 0x21, 0xc3, 0xee, +0x53, 0xb5, 0x02, 0x9f, 0x6b, 0xd7, 0x11, 0x44, +0xfe, 0x80, 0x76, 0x21, 0xf0, 0x93, 0xa3, 0x6b, +0x25, 0x59, 0x98, 0x63, 0xaa, 0x67, 0xb4, 0x85, +0x68, 0x3a, 0xaf, 0x83, 0x97, 0x96, 0xbb, 0xdb, +0xcb, 0x70, 0x9c, 0x09, 0xb1, 0xf3, 0xd9, 0x97, +0x45, 0xc4, 0x83, 0x8c, 0x2b, 0x5f, 0x04, 0xe8, +0x8f, 0xb1, 0x58, 0x11, 0x38, 0xe1, 0x3c, 0xa3, +0xca, 0x37, 0x69, 0xa7, 0x7f, 0x55, 0x42, 0xa9, +0x38, 0xfb, 0xa8, 0xad, 0xfc, 0x1e, 0x41, 0x08, +0xa5, 0x14, 0x23, 0xab, 0xa9, 0x7d, 0x9c, 0x90, +0x10, 0x2b, 0x6c, 0xc8, 0xe9, 0x9e, 0x2b, 0x8e, +0x45, 0x7e, 0xc8, 0x3b, 0x4b, 0xb7, 0xd3, 0xc1, +0xd8, 0x71, 0x84, 0xf7, 0x58, 0xce, 0x8f, 0xb6, +0x56, 0x49, 0x8d, 0x27, 0x55, 0x19, 0x6c, 0xbf, +0xb9, 0x25, 0x31, 0x47, 0xf7, 0xa8, 0x4b, 0xe7, +0xa8, 0x8b, 0x7b, 0xb5, 0x1c, 0x21, 0xde, 0xa9, +0x25, 0x94, 0x43, 0x11, 0xc2, 0x3e, 0x7e, 0xb1, +0xca, 0x10, 0x5b, 0x91, 0x21, 0x75, 0x31, 0x95, +0x02, 0x10, 0x68, 0x3c, 0x76, 0xc4, 0x97, 0xd2, +0x97, 0x67, 0xb1, 0x34, 0x5c, 0x4b, 0x25, 0xa9, +0x3d, 0x1f, 0xd5, 0x51, 0x21, 0x03, 0x05, 0x4d, +0x86, 0x87, 0xa6, 0xe1, 0xee, 0xe0, 0x1c, 0xbc, +0xa9, 0x4c, 0x1d, 0x9d, 0xae, 0xae, 0xd7, 0x7b, +0x0f, 0x86, 0xc6, 0xc6, 0x5f, 0xe3, 0x41, 0xe7, +0xde, 0x2c, 0x4c, 0xcd, 0x6b, 0x72, 0x6a, 0xb3, +0x9f, 0x93, 0xbf, 0xa0, 0x94, 0x0f, 0x19, 0x93, +0x9d, 0xc5, 0x43, 0x7e, 0x60, 0xd1, 0x66, 0x21, +0x4b, 0xaf, 0x1b, 0x26, 0xb5, 0x1f, 0x75, 0x01, +0x0a, 0x3d, 0xb7, 0xd0, 0x76, 0x8c, 0x4c, 0xb8, +0x05, 0xc7, 0x7c, 0x88, 0x58, 0x63, 0xfa, 0x54, +0x73, 0xa1, 0x31, 0x8f, 0xa6, 0x93, 0x41, 0x7b, +0x3e, 0x6e, 0x54, 0xa0, 0xcb, 0x53, 0x5b, 0x95, +0xb1, 0xae, 0x22, 0x20, 0x3f, 0xa8, 0xa0, 0xbd, +0x91, 0xff, 0xf5, 0x01, 0x61, 0x39, 0xc2, 0x2e, +0x50, 0x9e, 0xd1, 0x83, 0x89, 0x82, 0xea, 0x2c, +0x74, 0xf7, 0xc6, 0x7c, 0x7e, 0x0b, 0x53, 0x93, +0x8c, 0xbf, 0xf8, 0x23, 0xbd, 0xe1, 0x38, 0x84, +0x0e, 0x56, 0x90, 0x4b, 0xef, 0xeb, 0x00, 0x41, +0x4b, 0x1b, 0xf9, 0x6c, 0x88, 0xf3, 0x0b, 0xc4, +0x74, 0x0b, 0xff, 0x80, 0x3f, 0xff, 0x3d, 0xd7, +0x47, 0xd3, 0x67, 0x14, 0xb6, 0x99, 0xb6, 0x1b, +0xa9, 0x5b, 0x1e, 0x31, 0x5f, 0x1e, 0x83, 0xa7, +0x8e, 0x1e, 0x1e, 0x72, 0x86, 0x82, 0x47, 0xa4, +0x8c, 0x2e, 0xc8, 0xbc, 0xd4, 0x9b, 0x8e, 0x18, +0x0b, 0x3e, 0xe2, 0xf8, 0x16, 0x06, 0x25, 0xfc, +0x7a, 0x21, 0xac, 0x21, 0x67, 0xc8, 0xbf, 0x4e, +0x7a, 0xca, 0x4e, 0x1e, 0x79, 0x0e, 0xaf, 0x6b, +0xbe, 0xa1, 0x94, 0x7b, 0xc4, 0xde, 0xd5, 0x6d, +0xaf, 0xc6, 0x35, 0xca, 0x2f, 0x33, 0x71, 0xec, +0x37, 0x61, 0x3a, 0x21, 0x31, 0xba, 0x30, 0x12, +0x75, 0xe3, 0x60, 0x9a, 0x83, 0x68, 0xa5, 0xe4, +0x85, 0x6b, 0x4d, 0xfd, 0xf2, 0x89, 0xeb, 0xe5, +0x17, 0x19, 0x5a, 0xeb, 0x91, 0xa6, 0x07, 0x65, +0x09, 0xb7, 0x7f, 0x58, 0x9c, 0x04, 0xe3, 0xc5, +0xd0, 0xe6, 0x16, 0x5b, 0xab, 0xf7, 0x9c, 0x58, +0x1f, 0xa7, 0xeb, 0x02, 0x2f, 0xdd, 0x15, 0xc6, +0x60, 0xdf, 0x73, 0x5c, 0x14, 0x52, 0x60, 0x7c, +0x7c, 0xe5, 0xf6, 0x12, 0x3e, 0xdc, 0xe3, 0xad, +0x35, 0xc0, 0x4b, 0x12, 0xb1, 0x2c, 0x69, 0x6d, +0x11, 0xb4, 0xfd, 0xdc, 0x7b, 0x76, 0x99, 0x0b, +0xd8, 0x70, 0xb5, 0x96, 0xbc, 0x7f, 0x95, 0xc5, +0x32, 0x77, 0x51, 0xa0, 0x70, 0xc7, 0xe2, 0x5d, +0xde, 0x43, 0xc8, 0x02, 0xf2, 0x95, 0x14, 0xd9, +0x87, 0x80, 0x46, 0x54, 0x7c, 0x27, 0x35, 0x66, +0x19, 0xde, 0x60, 0xae, 0x47, 0x6d, 0xde, 0x6e, +0xaa, 0xc0, 0xcb, 0xe0, 0x66, 0xbf, 0xa0, 0xf2, +0x54, 0x22, 0x21, 0xd6, 0xa6, 0x43, 0xdd, 0x4f, +0x8e, 0xa7, 0x61, 0xb8, 0xd1, 0x9b, 0x44, 0xdb, +0x3e, 0xb0, 0xb9, 0x4d, 0xf9, 0x6e, 0xf9, 0x31, +0xb5, 0x2a, 0xa0, 0x53, 0xa0, 0x04, 0xd7, 0x2a, +0x69, 0x9d, 0x0d, 0xed, 0x7b, 0xc5, 0xfe, 0xbd, +0xdf, 0x48, 0x53, 0x05, 0xb9, 0xe9, 0x66, 0x08, +0x2a, 0x5c, 0xd7, 0x18, 0xe3, 0xf5, 0x83, 0xf1, +0x7c, 0xce, 0x70, 0xc3, 0x65, 0x9e, 0xbd, 0x52, +0x65, 0x23, 0x7f, 0xab, 0x34, 0x6f, 0x14, 0x42, +0x5a, 0x11, 0x8e, 0xfe, 0xa0, 0x24, 0x9d, 0xb9, +0x10, 0xe0, 0x06, 0x66, 0x71, 0xb6, 0xac, 0x46, +0xe5, 0xbb, 0x33, 0x49, 0x47, 0xd1, 0x65, 0x26, +0x33, 0xf6, 0xde, 0x3c, 0x93, 0x22, 0x06, 0xd1, +0x00, 0x8c, 0xf6, 0xec, 0x6b, 0x7d, 0xde, 0xce, +0xc8, 0x18, 0x90, 0x8d, 0xf5, 0x20, 0x22, 0x04, +0x8f, 0x80, 0xfc, 0x13, 0x7c, 0x80, 0xfd, 0x16, +0x82, 0x7d, 0x3a, 0xe4, 0x4f, 0xbe, 0x48, 0x1c, +0xcf, 0x78, 0x45, 0xd1, 0xca, 0x1e, 0xc4, 0x3f, +0xb8, 0x9e, 0x27, 0x80, 0xac, 0x12, 0xc9, 0x4c, +0xba, 0x7d, 0xc6, 0x70, 0xf7, 0x1f, 0x69, 0x4f, +0x3e, 0x64, 0x59, 0xc9, 0x5a, 0x01, 0x82, 0xaa, +0x2e, 0x7a, 0xa9, 0x63, 0x0d, 0xf0, 0x4d, 0x87, +0xf3, 0xa9, 0xab, 0xa5, 0x83, 0x8a, 0x5f, 0xc6, +0x27, 0x35, 0x0a, 0x5b, 0x76, 0xb2, 0x47, 0x88, +0x0f, 0x04, 0x33, 0x5b, 0xbf, 0x63, 0x79, 0xb2, +0x68, 0x60, 0x89, 0xc3, 0x6a, 0x25, 0x1d, 0x4c, +0x18, 0x27, 0x00, 0x24, 0x7f, 0x70, 0x05, 0x87, +0x1a, 0x0b, 0x90, 0x04, 0x94, 0xed, 0xec, 0x93, +0xc4, 0xc2, 0x0f, 0xb5, 0x22, 0x73, 0x54, 0x14, +0x43, 0x20, 0xf1, 0x57, 0x86, 0x84, 0xd8, 0xf9, +0x0e, 0x8b, 0xa6, 0xa8, 0x3c, 0x34, 0xf1, 0xa6, +0x1f, 0x9c, 0x1c, 0x13, 0x6a, 0xca, 0xba, 0xab, +0x98, 0xcc, 0x79, 0x16, 0x3b, 0x63, 0x58, 0x89, +0x9d, 0x11, 0xaf, 0x73, 0x81, 0x3d, 0x15, 0x41, +0x50, 0x2a, 0xd4, 0xae, 0x87, 0xfe, 0xfa, 0xf0, +0xcb, 0x33, 0xa4, 0xd0, 0xa9, 0x7a, 0x0e, 0xe2, +0x82, 0x1f, 0xfe, 0x9a, 0xc5, 0xd6, 0x12, 0x48, +0x43, 0xe1, 0xe6, 0xea, 0x04, 0xa2, 0xe7, 0xee, +0x56, 0xa9, 0xb5, 0x9c, 0x10, 0xa9, 0x51, 0x3a, +0x27, 0x65, 0xe1, 0xe4, 0x8c, 0x24, 0xf3, 0x01, +0x5d, 0xad, 0x7c, 0x33, 0x92, 0x93, 0xc4, 0x6f, +0x25, 0x48, 0xfb, 0x4d, 0x73, 0xc4, 0x2f, 0x16, +0x09, 0x78, 0xad, 0x1e, 0xf6, 0xef, 0xc8, 0x99, +0xbe, 0xe8, 0xb1, 0xdd, 0xa9, 0x9f, 0x00, 0xe0, +0x84, 0x7b, 0xcc, 0xcf, 0xc7, 0xc3, 0xa8, 0xb6, +0xed, 0xf6, 0x42, 0x37, 0x78, 0x0e, 0xf3, 0x33, +0x58, 0x54, 0x3c, 0x32, 0x9d, 0xac, 0xd8, 0x19, +0xb8, 0xb6, 0x4b, 0xf2, 0xbc, 0xe2, 0x83, 0xf2, +0x19, 0x5a, 0xac, 0x2a, 0x45, 0xee, 0x7d, 0xf3, +0x8c, 0x64, 0x67, 0x38, 0x11, 0x9d, 0x59, 0x6c, +0x45, 0xfb, 0x96, 0x51, 0x18, 0xc6, 0x8f, 0xc4, +0x91, 0x5a, 0x66, 0x54, 0x6d, 0x5c, 0x23, 0x88, +0x08, 0x5f, 0x2c, 0x56, 0x76, 0x0b, 0xf3, 0x58, +0xe2, 0x75, 0x35, 0x77, 0x6c, 0x8f, 0xbb, 0x0e, +0x3f, 0x23, 0x47, 0x1d, 0x9c, 0x5b, 0x03, 0x96, +0x55, 0xed, 0xbf, 0xf0, 0x55, 0x86, 0xc7, 0xbe, +0x09, 0xba, 0x13, 0x45, 0x83, 0xd9, 0x09, 0xae, +0x3e, 0x4f, 0xe2, 0xb7, 0x82, 0xda, 0xc9, 0xca, +0x2a, 0x80, 0xeb, 0x0a, 0xbe, 0x38, 0x81, 0x15, +0xc0, 0x6d, 0x9e, 0x2e, 0x46, 0xed, 0x5b, 0xf7, +0x4a, 0x2e, 0x40, 0x11, 0xb7, 0xb1, 0x4b, 0x99, +0xa0, 0x04, 0x82, 0x7c, 0x06, 0x3b, 0x08, 0x43, +0xae, 0xb3, 0xab, 0xef, 0x89, 0x24, 0x8b, 0xb7, +0x2d, 0x77, 0x51, 0x72, 0xae, 0xb3, 0xba, 0x7d, +0x16, 0x94, 0xb6, 0x43, 0x05, 0xb7, 0x0e, 0x69, +0x11, 0x42, 0x75, 0xd8, 0x1c, 0xd9, 0x2e, 0x0a, +0x7b, 0x9d, 0xbf, 0x9c, 0x6c, 0x99, 0x83, 0xc9, +0xe4, 0x11, 0x2c, 0xe8, 0x66, 0xc5, 0x60, 0x0b, +0x53, 0xf2, 0x37, 0x5b, 0xb0, 0xe1, 0xd3, 0x74, +0x3b, 0x64, 0x0b, 0x34, 0x37, 0xec, 0x0e, 0xbb, +0x15, 0x7d, 0xe1, 0x40, 0x45, 0x46, 0x94, 0x71, +0x2a, 0x8a, 0xba, 0x97, 0x4c, 0x08, 0xbf, 0x69, +0x50, 0xba, 0x7f, 0xbc, 0xc8, 0xe2, 0x9a, 0x0e, +0x96, 0xaa, 0x49, 0x8d, 0x7b, 0x30, 0xb7, 0x7d, +0x93, 0xec, 0x0a, 0xfc, 0x66, 0xed, 0x84, 0x3f, +0xad, 0x78, 0x23, 0xb8, 0xc7, 0xe6, 0x3b, 0xcc, +0x49, 0x13, 0x70, 0xfd, 0x23, 0x58, 0xc7, 0x94, +0x7c, 0x19, 0x36, 0xa1, 0x2b, 0xa6, 0xd8, 0x2a, +0x7e, 0xa7, 0x71, 0x9f, 0x59, 0x30, 0xf5, 0xc0, +0x18, 0x93, 0xa1, 0xf4, 0xcd, 0x1a, 0x03, 0x52, +0xd3, 0xe6, 0x52, 0xd2, 0x74, 0xc2, 0x17, 0x2d, +0x29, 0xd4, 0xb1, 0xd7, 0x5a, 0x8c, 0x70, 0x6c, +0x77, 0xc4, 0x42, 0x03, 0x13, 0x0c, 0x96, 0x28, +0x14, 0x3d, 0xf7, 0x26, 0xba, 0x0f, 0x41, 0xc4, +0xb5, 0x56, 0x29, 0x84, 0x4e, 0xf5, 0xeb, 0x9d, +0x4e, 0xe7, 0x60, 0xcd, 0x0c, 0x07, 0xb9, 0x43, +0x17, 0x2d, 0x90, 0x3e, 0x4a, 0x79, 0x6a, 0xf8, +0xec, 0x30, 0x49, 0x1c, 0x60, 0x84, 0x0d, 0x59, +0xd5, 0x3f, 0x89, 0x5a, 0x00, 0x45, 0xc4, 0x29, +0x6b, 0x3c, 0x58, 0xd4, 0x2a, 0xfd, 0x40, 0x3b, +0x5b, 0x2e, 0x89, 0x2e, 0x90, 0xb2, 0x7d, 0xb4, +0x42, 0xa9, 0x2f, 0x34, 0x55, 0x74, 0xd2, 0xc6, +0xfc, 0x31, 0x4d, 0x73, 0x6c, 0xdc, 0xf3, 0x1c, +0x71, 0x9f, 0x25, 0x8c, 0x45, 0x66, 0xff, 0xd7, +0x7c, 0x41, 0xe5, 0xf2, 0xb0, 0xd0, 0xbb, 0x06, +0xca, 0xfc, 0x13, 0xe2, 0x91, 0xc6, 0xd0, 0xf9, +0x9e, 0x32, 0x28, 0x3d, 0x3c, 0x1a, 0xa0, 0x63, +0xe8, 0x46, 0x4e, 0xe7, 0xc4, 0xbb, 0x77, 0xa9, +0xd2, 0xd4, 0x67, 0x51, 0xd7, 0x8f, 0x29, 0x25, +0x61, 0x6d, 0x46, 0x4d, 0xf5, 0x18, 0x43, 0x9a, +0x46, 0xd5, 0x45, 0xc0, 0xa0, 0xeb, 0xa9, 0xd5, +0xf1, 0xe6, 0x68, 0x63, 0x51, 0x8a, 0xdf, 0x30, +0x5d, 0xac }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0x8d, 0x8d, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x25, +0x57, 0x8f, 0xaf, 0x70, 0x4b, 0x80, 0x68, 0x59, +0x5f, 0x24, 0x81, 0xa7, 0xe8, 0x75, 0xd9, 0x0d, +0x62, 0x52, 0x24, 0xa8, 0xdf, 0x83, 0x13, 0x8d, +0x36, 0xfe, 0x55, 0x95, 0x8c, 0x5a, 0x0f, 0xa7, +0x91, 0x1e, 0xbe, 0xe9, 0x53, 0x01, 0x84, 0x8f, +0x57, 0xee, 0xd3, 0x86, 0x74, 0x8a, 0x19, 0xf1, +0xc6, 0xb0, 0xf4, 0xd4, 0x21, 0xec, 0xb1, 0xb0, +0x5e, 0xd5, 0xa9, 0x4a, 0xcd, 0x7d, 0x9c, 0x1f, +0x80, 0x26, 0x6b, 0x55, 0x54, 0xc9, 0xf6, 0x7c, +0xf3, 0x2c, 0x50, 0x3f, 0xc1, 0x85, 0x08, 0x81, +0x30, 0xf6, 0xa0, 0x3d, 0x3b, 0x06, 0xa8, 0x9d, +0x26, 0xa5, 0xf2, 0xd2, 0xe9, 0xf2, 0xf9, 0xa5, +0xea, 0x9e, 0x49, 0xec, 0xc4, 0xaa, 0xd6, 0x13, +0xb9, 0x49, 0x44, 0xf1, 0x9d, 0x3c, 0xa1, 0x85, +0x11, 0x35, 0x97, 0x0b, 0xde, 0xe6, 0x87, 0x7b, +0xa5, 0x58, 0x81, 0x06, 0x02, 0x4a, 0x47, 0xde, +0x24, 0x28, 0x85, 0x63, 0x67, 0xc6, 0x23, 0xca, +0x83, 0x7c, 0x5d, 0xb2, 0xf1, 0x8e, 0x78, 0x3d, +0x28, 0x79, 0xad, 0xf7, 0x2b, 0x7e, 0x55, 0x19, +0xc0, 0x29, 0x9e, 0x12, 0x79, 0x83, 0xd8, 0x5c, +0x49, 0x10, 0x46, 0xcf, 0xe3, 0xb2, 0xd9, 0x1e, +0x24, 0x3f, 0x1c, 0xc6, 0x60, 0x6a, 0xfe, 0xbd, +0x11, 0x09, 0x2d, 0x6c, 0x09, 0x13, 0x62, 0x2e, +0x78, 0x7f, 0x77, 0x30, 0x33, 0x93, 0x68, 0x03, +0xe2, 0x6b, 0x98, 0x7b, 0x9d, 0x4a, 0xcc, 0xb0, +0xd5, 0x35, 0xcb, 0xbd, 0x3c, 0xa2, 0x2f, 0x48, +0xa1, 0x07, 0x7c, 0xab, 0x5d, 0x0d, 0xbc, 0xf3, +0x8d, 0xe3, 0xd1, 0x2e, 0xb5, 0xa6, 0x49, 0x10, +0xf5, 0x50, 0x95, 0x83, 0x96, 0xc0, 0x7f, 0xde, +0x80, 0x0b, 0x4a, 0x39, 0xc4, 0xdc, 0x2d, 0xc9, +0x0a, 0x77, 0x2e, 0xc3, 0xb9, 0x30, 0xca, 0x0b, +0x07, 0x30, 0xa1, 0x85, 0xe7, 0x5a, 0xdc, 0xbb, +0x25, 0xa8, 0x0f, 0x17, 0x24, 0x1f, 0x9a, 0xa0, +0x28, 0x27, 0x73, 0xf8, 0xf9, 0x8f, 0x1d, 0x61, +0x40, 0x0b, 0x53, 0xbc, 0xe6, 0x75, 0x01, 0xfe, +0x53, 0xdc, 0xd4, 0x07, 0xd6, 0x3a, 0x69, 0x0d, +0x1d, 0xf9, 0x59, 0xaa, 0x2e, 0x58, 0xa7, 0x60, +0xf4, 0x42, 0x1f, 0x80, 0x06, 0x8c, 0x65, 0xd9, +0xb9, 0xf8, 0xe8, 0x0a, 0xa0, 0x30, 0xbb, 0x49, +0xe6, 0xbf, 0x39, 0x17, 0xc9, 0x68, 0x32, 0xae, +0x10, 0xc9, 0x6c, 0xa7, 0xee, 0x9f, 0xac, 0xd4, +0x72, 0x8c, 0x36, 0xe0, 0xc4, 0xfb, 0x90, 0xa2, +0x31, 0x5c, 0x62, 0xa3, 0x69, 0x44, 0xa5, 0x18, +0x78, 0x37, 0x38, 0xb6, 0xa4, 0x8b, 0x73, 0x62, +0x1d, 0xb2, 0xcf, 0x24, 0x90, 0xa0, 0xe1, 0xa4, +0x31, 0x5e, 0x58, 0x75, 0x88, 0x5f, 0x0a, 0x63, +0xaa, 0xeb, 0xf9, 0xef, 0x25, 0x79, 0x72, 0x9f, +0xf9, 0xc1, 0x56, 0xe6, 0x0f, 0x61, 0xc6, 0x66, +0xfc, 0xbb, 0xfb, 0x38, 0x0b, 0x6f, 0x24, 0x16, +0x4b, 0x05, 0x49, 0x46, 0xa8, 0x08, 0x9b, 0xbe, +0xa3, 0x86, 0xaa, 0xf1, 0x95, 0xf2, 0x0b, 0xf2, +0xf8, 0xe0, 0x0e, 0x32, 0xd3, 0x37, 0xc7, 0xbe, +0x73, 0x65, 0xe3, 0x66, 0x10, 0xfc, 0x5e, 0xf8, +0x44, 0x4a, 0x4b, 0xed, 0xfd, 0xe9, 0x5f, 0x8d, +0xa3, 0x11, 0x6f, 0x50, 0x7d, 0xf5, 0x45, 0x14, +0x27, 0x8b, 0xf6, 0x35, 0xd7, 0x34, 0x58, 0x5a, +0xc0, 0x5c, 0x56, 0x01, 0x2b, 0x7d, 0xa5, 0x4a, +0x81, 0xe7, 0x34, 0xa8, 0xa4, 0xb6, 0x99, 0xd9, +0x8e, 0x8e, 0x25, 0xe7, 0x7d, 0x00, 0x3f, 0xdd, +0x01, 0xab, 0xb0, 0xb9, 0x34, 0xd3, 0x1c, 0x22, +0x5f, 0x53, 0x9f, 0x2d, 0x19, 0x93, 0x89, 0x98, +0x69, 0x75, 0x09, 0x83, 0x2e, 0x4e, 0x89, 0xbb, +0x6c, 0x32, 0x34, 0x98, 0xbc, 0xa8, 0x9f, 0x95, +0x77, 0xcb, 0x47, 0xc9, 0x0f, 0x80, 0xcc, 0xdc, +0xb2, 0xb5, 0xa8, 0xc6, 0xa4, 0x2a, 0x3a, 0xa8, +0x8c, 0xfb, 0x25, 0xe0, 0xeb, 0x8f, 0x13, 0x3d, +0xc2, 0xe1, 0x5a, 0x03, 0x5f, 0xfd, 0xec, 0xb0, +0xba, 0x32, 0xc4, 0x58, 0x79, 0x60, 0x7d, 0xdd, +0x00, 0xd2, 0x31, 0x27, 0x0b, 0x29, 0x4a, 0x7c, +0xa5, 0x73, 0x75, 0xaa, 0xf0, 0x69, 0xb4, 0xac, +0xe1, 0x4b, 0xb5, 0x24, 0x1b, 0x03, 0xc0, 0x91, +0x6f, 0xda, 0xce, 0xb9, 0xaf, 0x08, 0xe6, 0x07, +0xc0, 0xad, 0xd4, 0x62, 0x45, 0xdb, 0x72, 0x7c, +0xd1, 0x8d, 0x32, 0x73, 0x06, 0xe5, 0x07, 0x08, +0x0b, 0x71, 0xba, 0x1b, 0xd0, 0x12, 0x57, 0x2f, +0x35, 0x99, 0x7d, 0x36, 0xe0, 0x8d, 0xe1, 0x8e, +0x54, 0x79, 0xa8, 0x21, 0x28, 0x40, 0x12, 0x87, +0xa2, 0xd6, 0x68, 0xf8, 0x4e, 0x6b, 0x6c, 0x07, +0xc2, 0x2b, 0x93, 0x2f, 0x42, 0x89, 0xfb, 0xf4, +0x21, 0x41, 0x92, 0x7b, 0xa5, 0xb7, 0xc1, 0xda, +0x8f, 0x1e, 0xc9, 0x16, 0x8e, 0x97, 0x79, 0xf1, +0xb3, 0x79, 0x0d, 0x1c, 0x48, 0x7f, 0x9e, 0x36, +0x6c, 0x4e, 0xfd, 0xad, 0xa2, 0x4c, 0xc9, 0xd8, +0x51, 0xf0, 0x4b, 0x1c, 0x94, 0xb8, 0x93, 0xcf, +0xe4, 0x4d, 0x93, 0xc7, 0x70, 0xd1, 0xeb, 0xd4, +0xdb, 0x7a, 0x97, 0xa4, 0x0c, 0xfc, 0x2d, 0x1a, +0xda, 0x78, 0x30, 0x27, 0x43, 0xf4, 0x2c, 0xc4, +0x07, 0xa8, 0x02, 0x06, 0xb4, 0xa4, 0x26, 0xe2, +0x41, 0x0b, 0x99, 0xf0, 0x0f, 0x5c, 0x7f, 0xfc, +0xe2, 0x91, 0x2f, 0x1f, 0xe0, 0x84, 0x1f, 0x05, +0x7b, 0x03, 0x1d, 0xd9, 0x8d, 0x78, 0xe1, 0xe7, +0x56, 0x7a, 0xc0, 0x94, 0xa3, 0x60, 0xa3, 0x17, +0x0b, 0xe2, 0xcb, 0x8b, 0x07, 0x24, 0x6a, 0x66, +0x2d, 0xf2, 0x62, 0x0d, 0xa3, 0x00, 0x29, 0x30, +0x3a, 0x88, 0xda, 0x61, 0x79, 0x02, 0x5d, 0x74, +0xe3, 0x6a, 0xa4, 0x9f, 0x97, 0xf9, 0xb4, 0x4a, +0x8f, 0x41, 0xcd, 0xca, 0x1c, 0x9a, 0x9c, 0xca, +0xf4, 0xf6, 0xa7, 0x39, 0xdb, 0x39, 0x20, 0xa3, +0x03, 0x44, 0xf3, 0x03, 0x5a, 0xae, 0xa8, 0xd5, +0xd9, 0x11, 0xfc, 0xf8, 0x75, 0x6d, 0xef, 0x5a, +0xce, 0x51, 0x7f, 0x3b, 0x09, 0x6f, 0xac, 0x06, +0x18, 0x4b, 0x1d, 0x2b, 0x59, 0xd4, 0xd4, 0xf7, +0xe2, 0x1c, 0xfa, 0xf0, 0x14, 0x96, 0xae, 0x25, +0x18, 0xc8, 0x9c, 0x41, 0x22, 0xa8, 0xac, 0x96, +0xfb, 0x40, 0xeb, 0xbd, 0x25, 0xaf, 0x95, 0xbf, +0x90, 0xd3, 0xa9, 0x63, 0x76, 0x69, 0x75, 0xaf, +0x51, 0x89, 0x34, 0xd1, 0x39, 0xff, 0x84, 0xcc, +0xa5, 0x79, 0x65, 0xde, 0x65, 0x6c, 0x91, 0xc5, +0xae, 0x8a, 0xa9, 0x95, 0xcd, 0x6f, 0xbd, 0xf8, +0x46, 0x39, 0x8f, 0xa3, 0x29, 0xdd, 0xc2, 0xe3, +0x5b, 0xbe, 0x0e, 0x38, 0x31, 0x97, 0x3e, 0xa0, +0x96, 0x1d, 0xbd, 0x98, 0xd0, 0xfa, 0xa7, 0x87, +0xe0, 0x74, 0x85, 0x78, 0xe4, 0x41, 0xba, 0x57, +0x45, 0xf4, 0x82, 0xfa, 0x2a, 0xba, 0xa1, 0xb9, +0xa8, 0x02, 0xb8, 0xa2, 0xaf, 0xf9, 0x3c, 0x3f, +0x2a, 0x04, 0xdf, 0xca, 0x5a, 0x54, 0x3b, 0xa3, +0x93, 0x4a, 0x12, 0x75, 0x40, 0x07, 0xdd, 0x13, +0x7b, 0x3c, 0x21, 0x12, 0xc2, 0x92, 0x22, 0x50, +0x40, 0xde, 0xb7, 0x0a, 0x7a, 0x87, 0xa0, 0x78, +0x16, 0x3d, 0x65, 0x4e, 0x80, 0x57, 0x7b, 0xd3, +0xdb, 0x1a, 0x43, 0x06, 0x0a, 0x4b, 0xf3, 0xba, +0x9d, 0x59, 0x89, 0x3d, 0xbd, 0xa6, 0x82, 0x38, +0xed, 0x8f, 0x4d, 0x37, 0xaa, 0x93, 0xba, 0xa5, +0x70, 0x79, 0x27, 0x03, 0x6b, 0xef, 0xdb, 0xd9, +0xc3, 0x32, 0x56, 0x2e, 0x26, 0x8d, 0x93, 0x55, +0x2e, 0x47, 0x38, 0x7e, 0x0c, 0x1b, 0x01, 0xfe, +0x5f, 0x6d, 0xc8, 0xee, 0x2e, 0xf5, 0x3d, 0xc4, +0x26, 0x45, 0xe5, 0x07, 0x60, 0x3f, 0xfe, 0xb7, +0xb8, 0xbf, 0x31, 0x41, 0x8c, 0x76, 0x0e, 0xa5, +0x06, 0x36, 0xf4, 0x09, 0x4b, 0x52, 0x7c, 0xf1, +0x15, 0x31, 0x94, 0x4b, 0x72, 0x21, 0xa6, 0x6b, +0x47, 0x7b, 0xce, 0xc0, 0xad, 0xdf, 0x99, 0x27, +0x7f, 0x49, 0xdc, 0xd7, 0xed, 0x1d, 0x62, 0x2d, +0x46, 0x5c, 0x75, 0x40, 0xb4, 0x5d, 0xdb, 0x16, +0x26, 0x08, 0xec, 0x21, 0xe7, 0x91, 0x53, 0xaf, +0x4f, 0x0b, 0x48, 0x38, 0xb0, 0x3a, 0x01, 0x51, +0xd0, 0x47, 0x04, 0x9c, 0x0d, 0x9f, 0xbf, 0x49, +0xe0, 0x58, 0x3c, 0x46, 0xd4, 0xfa, 0x36, 0x04, +0x05, 0x9a, 0xc5, 0xa3, 0x3a, 0x0a, 0x20, 0x5b, +0x58, 0x38, 0x9d, 0xf9, 0xa7, 0x97, 0x2d, 0xbd, +0x44, 0x76, 0xf8, 0xe4, 0xb3, 0x70, 0x60, 0x65, +0x89, 0xe2, 0x23, 0xbf, 0x31, 0x9c, 0xd8, 0xba, +0xca, 0x05, 0xe4, 0x8c, 0xc1, 0xe3, 0x11, 0x5a, +0x3e, 0x15, 0xce, 0x28, 0xfd, 0xb4, 0x88, 0xa9, +0x4a, 0xda, 0x56, 0x7c, 0x54, 0x52, 0x70, 0xb2, +0x22, 0x69, 0x17, 0x84, 0x9c, 0xc9, 0xdc, 0x10, +0xec, 0x0f, 0x6d, 0x63, 0xad, 0xd1 }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x43, +0x0e, 0xfc, 0xdf, 0xe1, 0x55, 0x09, 0xe6, 0x10, +0x1c, 0xc7, 0x9e, 0xb4, 0x3b, 0xdc, 0x58, 0x5a, +0x0d, 0xf0, 0x56, 0x9e, 0x35, 0xab, 0x9c, 0x42, +0x33, 0xef, 0x87, 0x87, 0xa1, 0x2f, 0x31, 0xc4, +0x34, 0xd0, 0x88, 0x89, 0x32, 0x99, 0x11, 0x19, +0x61, 0x85, 0x5d, 0x0b, 0x92, 0x64, 0x77, 0xd0, +0xc3, 0x9c, 0x91, 0x5b, 0xbb, 0xd3, 0xed, 0xef, +0x48, 0x68, 0xdb, 0x33, 0xfd, 0x86, 0x3e, 0x83, +0xdd, 0xb3, 0x27, 0x52, 0xa7, 0x79, 0xb8, 0xfe, +0x24, 0x35, 0xb7, 0x6c, 0x19, 0xbc, 0x97, 0x9d, +0x95, 0xdf, 0x8d, 0xc0, 0x29, 0xab, 0xbc, 0x8a, +0x94, 0xce, 0x29, 0xd7, 0x14, 0xa2, 0xc4, 0x26, +0xa3, 0x23, 0xcf, 0xf0, 0xce, 0x0c, 0x42, 0x81, +0xd1, 0x39, 0x01, 0xbd, 0xfc, 0x76, 0xe6, 0xaa, +0x64, 0x1c, 0x18, 0x81, 0x2d, 0x46, 0x1e, 0x21, +0xf8, 0x5d, 0x77, 0xf4, 0x45, 0x94, 0x8b, 0xaf, +0x9a, 0x6a, 0x78, 0x2e, 0xc2, 0x9c, 0xf2, 0xa2, +0xb6, 0xfb, 0x98, 0xf2, 0x02, 0xc5, 0x58, 0x96, +0xc0, 0x13, 0xe5, 0xa9, 0xc4, 0xdc, 0x6b, 0xce, +0x07, 0xad, 0x54, 0xd3, 0x24, 0x0a, 0x05, 0x6f, +0xb8, 0x9b, 0x17, 0xc1, 0xc0, 0x1f, 0xec, 0x08, +0x76, 0x4f, 0x9e, 0x7f, 0x94, 0x22, 0xa0, 0x84, +0xca, 0xe5, 0xd7, 0x16, 0x73, 0x3d, 0x85, 0xd9, +0x0d, 0x18, 0xcf, 0x42, 0x4e, 0x59, 0x6d, 0x77, +0x45, 0x63, 0xd7, 0x4c, 0xe8, 0x12, 0xfa, 0x1b, +0x28, 0x8c, 0xdb, 0xe0, 0xcc, 0x46, 0xad, 0xc1, +0x2c, 0xb6, 0xab, 0xdb, 0x57, 0xd6, 0x08, 0x52, +0x54, 0x69, 0x96, 0x7c, 0x56, 0x4d, 0x8e, 0x9b, +0x6a, 0x23, 0xca, 0x67, 0xca, 0x05, 0xc4, 0x25, +0xba, 0x9f, 0xa0, 0x65, 0x4f, 0x4e, 0xee, 0x68, +0xa7, 0x8a, 0x5b, 0x5f, 0xfb, 0x76, 0x20, 0x7b, +0x3c, 0x88, 0xb3, 0xde, 0xdd, 0x59, 0x68, 0xc7, +0x55, 0x7d, 0x02, 0x70, 0x7f, 0xb2, 0x43, 0x2f, +0x40, 0xde, 0x25, 0x1a, 0xf9, 0xfa, 0xa3, 0x14, +0x87, 0xe3, 0xea, 0xff, 0xfd, 0xd6, 0xa3, 0x6f, +0xfe, 0x30, 0x0c, 0x61, 0xf2, 0x3f, 0xae, 0x7a, +0x6b, 0xc3, 0x29, 0x4b, 0x5e, 0xd2, 0x51, 0x32, +0x2a, 0x82, 0x3c, 0x16, 0x39, 0x72, 0x5d, 0x21, +0xd4, 0x14, 0x35, 0x5e, 0xdc, 0x62, 0x54, 0x77, +0x62, 0xf7, 0x0a, 0x7d, 0xc3, 0x7e, 0x88, 0xb1, +0xd2, 0x81, 0x83, 0x17, 0x2d, 0x54, 0x28, 0x21, +0x90, 0x36, 0xc0, 0x23, 0x89, 0x4d, 0x03, 0xf6, +0xea, 0x5b, 0x7e, 0x11, 0xf6, 0xe4, 0xeb, 0x7b, +0x26, 0xef, 0xa2, 0x48, 0xf9, 0xdd, 0xd1, 0xdd, +0xfd, 0x55, 0x33, 0x16, 0x73, 0xdb, 0x31, 0x26, +0x13, 0x26, 0xa8, 0x59, 0xef, 0x20, 0x12, 0xa6, +0x4a, 0x29, 0x33, 0x6a, 0x14, 0x12, 0xb5, 0x6d, +0x51, 0x49, 0xc0, 0xcf, 0x47, 0xd6, 0x0f, 0x0f, +0xef, 0x47, 0x59, 0x46, 0xbe, 0xe1, 0x72, 0x29, +0x76, 0xe3, 0xae, 0x62, 0x91, 0xb1, 0x6a, 0x66, +0x77, 0x65, 0x52, 0x89, 0xdd, 0x16, 0x6a, 0xbd, +0xae, 0xe4, 0x6e, 0x54, 0x8e, 0x40, 0x75, 0x30, +0xf1, 0xc9, 0x0b, 0x30, 0x15, 0x5d, 0x4b, 0x27, +0xe6, 0x35, 0x24, 0x19, 0x46, 0xdf, 0x7d, 0x7d, +0x73, 0xb6, 0x0c, 0x63, 0x15, 0x24, 0x01, 0xd2, +0xf1, 0x5a, 0xda, 0xb9, 0xf6, 0xe8, 0xf5, 0x97, +0x99, 0x51, 0x79, 0x4c, 0x3b, 0xbd, 0xa8, 0x92, +0x24, 0xf8, 0xb9, 0xcc, 0x27, 0xd5, 0xa4, 0xa2, +0xca, 0xec, 0x87, 0x00, 0x21, 0x3a, 0x73, 0x1e, +0x48, 0x22, 0x1d, 0x5f, 0x01, 0x5c, 0x95, 0x6e, +0xf1, 0xd0, 0x2a, 0x71, 0xa9, 0x2b, 0xee, 0x51, +0xaf, 0x9d, 0xd8, 0x76, 0xa2, 0x4b, 0xea, 0x90, +0xf4, 0xf6, 0xb6, 0x89, 0x9d, 0xf8, 0x17, 0x41, +0x5d, 0xa5, 0x72, 0xd9, 0xb0, 0xb8, 0x72, 0x0e, +0x4a, 0x51, 0x86, 0xcb, 0xe5, 0x10, 0xd2, 0x25, +0x95, 0x47, 0x1c, 0xd1, 0x7d, 0x7a, 0x94, 0xf6, +0x42, 0x8b, 0xd8, 0xbb, 0xbc, 0xe1, 0x00, 0x88, +0x23, 0x06, 0x80, 0xeb, 0xde, 0x21, 0xb0, 0xf1, +0xd7, 0x2f, 0x04, 0x3c, 0x09, 0x8e, 0xae, 0x6b, +0x68, 0x2e, 0x39, 0xa9, 0x5b, 0x53, 0x1a, 0xca, +0xbd, 0x0d, 0x77, 0xb5, 0x48, 0xf8, 0x50, 0x29, +0x6d, 0x6f, 0x72, 0xab, 0x77, 0x5f, 0xa5, 0x2e, +0xe0, 0x7c, 0x59, 0x5f, 0xe4, 0x52, 0x45, 0x57, +0x54, 0x62, 0x9b, 0xf5, 0x50, 0xea, 0xc1, 0x83, +0x35, 0x89, 0x64, 0x5a, 0x77, 0xd6, 0x10, 0x21, +0x7d, 0x20, 0x93, 0x01, 0x01, 0x85, 0x12, 0x7f, +0xaa, 0xeb, 0x8a, 0xda, 0xfa, 0x32, 0x45, 0xd7, +0x10, 0x6d, 0x65, 0xdf, 0x81, 0x47, 0x17, 0x44, +0x52, 0xc2, 0xd6, 0x13, 0x8f, 0xd6, 0xef, 0x40, +0xe4, 0x4d, 0xf5, 0xca, 0x2d, 0xc4, 0xbd, 0x31, +0x2d, 0xc3, 0x98, 0xd9, 0x6d, 0x39, 0x4f, 0xe1, +0x83, 0xba, 0xae, 0xf3, 0x96, 0x2b, 0x52, 0x1b, +0x54, 0xe9, 0x7c, 0x98, 0x29, 0x54, 0xe8, 0x23, +0x8b, 0x38, 0x95, 0xe5, 0xc0, 0x18, 0xca, 0xa8, +0x28, 0xc3, 0x65, 0xdf, 0x66, 0x8e, 0x12, 0x9c, +0xbd, 0x03, 0x7f, 0xba, 0xbe, 0x7c, 0x53, 0xf3, +0x56, 0xb0, 0xb3, 0xe3, 0xf2, 0x0d, 0x46, 0x6c, +0xc0, 0x8b, 0x24, 0x73, 0xd1, 0xea, 0xc1, 0xfe, +0x1c, 0xca, 0x79, 0xa0, 0x7e, 0x92, 0x78, 0x7d, +0x64, 0x7c, 0x77, 0xf0, 0x6f, 0x32, 0x3b, 0x68, +0xdf, 0x41, 0x57, 0x0d, 0x79, 0x18, 0x2c, 0xea, +0x40, 0x75, 0x2a, 0xb2, 0x89, 0xf5, 0xfa, 0xb8, +0x7a, 0x66, 0x7a, 0xaa, 0x23, 0x24, 0x8c, 0xdd, +0x77, 0x41, 0xf4, 0x89, 0x16, 0xf4, 0x83, 0x19, +0x00, 0x96, 0x19, 0x02, 0x61, 0x3c, 0x96, 0x3f, +0x60, 0x22, 0xdc, 0x2e, 0x98, 0xa2, 0x42, 0xf2, +0x89, 0x61, 0x3d, 0x63, 0x2a, 0x27, 0x1a, 0x6c, +0x0a, 0xc5, 0x1e, 0x5e, 0xd3, 0xde, 0xa5, 0xf4, +0x5a, 0x9d, 0xe5, 0xe9, 0x18, 0x4a, 0x6b, 0xd8, +0xdd, 0xaf, 0x4d, 0xca, 0x5d, 0x26, 0x18, 0x68, +0x28, 0x53, 0x14, 0x08, 0x3b, 0xce, 0x57, 0x6b, +0xf9, 0xd3, 0x73, 0xcb, 0x01, 0xbc, 0x70, 0x92, +0x6b, 0xa5, 0xb7, 0xa1, 0x77, 0x7d, 0x3c, 0xa5, +0x23, 0xaf, 0x20, 0xa1, 0x96, 0x99, 0xa3, 0x87, +0xdc, 0x1d, 0xad, 0xf0, 0x60, 0xc4, 0x02, 0xc1, +0x38, 0xe8, 0x4e, 0xf4, 0xc5, 0x8c, 0x50, 0xde, +0x9a, 0x1a, 0x9b, 0x68, 0xca, 0x96, 0xb4, 0x37, +0x3b, 0x2b, 0xe6, 0x04, 0xb1, 0x89, 0x4f, 0x27, +0xd6, 0x08, 0x15, 0x6c, 0x72, 0x4b, 0x6e, 0xbe, +0x85, 0x9c, 0x43, 0x72, 0xc0, 0x43, 0xe3, 0x26, +0xe0, 0x0a, 0xb6, 0x9e, 0x05, 0xe2, 0x33, 0x7f, +0xec, 0x52, 0x87, 0x9e, 0x58, 0x41, 0x5d, 0xbf, +0x12, 0x51, 0x8e, 0xa6, 0x19, 0xdf, 0xc5, 0xf4, +0xea, 0x98, 0x27, 0x72, 0xaa, 0x19, 0xa4, 0xae, +0x80, 0x84, 0x15, 0x8d, 0xb6, 0x04, 0xdd, 0x4a, +0x4f, 0xd4, 0x51, 0xa9, 0x5e, 0x03, 0xb5, 0x96, +0x54, 0x10, 0x66, 0x97, 0x38, 0x87, 0x0f, 0xa3, +0xc5, 0x7f, 0x24, 0x23, 0x46, 0x3d, 0xd4, 0x91, +0x06, 0x0c, 0x23, 0xe6, 0x40, 0x0d, 0x2f, 0x1c, +0x7b, 0xe2, 0x48, 0x06, 0x3a, 0x45, 0x38, 0x51, +0xae, 0xd8, 0xfb, 0xa9, 0xb6, 0x12, 0x47, 0xbb, +0xa9, 0x60, 0xeb, 0x62, 0x61, 0x6f, 0xfd, 0xc9, +0xf2, 0x67, 0xb0, 0xb4, 0x51, 0x3c, 0x5a, 0x48, +0xaf, 0x69, 0x18, 0xe2, 0xa0, 0x61, 0x5a, 0xc7, +0x0d, 0x0f, 0xe5, 0x09, 0x95, 0xed, 0x43, 0xba, +0x0a, 0xfc, 0xd3, 0xfb, 0xe7, 0x85, 0x1e, 0x63, +0xfe, 0x09, 0x6d, 0xe3, 0x2d, 0xd1, 0x72, 0x0e, +0x1d, 0x39, 0x8c, 0x89, 0x82, 0x9f, 0x92, 0x23, +0x25, 0xe5, 0xdb, 0xce, 0x84, 0x6d, 0xce, 0x98, +0x0f, 0x3f, 0x40, 0x89, 0x47, 0xbe, 0xf2, 0x51, +0xce, 0x82, 0x20, 0x02, 0x6a, 0xb9, 0x9a, 0x9f, +0x1e, 0x77, 0xdc, 0x66, 0x3f, 0x82, 0x26, 0xe3, +0x10, 0x6d, 0x02, 0xc9, 0x39, 0x09, 0xca, 0x2b, +0x0e, 0x8b, 0x7d, 0x91, 0x45, 0x52, 0x46, 0x0e, +0x59, 0x86, 0xc4, 0x1f, 0x3f, 0xa3, 0x88, 0x59, +0x0f, 0xa8, 0x4d, 0xe4, 0xd0, 0xa7, 0x41, 0x58, +0x9e, 0x9e, 0x09, 0x37, 0x55, 0xda, 0x32, 0x03, +0x48, 0x1e, 0xe7, 0x03, 0x6c, 0xb2, 0xb6, 0x21, +0xbb, 0x85, 0x0c, 0x55, 0xc1, 0xa1, 0x36, 0xf4, +0xa9, 0xb7, 0xbe, 0xc7, 0xfa, 0x95, 0x9f, 0xd5, +0x5c, 0x8e, 0x16, 0x99, 0x3c, 0x83, 0x2f, 0x4f, +0x54, 0x78, 0xaf, 0xb1, 0x33, 0xf9, 0xf0, 0x78, +0x21, 0x7f, 0x74, 0x29, 0x29, 0xa2, 0xdd, 0xd3, +0xaa, 0x56, 0xdb, 0x33, 0x9d, 0x46, 0xc1, 0xeb, +0x80, 0xd7, 0x98, 0xb5, 0x4f, 0x56, 0x56, 0x94, +0x3c, 0x4f, 0xb3, 0x3d, 0x9a, 0x88, 0xa4, 0xc3, +0x92, 0x56, 0x8b, 0xc0, 0xe4, 0xb7, 0xb1, 0x0c, +0xc4, 0x6a, 0x1c, 0x0f, 0x4c, 0x18, 0x03, 0xdc, +0x2d, 0xaa, 0x1c, 0xea, 0x52, 0xe2, 0x02, 0x12, +0x88, 0xdc, 0xa2, 0xe1, 0xa1, 0xb8, 0x0e, 0xcc, +0x7b, 0x19, 0x28, 0xac, 0x7d, 0xe6, 0x0c, 0xb1, +0xc6, 0x4b, 0xcc, 0x00, 0xde, 0x65, 0x69, 0xd6, +0xd4, 0xd6, 0x75, 0x12, 0xad, 0xaf, 0x2f, 0x8f, +0x56, 0x0f, 0xb2, 0xc9, 0x0a, 0xd9, 0xb9, 0x2a, +0x18, 0xc5, 0x79, 0x32, 0x96, 0xa3, 0x62, 0x36, +0x4c, 0xbe, 0xcd, 0xa8, 0x3e, 0x39, 0xc7, 0xdf, +0x69, 0x0f, 0x83, 0x36, 0x6e, 0x60, 0xf7, 0x49, +0x82, 0x40, 0x5d, 0xb7, 0xf8, 0x91, 0x99, 0xa0, +0x22, 0x9f, 0xec, 0xf2, 0x96, 0x49, 0x25, 0xa5, +0xa3, 0x0a, 0xd5, 0x11, 0x3b, 0xd7, 0xaf, 0x4f, +0x6b, 0x22, 0x83, 0x76, 0x81, 0x2e, 0x58, 0xb5, +0x72, 0x57, 0xe9, 0x3c, 0x5e, 0x62, 0x72, 0x7f, +0x9f, 0xf0, 0x71, 0xdd, 0x4c, 0xf9, 0x21, 0xf4, +0x68, 0x2e, 0x60, 0xb7, 0x9d, 0x0d, 0xa2, 0x69, +0x43, 0xf4, 0x7a, 0x89, 0x5c, 0x70, 0xe8, 0xb3, +0x96, 0x01, 0xb0, 0xf8, 0xda, 0xee, 0xbc, 0xea, +0x0f, 0x1c, 0xce, 0x13, 0xc9, 0x70, 0xf0, 0x6e, +0x21, 0x0f, 0x84, 0xaf, 0xf1, 0x43, 0xbe, 0xda, +0x28, 0x5f, 0x5f, 0x84, 0xf8, 0x3f, 0x83, 0x64, +0x03, 0x66, 0xff, 0x63, 0x0e, 0x40, 0xdc, 0x69, +0xcb, 0x85, 0xe4, 0x6a, 0x03, 0xc8, 0x70, 0x83, +0x47, 0xf2, 0xa8, 0x60, 0x50, 0x9b, 0xd3, 0x48, +0x51, 0xf5, 0xa7, 0xfc, 0xf3, 0x6c, 0x21, 0xc1, +0xa2, 0x67, 0xab, 0x44, 0xa7, 0x05, 0x93, 0xc5, +0x9d, 0x60, 0x1c, 0x61, 0x39, 0x7e, 0xe1, 0x35, +0x83, 0x27, 0x67, 0xbf, 0x5c, 0x72, 0xdb, 0x1c, +0xc3, 0x06, 0x78, 0xa4, 0x79, 0x86, 0xa0, 0x52, +0x9f, 0xc7, 0xaa, 0xe2, 0x23, 0xb5, 0x35, 0x63, +0x5b, 0x52, 0x54, 0x2d, 0x5d, 0xdb, 0xb9, 0xc5, +0x1b, 0xa5, 0xb0, 0x66, 0x9c, 0x1e, 0xbd, 0x55, +0x8e, 0x85 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, +0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0x0e, 0x73, +0x64, 0xda, 0xdc, 0x87, 0xdd, 0xa7, 0x8a, 0xb1, +0xe0, 0x5f, 0x0d, 0xc6, 0x1b, 0x2b, 0x5e, 0xa7, +0x91, 0x58, 0x18, 0x49, 0x62, 0xc7, 0xfc, 0xdc, +0x19, 0xb6, 0xf4, 0xa9, 0xb0, 0x06, 0x71, 0x0d, +0xa4, 0x68, 0x69, 0xfe, 0x06, 0xe5, 0xca, 0xd0, +0x1c, 0x96, 0x85, 0x39, 0xe4, 0x63, 0x14, 0xba, +0xaf, 0x6e, 0x18, 0x94, 0x92, 0x45, 0xe8, 0xd6, +0xc5, 0x7b, 0x81, 0xde, 0x9e, 0x95, 0x45, 0x14, +0x9d, 0xa4, 0x5f, 0x2a, 0x98, 0x49, 0x88, 0x0a, +0xa4, 0x99, 0xfd, 0x7e, 0x0e, 0xab, 0x17, 0x93, +0xe4, 0xec, 0xc7, 0xdb, 0x02, 0xb9, 0x41, 0xa9, +0x16, 0x83, 0xb8, 0xe3, 0xbb, 0x58, 0xb6, 0xc7, +0x2c, 0x42, 0x44, 0xe1, 0xba, 0xe1, 0xe5, 0x5e, +0x9c, 0xdf, 0x9e, 0x66, 0x90, 0x8b, 0x62, 0x8f, +0x9c, 0xf7, 0x76, 0x20, 0x7b, 0x3b, 0xec, 0xc2, +0x6b, 0x21, 0x16, 0xc8, 0x86, 0x91, 0xaa, 0xd7, +0xd1, 0xb6, 0x95, 0xc3, 0xaa, 0x2f, 0x64, 0xf6, +0x55, 0x6d, 0x46, 0x16, 0x17, 0xf2, 0xc5, 0xd9, +0xa8, 0x34, 0x6e, 0x31, 0x1c, 0x88, 0xf7, 0x9b, +0x96, 0xee, 0xe0, 0x91, 0x6b, 0xe0, 0x57, 0x76, +0x36, 0x4c, 0xfb, 0x62, 0x54, 0xbe, 0x28, 0x0f, +0x31, 0xeb, 0x7b, 0xe3, 0x23, 0xe0, 0x8d, 0x77, +0xee, 0x9c, 0xf8, 0x65, 0xd5, 0xf8, 0x68, 0xb6, +0x54, 0xe3, 0xd9, 0xb0, 0x03, 0x12, 0x85, 0xf4, +0x38, 0x7f, 0x7c, 0x9d, 0xf9, 0xa4, 0xd6, 0x0a, +0xf2, 0xf9, 0x75, 0xf8, 0x9e, 0xe3, 0xc9, 0xe0, +0xa4, 0x46, 0x6b, 0x0e, 0x18, 0x19, 0xbd, 0xa9, +0x01, 0x80, 0x81, 0xb0, 0xed, 0xa5, 0xee, 0xf1, +0x4d, 0xf7, 0x08, 0x95, 0x30, 0xf3, 0x13, 0xb5, +0xd0, 0x25, 0x2f, 0x4d, 0x04, 0xa2, 0x70, 0x03, +0x00, 0xd1, 0xa3, 0xb9, 0xed, 0x81, 0x3f, 0x9a, +0xa9, 0xaf, 0x70, 0x9d, 0x5e, 0x11, 0x45, 0x69, +0xf0, 0xc1, 0x3e, 0xa9, 0x5c, 0x89, 0xb2, 0x42, +0x86, 0x2c, 0x63, 0xae, 0xcd, 0xe6, 0x60, 0xd4, +0x75, 0xf1, 0xeb, 0xbc, 0x7f, 0xdc, 0x44, 0x2e, +0xd5, 0xe4, 0x3f, 0xc4, 0x9c, 0x92, 0xa4, 0x1c, +0x23, 0xf7, 0x80, 0xae, 0x5a, 0x29, 0xe2, 0xd5, +0x30, 0x81, 0x2d, 0xed, 0x94, 0x4a, 0x49, 0x1b, +0xb2, 0xc2, 0x8b, 0xee, 0xc8, 0x2e, 0xb2, 0x7a, +0xeb, 0x2f, 0x36, 0x2e, 0x7e, 0xcb, 0x09, 0xcb, +0x9e, 0xbf, 0xf4, 0x99, 0xb2, 0x61, 0x87, 0x24, +0x91, 0x95, 0x24, 0xf0, 0x9c, 0x8c, 0x98, 0x9d, +0x37, 0x4f, 0x51, 0xff, 0x52, 0xc4, 0xa3, 0xd4, +0x95, 0xf1, 0xc8, 0x5e, 0xce, 0x2d, 0xa5, 0xc0, +0xe9, 0xb8, 0x53, 0x60, 0x0a, 0xe9, 0x26, 0xaa, +0x8f, 0x80, 0x2d, 0x67, 0x3d, 0x2d, 0xe9, 0x3c, +0xae, 0xa7, 0xd0, 0x5e, 0x31, 0xba, 0x14, 0xa1, +0xb1, 0xfc, 0xd5, 0x70, 0xe9, 0x03, 0xee, 0xfc, +0x29, 0xd0, 0x3b, 0x52, 0xad, 0xa3, 0xcc, 0x9f, +0x61, 0x17, 0x97, 0x94, 0xf0, 0x9c, 0xb0, 0x75, +0x5b, 0x3c, 0xdb, 0x1d, 0xef, 0xa0, 0x90, 0x45, +0x99, 0xb3, 0x1e, 0x9f, 0x0f, 0x44, 0xa1, 0xaf, +0x03, 0x49, 0x60, 0x88, 0xc4, 0xe6, 0xb5, 0x71, +0xad, 0x18, 0x48, 0x67, 0x40, 0x38, 0xd0, 0x0c, +0xa9, 0x6d, 0x8c, 0xbc, 0xab, 0x5e, 0x87, 0x9c, +0xd1, 0x99, 0x77, 0xea, 0x4b, 0xe6, 0xb7, 0x05, +0x05, 0xf1, 0x44, 0xfc, 0x77, 0x58, 0xc6, 0xfc, +0xfe, 0xd9, 0x0a, 0xc2, 0x09, 0x51, 0x7c, 0xec, +0x19, 0x69, 0x48, 0xa7, 0x81, 0xec, 0x0a, 0x60, +0x71, 0x15, 0x68, 0xba, 0x65, 0x29, 0x5c, 0xee, +0x78, 0x8c, 0x60, 0x51, 0x19, 0xf6, 0x37, 0x59, +0xd7, 0xc9, 0x97, 0xf5, 0xbb, 0xb3, 0x84, 0x64, +0x66, 0x49, 0x94, 0xd8, 0x3d, 0xc5, 0x95, 0x36, +0xc0, 0xc9, 0xa0, 0x55, 0x50, 0xec, 0x7c, 0x9b, +0xca, 0xf2, 0x27, 0x7f, 0x91, 0x5e, 0x58, 0x57, +0xaf, 0x6d, 0x38, 0x3e, 0x33, 0xdb, 0x51, 0xe3, +0xbf, 0xd2, 0xff, 0xb8, 0xff, 0x0c, 0x09, 0xcf, +0x3b, 0x03, 0x60, 0xb5, 0x80, 0xf1, 0xb1, 0xb3, +0xf6, 0x9c, 0xb1, 0x68, 0x65, 0x71, 0x26, 0xc3, +0x17, 0x5d, 0x3c, 0x17, 0x43, 0x20, 0x33, 0xa8, +0x63, 0x51, 0x80, 0x9b, 0x8e, 0xfe, 0x28, 0x26, +0x8c, 0xd2, 0x3d, 0xbf, 0x1d, 0x65, 0x1a, 0x5f, +0xbf, 0x37, 0xa7, 0x67, 0x58, 0x2c, 0xc0, 0xda, +0x2b, 0xa8, 0x55, 0x2c, 0x52, 0xf3, 0xc6, 0x59, +0xfb, 0x49, 0x5a, 0xaa, 0x20, 0x71, 0xa7, 0xf3, +0x24, 0x83, 0x5e, 0xc6, 0xbc, 0xac, 0xa0, 0xf5, +0xf7, 0x62, 0x74, 0x54, 0x11, 0xff, 0xcb, 0xf8, +0x0f, 0x4c, 0xf1, 0xc7, 0x1d, 0xb6, 0x9e, 0xcf, +0x11, 0x04, 0xa6, 0x8e, 0x16, 0x1b, 0x41, 0x30, +0x54, 0x49, 0x13, 0x9b, 0xb8, 0x24, 0xdf, 0x1c, +0x37, 0x0a, 0x7b, 0x06, 0xfa, 0x02, 0xa4, 0x80, +0x43, 0xe2, 0x36, 0xef, 0xb0, 0xba, 0x5a, 0x5e, +0xcb, 0x8a, 0x8b, 0xb8, 0xaa, 0x0b, 0xbe, 0x02, +0x70, 0x94, 0x46, 0xc0, 0x19, 0x40, 0xf6, 0x4e, +0x6d, 0x7f, 0x4d, 0xc9, 0xdc, 0xc9, 0x48, 0x1e, +0x1f, 0x3a, 0x7e, 0x3d, 0x69, 0x47, 0x53, 0xab, +0x45, 0x77, 0xba, 0x98, 0x15, 0x53, 0x66, 0xae, +0xc3, 0x60, 0xba, 0x9d, 0x29, 0x83, 0xa3, 0xdc, +0x1b, 0xf8, 0xad, 0x4d, 0xda, 0x9a, 0x09, 0xb0, +0x18, 0xfa, 0xf5, 0xbd, 0x73, 0x17, 0x1b, 0x7a, +0xc7, 0xdf, 0x8c, 0xc4, 0x5f, 0x2b, 0x99, 0x91, +0x4f, 0x1e, 0x6b, 0x07, 0x96, 0xfd, 0x45, 0xe2, +0x37, 0x21, 0x58, 0xf2, 0x93, 0x34, 0xe8, 0x06, +0x3b, 0xff, 0xfc, 0x9a, 0x6b, 0x1d, 0x6e, 0x9b, +0x61, 0xd3, 0xae, 0x6f, 0xe6, 0xa1, 0x86, 0xfc, +0x3a, 0xc9, 0x51, 0xa6, 0x70, 0x1d, 0xc8, 0x8c, +0xdd, 0x09, 0x28, 0x8c, 0x7f, 0x3d, 0xfa, 0x4d, +0xae, 0xd9, 0x9e, 0x29, 0xbe, 0x56, 0xc2, 0x8e, +0x3f, 0xef, 0xb2, 0x66, 0x2f, 0xa5, 0x95, 0x14, +0x13, 0xd1, 0xfd, 0xa5, 0xda, 0xca, 0x6d, 0x91, +0xf1, 0x8e, 0x42, 0x81, 0xd4, 0xff, 0x5d, 0xc4, +0x4c, 0x2e, 0x14, 0x7c, 0xbb, 0x3d, 0x40, 0x5a, +0x6d, 0x97, 0xd2, 0x3d, 0x2a, 0x1f, 0xdd, 0x9f, +0x84, 0xc6, 0x00, 0xe0, 0xa9, 0x13, 0xfa, 0xc8, +0x2d, 0xca, 0x95, 0x6e, 0xcc, 0xa9, 0x66, 0x1b, +0x5f, 0x98, 0xa6, 0x1b, 0xb2, 0x5a, 0x8f, 0x73, +0x96, 0x91, 0xe7, 0x5d, 0xb7, 0x8a, 0xb1, 0xfc, +0x7d, 0x93, 0x9b, 0x7b, 0x4d, 0x5c, 0x94, 0xaf, +0xaf, 0x4a, 0xb5, 0xb0, 0xe9, 0x27, 0x35, 0x6f, +0xcb, 0xa2, 0x4c, 0x35, 0xd6, 0x73, 0xe2, 0x43, +0x5c, 0xb6, 0x0e, 0x08, 0x16, 0x4d, 0xa7, 0xc5, +0xbb, 0xe6, 0xf7, 0xce, 0xaa, 0xce, 0x65, 0x08, +0x2f, 0x4c, 0x67, 0x1a, 0xce, 0xe7, 0x46, 0x4f, +0x2b, 0x05, 0x80, 0x6f, 0x33, 0x27, 0x61, 0x36, +0x53, 0xd9, 0xa0, 0x40, 0x6a, 0xc3, 0xa3, 0xce, +0xc9, 0xa9, 0x14, 0x93, 0xed, 0x6b, 0xda, 0x27, +0x95, 0xaf, 0xe0, 0x62, 0x42, 0xea, 0x15, 0xe5, +0x18, 0x1c, 0xb3, 0xec, 0x0f, 0xe9, 0x46, 0xc9, +0xc8, 0x57, 0x14, 0x5a, 0xf3, 0xd6, 0x91, 0xcf, +0xd6, 0x92, 0x43, 0x18, 0x47, 0x8d, 0x7a, 0x14, +0xcc, 0xf5, 0x24, 0x08, 0x17, 0x20, 0xc9, 0x33, +0xcb, 0x5b, 0xb8, 0xc2, 0x9a, 0xfc, 0xf0, 0x2e, +0xd4, 0x11, 0x18, 0xb9, 0xa3, 0x0c, 0x63, 0x9c, +0x86, 0xe3, 0x72, 0x13, 0xdf, 0xc5, 0x42, 0x93, +0x4f, 0x90, 0x8b, 0x5e, 0x2e, 0xa7, 0xec, 0x8d, +0x45, 0xe0, 0xca, 0x5b, 0x00, 0x91, 0x61, 0x9f, +0xd4, 0x0c, 0x68, 0x6a, 0xc9, 0xf1, 0x42, 0xa6, +0xb0, 0xfe, 0x60, 0xa7, 0x08, 0xff, 0x2c, 0x69, +0xfd, 0x40, 0x43, 0xe9, 0x96, 0x27, 0x42, 0x9e, +0xb3, 0xbe, 0xb4, 0xb2, 0x9c, 0x3c, 0xd7, 0x6d, +0xb5, 0x7e, 0x69, 0xce, 0xeb, 0x68, 0xd3, 0x01, +0xa2, 0x46, 0x1a, 0x60, 0xbc, 0x68, 0x4d, 0x26, +0xd0, 0x54, 0x4a, 0xda, 0x9c, 0x35, 0x36, 0xe6, +0xd0, 0x0b, 0x9d, 0xbb, 0x95, 0x63, 0xe1, 0x65, +0x48, 0xd0, 0xd6, 0x27, 0x71, 0xb5, 0x03, 0x6f, +0x9a, 0x6d, 0xcd, 0xd0, 0x7f, 0x46, 0xb8, 0x07, +0xcc, 0x1d, 0x16, 0x9b, 0xea, 0x39, 0x0e, 0x36, +0xd7, 0x8e, 0xa7, 0x47, 0xe6, 0x13, 0xce, 0x55, +0x3a, 0x8f, 0x9d, 0x8f, 0xe8, 0x8d, 0xec, 0x7d, +0xcf, 0x18, 0xb6, 0xf7, 0x69, 0x56, 0x2e, 0xb1, +0x1d, 0x9a, 0x49, 0x1b, 0x87, 0xc3, 0x71, 0xc9, +0xac, 0xb8, 0xf1, 0x2d, 0xdd, 0x0b, 0x34, 0x40, +0x21, 0xa2, 0x56, 0xaf, 0x5f, 0xe8, 0xc4, 0xc9, +0xb1, 0x03, 0x75, 0x55, 0x27, 0x17, 0x3a, 0xfe, +0x29, 0x92, 0x35, 0x1e, 0x55, 0x8a, 0xcc, 0x1d, +0x54, 0x07, 0x71, 0x74, 0x2f, 0x85, 0xf2, 0x55, +0x73, 0x40, 0x8f, 0xd0, 0x6f, 0xf0, 0xea, 0xd9, +0x67, 0x35, 0xd0, 0xb1, 0x90, 0x64, 0x3f, 0xf9, +0xcc, 0x34, 0x45, 0x87, 0x16, 0xf6, 0x37, 0xab, +0xa8, 0x14, 0x3c, 0xd9, 0x11, 0x73, 0xc3, 0x92, +0xa5, 0x40, 0x44, 0x1a, 0x3d, 0xb9, 0xdf, 0x61, +0x0b, 0xaf, 0xf9, 0x5a, 0x9d, 0x1f }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x45, 0xf0, +0xf5, 0xbd, 0x35, 0xbe, 0xbb, 0xa0, 0xd5, 0x87, +0x8e, 0xcc, 0x7d, 0xb4, 0x55, 0x5e, 0x4e, 0x81, +0x9f, 0xbb, 0xca, 0xc5, 0x37, 0xd5, 0x43, 0x91, +0x3f, 0xb8, 0xe9, 0x72, 0xc6, 0x67, 0x1a, 0xc8, +0xd4, 0x94, 0x43, 0x54, 0xe7, 0x41, 0x68, 0xce, +0x2d, 0xba, 0x77, 0xbf, 0x14, 0xe7, 0x6a, 0xd9, +0x1f, 0xd4, 0x5b, 0xb5, 0xd8, 0xce, 0x8d, 0xc4, +0xc2, 0x9d, 0xbb, 0x4c, 0xce, 0x3e, 0x3b, 0xe0, +0xa7, 0x9a, 0x46, 0xb0, 0x8e, 0x6c, 0xcb, 0x21, +0x5c, 0x8e, 0xba, 0xb5, 0xe4, 0x9a, 0x18, 0x62, +0xb3, 0x6c, 0x5c, 0xc2, 0x74, 0x51, 0xe2, 0x3b, +0x96, 0xfd, 0xd3, 0x97, 0xad, 0xff, 0xb7, 0xff, +0xe0, 0x34, 0x63, 0xc4, 0x3c, 0x18, 0xf5, 0x67, +0x72, 0xcb, 0x09, 0x02, 0x42, 0x76, 0x87, 0x19, +0xe4, 0x71, 0xa3, 0x5d, 0x25, 0xe7, 0x44, 0x97, +0xf5, 0x58, 0x74, 0x66, 0xa3, 0x1c, 0x28, 0xe3, +0xb8, 0xa1, 0x5a, 0x23, 0x83, 0x66, 0x90, 0xa2, +0xdf, 0xd4, 0x23, 0x6f, 0xfe, 0xab, 0x70, 0x74, +0x72, 0xea, 0x9e, 0x13, 0xff, 0x95, 0x40, 0xa4, +0xed, 0x2c, 0x78, 0x92, 0x2b, 0x6b, 0xa1, 0x69, +0x9f, 0x10, 0x6a, 0x5b, 0xdd, 0xcf, 0x73, 0x7e, +0xa4, 0xd5, 0x22, 0x2a, 0xba, 0x1e, 0x41, 0x61, +0x09, 0x32, 0xbd, 0xe1, 0x9c, 0x67, 0x1a, 0x91, +0xfe, 0x91, 0x1c, 0x99, 0x16, 0xe4, 0xd5, 0x84, +0x1d, 0xc1, 0xa4, 0x72, 0x3d, 0xa0, 0x23, 0x5a, +0x0b, 0x03, 0x8e, 0x2f, 0x50, 0x87, 0x03, 0x95, +0x50, 0xaf, 0xf4, 0x06, 0x55, 0x98, 0xff, 0xa9, +0xcd, 0x6b, 0xa6, 0xaa, 0x0d, 0x23, 0xc4, 0x20, +0x14, 0x5c }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, +0x00, 0x00, 0x00, 0xff, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, +0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0x0e, 0x73, +0x64, 0xda, 0xdc, 0x87, 0xdd, 0xa7, 0x8a, 0xb1, +0xe0, 0x5f, 0x0d, 0xc6, 0x1b, 0x2b, 0x5e, 0xa7, +0x91, 0x58, 0x18, 0x49, 0x62, 0xc7, 0xfc, 0xdc, +0x19, 0xb6, 0xf4, 0xa9, 0xb0, 0x06, 0x71, 0x0d, +0xa4, 0x68, 0x69, 0xfe, 0x06, 0xe5, 0xca, 0xd0, +0x1c, 0x96, 0x85, 0x39, 0xe4, 0x63, 0x14, 0xba, +0xaf, 0x6e, 0x18, 0x94, 0x92, 0x45, 0xe8, 0xd6, +0xc5, 0x7b, 0x81, 0xde, 0x9e, 0x95, 0x45, 0x14, +0x9d, 0xa4, 0x5f, 0x2a, 0x98, 0x49, 0x88, 0x0a, +0xa4, 0x99, 0xfd, 0x7e, 0x0e, 0xab, 0x17, 0x93, +0xe4, 0xec, 0xc7, 0xdb, 0x02, 0xb9, 0x41, 0xa9, +0x16, 0x83, 0xb8, 0xe3, 0xbb, 0x58, 0xb6, 0xc7, +0x2c, 0x42, 0x44, 0xe1, 0xba, 0xe1, 0xe5, 0x5e, +0x9c, 0xdf, 0x9e, 0x66, 0x90, 0x8b, 0x62, 0x8f, +0x9c, 0xf7, 0x76, 0x20, 0x7b, 0x3b, 0xec, 0xc2, +0x6b, 0x21, 0x16, 0xc8, 0x86, 0x91, 0xaa, 0xd7, +0xd1, 0xb6, 0x95, 0xc3, 0xaa, 0x2f, 0x64, 0xf6, +0x55, 0x6d, 0x46, 0x16, 0x17, 0xf2, 0xc5, 0xd9, +0xa8, 0x34, 0x6e, 0x31, 0x1c, 0x88, 0xf7, 0x9b, +0x96, 0xee, 0xe0, 0x91, 0x6b, 0xe0, 0x57, 0x76, +0x36, 0x4c, 0xfb, 0x62, 0x54, 0xbe, 0x28, 0x0f, +0x31, 0xeb, 0x7b, 0xe3, 0x23, 0xe0, 0x8d, 0x77, +0xee, 0x9c, 0xf8, 0x65, 0xd5, 0xf8, 0x68, 0xb6, +0x54, 0xe3, 0xd9, 0xb0, 0x03, 0x12, 0x85, 0xf4, +0x38, 0x7f, 0x7c, 0x9d, 0xf9, 0xa4, 0xd6, 0x0a, +0xf2, 0xf9, 0x75, 0xf8, 0x9e, 0xe3, 0xc9, 0xe0, +0xa4, 0x46, 0x6b, 0x0e, 0x18, 0x19, 0xbd, 0xa9, +0x01, 0x80, 0x81, 0xb0, 0xed, 0xa5, 0xee, 0xf1, +0x4d, 0xf7, 0x08, 0x95, 0x30, 0xf3, 0x13, 0xb5, +0xd0, 0x25, 0x2f, 0x4d, 0x04, 0xa2, 0x70, 0x03, +0x00, 0xd1, 0xa3, 0xb9, 0xed, 0x81, 0x3f, 0x9a, +0xa9, 0xaf, 0x70, 0x9d, 0x5e, 0x11, 0x45, 0x69, +0xf0, 0xc1, 0x3e, 0xa9, 0x5c, 0x89, 0xb2, 0x42, +0x86, 0x2c, 0x63, 0xae, 0xcd, 0xe6, 0x60, 0xd4, +0x75, 0xf1, 0xeb, 0xbc, 0x7f, 0xdc, 0x44, 0x2e, +0xd5, 0xe4, 0x3f, 0xc4, 0x9c, 0x92, 0xa4, 0x1c, +0x23, 0xf7, 0x80, 0xae, 0x5a, 0x29, 0xe2, 0xd5, +0x30, 0x81, 0x2d, 0xed, 0x94, 0x4a, 0x49, 0x1b, +0xb2, 0xc2, 0x8b, 0xee, 0xc8, 0x2e, 0xb2, 0x7a, +0xeb, 0x2f, 0x36, 0x2e, 0x7e, 0xcb, 0x09, 0xcb, +0x9e, 0xbf, 0xf4, 0x99, 0xb2, 0x61, 0x87, 0x24, +0x91, 0x95, 0x24, 0xf0, 0x9c, 0x8c, 0x98, 0x9d, +0x37, 0x4f, 0x51, 0xff, 0x52, 0xc4, 0xa3, 0xd4, +0x95, 0xf1, 0xc8, 0x5e, 0xce, 0x2d, 0xa5, 0xc0, +0xe9, 0xb8, 0x53, 0x60, 0x0a, 0xe9, 0x26, 0xaa, +0x8f, 0x80, 0x2d, 0x67, 0x3d, 0x2d, 0xe9, 0x3c, +0xae, 0xa7, 0xd0, 0x5e, 0x31, 0xba, 0x14, 0xa1, +0xb1, 0xfc, 0xd5, 0x70, 0xe9, 0x03, 0xee, 0xfc, +0x29, 0xd0, 0x3b, 0x52, 0xad, 0xa3, 0xcc, 0x9f, +0x61, 0x17, 0x97, 0x94, 0xf0, 0x9c, 0xb0, 0x75, +0x5b, 0x3c, 0xdb, 0x1d, 0xef, 0xa0, 0x90, 0x45, +0x99, 0xb3, 0x1e, 0x9f, 0x0f, 0x44, 0xa1, 0xaf, +0x03, 0x49, 0x60, 0x88, 0xc4, 0xe6, 0xb5, 0x71, +0xad, 0x18, 0x48, 0x67, 0x40, 0x38, 0xd0, 0x0c, +0xa9, 0x6d, 0x8c, 0xbc, 0xab, 0x5e, 0x87, 0x9c, +0xd1, 0x99, 0x77, 0xea, 0x4b, 0xe6, 0xb7, 0x05, +0x05, 0xf1, 0x44, 0xfc, 0x77, 0x58, 0xc6, 0xfc, +0xfe, 0xd9, 0x0a, 0xc2, 0x09, 0x51, 0x7c, 0xec, +0x19, 0x69, 0x48, 0xa7, 0x81, 0xec, 0x0a, 0x60, +0x71, 0x15, 0x68, 0xba, 0x65, 0x29, 0x5c, 0xee, +0x78, 0x8c, 0x60, 0x51, 0x19, 0xf6, 0x37, 0x59, +0xd7, 0xc9, 0x97, 0xf5, 0xbb, 0xb3, 0x84, 0x64, +0x66, 0x49, 0x94, 0xd8, 0x3d, 0xc5, 0x95, 0x36, +0xc0, 0xc9, 0xa0, 0x55, 0x50, 0xec, 0x7c, 0x9b, +0xca, 0xf2, 0x27, 0x7f, 0x91, 0x5e, 0x58, 0x57, +0xaf, 0x6d, 0x38, 0x3e, 0x33, 0xdb, 0x51, 0xe3, +0xbf, 0xd2, 0xff, 0xb8, 0xff, 0x0c, 0x09, 0xcf, +0x3b, 0x03, 0x60, 0xb5, 0x80, 0xf1, 0xb1, 0xb3, +0xf6, 0x9c, 0xb1, 0x68, 0x65, 0x71, 0x26, 0xc3, +0x17, 0x5d, 0x3c, 0x17, 0x43, 0x20, 0x33, 0xa8, +0x63, 0x51, 0x80, 0x9b, 0x8e, 0xfe, 0x28, 0x26, +0x8c, 0xd2, 0x3d, 0xbf, 0x1d, 0x65, 0x1a, 0x5f, +0xbf, 0x37, 0xa7, 0x67, 0x58, 0x2c, 0xc0, 0xda, +0x2b, 0xa8, 0x55, 0x2c, 0x52, 0xf3, 0xc6, 0x59, +0xfb, 0x49, 0x5a, 0xaa, 0x20, 0x71, 0xa7, 0xf3, +0x24, 0x83, 0x5e, 0xc6, 0xbc, 0xac, 0xa0, 0xf5, +0xf7, 0x62, 0x74, 0x54, 0x11, 0xff, 0xcb, 0xf8, +0x0f, 0x4c, 0xf1, 0xc7, 0x1d, 0xb6, 0x9e, 0xcf, +0x11, 0x04, 0xa6, 0x8e, 0x16, 0x1b, 0x41, 0x30, +0x54, 0x49, 0x13, 0x9b, 0xb8, 0x24, 0xdf, 0x1c, +0x37, 0x0a, 0x7b, 0x06, 0xfa, 0x02, 0xa4, 0x80, +0x43, 0xe2, 0x36, 0xef, 0xb0, 0xba, 0x5a, 0x5e, +0xcb, 0x8a, 0x8b, 0xb8, 0xaa, 0x0b, 0xbe, 0x02, +0x70, 0x94, 0x46, 0xc0, 0x19, 0x40, 0xf6, 0x4e, +0x6d, 0x7f, 0x4d, 0xc9, 0xdc, 0xc9, 0x48, 0x1e, +0x1f, 0x3a, 0x7e, 0x3d, 0x69, 0x47, 0x53, 0xab, +0x45, 0x77, 0xba, 0x98, 0x15, 0x53, 0x66, 0xae, +0xc3, 0x60, 0xba, 0x9d, 0x29, 0x83, 0xa3, 0xdc, +0x1b, 0xf8, 0xad, 0x4d, 0xda, 0x9a, 0x09, 0xb0, +0x18, 0xfa, 0xf5, 0xbd, 0x73, 0x17, 0x1b, 0x7a, +0xc7, 0xdf, 0x8c, 0xc4, 0x5f, 0x2b, 0x99, 0x91, +0x4f, 0x1e, 0x6b, 0x07, 0x96, 0xfd, 0x45, 0xe2, +0x37, 0x21, 0x58, 0xf2, 0x93, 0x34, 0xe8, 0x06, +0x3b, 0xff, 0xfc, 0x9a, 0x6b, 0x1d, 0x6e, 0x9b, +0x61, 0xd3, 0xae, 0x6f, 0xe6, 0xa1, 0x86, 0xfc, +0x3a, 0xc9, 0x51, 0xa6, 0x70, 0x1d, 0xc8, 0x8c, +0xdd, 0x09, 0x28, 0x8c, 0x7f, 0x3d, 0xfa, 0x4d, +0xae, 0xd9, 0x9e, 0x29, 0xbe, 0x56, 0xc2, 0x8e, +0x3f, 0xef, 0xb2, 0x66, 0x2f, 0xa5, 0x95, 0x14, +0x13, 0xd1, 0xfd, 0xa5, 0xda, 0xca, 0x6d, 0x91, +0xf1, 0x8e, 0x42, 0x81, 0xd4, 0xff, 0x5d, 0xc4, +0x4c, 0x2e, 0x14, 0x7c, 0xbb, 0x3d, 0x40, 0x5a, +0x6d, 0x97, 0xd2, 0x3d, 0x2a, 0x1f, 0xdd, 0x9f, +0x84, 0xc6, 0x00, 0xe0, 0xa9, 0x13, 0xfa, 0xc8, +0x2d, 0xca, 0x95, 0x6e, 0xcc, 0xa9, 0x66, 0x1b, +0x5f, 0x98, 0xa6, 0x1b, 0xb2, 0x5a, 0x8f, 0x73, +0x96, 0x91, 0xe7, 0x5d, 0xb7, 0x8a, 0xb1, 0xfc, +0x7d, 0x93, 0x9b, 0x7b, 0x4d, 0x5c, 0x94, 0xaf, +0xaf, 0x4a, 0xb5, 0xb0, 0xe9, 0x27, 0x35, 0x6f, +0xcb, 0xa2, 0x4c, 0x35, 0xd6, 0x73, 0xe2, 0x43, +0x5c, 0xb6, 0x0e, 0x08, 0x16, 0x4d, 0xa7, 0xc5, +0xbb, 0xe6, 0xf7, 0xce, 0xaa, 0xce, 0x65, 0x08, +0x2f, 0x4c, 0x67, 0x1a, 0xce, 0xe7, 0x46, 0x4f, +0x2b, 0x05, 0x80, 0x6f, 0x33, 0x27, 0x61, 0x36, +0x53, 0xd9, 0xa0, 0x40, 0x6a, 0xc3, 0xa3, 0xce, +0xc9, 0xa9, 0x14, 0x93, 0xed, 0x6b, 0xda, 0x27, +0x95, 0xaf, 0xe0, 0x62, 0x42, 0xea, 0x15, 0xe5, +0x18, 0x1c, 0xb3, 0xec, 0x0f, 0xe9, 0x46, 0xc9, +0xc8, 0x57, 0x14, 0x5a, 0xf3, 0xd6, 0x91, 0xcf, +0xd6, 0x92, 0x43, 0x18, 0x47, 0x8d, 0x7a, 0x14, +0xcc, 0xf5, 0x24, 0x08, 0x17, 0x20, 0xc9, 0x33, +0xcb, 0x5b, 0xb8, 0xc2, 0x9a, 0xfc, 0xf0, 0x2e, +0xd4, 0x11, 0x18, 0xb9, 0xa3, 0x0c, 0x63, 0x9c, +0x86, 0xe3, 0x72, 0x13, 0xdf, 0xc5, 0x42, 0x93, +0x4f, 0x90, 0x8b, 0x5e, 0x2e, 0xa7, 0xec, 0x8d, +0x45, 0xe0, 0xca, 0x5b, 0x00, 0x91, 0x61, 0x9f, +0xd4, 0x0c, 0x68, 0x6a, 0xc9, 0xf1, 0x42, 0xa6, +0xb0, 0xfe, 0x60, 0xa7, 0x08, 0xff, 0x2c, 0x69, +0xfd, 0x40, 0x43, 0xe9, 0x96, 0x27, 0x42, 0x9e, +0xb3, 0xbe, 0xb4, 0xb2, 0x9c, 0x3c, 0xd7, 0x6d, +0xb5, 0x7e, 0x69, 0xce, 0xeb, 0x68, 0xd3, 0x01, +0xa2, 0x46, 0x1a, 0x60, 0xbc, 0x68, 0x4d, 0x26, +0xd0, 0x54, 0x4a, 0xda, 0x9c, 0x35, 0x36, 0xe6, +0xd0, 0x0b, 0x9d, 0xbb, 0x95, 0x63, 0xe1, 0x65, +0x48, 0xd0, 0xd6, 0x27, 0x71, 0xb5, 0x03, 0x6f, +0x9a, 0x6d, 0xcd, 0xd0, 0x7f, 0x46, 0xb8, 0x07, +0xcc, 0x1d, 0x16, 0x9b, 0xea, 0x39, 0x0e, 0x36, +0xd7, 0x8e, 0xa7, 0x47, 0xe6, 0x13, 0xce, 0x55, +0x3a, 0x8f, 0x9d, 0x8f, 0xe8, 0x8d, 0xec, 0x7d, +0xcf, 0x18, 0xb6, 0xf7, 0x69, 0x56, 0x2e, 0xb1, +0x1d, 0x9a, 0x49, 0x1b, 0x87, 0xc3, 0x71, 0xc9, +0xac, 0xb8, 0xf1, 0x2d, 0xdd, 0x0b, 0x34, 0x40, +0x21, 0xa2, 0x56, 0xaf, 0x5f, 0xe8, 0xc4, 0xc9, +0xb1, 0x03, 0x75, 0x55, 0x27, 0x17, 0x3a, 0xfe, +0x29, 0x92, 0x35, 0x1e, 0x55, 0x8a, 0xcc, 0x1d, +0x54, 0x07, 0x71, 0x74, 0x2f, 0x85, 0xf2, 0x55, +0x73, 0x40, 0x8f, 0xd0, 0x6f, 0xf0, 0xea, 0xd9, +0x67, 0x35, 0xd0, 0xb1, 0x90, 0x64, 0x3f, 0xf9, +0xcc, 0x34, 0x45, 0x87, 0x16, 0xf6, 0x37, 0xab, +0xa8, 0x14, 0x3c, 0xd9, 0x11, 0x73, 0xc3, 0x92, +0xa5, 0x40, 0x44, 0x1a, 0x3d, 0xb9, 0xdf, 0x61, +0x0b, 0xaf, 0xf9, 0x5a, 0x9d, 0x1f, 0x45, 0xf0, +0xf5, 0xbd, 0x35, 0xbe, 0xbb, 0xa0, 0xd5, 0x87, +0x8e, 0xcc, 0x7d, 0xb4, 0x55, 0x5e, 0x4e, 0x81, +0x9f, 0xbb, 0xca, 0xc5, 0x37, 0xd5, 0x43, 0x91, +0x3f, 0xb8, 0xe9, 0x72, 0xc6, 0x67, 0x1a, 0xc8, +0xd4, 0x94, 0x43, 0x54, 0xe7, 0x41, 0x68, 0xce, +0x2d, 0xba, 0x77, 0xbf, 0x14, 0xe7, 0x6a, 0xd9, +0x1f, 0xd4, 0x5b, 0xb5, 0xd8, 0xce, 0x8d, 0xc4, +0xc2, 0x9d, 0xbb, 0x4c, 0xce, 0x3e, 0x3b, 0xe0, +0xa7, 0x9a, 0x46, 0xb0, 0x8e, 0x6c, 0xcb, 0x21, +0x5c, 0x8e, 0xba, 0xb5, 0xe4, 0x9a, 0x18, 0x62, +0xb3, 0x6c, 0x5c, 0xc2, 0x74, 0x51, 0xe2, 0x3b, +0x96, 0xfd, 0xd3, 0x97, 0xad, 0xff, 0xb7, 0xff, +0xe0, 0x34, 0x63, 0xc4, 0x3c, 0x18, 0xf5, 0x67, +0x72, 0xcb, 0x09, 0x02, 0x42, 0x76, 0x87, 0x19, +0xe4, 0x71, 0xa3, 0x5d, 0x25, 0xe7, 0x44, 0x97, +0xf5, 0x58, 0x74, 0x66, 0xa3, 0x1c, 0x28, 0xe3, +0xb8, 0xa1, 0x5a, 0x23, 0x83, 0x66, 0x90, 0xa2, +0xdf, 0xd4, 0x23, 0x6f, 0xfe, 0xab, 0x70, 0x74, +0x72, 0xea, 0x9e, 0x13, 0xff, 0x95, 0x40, 0xa4, +0xed, 0x2c, 0x78, 0x92, 0x2b, 0x6b, 0xa1, 0x69, +0x9f, 0x10, 0x6a, 0x5b, 0xdd, 0xcf, 0x73, 0x7e, +0xa4, 0xd5, 0x22, 0x2a, 0xba, 0x1e, 0x41, 0x61, +0x09, 0x32, 0xbd, 0xe1, 0x9c, 0x67, 0x1a, 0x91, +0xfe, 0x91, 0x1c, 0x99, 0x16, 0xe4, 0xd5, 0x84, +0x1d, 0xc1, 0xa4, 0x72, 0x3d, 0xa0, 0x23, 0x5a, +0x0b, 0x03, 0x8e, 0x2f, 0x50, 0x87, 0x03, 0x95, +0x50, 0xaf, 0xf4, 0x06, 0x55, 0x98, 0xff, 0xa9, +0xcd, 0x6b, 0xa6, 0xaa, 0x0d, 0x23, 0xc4, 0x20, +0x14, 0x5c }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt15[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt17[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xd5, 0xb5, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x14, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x06, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; + +static char pkt18[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xd5, 0xb5, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x14, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0x06, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; + +static char pkt19[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xd5, 0xb6, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x15, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x06, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; + +static char pkt20[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xd5, 0xb6, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x15, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0x06, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; +#endif + +TAHI_TEST_SEQ tahi_ipsec_005[] = { + {TITLE, "IPSEC-005", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, + {ASSEMBLE, &pkt7[0], sizeof(pkt7), 3, 0, 0, 0, 0}, + {AD_CHECK, &pkt8[0], sizeof(pkt8), 5, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_005_size = sizeof(tahi_ipsec_005) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_006.c b/test/regression/tahi_test/tahi_ipsec_006.c new file mode 100644 index 00000000..40af6caa --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_006.c @@ -0,0 +1,181 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt0[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xea, 0xd1, +0x3a, 0x91, 0x23, 0xb5, 0x4e, 0xea, 0xea, 0x1d, +0x61, 0xbe, 0xf2, 0xaa, 0x23, 0x91, 0x78, 0xf8, +0x82, 0x25, 0xc0, 0xad, 0xf7, 0x6c, 0x68, 0x1c, +0xa3, 0xc7, 0x88, 0x6c, 0xcb, 0xc2, 0x3d, 0xa2, +0x47, 0x68 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, +0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xc3, 0xcd, +0x45, 0xa5, 0x4a, 0x1b, 0x5b, 0xd7, 0xe6, 0x82, +0x6a, 0x43, 0x30, 0xff, 0x58, 0x56, 0x10, 0x1d, +0xc6, 0xa4, 0xd9, 0x5a, 0x04, 0xb8, 0x51, 0x57, +0x41, 0xc2, 0x27, 0xa8, 0xcb, 0x42, 0xc7, 0x31, +0x8d, 0x69, 0x1d, 0xa1, 0x5d, 0xb4, 0xd4, 0xb6, +0x44, 0xa2 }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x24, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x96, +0xac, 0x2e, 0xb1, 0xb3, 0xdc, 0x8c, 0xfd, 0x67, +0xc6, 0xca, 0xcf, 0xcd, 0x5a, 0x0b, 0xfe, 0x0e, +0x0e, 0x7c }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xea, 0xd1, +0x3a, 0x91, 0x23, 0xb5, 0x4e, 0xea, 0xea, 0x1d, +0x61, 0xbe, 0xf2, 0xaa, 0x23, 0x91, 0x78, 0xf8, +0x82, 0x25, 0xc0, 0xad, 0xf7, 0x6c, 0x79, 0xb6, +0xa3, 0x10, 0x59, 0x74, 0x32, 0xe8, 0x7e, 0x7c, +0x1e, 0x59 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0xf6, +0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xae, 0x8c, +0xf7, 0x66, 0xa0, 0xed, 0x8f, 0x37, 0xe6, 0xe6, +0x55, 0x44, 0x41, 0x2b, 0x37, 0x0b, 0xf8, 0x57, +0xc4, 0x91, 0x3f, 0x54, 0xcf, 0xae, 0xdc, 0x79, +0x4b, 0xcd, 0x03, 0x75, 0x0f, 0x27, 0x5d, 0x43, +0x47, 0x04, 0x67, 0x2b, 0x51, 0x1d, 0x09, 0x5a, +0xeb, 0xd2 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_006[] = { + {TITLE, "IPSEC-006", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt0[0], sizeof(pkt0), 0, 0, 0, 0, 0}, /* Add a RA packet.*/ + {WAIT, NX_NULL, 0, 10, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, + {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0, 0, 0, 0, 0}, /* Send NA first. */ + {D_CHECK, &pkt7[0], sizeof(pkt7), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_006_size = sizeof(tahi_ipsec_006) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_007.c b/test/regression/tahi_test/tahi_ipsec_007.c new file mode 100644 index 00000000..f516a844 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_007.c @@ -0,0 +1,135 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x5b, +0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0x43, 0xcf, +0x37, 0xbd, 0x3b, 0x8d, 0x4b, 0x22, 0xa5, 0x67, +0xb4, 0x58, 0x1d, 0x7b, 0x3c, 0xfc, 0xcf, 0x25, +0xe5, 0x0e, 0x3c, 0xee, 0x5b, 0xc1, 0xb7, 0xc0, +0xa5, 0x0a, 0xff, 0x65, 0x49, 0x36, 0x32, 0xc0, +0x87, 0x6e, 0x88, 0x67, 0x50, 0xe4, 0x0e, 0x0d, +0x83, 0xd2 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xb7, 0x6e, +0xae, 0xf1, 0xe4, 0xb0, 0x56, 0xd6, 0x3a, 0x9e, +0x0b, 0xb4, 0xd2, 0x0b, 0xe0, 0x1f, 0x54, 0x9d, +0x15, 0x82, 0x22, 0xa1, 0xe7, 0xa8, 0x0d, 0x5e, +0x9d, 0x9a }; + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xa5, 0x3b, +0x91, 0x77, 0x91, 0x16, 0x3e, 0xa0, 0x3d, 0xb1, +0x63, 0xb8 }; + +static char pkt5[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x7f, +0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0x7a, 0xca, +0x08, 0x9d, 0x64, 0xad, 0x5f, 0x8a, 0x52, 0xcc, +0xaf, 0x66, 0xe3, 0xf0, 0x49, 0x54, 0x0b, 0x22, +0x12, 0x4a, 0xc1, 0x68, 0x9d, 0x61, 0x25, 0xdb, +0x2d, 0x07, 0x13, 0x60, 0xed, 0x51, 0xf9, 0xca, +0x5d, 0xe5, 0xa2, 0xdb, 0x16, 0xdf, 0xfe, 0xe6, +0x60, 0xa2 }; + +#if 0 +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt7[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_007[] = { + {TITLE, "IPSEC-007", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, + {INJECT, &pkt7[0], sizeof(pkt7), 0, 0, 0, 0, 0}, /* Send NA first. */ + {D_CHECK, &pkt5[0], sizeof(pkt5), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_007_size = sizeof(tahi_ipsec_007) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_008.c b/test/regression/tahi_test/tahi_ipsec_008.c new file mode 100644 index 00000000..ab4b7ca5 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_008.c @@ -0,0 +1,110 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0x68, 0x48, +0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0xdd, 0x46, +0x5c, 0xea, 0xe5, 0x8d, 0x53, 0x63, 0x0c, 0xcb, +0x5e, 0xe8, 0x1e, 0x3a, 0x6d, 0xe6, 0xb1, 0x43, +0x1c, 0x50, 0x0d, 0x1e, 0x29, 0x06, 0x0b, 0xb3, +0xa0, 0xfe, 0x3c, 0x53, 0x3d, 0xb6, 0x46, 0x88, +0xb8, 0x74, 0xe6, 0x0f, 0x2c, 0x0e, 0x87, 0x70, +0xf5, 0x29 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x13, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, +0x12, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +TAHI_TEST_SEQ tahi_ipsec_008[] = { + {TITLE, "IPSEC-008", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_008_size = sizeof(tahi_ipsec_008) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_008_02.c b/test/regression/tahi_test/tahi_ipsec_008_02.c new file mode 100644 index 00000000..8788b793 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_008_02.c @@ -0,0 +1,46 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x13, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, +0x12, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +TAHI_TEST_SEQ tahi_ipsec_008_02[] = { + {TITLE, "IPSEC-008_02", 12, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {CHECK, &pkt6[0], sizeof(pkt6), 3, 0, 0, 0, 0}, + {CHECK, NX_NULL, 0, 3, 0, 0, 0, 0}, + {CHECK, NX_NULL, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_008_02_size = sizeof(tahi_ipsec_008_02) / sizeof(TAHI_TEST_SEQ); + +#endif \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_ipsec_009.c b/test/regression/tahi_test/tahi_ipsec_009.c new file mode 100644 index 00000000..ba5096eb --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_009.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xb7, +0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0xef, 0x55, +0xca, 0x2d, 0xc0, 0x4a, 0x54, 0x46, 0x0f, 0x51, +0xfc, 0x9b, 0xf7, 0xd4, 0xfa, 0x10, 0xc4, 0x76, +0xae, 0xed, 0xce, 0x73, 0x41, 0x51, 0xe9, 0x20, +0xde, 0xf7, 0x03, 0x8c, 0x11, 0xbe, 0xe2, 0xcc, +0xb2, 0xdd, 0xdb, 0xc2, 0xc6, 0xc4, 0xed, 0xd9, +0x60, 0xee }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_009[] = { + {TITLE, "IPSEC-009", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_009_size = sizeof(tahi_ipsec_009) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_009_02.c b/test/regression/tahi_test/tahi_ipsec_009_02.c new file mode 100644 index 00000000..8c0ccd2f --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_009_02.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x13, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +TAHI_TEST_SEQ tahi_ipsec_009_02[] = { + {TITLE, "IPSEC-009-02", 12, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_009_02_size = sizeof(tahi_ipsec_009_02) / sizeof(TAHI_TEST_SEQ); + +#endif \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_ipsec_010.c b/test/regression/tahi_test/tahi_ipsec_010.c new file mode 100644 index 00000000..ca3c910d --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_010.c @@ -0,0 +1,148 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x5b, +0xa0, 0x57, 0x89, 0x22, 0xed, 0x9b, 0x47, 0x4d, +0x4f, 0x12, 0xcc, 0x65, 0xb7, 0x6a, 0x49, 0x35, +0xb0, 0x9f, 0x05, 0x22, 0x91, 0x0f, 0x77, 0xd1, +0xdf, 0x02, 0x60, 0x46, 0x8f, 0x90, 0x46, 0x52, +0x54, 0x25 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2b, 0xa5, +0xa3, 0x70, 0xf1, 0xba, 0xe4, 0x28, 0x9a, 0x80, +0x5a, 0x60, 0xb6, 0x12, 0x7d, 0x8e, 0x4c, 0x29, +0x23, 0x38, 0x41, 0x5b, 0xe8, 0x84, 0x7e, 0x0b, +0x0b, 0x2c, 0xa0, 0x77, 0xa7, 0x97, 0xd9, 0x4b, +0x86, 0x7b, 0x25, 0xc1, 0xe7, 0xca, 0x17, 0xa7, +0x7f, 0x69 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x01, 0x2c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x5b, +0xa0, 0x57, 0x89, 0x22, 0xed, 0x9b, 0x47, 0x4d, +0x4f, 0x12, 0xcc, 0x65, 0xb7, 0x6a, 0x49, 0x3d, +0xa4, 0x94, 0xcf, 0x82, 0xa0, 0x58, 0x1f, 0xba, +0xbc, 0xa5, 0xd9, 0xe6, 0xfd, 0x38, 0x5d, 0x8c, +0xf2, 0xc1, 0xac, 0xa9, 0x5f, 0xe1, 0x98, 0xe5, +0x09, 0x0d, 0x51, 0xff, 0x2a, 0x71, 0x93, 0x21, +0x37, 0x17, 0x64, 0xb4, 0xe0, 0x6b, 0xfe, 0x17, +0x9c, 0x4e, 0x64, 0x7b, 0xea, 0x92, 0x22, 0xf1, +0xb6, 0xd4, 0xf3, 0x93, 0x50, 0xa7, 0x1f, 0x43, +0xa1, 0x76, 0xbb, 0xa3, 0x9e, 0x45, 0x44, 0x12, +0xb7, 0x6b, 0x87, 0x48, 0x36, 0xe3, 0xf5, 0x72, +0x78, 0x06, 0x2a, 0xa0, 0x7c, 0xcf, 0x8d, 0xa0, +0x3f, 0x09, 0x3a, 0x79, 0x14, 0x06, 0xa3, 0xa0, +0xa6, 0x95, 0x33, 0xf7, 0xe1, 0x4a, 0xa2, 0x19, +0xe0, 0x88, 0x86, 0xb4, 0xfd, 0xb5, 0xb2, 0xa7, +0x4c, 0xd8, 0x89, 0x7f, 0x3c, 0x02, 0xd3, 0x3a, +0xe1, 0xfd, 0xc1, 0x4f, 0x79, 0x78, 0x2e, 0x89, +0x24, 0x17, 0xfa, 0xcb, 0x93, 0x70, 0x73, 0x58, +0xd4, 0xc3, 0x30, 0x4f, 0xb4, 0x64, 0x3f, 0x2a, +0x74, 0xbf, 0x49, 0xcd, 0xbc, 0xbb, 0x38, 0x25, +0x10, 0x84, 0x6c, 0x14, 0x81, 0xfc, 0xad, 0x5a, +0xcc, 0xbd, 0xbd, 0x6f, 0xe6, 0x55, 0x05, 0xaa, +0x6d, 0xa7, 0x47, 0xcd, 0x6d, 0x89, 0xf9, 0xa5, +0x7a, 0x30, 0x77, 0x4c, 0x41, 0x32, 0xbc, 0xfc, +0x4f, 0x0b, 0x05, 0x49, 0xca, 0x2e, 0x00, 0x8b, +0xc8, 0x63, 0x13, 0xca, 0x25, 0x77, 0x8d, 0xbe, +0x7d, 0x21, 0x23, 0xe5, 0x9d, 0x40, 0x3e, 0xd5, +0x81, 0xcf, 0x08, 0x83, 0x09, 0x55, 0x9c, 0x02, +0x55, 0xb0, 0x4a, 0xc0, 0xe0, 0xe3, 0x03, 0x25, +0xde, 0xc0, 0x98, 0xf5, 0xe3, 0xe8, 0x9b, 0xa6, +0x0d, 0xd0, 0x75, 0xbf, 0x04, 0x67, 0x47, 0x68, +0x5a, 0xdb, 0x1f, 0x08, 0x0d, 0xfc, 0x25, 0x7d, +0x3d, 0x7b, 0xcd, 0x0a, 0x15, 0xa4, 0x1e, 0x5a, +0xe1, 0x95, 0x57, 0x4b, 0x4b, 0xb8, 0x01, 0x35, +0x72, 0xf2, 0x81, 0x82, 0x71, 0x0f, 0xe3, 0xd7, +0x48, 0x7f }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, +0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0x31, 0x8b, +0x80, 0x35, 0x94, 0xb1, 0xd3, 0xb4, 0xdf, 0x9d, +0x9b, 0x07, 0x97, 0x8e, 0x01, 0x4d, 0xe1, 0x07, +0x7c, 0x35, 0x6d, 0xd5, 0x57, 0xb2, 0xd6, 0xb5, +0x0b, 0x74, 0x75, 0x04, 0x68, 0xb6, 0x3c, 0x82, +0xe8, 0x4b }; + +TAHI_TEST_SEQ tahi_ipsec_010[] = { + {TITLE, "IPSEC-010", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_010_size = sizeof(tahi_ipsec_010) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_012.c b/test/regression/tahi_test/tahi_ipsec_012.c new file mode 100644 index 00000000..a5b944ac --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_012.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7a, 0x2f, +0x2d, 0x74, 0x96, 0x07, 0x1f, 0x0d, 0x82, 0x41, +0xc7, 0xf2, 0xa7, 0x7c, 0x7b, 0x41, 0x3a, 0xef, +0xcc, 0xf4, 0x64, 0xbd, 0xbf, 0x5f, 0x72, 0xdc, +0x46, 0xfa, 0xde, 0xa6, 0xe2, 0x7c, 0xde, 0x6c, +0x44, 0x63, 0x1c, 0xa7, 0x2c, 0xb7, 0xed, 0x7a, +0xfb, 0x04, 0xd3, 0x2c, 0xe0, 0xca, 0x00, 0x0d, +0x38, 0xe8 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x90, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xec, 0x69, +0xfd, 0xd9, 0x61, 0xd2, 0xa2, 0xb4, 0x20, 0xac, +0x2d, 0x26 }; + +TAHI_TEST_SEQ tahi_ipsec_012[] = { + {TITLE, "IPSEC-012", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0],sizeof(pkt5),0, 0, 0, 0, 0}, + {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_012_size = sizeof(tahi_ipsec_012) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_013.c b/test/regression/tahi_test/tahi_ipsec_013.c new file mode 100644 index 00000000..5a3f426a --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_013.c @@ -0,0 +1,102 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x09, 0x5e, +0x03, 0x76, 0x2c, 0x70, 0xf7, 0x40, 0x93, 0x0d, +0x77, 0x9d, 0x7a, 0xd2, 0xaf, 0xb6, 0x1f, 0x55, +0x62, 0x92, 0x1e, 0x9b, 0xf8, 0xa8, 0x5e, 0xb1, +0x6e, 0x4b, 0x80, 0x1f, 0xf1, 0xa9, 0x2d, 0x25, +0x35, 0x69, 0x92, 0x1b, 0x23, 0x99, 0x2f, 0x92, +0x4e, 0xbb, 0xff, 0x74, 0xb1, 0xfe, 0x3a, 0xde, +0xe4, 0xaa }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xaa, 0xaa, +0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, +0xaa, 0xaa, 0xaa, 0xaa, 0x6d, 0x38, 0x5a, 0x47, +0x8b, 0x08, 0x88, 0x5b, 0xd1, 0xce, 0x49, 0xfd, +0xe6, 0x6b }; + +TAHI_TEST_SEQ tahi_ipsec_013[] = { + {TITLE, "IPSEC-013", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_013_size = sizeof(tahi_ipsec_013) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_014.c b/test/regression/tahi_test/tahi_ipsec_014.c new file mode 100644 index 00000000..32e154bf --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_014.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, +0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, +0x5e, 0x4f }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0xa5, 0x2c, +0xa7, 0x6f, 0x57, 0x41, 0xa8, 0x2a, 0x48, 0xc6, +0x65, 0xe7, 0x0b, 0x84, 0x6e, 0x78, 0x52, 0xf4, +0x83, 0x67, 0x4a, 0x71, 0x15, 0xfe, 0x8d, 0x85, +0x27, 0x2c, 0xe4, 0x03, 0x9a, 0x37, 0xa7, 0x9e, +0xcf, 0x14, 0x20, 0x06, 0x86, 0x14, 0xcd, 0x24, +0x60, 0xd4, 0xd2, 0x5d, 0x2e, 0x18, 0x7c, 0x6a, +0xe3, 0x92 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_014[] = { + {TITLE, "IPSEC-014", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_014_size = sizeof(tahi_ipsec_014) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_015.c b/test/regression/tahi_test/tahi_ipsec_015.c new file mode 100644 index 00000000..934e9041 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_015.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xa4, 0xa8, +0x86, 0xf5, 0x75, 0xa6, 0xcd, 0x0d, 0x52, 0x65, +0x67, 0x3a }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x74, 0xdf, +0xa0, 0x58, 0x64, 0x03, 0x4a, 0x47, 0xa0, 0x37, +0x93, 0x62, 0xa4, 0x07, 0x3f, 0x8d, 0xec, 0x0e, +0x2f, 0x4c, 0xb7, 0xd2, 0xb7, 0x31, 0xb0, 0xb5, +0x92, 0x33, 0x40, 0xd6, 0xb8, 0x89, 0xcc, 0xf8, +0x4b, 0x99, 0x20, 0xf2, 0x0e, 0x99, 0x0c, 0x74, +0xbb, 0xf3, 0xe8, 0x8a, 0xc5, 0x60, 0x89, 0x3e, +0x59, 0x0f }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_015[] = { + {TITLE, "IPSEC-015", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_015_size = sizeof(tahi_ipsec_015) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_016.c b/test/regression/tahi_test/tahi_ipsec_016.c new file mode 100644 index 00000000..bd962cc7 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_016.c @@ -0,0 +1,78 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, +0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, +0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, +0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc4, 0x3c, +0x53, 0x2e, 0xaf, 0x5f, 0x18, 0x04, 0xfa, 0xeb, +0x30, 0x09, 0x0d, 0x92, 0xaa, 0x89, 0x43, 0x6a, +0xae, 0x69, 0x9d, 0x12, 0x4f, 0x4e, 0x9f, 0x5a, +0x97, 0x04, 0xd7, 0x27, 0x69, 0x5c, 0x5f, 0xab, +0x48, 0x2a, 0x44, 0x30, 0xe0, 0x55 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_016[] = { + {TITLE, "IPSEC-016", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_016_size = sizeof(tahi_ipsec_016) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_017.c b/test/regression/tahi_test/tahi_ipsec_017.c new file mode 100644 index 00000000..0b952f1a --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_017.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x58, +0x93, 0x6c, 0xa3, 0xc3, 0xe3, 0x73, 0x64, 0x62, +0xf2, 0x46, 0x31, 0x67, 0x99, 0x1d, 0xba, 0x56, +0x20, 0x17, 0x3e, 0x4a, 0xf9, 0xc8, 0x62, 0x98, +0x2e, 0x71, 0xff, 0x02, 0xa6, 0x85, 0x5a, 0xd0, +0x2d, 0x42, 0x23, 0x8c, 0xbc, 0x26, 0xfd, 0xc9, +0xf2, 0x26 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0xb1, +0xe3, 0x6d, 0x28, 0x86, 0xab, 0x0c, 0xa4, 0xbf, +0x43, 0x70, 0xe9, 0x50, 0x81, 0x39, 0x4a, 0x3b, +0xf6, 0xb1, 0x38, 0x92, 0x9b, 0xad, 0x94, 0xe2, +0x3f, 0xda, 0xb9, 0xbb, 0x1e, 0x0c, 0x20, 0x17, +0xe3, 0x21, 0xab, 0xce, 0xba, 0x5f, 0xe5, 0xb9, +0x15, 0x2e, 0x5f, 0xb3, 0xda, 0x37, 0x0a, 0x86, +0xea, 0xce, 0x93, 0x45, 0xcf, 0x28, 0x47, 0x50, +0x92, 0x35 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_017[] = { + {TITLE, "IPSEC-017", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_017_size = sizeof(tahi_ipsec_017) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_018.c b/test/regression/tahi_test/tahi_ipsec_018.c new file mode 100644 index 00000000..8555edda --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_018.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xad, +0xfa, 0x5d, 0x9a, 0x13, 0xd5, 0xfd, 0x62, 0x7d, +0x3b, 0x93, 0xa1, 0x5b, 0xd7, 0x75, 0xc2, 0x4b, +0xa4, 0x99, 0x2c, 0x25, 0x54, 0x24, 0xf3, 0xac, +0x1c, 0xe6, 0x8f, 0x72, 0x43, 0xa0, 0xdf, 0xda, +0x82, 0x1c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x57, 0x16, +0x52, 0x37, 0xdb, 0x2f, 0x9a, 0x4d, 0xa9, 0x89, +0x36, 0x77, 0x58, 0x06, 0x0e, 0x5a, 0x29, 0xca, +0x7f, 0xfc, 0x62, 0x0c, 0x72, 0x7a, 0x19, 0x07, +0x02, 0x56, 0x49, 0x10, 0xe6, 0xf3, 0xdd, 0x71, +0xf9, 0x5e, 0xa7, 0xb5, 0x41, 0x87, 0x27, 0x5d, +0x35, 0x8c, 0x5e, 0xf0, 0x05, 0x9e, 0xdb, 0x9f, +0x02, 0xbe }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_018[] = { + {TITLE, "IPSEC-018", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_018_size = sizeof(tahi_ipsec_018) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_019.c b/test/regression/tahi_test/tahi_ipsec_019.c new file mode 100644 index 00000000..6ba8c040 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_019.c @@ -0,0 +1,79 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, +0x13, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f, 0x00, 0x3a, 0xba, 0x19, +0x8b, 0x06, 0x67, 0x5d, 0x31, 0x3e, 0x5f, 0xd5, +0x7c, 0x50 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, +0x12, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f, 0x01, 0x02, 0x03, 0x04, +0x04, 0x3a, 0x47, 0x50, 0x6a, 0xdd, 0xbe, 0xe3, +0x26, 0xb5, 0xec, 0x8b, 0x07, 0xbe }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_019[] = { + {TITLE, "IPSEC-019", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_019_size = sizeof(tahi_ipsec_019) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_022.c b/test/regression/tahi_test/tahi_ipsec_022.c new file mode 100644 index 00000000..ca079352 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_022.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xe5, +0x23, 0x8e, 0x82, 0xc1, 0xde, 0xab, 0x58, 0xa3, +0x1a, 0x7e, 0x20, 0x57, 0xd6, 0xa2, 0xc4, 0x41, +0x27, 0x06, 0x99, 0xba, 0xb7, 0xd9, 0x52, 0x6a, +0x21, 0x05, 0xc6, 0x72, 0x32, 0xc6, 0xe4, 0x8d, +0x73, 0xab, 0x10, 0x71, 0xeb, 0x36, 0x29, 0xe8, +0x57, 0xd8, 0x82, 0x0f, 0x74, 0xbf, 0x02, 0xd7, +0x9b, 0x39, 0x97, 0xec, 0xe1, 0xe5, 0x82, 0x1d, +0x67, 0x94, 0x12, 0xba, 0xbc, 0x47, 0x7a, 0x58, +0xf6, 0x9b, 0x99, 0x3d, 0x9f, 0x4e, 0x0f, 0x13, +0x9b, 0xc2 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5e, 0x62, +0xc3, 0x76, 0x20, 0x50, 0x07, 0x55, 0x6f, 0xef, +0xce, 0x13, 0x9c, 0x0f, 0xa4, 0xaf, 0x12, 0x60, +0x1e, 0x93, 0x73, 0x95, 0x34, 0xe4, 0x18, 0xcd, +0x2a, 0x05, 0x76, 0xab, 0x46, 0x1d, 0x9d, 0x3b, +0x2a, 0xd1, 0x96, 0xff, 0x00, 0xb4, 0x88, 0x78, +0x9e, 0x55, 0x7a, 0xdf, 0x4b, 0x26, 0xfb, 0x46, +0x7e, 0xe1, 0xf1, 0x2d, 0x95, 0x0c, 0xaf, 0xa2, +0x96, 0xb7, 0x9f, 0xca, 0xf7, 0x37, 0x94, 0x77, +0xf8, 0x8a, 0x59, 0x83, 0xde, 0xcf, 0x4d, 0x34, +0xc7, 0x7d, 0xc2, 0x59, 0xe2, 0x5c, 0x90, 0xad, +0x1f, 0x59, 0x52, 0xd9, 0xac, 0xc6, 0xf8, 0xe3, +0xa7, 0xb0 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_022[] = { + {TITLE, "IPSEC-022", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_022_size = sizeof(tahi_ipsec_022) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_023.c b/test/regression/tahi_test/tahi_ipsec_023.c new file mode 100644 index 00000000..63ed95d3 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_023.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xe5, +0x23, 0x8e, 0x82, 0xc1, 0xde, 0xab, 0x29, 0x84, +0x15, 0x51, 0xff, 0xe3, 0xd5, 0xe4, 0xc3, 0xd4, +0xc7, 0x3d, 0x34, 0x47, 0x77, 0x02, 0x35, 0xaf, +0x15, 0xdb, 0xd4, 0xba, 0xae, 0x95, 0x65, 0x1a, +0xa2, 0x78, 0x15, 0x52, 0x8d, 0xc4, 0x29, 0xfc, +0x74, 0xf9, 0x97, 0x10, 0x80, 0xb6, 0xea, 0x3c, +0xb0, 0x9d, 0xfc, 0x6a, 0x6d, 0x33, 0x80, 0x9a, +0xac, 0x49, 0xcd, 0xa9, 0xc9, 0x95, 0x6c, 0x79, +0x6f, 0xb7, 0xf2, 0x5f, 0x49, 0x94, 0x55, 0xfc, +0x9e, 0x65 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfb, 0x54, +0x9b, 0x32, 0x38, 0xc0, 0x1f, 0x38, 0xf1, 0x4d, +0xab, 0x84, 0xdd, 0x1d, 0x11, 0x14, 0xa6, 0xf9, +0x1d, 0x9d, 0x3d, 0xa2, 0x07, 0x15, 0x06, 0x42, +0xd6, 0x8e, 0x35, 0x02, 0x0e, 0x66, 0x0e, 0x2c, +0xfe, 0x33, 0x13, 0xc0, 0xc3, 0xc4, 0x4f, 0xab, +0x5c, 0xf0, 0x69, 0x47, 0x50, 0x3f, 0x79, 0x5a, +0x57, 0xe9, 0x08, 0x7e, 0x65, 0xb5, 0x5e, 0x9a, +0x3b, 0x22, 0x89, 0x7e, 0xbe, 0xbd, 0xb4, 0xf1, +0x14, 0x50, 0xaa, 0x2c, 0x49, 0xf0, 0x86, 0x73, +0x75, 0x4b, 0x8a, 0xc4, 0x7e, 0xb4, 0xc1, 0xb9, +0xb2, 0xbf, 0x05, 0x0b, 0xae, 0x73, 0xd7, 0x8f, +0x9a, 0x23 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_023[] = { + {TITLE, "IPSEC-023", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_023_size = sizeof(tahi_ipsec_023) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_024.c b/test/regression/tahi_test/tahi_ipsec_024.c new file mode 100644 index 00000000..7bd205b6 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_024.c @@ -0,0 +1,139 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xe5, +0x23, 0x8e, 0x82, 0xc1, 0xde, 0xab, 0x29, 0x84, +0x15, 0x51, 0xff, 0xe3, 0xd5, 0xe4, 0xc3, 0xd4, +0xc7, 0x3d, 0x34, 0x47, 0x77, 0x02, 0x35, 0xaf, +0x15, 0xdb, 0xd4, 0xba, 0xae, 0x95, 0x65, 0x1a, +0xa2, 0x78, 0x15, 0x52, 0x8d, 0xc4, 0x29, 0xfc, +0x74, 0xf9, 0x97, 0x10, 0x80, 0xb6, 0xea, 0x3c, +0xb0, 0x9d, 0xfc, 0x6a, 0x6d, 0x33, 0x80, 0x9a, +0xac, 0x49, 0xcd, 0xa9, 0xc9, 0x95, 0x6c, 0x79, +0x6f, 0xb7, 0xf2, 0x5f, 0x49, 0x94, 0x55, 0xfc, +0x9e, 0x65 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa8, 0xd5, +0x78, 0x53, 0x4e, 0x00, 0xe5, 0x76, 0x92, 0xc5, +0x35, 0x63, 0xea, 0xee, 0x2d, 0xf0, 0xd3, 0x55, +0xf4, 0x44, 0x42, 0x26, 0xa5, 0x87, 0x52, 0x84, +0x58, 0xb5, 0x5c, 0x97, 0x1b, 0xcc, 0x6d, 0xd4, +0xaa, 0x66, 0x80, 0x5f, 0x03, 0x3f, 0xf1, 0x3a, +0xa4, 0x30, 0x5e, 0xdb, 0xad, 0xba, 0xce, 0x26, +0x68, 0xdc, 0x41, 0x40, 0xd0, 0x64, 0xe1, 0x36, +0xf7, 0x45, 0x7a, 0x35, 0xeb, 0x93, 0xee, 0xbc, +0x3f, 0xb4, 0x24, 0xa7, 0x63, 0x86, 0x94, 0x74, +0xa0, 0x86, 0x1a, 0x42, 0xcd, 0xe0, 0x81, 0x8d, +0xbb, 0x9a, 0x33, 0x5a, 0x30, 0x18, 0x8e, 0x5c, +0x28, 0x0f }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x73, +0x3a, 0xda, 0x5b, 0x57, 0x9a, 0x02, 0x84, 0x0f, +0x1a, 0x6c, 0xb3, 0x20, 0xd1, 0x23, 0x17, 0x72, +0x8b, 0x53, 0xcc, 0x50, 0xbb, 0x9e, 0x25, 0x7c, +0xa5, 0x0c, 0x8a, 0x05, 0xf0, 0x30, 0xbb, 0x08, +0xc0, 0xac, 0xf5, 0x51, 0x92, 0x04, 0x9e, 0x40, +0x3a, 0x63, 0x09, 0xe2, 0x7b, 0x92, 0xdb, 0x03, +0x42, 0xc6, 0xb0, 0x70, 0xdb, 0xb0, 0x2c, 0x82, +0x57, 0xac, 0x1c, 0x31, 0xbf, 0x33, 0x39, 0xb3, +0xbc, 0x3e, 0xcc, 0xa2, 0x42, 0x1e, 0x3b, 0xc1, +0x5f, 0x96 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa6, 0x87, +0x7d, 0x79, 0x14, 0xc7, 0x56, 0x27, 0x61, 0xa0, +0xe7, 0x36, 0xec, 0x4f, 0x3a, 0xf3, 0xe0, 0x90, +0xa5, 0x8c, 0xaf, 0x7b, 0x2d, 0xd6, 0xbf, 0x27, +0xb9, 0x25, 0xe1, 0x6f, 0x63, 0x4b, 0x4a, 0xab, +0x43, 0xe1, 0x6d, 0x2f, 0xbd, 0xeb, 0xab, 0x04, +0x7f, 0x87, 0x45, 0x52, 0x39, 0xd2, 0x7f, 0x11, +0xb9, 0xc0, 0x83, 0x41, 0x80, 0xba, 0x42, 0x9a, +0x06, 0xa3, 0x0d, 0xed, 0x05, 0xee, 0x39, 0x01, +0x19, 0x30, 0xd5, 0x4d, 0xeb, 0x7c, 0x57, 0x33, +0x46, 0x1c, 0xc2, 0xa4, 0x0f, 0xf4, 0xe6, 0x72, +0xd9, 0xeb, 0x5a, 0xec, 0xeb, 0xe2, 0xe8, 0xa0, +0x9d, 0x30 }; + +TAHI_TEST_SEQ tahi_ipsec_024[] = { + {TITLE, "IPSEC-024", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_024_size = sizeof(tahi_ipsec_024) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_025.c b/test/regression/tahi_test/tahi_ipsec_025.c new file mode 100644 index 00000000..0dc54c21 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_025.c @@ -0,0 +1,169 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbd, +0x5e, 0xcf, 0x95, 0x7f, 0xd6, 0x43, 0x59, 0x78, +0x73, 0x51, 0x34, 0x6a, 0x3a, 0x26, 0xb4, 0xe3, +0x2c, 0xf6, 0xfb, 0xf4, 0xc7, 0x3d, 0x68, 0xf7, +0xbe, 0xba, 0x09, 0x08, 0xed, 0x68, 0xe6, 0xfb, +0x95, 0xac, 0x68, 0xaa, 0x30, 0x13, 0xc2, 0x6c, +0x3e, 0xb3, 0x0f, 0x7a, 0xa8, 0x69, 0x96, 0xe0, +0x39, 0x32, 0xdd, 0x84, 0x3d, 0xfa, 0x9b, 0x19, +0x42, 0xf6, 0x5f, 0x10, 0xe3, 0x61, 0x91, 0xa0, +0x45, 0x8a, 0xb4, 0x5a, 0xd1, 0x15, 0x7c, 0x24, +0xea, 0xc2 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x93, 0x8d, +0x59, 0x4c, 0x25, 0xd7, 0x3b, 0x64, 0x2b, 0x9e, +0xcd, 0xe0, 0x2f, 0x8c, 0xf4, 0xcc, 0xed, 0x5f, +0x46, 0x21, 0x1b, 0xe7, 0xb4, 0xb6, 0x82, 0x98, +0x77, 0xce, 0x61, 0x52, 0xb0, 0x72, 0x56, 0x49, +0x8f, 0xd0, 0x87, 0xac, 0xff, 0xc9, 0xe3, 0xeb, +0xc2, 0xc9, 0x95, 0xdd, 0x63, 0xbd, 0x1e, 0x9f, +0x2a, 0xef, 0xb3, 0xfb, 0x51, 0x20, 0xb5, 0xc8, +0x71, 0x0d, 0x89, 0xba, 0x77, 0x6c, 0x15, 0xe3, +0x33, 0x7c, 0x18, 0x6a, 0xb6, 0x2e, 0x90, 0x35, +0xf0, 0xf2, 0xaf, 0x7e, 0xbd, 0xde, 0xe7, 0x40, +0xfa, 0xed }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x01, 0x54, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbd, +0x5e, 0xcf, 0x95, 0x7f, 0xd6, 0x43, 0x59, 0x78, +0x73, 0x51, 0x34, 0x6a, 0x3a, 0x26, 0xb4, 0xe3, +0x2c, 0xf6, 0xfb, 0xf4, 0xc7, 0x3d, 0x68, 0xf7, +0xbe, 0xba, 0x09, 0x08, 0xed, 0x68, 0xe6, 0xfb, +0x95, 0xac, 0x68, 0xaa, 0x30, 0x13, 0xc2, 0x6c, +0x3e, 0xb3, 0x0f, 0x7a, 0xa8, 0x69, 0x96, 0xe0, +0x39, 0x32, 0xdd, 0x84, 0x3d, 0xfa, 0xa7, 0x91, +0xb1, 0x91, 0xc9, 0xeb, 0xae, 0x69, 0x5c, 0xa3, +0x6d, 0xb9, 0xd8, 0x62, 0x07, 0xeb, 0xdd, 0x69, +0xd0, 0xec, 0xf6, 0x8a, 0x34, 0xbf, 0xb8, 0x2c, +0x7b, 0x09, 0x03, 0x78, 0xbd, 0x1f, 0x4d, 0xff, +0xbb, 0x9f, 0xab, 0x6f, 0xca, 0xb1, 0x00, 0x9f, +0x53, 0xef, 0x50, 0x44, 0xeb, 0xa1, 0x97, 0xd4, +0xa4, 0x3c, 0xd7, 0x6a, 0xf4, 0x7a, 0x9e, 0xfc, +0x06, 0x12, 0xca, 0xd9, 0x6b, 0x0f, 0xd7, 0x54, +0xdf, 0x43, 0xd1, 0x48, 0xfd, 0x91, 0x09, 0x42, +0x00, 0xf8, 0x87, 0x8f, 0xce, 0x7f, 0xeb, 0xc0, +0x54, 0xce, 0x13, 0xeb, 0x3c, 0x33, 0x2c, 0x1a, +0x40, 0xca, 0x29, 0xaa, 0x0e, 0xbc, 0x13, 0x4e, +0xdd, 0x46, 0x8f, 0x9e, 0x92, 0xaa, 0xa0, 0x16, +0x6b, 0x0e, 0x81, 0xed, 0x82, 0x50, 0x86, 0x70, +0x7b, 0xcf, 0x25, 0x02, 0x67, 0xf2, 0x7a, 0x8a, +0x2a, 0xc0, 0xfb, 0xc3, 0xcf, 0xb5, 0x53, 0xc8, +0x96, 0x78, 0x08, 0x05, 0x70, 0x8f, 0xf0, 0x2c, +0x84, 0x7b, 0x0e, 0x40, 0xc2, 0x2c, 0x34, 0x4e, +0x90, 0x2c, 0x08, 0xf7, 0x69, 0xab, 0xf5, 0xbf, +0x97, 0x82, 0x9a, 0x67, 0x13, 0x8c, 0x89, 0x63, +0xfc, 0x9e, 0xdf, 0xa4, 0x43, 0x71, 0xbd, 0xf9, +0x35, 0xac, 0xfa, 0xff, 0x68, 0x85, 0x48, 0xf2, +0x0c, 0x7a, 0xa6, 0x1d, 0xc6, 0x48, 0xeb, 0xf6, +0xdb, 0x34, 0x1e, 0x69, 0x31, 0x17, 0x28, 0xb2, +0xf8, 0xb6, 0x9f, 0xda, 0x3a, 0x1a, 0x3b, 0x68, +0xfb, 0xb0, 0xd9, 0xbe, 0xf6, 0x5f, 0x72, 0x2e, +0xd4, 0x1c, 0x59, 0x0a, 0x8a, 0x22, 0x92, 0x03, +0x6c, 0x9c, 0x1f, 0x23, 0x67, 0xd4, 0xdb, 0xbd, +0xd1, 0x09, 0xc7, 0x2a, 0x1b, 0x83, 0x69, 0xaf, +0x15, 0xbc, 0x80, 0xbd, 0xbf, 0x90, 0x3b, 0x97, +0xb6, 0xf2, 0x3b, 0x33, 0x94, 0x11, 0x3c, 0x29, +0x84, 0x37, 0x76, 0xf6, 0x19, 0x62, 0x3d, 0x94, +0xd8, 0x07, 0x33, 0xb0, 0x67, 0x29, 0x68, 0x7b, +0x84, 0xcd }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x56, 0x94, +0x44, 0x2b, 0x24, 0x86, 0x12, 0x67, 0x2b, 0x79, +0xb2, 0xc9, 0x36, 0xf4, 0x49, 0xf6, 0x5a, 0x25, +0xfe, 0x64, 0x5c, 0xeb, 0x1f, 0x32, 0xd3, 0x04, +0x74, 0xef, 0x88, 0x48, 0xc0, 0x5b, 0xc9, 0x20, +0x23, 0x5d, 0xd1, 0x5a, 0x78, 0x9c, 0xdc, 0x04, +0x8e, 0xeb, 0x82, 0x1a, 0x2e, 0x3d, 0x3a, 0xce, +0xde, 0x79, 0x8d, 0x87, 0x04, 0x28, 0xb9, 0xb8, +0x58, 0xe2, 0x1d, 0x29, 0x58, 0xf4, 0x7a, 0x29, +0x98, 0xbe, 0xda, 0xec, 0x8c, 0x11, 0xe5, 0x73, +0xb6, 0x37, 0x66, 0xbd, 0xfe, 0x51, 0x07, 0xf6, +0x6f, 0x0f }; + + +TAHI_TEST_SEQ tahi_ipsec_025[] = { + {TITLE, "IPSEC-025", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_025_size = sizeof(tahi_ipsec_025) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_026.c b/test/regression/tahi_test/tahi_ipsec_026.c new file mode 100644 index 00000000..4d4d834a --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_026.c @@ -0,0 +1,93 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf7, 0xfa, +0x79, 0x03, 0x31, 0x95, 0xbb, 0x35, 0x83, 0xc1, +0x8e, 0x7a, 0x24, 0xd4, 0xe9, 0x11, 0x49, 0x4b, +0xa2, 0x52, 0x59, 0xb1, 0x69, 0x8f, 0xe2, 0x59, +0x38, 0x5f, 0x62, 0xcd, 0xbb, 0x17, 0xf0, 0x00, +0xb3, 0xd2, 0x12, 0xf8, 0xb1, 0x25, 0x7a, 0xc0, +0x2e, 0x83, 0x0b, 0x7f, 0x53, 0x73, 0x4c, 0xd2, +0xbb, 0x5c, 0x64, 0x2b, 0xc2, 0x52, 0xd5, 0x6a, +0x59, 0x76, 0xc6, 0x64, 0x33, 0xa3, 0xff, 0xf4, +0x48, 0x2b, 0xe3, 0x73, 0x13, 0x69, 0x9d, 0x53, +0x04, 0xaa, 0xbb, 0x4c, 0x84, 0x09, 0x23, 0x2d, +0xf6, 0xd9 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0xe6, +0x99, 0x78, 0xdf, 0x32, 0x82, 0x08, 0x16, 0xc2, +0xb6, 0xcc, 0xb9, 0x71, 0x07, 0x40, 0x8d, 0xd1, +0x3d, 0xe1, 0xbc, 0x7d, 0x44, 0x10, 0x67, 0xa4, +0xc3, 0x78, 0x6a, 0x9c, 0xa7, 0xef, 0xba, 0x4c, +0xec, 0x7b, 0x09, 0x05, 0xc3, 0x58, 0x25, 0x3e, +0x35, 0xf8, 0xa9, 0xd7, 0xf7, 0xb7, 0x4e, 0x7e, +0x38, 0xda, 0x37, 0x2b, 0xe1, 0xc5, 0xac, 0xa1, +0x0b, 0x09, 0x35, 0x10, 0x17, 0x61, 0xbd, 0x26, +0xb5, 0xe5, 0x47, 0xdb, 0x1a, 0xd6, 0xb8, 0x75, +0x06, 0x16, 0x11, 0x3b, 0x28, 0x4d, 0xad, 0x04, +0xce, 0x9f, 0xe0, 0xe0, 0xb6, 0x6b, 0x60, 0x6a, +0x5d, 0x30 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_026[] = { + {TITLE, "IPSEC-026", 9, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_026_size = sizeof(tahi_ipsec_026) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_001.c b/test/regression/tahi_test/tahi_ipsec_udp_001.c new file mode 100644 index 00000000..12386d79 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_001.c @@ -0,0 +1,165 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +#if 0 +static char pkt1[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt5[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +#if 0 +static char pkt6[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt7[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, +0x27, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, +0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; + +static char pkt9[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x21, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt10[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0x5e, 0xde, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt11[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x81, 0x00, +0x26, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, +0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; + +TAHI_TEST_SEQ tahi_ipsec_udp_001[] = { + {TITLE, "IPSEC-UDP-001", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {CHECK, &pkt4[0], sizeof(pkt4), 5, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 6, 0, 0, 0, 0}, + + {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, + {CHECK, &pkt9[0], sizeof(pkt9), 5, 0, 0, 0, 0}, + {INJECT, &pkt10[0], sizeof(pkt10), 0, 0, 0, 0, 0}, + {CHECK, &pkt11[0], sizeof(pkt11), 5, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_001_size = sizeof(tahi_ipsec_udp_001) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_002.c b/test/regression/tahi_test/tahi_ipsec_udp_002.c new file mode 100644 index 00000000..2daade0d --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_002.c @@ -0,0 +1,147 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, +0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xae, 0xa2, +0x6e, 0x32, 0xe2, 0x9d, 0x35, 0x7a, 0xcd, 0xbb, +0x07, 0xba, 0xa0, 0xb0, 0x5d, 0xfd, 0x09, 0xce, +0xce, 0x57, 0xac, 0x4f, 0xfa, 0x22, 0xb1, 0x3f, +0x54, 0x43, 0x45, 0xd3, 0xa9, 0x96, 0x9a, 0xde, +0x15, 0x06, 0x9a, 0x2e, 0xc4, 0x4c, 0xc8, 0x69, +0x14, 0x3c }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x87, +0x9d, 0xb2, 0xd7, 0xac, 0x55, 0xff, 0x91, 0xbd, +0x22, 0xd9, 0x9d, 0x4c, 0x4f, 0xfb, 0xb4, 0x28, +0x0f, 0x1a, 0xce, 0x20, 0xda, 0x5f, 0xe0, 0xc2, +0x4e, 0x23, 0x27, 0xbf, 0x73, 0xa7, 0xc1, 0x3d, +0x9e, 0xce }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x46, 0xf6, +0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xb2, 0x94, +0x68, 0xee, 0xd0, 0x31, 0x8d, 0x9d, 0x94, 0x0c, +0x79, 0x96, 0x09, 0x38, 0xef, 0xce, 0xe7, 0xa9, +0x81, 0xfe, 0xda, 0x9a, 0x3e, 0x94, 0xbb, 0x4b, +0x01, 0xd6, 0x56, 0x9d, 0xb7, 0x65, 0x8e, 0x8b, +0x98, 0x75, 0x38, 0x43, 0xe2, 0x52, 0x6e, 0x86, +0x6a, 0x56 }; + +#if 0 +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_002[] = { + {TITLE, "IPSEC-UDP-002", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, + {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_002_size = sizeof(tahi_ipsec_udp_002) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_004.c b/test/regression/tahi_test/tahi_ipsec_udp_004.c new file mode 100644 index 00000000..9f0a9bd0 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_004.c @@ -0,0 +1,119 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x5b, +0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0xc8, 0xc5, +0x80, 0x58, 0xa2, 0x96, 0xa5, 0xe3, 0x66, 0x3d, +0xca, 0xcf, 0xea, 0xac, 0x15, 0x46, 0x7e, 0x29, +0x12, 0x6f, 0x2b, 0x99, 0xa3, 0x5e, 0x79, 0x1e, +0xa1, 0xd9, 0x34, 0x3b, 0x7d, 0x5b, 0x84, 0xc7, +0xd0, 0x3d, 0x2d, 0xd0, 0xdb, 0x20, 0xe5, 0x81, +0x33, 0x13 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x52, 0x80, +0xaa, 0x15, 0x46, 0x2d, 0xd5, 0x7b, 0x9f, 0xc6, +0x3f, 0x5a }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x78, 0x7f, +0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0x61, 0x10, +0x51, 0x54, 0x2f, 0xdb, 0xdb, 0x75, 0xed, 0xb4, +0xde, 0xda, 0xe4, 0xce, 0x9f, 0xf0, 0x33, 0x12, +0xbd, 0x90, 0xea, 0xff, 0xfd, 0xf4, 0x43, 0x98, +0x96, 0x50, 0x4e, 0x9c, 0xec, 0x2b, 0x31, 0xf2, +0xeb, 0x63, 0x52, 0x89, 0x9d, 0xbc, 0x37, 0x67, +0xf1, 0xad }; + +TAHI_TEST_SEQ tahi_ipsec_udp_004[] = { + {TITLE, "IPSEC-UDP-004", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_004_size = sizeof(tahi_ipsec_udp_004) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_005.c b/test/regression/tahi_test/tahi_ipsec_udp_005.c new file mode 100644 index 00000000..8ef81a63 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_005.c @@ -0,0 +1,1279 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xaa, +0x3b, 0x05, 0xde, 0xd4, 0xab, 0x24, 0xae, 0xfb, +0x59, 0x37, 0x13, 0x31, 0x53, 0x9f, 0x56, 0x88, +0x9f, 0x3c, 0xc8, 0x03, 0x68, 0x87, 0x04, 0xa3, +0xe6, 0x78, 0xdf, 0x38, 0x2f, 0xe5, 0x7d, 0x40, +0x61, 0xeb, 0xb1, 0x19, 0xeb, 0xfe, 0x61, 0x83, +0xf6, 0xaa, 0xb7, 0x17, 0x84, 0xdc, 0xab, 0x99, +0xd6, 0xdc, 0x26, 0x12, 0x02, 0x3f, 0x44, 0x7b, +0xaf, 0x60, 0xcc, 0x7b, 0x7c, 0xf1, 0x8d, 0x1e, +0x69, 0x1b, 0x71, 0x28, 0x9a, 0x1f, 0xe2, 0x07, +0xac, 0x8c, 0x77, 0x59, 0x9e, 0x1b, 0x1a, 0xa5, +0x36, 0xd5, 0x2f, 0xb8, 0xe4, 0xc2, 0xfb, 0x79, +0x02, 0x75, 0xe5, 0xe0, 0x1c, 0x43, 0xcb, 0xb0, +0x7a, 0xba, 0x2d, 0xad, 0xdb, 0x13, 0xbc, 0x70, +0x10, 0x46, 0x74, 0xc0, 0x31, 0xdf, 0x54, 0x19, +0x1f, 0xf8, 0x20, 0x71, 0x5b, 0xbe, 0xe2, 0xd4, +0xde, 0x1e, 0x6c, 0xee, 0x09, 0x0c, 0xb6, 0x81, +0x67, 0x75, 0x5c, 0x52, 0x55, 0x88, 0x57, 0xb4, +0x4a, 0x6d, 0xdd, 0xbb, 0x63, 0x87, 0xb1, 0xc7, +0xff, 0xdb, 0xe9, 0xf0, 0x69, 0x45, 0x81, 0x44, +0x1e, 0x05, 0xda, 0x86, 0x21, 0xf3, 0x74, 0xa2, +0xa8, 0x10, 0x99, 0x3c, 0x5b, 0x19, 0xf4, 0x39, +0x31, 0x9a, 0x83, 0xf6, 0x11, 0x9a, 0x65, 0x67, +0xd7, 0x9c, 0xb9, 0xe5, 0xba, 0x4a, 0x0a, 0x9f, +0x24, 0x36, 0xf4, 0x6f, 0x19, 0xc1, 0xfe, 0xab, +0xf3, 0xe2, 0x94, 0x21, 0xa3, 0xef, 0xc9, 0x03, +0xe1, 0x7b, 0x99, 0xef, 0x20, 0x1c, 0x66, 0x31, +0x7f, 0xab, 0x67, 0x38, 0xfb, 0xe3, 0x7a, 0x10, +0xd9, 0x83, 0x0c, 0x02, 0x07, 0x4e, 0xd0, 0xaa, +0x8d, 0x7d, 0x92, 0x72, 0x9f, 0x7a, 0x1c, 0xe7, +0x30, 0xc5, 0x8b, 0xb9, 0x65, 0xc5, 0x8d, 0x78, +0xaa, 0x4d, 0xb5, 0x45, 0x05, 0xdf, 0x8f, 0x90, +0xa0, 0x06, 0xbf, 0x49, 0xfa, 0xfb, 0xf2, 0xfb, +0x5b, 0x72, 0x68, 0xa6, 0xfb, 0x8d, 0x1f, 0x61, +0x34, 0xff, 0x67, 0x07, 0xd5, 0x9f, 0x1d, 0xbf, +0x8d, 0xae, 0x19, 0x6b, 0xd8, 0x7f, 0x7e, 0xe9, +0x02, 0x86, 0x36, 0x81, 0xf6, 0xc6, 0x5c, 0x23, +0xa4, 0x4a, 0x03, 0x70, 0xed, 0x09, 0x9c, 0xdb, +0xce, 0xb0, 0xf9, 0x84, 0x49, 0xc6, 0x61, 0x5d, +0x85, 0xa0, 0x7d, 0x18, 0x61, 0x37, 0x8b, 0x74, +0x54, 0xb9, 0x11, 0xe1, 0xf8, 0xaf, 0x95, 0x2c, +0xc8, 0x6a, 0x7c, 0x6b, 0xf3, 0x06, 0xec, 0xeb, +0x3c, 0xc9, 0x7a, 0x0f, 0x38, 0x65, 0x63, 0xc0, +0x02, 0x47, 0xae, 0xa9, 0x33, 0xea, 0xc9, 0xa3, +0xfd, 0x21, 0xd3, 0x28, 0x5d, 0x1a, 0xa8, 0x0d, +0xf4, 0x9c, 0x87, 0xab, 0x3b, 0xf5, 0x81, 0x29, +0xfd, 0x28, 0xef, 0xe4, 0x3b, 0x3e, 0xc2, 0xd1, +0x3b, 0xd9, 0xe5, 0x32, 0x4e, 0x0f, 0x2e, 0x64, +0xd0, 0x71, 0x4c, 0xc0, 0x44, 0x2b, 0x9e, 0x28, +0x68, 0x45, 0xa4, 0x4f, 0xe0, 0xb5, 0x9b, 0x42, +0xae, 0x6c, 0x94, 0xcd, 0xe5, 0x2b, 0x8f, 0x86, +0x52, 0x91, 0xa0, 0x2b, 0x97, 0x10, 0xf0, 0x79, +0xb3, 0x72, 0xce, 0x4b, 0x66, 0x63, 0xe1, 0xef, +0xb0, 0xae, 0xd9, 0x6d, 0xaf, 0x79, 0x38, 0xff, +0x6b, 0xfb, 0x9f, 0xa9, 0xe6, 0x68, 0x0e, 0x4b, +0x2a, 0x61, 0x09, 0xa4, 0x67, 0x98, 0xff, 0xe0, +0xff, 0xda, 0x27, 0xd2, 0x2b, 0x87, 0x51, 0x97, +0xe6, 0x61, 0x97, 0xec, 0x51, 0xf6, 0x17, 0x93, +0xcb, 0x28, 0x21, 0x6d, 0xfa, 0xb5, 0x18, 0x6b, +0x75, 0xd5, 0x8a, 0x48, 0x6a, 0x5b, 0xd5, 0x80, +0xc1, 0x22, 0xcc, 0x85, 0xa7, 0xda, 0x4b, 0xc0, +0xe2, 0xb6, 0xf0, 0xb5, 0xb4, 0xad, 0x43, 0x20, +0xae, 0x6f, 0xe8, 0x95, 0x96, 0x99, 0x56, 0x75, +0xfa, 0x8c, 0x91, 0x91, 0xb6, 0x26, 0x58, 0x29, +0x62, 0xf6, 0xa3, 0xec, 0x53, 0xdb, 0x7b, 0xf2, +0x3e, 0x79, 0xd3, 0x08, 0xce, 0x78, 0x2e, 0x58, +0xe7, 0xa9, 0xac, 0xbe, 0xf0, 0x85, 0x52, 0xf2, +0x8e, 0x46, 0x47, 0x28, 0xf3, 0x49, 0xac, 0x9c, +0xb2, 0xf3, 0x42, 0x3c, 0x13, 0x10, 0x82, 0xf6, +0xd6, 0x14, 0x09, 0x99, 0xd4, 0x6d, 0xe9, 0x3a, +0x2d, 0x6a, 0x31, 0x4b, 0x2a, 0xb9, 0x48, 0x26, +0xce, 0x3c, 0xe0, 0x1a, 0xca, 0x39, 0x17, 0xcf, +0xd8, 0xe6, 0x39, 0x95, 0x5b, 0x77, 0x28, 0x00, +0xff, 0x2a, 0x83, 0xd8, 0x3d, 0xd8, 0xeb, 0xfa, +0xe6, 0x37, 0x7c, 0xc4, 0x6d, 0xba, 0xbf, 0x85, +0x17, 0x3d, 0x68, 0x9e, 0xfd, 0x4b, 0x91, 0xd2, +0x13, 0x5a, 0xc8, 0x73, 0xbe, 0xc2, 0xa3, 0x7f, +0x58, 0x36, 0x8c, 0x29, 0x3f, 0xfd, 0x59, 0x9a, +0xbd, 0x5f, 0xf0, 0x16, 0xd5, 0xc1, 0x10, 0xcc, +0x54, 0x31, 0xe4, 0x3e, 0x84, 0xda, 0xda, 0x3e, +0x6c, 0x23, 0xf6, 0x5c, 0x46, 0x68, 0xed, 0xbb, +0x23, 0xb5, 0xd3, 0x57, 0xf3, 0xdb, 0x9a, 0x5a, +0x61, 0xba, 0x9f, 0xa7, 0x69, 0x31, 0x23, 0x47, +0x87, 0x13, 0x9a, 0x4f, 0x46, 0x35, 0xc2, 0x60, +0xd5, 0xf1, 0x77, 0x55, 0xd7, 0x83, 0xb0, 0xc3, +0x2f, 0x66, 0xaa, 0x14, 0xb3, 0x34, 0xd7, 0xa3, +0x6c, 0x66, 0x6f, 0x50, 0x91, 0xb9, 0x30, 0x3f, +0x62, 0xa4, 0x7b, 0xf5, 0x40, 0x46, 0x5c, 0x75, +0xfe, 0x6e, 0x3b, 0xe2, 0x62, 0x0f, 0xdb, 0x90, +0x06, 0x46, 0x4e, 0x31, 0x64, 0xc9, 0xd8, 0x4e, +0x02, 0xa5, 0x14, 0xd4, 0xa9, 0xa6, 0xea, 0x56, +0x01, 0xa6, 0x80, 0x7c, 0xa7, 0xff, 0xc6, 0xb1, +0x5f, 0x96, 0x49, 0xb5, 0x05, 0x96, 0x49, 0x54, +0x28, 0xa4, 0xd2, 0xb7, 0xee, 0xe9, 0x9b, 0x02, +0xfc, 0x26, 0xdc, 0x78, 0xa5, 0x11, 0x6b, 0x9f, +0x8e, 0x7c, 0xb3, 0x2a, 0xee, 0x91, 0x35, 0x16, +0x2f, 0x8d, 0xf9, 0x79, 0x4c, 0x16, 0xec, 0xa6, +0xa8, 0x73, 0xb8, 0x09, 0x3b, 0x89, 0x5e, 0xa5, +0xc4, 0xc5, 0xda, 0xdf, 0x5e, 0x25, 0xe2, 0xf4, +0xe7, 0x86, 0x73, 0x4a, 0xf8, 0x7b, 0x37, 0x6f, +0x09, 0x95, 0xfc, 0xb7, 0x3c, 0xcc, 0x5e, 0x72, +0x9e, 0x8d, 0x9d, 0x19, 0xd4, 0x2e, 0x5c, 0xb0, +0xa6, 0x8b, 0xc0, 0x15, 0x3f, 0x75, 0xf3, 0x05, +0xda, 0x13, 0x12, 0x22, 0xbe, 0xb7, 0x6c, 0x40, +0x94, 0x30, 0xa9, 0xb6, 0x0f, 0x71, 0xd2, 0x6f, +0x89, 0x35, 0xd7, 0xac, 0xee, 0xe9, 0x18, 0x93, +0x0d, 0x60, 0x1e, 0xa2, 0x49, 0xe1, 0x9b, 0x41, +0x18, 0x59, 0x7c, 0x38, 0x7f, 0x05, 0x84, 0x0b, +0x66, 0xab, 0x54, 0xba, 0xfc, 0x40, 0x5e, 0xa3, +0x1b, 0xc0, 0xb9, 0x3c, 0x51, 0x40, 0xcb, 0xd3, +0xe5, 0x96, 0x3b, 0x2b, 0x06, 0xc9, 0x4f, 0x17, +0xd7, 0x4f, 0xd7, 0x47, 0xe0, 0x85, 0x97, 0xde, +0x86, 0xa4, 0x2e, 0x64, 0x11, 0x00, 0x34, 0x44, +0x6a, 0x10, 0x96, 0xf1, 0x6d, 0x3a, 0xb1, 0x0d, +0xe4, 0xf2, 0x52, 0x00, 0xd3, 0x80, 0x76, 0x4d, +0x33, 0xa8, 0x41, 0xd1, 0x2b, 0x06, 0x37, 0x3f, +0xc1, 0x8e, 0x0c, 0x47, 0xd9, 0x85, 0x8c, 0x0e, +0x21, 0x57, 0xe9, 0xbd, 0x86, 0x3c, 0xf8, 0x23, +0xc3, 0xc3, 0xfd, 0x7d, 0x60, 0xea, 0x07, 0xab, +0x3c, 0x91, 0x2e, 0xb6, 0xf0, 0xec, 0xf6, 0xb0, +0x89, 0xaf, 0x55, 0xf3, 0x07, 0xe9, 0x60, 0x10, +0x40, 0x43, 0x91, 0x0d, 0x20, 0xc6, 0x37, 0x67, +0xbe, 0xdb, 0xab, 0xe7, 0xc5, 0x50, 0x60, 0x5d, +0xec, 0x7f, 0x5b, 0xd0, 0x02, 0x2f, 0xa1, 0xb3, +0x33, 0x70, 0xdb, 0x26, 0x15, 0x94, 0xda, 0x7d, +0xd7, 0x76, 0x11, 0x0e, 0xdd, 0x46, 0x98, 0x9f, +0x9d, 0xdc, 0xa0, 0x85, 0x2c, 0xd7, 0x4f, 0x85, +0xc4, 0x89, 0x77, 0x96, 0xd0, 0x02, 0x3f, 0x34, +0x44, 0x2b, 0x01, 0x04, 0x57, 0x1a, 0xc0, 0x5f, +0x3e, 0xb8, 0xea, 0x78, 0x05, 0x74, 0x9d, 0xf6, +0x16, 0x1d, 0xac, 0x46, 0x10, 0x14, 0xb9, 0x6f, +0x97, 0xa0, 0xdd, 0x2b, 0xd4, 0x5b, 0x25, 0x68, +0xba, 0x2b, 0x75, 0x14, 0xbf, 0x5f, 0xca, 0xa4, +0xcb, 0x23, 0xba, 0xa4, 0x5c, 0x2b, 0xeb, 0xc2, +0xfa, 0xfa, 0xed, 0x1f, 0xd2, 0x7d, 0x49, 0x5b, +0x6c, 0x5f, 0x94, 0xe2, 0xa7, 0xbc, 0xf5, 0x3c, +0x5c, 0xd8, 0xf3, 0x82, 0xc1, 0xba, 0xbc, 0xf3, +0x6e, 0x15, 0xf3, 0x2e, 0xc5, 0x44, 0x7f, 0xd3, +0x5e, 0xf4, 0xe7, 0xc5, 0xf9, 0x5a, 0xc5, 0x72, +0x37, 0xb1, 0xc8, 0x24, 0x0c, 0xe7, 0x0f, 0xe4, +0x02, 0x67, 0xff, 0x45, 0x7f, 0xcc, 0x38, 0xd5, +0x19, 0x5a, 0xe3, 0x83, 0x3d, 0xa9, 0x02, 0x2d, +0x84, 0xd3, 0xe8, 0x5f, 0x45, 0x11, 0xd4, 0x63, +0x44, 0xaf, 0xb5, 0xec, 0x6d, 0x63, 0x57, 0xec, +0x8e, 0xcf, 0xeb, 0x1a, 0x72, 0x4e, 0x82, 0x7d, +0xe2, 0x7f, 0x72, 0x9d, 0xff, 0xa0, 0x79, 0x17, +0xe4, 0xbd, 0x67, 0x20, 0xdb, 0xa7, 0xf3, 0xad, +0xba, 0xb4, 0x03, 0x4a, 0xd7, 0x57, 0xf8, 0xa2, +0x6e, 0xc6, 0x35, 0x45, 0xe6, 0x8d, 0x8d, 0x64, +0xb7, 0xdb, 0x7c, 0x91, 0x9c, 0x8a, 0xfe, 0xec, +0xf0, 0xe7, 0xf0, 0x22, 0x6b, 0x79, 0x40, 0x96, +0x2f, 0x19, 0x1a, 0xf2, 0xc8, 0x52, 0xd5, 0x00, +0xe6, 0xac, 0xad, 0x97, 0x54, 0xa6, 0xd3, 0xd5, +0x5f, 0xae, 0x97, 0x9d, 0x1e, 0x5a, 0x67, 0xb4, +0xd7, 0x69, 0x64, 0x73, 0x0c, 0x70, 0xf6, 0x25, +0xc1, 0xf5, 0xca, 0x9b, 0xe7, 0x82, 0xb9, 0xda, +0x2e, 0x76, 0xae, 0x2e, 0xcd, 0x5b, 0xce, 0x47, +0xa1, 0x40, 0xe6, 0xcf, 0xc9, 0xb6, 0x20, 0x24, +0xb8, 0x06, 0x06, 0xb2, 0xcb, 0x53, 0x16, 0x48, +0x8f, 0x6a, 0x44, 0x02, 0xc5, 0x19, 0x76, 0xdd, +0xfe, 0xa7, 0xe9, 0xbb, 0x16, 0x95, 0x1d, 0xed, +0x8a, 0xf3, 0xb3, 0xb1, 0x1f, 0x81, 0x76, 0xfc, +0x68, 0xb6, 0xef, 0x4a, 0xdc, 0x0d, 0xb9, 0xc9, +0x4e, 0x05, 0x7b, 0xc0, 0x0b, 0xa7, 0x67, 0xf6, +0xb9, 0x12, 0x60, 0x9b, 0x8d, 0x97, 0x5c, 0xe7, +0x36, 0xc3, 0x8c, 0x25, 0xcc, 0x7b, 0x9a, 0x47, +0x3c, 0x86, 0x0f, 0x4e, 0x6c, 0xff, 0x25, 0x30, +0x2f, 0xc2, 0x45, 0xc8, 0xb4, 0xe4, 0xad, 0x9a, +0x23, 0xbc, 0xfa, 0xc0, 0x07, 0x2d, 0x4e, 0xea, +0x4e, 0x3e, 0xc0, 0x5f, 0x61, 0xec, 0x2d, 0xd9, +0x95, 0x9d, 0x7a, 0xa8, 0xb3, 0xdd, 0x92, 0xce, +0x26, 0xd7, 0x41, 0x83, 0x2c, 0x5f, 0x4f, 0xa6, +0xf8, 0x21, 0xdf, 0x78, 0xb0, 0x50, 0x8e, 0xfa, +0xfd, 0xc8, 0x91, 0x07, 0xb4, 0x46, 0x2d, 0x88, +0x36, 0x9a, 0x65, 0x44, 0xab, 0x58, 0x81, 0x4f, +0x9a, 0x13, 0x17, 0x1d, 0x35, 0x8e, 0x9e, 0xf3, +0xaa, 0x55, 0xbc, 0x0c, 0xc3, 0xbe, 0xa3, 0x4b, +0x38, 0x1a, 0xd2, 0x42, 0x97, 0xe2, 0xed, 0x65, +0xea, 0xae, 0x9c, 0xe9, 0xf8, 0x5a, 0x44, 0xd3, +0xde, 0xae, 0x70, 0x2e, 0xfb, 0xa5, 0x77, 0x9b, +0xce, 0x8b, 0x15, 0x5d, 0x3d, 0xdc, 0xf7, 0xed, +0xd8, 0x67 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68, 0x48, +0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0x3c, 0x06, +0xaa, 0xcd, 0x0f, 0x2d, 0x70, 0x86, 0x90, 0xd1, +0x1c, 0xc6, 0x46, 0xb0, 0x13, 0xb4, 0x24, 0x14, +0x6b, 0x61, 0x9a, 0xae, 0xfa, 0xc1, 0x12, 0xd2, +0x9e, 0x0d, 0xea, 0xb8, 0x6c, 0x69, 0x5a, 0x3e, +0x34, 0xbe, 0x39, 0xf4, 0x02, 0xde, 0x40, 0x9b, +0x03, 0xeb, 0x87, 0x7b, 0x6b, 0xe5, 0xa5, 0x98, +0x0e, 0x68, 0xc2, 0x65, 0xf9, 0xef, 0x8a, 0x4e, +0xad, 0x48, 0x7e, 0xd6, 0xe6, 0x8d, 0x76, 0xa3, +0x87, 0x12, 0xb5, 0x3b, 0x65, 0x8e, 0x63, 0xb9, +0xa7, 0x1a, 0xeb, 0x2f, 0x3d, 0x54, 0x6a, 0x62, +0x9d, 0x95, 0x68, 0x4a, 0xfd, 0x64, 0x18, 0xd3, +0x16, 0xee, 0xcf, 0x92, 0x92, 0x02, 0x62, 0x3d, +0xb7, 0x74, 0x43, 0x09, 0x40, 0x2a, 0x0e, 0x7d, +0x62, 0xe0, 0x4b, 0xf6, 0x5b, 0x2b, 0xe5, 0x3e, +0xc0, 0x0d, 0xe4, 0x82, 0xcb, 0x53, 0xcd, 0xc9, +0x3a, 0xa8, 0xae, 0xd2, 0x67, 0x61, 0x3b, 0x65, +0xfd, 0x6b, 0xee, 0xa2, 0x1f, 0xaf, 0xa2, 0xfe, +0x35, 0xd0, 0x1c, 0xf8, 0x99, 0xeb, 0xcd, 0x72, +0x69, 0xfc, 0x64, 0x88, 0xd1, 0xe0, 0x23, 0x52, +0x9b, 0x37, 0x15, 0xa5, 0xbc, 0x13, 0xce, 0xce, +0x36, 0x2d, 0x04, 0x07, 0x04, 0x21, 0x2b, 0x6e, +0x2b, 0x2a, 0x41, 0x66, 0x82, 0x29, 0x25, 0x6c, +0x11, 0xfa, 0xe2, 0x82, 0xb4, 0xf1, 0x58, 0x40, +0x96, 0x34, 0x9b, 0x01, 0xd4, 0x94, 0x95, 0xed, +0x52, 0xce, 0x1f, 0x5c, 0xe4, 0x25, 0xe8, 0xc9, +0x14, 0x7b, 0x0c, 0x45, 0xee, 0x4a, 0xc2, 0x69, +0x42, 0x54, 0x3a, 0x9d, 0xc7, 0x75, 0x68, 0x95, +0x27, 0xf9, 0xa9, 0x7a, 0x9a, 0xfd, 0x40, 0xc8, +0xae, 0xdb, 0xf5, 0xca, 0xb6, 0x64, 0xee, 0x06, +0x93, 0x8b, 0x91, 0x7b, 0xcc, 0xac, 0xc7, 0x37, +0x37, 0xb8, 0x3f, 0x3a, 0x4d, 0xc6, 0x43, 0xf6, +0x3c, 0xb7, 0xc4, 0x15, 0x46, 0xb3, 0xe1, 0x8d, +0xce, 0xb3, 0x50, 0xd4, 0xac, 0x91, 0xfb, 0x4e, +0x9f, 0x91, 0x79, 0xa4, 0x9e, 0x28, 0xd5, 0x94, +0x1f, 0x48, 0x9a, 0x7d, 0x03, 0xbc, 0x03, 0x34, +0x4a, 0xbf, 0x83, 0x78, 0x78, 0x52, 0x18, 0xaf, +0xac, 0xc6, 0xf0, 0xdf, 0x41, 0x05, 0xce, 0x4c, +0x24, 0x50, 0xc1, 0xec, 0x70, 0x7c, 0x40, 0x03, +0x7f, 0xe2, 0x73, 0xbd, 0x1f, 0x03, 0x95, 0x93, +0x41, 0x54, 0x67, 0xd3, 0x8f, 0x39, 0xc1, 0x0b, +0xb0, 0x29, 0xcd, 0xc1, 0x7b, 0x2b, 0xdd, 0xac, +0x74, 0x8e, 0x95, 0x84, 0x34, 0x1b, 0xb0, 0x26, +0xc8, 0x14, 0x8d, 0x95, 0x41, 0xa4, 0x69, 0x04, +0xbe, 0x0d, 0xf4, 0xdf, 0xc8, 0x11, 0x54, 0x1d, +0x90, 0xb0, 0xae, 0xa1, 0x39, 0x98, 0xfd, 0x9c, +0x8d, 0x0a, 0x47, 0x1c, 0xac, 0x10, 0x21, 0x34, +0x02, 0x2e, 0x2a, 0xbc, 0x01, 0xe0, 0xdf, 0xe7, +0xce, 0x21, 0x5a, 0x39, 0x7e, 0xd0, 0x66, 0x01, +0x20, 0xc9, 0x5d, 0x14, 0xd3, 0x4b, 0xcd, 0x4b, +0xbd, 0x38, 0x1f, 0x69, 0x54, 0x68, 0x99, 0xce, +0x86, 0x9c, 0x3f, 0xad, 0xe3, 0x0f, 0xa4, 0xd5, +0x4f, 0xe4, 0xad, 0x8e, 0xbf, 0x00, 0x23, 0x77, +0x57, 0x18, 0xd6, 0xa8, 0x76, 0x28, 0x12, 0x5e, +0x9d, 0x93, 0x46, 0x68, 0x96, 0x38, 0x6c, 0x81, +0x0b, 0xb2, 0x9e, 0xb5, 0xdb, 0xdf, 0xbb, 0x16, +0x21, 0xf8, 0xc5, 0xc7, 0x4d, 0x25, 0xc8, 0xb6, +0xe2, 0x0f, 0xd7, 0x26, 0x9d, 0x9a, 0xc2, 0x70, +0x8d, 0x51, 0x53, 0x07, 0xc8, 0x4c, 0x8d, 0x51, +0x19, 0xc4, 0x2a, 0x2e, 0x3d, 0x61, 0x98, 0x14, +0x89, 0x73, 0xe4, 0x17, 0xcb, 0xda, 0xc5, 0xaa, +0x38, 0x58, 0x8b, 0x79, 0x45, 0xe3, 0x77, 0x80, +0x25, 0x61, 0xb3, 0xd6, 0xd0, 0xd5, 0xa4, 0xb8, +0x12, 0xd6, 0x66, 0x67, 0xb1, 0x2b, 0xfe, 0xc8, +0x91, 0x51, 0x54, 0xaa, 0xbe, 0x22, 0x1c, 0xef, +0xb0, 0x0b, 0x09, 0xca, 0x7c, 0x41, 0xe9, 0x17, +0x47, 0x11, 0x3a, 0x90, 0xde, 0x94, 0x1e, 0x6c, +0xac, 0xcc, 0xda, 0x12, 0xea, 0x90, 0x8f, 0x7a, +0x91, 0x6a, 0xaf, 0x21, 0x8b, 0x64, 0xf6, 0xb9, +0x3f, 0xd2, 0x24, 0x6c, 0xfc, 0x57, 0x55, 0xf5, +0x79, 0x88, 0x19, 0x5f, 0x77, 0xe0, 0x2f, 0x46, +0x50, 0x41, 0xcc, 0x7c, 0xc9, 0xba, 0xa6, 0x75, +0x65, 0xab, 0xce, 0x0f, 0x5a, 0x75, 0xd8, 0xff, +0x74, 0x1d, 0x52, 0x57, 0x88, 0x72, 0xfb, 0xa1, +0xc0, 0xdb, 0x51, 0xe1, 0xe9, 0x90, 0xcf, 0x71, +0xc4, 0xce, 0xf2, 0x49, 0x16, 0xe5, 0x99, 0x96, +0x2f, 0x26, 0x16, 0xf8, 0x26, 0x85, 0x9f, 0x3c, +0x39, 0xf2, 0x84, 0x41, 0x29, 0x6d, 0x5c, 0xd0, +0x25, 0xad, 0x1f, 0x3a, 0x9b, 0x1e, 0xbb, 0x5a, +0xa5, 0x24, 0x14, 0xaa, 0xe3, 0x53, 0x38, 0xfb, +0xc3, 0x03, 0x3e, 0x43, 0xa5, 0x0c, 0xd0, 0xd1, +0x23, 0xb7, 0x49, 0x67, 0x11, 0x58, 0xff, 0x62, +0xa9, 0x89, 0xc7, 0xd9, 0xe0, 0x4d, 0x33, 0x65, +0x3b, 0x49, 0xac, 0xe7, 0x7b, 0x16, 0x66, 0xf4, +0x7f, 0x22, 0xb4, 0x89, 0xe3, 0x9f, 0x6c, 0x60, +0xcc, 0x1b, 0x57, 0x6f, 0x9c, 0x7f, 0x82, 0x04, +0x86, 0x6a, 0x58, 0x08, 0x7e, 0xb2, 0x8c, 0xa7, +0x6f, 0x91, 0x32, 0x19, 0xe6, 0xda, 0xc4, 0xc7, +0x09, 0xe8, 0x5e, 0x6a, 0x84, 0x88, 0xbb, 0xb5, +0x47, 0x2f, 0xb6, 0x8c, 0x12, 0x08, 0x8d, 0xa7, +0x34, 0x3f, 0xac, 0x60, 0xc7, 0xea, 0x91, 0x44, +0x45, 0xaa, 0x6a, 0x0f, 0xf0, 0x79, 0x51, 0xc4, +0xc7, 0x0e, 0x2d, 0x86, 0x00, 0x72, 0xb4, 0x39, +0x50, 0xb3, 0x71, 0x3d, 0xd2, 0x38, 0xe0, 0xc3, +0xb3, 0x75, 0x55, 0xd9, 0xe5, 0xe9, 0x11, 0xfa, +0xa0, 0x64, 0x69, 0xfa, 0x06, 0xf6, 0x89, 0xe0, +0x5f, 0x32, 0x90, 0xfe, 0x8a, 0x6c, 0xb3, 0x71, +0xf5, 0x7c, 0x46, 0xc0, 0xbf, 0x7c, 0x04, 0xbd, +0x8a, 0x4b, 0x99, 0xbe, 0x67, 0xcc, 0x67, 0x18, +0x5b, 0x4c, 0xa2, 0x28, 0x41, 0x73, 0x06, 0xe5, +0x02, 0xf0, 0xb3, 0xad, 0xae, 0x0e, 0x80, 0xc7, +0x80, 0x2e, 0xe7, 0x59, 0x71, 0xc8, 0x5e, 0x34, +0x6a, 0xa4, 0x9e, 0x37, 0x73, 0xe5, 0xdb, 0xba, +0x3f, 0xc1, 0xa5, 0x8b, 0xac, 0x26, 0xfc, 0x3d, +0x71, 0xc8, 0xf6, 0x21, 0xc4, 0xb8, 0xc8, 0xb8, +0x6b, 0x9a, 0x94, 0x28, 0xb4, 0x45, 0xdb, 0x51, +0x19, 0x02, 0x75, 0x98, 0x35, 0xed, 0xc0, 0x06, +0x70, 0xec, 0xa4, 0x8c, 0x79, 0x47, 0x3b, 0x01, +0x10, 0x4a, 0xa7, 0x00, 0x0f, 0xb4, 0xde, 0x40, +0x75, 0xb3, 0xb4, 0xd9, 0x5b, 0xd2, 0x56, 0x2f, +0x0e, 0x54, 0xda, 0x4b, 0x8d, 0xea, 0x48, 0xa3, +0x92, 0x24, 0x51, 0xb1, 0x1c, 0x18, 0xd1, 0xc9, +0x7c, 0xcf, 0xd6, 0x8a, 0x1f, 0x16, 0x75, 0x28, +0xac, 0x29, 0xeb, 0x3c, 0x5d, 0x91, 0xb5, 0x3b, +0x60, 0xcd, 0xbe, 0xe1, 0x01, 0x2c, 0xbb, 0x25, +0x67, 0x51, 0xe7, 0x7b, 0x15, 0x46, 0xe4, 0x64, +0x9f, 0x67, 0x11, 0x9f, 0xab, 0x21, 0x6a, 0x43, +0xed, 0x36, 0x67, 0xef, 0x2f, 0xb7, 0x67, 0xf7, +0x3b, 0x56, 0x33, 0x59, 0x63, 0x9f, 0xc2, 0xb9, +0x55, 0x73, 0x57, 0xfd, 0xa8, 0xde, 0x44, 0x87, +0x56, 0xa9, 0x01, 0xe8, 0x4c, 0xa4, 0x65, 0xbe, +0x03, 0x16, 0x79, 0x4f, 0x6a, 0x11, 0x11, 0x95, +0xf6, 0x87, 0x19, 0x9c, 0x0f, 0x24, 0xc8, 0xc5, +0x54, 0x44, 0xb1, 0x5d, 0xbc, 0x96, 0x4b, 0x2b, +0x0f, 0x59, 0xcc, 0xed, 0xb3, 0xd6, 0xf1, 0x11, +0xa0, 0x5c, 0xac, 0x79, 0x6d, 0x35, 0x0f, 0xb2, +0xde, 0xa0, 0x11, 0xae, 0x4b, 0x7b, 0x6f, 0x6b, +0x82, 0x06, 0xe1, 0x05, 0x07, 0x7f, 0xc5, 0x71, +0x09, 0xa8, 0xb6, 0xc6, 0x5b, 0x5d, 0x5b, 0x14, +0xd2, 0xc6, 0x91, 0xd6, 0x6b, 0x7a, 0xfd, 0xe1, +0x6f, 0x33, 0x7a, 0x4d, 0xf0, 0x11, 0x1a, 0x45, +0x12, 0xfc, 0x27, 0x0e, 0xe0, 0x74, 0xab, 0x6f, +0xae, 0x3d, 0x31, 0xfd, 0xbb, 0x65, 0x0f, 0xd1, +0xb0, 0xa7, 0x07, 0xdb, 0x4c, 0x15, 0xde, 0xf1, +0x36, 0x97, 0x73, 0xb4, 0x51, 0xdf, 0xa9, 0x50, +0xc1, 0x1a, 0xa0, 0xe1, 0x75, 0xc8, 0x40, 0xbf, +0x05, 0xfe, 0xb9, 0xb3, 0xd7, 0xbd, 0x26, 0xc4, +0x1c, 0x25, 0xe7, 0xd6, 0xba, 0xdc, 0x1d, 0x6c, +0x86, 0x5f, 0xb6, 0x20, 0xdd, 0xe4, 0xf5, 0x07, +0xec, 0xc8, 0x2b, 0x07, 0x7e, 0xb3, 0x58, 0xcd, +0x18, 0xa4, 0x62, 0x34, 0xc2, 0xa5, 0x13, 0x55, +0x24, 0x9e, 0x4b, 0x9e, 0x53, 0xc1, 0x48, 0x8f, +0x57, 0x42, 0x81, 0x4e, 0x2a, 0x3c, 0xc7, 0x37, +0x8f, 0x53, 0xec, 0xed, 0x7c, 0xb6, 0x90, 0xb5, +0x43, 0x6c, 0xe2, 0xb7, 0xfb, 0xb8, 0xd7, 0x05, +0xc3, 0x80, 0xc5, 0xb1, 0xf7, 0x07, 0x06, 0xb3, +0xc1, 0xcc, 0xa3, 0xea, 0x0b, 0x6a, 0x83, 0xb9, +0x5b, 0xb4, 0x58, 0x7d, 0x37, 0xe6, 0x89, 0xeb, +0x4b, 0x03, 0xef, 0x90, 0x56, 0x09, 0x58, 0x57, +0xbe, 0x98, 0x84, 0x31, 0x10, 0x8b, 0xc3, 0x25, +0x63, 0x82, 0x83, 0xe3, 0xc6, 0xd9, 0x5d, 0xc3, +0x7e, 0xf1, 0xd2, 0x9a, 0x53, 0x51, 0x6b, 0xb6, +0x26, 0x36, 0xc0, 0x1a, 0xc6, 0x60, 0xaa, 0x41, +0x42, 0x76, 0x84, 0xd0, 0x3d, 0x2b, 0x29, 0x3a, +0xa4, 0x0b, 0xb8, 0x5a, 0x93, 0x7b, 0x6a, 0x1e, +0xe4, 0x8d, 0x92, 0x8e, 0x6f, 0xf0, 0xeb, 0x32, +0x4c, 0x9a, 0x63, 0xf0, 0x56, 0xf8, 0x80, 0x10, +0xeb, 0xa0, 0x4b, 0xdd, 0x5a, 0xf4, 0xd0, 0x20, +0x4c, 0x59, 0xd9, 0xc3, 0xdc, 0x7f, 0x2a, 0x87, +0x2f, 0x5e, 0xbe, 0x37, 0x3e, 0x26, 0x00, 0x08, +0x6a, 0x55, 0x30, 0xb1, 0xfd, 0x5e, 0xd8, 0x85, +0xde, 0xbc, 0xe6, 0x8c, 0x36, 0x94, 0xf1, 0x4c, +0x29, 0x0f, 0x3a, 0x3f, 0x2c, 0x89, 0xcb, 0xb2, +0x3e, 0x5b, 0x00, 0xea, 0x88, 0x54, 0xdb, 0xe8, +0x10, 0x91, 0x82, 0xc1, 0x48, 0xd6, 0x72, 0x5c, +0xa4, 0x4c, 0x1b, 0xbc, 0x61, 0xc0, 0x3f, 0x34, +0x45, 0xe1, 0x1c, 0xd2, 0x5b, 0x36, 0xd2, 0xd9, +0xcd, 0x15, 0xbb, 0x51, 0xbd, 0xd5, 0xd3, 0x59, +0x10, 0x71, 0x9a, 0x3b, 0xb9, 0x70, 0x32, 0x66, +0xef, 0x03, 0xdc, 0x36, 0x20, 0xe4, 0x89, 0x5e, +0x5a, 0x98, 0x04, 0x80, 0x7a, 0x48, 0xe7, 0xf4, +0xc5, 0x98, 0xff, 0x4b, 0x5f, 0xb5, 0x94, 0xf2, +0x38, 0x7e, 0x2c, 0xe9, 0x90, 0x6e, 0x20, 0x75, +0xce, 0x31, 0xed, 0x0c, 0x2a, 0xf1, 0x46, 0xf6, +0x37, 0x80, 0x6b, 0x8f, 0x52, 0x85, 0x9d, 0xd7, +0x2f, 0xe5, 0x89, 0xb1, 0xc7, 0x97, 0x69, 0xae, +0xe8, 0xf3, 0x7c, 0xed, 0x96, 0xdd, 0x5c, 0x70, +0xed, 0xbf, 0x42, 0xca, 0x24, 0xf6, 0x2f, 0x7c, +0xca, 0x84, 0xa9, 0xa7, 0xa9, 0x49, 0xb3, 0xcb, +0x4e, 0x61, 0x3d, 0xfb, 0xac, 0x78, 0xbe, 0x39, +0x87, 0x39, 0xaa, 0x38, 0xda, 0x15, 0x9d, 0x01, +0x35, 0x08 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, +0xbd, 0xa7, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xb3, +0x32, 0x34, 0x9b, 0xde, 0x01, 0xd6, 0x40, 0x07, +0x60, 0x71, 0xef, 0xf8, 0xb1, 0x47, 0xa0, 0x6b, +0x20, 0x52, 0x79, 0x58, 0x71, 0x6d, 0x80, 0x19, +0x68, 0xa6, 0x1b, 0x79, 0xec, 0xee, 0x71, 0x16, +0x30, 0x02, 0x55, 0xf6, 0x4d, 0x84, 0x40, 0xe7, +0x1d, 0x96, 0x57, 0xfd, 0xb8, 0x06, 0x7b, 0x6d, +0xee, 0xfc, 0xbc, 0x46, 0x02, 0x0e, 0xc7, 0xc1, +0x00, 0xc9, 0x8c, 0x5c, 0xd6, 0x07, 0xb0, 0x77, +0x01, 0x52, 0xef, 0x95, 0xb9, 0x64, 0x9b, 0x4d, +0x55, 0x0b, 0x08, 0x77, 0x11, 0x40, 0x5c, 0x2e, +0xaa, 0xab, 0x77, 0xfa, 0x16, 0x1a, 0xa8, 0x0c, +0x23, 0x54, 0x3b, 0x26, 0x46, 0x7d, 0x16, 0xb3, +0x27, 0x32, 0xb9, 0x5b, 0xda, 0xd0, 0x02, 0xa6, +0x16, 0x4c, 0xd6, 0xdd, 0xf1, 0xde, 0x2c, 0xdc, +0x13, 0x3d, 0xb8, 0x60, 0x3f, 0x89, 0xf4, 0x7e, +0x4c, 0x40, 0xd8, 0xcb, 0xd3, 0x1c, 0x13, 0x68, +0xcb, 0xc6, 0x93, 0x7d, 0x3d, 0x96, 0xae, 0x62, +0xb1, 0x9e, 0xf2, 0xdb, 0x9c, 0xe8, 0xa2, 0xe1, +0x09, 0x60, 0xea, 0x5e, 0x54, 0xf7, 0x53, 0xd5, +0xd2, 0x66, 0xa1, 0xa9, 0x2d, 0x75, 0x8b, 0x3e, +0xf0, 0x72, 0x38, 0x76, 0xa7, 0x21, 0xaf, 0x42, +0xe6, 0xfb, 0xc0, 0x53, 0x0a, 0x65, 0xfe, 0xce, +0x6e, 0x9d, 0xee, 0x14, 0xa8, 0xce, 0x20, 0xaa, +0x31, 0xe9, 0xb2, 0x0d, 0x37, 0x7a, 0xf3, 0x0d, +0x91, 0xf1, 0x19, 0x1c, 0x8a, 0xeb, 0x30, 0xf6, +0xa4, 0x16, 0xc0, 0xff, 0x06, 0xea, 0x66, 0x74, +0xe2, 0x21, 0x8a, 0xcf, 0xcc, 0x16, 0x3c, 0x04, +0x62, 0xe6, 0x21, 0x24, 0x24, 0x24, 0xc2, 0xc0, +0x81, 0x64, 0x60, 0x02, 0x8e, 0x38, 0xb2, 0xf3, +0x3e, 0x28, 0x28, 0x2b, 0xe9, 0x6c, 0x67, 0x03, +0x94, 0x90, 0x3c, 0xaa, 0xa2, 0x94, 0x5b, 0xab, +0x91, 0xf5, 0x3d, 0x4e, 0x63, 0xc2, 0x4d, 0xe8, +0xdd, 0xe1, 0x73, 0x93, 0x63, 0xc5, 0x55, 0x32, +0xc3, 0xc6, 0x8c, 0x0f, 0x13, 0xb0, 0x2d, 0x76, +0x0a, 0x54, 0xbe, 0xa1, 0xcd, 0x9b, 0x1d, 0xc2, +0xa7, 0x95, 0x18, 0xd0, 0xf0, 0x8b, 0x3c, 0x78, +0x72, 0x3a, 0x8c, 0x51, 0xca, 0xf8, 0x2d, 0x85, +0xce, 0x03, 0xb9, 0xfc, 0xf6, 0x69, 0xe7, 0x00, +0x5e, 0x6b, 0x98, 0x3d, 0x2d, 0xbd, 0x97, 0x65, +0x4a, 0xc0, 0xc4, 0x1f, 0x95, 0x5e, 0x5c, 0xb0, +0x50, 0x51, 0x4c, 0x53, 0xa2, 0x4e, 0x93, 0xb6, +0x82, 0x76, 0xbd, 0x23, 0xe4, 0xd1, 0x45, 0x6c, +0x5c, 0x81, 0x3d, 0xc9, 0x07, 0xcc, 0x05, 0x68, +0xaa, 0x15, 0x6d, 0x0e, 0x45, 0x3e, 0xcf, 0xf5, +0xdb, 0x45, 0x45, 0x63, 0x05, 0xdf, 0xa4, 0x96, +0x40, 0x5e, 0x32, 0x57, 0x0b, 0x29, 0x35, 0xb1, +0x7d, 0x9d, 0x4e, 0xbc, 0xa9, 0x0e, 0x9a, 0x70, +0x50, 0x3c, 0x5e, 0xff, 0x14, 0x88, 0x77, 0xa2, +0xcb, 0xb7, 0x5d, 0xf8, 0x8e, 0x20, 0x1b, 0x4e, +0xeb, 0x9b, 0x61, 0xca, 0x02, 0x84, 0x28, 0x54, +0x2a, 0x72, 0x07, 0xee, 0x77, 0x66, 0x46, 0xc3, +0xbc, 0xad, 0x05, 0x16, 0x3a, 0x4b, 0xa3, 0xb0, +0x90, 0x99, 0x5b, 0x58, 0x97, 0xcf, 0x88, 0x14, +0xc4, 0x62, 0xf2, 0xe4, 0x40, 0x79, 0x4c, 0x7e, +0x13, 0x48, 0xae, 0x9e, 0xb2, 0xde, 0xab, 0x93, +0x08, 0xc3, 0x3e, 0x9d, 0x41, 0xaf, 0x7b, 0xf2, +0x0c, 0x6b, 0x82, 0xf5, 0xc8, 0x34, 0xad, 0xaa, +0xb6, 0xc5, 0xd0, 0x81, 0x9f, 0xb1, 0xde, 0x18, +0xd6, 0xdb, 0xaa, 0x7b, 0x1e, 0x30, 0x18, 0xd9, +0x7e, 0x7b, 0xf4, 0x9b, 0x9f, 0xd2, 0x69, 0x80, +0xa9, 0xd7, 0x99, 0x7d, 0xde, 0x2f, 0x4c, 0x4c, +0x41, 0x94, 0x30, 0xe3, 0xd5, 0x59, 0x7d, 0xe6, +0x85, 0x50, 0x1e, 0x55, 0xe9, 0xd3, 0xc5, 0xd8, +0x26, 0x4a, 0xe3, 0x2f, 0xee, 0x06, 0x02, 0x6f, +0x65, 0xae, 0xca, 0xf1, 0xdf, 0x4d, 0x47, 0xa7, +0x78, 0x22, 0x2f, 0xca, 0x71, 0xc7, 0xcb, 0x73, +0x58, 0xfe, 0x8c, 0xf0, 0x36, 0x84, 0xa5, 0x14, +0xbf, 0x2e, 0xa6, 0xd7, 0xcd, 0xda, 0xe3, 0x7b, +0x5e, 0xec, 0x49, 0x7b, 0x5e, 0xbf, 0xbd, 0x80, +0x1a, 0xa3, 0xc4, 0x9d, 0xf1, 0x1e, 0x84, 0x41, +0x65, 0x29, 0x98, 0x2d, 0x65, 0x93, 0x79, 0xa2, +0xc7, 0xed, 0x23, 0x49, 0x0d, 0xf3, 0x8e, 0x34, +0xe5, 0x60, 0xc9, 0x52, 0xfe, 0xd3, 0x24, 0x7e, +0x82, 0x16, 0xbb, 0xfc, 0xcb, 0x2a, 0x41, 0x20, +0x94, 0xe7, 0xae, 0xa9, 0x0b, 0x01, 0x37, 0x86, +0xf7, 0x2d, 0x72, 0x1e, 0xed, 0x24, 0x1f, 0x13, +0xef, 0x7e, 0xf6, 0x15, 0xe3, 0xd9, 0x37, 0xc4, +0x11, 0xf3, 0x85, 0x8f, 0x88, 0x1e, 0x6d, 0x75, +0x32, 0xf1, 0xd2, 0x41, 0x95, 0xa0, 0x09, 0xe0, +0x8c, 0x9d, 0xb5, 0x94, 0xb2, 0x69, 0xdb, 0xbd, +0xe2, 0x15, 0xc7, 0xad, 0x77, 0x2b, 0x2d, 0xe0, +0xed, 0x62, 0x88, 0x44, 0x99, 0x3b, 0xaf, 0xb1, +0x0c, 0x8b, 0x4f, 0xbe, 0x97, 0xa5, 0x2b, 0x3c, +0x33, 0xbf, 0xfd, 0x34, 0x46, 0xdf, 0x72, 0xa2, +0xe0, 0xef, 0x0d, 0xaa, 0x5a, 0xc9, 0x26, 0x2e, +0x4e, 0x01, 0xef, 0x78, 0x2c, 0x14, 0xcc, 0x4c, +0x83, 0x46, 0xfe, 0x98, 0x0f, 0x22, 0x0c, 0x3d, +0x08, 0x57, 0xb5, 0xac, 0xe1, 0x41, 0xd5, 0xda, +0x11, 0x94, 0xfe, 0xb2, 0xb5, 0x08, 0xcf, 0x06, +0x11, 0x0c, 0x96, 0x53, 0x41, 0xc9, 0x05, 0xbd, +0x50, 0xea, 0xd7, 0x16, 0xf9, 0x1b, 0x57, 0xc4, +0x8b, 0xf1, 0xc3, 0x54, 0x9e, 0x71, 0xcf, 0xa5, +0x7f, 0xef, 0x75, 0x86, 0x1c, 0xf7, 0x7b, 0x64, +0x4d, 0xdb, 0xe9, 0x44, 0x94, 0xfb, 0xb8, 0xa4, +0x33, 0x3b, 0x55, 0x7d, 0x29, 0x7a, 0xfa, 0x04, +0xf0, 0xf1, 0xf7, 0xd3, 0x16, 0xcd, 0x26, 0x87, +0xc8, 0x3f, 0x8d, 0xa3, 0x26, 0x56, 0x69, 0xd3, +0x06, 0x18, 0xa6, 0x79, 0xc5, 0x35, 0x94, 0xd2, +0xee, 0x23, 0x47, 0x7a, 0x5d, 0xbe, 0xc9, 0x16, +0x37, 0x6b, 0xc2, 0xa5, 0x95, 0x38, 0x4b, 0x19, +0x2d, 0x8e, 0x97, 0x44, 0xf1, 0xca, 0x7d, 0xe3, +0xda, 0x00, 0x30, 0xf6, 0x8e, 0x4d, 0x5f, 0x8f, +0xeb, 0xc2, 0x49, 0x97, 0x5a, 0xe0, 0x75, 0xab, +0xa9, 0x1d, 0xa1, 0xfe, 0xfe, 0x65, 0xd4, 0xb6, +0xf7, 0x67, 0x53, 0x38, 0x2c, 0xd7, 0x36, 0x44, +0x32, 0x51, 0x69, 0xea, 0x60, 0xac, 0xe6, 0x86, +0x98, 0xe3, 0xe6, 0xff, 0x41, 0x85, 0x5e, 0x34, +0x29, 0xbe, 0x7e, 0x97, 0x80, 0x0f, 0x3b, 0x71, +0x0b, 0x38, 0xf3, 0x0a, 0x5d, 0x22, 0xe2, 0x69, +0xc7, 0xc4, 0xd5, 0xf1, 0x84, 0x4c, 0xe5, 0x85, +0x61, 0xea, 0x27, 0x40, 0xd7, 0xb5, 0x04, 0x3a, +0xce, 0x5b, 0x0d, 0x78, 0x8c, 0xcb, 0x70, 0xe0, +0x75, 0x1e, 0x3a, 0x36, 0x0e, 0x80, 0x09, 0x54, +0x61, 0x60, 0x3c, 0x67, 0xd8, 0x4b, 0x3f, 0x9b, +0xda, 0x7a, 0xb0, 0xa9, 0x2e, 0x98, 0xa2, 0xf7, +0x23, 0xf9, 0x61, 0xbd, 0xc6, 0xcf, 0xa8, 0x16, +0x79, 0x66, 0xff, 0x65, 0x47, 0xcf, 0xf0, 0xa1, +0x18, 0x6f, 0x56, 0xd1, 0x3f, 0x24, 0x48, 0x1a, +0x5c, 0x61, 0x8e, 0x4b, 0x43, 0xb8, 0x8c, 0xaa, +0xa3, 0x53, 0x0c, 0xcb, 0xbe, 0x30, 0x1a, 0xf5, +0x96, 0x41, 0x93, 0xa5, 0x61, 0xbf, 0xc8, 0x2d, +0x0d, 0x52, 0xf1, 0x97, 0xe6, 0x84, 0xba, 0x2c, +0x81, 0xfb, 0xab, 0x0f, 0x15, 0xb9, 0xa5, 0x55, +0x2d, 0x01, 0x43, 0x3a, 0xa6, 0xf6, 0x1c, 0x95, +0x2d, 0xa1, 0x22, 0xf0, 0xec, 0xb4, 0xd5, 0xd8, +0xc5, 0x3d, 0xd0, 0xc1, 0xb9, 0x97, 0x6d, 0x5c, +0xb9, 0xfb, 0x7e, 0xdf, 0x94, 0xbb, 0x9f, 0x8b, +0x74, 0xf5, 0xa6, 0x7e, 0x7b, 0x9e, 0x17, 0xed, +0x2c, 0x99, 0xe0, 0x99, 0x41, 0x44, 0xa6, 0xce, +0x63, 0x1e, 0xa5, 0xd8, 0xba, 0xcb, 0xe1, 0x3c, +0x19, 0x59, 0x94, 0xe0, 0x26, 0x33, 0x9d, 0xc1, +0x83, 0xe1, 0x0a, 0x42, 0x9c, 0x9b, 0x14, 0xc0, +0xf7, 0xde, 0x4a, 0x9e, 0xb3, 0x42, 0xd9, 0x35, +0x2c, 0x86, 0x48, 0xf1, 0xf7, 0xde, 0xd8, 0x25, +0xd6, 0xb3, 0x55, 0x1f, 0xe9, 0x57, 0x34, 0xc6, +0x4a, 0x67, 0xe4, 0x7f, 0xfd, 0x08, 0x54, 0xc3, +0x19, 0x52, 0x7b, 0x55, 0x4a, 0x77, 0xd5, 0x5e, +0x7e, 0x5c, 0x0f, 0x64, 0xac, 0xfe, 0x3c, 0xf5, +0xc3, 0x95, 0xd4, 0xac, 0xb0, 0xbf, 0x52, 0x70, +0x25, 0x61, 0x99, 0xb8, 0x55, 0x9c, 0xce, 0xb7, +0xe4, 0x36, 0x72, 0x16, 0x16, 0xdd, 0x7e, 0x5a, +0xec, 0x95, 0x04, 0x57, 0xd7, 0x73, 0x80, 0x18, +0x2f, 0xe6, 0x7d, 0x56, 0xc9, 0xe7, 0x0f, 0x9a, +0x6d, 0x50, 0x34, 0x1f, 0xf4, 0x26, 0x35, 0xe5, +0xe8, 0x94, 0xbd, 0xef, 0xf7, 0x69, 0x28, 0xf7, +0x7b, 0x86, 0xc6, 0x80, 0x81, 0x71, 0xe8, 0xa8, +0xfd, 0x9e, 0x07, 0x2b, 0xba, 0xda }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xaa, +0x3b, 0x05, 0xde, 0xd4, 0xab, 0x24, 0xae, 0xfb, +0x59, 0x37, 0x13, 0x31, 0x53, 0x9f, 0x56, 0x88, +0x9f, 0x3c, 0xc8, 0x03, 0x68, 0x87, 0x04, 0xa3, +0xe6, 0x78, 0xdf, 0x38, 0x2f, 0xe5, 0x7d, 0x40, +0x61, 0xeb, 0xb1, 0x19, 0xeb, 0xfe, 0x61, 0x83, +0xf6, 0xaa, 0xb7, 0x17, 0x84, 0xdc, 0xab, 0x99, +0xd6, 0xdc, 0x26, 0x12, 0x02, 0x3f, 0x44, 0x7b, +0xaf, 0x60, 0xcc, 0x7b, 0x7c, 0xf1, 0x8d, 0x1e, +0x69, 0x1b, 0x71, 0x28, 0x9a, 0x1f, 0xe2, 0x07, +0xac, 0x8c, 0x77, 0x59, 0x9e, 0x1b, 0x1a, 0xa5, +0x36, 0xd5, 0x2f, 0xb8, 0xe4, 0xc2, 0xfb, 0x79, +0x02, 0x75, 0xe5, 0xe0, 0x1c, 0x43, 0xcb, 0xb0, +0x7a, 0xba, 0x2d, 0xad, 0xdb, 0x13, 0xbc, 0x70, +0x10, 0x46, 0x74, 0xc0, 0x31, 0xdf, 0x54, 0x19, +0x1f, 0xf8, 0x20, 0x71, 0x5b, 0xbe, 0xe2, 0xd4, +0xde, 0x1e, 0x6c, 0xee, 0x09, 0x0c, 0xb6, 0x81, +0x67, 0x75, 0x5c, 0x52, 0x55, 0x88, 0x57, 0xb4, +0x4a, 0x6d, 0xdd, 0xbb, 0x63, 0x87, 0xb1, 0xc7, +0xff, 0xdb, 0xe9, 0xf0, 0x69, 0x45, 0x81, 0x44, +0x1e, 0x05, 0xda, 0x86, 0x21, 0xf3, 0x74, 0xa2, +0xa8, 0x10, 0x99, 0x3c, 0x5b, 0x19, 0xf4, 0x39, +0x31, 0x9a, 0x83, 0xf6, 0x11, 0x9a, 0x65, 0x67, +0xd7, 0x9c, 0xb9, 0xe5, 0xba, 0x4a, 0x0a, 0x9f, +0x24, 0x36, 0xf4, 0x6f, 0x19, 0xc1, 0xfe, 0xab, +0xf3, 0xe2, 0x94, 0x21, 0xa3, 0xef, 0xc9, 0x03, +0xe1, 0x7b, 0x99, 0xef, 0x20, 0x1c, 0x66, 0x31, +0x7f, 0xab, 0x67, 0x38, 0xfb, 0xe3, 0x7a, 0x10, +0xd9, 0x83, 0x0c, 0x02, 0x07, 0x4e, 0xd0, 0xaa, +0x8d, 0x7d, 0x92, 0x72, 0x9f, 0x7a, 0x1c, 0xe7, +0x30, 0xc5, 0x8b, 0xb9, 0x65, 0xc5, 0x8d, 0x78, +0xaa, 0x4d, 0xb5, 0x45, 0x05, 0xdf, 0x8f, 0x90, +0xa0, 0x06, 0xbf, 0x49, 0xfa, 0xfb, 0xf2, 0xfb, +0x5b, 0x72, 0x68, 0xa6, 0xfb, 0x8d, 0x1f, 0x61, +0x34, 0xff, 0x67, 0x07, 0xd5, 0x9f, 0x1d, 0xbf, +0x8d, 0xae, 0x19, 0x6b, 0xd8, 0x7f, 0x7e, 0xe9, +0x02, 0x86, 0x36, 0x81, 0xf6, 0xc6, 0x5c, 0x23, +0xa4, 0x4a, 0x03, 0x70, 0xed, 0x09, 0x9c, 0xdb, +0xce, 0xb0, 0xf9, 0x84, 0x49, 0xc6, 0x61, 0x5d, +0x85, 0xa0, 0x7d, 0x18, 0x61, 0x37, 0x8b, 0x74, +0x54, 0xb9, 0x11, 0xe1, 0xf8, 0xaf, 0x95, 0x2c, +0xc8, 0x6a, 0x7c, 0x6b, 0xf3, 0x06, 0xec, 0xeb, +0x3c, 0xc9, 0x7a, 0x0f, 0x38, 0x65, 0x63, 0xc0, +0x02, 0x47, 0xae, 0xa9, 0x33, 0xea, 0xc9, 0xa3, +0xfd, 0x21, 0xd3, 0x28, 0x5d, 0x1a, 0xa8, 0x0d, +0xf4, 0x9c, 0x87, 0xab, 0x3b, 0xf5, 0x81, 0x29, +0xfd, 0x28, 0xef, 0xe4, 0x3b, 0x3e, 0xc2, 0xd1, +0x3b, 0xd9, 0xe5, 0x32, 0x4e, 0x0f, 0x2e, 0x64, +0xd0, 0x71, 0x4c, 0xc0, 0x44, 0x2b, 0x9e, 0x28, +0x68, 0x45, 0xa4, 0x4f, 0xe0, 0xb5, 0x9b, 0x42, +0xae, 0x6c, 0x94, 0xcd, 0xe5, 0x2b, 0x8f, 0x86, +0x52, 0x91, 0xa0, 0x2b, 0x97, 0x10, 0xf0, 0x79, +0xb3, 0x72, 0xce, 0x4b, 0x66, 0x63, 0xe1, 0xef, +0xb0, 0xae, 0xd9, 0x6d, 0xaf, 0x79, 0x38, 0xff, +0x6b, 0xfb, 0x9f, 0xa9, 0xe6, 0x68, 0x0e, 0x4b, +0x2a, 0x61, 0x09, 0xa4, 0x67, 0x98, 0xff, 0xe0, +0xff, 0xda, 0x27, 0xd2, 0x2b, 0x87, 0x51, 0x97, +0xe6, 0x61, 0x97, 0xec, 0x51, 0xf6, 0x17, 0x93, +0xcb, 0x28, 0x21, 0x6d, 0xfa, 0xb5, 0x18, 0x6b, +0x75, 0xd5, 0x8a, 0x48, 0x6a, 0x5b, 0xd5, 0x80, +0xc1, 0x22, 0xcc, 0x85, 0xa7, 0xda, 0x4b, 0xc0, +0xe2, 0xb6, 0xf0, 0xb5, 0xb4, 0xad, 0x43, 0x20, +0xae, 0x6f, 0xe8, 0x95, 0x96, 0x99, 0x56, 0x75, +0xfa, 0x8c, 0x91, 0x91, 0xb6, 0x26, 0x58, 0x29, +0x62, 0xf6, 0xa3, 0xec, 0x53, 0xdb, 0x7b, 0xf2, +0x3e, 0x79, 0xd3, 0x08, 0xce, 0x78, 0x2e, 0x58, +0xe7, 0xa9, 0xac, 0xbe, 0xf0, 0x85, 0x52, 0xf2, +0x8e, 0x46, 0x47, 0x28, 0xf3, 0x49, 0xac, 0x9c, +0xb2, 0xf3, 0x42, 0x3c, 0x13, 0x10, 0x82, 0xf6, +0xd6, 0x14, 0x09, 0x99, 0xd4, 0x6d, 0xe9, 0x3a, +0x2d, 0x6a, 0x31, 0x4b, 0x2a, 0xb9, 0x48, 0x26, +0xce, 0x3c, 0xe0, 0x1a, 0xca, 0x39, 0x17, 0xcf, +0xd8, 0xe6, 0x39, 0x95, 0x5b, 0x77, 0x28, 0x00, +0xff, 0x2a, 0x83, 0xd8, 0x3d, 0xd8, 0xeb, 0xfa, +0xe6, 0x37, 0x7c, 0xc4, 0x6d, 0xba, 0xbf, 0x85, +0x17, 0x3d, 0x68, 0x9e, 0xfd, 0x4b, 0x91, 0xd2, +0x13, 0x5a, 0xc8, 0x73, 0xbe, 0xc2, 0xa3, 0x7f, +0x58, 0x36, 0x8c, 0x29, 0x3f, 0xfd, 0x59, 0x9a, +0xbd, 0x5f, 0xf0, 0x16, 0xd5, 0xc1, 0x10, 0xcc, +0x54, 0x31, 0xe4, 0x3e, 0x84, 0xda, 0xda, 0x3e, +0x6c, 0x23, 0xf6, 0x5c, 0x46, 0x68, 0xed, 0xbb, +0x23, 0xb5, 0xd3, 0x57, 0xf3, 0xdb, 0x9a, 0x5a, +0x61, 0xba, 0x9f, 0xa7, 0x69, 0x31, 0x23, 0x47, +0x87, 0x13, 0x9a, 0x4f, 0x46, 0x35, 0xc2, 0x60, +0xd5, 0xf1, 0x77, 0x55, 0xd7, 0x83, 0xb0, 0xc3, +0x2f, 0x66, 0xaa, 0x14, 0xb3, 0x34, 0xd7, 0xa3, +0x6c, 0x66, 0x6f, 0x50, 0x91, 0xb9, 0x30, 0x3f, +0x62, 0xa4, 0x7b, 0xf5, 0x40, 0x46, 0x5c, 0x75, +0xfe, 0x6e, 0x3b, 0xe2, 0x62, 0x0f, 0xdb, 0x90, +0x06, 0x46, 0x4e, 0x31, 0x64, 0xc9, 0xd8, 0x4e, +0x02, 0xa5, 0x14, 0xd4, 0xa9, 0xa6, 0xea, 0x56, +0x01, 0xa6, 0x80, 0x7c, 0xa7, 0xff, 0xc6, 0xb1, +0x5f, 0x96, 0x49, 0xb5, 0x05, 0x96, 0x49, 0x54, +0x28, 0xa4, 0xd2, 0xb7, 0xee, 0xe9, 0x9b, 0x02, +0xfc, 0x26, 0xdc, 0x78, 0xa5, 0x11, 0x6b, 0x9f, +0x8e, 0x7c, 0xb3, 0x2a, 0xee, 0x91, 0x35, 0x16, +0x2f, 0x8d, 0xf9, 0x79, 0x4c, 0x16, 0xec, 0xa6, +0xa8, 0x73, 0xb8, 0x09, 0x3b, 0x89, 0x5e, 0xa5, +0xc4, 0xc5, 0xda, 0xdf, 0x5e, 0x25, 0xe2, 0xf4, +0xe7, 0x86, 0x73, 0x4a, 0xf8, 0x7b, 0x37, 0x6f, +0x09, 0x95, 0xfc, 0xb7, 0x3c, 0xcc, 0x5e, 0x72, +0x9e, 0x8d, 0x9d, 0x19, 0xd4, 0x2e, 0x5c, 0xb0, +0xa6, 0x8b, 0xc0, 0x15, 0x3f, 0x75, 0xf3, 0x05, +0xda, 0x13, 0x12, 0x22, 0xbe, 0xb7, 0x6c, 0x40, +0x94, 0x30, 0xa9, 0xb6, 0x0f, 0x71, 0xd2, 0x6f, +0x89, 0x35, 0xd7, 0xac, 0xee, 0xe9, 0x18, 0x93, +0x0d, 0x60, 0x1e, 0xa2, 0x49, 0xe1, 0x9b, 0x41, +0x18, 0x59, 0x7c, 0x38, 0x7f, 0x05, 0x84, 0x0b, +0x66, 0xab, 0x54, 0xba, 0xfc, 0x40, 0x5e, 0xa3, +0x1b, 0xc0, 0xb9, 0x3c, 0x51, 0x40, 0xcb, 0xd3, +0xe5, 0x96, 0x3b, 0x2b, 0x06, 0xc9, 0x4f, 0x17, +0xd7, 0x4f, 0xd7, 0x47, 0xe0, 0x85, 0x97, 0xde, +0x86, 0xa4, 0x2e, 0x64, 0x11, 0x00, 0x34, 0x44, +0x6a, 0x10, 0x96, 0xf1, 0x6d, 0x3a, 0xb1, 0x0d, +0xe4, 0xf2, 0x52, 0x00, 0xd3, 0x80, 0x76, 0x4d, +0x33, 0xa8, 0x41, 0xd1, 0x2b, 0x06, 0x37, 0x3f, +0xc1, 0x8e, 0x0c, 0x47, 0xd9, 0x85, 0x8c, 0x0e, +0x21, 0x57, 0xe9, 0xbd, 0x86, 0x3c, 0xf8, 0x23, +0xc3, 0xc3, 0xfd, 0x7d, 0x60, 0xea, 0x07, 0xab, +0x3c, 0x91, 0x2e, 0xb6, 0xf0, 0xec, 0xf6, 0xb0, +0x89, 0xaf, 0x55, 0xf3, 0x07, 0xe9, 0x60, 0x10, +0x40, 0x43, 0x91, 0x0d, 0x20, 0xc6, 0x37, 0x67, +0xbe, 0xdb, 0xab, 0xe7, 0xc5, 0x50, 0x60, 0x5d, +0xec, 0x7f, 0x5b, 0xd0, 0x02, 0x2f, 0xa1, 0xb3, +0x33, 0x70, 0xdb, 0x26, 0x15, 0x94, 0xda, 0x7d, +0xd7, 0x76, 0x11, 0x0e, 0xdd, 0x46, 0x98, 0x9f, +0x9d, 0xdc, 0xa0, 0x85, 0x2c, 0xd7, 0x4f, 0x85, +0xc4, 0x89, 0x77, 0x96, 0xd0, 0x02, 0x3f, 0x34, +0x44, 0x2b, 0x01, 0x04, 0x57, 0x1a, 0xc0, 0x5f, +0x3e, 0xb8, 0xea, 0x78, 0x05, 0x74, 0x9d, 0xf6, +0x16, 0x1d, 0xac, 0x46, 0x10, 0x14, 0xb9, 0x6f, +0x97, 0xa0, 0xdd, 0x2b, 0xd4, 0x5b, 0x25, 0x68, +0xba, 0x2b, 0x75, 0x14, 0xbf, 0x5f, 0xca, 0xa4, +0xcb, 0x23, 0xba, 0xa4, 0x5c, 0x2b, 0xeb, 0xc2, +0xfa, 0xfa, 0xed, 0x1f, 0xd2, 0x7d, 0x49, 0x5b, +0x6c, 0x5f, 0x94, 0xe2, 0xa7, 0xbc, 0xf5, 0x3c, +0x5c, 0xd8, 0xf3, 0x82, 0xc1, 0xba, 0xbc, 0xf3, +0x6e, 0x15, 0xf3, 0x2e, 0xc5, 0x44, 0x7f, 0xd3, +0x5e, 0xf4, 0xe7, 0xc5, 0xf9, 0x5a, 0xc5, 0x72, +0x37, 0xb1, 0xc8, 0x24, 0x0c, 0xe7, 0x0f, 0xe4, +0x02, 0x67, 0xff, 0x45, 0x7f, 0xcc, 0x38, 0xd5, +0x19, 0x5a, 0xe3, 0x83, 0x3d, 0xa9, 0x02, 0x2d, +0x84, 0xd3, 0xe8, 0x5f, 0x45, 0x11, 0xd4, 0x63, +0x44, 0xaf, 0xb5, 0xec, 0x6d, 0x63, 0x57, 0xec, +0x8e, 0xcf, 0xeb, 0x1a, 0x72, 0x4e, 0x82, 0x7d, +0xe2, 0x7f, 0x72, 0x9d, 0xff, 0xa0, 0x79, 0x17, +0xe4, 0xbd, 0x67, 0x20, 0xdb, 0xa7, 0xf3, 0xad, +0xba, 0xb4, 0x03, 0x4a, 0xd7, 0x57, 0xf8, 0xa2, +0x6e, 0xc6, 0x35, 0x45, 0xe6, 0x8d, 0x8d, 0x64, +0xb7, 0xdb, 0x7c, 0x91, 0x9c, 0x8a, 0xfe, 0xec, +0xf0, 0xe7, 0xf0, 0x22, 0x6b, 0x79, 0x40, 0x96, +0x2f, 0x19, 0x1a, 0xf2, 0xc8, 0x52, 0xd5, 0x00, +0xe6, 0xac, 0xad, 0x97, 0x54, 0xa6, 0xd3, 0xd5, +0x5f, 0xae, 0x97, 0x9d, 0x1e, 0x5a, 0x67, 0xb4, +0xd7, 0x69, 0x64, 0x73, 0x0c, 0x70, 0xf6, 0x25, +0xc1, 0xf5, 0xca, 0x9b, 0xe7, 0x82, 0xb9, 0xda, +0x2e, 0x76, 0xae, 0x2e, 0xcd, 0x5b, 0xce, 0x47, +0xa1, 0x40, 0xe6, 0xcf, 0xc9, 0xb6, 0x20, 0x24, +0xb8, 0x06, 0x06, 0xb2, 0xcb, 0x53, 0x16, 0x48, +0x8f, 0x6a, 0x44, 0x02, 0xc5, 0x19, 0x76, 0xdd, +0xfe, 0xa7, 0xe9, 0xbb, 0x16, 0x95, 0x1d, 0xed, +0x8a, 0xf3, 0xb3, 0xb1, 0x1f, 0x81, 0x76, 0xfc, +0x68, 0xb6, 0xef, 0x4a, 0xdc, 0x0d, 0xb9, 0xc9, +0x4e, 0x05, 0x7b, 0xc0, 0x0b, 0xa7, 0x67, 0xf6, +0xb9, 0x12, 0x60, 0x9b, 0x8d, 0x97, 0x5c, 0xe7, +0x36, 0xc3, 0x8c, 0x25, 0xcc, 0x7b, 0x9a, 0x47, +0x3c, 0x86, 0x0f, 0x4e, 0x6c, 0xff, 0x25, 0x30, +0x2f, 0xc2, 0x45, 0xc8, 0xb4, 0xe4, 0xad, 0x9a, +0x23, 0xbc, 0xfa, 0xc0, 0x07, 0x2d, 0x4e, 0xea, +0x4e, 0x3e, 0xc0, 0x5f, 0x61, 0xec, 0x2d, 0xd9, +0x95, 0x9d, 0x7a, 0xa8, 0xb3, 0xdd, 0x92, 0xce, +0x26, 0xd7, 0x41, 0x83, 0x2c, 0x5f, 0x4f, 0xa6, +0xf8, 0x21, 0xdf, 0x78, 0xb0, 0x50, 0x8e, 0xfa, +0xfd, 0xc8, 0x91, 0x07, 0xb4, 0x46, 0x2d, 0x88, +0x36, 0x9a, 0x65, 0x44, 0xab, 0x58, 0x81, 0x4f, +0x9a, 0x13, 0x17, 0x1d, 0x35, 0x8e, 0x9e, 0xf3, +0xaa, 0x55, 0xbc, 0x0c, 0xc3, 0xbe, 0xa3, 0x4b, +0x38, 0x1a, 0xd2, 0x42, 0x97, 0xe2, 0xed, 0x65, +0xea, 0xae, 0x9c, 0xe9, 0xf8, 0x5a, 0x44, 0xd3, +0xde, 0xae, 0x70, 0x2e, 0xfb, 0xa5, 0x41, 0xd7, +0xfa, 0x0f, 0x4b, 0x1e, 0x26, 0x24, 0xb3, 0x25, +0x15, 0x97 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x04, 0xd8, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb7, +0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0x2d, 0x70, +0xb4, 0x11, 0x1a, 0xcc, 0xf6, 0x93, 0x87, 0xd3, +0xf9, 0xc1, 0x42, 0x7c, 0x05, 0x1d, 0xc4, 0x74, +0x12, 0x77, 0x02, 0xa0, 0xce, 0x81, 0x7d, 0x32, +0xe4, 0x9c, 0x0d, 0x01, 0xbd, 0xd5, 0x5c, 0x1c, +0x01, 0x65, 0x6b, 0x34, 0x38, 0xb3, 0x71, 0x41, +0xed, 0x4d, 0x4a, 0xa7, 0xc8, 0xb3, 0x9a, 0x77, +0xd8, 0xc2, 0x84, 0x14, 0x68, 0x8e, 0xbf, 0x94, +0xda, 0xe3, 0xc0, 0x70, 0x56, 0x69, 0x3a, 0x65, +0x58, 0xae, 0x9d, 0xcd, 0x00, 0x45, 0x20, 0xf2, +0x59, 0xb0, 0x6c, 0x76, 0x16, 0xa2, 0x22, 0xde, +0xfc, 0x06, 0xe0, 0xf4, 0x52, 0x8d, 0x93, 0xe1, +0xd4, 0x92, 0x0c, 0x05, 0xf9, 0xfb, 0x52, 0xfb, +0xa8, 0xcf, 0xb1, 0x86, 0xdc, 0xe8, 0x07, 0x95, +0xfa, 0x1c, 0x38, 0xb9, 0xd0, 0x7a, 0x65, 0xe0, +0x36, 0xe1, 0x2f, 0xa8, 0x3a, 0xbf, 0xc7, 0xb7, +0x3e, 0xc4, 0xd5, 0x48, 0xfb, 0x6d, 0x40, 0xa2, +0xb5, 0xe2, 0xe7, 0x3a, 0x42, 0x7c, 0x1c, 0xc5, +0x36, 0xbc, 0x29, 0xca, 0x78, 0xf9, 0x36, 0xba, +0xf4, 0xb6, 0x8e, 0xe7, 0x74, 0xc7, 0xc9, 0x8a, +0x74, 0x2d, 0xfc, 0x66, 0x8d, 0x31, 0x62, 0x15, +0x59, 0x00, 0xbb, 0x53, 0xd3, 0x4b, 0xad, 0x8a, +0x97, 0x00, 0xf7, 0x90, 0xdd, 0x7a, 0xf2, 0xde, +0x02, 0x82, 0x75, 0xe8, 0xae, 0x82, 0x18, 0x14, +0xc2, 0xc3, 0x03, 0x27, 0x93, 0x0f, 0x2b, 0xc6, +0xb1, 0xd0, 0x8b, 0xae, 0x28, 0xbb, 0x3f, 0xb5, +0x47, 0x42, 0xc6, 0x73, 0x3a, 0xb2, 0xd8, 0x8f, +0x21, 0xde, 0x10, 0xb4, 0x5a, 0x8b, 0x54, 0x3d, +0x24, 0xc7, 0x8b, 0xbf, 0x0d, 0xc5, 0x81, 0x52, +0x1d, 0x21, 0x09, 0x61, 0xcc, 0x88, 0x2a, 0x6d, +0xe5, 0x45, 0xc7, 0x17, 0x94, 0x27, 0x18, 0x9b, +0x04, 0xea, 0xa5, 0x9b, 0x97, 0x79, 0xf9, 0x61, +0xe3, 0xc4, 0x5e, 0x31, 0x50, 0x06, 0x02, 0x43, +0x7c, 0x85, 0xf6, 0x4c, 0xc5, 0x10, 0x6d, 0x0f, +0xb3, 0x5e, 0x97, 0x01, 0x9f, 0x77, 0x5d, 0xcc, +0x68, 0x49, 0xae, 0xaa, 0x52, 0xcc, 0x6d, 0x81, +0xa9, 0x90, 0x81, 0x10, 0x09, 0x3f, 0xdd, 0x5c, +0x61, 0xcc, 0xc3, 0xc0, 0xc8, 0xc4, 0x5c, 0x0a, +0xb0, 0x63, 0x5b, 0xb0, 0xf4, 0xa1, 0x64, 0x4e, +0xd6, 0xc6, 0x81, 0xb2, 0x75, 0xc2, 0x7d, 0xaa, +0x01, 0xae, 0xe0, 0xf0, 0x4e, 0x62, 0x40, 0xb4, +0x13, 0xf1, 0xa7, 0x66, 0xef, 0xd4, 0xf1, 0xf1, +0xa9, 0x60, 0xce, 0x18, 0x6c, 0xb3, 0x36, 0xa6, +0x12, 0xed, 0xb6, 0x20, 0xca, 0x0b, 0x84, 0xde, +0xbc, 0xcb, 0x3c, 0x38, 0x6d, 0x03, 0xc8, 0xd0, +0xe1, 0x25, 0xc0, 0x49, 0x1d, 0x11, 0x7b, 0x41, +0x2a, 0x5d, 0x07, 0x74, 0x7d, 0x52, 0x5a, 0x53, +0xf6, 0xa7, 0xd7, 0xc0, 0xaa, 0x72, 0x4c, 0xcc, +0x62, 0x6b, 0x5e, 0xf6, 0x1d, 0xd1, 0xb9, 0x93, +0x01, 0x77, 0x0d, 0xa9, 0x48, 0xfb, 0x32, 0x30, +0x4c, 0x35, 0x74, 0x0d, 0x62, 0xfe, 0xea, 0xe6, +0x17, 0x76, 0x80, 0x55, 0x8f, 0xcd, 0x16, 0xe6, +0x0f, 0xaa, 0xf8, 0xc0, 0x6a, 0x8b, 0xe8, 0xa8, +0x21, 0x89, 0x58, 0xda, 0x4c, 0xcb, 0x70, 0x50, +0x6d, 0x3f, 0x5e, 0x4e, 0xcf, 0x7c, 0x0a, 0x04, +0xf9, 0x79, 0x77, 0xd3, 0x54, 0xaa, 0x92, 0xbe, +0x49, 0x1a, 0x23, 0x60, 0x1e, 0x4c, 0x06, 0xa4, +0xbb, 0x3d, 0xd1, 0x7c, 0xcd, 0xf3, 0xf6, 0x61, +0x4a, 0xee, 0x2b, 0x44, 0x77, 0x93, 0xe4, 0xe8, +0x5c, 0x80, 0x43, 0x09, 0x22, 0x95, 0x27, 0x60, +0xb2, 0x45, 0xf6, 0xfc, 0x2f, 0xd2, 0xf5, 0xfa, +0x0b, 0xdd, 0x00, 0x09, 0xb0, 0x63, 0xf4, 0x27, +0x23, 0x51, 0x88, 0x6e, 0x4b, 0x59, 0x20, 0x18, +0x97, 0x3e, 0xc8, 0xd1, 0x3f, 0x8a, 0xd1, 0xb5, +0xa4, 0xc5, 0x23, 0xcf, 0x08, 0xe9, 0x28, 0xf0, +0xfc, 0xff, 0x89, 0xcb, 0x8e, 0xc7, 0xcf, 0xf5, +0x8e, 0x82, 0x4e, 0xc3, 0x61, 0xf6, 0x20, 0x25, +0x9d, 0xd5, 0xd6, 0x19, 0xc9, 0x55, 0x88, 0x64, +0xd2, 0x97, 0xcd, 0x6c, 0x73, 0x53, 0x44, 0xa2, +0x44, 0xc4, 0x65, 0x16, 0x8e, 0x33, 0xbe, 0x85, +0x70, 0xcc, 0xc0, 0xac, 0x8a, 0xba, 0x4e, 0xa3, +0x7f, 0x1c, 0x6a, 0x0f, 0x7d, 0x9a, 0xad, 0x50, +0x45, 0xd7, 0x7e, 0x63, 0xc0, 0xfe, 0xb9, 0xaa, +0x91, 0x89, 0x85, 0x35, 0x52, 0x0b, 0x9b, 0xae, +0x62, 0xe5, 0x1e, 0x9d, 0x67, 0x39, 0xdc, 0x03, +0x27, 0x5b, 0x77, 0xdf, 0x80, 0x0f, 0xcc, 0x30, +0x12, 0x49, 0x0c, 0xb3, 0xed, 0x27, 0x87, 0x9e, +0x16, 0x80, 0x8c, 0x27, 0xd7, 0xfd, 0x3b, 0x78, +0xd7, 0x55, 0x32, 0x18, 0x19, 0xa8, 0x7b, 0x15, +0x45, 0x34, 0xf4, 0x94, 0x85, 0x0a, 0x48, 0x79, +0x62, 0x1c, 0x5a, 0x7a, 0x0e, 0x2d, 0xa8, 0xdf, +0x10, 0x5a, 0x13, 0xa6, 0x24, 0xdc, 0xf8, 0x0c, +0xe6, 0x1d, 0xef, 0x84, 0x6e, 0x2a, 0xc7, 0xe5, +0xcf, 0xb1, 0xd1, 0x7a, 0x22, 0x50, 0xcd, 0x6d, +0x83, 0xb0, 0x09, 0x95, 0x4a, 0x97, 0x43, 0x42, +0x49, 0xf0, 0xcf, 0x11, 0xb7, 0x85, 0x2f, 0x74, +0x57, 0x3a, 0xb8, 0xfc, 0x06, 0xe5, 0x5d, 0x82, +0x5b, 0xb9, 0x85, 0x82, 0xdf, 0xc7, 0xd1, 0x60, +0xc2, 0x21, 0x6f, 0x92, 0x70, 0xa4, 0xe2, 0x56, +0x54, 0xbd, 0x08, 0x6e, 0x3a, 0x3c, 0xa9, 0x9b, +0xd6, 0xac, 0xd6, 0x90, 0x1d, 0xa2, 0x3d, 0x61, +0x67, 0xc6, 0x09, 0x25, 0x3c, 0x81, 0x3a, 0xcf, +0x40, 0x99, 0x42, 0x37, 0xe1, 0x51, 0xd7, 0x35, +0xb1, 0x16, 0x42, 0x3b, 0x74, 0xf5, 0x45, 0x72, +0xa7, 0xbb, 0xe7, 0xf7, 0xce, 0x98, 0xbe, 0x12, +0xdc, 0xe1, 0x7e, 0x9b, 0x36, 0xb4, 0xd3, 0xc7, +0xa5, 0xd4, 0xf5, 0x10, 0xea, 0x53, 0x77, 0x77, +0x1a, 0x8d, 0x42, 0x53, 0x00, 0x62, 0x75, 0x7c, +0xc9, 0x7d, 0xa6, 0x63, 0xfe, 0xb1, 0xa0, 0xb8, +0x1d, 0x80, 0x4c, 0x91, 0x8d, 0xac, 0x0d, 0x0b, +0x27, 0x3f, 0x86, 0xf0, 0x27, 0xee, 0x75, 0xfb, +0x79, 0x88, 0x93, 0x70, 0x93, 0xbf, 0xc8, 0x67, +0x8e, 0xe7, 0x91, 0xe7, 0x86, 0x0a, 0x96, 0xfa, +0x2e, 0x44, 0x96, 0x55, 0x10, 0xa9, 0x78, 0x02, +0x3e, 0xfa, 0xdf, 0x9e, 0x15, 0xd9, 0xd9, 0xd0, +0x42, 0x13, 0x99, 0x7d, 0x17, 0x27, 0xae, 0xbf, +0x2a, 0x49, 0xa8, 0x0c, 0xa1, 0x55, 0x74, 0x09, +0x20, 0x46, 0x71, 0xb8, 0xc7, 0xb3, 0xb3, 0xbe, +0xf3, 0x11, 0xac, 0x9b, 0x54, 0xd7, 0xa9, 0x4d, +0x5a, 0x5f, 0x85, 0x28, 0x99, 0x64, 0x93, 0xbe, +0xc0, 0xe6, 0x8a, 0x25, 0x25, 0xeb, 0x49, 0xa3, +0x4e, 0xf0, 0x6e, 0x5f, 0x29, 0xf9, 0x4f, 0xe2, +0x51, 0xf5, 0xbd, 0x30, 0xeb, 0x31, 0x00, 0x91, +0x25, 0xa1, 0xb1, 0x5d, 0xd5, 0x9a, 0xee, 0x8c, +0x56, 0xaf, 0x24, 0x58, 0x19, 0x8b, 0x8e, 0x49, +0x16, 0x85, 0xda, 0xfd, 0x72, 0xbf, 0x0b, 0x96, +0x71, 0xb2, 0xc1, 0x18, 0xb3, 0xb3, 0xc5, 0xfc, +0x41, 0x45, 0xa8, 0x28, 0x75, 0xc7, 0xe7, 0xa7, +0xef, 0x3c, 0x91, 0xe2, 0x10, 0x0b, 0x6a, 0x4e, +0x79, 0x1b, 0x8c, 0xa8, 0x43, 0x6a, 0x0d, 0x42, +0xe6, 0x7e, 0x4f, 0xc5, 0x4e, 0x1e, 0x3c, 0x17, +0x35, 0xf1, 0x8f, 0xa6, 0xa1, 0x0c, 0x6e, 0x60, +0xb9, 0x98, 0xe3, 0xc0, 0x95, 0x26, 0xcd, 0xc9, +0x8c, 0x74, 0x48, 0x75, 0x85, 0xfb, 0x03, 0xec, +0x60, 0x97, 0xac, 0x62, 0xc6, 0x1f, 0xd4, 0x7f, +0xe1, 0x2f, 0xe7, 0xf9, 0x48, 0x5c, 0x01, 0xe0, +0x04, 0x91, 0x65, 0x71, 0x9b, 0x22, 0x5c, 0xf0, +0x5e, 0xc4, 0xe9, 0x64, 0xc9, 0x94, 0x8a, 0x08, +0x39, 0x6b, 0x9b, 0x1f, 0x73, 0x4a, 0xd6, 0x79, +0xeb, 0x02, 0x37, 0x9f, 0x1a, 0x01, 0x4a, 0xce, +0x30, 0x22, 0x31, 0x33, 0x2f, 0x40, 0xca, 0x6b, +0xd9, 0xf0, 0x4f, 0xc6, 0xf6, 0x5c, 0xbe, 0x42, +0x28, 0xd6, 0xfc, 0xcf, 0x47, 0x87, 0x76, 0xe0, +0xf6, 0xe8, 0x9a, 0xe5, 0xbb, 0x49, 0x0d, 0x32, +0x3d, 0xf1, 0x54, 0x87, 0x6b, 0xd5, 0x68, 0x69, +0xb0, 0x10, 0xa2, 0x77, 0xce, 0xd7, 0x52, 0x09, +0x40, 0xdd, 0xbe, 0xc0, 0x5f, 0x40, 0xa5, 0x88, +0x78, 0xbe, 0x81, 0x50, 0x05, 0x23, 0x86, 0x46, +0x16, 0x3a, 0x34, 0x72, 0xcc, 0xfe, 0x2d, 0x6c, +0xea, 0xbd, 0x2d, 0xdd, 0xf3, 0xbe, 0xde, 0x9d, +0x7b, 0xa9, 0x0c, 0x69, 0xae, 0xc3, 0x22, 0xb7, +0xe1, 0xa1, 0xf9, 0x9b, 0x48, 0x01, 0xbc, 0xb2, +0xe7, 0x48, 0xd9, 0xbc, 0x6f, 0x1e, 0xbb, 0x8b, +0xe6, 0x41, 0x2b, 0xf4, 0xc4, 0xbd, 0x9e, 0xab, +0x08, 0x1c, 0xdc, 0x45, 0x16, 0x1f, 0xa3, 0x5c, +0x14, 0xd5, 0x50, 0xad, 0x43, 0x4a, 0x9a, 0xcc, +0x7d, 0x2b, 0xf1, 0x4f, 0x1f, 0x73, 0x22, 0x6f, +0xa0, 0x81, 0x4c, 0xaa, 0x92, 0xb2, 0x29, 0xed, +0x07, 0x52, 0xaa, 0x67, 0xc5, 0x7b, 0x2f, 0x8d, +0x3d, 0xc0, 0x86, 0x2d, 0x53, 0xab, 0x4a, 0xb2, +0x3d, 0x31, 0x2b, 0xc6, 0x21, 0x38, 0x65, 0x64, +0x92, 0x67, 0xbf, 0x0b, 0xb8, 0xa8, 0xe8, 0x63, +0x64, 0x00, 0xcd, 0xa5, 0xfe, 0x05 }; + +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0xec, 0x2c, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, +0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x98, 0xc5, +0x22, 0x1f, 0x25, 0x30, 0x44, 0xb8, 0x34, 0x12, +0x59, 0x5a, 0xd4, 0xc1, 0x22, 0x39, 0xf8, 0x37, +0x52, 0xc9, 0x92, 0xae, 0x84, 0xef, 0x84, 0xb4, +0x7b, 0x98, 0x1b, 0x19, 0x8e, 0x0f, 0x0d, 0xda, +0xec, 0xf9, 0xef, 0x0a, 0xc0, 0xb7, 0x86, 0xeb, +0xc3, 0x85, 0xe0, 0x46, 0xbd, 0xc7, 0xdd, 0x3f, +0xd8, 0x38, 0xa9, 0x30, 0x9b, 0x67, 0xde, 0xb3, +0x25, 0x65, 0xf3, 0xf6, 0x7e, 0xb6, 0x02, 0x0e, +0xbc, 0xe1, 0x23, 0xc1, 0x24, 0x08, 0x22, 0x4b, +0x5e, 0x60, 0x7b, 0xb7, 0xf0, 0x3d, 0x75, 0x50, +0xf7, 0x5f, 0xf2, 0xba, 0x79, 0x43, 0xc3, 0x5f, +0xdb, 0x2f, 0x0c, 0xb9, 0xfd, 0x30, 0x82, 0x8a, +0x72, 0x3f, 0x3c, 0xd4, 0x54, 0xe7, 0xe9, 0xf4, +0x86, 0x3d, 0x02, 0x18, 0xf6, 0x3f, 0x18, 0x8a, +0xf8, 0x8c, 0xb7, 0x7a, 0x08, 0x1d, 0x26, 0x25, +0x5f, 0x85, 0x01, 0xe3, 0x85, 0x33, 0x5d, 0x52, +0xcd, 0x13, 0x22, 0xdd, 0x66, 0x46, 0xee, 0x95, +0xea, 0xea, 0x65, 0x8f, 0xdc, 0x68, 0x14, 0x80, +0x90, 0xa4, 0x3d, 0x32, 0x63, 0xfa, 0x42, 0xcd, +0x3b, 0xb0, 0x21, 0xa9, 0x2d, 0x95, 0xda, 0x43, +0x51, 0xa5, 0x84, 0x3b, 0xb7, 0x72, 0x06, 0xd7, +0xd8, 0xbe, 0xe1, 0xb5, 0xa5, 0xbb, 0x16, 0xee, +0xd3, 0x8f, 0xe1, 0xa8, 0x24, 0xde, 0x5f, 0x2a, +0x91, 0x9a, 0x42, 0xe7, 0x5a, 0xd2, 0x2e, 0x97, +0xe2, 0x07, 0xb6, 0x58, 0x8e, 0xb8, 0x8c, 0xf1, +0xbf, 0x1e, 0xc6, 0x3c, 0x48, 0x5f, 0x29, 0x18, +0x00, 0xdc, 0xee, 0xe9, 0xc3, 0x59, 0x15, 0x1e, +0x87, 0xeb, 0xb2, 0xea, 0x08, 0x93, 0xe3, 0x0a, +0x93, 0xe5 }; + +#if 0 +static char pkt9[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, +0x00, 0x00, 0x00, 0xff, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb7, +0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0x2d, 0x70, +0xb4, 0x11, 0x1a, 0xcc, 0xf6, 0x93, 0x87, 0xd3, +0xf9, 0xc1, 0x42, 0x7c, 0x05, 0x1d, 0xc4, 0x74, +0x12, 0x77, 0x02, 0xa0, 0xce, 0x81, 0x7d, 0x32, +0xe4, 0x9c, 0x0d, 0x01, 0xbd, 0xd5, 0x5c, 0x1c, +0x01, 0x65, 0x6b, 0x34, 0x38, 0xb3, 0x71, 0x41, +0xed, 0x4d, 0x4a, 0xa7, 0xc8, 0xb3, 0x9a, 0x77, +0xd8, 0xc2, 0x84, 0x14, 0x68, 0x8e, 0xbf, 0x94, +0xda, 0xe3, 0xc0, 0x70, 0x56, 0x69, 0x3a, 0x65, +0x58, 0xae, 0x9d, 0xcd, 0x00, 0x45, 0x20, 0xf2, +0x59, 0xb0, 0x6c, 0x76, 0x16, 0xa2, 0x22, 0xde, +0xfc, 0x06, 0xe0, 0xf4, 0x52, 0x8d, 0x93, 0xe1, +0xd4, 0x92, 0x0c, 0x05, 0xf9, 0xfb, 0x52, 0xfb, +0xa8, 0xcf, 0xb1, 0x86, 0xdc, 0xe8, 0x07, 0x95, +0xfa, 0x1c, 0x38, 0xb9, 0xd0, 0x7a, 0x65, 0xe0, +0x36, 0xe1, 0x2f, 0xa8, 0x3a, 0xbf, 0xc7, 0xb7, +0x3e, 0xc4, 0xd5, 0x48, 0xfb, 0x6d, 0x40, 0xa2, +0xb5, 0xe2, 0xe7, 0x3a, 0x42, 0x7c, 0x1c, 0xc5, +0x36, 0xbc, 0x29, 0xca, 0x78, 0xf9, 0x36, 0xba, +0xf4, 0xb6, 0x8e, 0xe7, 0x74, 0xc7, 0xc9, 0x8a, +0x74, 0x2d, 0xfc, 0x66, 0x8d, 0x31, 0x62, 0x15, +0x59, 0x00, 0xbb, 0x53, 0xd3, 0x4b, 0xad, 0x8a, +0x97, 0x00, 0xf7, 0x90, 0xdd, 0x7a, 0xf2, 0xde, +0x02, 0x82, 0x75, 0xe8, 0xae, 0x82, 0x18, 0x14, +0xc2, 0xc3, 0x03, 0x27, 0x93, 0x0f, 0x2b, 0xc6, +0xb1, 0xd0, 0x8b, 0xae, 0x28, 0xbb, 0x3f, 0xb5, +0x47, 0x42, 0xc6, 0x73, 0x3a, 0xb2, 0xd8, 0x8f, +0x21, 0xde, 0x10, 0xb4, 0x5a, 0x8b, 0x54, 0x3d, +0x24, 0xc7, 0x8b, 0xbf, 0x0d, 0xc5, 0x81, 0x52, +0x1d, 0x21, 0x09, 0x61, 0xcc, 0x88, 0x2a, 0x6d, +0xe5, 0x45, 0xc7, 0x17, 0x94, 0x27, 0x18, 0x9b, +0x04, 0xea, 0xa5, 0x9b, 0x97, 0x79, 0xf9, 0x61, +0xe3, 0xc4, 0x5e, 0x31, 0x50, 0x06, 0x02, 0x43, +0x7c, 0x85, 0xf6, 0x4c, 0xc5, 0x10, 0x6d, 0x0f, +0xb3, 0x5e, 0x97, 0x01, 0x9f, 0x77, 0x5d, 0xcc, +0x68, 0x49, 0xae, 0xaa, 0x52, 0xcc, 0x6d, 0x81, +0xa9, 0x90, 0x81, 0x10, 0x09, 0x3f, 0xdd, 0x5c, +0x61, 0xcc, 0xc3, 0xc0, 0xc8, 0xc4, 0x5c, 0x0a, +0xb0, 0x63, 0x5b, 0xb0, 0xf4, 0xa1, 0x64, 0x4e, +0xd6, 0xc6, 0x81, 0xb2, 0x75, 0xc2, 0x7d, 0xaa, +0x01, 0xae, 0xe0, 0xf0, 0x4e, 0x62, 0x40, 0xb4, +0x13, 0xf1, 0xa7, 0x66, 0xef, 0xd4, 0xf1, 0xf1, +0xa9, 0x60, 0xce, 0x18, 0x6c, 0xb3, 0x36, 0xa6, +0x12, 0xed, 0xb6, 0x20, 0xca, 0x0b, 0x84, 0xde, +0xbc, 0xcb, 0x3c, 0x38, 0x6d, 0x03, 0xc8, 0xd0, +0xe1, 0x25, 0xc0, 0x49, 0x1d, 0x11, 0x7b, 0x41, +0x2a, 0x5d, 0x07, 0x74, 0x7d, 0x52, 0x5a, 0x53, +0xf6, 0xa7, 0xd7, 0xc0, 0xaa, 0x72, 0x4c, 0xcc, +0x62, 0x6b, 0x5e, 0xf6, 0x1d, 0xd1, 0xb9, 0x93, +0x01, 0x77, 0x0d, 0xa9, 0x48, 0xfb, 0x32, 0x30, +0x4c, 0x35, 0x74, 0x0d, 0x62, 0xfe, 0xea, 0xe6, +0x17, 0x76, 0x80, 0x55, 0x8f, 0xcd, 0x16, 0xe6, +0x0f, 0xaa, 0xf8, 0xc0, 0x6a, 0x8b, 0xe8, 0xa8, +0x21, 0x89, 0x58, 0xda, 0x4c, 0xcb, 0x70, 0x50, +0x6d, 0x3f, 0x5e, 0x4e, 0xcf, 0x7c, 0x0a, 0x04, +0xf9, 0x79, 0x77, 0xd3, 0x54, 0xaa, 0x92, 0xbe, +0x49, 0x1a, 0x23, 0x60, 0x1e, 0x4c, 0x06, 0xa4, +0xbb, 0x3d, 0xd1, 0x7c, 0xcd, 0xf3, 0xf6, 0x61, +0x4a, 0xee, 0x2b, 0x44, 0x77, 0x93, 0xe4, 0xe8, +0x5c, 0x80, 0x43, 0x09, 0x22, 0x95, 0x27, 0x60, +0xb2, 0x45, 0xf6, 0xfc, 0x2f, 0xd2, 0xf5, 0xfa, +0x0b, 0xdd, 0x00, 0x09, 0xb0, 0x63, 0xf4, 0x27, +0x23, 0x51, 0x88, 0x6e, 0x4b, 0x59, 0x20, 0x18, +0x97, 0x3e, 0xc8, 0xd1, 0x3f, 0x8a, 0xd1, 0xb5, +0xa4, 0xc5, 0x23, 0xcf, 0x08, 0xe9, 0x28, 0xf0, +0xfc, 0xff, 0x89, 0xcb, 0x8e, 0xc7, 0xcf, 0xf5, +0x8e, 0x82, 0x4e, 0xc3, 0x61, 0xf6, 0x20, 0x25, +0x9d, 0xd5, 0xd6, 0x19, 0xc9, 0x55, 0x88, 0x64, +0xd2, 0x97, 0xcd, 0x6c, 0x73, 0x53, 0x44, 0xa2, +0x44, 0xc4, 0x65, 0x16, 0x8e, 0x33, 0xbe, 0x85, +0x70, 0xcc, 0xc0, 0xac, 0x8a, 0xba, 0x4e, 0xa3, +0x7f, 0x1c, 0x6a, 0x0f, 0x7d, 0x9a, 0xad, 0x50, +0x45, 0xd7, 0x7e, 0x63, 0xc0, 0xfe, 0xb9, 0xaa, +0x91, 0x89, 0x85, 0x35, 0x52, 0x0b, 0x9b, 0xae, +0x62, 0xe5, 0x1e, 0x9d, 0x67, 0x39, 0xdc, 0x03, +0x27, 0x5b, 0x77, 0xdf, 0x80, 0x0f, 0xcc, 0x30, +0x12, 0x49, 0x0c, 0xb3, 0xed, 0x27, 0x87, 0x9e, +0x16, 0x80, 0x8c, 0x27, 0xd7, 0xfd, 0x3b, 0x78, +0xd7, 0x55, 0x32, 0x18, 0x19, 0xa8, 0x7b, 0x15, +0x45, 0x34, 0xf4, 0x94, 0x85, 0x0a, 0x48, 0x79, +0x62, 0x1c, 0x5a, 0x7a, 0x0e, 0x2d, 0xa8, 0xdf, +0x10, 0x5a, 0x13, 0xa6, 0x24, 0xdc, 0xf8, 0x0c, +0xe6, 0x1d, 0xef, 0x84, 0x6e, 0x2a, 0xc7, 0xe5, +0xcf, 0xb1, 0xd1, 0x7a, 0x22, 0x50, 0xcd, 0x6d, +0x83, 0xb0, 0x09, 0x95, 0x4a, 0x97, 0x43, 0x42, +0x49, 0xf0, 0xcf, 0x11, 0xb7, 0x85, 0x2f, 0x74, +0x57, 0x3a, 0xb8, 0xfc, 0x06, 0xe5, 0x5d, 0x82, +0x5b, 0xb9, 0x85, 0x82, 0xdf, 0xc7, 0xd1, 0x60, +0xc2, 0x21, 0x6f, 0x92, 0x70, 0xa4, 0xe2, 0x56, +0x54, 0xbd, 0x08, 0x6e, 0x3a, 0x3c, 0xa9, 0x9b, +0xd6, 0xac, 0xd6, 0x90, 0x1d, 0xa2, 0x3d, 0x61, +0x67, 0xc6, 0x09, 0x25, 0x3c, 0x81, 0x3a, 0xcf, +0x40, 0x99, 0x42, 0x37, 0xe1, 0x51, 0xd7, 0x35, +0xb1, 0x16, 0x42, 0x3b, 0x74, 0xf5, 0x45, 0x72, +0xa7, 0xbb, 0xe7, 0xf7, 0xce, 0x98, 0xbe, 0x12, +0xdc, 0xe1, 0x7e, 0x9b, 0x36, 0xb4, 0xd3, 0xc7, +0xa5, 0xd4, 0xf5, 0x10, 0xea, 0x53, 0x77, 0x77, +0x1a, 0x8d, 0x42, 0x53, 0x00, 0x62, 0x75, 0x7c, +0xc9, 0x7d, 0xa6, 0x63, 0xfe, 0xb1, 0xa0, 0xb8, +0x1d, 0x80, 0x4c, 0x91, 0x8d, 0xac, 0x0d, 0x0b, +0x27, 0x3f, 0x86, 0xf0, 0x27, 0xee, 0x75, 0xfb, +0x79, 0x88, 0x93, 0x70, 0x93, 0xbf, 0xc8, 0x67, +0x8e, 0xe7, 0x91, 0xe7, 0x86, 0x0a, 0x96, 0xfa, +0x2e, 0x44, 0x96, 0x55, 0x10, 0xa9, 0x78, 0x02, +0x3e, 0xfa, 0xdf, 0x9e, 0x15, 0xd9, 0xd9, 0xd0, +0x42, 0x13, 0x99, 0x7d, 0x17, 0x27, 0xae, 0xbf, +0x2a, 0x49, 0xa8, 0x0c, 0xa1, 0x55, 0x74, 0x09, +0x20, 0x46, 0x71, 0xb8, 0xc7, 0xb3, 0xb3, 0xbe, +0xf3, 0x11, 0xac, 0x9b, 0x54, 0xd7, 0xa9, 0x4d, +0x5a, 0x5f, 0x85, 0x28, 0x99, 0x64, 0x93, 0xbe, +0xc0, 0xe6, 0x8a, 0x25, 0x25, 0xeb, 0x49, 0xa3, +0x4e, 0xf0, 0x6e, 0x5f, 0x29, 0xf9, 0x4f, 0xe2, +0x51, 0xf5, 0xbd, 0x30, 0xeb, 0x31, 0x00, 0x91, +0x25, 0xa1, 0xb1, 0x5d, 0xd5, 0x9a, 0xee, 0x8c, +0x56, 0xaf, 0x24, 0x58, 0x19, 0x8b, 0x8e, 0x49, +0x16, 0x85, 0xda, 0xfd, 0x72, 0xbf, 0x0b, 0x96, +0x71, 0xb2, 0xc1, 0x18, 0xb3, 0xb3, 0xc5, 0xfc, +0x41, 0x45, 0xa8, 0x28, 0x75, 0xc7, 0xe7, 0xa7, +0xef, 0x3c, 0x91, 0xe2, 0x10, 0x0b, 0x6a, 0x4e, +0x79, 0x1b, 0x8c, 0xa8, 0x43, 0x6a, 0x0d, 0x42, +0xe6, 0x7e, 0x4f, 0xc5, 0x4e, 0x1e, 0x3c, 0x17, +0x35, 0xf1, 0x8f, 0xa6, 0xa1, 0x0c, 0x6e, 0x60, +0xb9, 0x98, 0xe3, 0xc0, 0x95, 0x26, 0xcd, 0xc9, +0x8c, 0x74, 0x48, 0x75, 0x85, 0xfb, 0x03, 0xec, +0x60, 0x97, 0xac, 0x62, 0xc6, 0x1f, 0xd4, 0x7f, +0xe1, 0x2f, 0xe7, 0xf9, 0x48, 0x5c, 0x01, 0xe0, +0x04, 0x91, 0x65, 0x71, 0x9b, 0x22, 0x5c, 0xf0, +0x5e, 0xc4, 0xe9, 0x64, 0xc9, 0x94, 0x8a, 0x08, +0x39, 0x6b, 0x9b, 0x1f, 0x73, 0x4a, 0xd6, 0x79, +0xeb, 0x02, 0x37, 0x9f, 0x1a, 0x01, 0x4a, 0xce, +0x30, 0x22, 0x31, 0x33, 0x2f, 0x40, 0xca, 0x6b, +0xd9, 0xf0, 0x4f, 0xc6, 0xf6, 0x5c, 0xbe, 0x42, +0x28, 0xd6, 0xfc, 0xcf, 0x47, 0x87, 0x76, 0xe0, +0xf6, 0xe8, 0x9a, 0xe5, 0xbb, 0x49, 0x0d, 0x32, +0x3d, 0xf1, 0x54, 0x87, 0x6b, 0xd5, 0x68, 0x69, +0xb0, 0x10, 0xa2, 0x77, 0xce, 0xd7, 0x52, 0x09, +0x40, 0xdd, 0xbe, 0xc0, 0x5f, 0x40, 0xa5, 0x88, +0x78, 0xbe, 0x81, 0x50, 0x05, 0x23, 0x86, 0x46, +0x16, 0x3a, 0x34, 0x72, 0xcc, 0xfe, 0x2d, 0x6c, +0xea, 0xbd, 0x2d, 0xdd, 0xf3, 0xbe, 0xde, 0x9d, +0x7b, 0xa9, 0x0c, 0x69, 0xae, 0xc3, 0x22, 0xb7, +0xe1, 0xa1, 0xf9, 0x9b, 0x48, 0x01, 0xbc, 0xb2, +0xe7, 0x48, 0xd9, 0xbc, 0x6f, 0x1e, 0xbb, 0x8b, +0xe6, 0x41, 0x2b, 0xf4, 0xc4, 0xbd, 0x9e, 0xab, +0x08, 0x1c, 0xdc, 0x45, 0x16, 0x1f, 0xa3, 0x5c, +0x14, 0xd5, 0x50, 0xad, 0x43, 0x4a, 0x9a, 0xcc, +0x7d, 0x2b, 0xf1, 0x4f, 0x1f, 0x73, 0x22, 0x6f, +0xa0, 0x81, 0x4c, 0xaa, 0x92, 0xb2, 0x29, 0xed, +0x07, 0x52, 0xaa, 0x67, 0xc5, 0x7b, 0x2f, 0x8d, +0x3d, 0xc0, 0x86, 0x2d, 0x53, 0xab, 0x4a, 0xb2, +0x3d, 0x31, 0x2b, 0xc6, 0x21, 0x38, 0x65, 0x64, +0x92, 0x67, 0xbf, 0x0b, 0xb8, 0xa8, 0xe8, 0x63, +0x64, 0x00, 0xcd, 0xa5, 0xfe, 0x05, 0x98, 0xc5, +0x22, 0x1f, 0x25, 0x30, 0x44, 0xb8, 0x34, 0x12, +0x59, 0x5a, 0xd4, 0xc1, 0x22, 0x39, 0xf8, 0x37, +0x52, 0xc9, 0x92, 0xae, 0x84, 0xef, 0x84, 0xb4, +0x7b, 0x98, 0x1b, 0x19, 0x8e, 0x0f, 0x0d, 0xda, +0xec, 0xf9, 0xef, 0x0a, 0xc0, 0xb7, 0x86, 0xeb, +0xc3, 0x85, 0xe0, 0x46, 0xbd, 0xc7, 0xdd, 0x3f, +0xd8, 0x38, 0xa9, 0x30, 0x9b, 0x67, 0xde, 0xb3, +0x25, 0x65, 0xf3, 0xf6, 0x7e, 0xb6, 0x02, 0x0e, +0xbc, 0xe1, 0x23, 0xc1, 0x24, 0x08, 0x22, 0x4b, +0x5e, 0x60, 0x7b, 0xb7, 0xf0, 0x3d, 0x75, 0x50, +0xf7, 0x5f, 0xf2, 0xba, 0x79, 0x43, 0xc3, 0x5f, +0xdb, 0x2f, 0x0c, 0xb9, 0xfd, 0x30, 0x82, 0x8a, +0x72, 0x3f, 0x3c, 0xd4, 0x54, 0xe7, 0xe9, 0xf4, +0x86, 0x3d, 0x02, 0x18, 0xf6, 0x3f, 0x18, 0x8a, +0xf8, 0x8c, 0xb7, 0x7a, 0x08, 0x1d, 0x26, 0x25, +0x5f, 0x85, 0x01, 0xe3, 0x85, 0x33, 0x5d, 0x52, +0xcd, 0x13, 0x22, 0xdd, 0x66, 0x46, 0xee, 0x95, +0xea, 0xea, 0x65, 0x8f, 0xdc, 0x68, 0x14, 0x80, +0x90, 0xa4, 0x3d, 0x32, 0x63, 0xfa, 0x42, 0xcd, +0x3b, 0xb0, 0x21, 0xa9, 0x2d, 0x95, 0xda, 0x43, +0x51, 0xa5, 0x84, 0x3b, 0xb7, 0x72, 0x06, 0xd7, +0xd8, 0xbe, 0xe1, 0xb5, 0xa5, 0xbb, 0x16, 0xee, +0xd3, 0x8f, 0xe1, 0xa8, 0x24, 0xde, 0x5f, 0x2a, +0x91, 0x9a, 0x42, 0xe7, 0x5a, 0xd2, 0x2e, 0x97, +0xe2, 0x07, 0xb6, 0x58, 0x8e, 0xb8, 0x8c, 0xf1, +0xbf, 0x1e, 0xc6, 0x3c, 0x48, 0x5f, 0x29, 0x18, +0x00, 0xdc, 0xee, 0xe9, 0xc3, 0x59, 0x15, 0x1e, +0x87, 0xeb, 0xb2, 0xea, 0x08, 0x93, 0xe3, 0x0a, +0x93, 0xe5 }; + +static char pkt10[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt11[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt12[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt13[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, +0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt14[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt15[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; + +static char pkt16[] = { +0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, +0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; +#endif + +TAHI_TEST_SEQ tahi_ipsec_udp_005[] = { + {TITLE, "IPSEC-UDP-005", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, + {ASSEMBLE, &pkt7[0], sizeof(pkt7), 3, 0, 0, 0, 0}, + {AD_CHECK, &pkt8[0], sizeof(pkt8), 5, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_005_size = sizeof(tahi_ipsec_udp_005) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_006.c b/test/regression/tahi_test/tahi_ipsec_udp_006.c new file mode 100644 index 00000000..47ee451f --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_006.c @@ -0,0 +1,180 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt0[] = { +0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, +0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, +0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, +0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, +0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; + +static char pkt3[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt4[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, +0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xae, 0xa2, +0x6e, 0x32, 0xe2, 0x9d, 0x35, 0x7a, 0xcd, 0xbb, +0x07, 0xba, 0xa0, 0xb0, 0x5d, 0xfd, 0x09, 0xce, +0xce, 0x57, 0xac, 0x4f, 0xfa, 0x22, 0xb1, 0x3f, +0x54, 0x43, 0x45, 0xd3, 0xa9, 0x96, 0x9a, 0xde, +0x15, 0x06, 0x9a, 0x2e, 0xc4, 0x4c, 0xc8, 0x69, +0x14, 0x3c }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x24, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x96, +0xac, 0x2e, 0xb1, 0xb3, 0xdc, 0x8c, 0xfd, 0x67, +0xc6, 0xca, 0xcf, 0xcd, 0x5a, 0x0b, 0xfe, 0x0e, +0x0e, 0x7c }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x0c, 0x4e, +0x1f, 0x6e, 0xae, 0xd5, 0xff, 0xa7, 0x6a, 0x83, +0xda, 0x78 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0xf6, +0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xad, 0x1e, +0x61, 0xe3, 0x78, 0x5a, 0x39, 0xc6, 0xb9, 0x02, +0x9a, 0x45, 0x32, 0xc8, 0xe2, 0x5f, 0xab, 0x47, +0xe7, 0x43, 0xbb, 0xc6, 0x9d, 0xb2, 0x97, 0x5c, +0xe4, 0xcb, 0x7b, 0xbf, 0x65, 0x12, 0x13, 0xcf, +0xc0, 0x02, 0x1e, 0x35, 0x9d, 0x5f, 0x73, 0x20, +0xf1, 0x87 }; + +#if 0 +static char pkt8[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_006[] = { + {TITLE, "IPSEC-UDP-006", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt0[0], sizeof(pkt0), 0, 0, 0, 0, 0}, /* Add a RA packet.*/ + {WAIT, NX_NULL, 0, 10, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, + {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + + {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt7[0], sizeof(pkt7), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_006_size = sizeof(tahi_ipsec_udp_006) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_007.c b/test/regression/tahi_test/tahi_ipsec_udp_007.c new file mode 100644 index 00000000..d7890ea8 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_007.c @@ -0,0 +1,135 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x5b, +0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0xc8, 0xc5, +0x80, 0x58, 0xa2, 0x96, 0xa5, 0xe3, 0x66, 0x3d, +0xca, 0xcf, 0xea, 0xac, 0x15, 0x46, 0x7e, 0x29, +0x12, 0x6f, 0x2b, 0x99, 0xa3, 0x5e, 0x79, 0x1e, +0xa1, 0xd9, 0x34, 0x3b, 0x7d, 0x5b, 0xd7, 0x61, +0x6b, 0xe2, 0xb1, 0xb5, 0xaa, 0x80, 0xf5, 0xa7, +0x44, 0x80 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xb7, 0x6e, +0xae, 0xf1, 0xe4, 0xb0, 0x56, 0xd6, 0x3a, 0x9e, +0x0b, 0xb4, 0xd2, 0x0b, 0xe0, 0x1f, 0x54, 0x9d, +0x15, 0x82, 0x22, 0xa1, 0xe7, 0xa8, 0x0d, 0x5e, +0x9d, 0x9a }; + +static char pkt6[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x0c, 0x4e, +0x1f, 0x6e, 0xae, 0xd5, 0xff, 0xa7, 0x6a, 0x83, +0xda, 0x78 }; + +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x7f, +0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0x61, 0x10, +0x51, 0x54, 0x2f, 0xdb, 0xdb, 0x75, 0xed, 0xb4, +0xde, 0xda, 0xe4, 0xce, 0x9f, 0xf0, 0x33, 0x12, +0xbd, 0x90, 0xea, 0xff, 0xfd, 0xf4, 0x43, 0x98, +0x96, 0x50, 0x4e, 0x9c, 0xec, 0x2b, 0x3d, 0xfc, +0xc7, 0xb9, 0x3a, 0x50, 0xc5, 0x27, 0x70, 0x80, +0x23, 0x08 }; + +TAHI_TEST_SEQ tahi_ipsec_udp_007[] = { + {TITLE, "IPSEC-UDP-007", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt7[0], sizeof(pkt7), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_007_size = sizeof(tahi_ipsec_udp_007) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_008.c b/test/regression/tahi_test/tahi_ipsec_udp_008.c new file mode 100644 index 00000000..426edf6d --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_008.c @@ -0,0 +1,139 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0x68, 0x48, +0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0x35, 0xc6, +0xea, 0x63, 0x2c, 0x9b, 0x34, 0x06, 0xe1, 0x59, +0x18, 0xf1, 0x13, 0x15, 0x01, 0x10, 0x7d, 0x29, +0xec, 0x5f, 0x78, 0x81, 0x35, 0x21, 0x14, 0x49, +0x25, 0x1c, 0x95, 0x92, 0xc6, 0x5c, 0x93, 0xac, +0xe6, 0x77, 0x54, 0x89, 0x47, 0xea, 0x72, 0x2c, +0xe4, 0x39 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x27, 0x10, +0x00, 0x07, 0x00, 0x16, 0x6c, 0x95, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, +0x27, 0x10, 0x00, 0x16, 0x6c, 0x95, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +#if 0 +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_008[] = { + {TITLE, "IPSEC-UDP-008", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA first. */ + {CHECK, &pkt6[0], sizeof(pkt6), 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_008_size = sizeof(tahi_ipsec_udp_008) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_009.c b/test/regression/tahi_test/tahi_ipsec_udp_009.c new file mode 100644 index 00000000..c0d60519 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_009.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xb7, +0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0x4a, 0xdf, +0xa2, 0xe5, 0x8c, 0xe9, 0x3d, 0xe5, 0xed, 0xb6, +0x47, 0x2a, 0x4d, 0x19, 0x25, 0xf4, 0x84, 0x05, +0x37, 0xbf, 0xdd, 0x99, 0xd0, 0xc1, 0x1a, 0x27, +0x32, 0xbe, 0x52, 0x9f, 0xc7, 0xef, 0x52, 0x9c, +0xda, 0x65, 0x00, 0x29, 0x37, 0x8c, 0x28, 0xd0, +0xe4, 0x58 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_009[] = { + {TITLE, "IPSEC-UDP-009", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_009_size = sizeof(tahi_ipsec_udp_009) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_009_02.c b/test/regression/tahi_test/tahi_ipsec_udp_009_02.c new file mode 100644 index 00000000..94f81ca4 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_009_02.c @@ -0,0 +1,32 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x27, 0x10, +0x00, 0x07, 0x00, 0x16, 0x6c, 0x95, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_009_02[] = { + {TITLE, "IPSEC-UDP-009-02", 16, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_009_02_size = sizeof(tahi_ipsec_udp_009_02) / sizeof(TAHI_TEST_SEQ); + +#endif \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_ipsec_udp_010.c b/test/regression/tahi_test/tahi_ipsec_udp_010.c new file mode 100644 index 00000000..06c7b0a8 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_010.c @@ -0,0 +1,148 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +0x1e, 0xa8, 0xa2, 0xda, 0x5b, 0x09, 0x5d, 0x65, +0x4b, 0xe8, 0x7e, 0x24, 0xc9, 0x6d, 0x2a, 0x7b, +0xe5, 0xa2, 0xe6, 0x23, 0x77, 0xad, 0xd1, 0xda, +0xe9, 0xe9, 0x76, 0xdf, 0x7f, 0x4c, 0x1d, 0x36, +0x95, 0xb2 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2b, 0xa5, +0xa3, 0x70, 0xf1, 0xba, 0xe4, 0x28, 0x8c, 0x86, +0x2a, 0x1b, 0x7a, 0xa0, 0x10, 0xdf, 0xd4, 0x91, +0x08, 0xa4, 0x67, 0x23, 0xb6, 0x63, 0xc3, 0x31, +0xa7, 0x1f, 0x30, 0x82, 0xf6, 0xe5, 0xf7, 0x8c, +0x22, 0xad, 0x3b, 0xff, 0x36, 0xc8, 0x3a, 0x12, +0xc8, 0xd5 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x01, 0x2c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +0x1e, 0xa8, 0xa2, 0xda, 0x5b, 0x09, 0x5d, 0x65, +0x4b, 0xe8, 0x7e, 0x24, 0xc9, 0x6d, 0x53, 0xb5, +0x2e, 0xdb, 0x11, 0x85, 0xb3, 0x4a, 0x30, 0xfa, +0x7e, 0x7f, 0x68, 0x4d, 0xa5, 0xe5, 0x3d, 0xe7, +0xaf, 0x1f, 0x9c, 0x8f, 0x14, 0x2a, 0xd2, 0x47, +0xee, 0x7f, 0xca, 0xf0, 0x9c, 0xe4, 0x40, 0x3c, +0xae, 0x44, 0x8c, 0x0d, 0xf1, 0x4e, 0xbd, 0x6b, +0xa7, 0x33, 0x62, 0x69, 0xb6, 0xbf, 0xf2, 0xc1, +0xed, 0xac, 0x38, 0xb0, 0x91, 0x0e, 0xee, 0x12, +0xc8, 0x60, 0x8f, 0x00, 0x4d, 0x66, 0xbb, 0xe4, +0x4c, 0x5d, 0x8c, 0x0b, 0xc3, 0x51, 0x4a, 0x37, +0x30, 0xab, 0xe1, 0x1d, 0x06, 0x30, 0x50, 0xff, +0x98, 0x91, 0xd5, 0xe4, 0x7b, 0x2e, 0xac, 0xd0, +0x65, 0xfa, 0xcb, 0xee, 0xc1, 0x78, 0x46, 0xf2, +0x23, 0xf2, 0x58, 0x72, 0x00, 0xe2, 0x6b, 0xc9, +0xad, 0x67, 0x85, 0x4b, 0x07, 0x21, 0x4b, 0xf1, +0x33, 0xb5, 0x89, 0x5c, 0x44, 0x8c, 0xf0, 0x65, +0x6b, 0xc2, 0x7b, 0xe8, 0xc6, 0x8a, 0xa0, 0x36, +0xd1, 0x46, 0x00, 0xae, 0xa6, 0x24, 0x78, 0xa2, +0xea, 0x2f, 0x4d, 0xbb, 0xaa, 0x76, 0x56, 0x4f, +0x38, 0x6e, 0x95, 0xa6, 0xae, 0x97, 0xe7, 0x8b, +0xcc, 0x78, 0x03, 0x41, 0x09, 0x1a, 0x43, 0x12, +0xf7, 0xaa, 0xfd, 0x2b, 0x20, 0xa9, 0x5e, 0x02, +0x9d, 0xc7, 0xd2, 0xc4, 0x71, 0x49, 0x95, 0x48, +0x04, 0xf4, 0x02, 0x44, 0x86, 0xe0, 0xe5, 0xd7, +0x1c, 0x51, 0x68, 0x0d, 0x55, 0xab, 0x81, 0xcf, +0x55, 0x41, 0xb1, 0x2e, 0x09, 0x28, 0xf9, 0x89, +0x6b, 0x44, 0xf7, 0x89, 0x65, 0x63, 0x93, 0x7b, +0xd2, 0xee, 0x84, 0xcd, 0xee, 0x9f, 0x11, 0xe5, +0xa8, 0x21, 0x56, 0xf2, 0xf1, 0x69, 0xf4, 0xfa, +0x37, 0xc9, 0x95, 0x27, 0xcf, 0x47, 0x12, 0xb4, +0xda, 0x3f, 0x7e, 0xdd, 0xaf, 0x04, 0xb2, 0xb3, +0x3d, 0x7c, 0x05, 0xe2, 0x6c, 0x52, 0xf2, 0xf2, +0x92, 0x39, 0x92, 0x0f, 0x54, 0x10, 0x63, 0x4d, +0xea, 0x35, 0x07, 0x94, 0x4d, 0x32, 0xbd, 0x21, +0xb1, 0x27 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, +0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0xf5, 0xa3, +0xf7, 0xb6, 0xef, 0x50, 0x8d, 0xde, 0xfa, 0x51, +0xb3, 0xf6, 0x36, 0x2d, 0x9e, 0xf6, 0xd5, 0x96, +0x1a, 0x9a, 0xd8, 0x35, 0xd4, 0x87, 0x05, 0x28, +0xa8, 0x90, 0x01, 0x92, 0x23, 0xeb, 0xa1, 0x2e, +0x72, 0x6d }; + +TAHI_TEST_SEQ tahi_ipsec_udp_010[] = { + {TITLE, "IPSEC-UDP-010", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_010_size = sizeof(tahi_ipsec_udp_010) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_011.c b/test/regression/tahi_test/tahi_ipsec_udp_011.c new file mode 100644 index 00000000..c163c1fe --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_011.c @@ -0,0 +1,83 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x86, 0x9b, +0x37, 0xbd, 0xb8, 0x0e, 0x84, 0xed, 0x35, 0x21, +0x00, 0x71, 0xc8, 0x9b, 0xbc, 0xed, 0x88, 0x36, +0x5f, 0x47, 0x7f, 0x71, 0xcf, 0xdc, 0x81, 0x47, +0xcf, 0xd0, 0x74, 0xbe, 0x55, 0x19, 0x1a, 0x90, +0xf2, 0xd6, 0x58, 0x9d, 0x93, 0xab, 0x34, 0x89, +0xf3, 0x79 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7a, 0x2f, +0x2d, 0x74, 0x96, 0x07, 0x1f, 0x0d, 0x24, 0xef, +0x93, 0x6a, 0x7f, 0xef, 0x95, 0xec, 0x8a, 0xbf, +0xc7, 0x69, 0x93, 0xfb, 0xa8, 0x90, 0xa3, 0xf2, +0xae, 0x44, 0x77, 0xc4, 0x33, 0x21, 0x0b, 0xb7, +0x06, 0x12, 0x10, 0x10, 0x48, 0xb3, 0x9c, 0x8a, +0xb6, 0x26, 0x0d, 0xc5, 0x54, 0x72, 0x28, 0x39, +0x50, 0x1f }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_011[] = { + {TITLE, "IPSEC-UDP-011", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_011_size = sizeof(tahi_ipsec_udp_011) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_012.c b/test/regression/tahi_test/tahi_ipsec_udp_012.c new file mode 100644 index 00000000..8a8758ba --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_012.c @@ -0,0 +1,101 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x09, 0x5e, +0x03, 0x76, 0x2c, 0x70, 0xf7, 0x40, 0x83, 0x1f, +0x0d, 0xfd, 0x14, 0xa0, 0x0e, 0x50, 0x3d, 0x24, +0x18, 0x87, 0x7e, 0xdd, 0xc5, 0x20, 0x45, 0x86, +0xff, 0x00, 0x47, 0xa1, 0xee, 0x28, 0x70, 0x68, +0x3d, 0xb2, 0x14, 0x4a, 0xfe, 0x05, 0xb8, 0x54, +0xab, 0x92, 0xd0, 0x41, 0x40, 0x4e, 0x73, 0x6b, +0xbc, 0x4a }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x90, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x62, 0x2a, +0x53, 0xb0, 0xbb, 0xfa, 0x2f, 0x14, 0x39, 0xd5, +0x7b, 0xe6 }; + +TAHI_TEST_SEQ tahi_ipsec_udp_012[] = { + {TITLE, "IPSEC-UDP-012", 13, 0, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_012_size = sizeof(tahi_ipsec_udp_012) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_013.c b/test/regression/tahi_test/tahi_ipsec_udp_013.c new file mode 100644 index 00000000..145a1f28 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_013.c @@ -0,0 +1,236 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +#if 0 +static char pkt1[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xf7, 0xb5, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x10, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xdd, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; + +static char pkt2[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xf7, 0xb5, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x10, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, +0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, +0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0f, 0xdd, 0x80, 0xfc, 0x0a, 0x00, +0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, +0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; + +static char pkt3[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xf7, 0xb6, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x11, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xdd, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; + +static char pkt4[] = { +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, +0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, +0x00, 0xe8, 0xf7, 0xb6, 0x00, 0x00, 0x40, 0x11, +0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, +0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, +0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x11, 0x0a, 0x00, +0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, +0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, +0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, +0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, +0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, +0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, +0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, +0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, +0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, +0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, +0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, +0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, +0x45, 0x00, 0x0c, 0xdd, 0x80, 0xfc, 0x0a, 0x00, +0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, +0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, +0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; +#endif + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0xa5, 0x2c, +0xa7, 0x6f, 0x57, 0x41, 0xa8, 0x2a, 0xe0, 0xfe, +0xc5, 0x18, 0x6f, 0x7a, 0x22, 0xe9, 0x5b, 0x04, +0x2c, 0xd1, 0x7a, 0xa2, 0x96, 0x28, 0x6d, 0x6f, +0xe8, 0x3f, 0x88, 0x91, 0xe3, 0xee, 0x9c, 0x6b, +0xc9, 0x76, 0x91, 0x79, 0x84, 0xab, 0xe7, 0x7a, +0xc3, 0xac, 0x44, 0xd7, 0x2f, 0xa6, 0x45, 0xeb, +0xff, 0x8d }; + +#if 0 +static char pkt7[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt8[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt9[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0xaa, 0xaa, +0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, +0xaa, 0xaa, 0xaa, 0xaa, 0x9b, 0xf4, 0x52, 0x80, +0xaa, 0x15, 0x46, 0x2d, 0xd5, 0x7b, 0x9f, 0xc6, +0x3f, 0x5a }; + +TAHI_TEST_SEQ tahi_ipsec_udp_013[] = { + {TITLE, "IPSEC-UDP-013", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt9[0], sizeof(pkt9), 0, 0, 0, 0, 0}, + {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_013_size = sizeof(tahi_ipsec_udp_013) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_014.c b/test/regression/tahi_test/tahi_ipsec_udp_014.c new file mode 100644 index 00000000..9342d79c --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_014.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, +0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, +0x1e, 0x3c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, 0xdf, +0xa0, 0x58, 0x64, 0x03, 0x4a, 0x47, 0x20, 0xcd, +0xe6, 0x14, 0x8d, 0x71, 0x7f, 0x8e, 0xc5, 0xc6, +0x5f, 0x6f, 0x6d, 0x9a, 0x53, 0x52, 0x62, 0xb8, +0x95, 0x51, 0xea, 0x30, 0x92, 0x0f, 0x09, 0xb7, +0x42, 0x61, 0xa3, 0x99, 0xca, 0x1d, 0xd9, 0x5f, +0x90, 0x52, 0x58, 0x02, 0xf8, 0xd7, 0xe5, 0x08, +0x6b, 0x4c }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_014[] = { + {TITLE, "IPSEC-UDP-014", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_014_size = sizeof(tahi_ipsec_udp_014) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_015.c b/test/regression/tahi_test/tahi_ipsec_udp_015.c new file mode 100644 index 00000000..ebcb3ba2 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_015.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x54, 0x77, +0x54, 0x40, 0x58, 0xf4, 0xf0, 0x01, 0x84, 0xf9, +0x59, 0x45 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc4, 0x3c, +0x53, 0x2e, 0xaf, 0x5f, 0x18, 0x04, 0xc4, 0x83, +0xe2, 0xcb, 0xf5, 0x58, 0x2d, 0xee, 0x2a, 0x38, +0x72, 0x0d, 0x5a, 0xd1, 0x7c, 0xc4, 0x86, 0x21, +0xb7, 0x48, 0x32, 0xf1, 0xec, 0x62, 0x8f, 0x2d, +0xf7, 0x11, 0x84, 0x6b, 0x40, 0xe9, 0x93, 0xc8, +0xea, 0xc8, 0xa5, 0xf6, 0x5d, 0x41, 0x23, 0x95, +0x8e, 0x27 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_015[] = { + {TITLE, "IPSEC-UDP-015", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_015_size = sizeof(tahi_ipsec_udp_015) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_016.c b/test/regression/tahi_test/tahi_ipsec_udp_016.c new file mode 100644 index 00000000..e50fc9ba --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_016.c @@ -0,0 +1,78 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x28, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, +0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, +0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, +0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0xb1, +0xe3, 0x6d, 0x28, 0x86, 0xab, 0x0c, 0xfb, 0x49, +0xb8, 0x88, 0x93, 0xb8, 0xce, 0xf3, 0xfd, 0x16, +0x46, 0xc5, 0x25, 0xc0, 0x0c, 0xdd, 0x57, 0x2b, +0x3a, 0xfc, 0xce, 0xc2, 0xfe, 0x0f, 0x10, 0x97, +0x2b, 0x8e, 0x89, 0xca, 0x89, 0x57 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_016[] = { + {TITLE, "IPSEC-UDP-016", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_016_size = sizeof(tahi_ipsec_udp_016) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_017.c b/test/regression/tahi_test/tahi_ipsec_udp_017.c new file mode 100644 index 00000000..da0adca4 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_017.c @@ -0,0 +1,85 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc5, +0x52, 0x01, 0x91, 0x04, 0xd7, 0xed, 0xcb, 0xe8, +0xf9, 0xb0, 0x7d, 0x8c, 0x73, 0x29, 0x80, 0xc6, +0xde, 0x36, 0x7d, 0x38, 0xa8, 0x4a, 0x71, 0x14, +0x4e, 0x53, 0x05, 0x28, 0x3d, 0x04, 0x12, 0x05, +0x21, 0xb9, 0xb8, 0x67, 0x14, 0x54, 0x5e, 0x9d, +0x0c, 0xac }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa4, 0xbf, +0x43, 0x70, 0xe9, 0x50, 0x81, 0x39, 0x57, 0x16, +0x52, 0x37, 0xdb, 0x2f, 0x9a, 0x4d, 0x73, 0x44, +0x8e, 0xcb, 0x2a, 0x26, 0xe3, 0x06, 0xba, 0x3e, +0x88, 0xa1, 0x44, 0x91, 0x47, 0x51, 0xfc, 0xb9, +0xf4, 0x0c, 0xee, 0x17, 0x6c, 0x1a, 0xa8, 0x75, +0xa1, 0xf9, 0xe8, 0xc0, 0xd6, 0xd1, 0xf1, 0x5e, +0x90, 0xfd, 0x82, 0xf0, 0x16, 0xf6, 0xf6, 0xc8, +0x44, 0xcb }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_017[] = { + {TITLE, "IPSEC-UDP-017", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_017_size = sizeof(tahi_ipsec_udp_017) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_018.c b/test/regression/tahi_test/tahi_ipsec_udp_018.c new file mode 100644 index 00000000..857d0dd4 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_018.c @@ -0,0 +1,82 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0xbd, +0xe9, 0xc0, 0x9a, 0x05, 0xb9, 0x6b, 0x62, 0x7d, +0x3b, 0x93, 0xa1, 0x5b, 0xd7, 0x75, 0xc2, 0x4b, +0xa4, 0x99, 0x2c, 0x25, 0x54, 0x0f, 0xcd, 0x16, +0x82, 0xbc, 0xc6, 0xa3, 0x15, 0x18, 0xaf, 0x53, +0x99, 0x2e }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5e, 0x62, +0xc3, 0x76, 0x20, 0x50, 0x07, 0x55, 0x85, 0x02, +0xc1, 0x2a, 0xe1, 0xbf, 0x80, 0x79, 0x33, 0xae, +0x5c, 0x25, 0xa0, 0x7f, 0x13, 0x86, 0xf3, 0xc3, +0x8e, 0xf3, 0x9a, 0x1a, 0xb0, 0x50, 0xae, 0x12, +0x95, 0x8b, 0xb7, 0xcb, 0x6e, 0xea, 0xbb, 0xcb, +0xff, 0x88, 0xd7, 0x43, 0xe1, 0x37, 0xff, 0x36, +0x56, 0xab }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_018[] = { + {TITLE, "IPSEC-UDP-018", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_018_size = sizeof(tahi_ipsec_udp_018) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_019.c b/test/regression/tahi_test/tahi_ipsec_udp_019.c new file mode 100644 index 00000000..79cb92d6 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_019.c @@ -0,0 +1,79 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x27, 0x10, +0x00, 0x07, 0x00, 0x16, 0x6c, 0x96, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f, 0x00, 0x11, 0x6a, 0x8c, +0xb1, 0xe2, 0x72, 0xcf, 0x9e, 0x87, 0x83, 0x21, +0x16, 0xd1 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, +0x27, 0x10, 0x00, 0x16, 0x6c, 0x96, 0x50, 0x61, +0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, +0x5a, 0x65, 0x72, 0x6f, 0x01, 0x02, 0x03, 0x04, +0x04, 0x11, 0xb0, 0x95, 0xad, 0xa9, 0x97, 0x25, +0xc2, 0xa3, 0xfc, 0x85, 0x83, 0xe5 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_019[] = { + {TITLE, "IPSEC-UDP-019", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_019_size = sizeof(tahi_ipsec_udp_019) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_022.c b/test/regression/tahi_test/tahi_ipsec_udp_022.c new file mode 100644 index 00000000..94f1230a --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_022.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, +0x8d, 0x47, 0xa9, 0xe7, 0x2e, 0x0c, 0xdc, 0x2b, +0x24, 0xf7, 0x94, 0x6d, 0x3c, 0xdb, 0x64, 0x10, +0x12, 0x2c, 0x37, 0x8e, 0xdd, 0xf2, 0xa4, 0x98, +0x55, 0x0a, 0x69, 0x5b, 0xd9, 0xa5, 0x7b, 0xf1, +0x95, 0x5b, 0x7c, 0xa0, 0xad, 0xd5, 0x8e, 0x1c, +0xd3, 0x6d, 0x4b, 0xaa, 0x80, 0x58, 0x54, 0x63, +0x7d, 0xb5, 0x12, 0xba, 0xe8, 0x49, 0xa5, 0x35, +0xb3, 0x4a, 0x44, 0x7e, 0xc5, 0xb4, 0x94, 0x7c, +0x6c, 0x41, 0xf1, 0xc7, 0x8d, 0x0b, 0xd7, 0x06, +0x4f, 0xc7 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfb, 0x54, +0x9b, 0x32, 0x38, 0xc0, 0x1f, 0x38, 0xd1, 0x44, +0x1e, 0xe6, 0xdd, 0x82, 0x67, 0xbb, 0x80, 0x33, +0x1f, 0x49, 0x40, 0x4e, 0xf6, 0xac, 0x79, 0xfd, +0x38, 0x7e, 0x2e, 0xe9, 0x03, 0x27, 0x5f, 0xee, +0xe3, 0xb1, 0x81, 0x62, 0xa5, 0xa7, 0xfc, 0x05, +0x4a, 0xf9, 0xe6, 0x52, 0x5a, 0x26, 0xfd, 0x54, +0x5a, 0xfb, 0x8d, 0x5a, 0x02, 0xa6, 0x57, 0x36, +0x3d, 0xb8, 0xc3, 0x61, 0x46, 0x06, 0xe2, 0xd3, +0x4c, 0x74, 0x0e, 0xa1, 0x0f, 0xdf, 0x2c, 0xe0, +0x27, 0x7a, 0x8c, 0x3f, 0x7a, 0xc5, 0x85, 0xa7, +0xbc, 0x71, 0xc4, 0x60, 0xa7, 0x30, 0xcf, 0x9b, +0xa7, 0x0f }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_022[] = { + {TITLE, "IPSEC-UDP-022", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_022_size = sizeof(tahi_ipsec_udp_022) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_023.c b/test/regression/tahi_test/tahi_ipsec_udp_023.c new file mode 100644 index 00000000..02af7b4a --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_023.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, +0x8d, 0x47, 0xa9, 0xe7, 0x2e, 0x0c, 0x69, 0x1d, +0x4d, 0x91, 0x4f, 0x6d, 0x16, 0x16, 0xfe, 0x41, +0xd9, 0x28, 0xac, 0xd2, 0xa8, 0xdd, 0x05, 0xc6, +0xe9, 0x23, 0x61, 0x69, 0x73, 0x0d, 0x39, 0x41, +0xbd, 0x4c, 0x8d, 0x19, 0x93, 0xc6, 0xd7, 0x17, +0x2e, 0xd1, 0xbc, 0xb6, 0x33, 0x01, 0xaa, 0xdb, +0x05, 0x76, 0x1c, 0xff, 0x3c, 0x69, 0xe2, 0x78, +0xb8, 0xaf, 0x5c, 0x51, 0x2e, 0xe4, 0x61, 0x63, +0x4b, 0x39, 0x72, 0x93, 0x3c, 0x73, 0xfe, 0x02, +0x40, 0xf3 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa8, 0xd5, +0x78, 0x53, 0x4e, 0x00, 0xe5, 0x76, 0xfd, 0x12, +0x92, 0xbe, 0xac, 0xe2, 0x76, 0x7b, 0xc8, 0x75, +0x4d, 0xff, 0x78, 0x3a, 0x27, 0xc1, 0x6a, 0x8f, +0xc0, 0x53, 0x3e, 0xfb, 0xc7, 0x1b, 0x9e, 0x24, +0x53, 0xc4, 0x0c, 0x85, 0x2c, 0x48, 0x5a, 0xb7, +0x0b, 0x85, 0x7a, 0xbc, 0x8a, 0xfa, 0xa3, 0xcc, +0xc2, 0x7f, 0x06, 0x9a, 0x7a, 0x20, 0x4e, 0xdf, +0x2e, 0xc5, 0x99, 0x48, 0xe3, 0x06, 0x9f, 0x29, +0xd7, 0x0b, 0x30, 0xb3, 0xb5, 0x02, 0x0f, 0x6d, +0x70, 0x6a, 0xe8, 0x68, 0x4f, 0x17, 0x44, 0x3c, +0x6d, 0xac, 0x39, 0x73, 0x5b, 0x24, 0xa6, 0x8a, +0x3e, 0x72 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_023[] = { + {TITLE, "IPSEC-UDP-023", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_023_size = sizeof(tahi_ipsec_udp_023) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_024.c b/test/regression/tahi_test/tahi_ipsec_udp_024.c new file mode 100644 index 00000000..0be7c7d3 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_024.c @@ -0,0 +1,139 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, +0x8d, 0x47, 0xa9, 0xe7, 0x2e, 0x0c, 0x69, 0x1d, +0x4d, 0x91, 0x4f, 0x6d, 0x16, 0x16, 0xfe, 0x41, +0xd9, 0x28, 0xac, 0xd2, 0xa8, 0xdd, 0x05, 0xc6, +0xe9, 0x23, 0x61, 0x69, 0x73, 0x0d, 0x39, 0x41, +0xbd, 0x4c, 0x8d, 0x19, 0x93, 0xc6, 0xd7, 0x17, +0x2e, 0xd1, 0xbc, 0xb6, 0x33, 0x01, 0xaa, 0xdb, +0x05, 0x76, 0x1c, 0xff, 0x3c, 0x69, 0xe2, 0x78, +0xb8, 0xaf, 0x5c, 0x51, 0x2e, 0xe4, 0x61, 0x63, +0x4b, 0x39, 0x72, 0x93, 0x3c, 0x73, 0xfe, 0x02, +0x40, 0xf3 }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa6, 0x87, +0x7d, 0x79, 0x14, 0xc7, 0x56, 0x27, 0x31, 0x3c, +0xdf, 0x14, 0x08, 0xdc, 0x7f, 0x0b, 0x91, 0xb4, +0x84, 0xbb, 0x5e, 0x54, 0x97, 0x55, 0x0e, 0x2a, +0x6d, 0xd5, 0x46, 0xc7, 0x8e, 0xd9, 0x78, 0xdc, +0xd4, 0x71, 0x38, 0x8c, 0x18, 0x35, 0x39, 0x96, +0x42, 0x74, 0x5f, 0x2b, 0x11, 0xda, 0xb2, 0x89, +0x0d, 0x35, 0x3e, 0xed, 0x3a, 0xa8, 0xa7, 0xf5, +0x24, 0x95, 0xad, 0x33, 0xf3, 0x20, 0xac, 0xde, +0x77, 0xc6, 0xf4, 0x74, 0x2a, 0x7c, 0x8d, 0xcc, +0xfe, 0xe5, 0x77, 0x67, 0xe5, 0xac, 0xe2, 0x04, +0xb2, 0xd2, 0x64, 0x1c, 0x06, 0x80, 0x9c, 0x35, +0x56, 0xd4 }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x10, +0xde, 0x9d, 0xbc, 0xb7, 0x02, 0xe0, 0x20, 0x73, +0x02, 0x13, 0xd5, 0xab, 0x65, 0x10, 0x41, 0xf8, +0x2b, 0x2d, 0x7e, 0xcc, 0xc7, 0x6a, 0x8e, 0x77, +0x1b, 0xda, 0xe3, 0x97, 0x8a, 0x77, 0xc9, 0xb7, +0xc6, 0xfd, 0x53, 0xab, 0x8c, 0x10, 0x55, 0xff, +0x89, 0xc2, 0xe4, 0x10, 0x8f, 0xf4, 0x51, 0xa4, +0x0f, 0x88, 0xa0, 0xbd, 0x2f, 0x33, 0x67, 0x7e, +0x2a, 0xcd, 0xc5, 0x37, 0xe4, 0xdd, 0x40, 0x01, +0x71, 0x03, 0x58, 0xaf, 0xf8, 0x3e, 0x24, 0xb5, +0xd6, 0xf2 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x93, 0x8d, +0x59, 0x4c, 0x25, 0xd7, 0x3b, 0x64, 0x4e, 0x25, +0x38, 0x6d, 0x24, 0xff, 0xb3, 0x79, 0x20, 0xca, +0x04, 0x09, 0x25, 0xbb, 0x00, 0x7d, 0xf4, 0x92, +0x5e, 0xfb, 0xfa, 0xf3, 0x20, 0x0c, 0xb4, 0xea, +0x5d, 0x2b, 0xd9, 0x64, 0x1e, 0x59, 0x19, 0xa0, +0x8e, 0xd1, 0x73, 0x59, 0x49, 0xd2, 0x17, 0xa0, +0xca, 0x37, 0xc0, 0xe6, 0x77, 0xe1, 0x4c, 0xc8, +0x87, 0xf8, 0x44, 0xbd, 0x50, 0x3b, 0xe2, 0x09, +0xa9, 0xe8, 0x5e, 0xf5, 0x0f, 0xde, 0xd4, 0x8d, +0xe5, 0x5f, 0xbe, 0x4a, 0x94, 0x2c, 0x7d, 0x8f, +0x86, 0x49, 0xe7, 0x50, 0x73, 0xf3, 0x9c, 0x44, +0x2c, 0xb2 }; + +TAHI_TEST_SEQ tahi_ipsec_udp_024[] = { + {TITLE, "IPSEC-UDP-024", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_024_size = sizeof(tahi_ipsec_udp_024) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_025.c b/test/regression/tahi_test/tahi_ipsec_udp_025.c new file mode 100644 index 00000000..05b2f2c5 --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_025.c @@ -0,0 +1,168 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x15, +0x08, 0x1d, 0xe6, 0x03, 0xd0, 0x19, 0xfc, 0xad, +0xae, 0x67, 0x70, 0xcd, 0x9a, 0xc8, 0x37, 0xc2, +0x56, 0x6a, 0x34, 0x0a, 0x41, 0x61, 0xf4, 0x48, +0x4a, 0xd2, 0x27, 0xce, 0xac, 0x23, 0x41, 0x60, +0x51, 0x65, 0x85, 0x2a, 0x5d, 0x35, 0x49, 0x06, +0xe1, 0xf6, 0x4d, 0x08, 0x91, 0x73, 0x92, 0x75, +0xee, 0x87, 0x3b, 0x0e, 0xfc, 0x34, 0xac, 0x18, +0xf6, 0x4c, 0x1a, 0x10, 0xd4, 0x77, 0x0f, 0x99, +0x94, 0x0a, 0x56, 0x4b, 0x38, 0x35, 0x52, 0x8f, +0xf5, 0x4c }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x56, 0x94, +0x44, 0x2b, 0x24, 0x86, 0x12, 0x67, 0xf2, 0x57, +0x44, 0x2c, 0x93, 0xe3, 0xb2, 0x6e, 0x15, 0x39, +0xc1, 0xc5, 0xc9, 0x59, 0xc1, 0x1e, 0x03, 0xa3, +0x2f, 0xc5, 0x70, 0xb4, 0xe5, 0xc1, 0xc2, 0x2d, +0x1b, 0x91, 0xee, 0x87, 0x2c, 0x66, 0x6c, 0xfc, +0x27, 0x86, 0x2f, 0xde, 0x92, 0xd4, 0x25, 0x52, +0xe4, 0x09, 0x9e, 0x01, 0x9e, 0x46, 0x19, 0x29, +0xb8, 0x98, 0xc2, 0xda, 0xc8, 0xc9, 0xab, 0xcc, +0xe8, 0x14, 0x08, 0xe7, 0xd7, 0x10, 0x77, 0xa8, +0xaf, 0x2a, 0x9a, 0x55, 0x10, 0x1a, 0x9a, 0xfa, +0x5e, 0x7b }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +static char pkt5[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x01, 0x54, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x15, +0x08, 0x1d, 0xe6, 0x03, 0xd0, 0x19, 0xfc, 0xad, +0xae, 0x67, 0x70, 0xcd, 0x9a, 0xc8, 0x37, 0xc2, +0x56, 0x6a, 0x34, 0x0a, 0x41, 0x61, 0xf4, 0x48, +0x4a, 0xd2, 0x27, 0xce, 0xac, 0x23, 0x41, 0x60, +0x51, 0x65, 0x85, 0x2a, 0x5d, 0x35, 0x49, 0x06, +0xe1, 0xf6, 0x4d, 0x08, 0x91, 0x73, 0x92, 0x75, +0xee, 0x87, 0x3b, 0x0e, 0xfc, 0x34, 0x59, 0xf7, +0xf7, 0x23, 0x3d, 0xea, 0xc5, 0xe1, 0x2e, 0x84, +0xf7, 0xf4, 0x7a, 0x0a, 0x10, 0xb0, 0x21, 0x1f, +0x88, 0x74, 0x0c, 0xa3, 0x5c, 0xf4, 0x23, 0xd6, +0xd9, 0x8c, 0x4d, 0x49, 0x11, 0x0a, 0xe6, 0x63, +0x26, 0xa1, 0xd3, 0x12, 0xa9, 0x56, 0xe6, 0x6e, +0x26, 0x2e, 0x7e, 0xda, 0x8f, 0xc5, 0x46, 0x53, +0x10, 0x0e, 0x01, 0x61, 0xa2, 0x0c, 0x3f, 0x90, +0xcb, 0x77, 0xe0, 0x26, 0xb9, 0xdb, 0xc1, 0x29, +0x24, 0xc6, 0x2c, 0x39, 0xd8, 0x75, 0x44, 0xad, +0xb6, 0xb3, 0x42, 0x08, 0xf0, 0x02, 0x99, 0x01, +0x15, 0x5d, 0x27, 0x51, 0x12, 0x10, 0x4f, 0xe2, +0x94, 0x69, 0x56, 0x12, 0x9b, 0x4e, 0x7d, 0xf3, +0x93, 0x9e, 0xee, 0xdb, 0x94, 0x68, 0x0b, 0xdb, +0xaf, 0xb4, 0xc0, 0x0f, 0xad, 0x77, 0x0b, 0xf7, +0xf5, 0x2c, 0xe8, 0x3d, 0x86, 0x94, 0xa1, 0xa1, +0x85, 0x82, 0xd5, 0x79, 0x13, 0x2e, 0x08, 0x14, +0xb1, 0x08, 0x38, 0x10, 0xd0, 0x07, 0x93, 0xd8, +0x07, 0x48, 0x26, 0xde, 0x23, 0x34, 0x8d, 0x2c, +0x62, 0xd6, 0x2f, 0x50, 0x16, 0xea, 0x4d, 0x32, +0xc9, 0x9e, 0xb2, 0xf8, 0x68, 0x34, 0x41, 0xa8, +0xf0, 0xa7, 0x23, 0x22, 0xf8, 0x90, 0xe3, 0xc2, +0x50, 0x57, 0x5c, 0x03, 0x88, 0x28, 0x4d, 0x86, +0x97, 0x23, 0x71, 0x45, 0x59, 0xbc, 0xbb, 0xbf, +0x95, 0x8e, 0xb0, 0x83, 0x94, 0xee, 0xd4, 0xd1, +0xb4, 0x2f, 0x9f, 0xeb, 0x20, 0x8b, 0x67, 0xf7, +0x40, 0x10, 0x84, 0x55, 0xe3, 0xe8, 0xbc, 0x22, +0xaf, 0xd8, 0xc7, 0x73, 0xae, 0x8c, 0x16, 0x84, +0x59, 0x40, 0x94, 0x53, 0xcb, 0xde, 0x22, 0x05, +0x55, 0xc3, 0xc6, 0x43, 0x3e, 0x90, 0x93, 0x4a, +0x81, 0xe3, 0x33, 0x7b, 0x80, 0xf2, 0xe0, 0x29, +0xe3, 0x57, 0xfe, 0xa1, 0x01, 0x80, 0x26, 0xb5, +0x63, 0xee, 0x1f, 0xa7, 0x16, 0x21, 0xd7, 0x19, +0x4a, 0x0d, 0x29, 0xe7, 0x82, 0x14, 0xd7, 0x98, +0x81, 0x39 }; + +static char pkt6[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x44, 0xe6, +0x99, 0x78, 0xdf, 0x32, 0x82, 0x08, 0xd3, 0xec, +0x7e, 0x5f, 0x1a, 0xb6, 0x30, 0x49, 0x92, 0xf5, +0x90, 0xb8, 0xf3, 0x4b, 0x88, 0x84, 0x91, 0xa4, +0x26, 0x16, 0x3b, 0x33, 0xc4, 0x60, 0x80, 0x45, +0xa0, 0x5d, 0x13, 0xc5, 0x6d, 0xac, 0xeb, 0x9e, +0x06, 0x55, 0x27, 0x9e, 0x26, 0xc6, 0x25, 0x33, +0xe0, 0xa3, 0x68, 0x00, 0x78, 0x23, 0x4b, 0x9e, +0xf2, 0xf5, 0xfd, 0x53, 0x17, 0x0a, 0x41, 0x22, +0xc7, 0xa8, 0x94, 0x5d, 0x85, 0xb8, 0xdf, 0xcd, +0x52, 0x15, 0x71, 0x7a, 0x5a, 0x3a, 0x24, 0xe6, +0xdd, 0x9d }; + +TAHI_TEST_SEQ tahi_ipsec_udp_025[] = { + {TITLE, "IPSEC-UDP-025", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {DUMP,NX_NULL,0,0, 0, 0, 0, 0}, + {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, + {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_025_size = sizeof(tahi_ipsec_udp_025) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_026.c b/test/regression/tahi_test/tahi_ipsec_udp_026.c new file mode 100644 index 00000000..7378aa4b --- /dev/null +++ b/test/regression/tahi_test/tahi_ipsec_udp_026.c @@ -0,0 +1,92 @@ +#include "nx_api.h" +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) +#include "netx_tahi.h" + + +static char pkt1[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, +0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x23, +0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf1, 0x71, +0x71, 0x9c, 0x36, 0x13, 0x0d, 0xba, 0xbe, 0x4c, +0xb0, 0x39, 0x12, 0xb8, 0x79, 0x14, 0x17, 0xfd, +0xbc, 0x52, 0xb2, 0xb3, 0x37, 0x88, 0x65, 0xd3, +0xbc, 0x2e, 0xf0, 0xa7, 0x1c, 0xe1, 0x67, 0x7b, +0xe1, 0x7b, 0x3b, 0x8a, 0x56, 0x73, 0x7d, 0x9c, +0x91, 0x05, 0xa6, 0xf8, 0xbb, 0x9b, 0xcc, 0xf7, +0xc6, 0x59, 0xe4, 0xb5, 0x8c, 0x5d, 0x9c, 0x2e, +0xbf, 0x6b, 0x6e, 0xe0, 0xb1, 0xe4, 0x10, 0xc6, +0x01, 0xd1, 0x93, 0x9a, 0xa8, 0x35, 0x26, 0x02, +0xfb, 0x6e, 0x7b, 0xcd, 0xac, 0x23, 0x45, 0xac, +0xe8, 0x9b }; + +static char pkt2[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, +0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x05, +0xb5, 0x6d, 0x8d, 0x7d, 0x15, 0x7d, 0x8b, 0x97, +0xb7, 0x42, 0x10, 0xb2, 0xba, 0x93, 0xea, 0x62, +0x49, 0xa2, 0x82, 0x8e, 0x83, 0x50, 0xa7, 0x1e, +0x81, 0x5f, 0xc9, 0x45, 0x47, 0x28, 0xd5, 0xbc, +0x08, 0x7e, 0x2a, 0x23, 0x42, 0x05, 0x3f, 0x04, +0x0e, 0x81, 0xfe, 0xf0, 0x5d, 0xb0, 0xda, 0x11, +0xcf, 0xcf, 0xc5, 0x56, 0xeb, 0x2d, 0x97, 0x96, +0x1a, 0xb9, 0x19, 0x6c, 0xde, 0x4b, 0x71, 0x8e, +0xe1, 0xfb, 0xca, 0x48, 0x0a, 0x1f, 0xae, 0x35, +0x33, 0x72, 0x32, 0x2b, 0x08, 0x38, 0x04, 0xa6, +0x30, 0xaa, 0x3d, 0xce, 0x7f, 0x22, 0x89, 0x35, +0xd9, 0xcf }; + +#if 0 +static char pkt3[] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, +0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, +0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, +0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; +#endif + +static char pkt4[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, +0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, +0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, +0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, +0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; + +TAHI_TEST_SEQ tahi_ipsec_udp_026[] = { + {TITLE, "IPSEC-UDP-026", 13, 0, 0, 0, 0, 0}, + {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, + + {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, + {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ + {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, + + {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, + {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} +}; + +int tahi_ipsec_udp_026_size = sizeof(tahi_ipsec_udp_026) / sizeof(TAHI_TEST_SEQ); + +#endif diff --git a/test/regression/telnet_test/netx_telnet_activity_timeout_test.c b/test/regression/telnet_test/netx_telnet_activity_timeout_test.c new file mode 100644 index 00000000..34eac7ec --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_activity_timeout_test.c @@ -0,0 +1,567 @@ +/* This test checks for the Telnet Server to keep track of the length of inactivity on all its connections + If the timeout is exceeded it should close the connection. + + The following symbols and options must be set: + + NX_TELNET_SERVER_USER_CREATE_PACKET_POOL defined + NX_TELNET_TIMEOUT_PERIOD = 2 + NX_TELNET_ACTIVITY_TIMEOUT = 10 + +*/ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if defined(NX_TELNET_SERVER_USER_CREATE_PACKET_POOL) && !defined(NX_DISABLE_IPV4) + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_client.h" +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_client.h" +#include "nx_telnet_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client1_thread; +static TX_THREAD client2_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; + +/* Define TELNET objects. */ + +static NX_TELNET_SERVER my_server; +static NX_TELNET_CLIENT my_client1; +static NX_TELNET_CLIENT my_client2; + +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG clients_connected = 0; +static ULONG total_disconnects = 0; +static ULONG total_connections = 0; +static ULONG error_counter = 0; + + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 +#define SHORT_TELNET_TIMEOUT 50 + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_client1_entry(ULONG thread_input); +static void thread_client2_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_activity_timeout_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client 1 thread. */ + tx_thread_create(&client1_thread, "client 1 thread", thread_client1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the client 2 thread. */ + tx_thread_create(&client2_thread, "client 2 thread", thread_client2_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + status = nx_telnet_server_packet_pool_set(&my_server, &pool_server); + + /* Check for errors. */ + if (status) + error_counter++; +} + +/* Define the Server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +UINT current_connections; + + + tx_thread_sleep(20); + + /* Print out test information banner. */ + printf("NetX Test: Telnet Activity Timeout Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + /* Wait a few beats to let clients connect. */ + while(!clients_connected) + { + tx_thread_sleep(50); + } + + /* Check on the number of current connections. */ + do + { + + nx_telnet_server_get_open_connection_count(&my_server, ¤t_connections); + tx_thread_sleep(50); + + }while (current_connections > 0); + + /* Kill remaining clients connections if any. */ + status = nx_telnet_server_stop(&my_server); + + if (status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_telnet_server_delete(&my_server); + if (status) + error_counter++; + + if ((my_server.nx_telnet_server_activity_timeouts != 1) || + (total_connections != 2) || + (total_disconnects != 2)) + { + error_counter++; + } + + /* Wait for thread2 to complete. */ + while(clients_connected) + tx_thread_sleep(100); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + total_connections++; + + /* Allocate a packet for client greeting. */ + status = nx_packet_allocate(&pool_server, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + error_counter++; + + /* Build a banner message and a prompt. */ + nx_packet_data_append(packet_ptr, "**** Welcome to NetX TELNET Server ****\r\n\r\n\r\n", 45, + &pool_server, NX_NO_WAIT); + + nx_packet_data_append(packet_ptr, "NETX> ", 6, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } +} + + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + +UINT status; +UCHAR alpha; +ULONG bytes_copied; + + + /* This demo just echoes the character back and on sends a new prompt back to the + client. A real system would most likely buffer the character(s) received in a buffer + associated with the supplied logical connection and process according to it. */ + + + /* Just throw away carriage returns. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\r') && (packet_ptr -> nx_packet_length == 1)) + { + + nx_packet_release(packet_ptr); + return; + } + + /* Setup new line on line feed. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\n') || (packet_ptr -> nx_packet_prepend_ptr[1] == '\n')) + { + + /* Clean up the packet. */ + packet_ptr -> nx_packet_length = 0; + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + + /* Build the next prompt. */ + nx_packet_data_append(packet_ptr, "\r\nNETX> ", 8, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + return; + } + + /* Verify data. */ + status = nx_packet_data_retrieve(packet_ptr, recv_buff, &bytes_copied); + if (status) + { + error_counter++; + } + + if (bytes_copied != sizeof(send_buff)) + { + error_counter++; + } + + if (memcmp(send_buff, recv_buff, sizeof(send_buff)) != 0) + { + error_counter++; + } + + /* Pickup first character (usually only one from client). */ + alpha = packet_ptr -> nx_packet_prepend_ptr[0]; + + /* Echo character. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check for a disconnection. */ + if (alpha == 'q') + { + + /* Initiate server disconnection. */ + nx_telnet_server_disconnect(server_ptr, logical_connection); + } +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + + total_disconnects++; + + /* Cleanup any application specific connection or buffer information. */ + return; +} + + +/* Define the client1 thread. */ +void thread_client1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT i; +UINT packets_sent= 0; + + tx_thread_sleep(100); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client1, "TELNET Client1", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client1, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT); + if (status) + error_counter++; + else + clients_connected++; + + /* Initialize the buffers. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (UCHAR)(i & 0xFF); + } + send_buff[0] = 0xFF; + send_buff[1] = 0xFF; + send_buff[2] = 0xFF; + memset(recv_buff, 0, sizeof(recv_buff)); + + while (packets_sent< 2) + { + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client1, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server header. */ + status = nx_telnet_client_packet_receive(&my_client1, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the Server's banner + message sent by the Server callback function below. Just + release it for this demo. */ + nx_packet_release(my_packet); + + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client1, &my_packet, 4000); // jlc TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'a' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + packets_sent++; + } + + /* Now disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client1, TELNET_TIMEOUT); + clients_connected--; + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client1); + if (status) + error_counter++; + +} + + +/* Define the client2 thread. */ +void thread_client2_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT i; + + tx_thread_sleep(110); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client2, "TELNET Client2", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client2, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT); + if (status) + error_counter++; + else + clients_connected++; + + /* Initialize the buffers. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (UCHAR)(i & 0xFF); + } + send_buff[0] = 0xFF; + send_buff[1] = 0xFF; + send_buff[2] = 0xFF; + memset(recv_buff, 0, sizeof(recv_buff)); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Put in a long sleep time exceeding the activity timeout. */ + tx_thread_sleep(1200); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client2, my_packet, TELNET_TIMEOUT); + + /* The server should have disconnected so check for 0x38/Not connected error*/ + if (status == NX_NOT_CONNECTED) + { + + /* Disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client2, TELNET_TIMEOUT); + clients_connected--; + + /* Delete TELNET Client2. */ + status = nx_telnet_client_delete(&my_client2); + if (status) + error_counter++; + + return; + } + + /* This call should not succeed. */ + error_counter++; + + /* Now disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client2, TELNET_TIMEOUT); + clients_connected--; + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client2); + +} + + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_activity_timeout_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Telnet Activity Timeout Test..............................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + + + + + diff --git a/test/regression/telnet_test/netx_telnet_basic_test.c b/test/regression/telnet_test/netx_telnet_basic_test.c new file mode 100644 index 00000000..d9e59f0b --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_basic_test.c @@ -0,0 +1,474 @@ + + +#include "tx_api.h" +#include "nx_api.h" +#include +#include +extern void test_control_return(UINT); + +#if !defined(NX_TELNET_SERVER_USER_CREATE_PACKET_POOL) && !defined(NX_DISABLE_IPV4) + + + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_client.h" +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_client.h" +#include "nx_telnet_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; + +/* Define TELNET objects. */ + +static NX_TELNET_SERVER my_server; +static NX_TELNET_CLIENT my_client; + +static UINT data_received; +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; +} + +/* Define the Server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: Telnet Basic Test........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + /* Restart TELNET server. */ + status = nx_telnet_server_stop(&my_server); + status += nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_telnet_server_delete(&my_server); + if (status) + error_counter++; + +} + +/* Define the client thread. */ +void thread_client_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT i; + + tx_thread_sleep(1); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client, "My TELNET Client", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + status = nx_telnet_client_delete(&my_client); + if (status) + error_counter++; + + status = nx_telnet_client_create(&my_client, "My TELNET Client", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Initialize the buffers. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (UCHAR)(i & 0xFF); + } + send_buff[0] = 0xFF; + send_buff[1] = 0xFF; + send_buff[2] = 0xFF; + memset(recv_buff, 0, sizeof(recv_buff)); + data_received = NX_FALSE; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server header. */ + status = nx_telnet_client_packet_receive(&my_client, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the Server's banner + message sent by the Server callback function below. Just + release it for this demo. */ + nx_packet_release(my_packet); + +#ifndef NX_TELNET_SERVER_OPTION_DISABLE + + /* Pickup the echo option requests. */ + status = nx_telnet_client_packet_receive(&my_client, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + nx_packet_release(my_packet); +#endif + + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'a' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a "q" message for disconnection. */ + nx_packet_data_append(my_packet, "q", 1, &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'q' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + /* Now disconnect form the TELNET Server. */ + status = nx_telnet_client_disconnect(&my_client, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client); + if (status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + if ((error_counter) || (data_received == NX_FALSE)) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Allocate a packet for client greeting. */ + status = nx_packet_allocate(&pool_server, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + error_counter++; + + /* Build a banner message and a prompt. */ + nx_packet_data_append(packet_ptr, "**** Welcome to NetX TELNET Server ****\r\n\r\n\r\n", 45, + &pool_server, NX_NO_WAIT); + + nx_packet_data_append(packet_ptr, "NETX> ", 6, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } +} + + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + +UINT status; +UCHAR alpha; +ULONG bytes_copied; + + + /* This demo just echoes the character back and on sends a new prompt back to the + client. A real system would most likely buffer the character(s) received in a buffer + associated with the supplied logical connection and process according to it. */ + + + /* Just throw away carriage returns. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\r') && (packet_ptr -> nx_packet_length == 1)) + { + + nx_packet_release(packet_ptr); + return; + } + + /* Setup new line on line feed. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\n') || (packet_ptr -> nx_packet_prepend_ptr[1] == '\n')) + { + + /* Clean up the packet. */ + packet_ptr -> nx_packet_length = 0; + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + + /* Build the next prompt. */ + nx_packet_data_append(packet_ptr, "\r\nNETX> ", 8, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + return; + } + + if (!data_received) + { + + /* Verify data. */ + status = nx_packet_data_retrieve(packet_ptr, recv_buff, &bytes_copied); + if (status) + { + error_counter++; + } + + if (bytes_copied != sizeof(send_buff)) + { + error_counter++; + } + + if (memcmp(send_buff, recv_buff, sizeof(send_buff)) != 0) + { + error_counter++; + } + else + { + data_received = NX_TRUE; + } + } + + /* Pickup first character (usually only one from client). */ + alpha = packet_ptr -> nx_packet_prepend_ptr[0]; + + /* Echo character. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check for a disconnection. */ + if (alpha == 'q') + { + + /* Initiate server disconnection. */ + nx_telnet_server_disconnect(server_ptr, logical_connection); + } +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ +UINT current_connections; + + nx_telnet_server_get_open_connection_count(server_ptr, ¤t_connections); + + if (current_connections != 0) + { + error_counter++; + } + + /* Cleanup any application specific connection or buffer information. */ + return; +} + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_basic_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: Telnet Basic Test.........................................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + + diff --git a/test/regression/telnet_test/netx_telnet_create_packet_pool_test.c b/test/regression/telnet_test/netx_telnet_create_packet_pool_test.c new file mode 100644 index 00000000..a5d26441 --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_create_packet_pool_test.c @@ -0,0 +1,387 @@ +/* This demo tests the feature to create the Telnet packet pool instead of the default + behavior of the Telnet Server creating its own packet pool. + + NX_TELNET_SERVER_USER_CREATE_PACKET_POOL must be defined in the test. +*/ + +#include "tx_api.h" +#include "nx_api.h" +#include +#include +extern void test_control_return(UINT); + +#if defined(NX_TELNET_SERVER_USER_CREATE_PACKET_POOL) && !defined(NX_DISABLE_IPV4) + + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_client.h" +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_client.h" +#include "nx_telnet_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; + +/* Define TELNET objects. */ + +static NX_TELNET_SERVER my_server; +static NX_TELNET_CLIENT my_client; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_create_packet_pool_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client thread. */ + tx_thread_create(&client_thread, "client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; + + pointer = pointer + 2048; + + status = nx_telnet_server_packet_pool_set(&my_server, &pool_server); + + /* Check for errors. */ + if (status) + error_counter++; +} + +/* Define the Server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: Telnet Create Packet Pool Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + tx_thread_sleep(100); + + status = nx_telnet_server_delete(&my_server); + if (status) + error_counter++; + +} + +/* Define the client thread. */ +void thread_client_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + tx_thread_sleep(50); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client, "My TELNET Client", &ip_client, 600); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, "a", 1, &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server header. */ + status = nx_telnet_client_packet_receive(&my_client, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the Server's banner + message sent by the Server callback function below. Just + release it for this demo. */ + nx_packet_release(my_packet); + + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'a' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + /* Now disconnect form the TELNET Server. */ + status = nx_telnet_client_disconnect(&my_client, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client); + if (status) + error_counter++; + + tx_thread_sleep(100); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + +UINT status; +NX_PACKET *packet_ptr; + + /* Allocate a packet for client greeting. */ + status = nx_packet_allocate(&pool_server, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + error_counter++; + + /* Build a banner message and a prompt. */ + nx_packet_data_append(packet_ptr, "**** Welcome to NetX TELNET Server ****\r\n\r\n\r\n", 45, + &pool_server, NX_NO_WAIT); + + nx_packet_data_append(packet_ptr, "NETX> ", 6, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } +} + + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + +UINT status; +UCHAR alpha; + + + /* This demo just echoes the character back and on sends a new prompt back to the + client. A real system would most likely buffer the character(s) received in a buffer + associated with the supplied logical connection and process according to it. */ + + + /* Just throw away carriage returns. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\r') && (packet_ptr -> nx_packet_length == 1)) + { + + nx_packet_release(packet_ptr); + return; + } + + /* Setup new line on line feed. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\n') || (packet_ptr -> nx_packet_prepend_ptr[1] == '\n')) + { + + /* Clean up the packet. */ + packet_ptr -> nx_packet_length = 0; + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + + /* Build the next prompt. */ + nx_packet_data_append(packet_ptr, "\r\nNETX> ", 8, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + return; + } + + /* Pickup first character (usually only one from client). */ + alpha = packet_ptr -> nx_packet_prepend_ptr[0]; + + /* Echo character. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check for a disconnection. */ + if (alpha == 'q') + { + + /* Initiate server disconnection. */ + nx_telnet_server_disconnect(server_ptr, logical_connection); + } +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + /* Cleanup any application specific connection or buffer information. */ + return; +} + + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_create_packet_pool_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: Telnet Create Packet Pool Test............................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ diff --git a/test/regression/telnet_test/netx_telnet_max_connections_test.c b/test/regression/telnet_test/netx_telnet_max_connections_test.c new file mode 100644 index 00000000..0c87d929 --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_max_connections_test.c @@ -0,0 +1,662 @@ +/* This test checks for the Telnet Server limiting itself to the NX_TELNET_MAX_CLIENTS. The test verifies + that the Telnet Server supports at most NX_TELNET_MAX_CLIENTS simultaneous connections, and that each Client receives + responses to their Telnet packets. + + The following symbols and options must be set: + + NX_TELNET_MAX_CLIENTS 2 + NX_TELNET_SERVER_OPTION_DISABLE not defined + (NX_TELNET_SERVER_USER_CREATE_PACKET_POOL is defined.) +*/ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if defined(NX_TELNET_SERVER_USER_CREATE_PACKET_POOL) && !defined(NX_DISABLE_IPV4) + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_client.h" +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_client.h" +#include "nx_telnet_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client1_thread; +static TX_THREAD client2_thread; +static TX_THREAD client3_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; + +/* Define TELNET objects. */ + +static NX_TELNET_SERVER my_server; +static NX_TELNET_CLIENT my_client1; +static NX_TELNET_CLIENT my_client2; +static NX_TELNET_CLIENT my_client3; + +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +UINT client_connections = 0; +UINT disconnects = 0; +static ULONG error_counter = 0; + + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 +#define SHORT_TELNET_TIMEOUT 50 + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_client1_entry(ULONG thread_input); +static void thread_client2_entry(ULONG thread_input); +static void thread_client3_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); +extern void test_control_return(UINT); + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_max_connections_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client 1 thread. */ + tx_thread_create(&client1_thread, "client 1 thread", thread_client1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + + /* Create the client 2 thread. */ + tx_thread_create(&client2_thread, "client 2 thread", thread_client2_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client 3 thread. */ + tx_thread_create(&client3_thread, "client 3 thread", thread_client3_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; + + + pointer = pointer + 2048; + + status = nx_telnet_server_packet_pool_set(&my_server, &pool_server); + + /* Check for errors. */ + if (status) + error_counter++; +} + +/* Define the Server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; +UINT connections = 0; + + tx_thread_sleep(20); + + /* Print out test information banner. */ + printf("NetX Test: Telnet Max Connections Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + /* Wait for clients to connect. */ + while(client_connections == 0) + tx_thread_sleep(20); + + do + { + tx_thread_sleep(20); + status = nx_telnet_server_get_open_connection_count(&my_server, &connections); + + if (connections > 2) + { + error_counter++; + break; + } + } while(connections); + + + + /* Kill remaining clients connections if any. */ + status = nx_telnet_server_stop(&my_server); + + if (status) + error_counter++; + + tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); + + status = nx_telnet_server_delete(&my_server); + if (status) + error_counter++; + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } + +} + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + client_connections++; + + /* Allocate a packet for client greeting. */ + status = nx_packet_allocate(&pool_server, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + if (status) + error_counter++; + + /* Build a banner message and a prompt. */ + nx_packet_data_append(packet_ptr, "**** Welcome to NetX TELNET Server ****\r\n\r\n\r\n", 45, + &pool_server, NX_NO_WAIT); + + nx_packet_data_append(packet_ptr, "NETX> ", 6, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } +} + + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + +UINT status; +UCHAR alpha; +ULONG bytes_copied; + + + /* This demo just echoes the character back and on sends a new prompt back to the + client. A real system would most likely buffer the character(s) received in a buffer + associated with the supplied logical connection and process according to it. */ + + + /* Just throw away carriage returns. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\r') && (packet_ptr -> nx_packet_length == 1)) + { + + nx_packet_release(packet_ptr); + return; + } + + /* Setup new line on line feed. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\n') || (packet_ptr -> nx_packet_prepend_ptr[1] == '\n')) + { + + /* Clean up the packet. */ + packet_ptr -> nx_packet_length = 0; + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + + /* Build the next prompt. */ + nx_packet_data_append(packet_ptr, "\r\nNETX> ", 8, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + return; + } + + /* Verify data. */ + status = nx_packet_data_retrieve(packet_ptr, recv_buff, &bytes_copied); + if (status) + { + error_counter++; + } + + if (bytes_copied != sizeof(send_buff)) + { + error_counter++; + } + + if (memcmp(send_buff, recv_buff, sizeof(send_buff)) != 0) + { + error_counter++; + } + + /* Pickup first character (usually only one from client). */ + alpha = packet_ptr -> nx_packet_prepend_ptr[0]; + + /* Echo character. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + if (status) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check for a disconnection. */ + if (alpha == 'q') + { + + /* Initiate server disconnection. */ + nx_telnet_server_disconnect(server_ptr, logical_connection); + } +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + disconnects++; + + /* Cleanup any application specific connection or buffer information. */ + return; +} + + +/* Define the client1 thread. */ +void thread_client1_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT i; + + tx_thread_sleep(100); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client1, "TELNET Client1", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client1, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Initialize the buffers. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (UCHAR)(i & 0xFF); + } + send_buff[0] = 0xFF; + send_buff[1] = 0xFF; + send_buff[2] = 0xFF; + memset(recv_buff, 0, sizeof(recv_buff)); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Stay connected long enough Client 3 wait option to connect expires. */ + tx_thread_sleep(100); + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client1, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server header. */ + status = nx_telnet_client_packet_receive(&my_client1, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the Server's banner + message sent by the Server callback function below. Just + release it for this demo. */ + nx_packet_release(my_packet); + + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client1, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'a' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + /* Now disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client1, TELNET_TIMEOUT); + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client1); + if (status) + error_counter++; + +} + + +/* Define the client2 thread. */ +void thread_client2_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT i; + + tx_thread_sleep(100); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client2, "TELNET Client2", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client2, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Initialize the buffers. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (UCHAR)(i & 0xFF); + } + send_buff[0] = 0xFF; + send_buff[1] = 0xFF; + send_buff[2] = 0xFF; + memset(recv_buff, 0, sizeof(recv_buff)); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client2, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server header. */ + status = nx_telnet_client_packet_receive(&my_client2, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the Server's banner + message sent by the Server callback function below. Just + release it for this demo. */ + nx_packet_release(my_packet); + + tx_thread_sleep(100); + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client2, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'a' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + + /* Now disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client2, TELNET_TIMEOUT); + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client2); + if (status) + error_counter++; + +} + + +/* Define the client3 thread. */ +void thread_client3_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT i; +UINT connections = 0; +UINT status_connection_count; + + tx_thread_sleep(100); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client3, "TELNET Client3", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. Use a shorter + timeout so we can test that the server won't make this third connection (max connection + set to 2). If it's longer it will simply suspend till either Client 1, 2 disconnect).*/ + + status = nx_telnet_client_connect(&my_client3, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, TELNET_TIMEOUT + 50); + + status_connection_count = nx_telnet_server_get_open_connection_count(&my_server, &connections); + if (status_connection_count) + { + error_counter++; + } + + if (status == NX_SUCCESS) + { + + /* Find out how many connections are in process. */ + + if (connections > 2) + { + /* The Server should not let the client connect. */ + error_counter++; + nx_telnet_client_disconnect(&my_client3, TELNET_TIMEOUT); + return; + } + } + else if (connections < 2) + { + + /* Server should have allowed this connection*/ + error_counter++; + return; + } + + + /* Ok to proceed with valid connection. Initialize the buffers. */ + for (i = 0; i < sizeof(send_buff); i++) + { + send_buff[i] = (UCHAR)(i & 0xFF); + } + + send_buff[0] = 0xFF; + send_buff[1] = 0xFF; + send_buff[2] = 0xFF; + memset(recv_buff, 0, sizeof(recv_buff)); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client3, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Pickup the Server header. */ + status = nx_telnet_client_packet_receive(&my_client3, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the Server's banner + message sent by the Server callback function below. Just + release it for this demo. */ + nx_packet_release(my_packet); + + /* Pickup the Server echo of the character. */ + status = nx_telnet_client_packet_receive(&my_client3, &my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* At this point the packet should contain the character 'a' that + we sent earlier. Just release the packet for now. */ + nx_packet_release(my_packet); + + /* Now disconnect from the TELNET Server. */ + nx_telnet_client_disconnect(&my_client3, TELNET_TIMEOUT); + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client3); + if (status) + error_counter++; + +} +#else /* NX_TELNET_SERVER_USR_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_max_connections_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Telnet Max Connections Test...............................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USR_CREATE_PACKET_POOL */ + + + + + diff --git a/test/regression/telnet_test/netx_telnet_rst_test.c b/test/regression/telnet_test/netx_telnet_rst_test.c new file mode 100644 index 00000000..2a8f2656 --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_rst_test.c @@ -0,0 +1,317 @@ +/* This case tests the Telnet server on handling RST packet. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-235 + */ +#include "tx_api.h" +#include "nx_api.h" +#include +#include +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + + + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; +static TX_THREAD test_threads[NX_TELNET_MAX_CLIENTS]; +static NX_TCP_SOCKET test_sockets[NX_TELNET_MAX_CLIENTS]; +static UINT run_count[NX_TELNET_MAX_CLIENTS]; +static UCHAR test_thread_stack[NX_TELNET_MAX_CLIENTS][DEMO_STACK_SIZE]; +static TX_SEMAPHORE sema_0; + +/* Define TELNET objects. */ + +static NX_TELNET_SERVER my_server; + +static UINT data_received; +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_rst_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +static void thread_test_entry(ULONG thread_input) +{ +NX_TCP_SOCKET *socket_ptr = &test_sockets[thread_input]; +UINT status; +UINT i; + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_client, socket_ptr, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + for (i = 0; i < LOOP; i++) + { + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(socket_ptr, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + status = nx_tcp_client_socket_connect(socket_ptr, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + nx_tcp_socket_disconnect(socket_ptr, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(socket_ptr); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + run_count[thread_input]++; + } + + nx_tcp_socket_delete(socket_ptr); + tx_semaphore_put(&sema_0); +} + +/* Define the Server thread. */ +static void thread_server_entry(ULONG thread_input) +{ + +UINT i; +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: Telnet RST Test..........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_TELNET_SERVER_USER_CREATE_PACKET_POOL + nx_telnet_server_packet_pool_set(&my_server, &pool_server); +#endif + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + run_count[i] = 0; + tx_thread_create(&test_threads[i], "Test thread", thread_test_entry, i, + test_thread_stack[i], DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (tx_semaphore_get(&sema_0, 30 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + break; + } + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (run_count[i] != LOOP) + { + error_counter++; + } + } + + status = nx_telnet_server_delete(&my_server); + if (status) + error_counter++; + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ +} + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ +} + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_rst_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: Telnet RST Test...........................................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + + diff --git a/test/regression/telnet_test/netx_telnet_server_bad_option_reply_test.c b/test/regression/telnet_test/netx_telnet_server_bad_option_reply_test.c new file mode 100644 index 00000000..63e1f552 --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_server_bad_option_reply_test.c @@ -0,0 +1,472 @@ +/* This test checks for the Telnet Server to handle invalid telnet client option replies and unsupported client telnet options + in response to the server offering ECHO, Suppress Go Ahead and asks the peer not to ECHO (Don't Echo). + The Telnet Client is programmed to respond with a WILL ECHO (to the server WILL ECHO), a WILL [0x99 unknown option] and Won't Echo. + The server should not accept these options so a successful test is if echo and SGA are not enabled on the Telnet server. + + Required configuration settings: + + NX_TELNET_SERVER_OPTION_DISABLE not defined + NX_TELNET_SERVER_USER_CREATE_PACKET_POOL defined +*/ + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT); + +#if defined(NX_TELNET_SERVER_USER_CREATE_PACKET_POOL) && !defined(NX_DISABLE_IPV4) + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_client.h" +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_client.h" +#include "nx_telnet_server.h" +#endif + + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; + + +/* Define TELNET server object. */ + +static NX_TELNET_SERVER my_server; +static NX_TELNET_CLIENT my_client; + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + + +/* Define the counters and flags used in the demo application... */ + +static ULONG error_counter; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 + + +static void thread_server_entry(ULONG thread_input); +static void thread_client_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +static UCHAR send_buff[256]; + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_server_bad_option_reply_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + status = tx_thread_create(&server_thread, "Telnet Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 12, 12, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + if (status) + { + printf("Error creating Server thread 0x%x\n", status); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + + /* Create the Server IP instance. */ + nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + + pointer = pointer + 4096; + + + /* Enable ARP and supply ARP cache memory for the server. */ + nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP processing for both IP instances. */ + nx_tcp_enable(&ip_server); + nx_icmp_enable(&ip_server); + + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; + + + pointer = pointer + 2048; + + /* Create the Client thread. */ + status = tx_thread_create(&client_thread, "Telnet Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 12, 12, TX_NO_TIME_SLICE, TX_AUTO_START); + + if (status) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + if (status) + { + error_counter++; + } + pointer = pointer + 8192; + + /* Create the Client IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + if (status) + { + error_counter++; + } + + pointer = pointer + 4096; + + /* Enable ARP and supply ARP cache memory for the client. */ + nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP and ICMP processing for client IP instance. */ + nx_tcp_enable(&ip_client); + nx_icmp_enable(&ip_client); + + + return; +} + +static void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet, *my_packet2, *rcv_packet; + + tx_thread_sleep(100); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client, "TELNET Client", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, 200); + if (status) + error_counter++; + + + /* This should be the welcome message. */ + status = nx_telnet_client_packet_receive(&my_client, &rcv_packet, TELNET_TIMEOUT); + + if (status) + error_counter++; + + /* To do verify this is just a hello message. */ + + nx_packet_release(rcv_packet); + + /* Server should be negotiating options. */ + status = nx_telnet_client_packet_receive(&my_client, &rcv_packet, TELNET_TIMEOUT); + + if (status) + error_counter++; + + /* Parse the options. Should be will echo don't echo and will suppress go ahead */ + + nx_packet_release(rcv_packet); + + /* Prepare a WILL ECHO reply. This is invalid since the server just indicated it would enable ECHO */ + send_buff[0] = 0xFF; + send_buff[1] = 0xFB; /* WILL */ + send_buff[2] = 0x01; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Prepare a second reply: WONT ECHO, DO [unknown option] */ + send_buff[0] = 0xFF; + send_buff[1] = 0xFC; + send_buff[2] = 0x01; + send_buff[0] = 0xFF; + send_buff[1] = 0xFD; + send_buff[2] = 0x99; /* No idea what this is but we don't support it*/ + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Load the reply in to the packet. */ + nx_packet_data_append(my_packet2, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet2, TELNET_TIMEOUT); + if (status) + error_counter++; + + tx_thread_sleep(200); + + /* Now disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client, 100); + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client); + if (status) + error_counter++; + +} + +/* Define the Telnet Server thread. */ +static void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + + tx_thread_sleep(20); + + /* Print out test information banner. */ + printf("NetX Test: Telnet Server Bad Option Reply Test......................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* We have defined the NX_TELNET_CREATE_PACKET_POOL option for sending + Telnet options (not disabled). So set the telnet packet pool. */ + status = nx_telnet_server_packet_pool_set(&my_server, &pool_server); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + /* Check if the client connection is still live. */ + + tx_thread_sleep(100); + }while (my_server.nx_telnet_server_open_connections == 1); + + status = nx_telnet_server_stop(&my_server); + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + + } + + if (error_counter || + (my_server.nx_telnet_server_client_list[0].nx_telnet_client_agree_server_will_SGA_success == NX_TRUE) || + (my_server.nx_telnet_server_client_list[0].nx_telnet_client_agree_server_will_echo_success == NX_TRUE)) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Allocate a packet for client greeting. */ + status = nx_packet_allocate(&pool_server, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + if (pool_server.nx_packet_pool_available < 2) + { + printf("Packet pool getting low...\n"); + } + /* Build a banner message and a prompt. */ + nx_packet_data_append(packet_ptr, "**** Welcome to NetX TELNET Server ****\r\n\r\n\r\n", 45, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + return; +} + + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + +UINT status; +UCHAR alpha; + + + + /* This demo just echoes the character back and on sends a new prompt back to the + client. A real system would most likely buffer the character(s) received in a buffer + associated with the supplied logical connection and process according to it. */ + + + /* Just throw away carriage returns. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\r') && (packet_ptr -> nx_packet_length == 1)) + { + nx_packet_release(packet_ptr); + return; + } + + + /* Setup new line on line feed. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\n') || (packet_ptr -> nx_packet_prepend_ptr[1] == '\n')) + { + + /* Clean up the packet. */ + packet_ptr -> nx_packet_length = 0; + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + + /* Build the next prompt. */ + nx_packet_data_append(packet_ptr, "\r\nNETX> ", 8, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + return; + } + + /* Pickup first character (usually only one from client). */ + alpha = packet_ptr -> nx_packet_prepend_ptr[0]; + + /* Echo character. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check for a disconnection. */ + if (alpha == 'q') + { + + /* Initiate server disconnection. */ + nx_telnet_server_disconnect(server_ptr, logical_connection); + } +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + + /* Cleanup any application specific connection or buffer information. */ +} + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_server_bad_option_reply_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Telnet Server Bad Option Reply Test.......................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + diff --git a/test/regression/telnet_test/netx_telnet_server_options_negotiate_test.c b/test/regression/telnet_test/netx_telnet_server_options_negotiate_test.c new file mode 100644 index 00000000..e48c3142 --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_server_options_negotiate_test.c @@ -0,0 +1,480 @@ +/* This test checks for the Telnet Server to negotiate with a Telnet Client for three common + Telnet options. It offers to ECHO, Suppress Go Ahead and asks the peer not to ECHO (Don't Echo). + The Telnet Client is programmed to acknowledge the ECHO and SGA, and Won't Echo. + + Required configuration settings: + + NX_TELNET_SERVER_OPTION_DISABLE not defined + NX_TELNET_SERVER_USER_CREATE_PACKET_POOL defined +*/ + +#include "tx_api.h" +#include "nx_api.h" + + +extern void test_control_return(UINT); + +#if defined(NX_TELNET_SERVER_USER_CREATE_PACKET_POOL) && !defined(NX_DISABLE_IPV4) + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_client.h" +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_client.h" +#include "nx_telnet_server.h" +#endif + + +#define DEMO_STACK_SIZE 4096 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; + + +/* Define TELNET server object. */ + +static NX_TELNET_SERVER my_server; +static NX_TELNET_CLIENT my_client; + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + + +/* Define the counters and flags used in the demo application... */ + +static ULONG error_counter; +static UINT server_option_negotiation; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 + + +void thread_server_entry(ULONG thread_input); +void thread_client_entry(ULONG thread_input); + +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + +static UCHAR send_buff[256]; + +/* Define the application's TELNET Server callback routines. */ + +void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_server_options_negotiate_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + status = tx_thread_create(&server_thread, "Telnet Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 12, 12, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + + if (status) + { + printf("Error creating Server thread 0x%x\n", status); + } + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + + /* Create the Server IP instance. */ + nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + + pointer = pointer + 4096; + + + /* Enable ARP and supply ARP cache memory for the server. */ + nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP processing for both IP instances. */ + nx_tcp_enable(&ip_server); + nx_icmp_enable(&ip_server); + + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; + + + pointer = pointer + 2048; + + /* Create the Client thread. */ + status = tx_thread_create(&client_thread, "Telnet Client thread", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 12, 12, TX_NO_TIME_SLICE, TX_AUTO_START); + + if (status) + { + error_counter++; + } + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the client packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + if (status) + { + error_counter++; + } + pointer = pointer + 8192; + + /* Create the Client IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + if (status) + { + error_counter++; + } + + pointer = pointer + 4096; + + /* Enable ARP and supply ARP cache memory for the client. */ + nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP and ICMP processing for client IP instance. */ + nx_tcp_enable(&ip_client); + nx_icmp_enable(&ip_client); + + + return; +} + +void thread_client_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet, *my_packet2, *rcv_packet; + + tx_thread_sleep(100); + + /* Create a TELENT client instance. */ + status = nx_telnet_client_create(&my_client, "TELNET Client", &ip_client, 6 * NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + /* Connect the TELNET client to the TELNET Server at port 23 over IPv4. */ + status = nx_telnet_client_connect(&my_client, SERVER_ADDRESS, NX_TELNET_SERVER_PORT, 200); + if (status) + error_counter++; + + + /* This should be the welcome message. */ + status = nx_telnet_client_packet_receive(&my_client, &rcv_packet, TELNET_TIMEOUT); + + if (status) + error_counter++; + + /* To do verify this is just a hello message. */ + + nx_packet_release(rcv_packet); + + /* Server should be negotiating options. */ + status = nx_telnet_client_packet_receive(&my_client, &rcv_packet, TELNET_TIMEOUT); + + if (status) + error_counter++; + + /* Parse the options. Should be will echo don't echo and will suppress go ahead */ + + nx_packet_release(rcv_packet); + + /* Prepare a Do ECHO reply */ + send_buff[0] = 0xFF; + send_buff[1] = 0xFD; + send_buff[2] = 0x01; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Build a simple 1-byte message. */ + nx_packet_data_append(my_packet, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet, TELNET_TIMEOUT); + if (status) + error_counter++; + + /* Prepare a second reply: WONT ECHO, DO SUPPRESS GO AHEAD */ + send_buff[0] = 0xFF; + send_buff[1] = 0xFC; + send_buff[2] = 0x01; + send_buff[0] = 0xFF; + send_buff[1] = 0xFD; + send_buff[2] = 0x03; + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_client, &my_packet2, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Load the reply in to the packet. */ + nx_packet_data_append(my_packet2, send_buff, sizeof(send_buff), &pool_client, NX_WAIT_FOREVER); + + /* Send the packet to the TELNET Server. */ + status = nx_telnet_client_packet_send(&my_client, my_packet2, TELNET_TIMEOUT); + if (status) + error_counter++; + + tx_thread_sleep(200); + + /* Now disconnect form the TELNET Server. */ + nx_telnet_client_disconnect(&my_client, 100); + + /* Delete the TELNET Client. */ + status = nx_telnet_client_delete(&my_client); + if (status) + error_counter++; + +} + +/* Define the Telnet Server thread. */ +void thread_server_entry(ULONG thread_input) +{ + +UINT status; + + + tx_thread_sleep(20); + + /* Print out test information banner. */ + printf("NetX Test: Telnet Server Negotiation Test............................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* We have defined the NX_TELNET_CREATE_PACKET_POOL option for sending + Telnet options (not disabled). So set the telnet packet pool. */ + status = nx_telnet_server_packet_pool_set(&my_server, &pool_server); + + if (status != NX_SUCCESS) + { + error_counter++; + } + + server_option_negotiation = NX_FALSE; + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + } + + do + { + /* Check on the result of optio negotiations while the client connection is live. */ + + NX_TELNET_CLIENT_REQUEST *client_req_ptr = &(my_server.nx_telnet_server_client_list[0]); + if ((client_req_ptr -> nx_telnet_client_agree_server_will_SGA_success == NX_TRUE) && + (client_req_ptr -> nx_telnet_client_agree_server_will_echo_success == NX_TRUE)) + { + /* negotiation successful. */ + server_option_negotiation = NX_TRUE; + } + + tx_thread_sleep(100); + }while (my_server.nx_telnet_server_open_connections == 1); + + status = nx_telnet_server_stop(&my_server); + + /* Check for errors. */ + if (status != NX_SUCCESS) + { + error_counter++; + + } + + if (error_counter || !server_option_negotiation) + { + + printf("ERROR!\n"); + test_control_return(1); + } + else + + { + + printf("SUCCESS!\n"); + test_control_return(0); + } + + return; +} + + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + +UINT status; +NX_PACKET *packet_ptr; + + + /* Allocate a packet for client greeting. */ + status = nx_packet_allocate(&pool_server, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + + if (status != NX_SUCCESS) + { + error_counter++; + return; + } + + if (pool_server.nx_packet_pool_available < 2) + { + printf("Packet pool getting low...\n"); + } + /* Build a banner message and a prompt. */ + nx_packet_data_append(packet_ptr, "**** Welcome to NetX TELNET Server ****\r\n\r\n\r\n", 45, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + return; +} + + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + +UINT status; +UCHAR alpha; + + + + /* This demo just echoes the character back and on sends a new prompt back to the + client. A real system would most likely buffer the character(s) received in a buffer + associated with the supplied logical connection and process according to it. */ + + + /* Just throw away carriage returns. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\r') && (packet_ptr -> nx_packet_length == 1)) + { + nx_packet_release(packet_ptr); + return; + } + + + /* Setup new line on line feed. */ + if ((packet_ptr -> nx_packet_prepend_ptr[0] == '\n') || (packet_ptr -> nx_packet_prepend_ptr[1] == '\n')) + { + + /* Clean up the packet. */ + packet_ptr -> nx_packet_length = 0; + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_data_start + NX_TCP_PACKET; + + /* Build the next prompt. */ + nx_packet_data_append(packet_ptr, "\r\nNETX> ", 8, &pool_server, NX_NO_WAIT); + + /* Send the packet to the client. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status) + { + nx_packet_release(packet_ptr); + error_counter++; + } + + return; + } + + /* Pickup first character (usually only one from client). */ + alpha = packet_ptr -> nx_packet_prepend_ptr[0]; + + /* Echo character. */ + status = nx_telnet_server_packet_send(server_ptr, logical_connection, packet_ptr, TELNET_TIMEOUT); + + if (status != NX_SUCCESS) + { + error_counter++; + nx_packet_release(packet_ptr); + } + + /* Check for a disconnection. */ + if (alpha == 'q') + { + + /* Initiate server disconnection. */ + nx_telnet_server_disconnect(server_ptr, logical_connection); + } +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ + + /* Cleanup any application specific connection or buffer information. */ +} + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_server_options_negotiate_test_application_define(void *first_unused_memory) +#endif +{ + printf("NetX Test: Telnet Server Negotiation Test............................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + diff --git a/test/regression/telnet_test/netx_telnet_two_listen_test.c b/test/regression/telnet_test/netx_telnet_two_listen_test.c new file mode 100644 index 00000000..4f2b000a --- /dev/null +++ b/test/regression/telnet_test/netx_telnet_two_listen_test.c @@ -0,0 +1,299 @@ +/* This case tests the Telnet server on handling two session listen situation. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-238 + */ +#include "tx_api.h" +#include "nx_api.h" +#include +#include +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + + + +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_telnet_server.h" +#else +#include "nx_telnet_server.h" +#endif + +#define DEMO_STACK_SIZE 4096 +#define LOOP 100 + + +/* Define the ThreadX and NetX object control blocks... */ + +static TX_THREAD server_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; +static NX_TCP_SOCKET test_sockets[3]; +static TX_SEMAPHORE sema_0; + +/* Define TELNET objects. */ + +static NX_TELNET_SERVER my_server; + +static UINT data_received; +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +#define TELNET_TIMEOUT 200 + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the application's TELNET Server callback routines. */ + +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection); +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr); +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_two_listen_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + /* Create the NetX Duo TELNET Server. */ + status = nx_telnet_server_create(&my_server, "Telnet Server", &ip_server, + pointer, 2048, telnet_new_connection, telnet_receive_data, + telnet_connection_end); + + /* Check for errors. */ + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +/* Define the Server thread. */ +static void thread_server_entry(ULONG thread_input) +{ + +UINT i; +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: Telnet Two Listen Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + +#ifdef NX_TELNET_SERVER_USER_CREATE_PACKET_POOL + nx_telnet_server_packet_pool_set(&my_server, &pool_server); +#endif + + /* Start the TELNET Server. */ + status = nx_telnet_server_start(&my_server); + if (status) + error_counter++; + + /* Initialize test sockets. */ + for (i = 0; i < sizeof(test_sockets) / sizeof(NX_TCP_SOCKET); i++) + { + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_client, &test_sockets[i], "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&test_sockets[i], NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + } + + /* Connect to Telnet server. */ + status = nx_tcp_client_socket_connect(&test_sockets[0], SERVER_ADDRESS, NX_TELNET_SERVER_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + /* Send data to Telnet server. */ + nx_packet_allocate(&pool_client, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + nx_packet_data_append(packet_ptr, "ABC", 3, &pool_client, NX_NO_WAIT); + nx_tcp_socket_send(&test_sockets[0], packet_ptr, NX_NO_WAIT); + + /* Disconnect immediately. */ + nx_tcp_socket_disconnect(&test_sockets[0], NX_IP_PERIODIC_RATE); + + if (tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + } + + /* Let another two sockets connect to Telnet server without block. */ + nx_tcp_client_socket_connect(&test_sockets[1], SERVER_ADDRESS, NX_TELNET_SERVER_PORT, NX_NO_WAIT); + nx_tcp_client_socket_connect(&test_sockets[2], SERVER_ADDRESS, NX_TELNET_SERVER_PORT, NX_NO_WAIT); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the state of sockets is ESTABLISHED. */ + if (test_sockets[1].nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + error_counter++; + } + if (test_sockets[2].nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + error_counter++; + } + + status = nx_telnet_server_stop(&my_server); + status += nx_telnet_server_delete(&my_server); + if (status) + error_counter++; + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* This routine is called by the NetX Telnet Server whenever a new Telnet client + connection is established. */ +static void telnet_new_connection(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ +} + +/* This routine is called by the NetX Telnet Server whenever data is present on a Telnet client + connection. */ +static void telnet_receive_data(NX_TELNET_SERVER *server_ptr, UINT logical_connection, NX_PACKET *packet_ptr) +{ + nx_packet_release(packet_ptr); + tx_semaphore_put(&sema_0); +} + + +/* This routine is called by the NetX Telnet Server whenever the client disconnects. */ +static void telnet_connection_end(NX_TELNET_SERVER *server_ptr, UINT logical_connection) +{ +} + +#else /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_telnet_two_listen_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: Telnet Two Listen Test....................................N/A\n"); + test_control_return(3); +} +#endif /* NX_TELNET_SERVER_USER_CREATE_PACKET_POOL */ + + diff --git a/test/regression/test/netxtestcontrol.c b/test/regression/test/netxtestcontrol.c new file mode 100644 index 00000000..11f7a74f --- /dev/null +++ b/test/regression/test/netxtestcontrol.c @@ -0,0 +1,3418 @@ +/* This is the test control routine the NetX TCP/IP stack. All tests are dispatched from this routine. */ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include +#include +#include "nx_ram_network_driver_test_1500.h" +#if defined(__linux__) && defined(USE_FORK) +#undef __suseconds_t_defined +#undef _STRUCT_TIMEVAL +#undef _SYS_SELECT_H +#include +#include +#include +#include + +void fork_child(); +#endif + +/* Version definitions check. */ +#if defined(__PRODUCT_NETXDUO__) + +#if defined(EXPECTED_MAJOR_VERSION) && ( !defined(__NETXDUO_MAJOR_VERSION__) || __NETXDUO_MAJOR_VERSION__ != EXPECTED_MAJOR_VERSION) +#error "__NETXDUO_MAJOR_VERSION__" +#endif /* Check __NETXDUO_MAJOR_VERSION__ */ + +#if defined(EXPECTED_MINOR_VERSION) && ( !defined(__NETXDUO_MINOR_VERSION__) || EXPECTED_MINOR_VERSION != __NETXDUO_MINOR_VERSION__) +#error "__NETXDUO_MINOR_VERSION__" +#endif /* Check __NETXDUO_MINOR_VERSION__ */ + +#elif defined(__PRODUCT_NETX__) + +#if defined(EXPECTED_MAJOR_VERSION) && (!defined(__NETX_MAJOR_VERSION__) || __NETX_MAJOR_VERSION__ != EXPECTED_MAJOR_VERSION) +#error "__NETX_MAJOR_VERSION__" +#endif /* Check __NETX_MAJOR_VERSION__ */ + +#if defined(EXPECTED_MINOR_VERSION) && ( !defined(__NETX_MINOR_VERSION__) || EXPECTED_MINOR_VERSION != __NETX_MINOR_VERSION__) +#error "__NETX_MINOR_VERSION__" +#endif /* Check __NETX_MINOR_VERSION__ */ + +#else /* ! __PRODUCT_NETXDUO__ and !__PRODUCT_NETX__ */ +#error "__PRODUCT_XXX__ not found." +#endif /* ! __PRODUCT_NETXDUO__ and !__PRODUCT_NETX__ */ + +/* +#define NETXTEST_TIMEOUT_DISABLE +*/ + + FILE *stream; + +#define TEST_STACK_SIZE 4096 + +/* 1 minute. */ +#define TEST_TIMEOUT_LOW (60 * NX_IP_PERIODIC_RATE) +/* 15 minutes. */ +#define TEST_TIMEOUT_MID (900 * NX_IP_PERIODIC_RATE) +/* 120 minutes. */ +#define TEST_TIMEOUT_HIGH (7200 * NX_IP_PERIODIC_RATE) + +/* Define the test control ThreadX objects... */ + +TX_THREAD test_control_thread; +#ifndef NETXTEST_TIMEOUT_DISABLE +TX_SEMAPHORE test_control_sema; +#endif + +/* Define the test control global variables. */ + +ULONG test_control_return_status; +ULONG test_control_successful_tests; +ULONG test_control_failed_tests; +ULONG test_control_warning_tests; +ULONG test_control_na_tests; + +/* Remember the start of free memory. */ + +UCHAR *test_free_memory_ptr; + +extern volatile UINT _tx_thread_preempt_disable; + +/* Define test entry pointer type. */ + +typedef struct TEST_ENTRY_STRUCT +{ + VOID (*test_entry)(void *); + UINT timeout; +} TEST_ENTRY; + + +/* Define the prototypes for the test entry points. */ +void netx_api_compile_test_application_define(void*); +void netx_caller_check_test_application_define(void*); +void netx_packet_payload_size_test_application_define(void *); +void netx_checksum_test_application_define(void *); +void netx_netx_ramdriver_callback_application_define(void *); +void netx_old_api_application_define(void *); +void netx_utility_test_application_define(void *); + +void netx_arp_basic_test_application_define(void *); +void netx_arp_conflict_test_application_define(void *); +void netx_arp_dynamic_entry_test_application_define(void *); +void netx_arp_dynamic_entry_test2_application_define(void *); +void netx_arp_dynamic_entry_test3_application_define(void *); +void netx_arp_dynamic_entry_set_test_application_define(void *); +void netx_arp_dynamic_entry_fail_test_application_define(void *); +void netx_arp_dynamic_entry_timeout_test_application_define(void *); +void netx_arp_dynamic_invalidate_test_application_define(void *); +void netx_arp_gratuitous_test_application_define(void *); +void netx_arp_static_entries_delete_test_application_define(void *); +void netx_arp_static_entry_create_test_application_define(void *); +void netx_arp_static_entry_test_application_define(void *); +void netx_arp_static_entry_pollute_test_application_define(void *); +void netx_arp_entry_cache_test_application_define(void *); +void netx_arp_entry_abnormal_operation_test_application_define(void *); +void netx_arp_queue_depth_test_application_define(void *); +void netx_arp_nxe_api_test_application_define(void *); +void netx_arp_dual_pool_test_application_define(void *); +void netx_arp_invalid_type_test_application_define(void *); +void netx_arp_auto_entry_test_application_define(void *); +void netx_arp_no_duplicate_entry_application_define(void *); +void netx_arp_packet_allocate_test_application_define(void *); +void netx_arp_branch_test_application_define(void*); + +void netx_icmp_ping_test_application_define(void *); +void netx_icmp_ping_fragment_test_application_define(void *); +void netx_icmp_ping6_test_application_define(void *); +void netx_icmp_ping6_data_append_test_application_define(void *); +void netx_icmp_ping6_fragment_test_application_define(void *); +void netx_icmp_interface2_ping_test_application_define(void *); +void netx_icmp_interface2_ping6_test_application_define(void *); +void netx_icmp_invalid_source_test_application_define(void *); +void netx_icmp_cleanup_test_application_define(void *); +void netx_icmp_packet_receive_function_test_application_define(void *); +void netx_icmp_multiple_ping_test1_application_define(void *); +void netx_icmp_multiple_ping_test2_application_define(void *); +void netx_icmp_multiple_ping6_test1_application_define(void *); +void netx_icmp_multiple_ping6_test2_application_define(void *); +void netx_icmp_nxe_api_test_application_define(void *); +void netx_icmp_send_error_message_test_application_define(void *); +void netx_icmp_send_error_message_test_1_application_define(void *); +void netx_icmp_loopback_test_application_define(void *); +void netx_icmp_loopback_test2_application_define(void *); +void netx_icmp_loopback_fail_test_application_define(void *); +void netx_icmp_invalid_echo_reply_test_application_define(void *); +void netx_icmp_ping_multicast_test_application_define(void *); +void netx_icmp_branch_test_application_define(void *); +void netx_icmp_broadcast_ping_test_application_define(void *); + +void netx_icmpv6_error_test_application_define(void *first_unused_memory); +void netx_icmpv6_error_small_packet_test_application_define(void *first_unused_memory); +void netx_icmpv6_DAD_test_application_define(void *); +void netx_icmpv6_echo_request_test_application_define(void *); +void netx_icmpv6_echo_reply_test_application_define(void *); +void netx_icmpv6_redirect_test_application_define(void *first_unused_memory); +void netx_icmpv6_ra_flag_callback_test_application_define(void *first_unused_memory); +void netx_icmpv6_solicitated_ra_test_application_define(void *first_unused_memory); +void netx_icmpv6_abnormal_mtu_in_ra_test_application_define(void *first_unused_memory); +void netx_icmpv6_invalid_length_test_application_define(void *first_unused_memory); +void netx_icmpv6_invalid_length_test2_application_define(void *first_unused_memory); +void netx_icmpv6_invalid_ra_dest_test_application_define(void *first_unused_memory); +void netx_icmpv6_ra_lifetime_test_application_define(void *first_unused_memory); +void netx_icmpv6_router_solicitation_test_application_define(void *first_unused_memory); +void netx_icmpv6_invalid_na_application_define(void *first_unused_memory); +void netx_icmpv6_na_test_application_define(void *first_unused_memory); +void netx_icmpv6_na_tlla_changed_test_application_define(void *first_unused_memory); +void netx_icmpv6_na_buffer_overwrite_test_application_define(void *first_unused_memory); +void netx_icmpv6_redirect_nd_full_test_application_define(void *first_unused_memory); +void netx_icmpv6_redirect_buffer_overwrite_test_application_define(void *first_unused_memory); +void netx_icmpv6_destination_table_periodic_test_application_define(void *first_unused_memory); +void netx_icmpv6_mtu_option_test_application_define(void *first_unused_memory); +void netx_icmpv6_branch_test_application_define(void *); +void netx_icmpv6_ra_address_full_test_application_define(void *first_unused_memory); +void netx_icmpv6_ra_slla_changed_test_application_define(void *first_unused_memory); +void netx_icmpv6_ra_router_full_test_application_define(void *first_unused_memory); +void netx_icmpv6_invalid_message_test_application_define(void *); +void netx_icmpv6_ra_invalid_length_test_application_define(void *); +void netx_icmpv6_ra_buffer_overwrite_test_application_define(void *); +void netx_icmpv6_ns_with_small_packet_test_application_define(void *); +void netx_icmpv6_ns_buffer_overwrite_test_application_define(void *first_unused_memory); +void netx_icmpv6_invalid_ra_option_test_application_define(void *); +void netx_icmpv6_too_big_buffer_overwrite_test_application_define(void *); + +void netx_igmp_basic_test_application_define(void *); +void netx_igmp_multicast_basic_test_application_define(void *); +void netx_igmp_loopback_test_application_define(void *); +void netx_igmp_packet_receive_function_test_application_define(void *); +void netx_igmp_router_query_test_application_define(void *); +void netx_igmp_nxe_api_test_application_define(void *); +void netx_igmp_leave_test_application_define(void *); +void netx_igmp_join_fail_test_application_define(void *); +void netx_igmp_checksum_computation_test_application_define(void *); +void netx_igmp_branch_test_application_define(void *); +void netx_igmp_interface_indirect_report_send_test_application_define(void *); + + +void netx_nd_cache_api_test_application_define(void *); +void netx_nd_cache_under_interface_detach_test_application_define(void *); +void netx_nd_cache_with_own_address_test_application_define(void *); +void netx_nd_cache_add_test_application_define(void *); +void netx_nd_cache_nxe_api_test_application_define(void *); +void netx_nd_cache_branch_test_application_define(void *); +void netx_dest_table_add_fail_test_application_define(void *); + +void netx_ip_basic_test_application_define(void *); +void netx_ip_link_status_test_application_define(void *); +void netx_ip_create_test_application_define(void *); +void netx_ip_delete_test_application_define(void *); +void netx_ip_status_check_test_application_define(void*); +void netx_ip_fragmentation_order_test_application_define(void *); +void netx_ip_fragmentation_test_application_define(void *); +void netx_ip_fragmentation_disable_test_application_define(void *); +void netx_ip_fragmentation_timeout_check_test_application_define(void *); +void netx_ip_fragmentation_timeout_check_test_2_application_define(void *); +void netx_ip_fragmentation_time_exceeded_message_test_application_define(void *); +void netx_ip_fragmentation_duplicate_test_application_define(void *); +void netx_ip_fragmentation_dispatch_fail_test_application_define(void *); +void netx_ip_fragmentation_packet_copy_test_application_define(void *); +void netx_ip_fragmentation_packet_delay_test_application_define(void *); +void netx_ip_fragmentation_packet_drop_test_application_define(void *); +void netx_ip_fragmentation_wrong_destination_address_test_application_define(void *); +void netx_ip_fragmentation_wrong_protocol_field_test_application_define(void *); +void netx_ip_fragmentation_wrong_protocol_field_test2_application_define(void *); +void netx_ip_interface_attachment_test_application_define(void*); +void netx_ip_interface_detachment_test_application_define(void*); +void netx_ip_interface_detachment_tcp_connection_test_application_define(void*); +void netx_ip_interface_detachment_arp_table_test_application_define(void*); +void netx_ip_interface_detachment_gateway_test_application_define(void*); +void netx_ip_interface_status_check_fail_test_application_define(void*); +void netx_ip_interface_status_check_test_application_define(void*); +void netx_ip_interface_address_get_test_application_define(void*); +void netx_ip_interface_address_set_test_application_define(void*); +void netx_ip_interface_info_get_test_application_define(void*); +void netx_ip_interface_capability_test_application_define(void *); +void netx_ip_interface_physical_address_set_fail_test_application_define(void *); +void netx_ip_interface_physical_address_test_application_define(void *); +void netx_ip_max_payload_size_find_test_application_define(void*); +void netx_ip_address_get_test_application_define(void*); +void netx_ip_address_set_test_application_define(void*); +void netx_ip_address_change_notify_test_application_define(void*); +void netx_ip_address_conflict_callback_test_application_define(void*); +void netx_ip_address_conflict_detection_test_application_define(void*); +void netx_ip_auxiliary_packet_pool_set_test_application_define(void*); +void netx_ip_multicast_interface_detach_test_application_define(void *); +void netx_ip_gateway_address_test_application_define(void*); +void netx_ip_static_route_add_test_application_define(void*); +void netx_ip_static_route_delete_test_application_define(void*); +void netx_ip_static_route_find_test_application_define(void*); +void netx_ip_invalid_packet_receive_test_application_define(void*); +void netx_ip_chain_packet_process_test_application_define(void*); +void netx_ip_nxe_api_test_application_define(void *); +void netx_ip_abnormal_packet_test_application_define(void *); +void netx_ip_link_local_address_test_application_define(void *); +void netx_ip_route_reachable_test_application_define(void *); +void netx_ip_packet_filter_test_application_define(void *); +void netx_ip_packet_filter_extended_test_application_define(void *); +void netx_ip_driver_deferred_test_application_define(void *); +void netx_ip_loopback_multihome_test_application_define(void *); +void netx_ip_branch_test_application_define(void *); +void netx_ip_malformed_packet_test_application_define(void *); +void netx_ip_idle_scan_test_application_define(void *); + +void netx_ipv4_option_process_test_application_define(void *); + +void netx_ip_raw_packet_test_application_define(void *); +void netx_raw_special_test_application_define(void *); +void netx_raw_nxe_api_test_application_define(void *); +void netx_ip_raw_packet_filter_test_application_define(void *); +void netx_ip_raw_packet_queue_test_application_define(void *); +void netx_ipv6_raw_packet_test_application_define(void *); +void netx_ip_raw_loopback_test_application_define(void *); + +/* Forward function. */ +void netx_forward_icmp_ping_test_application_define(void *); +void netx_forward_icmp_ttl_test_application_define(void *); +void netx_forward_icmp_small_header_test_application_define(void *); +void netx_forward_icmp_small_header_test2_application_define(void *); +void netx_forward_icmp_small_header_test3_application_define(void *); +void netx_forward_multicast_test_application_define(void *); +void netx_forward_udp_test_application_define(void *); +void netx_forward_udp_fragment_test_application_define(void *); +void netx_forward_udp_fragment_test2_application_define(void *); +void netx_forward_udp_fragment_test3_application_define(void *); +void netx_forward_udp_fragment_test4_application_define(void *); +void netx_forward_tcp_test_1_application_define(void *); +void netx_forward_tcp_test_2_application_define(void *); +void netx_forward_tcp_test_3_application_define(void *); +void netx_forward_tcp_test_4_application_define(void *); +void netx_forward_tcp_test_5_application_define(void *); +void netx_forward_link_local_address_test_application_define(void *); + +void netx_ipv6_disable_test_application_define(void *); +void netx_ipv6_fragmentation_test_application_define(void *); +void netx_ipv6_fragmentation_error_test1_application_define(void *); +void netx_ipv6_fragmentation_error_test2_application_define(void *); +void netx_ipv6_default_router_api_test_application_define(void *); +void netx_ipv6_address_delete_application_define(void *); +void netx_ipv6_address_get_test_application_define(void *); +void netx_ipv6_address_set_test_application_define(void *); +void netx_ipv6_search_onlink_test_application_define(void *); +void netx_ipv6_multicast_basic_test_application_define(void *); +void netx_ipv6_multicast_ping_test_application_define(void *); +void netx_ipv6_multicast_ping_test1_application_define(void *); +void netx_ipv6_multicast_interface_detach_test_application_define(void *); +void netx_ipv6_stateless_address_autoconfig_application_define(void *); +void netx_ipv6_prefix_test_application_define(void *); +void netx_ipv6_hop_by_hop_option_error_test_application_define(void *); +void netx_ipv6_hop_by_hop_fragment_test_application_define(void *); +void netx_ipv6_util_api_test_application_define(void *); +void netx_ipv6_nxe_api_test_application_define(void *); +void netx_ipv6_send_fail_test_application_define(void *); +void netx_ipv6_default_router_test_application_define(void *); +void netx_ipv6_invalid_packet_receive_test_application_define(void *); +void netx_ipv6_packet_chain_test_application_define(void *); +void netx_ipv6_fragment_fail_test_application_define(void *); +void netx_ipv6_pmtu_test_application_define(void *); +void netx_ipv6_interface_detachment_router_test_application_define(void *); +void netx_ipv6_branch_test_application_define(void *); + +void netx_packet_basic_test_application_define(void *); +void netx_packet_data_append_test_application_define(void *); +void netx_packet_debug_info_test_application_define(void *); +void netx_packet_suspension_test_application_define(void *); +void netx_packet_nxe_api_test_application_define(void *); +void netx_packet_branch_test_application_define(void *); + +void netx_low_watermark_test_application_define(void *); +void netx_low_watermark_zero_window_test_application_define(void *); +void netx_low_watermark_fragment_test_application_define(void *); + +void netx_rarp_basic_processing_test_application_define(void *); +void netx_rarp_packet_allocate_fail_test_application_define(void *); +void netx_rarp_nxe_api_test_application_define(void *); +void netx_rarp_multiple_interfaces_test_application_define(void *); +void netx_rarp_branch_test_application_define(void*); + +void netx_tcp_duplicate_accept_test_application_define(void *); +void netx_tcp_ack_check_for_syn_message_test_application_define(void *); +void netx_tcp_ack_check_issue_test_application_define(void *); +void netx_tcp_ack_before_release_test_application_define(void *); +void netx_tcp_basic_processing_test_application_define(void *); +void netx_tcp_zero_window_test_application_define(void *); +void netx_tcp_zero_window_probe_test_application_define(void *); +void netx_tcp_zero_window_probe_test_2_application_define(void *); +void netx_tcp_zero_window_probe_test_3_application_define(void *); +void netx_tcp_fin_wait_recv_test_application_define(void *); +void netx_tcp_window_update_application_define(void *); +void netx_tcp_retransmit_test_application_define(void *); +void netx_tcp_retransmit_test_1_application_define(void *); +void netx_tcp_send_fail_test_application_define(void *); +void netx_tcp_send_fail_test2_application_define(void *); +void netx_tcp_send_fail_test3_application_define(void *); +void netx_tcp_listen_test_application_define(void *); +void netx_tcp_listen_packet_leak_test_application_define(void *); +void netx_tcp_socket_available_bytes_test_application_define(void *); +void netx_tcp_socket_delete_test_application_define(void *); +void netx_tcp_socket_unbind_test_application_define(void *); +void netx_tcp_socket_unbind_test2_application_define(void *); +void netx_tcp_socket_unaccept_test_application_define(void *); +void netx_tcp_socket_unlisten_test_application_define(void *); +void netx_tcp_socket_relisten_test_application_define(void *); +void netx_tcp_socket_relisten_test2_application_define(void *); +void netx_tcp_socket_listen_test_application_define(void *); +void netx_tcp_socket_listen_queue_test_application_define(void *); +void netx_tcp_server_socket_accept_test_application_define(void *); +void netx_tcp_connection_reset_test_application_define(void *); +void netx_tcp_fast_retransmit_test_application_define(void *); +void netx_tcp_data_transfer_test_application_define(void *); +void netx_tcp_data_trim_test_application_define(void *); +void netx_tcp_dropped_packet_test_application_define(void *); +void netx_tcp_dropped_packet_test2_application_define(void *); +void netx_tcp_fast_disconnect_test_application_define(void *); +void netx_tcp_loopback_test_application_define(void *); +void netx_tcp_out_of_order_packet_test_application_define(void *); +void netx_tcp_out_of_order_ack_test_application_define(void *); +// jlc temporarily omitting this one void netx_tcp_out_of_order_packet_max_test_application_define(void *); +void netx_tcp_small_window_preempt_test_application_define(void *); +void netx_tcp_small_window_test_application_define(void *); +void netx_tcp_ipv4_interface2_mss_test_application_define(void *); +void netx_tcp_ipv6_basic_processing_test_application_define(void *); +void netx_tcp_ipv6_interface2_mss_test_application_define(void *); +void netx_tcp_ipv6_window_scale_test_application_define(void *); +void netx_tcp_wrapping_sequence_test_application_define(void *); +void netx_tcp_wrapping_sequence_test2_application_define(void *); +void netx_tcp_wrapping_sequence_test3_application_define(void *); +void netx_tcp_wrapping_sequence_test4_application_define(void *); +void netx_tcp_queue_depth_nofity_application_define(void *); +void netx_tcp_client_bind_cleanup_test_application_define(void *); +void netx_tcp_transmit_cleanup_test_application_define(void *); +void netx_tcp_receive_cleanup_test_application_define(void *); +void netx_tcp_packet_receive_function_test_application_define(void *); +void netx_tcp_error_operation_check_test_application_define(void *); +void netx_tcp_socket_send_internal_test_application_define(void *); +void netx_tcp_socket_state_wait_test_application_define(void *); +void netx_tcp_keepalive_test_application_define(void *); +void netx_tcp_client_socket_port_get_test_application_define(void *); +void netx_tcp_client_socket_bind_test_application_define(void *); +void netx_tcp_client_packet_leak_test_application_define(void *); +void netx_tcp_client_socket_unbind_test_application_define(void *); +void netx_tcp_transmit_under_interface_detach_test_application_define(void *); +void netx_tcp_receive_under_interface_detach_test_application_define(void *); +void netx_tcp_receive_under_interface_detach_test2_application_define(void *); +void netx_tcp_max_window_scale_test_application_define(void *); +void netx_tcp_mss_option_test_application_define(void *); +void netx_tcp_socket_mss_test_application_define(void *); +void netx_tcp_fin_wait1_to_time_wait_test_application_define(void *); +void netx_tcp_time_wait_to_close_test_application_define(void *); +void netx_tcp_invalid_option_test_application_define(void *); +void netx_tcp_invalid_option_test2_application_define(void *); +void netx_tcp_out_of_window_control_packet_test_application_define(void *); +void netx_tcp_new_reno_algorithm_test1_application_define(void *); +void netx_tcp_new_reno_algorithm_test2_application_define(void *); +void netx_tcp_new_reno_algorithm_test3_application_define(void *); +void netx_tcp_new_reno_algorithm_test4_application_define(void *); +void netx_tcp_new_reno_algorithm_test5_application_define(void *); +void netx_tcp_nxe_api_test_application_define(void *); +void netx_tcp_large_mtu_test_application_define(void *); +void netx_tcp_large_mtu_test_2_application_define(void *); +void netx_tcp_simultaneous_test_application_define(void *); +void netx_tcp_send_disconnect_test_application_define(void *); +void netx_tcp_not_enabled_test_application_define(void *); +void netx_tcp_tx_queue_exceed_test_application_define(void *); +void netx_tcp_transmit_not_done_test_application_define(void *); +void netx_tcp_4_duplicate_ack_test_application_define(void *); +void netx_tcp_cwnd_test_application_define(void *); +void netx_tcp_urgent_packet_test_application_define(void *); +void netx_tcp_multiple_send_test_application_define(void *); +void netx_tcp_multiple_send_test2_application_define(void *); +void netx_tcp_reset_during_send_test_application_define(void *); +void netx_tcp_delayed_retransmission_test_application_define(void *); +void netx_tcp_delayed_retransmission_test_2_application_define(void *); +void netx_tcp_ipv6_delayed_retransmission_test_application_define(void *); +void netx_tcp_odd_window_test_application_define(void *); +void netx_tcp_chained_packet_test_application_define(void *); +void netx_tcp_branch_test_application_define(void *); +void netx_tcp_packet_leak_test_application_define(void *); +void netx_tcp_udp_random_port_test_application_define(void *); +void netx_tcp_invalid_length_test_application_define(void *); +void netx_tcp_large_data_transfer_test_application_define(void *); +void netx_tcp_small_packet_test_application_define(void *); +void netx_tcp_advertised_window_update_test_application_define(void *); +void netx_tcp_race_condition_test_application_define(void *); +void netx_tcp_race_condition_test2_application_define(void *); +void netx_tcp_socket_receive_rst_test_application_define(void *); +void netx_tcp_invalid_packet_chain_test_application_define(void *); + +void netx_udp_basic_processing_test_application_define(void *); +void netx_udp_socket_bind_test_application_define(void *); +void netx_udp_socket_delete_test_application_define(void *); +void netx_udp_socket_unbind_receive_test_application_define(void *); +void netx_udp_socket_unbind_test_application_define(void *); +void netx_udp_free_port_find_test_application_define(void *); +void netx_udp_source_send_test_application_define(void *); +void netx_udp_packet_receive_test_application_define(void *); +void netx_udp_fragment_test_application_define(void *); +void netx_udp_fragmentation_processing_test_application_define(void *); +void netx_nxd_udp_socket_send_special_test_application_define(void *); +void netx_udp_multiple_ports_test_application_define(void *); +void netx_udp_bind_cleanup_test_application_define(void *); +void netx_udp_packet_type_test_application_define(void *); +void netx_udp_nxe_api_test_application_define(void *); +void netx_udp_checksum_zero_test_application_define(void *); +void netx_udp_ipv4_interface2_test_1_test_application_define(void *); +void netx_udp_ipv6_interface2_test_1_test_application_define(void *); +void netx_udp_loopback_test_application_define(void *); +void netx_udp_port_unreachable_test_application_define(void *); +void netx_udp_port_table_update_test_application_define(void *); +void netx_udp_branch_test_application_define(void *); + +void netx_icmp_ping_tunnel_ipv4_ipv4_test_application_define(void *); +void netx_udp_tunnel_ipv4_ipv4_basic_test_application_define(void *); +void netx_tcp_tunnel_ipv4_ipv4_basic_test_application_define(void *); +void netx_udp_tunnel_ipv6_ipv4_basic_test_application_define(void *); +void netx_udp_tunnel_ipv4_ipv6_basic_test_application_define(void *); +void netx_udp_tunnel_ipv6_ipv6_basic_test_application_define(void *); +void netx_tcp_tunnel_ipv6_ipv4_basic_test_application_define(void *); +void netx_tcp_tunnel_ipv4_ipv6_basic_test_application_define(void *); +void netx_tcp_tunnel_ipv6_ipv6_basic_test_application_define(void *); +void netx_tcp_tunnel_ipv4_ipv6_address_test_application_define(void *); +void netx_icmp_ping_tunnel_ipv4_ipv6_test_application_define(void *); +void netx_icmp_ping6_tunnel_ipv6_ipv6_test_application_define(void *); +void netx_icmp_ping6_tunnel_ipv6_ipv4_test_application_define(void *); +void netx_tcp_tunnel_ipv4_ipv6_samll_windows_application_define(void *); +void netx_tcp_tunnel_ipv4_ipv6_big_packet_test_application_define(void *); +void netx_tcp_overlapping_packet_test_application_define(void *); +void netx_tcp_overlapping_packet_test_2_application_define(void *); +void netx_tcp_overlapping_packet_test_3_application_define(void *); +void netx_tcp_overlapping_packet_test_4_application_define(void *); +void netx_tcp_overlapping_packet_test_5_application_define(void *); +void netx_tcp_overlapping_packet_test_6_application_define(void *); +void netx_tcp_overlapping_packet_test_7_application_define(void *); +void netx_tcp_overlapping_packet_test_8_application_define(void *); +void netx_tcp_overlapping_packet_test_9_application_define(void *); +void netx_tcp_overlapping_packet_test_10_application_define(void *); +void netx_tcp_overlapping_packet_test_11_application_define(void *); +void netx_tcp_overlapping_packet_test_12_application_define(void *); +void netx_tcp_overlapping_packet_test_13_application_define(void *); +void netx_tcp_overlapping_packet_test_14_application_define(void *); +void netx_tcp_overlapping_packet_test_15_application_define(void *); +void netx_tcp_overlapping_packet_test_16_application_define(void *); +void netx_tcp_overlapping_packet_test_17_application_define(void *); +void netx_tcp_overlapping_packet_test_18_application_define(void *); + +/* TCP tests*/ +void netx_1_01_application_define(void *); +void netx_1_02_application_define(void *); +void netx_1_03_application_define(void *); +void netx_1_04_application_define(void *); +void netx_1_04_ipv6_application_define(void *); +void netx_1_05_application_define(void *); +void netx_1_17_application_define(void *); +void netx_1_18_application_define(void *); +void netx_1_19_01_application_define(void *); +void netx_1_19_02_application_define(void *); +void netx_1_19_03_application_define(void *); +void netx_1_20_application_define(void *); +void netx_1_21_01_application_define(void *); +void netx_1_21_02_application_define(void *); +void netx_1_26_01_application_define(void *); +void netx_1_26_02_application_define(void *); +void netx_1_27_01_application_define(void *); +void netx_1_27_02_application_define(void *); +void netx_1_27_03_application_define(void *); +void netx_1_27_04_application_define(void *); +void netx_2_01_application_define(void *); +void netx_2_02_application_define(void *); +void netx_2_17_application_define(void *); +void netx_2_20_application_define(void *); +void netx_3_01_application_define(void *); +void netx_3_02_application_define(void *); +void netx_3_03_application_define(void *); +void netx_3_04_application_define(void *); +void netx_3_06_application_define(void *); +void netx_3_07_application_define(void *); +void netx_3_08_application_define(void *); +void netx_3_17_application_define(void *); +void netx_3_18_application_define(void *); +void netx_3_19_application_define(void *); +void netx_3_20_application_define(void *); +void netx_3_21_application_define(void *); +void netx_3_23_application_define(void *); +void netx_4_01_application_define(void *); +void netx_4_17_application_define(void *); +void netx_4_21_application_define(void *); +void netx_4_23_application_define(void *); +void netx_4_24_application_define(void *); +void netx_4_25_application_define(void *); +void netx_4_26_application_define(void *); +void netx_4_27_application_define(void *); +void netx_4_28_application_define(void *); +void netx_4_29_application_define(void *); +void netx_5_18_application_define(void *); +void netx_5_19_application_define(void *); +void netx_5_20_application_define(void *); +void netx_5_21_application_define(void *); +void netx_5_22_application_define(void *); +void netx_5_23_application_define(void *); +void netx_5_24_application_define(void *); +void netx_5_25_application_define(void *); +void netx_6_17_application_define(void *); +void netx_6_18_application_define(void *); +void netx_6_20_application_define(void *); +void netx_6_22_01_application_define(void *); +void netx_6_22_02_application_define(void *); +void netx_6_23_application_define(void *); +void netx_6_24_application_define(void *); +void netx_6_25_application_define(void *); +void netx_6_27_application_define(void *); +void netx_6_28_application_define(void *); +void netx_6_29_application_define(void *); +void netx_6_32_application_define(void *); +void netx_8_01_application_define(void *); +void netx_8_02_application_define(void *); +void netx_8_17_application_define(void *); +void netx_8_18_application_define(void *); +void netx_8_19_application_define(void *); +void netx_8_20_application_define(void *); +void netx_8_21_application_define(void *); +void netx_8_29_01_application_define(void *); +void netx_8_29_02_application_define(void *); +void netx_8_29_03_application_define(void *); +void netx_8_29_04_application_define(void *); +void netx_9_17_application_define(void *); +void netx_9_18_application_define(void *); +void netx_9_19_01_application_define(void *); +void netx_9_19_02_application_define(void *); +void netx_9_20_application_define(void *); +void netx_9_21_01_application_define(void *); +void netx_9_21_02_application_define(void *); +void netx_9_22_application_define(void *); +void netx_9_27_application_define(void *); +void netx_10_23_01_application_define(void *); +void netx_10_23_02_application_define(void *); +void netx_10_24_01_application_define(void *); +void netx_10_24_02_application_define(void *); +void netx_10_24_03_application_define(void *); +void netx_10_25_application_define(void *); +void netx_10_26_application_define(void *); +void netx_11_18_application_define(void *); +void netx_11_19_application_define(void *); +void netx_11_23_application_define(void *); +void netx_11_24_application_define(void *); +void netx_11_25_application_define(void *); +void netx_11_26_application_define(void *); +void netx_11_27_application_define(void *); +void netx_11_28_application_define(void *); +void netx_11_29_application_define(void *); +void netx_12_01_application_define(void *); +void netx_12_02_application_define(void *); +void netx_12_03_application_define(void *); +void netx_12_04_application_define(void *); +void netx_12_17_application_define(void *); +void netx_12_18_application_define(void *); +void netx_12_19_application_define(void *); +void netx_12_20_application_define(void *); +void netx_12_21_application_define(void *); +void netx_12_23_application_define(void *); +void netx_12_24_application_define(void *); +void netx_12_25_application_define(void *); +void netx_12_26_application_define(void *); +void netx_12_27_application_define(void *); +void netx_12_30_application_define(void *); +void netx_12_31_application_define(void *); +void netx_13_01_application_define(void *); +void netx_13_02_application_define(void *); +void netx_13_04_application_define(void *); +void netx_13_05_application_define(void *); +void netx_13_17_application_define(void *); +void netx_14_19_application_define(void *); +void netx_14_20_application_define(void *); +void netx_15_03_application_define(void *); +void netx_15_20_application_define(void *); +void netx_15_21_application_define(void *); +void netx_15_24_application_define(void *); +void netx_15_25_application_define(void *); +void netx_15_26_application_define(void *); +void netx_16_02_application_define(void *); +void netx_16_17_application_define(void *); +void netx_16_19_application_define(void *); +void netx_16_21_application_define(void *); +void netx_16_22_application_define(void *); +void netx_17_17_application_define(void *); +void netx_18_21_application_define(void *); +void netx_23_02_01_application_define(void *); +void netx_23_02_02_application_define(void *); +void netx_23_02_03_application_define(void *); +void netx_23_02_04_application_define(void *); +void netx_101_17_application_define(void *); +void netx_101_18_application_define(void *); +void netx_102_18_application_define(void *); +void netx_102_19_application_define(void *); +void netx_102_20_application_define(void *); +void netx_102_21_application_define(void *); +void netx_102_22_application_define(void *); +void netx_102_23_application_define(void *); +void netx_102_24_application_define(void *); +void netx_102_25_application_define(void *); +void netx_103_17_application_define(void *); +void netx_104_17_application_define(void *); +void netx_106_17_application_define(void *); + + +/* Applications. */ + +/* Application tests do not support for 64-bit mode yet. */ +#ifndef XWARE_64 +/* IPSec specific function and encryption algorithm */ +void netx_ipsec_esp_transport_icmp_ipv4_icv_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_multiple_sas_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_key_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_spi_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_selector_port_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_retransmit_test_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_selector_next_layer_protocol_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_selector_policy_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_selector_type_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_selector_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_3des_basic_test_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_3des_interface_test_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_basic_test_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_interface_test_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_256_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_3des_null_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_3des_aes_xcbc_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_3des_md5_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_3des_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_192_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_aes_xcbc_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_md5_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_192_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_256_sha1_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_aes_xcbc_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_md5_test_define_application_define(void *); + +/* Combination of IPsec function and TCP/UDP/ICMP.. function. */ +void netx_ipsec_esp_transport_tcp_ipv4_test_define_application_define(void *); +void netx_ipsec_esp_transport_udp_ipv4_test_define_application_define(void *); +void netx_ipsec_esp_transport_udp_ipv4_selector_test_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv4_test_define_application_define(void *); + +void netx_ipsec_esp_tunnel_tcp_ipv4_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_udp_ipv4_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_icmp_ipv4_test_define_application_define(void *); + +void netx_ipsec_esp_transport_tcp_ipv4_interface2_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_tcp_ipv4_interface2_test_define_application_define(void *); + +void netx_ipsec_ah_transport_tcp_ipv4_basic_test_application_define(void *); +void netx_ipsec_ah_transport_tcp_ipv4_retransmit_test_application_define(void *); +void netx_ipsec_ah_transport_tcp_ipv4_test_define_application_define(void *); +void netx_ipsec_ah_transport_udp_ipv4_selector_test_application_define(void *); +void netx_ipsec_ah_transport_udp_ipv4_test_define_application_define(void *); +void netx_ipsec_ah_transport_icmp_ipv4_test_define_application_define(void *); + +void netx_ipsec_ah_tunnel_tcp_ipv4_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_udp_ipv4_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_icmp_ipv4_test_define_application_define(void *); + + +/* IPsec with IPv6 address.*/ +void netx_ipsec_esp_transport_tcp_ipv6_3des_interface_test_application_define(void*); +void netx_ipsec_esp_transport_tcp_ipv6_aes_interface_test_application_define(void*); +void netx_ipsec_esp_transport_tcp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_udp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_udp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_icmp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv6_interface2_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_transport_tcp_ipv6_interface2_global_address_test_define_application_define(void *); + +void netx_ipsec_esp_tunnel_tcp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_tcp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_udp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_icmp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_icmp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_tcp_ipv6_interface2_linklocal_address_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_tcp_ipv6_interface2_global_address_test_define_application_define(void *); + +void netx_ipsec_ah_transport_tcp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_ah_transport_tcp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_ah_transport_udp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_ah_transport_udp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_ah_transport_icmp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_ah_transport_icmp_ipv6_global_address_test_define_application_define(void *); + +void netx_ipsec_ah_tunnel_tcp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_tcp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_udp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_udp_ipv6_global_address_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_icmp_ipv6_linklocal_address_test_define_application_define(void *); +void netx_ipsec_ah_tunnel_icmp_ipv6_global_address_test_define_application_define(void *); + +/* IPsec with Fragment function. */ +void netx_ipsec_esp_transport_udp_ipv6_linklocal_address_fragment_test_define_application_define(void *); +void netx_ipsec_esp_transport_udp_ipv6_global_address_fragment_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_fragment_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_udp_ipv6_global_address_fragment_test_define_application_define(void *); +void netx_ipsec_esp_transport_udp_ipv4_fragment_test_define_application_define(void *); +void netx_ipsec_esp_tunnel_udp_ipv4_fragment_test_define_application_define(void *); + + +/* AUTO IP. */ +void netx_auto_ip_basic_test_application_define(void *); +void netx_auto_ip_address_check_test_application_define(void *); +void netx_auto_ip_announce_num_test_application_define(void *); +void netx_auto_ip_arp_dest_addr_test_application_define(void *); +void netx_auto_ip_conflicts_check_test_application_define(void *); +void netx_auto_ip_max_conflicts_test_application_define(void *); + + +/* WebSocket. */ +void netx_websocket_fin_test_application_define(void *); +void netx_websocket_opcode_test_application_define(void *); +void netx_websocket_connect_test_application_define(void *); +void netx_websocket_disconnect_test_application_define(void *); +void netx_websocket_mask_test_application_define(void *); +void netx_websocket_one_frame_in_packets_test_application_define(void *); +void netx_websocket_one_packet_with_multi_frames_test_application_define(void *); +void netx_websocket_16_bit_payload_length_test_application_define(void *); +void netx_websocket_delete_test_application_define(void *); +void netx_websocket_multi_instance_test_application_define(void *); +void netx_websocket_non_block_test_application_define(void *); +void netx_websocket_send_chain_packets_test_application_define(void *); + + +/* HTTP. */ +void netx_http_basic_test_application_define(void *); +void netx_http_status_501_test_application_define(void *); +void netx_http_if_modified_since_test_application_define(void *); +void netx_http_head_basic_test_application_define(void *); +void netx_http_post_basic_test_application_define(void *); +void netx_http_delete_basic_test_application_define(void *); +void netx_http_basic_authenticate_test_application_define(void *); +void netx_http_status_400_test_application_define(void *); +void netx_http_status_404_test_application_define(void *); +void netx_http_multipart_fragment_test_application_define(void *); +void netx_http_multipart_underflow_test_application_define(void *); +void netx_http_get_content_length_test_application_define(void *); +void netx_http_get_contentlength_packetleak_test_application_define(void *); +void netx_http_client_change_connect_port_test_application_define(void *); +void netx_http_get_put_referred_URI_test_application_define(void *); +void netx_http_request_in_multiple_packets_test_application_define(void *); +void netx_http_digest_authenticate_test_application_define(void *); +void netx_http_server_type_retrieve_test_application_define(void *); +void netx_http_digest_authenticate_timeout_test_application_define(void *); + +/*HTTP Proxy. */ +void netx_http_proxy_basic_test_application_define(void *); +void netx_http_proxy_non_block_test_application_define(void *); +void netx_http_proxy_multiple_response_test_application_define(void *); +void netx_http_proxy_error_response_test_application_define(void *); +void netx_http_proxy_disconnect_test_application_define(void *); +void netx_http_proxy_data_fin_test_application_define(void *); + + +/* FTP. */ +void netx_ftp_basic_test_application_define(void *); +void netx_ftp_access_control_commands_01_test_application_define(void *); +void netx_ftp_access_control_commands_02_test_application_define(void *); +void netx_ftp_access_control_commands_03_test_application_define(void *); +void netx_ftp_access_control_commands_04_test_application_define(void *); +void netx_ftp_commands_characters_test_application_define(void *); +void netx_ftp_commands_replys_test_application_define(void *); +void netx_ftp_control_connection_test_application_define(void *); +void netx_ftp_data_connection_test_application_define(void *); +void netx_ftp_establish_data_connection_03_test_application_define(void *); +void netx_ftp_establish_data_connection_05_test_application_define(void *); +void netx_ftp_establish_data_connection_06_test_application_define(void *); +void netx_ftp_establish_data_connection_08_test_application_define(void *); +void netx_ftp_service_commands_dele_test_application_define(void *); +void netx_ftp_service_commands_m_d_dir_test_application_define(void *); +void netx_ftp_service_commands_nlist_test_application_define(void *); +void netx_ftp_service_commands_rename_test_application_define(void *); +void netx_ftp_service_commands_RETR_STOR_test_application_define(void *); +void netx_ftp_user_data_type_application_define(void *); +void netx_ftp_service_commands_file_write_test_application_define(void *); +void netx_ftp_client_pasv_denied_test_application_define(void *); +void netx_ftp_client_pasv_file_read_test_application_define(void *); +void netx_ftp_client_pasv_file_write_test_application_define(void *); +void netx_ftp_client_invalid_username_password_length_test_application_define(void *first_unused_memory); +void netx_ftp_client_multiple_connection_response_test_application_define(void*); +void netx_ftp_client_packet_leak_test_application_define(void *first_unused_memory); +void netx_ftp_client_buffer_overflow_test_application_define(void *first_unused_memory); +void netx_ftp_client_file_write_fail_test_application_define(void *); +void netx_ftp_server_invalid_month_crash_test_application_define(void *first_unused_memory); +void netx_ftp_server_mss_too_small_test_application_define(void *first_unused_memory); +void netx_ftp_rst_test_application_define(void *first_unused_memory); +void netx_ftp_two_listen_test_application_define(void *first_unused_memory); +void netx_ftp_parse_ipv6_address_test_application_define(void *); +void netx_ftp_server_abnormal_packet_test_application_define(void *); +void netx_ftp_server_list_command_test_application_define(void *); +void netx_ftp_server_dangling_pinter_test_application_define(void *); +void netx_ftp_pasv_twice_test_application_define(void *); +void netx_ftp_disconnection_event_test_application_define(void *); +void netx_ftp_ipv6_epsv_test_application_define(void *); +void netx_ftp_pasv_port_test_application_define(void *); +void netx_ftp_pasv_stor_test_application_define(void *); + + +/* PPP test. */ +void netx_ppp_IPCP_timeout_test_application_define(void *); +void netx_ppp_LCP_timeout_test_application_define(void *); +void netx_ppp_chap_bad_secret_failed_retry_test_application_define(void *); +void netx_ppp_chap_bad_secret_passed_on_retry_test_application_define(void *); +void netx_ppp_check_boundary_test_application_define(void *); +void netx_ppp_request_dns_server_test_application_define(void *); +void netx_ppp_PAP_bad_password_test_application_define(void *); +void netx_ppp_PAP_bad_username_test_application_define(void *); +void netx_ppp_pap_null_name_password_test_application_define(void *); +void netx_ppp_LCP_invalid_packet_test_application_define(void *); +void netx_ppp_IPCP_abnormal_packet_test_application_define(void *); +void netx_ppp_IPCP_nak_test_application_define(void *); +void netx_ppp_IPCP_retransmit_test_application_define(void *); +void netx_ppp_pap_basic_test_application_define(void *); +void netx_ppp_pfc_option_test_application_define(void *); +void netx_ppp_acfc_option_test_application_define(void *); + + +/* PPPoE test. */ +void netx_pppoe_basic_test_application_define(void *); +void netx_pppoe_api_test_application_define(void *); +void netx_pppoe_api_extended_test_application_define(void *); +void netx_pppoe_ac_name_test_application_define(void *); +void netx_pppoe_session_control_test_application_define(void *); + +/* RTP test. */ +void netx_rtp_multi_interfaces_test_application_define(void *first_unused_memory); +void netx_rtp_session_packet_send_test_application_define(void *first_unused_memory); +void netx_rtp_session_jpeg_send_test_application_define(void *first_unused_memory); +void netx_rtp_session_h264_send_test_application_define(void *first_unused_memory); +void netx_rtp_session_aac_send_test_application_define(void *first_unused_memory); +void netx_rtp_free_udp_port_find_test_application_define(void *first_unused_memory); +void netx_rtp_multi_clients_test_application_define(void *first_unused_memory); +void netx_rtp_multicast_test_application_define(void *first_unused_memory); +void netx_rtp_basic_test_application_define(void *first_unused_memory); +void netx_rtp_api_test_application_define(void *first_unused_memory); +void netx_rtcp_abnormal_packet_test_application_define(void *first_unused_memory); +void netx_rtcp_packet_process_test_application_define(void *first_unused_memory); +void netx_rtcp_packet_send_test_application_define(void *first_unused_memory); +void netx_rtcp_basic_test_application_define(void *first_unused_memory); + +/* RTSP test. */ +void netx_rtsp_api_test_application_define(void *); +void netx_rtsp_rtp_basic_test_application_define(void *); +void netx_rtsp_rtp_ipv6_basic_test_application_define(void *); +void netx_rtsp_rtp_multicast_test_application_define(void *); +void netx_rtsp_rtp_ipv6_multicast_test_application_define(void *); +void netx_rtsp_multiple_request_test_application_define(void *); +void netx_rtsp_multiple_clients_test_application_define(void *); +void netx_rtsp_client_timeout_test_application_define(void *); +void netx_rtsp_error_response_test_application_define(void *); +void netx_rtsp_delete_beforehand_test_application_define(void *); + +/* TFTP. */ +void netx_tftp_basic_test_application_define(void *); +#ifdef FEATURE_NX_IPV6 +void netx_tftp_ipv6_basic_test_application_define(void *); +#endif +void netx_tftp_read_interaction_test_application_define(void *); +void netx_tftp_write_interaction_test_application_define(void *); +void netx_tftp_error_destination_port_test_application_define(void *); +void netx_tftp_error_file_name_test_application_define(void *); +void netx_tftp_large_data_test_application_define(void *); +void netx_tftp_malformed_packet_test_application_define(void *); + + +/* TELNET. */ +void netx_telnet_create_packet_pool_test_application_define(void *); +void netx_telnet_max_connections_test_application_define(void *); +void netx_telnet_activity_timeout_test_application_define(void *); +void netx_telnet_server_options_negotiate_test_application_define(void *); +void netx_telnet_server_bad_option_reply_test_application_define(void *); +void netx_telnet_rst_test_application_define(void *); +void netx_telnet_two_listen_test_application_define(void *); + + +/* SNTP. */ +void netx_sntp_client_unicast_basic_test_application_define(void *); +void netx_sntp_client_broadcast_basic_test_application_define(void *); +void netx_sntp_client_ipv6_unicast_basic_test_application_define(void *); +void netx_sntp_client_ipv6_broadcast_basic_test_application_define(void *); +void netx_sntp_request_unicast_test_application_define(void *); +void netx_sntp_forward_unicast_update_test_application_define(void *); +void netx_sntp_client_unicast_display_date_test_application_define(void *); +void netx_sntp_client_seconds_to_date_test_application_define(void *); +void netx_sntp_client_kod_test_application_define(void *); +void netx_sntp_client_packet_chain_test_application_define(void *); + + +/* SNMP Agent */ +void netx_snmp_v1_buffer_overwrite_test_application_define(void *); +void netx_snmp_v1_object_id_buffer_overwrite_test_application_define(void *); +void netx_snmp_v1_packet_double_release_test_application_define(void *); +void netx_snmp_basic_v2_test_application_define(void*); +void netx_snmp_v2_get_bulk_request_test_application_define(void *); +void netx_snmp_v2_unknown_oid_test_application_define(void*); +void netx_snmp_v2_send_trap_test_application_define(void*); +void netx_snmp_v2_buffer_overwrite_test_application_define(void *); +void netx_snmp_v3_nosec_traplist_test_application_define(void *); +void netx_snmp_v3_md5_failed_security_test_application_define(void *); +void netx_snmp_v3_no_security_application_define(void*); +void netx_snmp_v3_md5_security_test_application_define(void *); +void netx_snmp_v3_md5_security_extended_test_application_define(void *); +void netx_snmp_v3_buffer_overwrite_test_application_define(void *); +void netx_snmp_v3_decrypt_pdu_buffer_overwrite_test_application_define(void *); +void netx_snmp_v3_encrypt_pdu_buffer_overwrite_test_application_define(void *); +void netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test_application_define(void *); +void netx_snmp_v3_object_id_buffer_overwrite_test_application_define(void *); + +void netx_snmp_setget_integers_test_application_define(void *); +void netx_snmp_setget_octet_strings_test_application_define(void *); +void netx_snmp_setget_ip_address_test_application_define(void *); +void netx_snmp_setget_misc_test_application_define(void *); +void netx_snmp_abnormal_packet_test_application_define(void *); +#endif /* XWARE_64 */ + + +/* DHCP. */ +void netx_dhcp_basic_test_application_define(void *); +void netx_dhcp_basic_restore_test_application_define(void *); +void netx_dhcp_unicast_test_application_define(void *); +void netx_dhcp_user_option_add_test_application_define(void *); +void netx_dhcp_server_improper_term_test_application_define(void *); +void netx_dhcp_03_01_01_test_application_define(void *); +void netx_dhcp_03_01_02_test_application_define(void *); +void netx_dhcp_03_01_03_test_application_define(void *); +void netx_dhcp_03_02_01_test_application_define(void *); +void netx_dhcp_03_02_02_test_application_define(void *); +void netx_dhcp_03_02_03_test_application_define(void *); +void netx_dhcp_03_04_01_test_application_define(void *); +void netx_dhcp_03_05_01_test_application_define(void *); +void netx_dhcp_04_01_01_test_application_define(void *); +void netx_dhcp_04_03_02_01_test_application_define(void *); +void netx_dhcp_04_03_02_02_test_application_define(void *); +void netx_dhcp_04_03_02_03_test_application_define(void *); +void netx_dhcp_04_03_05_01_test_application_define(void *); +void netx_dhcp_04_04_01_01_test_application_define(void *); +void netx_dhcp_04_04_01_02_test_application_define(void *); +void netx_dhcp_packet_process_test_application_define(void*); +void netx_dhcp_client_send_with_zero_source_address_test_application_define(void*); +void netx_dhcp_multiple_instances_test_application_define(void*); +void netx_dhcp_send_request_internal_test_application_define(void*); +void netx_dhcp_extract_information_test_application_define(void*); +void netx_dhcp_get_option_value_test_application_define(void *); +void netx_dhcp_delete_test_application_define(void*); +void netx_dhcp_stop_test_application_define(void *); +void netx_dhcp_enable_test_application_define(void *); +void netx_dhcp_start_test_application_define(void *); +void netx_dhcp_release_test_application_define(void *); +void netx_dhcp_reinitialize_test_application_define(void *); +void netx_dhcp_client_activate_interfaces_test_application_define(void *); +void netx_dhcp_client_secondary_interface_test_application_define(void *); +void netx_dhcp_client_interface_order_test_application_define(void *); +void netx_dhcp_client_ip_mutex_test_application_define(void *); +void netx_dhcp_client_server_source_port_test_application_define(void *); +void netx_dhcp_client_parameter_request_test_application_define(void *); +void netx_dhcp_client_ntp_option_test_application_define(void *); +void netx_dhcp_skip_discover_test_application_define(void *); +void netx_dhcp_coverage_test_applicaiton_define(void*); +void netx_dhcp_client_nxe_api_test_application_define(void*); +//void netx_dhcp_client_arp_probe_fail_multiple_interface_test_application_define(void *); +//void netx_dhcp_client_decline_test_application_define(void *); +void netx_dhcp_server_test_application_define(void *); +void netx_dhcp_server_second_interface_test_application_define(void *); +void netx_dhcp_server_options_test_application_define(void *); +void netx_dhcp_server_small_packet_payload_test_application_define(void *); + +void netx_dhcpv6_basic_test_application_define(void *); +void netx_dhcpv6_extended_api_test_application_define(void *); +void netx_dhcpv6_packet_loss_test_application_define(void *); +void netx_dhcpv6_client_process_server_duid_test_application_define(void *); +void netx_dhcpv6_server_ia_options_test_application_define(void *); +void netx_dhcpv6_server_iana_test_application_define(void *); +void netx_dhcpv6_server_process_repeated_msgs_test_application_define(void *); +void netx_dhcpv6_user_option_add_test_application_define(void *); + +#ifndef XWARE_64 + +void netx_dhcpv4_relay_test_define(void *); + +#ifdef FEATURE_NX_IPV6 +void netx_dhcpv6_relay_test_define(void *); +#endif + + +/* SMTP Client */ +void netx_smtp_basic_function_test_application_define(void *); +void netx_smtp_two_packet_ehlo_message_test_application_define(void *); +void netx_smtp_auth_logon_function_test_application_define(void *); +void netx_smtp_auth_none_test_application_define(void *); +void netx_smtp_missing_last_250_EHLO_message_test_application_define(void *); +void netx_smtp_two_packet_EHLO_auth_last_message_test_application_define(void *); +void netx_smtp_auth_no_type_test_application_define(void *); +void netx_smtp_abnormal_packet_test_application_define(void *); +void netx_smtp_invalid_release_test_application_define(void *); + + +/* POP3 client */ +void netx_pop3_mail_receive_test_application_define(void *); +void netx_pop3_two_mails_received_test_application_define(void *_); +void netx_pop3_packet_with_endmarker_test_application_define(void *); +void netx_pop3_abnormal_packet_test_application_define(void *); + + +/* NAT */ +void netx_nat_icmp_test_application_define(void *); +void netx_nat_udp_test_application_define(void *); +void netx_nat_udp_port_test_application_define(void *); +void netx_nat_udp_fragment_test_application_define(void *); +void netx_nat_tcp_test1_application_define(void *); +void netx_nat_tcp_test2_application_define(void *); +void netx_nat_tcp_port_test_application_define(void *); +void netx_nat_tcp_port_test2_application_define(void *); +void netx_nat_tcp_fragment_test_application_define(void *); +void netx_nat_invalid_header_test_application_define(void *); + +#endif /* !XWARE_64 */ + +/* DNS Test*/ +void netx_dns_coverage_test_application_define(void *); +void netx_dns_function_test_application_define(void *); +void netx_dns_nxe_api_test_application_define(void *); +void netx_dns_request_a_response_cname_a_smtp_live_com_test_application_define(void *); +void netx_dns_invalid_name_unencode_test_application_define(void *); +void netx_dns_invalid_resource_get_test_application_define(void *); +void netx_dns_abnormal_packet_test_application_define(void *); +void netx_dns_source_port_test_application_define(void *); +void netx_dns_non_blocking_a_test_application_define(void *); +void netx_dns_fake_response_test_application_define(void *); +void netx_dns_packet_double_release_test_application_define(void *); + +#ifndef XWARE_64 + +/* mDNS Test. */ +void netx_mdns_internal_function_test(void *first_unused_memory); +void netx_mdns_create_delete_test(void *first_unused_memory); +void netx_mdns_one_shot_query_test(void *first_unused_memory); +void netx_mdns_local_cache_continuous_query_test(void *first_unused_memory); +void netx_mdns_local_cache_one_shot_query_test(void *first_unused_memory); +void netx_mdns_service_lookup_test(void *first_unused_memory); +void netx_mdns_service_add_delete_test(void *first_unused_memory); +void netx_mdns_announcement_repeat_test(void *first_unused_memory); +void netx_mdns_multiple_answers_test(void *first_unused_memory); +void netx_mdns_responder_cooperating_test(void *first_unused_memory); +void netx_mdns_response_with_question_test(void *first_unused_memory); +void netx_mdns_source_address_test(void *first_unused_memory); +void netx_mdns_source_port_test(void *first_unused_memory); +void netx_mdns_two_buffer_test(void *first_unused_memory); +void netx_mdns_buffer_size_test(void *first_unused_memory); +void netx_mdns_ttl_test(void *first_unused_memory); +void netx_mdns_txt_test(void *first_unused_memory); +void netx_mdns_txt_notation_test(void *first_unused_memory); +void netx_mdns_name_test(void *first_unused_memory); +void netx_mdns_domain_name_test(void *first_unused_memory); +void netx_mdns_interface_test(void *first_unused_memory); +void netx_mdns_second_interface_test(void *first_unused_memory); +void netx_mdns_peer_service_change_notify_test(void *first_unused_memory); +void netx_mdns_ipv6_string_test(void *first_unused_memory); +void netx_mdns_bad_packet_test(void *first_unused_memory); +void netx_mdns_read_overflow_test(void *); +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 +void netx_mdns_ram_test_define(void *first_unused_memory); +#endif /* __PRODUCT_NETXDUO__ && !NX_DISABLE_IPV4 */ + + +/* BSD Test */ +#ifdef NX_BSD_ENABLE +void netx_bsd_getaddrinfo_test_application_define(void *); +void netx_bsd_raw_pppoe_test_application_define(void *first_unused_memory); +void netx_bsd_tcp_ioctl_nonblocking_test_application_define(void *); +void netx_bsd_tcp_two_blocking_test_application_define(void *); +void netx_bsd_tcp_multiple_accept_test_application_define(void *); +void netx_bsd_tcp_basic_blocking_test_application_define(void *); +void netx_bsd_tcp_basic_nonblocking_test_application_define(void *); +void netx_bsd_udp_basic_blocking_test_application_define(void*); +void netx_bsd_udp_basic_nonblocking_test_application_define(void*); +void netx_bsd_raw_basic_blocking_test_application_define(void*); +void netx_bsd_raw_basic_nonblocking_test_application_define(void*); +void netx_bsd_raw_basic_rx_nohdr_blocking_test_application_define(void*); +void netx_bsd_raw_basic_rx_nohdr_nonblocking_test_application_define(void*); +void netx_bsd_multicast_test_application_define(void*); +void netx_bsd_udp_bind_test_application_define(void*); +void netx_bsd_tcp_bind_test_application_define(void*); +void netx_bsd_udp_connect_test_application_define(void*); +void netx_bsd_tcp_disconnect_test_application_define(void*); +void netx_bsd_tcp_sendto_test_application_define(void*); +void netx_bsd_tcp_2nd_bind_test_application_define(void*); +void netx_bsd_udp_blocking_bidirection_test_application_define(void *); +void netx_bsd_tcp_blocking_bidirection_test_application_define(void *); +void netx_bsd_udp_bind_connect_test_application_define(void *); +void netx_bsd_raw_tx_test_application_define(void *); +void netx_bsd_raw_bind_connect_test_application_define(void*); +void netx_bsd_raw_rx_hdrinclude_test_application_define(void*); +void netx_bsd_raw_rx_nohdr_basic_blocking_test_application_define(void*); +void netx_bsd_raw_rx_nohdr_basic_nonblocking_test_application_define(void*); +void netx_bsd_raw_basic_rx_nohdr_blocking_test_application_define(void*); +void netx_bsd_raw_basic_rx_nohdr_basic_blocking_test_application(void*); +void netx_bsd_raw_rx_nohdr_basic_blocking_test_application_define(void*); +void netx_bsd_raw_ping_test_application_define(void*); +void netx_bsd_tcp_accept_nonblocking_timeout_test_application_define(void *); +void netx_bsd_tcp_accept_blocking_test_application_define(void *); +void netx_bsd_tcp_accept_nonblocking_test_application_define(void *); +void netx_bsd_tcp_accept_blocking_test_application_define(void *); +void netx_bsd_tcp_accept_nonblocking_test_application_define(void *); +void netx_bsd_tcp_accept_blocking_timeout_test_application_define(void *); +void netx_bsd_tcp_accept_noselect_test_application_define(void *); +void netx_bsd_tcp_udp_select_test_application_define(void *); +void netx_bsd_aton_test_application_define(void *); +void netx_bsd_ntoa_test_application_define(void *); +void netx_bsd_ntop_test_application_define(void *); +void netx_bsd_pton_test_application_define(void *); +void netx_bsd_inet_addr_pton_test_application_define(void *); +void netx_bsd_tcp_servers_share_port_test_application_define(void *); +void netx_bsd_tcp_clients_share_port_test_application_define(void *); +void netx_bsd_tcp_rcvbuf_test_application_define(void *); +void netx_bsd_tcp_getsockname_without_bind_test_application_define(void *); +void netx_bsd_udp_checksum_corrupt_test_application_define(void*); +void netx_bsd_tcp_fionread_test_application_define(void *); +#endif /* NX_BSD_ENABLE */ + + +/* Cloud Test */ +void netx_cloud_basic_test_application_define(void*); +void netx_cloud_api_test_application_define(void*); +void netx_cloud_module_register_deregister_test_application_define(void*); +void netx_cloud_module_event_test_application_define(void*); + +#endif /* XWARE_64 */ + +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#ifndef XWARE_64 +#ifdef NX_IPSEC_ENABLE + +/* IPsec TAHI test.*/ +void netx_tahi_test_ipsec_define(void *); +void netx_tahi_test_ipsec_2_define(void *); +void netx_tahi_test_ipsec_udp_define(void *); +void netx_tahi_test_ipsec_udp_2_define(void *); + +#endif +#endif /* XWARE_64 */ + +#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY +/* IPv6 TAHI test*/ +void netx_tahi_test_1_define(void *); +void netx_tahi_test_2_1_define(void *); +void netx_tahi_test_2_2_define(void *); +void netx_tahi_test_2_3_define(void *); +void netx_tahi_test_2_4_define(void *); +void netx_tahi_test_2_5_define(void *); +void netx_tahi_test_2_6_define(void *); +void netx_tahi_test_2_7_define(void *); +void netx_tahi_test_2_8_define(void *); +void netx_tahi_test_2_9_define(void *); +void netx_tahi_test_2_10_define(void *); +void netx_tahi_test_2_11_define(void *); +void netx_tahi_test_3_1_define(void *); +void netx_tahi_test_3_2_define(void *); +void netx_tahi_test_3_3_define(void *); +void netx_tahi_test_3_4_define(void *); +void netx_tahi_test_3_5_define(void *); +void netx_tahi_test_3_6_define(void *); +void netx_tahi_test_3_7_define(void *); +void netx_tahi_test_3_8_define(void *); +void netx_tahi_test_3_9_define(void *); +void netx_tahi_test_3_10_define(void *); +void netx_tahi_test_3_11_define(void *); +void netx_tahi_test_3_12_define(void *); +void netx_tahi_test_3_13_define(void *); +void netx_tahi_test_3_14_define(void *); +void netx_tahi_test_3_15_define(void *); +void netx_tahi_test_3_16_define(void *); +void netx_tahi_test_3_17_define(void *); +void netx_tahi_test_3_18_define(void *); +void netx_tahi_test_3_19_define(void *); +void netx_tahi_test_3_20_define(void *); +void netx_tahi_test_3_21_define(void *); +void netx_tahi_test_3_22_define(void *); +void netx_tahi_test_3_23_define(void *); +void netx_tahi_test_3_24_define(void *); +void netx_tahi_test_3_25_define(void *); +void netx_tahi_test_3_26_define(void *); +void netx_tahi_test_3_27_define(void *); +void netx_tahi_test_3_28_define(void *); +void netx_tahi_test_3_29_define(void *); +void netx_tahi_test_3_30_define(void *); +void netx_tahi_test_3_31_define(void *); +void netx_tahi_test_3_32_define(void *); +void netx_tahi_test_3_33_define(void *); +void netx_tahi_test_3_34_define(void *); +void netx_tahi_test_3_35_define(void *); +void netx_tahi_test_3_36_define(void *); +void netx_tahi_test_3_37_define(void *); +void netx_tahi_test_3_38_define(void *); +void netx_tahi_test_3_39_define(void *); +void netx_tahi_test_3_40_define(void *); +void netx_tahi_test_3_41_define(void *); +void netx_tahi_test_3_42_define(void *); +void netx_tahi_test_3_43_define(void *); +void netx_tahi_test_3_44_define(void *); +void netx_tahi_test_3_45_define(void *); + +void netx_tahi_test_4_2_define(void *); +void netx_tahi_test_4_3_define(void *); +void netx_tahi_test_4_4_define(void *); +void netx_tahi_test_4_5_define(void *); +void netx_tahi_test_4_6_define(void *); +void netx_tahi_test_4_7_define(void *); +void netx_tahi_test_4_8_define(void *); +void netx_tahi_test_4_9_define(void *); +void netx_tahi_test_4_10_define(void *); +void netx_tahi_test_4_11_define(void *); +void netx_tahi_test_4_12_define(void *); +void netx_tahi_test_4_13_define(void *); +void netx_tahi_test_4_14_define(void *); +void netx_tahi_test_4_15_define(void *); +void netx_tahi_test_4_16_define(void *); + +void netx_tahi_test_5_define(void *); +#endif /* NX_ENABLE_IPV6_PATH_MTU_DISCOVERY */ +#endif /* NX_TAHI_ENABLE */ + +#ifdef NX_DHCPV6_TAHI_ENABLE +void netx_tahi_dhcpv6_test_01_002_define(void * ); +void netx_tahi_dhcpv6_test_01_003_define(void * ); +void netx_tahi_dhcpv6_test_01_004_define(void * ); +void netx_tahi_dhcpv6_test_01_005_define(void * ); +void netx_tahi_dhcpv6_test_01_006_define(void * ); +void netx_tahi_dhcpv6_test_01_007_define(void * ); +void netx_tahi_dhcpv6_test_01_008_define(void * ); +void netx_tahi_dhcpv6_test_01_009_define(void * ); +void netx_tahi_dhcpv6_test_01_010_define(void * ); +void netx_tahi_dhcpv6_test_01_011_define(void * ); +void netx_tahi_dhcpv6_test_01_012_define(void * ); +void netx_tahi_dhcpv6_test_01_013_define(void * ); +void netx_tahi_dhcpv6_test_01_014_define(void * ); + +void netx_tahi_dhcpv6_test_01_019_define(void * ); +void netx_tahi_dhcpv6_test_01_020_define(void * ); +void netx_tahi_dhcpv6_test_01_021_define(void * ); +void netx_tahi_dhcpv6_test_01_022_define(void * ); +void netx_tahi_dhcpv6_test_01_023_define(void * ); +void netx_tahi_dhcpv6_test_01_024_define(void * ); +void netx_tahi_dhcpv6_test_01_025_define(void * ); +void netx_tahi_dhcpv6_test_01_026_define(void * ); +void netx_tahi_dhcpv6_test_01_027_define(void * ); +void netx_tahi_dhcpv6_test_01_028_define(void * ); +void netx_tahi_dhcpv6_test_01_029_define(void * ); +void netx_tahi_dhcpv6_test_01_030_define(void * ); +void netx_tahi_dhcpv6_test_01_031_define(void * ); +void netx_tahi_dhcpv6_test_01_032_define(void * ); +void netx_tahi_dhcpv6_test_01_033_define(void * ); +void netx_tahi_dhcpv6_test_01_034_define(void * ); +void netx_tahi_dhcpv6_test_01_035_define(void * ); +void netx_tahi_dhcpv6_test_01_036_define(void * ); +void netx_tahi_dhcpv6_test_01_037_define(void * ); +void netx_tahi_dhcpv6_test_01_038_define(void * ); +void netx_tahi_dhcpv6_test_01_039_define(void * ); +void netx_tahi_dhcpv6_test_01_040_define(void * ); +void netx_tahi_dhcpv6_test_01_041_define(void * ); +void netx_tahi_dhcpv6_test_01_042_define(void * ); +void netx_tahi_dhcpv6_test_01_043_define(void * ); +void netx_tahi_dhcpv6_test_01_044_define(void * ); +void netx_tahi_dhcpv6_test_01_045_define(void * ); +void netx_tahi_dhcpv6_test_01_046_define(void * ); +void netx_tahi_dhcpv6_test_01_047_define(void * ); +void netx_tahi_dhcpv6_test_01_048_define(void * ); +void netx_tahi_dhcpv6_test_01_049_define(void * ); +void netx_tahi_dhcpv6_test_01_050_define(void * ); +void netx_tahi_dhcpv6_test_01_051_define(void * ); +void netx_tahi_dhcpv6_test_01_052_define(void * ); +void netx_tahi_dhcpv6_test_01_053_define(void * ); +void netx_tahi_dhcpv6_test_01_054_define(void * ); +void netx_tahi_dhcpv6_test_01_055_define(void * ); +void netx_tahi_dhcpv6_test_01_056_define(void * ); +void netx_tahi_dhcpv6_test_01_057_define(void * ); +void netx_tahi_dhcpv6_test_01_058_define(void * ); +void netx_tahi_dhcpv6_test_01_059_define(void * ); +void netx_tahi_dhcpv6_test_01_060_define(void * ); +void netx_tahi_dhcpv6_test_01_061_define(void * ); +void netx_tahi_dhcpv6_test_01_062_define(void * ); +void netx_tahi_dhcpv6_test_01_063_define(void * ); +void netx_tahi_dhcpv6_test_01_064_define(void * ); +void netx_tahi_dhcpv6_test_01_065_define(void * ); +void netx_tahi_dhcpv6_test_01_066_define(void * ); +void netx_tahi_dhcpv6_test_01_067_define(void * ); +void netx_tahi_dhcpv6_test_01_068_define(void * ); +void netx_tahi_dhcpv6_test_01_069_define(void * ); +void netx_tahi_dhcpv6_test_01_070_define(void * ); +void netx_tahi_dhcpv6_test_01_071_define(void * ); +void netx_tahi_dhcpv6_test_01_072_define(void * ); +void netx_tahi_dhcpv6_test_01_073_define(void * ); +void netx_tahi_dhcpv6_test_01_074_define(void * ); +void netx_tahi_dhcpv6_test_01_075_define(void * ); +void netx_tahi_dhcpv6_test_01_076_define(void * ); +void netx_tahi_dhcpv6_test_01_077_define(void * ); +void netx_tahi_dhcpv6_test_01_078_define(void * ); +void netx_tahi_dhcpv6_test_01_079_define(void * ); +void netx_tahi_dhcpv6_test_01_080_define(void * ); +void netx_tahi_dhcpv6_test_01_081_define(void * ); +void netx_tahi_dhcpv6_test_01_082_define(void * ); +void netx_tahi_dhcpv6_test_01_083_define(void * ); +void netx_tahi_dhcpv6_test_01_084_define(void * ); +void netx_tahi_dhcpv6_test_01_085_define(void * ); +void netx_tahi_dhcpv6_test_01_086_define(void * ); +void netx_tahi_dhcpv6_test_01_087_define(void * ); +void netx_tahi_dhcpv6_test_01_088_define(void * ); +void netx_tahi_dhcpv6_test_01_089_define(void * ); +void netx_tahi_dhcpv6_test_01_090_define(void * ); +void netx_tahi_dhcpv6_test_01_091_define(void * ); +void netx_tahi_dhcpv6_test_01_092_define(void * ); +void netx_tahi_dhcpv6_test_01_093_define(void * ); +void netx_tahi_dhcpv6_test_01_094_define(void * ); +void netx_tahi_dhcpv6_test_01_095_define(void * ); +void netx_tahi_dhcpv6_test_01_096_define(void * ); +void netx_tahi_dhcpv6_test_01_097_define(void * ); +void netx_tahi_dhcpv6_test_01_098_define(void * ); +void netx_tahi_dhcpv6_test_01_099_define(void * ); + + + +void netx_tahi_dhcpv6_test_04_002_define(void * ); +void netx_tahi_dhcpv6_test_04_003_define(void * ); +void netx_tahi_dhcpv6_test_04_004_define(void * ); +void netx_tahi_dhcpv6_test_04_005_define(void * ); +void netx_tahi_dhcpv6_test_04_006_define(void * ); +void netx_tahi_dhcpv6_test_04_007_define(void * ); +void netx_tahi_dhcpv6_test_04_008_define(void * ); +void netx_tahi_dhcpv6_test_04_009_define(void * ); +void netx_tahi_dhcpv6_test_04_010_define(void * ); +void netx_tahi_dhcpv6_test_04_011_define(void * ); +void netx_tahi_dhcpv6_test_04_012_define(void * ); +void netx_tahi_dhcpv6_test_04_013_define(void * ); +void netx_tahi_dhcpv6_test_04_014_define(void * ); +void netx_tahi_dhcpv6_test_04_015_define(void * ); +void netx_tahi_dhcpv6_test_04_016_define(void * ); +void netx_tahi_dhcpv6_test_04_017_define(void * ); +void netx_tahi_dhcpv6_test_04_018_define(void * ); +void netx_tahi_dhcpv6_test_04_019_define(void * ); +void netx_tahi_dhcpv6_test_04_020_define(void * ); +void netx_tahi_dhcpv6_test_04_021_define(void * ); +void netx_tahi_dhcpv6_test_04_022_define(void * ); +void netx_tahi_dhcpv6_test_04_023_define(void * ); +void netx_tahi_dhcpv6_test_04_024_define(void * ); +void netx_tahi_dhcpv6_test_04_025_define(void * ); +void netx_tahi_dhcpv6_test_04_026_define(void * ); +void netx_tahi_dhcpv6_test_04_027_define(void * ); +void netx_tahi_dhcpv6_test_04_028_define(void * ); +void netx_tahi_dhcpv6_test_04_029_define(void * ); +void netx_tahi_dhcpv6_test_04_030_define(void * ); +void netx_tahi_dhcpv6_test_04_031_define(void * ); + +void netx_tahi_dhcpv6_test_07_002_define(void * ); +void netx_tahi_dhcpv6_test_07_003_define(void * ); +void netx_tahi_dhcpv6_test_07_004_define(void * ); +void netx_tahi_dhcpv6_test_07_005_define(void * ); +void netx_tahi_dhcpv6_test_07_006_define(void * ); +void netx_tahi_dhcpv6_test_07_007_define(void * ); +void netx_tahi_dhcpv6_test_07_008_define(void * ); +void netx_tahi_dhcpv6_test_07_009_define(void * ); +void netx_tahi_dhcpv6_test_07_010_define(void * ); +void netx_tahi_dhcpv6_test_07_011_define(void * ); +void netx_tahi_dhcpv6_test_07_012_define(void * ); +void netx_tahi_dhcpv6_test_07_013_define(void * ); +void netx_tahi_dhcpv6_test_07_014_define(void * ); +void netx_tahi_dhcpv6_test_07_015_define(void * ); +void netx_tahi_dhcpv6_test_07_016_define(void * ); +void netx_tahi_dhcpv6_test_07_017_define(void * ); +void netx_tahi_dhcpv6_test_07_018_define(void * ); +void netx_tahi_dhcpv6_test_07_019_define(void * ); +void netx_tahi_dhcpv6_test_07_020_define(void * ); +void netx_tahi_dhcpv6_test_07_021_define(void * ); +void netx_tahi_dhcpv6_test_07_022_define(void * ); +void netx_tahi_dhcpv6_test_07_023_define(void * ); +void netx_tahi_dhcpv6_test_07_024_define(void * ); +void netx_tahi_dhcpv6_test_07_025_define(void * ); +void netx_tahi_dhcpv6_test_07_026_define(void * ); +void netx_tahi_dhcpv6_test_07_027_define(void * ); +#endif /* NX_DHCPV6_TAHI_ENABLE*/ +void test_application_define(void * ); + + +/* Define the array of test entry points. */ + +TEST_ENTRY test_control_tests[] = +{ + +#ifdef CTEST + {test_application_define, TEST_TIMEOUT_HIGH}, +#else /* CTEST */ + +#ifndef SNMP_ONLY + {netx_caller_check_test_application_define, TEST_TIMEOUT_LOW}, + {netx_api_compile_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_status_check_test_application_define, TEST_TIMEOUT_LOW}, + {netx_utility_test_application_define, TEST_TIMEOUT_LOW}, + + /* Checksum test. */ + {netx_checksum_test_application_define, TEST_TIMEOUT_LOW}, + + /* Pakcet payload size test. */ + {netx_packet_payload_size_test_application_define, TEST_TIMEOUT_LOW}, + + /* RAMDriver test */ + {netx_netx_ramdriver_callback_application_define, TEST_TIMEOUT_LOW}, + + /* Old API test*/ + {netx_old_api_application_define, TEST_TIMEOUT_LOW}, + + /* ARP test */ + {netx_arp_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_conflict_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_dynamic_entry_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_dynamic_entry_test2_application_define, TEST_TIMEOUT_MID}, + {netx_arp_dynamic_entry_test3_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_dynamic_entry_set_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_dynamic_entry_fail_test_application_define, TEST_TIMEOUT_MID}, + {netx_arp_dynamic_entry_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_arp_dynamic_invalidate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_gratuitous_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_static_entries_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_static_entry_create_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_static_entry_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_static_entry_pollute_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_entry_cache_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_entry_abnormal_operation_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_queue_depth_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_dual_pool_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_invalid_type_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_auto_entry_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_no_duplicate_entry_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_packet_allocate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_arp_branch_test_application_define, TEST_TIMEOUT_LOW}, + + /* RARP test */ + {netx_rarp_basic_processing_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rarp_packet_allocate_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rarp_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rarp_multiple_interfaces_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rarp_branch_test_application_define, TEST_TIMEOUT_LOW}, + + /* ICMP test */ + {netx_icmp_ping_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping_fragment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping6_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping6_data_append_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping6_fragment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_interface2_ping_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_interface2_ping6_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_invalid_source_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_cleanup_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_packet_receive_function_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_multiple_ping_test1_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_multiple_ping_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_multiple_ping6_test1_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_multiple_ping6_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_send_error_message_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_send_error_message_test_1_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_loopback_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_loopback_test2_application_define, TEST_TIMEOUT_MID}, + {netx_icmp_loopback_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_invalid_echo_reply_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping_multicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_branch_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_broadcast_ping_test_application_define, TEST_TIMEOUT_LOW}, + + /* ICMPv6 test*/ + {netx_icmpv6_error_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_error_small_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_DAD_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_echo_request_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_echo_reply_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_redirect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ra_flag_callback_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ra_address_full_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ra_slla_changed_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ra_router_full_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_solicitated_ra_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_abnormal_mtu_in_ra_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_invalid_length_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_invalid_length_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_invalid_ra_dest_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ra_lifetime_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_router_solicitation_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_invalid_na_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_na_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_na_tlla_changed_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_na_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_redirect_nd_full_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_redirect_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_destination_table_periodic_test_application_define, TEST_TIMEOUT_MID}, + {netx_icmpv6_mtu_option_test_application_define, TEST_TIMEOUT_MID}, + {netx_icmpv6_invalid_message_test_application_define, TEST_TIMEOUT_MID}, + {netx_icmpv6_ra_invalid_length_test_application_define, TEST_TIMEOUT_MID}, + {netx_icmpv6_ra_buffer_overwrite_test_application_define, TEST_TIMEOUT_MID}, + {netx_icmpv6_branch_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ns_with_small_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_ns_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_invalid_ra_option_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmpv6_too_big_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + + /* IGMP test */ + {netx_igmp_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_multicast_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_loopback_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_packet_receive_function_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_router_query_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_leave_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_join_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_checksum_computation_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_branch_test_application_define, TEST_TIMEOUT_LOW}, + {netx_igmp_interface_indirect_report_send_test_application_define, TEST_TIMEOUT_LOW}, + + /* IPv4 test */ + {netx_ip_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_link_status_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_create_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_fragmentation_order_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_fragmentation_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_fragmentation_disable_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_fragmentation_timeout_check_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_timeout_check_test_2_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_time_exceeded_message_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_duplicate_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_dispatch_fail_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_packet_copy_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_packet_delay_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_packet_drop_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_wrong_destination_address_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_wrong_protocol_field_test_application_define, TEST_TIMEOUT_MID}, + {netx_ip_fragmentation_wrong_protocol_field_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_attachment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_detachment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_detachment_tcp_connection_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_detachment_arp_table_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_detachment_gateway_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_address_get_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_address_set_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_info_get_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_capability_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_physical_address_set_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_physical_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_address_set_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_address_get_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_address_change_notify_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_address_conflict_callback_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_address_conflict_detection_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_auxiliary_packet_pool_set_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_status_check_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_interface_status_check_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_max_payload_size_find_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_gateway_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_static_route_add_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_static_route_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_static_route_find_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_invalid_packet_receive_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_chain_packet_process_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_link_local_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_route_reachable_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_packet_filter_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_packet_filter_extended_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_driver_deferred_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_loopback_multihome_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_branch_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_malformed_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_idle_scan_test_application_define, TEST_TIMEOUT_LOW}, + + {netx_ipv4_option_process_test_application_define, TEST_TIMEOUT_LOW}, + + {netx_ip_raw_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_raw_special_test_application_define, TEST_TIMEOUT_LOW}, + {netx_raw_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_raw_packet_queue_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_raw_packet_filter_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_multicast_interface_detach_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_raw_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ip_raw_loopback_test_application_define, TEST_TIMEOUT_LOW}, + + /* IPv6 test */ + {netx_ipv6_disable_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_search_onlink_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_address_delete_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_address_get_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_address_set_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_default_router_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_fragmentation_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_fragmentation_error_test1_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_fragmentation_error_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_multicast_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_multicast_ping_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_multicast_ping_test1_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_multicast_interface_detach_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_stateless_address_autoconfig_application_define, TEST_TIMEOUT_MID}, + {netx_ipv6_prefix_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_hop_by_hop_option_error_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_hop_by_hop_fragment_test_application_define, TEST_TIMEOUT_MID}, + {netx_ipv6_util_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_send_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_default_router_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_invalid_packet_receive_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_packet_chain_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_fragment_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_pmtu_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_interface_detachment_router_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipv6_branch_test_application_define, TEST_TIMEOUT_LOW}, + + /* ND Cache test */ + {netx_nd_cache_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_nd_cache_under_interface_detach_test_application_define, TEST_TIMEOUT_LOW}, + {netx_nd_cache_with_own_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_nd_cache_add_test_application_define, TEST_TIMEOUT_LOW}, + {netx_nd_cache_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_nd_cache_branch_test_application_define, TEST_TIMEOUT_LOW}, + + /* Dest table test*/ + {netx_dest_table_add_fail_test_application_define, TEST_TIMEOUT_LOW}, + + /* Packet test */ + {netx_packet_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_packet_data_append_test_application_define, TEST_TIMEOUT_LOW}, + {netx_packet_debug_info_test_application_define, TEST_TIMEOUT_LOW}, + {netx_packet_suspension_test_application_define, TEST_TIMEOUT_LOW}, + {netx_packet_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_packet_branch_test_application_define, TEST_TIMEOUT_LOW}, + {netx_low_watermark_test_application_define, TEST_TIMEOUT_LOW}, + {netx_low_watermark_zero_window_test_application_define, TEST_TIMEOUT_LOW}, + {netx_low_watermark_fragment_test_application_define, TEST_TIMEOUT_LOW}, + + /* TCP test */ + {netx_tcp_duplicate_accept_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_ack_check_for_syn_message_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_ack_check_issue_test_application_define, TEST_TIMEOUT_LOW}, +#if 0 + /* The logic has been fixed in TCP layer. Driver will release the packet after it is transmitted. */ + {netx_tcp_ack_before_release_test_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_tcp_basic_processing_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_zero_window_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_zero_window_probe_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_zero_window_probe_test_2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_zero_window_probe_test_3_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_fin_wait_recv_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_window_update_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_retransmit_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_retransmit_test_1_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_send_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_send_fail_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_send_fail_test3_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_listen_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_listen_packet_leak_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_available_bytes_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_unbind_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_unbind_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_unaccept_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_unlisten_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_relisten_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_relisten_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_listen_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_listen_queue_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_server_socket_accept_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_connection_reset_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_fast_retransmit_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_3_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_4_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_5_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_6_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_7_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_8_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_9_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_10_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_11_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_12_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_13_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_14_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_15_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_16_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_17_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_overlapping_packet_test_18_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_data_transfer_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_data_trim_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_dropped_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_dropped_packet_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_fast_disconnect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_loopback_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_out_of_order_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_out_of_order_ack_test_application_define, TEST_TIMEOUT_LOW}, +// jlc temporarily omitting this one {netx_tcp_out_of_order_packet_max_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_small_window_preempt_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_small_window_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_ipv4_interface2_mss_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_ipv6_basic_processing_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_ipv6_interface2_mss_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_ipv6_window_scale_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_wrapping_sequence_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_wrapping_sequence_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_wrapping_sequence_test3_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_wrapping_sequence_test4_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_queue_depth_nofity_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_client_bind_cleanup_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_transmit_cleanup_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_receive_cleanup_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_packet_receive_function_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_error_operation_check_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_send_internal_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_state_wait_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_keepalive_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_client_socket_port_get_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_client_socket_unbind_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_client_socket_bind_test_application_define, TEST_TIMEOUT_HIGH}, + {netx_tcp_client_packet_leak_test_application_define, TEST_TIMEOUT_HIGH}, + {netx_tcp_transmit_under_interface_detach_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_receive_under_interface_detach_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_receive_under_interface_detach_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_max_window_scale_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_mss_option_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_mss_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_fin_wait1_to_time_wait_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_time_wait_to_close_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_invalid_option_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_invalid_option_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_out_of_window_control_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_new_reno_algorithm_test1_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_new_reno_algorithm_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_new_reno_algorithm_test3_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_new_reno_algorithm_test4_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_new_reno_algorithm_test5_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_large_mtu_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_large_mtu_test_2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_simultaneous_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_send_disconnect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_not_enabled_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tx_queue_exceed_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_transmit_not_done_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_4_duplicate_ack_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_cwnd_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_urgent_packet_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_multiple_send_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_multiple_send_test2_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_reset_during_send_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_delayed_retransmission_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_delayed_retransmission_test_2_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_ipv6_delayed_retransmission_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_odd_window_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_chained_packet_test_application_define, TEST_TIMEOUT_MID}, + {netx_tcp_branch_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_packet_leak_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_udp_random_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_invalid_length_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_large_data_transfer_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_small_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_advertised_window_update_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_race_condition_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_race_condition_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_socket_receive_rst_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_invalid_packet_chain_test_application_define, TEST_TIMEOUT_LOW}, + + /* UDP test*/ + {netx_udp_basic_processing_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_socket_unbind_receive_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_socket_unbind_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_free_port_find_test_application_define, TEST_TIMEOUT_HIGH}, + {netx_udp_source_send_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_packet_receive_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_fragment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_fragmentation_processing_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_multiple_ports_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_ipv4_interface2_test_1_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_ipv6_interface2_test_1_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_socket_bind_test_application_define, TEST_TIMEOUT_HIGH}, + {netx_udp_socket_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_bind_cleanup_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_packet_type_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_checksum_zero_test_application_define, TEST_TIMEOUT_LOW}, + {netx_nxd_udp_socket_send_special_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_loopback_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_port_unreachable_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_port_table_update_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_branch_test_application_define, TEST_TIMEOUT_LOW}, + + /* Add Forward test. */ + {netx_forward_icmp_ping_test_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_icmp_ttl_test_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_icmp_small_header_test_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_icmp_small_header_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_icmp_small_header_test3_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_multicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_udp_test_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_udp_fragment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_udp_fragment_test2_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_udp_fragment_test3_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_udp_fragment_test4_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_tcp_test_1_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_tcp_test_2_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_tcp_test_3_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_tcp_test_4_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_tcp_test_5_application_define, TEST_TIMEOUT_LOW}, + {netx_forward_link_local_address_test_application_define, TEST_TIMEOUT_LOW}, + + + {netx_icmp_ping_tunnel_ipv4_ipv4_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_tunnel_ipv4_ipv4_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv4_ipv4_basic_test_application_define, TEST_TIMEOUT_LOW}, + + {netx_icmp_ping6_tunnel_ipv6_ipv6_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping6_tunnel_ipv6_ipv4_test_application_define, TEST_TIMEOUT_LOW}, + {netx_icmp_ping_tunnel_ipv4_ipv6_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_tunnel_ipv6_ipv4_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_tunnel_ipv4_ipv6_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_udp_tunnel_ipv6_ipv6_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv6_ipv4_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv4_ipv6_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv6_ipv6_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv4_ipv6_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv4_ipv6_samll_windows_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_tunnel_ipv4_ipv6_big_packet_test_application_define, TEST_TIMEOUT_LOW}, + + /*TCP tests*/ + {netx_1_01_application_define, TEST_TIMEOUT_LOW}, + {netx_1_02_application_define, TEST_TIMEOUT_LOW}, + {netx_1_03_application_define, TEST_TIMEOUT_LOW}, + {netx_1_04_application_define, TEST_TIMEOUT_LOW}, + {netx_1_04_ipv6_application_define, TEST_TIMEOUT_LOW}, + {netx_1_05_application_define, TEST_TIMEOUT_LOW}, + {netx_1_17_application_define, TEST_TIMEOUT_LOW}, + {netx_1_18_application_define, TEST_TIMEOUT_LOW}, + {netx_1_19_01_application_define, TEST_TIMEOUT_LOW}, + {netx_1_19_02_application_define, TEST_TIMEOUT_LOW}, + {netx_1_19_03_application_define, TEST_TIMEOUT_LOW}, + {netx_1_20_application_define, TEST_TIMEOUT_LOW}, + {netx_1_21_01_application_define, TEST_TIMEOUT_LOW}, + {netx_1_21_02_application_define, TEST_TIMEOUT_LOW}, + {netx_1_26_01_application_define, TEST_TIMEOUT_LOW}, + {netx_1_26_02_application_define, TEST_TIMEOUT_LOW}, + {netx_1_27_01_application_define, TEST_TIMEOUT_LOW}, + {netx_1_27_02_application_define, TEST_TIMEOUT_LOW}, + {netx_1_27_03_application_define, TEST_TIMEOUT_LOW}, + {netx_1_27_04_application_define, TEST_TIMEOUT_LOW}, + {netx_2_01_application_define, TEST_TIMEOUT_LOW}, + {netx_2_02_application_define, TEST_TIMEOUT_LOW}, + {netx_2_17_application_define, TEST_TIMEOUT_LOW}, + {netx_2_20_application_define, TEST_TIMEOUT_LOW}, + {netx_3_01_application_define, TEST_TIMEOUT_LOW}, + {netx_3_02_application_define, TEST_TIMEOUT_LOW}, + {netx_3_03_application_define, TEST_TIMEOUT_LOW}, + {netx_3_04_application_define, TEST_TIMEOUT_LOW}, + {netx_3_06_application_define, TEST_TIMEOUT_LOW}, + {netx_3_07_application_define, TEST_TIMEOUT_LOW}, + {netx_3_08_application_define, TEST_TIMEOUT_LOW}, + {netx_3_17_application_define, TEST_TIMEOUT_LOW}, + {netx_3_18_application_define, TEST_TIMEOUT_LOW}, + {netx_3_19_application_define, TEST_TIMEOUT_LOW}, + {netx_3_20_application_define, TEST_TIMEOUT_LOW}, + {netx_3_21_application_define, TEST_TIMEOUT_LOW}, + {netx_3_23_application_define, TEST_TIMEOUT_LOW}, + {netx_4_01_application_define, TEST_TIMEOUT_LOW}, + {netx_4_17_application_define, TEST_TIMEOUT_LOW}, + {netx_4_21_application_define, TEST_TIMEOUT_LOW}, + {netx_4_23_application_define, TEST_TIMEOUT_LOW}, + {netx_4_24_application_define, TEST_TIMEOUT_LOW}, + {netx_4_25_application_define, TEST_TIMEOUT_LOW}, + {netx_4_26_application_define, TEST_TIMEOUT_LOW}, + {netx_4_27_application_define, TEST_TIMEOUT_LOW}, + {netx_4_28_application_define, TEST_TIMEOUT_LOW}, + {netx_4_29_application_define, TEST_TIMEOUT_LOW}, + {netx_5_18_application_define, TEST_TIMEOUT_LOW}, + {netx_5_19_application_define, TEST_TIMEOUT_LOW}, + {netx_5_20_application_define, TEST_TIMEOUT_LOW}, + {netx_5_21_application_define, TEST_TIMEOUT_LOW}, + {netx_5_22_application_define, TEST_TIMEOUT_LOW}, + {netx_5_23_application_define, TEST_TIMEOUT_LOW}, + {netx_5_24_application_define, TEST_TIMEOUT_LOW}, + {netx_5_25_application_define, TEST_TIMEOUT_LOW}, + {netx_6_17_application_define, TEST_TIMEOUT_LOW}, + {netx_6_18_application_define, TEST_TIMEOUT_LOW}, + {netx_6_20_application_define, TEST_TIMEOUT_LOW}, + {netx_6_22_01_application_define, TEST_TIMEOUT_LOW}, + {netx_6_22_02_application_define, TEST_TIMEOUT_LOW}, + {netx_6_23_application_define, TEST_TIMEOUT_LOW}, + {netx_6_24_application_define, TEST_TIMEOUT_LOW}, + {netx_6_25_application_define, TEST_TIMEOUT_LOW}, + {netx_6_27_application_define, TEST_TIMEOUT_LOW}, + {netx_6_28_application_define, TEST_TIMEOUT_LOW}, + {netx_6_29_application_define, TEST_TIMEOUT_LOW}, + {netx_6_32_application_define, TEST_TIMEOUT_LOW}, + {netx_8_01_application_define, TEST_TIMEOUT_LOW}, + {netx_8_02_application_define, TEST_TIMEOUT_LOW}, + {netx_8_17_application_define, TEST_TIMEOUT_LOW}, + {netx_8_18_application_define, TEST_TIMEOUT_LOW}, + {netx_8_19_application_define, TEST_TIMEOUT_LOW}, + {netx_8_20_application_define, TEST_TIMEOUT_LOW}, + {netx_8_21_application_define, TEST_TIMEOUT_LOW}, + {netx_8_29_01_application_define, TEST_TIMEOUT_LOW}, + {netx_8_29_02_application_define, TEST_TIMEOUT_LOW}, + {netx_8_29_03_application_define, TEST_TIMEOUT_LOW}, + {netx_8_29_04_application_define, TEST_TIMEOUT_LOW}, + {netx_9_17_application_define, TEST_TIMEOUT_LOW}, + {netx_9_18_application_define, TEST_TIMEOUT_LOW}, + {netx_9_19_01_application_define, TEST_TIMEOUT_LOW}, + {netx_9_19_02_application_define, TEST_TIMEOUT_LOW}, + {netx_9_20_application_define, TEST_TIMEOUT_LOW}, + {netx_9_21_01_application_define, TEST_TIMEOUT_LOW}, + {netx_9_21_02_application_define, TEST_TIMEOUT_LOW}, + {netx_9_22_application_define, TEST_TIMEOUT_LOW}, + {netx_9_27_application_define, TEST_TIMEOUT_LOW}, + {netx_10_23_01_application_define, TEST_TIMEOUT_LOW}, + {netx_10_23_02_application_define, TEST_TIMEOUT_LOW}, + {netx_10_24_01_application_define, TEST_TIMEOUT_LOW}, + {netx_10_24_02_application_define, TEST_TIMEOUT_LOW}, + {netx_10_24_03_application_define, TEST_TIMEOUT_LOW}, + {netx_10_25_application_define, TEST_TIMEOUT_LOW}, + {netx_10_26_application_define, TEST_TIMEOUT_LOW}, + {netx_11_18_application_define, TEST_TIMEOUT_LOW}, + {netx_11_19_application_define, TEST_TIMEOUT_LOW}, +#if 0 /* The warning test case does not help. */ + {netx_11_23_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_11_24_application_define, TEST_TIMEOUT_LOW}, + {netx_11_25_application_define, TEST_TIMEOUT_LOW}, + {netx_11_26_application_define, TEST_TIMEOUT_LOW}, + {netx_11_27_application_define, TEST_TIMEOUT_LOW}, + {netx_11_28_application_define, TEST_TIMEOUT_LOW}, + {netx_11_29_application_define, TEST_TIMEOUT_LOW}, + {netx_12_01_application_define, TEST_TIMEOUT_LOW}, + {netx_12_02_application_define, TEST_TIMEOUT_LOW}, + {netx_12_03_application_define, TEST_TIMEOUT_LOW}, + {netx_12_04_application_define, TEST_TIMEOUT_LOW}, + {netx_12_17_application_define, TEST_TIMEOUT_LOW}, + {netx_12_18_application_define, TEST_TIMEOUT_LOW}, + {netx_12_19_application_define, TEST_TIMEOUT_LOW}, + {netx_12_20_application_define, TEST_TIMEOUT_LOW}, + {netx_12_21_application_define, TEST_TIMEOUT_LOW}, + {netx_12_23_application_define, TEST_TIMEOUT_LOW}, + {netx_12_24_application_define, TEST_TIMEOUT_LOW}, + {netx_12_25_application_define, TEST_TIMEOUT_LOW}, + {netx_12_26_application_define, TEST_TIMEOUT_LOW}, + {netx_12_27_application_define, TEST_TIMEOUT_LOW}, + {netx_12_30_application_define, TEST_TIMEOUT_LOW}, + {netx_12_31_application_define, TEST_TIMEOUT_LOW}, + {netx_13_01_application_define, TEST_TIMEOUT_LOW}, + {netx_13_02_application_define, TEST_TIMEOUT_LOW}, + {netx_13_04_application_define, TEST_TIMEOUT_LOW}, + {netx_13_05_application_define, TEST_TIMEOUT_LOW}, + {netx_13_17_application_define, TEST_TIMEOUT_LOW}, + {netx_14_19_application_define, TEST_TIMEOUT_LOW}, + {netx_14_20_application_define, TEST_TIMEOUT_LOW}, + {netx_15_03_application_define, TEST_TIMEOUT_LOW}, + {netx_15_20_application_define, TEST_TIMEOUT_LOW}, + {netx_15_21_application_define, TEST_TIMEOUT_LOW}, + {netx_15_24_application_define, TEST_TIMEOUT_LOW}, + {netx_15_25_application_define, TEST_TIMEOUT_LOW}, + {netx_15_26_application_define, TEST_TIMEOUT_LOW}, + {netx_16_02_application_define, TEST_TIMEOUT_LOW}, + {netx_16_17_application_define, TEST_TIMEOUT_LOW}, + {netx_16_19_application_define, TEST_TIMEOUT_LOW}, + {netx_16_21_application_define, TEST_TIMEOUT_LOW}, + {netx_16_22_application_define, TEST_TIMEOUT_LOW}, + {netx_17_17_application_define, TEST_TIMEOUT_LOW}, +#if 0 /* The warning test case does not help. */ + {netx_18_21_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_23_02_01_application_define, TEST_TIMEOUT_LOW}, + {netx_23_02_02_application_define, TEST_TIMEOUT_LOW}, + {netx_23_02_03_application_define, TEST_TIMEOUT_LOW}, + {netx_23_02_04_application_define, TEST_TIMEOUT_LOW}, + {netx_101_17_application_define, TEST_TIMEOUT_LOW}, + {netx_101_18_application_define, TEST_TIMEOUT_LOW}, + {netx_102_18_application_define, TEST_TIMEOUT_LOW}, + {netx_102_19_application_define, TEST_TIMEOUT_LOW}, + {netx_102_20_application_define, TEST_TIMEOUT_LOW}, + {netx_102_21_application_define, TEST_TIMEOUT_LOW}, + {netx_102_22_application_define, TEST_TIMEOUT_LOW}, + {netx_102_23_application_define, TEST_TIMEOUT_LOW}, + {netx_102_24_application_define, TEST_TIMEOUT_LOW}, + {netx_102_25_application_define, TEST_TIMEOUT_LOW}, + {netx_103_17_application_define, TEST_TIMEOUT_LOW}, + {netx_104_17_application_define, TEST_TIMEOUT_LOW}, + {netx_106_17_application_define, TEST_TIMEOUT_LOW}, +#endif /* SNMP_ONLY */ + +#if !defined CERT_BUILD && !defined (SNMP_ONLY) + + /* Application tests do not support for 64-bit mode yet. */ +#ifndef XWARE_64 + /* Auto_ip test. */ + {netx_auto_ip_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_auto_ip_address_check_test_application_define, TEST_TIMEOUT_LOW}, + {netx_auto_ip_announce_num_test_application_define, TEST_TIMEOUT_LOW}, + {netx_auto_ip_arp_dest_addr_test_application_define, TEST_TIMEOUT_LOW}, +#if 0 /* This test case makes no sense but output warning. Remove it temporary. */ + {netx_auto_ip_conflicts_check_test_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_auto_ip_max_conflicts_test_application_define, TEST_TIMEOUT_MID}, + + /* Websocket test. */ + {netx_websocket_fin_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_opcode_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_connect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_disconnect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_mask_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_one_frame_in_packets_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_one_packet_with_multi_frames_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_16_bit_payload_length_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_multi_instance_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_non_block_test_application_define, TEST_TIMEOUT_LOW}, + {netx_websocket_send_chain_packets_test_application_define, TEST_TIMEOUT_LOW}, + + /* Http test. */ + /* Not support, or Error. */ +#if 0 + {netx_http_status_501_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_status_400_test_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_http_if_modified_since_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_status_404_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_basic_authenticate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_delete_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_post_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_head_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_multipart_fragment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_multipart_underflow_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_get_contentlength_packetleak_test_application_define, TEST_TIMEOUT_MID}, + {netx_http_get_put_referred_URI_test_application_define, TEST_TIMEOUT_MID}, + {netx_http_client_change_connect_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_request_in_multiple_packets_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_digest_authenticate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_server_type_retrieve_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_digest_authenticate_timeout_test_application_define, TEST_TIMEOUT_LOW}, + + /*HTTP Proxy test. */ + {netx_http_proxy_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_proxy_non_block_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_proxy_multiple_response_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_proxy_error_response_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_proxy_disconnect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_http_proxy_data_fin_test_application_define, TEST_TIMEOUT_LOW}, + + /* Ftp test. */ + {netx_ftp_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_establish_data_connection_05_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_user_data_type_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_service_commands_RETR_STOR_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_service_commands_rename_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_service_commands_nlist_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_service_commands_file_write_test_application_define, TEST_TIMEOUT_LOW}, +#if 0 + {netx_ftp_service_commands_m_d_dir_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_service_commands_dele_test_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_ftp_establish_data_connection_08_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_establish_data_connection_06_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_establish_data_connection_03_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_data_connection_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_control_connection_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_commands_replys_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_commands_characters_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_access_control_commands_04_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_access_control_commands_03_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_access_control_commands_02_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_access_control_commands_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_pasv_denied_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_pasv_file_read_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_pasv_file_write_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_invalid_username_password_length_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_multiple_connection_response_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_packet_leak_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_buffer_overflow_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_client_file_write_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_server_invalid_month_crash_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_server_mss_too_small_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_rst_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_two_listen_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_parse_ipv6_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_server_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_server_list_command_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_server_dangling_pinter_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_pasv_twice_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_disconnection_event_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_ipv6_epsv_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_pasv_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ftp_pasv_stor_test_application_define, TEST_TIMEOUT_LOW}, + + /* PPP test. */ + {netx_ppp_PAP_bad_username_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_PAP_bad_password_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_chap_bad_secret_failed_retry_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_chap_bad_secret_passed_on_retry_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_LCP_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_ppp_IPCP_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_ppp_check_boundary_test_application_define, TEST_TIMEOUT_MID}, + {netx_ppp_request_dns_server_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_pap_null_name_password_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_LCP_invalid_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_IPCP_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_IPCP_nak_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_IPCP_retransmit_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_pap_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_pfc_option_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ppp_acfc_option_test_application_define, TEST_TIMEOUT_LOW}, + + /* PPPoE test. */ + {netx_pppoe_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pppoe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pppoe_api_extended_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pppoe_ac_name_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pppoe_session_control_test_application_define, TEST_TIMEOUT_LOW}, + + /* RTP test. */ + {netx_rtp_multi_interfaces_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_session_packet_send_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_session_jpeg_send_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_session_h264_send_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_session_aac_send_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_free_udp_port_find_test_application_define, TEST_TIMEOUT_MID}, + {netx_rtp_multi_clients_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_multicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtp_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtcp_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtcp_packet_process_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtcp_packet_send_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtcp_basic_test_application_define, TEST_TIMEOUT_LOW}, + + /* RTSP test. */ + {netx_rtsp_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_rtp_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_rtp_ipv6_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_rtp_multicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_rtp_ipv6_multicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_multiple_request_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_multiple_clients_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_client_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_rtsp_error_response_test_application_define, TEST_TIMEOUT_LOW}, + {netx_rtsp_delete_beforehand_test_application_define, TEST_TIMEOUT_LOW}, + + /* Tftp test. */ + {netx_tftp_basic_test_application_define, TEST_TIMEOUT_LOW}, +#ifdef FEATURE_NX_IPV6 + {netx_tftp_ipv6_basic_test_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_tftp_read_interaction_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tftp_write_interaction_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tftp_error_destination_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tftp_error_file_name_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tftp_large_data_test_application_define, TEST_TIMEOUT_HIGH}, + {netx_tftp_malformed_packet_test_application_define, TEST_TIMEOUT_LOW}, + + /* Sntp test. */ + {netx_sntp_client_ipv6_broadcast_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_ipv6_unicast_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_broadcast_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_unicast_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_request_unicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_forward_unicast_update_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_unicast_display_date_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_seconds_to_date_test_application_define, TEST_TIMEOUT_LOW}, + + /* Telnet test. */ + {netx_telnet_create_packet_pool_test_application_define, TEST_TIMEOUT_LOW}, + {netx_telnet_max_connections_test_application_define, TEST_TIMEOUT_LOW}, + {netx_telnet_activity_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_telnet_server_options_negotiate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_telnet_server_bad_option_reply_test_application_define, TEST_TIMEOUT_LOW}, + {netx_telnet_rst_test_application_define, TEST_TIMEOUT_LOW}, + {netx_telnet_two_listen_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_kod_test_application_define, TEST_TIMEOUT_LOW}, + {netx_sntp_client_packet_chain_test_application_define, TEST_TIMEOUT_LOW}, + +#endif /* !XWARE_64 */ + + /* DHCP test. */ + {netx_dhcp_basic_test_application_define, TEST_TIMEOUT_MID}, + {netx_dhcp_basic_restore_test_application_define, TEST_TIMEOUT_MID}, + {netx_dhcp_unicast_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_user_option_add_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_server_improper_term_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_coverage_test_applicaiton_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + + /* Not support. */ +#if 0 + {netx_dhcp_03_04_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_01_03_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_01_02_test_application_define, TEST_TIMEOUT_LOW}, +#endif + {netx_dhcp_04_04_01_02_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_04_04_01_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_04_03_05_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_04_03_02_03_test_application_define, TEST_TIMEOUT_MID}, + {netx_dhcp_04_03_02_02_test_application_define, TEST_TIMEOUT_MID}, + {netx_dhcp_04_03_02_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_04_01_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_05_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_02_03_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_02_02_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_02_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_03_01_01_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_packet_process_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_send_with_zero_source_address_test_application_define, TEST_TIMEOUT_LOW}, + { netx_dhcp_multiple_instances_test_application_define, TEST_TIMEOUT_LOW }, + {netx_dhcp_send_request_internal_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_extract_information_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_get_option_value_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_delete_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_stop_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_enable_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_start_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_release_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_reinitialize_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_activate_interfaces_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_secondary_interface_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_interface_order_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_ip_mutex_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_server_source_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_parameter_request_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_client_ntp_option_test_application_define, TEST_TIMEOUT_LOW}, + //{netx_dhcp_client_arp_probe_fail_multiple_interface_test_application_define, TEST_TIMEOUT_MID}, + //{netx_dhcp_client_decline_test_application_define, TEST_TIMEOUT_MID}, + {netx_dhcp_server_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_server_second_interface_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_server_options_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcp_server_small_packet_payload_test_application_define, TEST_TIMEOUT_LOW}, + + {netx_dhcpv6_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_extended_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_packet_loss_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_client_process_server_duid_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_server_ia_options_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_server_iana_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_server_process_repeated_msgs_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dhcpv6_user_option_add_test_application_define, TEST_TIMEOUT_LOW}, + +#ifndef XWARE_64 + +#ifdef NX_DHCP_RELAY_ENABLE + /* DHCPv4 Relay test. */ + {netx_dhcpv4_relay_test_define, TEST_TIMEOUT_MID}, + +#ifdef FEATURE_NX_IPV6 + /* DHCPv6 Relay test. */ + {netx_dhcpv6_relay_test_define, TEST_TIMEOUT_MID}, +#endif +#endif /* NX_DHCP_RELAY_ENABLE */ + + /* SMTP test. */ + {netx_smtp_basic_function_test_application_define, TEST_TIMEOUT_LOW}, + {netx_smtp_two_packet_ehlo_message_test_application_define, TEST_TIMEOUT_MID}, + {netx_smtp_auth_logon_function_test_application_define, TEST_TIMEOUT_LOW}, + {netx_smtp_auth_none_test_application_define, TEST_TIMEOUT_LOW}, + {netx_smtp_missing_last_250_EHLO_message_test_application_define, TEST_TIMEOUT_MID}, + {netx_smtp_two_packet_EHLO_auth_last_message_test_application_define, TEST_TIMEOUT_LOW}, + {netx_smtp_auth_no_type_test_application_define, TEST_TIMEOUT_LOW}, + {netx_smtp_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_smtp_invalid_release_test_application_define, TEST_TIMEOUT_LOW}, + + /* PoP3 test. */ + {netx_pop3_mail_receive_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pop3_two_mails_received_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pop3_packet_with_endmarker_test_application_define, TEST_TIMEOUT_LOW}, + {netx_pop3_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + + /* NAT test. */ + {netx_nat_icmp_test_application_define, TEST_TIMEOUT_MID}, + {netx_nat_udp_test_application_define, TEST_TIMEOUT_MID}, + {netx_nat_udp_port_test_application_define, TEST_TIMEOUT_MID}, + {netx_nat_udp_fragment_test_application_define, TEST_TIMEOUT_MID}, + {netx_nat_tcp_test1_application_define, TEST_TIMEOUT_MID}, + {netx_nat_tcp_test2_application_define, TEST_TIMEOUT_MID}, + {netx_nat_tcp_port_test_application_define, TEST_TIMEOUT_MID}, + {netx_nat_tcp_port_test2_application_define, TEST_TIMEOUT_MID}, + {netx_nat_tcp_fragment_test_application_define, TEST_TIMEOUT_MID}, + {netx_nat_invalid_header_test_application_define, TEST_TIMEOUT_MID}, + +#endif /* !XWARE_64 */ + + /* DNS Test. */ + {netx_dns_coverage_test_application_define, TEST_TIMEOUT_MID}, + {netx_dns_function_test_application_define, TEST_TIMEOUT_MID}, + {netx_dns_request_a_response_cname_a_smtp_live_com_test_application_define, TEST_TIMEOUT_MID}, + {netx_dns_invalid_name_unencode_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dns_invalid_resource_get_test_application_define, TEST_TIMEOUT_MID}, + {netx_dns_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dns_source_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dns_non_blocking_a_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dns_fake_response_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dns_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_dns_packet_double_release_test_application_define, TEST_TIMEOUT_LOW}, + +#ifndef XWARE_64 + /* mDNS Test. */ + {netx_mdns_internal_function_test, TEST_TIMEOUT_LOW}, + {netx_mdns_create_delete_test, TEST_TIMEOUT_LOW}, + {netx_mdns_one_shot_query_test, TEST_TIMEOUT_LOW}, + {netx_mdns_local_cache_continuous_query_test, TEST_TIMEOUT_LOW}, + {netx_mdns_local_cache_one_shot_query_test, TEST_TIMEOUT_MID}, + {netx_mdns_service_lookup_test, TEST_TIMEOUT_LOW}, + {netx_mdns_service_add_delete_test, TEST_TIMEOUT_LOW}, + {netx_mdns_announcement_repeat_test, TEST_TIMEOUT_MID}, + {netx_mdns_multiple_answers_test, TEST_TIMEOUT_LOW}, + {netx_mdns_responder_cooperating_test, TEST_TIMEOUT_LOW}, + {netx_mdns_response_with_question_test, TEST_TIMEOUT_LOW}, + {netx_mdns_source_address_test, TEST_TIMEOUT_LOW}, + {netx_mdns_source_port_test, TEST_TIMEOUT_LOW}, + {netx_mdns_two_buffer_test, TEST_TIMEOUT_LOW}, + {netx_mdns_buffer_size_test, TEST_TIMEOUT_MID}, + {netx_mdns_ttl_test, TEST_TIMEOUT_LOW}, + {netx_mdns_txt_test, TEST_TIMEOUT_LOW}, + {netx_mdns_txt_notation_test, TEST_TIMEOUT_LOW}, + {netx_mdns_name_test, TEST_TIMEOUT_LOW}, + {netx_mdns_domain_name_test, TEST_TIMEOUT_LOW}, + {netx_mdns_interface_test, TEST_TIMEOUT_LOW}, + {netx_mdns_second_interface_test, TEST_TIMEOUT_LOW}, + {netx_mdns_peer_service_change_notify_test, TEST_TIMEOUT_LOW}, + {netx_mdns_ipv6_string_test, TEST_TIMEOUT_LOW}, + {netx_mdns_bad_packet_test, TEST_TIMEOUT_LOW}, + {netx_mdns_read_overflow_test, TEST_TIMEOUT_LOW}, +#if defined __PRODUCT_NETXDUO__ && !defined NX_DISABLE_IPV4 + {netx_mdns_ram_test_define, TEST_TIMEOUT_MID}, +#endif /* __PRODUCT_NETXDUO__ && !NX_DISABLE_IPV4 */ + +#ifdef NX_IPSEC_ENABLE + /* IPSec specific function and encryption algorithm */ + {netx_ipsec_esp_transport_icmp_ipv4_icv_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_multiple_sas_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_key_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_spi_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_selector_next_layer_protocol_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_selector_policy_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_selector_type_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_selector_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_selector_port_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_retransmit_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_3des_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_3des_interface_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_interface_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_256_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_3des_null_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_3des_aes_xcbc_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_3des_md5_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_3des_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_192_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_aes_xcbc_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_md5_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_192_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_256_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_aes_xcbc_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_md5_test_define_application_define, TEST_TIMEOUT_LOW}, + + /* Combination of IPsec function and TCP/UDP/ICMP.. function. */ + {netx_ipsec_esp_transport_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_udp_ipv4_selector_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv4_interface2_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_udp_ipv4_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, + + {netx_ipsec_esp_tunnel_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_tcp_ipv4_interface2_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_udp_ipv4_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, + + /* IPsec with IPv6 address.*/ + {netx_ipsec_esp_transport_tcp_ipv6_3des_interface_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv6_aes_interface_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv6_interface2_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_tcp_ipv6_interface2_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + + {netx_ipsec_esp_tunnel_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_tcp_ipv6_interface2_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_tcp_ipv6_interface2_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + + {netx_ipsec_ah_transport_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_tcp_ipv4_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_tcp_ipv4_retransmit_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_udp_ipv4_selector_test_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + + {netx_ipsec_ah_tunnel_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, + + {netx_ipsec_ah_transport_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_transport_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + + /* IPsec with Fragment function. */ + {netx_ipsec_esp_transport_udp_ipv6_linklocal_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_transport_udp_ipv6_global_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, + + + {netx_ipsec_ah_tunnel_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_ah_tunnel_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, + + /* IPsec with Fragment function. */ + {netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, + {netx_ipsec_esp_tunnel_udp_ipv6_global_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, +#endif /* NX_IPSEC_ENABLE */ + +/* BSD Test */ +#ifdef NX_BSD_ENABLE + {netx_bsd_getaddrinfo_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_pppoe_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_ioctl_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_two_blocking_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_basic_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_basic_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_accept_blocking_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_accept_nonblocking_timeout_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_accept_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_accept_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_sendto_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_udp_select_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_accept_noselect_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_bind_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_disconnect_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_multiple_accept_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_udp_bind_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_multicast_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_udp_blocking_bidirection_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_udp_basic_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_udp_basic_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_tcp_2nd_bind_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_bind_connect_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_basic_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_basic_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_basic_rx_nohdr_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_rx_nohdr_basic_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_basic_rx_nohdr_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_rx_nohdr_basic_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_basic_rx_nohdr_blocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_ping_test_application_define, TEST_TIMEOUT_MID}, + //{netx_bsd_raw_rx_nohdr_basic_nonblocking_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_udp_bind_connect_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_udp_checksum_corrupt_test_application_define, TEST_TIMEOUT_MID}, + + {netx_bsd_udp_connect_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_raw_tx_test_application_define, TEST_TIMEOUT_MID}, + {netx_bsd_aton_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_ntoa_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_ntop_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_pton_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_inet_addr_pton_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_servers_share_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_clients_share_port_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_getsockname_without_bind_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_rcvbuf_test_application_define, TEST_TIMEOUT_LOW}, + {netx_bsd_tcp_fionread_test_application_define, TEST_TIMEOUT_LOW}, + +#endif /* NX_BSD_ENABLE */ + + /* Cloud Test. */ + {netx_cloud_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_cloud_api_test_application_define, TEST_TIMEOUT_LOW}, + {netx_cloud_module_register_deregister_test_application_define, TEST_TIMEOUT_LOW}, + {netx_cloud_module_event_test_application_define, TEST_TIMEOUT_LOW}, + +#endif /* XWARE_64 */ + +#endif /* !CERT_BUILD && !SNMP_ONLY */ + +#ifndef CERT_BUILD +#ifndef XWARE_64 + /* SNMP Agent */ + {netx_snmp_v1_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v1_object_id_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v1_packet_double_release_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_basic_v2_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v2_get_bulk_request_test_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v2_send_trap_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v2_unknown_oid_test_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v2_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v3_nosec_traplist_test_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v3_md5_failed_security_test_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v3_no_security_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v3_md5_security_test_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v3_md5_security_extended_test_application_define, TEST_TIMEOUT_MID}, + {netx_snmp_v3_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v3_decrypt_pdu_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v3_encrypt_pdu_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v3_encrypt_pdu_padding_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_v3_object_id_buffer_overwrite_test_application_define, TEST_TIMEOUT_LOW}, + + {netx_snmp_setget_integers_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_setget_octet_strings_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_setget_ip_address_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_setget_misc_test_application_define, TEST_TIMEOUT_LOW}, + {netx_snmp_abnormal_packet_test_application_define, TEST_TIMEOUT_LOW}, +#endif /* XWARE_64 */ +#endif /* CERT_BUILD */ + +#if !defined CERT_BUILD && !defined (SNMP_ONLY) + +#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) + +#ifndef XWARE_64 +#ifdef NX_IPSEC_ENABLE + /* IPsec TAHI test. */ + {netx_tahi_test_ipsec_define, TEST_TIMEOUT_MID}, + {netx_tahi_test_ipsec_2_define, TEST_TIMEOUT_MID}, + {netx_tahi_test_ipsec_udp_define, TEST_TIMEOUT_MID}, + {netx_tahi_test_ipsec_udp_2_define, TEST_TIMEOUT_MID}, + +#endif +#endif /* XWARE_64 */ + +#ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY + /* IPv6 TAHI test*/ + {netx_tahi_test_1_define, TEST_TIMEOUT_HIGH}, + + {netx_tahi_test_2_1_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_2_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_3_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_4_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_5_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_6_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_7_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_8_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_9_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_10_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_2_11_define, TEST_TIMEOUT_HIGH}, + + {netx_tahi_test_3_1_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_2_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_3_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_4_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_5_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_6_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_7_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_8_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_9_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_10_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_11_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_12_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_13_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_14_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_15_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_16_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_17_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_18_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_19_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_20_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_21_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_22_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_23_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_24_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_25_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_26_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_27_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_28_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_29_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_30_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_31_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_32_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_33_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_34_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_35_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_36_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_37_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_38_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_39_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_40_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_41_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_42_define, TEST_TIMEOUT_HIGH}, + + /* Remove 2 hours test. */ +#if 0 + {netx_tahi_test_3_43_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_44_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_3_45_define, TEST_TIMEOUT_HIGH}, +#endif + + {netx_tahi_test_4_2_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_3_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_4_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_5_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_6_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_7_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_8_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_9_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_10_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_11_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_12_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_13_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_14_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_15_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_test_4_16_define, TEST_TIMEOUT_HIGH}, + + {netx_tahi_test_5_define, TEST_TIMEOUT_HIGH}, +#endif /* NX_ENABLE_IPV6_PATH_MTU_DISCOVERY */ +#endif /* NX_TAHI_ENABLE*/ + +#ifdef NX_DHCPV6_TAHI_ENABLE + + /* Section 1: RFC3315 - Address Assignment for Client. */ + {netx_tahi_dhcpv6_test_01_002_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_003_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_004_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_005_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_006_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_007_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_008_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_009_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_010_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_011_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_012_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_013_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_014_define, TEST_TIMEOUT_HIGH}, + + {netx_tahi_dhcpv6_test_01_019_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_020_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_021_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_022_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_023_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_024_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_025_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_026_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_027_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_028_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_029_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_030_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_031_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_032_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_033_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_034_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_035_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_036_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_037_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_038_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_039_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_040_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_041_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_042_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_043_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_044_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_045_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_046_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_047_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_048_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_049_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_050_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_051_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_052_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_053_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_054_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_055_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_056_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_057_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_058_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_059_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_060_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_061_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_062_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_063_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_064_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_065_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_066_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_067_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_068_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_069_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_070_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_071_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_072_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_073_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_074_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_075_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_076_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_077_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_078_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_079_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_080_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_081_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_082_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_083_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_084_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_085_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_086_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_087_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_088_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_089_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_090_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_091_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_092_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_093_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_094_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_095_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_096_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_097_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_098_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_01_099_define, TEST_TIMEOUT_HIGH}, + + + /* Section 4: RFC3646 - DNS configuration in parallel with Address Assignment for Client. */ + {netx_tahi_dhcpv6_test_04_002_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_003_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_004_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_005_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_006_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_007_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_008_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_009_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_010_define, TEST_TIMEOUT_HIGH}, + + {netx_tahi_dhcpv6_test_04_012_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_013_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_014_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_015_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_016_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_017_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_018_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_019_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_020_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_021_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_022_define, TEST_TIMEOUT_HIGH}, + + {netx_tahi_dhcpv6_test_04_026_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_04_027_define, TEST_TIMEOUT_HIGH}, + + + /* Section 7: RFC3736 - Stateless DHCPv6 for DNS configuration for Client. */ + {netx_tahi_dhcpv6_test_07_002_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_003_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_004_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_005_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_006_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_007_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_008_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_009_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_010_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_011_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_012_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_013_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_014_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_015_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_016_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_017_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_018_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_019_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_020_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_021_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_022_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_023_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_024_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_025_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_026_define, TEST_TIMEOUT_HIGH}, + {netx_tahi_dhcpv6_test_07_027_define, TEST_TIMEOUT_HIGH}, + +#endif /* NX_DHCPV6_TAHI_ENABLE*/ +#endif /* !CERT_BUILD && !SNMP_ONLY */ +#endif /* CTEST */ + {TX_NULL, TEST_TIMEOUT_LOW}, +}; + +/* Define thread prototypes. */ + +void test_control_thread_entry(ULONG thread_input); +void test_control_return(UINT status); +void test_control_cleanup(void); +void _nx_ram_network_driver_reset(void); + +/* Define necessary external references. */ + +#ifdef __ghs +extern TX_MUTEX __ghLockMutex; +#endif + +extern TX_TIMER *_tx_timer_created_ptr; +extern ULONG _tx_timer_created_count; +#ifndef TX_TIMER_PROCESS_IN_ISR +extern TX_THREAD _tx_timer_thread; +#endif +extern TX_THREAD *_tx_thread_created_ptr; +extern ULONG _tx_thread_created_count; +extern TX_SEMAPHORE *_tx_semaphore_created_ptr; +extern ULONG _tx_semaphore_created_count; +extern TX_QUEUE *_tx_queue_created_ptr; +extern ULONG _tx_queue_created_count; +extern TX_MUTEX *_tx_mutex_created_ptr; +extern ULONG _tx_mutex_created_count; +extern TX_EVENT_FLAGS_GROUP *_tx_event_flags_created_ptr; +extern ULONG _tx_event_flags_created_count; +extern TX_BYTE_POOL *_tx_byte_pool_created_ptr; +extern ULONG _tx_byte_pool_created_count; +extern TX_BLOCK_POOL *_tx_block_pool_created_ptr; +extern ULONG _tx_block_pool_created_count; + +extern NX_PACKET_POOL * _nx_packet_pool_created_ptr; +extern ULONG _nx_packet_pool_created_count; +extern NX_IP * _nx_ip_created_ptr; +extern ULONG _nx_ip_created_count; + +/* Define main entry point. */ + +int main() +{ +#if 0 + /* Reassign "stdout" to "freopen.out": */ + stream = freopen( "test_result.txt", "w", stdout ); +#endif + /* Print out some test information banners. */ + printf("%s\n", _nx_version_id); +#ifdef FEATURE_NX_IPV6 + printf("IPv6 is built-in.\n"); +#else + printf("IPv6 is not built-in.\n"); +#endif + +#ifdef NX_IPSEC_ENABLE + printf("IPsec is built-in.\n"); +#else + printf("IPsec is not built-in.\n"); +#endif + +#ifdef NX_TUNNEL_ENABLE + printf("Tunnel is built-in.\n"); +#else + printf("Tunnel is not built-in.\n"); +#endif + + printf("IP structure size: %d\n", (UINT)sizeof(NX_IP)); + printf("TCP control block size: %d\n", (UINT)sizeof(NX_TCP_SOCKET)); +#if defined(__PRODUCT_NETXDUO__) +#ifndef NX_DISABLE_IPV4 + printf("ARP table entry size: %d, ARP table size %d\n", + (UINT)sizeof(NX_ARP), (UINT)(sizeof(NX_ARP) * NX_ARP_TABLE_SIZE)); +#endif /* NX_DISABLE_IPV4 */ +#elif defined(__PRODUCT_NETX__) + printf("ARP table entry size: %d, ARP table size %d\n", + (UINT)sizeof(NX_ARP), (UINT)(sizeof(NX_ARP) * NX_ROUTE_TABLE_SIZE)); +#else +#error "Not NetX nor NetX Duo" +#endif + printf("Packet structure size: %d\n", (UINT)sizeof(NX_PACKET)); + fflush(stdout); + +#if defined(__linux__) && defined(USE_FORK) + fork_child(); +#else + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +#endif + + return 0; +} + +#if defined(__linux__) && defined(USE_FORK) +static pid_t child_pid = -1; +static UINT test_index = 0; +static int result_fd[2]; + +void kill_child(int sig) +{ +CHAR data[4]={0, 1, 0, 0}; + + printf("ERROR! - TIMEOUT\n"); + fflush(stdout); + write(result_fd[1], data, sizeof(data)); + exit(1); +} + +void fork_child() +{ +INT status; +CHAR data[4]; +struct pollfd fds; + + while (test_control_tests[test_index].test_entry != TX_NULL) + { + + /* Create pipe for communicating. */ + pipe(result_fd); + fds.fd = result_fd[0]; + fds.events=POLLIN | POLLOUT | POLLERR; + + + /* Fork test process. */ + child_pid = fork(); + if (child_pid > 0) + { + wait(&status); + poll(&fds, 1, 0); + if (fds.revents & POLLIN) + { + read(result_fd[0], data, sizeof(data)); + test_control_successful_tests += (ULONG)data[0]; + test_control_failed_tests += (ULONG)data[1]; + test_control_warning_tests += (ULONG)data[2]; + test_control_na_tests += (ULONG)data[3]; + } + else + { + + /* The child process crashes. */ + printf("ERROR! CRASH\n"); + test_control_failed_tests++; + } + + fflush(stdout); + + test_index++; + } + else + { + + /* Setup SIGALRM callback function. */ + signal(SIGALRM, (void (*)(int))kill_child); + + /* Initialize the results. */ + test_control_successful_tests = 0; + test_control_failed_tests = 0; + test_control_warning_tests = 0; + test_control_na_tests = 0; + + /* Setup timeout alarm. */ + alarm(test_control_tests[test_index].timeout / NX_IP_PERIODIC_RATE); + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); + return; + } + } + + /* Finished with all tests, print results and return! */ + printf("**** Testing Complete ****\n"); + printf("**** Test Summary: Tests Passed: %d Tests Warning: %d Tests Failed: %d\n", (UINT)test_control_successful_tests, (UINT)test_control_warning_tests, (UINT)test_control_failed_tests); +#ifdef BATCH_TEST + exit(test_control_failed_tests); +#endif +} + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + + fx_system_initialize(); + + /* Dispatch the test. */ + (test_control_tests[test_index].test_entry)(first_unused_memory); +} + +void test_control_return(UINT status) +{ +UINT old_posture = TX_INT_ENABLE; +INT exit_code = status; +CHAR data[4]; + + fflush(stdout); + + /* Initialize result through pipe. */ + data[0] = (CHAR)test_control_successful_tests; + data[1] = (CHAR)test_control_failed_tests; + data[2] = (CHAR)test_control_warning_tests; + data[3] = (CHAR)test_control_na_tests; + + /* Save the status in a global. */ + test_control_return_status = status; + + /* Ensure interrupts are enabled. */ + old_posture = tx_interrupt_control(TX_INT_ENABLE); + + /* Determine if it was successful or not. */ + if((status == 1) || (_tx_thread_preempt_disable) || (old_posture == TX_INT_DISABLE)) + { + data[1]++; + exit_code = 1; + } + else if(status == 2) + { + data[2]++; + exit_code = 2; + } + else if(status == 0) + { + data[0]++; + exit_code = 0; + } + else if(status == 3) + { + data[3]++; + exit_code = 3; + } + + /* Send result through pipe. */ + write(result_fd[1], data, sizeof(data)); + exit(exit_code); +} + +#else +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + UCHAR *pointer; + + /* Setup a pointer to the first unused memory. */ + pointer = (UCHAR *) first_unused_memory; + + fx_system_initialize(); + +#ifdef CTEST + + test_application_define(pointer); + +#else + + /* Create the test control thread. */ + tx_thread_create(&test_control_thread, "test control thread", test_control_thread_entry, 0, + pointer, TEST_STACK_SIZE, + 0, 0, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + TEST_STACK_SIZE; + +#ifndef NETXTEST_TIMEOUT_DISABLE + /* Create the test control semaphore. */ + tx_semaphore_create(&test_control_sema, "Test control semaphore", 0); +#endif + + /* Remember the free memory pointer. */ + test_free_memory_ptr = pointer; + +#endif /* CTEST */ +} + +/* Define the test control thread. This thread is responsible for dispatching all of the +tests in the ThreadX test suite. */ + +void test_control_thread_entry(ULONG thread_input) +{ + UINT i; + + /* Loop to process all tests... */ + i = 0; + while (test_control_tests[i].test_entry != TX_NULL) + { + + /* Dispatch the test. */ + (test_control_tests[i++].test_entry)(test_free_memory_ptr); + + if (test_control_return_status != 3) + { + +#ifdef NETXTEST_TIMEOUT_DISABLE + /* Suspend control test to allow test to run. */ + tx_thread_suspend(&test_control_thread); +#else + if(tx_semaphore_get(&test_control_sema, test_control_tests[i - 1].timeout)) + { + + /* Test case timeouts. */ + printf("ERROR!\n"); + test_control_failed_tests++; + + } +#endif + } + else + test_control_return_status = 0; + + /* Test finished, cleanup in preparation for the next test. */ + test_control_cleanup(); + fflush(stdout); + } + + /* Finished with all tests, print results and return! */ + printf("**** Testing Complete ****\n"); + printf("**** Test Summary: Tests Passed: %d Tests Warning: %d Tests Failed: %d\n", (UINT)test_control_successful_tests, (UINT)test_control_warning_tests, (UINT)test_control_failed_tests); +#if 0 + fclose(stream); +#endif +#ifdef BATCH_TEST + exit(test_control_failed_tests); +#endif + + +} + +void test_control_return(UINT status) +{ + UINT old_posture = TX_INT_ENABLE; + + /* Save the status in a global. */ + test_control_return_status = status; + + /* Ensure interrupts are enabled. */ + old_posture = tx_interrupt_control(TX_INT_ENABLE); + + /* Determine if it was successful or not. */ + if((status == 1) || (_tx_thread_preempt_disable) || (old_posture == TX_INT_DISABLE)) + test_control_failed_tests++; + else if(status == 2) + test_control_warning_tests++; + else if(status == 0) + test_control_successful_tests++; + else if(status == 3) + test_control_na_tests++; + + +#ifdef CTEST + + exit(test_control_failed_tests); + +#else + +#ifdef NETXTEST_TIMEOUT_DISABLE + /* Resume the control thread to fully exit the test. */ + tx_thread_resume(&test_control_thread); +#else + if(test_control_return_status != 3) + tx_semaphore_put(&test_control_sema); +#endif + +#endif /* CTEST */ +} + +void test_control_cleanup(void) +{ + TX_MUTEX *mutex_ptr; + TX_THREAD *thread_ptr; + + /* Clean timer used by RAM driver. */ + _nx_ram_network_driver_timer_clean(); + + /* Delete all IP instances. */ + while (_nx_ip_created_ptr) + { + + /* Delete all UDP sockets. */ + while (_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr) + { + + /* Make sure the UDP socket is unbound. */ + nx_udp_socket_unbind(_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr); + } + + /* Delete all TCP sockets. */ + while (_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr) + { + + /* Disconnect. */ + nx_tcp_socket_disconnect(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr, NX_NO_WAIT); + + /* Make sure the TCP client socket is unbound. */ + nx_tcp_client_socket_unbind(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + + /* Make sure the TCP server socket is unaccepted. */ + nx_tcp_server_socket_unaccept(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + } + + /* Clear all listen requests. */ + while (_nx_ip_created_ptr -> nx_ip_tcp_active_listen_requests) + { + + /* Make sure the TCP server socket is unlistened. */ + nx_tcp_server_socket_unlisten(_nx_ip_created_ptr, (_nx_ip_created_ptr -> nx_ip_tcp_active_listen_requests) -> nx_tcp_listen_port); + } + + /* Delete the IP instance. */ + nx_ip_delete(_nx_ip_created_ptr); + } + + /* Delete all the packet pools. */ + while (_nx_packet_pool_created_ptr) + { + nx_packet_pool_delete(_nx_packet_pool_created_ptr); + } + + /* Reset the RAM driver. */ + _nx_ram_network_driver_reset(); + + /* Delete all queues. */ + while(_tx_queue_created_ptr) + { + + /* Delete queue. */ + tx_queue_delete(_tx_queue_created_ptr); + } + + /* Delete all semaphores. */ + while(_tx_semaphore_created_ptr) + { +#ifndef NETXTEST_TIMEOUT_DISABLE + if(_tx_semaphore_created_ptr != &test_control_sema) + { + + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr); + } + else if(_tx_semaphore_created_count == 1) + break; + else + { + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr -> tx_semaphore_created_next); + } +#else + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr); +#endif + } + + /* Delete all event flag groups. */ + while(_tx_event_flags_created_ptr) + { + + /* Delete event flag group. */ + tx_event_flags_delete(_tx_event_flags_created_ptr); + } + + /* Delete all byte pools. */ + while(_tx_byte_pool_created_ptr) + { + + /* Delete byte pool. */ + tx_byte_pool_delete(_tx_byte_pool_created_ptr); + } + + /* Delete all block pools. */ + while(_tx_block_pool_created_ptr) + { + + /* Delete block pool. */ + tx_block_pool_delete(_tx_block_pool_created_ptr); + } + + /* Delete all timers. */ + while(_tx_timer_created_ptr) + { + + /* Deactivate timer. */ + tx_timer_deactivate(_tx_timer_created_ptr); + + /* Delete timer. */ + tx_timer_delete(_tx_timer_created_ptr); + } + + /* Delete all mutexes (except for system mutex). */ + while(_tx_mutex_created_ptr) + { + + /* Setup working mutex pointer. */ + mutex_ptr = _tx_mutex_created_ptr; + +#ifdef __ghs + + /* Determine if the mutex is the GHS system mutex. If so, don't delete! */ + if(mutex_ptr == &__ghLockMutex) + { + + /* Move to next mutex. */ + mutex_ptr = mutex_ptr -> tx_mutex_created_next; + } + + /* Determine if there are no more mutexes to delete. */ + if(_tx_mutex_created_count == 1) + break; +#endif + + /* Delete mutex. */ + tx_mutex_delete(mutex_ptr); + } + + /* Delete all threads, except for timer thread, and test control thread. */ + while (_tx_thread_created_ptr) + { + + /* Setup working pointer. */ + thread_ptr = _tx_thread_created_ptr; + +#ifdef TX_TIMER_PROCESS_IN_ISR + + /* Determine if there are more threads to delete. */ + if(_tx_thread_created_count == 1) + break; + + /* Determine if this thread is the test control thread. */ + if(thread_ptr == &test_control_thread) + { + + /* Move to the next thread pointer. */ + thread_ptr = thread_ptr -> tx_thread_created_next; + } +#else + + /* Determine if there are more threads to delete. */ + if(_tx_thread_created_count == 2) + break; + + /* Move to the thread not protected. */ + while ((thread_ptr == &_tx_timer_thread) || (thread_ptr == &test_control_thread)) + { + + /* Yes, move to the next thread. */ + thread_ptr = thread_ptr -> tx_thread_created_next; + } +#endif + + /* First terminate the thread to ensure it is ready for deletion. */ + tx_thread_terminate(thread_ptr); + + /* Delete the thread. */ + tx_thread_delete(thread_ptr); + } + + /* At this point, only the test control thread and the system timer thread and/or mutex should still be + in the system. */ + +#ifdef NX_PCAP_ENABLE + /* Close the pcap file. */ + close_pcap_file(); +#endif +} +#endif diff --git a/test/regression/test/netxtestcontrol.h b/test/regression/test/netxtestcontrol.h new file mode 100644 index 00000000..addae17e --- /dev/null +++ b/test/regression/test/netxtestcontrol.h @@ -0,0 +1,8 @@ + +#define CHECK_STATUS(expected, actual) \ + if((expected) != (actual)) \ + { \ + printf("\nERROR! File: %s Line: %d\n", __FILE__, __LINE__); \ + printf("Expected: 0x%x, (%d) Got: 0x%x (%d)\n", (UINT)(expected), (INT)(expected), (UINT)(actual), (INT)(actual)); \ + test_control_return(1); \ + } diff --git a/test/regression/test/nx_ram_network_driver_test_1500.c b/test/regression/test/nx_ram_network_driver_test_1500.c new file mode 100644 index 00000000..e1f57c80 --- /dev/null +++ b/test/regression/test/nx_ram_network_driver_test_1500.c @@ -0,0 +1,2879 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 1996-2005 by Express Logic Inc. */ +/* */ +/* This software is copyrighted by and is the sole property of Express */ +/* Logic, Inc. All rights, title, ownership, or other interests */ +/* in the software remain the property of Express Logic, Inc. This */ +/* software may only be used in accordance with the corresponding */ +/* license agreement. Any unauthorized use, duplication, transmission, */ +/* distribution, or disclosure of this software is expressly forbidden. */ +/* */ +/* This Copyright notice may not be removed or modified without prior */ +/* written consent of Express Logic, Inc. */ +/* */ +/* Express Logic, Inc. reserves the right to modify this software */ +/* without notice. */ +/* */ +/* Express Logic, Inc. info@expresslogic.com */ +/* 11423 West Bernardo Court http://www.expresslogic.com */ +/* San Diego, CA 92127 */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** RAM Network (RAM) */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Include necessary system files. */ + +#include "nx_api.h" +#include "nx_ram_network_driver_test_1500.h" +#ifdef NX_ENABLE_INTERFACE_CAPABILITY +#define NX_DROP_ERROR_CHECKSUM +#include "nx_ip.h" +#include "nx_tcp.h" +#include "nx_udp.h" +#include "nx_icmp.h" +#include "nx_igmp.h" +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + +#ifdef NX_BSD_RAW_PPPOE_SUPPORT +#include "nxd_bsd.h" +#endif /* NX_BSD_RAW_PPPOE_SUPPORT */ + + +#ifdef NX_PCAP_ENABLE +#ifdef linux +#include "sys/time.h" +#else +#include "winsock.h" +#endif +FILE *nx_network_driver_pcap_fp = NX_NULL; +#endif /* NX_PCAP_ENABLE */ + +#ifdef NX_PPP_PPPOE_ENABLE +#include "nx_pppoe_client.h" +#include "nx_pppoe_server.h" + +extern NX_PPPOE_CLIENT *_nx_pppoe_client_created_ptr; +extern NX_PPPOE_SERVER *_nx_pppoe_server_created_ptr; +#endif + +ULONG fragment_order_test = 0; +ULONG packet_gather = 0; +ULONG packet_drop = 0; +NX_PACKET *packet_save[4] = {0, 0, 0, 0}; +NX_PACKET_POOL *driver_pool = NX_NULL; +CHAR driver_data_buffer[3014]; +ULONG driver_data_length; + +/* Define Ethernet address format. This is prepended to the incoming IP + and ARP/RARP messages. The frame beginning is 14 bytes, but for speed + purposes, we are going to assume there are 16 bytes free in front of the + prepend pointer and that the prepend pointer is 32-bit aligned. + + Byte Offset Size Meaning + + 0 6 Destination Ethernet Address + 6 6 Source Ethernet Address + 12 2 Ethernet Frame Type, where: + + 0x0800 -> IP Datagram + 0x0806 -> ARP Request/Reply + 0x0835 -> RARP request reply + + 42 18 Padding on ARP and RARP messages only. */ + +#define NX_ETHERNET_IP 0x0800 +#define NX_ETHERNET_ARP 0x0806 +#define NX_ETHERNET_RARP 0x8035 +#define NX_ETHERNET_IPV6 0x86DD +#ifdef NX_PPP_PPPOE_ENABLE +#define NX_ETHERNET_PPPOE_DISCOVERY 0x8863 +#define NX_ETHERNET_PPPOE_SESSION 0x8864 +#endif +#define NX_ETHERNET_SIZE 14 + +/* For the simulated ethernet driver, physical addresses are allocated starting + at the preset value and then incremented before the next allocation. */ + +ULONG simulated_address_msw = 0x0011; +ULONG simulated_address_lsw = 0x22334456; + +#define NX_MAX_RAM_INTERFACES 8 +#define NX_RAM_DRIVER_MAX_MCAST_ADDRESSES 8 + +typedef struct MAC_ADDRESS_STRUCT +{ + ULONG nx_mac_address_msw; + ULONG nx_mac_address_lsw; + +} MAC_ADDRESS; + + +/* Define an application-specific data structure that holds internal + data (such as the state information) of a device driver. + + The example below applies to the simulated RAM driver. + User shall replace its content with information related to + the actual driver being used. */ +typedef struct _nx_ram_network_driver_instance_type +{ + UINT nx_ram_network_driver_in_use; + UINT nx_ram_network_driver_id; + NX_INTERFACE *nx_ram_driver_interface_ptr; + NX_IP *nx_ram_driver_ip_ptr; + MAC_ADDRESS nx_ram_driver_mac_address; + MAC_ADDRESS nx_ram_driver_mcast_address[NX_RAM_DRIVER_MAX_MCAST_ADDRESSES]; + +} _nx_ram_network_driver_instance_type; + +/* In this example, there are four instances of the simulated RAM driver. + Therefore an array of four driver instances are created to keep track of + the interface information of each driver. */ +static _nx_ram_network_driver_instance_type nx_ram_driver[NX_MAX_RAM_INTERFACES]; + + +/* Define driver prototypes. */ + +VOID _nx_ram_network_driver_internal(NX_IP_DRIVER *driver_req_ptr, UINT mtu_size); +VOID _nx_ram_network_driver_3000(NX_IP_DRIVER *driver_req_ptr) +{ + _nx_ram_network_driver_internal(driver_req_ptr, 3000); +} +VOID _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr) +{ + _nx_ram_network_driver_internal(driver_req_ptr, 1500); +} +VOID _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr) +{ + _nx_ram_network_driver_internal(driver_req_ptr, 1024); +} +VOID _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr) +{ + _nx_ram_network_driver_internal(driver_req_ptr, 512); +} +VOID _nx_ram_network_driver_256(NX_IP_DRIVER *driver_req_ptr) +{ + _nx_ram_network_driver_internal(driver_req_ptr, 256); +} + +UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); + +VOID _nx_ram_network_driver_output(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id); +VOID _nx_ram_network_driver_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id); +VOID _nx_ram_network_driver_reset(); + +TX_TIMER nx_driver_timers[NX_MAX_TIMER]; +NX_IP_DRIVER nx_driver_requests[NX_MAX_TIMER]; +UCHAR nx_driver_timer_used[NX_MAX_TIMER]; + + +#ifndef NX_INTERFACE_CAPABILITY +#define NX_INTERFACE_CAPABILITY ( NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM | NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM | NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM | NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM | NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM | NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM ) +#endif + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY +UINT _nx_ram_network_driver_calculate_checksum(NX_INTERFACE *interface_ptr, NX_PACKET *packet_ptr, UCHAR is_check); +#endif + +#ifdef NX_PCAP_ENABLE +UINT write_pcap_file(NX_PACKET *packet_ptr); +#endif /* NX_PCAP_ENABLE */ + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_set_pool PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function sets the virtual network driver pool. */ +/* */ +/* INPUT */ +/* */ +/* pool_ptr Pool used by driver */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* */ +/**************************************************************************/ +UINT _nx_ram_network_driver_set_pool(NX_PACKET_POOL *pool_ptr) +{ + driver_pool = pool_ptr; + return NX_SUCCESS; +} + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_reset PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function resets the virtual network driver. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* */ +/**************************************************************************/ +void _nx_ram_network_driver_reset(void) +{ + simulated_address_msw = 0x0011; + simulated_address_lsw = 0x22334456; + + fragment_order_test = 0; + packet_gather = 0; + packet_drop = 0; + packet_save[0] = 0; + packet_save[1] = 0; + packet_save[2] = 0; + packet_save[3] = 0; + + memset(&nx_ram_driver[0], 0 ,sizeof(_nx_ram_network_driver_instance_type) * (NX_MAX_RAM_INTERFACES)); + memset(&nx_driver_timers[0], 0, sizeof(TX_TIMER) * (NX_MAX_TIMER)); + memset(&nx_driver_requests[0], 0, sizeof(NX_IP_DRIVER) * (NX_MAX_TIMER)); + memset(&nx_driver_timer_used[0], 0, sizeof(UCHAR) * (NX_MAX_TIMER)); + + driver_pool = NX_NULL; +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_delay_entry PORTABLE C */ +/* 2.1b */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function sends out delayed packet. */ +/* */ +/* INPUT */ +/* */ +/* index index of driver request */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _nx_ram_network_driver_output Send physical packet out */ +/* */ +/* CALLED BY */ +/* */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx William E. Lamie Initial Version 2.0 */ +/* */ +/**************************************************************************/ +VOID _nx_ram_network_driver_delay_entry(ULONG timer_input) +{ +TX_INTERRUPT_SAVE_AREA +UINT index; +UINT interface_instance_id; +NX_IP_DRIVER *driver_req; + + index = (timer_input & 0xFFFF0000) >> 16; + interface_instance_id = timer_input & 0x0000FFFF; + + driver_req = &nx_driver_requests[index]; + + /* Send out delayed packet. */ + _nx_ram_network_driver_output(driver_req -> nx_ip_driver_ptr, driver_req -> nx_ip_driver_packet, interface_instance_id); + + /* Deactivate timer. */ + tx_timer_deactivate(&nx_driver_timers[index]); + + TX_DISABLE + + /* Clean the used flag. */ + nx_driver_timer_used[index] = NX_RAMDRIVER_TIMER_DIRTY; + + TX_RESTORE +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_timer_clean PORTABLE C */ +/* 2.1b */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function cleans timers used by driver. */ +/* */ +/* INPUT */ +/* */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx William E. Lamie Initial Version 2.0 */ +/* */ +/**************************************************************************/ +VOID _nx_ram_network_driver_timer_clean(VOID) +{ + UINT timer_index; + + for(timer_index = 0; timer_index < NX_MAX_TIMER; timer_index++) + { + if(nx_driver_timer_used[timer_index] != NX_RAMDRIVER_TIMER_UNUSED) + { + tx_timer_deactivate(&nx_driver_timers[timer_index]); + tx_timer_delete(&nx_driver_timers[timer_index]); + } + + nx_driver_timer_used[timer_index] = NX_RAMDRIVER_TIMER_UNUSED; + } +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_internal PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function acts as a virtual network for testing the NetX source */ +/* and driver concepts. */ +/* */ +/* Note, This function has callback functions for test cases. */ +/* */ +/* INPUT */ +/* */ +/* driver_req__ptr Pointer to NX_IP_DRIVER */ +/* mtu_size LINK MTU size */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* NetX IP processing */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* */ +/**************************************************************************/ +VOID _nx_ram_network_driver_internal(NX_IP_DRIVER *driver_req_ptr, UINT mtu_size) +{ + +TX_INTERRUPT_SAVE_AREA +NX_IP *ip_ptr; +NX_PACKET *packet_ptr; +ULONG *ethernet_frame_ptr; +NX_INTERFACE *interface_ptr; +#ifdef __PRODUCT_NETXDUO__ +UINT interface_index; +#endif +UINT i; +NX_PACKET *dup_packet_ptr = NX_NULL; +UINT timer_index; +UINT op = 0, delay = 0; +UINT status; +ULONG timer_input; +NX_PACKET_POOL *pool_ptr; +UINT old_threshold = 0; + + /* Setup the IP pointer from the driver request. */ + ip_ptr = driver_req_ptr -> nx_ip_driver_ptr; + + /* Set driver pool. */ + if (driver_pool) + pool_ptr = driver_pool; + else + pool_ptr = ip_ptr -> nx_ip_default_packet_pool; + + /* Default to successful return. */ + driver_req_ptr -> nx_ip_driver_status = NX_SUCCESS; + + /* Setup interface pointer. */ + interface_ptr = driver_req_ptr -> nx_ip_driver_interface; + +#ifdef __PRODUCT_NETXDUO__ + /* Obtain the index number of the network interface. */ + interface_index = interface_ptr -> nx_interface_index; +#endif + + /* Find out the driver interface if the driver command is not ATTACH. */ + if(driver_req_ptr -> nx_ip_driver_command != NX_LINK_INTERFACE_ATTACH) + { + for(i = 0; i < NX_MAX_RAM_INTERFACES;i++) + { + if(nx_ram_driver[i].nx_ram_network_driver_in_use == 0) + continue; + + if(nx_ram_driver[i].nx_ram_driver_ip_ptr != ip_ptr) + continue; + + if(nx_ram_driver[i].nx_ram_driver_interface_ptr != driver_req_ptr -> nx_ip_driver_interface) + continue; + + break; + } + + if(i == NX_MAX_RAM_INTERFACES) + { + driver_req_ptr -> nx_ip_driver_status = NX_INVALID_INTERFACE; + return; + } + } + + /* Process according to the driver request type in the IP control block. */ + switch (driver_req_ptr -> nx_ip_driver_command) + { + + case NX_LINK_INTERFACE_ATTACH: + { + + /* Disable preemption. */ + tx_thread_preemption_change(tx_thread_identify(), 0, &old_threshold); + + /* Find an available driver instance to attach the interface. */ + for(i = 0; i < NX_MAX_RAM_INTERFACES;i++) + { + if(nx_ram_driver[i].nx_ram_network_driver_in_use == 0) + break; + } + /* An available entry is found. */ + if(i < NX_MAX_RAM_INTERFACES) + { + /* Set the IN USE flag.*/ + nx_ram_driver[i].nx_ram_network_driver_in_use = 1; + + nx_ram_driver[i].nx_ram_network_driver_id = i; + + /* Record the interface attached to the IP instance. */ + nx_ram_driver[i].nx_ram_driver_interface_ptr = driver_req_ptr -> nx_ip_driver_interface; + + /* Record the IP instance. */ + nx_ram_driver[i].nx_ram_driver_ip_ptr = ip_ptr; + + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw = simulated_address_msw; + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw = simulated_address_lsw + i; + } + else + { + driver_req_ptr -> nx_ip_driver_status = NX_INVALID_INTERFACE; + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + driver_req_ptr -> nx_ip_driver_interface -> nx_interface_capability_flag = NX_INTERFACE_CAPABILITY; +#endif + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); + + break; + } + +#ifdef __PRODUCT_NETXDUO__ + case NX_LINK_UNINITIALIZE: + case NX_LINK_INTERFACE_DETACH : + { + + /* Zero out the driver instance. */ + memset(&(nx_ram_driver[i]), 0 , sizeof(_nx_ram_network_driver_instance_type)); + + break; + } +#endif + case NX_LINK_INITIALIZE: + { + + /* Device driver shall initialize the Ethernet Controller here. */ + + packet_process_callback = NX_NULL; + advanced_packet_process_callback = NX_NULL; + +#ifdef __PRODUCT_NETXDUO__ + /* Once the Ethernet controller is initialized, the driver needs to + configure the NetX Interface Control block, as outlined below. */ + + /* The nx_interface_ip_mtu_size should be the MTU for the IP payload. + For regular Ethernet, the IP MTU is 1500. */ + nx_ip_interface_mtu_set(ip_ptr, interface_index, mtu_size); + + /* Set the physical address (MAC address) of this IP instance. */ + /* For this simulated RAM driver, the MAC address is constructed by + incrementing a base lsw value, to simulate multiple nodes hanging on the + ethernet. */ + nx_ip_interface_physical_address_set(ip_ptr, interface_index, + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw, + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw, NX_FALSE); + + /* Indicate to the IP software that IP to physical mapping is required. */ + nx_ip_interface_address_mapping_configure(ip_ptr, interface_index, NX_TRUE); +#else + + interface_ptr -> nx_interface_ip_mtu_size = mtu_size; + + /* Set the physical address (MAC address) of this IP instance. */ + /* For this simulated RAM driver, the MAC address is constructed by + incrementing a base lsw value, to simulate multiple nodes hanging on the + ethernet. */ + + interface_ptr -> nx_interface_physical_address_msw = nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw; + interface_ptr -> nx_interface_physical_address_lsw = nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw; + + /* Indicate to the IP software that IP to physical mapping is required. */ + interface_ptr -> nx_interface_address_mapping_needed = NX_TRUE; +#endif + + break; + } + + case NX_LINK_ENABLE: + { + + /* Process driver link enable. An Ethernet driver shall enable the + transmit and reception logic. Once the IP stack issues the + LINK_ENABLE command, the stack may start transmitting IP packets. */ + + /* In the RAM driver, just set the enabled flag. */ + interface_ptr -> nx_interface_link_up = NX_TRUE; + + break; + } + + case NX_LINK_DISABLE: + { + + /* Process driver link disable. This command indicates the IP layer + is not going to transmit any IP datagrams, nor does it expect any + IP datagrams from the interface. Therefore after processing this command, + the device driver shall not send any incoming packets to the IP + layer. Optionally the device driver may turn off the interface. */ + + /* In the RAM driver, just clear the enabled flag. */ + interface_ptr -> nx_interface_link_up = NX_FALSE; + + break; + } + + case NX_LINK_PACKET_SEND: + { + /* Process driver send packet. */ + + /* Place the ethernet frame at the front of the packet. */ + packet_ptr = driver_req_ptr -> nx_ip_driver_packet; + + if (interface_ptr -> nx_interface_link_up == NX_FALSE) + { + + /* Link is down. Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + return; + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + _nx_ram_network_driver_calculate_checksum(nx_ram_driver[i].nx_ram_driver_interface_ptr, packet_ptr, NX_FALSE); +#endif + + + /* Advanced function entry for calling. */ + if(advanced_packet_process_callback != NX_NULL) + { + status = advanced_packet_process_callback(ip_ptr, packet_ptr, &op, &delay); + if(!status) + return; + + /* Advanced process. */ + switch(op) + { + case NX_RAMDRIVER_OP_DROP: + { + + /* Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + return; + }break; + + case NX_RAMDRIVER_OP_DELAY: + { + TX_DISABLE + + /* Find an unused timer. */ + for(timer_index = 0; timer_index < NX_MAX_TIMER; timer_index++) + { + if(nx_driver_timer_used[timer_index] != NX_RAMDRIVER_TIMER_USED) + { + if(nx_driver_timer_used[timer_index] == NX_RAMDRIVER_TIMER_DIRTY) + tx_timer_delete(&nx_driver_timers[timer_index]); + + nx_driver_timer_used[timer_index] = NX_RAMDRIVER_TIMER_USED; + break; + } + } + TX_RESTORE + + if(timer_index < NX_MAX_TIMER) + { + memcpy(&nx_driver_requests[timer_index], driver_req_ptr, sizeof(NX_IP_DRIVER)); + + timer_input = (timer_index << 16) | i; + + tx_timer_create(&nx_driver_timers[timer_index], "Driver timer", + _nx_ram_network_driver_delay_entry, + (ULONG)timer_input, + delay, delay, TX_NO_ACTIVATE); + } + else + { + + /* No available timer, just send bypass. */ + op = NX_RAMDRIVER_OP_BYPASS; + } + }break; + + case NX_RAMDRIVER_OP_DUPLICATE: + { + + /* Set the dup_packet_ptr. */ + dup_packet_ptr = packet_ptr; + }break; + + case NX_RAMDRIVER_OP_BYPASS: + default: + break; + } + } + /*A function entry for calling*/ + if(packet_process_callback != NX_NULL) + { + + status = packet_process_callback(ip_ptr, packet_ptr); + if(!status) + return; + } + + /* Adjust the prepend pointer. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + NX_ETHERNET_SIZE; + + /* If the physical header won't fit, return an error. */ + if (packet_ptr -> nx_packet_prepend_ptr < packet_ptr -> nx_packet_data_start) + { + + /* Remove the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + + return; + } + + /* Setup the ethernet frame pointer to build the ethernet frame. Backup another 2 + bytes to get 32-bit word alignment. */ + ethernet_frame_ptr = (ULONG *) (packet_ptr -> nx_packet_prepend_ptr - 2); + + /* Build the ethernet frame. */ + *ethernet_frame_ptr = driver_req_ptr -> nx_ip_driver_physical_address_msw; + *(ethernet_frame_ptr+1) = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + *(ethernet_frame_ptr+2) = (interface_ptr -> nx_interface_physical_address_msw << 16) | + (interface_ptr -> nx_interface_physical_address_lsw >> 16); + *(ethernet_frame_ptr+3) = (interface_ptr -> nx_interface_physical_address_lsw << 16); + +#ifdef FEATURE_NX_IPV6 + if(packet_ptr -> nx_packet_ip_version == 6) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IPV6; + else +#endif + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IP; + + /* Endian swapping if NX_LITTLE_ENDIAN is defined. */ + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3)); + + /* At this point, the packet is a complete Ethernet frame, ready to be transmitted. + The driver shall call the actual Ethernet transmit routine and put the packet + on the wire. + + In this example, the simulated RAM network transmit routine is called. */ + + /* Check whether we need to duplicate the packet. */ + if(dup_packet_ptr != NX_NULL) + nx_packet_copy(packet_ptr, &dup_packet_ptr, pool_ptr, NX_NO_WAIT); + if(op != NX_RAMDRIVER_OP_DELAY) + _nx_ram_network_driver_output(ip_ptr, packet_ptr, i); + else + tx_timer_activate(&nx_driver_timers[timer_index]); + + /* Send the duplicate packet. */ + if(dup_packet_ptr != NX_NULL) + _nx_ram_network_driver_output(ip_ptr, dup_packet_ptr, i); + + break; + } + + case NX_LINK_PACKET_BROADCAST: + case NX_LINK_ARP_SEND: + case NX_LINK_ARP_RESPONSE_SEND: + case NX_LINK_RARP_SEND: + { + + /* The IP stack sends down a data packet for transmission. + The device driver needs to prepend a MAC header, and fill in the + Ethernet frame type (assuming Ethernet protocol for network transmission) + based on the type of packet being transmitted. + + The following sequence illustrates this process. */ + + + /* Place the ethernet frame at the front of the packet. */ + packet_ptr = driver_req_ptr -> nx_ip_driver_packet; + + if (interface_ptr -> nx_interface_link_up == NX_FALSE) + { + + /* Link is down. Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + return; + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if((driver_req_ptr -> nx_ip_driver_command) == NX_LINK_PACKET_BROADCAST) + _nx_ram_network_driver_calculate_checksum(nx_ram_driver[i].nx_ram_driver_interface_ptr, packet_ptr, NX_FALSE); +#endif + + /* Advanced function entry for calling. */ + if(advanced_packet_process_callback != NX_NULL) + { + status = advanced_packet_process_callback(ip_ptr, packet_ptr, &op, &delay); + + if(!status) + return; + + /* Advanced process. */ + switch(op) + { + case NX_RAMDRIVER_OP_DROP: + { + + /* Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + return; + }break; + + case NX_RAMDRIVER_OP_DELAY: + { + TX_DISABLE + + /* Find an unused timer. */ + for(timer_index = 0; timer_index < NX_MAX_TIMER; timer_index++) + { + if(nx_driver_timer_used[timer_index] != NX_RAMDRIVER_TIMER_USED) + { + if(nx_driver_timer_used[timer_index] == NX_RAMDRIVER_TIMER_DIRTY) + tx_timer_delete(&nx_driver_timers[timer_index]); + + nx_driver_timer_used[timer_index] = NX_RAMDRIVER_TIMER_USED; + break; + } + } + TX_RESTORE + + if(timer_index < NX_MAX_TIMER) + { + memcpy(&nx_driver_requests[timer_index], driver_req_ptr, sizeof(NX_IP_DRIVER)); + + timer_input = (timer_index << 16) | i; + + tx_timer_create(&nx_driver_timers[timer_index], "Driver timer", + _nx_ram_network_driver_delay_entry, + (ULONG)timer_input, + delay, delay, TX_NO_ACTIVATE); + } + else + { + + /* No available timer, just send bypass. */ + op = NX_RAMDRIVER_OP_BYPASS; + } + }break; + + case NX_RAMDRIVER_OP_DUPLICATE: + { + + /* Set the dup_packet_ptr. */ + dup_packet_ptr = packet_ptr; + }break; + + case NX_RAMDRIVER_OP_BYPASS: + default: + break; + } + } + + /* Adjust the prepend pointer. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + NX_ETHERNET_SIZE; + + /* Setup the ethernet frame pointer to build the ethernet frame. Backup another 2 + bytes to get 32-bit word alignment. */ + ethernet_frame_ptr = (ULONG *) (packet_ptr -> nx_packet_prepend_ptr - 2); + + /* Build the ethernet frame. */ + *ethernet_frame_ptr = driver_req_ptr -> nx_ip_driver_physical_address_msw; + *(ethernet_frame_ptr+1) = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + *(ethernet_frame_ptr+2) = (interface_ptr -> nx_interface_physical_address_msw << 16) | + (interface_ptr -> nx_interface_physical_address_lsw >> 16); + *(ethernet_frame_ptr+3) = (interface_ptr -> nx_interface_physical_address_lsw << 16); + + if(driver_req_ptr -> nx_ip_driver_command == NX_LINK_ARP_SEND) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_ARP; + else if(driver_req_ptr -> nx_ip_driver_command == NX_LINK_ARP_RESPONSE_SEND) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_ARP; + else if(driver_req_ptr -> nx_ip_driver_command == NX_LINK_RARP_SEND) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_RARP; +#ifdef FEATURE_NX_IPV6 + else if(packet_ptr -> nx_packet_ip_version == 6) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IPV6; +#endif + else + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IP; + + + /* Endian swapping if NX_LITTLE_ENDIAN is defined. */ + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3)); + + /* At this point, the packet is a complete Ethernet frame, ready to be transmitted. + The driver shall call the actual Ethernet transmit routine and put the packet + on the wire. + + In this example, the simulated RAM network transmit routine is called. */ + + /* Check whether we need to duplicate the packet. */ + if(dup_packet_ptr != NX_NULL) + nx_packet_copy(packet_ptr, &dup_packet_ptr, pool_ptr, NX_NO_WAIT); + if(op != NX_RAMDRIVER_OP_DELAY) + _nx_ram_network_driver_output(ip_ptr, packet_ptr, i); + else + tx_timer_activate(&nx_driver_timers[timer_index]); + + /* Send the duplicate packet. */ + if(dup_packet_ptr != NX_NULL) + _nx_ram_network_driver_output(ip_ptr, dup_packet_ptr, i); + + break; + } + + case NX_LINK_MULTICAST_JOIN: + { + UINT mcast_index; + + /* The IP layer issues this command to join a multicast group. Note that + multicast operation is required for IPv6. + + On a typically Ethernet controller, the driver computes a hash value based + on MAC address, and programs the hash table. + + It is likely the driver also needs to maintain an internal MAC address table. + Later if a multicast address is removed, the driver needs + to reprogram the hash table based on the remaining multicast MAC addresses. */ + + + /* The following procedure only applies to our simulated RAM network driver, which manages + multicast MAC addresses by a simple look up table. */ + for(mcast_index = 0; mcast_index < NX_RAM_DRIVER_MAX_MCAST_ADDRESSES; mcast_index++) + { + if(nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw == 0 && + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw == 0 ) + { + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw = driver_req_ptr -> nx_ip_driver_physical_address_msw; + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + break; + } + } + if(mcast_index == NX_RAM_DRIVER_MAX_MCAST_ADDRESSES) + driver_req_ptr -> nx_ip_driver_status = NX_NO_MORE_ENTRIES; + + break; + } + + case NX_LINK_MULTICAST_LEAVE: + { + + UINT mcast_index; + + /* The IP layer issues this command to remove a multicast MAC address from the + receiving list. A device driver shall properly remove the multicast address + from the hash table, so the hardware does not receive such traffic. Note that + in order to reprogram the hash table, the device driver may have to keep track of + current active multicast MAC addresses. */ + + /* The following procedure only applies to our simulated RAM network driver, which manages + multicast MAC addresses by a simple look up table. */ + for(mcast_index = 0; mcast_index < NX_RAM_DRIVER_MAX_MCAST_ADDRESSES; mcast_index++) + { + if(nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw == driver_req_ptr -> nx_ip_driver_physical_address_msw && + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw == driver_req_ptr -> nx_ip_driver_physical_address_lsw) + { + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw = 0; + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw = 0; + break; + } + } + if(mcast_index == NX_RAM_DRIVER_MAX_MCAST_ADDRESSES) + driver_req_ptr -> nx_ip_driver_status = NX_ENTRY_NOT_FOUND; + + break; + } + + case NX_LINK_GET_STATUS: + { + + /* Return the link status in the supplied return pointer. */ + *(driver_req_ptr -> nx_ip_driver_return_ptr) = interface_ptr -> nx_interface_link_up; + break; + } + + case NX_LINK_DEFERRED_PROCESSING: + { + + /* Driver defined deferred processing. This is typically used to defer interrupt + processing to the thread level. + + A typical use case of this command is: + On receiving an Ethernet frame, the RX ISR does not process the received frame, + but instead records such an event in its internal data structure, and issues + a notification to the IP stack (the driver sends the notification to the IP + helping thread by calling "_nx_ip_driver_deferred_processing()". When the IP stack + gets a notification of a pending driver deferred process, it calls the + driver with the NX_LINK_DEFERRED_PROCESSING command. The driver shall complete + the pending receive process. + */ + + /* The simulated RAM driver doesn't require a deferred process so it breaks out of + the switch case. */ + + + break; + } + +#ifdef __PRODUCT_NETXDUO__ + case NX_LINK_SET_PHYSICAL_ADDRESS: + { + + /* Find an driver instance to attach the interface. */ + for(i = 0; i < NX_MAX_RAM_INTERFACES;i++) + { + if(nx_ram_driver[i].nx_ram_driver_interface_ptr == driver_req_ptr -> nx_ip_driver_interface) + break; + } + + /* An available entry is found. */ + if(i < NX_MAX_RAM_INTERFACES) + { + + /* Set the physical address. */ + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw = driver_req_ptr -> nx_ip_driver_physical_address_msw; + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + } + else + { + driver_req_ptr -> nx_ip_driver_status = NX_INVALID_INTERFACE; + } + + break; + } +#endif + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + case NX_INTERFACE_CAPABILITY_GET: + { + driver_req_ptr -> nx_ip_driver_interface -> nx_interface_capability_flag = NX_INTERFACE_CAPABILITY; + break; + } + + case NX_INTERFACE_CAPABILITY_SET: + { + break; + } + +#endif +#ifdef NX_BSD_RAW_PPPOE_SUPPORT + case NX_LINK_PACKET_PPPOE_SESS_SEND: + case NX_LINK_PACKET_PPPOE_DISC_SEND: + + /* Place the ethernet frame at the front of the packet. */ + packet_ptr = driver_req_ptr -> nx_ip_driver_packet; + + _nx_ram_network_driver_output(ip_ptr, packet_ptr, i); + break; + +#endif /* NX_BSD_RAW_PPPOE_SUPPORT */ + default: + { + + /* Invalid driver request. */ + + /* Return the unhandled command status. */ + driver_req_ptr -> nx_ip_driver_status = NX_UNHANDLED_COMMAND; + } + } +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function acts as a virtual network for testing the NetX source */ +/* and driver concepts. */ +/* */ +/* INPUT */ +/* */ +/* driver_req__ptr Pointer to NX_IP_DRIVER */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* NetX IP processing */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* */ +/**************************************************************************/ +VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr) +{ + +NX_IP *ip_ptr; +NX_PACKET *packet_ptr; +ULONG *ethernet_frame_ptr; +NX_INTERFACE *interface_ptr; +#ifdef __PRODUCT_NETXDUO__ +UINT interface_index; +#endif +UINT i; +UINT mtu_size = 128; +UINT old_threshold = 0; + + /* Setup the IP pointer from the driver request. */ + ip_ptr = driver_req_ptr -> nx_ip_driver_ptr; + + /* Default to successful return. */ + driver_req_ptr -> nx_ip_driver_status = NX_SUCCESS; + + /* Setup interface pointer. */ + interface_ptr = driver_req_ptr -> nx_ip_driver_interface; + +#ifdef __PRODUCT_NETXDUO__ + /* Obtain the index number of the network interface. */ + interface_index = interface_ptr -> nx_interface_index; +#endif + + /* Find out the driver interface if the driver command is not ATTACH. */ + if(driver_req_ptr -> nx_ip_driver_command != NX_LINK_INTERFACE_ATTACH) + { + for(i = 0; i < NX_MAX_RAM_INTERFACES;i++) + { + if(nx_ram_driver[i].nx_ram_network_driver_in_use == 0) + continue; + + if(nx_ram_driver[i].nx_ram_driver_ip_ptr != ip_ptr) + continue; + + if(nx_ram_driver[i].nx_ram_driver_interface_ptr != driver_req_ptr -> nx_ip_driver_interface) + continue; + + break; + } + + if(i == NX_MAX_RAM_INTERFACES) + { + driver_req_ptr -> nx_ip_driver_status = NX_INVALID_INTERFACE; + return; + } + } + + /* Process according to the driver request type in the IP control block. */ + switch (driver_req_ptr -> nx_ip_driver_command) + { + case NX_LINK_INTERFACE_ATTACH: + { + + /* Disable preemption. */ + tx_thread_preemption_change(tx_thread_identify(), 0, &old_threshold); + + /* Find an available driver instance to attach the interface. */ + for(i = 0; i < NX_MAX_RAM_INTERFACES;i++) + { + if(nx_ram_driver[i].nx_ram_network_driver_in_use == 0) + break; + } + /* An available entry is found. */ + if(i < NX_MAX_RAM_INTERFACES) + { + /* Set the IN USE flag.*/ + nx_ram_driver[i].nx_ram_network_driver_in_use = 1; + + nx_ram_driver[i].nx_ram_network_driver_id = i; + + /* Record the interface attached to the IP instance. */ + nx_ram_driver[i].nx_ram_driver_interface_ptr = driver_req_ptr -> nx_ip_driver_interface; + + /* Record the IP instance. */ + nx_ram_driver[i].nx_ram_driver_ip_ptr = ip_ptr; + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw = simulated_address_msw; + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw = simulated_address_lsw + i; + } + else + { + driver_req_ptr -> nx_ip_driver_status = NX_INVALID_INTERFACE; + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + driver_req_ptr -> nx_ip_driver_interface -> nx_interface_capability_flag = NX_INTERFACE_CAPABILITY; +#endif + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); + + break; + } +#ifdef __PRODUCT_NETXDUO__ + case NX_LINK_INTERFACE_DETACH : + { + /* Zero out the driver instance. */ + memset(&(nx_ram_driver[i]), 0 , sizeof(_nx_ram_network_driver_instance_type)); + break; + } +#endif + case NX_LINK_INITIALIZE: + { + /* Device driver shall initialize the Ethernet Controller here. */ + + packet_process_callback = NX_NULL; + advanced_packet_process_callback = NX_NULL; + +#ifdef __PRODUCT_NETXDUO__ + /* Once the Ethernet controller is initialized, the driver needs to + configure the NetX Interface Control block, as outlined below. */ + + /* The nx_interface_ip_mtu_size should be the MTU for the IP payload. + For regular Ethernet, the IP MTU is 1500. */ + nx_ip_interface_mtu_set(ip_ptr, interface_index, mtu_size); + + /* Set the physical address (MAC address) of this IP instance. */ + /* For this simulated RAM driver, the MAC address is constructed by + incrementing a base lsw value, to simulate multiple nodes hanging on the + ethernet. */ + nx_ip_interface_physical_address_set(ip_ptr, interface_index, + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw, + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw, NX_FALSE); + + /* Indicate to the IP software that IP to physical mapping is required. */ + nx_ip_interface_address_mapping_configure(ip_ptr, interface_index, NX_TRUE); +#else + + interface_ptr -> nx_interface_ip_mtu_size = mtu_size; + + /* Set the physical address (MAC address) of this IP instance. */ + /* For this simulated RAM driver, the MAC address is constructed by + incrementing a base lsw value, to simulate multiple nodes hanging on the + ethernet. */ + + interface_ptr -> nx_interface_physical_address_msw = nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw; + interface_ptr -> nx_interface_physical_address_lsw = nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw; + + /* Indicate to the IP software that IP to physical mapping is required. */ + interface_ptr -> nx_interface_address_mapping_needed = NX_TRUE; + +#endif + + break; + } + + case NX_LINK_ENABLE: + { + + /* Process driver link enable. An Ethernet driver shall enable the + transmit and reception logic. Once the IP stack issues the + LINK_ENABLE command, the stack may start transmitting IP packets. */ + + /* In the RAM driver, just set the enabled flag. */ + interface_ptr -> nx_interface_link_up = NX_TRUE; + + break; + } + + case NX_LINK_DISABLE: + { + + /* Process driver link disable. This command indicates the IP layer + is not going to transmit any IP datagrams, nor does it expect any + IP datagrams from the interface. Therefore after processing this command, + the device driver shall not send any incoming packets to the IP + layer. Optionally the device driver may turn off the interface. */ + + /* In the RAM driver, just clear the enabled flag. */ + interface_ptr -> nx_interface_link_up = NX_FALSE; + + break; + } + + case NX_LINK_PACKET_SEND: + { + + /* Process driver send packet. */ + + /* Place the ethernet frame at the front of the packet. */ + packet_ptr = driver_req_ptr -> nx_ip_driver_packet; + + if (interface_ptr -> nx_interface_link_up == NX_FALSE) + { + + /* Link is down. Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + return; + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + _nx_ram_network_driver_calculate_checksum(nx_ram_driver[i].nx_ram_driver_interface_ptr, packet_ptr, NX_FALSE); +#endif + /* Place the ethernet frame at the front of the packet. */ + packet_ptr = driver_req_ptr -> nx_ip_driver_packet; + + /* Adjust the prepend pointer. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + NX_ETHERNET_SIZE; + + /* If the physical header won't fit, return an error. */ + if (packet_ptr -> nx_packet_prepend_ptr < packet_ptr -> nx_packet_data_start) + { + + /* Remove the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + + return; + } + + /* Setup the ethernet frame pointer to build the ethernet frame. Backup another 2 + bytes to get 32-bit word alignment. */ + ethernet_frame_ptr = (ULONG *) (packet_ptr -> nx_packet_prepend_ptr - 2); + + /* Build the ethernet frame. */ + *ethernet_frame_ptr = driver_req_ptr -> nx_ip_driver_physical_address_msw; + *(ethernet_frame_ptr+1) = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + *(ethernet_frame_ptr+2) = (interface_ptr -> nx_interface_physical_address_msw << 16) | + (interface_ptr -> nx_interface_physical_address_lsw >> 16); + *(ethernet_frame_ptr+3) = (interface_ptr -> nx_interface_physical_address_lsw << 16); + +#ifdef FEATURE_NX_IPV6 + if(packet_ptr -> nx_packet_ip_version == 6) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IPV6; + else +#endif + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IP; + + + /* Endian swapping if NX_LITTLE_ENDIAN is defined. */ + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3)); + + /* At this point, the packet is a complete Ethernet frame, ready to be transmitted. + The driver shall call the actual Ethernet transmit routine and put the packet + on the wire. + + In this example, the simulated RAM network transmit routine is called. */ + + _nx_ram_network_driver_output(ip_ptr, packet_ptr, i ); + + break; + } + + case NX_LINK_PACKET_BROADCAST: + case NX_LINK_ARP_SEND: + case NX_LINK_ARP_RESPONSE_SEND: + case NX_LINK_RARP_SEND: +#ifdef NX_PPP_PPPOE_ENABLE + case NX_LINK_PPPOE_DISCOVERY_SEND: + case NX_LINK_PPPOE_SESSION_SEND: +#endif + { + /* Process driver send packet. */ + + /* Place the ethernet frame at the front of the packet. */ + packet_ptr = driver_req_ptr -> nx_ip_driver_packet; + + if (interface_ptr -> nx_interface_link_up == NX_FALSE) + { + + /* Link is down. Drop the packet. */ + nx_packet_transmit_release(packet_ptr); + return; + } + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if((driver_req_ptr -> nx_ip_driver_command) == NX_LINK_PACKET_BROADCAST) + _nx_ram_network_driver_calculate_checksum(nx_ram_driver[i].nx_ram_driver_interface_ptr, packet_ptr, NX_FALSE); +#endif + + /* Adjust the prepend pointer. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr - NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length + NX_ETHERNET_SIZE; + + /* Setup the ethernet frame pointer to build the ethernet frame. Backup another 2 + bytes to get 32-bit word alignment. */ + ethernet_frame_ptr = (ULONG *) (packet_ptr -> nx_packet_prepend_ptr - 2); + + /* Build the ethernet frame. */ + *ethernet_frame_ptr = driver_req_ptr -> nx_ip_driver_physical_address_msw; + *(ethernet_frame_ptr+1) = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + *(ethernet_frame_ptr+2) = (interface_ptr -> nx_interface_physical_address_msw << 16) | + (interface_ptr -> nx_interface_physical_address_lsw >> 16); + *(ethernet_frame_ptr+3) = (interface_ptr -> nx_interface_physical_address_lsw << 16); + + if(driver_req_ptr -> nx_ip_driver_command == NX_LINK_ARP_SEND) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_ARP; + else if(driver_req_ptr -> nx_ip_driver_command == NX_LINK_ARP_RESPONSE_SEND) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_ARP; + else if(driver_req_ptr -> nx_ip_driver_command == NX_LINK_RARP_SEND) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_RARP; +#ifdef NX_PPP_PPPOE_ENABLE + else if (driver_req_ptr -> nx_ip_driver_command == NX_LINK_PPPOE_DISCOVERY_SEND) + *(ethernet_frame_ptr + 3) |= NX_ETHERNET_PPPOE_DISCOVERY; + else if (driver_req_ptr -> nx_ip_driver_command == NX_LINK_PPPOE_SESSION_SEND) + *(ethernet_frame_ptr + 3) |= NX_ETHERNET_PPPOE_SESSION; +#endif +#ifdef FEATURE_NX_IPV6 + else if(packet_ptr -> nx_packet_ip_version == 6) + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IPV6; +#endif + else + *(ethernet_frame_ptr+3) |= NX_ETHERNET_IP; + + + /* Endian swapping if NX_LITTLE_ENDIAN is defined. */ + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+1)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+2)); + NX_CHANGE_ULONG_ENDIAN(*(ethernet_frame_ptr+3)); + + /* At this point, the packet is a complete Ethernet frame, ready to be transmitted. + The driver shall call the actual Ethernet transmit routine and put the packet + on the wire. + + In this example, the simulated RAM network transmit routine is called. */ + + _nx_ram_network_driver_output(ip_ptr, packet_ptr, i ); + + break; + } + + case NX_LINK_MULTICAST_JOIN: + { + UINT mcast_index; + + /* The IP layer issues this command to join a multicast group. Note that + multicast operation is required for IPv6. + + On a typically Ethernet controller, the driver computes a hash value based + on MAC address, and programs the hash table. + + It is likely the driver also needs to maintain an internal MAC address table. + Later if a multicast address is removed, the driver needs + to reprogram the hash table based on the remaining multicast MAC addresses. */ + + + /* The following procedure only applies to our simulated RAM network driver, which manages + multicast MAC addresses by a simple look up table. */ + for(mcast_index = 0; mcast_index < NX_RAM_DRIVER_MAX_MCAST_ADDRESSES; mcast_index++) + { + if(nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw == 0 && + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw == 0 ) + { + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw = driver_req_ptr -> nx_ip_driver_physical_address_msw; + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + break; + } + } + if(mcast_index == NX_RAM_DRIVER_MAX_MCAST_ADDRESSES) + driver_req_ptr -> nx_ip_driver_status = NX_NO_MORE_ENTRIES; + + break; + } + + case NX_LINK_MULTICAST_LEAVE: + { + + UINT mcast_index; + + /* The IP layer issues this command to remove a multicast MAC address from the + receiving list. A device driver shall properly remove the multicast address + from the hash table, so the hardware does not receive such traffic. Note that + in order to reprogram the hash table, the device driver may have to keep track of + current active multicast MAC addresses. */ + + /* The following procedure only applies to our simulated RAM network driver, which manages + multicast MAC addresses by a simple look up table. */ + for(mcast_index = 0; mcast_index < NX_RAM_DRIVER_MAX_MCAST_ADDRESSES; mcast_index++) + { + if(nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw == driver_req_ptr -> nx_ip_driver_physical_address_msw && + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw == driver_req_ptr -> nx_ip_driver_physical_address_lsw) + { + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw = 0; + nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw = 0; + break; + } + } + if(mcast_index == NX_RAM_DRIVER_MAX_MCAST_ADDRESSES) + driver_req_ptr -> nx_ip_driver_status = NX_ENTRY_NOT_FOUND; + + break; + } + + case NX_LINK_GET_STATUS: + { + + /* Return the link status in the supplied return pointer. */ + *(driver_req_ptr -> nx_ip_driver_return_ptr) = ip_ptr-> nx_ip_interface[0].nx_interface_link_up; + break; + } + + case NX_LINK_DEFERRED_PROCESSING: + { + + /* Driver defined deferred processing. This is typically used to defer interrupt + processing to the thread level. + + A typical use case of this command is: + On receiving an Ethernet frame, the RX ISR does not process the received frame, + but instead records such an event in its internal data structure, and issues + a notification to the IP stack (the driver sends the notification to the IP + helping thread by calling "_nx_ip_driver_deferred_processing()". When the IP stack + gets a notification of a pending driver deferred process, it calls the + driver with the NX_LINK_DEFERRED_PROCESSING command. The driver shall complete + the pending receive process. */ + + /* The simulated RAM driver doesn't require a deferred process so it breaks out of + the switch case. */ + + break; + } + +#ifdef __PRODUCT_NETXDUO__ + case NX_LINK_SET_PHYSICAL_ADDRESS: + { + + /* Find an driver instance to attach the interface. */ + for(i = 0; i < NX_MAX_RAM_INTERFACES;i++) + { + if(nx_ram_driver[i].nx_ram_driver_interface_ptr == driver_req_ptr -> nx_ip_driver_interface) + break; + } + + /* An available entry is found. */ + if(i < NX_MAX_RAM_INTERFACES) + { + + /* Set the physical address. */ + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw = driver_req_ptr -> nx_ip_driver_physical_address_msw; + nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw = driver_req_ptr -> nx_ip_driver_physical_address_lsw; + } + else + { + driver_req_ptr -> nx_ip_driver_status = NX_INVALID_INTERFACE; + } + + break; + } +#endif + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + case NX_INTERFACE_CAPABILITY_GET: + { + driver_req_ptr -> nx_ip_driver_interface -> nx_interface_capability_flag = NX_INTERFACE_CAPABILITY; + break; + } + + case NX_INTERFACE_CAPABILITY_SET: + { + break; + } + +#endif + default: + { + + /* Invalid driver request. */ + + /* Return the unhandled command status. */ + driver_req_ptr -> nx_ip_driver_status = NX_UNHANDLED_COMMAND; + } + } +} + + + + + + + + + + + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_output PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function simply sends the packet to the IP instance on the */ +/* created IP list that matches the physical destination specified in */ +/* the Ethernet packet. In a real hardware setting, this routine */ +/* would simply put the packet out on the wire. */ +/* */ +/* INPUT */ +/* */ +/* ip_ptr Pointer to IP protocol block */ +/* packet_ptr Packet pointer */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* nx_packet_copy Copy a packet */ +/* nx_packet_transmit_release Release a packet */ +/* _nx_ram_network_driver_receive RAM driver receive processing */ +/* */ +/* CALLED BY */ +/* */ +/* NetX IP processing */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* */ +/**************************************************************************/ +VOID _nx_ram_network_driver_output(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id) +{ +NX_IP *dest_ip; +NX_PACKET *packet_copy; +ULONG destination_address_msw; +ULONG destination_address_lsw; +UINT old_threshold = 0; +UINT i; +UINT mcast_index; +NX_PACKET_POOL *pool_ptr; + +#ifdef NX_DEBUG_PACKET +UCHAR *ptr; +UINT j; + + ptr = packet_ptr -> nx_packet_prepend_ptr; + printf("Ethernet Packet: "); + for (j = 0; j < 6; j++) + printf("%02X", *ptr++); + printf(" "); + for (j = 0; j < 6; j++) + printf("%02X", *ptr++); + printf(" %02X", *ptr++); + printf("%02X ", *ptr++); + + i = 0; + for (j = 0; j < (packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE); j++) + { + printf("%02X", *ptr++); + i++; + if (i > 3) + { + i = 0; + printf(" "); + } + } + printf("\n"); +#endif + + /* Pickup the destination IP address from the packet_ptr. */ + destination_address_msw = (ULONG) *(packet_ptr -> nx_packet_prepend_ptr); + destination_address_msw = (destination_address_msw << 8) | (ULONG) *(packet_ptr -> nx_packet_prepend_ptr+1); + destination_address_lsw = (ULONG) *(packet_ptr -> nx_packet_prepend_ptr+2); + destination_address_lsw = (destination_address_lsw << 8) | (ULONG) *(packet_ptr -> nx_packet_prepend_ptr+3); + destination_address_lsw = (destination_address_lsw << 8) | (ULONG) *(packet_ptr -> nx_packet_prepend_ptr+4); + destination_address_lsw = (destination_address_lsw << 8) | (ULONG) *(packet_ptr -> nx_packet_prepend_ptr+5); + + /* Disable preemption. */ + tx_thread_preemption_change(tx_thread_identify(), 0, &old_threshold); + + /* Retrieve data from packet. */ + nx_packet_data_retrieve(packet_ptr, driver_data_buffer, &driver_data_length); + +#ifdef NX_PCAP_ENABLE + /* Write packet data into pcap file. */ + write_pcap_file(packet_ptr); +#endif + + /* Loop through all instances of created IPs to see who gets the packet. */ + for(i = 0; i < NX_MAX_RAM_INTERFACES; i++) + { + + /* Skip the interface from which the packet was sent. */ + if(i == interface_instance_id) + continue; + + /* Skip the instance that has not been initialized. */ + if(nx_ram_driver[i].nx_ram_network_driver_in_use == 0) + continue; + + dest_ip = nx_ram_driver[i].nx_ram_driver_ip_ptr; + + /* If the destination MAC address is broadcast or the destination matches the interface MAC, + accept the packet. */ + if(((destination_address_msw == ((ULONG) 0x0000FFFF)) && (destination_address_lsw == ((ULONG) 0xFFFFFFFF))) || /* Broadcast match */ + ((destination_address_msw == nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_msw) && + (destination_address_lsw == nx_ram_driver[i].nx_ram_driver_mac_address.nx_mac_address_lsw)) || + (destination_address_msw == ((ULONG)0x00003333)) || /* Ethernet multicast address, RFC2464, Section7, Page 5 2. */ + ((destination_address_msw == 0) && (destination_address_lsw == 0))) + { + + /* Set the packet pool. */ + if (driver_pool) + pool_ptr = driver_pool; + else + pool_ptr = dest_ip -> nx_ip_default_packet_pool; + + /* Allocate packet. */ + if (nx_packet_allocate(pool_ptr, &packet_copy, NX_RECEIVE_PACKET, NX_NO_WAIT)) + { + + /* Remove the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Error, no point in continuing, just release the packet. */ + nx_packet_transmit_release(packet_ptr); + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); + return; + } + + /* Skip two bytes. */ + packet_copy -> nx_packet_prepend_ptr += 2; + packet_copy -> nx_packet_append_ptr += 2; + + /* Make a copy of packet for the forwarding. */ + if (nx_packet_data_append(packet_copy, driver_data_buffer, driver_data_length, pool_ptr, NX_NO_WAIT)) + { + + /* Remove the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Error, no point in continuing, just release the packet. */ + nx_packet_transmit_release(packet_ptr); + + /* Release the packet. */ + nx_packet_release(packet_copy); + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); + + return; + } + +#ifdef __PRODUCT_NETXDUO__ + /* Copy packet version. */ + packet_copy -> nx_packet_ip_version = packet_ptr -> nx_packet_ip_version; +#endif /* __PRODUCT_NETXDUO__ */ + + _nx_ram_network_driver_receive(dest_ip, packet_copy, i); + } + else + { + for(mcast_index = 0; mcast_index < NX_RAM_DRIVER_MAX_MCAST_ADDRESSES; mcast_index++) + { + + if(destination_address_msw == nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_msw && + destination_address_lsw == nx_ram_driver[i].nx_ram_driver_mcast_address[mcast_index].nx_mac_address_lsw) + { + + /* Set the packet pool. */ + if (driver_pool) + pool_ptr = driver_pool; + else + pool_ptr = dest_ip -> nx_ip_default_packet_pool; + + /* Allocate packet. */ + if (nx_packet_allocate(pool_ptr, &packet_copy, NX_RECEIVE_PACKET, NX_NO_WAIT)) + { + + /* Remove the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Error, no point in continuing, just release the packet. */ + nx_packet_transmit_release(packet_ptr); + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); + return; + } + + /* Skip two bytes. */ + packet_copy -> nx_packet_prepend_ptr += 2; + packet_copy -> nx_packet_append_ptr += 2; + + /* Make a copy of packet for the forwarding. */ + if (nx_packet_data_append(packet_copy, driver_data_buffer, driver_data_length, pool_ptr, NX_NO_WAIT)) + { + + /* Remove the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Error, no point in continuing, just release the packet. */ + nx_packet_transmit_release(packet_ptr); + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); + return; + } + + _nx_ram_network_driver_receive(dest_ip, packet_copy, i); + + + } + + + } + } + } + + /* Remove the Ethernet header. In real hardware environments, this is typically + done after a transmit complete interrupt. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Now that the Ethernet frame has been removed, release the packet. */ + nx_packet_transmit_release(packet_ptr); + + /* Restore preemption. */ + tx_thread_preemption_change(tx_thread_identify(), old_threshold, &old_threshold); +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_receive PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processing incoming packets. In the RAM network */ +/* driver, the incoming packets are coming from the RAM driver output */ +/* routine. In real hardware settings, this routine would be called */ +/* from the receive packet ISR. */ +/* */ +/* INPUT */ +/* */ +/* ip_ptr Pointer to IP protocol block */ +/* packet_ptr Packet pointer */ +/* interface_instance_id The interface ID the packet is*/ +/* destined for */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _nx_ip_packet_receive IP receive packet processing */ +/* _nx_ip_packet_deferred_receive IP deferred receive packet */ +/* processing */ +/* _nx_arp_packet_deferred_receive ARP receive processing */ +/* _nx_rarp_packet_deferred_receive RARP receive processing */ +/* nx_packet_release Packet release */ +/* */ +/* CALLED BY */ +/* */ +/* NetX IP processing */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* */ +/**************************************************************************/ +VOID _nx_ram_network_driver_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id) +{ + +UINT packet_type; + + /* Pickup the packet header to determine where the packet needs to be + sent. */ + packet_type = (((UINT) (*(packet_ptr -> nx_packet_prepend_ptr+12))) << 8) | + ((UINT) (*(packet_ptr -> nx_packet_prepend_ptr+13))); + + /* Setup interface pointer. */ + packet_ptr -> nx_packet_ip_interface = nx_ram_driver[interface_instance_id].nx_ram_driver_interface_ptr; + + /* Route the incoming packet according to its ethernet type. */ + /* The RAM driver accepts both IPv4 and IPv6 frames. */ + if ((packet_type == NX_ETHERNET_IP) || (packet_type == NX_ETHERNET_IPV6)) + { + + /* Note: The length reported by some Ethernet hardware includes bytes after the packet + as well as the Ethernet header. In some cases, the actual packet length after the + Ethernet header should be derived from the length in the IP header (lower 16 bits of + the first 32-bit word). */ + + /* Clean off the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY + if(_nx_ram_network_driver_calculate_checksum(packet_ptr -> nx_packet_ip_interface, packet_ptr, NX_TRUE)) + { +#ifdef NX_DROP_ERROR_CHECKSUM + nx_packet_release(packet_ptr); + return; +#endif /* NX_DROP_ERROR_CHECKSUM */ + } +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + /* Route to the ip receive function. */ + +#ifdef NX_DIRECT_ISR_CALL + _nx_ip_packet_receive(ip_ptr, packet_ptr); +#else + _nx_ip_packet_deferred_receive(ip_ptr, packet_ptr); +#endif + } +#ifndef NX_DISABLE_IPV4 + else if (packet_type == NX_ETHERNET_ARP) + { + + /* Clean off the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Route to the ARP receive function. */ + _nx_arp_packet_deferred_receive(ip_ptr, packet_ptr); + + } + else if (packet_type == NX_ETHERNET_RARP) + { + + /* Clean off the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + /* Route to the RARP receive function. */ + _nx_rarp_packet_deferred_receive(ip_ptr, packet_ptr); + } +#ifdef NX_PPP_PPPOE_ENABLE + else if ((packet_type == NX_ETHERNET_PPPOE_DISCOVERY) || + (packet_type == NX_ETHERNET_PPPOE_SESSION)) + { + + /* Clean off the Ethernet header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ETHERNET_SIZE; + + /* Adjust the packet length. */ + packet_ptr -> nx_packet_length = packet_ptr -> nx_packet_length - NX_ETHERNET_SIZE; + + if (_nx_pppoe_client_created_ptr -> nx_pppoe_interface_ptr == nx_ram_driver[interface_instance_id].nx_ram_driver_interface_ptr) + { + /* Route to the PPPoE client receive function. */ + _nx_pppoe_client_packet_deferred_receive(packet_ptr); + } + else if (_nx_pppoe_server_created_ptr -> nx_pppoe_interface_ptr == nx_ram_driver[interface_instance_id].nx_ram_driver_interface_ptr) + { + /* Route to the PPPoE server receive function. */ + _nx_pppoe_server_packet_deferred_receive(packet_ptr); + } + } +#endif +#endif + +#ifdef NX_BSD_RAW_PPPOE_SUPPORT + else if((packet_type == ETHERTYPE_PPPOE_DISC) || (packet_type == ETHERTYPE_PPPOE_SESS)) + { + _nx_bsd_pppoe_packet_received(packet_ptr, packet_type, interface_instance_id); + + } +#endif /* NX_BSD_RAW_PPPOE_SUPPORT */ + + else + { + /* Invalid ethernet header... release the packet. */ + nx_packet_release(packet_ptr); + } +} + + +#ifdef NX_ENABLE_INTERFACE_CAPABILITY +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_ram_network_driver_calculate_checksum PORTABLE C */ +/* 2.1b */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function calculates or verifys checksum for headers. */ +/* */ +/* INPUT */ +/* */ +/* interface_ptr Pointer to interface */ +/* packet_ptr Packet pointer */ +/* is_check Check or verify */ +/* */ +/* OUTPUT */ +/* */ +/* status Completion status */ +/* */ +/* CALLS */ +/* */ +/* _nx_ip_checksum_compute */ +/* */ +/* CALLED BY */ +/* */ +/* _nx_ram_network_driver_internal */ +/* _nx_ram_network_driver */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx William E. Lamie Initial Version 2.1b */ +/* */ +/**************************************************************************/ +UINT _nx_ram_network_driver_calculate_checksum(NX_INTERFACE *interface_ptr, NX_PACKET *packet_ptr, UCHAR is_check) +{ +ULONG next_protocol = 0; +UCHAR *org_prepend_ptr; +USHORT checksum; +ULONG val; +UCHAR is_done = NX_FALSE; +UCHAR is_fragmented = NX_FALSE; +ULONG ip_src_addr[4]; +ULONG ip_dst_addr[4]; +ULONG data_length; +NX_TCP_HEADER *tcp_header_ptr; +NX_UDP_HEADER *udp_header_ptr; +#ifndef NX_DISABLE_IPV4 +ULONG ip_header_length; +NX_IPV4_HEADER *ip_header_ptr; +NX_ICMP_HEADER *icmpv4_header_ptr; +NX_IGMP_HEADER *igmp_header_ptr; +#endif /* NX_DISABLE_IPV4 */ +#ifdef FEATURE_NX_IPV6 +NX_ICMPV6_HEADER *icmpv6_header_ptr; +NX_IPV6_HEADER *ipv6_header_ptr; +#endif + + /* Get IP version. */ +#ifndef NX_DISABLE_IPV4 + if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) + { + next_protocol = NX_PROTOCOL_IPV4; + } +#endif /* NX_DISABLE_IPV4 */ +#ifdef FEATURE_NX_IPV6 + if (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) + { + next_protocol = NX_PROTOCOL_IPV6; + } +#endif + if (next_protocol == 0) + return NX_INVALID_PACKET; + + /* Store original prepend_ptr. */ + org_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr; + + /* Loop to process headers. */ + while(!is_done) + { + switch(next_protocol) + { +#ifndef NX_DISABLE_IPV4 + case NX_PROTOCOL_IPV4: + { + + /* It's assumed that the IP link driver has positioned the top pointer in the + packet to the start of the IP address... so that's where we will start. */ + ip_header_ptr = (NX_IPV4_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + /* Pick up the first word in the IP header. */ + val = ip_header_ptr -> nx_ip_header_word_0; + + /* Convert to host byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Obtain IP header length. */ + ip_header_length = (val & NX_IP_LENGTH_MASK) >> 24; + + /* Check if IPv4 checksum is enabled. */ + if(((is_check) && (interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_IPV4_RX_CHECKSUM)) || + ((!is_check) && (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_IPV4_TX_CHECKSUM))) + { + + /* Check fragmentation. */ + if(is_fragmented) + { + + /* Not support fragmentation. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_VERSION_V4, + /* length is the size of IP header, including options */ + ip_header_length << 2, + /* IPv4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + if(is_check) + { + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Check the checksum. */ + if (checksum) + { + + /* Checksum error. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_INVALID_PACKET; + } + } + else + { + val = (ULONG)(~checksum); + val = val & NX_LOWER_16_MASK; + + /* Convert to network byte order. */ + NX_CHANGE_ULONG_ENDIAN(val); + + /* Now store the checksum in the IP header. */ + ip_header_ptr -> nx_ip_header_word_2 = ip_header_ptr -> nx_ip_header_word_2 | val; + } + } + + /* Check if FRAGMENT flag is set. */ + val = ip_header_ptr -> nx_ip_header_word_1; + NX_CHANGE_ULONG_ENDIAN(val); + if(val & NX_IP_FRAGMENT_MASK) + { + + /* Fragmented packet not supported. Restore origianl prepend_ptr. */ + is_fragmented = NX_TRUE; + } + + /* Get src and dst addresses. */ + ip_src_addr[0] = ip_header_ptr -> nx_ip_header_source_ip; + ip_dst_addr[0] = ip_header_ptr -> nx_ip_header_destination_ip; + NX_CHANGE_ULONG_ENDIAN(ip_src_addr[0]); + NX_CHANGE_ULONG_ENDIAN(ip_dst_addr[0]); + + /* Get next protocol. */ + next_protocol = (ip_header_ptr -> nx_ip_header_word_2 >> 8) & 0xFF; + + /* Remove IPv4 header. */ + packet_ptr -> nx_packet_prepend_ptr = packet_ptr -> nx_packet_prepend_ptr + (ip_header_length << 2); + data_length = packet_ptr -> nx_packet_length - (ip_header_length << 2); + break; + } +#endif /* NX_DISABLE_IPV4 */ + + case NX_PROTOCOL_TCP: + { + + /* Check if TCP checksum is enabled. */ + if(((is_check) && (interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_TCP_RX_CHECKSUM)) || + ((!is_check) && (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_TCP_TX_CHECKSUM))) + { + + /* Check fragmentation. */ + if(is_fragmented) + { + /* When receiving a fragmented packet, do nothing, deliver it to NetX. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + /* Calculate the TCP checksum without protection. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_TCP, + data_length, + ip_src_addr, ip_dst_addr); + + if(is_check) + { + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Check the checksum. */ + if (checksum) + { + + /* Checksum error. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_INVALID_PACKET; + } + } + else + { + + /* Pickup the pointer to the head of the TCP packet. */ + tcp_header_ptr = (NX_TCP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + tcp_header_ptr -> nx_tcp_header_word_4 |= (checksum << NX_SHIFT_BY_16); + NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_4); + } + } + + /* No necessary to process next protocol. */ + is_done = NX_TRUE; + break; + } + + case NX_PROTOCOL_UDP: + { + + /* Check if UDP checksum is enabled. */ + if(((is_check) && (interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_UDP_RX_CHECKSUM)) || + ((!is_check) && (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_UDP_TX_CHECKSUM))) + { + + /* Check fragmentation. */ + if(is_fragmented) + { + /* When receiving a fragmented packet, do nothing, deliver it to NetX. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + /* Calculate the UDP checksum without protection. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_UDP, + data_length, + ip_src_addr, ip_dst_addr); + + if(is_check) + { + + /* Pickup the pointer to the head of the UDP packet. */ + udp_header_ptr = (NX_UDP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + if(((udp_header_ptr -> nx_udp_header_word_1 & NX_LOWER_16_MASK) == 0) && + (packet_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4)) + checksum = 0; + else + checksum = ~checksum & NX_LOWER_16_MASK; + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Check the checksum. */ + if (checksum) + { + + /* Checksum error. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_INVALID_PACKET; + } + } + else + { + + /* Pickup the pointer to the head of the UDP packet. */ + udp_header_ptr = (NX_UDP_HEADER *)(packet_ptr -> nx_packet_prepend_ptr); + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + udp_header_ptr -> nx_udp_header_word_1 = udp_header_ptr -> nx_udp_header_word_1 | (~checksum & NX_LOWER_16_MASK); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + } + } + + /* No necessary to process next protocol. */ + is_done = NX_TRUE; + break; + } + +#ifndef NX_DISABLE_IPV4 + case NX_PROTOCOL_ICMP: + { + + /* Check if ICMPv4 checksum is enabled. */ + if(((is_check) && (interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_ICMPV4_RX_CHECKSUM)) || + ((!is_check) && (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_ICMPV4_TX_CHECKSUM))) + { + + /* Check fragmentation. */ + if(is_fragmented) + { + + /* Not support fragmentation. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + /* Calculate the ICMPv4 checksum without protection. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_IP_ICMP, + data_length, + /* ICMPV4 header checksum doesn't care src/dest addresses */ + NULL, NULL); + + if(is_check) + { + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Check the checksum. */ + if (checksum) + { + + /* Checksum error. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_INVALID_PACKET; + } + } + else + { + + /* Pickup the pointer to the head of the ICMPv4 packet. */ + icmpv4_header_ptr = (NX_ICMP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + /* Move the checksum into header. */ + NX_CHANGE_ULONG_ENDIAN(icmpv4_header_ptr -> nx_icmp_header_word_0); + icmpv4_header_ptr -> nx_icmp_header_word_0 = icmpv4_header_ptr -> nx_icmp_header_word_0 | (~checksum & NX_LOWER_16_MASK); + NX_CHANGE_ULONG_ENDIAN(icmpv4_header_ptr -> nx_icmp_header_word_0); + } + } + + /* No necessary to process next protocol. */ + is_done = NX_TRUE; + break; + } + + case NX_PROTOCOL_IGMP: + { + + /* Check if IGMP checksum is enabled. */ + if(((is_check) && (interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_IGMP_RX_CHECKSUM)) || + ((!is_check) && (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_IGMP_TX_CHECKSUM))) + { + + /* Check fragmentation. */ + if(is_fragmented) + { + + /* Not support fragmentation. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + /* Pickup the pointer to the head of the IGMP packet. */ + igmp_header_ptr = (NX_IGMP_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + /* Change the endian. */ + NX_CHANGE_ULONG_ENDIAN(igmp_header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(igmp_header_ptr -> nx_igmp_header_word_1); + + /* Calculate the checksum. */ + val = igmp_header_ptr -> nx_igmp_header_word_0; + checksum = (val >> NX_SHIFT_BY_16); + checksum += (val & NX_LOWER_16_MASK); + val = igmp_header_ptr -> nx_igmp_header_word_1; + checksum += (val >> NX_SHIFT_BY_16); + checksum += (val & NX_LOWER_16_MASK); + + /* Add in the carry bits into the checksum. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + /* Do it again in case previous operation generates an overflow. */ + checksum = (checksum >> NX_SHIFT_BY_16) + (checksum & NX_LOWER_16_MASK); + + if(is_check) + { + + /* Change the endian. */ + NX_CHANGE_ULONG_ENDIAN(igmp_header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(igmp_header_ptr -> nx_igmp_header_word_1); + + /* Check the checksum. */ + if ((~checksum) & 0xFFFF) + { + + /* Checksum error. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_INVALID_PACKET; + } + } + else + { + + /* Place the checksum into the first header word. */ + igmp_header_ptr -> nx_igmp_header_word_0 = igmp_header_ptr -> nx_igmp_header_word_0 | (~checksum & NX_LOWER_16_MASK); + + /* Change the endian. */ + NX_CHANGE_ULONG_ENDIAN(igmp_header_ptr -> nx_igmp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(igmp_header_ptr -> nx_igmp_header_word_1); + } + + /* No necessary to process next protocol. */ + is_done = NX_TRUE; + break; + } + + /* No necessary to process next protocol. */ + is_done = NX_TRUE; + break; + } +#endif /* NX_DISABLE_IPV4 */ + +#ifdef FEATURE_NX_IPV6 + case NX_PROTOCOL_ICMPV6: + { + + /* Check if ICMPv6 checksum is enabled. */ + if(((is_check) && (interface_ptr -> nx_interface_capability_flag & NX_INTERFACE_CAPABILITY_ICMPV6_RX_CHECKSUM)) || + ((!is_check) && (packet_ptr -> nx_packet_interface_capability_flag & NX_INTERFACE_CAPABILITY_ICMPV6_TX_CHECKSUM))) + { + + /* Check fragmentation. */ + if(is_fragmented) + { + + /* Not support fragmentation. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + /* Calculate the ICMPv6 checksum without protection. */ + checksum = _nx_ip_checksum_compute(packet_ptr, NX_PROTOCOL_ICMPV6, + data_length, + ip_src_addr, ip_dst_addr); + + if(is_check) + { + checksum = ~checksum & NX_LOWER_16_MASK; + + /* Check the checksum. */ + if (checksum) + { + + /* Checksum error. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_INVALID_PACKET; + } + } + else + { + + /* Pickup the pointer to the head of the ICMPv6 packet. */ + icmpv6_header_ptr = (NX_ICMPV6_HEADER *) packet_ptr -> nx_packet_prepend_ptr; + + checksum = ~checksum; + + /* Move the checksum into header. */ + NX_CHANGE_USHORT_ENDIAN(checksum); + icmpv6_header_ptr -> nx_icmpv6_header_checksum = checksum; + } + } + + /* No necessary to process next protocol. */ + is_done = NX_TRUE; + break; + } + + case NX_PROTOCOL_IPV6: + { + + /* Check fragmentation. */ + if(is_fragmented) + { + + /* Not support fragmentation. Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; + } + + /* Points to the base of IPv6 header. */ + ipv6_header_ptr = (NX_IPV6_HEADER*)packet_ptr -> nx_packet_prepend_ptr; + + /* Get src and dst addresses. */ + COPY_IPV6_ADDRESS(ipv6_header_ptr -> nx_ip_header_source_ip, ip_src_addr); + COPY_IPV6_ADDRESS(ipv6_header_ptr -> nx_ip_header_destination_ip, ip_dst_addr); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_src_addr); + NX_IPV6_ADDRESS_CHANGE_ENDIAN(ip_dst_addr); + + /* Get next protocol. */ + next_protocol = (ipv6_header_ptr -> nx_ip_header_word_1 >> 16) & 0xFF; + + /* Remove IPv6 header. */ + packet_ptr -> nx_packet_prepend_ptr += sizeof(NX_IPV6_HEADER); + data_length = packet_ptr -> nx_packet_length - sizeof(NX_IPV6_HEADER); + break; + } + + case NX_PROTOCOL_NEXT_HEADER_FRAGMENT: + is_fragmented = NX_TRUE; + case NX_PROTOCOL_NEXT_HEADER_HOP_BY_HOP: + case NX_PROTOCOL_NEXT_HEADER_DESTINATION: + case NX_PROTOCOL_NEXT_HEADER_ROUTING: + { + next_protocol = (ULONG)(*packet_ptr -> nx_packet_prepend_ptr); + data_length -= (ULONG)(*(packet_ptr -> nx_packet_prepend_ptr + 1)); + packet_ptr -> nx_packet_prepend_ptr += (ULONG)(*(packet_ptr -> nx_packet_prepend_ptr + 1)); + break; + } +#endif + + default: + /* Unsupported protocol. */ + is_done = NX_TRUE; + break; + } + } + + + /* Restore origianl prepend_ptr. */ + packet_ptr -> nx_packet_prepend_ptr = org_prepend_ptr; + return NX_SUCCESS; +} +#endif /* NX_ENABLE_INTERFACE_CAPABILITY */ + + +#ifdef NX_PCAP_ENABLE +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* get_time_of_day PORTABLE C */ +/* 5.8 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function gets sec and usec from January 1, 1970 */ +/* */ +/* INPUT */ +/* */ +/* tv Pointer to TIME_VAL structure */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* write_pcap_file */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* */ +/**************************************************************************/ +VOID get_time_of_day(NX_TIME_VALUE *time_value) +{ +#ifdef linux + + /* Get the system time. */ + gettimeofday(tv); +#else +SYSTEMTIME systemtime; +FILETIME filetime; +ULONG64 time; + + /* Get the system time. */ + GetSystemTime(&systemtime); + + /* Get the file time. */ + SystemTimeToFileTime(&systemtime, &filetime); + + /* Set the time as ULONG64. */ + time = ((ULONG64)filetime.dwLowDateTime); + time += (((ULONG64)filetime.dwHighDateTime) << 32); + + /* Set the time as from January 1, 1970. */ + time_value -> tv_sec = (LONG)((time - ((UINT64)116444736000000000ULL)) / 10000000L); + time_value -> tv_usec = (LONG)(systemtime.wMilliseconds * 1000); +#endif +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* create_pcap_file PORTABLE C */ +/* 5.10 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function creates libpcap file global header based on libpcap */ +/* file format and writes it to the file. */ +/* */ +/* INPUT */ +/* */ +/* file_name String of file name */ +/* */ +/* OUTPUT */ +/* */ +/* NX_PCAP_FILE_OK Successful file open status */ +/* NX_PCAP_FILE_ERROR Failed file open status */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* */ +/**************************************************************************/ +UINT create_pcap_file(CHAR *file_name) +{ +NX_PCAP_FILE_HEADER pcap_file_header; + + /* Set the pcap file header value. */ + pcap_file_header.magic_number = 0xa1b2c3d4; + pcap_file_header.version_major = 2; + pcap_file_header.version_minor = 4; + pcap_file_header.this_zone = -28800; + pcap_file_header.sig_figs = 0; + pcap_file_header.snapshot_length = 0x0000ffff; + pcap_file_header.link_type = 1; + + /* Open the pcap file. */ + nx_network_driver_pcap_fp = fopen(file_name, "wb+"); + + /* Check if open the pcap file. */ + if (nx_network_driver_pcap_fp == NX_NULL) + return (NX_PCAP_FILE_ERROR); + + /* Write the pcap file header. */ + fwrite(&pcap_file_header, sizeof(pcap_file_header), 1, nx_network_driver_pcap_fp); + + /* Return. */ + return (NX_PCAP_FILE_OK); +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* write_pcap_file PORTABLE C */ +/* 5.10 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function creates libpcap file packet header based on libpcap */ +/* file format, receives packet data, and writes them to the file. */ +/* */ +/* INPUT */ +/* */ +/* packet_ptr Pointer to the source packet */ +/* */ +/* OUTPUT */ +/* */ +/* NX_PCAP_FILE_OK Successful file open status */ +/* NX_PCAP_FILE_ERROR Failed file open status */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* _nx_ram_network_driver_output */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* */ +/**************************************************************************/ +UINT write_pcap_file(NX_PACKET *packet_ptr) +{ +NX_PCAP_PACKET_HEADER pcap_packet_header; +NX_TIME_VALUE time_value; +CHAR data_buffer[3014]; +ULONG data_length; + + /* Get the system time. */ + get_time_of_day(&time_value); + + /* Retrieve data from packet. */ + nx_packet_data_retrieve(packet_ptr, data_buffer, &data_length); + + /* Set the time. */ + pcap_packet_header.time_stamp_second = time_value.tv_sec; + pcap_packet_header.time_stamp_microseconds = time_value.tv_usec; + pcap_packet_header.capture_length = data_length; + pcap_packet_header.actual_length = data_length; + + /* Check if open the pcap file. */ + if (nx_network_driver_pcap_fp == NX_NULL) + return (NX_PCAP_FILE_ERROR); + + /* Write the pcap packet header. */ + fwrite(&pcap_packet_header, sizeof(pcap_packet_header), 1, nx_network_driver_pcap_fp); + + /* Write the packet data. */ + fwrite(data_buffer, data_length, 1, nx_network_driver_pcap_fp); + + /* Flush the file data. */ + fflush(nx_network_driver_pcap_fp); + + /* Return. */ + return (NX_PCAP_FILE_OK); +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* close_pcap_file PORTABLE C */ +/* 5.10 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Express Logic, Inc. */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function closes the libpcap file opened */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* */ +/**************************************************************************/ +VOID close_pcap_file() +{ + + /* Check if the pcap file pointer. */ + if (nx_network_driver_pcap_fp != NX_NULL) + { + + /* Close the file. */ + fclose(nx_network_driver_pcap_fp); + + /* Set the pcap file pointer to NX_NULL. */ + nx_network_driver_pcap_fp = NX_NULL; + } +} +#endif /* NX_PCAP_ENABLE */ + +#ifdef NX_BSD_RAW_SUPPORT +/* Stub function used by BSD raw socket. */ +UINT _nx_driver_hardware_packet_send(NX_PACKET *packet_ptr) +{ + + if (!(packet_ptr -> nx_packet_ip_interface -> nx_interface_valid)) + return(NX_PTR_ERROR); + return(NX_SUCCESS); +} + +/* Callback function pointer when packet is received. */ +VOID (*_nx_driver_hardware_packet_received_callback)(NX_PACKET *packet_ptr, UCHAR *consumed); +#endif /* NX_BSD_RAW_SUPPORT */ diff --git a/test/regression/test/nx_ram_network_driver_test_1500.h b/test/regression/test/nx_ram_network_driver_test_1500.h new file mode 100644 index 00000000..ed58da53 --- /dev/null +++ b/test/regression/test/nx_ram_network_driver_test_1500.h @@ -0,0 +1,50 @@ +#ifndef _NX_RAM_NETWORK_DRIVER_TEST_1500_H_ +#define _NX_RAM_NETWORK_DRIVER_TEST_1500_H_ +#include "tx_api.h" +#include "tx_timer.h" +#define NX_RAMDRIVER_OP_BYPASS 0 +#define NX_RAMDRIVER_OP_DROP 1 +#define NX_RAMDRIVER_OP_DELAY 2 +#define NX_RAMDRIVER_OP_DUPLICATE 3 + +#define NX_RAMDRIVER_TIMER_UNUSED 0 +#define NX_RAMDRIVER_TIMER_USED 1 +#define NX_RAMDRIVER_TIMER_DIRTY 2 + +#define NX_MAX_TIMER 5 + +VOID _nx_ram_network_driver_timer_clean(VOID); + + +#ifdef NX_PCAP_ENABLE + +/* Define return values. */ +#define NX_PCAP_FILE_OK 1 +#define NX_PCAP_FILE_ERROR 0 + +/* Define the pcap header struct. */ +typedef struct NX_PCAP_HEADER_FILE_STRUCT +{ +UINT magic_number; /* magic number */ +USHORT version_major; /* major version number */ +USHORT version_minor; /* minor version number */ +INT this_zone; /* GMT to local correction */ +UINT sig_figs; /* accuracy of timestamps */ +UINT snapshot_length; /* max length of captured packets, in octets */ +UINT link_type; /* data link type */ +} NX_PCAP_FILE_HEADER; + +typedef struct NX_PCAP_PACKET_HEADER_STRUCT +{ +UINT time_stamp_second; /* timestamp seconds */ +UINT time_stamp_microseconds; /* timestamp microseconds */ +UINT capture_length; /* number of octets of packet saved in file */ +UINT actual_length; /* actual length of packet */ +} NX_PCAP_PACKET_HEADER; + +/* Define time value. */ +typedef struct timeval NX_TIME_VALUE; + +#endif /* NX_PCAP_ENABLE */ + +#endif /* _NX_RAM_NETWORK_DRIVER_TEST_1500_H_ */ diff --git a/test/regression/tftp_test/netx_tftp_basic_test.c b/test/regression/tftp_test/netx_tftp_basic_test.c new file mode 100644 index 00000000..afb92a17 --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_basic_test.c @@ -0,0 +1,432 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + +/* Define buffer used in the demo application. */ +static UCHAR buffer[255]; +static ULONG data_length; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TFTP Basic Test..........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + nxd_tftp_server_delete(&server); +#else + nx_tftp_server_delete(&server); +#endif + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT all_done = NX_FALSE; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open a TFTP file for writing. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a TFTP packet. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check status. */ + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write this packet to the file via TFTP. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Close this file. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open the same file for reading. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + do + { + + /* Read the file back. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check for retranmission/dropped packet error. Benign. Try again... */ + if (status == NX_TFTP_INVALID_BLOCK_NUMBER) + { + continue; + } + else if (status == NX_TFTP_END_OF_FILE) + { + /* All done. */ + all_done = NX_TRUE; + } + else if (status) + { + error_counter++; + + /* Internal error, invalid packet or error on read. */ + break; + } + + + /* Do something with the packet data and release when done. */ + nx_packet_data_retrieve(my_packet, buffer, &data_length); + buffer[data_length] = 0; + nx_packet_release(my_packet); + + } while (all_done == NX_FALSE); + + /* Close the file again. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Basic Test...........................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/tftp_test/netx_tftp_error_destionation_port_test.c b/test/regression/tftp_test/netx_tftp_error_destionation_port_test.c new file mode 100644 index 00000000..e8f9a1c6 --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_error_destionation_port_test.c @@ -0,0 +1,421 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +/* Define the TID variables. */ +static UINT client_port; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); +static void server_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_error_destination_port_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Set the callback funciton. */ + server_ip.nx_ip_udp_packet_receive = server_udp_packet_receive; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TFTP Error Destination Port Test.........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + nxd_tftp_server_delete(&server); +#else + nx_tftp_server_delete(&server); +#endif + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open a TFTP file for writing. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Allocate a TFTP packet. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check status. */ + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write this packet to the file via TFTP. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status == NX_SUCCESS) + error_counter++; + + /* Close this file. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; +} + +/* 1. Host A sends a "WRQ" to host B with source = A's TID, destination = 69/ + 2. Host B sends a "ACK" (with block number = 0) to host A with source = B's TID, destination = A's TID. RFC1350, Section4, Page5. */ + +static void server_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_UDP_HEADER *udp_header_ptr; +UINT src_port,dest_port; + + /* Get the header pointer. */ + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pickup the destination UDP port. */ + src_port = (UINT) ((udp_header_ptr -> nx_udp_header_word_0 >> NX_SHIFT_BY_16) & NX_LOWER_16_MASK); + dest_port = (UINT) (udp_header_ptr -> nx_udp_header_word_0 & NX_LOWER_16_MASK); + + /* Keep the source port. */ + client_port = src_port; + + /* Check destinaton port. */ + if (dest_port != NX_TFTP_SERVER_PORT) + error_counter ++; + + /* Modify the destination port. */ + udp_header_ptr -> nx_udp_header_word_0 = udp_header_ptr -> nx_udp_header_word_0 & 0xFFFF0000; + udp_header_ptr -> nx_udp_header_word_0 = udp_header_ptr -> nx_udp_header_word_0| (NX_TFTP_SERVER_PORT + 1); + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pass the packet to the default function. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_error_destination_port_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Error Destination Port Test..........................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/tftp_test/netx_tftp_error_file_name_test.c b/test/regression/tftp_test/netx_tftp_error_file_name_test.c new file mode 100644 index 00000000..4d5ebefa --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_error_file_name_test.c @@ -0,0 +1,408 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_error_file_name_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TFTP Error File Name Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + nxd_tftp_server_delete(&server); +#else + nx_tftp_server_delete(&server); +#endif + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open a TFTP file for writing. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a TFTP packet. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check status. */ + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write this packet to the file via TFTP. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Close this file. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open the same file for reading. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test1.txt", &server_ip_address, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test1.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Read the file back. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check for retranmission/dropped packet error. Benign. Try again... */ + if ((status != NX_TFTP_CODE_ERROR) || + (client.nx_tftp_client_error_code != NX_TFTP_ERROR_FILE_NOT_FOUND) || + (strcmp(client.nx_tftp_client_error_string, "NetX TFTP Server: File Not Found"))) + { + error_counter++; + } + + /* Close the file again. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_error_file_name_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Error File Name Test.................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/tftp_test/netx_tftp_ipv6_basic_test.c b/test/regression/tftp_test/netx_tftp_ipv6_basic_test.c new file mode 100644 index 00000000..697643d2 --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_ipv6_basic_test.c @@ -0,0 +1,374 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" +#ifdef FEATURE_NX_IPV6 +#include "nx_ipv6.h" + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define IP_TYPE 6 +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +static NXD_ADDRESS client_ip_address; +static NXD_ADDRESS server_ip_address; +static UINT error_counter = 0; + +/* Define buffer used in the demo application. */ +static UCHAR buffer[255]; +static ULONG data_length; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); +extern void test_control_return(UINT); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_ipv6_basic_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Set the server ipv6 address. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + server_ip_address.nxd_ip_address.v6[0] = 0x20010000; + server_ip_address.nxd_ip_address.v6[1] = 0x00000000; + server_ip_address.nxd_ip_address.v6[2] = 0x00000000; + server_ip_address.nxd_ip_address.v6[3] = 0x10000001; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&server_ip, 0, &server_ip_address,64, NX_NULL); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP for Server IP instance. */ + status = nx_udp_enable(&server_ip); + status += nxd_ipv6_enable(&server_ip); + status += nxd_icmp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Set ipv6 version and address. */ + client_ip_address.nxd_ip_version = NX_IP_VERSION_V6; + client_ip_address.nxd_ip_address.v6[0] = 0x20010000; + client_ip_address.nxd_ip_address.v6[1] = 0x00000000; + client_ip_address.nxd_ip_address.v6[2] = 0x00000000; + client_ip_address.nxd_ip_address.v6[3] = 0x10000010; + + /* Set interfaces' address */ + status = nxd_ipv6_address_set(&client_ip, 0, &client_ip_address,64, NX_NULL); + + /* Enable UDP for client IP instance. */ + status = nx_udp_enable(&client_ip); + status += nxd_ipv6_enable(&client_ip); + status += nxd_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TFTP IPv6 Basic Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ + status = nxd_tftp_server_start(&server); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + + nxd_tftp_server_delete(&server); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT all_done = NX_FALSE; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); + + /* Check status. */ + if (status) + error_counter++; + + /* Open a TFTP file for writing. */ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a TFTP packet. */ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); + /* Check status. */ + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write this packet to the file via TFTP. */ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); + + /* Check status. */ + if (status) + error_counter++; + + /* Close this file. */ + status = nxd_tftp_client_file_close(&client, IP_TYPE); + + /* Check status. */ + if (status) + error_counter++; + + /* Open the same file for reading. */ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE, IP_TYPE); + + /* Check status. */ + if (status) + error_counter++; + do + { + + /* Read the file back. */ + status = nxd_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); + + /* Check for retranmission/dropped packet error. Benign. Try again... */ + if (status == NX_TFTP_INVALID_BLOCK_NUMBER) + { + continue; + } + else if (status == NX_TFTP_END_OF_FILE) + { + /* All done. */ + all_done = NX_TRUE; + } + else if (status) + { + error_counter++; + + /* Internal error, invalid packet or error on read. */ + break; + } + + + /* Do something with the packet data and release when done. */ + nx_packet_data_retrieve(my_packet, buffer, &data_length); + buffer[data_length] = 0; + nx_packet_release(my_packet); + + } while (all_done == NX_FALSE); + + /* Close the file again. */ + status = nxd_tftp_client_file_close(&client, IP_TYPE); + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ + status = nxd_tftp_client_delete(&client); + + /* Check status. */ + if (status) + error_counter++; +} +#endif diff --git a/test/regression/tftp_test/netx_tftp_large_data_test.c b/test/regression/tftp_test/netx_tftp_large_data_test.c new file mode 100644 index 00000000..7d2f604a --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_large_data_test.c @@ -0,0 +1,500 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + +/* Define buffer used in the demo application. */ +static UCHAR buffer[50000000]; +static UINT buffer_size = 50000000; +static UINT real_data_length = 50000000; +static UINT send_data_length; +static UINT receive_data_length; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[60000000]; +static UCHAR ram_disk_sector_cache[512]; + +/* Define the TID variables. */ +static UINT client_port; +static UINT service_packet_number = 0; +static UINT client_packet_number = 0; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1500(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_large_data_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 20480); + pointer = pointer + 20480; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 20480); + pointer = pointer + 20480; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 10000 * 10, /* Total sectors */ + 512, /* Sector size */ + 10, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT packet_length; +UINT all_done = NX_FALSE; +ULONG i; +ULONG data_value; + + + /* Print out test information banner. */ + printf("NetX Test: TFTP Large Data Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Generate a random number for write data. */ + data_value = NX_RAND(); + + /* Genearte the write data. */ + for (i = 0; i < buffer_size / sizeof(ULONG); i ++) + { + ((ULONG*)buffer)[i] = data_value++; + } + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Open a TFTP file for writing. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Loop to send the data. */ + send_data_length = 0; + while(send_data_length < real_data_length) + { + + /* Allocate a TFTP packet. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Write ABCs into the packet payload! */ + if (send_data_length + 512 < real_data_length) + packet_length = 512; + else + packet_length = real_data_length - send_data_length; + + /* Write ABCs into the packet payload! */ + status = nx_packet_data_append(my_packet, buffer + send_data_length, packet_length, &client_pool, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Write this packet to the file via TFTP. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + send_data_length += packet_length; + } + + /* Check the send length. */ + if ((error_counter) ||(send_data_length != real_data_length)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Close this file. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Open the same file for reading. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + receive_data_length = 0; + do + { + + /* Read the file back. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check for retranmission/dropped packet error. Benign. Try again... */ + if (status == NX_TFTP_INVALID_BLOCK_NUMBER) + { + continue; + } + else if (status == NX_TFTP_END_OF_FILE) + { + /* All done. */ + all_done = NX_TRUE; + } + else if (status) + { + error_counter++; + + /* Internal error, invalid packet or error on read. */ + break; + } + + /* Do something with the packet data and release when done. */ + nx_packet_data_retrieve(my_packet, buffer, (ULONG *)&packet_length); + receive_data_length += packet_length; + nx_packet_release(my_packet); + } while (all_done == NX_FALSE); + + /* Check the send length. */ + if ((error_counter) ||(receive_data_length != real_data_length)) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Close the file again. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + { + printf("ERROR!\n"); + test_control_return(1); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_large_data_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Large Data Test......................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/tftp_test/netx_tftp_malformed_packet_test.c b/test/regression/tftp_test/netx_tftp_malformed_packet_test.c new file mode 100644 index 00000000..6caaebb9 --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_malformed_packet_test.c @@ -0,0 +1,465 @@ + +#include "tx_api.h" +#include "nx_api.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + +/* Define buffer used in the demo application. */ +static UCHAR buffer[255]; +static ULONG data_length; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_malformed_packet_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; +FX_FILE my_file; + + /* Print out test information banner. */ + printf("NetX Test: TFTP Malformed Packet Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + status += fx_file_create(&ram_disk, "test.txt"); + status += fx_file_open(&ram_disk, &my_file, "test.txt", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "TFTP server", 11); + status += fx_file_close(&my_file); + if (status) + error_counter++; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_suspend(&server_thread); + +#ifdef __PRODUCT_NETXDUO__ + nxd_tftp_server_delete(&server); +#else + nx_tftp_server_delete(&server); +#endif + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ +UCHAR write_data[] = {0x00, 0x02, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x00}; +UCHAR read_data[] = {0x00, 0x01, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x00}; +UCHAR test_write_data[] = {0x00, 0x02, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78, 0x74, 0x00}; +UCHAR test_read_data[] = {0x00, 0x01, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78, 0x74, 0x00}; +UCHAR test_write_data_1[] = {0x00, 0x02, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x4f, 0x43, 0x00, 0x45, 0x54, 0x00}; +UCHAR test_read_data_1[] = {0x00, 0x01, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x4f, 0x43, 0x00, 0x45, 0x54, 0x00}; +UCHAR *test_data[] = { + test_write_data, + test_write_data_1, + test_read_data, + test_read_data_1, +}; +UINT test_data_size[] = { + sizeof(test_write_data), + sizeof(test_write_data_1), + sizeof(test_read_data), + sizeof(test_read_data_1), +}; + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UCHAR *buffer_ptr; +UINT i; +UINT all_done = NX_FALSE; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + error_counter++; + + for (i = 0; i < sizeof(test_data) / sizeof(UCHAR *); i++) + { + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + { + error_counter++; + continue; + } + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, test_data[i], sizeof(test_write_data)); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = test_data_size[i]; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + test_data_size[i]; + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_udp_socket_send(&client.nx_tftp_client_socket, my_packet, &server_ip_address, NX_TFTP_SERVER_PORT); +#else + status = nx_udp_socket_send(&client.nx_tftp_client_socket, my_packet, SERVER_ADDRESS, NX_TFTP_SERVER_PORT); +#endif + /* Check status. */ + if (status) + { + error_counter++; + nx_packet_release(my_packet); + continue; + } + + status = nx_udp_socket_receive(&client.nx_tftp_client_socket, &my_packet, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status == NX_SUCCESS) + { + + /* Setup a pointer to the packet payload. */ + buffer_ptr = my_packet -> nx_packet_prepend_ptr; + + if ((buffer_ptr[0] != 0) || (buffer_ptr[1] != NX_TFTP_CODE_ERROR)) + { + error_counter++; + } + + nx_packet_release(my_packet); + } + } + + /* Open the same file for reading. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + do + { + + /* Read the file back. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check for retranmission/dropped packet error. Benign. Try again... */ + if (status == NX_TFTP_INVALID_BLOCK_NUMBER) + { + continue; + } + else if (status == NX_TFTP_END_OF_FILE) + { + /* All done. */ + all_done = NX_TRUE; + } + else if (status) + { + error_counter++; + + /* Internal error, invalid packet or error on read. */ + break; + } + + + /* Do something with the packet data and release when done. */ + nx_packet_data_retrieve(my_packet, buffer, &data_length); + buffer[data_length] = 0; + nx_packet_release(my_packet); + + } while (all_done == NX_FALSE); + + /* Close the file again. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + tx_thread_resume(&server_thread); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_malformed_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Malformed Packet Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/tftp_test/netx_tftp_read_interaction_test.c b/test/regression/tftp_test/netx_tftp_read_interaction_test.c new file mode 100644 index 00000000..89a77e53 --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_read_interaction_test.c @@ -0,0 +1,563 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + +/* Define buffer used in the demo application. */ +static UCHAR buffer[255]; +static ULONG data_length; + + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +/* Define the TID variables. */ +static UINT client_port; +static UINT service_packet_number = 0; +static UINT client_packet_number = 0; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); +static void server_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void client_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_read_interaction_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TFTP Read Interaction Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + nxd_tftp_server_delete(&server); +#else + nx_tftp_server_delete(&server); +#endif + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +UINT all_done = NX_FALSE; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open a TFTP file for writing. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a TFTP packet. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check status. */ + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write this packet to the file via TFTP. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Close this file. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Set the callback funciton to process the Read message. */ + server_ip.nx_ip_udp_packet_receive = server_udp_packet_receive; + client_ip.nx_ip_udp_packet_receive = client_udp_packet_receive; + + /* Open the same file for reading. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + do + { + + /* Read the file back. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_read(&client, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check for retranmission/dropped packet error. Benign. Try again... */ + if (status == NX_TFTP_INVALID_BLOCK_NUMBER) + { + continue; + } + else if (status == NX_TFTP_END_OF_FILE) + { + /* All done. */ + all_done = NX_TRUE; + } + else if (status) + { + error_counter++; + + /* Internal error, invalid packet or error on read. */ + break; + } + + + /* Do something with the packet data and release when done. */ + nx_packet_data_retrieve(my_packet, buffer, &data_length); + buffer[data_length] = 0; + nx_packet_release(my_packet); + + } while (all_done == NX_FALSE); + + /* Close the file again. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; +} + +/* 1. Host A sends a "RRQ" to host B with source = A's TID, destination = 69/ + 2. Host B sends a "DATA" (with block number = 1) to host A with source = B's TID, destination = A's TID. RFC1350, I.Appendix, Page9. */ + +static void server_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_UDP_HEADER *udp_header_ptr; +UINT src_port,dest_port; +UCHAR *data_ptr; + + /* Get the header pointer. */ + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pickup the destination UDP port. */ + src_port = (UINT) ((udp_header_ptr -> nx_udp_header_word_0 >> NX_SHIFT_BY_16) & NX_LOWER_16_MASK); + dest_port = (UINT) (udp_header_ptr -> nx_udp_header_word_0 & NX_LOWER_16_MASK); + + /* Keep the source port. */ + client_port = src_port; + + /* Check destinaton port. */ + if (dest_port != NX_TFTP_SERVER_PORT) + error_counter ++; + + /* Check the "RRQ" */ + if (service_packet_number == 0) + { + data_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_UDP_HEADER); + + /* Check the OPcode, RRQ = 1, 2bytes. */ + if (*data_ptr != 0) + error_counter ++; + + data_ptr++; + + /* Check the OPcode. */ + if (*data_ptr != 1) + error_counter ++; + + service_packet_number++; + } + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pass the packet to the default function. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} + +static void client_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_UDP_HEADER *udp_header_ptr; +UINT src_port,dest_port; +UCHAR *data_ptr; + + /* Get the header pointer. */ + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pickup the destination UDP port. */ + src_port = (UINT) ((udp_header_ptr -> nx_udp_header_word_0 >> NX_SHIFT_BY_16) & NX_LOWER_16_MASK); + dest_port = (UINT) (udp_header_ptr -> nx_udp_header_word_0 & NX_LOWER_16_MASK); + + /* Check destinaton port. */ + if ((src_port != NX_TFTP_SERVER_PORT) || (dest_port != client_port)) + error_counter ++; + + /* Check the "DATA" */ + if (client_packet_number == 0) + { + data_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_UDP_HEADER); + + /* Check the OPcode, DATA = 3, 2bytes. */ + if (*data_ptr != 0) + error_counter ++; + + data_ptr++; + + /* Check the OPcode. */ + if (*data_ptr != 3) + error_counter ++; + + data_ptr++; + + /* Check the Block, Block = 1, 2bytes. */ + if (*data_ptr != 0) + error_counter ++; + + data_ptr++; + + /* Check the OPcode. */ + if (*data_ptr != 1) + error_counter ++; + + client_packet_number++; + } + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pass the packet to the default function. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_read_interaction_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Read Interaction Test................................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/tftp_test/netx_tftp_write_interaction_test.c b/test/regression/tftp_test/netx_tftp_write_interaction_test.c new file mode 100644 index 00000000..30579de3 --- /dev/null +++ b/test/regression/tftp_test/netx_tftp_write_interaction_test.c @@ -0,0 +1,501 @@ + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_udp.h" +#ifdef __PRODUCT_NETXDUO__ +#include "nxd_tftp_client.h" +#include "nxd_tftp_server.h" +#else +#include "nx_tftp_client.h" +#include "nx_tftp_server.h" +#endif +#include "fx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX, NetX, and FileX object control blocks... */ + +static TX_THREAD server_thread; +static TX_THREAD client_thread; +static NX_PACKET_POOL server_pool; +static NX_IP server_ip; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static FX_MEDIA ram_disk; + +/* Define the NetX DUO TFTP object control blocks. */ + +static NX_TFTP_CLIENT client; +static NX_TFTP_SERVER server; + +/* Define the application global variables */ + +#define CLIENT_ADDRESS IP_ADDRESS(1, 2, 3, 5) +#define SERVER_ADDRESS IP_ADDRESS(1, 2, 3, 4) +#ifdef __PRODUCT_NETXDUO__ +#define IP_TYPE 4 +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif +static UINT error_counter = 0; + +/* Define the memory area for the FileX RAM disk. */ +static UCHAR ram_disk_memory[32000]; +static UCHAR ram_disk_sector_cache[512]; + +/* Define the TID variables. */ +static UINT client_port; +static UINT service_packet_number = 0; +static UINT client_packet_number = 0; + + +/* Define function prototypes. */ + +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); + +static void client_thread_entry(ULONG thread_input); +static void server_thread_entry(ULONG thread_input); +static void server_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +static void client_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_write_interaction_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +UCHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the main TFTPv6 server thread. */ + status = tx_thread_create(&server_thread, "TFTP Server Thread", server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 4,4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the main TFTPv6 client thread at a slightly lower priority. */ + status = tx_thread_create(&client_thread, "TFTP Client Thread", client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 5, 5, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer += DEMO_STACK_SIZE ; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&server_pool, "TFTP Server Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create the IP instance for the TFTP Server. */ + status = nx_ip_create(&server_ip, "NetX Server IP Instance", SERVER_ADDRESS, 0xFFFFFF00UL, + &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable UDP. */ + status = nx_udp_enable(&server_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + + /* Create the TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = SERVER_ADDRESS; +#else + server_ip_address = SERVER_ADDRESS; +#endif + +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#else + status = nx_tftp_server_create(&server, "TFTP Server Instance", &server_ip, &ram_disk, + pointer, DEMO_STACK_SIZE, &server_pool); +#endif + + pointer = pointer + DEMO_STACK_SIZE; + + /* Check for errors for the server. */ + if (status) + error_counter++; + + /* Create a packet pool for the TFTP client. */ + + /* Note: The data portion of a packet is exactly 512 bytes, but the packet payload size must + be at least 580 bytes. The remaining bytes are used for the UDP, IP, and Ethernet + headers and byte alignment requirements. */ + + status = nx_packet_pool_create(&client_pool, "TFTP Client Packet Pool", NX_TFTP_PACKET_SIZE, pointer, 8192); + pointer = pointer + 8192; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Create an IP instance for the TFTP client. */ + status = nx_ip_create(&client_ip, "TFTP Client IP Instance", CLIENT_ADDRESS, 0xFFFFFF00UL, + &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); + pointer = pointer + 2048; + + /* Check for errors. */ + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable UDP for client IP instance. */ + status += nx_udp_enable(&client_ip); + status += nx_icmp_enable(&client_ip); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Set the callback funciton. */ + server_ip.nx_ip_udp_packet_receive = server_udp_packet_receive; + client_ip.nx_ip_udp_packet_receive = client_udp_packet_receive; + + tx_thread_resume(&client_thread); +} + +void server_thread_entry(ULONG thread_input) +{ + +UINT status; + + /* Print out test information banner. */ + printf("NetX Test: TFTP Write Interaction Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Format the RAM disk - the memory for the RAM disk was defined above. */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, /* Driver entry */ + ram_disk_memory, /* RAM disk memory pointer */ + ram_disk_sector_cache, /* Media buffer pointer */ + sizeof(ram_disk_sector_cache), /* Media buffer size */ + "MY_RAM_DISK", /* Volume Name */ + 1, /* Number of FATs */ + 32, /* Directory Entries */ + 0, /* Hidden sectors */ + 256, /* Total sectors */ + 128, /* Sector size */ + 1, /* Sectors per cluster */ + 1, /* Heads */ + 1); /* Sectors per track */ + + /* Check for errors. */ + if (status) + error_counter++; + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); + + /* Check for errors. */ + if (status) + error_counter++; + + /* Start the NetX Duo TFTP server. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_server_start(&server); +#else + status = nx_tftp_server_start(&server); +#endif + + /* Check for errors. */ + if (status) + error_counter++; + + /* Run for a while */ + tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); + +#ifdef __PRODUCT_NETXDUO__ + nxd_tftp_server_delete(&server); +#else + nx_tftp_server_delete(&server); +#endif + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the TFTP client thread. */ + +void client_thread_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; + + + /* The TFTP services used below include the NetX equivalent service which will work with + NetX Duo TFTP. However, it is recommended for developers to port their applications + to the newer services that take the NXD_ADDRESS type and support both IPv4 and IPv6 + communication. + */ + + /* Create a TFTP client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool, IP_TYPE); +#else + status = nx_tftp_client_create(&client, "TFTP Client", &client_ip, &client_pool); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Open a TFTP file for writing. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_open(&client, "test.txt", &server_ip_address, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_open(&client, "test.txt", SERVER_ADDRESS, NX_TFTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a TFTP packet. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_packet_allocate(&client_pool, &my_packet, NX_IP_PERIODIC_RATE); +#endif + /* Check status. */ + if (status) + error_counter++; + + /* Write ABCs into the packet payload! */ + memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); + + /* Adjust the write pointer. */ + my_packet -> nx_packet_length = 28; + my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; + + /* Write this packet to the file via TFTP. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE, IP_TYPE); +#else + status = nx_tftp_client_file_write(&client, my_packet, NX_IP_PERIODIC_RATE); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Close this file. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_file_close(&client, IP_TYPE); +#else + status = nx_tftp_client_file_close(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; + + /* Delete the client. */ +#ifdef __PRODUCT_NETXDUO__ + status = nxd_tftp_client_delete(&client); +#else + status = nx_tftp_client_delete(&client); +#endif + + /* Check status. */ + if (status) + error_counter++; +} + +/* 1. Host A sends a "WRQ" to host B with source = A's TID, destination = 69/ + 2. Host B sends a "ACK" (with block number = 0) to host A with source = B's TID, destination = A's TID. RFC1350, Section4, Page5. */ + +static void server_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_UDP_HEADER *udp_header_ptr; +UINT src_port,dest_port; +UCHAR *data_ptr; + + /* Get the header pointer. */ + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pickup the destination UDP port. */ + src_port = (UINT) ((udp_header_ptr -> nx_udp_header_word_0 >> NX_SHIFT_BY_16) & NX_LOWER_16_MASK); + dest_port = (UINT) (udp_header_ptr -> nx_udp_header_word_0 & NX_LOWER_16_MASK); + + /* Keep the source port. */ + client_port = src_port; + + /* Check destinaton port. */ + if (dest_port != NX_TFTP_SERVER_PORT) + error_counter ++; + + /* Check the "WRQ" */ + if (service_packet_number == 0) + { + data_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_UDP_HEADER); + + /* Check the OPcode, RRQ = 2, 2bytes. */ + if (*data_ptr != 0) + error_counter ++; + + data_ptr++; + + /* Check the OPcode. */ + if (*data_ptr != 2) + error_counter ++; + + service_packet_number++; + } + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pass the packet to the default function. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); + +} + +static void client_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + +NX_UDP_HEADER *udp_header_ptr; +UINT src_port,dest_port; +UCHAR *data_ptr; + + /* Get the header pointer. */ + udp_header_ptr = (NX_UDP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pickup the destination UDP port. */ + src_port = (UINT) ((udp_header_ptr -> nx_udp_header_word_0 >> NX_SHIFT_BY_16) & NX_LOWER_16_MASK); + dest_port = (UINT) (udp_header_ptr -> nx_udp_header_word_0 & NX_LOWER_16_MASK); + + /* Check destinaton port. */ + if ((src_port != NX_TFTP_SERVER_PORT) || (dest_port != client_port)) + error_counter ++; + + /* Check the "ACk" */ + if (client_packet_number == 0) + { + data_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_UDP_HEADER); + + /* Check the OPcode, ACK = 4, 2bytes. */ + if (*data_ptr != 0) + error_counter ++; + + data_ptr++; + + /* Check the OPcode. */ + if (*data_ptr != 4) + error_counter ++; + + data_ptr++; + + /* Check the Block, Block = 1, 2bytes. */ + if (*data_ptr != 0) + error_counter ++; + + data_ptr++; + + /* Check the OPcode. */ + if (*data_ptr != 0) + error_counter ++; + + client_packet_number++; + } + + /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will + swap the endian of the UDP header. */ + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_0); + NX_CHANGE_ULONG_ENDIAN(udp_header_ptr -> nx_udp_header_word_1); + + /* Pass the packet to the default function. */ + _nx_udp_packet_receive(ip_ptr, packet_ptr); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_tftp_write_interaction_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: TFTP Write Interaction Test...............................N/A\n"); + + test_control_return(3); +} +#endif \ No newline at end of file diff --git a/test/regression/web_test/ecc_certs.c b/test/regression/web_test/ecc_certs.c new file mode 100644 index 00000000..e40c8b62 --- /dev/null +++ b/test/regression/web_test/ecc_certs.c @@ -0,0 +1,1201 @@ + +static unsigned char globalsignrootca_cer[] = { + 0x30, 0x82, 0x03, 0x5f, 0x30, 0x82, 0x02, 0x47, 0xa0, 0x03, 0x02, 0x01, + 0x02, 0x02, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x21, 0x58, 0x53, + 0x08, 0xa2, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x4c, 0x31, 0x20, 0x30, 0x1e, 0x06, + 0x03, 0x55, 0x04, 0x0b, 0x13, 0x17, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x2d, 0x20, 0x52, 0x33, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, + 0x04, 0x0a, 0x13, 0x0a, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, + 0x67, 0x6e, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, + 0x0a, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x30, + 0x1e, 0x17, 0x0d, 0x30, 0x39, 0x30, 0x33, 0x31, 0x38, 0x31, 0x30, 0x30, + 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x33, 0x31, 0x38, + 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x4c, 0x31, 0x20, 0x30, + 0x1e, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x17, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x33, 0x31, 0x13, 0x30, 0x11, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0a, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, + 0x03, 0x13, 0x0a, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, + 0x6e, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, + 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, + 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xcc, 0x25, + 0x76, 0x90, 0x79, 0x06, 0x78, 0x22, 0x16, 0xf5, 0xc0, 0x83, 0xb6, 0x84, + 0xca, 0x28, 0x9e, 0xfd, 0x05, 0x76, 0x11, 0xc5, 0xad, 0x88, 0x72, 0xfc, + 0x46, 0x02, 0x43, 0xc7, 0xb2, 0x8a, 0x9d, 0x04, 0x5f, 0x24, 0xcb, 0x2e, + 0x4b, 0xe1, 0x60, 0x82, 0x46, 0xe1, 0x52, 0xab, 0x0c, 0x81, 0x47, 0x70, + 0x6c, 0xdd, 0x64, 0xd1, 0xeb, 0xf5, 0x2c, 0xa3, 0x0f, 0x82, 0x3d, 0x0c, + 0x2b, 0xae, 0x97, 0xd7, 0xb6, 0x14, 0x86, 0x10, 0x79, 0xbb, 0x3b, 0x13, + 0x80, 0x77, 0x8c, 0x08, 0xe1, 0x49, 0xd2, 0x6a, 0x62, 0x2f, 0x1f, 0x5e, + 0xfa, 0x96, 0x68, 0xdf, 0x89, 0x27, 0x95, 0x38, 0x9f, 0x06, 0xd7, 0x3e, + 0xc9, 0xcb, 0x26, 0x59, 0x0d, 0x73, 0xde, 0xb0, 0xc8, 0xe9, 0x26, 0x0e, + 0x83, 0x15, 0xc6, 0xef, 0x5b, 0x8b, 0xd2, 0x04, 0x60, 0xca, 0x49, 0xa6, + 0x28, 0xf6, 0x69, 0x3b, 0xf6, 0xcb, 0xc8, 0x28, 0x91, 0xe5, 0x9d, 0x8a, + 0x61, 0x57, 0x37, 0xac, 0x74, 0x14, 0xdc, 0x74, 0xe0, 0x3a, 0xee, 0x72, + 0x2f, 0x2e, 0x9c, 0xfb, 0xd0, 0xbb, 0xbf, 0xf5, 0x3d, 0x00, 0xe1, 0x06, + 0x33, 0xe8, 0x82, 0x2b, 0xae, 0x53, 0xa6, 0x3a, 0x16, 0x73, 0x8c, 0xdd, + 0x41, 0x0e, 0x20, 0x3a, 0xc0, 0xb4, 0xa7, 0xa1, 0xe9, 0xb2, 0x4f, 0x90, + 0x2e, 0x32, 0x60, 0xe9, 0x57, 0xcb, 0xb9, 0x04, 0x92, 0x68, 0x68, 0xe5, + 0x38, 0x26, 0x60, 0x75, 0xb2, 0x9f, 0x77, 0xff, 0x91, 0x14, 0xef, 0xae, + 0x20, 0x49, 0xfc, 0xad, 0x40, 0x15, 0x48, 0xd1, 0x02, 0x31, 0x61, 0x19, + 0x5e, 0xb8, 0x97, 0xef, 0xad, 0x77, 0xb7, 0x64, 0x9a, 0x7a, 0xbf, 0x5f, + 0xc1, 0x13, 0xef, 0x9b, 0x62, 0xfb, 0x0d, 0x6c, 0xe0, 0x54, 0x69, 0x16, + 0xa9, 0x03, 0xda, 0x6e, 0xe9, 0x83, 0x93, 0x71, 0x76, 0xc6, 0x69, 0x85, + 0x82, 0x17, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x42, 0x30, 0x40, 0x30, + 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, + 0x02, 0x01, 0x06, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, + 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, + 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x8f, 0xf0, 0x4b, 0x7f, 0xa8, + 0x2e, 0x45, 0x24, 0xae, 0x4d, 0x50, 0xfa, 0x63, 0x9a, 0x8b, 0xde, 0xe2, + 0xdd, 0x1b, 0xbc, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x4b, + 0x40, 0xdb, 0xc0, 0x50, 0xaa, 0xfe, 0xc8, 0x0c, 0xef, 0xf7, 0x96, 0x54, + 0x45, 0x49, 0xbb, 0x96, 0x00, 0x09, 0x41, 0xac, 0xb3, 0x13, 0x86, 0x86, + 0x28, 0x07, 0x33, 0xca, 0x6b, 0xe6, 0x74, 0xb9, 0xba, 0x00, 0x2d, 0xae, + 0xa4, 0x0a, 0xd3, 0xf5, 0xf1, 0xf1, 0x0f, 0x8a, 0xbf, 0x73, 0x67, 0x4a, + 0x83, 0xc7, 0x44, 0x7b, 0x78, 0xe0, 0xaf, 0x6e, 0x6c, 0x6f, 0x03, 0x29, + 0x8e, 0x33, 0x39, 0x45, 0xc3, 0x8e, 0xe4, 0xb9, 0x57, 0x6c, 0xaa, 0xfc, + 0x12, 0x96, 0xec, 0x53, 0xc6, 0x2d, 0xe4, 0x24, 0x6c, 0xb9, 0x94, 0x63, + 0xfb, 0xdc, 0x53, 0x68, 0x67, 0x56, 0x3e, 0x83, 0xb8, 0xcf, 0x35, 0x21, + 0xc3, 0xc9, 0x68, 0xfe, 0xce, 0xda, 0xc2, 0x53, 0xaa, 0xcc, 0x90, 0x8a, + 0xe9, 0xf0, 0x5d, 0x46, 0x8c, 0x95, 0xdd, 0x7a, 0x58, 0x28, 0x1a, 0x2f, + 0x1d, 0xde, 0xcd, 0x00, 0x37, 0x41, 0x8f, 0xed, 0x44, 0x6d, 0xd7, 0x53, + 0x28, 0x97, 0x7e, 0xf3, 0x67, 0x04, 0x1e, 0x15, 0xd7, 0x8a, 0x96, 0xb4, + 0xd3, 0xde, 0x4c, 0x27, 0xa4, 0x4c, 0x1b, 0x73, 0x73, 0x76, 0xf4, 0x17, + 0x99, 0xc2, 0x1f, 0x7a, 0x0e, 0xe3, 0x2d, 0x08, 0xad, 0x0a, 0x1c, 0x2c, + 0xff, 0x3c, 0xab, 0x55, 0x0e, 0x0f, 0x91, 0x7e, 0x36, 0xeb, 0xc3, 0x57, + 0x49, 0xbe, 0xe1, 0x2e, 0x2d, 0x7c, 0x60, 0x8b, 0xc3, 0x41, 0x51, 0x13, + 0x23, 0x9d, 0xce, 0xf7, 0x32, 0x6b, 0x94, 0x01, 0xa8, 0x99, 0xe7, 0x2c, + 0x33, 0x1f, 0x3a, 0x3b, 0x25, 0xd2, 0x86, 0x40, 0xce, 0x3b, 0x2c, 0x86, + 0x78, 0xc9, 0x61, 0x2f, 0x14, 0xba, 0xee, 0xdb, 0x55, 0x6f, 0xdf, 0x84, + 0xee, 0x05, 0x09, 0x4d, 0xbd, 0x28, 0xd8, 0x72, 0xce, 0xd3, 0x62, 0x50, + 0x65, 0x1e, 0xeb, 0x92, 0x97, 0x83, 0x31, 0xd9, 0xb3, 0xb5, 0xca, 0x47, + 0x58, 0x3f, 0x5f +}; +static unsigned int globalsignrootca_cer_len = 867; + +static unsigned char ECCA_der[] = { + 0x30, 0x82, 0x03, 0x1c, 0x30, 0x82, 0x02, 0x04, 0x02, 0x09, 0x00, 0xd3, 0xd3, 0xb4, 0x9f, 0xb2, + 0x53, 0x04, 0xf7, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x05, 0x00, 0x30, 0x50, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x04, + 0x45, 0x43, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x31, 0x36, 0x30, 0x31, + 0x34, 0x33, 0x32, 0x34, 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x31, 0x35, 0x30, 0x31, 0x34, + 0x33, 0x32, 0x34, 0x5a, 0x30, 0x50, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, + 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, + 0x0c, 0x04, 0x45, 0x43, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, + 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, + 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xe8, 0x58, 0x40, 0x7d, 0x86, 0x95, 0x98, 0x5a, 0xb0, + 0x9a, 0x29, 0x2c, 0xd5, 0x8f, 0xf3, 0xc7, 0x9a, 0x28, 0xee, 0x60, 0xa2, 0x39, 0xae, 0xc8, 0x56, + 0x84, 0xd8, 0x39, 0xbd, 0xa0, 0x68, 0x3a, 0xbf, 0x4b, 0xcf, 0xe7, 0x0a, 0xf9, 0x7f, 0x9d, 0xc5, + 0x7b, 0xf2, 0x91, 0x12, 0x55, 0x3b, 0x38, 0x98, 0x79, 0x94, 0x8e, 0x3c, 0x6c, 0xa1, 0x94, 0xb5, + 0xf9, 0xdf, 0x4c, 0xc6, 0x35, 0x08, 0x00, 0xd4, 0x9a, 0x24, 0xb8, 0xfd, 0xad, 0xf0, 0x63, 0xba, + 0xf9, 0x7d, 0x83, 0xea, 0x44, 0x87, 0x6b, 0x97, 0x1a, 0x03, 0xa4, 0x3e, 0xe7, 0x01, 0x47, 0x77, + 0x7f, 0x0c, 0xc2, 0xb8, 0xb3, 0x0a, 0x6d, 0x12, 0x34, 0x8c, 0xf3, 0xad, 0x69, 0x09, 0x8a, 0xab, + 0xd0, 0xd8, 0x23, 0x68, 0xff, 0x83, 0x8d, 0xea, 0x5d, 0xc5, 0x39, 0x21, 0x71, 0xc0, 0x8a, 0x8b, + 0x08, 0xd7, 0x8b, 0x02, 0xac, 0x15, 0x88, 0x78, 0x63, 0xd6, 0x07, 0x01, 0x9d, 0xb3, 0xb3, 0x55, + 0xd8, 0x5b, 0x92, 0x55, 0x37, 0x6e, 0xc3, 0xbf, 0xd2, 0x30, 0x11, 0xbc, 0xbb, 0x14, 0xca, 0x2b, + 0x15, 0x1a, 0xf8, 0xad, 0x21, 0x58, 0x6b, 0xc8, 0x46, 0xea, 0x25, 0x16, 0x82, 0x2d, 0x52, 0x67, + 0x44, 0xe8, 0x29, 0xab, 0x0e, 0xaf, 0x81, 0xd9, 0x89, 0x8e, 0x65, 0x90, 0x87, 0xda, 0x8b, 0xf0, + 0x0b, 0x6b, 0x18, 0x41, 0xc7, 0x57, 0x47, 0x4e, 0x8d, 0xea, 0xa8, 0xf5, 0x6d, 0xc2, 0x21, 0x86, + 0x3a, 0x57, 0x88, 0xbc, 0x9a, 0xed, 0x35, 0x89, 0x54, 0x2b, 0xf7, 0xf1, 0xd4, 0x65, 0xe5, 0x92, + 0xeb, 0x76, 0x93, 0xff, 0xfd, 0x4d, 0xf6, 0x5f, 0x6e, 0x93, 0xa8, 0x0d, 0x1f, 0x4d, 0x80, 0x6b, + 0x85, 0x6c, 0x0c, 0xc2, 0xaf, 0x1d, 0x8a, 0x06, 0xf7, 0xa6, 0x72, 0x97, 0x81, 0x4b, 0x0a, 0xba, + 0x85, 0x27, 0xcd, 0xf2, 0x35, 0x8b, 0x2d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, + 0x8e, 0xb6, 0x65, 0x1f, 0x77, 0x93, 0x67, 0xf6, 0xce, 0xea, 0x3b, 0x4d, 0x9a, 0x56, 0x54, 0x04, + 0xb3, 0xab, 0x7e, 0x2b, 0xc1, 0xcc, 0x04, 0xd9, 0xd5, 0x53, 0xb5, 0x92, 0xe5, 0xca, 0xc8, 0xa4, + 0x70, 0x23, 0x15, 0x73, 0x5f, 0x8d, 0xda, 0xba, 0x33, 0x2c, 0x4a, 0x8e, 0x5e, 0x01, 0xf1, 0x8e, + 0x24, 0x1d, 0xf3, 0x99, 0x19, 0x8e, 0xd7, 0x1d, 0x3e, 0x98, 0x22, 0x05, 0x4a, 0x31, 0xa1, 0x01, + 0xe6, 0x79, 0x8d, 0x2b, 0x72, 0xdc, 0x5f, 0x89, 0xcb, 0xd8, 0x54, 0x3e, 0x7a, 0x4c, 0x6d, 0x6f, + 0x41, 0x20, 0x9f, 0x3d, 0x31, 0xb2, 0xcf, 0xcc, 0x04, 0x5c, 0x96, 0xa2, 0xa5, 0xcf, 0xf9, 0xcd, + 0xd8, 0x68, 0x43, 0x3a, 0x63, 0x21, 0xef, 0x78, 0x35, 0x57, 0x48, 0xff, 0xb2, 0x6e, 0x49, 0xaf, + 0x2e, 0x72, 0xe4, 0xe6, 0x39, 0x66, 0x8d, 0x65, 0x76, 0xe4, 0xeb, 0xb1, 0xd4, 0xe8, 0x1e, 0x36, + 0x9e, 0xcb, 0xfd, 0x82, 0x44, 0xab, 0x00, 0x47, 0x6e, 0x71, 0x84, 0x8f, 0x2a, 0x45, 0x01, 0xd1, + 0x9f, 0xdd, 0xd0, 0xc6, 0xb8, 0x5d, 0x6a, 0xbd, 0xf9, 0x15, 0x0f, 0xb3, 0xa0, 0xf2, 0x12, 0xb5, + 0xb8, 0x5e, 0x48, 0x39, 0xe2, 0x84, 0xdb, 0x0d, 0xc7, 0xaf, 0x4e, 0x8b, 0x73, 0x6d, 0xe8, 0x54, + 0x26, 0xc7, 0x18, 0x89, 0xcb, 0x3f, 0xcb, 0xae, 0x7a, 0xd5, 0x2e, 0xf0, 0x47, 0xec, 0x4e, 0xe2, + 0x5a, 0x00, 0x5b, 0x1a, 0xac, 0xc3, 0x4e, 0xa1, 0x61, 0xb9, 0xab, 0x8e, 0xd2, 0x68, 0x0d, 0xf1, + 0xc8, 0x3d, 0x3e, 0xac, 0xa8, 0x04, 0xd6, 0x03, 0x0d, 0x40, 0x3a, 0xea, 0x88, 0xfa, 0x14, 0xe5, + 0xf9, 0xec, 0x30, 0x3d, 0xfc, 0x5d, 0xc5, 0x77, 0x8e, 0x28, 0x17, 0xe4, 0x67, 0x49, 0x0d, 0x4e, + 0xf2, 0x7e, 0xdd, 0x11, 0x2e, 0x8e, 0xde, 0xe8, 0x1b, 0x9f, 0x5d, 0x14, 0x20, 0x91, 0x65, 0x4d +}; +static unsigned int ECCA_der_len = 800; + +static unsigned char ECCArsa_der[] = { + 0x30, 0x82, 0x03, 0x1c, 0x30, 0x82, 0x02, 0x04, 0x02, 0x09, 0x00, 0xd3, + 0xd3, 0xb4, 0x9f, 0xb2, 0x53, 0x04, 0xf7, 0x30, 0x0d, 0x06, 0x09, 0x2a, + 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x50, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, + 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, + 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x04, 0x45, 0x43, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, + 0x31, 0x38, 0x30, 0x35, 0x31, 0x36, 0x30, 0x31, 0x34, 0x33, 0x32, 0x34, + 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x31, 0x35, 0x30, 0x31, 0x34, + 0x33, 0x32, 0x34, 0x5a, 0x30, 0x50, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x04, 0x45, 0x43, + 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, + 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, + 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xe8, + 0x58, 0x40, 0x7d, 0x86, 0x95, 0x98, 0x5a, 0xb0, 0x9a, 0x29, 0x2c, 0xd5, + 0x8f, 0xf3, 0xc7, 0x9a, 0x28, 0xee, 0x60, 0xa2, 0x39, 0xae, 0xc8, 0x56, + 0x84, 0xd8, 0x39, 0xbd, 0xa0, 0x68, 0x3a, 0xbf, 0x4b, 0xcf, 0xe7, 0x0a, + 0xf9, 0x7f, 0x9d, 0xc5, 0x7b, 0xf2, 0x91, 0x12, 0x55, 0x3b, 0x38, 0x98, + 0x79, 0x94, 0x8e, 0x3c, 0x6c, 0xa1, 0x94, 0xb5, 0xf9, 0xdf, 0x4c, 0xc6, + 0x35, 0x08, 0x00, 0xd4, 0x9a, 0x24, 0xb8, 0xfd, 0xad, 0xf0, 0x63, 0xba, + 0xf9, 0x7d, 0x83, 0xea, 0x44, 0x87, 0x6b, 0x97, 0x1a, 0x03, 0xa4, 0x3e, + 0xe7, 0x01, 0x47, 0x77, 0x7f, 0x0c, 0xc2, 0xb8, 0xb3, 0x0a, 0x6d, 0x12, + 0x34, 0x8c, 0xf3, 0xad, 0x69, 0x09, 0x8a, 0xab, 0xd0, 0xd8, 0x23, 0x68, + 0xff, 0x83, 0x8d, 0xea, 0x5d, 0xc5, 0x39, 0x21, 0x71, 0xc0, 0x8a, 0x8b, + 0x08, 0xd7, 0x8b, 0x02, 0xac, 0x15, 0x88, 0x78, 0x63, 0xd6, 0x07, 0x01, + 0x9d, 0xb3, 0xb3, 0x55, 0xd8, 0x5b, 0x92, 0x55, 0x37, 0x6e, 0xc3, 0xbf, + 0xd2, 0x30, 0x11, 0xbc, 0xbb, 0x14, 0xca, 0x2b, 0x15, 0x1a, 0xf8, 0xad, + 0x21, 0x58, 0x6b, 0xc8, 0x46, 0xea, 0x25, 0x16, 0x82, 0x2d, 0x52, 0x67, + 0x44, 0xe8, 0x29, 0xab, 0x0e, 0xaf, 0x81, 0xd9, 0x89, 0x8e, 0x65, 0x90, + 0x87, 0xda, 0x8b, 0xf0, 0x0b, 0x6b, 0x18, 0x41, 0xc7, 0x57, 0x47, 0x4e, + 0x8d, 0xea, 0xa8, 0xf5, 0x6d, 0xc2, 0x21, 0x86, 0x3a, 0x57, 0x88, 0xbc, + 0x9a, 0xed, 0x35, 0x89, 0x54, 0x2b, 0xf7, 0xf1, 0xd4, 0x65, 0xe5, 0x92, + 0xeb, 0x76, 0x93, 0xff, 0xfd, 0x4d, 0xf6, 0x5f, 0x6e, 0x93, 0xa8, 0x0d, + 0x1f, 0x4d, 0x80, 0x6b, 0x85, 0x6c, 0x0c, 0xc2, 0xaf, 0x1d, 0x8a, 0x06, + 0xf7, 0xa6, 0x72, 0x97, 0x81, 0x4b, 0x0a, 0xba, 0x85, 0x27, 0xcd, 0xf2, + 0x35, 0x8b, 0x2d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, + 0x82, 0x01, 0x01, 0x00, 0x8e, 0xb6, 0x65, 0x1f, 0x77, 0x93, 0x67, 0xf6, + 0xce, 0xea, 0x3b, 0x4d, 0x9a, 0x56, 0x54, 0x04, 0xb3, 0xab, 0x7e, 0x2b, + 0xc1, 0xcc, 0x04, 0xd9, 0xd5, 0x53, 0xb5, 0x92, 0xe5, 0xca, 0xc8, 0xa4, + 0x70, 0x23, 0x15, 0x73, 0x5f, 0x8d, 0xda, 0xba, 0x33, 0x2c, 0x4a, 0x8e, + 0x5e, 0x01, 0xf1, 0x8e, 0x24, 0x1d, 0xf3, 0x99, 0x19, 0x8e, 0xd7, 0x1d, + 0x3e, 0x98, 0x22, 0x05, 0x4a, 0x31, 0xa1, 0x01, 0xe6, 0x79, 0x8d, 0x2b, + 0x72, 0xdc, 0x5f, 0x89, 0xcb, 0xd8, 0x54, 0x3e, 0x7a, 0x4c, 0x6d, 0x6f, + 0x41, 0x20, 0x9f, 0x3d, 0x31, 0xb2, 0xcf, 0xcc, 0x04, 0x5c, 0x96, 0xa2, + 0xa5, 0xcf, 0xf9, 0xcd, 0xd8, 0x68, 0x43, 0x3a, 0x63, 0x21, 0xef, 0x78, + 0x35, 0x57, 0x48, 0xff, 0xb2, 0x6e, 0x49, 0xaf, 0x2e, 0x72, 0xe4, 0xe6, + 0x39, 0x66, 0x8d, 0x65, 0x76, 0xe4, 0xeb, 0xb1, 0xd4, 0xe8, 0x1e, 0x36, + 0x9e, 0xcb, 0xfd, 0x82, 0x44, 0xab, 0x00, 0x47, 0x6e, 0x71, 0x84, 0x8f, + 0x2a, 0x45, 0x01, 0xd1, 0x9f, 0xdd, 0xd0, 0xc6, 0xb8, 0x5d, 0x6a, 0xbd, + 0xf9, 0x15, 0x0f, 0xb3, 0xa0, 0xf2, 0x12, 0xb5, 0xb8, 0x5e, 0x48, 0x39, + 0xe2, 0x84, 0xdb, 0x0d, 0xc7, 0xaf, 0x4e, 0x8b, 0x73, 0x6d, 0xe8, 0x54, + 0x26, 0xc7, 0x18, 0x89, 0xcb, 0x3f, 0xcb, 0xae, 0x7a, 0xd5, 0x2e, 0xf0, + 0x47, 0xec, 0x4e, 0xe2, 0x5a, 0x00, 0x5b, 0x1a, 0xac, 0xc3, 0x4e, 0xa1, + 0x61, 0xb9, 0xab, 0x8e, 0xd2, 0x68, 0x0d, 0xf1, 0xc8, 0x3d, 0x3e, 0xac, + 0xa8, 0x04, 0xd6, 0x03, 0x0d, 0x40, 0x3a, 0xea, 0x88, 0xfa, 0x14, 0xe5, + 0xf9, 0xec, 0x30, 0x3d, 0xfc, 0x5d, 0xc5, 0x77, 0x8e, 0x28, 0x17, 0xe4, + 0x67, 0x49, 0x0d, 0x4e, 0xf2, 0x7e, 0xdd, 0x11, 0x2e, 0x8e, 0xde, 0xe8, + 0x1b, 0x9f, 0x5d, 0x14, 0x20, 0x91, 0x65, 0x4d +}; +static unsigned int ECCArsa_der_len = 800; + +static unsigned char ECCA2_der[] = { + 0x30, 0x82, 0x01, 0x92, 0x30, 0x82, 0x01, 0x38, 0x02, 0x09, 0x00, 0xa6, + 0x7d, 0x85, 0x34, 0x93, 0x36, 0xd5, 0x3b, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, + 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, + 0x30, 0x35, 0x31, 0x37, 0x30, 0x31, 0x35, 0x30, 0x33, 0x33, 0x5a, 0x17, + 0x0d, 0x32, 0x32, 0x30, 0x35, 0x31, 0x36, 0x30, 0x31, 0x35, 0x30, 0x33, + 0x33, 0x5a, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, + 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, + 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, + 0x03, 0x42, 0x00, 0x04, 0x59, 0x22, 0x43, 0x1a, 0xe7, 0x47, 0xd3, 0x22, + 0x1c, 0x6d, 0x80, 0x9e, 0x37, 0x0b, 0xcb, 0xd6, 0x42, 0xf0, 0x3e, 0xf2, + 0x61, 0xf1, 0x70, 0xd4, 0x40, 0xd7, 0x7e, 0x8c, 0xf3, 0xb2, 0xa6, 0x8b, + 0x70, 0xf9, 0x14, 0x02, 0x65, 0xf1, 0xfc, 0x03, 0x19, 0x1c, 0x0a, 0xf2, + 0xcf, 0x50, 0xd1, 0x38, 0x00, 0x37, 0x96, 0x1a, 0x83, 0xfc, 0x8e, 0xe0, + 0x53, 0x66, 0x03, 0x97, 0x18, 0xc8, 0x5f, 0x5b, 0x30, 0x0a, 0x06, 0x08, + 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, + 0x45, 0x02, 0x20, 0x62, 0xd1, 0x33, 0x99, 0x86, 0x2b, 0x5c, 0x11, 0x0b, + 0x92, 0xf1, 0x41, 0xb5, 0xd1, 0x75, 0x7f, 0x60, 0x08, 0xaa, 0x53, 0x6b, + 0x07, 0xd9, 0x55, 0x88, 0xec, 0xa7, 0x15, 0x50, 0x0c, 0xbd, 0xd4, 0x02, + 0x21, 0x00, 0x96, 0x89, 0xcb, 0x87, 0xf2, 0x16, 0x15, 0x36, 0x37, 0xe0, + 0x3a, 0x78, 0xb9, 0x65, 0x88, 0x87, 0xc0, 0x0a, 0x58, 0x05, 0x33, 0xa7, + 0x8f, 0xe8, 0xa5, 0xb6, 0xea, 0xae, 0x49, 0x73, 0xbd, 0xaf +}; +static unsigned int ECCA2_der_len = 406; +static unsigned char ECCA3_der[] = { + 0x30, 0x82, 0x02, 0x1a, 0x30, 0x82, 0x01, 0x7b, 0x02, 0x09, 0x00, 0xd8, + 0x41, 0xcc, 0x08, 0x88, 0x42, 0xb6, 0x4d, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, + 0x05, 0x45, 0x43, 0x43, 0x41, 0x33, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, + 0x30, 0x35, 0x31, 0x37, 0x30, 0x35, 0x31, 0x34, 0x32, 0x32, 0x5a, 0x17, + 0x0d, 0x32, 0x32, 0x30, 0x35, 0x31, 0x36, 0x30, 0x35, 0x31, 0x34, 0x32, + 0x32, 0x5a, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, + 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, + 0x33, 0x30, 0x81, 0x9b, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x23, 0x03, 0x81, + 0x86, 0x00, 0x04, 0x00, 0x44, 0xe5, 0x49, 0xf6, 0x2f, 0x62, 0x56, 0xa1, + 0x7d, 0x5a, 0x73, 0x44, 0xcd, 0xfd, 0x56, 0xa7, 0xc1, 0x40, 0x09, 0xe2, + 0x5b, 0xec, 0x4c, 0x6d, 0x49, 0x7c, 0xe0, 0x51, 0x97, 0x38, 0xa7, 0xeb, + 0xdb, 0x76, 0xb6, 0x05, 0xf0, 0xae, 0xcf, 0x31, 0x91, 0x1a, 0x9e, 0x0e, + 0x6a, 0x8c, 0x38, 0xed, 0x58, 0x47, 0x1d, 0xef, 0xb8, 0xa8, 0x07, 0xdd, + 0x59, 0x35, 0xce, 0x20, 0x23, 0x8b, 0x49, 0x92, 0xc8, 0x01, 0x88, 0x88, + 0xf8, 0x81, 0x65, 0x27, 0x37, 0x6b, 0x5d, 0x2e, 0x08, 0x25, 0x1e, 0xaf, + 0xf0, 0x24, 0xf9, 0x0b, 0xac, 0x44, 0x7e, 0x71, 0x08, 0x27, 0x76, 0x22, + 0xa2, 0x2e, 0xad, 0xc2, 0xae, 0x5b, 0x67, 0x7c, 0x6e, 0x53, 0x8a, 0x91, + 0x7a, 0x73, 0xd1, 0xbf, 0xab, 0xd9, 0xeb, 0x35, 0x2f, 0xbd, 0x18, 0x09, + 0x14, 0x79, 0x98, 0xdf, 0x5b, 0xe4, 0x89, 0xad, 0x00, 0x18, 0x2e, 0x37, + 0x6a, 0x04, 0xcb, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x04, 0x03, 0x02, 0x03, 0x81, 0x8c, 0x00, 0x30, 0x81, 0x88, 0x02, 0x42, + 0x01, 0x14, 0xbd, 0xdd, 0x5f, 0x00, 0xa2, 0xf8, 0x97, 0x1d, 0x9c, 0xf6, + 0x37, 0x3c, 0x4d, 0xe4, 0xce, 0xf5, 0x32, 0xa6, 0xc2, 0x59, 0x4d, 0x97, + 0x4e, 0x4f, 0x1e, 0xa3, 0x5c, 0xd2, 0xec, 0x81, 0x27, 0x8a, 0x20, 0xb6, + 0xbe, 0x90, 0xf4, 0x3d, 0xb4, 0x84, 0xa7, 0xe6, 0xe6, 0xb6, 0xee, 0xd5, + 0x71, 0x8e, 0x65, 0x60, 0x69, 0x83, 0xae, 0x22, 0x79, 0xa7, 0x8f, 0x9d, + 0x50, 0x2f, 0xc7, 0x4d, 0x73, 0xf5, 0x02, 0x42, 0x01, 0x54, 0x5b, 0xc5, + 0x3f, 0xbb, 0x8e, 0x25, 0x9d, 0x00, 0xa6, 0xb5, 0xfb, 0xec, 0x51, 0xed, + 0xe8, 0xf2, 0x26, 0xed, 0x66, 0x5e, 0xf6, 0x12, 0x3e, 0x85, 0x61, 0xec, + 0xa8, 0xdc, 0xe6, 0xe7, 0x2b, 0xf8, 0xd0, 0x87, 0x02, 0x70, 0x0d, 0xbd, + 0xe2, 0x65, 0x6f, 0xbd, 0xaf, 0xd5, 0x7b, 0x07, 0x87, 0x89, 0x9b, 0x18, + 0xbe, 0x55, 0x4f, 0x51, 0x47, 0xb9, 0x34, 0xa7, 0x24, 0x62, 0xa6, 0x76, + 0x52, 0x46 +}; +static unsigned int ECCA3_der_len = 542; + +static unsigned char ECCA4_der[] = { + 0x30, 0x82, 0x01, 0xcf, 0x30, 0x82, 0x01, 0x55, 0x02, 0x09, 0x00, 0xbc, 0x64, 0xd9, 0xfe, 0x6a, + 0x91, 0x0e, 0xc2, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, + 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, + 0x41, 0x34, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x31, 0x37, 0x30, 0x37, 0x31, 0x36, + 0x30, 0x38, 0x5a, 0x17, 0x0d, 0x32, 0x32, 0x30, 0x35, 0x31, 0x36, 0x30, 0x37, 0x31, 0x36, 0x30, + 0x38, 0x5a, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, + 0x45, 0x43, 0x43, 0x41, 0x34, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xcc, 0xb0, 0x3b, + 0xbf, 0x34, 0x54, 0x31, 0xdb, 0xf4, 0x13, 0xb6, 0x1f, 0x75, 0xfc, 0xc6, 0x6f, 0x25, 0x43, 0xc7, + 0xe1, 0x99, 0xb1, 0xdf, 0xc9, 0x2c, 0xa3, 0x14, 0x60, 0x95, 0x55, 0xdc, 0xbc, 0x6f, 0x87, 0x99, + 0xdb, 0xbb, 0xc8, 0x24, 0xfe, 0x3b, 0x34, 0x23, 0xfa, 0x79, 0x6b, 0xe1, 0xa8, 0x23, 0xbf, 0x23, + 0x72, 0x99, 0xd3, 0x86, 0x65, 0xa6, 0xa6, 0xa9, 0x10, 0xae, 0x20, 0x96, 0x87, 0x26, 0xca, 0x2e, + 0x5d, 0x07, 0x6e, 0xa8, 0xb6, 0xbc, 0xef, 0x85, 0x47, 0x71, 0x59, 0x9b, 0x16, 0x0d, 0x6d, 0xa5, + 0xa5, 0x3a, 0xc9, 0x65, 0xcb, 0x34, 0xdf, 0xf3, 0xc6, 0x90, 0x1e, 0xd7, 0x88, 0x30, 0x0a, 0x06, + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, + 0x00, 0xa0, 0xd0, 0x8e, 0x29, 0xfd, 0x8e, 0xca, 0x10, 0x9f, 0x01, 0xbc, 0xf4, 0x92, 0xfd, 0x7f, + 0xbb, 0x9d, 0x76, 0x6c, 0x8e, 0x48, 0x60, 0xf0, 0x57, 0x22, 0x00, 0x99, 0x57, 0x79, 0xe1, 0x13, + 0xee, 0x80, 0x63, 0x57, 0x79, 0x3d, 0x53, 0x23, 0xcb, 0x11, 0x47, 0x7e, 0x94, 0x78, 0x0a, 0xb8, + 0xed, 0x02, 0x30, 0x6e, 0x24, 0x1c, 0x78, 0xfe, 0xfb, 0x3e, 0x4e, 0x38, 0x36, 0xba, 0xed, 0x42, + 0xc8, 0xa9, 0xa1, 0xc0, 0x51, 0x36, 0x4b, 0x5f, 0x1e, 0x95, 0x59, 0x26, 0x8f, 0x42, 0x92, 0x03, + 0x59, 0x74, 0x93, 0x93, 0x4e, 0x37, 0xd5, 0xaf, 0x71, 0xd0, 0x96, 0x3f, 0x09, 0x03, 0xcc, 0x5b, + 0x82, 0x3e, 0x65 +}; +static unsigned int ECCA4_der_len = 467; + +static unsigned char ECTest_der[] = { + 0x30, 0x82, 0x02, 0x53, 0x30, 0x82, 0x01, 0x3b, 0x02, 0x09, 0x00, 0xdb, 0x47, 0xac, 0x3c, 0x3e, + 0x02, 0x58, 0x42, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x05, 0x00, 0x30, 0x50, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x04, + 0x45, 0x43, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x31, 0x36, 0x30, 0x35, + 0x32, 0x31, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x31, 0x35, 0x30, 0x35, 0x32, + 0x31, 0x34, 0x33, 0x5a, 0x30, 0x52, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, + 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, + 0x0c, 0x06, 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, + 0x42, 0x00, 0x04, 0x4d, 0xce, 0x22, 0x02, 0x29, 0x1f, 0xf0, 0xbf, 0x3a, 0xe5, 0x71, 0x42, 0x62, + 0xa5, 0x09, 0x0c, 0x92, 0xf6, 0x82, 0x4b, 0x98, 0xb0, 0x63, 0xd0, 0xca, 0x06, 0x72, 0xe8, 0xc7, + 0x65, 0xb6, 0xc1, 0x53, 0x80, 0x0e, 0xef, 0x17, 0x2e, 0x6b, 0x66, 0x47, 0x30, 0xd9, 0xc1, 0x56, + 0x6e, 0x82, 0xa5, 0x6f, 0x29, 0xb0, 0xf7, 0x8d, 0xe0, 0xfe, 0xe3, 0xc9, 0x2c, 0x36, 0x6e, 0x53, + 0x98, 0x98, 0x39, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0xb7, 0xfa, 0xd8, 0xd7, 0x38, 0x3c, 0xbf, 0x08, 0xd6, + 0x02, 0x6f, 0x84, 0x7f, 0xfb, 0xd1, 0xac, 0x33, 0x23, 0xa7, 0x27, 0x01, 0x76, 0x99, 0x90, 0xa0, + 0xd2, 0xac, 0x3a, 0x56, 0xf2, 0x4c, 0x90, 0xbd, 0x84, 0x66, 0x30, 0x4c, 0x9e, 0x07, 0x3d, 0xf4, + 0xe7, 0x43, 0x0d, 0x40, 0x92, 0x9f, 0x93, 0x89, 0xf0, 0xd3, 0xf2, 0x3e, 0x44, 0xee, 0xe9, 0x37, + 0x16, 0xbe, 0xd4, 0x5f, 0xe5, 0x9c, 0xf3, 0x71, 0x69, 0xf4, 0x93, 0xd7, 0x5a, 0xeb, 0xd6, 0x1c, + 0xae, 0xe8, 0xca, 0x32, 0x0c, 0xa3, 0x60, 0x29, 0x93, 0x4d, 0xf9, 0x20, 0xbf, 0x09, 0xf8, 0x50, + 0xb2, 0x5d, 0x4f, 0xf4, 0xe9, 0x19, 0xef, 0xf7, 0x52, 0xa9, 0x84, 0xcf, 0x9a, 0x8e, 0x92, 0xeb, + 0x38, 0x10, 0xc0, 0xe0, 0x8d, 0x3c, 0x18, 0xf3, 0x86, 0x0c, 0x9a, 0x8e, 0x8d, 0xc5, 0xb2, 0x93, + 0xc8, 0xa5, 0xf2, 0x3a, 0x55, 0xcf, 0xbe, 0x91, 0x96, 0xce, 0xa3, 0xa3, 0xcb, 0xcb, 0x76, 0xaf, + 0x31, 0xfa, 0x1c, 0x86, 0xa5, 0x19, 0xd2, 0x9a, 0xc0, 0x0e, 0xa2, 0x0f, 0xdd, 0x39, 0xd9, 0x5d, + 0xd6, 0xce, 0x8c, 0x9b, 0xc3, 0x6e, 0xa7, 0x98, 0xbb, 0xb2, 0xe6, 0x98, 0x05, 0x2d, 0x7c, 0x28, + 0xa4, 0xb6, 0x69, 0x2c, 0xe2, 0x0c, 0xa7, 0x26, 0x91, 0x35, 0x01, 0x3d, 0xd0, 0x2f, 0xa0, 0x03, + 0x87, 0xc9, 0x44, 0xcf, 0x19, 0x43, 0xd8, 0x6c, 0x61, 0xc8, 0xdd, 0x18, 0x51, 0xcd, 0x30, 0xd0, + 0xf0, 0x09, 0xb0, 0x96, 0xf4, 0xde, 0x78, 0x4b, 0xd9, 0xbe, 0x8b, 0x5a, 0xb7, 0xe6, 0x66, 0x73, + 0xe9, 0xac, 0x2b, 0xd3, 0x3b, 0x51, 0x2b, 0xbe, 0x1e, 0x58, 0x15, 0x4d, 0x35, 0x79, 0x56, 0x7a, + 0x5a, 0x79, 0x9a, 0x67, 0x60, 0x0c, 0x3c, 0xee, 0x9d, 0x67, 0x5d, 0x85, 0x2c, 0x1b, 0xe6, 0xc4, + 0xaa, 0xec, 0x77, 0x5f, 0x76, 0x9e, 0xc3 +}; +static unsigned int ECTest_der_len = 599; + +static unsigned char ECTest_key_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x5d, 0x2a, 0x16, 0xfd, 0x8c, 0x78, 0x09, 0x73, 0x5c, + 0x02, 0x0f, 0xae, 0xcb, 0x25, 0xbb, 0x73, 0xe5, 0x3b, 0x21, 0x4b, 0x33, 0x81, 0xc3, 0x71, 0xa0, + 0x62, 0xa8, 0x97, 0x12, 0xcb, 0x25, 0x0d, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x4d, 0xce, 0x22, 0x02, 0x29, 0x1f, 0xf0, + 0xbf, 0x3a, 0xe5, 0x71, 0x42, 0x62, 0xa5, 0x09, 0x0c, 0x92, 0xf6, 0x82, 0x4b, 0x98, 0xb0, 0x63, + 0xd0, 0xca, 0x06, 0x72, 0xe8, 0xc7, 0x65, 0xb6, 0xc1, 0x53, 0x80, 0x0e, 0xef, 0x17, 0x2e, 0x6b, + 0x66, 0x47, 0x30, 0xd9, 0xc1, 0x56, 0x6e, 0x82, 0xa5, 0x6f, 0x29, 0xb0, 0xf7, 0x8d, 0xe0, 0xfe, + 0xe3, 0xc9, 0x2c, 0x36, 0x6e, 0x53, 0x98, 0x98, 0x39 +}; +static unsigned int ECTest_key_der_len = 121; + +static unsigned char ECTestServer2_der[] = { + 0x30, 0x82, 0x02, 0x53, 0x30, 0x82, 0x01, 0xf8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x31, 0x37, 0x30, 0x31, 0x35, 0x34, 0x31, 0x38, 0x5a, + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x35, 0x31, 0x37, 0x30, 0x31, 0x35, 0x34, 0x31, 0x38, 0x5a, 0x30, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, + 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x32, 0x30, 0x59, 0x30, + 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x46, 0x5f, 0xdc, 0x06, 0xe4, 0x83, 0x8f, 0x2a, + 0x24, 0x4d, 0xef, 0xfb, 0x81, 0xd4, 0xc7, 0x87, 0xb4, 0x6f, 0x34, 0x98, 0xfe, 0xce, 0x0d, 0x9e, + 0x83, 0xed, 0x0f, 0x15, 0x5b, 0x7e, 0x73, 0x65, 0x23, 0x94, 0xe9, 0xd7, 0xb5, 0x05, 0x17, 0x93, + 0x02, 0x50, 0x0f, 0xd0, 0xba, 0x93, 0xae, 0x45, 0x28, 0x72, 0xfa, 0x88, 0x50, 0x74, 0xbd, 0xb1, + 0xd2, 0xee, 0x47, 0x26, 0xe8, 0xba, 0x2c, 0x21, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x6b, + 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, 0xa4, 0x53, 0x30, 0x51, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, + 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, + 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, + 0x82, 0x09, 0x00, 0xa6, 0x7d, 0x85, 0x34, 0x93, 0x36, 0xd5, 0x3b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, + 0x02, 0x03, 0xf8, 0x30, 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00, 0x30, + 0x46, 0x02, 0x21, 0x00, 0xf8, 0xed, 0x34, 0x8e, 0xe7, 0xa5, 0x20, 0xbf, 0x2b, 0x15, 0x97, 0x02, + 0x16, 0x98, 0x8b, 0x0f, 0x2a, 0xf6, 0xee, 0x5c, 0xe9, 0xf7, 0x64, 0x91, 0xed, 0x59, 0x7e, 0x5f, + 0x51, 0xa1, 0xcf, 0xf3, 0x02, 0x21, 0x00, 0xa1, 0x07, 0xcb, 0xe1, 0x86, 0x6a, 0x01, 0xeb, 0x39, + 0x48, 0xe0, 0x55, 0xed, 0x09, 0xbb, 0x74, 0x8f, 0xd4, 0x59, 0x3c, 0x71, 0xcc, 0xa7, 0x01, 0x77, + 0x72, 0x84, 0x7d, 0xa7, 0xf6, 0x0e, 0x64 +}; +static unsigned int ECTestServer2_der_len = 599; + +static unsigned char ECTestServer2_key_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x59, 0x8b, 0x2c, 0xa8, 0xef, 0xe7, 0x61, 0x2d, 0x17, + 0x0c, 0x8d, 0x92, 0xa4, 0xae, 0x07, 0x46, 0xa1, 0x91, 0x9c, 0xf4, 0x43, 0xed, 0xb9, 0xf2, 0xdf, + 0xb7, 0xe2, 0x0c, 0xa8, 0x76, 0x25, 0x28, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x46, 0x5f, 0xdc, 0x06, 0xe4, 0x83, 0x8f, + 0x2a, 0x24, 0x4d, 0xef, 0xfb, 0x81, 0xd4, 0xc7, 0x87, 0xb4, 0x6f, 0x34, 0x98, 0xfe, 0xce, 0x0d, + 0x9e, 0x83, 0xed, 0x0f, 0x15, 0x5b, 0x7e, 0x73, 0x65, 0x23, 0x94, 0xe9, 0xd7, 0xb5, 0x05, 0x17, + 0x93, 0x02, 0x50, 0x0f, 0xd0, 0xba, 0x93, 0xae, 0x45, 0x28, 0x72, 0xfa, 0x88, 0x50, 0x74, 0xbd, + 0xb1, 0xd2, 0xee, 0x47, 0x26, 0xe8, 0xba, 0x2c, 0x21 +}; +static unsigned int ECTestServer2_key_der_len = 121; + +static unsigned char ECTestServer3_der[] = { + 0x30, 0x82, 0x02, 0xda, 0x30, 0x82, 0x02, 0x3b, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x02, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x33, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x31, 0x37, 0x30, 0x35, 0x31, 0x35, 0x32, 0x34, 0x5a, + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x35, 0x31, 0x37, 0x30, 0x35, 0x31, 0x35, 0x32, 0x34, 0x5a, 0x30, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, + 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x33, 0x30, 0x81, 0x9b, + 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, + 0x00, 0x23, 0x03, 0x81, 0x86, 0x00, 0x04, 0x00, 0x30, 0xa5, 0x94, 0x4f, 0x3e, 0xd1, 0x8d, 0xcf, + 0xc4, 0xd7, 0x54, 0xfb, 0x62, 0xaa, 0x10, 0x11, 0x95, 0x20, 0x8b, 0x71, 0x6c, 0xa0, 0x88, 0x68, + 0x47, 0xc1, 0xf4, 0x0c, 0x41, 0x1c, 0x21, 0x6c, 0x0c, 0xc4, 0x0c, 0x1b, 0x91, 0x6d, 0x95, 0xad, + 0x84, 0x1a, 0xc3, 0x1c, 0xfb, 0xf3, 0xa3, 0x6a, 0xb9, 0x13, 0xe0, 0x23, 0x8f, 0x42, 0x0f, 0x1c, + 0x75, 0xda, 0x4d, 0xd8, 0xb0, 0x49, 0xaa, 0x1c, 0x75, 0x00, 0xa7, 0xa4, 0x69, 0xdc, 0xa8, 0x63, + 0x41, 0x85, 0x80, 0x51, 0xcb, 0x2b, 0xc2, 0x29, 0xe3, 0xf9, 0x36, 0x27, 0x93, 0xd8, 0x0a, 0x31, + 0xfc, 0x4d, 0x0e, 0xab, 0x42, 0x64, 0xa5, 0x0f, 0xf5, 0x38, 0x7b, 0x39, 0x9c, 0x99, 0x33, 0xec, + 0xcb, 0x12, 0x90, 0x5d, 0x92, 0x49, 0x9a, 0x06, 0xff, 0xd7, 0x7c, 0x80, 0xd9, 0xf9, 0x18, 0x0a, + 0x62, 0x97, 0x3e, 0x0f, 0x45, 0x63, 0xd9, 0x73, 0x4c, 0xef, 0xf2, 0xa3, 0x81, 0xc5, 0x30, 0x81, + 0xc2, 0x30, 0x6b, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, 0xa4, 0x53, + 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, + 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, + 0x43, 0x41, 0x33, 0x82, 0x09, 0x00, 0xd8, 0x41, 0xcc, 0x08, 0x88, 0x42, 0xb6, 0x4d, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, + 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, 0x30, 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, + 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, + 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, + 0x07, 0x03, 0x08, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, + 0x81, 0x8c, 0x00, 0x30, 0x81, 0x88, 0x02, 0x42, 0x00, 0xdf, 0xad, 0x0f, 0xcb, 0x3d, 0xc6, 0xa3, + 0xeb, 0x5b, 0x66, 0xbc, 0x22, 0x96, 0xde, 0x5d, 0xa4, 0x3e, 0x24, 0x0e, 0x3f, 0x15, 0x78, 0x81, + 0x60, 0x78, 0x20, 0x32, 0x56, 0xef, 0x25, 0x36, 0xbe, 0x16, 0x7d, 0x51, 0x2f, 0xe6, 0xef, 0x25, + 0x39, 0x72, 0x25, 0x65, 0xa7, 0xaf, 0x7c, 0xf0, 0xbb, 0xf2, 0x06, 0xe3, 0x61, 0x6e, 0x45, 0x5e, + 0x62, 0x41, 0xa5, 0x3e, 0xe1, 0xb4, 0xfd, 0x44, 0x72, 0x5a, 0x02, 0x42, 0x01, 0x5d, 0xfb, 0xf8, + 0xc2, 0x0e, 0x23, 0x72, 0xd8, 0x13, 0x6e, 0xe2, 0x32, 0x96, 0x33, 0x02, 0x22, 0x5d, 0x5d, 0x0e, + 0x76, 0x79, 0x7b, 0xa6, 0x68, 0xe0, 0xe5, 0x1e, 0xb2, 0xd0, 0xd6, 0x4a, 0x14, 0x90, 0x80, 0x4b, + 0x20, 0x16, 0xc1, 0xc3, 0x3d, 0xda, 0x28, 0xe9, 0x52, 0xe6, 0x3f, 0x18, 0x90, 0xb8, 0x82, 0x48, + 0x44, 0x12, 0x99, 0x9d, 0x35, 0x59, 0x37, 0x81, 0x89, 0xae, 0x89, 0xc4, 0x13, 0x9d +}; +static unsigned int ECTestServer3_der_len = 734; + +static unsigned char ECTestServer3_key_der[] = { + 0x30, 0x81, 0xdc, 0x02, 0x01, 0x01, 0x04, 0x42, 0x00, 0xec, 0x45, 0xa8, 0x92, 0xdd, 0xc4, 0x57, + 0x04, 0xba, 0x3d, 0x24, 0xff, 0xc1, 0x81, 0x6f, 0x65, 0x2c, 0xd3, 0xfd, 0x78, 0x19, 0x8c, 0x40, + 0x33, 0x13, 0x8e, 0x43, 0x84, 0x8b, 0x3d, 0xad, 0x50, 0xbd, 0x3f, 0x44, 0xe8, 0xff, 0x65, 0x40, + 0x82, 0x3b, 0xd1, 0xa2, 0xe1, 0x80, 0x0f, 0xf8, 0x04, 0xd4, 0x19, 0x33, 0xf4, 0xd6, 0x16, 0xd2, + 0x5f, 0x95, 0x9a, 0x0e, 0x72, 0xed, 0x74, 0xfe, 0xe7, 0x27, 0xa0, 0x07, 0x06, 0x05, 0x2b, 0x81, + 0x04, 0x00, 0x23, 0xa1, 0x81, 0x89, 0x03, 0x81, 0x86, 0x00, 0x04, 0x00, 0x30, 0xa5, 0x94, 0x4f, + 0x3e, 0xd1, 0x8d, 0xcf, 0xc4, 0xd7, 0x54, 0xfb, 0x62, 0xaa, 0x10, 0x11, 0x95, 0x20, 0x8b, 0x71, + 0x6c, 0xa0, 0x88, 0x68, 0x47, 0xc1, 0xf4, 0x0c, 0x41, 0x1c, 0x21, 0x6c, 0x0c, 0xc4, 0x0c, 0x1b, + 0x91, 0x6d, 0x95, 0xad, 0x84, 0x1a, 0xc3, 0x1c, 0xfb, 0xf3, 0xa3, 0x6a, 0xb9, 0x13, 0xe0, 0x23, + 0x8f, 0x42, 0x0f, 0x1c, 0x75, 0xda, 0x4d, 0xd8, 0xb0, 0x49, 0xaa, 0x1c, 0x75, 0x00, 0xa7, 0xa4, + 0x69, 0xdc, 0xa8, 0x63, 0x41, 0x85, 0x80, 0x51, 0xcb, 0x2b, 0xc2, 0x29, 0xe3, 0xf9, 0x36, 0x27, + 0x93, 0xd8, 0x0a, 0x31, 0xfc, 0x4d, 0x0e, 0xab, 0x42, 0x64, 0xa5, 0x0f, 0xf5, 0x38, 0x7b, 0x39, + 0x9c, 0x99, 0x33, 0xec, 0xcb, 0x12, 0x90, 0x5d, 0x92, 0x49, 0x9a, 0x06, 0xff, 0xd7, 0x7c, 0x80, + 0xd9, 0xf9, 0x18, 0x0a, 0x62, 0x97, 0x3e, 0x0f, 0x45, 0x63, 0xd9, 0x73, 0x4c, 0xef, 0xf2 +}; +static unsigned int ECTestServer3_key_der_len = 223; + +static unsigned char ECTestServer4_key_der[] = { + 0x30, 0x81, 0xa4, 0x02, 0x01, 0x01, 0x04, 0x30, 0x12, 0x17, 0x7e, 0xf0, + 0xe5, 0x83, 0xa8, 0xb9, 0x2a, 0xf8, 0xba, 0xc9, 0x6e, 0x41, 0x93, 0xb6, + 0x11, 0x0a, 0xb2, 0x7c, 0xf6, 0xfa, 0x9c, 0x9d, 0x8b, 0x53, 0x3a, 0x79, + 0x30, 0xcd, 0x92, 0xf2, 0x77, 0xdf, 0xdc, 0x24, 0x79, 0x1f, 0x3c, 0x47, + 0xd1, 0xf9, 0x74, 0x2c, 0xff, 0x91, 0x03, 0xa2, 0xa0, 0x07, 0x06, 0x05, + 0x2b, 0x81, 0x04, 0x00, 0x22, 0xa1, 0x64, 0x03, 0x62, 0x00, 0x04, 0xcf, + 0xd9, 0x16, 0x42, 0x8e, 0xb5, 0x0a, 0xcb, 0xfe, 0x41, 0x07, 0xc9, 0x1f, + 0xe3, 0x87, 0x02, 0xdb, 0x23, 0xc2, 0xde, 0xfa, 0x45, 0x7e, 0x65, 0x0b, + 0x1c, 0xf7, 0xc5, 0xc0, 0xbd, 0xad, 0x39, 0x2e, 0x3c, 0x30, 0x0e, 0xad, + 0xb8, 0xc4, 0x9e, 0xa3, 0x8f, 0x90, 0xee, 0xe7, 0x3d, 0xc6, 0x1f, 0x2d, + 0xff, 0x48, 0xfc, 0xe6, 0x7c, 0x72, 0x35, 0xcc, 0xc9, 0xaf, 0x69, 0xee, + 0xc6, 0x0f, 0xc2, 0xcf, 0x7c, 0x1f, 0x61, 0xd8, 0xb4, 0x94, 0xa9, 0x70, + 0x52, 0xd5, 0x6a, 0x38, 0x1c, 0x86, 0x01, 0x72, 0x1e, 0x8d, 0xa5, 0x67, + 0xfb, 0xff, 0xb2, 0xf1, 0xeb, 0xfc, 0x2a, 0x3f, 0xd0, 0x12, 0x78 +}; +static unsigned int ECTestServer4_key_der_len = 167; + +static unsigned char ECTestServer4_der[] = { + 0x30, 0x82, 0x02, 0x8e, 0x30, 0x82, 0x02, 0x15, 0xa0, 0x03, 0x02, 0x01, + 0x02, 0x02, 0x01, 0x03, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, + 0x43, 0x41, 0x34, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x31, + 0x37, 0x30, 0x37, 0x31, 0x37, 0x30, 0x33, 0x5a, 0x17, 0x0d, 0x31, 0x39, + 0x30, 0x35, 0x31, 0x37, 0x30, 0x37, 0x31, 0x37, 0x30, 0x33, 0x5a, 0x30, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, + 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, + 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x0d, 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x34, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, + 0x22, 0x03, 0x62, 0x00, 0x04, 0xcf, 0xd9, 0x16, 0x42, 0x8e, 0xb5, 0x0a, + 0xcb, 0xfe, 0x41, 0x07, 0xc9, 0x1f, 0xe3, 0x87, 0x02, 0xdb, 0x23, 0xc2, + 0xde, 0xfa, 0x45, 0x7e, 0x65, 0x0b, 0x1c, 0xf7, 0xc5, 0xc0, 0xbd, 0xad, + 0x39, 0x2e, 0x3c, 0x30, 0x0e, 0xad, 0xb8, 0xc4, 0x9e, 0xa3, 0x8f, 0x90, + 0xee, 0xe7, 0x3d, 0xc6, 0x1f, 0x2d, 0xff, 0x48, 0xfc, 0xe6, 0x7c, 0x72, + 0x35, 0xcc, 0xc9, 0xaf, 0x69, 0xee, 0xc6, 0x0f, 0xc2, 0xcf, 0x7c, 0x1f, + 0x61, 0xd8, 0xb4, 0x94, 0xa9, 0x70, 0x52, 0xd5, 0x6a, 0x38, 0x1c, 0x86, + 0x01, 0x72, 0x1e, 0x8d, 0xa5, 0x67, 0xfb, 0xff, 0xb2, 0xf1, 0xeb, 0xfc, + 0x2a, 0x3f, 0xd0, 0x12, 0x78, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, + 0x6b, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, + 0xa4, 0x53, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, + 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, + 0x34, 0x82, 0x09, 0x00, 0xbc, 0x64, 0xd9, 0xfe, 0x6a, 0x91, 0x0e, 0xc2, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, + 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, + 0x30, 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, + 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, + 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x08, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, + 0x02, 0x03, 0x67, 0x00, 0x30, 0x64, 0x02, 0x30, 0x2f, 0xad, 0x80, 0x53, + 0xef, 0x83, 0x71, 0x0e, 0xd0, 0xd8, 0x2a, 0x96, 0xb9, 0x37, 0xe8, 0x06, + 0xb2, 0x49, 0x29, 0xf2, 0xfd, 0x58, 0xe3, 0x1f, 0x00, 0x66, 0x62, 0x4f, + 0x97, 0x8f, 0x44, 0xb7, 0x10, 0x1f, 0x70, 0x88, 0xa8, 0x44, 0x86, 0x89, + 0x9d, 0x21, 0xe4, 0x72, 0x6c, 0x6f, 0xd0, 0x92, 0x02, 0x30, 0x06, 0x53, + 0x65, 0xa6, 0x04, 0xfd, 0x20, 0x2f, 0x5b, 0x4d, 0x95, 0x14, 0xa4, 0xfa, + 0x97, 0xb9, 0xcf, 0x80, 0xab, 0x6a, 0xa5, 0x7a, 0x7b, 0x7a, 0xc5, 0xc3, + 0x98, 0x1e, 0x5f, 0xfc, 0x49, 0x23, 0xf7, 0x3d, 0xf5, 0x38, 0x55, 0x25, + 0xdb, 0x6d, 0x1d, 0x62, 0x36, 0xd2, 0xfa, 0x47, 0x0d, 0xc2 +}; +static unsigned int ECTestServer4_der_len = 658; + +static unsigned char ECTestServer6_der[] = { + 0x30, 0x82, 0x03, 0x3d, 0x30, 0x82, 0x02, 0xc3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x05, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x34, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x32, 0x34, 0x30, 0x31, 0x33, 0x30, 0x31, 0x34, 0x5a, + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x35, 0x32, 0x34, 0x30, 0x31, 0x33, 0x30, 0x31, 0x34, 0x5a, 0x30, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, + 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x36, 0x30, 0x82, 0x01, + 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, + 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbb, 0xbc, + 0x6a, 0xbc, 0x7c, 0x20, 0x77, 0x47, 0x9a, 0x34, 0x9b, 0x0c, 0x06, 0xc5, 0xc4, 0x40, 0xd8, 0x4b, + 0x21, 0x89, 0x63, 0x11, 0xa5, 0x69, 0xe6, 0x43, 0x85, 0xe9, 0xfd, 0x57, 0x4a, 0x20, 0xfc, 0x45, + 0x51, 0x2a, 0x72, 0xf0, 0x03, 0x6e, 0x09, 0x23, 0x23, 0xae, 0x70, 0x3e, 0xdf, 0xf0, 0x83, 0x45, + 0x47, 0xe6, 0x47, 0x5f, 0x15, 0x6a, 0xc4, 0xa2, 0x30, 0xaa, 0x1c, 0xbe, 0xf8, 0x6e, 0x24, 0xa9, + 0x39, 0x03, 0x40, 0x5d, 0x32, 0x6a, 0xa3, 0x8f, 0x09, 0x31, 0x73, 0x9f, 0x11, 0xb1, 0x94, 0x2d, + 0x8f, 0xee, 0x21, 0x6e, 0x5b, 0xee, 0x03, 0xa8, 0xa6, 0x31, 0x09, 0x5e, 0x9b, 0x45, 0x1b, 0x6b, + 0x19, 0x7e, 0x7c, 0xef, 0x8a, 0x9e, 0x04, 0xa1, 0xcb, 0x01, 0x28, 0x12, 0x47, 0x84, 0x3e, 0x8a, + 0x4c, 0xeb, 0x62, 0xcc, 0xcc, 0x2a, 0xf0, 0x2c, 0x1c, 0x03, 0x82, 0x17, 0x91, 0x39, 0xfa, 0xa9, + 0xc9, 0x28, 0x4d, 0x78, 0xc3, 0x48, 0x94, 0x6d, 0xfb, 0x25, 0x4b, 0x72, 0xd8, 0x21, 0x37, 0x64, + 0x26, 0x31, 0x01, 0xfc, 0x4c, 0xfe, 0x00, 0x83, 0xee, 0x8b, 0x57, 0x90, 0x53, 0x0d, 0x0c, 0x6f, + 0x82, 0x30, 0xf1, 0x0b, 0xea, 0x4e, 0x5f, 0x9a, 0x47, 0x70, 0x02, 0x37, 0xa2, 0xef, 0xc4, 0xf9, + 0x4c, 0x00, 0xaa, 0x80, 0x6f, 0x42, 0xc8, 0x45, 0x2a, 0x38, 0xcb, 0x90, 0x43, 0xd1, 0x79, 0x5e, + 0x34, 0xe6, 0x9a, 0xdc, 0x75, 0x3c, 0x68, 0x9e, 0x39, 0x37, 0x56, 0xf1, 0x67, 0xea, 0x41, 0x17, + 0x4c, 0xfa, 0x2a, 0xdc, 0xef, 0xff, 0x3a, 0xa1, 0xc7, 0xf2, 0x46, 0xa6, 0xe3, 0xd4, 0x24, 0x81, + 0x5f, 0x5a, 0x56, 0x13, 0xcf, 0xa0, 0xf8, 0x3b, 0xee, 0x30, 0x13, 0x4b, 0x17, 0x47, 0x9a, 0xaa, + 0x31, 0x4f, 0x1a, 0x74, 0xe5, 0xbf, 0xd0, 0x7f, 0xd1, 0xd0, 0x10, 0xa2, 0x4d, 0x81, 0x02, 0x03, + 0x01, 0x00, 0x01, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x6b, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, 0xa4, 0x53, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, + 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, + 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x34, 0x82, 0x09, 0x00, 0xbc, 0x64, + 0xd9, 0xfe, 0x6a, 0x91, 0x0e, 0xc2, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, + 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, 0x30, 0x3b, + 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, + 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, 0x00, 0x9a, + 0x02, 0xc1, 0x30, 0x87, 0xe9, 0x86, 0xc7, 0x24, 0x7f, 0xd9, 0xe4, 0x5b, 0x04, 0xe7, 0xa3, 0xbf, + 0xdc, 0x0d, 0xa8, 0x83, 0x03, 0x9d, 0xdf, 0x11, 0xce, 0x29, 0xeb, 0xed, 0xe0, 0x80, 0x67, 0xe7, + 0x72, 0x5c, 0xf5, 0xaf, 0xaa, 0x74, 0x68, 0x11, 0x65, 0xea, 0xe3, 0xcc, 0xeb, 0x11, 0xbd, 0x02, + 0x30, 0x32, 0xc6, 0x2d, 0x07, 0x22, 0x55, 0xb6, 0xe2, 0x4c, 0x48, 0x7f, 0x8e, 0x88, 0xd6, 0x9a, + 0xe9, 0xe6, 0x5a, 0x71, 0xed, 0xdd, 0xdd, 0x9d, 0x4b, 0xf1, 0x8a, 0x51, 0x19, 0xa0, 0x9d, 0xaf, + 0x61, 0xc6, 0x13, 0x0e, 0xd0, 0xc6, 0x7d, 0x62, 0xa9, 0xc8, 0xd0, 0x2b, 0x37, 0x8d, 0xd4, 0x95, + 0xd0 +}; +static unsigned int ECTestServer6_der_len = 833; + +static unsigned char ECTestServer6_key_der[] = { + 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbb, 0xbc, 0x6a, 0xbc, + 0x7c, 0x20, 0x77, 0x47, 0x9a, 0x34, 0x9b, 0x0c, 0x06, 0xc5, 0xc4, 0x40, 0xd8, 0x4b, 0x21, 0x89, + 0x63, 0x11, 0xa5, 0x69, 0xe6, 0x43, 0x85, 0xe9, 0xfd, 0x57, 0x4a, 0x20, 0xfc, 0x45, 0x51, 0x2a, + 0x72, 0xf0, 0x03, 0x6e, 0x09, 0x23, 0x23, 0xae, 0x70, 0x3e, 0xdf, 0xf0, 0x83, 0x45, 0x47, 0xe6, + 0x47, 0x5f, 0x15, 0x6a, 0xc4, 0xa2, 0x30, 0xaa, 0x1c, 0xbe, 0xf8, 0x6e, 0x24, 0xa9, 0x39, 0x03, + 0x40, 0x5d, 0x32, 0x6a, 0xa3, 0x8f, 0x09, 0x31, 0x73, 0x9f, 0x11, 0xb1, 0x94, 0x2d, 0x8f, 0xee, + 0x21, 0x6e, 0x5b, 0xee, 0x03, 0xa8, 0xa6, 0x31, 0x09, 0x5e, 0x9b, 0x45, 0x1b, 0x6b, 0x19, 0x7e, + 0x7c, 0xef, 0x8a, 0x9e, 0x04, 0xa1, 0xcb, 0x01, 0x28, 0x12, 0x47, 0x84, 0x3e, 0x8a, 0x4c, 0xeb, + 0x62, 0xcc, 0xcc, 0x2a, 0xf0, 0x2c, 0x1c, 0x03, 0x82, 0x17, 0x91, 0x39, 0xfa, 0xa9, 0xc9, 0x28, + 0x4d, 0x78, 0xc3, 0x48, 0x94, 0x6d, 0xfb, 0x25, 0x4b, 0x72, 0xd8, 0x21, 0x37, 0x64, 0x26, 0x31, + 0x01, 0xfc, 0x4c, 0xfe, 0x00, 0x83, 0xee, 0x8b, 0x57, 0x90, 0x53, 0x0d, 0x0c, 0x6f, 0x82, 0x30, + 0xf1, 0x0b, 0xea, 0x4e, 0x5f, 0x9a, 0x47, 0x70, 0x02, 0x37, 0xa2, 0xef, 0xc4, 0xf9, 0x4c, 0x00, + 0xaa, 0x80, 0x6f, 0x42, 0xc8, 0x45, 0x2a, 0x38, 0xcb, 0x90, 0x43, 0xd1, 0x79, 0x5e, 0x34, 0xe6, + 0x9a, 0xdc, 0x75, 0x3c, 0x68, 0x9e, 0x39, 0x37, 0x56, 0xf1, 0x67, 0xea, 0x41, 0x17, 0x4c, 0xfa, + 0x2a, 0xdc, 0xef, 0xff, 0x3a, 0xa1, 0xc7, 0xf2, 0x46, 0xa6, 0xe3, 0xd4, 0x24, 0x81, 0x5f, 0x5a, + 0x56, 0x13, 0xcf, 0xa0, 0xf8, 0x3b, 0xee, 0x30, 0x13, 0x4b, 0x17, 0x47, 0x9a, 0xaa, 0x31, 0x4f, + 0x1a, 0x74, 0xe5, 0xbf, 0xd0, 0x7f, 0xd1, 0xd0, 0x10, 0xa2, 0x4d, 0x81, 0x02, 0x03, 0x01, 0x00, + 0x01, 0x02, 0x82, 0x01, 0x01, 0x00, 0xa9, 0x5a, 0x9f, 0x2e, 0xc9, 0x0a, 0xc0, 0x8f, 0x67, 0x1c, + 0x6d, 0x81, 0xbb, 0xda, 0x4b, 0xdf, 0xf3, 0x3e, 0x53, 0x52, 0x8c, 0x7c, 0x2e, 0xac, 0x09, 0x7c, + 0x80, 0x21, 0x44, 0xd8, 0xa9, 0x96, 0x77, 0xfc, 0x4f, 0xeb, 0xeb, 0x23, 0x78, 0xf4, 0x9a, 0x69, + 0x88, 0x96, 0xa3, 0xcb, 0x14, 0x58, 0xf3, 0x12, 0x5c, 0x79, 0xef, 0x88, 0x66, 0xd9, 0x99, 0xe8, + 0x75, 0xdd, 0xff, 0x70, 0x86, 0xcb, 0x55, 0x67, 0x12, 0x77, 0x4c, 0x68, 0xc6, 0x42, 0x4c, 0xa9, + 0x8b, 0xb1, 0x80, 0x8b, 0xce, 0x7a, 0x53, 0x21, 0x86, 0xe5, 0x5a, 0x63, 0x23, 0xaa, 0xe2, 0xc2, + 0x10, 0xa9, 0xcb, 0xb9, 0xfc, 0x77, 0xaa, 0xf4, 0x42, 0x5b, 0x48, 0x79, 0x0e, 0xa2, 0xdd, 0xaa, + 0xd6, 0x66, 0x84, 0xaf, 0x78, 0xb4, 0x63, 0x76, 0x7f, 0x4d, 0x18, 0x23, 0x87, 0x4a, 0x74, 0xbe, + 0x55, 0xc7, 0x14, 0x64, 0x0e, 0x2c, 0xa2, 0xdf, 0xee, 0x52, 0xf2, 0xa1, 0x34, 0xdf, 0xcb, 0x3f, + 0x1e, 0xd1, 0x01, 0x97, 0xea, 0x2e, 0x86, 0x14, 0xa0, 0xac, 0x6e, 0x1c, 0x05, 0x38, 0xf7, 0xb9, + 0x9d, 0x6d, 0xc9, 0x06, 0x96, 0xab, 0xf6, 0x9d, 0x6b, 0xcd, 0x6f, 0x1d, 0xe6, 0x15, 0x38, 0x1a, + 0x87, 0xad, 0x8a, 0x84, 0x87, 0x57, 0x8e, 0xc7, 0x16, 0x08, 0x10, 0x07, 0xfd, 0x27, 0x8a, 0x81, + 0xeb, 0xd3, 0x24, 0x91, 0xb0, 0x6b, 0x2b, 0xfa, 0xac, 0xf4, 0xc8, 0xbf, 0xe9, 0x01, 0xcb, 0xbe, + 0x15, 0x22, 0xed, 0x27, 0x4e, 0xe3, 0xcd, 0x3e, 0x2a, 0x24, 0x5a, 0x60, 0xf5, 0x30, 0x37, 0xb0, + 0xae, 0x46, 0x0b, 0x31, 0x51, 0x67, 0x01, 0xf1, 0x34, 0xf8, 0x34, 0x89, 0x26, 0x10, 0x8a, 0x0a, + 0x0f, 0xcc, 0x0d, 0xed, 0xaf, 0x09, 0x4d, 0x66, 0x1a, 0x5d, 0x13, 0x13, 0x1c, 0x1d, 0xe1, 0x74, + 0xc6, 0xca, 0xf7, 0xf1, 0xe5, 0x01, 0x02, 0x81, 0x81, 0x00, 0xeb, 0x3c, 0x0a, 0x5b, 0xc0, 0x99, + 0x21, 0xc2, 0x1c, 0x25, 0xb6, 0xc6, 0x53, 0xd7, 0xb7, 0xbf, 0xff, 0xa1, 0x72, 0xd4, 0x32, 0xf1, + 0x1f, 0xfb, 0x19, 0xb5, 0x4c, 0xd1, 0x74, 0xea, 0x38, 0x2c, 0x53, 0xe3, 0x9d, 0xeb, 0xa6, 0x5d, + 0x5c, 0x38, 0x26, 0xac, 0xc3, 0x98, 0xe9, 0x9d, 0xf4, 0x26, 0x2e, 0xa2, 0x9e, 0x68, 0xf6, 0x0a, + 0x41, 0x37, 0xc1, 0x24, 0x06, 0x78, 0xe2, 0x7f, 0xc2, 0xe0, 0xfc, 0x24, 0x17, 0x0c, 0xd4, 0x86, + 0x6d, 0x64, 0x77, 0x2b, 0x55, 0xf2, 0xee, 0xff, 0x31, 0x03, 0xd8, 0x81, 0xe6, 0x35, 0x11, 0x8a, + 0x0b, 0x1a, 0x24, 0x6b, 0x06, 0x73, 0xf5, 0x25, 0xe1, 0x95, 0x94, 0x81, 0xa8, 0xb7, 0x46, 0x39, + 0xf1, 0x96, 0xe5, 0xa1, 0x7c, 0xdc, 0x8f, 0x1a, 0xfc, 0x00, 0xb1, 0x00, 0x39, 0x89, 0x7a, 0xcd, + 0x6c, 0x98, 0xcf, 0xba, 0x95, 0x27, 0xb4, 0x3f, 0x6b, 0x15, 0x02, 0x81, 0x81, 0x00, 0xcc, 0x4e, + 0xfa, 0x82, 0x22, 0xec, 0x11, 0xc2, 0x54, 0x66, 0x03, 0xde, 0x3c, 0xeb, 0x5f, 0xd0, 0x9f, 0x9a, + 0x12, 0x58, 0x3d, 0xca, 0x50, 0x0b, 0xfd, 0xa8, 0xc7, 0xf0, 0x2c, 0xd4, 0xf1, 0x05, 0x1b, 0x2a, + 0x1f, 0x87, 0x9e, 0x0c, 0x9e, 0x5a, 0xd1, 0xf9, 0x80, 0x7a, 0xcd, 0x47, 0xeb, 0xc5, 0xf5, 0x43, + 0x0c, 0xdc, 0x33, 0x0a, 0x86, 0xcb, 0xe0, 0xc6, 0x6b, 0xc8, 0x27, 0x42, 0x6f, 0x5a, 0xec, 0x54, + 0xd2, 0x32, 0x39, 0x64, 0xfc, 0xf5, 0x6f, 0xe3, 0xf4, 0x19, 0x3b, 0xa1, 0x4f, 0x2b, 0x91, 0xcc, + 0x61, 0x49, 0x21, 0xe4, 0x52, 0x14, 0x59, 0xe6, 0x39, 0x2f, 0x5d, 0x40, 0x09, 0x46, 0x72, 0x3d, + 0xb1, 0x0d, 0xb7, 0x5e, 0xfb, 0xa6, 0x83, 0x47, 0xd0, 0xa2, 0x06, 0x0d, 0x10, 0x05, 0xdf, 0x22, + 0xb1, 0xb6, 0x99, 0xb1, 0xf0, 0x3e, 0xc7, 0x0b, 0xde, 0xa4, 0x59, 0x13, 0x03, 0xbd, 0x02, 0x81, + 0x80, 0x14, 0x0b, 0xe4, 0xd2, 0x16, 0xe2, 0xb5, 0xe6, 0xc5, 0xe1, 0x4c, 0xe7, 0x2f, 0xe3, 0xf5, + 0x4b, 0xce, 0x6c, 0x22, 0xce, 0x04, 0x9d, 0x59, 0xdd, 0x5b, 0x3e, 0x81, 0x12, 0x64, 0x85, 0x45, + 0x4e, 0x39, 0xc3, 0xef, 0x04, 0x53, 0x04, 0x27, 0xc4, 0xbd, 0x3f, 0x01, 0xd8, 0x39, 0x28, 0x75, + 0xd2, 0xff, 0x2c, 0x6a, 0x95, 0x85, 0x4a, 0x30, 0x6e, 0xa0, 0xee, 0x02, 0x03, 0x31, 0x42, 0x34, + 0x08, 0x5a, 0x54, 0x75, 0x06, 0x69, 0xe2, 0x1e, 0xd6, 0x6d, 0xf5, 0x6a, 0x78, 0xae, 0x77, 0x5e, + 0xe4, 0xf6, 0x01, 0x73, 0xed, 0xd7, 0xd5, 0xcc, 0xc6, 0x68, 0x8e, 0x1a, 0x59, 0xad, 0x6d, 0x92, + 0x00, 0xde, 0x4c, 0x02, 0x65, 0xc3, 0xfd, 0x52, 0x22, 0x4a, 0xe5, 0x6d, 0x2f, 0x9a, 0x9e, 0x71, + 0x15, 0x5a, 0x00, 0x2b, 0xe7, 0x14, 0x69, 0x07, 0x35, 0x2a, 0x96, 0xba, 0xf9, 0x4c, 0x3a, 0x0f, + 0x55, 0x02, 0x81, 0x80, 0x53, 0x5f, 0x87, 0x6a, 0xc3, 0xc5, 0x82, 0x19, 0xc3, 0x47, 0x3e, 0x1c, + 0xda, 0xcf, 0x52, 0x72, 0x58, 0x2f, 0x0f, 0x7d, 0x62, 0xf9, 0xc4, 0x60, 0xa0, 0x4a, 0xd8, 0x0c, + 0x72, 0xbf, 0x12, 0xfb, 0xfa, 0x71, 0xde, 0x1c, 0x01, 0xab, 0x34, 0x93, 0xeb, 0x4b, 0xdd, 0xda, + 0x3f, 0x1b, 0x32, 0x63, 0xbe, 0x0a, 0x76, 0x9d, 0x05, 0x57, 0x2e, 0x5a, 0xd4, 0x87, 0x24, 0x44, + 0xb1, 0x80, 0xb2, 0xe0, 0x6f, 0xc0, 0xcd, 0x66, 0x21, 0x75, 0xcc, 0xa4, 0x7b, 0xdc, 0x92, 0x28, + 0x19, 0xe5, 0x61, 0xe1, 0x6d, 0xc5, 0xf1, 0x8d, 0x5e, 0x7f, 0x45, 0xdf, 0x78, 0x30, 0x32, 0xf5, + 0xd9, 0x1f, 0xe0, 0xa9, 0x16, 0xc5, 0x86, 0x13, 0x0a, 0xd9, 0x7f, 0xe8, 0x1b, 0x7a, 0x9a, 0xf1, + 0x03, 0x77, 0x21, 0x2a, 0xc4, 0x3b, 0xec, 0x39, 0x8f, 0xce, 0xc5, 0x33, 0x59, 0x16, 0xc6, 0xec, + 0x5a, 0x4d, 0x20, 0x21, 0x02, 0x81, 0x81, 0x00, 0x94, 0xc6, 0x78, 0x51, 0x88, 0xe4, 0xf2, 0x93, + 0x42, 0xdb, 0xb9, 0x46, 0xad, 0x82, 0x73, 0xb2, 0x4e, 0x83, 0x74, 0x8f, 0x79, 0xfe, 0x90, 0xae, + 0x71, 0x7f, 0x17, 0xa0, 0xc8, 0x36, 0x90, 0xc5, 0x71, 0x0e, 0xc1, 0x12, 0x2d, 0x20, 0x40, 0x5d, + 0x5a, 0x73, 0xeb, 0xef, 0xfb, 0xa3, 0x68, 0xa5, 0xb4, 0xce, 0x9d, 0x8b, 0xf0, 0x97, 0x11, 0xb3, + 0x22, 0x6d, 0xc4, 0x16, 0xed, 0x1c, 0x71, 0xab, 0xbc, 0x8b, 0x8f, 0xb2, 0x94, 0xeb, 0x20, 0x3f, + 0xd1, 0x05, 0xd5, 0x6e, 0x61, 0xaa, 0x86, 0xee, 0xee, 0x21, 0x0c, 0x7d, 0xa6, 0x53, 0x7b, 0x3b, + 0x9c, 0xc5, 0x9f, 0xf0, 0x4d, 0x79, 0x14, 0x99, 0x71, 0xeb, 0xb5, 0x4f, 0x37, 0x6c, 0xe6, 0x8b, + 0x9b, 0xd8, 0x11, 0x4d, 0xaa, 0xb1, 0x6c, 0xee, 0x0f, 0x42, 0x75, 0xf8, 0x0c, 0xc3, 0xc6, 0x3d, + 0x30, 0xb0, 0x1e, 0x69, 0x90, 0x1f, 0x2c, 0x16 +}; +static unsigned int ECTestServer6_key_der_len = 1192; + +static unsigned char ECTestServer7_256_der[] = { + 0x30, 0x82, 0x02, 0x77, 0x30, 0x82, 0x01, 0xfc, 0xa0, 0x03, 0x02, 0x01, + 0x02, 0x02, 0x01, 0x06, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, + 0x43, 0x41, 0x34, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x35, 0x32, + 0x35, 0x30, 0x34, 0x34, 0x35, 0x33, 0x33, 0x5a, 0x17, 0x0d, 0x31, 0x39, + 0x30, 0x35, 0x32, 0x35, 0x30, 0x34, 0x34, 0x35, 0x33, 0x33, 0x5a, 0x30, + 0x50, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, + 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, + 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x11, 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x37, 0x5f, 0x32, 0x35, 0x36, 0x30, 0x59, 0x30, + 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, + 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, + 0xee, 0xe8, 0x6b, 0x81, 0x32, 0x42, 0x79, 0x9e, 0x16, 0x27, 0x71, 0x3b, + 0xc6, 0x62, 0x2c, 0xea, 0x50, 0x83, 0x13, 0xbe, 0x07, 0x20, 0x96, 0xf3, + 0x9e, 0xb4, 0xc9, 0xe0, 0xcc, 0xf9, 0x97, 0x3b, 0xbe, 0x5c, 0xef, 0xbc, + 0x39, 0xc0, 0x33, 0x06, 0x27, 0x6e, 0xa6, 0xf6, 0xba, 0x25, 0x8f, 0x40, + 0x71, 0x2a, 0xb1, 0xa1, 0x44, 0x4f, 0x37, 0x05, 0x17, 0x46, 0x64, 0x3b, + 0x29, 0x74, 0x62, 0xb0, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x6b, + 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, 0xa4, + 0x53, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, + 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, + 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x34, + 0x82, 0x09, 0x00, 0xbc, 0x64, 0xd9, 0xfe, 0x6a, 0x91, 0x0e, 0xc2, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, + 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, 0x30, + 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, + 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, + 0x03, 0x69, 0x00, 0x30, 0x66, 0x02, 0x31, 0x00, 0x8f, 0xcd, 0x27, 0x83, + 0x3b, 0x3a, 0x93, 0xa2, 0x1c, 0x1a, 0x8d, 0xbe, 0x02, 0x07, 0x9f, 0x6c, + 0xf5, 0x28, 0x83, 0x91, 0x7d, 0x1c, 0x49, 0xf2, 0x83, 0x40, 0x4a, 0x78, + 0x11, 0xb0, 0xa0, 0xf4, 0x50, 0x1b, 0xba, 0x79, 0x59, 0xf6, 0x15, 0x70, + 0x37, 0x9f, 0x0c, 0xae, 0x1b, 0x3e, 0x25, 0x9e, 0x02, 0x31, 0x00, 0xe3, + 0x91, 0x01, 0x6a, 0x26, 0x98, 0x86, 0x7d, 0x90, 0x75, 0x8b, 0x1d, 0xaa, + 0xcf, 0x12, 0xe5, 0x99, 0x96, 0xb4, 0x49, 0xed, 0x90, 0xdc, 0x45, 0xf3, + 0xee, 0x12, 0x11, 0x45, 0xdb, 0x94, 0x69, 0xda, 0x5c, 0x7d, 0xf8, 0x53, + 0x17, 0x05, 0xb3, 0x57, 0x82, 0x06, 0x91, 0xb9, 0xdb, 0xa1, 0x09 +}; +static unsigned int ECTestServer7_256_der_len = 635; +static unsigned char ECTestServer7_256_key_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xe1, 0x2b, 0xa2, 0x26, 0x0a, + 0xa6, 0xe1, 0x77, 0xca, 0x3d, 0x2d, 0xe6, 0x4a, 0x8a, 0x9d, 0x73, 0xd7, + 0xaa, 0x98, 0x67, 0x28, 0x64, 0x41, 0x0e, 0x2c, 0xdc, 0x3e, 0xf2, 0x6c, + 0x7d, 0xf5, 0x82, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0xee, 0xe8, 0x6b, + 0x81, 0x32, 0x42, 0x79, 0x9e, 0x16, 0x27, 0x71, 0x3b, 0xc6, 0x62, 0x2c, + 0xea, 0x50, 0x83, 0x13, 0xbe, 0x07, 0x20, 0x96, 0xf3, 0x9e, 0xb4, 0xc9, + 0xe0, 0xcc, 0xf9, 0x97, 0x3b, 0xbe, 0x5c, 0xef, 0xbc, 0x39, 0xc0, 0x33, + 0x06, 0x27, 0x6e, 0xa6, 0xf6, 0xba, 0x25, 0x8f, 0x40, 0x71, 0x2a, 0xb1, + 0xa1, 0x44, 0x4f, 0x37, 0x05, 0x17, 0x46, 0x64, 0x3b, 0x29, 0x74, 0x62, + 0xb0 +}; +static unsigned int ECTestServer7_256_key_der_len = 121; + +static unsigned char ecdhkey_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x5d, 0x2a, 0x16, 0xfd, 0x8c, + 0x78, 0x09, 0x73, 0x5c, 0x02, 0x0f, 0xae, 0xcb, 0x25, 0xbb, 0x73, 0xe5, + 0x3b, 0x21, 0x4b, 0x33, 0x81, 0xc3, 0x71, 0xa0, 0x62, 0xa8, 0x97, 0x12, + 0xcb, 0x25, 0x0d, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x4d, 0xce, 0x22, + 0x02, 0x29, 0x1f, 0xf0, 0xbf, 0x3a, 0xe5, 0x71, 0x42, 0x62, 0xa5, 0x09, + 0x0c, 0x92, 0xf6, 0x82, 0x4b, 0x98, 0xb0, 0x63, 0xd0, 0xca, 0x06, 0x72, + 0xe8, 0xc7, 0x65, 0xb6, 0xc1, 0x53, 0x80, 0x0e, 0xef, 0x17, 0x2e, 0x6b, + 0x66, 0x47, 0x30, 0xd9, 0xc1, 0x56, 0x6e, 0x82, 0xa5, 0x6f, 0x29, 0xb0, + 0xf7, 0x8d, 0xe0, 0xfe, 0xe3, 0xc9, 0x2c, 0x36, 0x6e, 0x53, 0x98, 0x98, + 0x39 +}; +static unsigned int ecdhkey_der_len = 121; +static unsigned char ecdhcert_der[] = { + 0x30, 0x82, 0x02, 0x53, 0x30, 0x82, 0x01, 0x3b, 0x02, 0x09, 0x00, 0xdb, + 0x47, 0xac, 0x3c, 0x3e, 0x02, 0x58, 0x42, 0x30, 0x0d, 0x06, 0x09, 0x2a, + 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x50, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, + 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, + 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x04, 0x45, 0x43, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, + 0x31, 0x38, 0x30, 0x35, 0x31, 0x36, 0x30, 0x35, 0x32, 0x31, 0x34, 0x33, + 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x31, 0x35, 0x30, 0x35, 0x32, + 0x31, 0x34, 0x33, 0x5a, 0x30, 0x52, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x06, 0x45, 0x43, + 0x54, 0x65, 0x73, 0x74, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x4d, 0xce, 0x22, 0x02, 0x29, + 0x1f, 0xf0, 0xbf, 0x3a, 0xe5, 0x71, 0x42, 0x62, 0xa5, 0x09, 0x0c, 0x92, + 0xf6, 0x82, 0x4b, 0x98, 0xb0, 0x63, 0xd0, 0xca, 0x06, 0x72, 0xe8, 0xc7, + 0x65, 0xb6, 0xc1, 0x53, 0x80, 0x0e, 0xef, 0x17, 0x2e, 0x6b, 0x66, 0x47, + 0x30, 0xd9, 0xc1, 0x56, 0x6e, 0x82, 0xa5, 0x6f, 0x29, 0xb0, 0xf7, 0x8d, + 0xe0, 0xfe, 0xe3, 0xc9, 0x2c, 0x36, 0x6e, 0x53, 0x98, 0x98, 0x39, 0x30, + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0xb7, 0xfa, 0xd8, 0xd7, 0x38, + 0x3c, 0xbf, 0x08, 0xd6, 0x02, 0x6f, 0x84, 0x7f, 0xfb, 0xd1, 0xac, 0x33, + 0x23, 0xa7, 0x27, 0x01, 0x76, 0x99, 0x90, 0xa0, 0xd2, 0xac, 0x3a, 0x56, + 0xf2, 0x4c, 0x90, 0xbd, 0x84, 0x66, 0x30, 0x4c, 0x9e, 0x07, 0x3d, 0xf4, + 0xe7, 0x43, 0x0d, 0x40, 0x92, 0x9f, 0x93, 0x89, 0xf0, 0xd3, 0xf2, 0x3e, + 0x44, 0xee, 0xe9, 0x37, 0x16, 0xbe, 0xd4, 0x5f, 0xe5, 0x9c, 0xf3, 0x71, + 0x69, 0xf4, 0x93, 0xd7, 0x5a, 0xeb, 0xd6, 0x1c, 0xae, 0xe8, 0xca, 0x32, + 0x0c, 0xa3, 0x60, 0x29, 0x93, 0x4d, 0xf9, 0x20, 0xbf, 0x09, 0xf8, 0x50, + 0xb2, 0x5d, 0x4f, 0xf4, 0xe9, 0x19, 0xef, 0xf7, 0x52, 0xa9, 0x84, 0xcf, + 0x9a, 0x8e, 0x92, 0xeb, 0x38, 0x10, 0xc0, 0xe0, 0x8d, 0x3c, 0x18, 0xf3, + 0x86, 0x0c, 0x9a, 0x8e, 0x8d, 0xc5, 0xb2, 0x93, 0xc8, 0xa5, 0xf2, 0x3a, + 0x55, 0xcf, 0xbe, 0x91, 0x96, 0xce, 0xa3, 0xa3, 0xcb, 0xcb, 0x76, 0xaf, + 0x31, 0xfa, 0x1c, 0x86, 0xa5, 0x19, 0xd2, 0x9a, 0xc0, 0x0e, 0xa2, 0x0f, + 0xdd, 0x39, 0xd9, 0x5d, 0xd6, 0xce, 0x8c, 0x9b, 0xc3, 0x6e, 0xa7, 0x98, + 0xbb, 0xb2, 0xe6, 0x98, 0x05, 0x2d, 0x7c, 0x28, 0xa4, 0xb6, 0x69, 0x2c, + 0xe2, 0x0c, 0xa7, 0x26, 0x91, 0x35, 0x01, 0x3d, 0xd0, 0x2f, 0xa0, 0x03, + 0x87, 0xc9, 0x44, 0xcf, 0x19, 0x43, 0xd8, 0x6c, 0x61, 0xc8, 0xdd, 0x18, + 0x51, 0xcd, 0x30, 0xd0, 0xf0, 0x09, 0xb0, 0x96, 0xf4, 0xde, 0x78, 0x4b, + 0xd9, 0xbe, 0x8b, 0x5a, 0xb7, 0xe6, 0x66, 0x73, 0xe9, 0xac, 0x2b, 0xd3, + 0x3b, 0x51, 0x2b, 0xbe, 0x1e, 0x58, 0x15, 0x4d, 0x35, 0x79, 0x56, 0x7a, + 0x5a, 0x79, 0x9a, 0x67, 0x60, 0x0c, 0x3c, 0xee, 0x9d, 0x67, 0x5d, 0x85, + 0x2c, 0x1b, 0xe6, 0xc4, 0xaa, 0xec, 0x77, 0x5f, 0x76, 0x9e, 0xc3 +}; +static unsigned int ecdhcert_der_len = 599; + +static unsigned char ECTestServer9_192_der[] = { + 0x30, 0x82, 0x02, 0x42, 0x30, 0x82, 0x01, 0xe8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x08, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, 0x37, 0x30, 0x32, 0x32, 0x39, 0x31, 0x30, 0x5a, + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x36, 0x30, 0x37, 0x30, 0x32, 0x32, 0x39, 0x31, 0x30, 0x5a, 0x30, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, + 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x39, 0x30, 0x49, 0x30, + 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x03, 0x01, 0x01, 0x03, 0x32, 0x00, 0x04, 0x44, 0x99, 0x10, 0x2c, 0x49, 0x94, 0x99, 0x00, + 0xc7, 0x55, 0x19, 0xd3, 0x63, 0xf9, 0x23, 0x6a, 0xd4, 0x47, 0x6d, 0xb5, 0x41, 0xa1, 0x3b, 0x45, + 0x09, 0x13, 0xe3, 0x7a, 0x42, 0x2f, 0x91, 0x55, 0x05, 0xe1, 0x64, 0xe9, 0xc5, 0xb9, 0x14, 0x6d, + 0xa2, 0x06, 0xbc, 0x54, 0xb3, 0xfb, 0xb3, 0x13, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x6b, + 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, 0xa4, 0x53, 0x30, 0x51, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, + 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, + 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, + 0x82, 0x09, 0x00, 0xa6, 0x7d, 0x85, 0x34, 0x93, 0x36, 0xd5, 0x3b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, + 0x02, 0x03, 0xf8, 0x30, 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, + 0x45, 0x02, 0x21, 0x00, 0xb9, 0x64, 0xa3, 0x66, 0x0d, 0x25, 0xdf, 0xe2, 0xc7, 0x0f, 0xeb, 0xa3, + 0x80, 0xe8, 0x29, 0x7e, 0x7c, 0x8c, 0x0f, 0xb1, 0x65, 0x9e, 0xa7, 0x50, 0xe4, 0xea, 0xd2, 0x04, + 0x91, 0x6e, 0x58, 0xf8, 0x02, 0x20, 0x23, 0x6a, 0xe7, 0xc2, 0xd1, 0xe6, 0xbc, 0x54, 0x6d, 0x01, + 0x8d, 0xfa, 0xe7, 0x7e, 0x09, 0xe9, 0x65, 0xe1, 0x82, 0x16, 0xe6, 0xa0, 0xd2, 0x14, 0xbf, 0x56, + 0xec, 0xd2, 0xc7, 0xf2, 0xd5, 0xf7 +}; +static unsigned int ECTestServer9_192_der_len = 582; + +static unsigned char ECTestServer9_192_key_der[] = { + 0x30, 0x5f, 0x02, 0x01, 0x01, 0x04, 0x18, 0xe0, 0x0f, 0xc5, 0x13, 0x9e, 0xc5, 0xe5, 0xcd, 0x47, + 0x7c, 0x0e, 0x75, 0x8a, 0x8d, 0x0d, 0xb7, 0x59, 0x53, 0xb2, 0x6d, 0x06, 0x51, 0x5e, 0xb6, 0xa0, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x01, 0xa1, 0x34, 0x03, 0x32, 0x00, + 0x04, 0x44, 0x99, 0x10, 0x2c, 0x49, 0x94, 0x99, 0x00, 0xc7, 0x55, 0x19, 0xd3, 0x63, 0xf9, 0x23, + 0x6a, 0xd4, 0x47, 0x6d, 0xb5, 0x41, 0xa1, 0x3b, 0x45, 0x09, 0x13, 0xe3, 0x7a, 0x42, 0x2f, 0x91, + 0x55, 0x05, 0xe1, 0x64, 0xe9, 0xc5, 0xb9, 0x14, 0x6d, 0xa2, 0x06, 0xbc, 0x54, 0xb3, 0xfb, 0xb3, + 0x13 +}; +static unsigned int ECTestServer9_192_key_der_len = 97; + +static unsigned char ECTestServer8_224_der[] = { + 0x30, 0x82, 0x02, 0x46, 0x30, 0x82, 0x01, 0xed, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x07, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, 0x37, 0x30, 0x32, 0x32, 0x35, 0x32, 0x37, 0x5a, + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x36, 0x30, 0x37, 0x30, 0x32, 0x32, 0x35, 0x32, 0x37, 0x5a, 0x30, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0d, + 0x45, 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x38, 0x30, 0x4e, 0x30, + 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, + 0x21, 0x03, 0x3a, 0x00, 0x04, 0xfa, 0x17, 0x9d, 0x00, 0xcb, 0x26, 0xb5, 0xb8, 0xd5, 0x45, 0xd7, + 0x63, 0xe1, 0xdb, 0xe9, 0xc4, 0xb5, 0x86, 0xe4, 0x1d, 0xa5, 0x10, 0xf5, 0xda, 0x6c, 0x3a, 0x4d, + 0xa3, 0x5d, 0x77, 0xef, 0x7c, 0xe4, 0x81, 0xc7, 0x72, 0x52, 0xba, 0x83, 0x40, 0x41, 0xde, 0x0a, + 0xcc, 0xec, 0x73, 0xb6, 0x0b, 0xe5, 0x15, 0x90, 0xfe, 0x29, 0x90, 0x65, 0x59, 0xa3, 0x81, 0xc5, + 0x30, 0x81, 0xc2, 0x30, 0x6b, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, + 0xa4, 0x53, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, + 0x45, 0x43, 0x43, 0x41, 0x32, 0x82, 0x09, 0x00, 0xa6, 0x7d, 0x85, 0x34, 0x93, 0x36, 0xd5, 0x3b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, + 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, 0x30, 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, + 0x34, 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, + 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x03, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x03, 0x08, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, + 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x71, 0xad, 0xf5, 0x33, 0xc7, 0x04, 0x6a, 0x28, + 0xb0, 0x06, 0x45, 0x04, 0xf3, 0xf1, 0x4e, 0x60, 0x2f, 0x68, 0x1d, 0xfa, 0xb4, 0x87, 0xf2, 0xaf, + 0x21, 0xe0, 0x1b, 0x84, 0x84, 0x8f, 0x74, 0xcf, 0x02, 0x20, 0x15, 0x73, 0x48, 0x84, 0x93, 0x89, + 0x7a, 0xc9, 0xb8, 0xb2, 0x97, 0x76, 0x82, 0xd7, 0x62, 0x31, 0x25, 0x50, 0x46, 0x8b, 0xff, 0xde, + 0x57, 0xf3, 0xbd, 0x02, 0x18, 0x21, 0xba, 0xd4, 0xfe, 0xb0 +}; +static unsigned int ECTestServer8_224_der_len = 586; + +static unsigned char ECTestServer8_224_key_der[] = { + 0x30, 0x68, 0x02, 0x01, 0x01, 0x04, 0x1c, 0xbe, 0x90, 0xc8, 0x6d, 0x9c, 0xbd, 0xf3, 0x28, 0xdb, + 0xc0, 0xa4, 0xee, 0x6e, 0x6d, 0xee, 0x30, 0x9e, 0x3f, 0x7a, 0x74, 0x9c, 0xea, 0xc0, 0xad, 0x55, + 0x8e, 0xff, 0xa2, 0xa0, 0x07, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x21, 0xa1, 0x3c, 0x03, 0x3a, + 0x00, 0x04, 0xfa, 0x17, 0x9d, 0x00, 0xcb, 0x26, 0xb5, 0xb8, 0xd5, 0x45, 0xd7, 0x63, 0xe1, 0xdb, + 0xe9, 0xc4, 0xb5, 0x86, 0xe4, 0x1d, 0xa5, 0x10, 0xf5, 0xda, 0x6c, 0x3a, 0x4d, 0xa3, 0x5d, 0x77, + 0xef, 0x7c, 0xe4, 0x81, 0xc7, 0x72, 0x52, 0xba, 0x83, 0x40, 0x41, 0xde, 0x0a, 0xcc, 0xec, 0x73, + 0xb6, 0x0b, 0xe5, 0x15, 0x90, 0xfe, 0x29, 0x90, 0x65, 0x59 +}; +static unsigned int ECTestServer8_224_key_der_len = 106; + +static unsigned char ECTestServer10_der[] = { + 0x30, 0x82, 0x02, 0x51, 0x30, 0x82, 0x01, 0xf8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x0c, + 0x30, 0x09, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, 0x30, 0x51, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, + 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, + 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, + 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, 0x30, 0x1e, + 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, 0x38, 0x30, 0x37, 0x35, 0x38, 0x34, 0x34, 0x5a, 0x17, + 0x0d, 0x31, 0x39, 0x30, 0x36, 0x30, 0x38, 0x30, 0x37, 0x35, 0x38, 0x34, 0x34, 0x5a, 0x30, 0x4d, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, + 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x45, + 0x43, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x31, 0x30, 0x30, 0x59, 0x30, + 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xf9, 0x1a, 0x1d, 0x20, 0x7d, 0x9a, 0x66, 0x4e, + 0x7e, 0xba, 0x6b, 0x46, 0x32, 0xc5, 0x9b, 0xcf, 0x1a, 0xe8, 0xd7, 0x39, 0x53, 0x26, 0x86, 0xb9, + 0x86, 0xe9, 0x92, 0xd4, 0x0b, 0x17, 0x89, 0xfa, 0x9c, 0x91, 0x1b, 0xd4, 0x6c, 0x20, 0x96, 0xa5, + 0xc2, 0x50, 0xad, 0x0c, 0x23, 0x18, 0x1b, 0xa5, 0x33, 0x93, 0x58, 0x41, 0x15, 0x23, 0x01, 0xc4, + 0xe4, 0x99, 0x99, 0x40, 0x5f, 0x1c, 0x85, 0x18, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x6b, + 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, 0x30, 0x62, 0xa1, 0x55, 0xa4, 0x53, 0x30, 0x51, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, + 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, + 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x32, + 0x82, 0x09, 0x00, 0xa6, 0x7d, 0x85, 0x34, 0x93, 0x36, 0xd5, 0x3b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, + 0x02, 0x03, 0xf8, 0x30, 0x3b, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, + 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, + 0x30, 0x09, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, 0x03, 0x48, 0x00, 0x30, 0x45, + 0x02, 0x21, 0x00, 0xdf, 0x12, 0x00, 0x97, 0xb8, 0xc2, 0xd2, 0x68, 0x6f, 0xfd, 0x81, 0xa9, 0xe5, + 0xe9, 0x01, 0xb5, 0x4d, 0xc2, 0x50, 0xc3, 0x83, 0x11, 0xf1, 0x7c, 0x96, 0xfc, 0x16, 0x71, 0x30, + 0x81, 0x9a, 0xc4, 0x02, 0x20, 0x5d, 0xd9, 0x2d, 0xed, 0x92, 0xbb, 0xc7, 0x55, 0xee, 0xbd, 0xdf, + 0x1b, 0x3e, 0x3b, 0xb8, 0xc7, 0x1a, 0xd9, 0x32, 0xe0, 0x0b, 0x05, 0xf0, 0x56, 0x3b, 0xdf, 0x17, + 0x70, 0xd3, 0xb9, 0xbb, 0x14 +}; +static unsigned int ECTestServer10_der_len = 597; + +static unsigned char ECTestServer10_key_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x24, 0xab, 0x0d, 0x2c, 0x3e, 0xb0, 0x6a, 0xdf, 0x05, + 0x12, 0x6a, 0x97, 0x6e, 0x12, 0x69, 0x92, 0xfc, 0x5c, 0x70, 0x7d, 0x5b, 0x17, 0xcd, 0x1b, 0x07, + 0x51, 0x65, 0x68, 0x0d, 0x1e, 0xe9, 0xcc, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0xf9, 0x1a, 0x1d, 0x20, 0x7d, 0x9a, 0x66, + 0x4e, 0x7e, 0xba, 0x6b, 0x46, 0x32, 0xc5, 0x9b, 0xcf, 0x1a, 0xe8, 0xd7, 0x39, 0x53, 0x26, 0x86, + 0xb9, 0x86, 0xe9, 0x92, 0xd4, 0x0b, 0x17, 0x89, 0xfa, 0x9c, 0x91, 0x1b, 0xd4, 0x6c, 0x20, 0x96, + 0xa5, 0xc2, 0x50, 0xad, 0x0c, 0x23, 0x18, 0x1b, 0xa5, 0x33, 0x93, 0x58, 0x41, 0x15, 0x23, 0x01, + 0xc4, 0xe4, 0x99, 0x99, 0x40, 0x5f, 0x1c, 0x85, 0x18 +}; +static unsigned int ECTestServer10_key_der_len = 121; + + +/* +ECIntm_der: + +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 10 (0xa) + Signature Algorithm: ecdsa-with-SHA256 + Issuer: C = CN, ST = SH, L = SH, O = EL, OU = EL, CN = ECCA4 + Validity + Not Before: Jun 8 01:38:45 2018 GMT + Not After : Jun 8 01:38:45 2019 GMT + Subject: C = CN, ST = SH, O = EL, OU = EL, CN = ECIntm + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:2f:17:12:9b:9a:43:d7:f4:9c:06:f9:a6:e0:94: + c1:5c:c9:c7:a6:1c:b5:c8:a1:e9:b4:2a:78:ab:eb: + 88:84:c5:7b:98:fa:fa:c9:cd:da:e1:72:5a:9b:d5: + 99:5c:a8:7a:ae:8e:0d:f9:e7:8c:90:12:60:d4:53: + 5e:30:a2:72:5b + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Authority Key Identifier: + DirName:/C=CN/ST=SH/L=SH/O=EL/OU=EL/CN=ECCA4 + serial:BC:64:D9:FE:6A:91:0E:C2 + + X509v3 Basic Constraints: + CA:FALSE + X509v3 Key Usage: + Digital Signature, Certificate Sign, CRL Sign + X509v3 Extended Key Usage: + TLS Web Server Authentication, TLS Web Client Authentication, Code Signing, E-mail Protection, Time Stamping + Signature Algorithm: ecdsa-with-SHA256 + 30:65:02:30:63:92:28:85:04:b9:a2:bf:58:66:ef:05:0c:bc: + 4a:f9:5e:d3:75:86:89:7d:4b:3a:a6:32:e9:7f:a5:13:fc:96: + 99:4f:d4:ec:21:e5:bc:55:f6:41:d1:61:ff:bd:ea:e1:02:31: + 00:8e:20:3b:a3:6e:a3:ef:dc:d9:5e:f4:43:90:d7:3e:eb:fe: + 2d:26:22:08:04:5d:e4:1c:fd:d6:f0:a7:f2:ca:29:fa:f6:35: + 7c:f1:8c:5e:65:62:b5:d6:38:19:af:1d:02 +*/ +static unsigned char ECIntm_der[] = { + 0x30, 0x82, 0x02, 0x6b, 0x30, 0x82, 0x01, 0xf1, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x0a, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x51, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, + 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x34, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, 0x38, 0x30, 0x31, 0x33, 0x38, 0x34, 0x35, 0x5a, + 0x17, 0x0d, 0x31, 0x39, 0x30, 0x36, 0x30, 0x38, 0x30, 0x31, 0x33, 0x38, 0x34, 0x35, 0x5a, 0x30, + 0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x06, + 0x45, 0x43, 0x49, 0x6e, 0x74, 0x6d, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, + 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, + 0x04, 0x2f, 0x17, 0x12, 0x9b, 0x9a, 0x43, 0xd7, 0xf4, 0x9c, 0x06, 0xf9, 0xa6, 0xe0, 0x94, 0xc1, + 0x5c, 0xc9, 0xc7, 0xa6, 0x1c, 0xb5, 0xc8, 0xa1, 0xe9, 0xb4, 0x2a, 0x78, 0xab, 0xeb, 0x88, 0x84, + 0xc5, 0x7b, 0x98, 0xfa, 0xfa, 0xc9, 0xcd, 0xda, 0xe1, 0x72, 0x5a, 0x9b, 0xd5, 0x99, 0x5c, 0xa8, + 0x7a, 0xae, 0x8e, 0x0d, 0xf9, 0xe7, 0x8c, 0x90, 0x12, 0x60, 0xd4, 0x53, 0x5e, 0x30, 0xa2, 0x72, + 0x5b, 0xa3, 0x81, 0xc5, 0x30, 0x81, 0xc2, 0x30, 0x6b, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x64, + 0x30, 0x62, 0xa1, 0x55, 0xa4, 0x53, 0x30, 0x51, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, + 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, 0x34, 0x82, 0x09, 0x00, 0xbc, 0x64, 0xd9, 0xfe, + 0x6a, 0x91, 0x0e, 0xc2, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, + 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x3b, 0x06, 0x03, + 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, + 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x30, 0x63, 0x92, 0x28, 0x85, + 0x04, 0xb9, 0xa2, 0xbf, 0x58, 0x66, 0xef, 0x05, 0x0c, 0xbc, 0x4a, 0xf9, 0x5e, 0xd3, 0x75, 0x86, + 0x89, 0x7d, 0x4b, 0x3a, 0xa6, 0x32, 0xe9, 0x7f, 0xa5, 0x13, 0xfc, 0x96, 0x99, 0x4f, 0xd4, 0xec, + 0x21, 0xe5, 0xbc, 0x55, 0xf6, 0x41, 0xd1, 0x61, 0xff, 0xbd, 0xea, 0xe1, 0x02, 0x31, 0x00, 0x8e, + 0x20, 0x3b, 0xa3, 0x6e, 0xa3, 0xef, 0xdc, 0xd9, 0x5e, 0xf4, 0x43, 0x90, 0xd7, 0x3e, 0xeb, 0xfe, + 0x2d, 0x26, 0x22, 0x08, 0x04, 0x5d, 0xe4, 0x1c, 0xfd, 0xd6, 0xf0, 0xa7, 0xf2, 0xca, 0x29, 0xfa, + 0xf6, 0x35, 0x7c, 0xf1, 0x8c, 0x5e, 0x65, 0x62, 0xb5, 0xd6, 0x38, 0x19, 0xaf, 0x1d, 0x02 +}; +static unsigned int ECIntm_der_len = 623; + +static unsigned char ECIntm_key_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xb1, 0x92, 0x3b, 0xf6, 0x94, 0x9d, 0x96, 0x94, 0x6e, + 0x2a, 0xa2, 0x40, 0x72, 0x98, 0xf5, 0x78, 0xad, 0xf1, 0x34, 0x4d, 0xcc, 0xac, 0xcc, 0xdc, 0xe2, + 0x15, 0x22, 0x66, 0x62, 0xbd, 0x78, 0xa8, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x2f, 0x17, 0x12, 0x9b, 0x9a, 0x43, 0xd7, + 0xf4, 0x9c, 0x06, 0xf9, 0xa6, 0xe0, 0x94, 0xc1, 0x5c, 0xc9, 0xc7, 0xa6, 0x1c, 0xb5, 0xc8, 0xa1, + 0xe9, 0xb4, 0x2a, 0x78, 0xab, 0xeb, 0x88, 0x84, 0xc5, 0x7b, 0x98, 0xfa, 0xfa, 0xc9, 0xcd, 0xda, + 0xe1, 0x72, 0x5a, 0x9b, 0xd5, 0x99, 0x5c, 0xa8, 0x7a, 0xae, 0x8e, 0x0d, 0xf9, 0xe7, 0x8c, 0x90, + 0x12, 0x60, 0xd4, 0x53, 0x5e, 0x30, 0xa2, 0x72, 0x5b +}; +static unsigned int ECIntm_key_der_len = 121; + +static unsigned char ECRevoked2_der[] = { + 0x30, 0x82, 0x02, 0x3a, 0x30, 0x82, 0x01, 0xe1, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x0b, + 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x45, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, + 0x45, 0x4c, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x06, 0x45, 0x43, 0x49, + 0x6e, 0x74, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, 0x38, 0x30, 0x31, 0x35, + 0x35, 0x31, 0x31, 0x5a, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x36, 0x30, 0x38, 0x30, 0x31, 0x35, 0x35, + 0x31, 0x31, 0x5a, 0x30, 0x49, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, + 0x43, 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, + 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, + 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x0a, 0x45, 0x43, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x32, 0x30, 0x59, + 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x1f, 0x4a, 0x62, 0x3f, 0xe5, 0xc7, 0x98, + 0xdf, 0xcb, 0x63, 0x57, 0x08, 0x7c, 0xe3, 0x7d, 0x2f, 0x68, 0xa9, 0x70, 0x94, 0x4d, 0xf7, 0xd4, + 0x79, 0xbf, 0x53, 0xb2, 0x98, 0x3b, 0x96, 0x22, 0xc2, 0x9a, 0xfd, 0x7c, 0x77, 0x10, 0x13, 0x20, + 0xd7, 0x4c, 0x33, 0xc5, 0x47, 0xcd, 0xc8, 0xe0, 0xea, 0x77, 0x5e, 0xf2, 0xfb, 0xef, 0xdb, 0xf5, + 0xeb, 0xfc, 0xed, 0x91, 0x72, 0x20, 0xc6, 0xf0, 0xc4, 0xa3, 0x81, 0xbd, 0x30, 0x81, 0xba, 0x30, + 0x63, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x5c, 0x30, 0x5a, 0xa1, 0x55, 0xa4, 0x53, 0x30, 0x51, + 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4e, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x07, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, + 0x4c, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x05, 0x45, 0x43, 0x43, 0x41, + 0x34, 0x82, 0x01, 0x0a, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, + 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, 0x30, 0x3b, 0x06, 0x03, + 0x55, 0x1d, 0x25, 0x04, 0x34, 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, + 0x05, 0x05, 0x07, 0x03, 0x03, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, + 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x31, 0xbe, 0x74, 0xd3, + 0xdd, 0x4f, 0x3d, 0xfe, 0xc6, 0x40, 0x9e, 0x20, 0xce, 0x07, 0x5b, 0xc6, 0x18, 0xf1, 0x13, 0x60, + 0xf5, 0x00, 0xc9, 0x0c, 0xb3, 0x37, 0x98, 0x59, 0xec, 0xf3, 0x09, 0xe3, 0x02, 0x20, 0x4e, 0x61, + 0x65, 0x97, 0x08, 0x7f, 0xee, 0xc4, 0x1d, 0x86, 0x31, 0x95, 0xbc, 0x6e, 0x44, 0xfe, 0x02, 0x70, + 0x35, 0xaa, 0x70, 0x28, 0xa3, 0x3f, 0x8b, 0xd8, 0xa5, 0x4b, 0x1c, 0xeb, 0xde, 0xfa +}; +static unsigned int ECRevoked2_der_len = 574; + +static unsigned char ECRevoked2_key_der[] = { + 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x29, 0x5c, 0x9f, 0x10, 0x4e, 0x82, 0xae, 0x7d, 0xa7, + 0x80, 0x7d, 0xdd, 0xd1, 0xb5, 0xc5, 0xd0, 0xff, 0x01, 0xf0, 0x1d, 0x44, 0x2d, 0xe6, 0x1c, 0xd9, + 0xa5, 0xae, 0xc2, 0x9f, 0x4d, 0xd0, 0xa0, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x1f, 0x4a, 0x62, 0x3f, 0xe5, 0xc7, 0x98, + 0xdf, 0xcb, 0x63, 0x57, 0x08, 0x7c, 0xe3, 0x7d, 0x2f, 0x68, 0xa9, 0x70, 0x94, 0x4d, 0xf7, 0xd4, + 0x79, 0xbf, 0x53, 0xb2, 0x98, 0x3b, 0x96, 0x22, 0xc2, 0x9a, 0xfd, 0x7c, 0x77, 0x10, 0x13, 0x20, + 0xd7, 0x4c, 0x33, 0xc5, 0x47, 0xcd, 0xc8, 0xe0, 0xea, 0x77, 0x5e, 0xf2, 0xfb, 0xef, 0xdb, 0xf5, + 0xeb, 0xfc, 0xed, 0x91, 0x72, 0x20, 0xc6, 0xf0, 0xc4 +}; +static unsigned int ECRevoked2_key_der_len = 121; + +/* +ECIntm_crl +Certificate Revocation List (CRL): + Version 1 (0x0) + Signature Algorithm: ecdsa-with-SHA256 + Issuer: C = CN, ST = SH, O = EL, OU = EL, CN = ECIntm + Last Update: Jun 8 01:59:26 2018 GMT + Next Update: Jul 8 01:59:26 2018 GMT +Revoked Certificates: + Serial Number: 09 + Revocation Date: Jun 7 08:45:41 2018 GMT + Serial Number: 0B + Revocation Date: Jun 8 01:56:34 2018 GMT + Signature Algorithm: ecdsa-with-SHA256 + 30:44:02:20:01:4c:7f:67:b6:fb:47:51:fb:f0:2a:b7:f8:2e: + 6e:d7:e5:e6:a5:31:a8:17:47:36:e9:85:68:53:90:a7:56:4d: + 02:20:60:79:fb:9e:d4:4e:1a:50:90:68:63:d9:1f:fc:b5:e3: + 01:d1:0e:b9:73:25:3e:b5:d6:f8:b0:30:b6:e2:2c:39 +*/ + +static unsigned char ECIntm_crl[] = { + 0x30, 0x81, 0xf3, 0x30, 0x81, 0x9b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, + 0x03, 0x02, 0x30, 0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, + 0x4e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x53, 0x48, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0b, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x02, 0x45, 0x4c, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, + 0x03, 0x0c, 0x06, 0x45, 0x43, 0x49, 0x6e, 0x74, 0x6d, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, + 0x38, 0x30, 0x31, 0x35, 0x39, 0x32, 0x36, 0x5a, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x37, 0x30, 0x38, + 0x30, 0x31, 0x35, 0x39, 0x32, 0x36, 0x5a, 0x30, 0x28, 0x30, 0x12, 0x02, 0x01, 0x09, 0x17, 0x0d, + 0x31, 0x38, 0x30, 0x36, 0x30, 0x37, 0x30, 0x38, 0x34, 0x35, 0x34, 0x31, 0x5a, 0x30, 0x12, 0x02, + 0x01, 0x0b, 0x17, 0x0d, 0x31, 0x38, 0x30, 0x36, 0x30, 0x38, 0x30, 0x31, 0x35, 0x36, 0x33, 0x34, + 0x5a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, + 0x30, 0x44, 0x02, 0x20, 0x01, 0x4c, 0x7f, 0x67, 0xb6, 0xfb, 0x47, 0x51, 0xfb, 0xf0, 0x2a, 0xb7, + 0xf8, 0x2e, 0x6e, 0xd7, 0xe5, 0xe6, 0xa5, 0x31, 0xa8, 0x17, 0x47, 0x36, 0xe9, 0x85, 0x68, 0x53, + 0x90, 0xa7, 0x56, 0x4d, 0x02, 0x20, 0x60, 0x79, 0xfb, 0x9e, 0xd4, 0x4e, 0x1a, 0x50, 0x90, 0x68, + 0x63, 0xd9, 0x1f, 0xfc, 0xb5, 0xe3, 0x01, 0xd1, 0x0e, 0xb9, 0x73, 0x25, 0x3e, 0xb5, 0xd6, 0xf8, + 0xb0, 0x30, 0xb6, 0xe2, 0x2c, 0x39 +}; +static unsigned int ECIntm_crl_len = 246; + diff --git a/test/regression/web_test/http_digest_authentication.c b/test/regression/web_test/http_digest_authentication.c new file mode 100644 index 00000000..0b4b7e43 --- /dev/null +++ b/test/regression/web_test/http_digest_authentication.c @@ -0,0 +1,179 @@ + +#define HTTP_MAX_BINARY_MD5 16 +#define HTTP_MAX_ASCII_MD5 32 +#define HTTP_SERVER_NONCE_SIZE 32 +#define HTTP_MAX_RESOURCE 64 + +VOID http_hex_ascii_convert(CHAR *source, UINT source_length, CHAR *destination) +{ + +UINT i,j; +CHAR digit; + + + /* Setup destination index. */ + j = 0; + + /* Loop to process the entire source string. */ + for (i = 0; i < source_length; i++) + { + + /* Pickup the first nibble. */ + digit = (source[i] >> 4) & 0xF; + + /* Convert to ASCII and store. */ + if (digit <= 9) + destination[j++] = (CHAR)(digit + '0'); + else + destination[j++] = (CHAR)(digit + 'a' - 10); + + /* Pickup the second nibble. */ + digit = source[i] & 0xF; + + /* Convert to ASCII and store. */ + if (digit <= 9) + destination[j++] = (CHAR)(digit + '0'); + else + destination[j++] = (CHAR)(digit + 'a' - 10); + } + + /* Finally, place a NULL in the destination string. */ + destination[j] = (CHAR) NX_NULL; +} + +UINT http_nonce_retrieve(NX_PACKET *packet_ptr, CHAR *nonce) +{ +UINT length; +UINT found; +CHAR *buffer_ptr; + + found = NX_FALSE; + length = 0; + nonce[0] = NX_NULL; + + buffer_ptr = (CHAR *) packet_ptr -> nx_packet_prepend_ptr; + + while (((buffer_ptr + 6) < (CHAR *) packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != (CHAR) 0)) + { + + /* Check for the uri token. */ + if (((*(buffer_ptr) == 'n') || (*(buffer_ptr) == 'N')) && + ((*(buffer_ptr+1) == 'o') || (*(buffer_ptr+1) == 'O')) && + ((*(buffer_ptr+2) == 'n') || (*(buffer_ptr+2) == 'N')) && + ((*(buffer_ptr+3) == 'c') || (*(buffer_ptr+3) == 'C')) && + ((*(buffer_ptr+4) == 'e') || (*(buffer_ptr+4) == 'E')) && + (*(buffer_ptr+5) == '=')) + { + + /* Move the pointer up to the actual authorization string. */ + buffer_ptr = buffer_ptr + 6; + found = NX_TRUE; + + break; + } + + /* Move the pointer up to the next character. */ + buffer_ptr++; + } + + if (found == NX_FALSE) + { + return(NX_NOT_FOUND); + } + + /* Now remove any extra blanks and quotes. */ + while ((buffer_ptr < (CHAR *) packet_ptr -> nx_packet_append_ptr) && ((*buffer_ptr == ' ') || (*buffer_ptr == (CHAR) 0x22))) + { + + /* Move the pointer up one character. */ + buffer_ptr++; + } + + /* Now pickup the nonce string. */ + length = 0; + while ((buffer_ptr < (CHAR *) packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != (CHAR) 0) && (*buffer_ptr != ' ') && (*buffer_ptr != (CHAR) 13) && (length < HTTP_SERVER_NONCE_SIZE)) + { + + /* Determine if the ending quote is present. */ + if (*buffer_ptr == (CHAR) 0x22) + { + + break; + } + + /* Copy a character of the authorization string into the destination. */ + nonce[length++] = *buffer_ptr++; + } + + nonce[length] = NX_NULL; + return(NX_SUCCESS); +} + +VOID http_digest_response_calculate(NX_MD5 *md5data, CHAR *username, CHAR *realm, CHAR *password, CHAR *nonce, CHAR *method, CHAR *uri, CHAR *nc, CHAR *cnonce, CHAR *result) +{ + +CHAR md5_binary[HTTP_MAX_BINARY_MD5]; +CHAR ha1_string[HTTP_MAX_ASCII_MD5 + 1]; +CHAR ha2_string[HTTP_MAX_ASCII_MD5 + 1]; +UINT username_length; +UINT password_length; +UINT realm_length; +UINT method_length; +UINT uri_length; +UINT nc_length; +UINT cnonce_length; + + /* Get string length. */ + username_length = strlen(username); + password_length = strlen(password); + realm_length = strlen(realm); + method_length = strlen(method); + uri_length = strlen(uri); + nc_length = strlen(nc); + cnonce_length = strlen(cnonce); + + + /* Calculate the H(A1) portion of the digest. */ + _nx_md5_initialize(md5data); + _nx_md5_update(md5data, (unsigned char *) username, username_length); + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) realm, realm_length); + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) password, password_length); + _nx_md5_digest_calculate(md5data, (unsigned char *) md5_binary); + + /* Convert this H(A1) portion to ASCII Hex representation. */ + http_hex_ascii_convert(md5_binary, HTTP_MAX_BINARY_MD5, ha1_string); + + /* Make the H(A2) portion of the digest. */ + _nx_md5_initialize(md5data); + _nx_md5_update(md5data, (unsigned char *) method, method_length); + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) uri, uri_length); + _nx_md5_digest_calculate(md5data, (unsigned char *) md5_binary); + + /* Convert this H(A2) portion to ASCII Hex representation. */ + http_hex_ascii_convert(md5_binary, HTTP_MAX_BINARY_MD5, ha2_string); + + /* Now make the final MD5 digest. */ + _nx_md5_initialize(md5data); + _nx_md5_update(md5data, (unsigned char *) ha1_string, sizeof(ha1_string) - 1); + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) nonce, HTTP_SERVER_NONCE_SIZE); + + /* Start of Internet Explorer bug work-around. */ + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) nc, nc_length); + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) cnonce, cnonce_length); + _nx_md5_update(md5data, (unsigned char *) ":auth", 5); + /* End of Internet Explorer bug work-around. */ + + _nx_md5_update(md5data, (unsigned char *) ":", 1); + _nx_md5_update(md5data, (unsigned char *) ha2_string, sizeof(ha2_string) - 1); + _nx_md5_digest_calculate(md5data, (unsigned char *) md5_binary); + + /* Finally, convert the response back to an ASCII string and place in + the destination. */ + http_hex_ascii_convert(md5_binary, HTTP_MAX_BINARY_MD5, result); +} \ No newline at end of file diff --git a/test/regression/web_test/netx_https_api_test.c b/test/regression/web_test/netx_https_api_test.c new file mode 100644 index 00000000..b6c83ace --- /dev/null +++ b/test/regression/web_test/netx_https_api_test.c @@ -0,0 +1,2149 @@ +#include +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_ip.h" + +#ifdef NX_WEB_HTTPS_ENABLE +#include "nx_secure_tls.h" +#endif + +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +#define TEST(prefix, name) void prefix ## _ ##name() +#define EXPECT_EQ(expected, actual) \ + if(expected != actual) \ + { \ + printf("\nERROR! File: %s Line: %d\n", __FILE__, __LINE__); \ + printf("Expected: 0x%x, (%d) Got: 0x%x (%d)\n", (int)expected, (int)expected, (int)actual, (int)actual); \ + error_counter++; \ + } + +#define EXPECT_TRUE(statement) \ + if(!statement) \ + { \ + printf("\nERROR! File: %s Line: %d\n", __FILE__, __LINE__); \ + printf("Expected statement to be true!\n"); \ + error_counter++; \ + } + + +//typedef void VOID; + +extern void test_control_return(UINT status); + +UINT nx_web_http_client_create_test(void); +UINT nx_web_http_client_delete_test(void); +UINT nx_web_http_client_get_start_test(void); +UINT nx_web_http_client_put_start_test(void); +UINT nx_web_http_client_post_start_test(void); +UINT nx_web_http_client_head_start_test(void); +UINT nx_web_http_client_delete_start_test(void); +#ifdef NX_WEB_HTTPS_ENABLE +UINT nx_web_http_client_get_secure_start_test(void); +UINT nx_web_http_client_put_secure_start_test(void); +UINT nx_web_http_client_post_secure_start_test(void); +UINT nx_web_http_client_head_secure_start_test(void); +UINT nx_web_http_client_delete_secure_start_test(void); +#endif +UINT nx_web_http_client_response_body_get_test(void); +UINT nx_web_http_client_put_packet_test(void); +UINT nx_web_http_client_response_header_callback_set_test(void); +UINT nx_web_http_client_request_initialize_test(void); +UINT nx_web_http_client_request_send_test(void); +UINT nx_web_http_client_request_header_add_test(void); +UINT nx_web_http_client_connect_test(void); +#ifdef NX_WEB_HTTPS_ENABLE +UINT nx_web_http_client_secure_connect_test(void); +#endif +UINT nx_web_http_server_callback_data_send_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_callback_response_send_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_content_get_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_create_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_delete_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_param_get_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_query_get_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_start_test(VOID *stack_memory, UINT stack_size); +#ifdef NX_WEB_HTTPS_ENABLE +UINT nx_web_http_server_secure_configure_test(VOID *stack_memory, UINT stack_size); +#endif +UINT nx_web_http_server_stop_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_content_get_extended_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_content_length_get_test(VOID *stack_memory, UINT stack_size); +#ifdef NX_WEB_HTTP_MULTIPART_ENABLE +UINT nx_web_http_server_get_entity_header_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_get_entity_content_test(VOID *stack_memory, UINT stack_size); +#endif +UINT nx_web_http_server_callback_generate_response_header_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_callback_packet_send_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_gmt_callback_set_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_cache_info_callback_set_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_mime_maps_additional_set_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_type_get_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_packet_content_find_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_packet_get_test(VOID *stack_memory, UINT stack_size); +UINT nx_web_http_server_invalid_userpassword_notify_set_test(VOID *stack_memory, UINT stack_size); + +#define DEMO_STACK_SIZE 4096 +#define TEST_WINDOW_SIZE 2000 +static UCHAR stack_memory[4096]; + +static UCHAR ip_data[4096]; +static UCHAR pool_data[4096]; + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) + +static TX_THREAD test_thread; +static NX_PACKET_POOL pool_0; +static NX_IP ip_0; + +void test_thread_entry(ULONG thread_input); + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + + +#ifdef CTEST +void test_application_define(void* first_unused_memory) +#else /* CTEST */ +void netx_https_api_test(void* first_unused_memory) +#endif /* CTEST */ +{ +UINT status; +UINT error_counter = 0; +CHAR *pointer; + + printf("NetX Test: HTTPS API Test............................................"); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the test thread. */ + status = tx_thread_create(&test_thread, "HTTPS API Test Thread", test_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&pool_0, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "HTTP Client IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&ip_0); + if (status) + error_counter++; + + +} + +void test_thread_entry(ULONG thread_input) +{ +UINT status; +UINT error_counter = 0; + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + + status = nx_web_http_client_create_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_delete_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_get_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_put_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_post_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_head_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_delete_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + +#ifdef NX_WEB_HTTPS_ENABLE + status = nx_web_http_client_get_secure_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_put_secure_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_post_secure_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_head_secure_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_delete_secure_start_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } +#endif + + status = nx_web_http_client_response_body_get_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_put_packet_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_response_header_callback_set_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_request_initialize_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_request_send_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_request_header_add_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_client_connect_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + status = nx_web_http_client_secure_connect_test(); + if(status != NX_SUCCESS) + { + error_counter++; + } +#endif + + + status = nx_web_http_server_callback_data_send_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_callback_response_send_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_content_get_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_create_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_delete_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_param_get_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_query_get_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_start_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + +#ifdef NX_WEB_HTTPS_ENABLE + status = nx_web_http_server_secure_configure_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } +#endif + + status = nx_web_http_server_stop_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_content_get_extended_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_content_length_get_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + +#ifdef NX_WEB_HTTP_MULTIPART_ENABLE + status = nx_web_http_server_get_entity_header_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_get_entity_content_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } +#endif + + status = nx_web_http_server_callback_generate_response_header_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_callback_packet_send_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_gmt_callback_set_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_cache_info_callback_set_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_mime_maps_additional_set_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_type_get_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_packet_content_find_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_packet_get_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + status = nx_web_http_server_invalid_userpassword_notify_set_test(stack_memory, sizeof(stack_memory)); + if(status != NX_SUCCESS) + { + error_counter++; + } + + nx_ip_delete(&ip_0); + nx_packet_pool_delete(&pool_0); + tx_thread_delete(&test_thread); + + if(error_counter > 0) + { + printf("FAILURE!!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/************************ Utility functions. **************************/ +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + + +UINT server_auth_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + return(NX_SUCCESS); +} + +UINT server_req_notify(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ + return(NX_SUCCESS); +} + + +/************************ Begin test cases. **************************/ + +UINT nx_web_http_client_create_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +UINT error_counter = 0; + + /* Setup the IP instance so tests will pass. */ + ip_0.nx_ip_id = NX_IP_ID; + + memset(&http_client, 0, sizeof(NX_WEB_HTTP_CLIENT)); + status = nx_web_http_client_create(NX_NULL, "Name", &ip_0, &pool_0, TEST_WINDOW_SIZE); + EXPECT_EQ(NX_PTR_ERROR, status); + + memset(&http_client, 0, sizeof(NX_WEB_HTTP_CLIENT)); + status = nx_web_http_client_create(&http_client, "Name", NX_NULL, &pool_0, TEST_WINDOW_SIZE); + EXPECT_EQ(NX_PTR_ERROR, status); + + memset(&http_client, 0, sizeof(NX_WEB_HTTP_CLIENT)); + status = nx_web_http_client_create(&http_client, "Name", &ip_0, NX_NULL, TEST_WINDOW_SIZE); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Name can be NULL. */ + memset(&http_client, 0, sizeof(NX_WEB_HTTP_CLIENT)); + status = nx_web_http_client_create(&http_client, NX_NULL, &ip_0, &pool_0, TEST_WINDOW_SIZE); + EXPECT_EQ(NX_SUCCESS, status); + + /* Proper usage test for cases below. */ + status = nx_web_http_client_delete(&http_client); + EXPECT_EQ(NX_SUCCESS, status); + status = nx_web_http_client_create(&http_client, "Name", &ip_0, &pool_0, TEST_WINDOW_SIZE); + EXPECT_EQ(NX_SUCCESS, status); + + EXPECT_EQ(http_client.nx_web_http_client_ip_ptr, &ip_0); + + EXPECT_EQ(http_client.nx_web_http_client_packet_pool_ptr, &pool_0); + + EXPECT_EQ(http_client.nx_web_http_client_state, NX_WEB_HTTP_CLIENT_STATE_READY); + + EXPECT_EQ(http_client.nx_web_http_client_method, NX_WEB_HTTP_METHOD_NONE); + + EXPECT_EQ(http_client.nx_web_http_client_id, NX_WEB_HTTP_CLIENT_ID); + status = nx_web_http_client_delete(&http_client); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_delete_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_delete", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_delete(NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete(&http_client); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + + +UINT nx_web_http_client_get_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + /*NX_WEB_HTTP_CLIENT *client_ptr, NXD_ADDRESS *ip_address, UINT server_port, + CHAR *resource, CHAR *username, CHAR *password, + ULONG wait_option)*/ + http_client.nx_web_http_client_id = NX_WEB_HTTP_CLIENT_ID; + + status = nx_web_http_client_get_start(NX_NULL, &ip_addr, 0, resource, "www.abc.com", NX_NULL, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_get_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_get_start(&http_client, NX_NULL, 0, resource, "www.abc.com", NX_NULL, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_get_start(&http_client, &ip_addr, 0, NX_NULL, "www.abc.com", NX_NULL, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + http_client.nx_web_http_client_id = 0; + status = nx_web_http_client_get_start(&http_client, &ip_addr, 0, resource, "www.abc.com", NX_NULL, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + + +UINT nx_web_http_client_put_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + /* Control block not initialized. */ + status = nx_web_http_client_put_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_put_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_put_start(NX_NULL, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_put_start(&http_client, NX_NULL, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_put_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_post_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_post_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_post_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_post_start(NX_NULL, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_post_start(&http_client, NX_NULL, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_post_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", 100, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_head_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_head_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_head_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_head_start(NX_NULL, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_head_start(&http_client, NX_NULL, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_head_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_delete_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_delete_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_delete_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_delete_start(NX_NULL, &ip_addr, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete_start(&http_client, NX_NULL, NX_WEB_HTTP_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete_start(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete(&http_client); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +#ifdef NX_WEB_HTTPS_ENABLE +UINT nx_web_http_client_get_secure_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_get_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_get_secure_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_get_secure_start(NX_NULL, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_get_secure_start(&http_client, NX_NULL, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_get_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_get_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete(&http_client); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_put_secure_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_put_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_put_secure_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_put_secure_start(NX_NULL, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_put_secure_start(&http_client, NX_NULL, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_put_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_put_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_post_secure_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_post_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_post_secure_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_post_secure_start(NX_NULL, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_post_secure_start(&http_client, NX_NULL, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_post_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", 100, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_post_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", 100, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_head_secure_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_head_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_head_secure_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_head_secure_start(NX_NULL, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_head_secure_start(&http_client, NX_NULL, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_head_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_head_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_delete_secure_start_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NXD_ADDRESS ip_addr; +CHAR *resource = "test"; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_delete_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_delete_secure_start", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_delete_secure_start(NX_NULL, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete_secure_start(&http_client, NX_NULL, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, NX_NULL, "www.abc.com", "name", "password", tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_delete_secure_start(&http_client, &ip_addr, NX_WEB_HTTPS_SERVER_PORT, resource, "www.abc.com", "name", "password", NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +UINT nx_web_http_client_response_body_get_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NX_PACKET *packet_ptr; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_response_body_get(&http_client, &packet_ptr, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_response_body_get", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_response_body_get(NX_NULL, &packet_ptr, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_response_body_get(&http_client, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_put_packet_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +NX_PACKET packet; +UINT status; +UINT error_counter = 0; + + nx_web_http_client_delete(&http_client); + + /* Control block not initialized. */ + status = nx_web_http_client_put_packet(&http_client, &packet, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_put_packet", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_put_packet(NX_NULL, &packet, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_put_packet(&http_client, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + + +static VOID response_header_callback(NX_WEB_HTTP_CLIENT *client_ptr, CHAR *field_name, UINT field_name_length, + CHAR *field_value, UINT field_value_length) +{ + +} + +UINT nx_web_http_client_response_header_callback_set_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_response_header_callback_set", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_response_header_callback_set(NX_NULL, response_header_callback); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_response_header_callback_set(&http_client, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_request_initialize_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +CHAR *resource = "resource"; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_request_initialize", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_request_initialize(NX_NULL, NX_WEB_HTTP_METHOD_GET, resource, "www.abc.com", 0, NX_FALSE, + "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_request_initialize(&http_client, NX_WEB_HTTP_METHOD_GET, NX_NULL, "www.abc.com", 0, NX_FALSE, + "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_request_initialize(&http_client, NX_WEB_HTTP_METHOD_NONE, resource, "www.abc.com", 0, NX_FALSE, + "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_WEB_HTTP_METHOD_ERROR, status); + + /* Test method parameters. */ + status = nx_web_http_client_request_initialize(&http_client, NX_WEB_HTTP_METHOD_PUT, resource, "www.abc.com", 0, NX_FALSE, + "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_WEB_HTTP_METHOD_ERROR, status); + + status = nx_web_http_client_request_initialize(&http_client, NX_WEB_HTTP_METHOD_POST, resource, "www.abc.com", 0, NX_FALSE, + "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_WEB_HTTP_METHOD_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_request_send_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_request_send", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_request_send(NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_request_header_add_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_client_create(&http_client, "nx_web_http_client_request_header_add", + &ip_0, &pool_0, TEST_WINDOW_SIZE); + + status = nx_web_http_client_request_header_add(NX_NULL, "field_name", sizeof("field_name"), + "field_value", sizeof("field_value"), NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_request_header_add(&http_client, NX_NULL, sizeof("field_name"), + "field_value", sizeof("field_value"), NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_request_header_add(&http_client, "field_name", sizeof("field_name"), + NX_NULL, sizeof("field_value"), NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_client_delete(&http_client); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_client_connect_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +NXD_ADDRESS ip_addr; +UINT error_counter = 0; + + status = nx_web_http_client_connect(NX_NULL, &ip_addr, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_connect(&http_client, NX_NULL, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +#ifdef NX_WEB_HTTPS_ENABLE +UINT nx_web_http_client_secure_connect_test(void) +{ +NX_WEB_HTTP_CLIENT http_client; +UINT status; +NXD_ADDRESS ip_addr; +UINT error_counter = 0; + + status = nx_web_http_client_secure_connect(NX_NULL, &ip_addr, NX_WEB_HTTP_SERVER_PORT, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_secure_connect(&http_client, NX_NULL, NX_WEB_HTTP_SERVER_PORT, tls_callback, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_client_secure_connect(&http_client, &ip_addr, NX_WEB_HTTP_SERVER_PORT, NX_NULL, NX_WAIT_FOREVER); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} +#endif + +UINT nx_web_http_server_callback_data_send_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UCHAR *data_ptr = "data to send"; +UINT data_length = sizeof("data to send"); +UINT status; +UINT error_counter = 0; + + /* Control block not initialized. */ + status = nx_web_http_server_callback_data_send(&http_server, data_ptr, data_length); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + + status = nx_web_http_server_create(&http_server, "nx_web_http_server_callback_data_send", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_callback_data_send(NX_NULL, data_ptr, data_length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_callback_data_send(&http_server, NX_NULL, data_length); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_callback_response_send_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +CHAR *header = "header"; +CHAR *information = "info"; +CHAR *additional_info = "additional info"; +UINT status; +UINT error_counter = 0; + + + status = nx_web_http_server_callback_response_send(NX_NULL, header, information, additional_info); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_callback_response_send(&http_server, NX_NULL, information, additional_info); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_content_get_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +NX_PACKET packet; +CHAR dest_buffer[100]; +CHAR dest_size = sizeof(dest_buffer); +UINT actual_size; +UINT error_counter = 0; + + /* Control block not initialized. */ + status = nx_web_http_server_content_get(&http_server, &packet, 0, dest_buffer, dest_size, &actual_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_content_get", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_content_get(NX_NULL, &packet, 0, dest_buffer, dest_size, &actual_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_get(&http_server, NX_NULL, 0, dest_buffer, dest_size, &actual_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_get(&http_server, &packet, 0, NX_NULL, dest_size, &actual_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_get(&http_server, &packet, 0, dest_buffer, dest_size, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_create_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + + status = nx_web_http_server_create(NX_NULL, "nx_web_http_server_create", + NX_NULL, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + status = nx_web_http_server_create(&http_server, "nx_web_http_server_create", + NX_NULL, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + status = nx_web_http_server_create(&http_server, "nx_web_http_server_create", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + NX_NULL, stack_size, &pool_0, + server_auth_check, server_req_notify); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + status = nx_web_http_server_create(&http_server, "nx_web_http_server_create", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, NX_NULL, + server_auth_check, server_req_notify); + EXPECT_EQ(NX_PTR_ERROR, status); + + nx_web_http_server_delete(&http_server); + + /* Create server - expect successful return for following checks. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_create", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + EXPECT_EQ(NX_SUCCESS, status); + + EXPECT_EQ((ULONG)(&http_server), http_server.nx_web_http_server_tcpserver.nx_tcpserver_reserved); + EXPECT_EQ(&ip_0, http_server.nx_web_http_server_ip_ptr); + EXPECT_EQ(&pool_0, http_server.nx_web_http_server_packet_pool_ptr); + EXPECT_EQ(server_auth_check, http_server.nx_web_http_server_authentication_check); + EXPECT_EQ(server_req_notify, http_server.nx_web_http_server_request_notify); + EXPECT_EQ(NX_WEB_HTTP_SERVER_ID, http_server.nx_web_http_server_id); + EXPECT_EQ(NX_WEB_HTTP_SERVER_PORT, http_server.nx_web_http_server_listen_port); + + nx_web_http_server_delete(&http_server); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_delete_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_delete", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_delete(NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + + +UINT nx_web_http_server_param_get_test(VOID *stack_memory, UINT stack_size) +{ +NX_PACKET packet; +CHAR param_buf[100]; +UINT param_size; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_param_get(NX_NULL, 1, param_buf, ¶m_size, sizeof(param_buf)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_param_get(&packet, 1, NX_NULL, ¶m_size, sizeof(param_buf)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_param_get(&packet, 1, param_buf, NX_NULL, sizeof(param_buf)); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_query_get_test(VOID *stack_memory, UINT stack_size) +{ +NX_PACKET packet; +CHAR param_buf[100]; +UINT param_size; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_query_get(NX_NULL, 1, param_buf, ¶m_size, sizeof(param_buf)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_query_get(&packet, 1, NX_NULL, ¶m_size, sizeof(param_buf)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_query_get(&packet, 1, param_buf, NX_NULL, sizeof(param_buf)); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_start_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_start(&http_server); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_start(NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +#ifdef NX_WEB_HTTPS_ENABLE +UINT nx_web_http_server_secure_configure_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; + +const NX_SECURE_TLS_CRYPTO crypto_table; +UCHAR metadata_buffer[100]; +UCHAR packet_buffer[100]; +NX_SECURE_X509_CERT identity_certificate; +NX_SECURE_X509_CERT *trusted_certificates[1]; +NX_SECURE_X509_CERT *remote_certificates[1]; +UCHAR remote_certificate_buffer[100]; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_secure_configure", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_secure_configure(NX_NULL, &crypto_table, metadata_buffer, sizeof(metadata_buffer), + packet_buffer, sizeof(packet_buffer), &identity_certificate, + trusted_certificates, 1, remote_certificates, 1, + remote_certificate_buffer, sizeof(remote_certificate_buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_secure_configure(&http_server, NX_NULL, metadata_buffer, sizeof(metadata_buffer), + packet_buffer, sizeof(packet_buffer), &identity_certificate, + trusted_certificates, 1, remote_certificates, 1, + remote_certificate_buffer, sizeof(remote_certificate_buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_secure_configure(&http_server, &crypto_table, NX_NULL, sizeof(metadata_buffer), + packet_buffer, sizeof(packet_buffer), &identity_certificate, + trusted_certificates, 1, remote_certificates, 1, + remote_certificate_buffer, sizeof(remote_certificate_buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_secure_configure(&http_server, &crypto_table, metadata_buffer, sizeof(metadata_buffer), + NX_NULL, sizeof(packet_buffer), &identity_certificate, + trusted_certificates, 1, remote_certificates, 1, + remote_certificate_buffer, sizeof(remote_certificate_buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_secure_configure(&http_server, &crypto_table, metadata_buffer, sizeof(metadata_buffer), + packet_buffer, sizeof(packet_buffer), NX_NULL, + trusted_certificates, 1, remote_certificates, 1, + remote_certificate_buffer, sizeof(remote_certificate_buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} +#endif + +UINT nx_web_http_server_stop_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_stop(&http_server); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_stop(NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_content_get_extended_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET packet; +CHAR buffer[100]; +UINT content_size; +UINT status; +UINT error_counter = 0; + + /* Control block not initialized. */ + status = nx_web_http_server_content_get_extended(&http_server, &packet, 0, buffer, sizeof(buffer), &content_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_content_get_extended", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_content_get_extended(NX_NULL, &packet, 0, buffer, sizeof(buffer), &content_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_get_extended(&http_server, NX_NULL, 0, buffer, sizeof(buffer), &content_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_get_extended(&http_server, &packet, 0, NX_NULL, sizeof(buffer), &content_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_get_extended(&http_server, &packet, 0, buffer, sizeof(buffer), NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_content_length_get_test(VOID *stack_memory, UINT stack_size) +{ +NX_PACKET packet; +ULONG length; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_content_length_get(NX_NULL, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_content_length_get(&packet, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +#ifdef NX_WEB_HTTP_MULTIPART_ENABLE +UINT nx_web_http_server_get_entity_header_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET *packet_ptr; +UCHAR buffer[100]; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_get_entity_header(&http_server, &packet_ptr, buffer, sizeof(buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_get_entity_header", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_get_entity_header(NX_NULL, &packet_ptr, buffer, sizeof(buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_get_entity_header(&http_server, NX_NULL, buffer, sizeof(buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_get_entity_header(&http_server, &packet_ptr, NX_NULL, sizeof(buffer)); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_get_entity_content_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET *packet_ptr; +ULONG offset; +ULONG length; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_get_entity_content(&http_server, &packet_ptr, &offset, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_get_entity_content", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_get_entity_content(NX_NULL, &packet_ptr, &offset, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_get_entity_content(&http_server, NX_NULL, &offset, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_get_entity_content(&http_server, &packet_ptr, NX_NULL, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_get_entity_content(&http_server, &packet_ptr, &offset, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} +#endif + +UINT nx_web_http_server_callback_generate_response_header_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET *packet_ptr; +CHAR *status_code = "404"; +CHAR *content_type = "text"; +CHAR *header = "header"; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_callback_generate_response_header(&http_server, &packet_ptr, status_code, 100, content_type, header); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_callback_generate_response_header", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_callback_generate_response_header(NX_NULL, &packet_ptr, status_code, 100, content_type, header); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_callback_generate_response_header(&http_server, NX_NULL, status_code, 100, content_type, header); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_callback_generate_response_header(&http_server, &packet_ptr, NX_NULL, 100, content_type, header); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_callback_packet_send_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET packet; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_callback_packet_send(&http_server, &packet); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_callback_packet_send", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_callback_packet_send(NX_NULL, &packet); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_callback_packet_send(&http_server, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +static VOID gmt_callback(NX_WEB_HTTP_SERVER_DATE *date) +{ + +} + +UINT nx_web_http_server_gmt_callback_set_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_gmt_callback_set(&http_server, gmt_callback); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_gmt_callback_set", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_gmt_callback_set(NX_NULL, gmt_callback); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_gmt_callback_set(&http_server, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + + + +UINT cache_info_callback(CHAR *resource, UINT *age, NX_WEB_HTTP_SERVER_DATE *date) +{ + return(NX_SUCCESS); +} + + +UINT nx_web_http_server_cache_info_callback_set_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_cache_info_callback_set (&http_server, cache_info_callback); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_cache_info_callback_set ", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_cache_info_callback_set (NX_NULL, cache_info_callback); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_cache_info_callback_set (&http_server, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_mime_maps_additional_set_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_WEB_HTTP_SERVER_MIME_MAP mime_map; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_mime_maps_additional_set(&http_server, &mime_map, 1); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_mime_maps_additional_set", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_mime_maps_additional_set(NX_NULL, &mime_map, 1); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_mime_maps_additional_set(&http_server, NX_NULL, 1); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_type_get_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +CHAR name[100]; +CHAR type_string[100]; +UINT string_size; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_type_get(&http_server, name, type_string, &string_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_type_get", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_type_get(NX_NULL, name, type_string, &string_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_type_get(&http_server, NX_NULL, type_string, &string_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_type_get(&http_server, name, NX_NULL, &string_size); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_type_get(&http_server, name, type_string, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_packet_content_find_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET *packet_ptr; +ULONG length; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_packet_content_find(&http_server, &packet_ptr, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_packet_content_find", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_packet_content_find(NX_NULL, &packet_ptr, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_packet_content_find(&http_server, NX_NULL, &length); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_packet_content_find(&http_server, &packet_ptr, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +UINT nx_web_http_server_packet_get_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +NX_PACKET *packet_ptr; +UINT status; +UINT error_counter = 0; + + status = nx_web_http_server_packet_get(&http_server, &packet_ptr); + EXPECT_EQ(NX_PTR_ERROR, status); + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_packet_get", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_packet_get(NX_NULL, &packet_ptr); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_packet_get(&http_server, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +static UINT invalid_username_password_callback(CHAR *resource, NXD_ADDRESS *client_nxd_address, UINT request_type) +{ + return(NX_SUCCESS); +} + +UINT nx_web_http_server_invalid_userpassword_notify_set_test(VOID *stack_memory, UINT stack_size) +{ +NX_WEB_HTTP_SERVER http_server; +UINT status; +UINT error_counter = 0; + + /* Create web server instance for test. */ + status = nx_web_http_server_create(&http_server, "nx_web_http_server_invalid_userpassword_notify_set", + &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL, + stack_memory, stack_size, &pool_0, + server_auth_check, server_req_notify); + + status = nx_web_http_server_invalid_userpassword_notify_set(NX_NULL, invalid_username_password_callback); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_invalid_userpassword_notify_set(&http_server, NX_NULL); + EXPECT_EQ(NX_PTR_ERROR, status); + + status = nx_web_http_server_delete(&http_server); + EXPECT_EQ(NX_SUCCESS, status); + + if(error_counter > 0) + { + return(1); + } + + return(NX_SUCCESS); +} + +/******************************************************************************** + * Python used to generate skeleton test cases: +#!/bin/python + +def gen_client_tests(input_list): + ret_str = "" + for name in input_list: + ret_str += "\nUINT " + name + "(void)\n{" + ret_str += "\nNX_WEB_HTTP_CLIENT http_client;" + ret_str += "\nUINT status;" + ret_str += "\n " + ret_str += "\n / * Create web server instance for test. * /" + ret_str += "\n status = nx_web_http_client_create(&http_client, \"" + name + "\"," + ret_str += "\n &ip_0, &pool_0, TEST_WINDOW_SIZE);" + ret_str += "\n " + ret_str += "\n status = " + name + "(&http_client, );" + ret_str += "\n EXPECT_EQ(NX_PTR_ERROR, status);" + ret_str += "\n " + ret_str += "\n return(NX_SUCCESS);\n}\n" + return ret_str + +def gen_server_tests(input_list): + ret_str = "" + for name in input_list: + ret_str += "\nUINT " + name + "_test(VOID *stack_memory, UINT stack_size)\n{" + ret_str += "\nNX_WEB_HTTP_SERVER http_server;" + ret_str += "\nUINT status;" + ret_str += "\n / * Create web server instance for test. * /" + ret_str += "\n status = nx_web_http_server_create(&http_server, \"" + name + "\"," + ret_str += "\n &ip_0, NX_WEB_HTTP_SERVER_PORT, NX_NULL," + ret_str += "\n stack_memory, stack_size, &pool_0," + ret_str += "\n server_auth_check, server_req_notify);" + ret_str += "\n " + ret_str += "\n status = " + name + "(&http_server, );" + ret_str += "\n EXPECT_EQ(NX_PTR_ERROR, status);" + ret_str += "\n " + ret_str += "\n return(NX_SUCCESS);\n}\n" + return ret_str + +def gen_server_prototypes(input_list): + ret_str = "" + for name in input_list: + ret_str += "\nUINT " + name + "_test(VOID *stack_memory, UINT stack_size);" + return ret_str + + +def gen_client_prototypes(input_list): + ret_str = "" + for name in input_list: + ret_str += "\nUINT " + name + "_test(void);" + return ret_str + +def gen_server_calls(input_list): + ret_str = "" + for name in input_list: + ret_str += "\n status = " + name + "_test(stack_memory, sizeof(stack_memory));" + ret_str += "\n if(status != NX_SUCCESS)" + ret_str += "\n {" + ret_str += "\n test_control_return(1);" + ret_str += "\n }" + ret_str += "\n " + return ret_str + +def gen_client_calls(input_list): + ret_str = "" + for name in input_list: + ret_str += "\n status = " + name + "_test();" + ret_str += "\n if(status != NX_SUCCESS)" + ret_str += "\n {" + ret_str += "\n test_control_return(1);" + ret_str += "\n }" + ret_str += "\n" + return ret_str + +def gen_all_tests(): + ret_str = "" + ret_str += gen_client_prototypes(client_api_list) + ret_str += gen_server_prototypes(server_api_list) + ret_str += gen_client_calls(client_api_list) + ret_str += gen_server_calls(server_api_list) + ret_str += gen_client_tests(client_api_list) + ret_str += gen_server_tests(server_api_list) + return ret_str + +def write_tests(): + f = open("./test.c", "w") + tests = gen_all_tests() + f.write(tests) + f.close() + +client_api_list = [ "nx_web_http_client_create", +"nx_web_http_client_delete", +"nx_web_http_client_get_start", +"nx_web_http_client_put_start", +"nx_web_http_client_post_start", +"nx_web_http_client_head_start", +"nx_web_http_client_delete_start", +"nx_web_http_client_get_secure_start", +"nx_web_http_client_put_secure_start", +"nx_web_http_client_post_secure_start", +"nx_web_http_client_head_secure_start", +"nx_web_http_client_delete_secure_start", +"nx_web_http_client_response_body_get", +"nx_web_http_client_put_packet", +"nx_web_http_client_response_header_callback_set", +"nx_web_http_client_request_initialize", +"nx_web_http_client_request_send", +"nx_web_http_client_request_header_add", +"nx_web_http_client_connect", +"nx_web_http_client_secure_connect" ] + +server_api_list = [ "nx_web_http_server_callback_data_send", +"nx_web_http_server_callback_response_send", +"nx_web_http_server_content_get", +"nx_web_http_server_create", +"nx_web_http_server_delete", +"nx_web_http_server_param_get", +"nx_web_http_server_query_get", +"nx_web_http_server_start", +"nx_web_http_server_secure_configure", +"nx_web_http_server_stop", +"nx_web_http_server_content_get_extended", +"nx_web_http_server_content_length_get", +"nx_web_http_server_get_entity_header", +"nx_web_http_server_get_entity_content", +"nx_web_http_server_callback_generate_response_header", +"nx_web_http_server_callback_packet_send", +"nx_web_http_server_gmt_callback_set", +"nx_web_http_server_cache_info_callback_set ", +"nx_web_http_server_mime_maps_additional_set", +"nx_web_http_server_type_get", +"nx_web_http_server_packet_content_find", +"nx_web_http_server_packet_get", +"nx_web_http_server_invalid_userpassword_notify_set" ] + +*/ + + diff --git a/test/regression/web_test/netx_https_testcontrol.c b/test/regression/web_test/netx_https_testcontrol.c new file mode 100644 index 00000000..e8ab7818 --- /dev/null +++ b/test/regression/web_test/netx_https_testcontrol.c @@ -0,0 +1,551 @@ +/* This is the test control routine the NetX TCP/IP stack. All tests are dispatched from this routine. */ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include +#include +#include "nx_ram_network_driver_test_1500.h" + +/* +#define NETXTEST_TIMEOUT_DISABLE +*/ + +#define TEST_STACK_SIZE 4096 + +/* 1 minute. */ +#define TEST_TIMEOUT_LOW (60 * NX_IP_PERIODIC_RATE) +/* 15 minutes. */ +#define TEST_TIMEOUT_MID (900 * NX_IP_PERIODIC_RATE) +/* 120 minutes. */ +#define TEST_TIMEOUT_HIGH (7200 * NX_IP_PERIODIC_RATE) + +/* Define the test control ThreadX objects... */ + +TX_THREAD test_control_thread; +#ifndef NETXTEST_TIMEOUT_DISABLE +TX_SEMAPHORE test_control_sema; +#endif + +/* Define the test control global variables. */ + +ULONG test_control_return_status; +ULONG test_control_successful_tests; +ULONG test_control_failed_tests; +ULONG test_control_warning_tests; +ULONG test_control_na_tests; + +/* Remember the start of free memory. */ + +UCHAR *test_free_memory_ptr; + +extern volatile UINT _tx_thread_preempt_disable; + +/* Define test entry pointer type. */ + +typedef struct TEST_ENTRY_STRUCT +{ + VOID (*test_entry)(void *); + UINT timeout; +} TEST_ENTRY; + + +/* Define the prototypes for the test entry points. */ +void netx_https_api_test(void*); +void netx_web_basic_test_application_define(void *); +void netx_web_basic_ecc_test_application_define(void *); +void netx_web_put_basic_test_application_define(void *); +void netx_web_post_basic_test_application_define(void *); +void netx_web_delete_basic_test_application_define(void *); +void netx_web_head_basic_test_application_define(void *); +void netx_web_request_in_multiple_packets_test_application_define(void *); +void netx_web_basic_authenticate_test_application_define(void *); +void netx_web_if_modified_since_test_application_define(void *); +void netx_web_status_400_test_application_define(void *); +void netx_web_status_404_test_application_define(void *); +void netx_web_status_501_test_application_define(void *); +void netx_web_get_content_length_test_application_define(void *); +void netx_web_get_put_referred_URI_test_application_define(void *); +void netx_web_multipart_fragment_test_application_define(void *); +void netx_web_multipart_underflow_test_application_define(void *); +void netx_web_multiple_sessions_test_application_define(void *); +void netx_web_multiple_sessions_timeout_test_application_define(void *); +void netx_web_response_in_multiple_packets_test_application_define(void *); +void netx_web_connect_three_times_test_application_define(void *); +void netx_web_keep_alive_test_application_define(void *); +void netx_web_digest_authenticate_test_application_define(void *); +void netx_web_digest_authenticate_test_2_application_define(void *); +void netx_web_server_content_process_test_application_define(void *); +void netx_web_concurrent_sessions_test_application_define(void *); +void netx_web_post_basic_test_application_define(void *first_unused_memory); +void netx_web_post_large_packet_test_application_define(void *first_unused_memory); +void netx_web_host_field_test_application_define(void *); +void netx_web_chunked_request_test_application_define(void *); +void netx_web_chunked_request_additional_test_application_define(void *); +void netx_web_chunked_response_test_application_define(void *); +void netx_web_chunked_response_process_test_application_define(void *); +void netx_web_chunked_response_packet_chain_test_application_define(void *); +void netx_web_client_cleanup_test_application_define(void *); +void netx_web_server_chunked_content_process_test_application_define(void *); +void netx_web_packet_allocate_test_application_define(void *); +void netx_web_status_code_test_application_define(void *); +void netx_web_secure_connect_fail_test_application_define(void *); +void netx_web_tcpserver_rst_test_application_define(void *); +void netx_web_tcpserver_two_listen_test_application_define(void *); +void netx_web_abnormal_test_application_define(void *); +void netx_web_client_send_fail_test_application_define(void *); +void netx_web_client_receive_no_packet_test_application_define(void *); +void netx_web_keep_alive_abnormal_test_application_define(void *); +void netx_web_one_session_test_application_define(void *); +void netx_web_server_type_get_extended_test_application_define(void *); +void netx_web_secure_reconnect_test_application_define(void *); +void netx_web_non_block_basic_test_application_define(void *); +void netx_web_non_block_reconnect_test_application_define(void *); +void netx_web_tcpserver_tls_faile_rst_test_application_define(void *); +void netx_web_invalid_release_test_application_define(void *); +void netx_web_certifiacet_verify_test_application_define(void *); +void netx_web_client_rst_test_application_define(void *); +void netx_web_basic_authenticate_empty_test_application_define(void *); +void netx_web_digest_authenticate_timeout_test_application_define(void *); +void test_application_define(void *); + +/* Define the array of test entry points. */ + +TEST_ENTRY test_control_tests[] = +{ +#ifdef CTEST + {test_application_define, TEST_TIMEOUT_MID}, +#else /* CTEST */ + {netx_https_api_test, TEST_TIMEOUT_MID}, + {netx_web_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_basic_ecc_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_basic_authenticate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_request_in_multiple_packets_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_if_modified_since_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_get_content_length_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_multipart_fragment_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_multipart_underflow_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_status_404_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_multiple_sessions_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_multiple_sessions_timeout_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_response_in_multiple_packets_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_connect_three_times_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_put_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_post_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_head_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_delete_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_get_put_referred_URI_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_digest_authenticate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_digest_authenticate_test_2_application_define, TEST_TIMEOUT_LOW}, + {netx_web_server_content_process_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_concurrent_sessions_test_application_define, TEST_TIMEOUT_MID}, + {netx_web_post_large_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_host_field_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_chunked_response_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_chunked_request_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_chunked_request_additional_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_chunked_response_process_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_chunked_response_packet_chain_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_client_cleanup_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_keep_alive_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_server_chunked_content_process_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_packet_allocate_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_status_code_test_application_define, TEST_TIMEOUT_MID}, + {netx_web_secure_connect_fail_test_application_define,TEST_TIMEOUT_LOW}, + {netx_web_tcpserver_rst_test_application_define,TEST_TIMEOUT_LOW}, + {netx_web_tcpserver_two_listen_test_application_define,TEST_TIMEOUT_LOW}, + {netx_web_abnormal_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_client_send_fail_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_client_receive_no_packet_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_keep_alive_abnormal_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_one_session_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_server_type_get_extended_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_secure_reconnect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_non_block_basic_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_non_block_reconnect_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_tcpserver_tls_faile_rst_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_invalid_release_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_certifiacet_verify_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_client_rst_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_basic_authenticate_empty_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_digest_authenticate_timeout_test_application_define, TEST_TIMEOUT_LOW}, + + /* Not support. */ +#if 0 + {netx_web_status_400_test_application_define, TEST_TIMEOUT_LOW}, + {netx_web_status_501_test_application_define, TEST_TIMEOUT_LOW}, +#endif +#endif /* CTEST */ + {TX_NULL, TEST_TIMEOUT_LOW}, +}; + +/* Define thread prototypes. */ + +void test_control_thread_entry(ULONG thread_input); +void test_control_return(UINT status); +void test_control_cleanup(void); +void _nx_ram_network_driver_reset(void); + +/* Define necessary external references. */ + +#ifdef __ghs +extern TX_MUTEX __ghLockMutex; +#endif + +extern TX_TIMER *_tx_timer_created_ptr; +extern ULONG _tx_timer_created_count; +#ifndef TX_TIMER_PROCESS_IN_ISR +extern TX_THREAD _tx_timer_thread; +#endif +extern TX_THREAD *_tx_thread_created_ptr; +extern ULONG _tx_thread_created_count; +extern TX_SEMAPHORE *_tx_semaphore_created_ptr; +extern ULONG _tx_semaphore_created_count; +extern TX_QUEUE *_tx_queue_created_ptr; +extern ULONG _tx_queue_created_count; +extern TX_MUTEX *_tx_mutex_created_ptr; +extern ULONG _tx_mutex_created_count; +extern TX_EVENT_FLAGS_GROUP *_tx_event_flags_created_ptr; +extern ULONG _tx_event_flags_created_count; +extern TX_BYTE_POOL *_tx_byte_pool_created_ptr; +extern ULONG _tx_byte_pool_created_count; +extern TX_BLOCK_POOL *_tx_block_pool_created_ptr; +extern ULONG _tx_block_pool_created_count; + +extern NX_PACKET_POOL * _nx_packet_pool_created_ptr; +extern ULONG _nx_packet_pool_created_count; +extern NX_IP * _nx_ip_created_ptr; +extern ULONG _nx_ip_created_count; + +/* Define main entry point. */ + +int main() +{ + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); + + + return 0; +} + +//#define TEST_FREE_MEMORY_POOL_SIZE (100 * 1024) +//static ULONG test_free_memory_pool[TEST_FREE_MEMORY_POOL_SIZE / sizeof(ULONG)]; +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + UCHAR *pointer; + + /* Setup a pointer to the first unused memory. */ + pointer = (UCHAR *) first_unused_memory; + + /* Create the test control thread. */ + tx_thread_create(&test_control_thread, "test control thread", test_control_thread_entry, 0, + pointer, TEST_STACK_SIZE, + 0, 0, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + TEST_STACK_SIZE; + +#ifndef NETXTEST_TIMEOUT_DISABLE + /* Create the test control semaphore. */ + tx_semaphore_create(&test_control_sema, "HTTPS Test control semaphore", 0); +#endif + + /* Remember the free memory pointer. */ + //test_free_memory_ptr = (UCHAR*)test_free_memory_pool; + test_free_memory_ptr = pointer; + + fx_system_initialize(); +} + +/* Define the test control thread. This thread is responsible for dispatching all of the +tests in the ThreadX test suite. */ + +void test_control_thread_entry(ULONG thread_input) +{ + UINT i; + + /* Loop to process all tests... */ + i = 0; + while (test_control_tests[i].test_entry != TX_NULL) + { + + /* Dispatch the test. */ + (test_control_tests[i++].test_entry)(test_free_memory_ptr); + + if (test_control_return_status != 3) + { + +#ifdef NETXTEST_TIMEOUT_DISABLE + /* Suspend control test to allow test to run. */ + tx_thread_suspend(&test_control_thread); +#else + if(tx_semaphore_get(&test_control_sema, test_control_tests[i - 1].timeout)) + { + + /* Test case timeouts. */ + printf("ERROR!\n"); + test_control_failed_tests++; + + } +#endif + } + else + test_control_return_status = 0; + + /* Test finished, cleanup in preparation for the next test. */ + test_control_cleanup(); + fflush(stdout); + } + + /* Finished with all tests, print results and return! */ + printf("**** Testing Complete ****\n"); + printf("**** Test Summary: Tests Passed: %lu Tests Warning: %lu Tests Failed: %lu\n", test_control_successful_tests, test_control_warning_tests, test_control_failed_tests); +#if 0 + fclose(stream); +#endif +#ifdef BATCH_TEST + exit(test_control_failed_tests); +#endif + + +} + +void test_control_return(UINT status) +{ + UINT old_posture = TX_INT_ENABLE; + + /* Save the status in a global. */ + test_control_return_status = status; + + /* Ensure interrupts are enabled. */ + old_posture = tx_interrupt_control(TX_INT_ENABLE); + + /* Determine if it was successful or not. */ + if((status == 1) || (_tx_thread_preempt_disable) || (old_posture == TX_INT_DISABLE)) + test_control_failed_tests++; + else if(status == 2) + test_control_warning_tests++; + else if(status == 0) + test_control_successful_tests++; + else if(status == 3) + test_control_na_tests++; + +#ifdef NETXTEST_TIMEOUT_DISABLE + /* Resume the control thread to fully exit the test. */ + tx_thread_resume(&test_control_thread); +#else + if(test_control_return_status != 3) + tx_semaphore_put(&test_control_sema); +#endif +} + +void test_control_cleanup(void) +{ + TX_MUTEX *mutex_ptr; + TX_THREAD *thread_ptr; + + /* Clean timer used by RAM driver. */ + _nx_ram_network_driver_timer_clean(); + + /* Delete all IP instances. */ + while (_nx_ip_created_ptr) + { + + /* Delete all UDP sockets. */ + while (_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr) + { + + /* Make sure the UDP socket is unbound. */ + nx_udp_socket_unbind(_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr); + + /* Delete the UDP socket. */ + nx_udp_socket_delete(_nx_ip_created_ptr -> nx_ip_udp_created_sockets_ptr); + } + + /* Delete all TCP sockets. */ + while (_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr) + { + + /* Disconnect. */ + nx_tcp_socket_disconnect(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr, NX_NO_WAIT); + + /* Make sure the TCP client socket is unbound. */ + nx_tcp_client_socket_unbind(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + + /* Make sure the TCP server socket is unaccepted. */ + nx_tcp_server_socket_unaccept(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + + /* Delete the TCP socket. */ + nx_tcp_socket_delete(_nx_ip_created_ptr -> nx_ip_tcp_created_sockets_ptr); + } + + /* Clear all listen requests. */ + while (_nx_ip_created_ptr -> nx_ip_tcp_active_listen_requests) + { + + /* Make sure the TCP server socket is unlistened. */ + nx_tcp_server_socket_unlisten(_nx_ip_created_ptr, (_nx_ip_created_ptr -> nx_ip_tcp_active_listen_requests) -> nx_tcp_listen_port); + } + + /* Delete the IP instance. */ + nx_ip_delete(_nx_ip_created_ptr); + } + + /* Delete all the packet pools. */ + while (_nx_packet_pool_created_ptr) + { + nx_packet_pool_delete(_nx_packet_pool_created_ptr); + } + + /* Reset the RAM driver. */ + _nx_ram_network_driver_reset(); + + /* Delete all queues. */ + while(_tx_queue_created_ptr) + { + + /* Delete queue. */ + tx_queue_delete(_tx_queue_created_ptr); + } + + /* Delete all semaphores. */ + while(_tx_semaphore_created_ptr) + { +#ifndef NETXTEST_TIMEOUT_DISABLE + if(_tx_semaphore_created_ptr != &test_control_sema) + { + + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr); + } + else if(_tx_semaphore_created_count == 1) + break; + else + { + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr -> tx_semaphore_created_next); + } +#else + /* Delete semaphore. */ + tx_semaphore_delete(_tx_semaphore_created_ptr); +#endif + } + + /* Delete all event flag groups. */ + while(_tx_event_flags_created_ptr) + { + + /* Delete event flag group. */ + tx_event_flags_delete(_tx_event_flags_created_ptr); + } + + /* Delete all byte pools. */ + while(_tx_byte_pool_created_ptr) + { + + /* Delete byte pool. */ + tx_byte_pool_delete(_tx_byte_pool_created_ptr); + } + + /* Delete all block pools. */ + while(_tx_block_pool_created_ptr) + { + + /* Delete block pool. */ + tx_block_pool_delete(_tx_block_pool_created_ptr); + } + + /* Delete all timers. */ + while(_tx_timer_created_ptr) + { + + /* Deactivate timer. */ + tx_timer_deactivate(_tx_timer_created_ptr); + + /* Delete timer. */ + tx_timer_delete(_tx_timer_created_ptr); + } + + /* Delete all mutexes (except for system mutex). */ + while(_tx_mutex_created_ptr) + { + + /* Setup working mutex pointer. */ + mutex_ptr = _tx_mutex_created_ptr; + +#ifdef __ghs + + /* Determine if the mutex is the GHS system mutex. If so, don't delete! */ + if(mutex_ptr == &__ghLockMutex) + { + + /* Move to next mutex. */ + mutex_ptr = mutex_ptr -> tx_mutex_created_next; + } + + /* Determine if there are no more mutexes to delete. */ + if(_tx_mutex_created_count == 1) + break; +#endif + + /* Delete mutex. */ + tx_mutex_delete(mutex_ptr); + } + + /* Delete all threads, except for timer thread, and test control thread. */ + while (_tx_thread_created_ptr) + { + + /* Setup working pointer. */ + thread_ptr = _tx_thread_created_ptr; + +#ifdef TX_TIMER_PROCESS_IN_ISR + + /* Determine if there are more threads to delete. */ + if(_tx_thread_created_count == 1) + break; + + /* Determine if this thread is the test control thread. */ + if(thread_ptr == &test_control_thread) + { + + /* Move to the next thread pointer. */ + thread_ptr = thread_ptr -> tx_thread_created_next; + } +#else + + /* Determine if there are more threads to delete. */ + if(_tx_thread_created_count == 2) + break; + + /* Move to the thread not protected. */ + while ((thread_ptr == &_tx_timer_thread) || (thread_ptr == &test_control_thread)) + { + + /* Yes, move to the next thread. */ + thread_ptr = thread_ptr -> tx_thread_created_next; + } +#endif + + /* First terminate the thread to ensure it is ready for deletion. */ + tx_thread_terminate(thread_ptr); + + /* Delete the thread. */ + tx_thread_delete(thread_ptr); + } + + /* At this point, only the test control thread and the system timer thread and/or mutex should still be + in the system. */ + + +} + +void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number) +{ + *error_counter = (*error_counter) + 1; + + printf("Error: File %s:%d\n", filename, line_number); + + + +} diff --git a/test/regression/web_test/netx_web_abnormal_test.c b/test/regression/web_test/netx_web_abnormal_test.c new file mode 100644 index 00000000..a4f9d5f0 --- /dev/null +++ b/test/regression/web_test/netx_web_abnormal_test.c @@ -0,0 +1,541 @@ +/* This case tests abnormal cases. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_abnormal_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Abnormal case: Request packet is NULL, should return error. */ + status = nx_web_http_client_request_header_add(&my_client, "", 0, "", 0, NX_NO_WAIT); + if (status != NX_WEB_HTTP_ERROR) + error_counter++; + + /* Abnormal case: Request packet is NULL, should return error. */ + status = nx_web_http_client_request_send(&my_client, NX_NO_WAIT); + if (status != NX_WEB_HTTP_ERROR) + error_counter++; + + /* Abnormal case: Request packet isn't sent, should return error. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, NX_NO_WAIT); + if (status != NX_WEB_HTTP_ERROR) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "", "", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Abnorml case: Duplicate initialize, the old request packet should be released. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "", "", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Abnorml case: Error basic authorization field. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, NX_NULL, NX_NULL, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Add error basic authorization field. The correct string should be "Basic Og==". */ + status = nx_web_http_client_request_header_add(&my_client, "Authorization", 13, "Bassc OgOg", 10, NX_NO_WAIT); + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_STATUS_CODE_UNAUTHORIZED) + error_counter++; + + if (recv_packet) + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = ""; + *password = ""; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Abnormal Test........................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_abnormal_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Abnormal Test.........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_basic_authenticate_empty_test.c b/test/regression/web_test/netx_web_basic_authenticate_empty_test.c new file mode 100644 index 00000000..d5670588 --- /dev/null +++ b/test/regression/web_test/netx_web_basic_authenticate_empty_test.c @@ -0,0 +1,502 @@ +/* This case tests basic authentication with empty name or password. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_authenticate_empty_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "Placeholdername", "", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "Placeholdername", "", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_WEB_HTTP_AUTHENTICATION_ERROR) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "", "Placeholderpassword", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "", "Placeholderpassword", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_WEB_HTTP_AUTHENTICATION_ERROR) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Authenticate Empty Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + +#ifdef NX_WEB_HTTPS_ENABLE + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } +#endif + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "Placeholdername"; + *password = "Placeholderpassword"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_authenticate_empty_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Authenticate Empty Test.........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_basic_authenticate_test.c b/test/regression/web_test/netx_web_basic_authenticate_test.c new file mode 100644 index 00000000..070dadd8 --- /dev/null +++ b/test/regression/web_test/netx_web_basic_authenticate_test.c @@ -0,0 +1,504 @@ +/* This case tests basic authentication. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_authenticate_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name2", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "name2", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_WEB_HTTP_AUTHENTICATION_ERROR) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Authenticate Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + +#ifdef NX_WEB_HTTPS_ENABLE + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } +#endif + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_authenticate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Authenticate Test...............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_basic_ecc_test.c b/test/regression/web_test/netx_web_basic_ecc_test.c new file mode 100644 index 00000000..b2b1a633 --- /dev/null +++ b/test/regression/web_test/netx_web_basic_ecc_test.c @@ -0,0 +1,392 @@ +/* This case tests basic GET method using ECC. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" +#include "ecc_certs.c" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTPS_ENABLE) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +extern const USHORT nx_crypto_ecc_supported_groups[]; +extern const NX_CRYPTO_METHOD* nx_crypto_ecc_curves[]; +extern const UINT nx_crypto_ecc_supported_groups_size; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers_ecc; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_ecc_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers_ecc, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + status = nx_secure_tls_ecc_initialize(tls_session, nx_crypto_ecc_supported_groups, + nx_crypto_ecc_supported_groups_size, + nx_crypto_ecc_curves); + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ECCA2_der, ECCA2_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + https_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTPS_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Basic ECC Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Set TLS for HTTPS. */ + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, ECTestServer2_der, ECTestServer2_der_len, + NX_NULL, 0, ECTestServer2_key_der, ECTestServer2_key_der_len, + NX_SECURE_X509_KEY_TYPE_EC_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers_ecc, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + + status = nx_web_http_server_secure_ecc_configure(&my_server, nx_crypto_ecc_supported_groups, + nx_crypto_ecc_supported_groups_size, + nx_crypto_ecc_curves); + if (status) + { + error_counter++; + } + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_ecc_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Basic ECC Test........................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_basic_test.c b/test/regression/web_test/netx_web_basic_test.c new file mode 100644 index 00000000..65842d60 --- /dev/null +++ b/test/regression/web_test/netx_web_basic_test.c @@ -0,0 +1,650 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 4; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 2; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +static VOID http_response_callback(NX_WEB_HTTP_CLIENT *client_ptr, CHAR *field_name, UINT field_name_length, + CHAR *field_value, UINT field_value_length) +{ + if (memcmp(field_name, "Content-Type", field_name_length) == 0) + { + if (memcmp(field_value, "text/plain", field_value_length) != 0) + error_counter++; + } + else if(memcmp(field_name, "Content-Length", field_name_length) == 0) + { + if (memcmp(field_value, "12", field_value_length) != 0) + error_counter++; + } +#ifndef NX_WEB_HTTP_KEEPALIVE_DISABLE + else if(memcmp(field_name, "Connection", field_name_length) == 0) + { + if (memcmp(field_value, "keep-alive", field_value_length) != 0) + error_counter++; + } +#endif +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i < 2) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the header callback routine. */ + nx_web_http_client_response_header_callback_set(&my_client, http_response_callback); + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", NX_WAIT_FOREVER); + } + else if (i == 1) + { + status = nx_web_http_client_get_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", sizeof("http://1.2.3.4/test.txt") - 1, + "1.2.3.4", 7, "name", 4, "password", 8, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 2) + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } + else + { + status = nx_web_http_client_get_secure_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", sizeof("https://1.2.3.4/test.txt") - 1, + "1.2.3.4", 7, "name", 4, "password", 8, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Connect to server. */ + if (i < 2) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + if (i % 2) + { + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_WAIT_FOREVER); + } + else + { + /* Initialize the request. */ + status = nx_web_http_client_request_initialize_extended(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", 9, "1.2.3.4", 7, + 0, NX_FALSE, "name", 4, "password", 8, NX_WAIT_FOREVER); + } + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 1) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 3) + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Test............................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop/2; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +ULONG offset, length; +NX_PACKET *response_pkt; +UCHAR buffer[4000]; +UINT status; +CHAR response[] = "Test response from server - uploaded file contents:\n"; + + + memset(buffer, 0, sizeof(buffer)); + length = 0; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + /* Get the content header. */ + while(nx_web_http_server_get_entity_header(server_ptr, &packet_ptr, buffer, + sizeof(buffer)) == NX_SUCCESS) + { + + /* Header obtained successfully. Get the content data location. */ + while(nx_web_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, + &length) == NX_SUCCESS) + { + /* make sure we don't overwrite our buffer! */ + if(length > sizeof(buffer)) + { + length = sizeof(buffer); + } + + /* Write content data to buffer. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer, length, + &length); + buffer[length] = 0; + } + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 800, "text/html", + "Server: NetX HTTPS Experimental\r\n"); + + if(status) + { + return(status); + } + + status = nx_packet_data_append(response_pkt, response, strlen(response), + &server_pool, NX_WAIT_FOREVER); + + if(length > 0) + { + /* Only send what is in the buffer. */ + if(length > 4000) + { + length = 4000; + } + status = nx_packet_data_append(response_pkt, buffer, length, + &server_pool, NX_WAIT_FOREVER); + } + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_certifiacte_verify_test.c b/test/regression/web_test/netx_web_certifiacte_verify_test.c new file mode 100644 index 00000000..dd323ceb --- /dev/null +++ b/test/regression/web_test/netx_web_certifiacte_verify_test.c @@ -0,0 +1,387 @@ +/* This case tests client certificate verification. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTPS_ENABLE) && defined(NX_SECURE_ENABLE_CLIENT_CERTIFICATE_VERIFY) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate, client_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static NX_SECURE_X509_CERT server_trusted_certificates[2]; +static NX_SECURE_X509_CERT server_remote_certificates[2]; +static UCHAR server_remote_cert_buffer[2000 * 2]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_certifiacet_verify_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add certificate for client certificate verification. */ + nx_secure_x509_certificate_initialize(&client_certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + nx_secure_tls_local_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &client_certificate); + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + status = nx_web_http_client_get_secure_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", sizeof("https://1.2.3.4/test.txt") - 1, + "1.2.3.4", 7, "name", 4, "password", 8, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + https_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTPS_SERVER_PORT; +NX_SECURE_X509_CERT *server_trusted_certificates_list[2]; +NX_SECURE_X509_CERT *server_remote_certificates_list[2]; + + + /* Print out test information banner. */ + printf("NetX Test: Web Certificate Verify Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_x509_certificate_initialize(&server_trusted_certificates[0], ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + server_trusted_certificates_list[0] = &server_trusted_certificates[0]; + server_remote_certificates_list[0] = &server_remote_certificates[0]; + server_remote_certificates_list[1] = &server_remote_certificates[1]; + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, server_trusted_certificates_list, 1, server_remote_certificates_list, 2, server_remote_cert_buffer, sizeof(server_remote_cert_buffer)); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_certifiacet_verify_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Certificate Verify Test...............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_chunked_request_additional_test.c b/test/regression/web_test/netx_web_chunked_request_additional_test.c new file mode 100644 index 00000000..d36c2f34 --- /dev/null +++ b/test/regression/web_test/netx_web_chunked_request_additional_test.c @@ -0,0 +1,738 @@ +/* This case tests chunked request. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +}; + +static UINT test_chunk[] = {20, 120, 19, 34}; +static UINT test_num = sizeof(test_chunk)/sizeof(UINT); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_request_additional_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +NX_PACKET *send_packet, *recv_packet; +UINT chunk_size = 0, more_data = NX_FALSE; +CHAR *put_test; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Check status. */ + if (status) + error_counter++; + + /* Test chunked PUT request. */ + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + put_test = "http_put_test.html"; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + put_test = "https_put_test.html"; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_PUT, put_test, "www.abc.com", + 0, NX_TRUE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + +#if 1 + + /* For test, append chunked data to the header packet. */ + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\r\n19\r\n", 6, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, pkt, 25, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); +#endif + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + for (j = 0; j < test_num; j++) + { + + chunk_size = test_chunk[j]; + if (j == test_num - 1) + { + more_data = NX_FALSE; + } + else + { + more_data = NX_TRUE; + } + + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_web_http_client_request_chunked_set(&my_client, chunk_size, send_packet); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, chunk_size, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_client_request_packet_send(&my_client, send_packet, more_data, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Test chunked POST request. */ + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_POST, put_test, "www.abc.com", + 0, NX_TRUE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + for (j = 0; j < test_num; j++) + { + + chunk_size = test_chunk[j]; + if (j == test_num - 1) + { + more_data = NX_FALSE; + } + else + { + more_data = NX_TRUE; + } + + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_web_http_client_request_chunked_set(&my_client, chunk_size, send_packet); + if (status) + error_counter++; + + if (j == 1) + { + chunk_size = (chunk_size >> 1); + } + + nx_packet_data_append(send_packet, pkt, chunk_size, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_client_request_packet_send(&my_client, send_packet, more_data, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Test one chunk in multiple request packets. */ + if (j == 1) + { + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, chunk_size, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_client_request_packet_send(&my_client, send_packet, more_data, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + } + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Request Additional Test......................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *chunked_pkt; +NX_PACKET *response_pkt; +UINT status; +UINT i = 0; +UINT content_length = 0; +UINT total_length = 0; + + /* Process POST request. */ + if (request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + for (i = 0; i < test_num; i++) + { + total_length += test_chunk[i]; + } + + status = nx_web_http_server_packet_content_find(server_ptr, &packet_ptr, (ULONG *)&content_length); + + /* Release the received content packet. */ + nx_packet_release(packet_ptr); + + if (status) + { + return(status); + } + + while (1) + { + status = nx_web_http_server_packet_get(server_ptr, &chunked_pkt); + if (status) + { + break; + } + else + { + content_length += chunked_pkt -> nx_packet_length; + nx_packet_release(chunked_pkt); + } + } + + if (content_length != total_length) + { + error_counter++; + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header_extended(server_ptr, &response_pkt, + NX_WEB_HTTP_STATUS_OK, sizeof(NX_WEB_HTTP_STATUS_OK) - 1, 0, + "text/html", 9, NX_NULL, 0); + if (status) + { + return(status); + } + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_request_additional_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Request Additional Test.......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_chunked_request_test.c b/test/regression/web_test/netx_web_chunked_request_test.c new file mode 100644 index 00000000..15e5a6c8 --- /dev/null +++ b/test/regression/web_test/netx_web_chunked_request_test.c @@ -0,0 +1,709 @@ +/* This case tests chunked request. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +}; + +static UINT test_chunk[] = {20, 120, 19, 34}; +static UINT test_num = sizeof(test_chunk)/sizeof(UINT); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_request_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +NX_PACKET *send_packet, *recv_packet; +UINT chunk_size = 0, more_data = NX_FALSE; +CHAR *put_test; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Check status. */ + if (status) + error_counter++; + + /* Test chunked PUT request. */ + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + put_test = "http_put_test.html"; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + put_test = "https_put_test.html"; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_PUT, put_test, "www.abc.com", + 0, NX_TRUE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + for (j = 0; j < test_num; j++) + { + + chunk_size = test_chunk[j]; + if (j == test_num - 1) + { + more_data = NX_FALSE; + } + else + { + more_data = NX_TRUE; + } + + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_web_http_client_request_chunked_set(&my_client, chunk_size, send_packet); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, chunk_size, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_client_request_packet_send(&my_client, send_packet, more_data, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Test chunked POST request. */ + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_POST, put_test, "www.abc.com", + 0, NX_TRUE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + for (j = 0; j < test_num; j++) + { + + chunk_size = test_chunk[j]; + if (j == test_num - 1) + { + more_data = NX_FALSE; + } + else + { + more_data = NX_TRUE; + } + + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_web_http_client_request_chunked_set(&my_client, chunk_size, send_packet); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, chunk_size, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_client_request_packet_send(&my_client, send_packet, more_data, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Request Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *chunked_pkt; +NX_PACKET *response_pkt; +UINT status; +UINT i = 0; +UINT content_length = 0; +UINT total_length = 0; + + /* Process POST request. */ + if (request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + for (i = 0; i < test_num; i++) + { + total_length += test_chunk[i]; + } + + status = nx_web_http_server_packet_content_find(server_ptr, &packet_ptr, (ULONG *)&content_length); + + /* Release the received content packet. */ + nx_packet_release(packet_ptr); + + if (status) + { + return(status); + } + + while (1) + { + status = nx_web_http_server_packet_get(server_ptr, &chunked_pkt); + if (status) + { + break; + } + else + { + content_length += chunked_pkt -> nx_packet_length; + nx_packet_release(chunked_pkt); + } + } + + if (content_length != total_length) + { + error_counter++; + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 0, "text/html", + NX_NULL); + if (status) + { + return(status); + } + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_request_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Request Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_chunked_response_packet_chain_test.c b/test/regression/web_test/netx_web_chunked_response_packet_chain_test.c new file mode 100644 index 00000000..5f5cebdc --- /dev/null +++ b/test/regression/web_test/netx_web_chunked_response_packet_chain_test.c @@ -0,0 +1,533 @@ +/* This case tests chunked response with packet chain. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static char pkt[] = { +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, /* HTTP/1.0 */ +0x20, 0x32, 0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, /* 200 ..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* ontent-T */ +0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, /* ype: tex */ +0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x0d, /* t/plain. */ +0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, /* .Transfe */ +0x72, 0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, /* r-Encodi */ +0x6e, 0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, 0x6e, /* ng: chun */ +0x6b, 0x65, 0x64, 0x0d, 0x0a, 0x0d, 0x0a, /* ked.... */ /*71*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x63, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 0c..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*18*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x0d, 0x0a, 0x0d, 0x0a, /* 0.... */ /*5*/ +}; + +static char pkt1[] = { +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, /* HTTP/1.0 */ +0x20, 0x32, 0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, /* 200 ..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* ontent-T */ +0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, /* ype: tex */ +0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x0d, /* t/plain. */ +0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, /* .Transfe */ +0x72, 0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, /* r-Encodi */ +0x6e, 0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, 0x6e, /* ng: chun */ +0x6b, 0x65, 0x64, 0x0d, 0x0a, 0x0d, 0x0a, /* ked.... */ /*71*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +}; + +static char pkt2[] = { +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x63, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 0c..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +}; + +static char pkt3[] = { +0x0d, 0x0a, /* .. */ /*18*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x0d, 0x0a, 0x0d, 0x0a, /* 0.... */ /*5*/ +}; + +static UINT test_content_length = 52; + +/* FIXME XWH: Add declaration in header file. */ +extern UINT _nx_web_http_client_response_chunked_get(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_pptr, ULONG wait_option); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_response_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +UINT content_length = 0; +NX_PACKET *my_packet1, *my_packet2, *my_packet3; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + content_length = 0; + + nx_packet_allocate(&client_pool, &my_packet1, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + nx_packet_data_append(my_packet1, pkt1, sizeof(pkt1), &client_pool, 1 * NX_IP_PERIODIC_RATE); + nx_packet_allocate(&client_pool, &my_packet2, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + nx_packet_data_append(my_packet2, pkt2, sizeof(pkt2), &client_pool, 1 * NX_IP_PERIODIC_RATE); + nx_packet_allocate(&client_pool, &my_packet3, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); + nx_packet_data_append(my_packet3, pkt3, sizeof(pkt3), &client_pool, 1 * NX_IP_PERIODIC_RATE); + my_packet2->nx_packet_next = my_packet3; + my_packet2->nx_packet_length += my_packet3->nx_packet_length; + my_packet1->nx_packet_next = my_packet2; + my_packet1->nx_packet_length += my_packet2->nx_packet_length; + my_packet1->nx_packet_prepend_ptr += 71; + my_packet1->nx_packet_length -= 71; + my_client.nx_web_http_client_response_packet = my_packet1; + my_client.nx_web_http_client_chunked_response_remaining_size = my_client.nx_web_http_client_response_packet->nx_packet_length; + + /* Get response from server. */ + while (1) + { + status = _nx_web_http_client_response_chunked_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + content_length += recv_packet->nx_packet_length; + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if ((status != NX_WEB_HTTP_GET_DONE) || (content_length != test_content_length)) + error_counter++; + +#if 1 + nx_packet_release(my_client.nx_web_http_client_response_packet); + + /* Check if all the packets are released. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; +#endif + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Response Packet Chain Test...................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_response_packet_chain_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Response Packet Chain Test....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_chunked_response_process_test.c b/test/regression/web_test/netx_web_chunked_response_process_test.c new file mode 100644 index 00000000..ed668865 --- /dev/null +++ b/test/regression/web_test/netx_web_chunked_response_process_test.c @@ -0,0 +1,643 @@ +/* This case tests chunked response processing. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#if 1 + +static char pkt[] = { +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, /* HTTP/1.1 */ +0x20, 0x32, 0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, /* 200 ..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* ontent-T */ +0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, /* ype: tex */ +0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x0d, /* t/plain. */ +0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, /* .Transfe */ +0x72, 0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, /* r-Encodi */ +0x6e, 0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, 0x6e, /* ng: chun */ +0x6b, 0x65, 0x64, 0x0d, 0x0a, 0x0d, 0x0a, /* ked.... */ /*71*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x63, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 0c..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*18*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x0d, 0x0a, 0x0d, 0x0a, /* 0.... */ /*5*/ +}; + +/* Packet_length: 146, header length: 71, boday length: 75 */ +static UINT test_pkt_frag[][5] = +{ + {146, 0, 0, 0, 0}, /* headerxx\r\n....\r\nxx\r\n....\r\nxx\r\n....\r\n0\r\n\r\n */ + {71, 75, 0, 0, 0}, /* header||xx\r\n....\r\nxx\r\n....\r\nxx\r\n....\r\n0\r\n\r\n */ + {71, 73, 2, 0, 0}, /* header||xx\r\n....\r\nxx\r\n....\r\nxx\r\n....\r\n0\r\n||\r\n */ + {71, 42, 2, 29, 2}, /* header||xx\r\n....\r\nxx\r\n....||\r\n||xx\r\n....\r\n0\r\n||\r\n */ + {71, 26, 18, 26, 5}, /* header||xx\r\n....\r\n||xx\r\n....\r\n||xx\r\n....\r\n||0\r\n\r\n */ + {84, 13, 16, 27, 6}, /* headerxx\r\n..||..\r\n||xx\r\n....||\r\nxx\r\n....\r||\n0\r\n\r\n */ /* */ + {73, 25, 20, 16, 12},/* headerxx||\r\n....\r\nx||x\r\n....\r\nxx\r||\n..||..\r\n0\r\n\r\n */ + {71, 23, 39, 12, 1}, /* header||xx\r\n..||..\r\nxx\r\n....\r\nxx\r\n..||..\r\n0\r\n\r||\n */ +}; + +static UINT test_content_length = 0x14 + 0xc + 0x14; + +#else + +static char pkt[] = { +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, /* HTTP/1.0 */ +0x20, 0x32, 0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, /* 200 ..C */ +0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, /* ontent-T */ +0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, /* ype: tex */ +0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x0d, /* t/plain. */ +0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, /* .Transfe */ +0x72, 0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, /* r-Encodi */ +0x6e, 0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, 0x6e, /* ng: chun */ +0x6b, 0x65, 0x64, 0x0d, 0x0a, 0x0d, 0x0a, /* ked.... */ /*71*/ +0x31, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 14..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*26*/ +0x30, 0x63, 0x3B, 0x45, 0x4c, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 0c;EL..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*18*/ +0x31, 0x32, 0x34, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, /* 124..test */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x0d, 0x0a, /* .. */ /*299*/ +0x30, 0x0d, 0x0a, 0x0d, 0x0a, /* 0.... */ /*5*/ +}; + +/* Packet_length: 419, header length: 71, boday length: 348 */ +static UINT test_pkt_frag[][5] = +{ + {422, 0, 0, 0, 0}, /* headerxx\r\n....\r\nxx\r\n....\r\nxx\r\n....\r\n0\r\n\r\n */ +}; + +static UINT test_content_length = 0x14 + 0xc + 0x124; + +#endif + +static UINT test_num = sizeof(test_pkt_frag)/(5 * sizeof(UINT)); +static UINT test_count = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_response_process_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +UINT content_length = 0; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + for (test_count = 0; test_count < test_num; test_count++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + { + printf("\n%d connect fail!\n", status); + error_counter++; + } + + content_length = 0; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + if (status == NX_WEB_HTTP_GET_DONE) + { + nx_packet_release(recv_packet); + } + break; + } + else + { + content_length += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if ((status != NX_WEB_HTTP_GET_DONE) || (content_length != test_content_length)) + { + error_counter++; + } + + /* Check if all the packets are released. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + printf("\npacket leak!\n"); + error_counter++; + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + } + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Response Process Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; +UINT i = 0; +UCHAR *data_ptr; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + data_ptr = pkt; + + for (i = 0; i < 5; i++) + { + if (!test_pkt_frag[test_count][i]) + break; + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, data_ptr, test_pkt_frag[test_count][i], &server_pool, NX_WAIT_FOREVER); + + if (status == NX_SUCCESS) + { + if (nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + data_ptr += test_pkt_frag[test_count][i]; + } + + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_response_process_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Response Process Test.........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_chunked_response_test.c b/test/regression/web_test/netx_web_chunked_response_test.c new file mode 100644 index 00000000..bd541ae9 --- /dev/null +++ b/test/regression/web_test/netx_web_chunked_response_test.c @@ -0,0 +1,588 @@ +/* This case tests chunked resposne. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +}; + +static UINT test_chunk[] = {20, 120, 19, 34}; +static UINT test_num = sizeof(test_chunk)/sizeof(UINT); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_response_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +UINT content_length = 0; +UINT total_length = 0; + + for (i = 0; i < test_num; i++) + { + total_length += test_chunk[i]; + } + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/index.htm", "www.abc.com", + 0, NX_TRUE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + content_length = 0; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + if (status == NX_WEB_HTTP_GET_DONE) + { + nx_packet_release(recv_packet); + } + break; + } + else + { + content_length += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if ((status != NX_WEB_HTTP_GET_DONE) || (content_length != total_length)) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Response Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; +UINT i = 0; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 0, "text/html", + "Transfer-Encoding: chunked\r\n"); + if (status) + { + return(status); + } + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + + /* Send the chunk data. */ + for (i = 0; i < test_num; i++) + { + + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, NX_WAIT_FOREVER); + if (status) + { + return(status); + } + + status = nx_web_http_server_response_chunked_set(server_ptr, test_chunk[i], response_pkt); + if (status) + { + return(status); + } + + nx_packet_data_append(response_pkt, pkt, test_chunk[i], server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_chunked_response_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Chunked Response Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_client_cleanup_test.c b/test/regression/web_test/netx_web_client_cleanup_test.c new file mode 100644 index 00000000..cc21fa98 --- /dev/null +++ b/test/regression/web_test/netx_web_client_cleanup_test.c @@ -0,0 +1,525 @@ +/* This case tests the cleanup function. + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern VOID _nx_web_http_client_error_exit(NX_WEB_HTTP_CLIENT *client_ptr, UINT wait_option); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_cleanup_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +UINT recv_length = 0; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Send PUT request. */ + if (i == 0) + { + + status = nx_web_http_client_put_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://www.abc.com/client_test.htm", + "www.abc.com", "name", "password", 103, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + status = nx_web_http_client_put_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://www.abc.com/client_test1.htm", + "www.abc.com", "name", "password", 103, tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Disconnect with server. */ + _nx_web_http_client_error_exit(&my_client, 1 * NX_IP_PERIODIC_RATE); + + /* Reconnect with server, the client should clean up the temporary variables and reset the state. */ + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://www.abc.com/client_test.htm", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://www.abc.com/client_test1.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Reset the receive length. */ + recv_length = 0; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + { + recv_length += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + { + recv_length += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + + if (recv_length != 103) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Client Cleanup Test..................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_cleanup_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Client Cleanup Test...................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_client_receive_no_packet_test.c b/test/regression/web_test/netx_web_client_receive_no_packet_test.c new file mode 100644 index 00000000..71de45a4 --- /dev/null +++ b/test/regression/web_test/netx_web_client_receive_no_packet_test.c @@ -0,0 +1,435 @@ +/* This case tests client didn't receive response in time. + If client receive no packet, it can continue to get response untill get done. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_receive_no_packet_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_IP_PERIODIC_RATE); + + if (status) + error_counter++; + + /* Server didn't respond in time. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, NX_NO_WAIT); + + if (status != NX_NO_PACKET) + error_counter++; + + /* Continue to get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 2 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + tx_semaphore_put(&semaphore_client_stop); + } +} + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + return(NX_SUCCESS); +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Client Receive No Packet Test........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + status = nx_web_http_server_stop(&my_server); + if (status) + error_counter++; + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_receive_no_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Client Receive No Packet Test.........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_client_rst_test.c b/test/regression/web_test/netx_web_client_rst_test.c new file mode 100644 index 00000000..e67a49b9 --- /dev/null +++ b/test/regression/web_test/netx_web_client_rst_test.c @@ -0,0 +1,323 @@ +/* This case tests the cleanup function. + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_client_get = 0; +static UINT http_client_stop = 0; +static UINT http_server_rst = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +extern VOID _nx_web_http_client_error_exit(NX_WEB_HTTP_CLIENT *client_ptr, UINT wait_option); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_rst_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +UINT recv_length = 0; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Reconnect with server, the client should clean up the temporary variables and reset the state. */ + /* Send a GET request. */ + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "TEST.TXT", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + http_client_get = NX_TRUE; + + /* Reset the receive length. */ + recv_length = 0; + + /* Wait HTTP Server RST. */ + while(http_server_rst != NX_TRUE) + { + tx_thread_sleep(1); + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + { + recv_length += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + { + recv_length += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + + if (recv_length != 25) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + http_client_stop = NX_TRUE; +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Client RST Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "HTTP Server Data Content", sizeof("HTTP Server Data Content")); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Wait HTTP test finished. */ + while(http_client_get != NX_TRUE) + { + tx_thread_sleep(1); + } + + /* Send RST. */ + nx_tcp_socket_disconnect(&(my_server.nx_web_http_server_current_session_ptr -> nx_tcp_session_socket), NX_NO_WAIT); + + http_server_rst = NX_TRUE; + + /* Wait HTTP test finished. */ + while(http_client_stop != NX_TRUE) + { + tx_thread_sleep(1); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_rst_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Client RST Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_client_send_fail_test.c b/test/regression/web_test/netx_web_client_send_fail_test.c new file mode 100644 index 00000000..c14408e3 --- /dev/null +++ b/test/regression/web_test/netx_web_client_send_fail_test.c @@ -0,0 +1,442 @@ +/* This case tests abnormal cases. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static TX_SEMAPHORE semaphore_server_start; +static TX_SEMAPHORE semaphore_client_stop; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_send_fail_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + tx_semaphore_create(&semaphore_server_start, "semaphore server start", 0); + tx_semaphore_create(&semaphore_client_stop, "semaphore client stop", 0); + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +NX_PACKET *recv_packet; +ULONG temp; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + tx_semaphore_get(&semaphore_server_start, NX_WAIT_FOREVER); + + for (j = 0; j < 2; j++) + { + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + if (j == 0) + { + temp = my_client.nx_web_http_client_socket.nx_tcp_socket_connect_mss; + my_client.nx_web_http_client_socket.nx_tcp_socket_connect_mss = 1; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_NO_WAIT); + + if (!status) + error_counter++; + + my_client.nx_web_http_client_socket.nx_tcp_socket_connect_mss = temp; + + continue; + } + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_IP_PERIODIC_RATE); + + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + tx_semaphore_put(&semaphore_client_stop); + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Client Send Fail Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + tx_semaphore_put(&semaphore_server_start); + + tx_semaphore_get(&semaphore_client_stop, NX_WAIT_FOREVER); + + status = nx_web_http_server_stop(&my_server); + if (status) + error_counter++; + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_client_send_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Client Send Fail Test.................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_concurrent_sessions_test.c b/test/regression/web_test/netx_web_concurrent_sessions_test.c new file mode 100644 index 00000000..e0461798 --- /dev/null +++ b/test/regression/web_test/netx_web_concurrent_sessions_test.c @@ -0,0 +1,643 @@ +/* This case tests concurrent HTTPS sessions by launching several + * HTTPS clients in separate threads and using randomized delay to + * hit the server with repeated requests. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +#define HTTP_CLIENT_THREADS 4 +#define HTTP_CONCURRENT_TESTS 10 + +static TX_THREAD client_threads[HTTP_CLIENT_THREADS]; +static UINT client_thread_index = 0; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_clients[HTTP_CLIENT_THREADS]; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_WAIT_TICKS (50) +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[HTTP_CLIENT_THREADS][20000]; +static UCHAR tls_packet_buffer[NX_WEB_HTTP_SERVER_SESSION_MAX * 18500]; +static UCHAR client_packet_buffer[HTTP_CLIENT_THREADS][18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificates[HTTP_CLIENT_THREADS], remote_issuers[HTTP_CLIENT_THREADS]; +static UCHAR remote_cert_buffers[HTTP_CLIENT_THREADS][2000]; +static UCHAR remote_issuer_buffers[HTTP_CLIENT_THREADS][2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + + +#define PRINT_ERROR(error_code) _error_print(error_code, __LINE__) + +static void _error_print(UINT error_code, UINT line) +{ + printf("Error on line %d, status: 0x%x\n", line, error_code); + error_counter++; +} + +static void _print_trace(CHAR *message, ...) +{ +#if 0 +va_list arg; + + va_start (arg, message); + printf (message, arg); + va_end (arg); +#endif + +} + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_concurrent_sessions_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +CHAR thread_name[100]; +UINT i; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*64); + pointer = pointer + SERVER_PACKET_SIZE * 64; + if (status) + PRINT_ERROR(status); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + PRINT_ERROR(status); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + PRINT_ERROR(status); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + PRINT_ERROR(status); + + /* Create the HTTP Client thread. */ + for(i = 0; i < HTTP_CLIENT_THREADS; ++i) + { + snprintf(thread_name, 100, "HTTP Client %d", i); + status = tx_thread_create(&client_threads[i], thread_name, thread_client_entry, i, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + } + if (status) + PRINT_ERROR(status); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + PRINT_ERROR(status); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + PRINT_ERROR(status); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + PRINT_ERROR(status); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + PRINT_ERROR(status); +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + _print_trace("Setting up tls for thread: %s\n", client_ptr->nx_web_http_client_name); + + /* Use counter from client name (set up when client is created. */ + client_thread_index = client_ptr->nx_web_http_client_name[0] - '0'; + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client[client_thread_index], sizeof(crypto_metadata_client[0])); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(tls_session, client_packet_buffer[client_thread_index], sizeof(client_packet_buffer[0])); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificates[client_thread_index], remote_cert_buffers[client_thread_index], sizeof(remote_cert_buffers[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuers[client_thread_index], remote_issuer_buffers[client_thread_index], sizeof(remote_issuer_buffers[0])); + + /* Increment global counter. */ + client_thread_index++; + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +static VOID http_response_callback(NX_WEB_HTTP_CLIENT *client_ptr, CHAR *field_name, UINT field_name_length, + CHAR *field_value, UINT field_value_length) +{ + if (memcmp(field_name, "Content-Type", field_name_length) == 0) + { + if (memcmp(field_value, "text/plain", field_value_length) != 0) + PRINT_ERROR(1); + } + else if(memcmp(field_name, "Content-Length", field_name_length) == 0) + { + if (memcmp(field_value, "12", field_value_length) != 0) + PRINT_ERROR(1); + } + else if(memcmp(field_name, "Connection", field_name_length) == 0) + { + if (memcmp(field_value, "keep-alive", field_value_length) != 0) + PRINT_ERROR(1); + } +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +UINT thread_index; +UCHAR client_name[100]; +NX_PACKET *recv_packet; +NX_WEB_HTTP_CLIENT *my_client; +UINT num_tests; + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Get the index of this thread. */ + thread_index = (UINT)(thread_input); + + /* Get the client for this thread. */ + my_client = &my_clients[thread_index]; + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 1; i < loop ; i++) + { + _print_trace("Starting HTTP Client %d\n", thread_index); + for(num_tests = 0; num_tests < HTTP_CONCURRENT_TESTS; ++num_tests) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + _print_trace("Starting HTTP Client %d, test number: %d\n", thread_index, num_tests); + + /* Random start between 10ms and 1s so we hit during different states. */ + tx_thread_sleep((rand() % 10) * 10); + + + + /* Create an HTTP client instance. */ + snprintf(client_name, 100, "%d HTTP Client", thread_index); + status = nx_web_http_client_create(my_client, client_name, &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + PRINT_ERROR(status); + + /* Set the header callback routine. */ + nx_web_http_client_response_header_callback_set(my_client, http_response_callback); + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + _print_trace("Starting secure get\n"); + status = nx_web_http_client_get_secure_start(my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + { + _print_trace("Error in connecting to server. Status: 0x%x, Thread index: %d\n", status, thread_index); + PRINT_ERROR(status); + } + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + { + _print_trace("Error in getting response body (check connection). Status: 0x%x, Thread: %d\n", status, thread_index); + PRINT_ERROR(status); + } + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(my_client); + if (status) + PRINT_ERROR(status); + + } + + _print_trace("Ending HTTP Client %d\n", thread_index); + + /* Set the flag. */ + if (i == 0) + { + http_client_stop++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop++; + } +#endif + + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Concurrent Sessions Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + PRINT_ERROR(status); + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 1; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + _print_trace("\nStarting server\n"); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, server_request_callback); + if (status) + PRINT_ERROR(status); + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + PRINT_ERROR(status); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + PRINT_ERROR(status); + + _print_trace("...Server started\n"); + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(http_client_stop < HTTP_CLIENT_THREADS) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(https_client_stop < HTTP_CLIENT_THREADS) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + _print_trace("Stopping server...\n"); + + status = nx_web_http_server_stop(&my_server); + if (status) + PRINT_ERROR(status); + + status = nx_web_http_server_delete(&my_server); + if (status) + PRINT_ERROR(status); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +ULONG offset, length; +NX_PACKET *response_pkt; +UCHAR buffer[4000]; +UINT status; +CHAR response[] = "Test response from server - uploaded file contents:\n"; + + + memset(buffer, 0, sizeof(buffer)); + length = 0; + + _print_trace("***************** Server recevied request..\n"); + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + /* Get the content header. */ + while(nx_web_http_server_get_entity_header(server_ptr, &packet_ptr, buffer, + sizeof(buffer)) == NX_SUCCESS) + { + + /* Header obtained successfully. Get the content data location. */ + while(nx_web_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, + &length) == NX_SUCCESS) + { + /* make sure we don't overwrite our buffer! */ + if(length > sizeof(buffer)) + { + length = sizeof(buffer); + } + + /* Write content data to buffer. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer, length, + &length); + buffer[length] = 0; + } + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 800, "text/html", + "Server: NetX HTTPS Experimental\r\n"); + + if(status) + { + return(status); + } + + status = nx_packet_data_append(response_pkt, response, strlen(response), + &server_pool, SERVER_WAIT_TICKS); + + if(length > 0) + { + /* Only send what is in the buffer. */ + if(length > 4000) + { + length = 4000; + } + status = nx_packet_data_append(response_pkt, buffer, length, + &server_pool, SERVER_WAIT_TICKS); + } + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Basic Test............................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_connect_three_times_test.c b/test/regression/web_test/netx_web_connect_three_times_test.c new file mode 100644 index 00000000..857b3564 --- /dev/null +++ b/test/regression/web_test/netx_web_connect_three_times_test.c @@ -0,0 +1,456 @@ +/* This case tests client connect three times to server to see + if server actually clear the seesion materials. +*/ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_connect_three_times_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + + for (j = 0; j < 3; j++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + } + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Connect Three Times Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_connect_three_times_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Connect Three Times Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_delete_basic_test.c b/test/regression/web_test/netx_web_delete_basic_test.c new file mode 100644 index 00000000..74c7db76 --- /dev/null +++ b/test/regression/web_test/netx_web_delete_basic_test.c @@ -0,0 +1,525 @@ +/* This case tests basic DELETE method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 4; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 2; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_delete_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i < 2) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send PUT request. */ + if (i < 2) + { + + status = nx_web_http_client_put_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", 103, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + status = nx_web_http_client_put_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", 103, tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Send DELETE request. */ + if (i == 0) + { + status = nx_web_http_client_delete_start(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, + "/index.htm", "www.abc.com", NX_NULL, NX_NULL, + NX_WAIT_FOREVER); + } + else if (i == 1) + { + status = nx_web_http_client_delete_start_extended(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, + "/index.htm", 10, "www.abc.com", 11, NX_NULL, 0, NX_NULL, 0, + NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 2) + { + status = nx_web_http_client_delete_secure_start(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + "/index.htm", "www.abc.com", NX_NULL, NX_NULL, + tls_setup_callback, NX_WAIT_FOREVER); + } + else + { + status = nx_web_http_client_delete_secure_start_extended(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + "/index.htm", 10, "www.abc.com", 11, NX_NULL, 0, NX_NULL, 0, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 1) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 3) + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Delete Basic Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop/2; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_delete_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Delete Basic Test.....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_digest_authenticate_test.c b/test/regression/web_test/netx_web_digest_authenticate_test.c new file mode 100644 index 00000000..89609e15 --- /dev/null +++ b/test/regression/web_test/netx_web_digest_authenticate_test.c @@ -0,0 +1,733 @@ +/* This case tests digest authentication. + HA1 = MD5("name:NetX Duo HTTP demo:password") + = 01bb2595c9221423951ee86f3573b465 + HA2 = MD5("GET:/index.htm") + = d4b1da8c7955d2e98bc56ffc93003b44 + Response = MD5("01bb2595c9221423951ee86f3573b465: + nonce: + 00000001:0a4f113b:auth: + d4b1da8c7955d2e98bc56ffc93003b44") + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTP_DIGEST_ENABLE) && !defined(NX_WEB_HTTP_KEEPALIVE_DISABLE) + +#include "http_digest_authentication.c" + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); + +static CHAR nonce_buffer[NX_WEB_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR response_buffer[32 + 1]; +static NX_MD5 client_md5data; + +static char pkt[] = { +0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* GET /index.htm */ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, /* HTTP/1.1.. */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_digest_authenticate_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/index.htm", "1.2.3.4", + 0, NX_FALSE, NX_NULL, NX_NULL, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + if (i == 0) + { + status = nx_tcp_socket_receive(&my_client.nx_web_http_client_socket, &recv_packet, NX_WAIT_FOREVER); + } + else + { + status = nx_secure_tls_session_receive(&my_client.nx_web_http_client_tls_session, &recv_packet, NX_WAIT_FOREVER); + } + + /* Check status. */ + if (status) + error_counter++; + else + { + status = http_nonce_retrieve(recv_packet, nonce_buffer); + if (status) + error_counter++; + nx_packet_release(recv_packet); + } + + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "password", nonce_buffer, "GET", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/index.htm", "1.2.3.4", + 0, NX_FALSE, NX_NULL, NX_NULL, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Build the Authorization header. */ + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, nonce_buffer, NX_WEB_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + memset(response_buffer, 0, sizeof(response_buffer)); + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "password", nonce_buffer, "DELETE", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Initialize the request for delete. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_DELETE, "/index.htm", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Build the Authorization header. */ + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, nonce_buffer, NX_WEB_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Receive the response from http server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/index.htm", "1.2.3.4", + 0, NX_FALSE, NX_NULL, NX_NULL, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + if (i == 0) + { + status = nx_tcp_socket_receive(&my_client.nx_web_http_client_socket, &recv_packet, NX_WAIT_FOREVER); + } + else + { + status = nx_secure_tls_session_receive(&my_client.nx_web_http_client_tls_session, &recv_packet, NX_WAIT_FOREVER); + } + + /* Check status. */ + if (status) + error_counter++; + else + { + status = http_nonce_retrieve(recv_packet, nonce_buffer); + if (status) + error_counter++; + nx_packet_release(recv_packet); + } + + /* Use error password to generate "response". */ + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "pass", nonce_buffer, "GET", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/index.htm", "1.2.3.4", + 0, NX_FALSE, NX_NULL, NX_NULL, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Build the Authorization header. */ + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, nonce_buffer, NX_WEB_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet -> nx_packet_prepend_ptr; + + /* Check the status, If authentication failed , it should be 401. */ + if((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Digest Authenticate Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + status = fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_DIGEST_AUTHENTICATE); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_digest_authenticate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Digest Authenticate Test..............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_digest_authenticate_test2.c b/test/regression/web_test/netx_web_digest_authenticate_test2.c new file mode 100644 index 00000000..0eb15d97 --- /dev/null +++ b/test/regression/web_test/netx_web_digest_authenticate_test2.c @@ -0,0 +1,499 @@ +/* This case tests digest authentication. + HA1 = MD5("name:NetX Duo HTTP demo:password") + = 01bb2595c9221423951ee86f3573b465 + HA2 = MD5("GET:/index.htm") + = d4b1da8c7955d2e98bc56ffc93003b44 + Response = MD5("01bb2595c9221423951ee86f3573b465: + nonce: + 00000001:0a4f113b:auth: + d4b1da8c7955d2e98bc56ffc93003b44") + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTP_DIGEST_ENABLE) && !defined(NX_WEB_HTTP_KEEPALIVE_DISABLE) + +#include "http_digest_authentication.c" + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NX_TCP_SOCKET client_socket; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static TX_SEMAPHORE server_start; +static TX_SEMAPHORE client_stop; + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +static UINT authentication_check_extended(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, + CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length); +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); + +static CHAR nonce_buffer[NX_WEB_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR temp_nonce_buffer[NX_WEB_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR response_buffer[32 + 1]; +static NX_MD5 client_md5data; + +static char pkt[] = { +0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* GET /index.htm */ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, /* HTTP/1.1.. */ +}; + +static UINT test_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_digest_authenticate_test_2_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + tx_semaphore_create(&server_start, "server start", 0); + tx_semaphore_create(&client_stop, "client stop", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + /* Create an HTTP client instance. */ + status = nx_tcp_socket_create(&client_ip, &client_socket, "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + error_counter++; + + for (test_count = 0; test_count < 2; test_count++) + { + tx_semaphore_get(&server_start, NX_WAIT_FOREVER); + + /* Bind the client socket. */ + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check status of the bind. */ + if (status) + error_counter++; + + /* Connect to the HTTP server. */ + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_tcp_socket_send(&client_socket, send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + else + { + status = http_nonce_retrieve(recv_packet, nonce_buffer); + if (status) + error_counter++; + nx_packet_release(recv_packet); + + /* Check if the nonce is regenerated. */ + if (test_count == 0) + { + memcpy(temp_nonce_buffer, nonce_buffer, sizeof(nonce_buffer)); + } + else + { + if (memcmp(temp_nonce_buffer, nonce_buffer, sizeof(nonce_buffer)) == 0) + { + error_counter++; + } + } + } + + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "password", nonce_buffer, "GET", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + + /* Build the Authorization header. */ + nx_packet_data_append(send_packet, "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, nonce_buffer, NX_WEB_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + nx_packet_data_append(send_packet, "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Now send the packet to the HTTP server. */ + status = nx_tcp_socket_send(&client_socket, send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket, &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + if (test_count == 0) + { + /* Check the status, If authentication success , it should be 200. */ + if ((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + } + else + { + /* Check the status, If authentication fail , it should be 401. */ + if ((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + } + + nx_packet_release(recv_packet); + } + + /* Disconnect and unbind the socket. */ + nx_tcp_socket_disconnect(&client_socket, NX_WEB_HTTP_CLIENT_TIMEOUT); + nx_tcp_client_socket_unbind(&client_socket); + + tx_semaphore_put(&client_stop); + } + + status = nx_tcp_socket_delete(&client_socket); + if (status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static UINT digest_authenticate_callback(NX_WEB_HTTP_SERVER *server_ptr, CHAR *name_ptr, + CHAR *realm_ptr, CHAR *password_ptr, CHAR *method, + CHAR *authorization_uri, CHAR *authorization_nc, + CHAR *authorization_cnonce) +{ + + if (memcmp(authorization_nc, "00000001", 8) != 0) + { + return 1; + } + + if (test_count == 0) + { + /* Test authentication success. */ + return 0; + } + else + { + /* Test authentication fail. */ + return 1; + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; + + + /* Print out test information banner. */ + printf("NetX Test: Web Digest Authenticate Test2............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if (status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, NX_WEB_HTTP_SERVER_PORT, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, NX_NULL); + if (status) + error_counter++; + + nx_web_http_server_digest_authenticate_notify_set(&my_server, digest_authenticate_callback); + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); + tx_semaphore_get(&client_stop, NX_WAIT_FOREVER); + + status = nx_web_http_server_authentication_check_set(&my_server, authentication_check_extended); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request digest authentication. */ + return(NX_WEB_HTTP_DIGEST_AUTHENTICATE); +} + +static UINT authentication_check_extended(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, CHAR **name, UINT *name_length, + CHAR **password, UINT *password_length, CHAR **realm, UINT *realm_length) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + *name_length = 4; + *password_length = 8; + *realm_length = 18; + + /* Request digest authentication. */ + return(NX_WEB_HTTP_DIGEST_AUTHENTICATE); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_digest_authenticate_test_2_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Digest Authenticate Test2.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_digest_authenticate_timeout_test.c b/test/regression/web_test/netx_web_digest_authenticate_timeout_test.c new file mode 100644 index 00000000..54551cbd --- /dev/null +++ b/test/regression/web_test/netx_web_digest_authenticate_timeout_test.c @@ -0,0 +1,573 @@ +/* This case tests digest authentication. + HA1 = MD5("name:NetX Duo HTTP demo:Placeholderpassword") + = 01bb2595c9221423951ee86f3573b465 + HA2 = MD5("GET:/index.htm") + = d4b1da8c7955d2e98bc56ffc93003b44 + Response = MD5("01bb2595c9221423951ee86f3573b465: + nonce: + 00000001:0a4f113b:auth: + d4b1da8c7955d2e98bc56ffc93003b44") + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTP_DIGEST_ENABLE) && !defined(NX_WEB_HTTP_KEEPALIVE_DISABLE) + +#include "http_digest_authentication.c" + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NX_TCP_SOCKET client_socket[NX_WEB_HTTP_SERVER_NONCE_MAX + 1]; +#ifdef __PRODUCT_NETXDUO__ +static NXD_ADDRESS server_ip_address; +#else +static ULONG server_ip_address; +#endif + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +static TX_SEMAPHORE server_start; +static TX_SEMAPHORE client_stop; + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); + +static CHAR nonce_buffer[NX_WEB_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR temp_nonce_buffer[NX_WEB_HTTP_SERVER_NONCE_SIZE + 1]; +static CHAR response_buffer[32 + 1]; +static NX_MD5 client_md5data; + +static char pkt[] = { +0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x20, /* GET /index.htm */ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, /* HTTP/1.1.. */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_digest_authenticate_timeout_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + tx_semaphore_create(&server_start, "server start", 0); + tx_semaphore_create(&client_stop, "client stop", 0); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *send_packet[NX_WEB_HTTP_SERVER_NONCE_MAX + 1]; +NX_PACKET *send_packet_replay; +NX_PACKET *recv_packet; +CHAR *buffer_ptr; +INT i; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ +#ifdef __PRODUCT_NETXDUO__ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; +#else + server_ip_address = HTTP_SERVER_ADDRESS; +#endif + + tx_semaphore_get(&server_start, NX_WAIT_FOREVER); + + for (i = 0; i < NX_WEB_HTTP_SERVER_NONCE_MAX + 1; i++) + { + + /* Create an HTTP client instance. */ + status = nx_tcp_socket_create(&client_ip, &client_socket[i], "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the client socket. */ + status = nx_tcp_client_socket_bind(&client_socket[i], NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check status of the bind. */ + if (status) + error_counter++; + + /* Connect to the HTTP server. */ + /* Invoke the 'Duo' (supports IPv6/IPv4) connection call. */ + status = nxd_tcp_client_socket_connect(&client_socket[i], &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet[i], pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_tcp_socket_send(&client_socket[i], send_packet[i], NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[i], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + else + { + + if (i == NX_WEB_HTTP_SERVER_NONCE_MAX) + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + /* Check the status, no nonce entry, it should be 200. */ + if ((buffer_ptr[9] != '5') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + + /* Discconect. */ + nx_tcp_socket_disconnect(&client_socket[i], NX_NO_WAIT); + + /* Sleep for the allocated nonce to be timed out. */ + tx_thread_sleep(NX_WEB_HTTP_SERVER_NONCE_TIMEOUT + NX_IP_PERIODIC_RATE); + + /* Reconnect to HTTP server. */ + status = nxd_tcp_client_socket_connect(&client_socket[i], &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet[i], pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + /* Initialize the buffer. */ + memset(nonce_buffer, 0, sizeof(nonce_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + + /* Send the request. */ + status = nx_tcp_socket_send(&client_socket[i], send_packet[i], NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[i], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } + + /* Retrieve the nonce. */ + status = http_nonce_retrieve(recv_packet, nonce_buffer); + if (status) + error_counter++; + + nx_packet_release(recv_packet); + } + + /* Calculate the response. */ + http_digest_response_calculate(&client_md5data, "name", "NetX Duo HTTP demo", "Placeholderpassword", nonce_buffer, "GET", + "/index.htm", "00000001", "0a4f113b", response_buffer); + + /* Allocate a packet. */ + status = nx_packet_allocate(&client_pool, &send_packet[i], NX_TCP_PACKET, NX_WAIT_FOREVER); + if (status) + error_counter++; + + nx_packet_data_append(send_packet[i], pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + + /* Build the Authorization header. */ + nx_packet_data_append(send_packet[i], "Authorization: Digest", 21, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " username=\"name\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " realm=\"NetX Duo HTTP demo\",", 28, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " nonce=\"", 8, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], nonce_buffer, NX_WEB_HTTP_SERVER_NONCE_SIZE, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " uri=\"/index.htm\",", 17, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " qop=auth,", 10, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " nc=00000001,", 13, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " cnonce=\"0a4f113b\",", 19, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " response=\"", 11, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], response_buffer, 32, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], "\",", 2, &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet[i], " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"\r\n", 44, &client_pool, NX_WAIT_FOREVER); + + nx_packet_data_append(send_packet[i], "\r\n", 2, &client_pool, NX_WAIT_FOREVER); + + nx_tcp_socket_disconnect(&client_socket[i], NX_NO_WAIT); + } + + /* Copy for replay test. */ + nx_packet_copy(send_packet[1], &send_packet_replay, &client_pool, NX_WAIT_FOREVER); + + for (i = NX_WEB_HTTP_SERVER_NONCE_MAX; i >= 0; i--) + { + + /* Reconnect to the HTTP server. */ + status = nxd_tcp_client_socket_connect(&client_socket[i], &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Now send the packet to the HTTP server. */ + status = nx_tcp_socket_send(&client_socket[i], send_packet[i], NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[i], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + if (i == 0) + { + /* This nonce is timed out, the response should be 401. */ + if ((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + } + else + { + /* Check the status, If authentication success , it should be 200. */ + if ((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + } + + nx_packet_release(recv_packet); + } + + if (i != 1) + { + + /* Disconnect and unbind the socket. */ + status = nx_tcp_socket_disconnect(&client_socket[i], NX_WEB_HTTP_CLIENT_TIMEOUT); + status += nx_tcp_client_socket_unbind(&client_socket[i]); + status += nx_tcp_socket_delete(&client_socket[i]); + if (status) + error_counter++; + } + } + + /* Use the copied packet for replay test. */ + /* Create an HTTP client instance. */ + status = nx_tcp_socket_create(&client_ip, &client_socket[0], "Socket 0", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + error_counter++; + + /* Bind the client socket. */ + status = nx_tcp_client_socket_bind(&client_socket[0], NX_ANY_PORT, NX_WAIT_FOREVER); + + /* Check status of the bind. */ + if (status) + error_counter++; + + /* Connect to the HTTP server. */ + status = nxd_tcp_client_socket_connect(&client_socket[0], &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Now send the packet to the HTTP server. */ + status = nx_tcp_socket_send(&client_socket[0], send_packet_replay, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Pickup the response from the Server. */ + status = nx_tcp_socket_receive(&client_socket[0], &recv_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + else + { + buffer_ptr = (CHAR *)recv_packet->nx_packet_prepend_ptr; + + /* This is a replay attack, the response should be 401. */ + if ((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + + nx_packet_release(recv_packet); + } + + for (i = 0; i < 2; i++) + { + + /* Disconnect and unbind the socket. */ + status = nx_tcp_socket_disconnect(&client_socket[i], NX_WEB_HTTP_CLIENT_TIMEOUT); + status += nx_tcp_client_socket_unbind(&client_socket[i]); + status += nx_tcp_socket_delete(&client_socket[i]); + if (status) + error_counter++; + } + + tx_semaphore_put(&client_stop); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; + + + /* Print out test information banner. */ + printf("NetX Test: Web Digest Authenticate Timeout Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if (status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, NX_WEB_HTTP_SERVER_PORT, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, NX_NULL); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + tx_semaphore_put(&server_start); +} + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "Placeholderpassword"; + *realm = "NetX Duo HTTP demo"; + + /* Request digest authentication. */ + return(NX_WEB_HTTP_DIGEST_AUTHENTICATE); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_digest_authenticate_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Digest Authenticate Timeout Test......................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_external_client_test.c b/test/regression/web_test/netx_web_external_client_test.c new file mode 100644 index 00000000..7be772b4 --- /dev/null +++ b/test/regression/web_test/netx_web_external_client_test.c @@ -0,0 +1,350 @@ +/* This case tests server send chunked packet to external client and process chunked packet from external client. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_pcap_network_driver(NX_IP_DRIVER*); + +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; + +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,100,22) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_external_client_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_pcap_network_driver, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Enable ICMP. */ + status = nx_icmp_enable(&server_ip); + if (status) + error_counter++; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web External Client Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + tx_thread_sleep(600 * NX_IP_PERIODIC_RATE); + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; +UINT content_length = 0, length = 0; +UCHAR buffer[4000]; + + /* Process request. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 6, "application/octet-stream", + NX_NULL); + if (status) + { + return(status); + } + + nx_packet_data_append(response_pkt, "abcdef", 6, server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + + } + else if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 0, "text/htm", + "Transfer-Encoding: chunked\r\n"); + if (status) + { + return(status); + } + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + + while (1) + { + status = nx_web_http_server_content_get(server_ptr, packet_ptr, content_length, buffer, sizeof(buffer), &length); + + if (status) + { + break; + } + + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, NX_WAIT_FOREVER); + if (status) + { + return(status); + } + + status = nx_web_http_server_response_chunked_set(server_ptr, length, response_pkt); + if (status) + { + return(status); + } + + nx_packet_data_append(response_pkt, buffer, length, server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + + content_length += length; + } + + + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, NX_WAIT_FOREVER); + if (status) + { + return(status); + } + + status = nx_web_http_server_response_chunked_set(server_ptr, 16, response_pkt); + if (status) + { + return(status); + } + + nx_packet_data_append(response_pkt, "NETX HTTP SERVER", 16, server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_external_client_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web External Client Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_external_server_chunked_test.c b/test/regression/web_test/netx_web_external_server_chunked_test.c new file mode 100644 index 00000000..1303bad1 --- /dev/null +++ b/test/regression/web_test/netx_web_external_server_chunked_test.c @@ -0,0 +1,197 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define device drivers. */ +extern void _nx_pcap_network_driver(NX_IP_DRIVER*); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; +static NXD_ADDRESS server_ip_address; + +static void thread_client_entry(ULONG thread_input); + +#define GATEWAY_IP_ADDRESS IP_ADDRESS(192, 168, 100, 1) +#define HTTP_SERVER_ADDRESS IP_ADDRESS(191, 236, 16, 125)/* http://www.httpwatch.com/httpgallery/chunked/chunkedimage.aspx */ +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192, 168, 100, 22) +#define CHUNKED_TOTAL_SIZE 33653 + +static UINT loop = 1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_external_server_chunked_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_pcap_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +UINT chunked_size = 0; + + printf("NetX Test: Web External Server Chunked Test.........................."); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + +#ifdef GATEWAY_IP_ADDRESS + /* Setup gateway for communicating with the outside world. */ + status = nx_ip_gateway_address_set(&client_ip, GATEWAY_IP_ADDRESS); + + /* Check for errors. */ + if (status) + { + printf("Error in setting gateway address: 0x%02x\n", status); + return; + } +#endif + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/httpgallery/chunked/chunkedimage.aspx", + "www.httpwatch.com", + NX_NULL, NX_NULL, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + while (1) + { + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, NX_WAIT_FOREVER); + + if (status) + { + break; + } + else + { + chunked_size += recv_packet -> nx_packet_length; + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if ((status != NX_WEB_HTTP_GET_DONE) || (chunked_size != CHUNKED_TOTAL_SIZE)) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Check if all the packets are released. */ + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + error_counter++; + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_external_server_chunked_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web External Server Chunked Test..........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_external_server_test.c b/test/regression/web_test/netx_web_external_server_test.c new file mode 100644 index 00000000..2bc351dc --- /dev/null +++ b/test/regression/web_test/netx_web_external_server_test.c @@ -0,0 +1,262 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "globalsignrootca_cer.c" +#define ca_cert_der globalsignrootca_der +#define ca_cert_der_len globalsignrootca_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Define device drivers. */ +extern void _nx_pcap_network_driver(NX_IP_DRIVER*); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; +static NXD_ADDRESS server_ip_address; + +static void thread_client_entry(ULONG thread_input); + +#define GATEWAY_IP_ADDRESS IP_ADDRESS(192, 168, 100, 1) +#if 1 +#define HTTP_SERVER_ADDRESS IP_ADDRESS(180, 149, 134, 141)/* weibo.com */ +#define HOST_NAME "weibo.com" +#else +#define HTTP_SERVER_ADDRESS IP_ADDRESS(115, 239, 210, 27)/* baidu.com */ +#define HOST_NAME "www.baidu.com" +#endif +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192, 168, 100, 22) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[4096]; +static UCHAR remote_issuer_buffer[4096]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_external_server_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_pcap_network_driver, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + printf("NetX Test: Web External Server Test.................................."); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + +#ifdef GATEWAY_IP_ADDRESS + /* Setup gateway for communicating with the outside world. */ + status = nx_ip_gateway_address_set(&client_ip, GATEWAY_IP_ADDRESS); + + /* Check for errors. */ + if (status) + { + printf("Error in setting gateway address: 0x%02x\n", status); + return; + } +#endif + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/index.htm", + HOST_NAME, + NX_NULL, NX_NULL, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + HOST_NAME, NX_NULL, NX_NULL, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + while (1) + { + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (recv_packet) + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_external_server_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web External Server Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_get_content_length_test.c b/test/regression/web_test/netx_web_get_content_length_test.c new file mode 100644 index 00000000..7c327570 --- /dev/null +++ b/test/regression/web_test/netx_web_get_content_length_test.c @@ -0,0 +1,622 @@ +/* This case tests the get content length task which should allow zero or more white + spaces between field name (Content-Length) and value. +*/ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static void http_test_initialize(); +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char get_response_packet[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x34, 0x31, 0x35, /* gth: 415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow
..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; +static int get_response_size = 130; + +static char get_response_packet_nospace[129] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x34, 0x31, 0x35, /* gth:415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; +static int get_response_packet_nospace_size = 129; + +static char get_response_packet_3spaces[132] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x20, 0x34, 0x31, 0x35, /* gth: 415 */ +0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 4..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; +static int get_response_packet_3spaces_size = 132; + +static char get_response_packet_nolength[130] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x20, 0x20, /* gth: */ +0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* ..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; +static int get_response_packet_nolength_size = 130; + +static char get_response_packet_error[10] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x0d, 0x0a, 0x0d, 0x0a, /* TP/1.0 2 */ +}; +static int get_response_packet_error_size = 10; + +#define RESPONSE_COUNT 5 + +typedef struct HTTP_RESPONSE_STRUCT +{ + char *http_response_pkt_data; + int http_response_pkt_size; +} HTTP_RESPONSE; + +static HTTP_RESPONSE http_response[RESPONSE_COUNT]; + +static UINT packet_number = 0; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_get_content_length_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + packet_number = 0; + + for (j = 0; j < RESPONSE_COUNT; j++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if ((status != NX_SUCCESS) && (status != NX_WEB_HTTP_GET_DONE) && (j < 3)) + error_counter++; + else if (((status == NX_SUCCESS) || (status == NX_WEB_HTTP_GET_DONE)) && (j > 3)) + error_counter++; + + if (status == NX_SUCCESS) + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + } + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Get Content-Length Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Initialize the test data. */ + http_test_initialize(); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +static void http_test_initialize() +{ + + http_response[0].http_response_pkt_data = &get_response_packet[0]; + http_response[0].http_response_pkt_size = get_response_size; + + http_response[1].http_response_pkt_data = &get_response_packet_nospace[0]; + http_response[1].http_response_pkt_size = get_response_packet_nospace_size; + + http_response[2].http_response_pkt_data = &get_response_packet_3spaces[0]; + http_response[2].http_response_pkt_size = get_response_packet_3spaces_size; + + http_response[3].http_response_pkt_data = &get_response_packet_nolength[0]; + http_response[3].http_response_pkt_size = get_response_packet_nolength_size; + + http_response[4].http_response_pkt_data = &get_response_packet_error[0]; + http_response[4].http_response_pkt_size = get_response_packet_error_size; + +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, http_response[packet_number].http_response_pkt_data, http_response[packet_number].http_response_pkt_size, + &server_pool, NX_WAIT_FOREVER); + + packet_number++; + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_get_content_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Get Content-Length Test...............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_get_put_referred_URI_test.c b/test/regression/web_test/netx_web_get_put_referred_URI_test.c new file mode 100644 index 00000000..c10d8091 --- /dev/null +++ b/test/regression/web_test/netx_web_get_put_referred_URI_test.c @@ -0,0 +1,527 @@ +/* This case tests the ability of the HTTP Client to accept a URI resource string that does not + designate a root directory based file location. If the string begins with an HTTP: or HTTPS: (not + case sensitive) the HTTP Client will send the string as is. (Note this does not guarantee the HTTP server + will forward to the referred location.) Otherwise the URI is processed as if it is root directory based, + and a leading forward slash '/' is appended if one is missing. + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_get_put_referred_URI_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Send PUT request. */ + if (i == 0) + { + + status = nx_web_http_client_put_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://www.abc.com/client_test.htm", + "www.abc.com", "name", "password", 103, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + status = nx_web_http_client_put_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://www.abc.com/client_test1.htm", + "www.abc.com", "name", "password", 103, tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://www.abc.com/client_test.htm", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://www.abc.com/client_test1.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Get Put Referred URI Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_get_put_referred_URI_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Get Put Referred URI Test.............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_head_basic_test.c b/test/regression/web_test/netx_web_head_basic_test.c new file mode 100644 index 00000000..9474dfd5 --- /dev/null +++ b/test/regression/web_test/netx_web_head_basic_test.c @@ -0,0 +1,459 @@ +/* This case tests basic HEAD method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 4; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 2; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_head_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i < 2) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send HEAD request. */ + if (i == 0) + { + status = nx_web_http_client_head_start(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, + "/index.htm", "www.abc.com", NX_NULL, NX_NULL, + NX_WAIT_FOREVER); + } + else if (i == 1) + { + status = nx_web_http_client_head_start_extended(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, + "/index.htm", 10, "www.abc.com", 11, NX_NULL, 0, NX_NULL, 0, + NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 2) + { + status = nx_web_http_client_head_secure_start(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + "/index.htm", "www.abc.com", NX_NULL, NX_NULL, + tls_setup_callback, NX_WAIT_FOREVER); + } + else + { + status = nx_web_http_client_head_secure_start_extended(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + "/index.htm", 10, "www.abc.com", 11, NX_NULL, 0, NX_NULL, 0, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 1) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 3) + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Head Basic Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop/2; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_head_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Head Basic Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_host_field_test.c b/test/regression/web_test/netx_web_host_field_test.c new file mode 100644 index 00000000..a025e947 --- /dev/null +++ b/test/regression/web_test/netx_web_host_field_test.c @@ -0,0 +1,510 @@ +/* This case tests Host field. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); +extern UINT _nx_web_http_server_field_value_get(NX_PACKET *packet_ptr, UCHAR *field_name, ULONG name_length, UCHAR *field_value, ULONG field_value_size); +static CHAR *host_test = "express_logic"; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_host_field_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/test.txt", + host_test, "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/test.txt", + host_test, "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Host Field Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; +CHAR temp_string[20]; + + + /* Check the Host field. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Get the Host field. */ + if (_nx_web_http_server_field_value_get(packet_ptr, (UCHAR *)"Host", 4, (UCHAR *)temp_string, sizeof(temp_string)) == NX_SUCCESS) + { + if (memcmp(temp_string, host_test, strlen(host_test)) != 0) + { + error_counter++; + } + } + else + { + error_counter++; + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 0, NX_NULL, + NX_NULL); + + if(status) + { + return(status); + } + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_host_field_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Host Field Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_http_demo_test.c b/test/regression/web_test/netx_web_http_demo_test.c new file mode 100644 index 00000000..75048f60 --- /dev/null +++ b/test/regression/web_test/netx_web_http_demo_test.c @@ -0,0 +1,221 @@ +/* This is a small demo of HTTP on the high-performance NetX TCP/IP stack. + This demo relies on ThreadX, NetX, and FileX to show a simple HTML + transfer from the client and then back from the server. */ + +#include "tx_api.h" +#include "fx_api.h" +#include "nx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" +#include "test_utility.h" +#define DEMO_STACK_SIZE 4096 + +/* Define the ThreadX and NetX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +NX_PACKET_POOL pool_0; +NX_PACKET_POOL pool_1; +NX_IP ip_0; +NX_IP ip_1; +FX_MEDIA ram_disk; + +/* Define HTTP objects. */ + +NX_WEB_HTTP_SERVER my_server; +NX_WEB_HTTPS_CLIENT my_client; + +/* Define the counters used in the demo application... */ + +ULONG error_counter; + + +/* Define the RAM disk memory. */ + +UCHAR ram_disk_memory[32000]; + + +/* Define function prototypes. */ + +void thread_0_entry(ULONG thread_input); +VOID _fx_ram_driver(FX_MEDIA *media_ptr) ; +void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_http_demo_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 2, 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + nx_packet_pool_create(&pool_0, "NetX Packet Pool 0", 640, pointer, 8192); + pointer = pointer + 8192; + + /* Create an IP instance. */ + nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Create another packet pool. */ + nx_packet_pool_create(&pool_1, "NetX Packet Pool 1", 640, pointer, 8192); + pointer = pointer + 8192; + + /* Create another IP instance. */ + nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), + 0xFFFFFF00UL, &pool_1, _nx_ram_network_driver, + pointer, 4096, 1); + pointer = pointer + 4096; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + nx_arp_enable(&ip_1, (void *) pointer, 1024); + pointer = pointer + 1024; + + /* Enable TCP processing for both IP instances. */ + nx_tcp_enable(&ip_0); + nx_tcp_enable(&ip_1); + + /* Open the RAM disk. */ + /* Format the media. This needs to be done before opening it! */ + status = fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + pointer, // Media buffer pointer + 4096, // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 511, // Total sectors + 128, // Sector size + 1, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + EXPECT_EQ(0, status); + + status = fx_media_open(&ram_disk, "RAM DISK", + _fx_ram_driver, ram_disk_memory, pointer, 4096) ; + EXPECT_EQ(0, status); + pointer += 4096; + + /* Create the NetX HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &ip_1, &ram_disk, + pointer, 4096, &pool_1, authentication_check, NX_NULL); + EXPECT_EQ(NX_SUCCESS, status); + pointer = pointer + 4096; + + /* Start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + EXPECT_EQ(NX_SUCCESS, status); +} + + +/* Define the test thread. */ +void thread_0_entry(ULONG thread_input) +{ + +NX_PACKET *my_packet; +UINT status; +NXD_ADDRESS server_ip_address; +UCHAR buffer[100]; +ULONG bytes_received; + + + printf("NetX Test: Web HTTP Demo Test........................................"); + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "My Client", &ip_0, + &pool_0, 600); + EXPECT_EQ(NX_SUCCESS, status); + + /* Prepare to send the simple 5-byte HTML file to the Server. */ + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + server_ip_address.nxd_ip_address.v4 = IP_ADDRESS(1, 2, 3, 5); + status = nx_web_http_client_put_start(&my_client, &server_ip_address, + "/test.htm", "name", "password", 5, 50); +#if 0 + status = nx_web_http_client_put_start(&my_client, &server_ip_address, + "/test.htm", "", "", 5, 50); +#endif + EXPECT_EQ(NX_SUCCESS, status); + + /* Allocate a packet. */ + status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, + NX_WAIT_FOREVER); + EXPECT_EQ(NX_SUCCESS, status); + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(my_packet, "hello", 5, &pool_0, NX_WAIT_FOREVER); + + /* Complete the PUT by writing the total length. */ + status = nx_web_http_client_put_packet(&my_client, my_packet, 50); + EXPECT_EQ(NX_SUCCESS, status); + + /* Now GET the file back! */ + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + "/test.htm", NX_NULL, 0, "name", "password", 50); +#if 0 + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + "/test.htm", NX_NULL, 0, "", "", 50); +#endif + EXPECT_EQ(NX_SUCCESS, status); + + /* Get a packet. */ + status = nx_web_http_client_get_packet(&my_client, &my_packet, 20); + EXPECT_EQ(NX_SUCCESS, status); + + status = nx_packet_data_extract_offset(my_packet, 0, buffer, 100, &bytes_received); + EXPECT_EQ(NX_SUCCESS, status); + EXPECT_EQ((UINT)bytes_received, 5); + EXPECT_EQ(buffer[0], 'h'); + EXPECT_EQ(buffer[1], 'e'); + EXPECT_EQ(buffer[2], 'l'); + EXPECT_EQ(buffer[3], 'l'); + EXPECT_EQ(buffer[4], 'o'); + nx_packet_release(my_packet); + + /* Flush the media. */ + fx_media_flush(&ram_disk); + + printf("SUCCESS!\n"); + test_control_return(0); +} diff --git a/test/regression/web_test/netx_web_https_demo_test.c b/test/regression/web_test/netx_web_https_demo_test.c new file mode 100644 index 00000000..8f00fc7e --- /dev/null +++ b/test/regression/web_test/netx_web_https_demo_test.c @@ -0,0 +1,441 @@ +/* This is a small demo of the NetX HTTP Client Server API running on a + high-performance NetX TCP/IP stack. */ + +#include "tx_api.h" +#include "nx_api.h" +/* If not using FileX, define this option and define the file writing services + declared in filex_stub.h. +#define NX_WEB_HTTP_NO_FILEX +*/ +#ifndef NX_WEB_HTTP_NO_FILEX +#include "fx_api.h" +#else +#include "filex_stub.h" +#endif + +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + + +#include "tx_api.h" +#include "nx_api.h" +#include "nx_crypto.h" +#include "nx_secure_tls_api.h" +#include "nx_secure_dtls_api.h" +#include "nx_secure_x509.h" +#include "test_utility.h" + + +/* For NetX Duo applications, determine which IP version to use. For IPv6, + set IP_TYPE to 6; for IPv4 set to 4. Note that for IPv6, you must enable + USE_DUO so the application 'knows' to enabled IPv6 services on the IP task. */ + +#ifdef NX_DISABLE_IPV4 +#define IP_TYPE 6 +#else +#define IP_TYPE 4 +#endif /* NX_DISABLE_IPV4 */ + + +#define DEMO_STACK_SIZE 4096 + +/* Replace the 'ram' driver with your Ethernet driver. */ +VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); + +/* Set up the HTTP client global variables. */ + +NX_SECURE_TLS_SESSION client_tls_session; +TX_THREAD client_thread; +NX_WEB_HTTPS_CLIENT my_client; +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + + +/* Set up the HTTP server global variables */ + +NX_SECURE_TLS_SESSION server_tls_session; +NX_WEB_HTTP_SERVER my_server; +NX_PACKET_POOL server_pool; +NX_PACKET_POOL client_pool; +TX_THREAD server_thread; +NX_IP server_ip; +NX_IP client_ip; + +NXD_ADDRESS server_ip_address; +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +void https_server_thread_entry(ULONG thread_input); +void https_client_thread_entry(ULONG thread_input); + +/* HTTPS/TLS setup. */ + +#include "test_device_cert.c" + +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +static CHAR crypto_metadata[8928 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +/* Define the RAM disk memory. */ +static UCHAR media_memory[4096]; +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; + +static UCHAR server_stack[16000]; + +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +/* Gateway IP address - if needed! */ +//#define GATEWAY_IP_ADDRESS IP_ADDRESS(192, 168, 1, 1) + + +/* Google.com IP address. */ +//#define HTTP_SERVER_ADDRESS IP_ADDRESS(172,217,11,174) + +/* Local IP address. */ +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192, 168, 1, 150) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192, 168, 1, 151) + +VOID _fx_ram_driver(FX_MEDIA *media_ptr) ; +VOID _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + NX_PARAMETER_NOT_USED(server_ptr); + NX_PARAMETER_NOT_USED(request_type); + NX_PARAMETER_NOT_USED(resource); + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_https_demo_test_application_define(void *first_unused_memory) +#endif +{ + +CHAR *pointer; +UINT status; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTPS Server thread", https_server_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTPS Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE * 20); + EXPECT_EQ(NX_SUCCESS, status); + + pointer = pointer + SERVER_PACKET_SIZE * 20; + + /* Check for pool creation error. */ + if (status) + { + + return; + } + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver, + pointer, 4096, 1); + EXPECT_EQ(NX_SUCCESS, status); + + pointer = pointer + 4096; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + EXPECT_EQ(NX_SUCCESS, status); + + pointer = pointer + 1024; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + EXPECT_EQ(NX_SUCCESS, status); + + /* Set up the server's IPv4 address here. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + pointer = pointer + 2048; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTPS Client", https_client_thread_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + EXPECT_EQ(NX_SUCCESS, status); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTPS Client Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE * 20); + EXPECT_EQ(NX_SUCCESS, status); + + pointer = pointer + SERVER_PACKET_SIZE * 20; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTPS Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver, + pointer, 2048, 1); + EXPECT_EQ(NX_SUCCESS, status); + + pointer = pointer + 2048; + + nx_arp_enable(&client_ip, (void *) pointer, 1024); + + pointer = pointer + 2048; + + /* Enable TCP traffic. */ + nx_tcp_enable(&client_ip); + + return; +} + +VOID https_client_thread_entry(ULONG thread_input) +{ + +UINT status; +NX_PACKET *my_packet; +NX_PACKET *receive_packet; +UCHAR receive_buffer[1000]; +ULONG bytes; +NXD_ADDRESS server_ip_address; + + NX_PARAMETER_NOT_USED(thread_input); + + printf("NetX Test: Web HTTPS Demo Test......................................."); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(7 * NX_IP_PERIODIC_RATE); + + status = nx_secure_tls_session_create(&client_tls_session, &nx_crypto_tls_ciphers, crypto_metadata, sizeof(crypto_metadata)); + EXPECT_EQ(NX_SUCCESS, status); + + /* Create an HTTPS client instance. */ + status = _nx_web_https_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 65535, &client_tls_session); + EXPECT_EQ(NX_SUCCESS, status); + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(my_client.nx_web_http_client_tls_session, tls_packet_buffer, sizeof(tls_packet_buffer)); + EXPECT_EQ(NX_SUCCESS, status); + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&client_tls_session, &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&client_tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&client_tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + /* Allocate a packet. */ + //status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + EXPECT_EQ(NX_SUCCESS, status); + + /* GET the test page */ + /* Use the 'NetX' service to send a GET request to the server (can only use IPv4 addresses). */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + status = nx_web_http_client_get_start(&my_client, &server_ip_address, "/https_server.sh", + NX_NULL, 0, "name", "password", NX_WAIT_FOREVER); + EXPECT_EQ(NX_SUCCESS, status); + + status = nx_web_http_client_get_packet(&my_client, &receive_packet, NX_WAIT_FOREVER); + EXPECT_EQ(NX_SUCCESS, status); + + status = nx_packet_data_extract_offset(receive_packet, 0, receive_buffer, 1000, &bytes); + EXPECT_EQ(NX_SUCCESS, status); + + receive_buffer[bytes] = 0; + //printf("Received: %s\n", receive_buffer); + EXPECT_EQ((UINT)bytes, 12); + EXPECT_EQ(receive_buffer[0], 'h'); + EXPECT_EQ(receive_buffer[1], 't'); + EXPECT_EQ(receive_buffer[2], 't'); + EXPECT_EQ(receive_buffer[3], 'p'); + EXPECT_EQ(receive_buffer[4], 's'); + EXPECT_EQ(receive_buffer[5], ' '); + EXPECT_EQ(receive_buffer[6], 's'); + EXPECT_EQ(receive_buffer[7], 'e'); + EXPECT_EQ(receive_buffer[8], 'r'); + EXPECT_EQ(receive_buffer[9], 'v'); + EXPECT_EQ(receive_buffer[10], 'e'); + EXPECT_EQ(receive_buffer[11], 'r'); + + status = nx_web_http_client_delete(&my_client); + EXPECT_EQ(NX_SUCCESS, status); + + printf("SUCCESS!\n"); + test_control_return(0); +} + +/************* HTTP(S) Server *************************/ + + +/* TLS setup callback, used to configure the TLS sessions for an HTTPS server. */ +UINT server_tls_setup(NX_WEB_HTTP_SERVER *http_server_ptr, NX_TCPSERVER *socket_server) +{ +UINT status; + + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_tcpserver_tls_setup(&http_server_ptr -> nx_web_http_server_tcpserver, &nx_crypto_tls_ciphers, + crypto_metadata, sizeof(crypto_metadata), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0); + return(status); +} + +UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +ULONG offset, length; +NX_PACKET *response_pkt; +UCHAR buffer[1440]; +UINT i; +UINT status; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + /* Get the content header. */ + while(nx_web_http_server_get_entity_header(server_ptr, &packet_ptr, buffer, + sizeof(buffer)) == NX_SUCCESS) + { + + /* Header obtained successfully. Get the content data location. */ + while(nx_web_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, + &length) == NX_SUCCESS) + { + /* Write content data to buffer. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer, length, + &length); + buffer[length] = 0; + } + + printf("Receive buffer of size %d:\n", (UINT)length); + for(i = 0; i < length; ++i) + { + printf("%c", buffer[i]); + } + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 800, "text/html", + "Server: NetX HTTPS Experimental\r\n"); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != + NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet.*/ + return(NX_SUCCESS); + } + + + /* Release the received client packet. */ + nx_packet_release(packet_ptr); + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); + +} + +/* Define the helper HTTP server thread. */ +void https_server_thread_entry(ULONG thread_input) +{ + +UINT status; +FX_FILE my_file; + + NX_PARAMETER_NOT_USED(thread_input); + status = fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + EXPECT_EQ(NX_SUCCESS, status); + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "/https_server.sh"); + status += fx_file_open(&ram_disk, &my_file, "https_server.sh", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + EXPECT_EQ(NX_SUCCESS, status); + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE * 7); + + /* Create the HTTPS Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, &server_stack, sizeof(server_stack), &server_pool, authentication_check, server_request_callback); + EXPECT_EQ(NX_SUCCESS, status); + + /* Start an HTTPS Server with TLS. */ + status = nx_web_http_server_secure_start(&my_server, server_tls_setup, NX_NULL); + EXPECT_EQ(NX_SUCCESS, status); + + /* HTTP server ready to take requests! */ + /* Let the IP thread execute. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + while(1) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + //return; +} + + + diff --git a/test/regression/web_test/netx_web_if_modified_since_test.c b/test/regression/web_test/netx_web_if_modified_since_test.c new file mode 100644 index 00000000..c5f08b91 --- /dev/null +++ b/test/regression/web_test/netx_web_if_modified_since_test.c @@ -0,0 +1,558 @@ +/* This case tests filed If-Modified-field. + * if the requested variant has not been modified since the time specified in this field, + * an entity will not be returned from the server; instead, a 304 (not modified) response + * will be returned without any message-body. + * + * In this case, client get the index.htm with If-Modified-Since = 20130101, and index.htm is + * modified on 2013...., So server should send 304. + * */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +#if defined(WIN32) || defined(__linux__) +#include +#endif /* defined(WIN32) || defined(__linux__) */ + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +/* Frame (190 bytes) */ +/* This is a HTTP get packet captured by wireshark. If-Modified-since = 20130101 .*/ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0xb0, 0x09, 0xb8, 0x40, 0x00, 0x80, 0x06, /* ....@... */ + 0x6e, 0x5b, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* n[...i.. */ + 0x00, 0x7b, 0xc4, 0x77, 0x00, 0x50, 0x51, 0x6d, /* .{.w.PQm */ + 0xbc, 0x22, 0x77, 0x7f, 0x23, 0xc7, 0x50, 0x18, /* ."w.#.P. */ + 0xfa, 0xf0, 0x20, 0x9c, 0x00, 0x00, 0x47, 0x45, /* .. ...GE */ + 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, /* T /index */ + 0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, /* .htm HTT */ + 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, /* P/1.1..U */ + 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, /* ser-Agen */ + 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, /* t: curl/ */ + 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, /* 7.32.0.. */ + 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, /* Host: 19 */ + 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, /* 2.168.0. */ + 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, /* 123..Acc */ + 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, /* ept: */ + 0x0d, 0x0a, 0x49, 0x66, 0x2d, 0x4d, 0x6f, 0x64, /* ..If-Mod */ + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x53, 0x69, /* ified-Si */ + 0x6e, 0x63, 0x65, 0x3a, 0x20, 0x54, 0x75, 0x65, /* nce: Tue */ + 0x2c, 0x20, 0x30, 0x31, 0x20, 0x4a, 0x61, 0x6e, /* , 01 Jan */ + 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x30, 0x30, /* 2013 00 */ + 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x20, 0x47, /* :00:00 G */ + 0x4d, 0x54, 0x0d, 0x0a, 0x0d, 0x0a /* MT.... */ +}; + +#if defined(WIN32) || defined(__linux__) +static VOID get_gmt(NX_WEB_HTTP_SERVER_DATE *now); +static UINT cache_info_get(CHAR *resource, UINT *max_age, NX_WEB_HTTP_SERVER_DATE *last_modified); +#endif /* defined(WIN32) || defined(__linux__) */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_if_modified_since_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write If-Mdified-since Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt) - 54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = _nx_web_http_client_send(&my_client, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 304. */ + if((buffer_ptr[9] != '3') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '4')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web If Modified Since Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + +#if defined(WIN32) || defined(__linux__) + nx_web_http_server_gmt_callback_set(&my_server, get_gmt); + nx_web_http_server_cache_info_callback_set(&my_server, cache_info_get); +#endif /* defined(WIN32) || defined(__linux__) */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#if defined(WIN32) || defined(__linux__) +VOID get_gmt(NX_WEB_HTTP_SERVER_DATE *now) +{ +time_t rawtime; +struct tm *timeinfo; + + time (&rawtime); + timeinfo = gmtime(&rawtime); + + now -> nx_web_http_server_day = timeinfo -> tm_mday; + now -> nx_web_http_server_month = timeinfo -> tm_mon; + now -> nx_web_http_server_year = timeinfo -> tm_year + 1900; + now -> nx_web_http_server_hour = timeinfo -> tm_hour; + now -> nx_web_http_server_minute = timeinfo -> tm_min; + now -> nx_web_http_server_second = timeinfo -> tm_sec; + now -> nx_web_http_server_weekday = timeinfo -> tm_wday; + + +} + +UINT cache_info_get(CHAR *resource, UINT *max_age, NX_WEB_HTTP_SERVER_DATE *last_modified) +{ + *max_age = 315360000; + + /* 20130101 */ + last_modified -> nx_web_http_server_day = 1; + last_modified -> nx_web_http_server_month = 0; + last_modified -> nx_web_http_server_year = 113 + 1900; /* 2013 */ + last_modified -> nx_web_http_server_hour = 0; + last_modified -> nx_web_http_server_minute = 0; + last_modified -> nx_web_http_server_second = 0; + last_modified -> nx_web_http_server_weekday = 2; + + return NX_TRUE; +} +#endif /* defined(WIN32) || defined(__linux__) */ + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_if_modified_since_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web If Modfied Since Test.................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_invalid_release_test.c b/test/regression/web_test/netx_web_invalid_release_test.c new file mode 100644 index 00000000..a92a2c64 --- /dev/null +++ b/test/regression/web_test/netx_web_invalid_release_test.c @@ -0,0 +1,504 @@ +/* This case tests sending packet failure. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_invalid_release_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send PUT request. */ + if (i == 0) + { + + status = nx_web_http_client_put_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/http_put_test2.html", 34, + "www.abc.com", 11, "name", 4, "password", 8, 103, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + status = nx_web_http_client_put_secure_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/https_put_test2.html", 36, + "www.abc.com", 11, "name", 4, "password", 8, 103, tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the an empty packet. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + } + else + { + error_counter++; + } + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + if (i == 1) + { + send_packet -> nx_packet_prepend_ptr = send_packet -> nx_packet_data_start; + send_packet -> nx_packet_append_ptr = send_packet -> nx_packet_prepend_ptr; + } + + /* Send the an empty packet. */ + status = nx_web_http_client_request_packet_send(&my_client, send_packet, NX_FALSE, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + } + else + { + error_counter++; + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 1) + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Invalid Release Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_invalid_releases || server_pool.nx_packet_pool_invalid_releases) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_invalid_release_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Invalid Release Test..................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_keep_alive_abnormal_test.c b/test/regression/web_test/netx_web_keep_alive_abnormal_test.c new file mode 100644 index 00000000..fcd32218 --- /dev/null +++ b/test/regression/web_test/netx_web_keep_alive_abnormal_test.c @@ -0,0 +1,495 @@ +/* This case tests HTTP/1.1 server establish a persistent connection with a HTTP/1.1 client. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_WEB_HTTP_KEEPALIVE_DISABLE) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT test_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_keep_alive_abnormal_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + for (test_count = 0; test_count < 2; test_count++) + { + + /* Server disconnect the connection. */ + if (test_count == 1) + { + nx_tcp_socket_disconnect(&(my_server.nx_web_http_server_current_session_ptr -> nx_tcp_session_socket), NX_NO_WAIT); + } + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Initialize HTTP request. */ + status = nx_web_http_client_request_initialize(&my_client, + NX_WEB_HTTP_METHOD_GET, + "/index.htm", + "www.abc.com", + 0, + NX_FALSE, + NX_NULL, + NX_NULL, + 1 * NX_IP_PERIODIC_RATE); + + /* For HTTPS, if the connection is closed, the initialization should be failed. */ + if (status) + { + error_counter++; + break; + } + + /* Send GET with "connection: keep-alive", the connection should be kept alive. */ + status = nx_web_http_client_request_header_add(&my_client, "Connection", 10, "keep-alive", 10, 1 * NX_IP_PERIODIC_RATE); + + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + error_counter++; + break; + } + + /* Get the response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check the status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + } + + /* Delele the client. */ + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Keep Alive Abnormal Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_keep_alive_abnormal_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Keep Alive Abnormal Test..............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_keep_alive_test.c b/test/regression/web_test/netx_web_keep_alive_test.c new file mode 100644 index 00000000..7e8b14ba --- /dev/null +++ b/test/regression/web_test/netx_web_keep_alive_test.c @@ -0,0 +1,526 @@ +/* This case tests HTTP/1.1 server establish a persistent connection with a HTTP/1.1 client. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_WEB_HTTP_KEEPALIVE_DISABLE) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT test_count; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_keep_alive_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +static VOID http_response_callback(NX_WEB_HTTP_CLIENT *client_ptr, CHAR *field_name, UINT field_name_length, + CHAR *field_value, UINT field_value_length) +{ + if(memcmp(field_name, "Connection", field_name_length) == 0) + { + if ((test_count == 0) && (memcmp(field_value, "keep-alive", field_value_length) != 0)) + error_counter++; + else if((test_count == 1) && (memcmp(field_value, "Close", field_value_length) != 0)) + error_counter++; + } +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Set the header callback routine. */ + nx_web_http_client_response_header_callback_set(&my_client, http_response_callback); + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* First send GET with "connection: keep-alive", the connection should be kept alive. + Then send GET with "connection: close", the connection should be colsed. + If the connection is closed, the third request sending should be failed. */ + for (test_count = 0; test_count < 3; test_count++) + { + + /* Initialize HTTP request. */ + status = nx_web_http_client_request_initialize(&my_client, + NX_WEB_HTTP_METHOD_GET, + "/index.htm", + "www.abc.com", + 0, + NX_FALSE, + NX_NULL, + NX_NULL, + 1 * NX_IP_PERIODIC_RATE); + + /* For HTTPS, if the connection is closed, the initialization should be failed. */ + if ((i == 1) && (test_count == 2)) + { + if (!status) + error_counter++; + break; + } + else if (status) + { + error_counter++; + break; + } + + /* Add the connection field. */ + if (test_count == 0) + { + status = nx_web_http_client_request_header_add(&my_client, "Connection", 10, "keep-alive", 10, 1 * NX_IP_PERIODIC_RATE); + } + else if (test_count == 1) + { + status = nx_web_http_client_request_header_add(&my_client, "Connection", 10, "close", 5, 1 * NX_IP_PERIODIC_RATE); + } + + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, 1 * NX_IP_PERIODIC_RATE); + + if ((i == 0) && (test_count == 2)) + { + if (!status) + error_counter++; + break; + } + else if (status) + { + error_counter++; + break; + } + + /* Get the response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check the status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + } + + /* Delele the client. */ + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Keep Alive Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_keep_alive_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Keep Alive Test.......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_multipart_fragment_test.c b/test/regression/web_test/netx_web_multipart_fragment_test.c new file mode 100644 index 00000000..4578b837 --- /dev/null +++ b/test/regression/web_test/netx_web_multipart_fragment_test.c @@ -0,0 +1,820 @@ +/* This case tests whether HTTP server can work well with multipart/form-data. + * server packet size 800 + * client packet size 1400 + * pkt size is bigger than 1500 to cause client/server fragmentation. + */ + +/* Here is the packet content. */ +/* +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example" + +test(repeat 49 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example2" + +test2(repeat 35 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example3" + +test3(repeat 39 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example4" + +test4(repeat 51times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example5" + +test5(repeat 54times) +------------------------------4ebf00fbcf09-- +*/ + +/* length1 = 196, + * length2 = 175, + * length3 = 195, + * length4 = 205 + * length5 = 220. + * */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if defined(NX_WEB_HTTP_MULTIPART_ENABLE) && !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ +static UINT multipart_flag; + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +//#define TEST_CHUNKED + +/* This is a HTTP get packet captured by wireshark. HEAD index.html*/ +static char pkt[] = { + 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2f, 0x20, 0x48, /* POST / H */ + 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, /* TTP/1.1. */ + 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, /* .User-Ag */ + 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, /* ent: cur */ + 0x6c, 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, /* l/7.32.0 */ +#ifdef TEST_CHUNKED + 0x0d, 0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, + 0x6e, 0x6b, 0x65, 0x64, +#endif + 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, /* ..Host: */ + 0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, /* 192.168. */ + 0x30, 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, /* 0.123..A */ + 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, /* ccept: * */ + 0x2f, 0x2a, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* *..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, /* ent-Type */ + 0x3a, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* : multip */ + 0x61, 0x72, 0x74, 0x2f, 0x66, 0x6f, 0x72, 0x6d, /* art/form */ + 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, 0x62, /* -data; b */ + 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x3d, /* oundary= */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, /* t-Length */ + 0x3a, 0x20, 0x31, 0x35, 0x32, 0x31, 0x0d, 0x0a, /* : 1521.. */ + 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x3a, 0x20, /* Expect: */ + 0x31, 0x30, 0x30, 0x2d, 0x63, 0x6f, 0x6e, 0x74, /* 100-cont */ + 0x69, 0x6e, 0x75, 0x65, 0x0d, 0x0a, 0x0d, 0x0a, /* inue.... */ +#ifdef TEST_CHUNKED + 0x38, 0x30, 0x0d, 0x0a, +#endif + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, /* e"....te */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ +#ifdef TEST_CHUNKED + 0x0d, 0x0a, + 0x35, 0x37, 0x31, 0x0d, 0x0a, +#endif + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* st..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x32, 0x22, 0x0d, /* ample2". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* t2..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x33, 0x22, 0x0d, /* ample3". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x33, /* ...test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x0d, 0x0a, /* 3test3.. */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x34, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, /* e4"....t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x0d, 0x0a, 0x2d, 0x2d, /* est4..-- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, /* t-Dispos */ + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, /* ition: f */ + 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, /* orm-data */ + 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, /* ; name=" */ + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x35, /* example5 */ + 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, /* "....tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* 5..----- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, 0x66, /* -4ebf00f */ + 0x62, 0x63, 0x66, 0x30, 0x39, 0x2d, 0x2d, 0x0d, /* bcf09--. */ + 0x0a, /* . */ +#ifdef TEST_CHUNKED + 0x0d, 0x0a, + 0x30, 0x0d, 0x0a, 0x0d, 0x0a, +#endif +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multipart_fragment_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + multipart_flag = 0; + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write packet into the packet payload. */ + status = nx_packet_data_append(my_packet, pkt , sizeof(pkt), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the request. */ + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if((status) || (multipart_flag != 1)) + { + + if (status) + nx_packet_release(my_packet); + + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Multipart Fragment Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +ULONG offset, total_length; +ULONG length; +UCHAR buffer[1440]; +UINT count = 0; +UINT status; +NX_PACKET *response_pkt; + + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + while(nx_web_http_server_get_entity_header(server_ptr, &packet_ptr, buffer, sizeof(buffer)) == NX_SUCCESS) + { + + multipart_flag = 1; + + /* Send the result. */ + total_length = 0; + count++; + + while(nx_web_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, &length) == NX_SUCCESS) + { + /* Print content data. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer, length, &length); + buffer[length] = 0; + total_length += length; + } + + /* Check the data length. */ + if((count == 1) && (total_length != 196)) + error_counter++; + else if((count == 2) && (total_length != 175)) + error_counter++; + else if((count == 3) && (total_length != 195)) + error_counter++; + else if((count == 4) && (total_length != 205)) + error_counter++; + else if((count == 5) && (total_length != 220)) + error_counter++; + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, &response_pkt, NX_WEB_HTTP_STATUS_OK, 800, "text/html", "Server: NetXDuo HTTP 5.3\r\n"); + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt)) + nx_packet_release(response_pkt); + } + else + error_counter++; + } + else + { + return(NX_SUCCESS); + } + + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multipart_fragment_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Multipart Fragment Test...............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_multipart_underflow_test.c b/test/regression/web_test/netx_web_multipart_underflow_test.c new file mode 100644 index 00000000..565798cc --- /dev/null +++ b/test/regression/web_test/netx_web_multipart_underflow_test.c @@ -0,0 +1,832 @@ +/* This case tests whether HTTP server can work well with multipart/form-data. + * server packet size 800 + * client packet size 1400 + * pkt size is bigger than 1500 to cause client/server fragmentation. + */ + +/* Here is the packet content. */ +/* +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example" + +test(repeat 49 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example2" + +test2(repeat 35 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example3" + +test3(repeat 39 times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example4" + +test4(repeat 51times) +------------------------------4ebf00fbcf09 +Content-Disposition: form-data; name="example5" + +test5(repeat 54times) +------------------------------4ebf00fbcf09-- +*/ + +/* length1 = 196, + * length2 = 175, + * length3 = 195, + * length4 = 205 + * length5 = 220. + * */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if defined(NX_WEB_HTTP_MULTIPART_ENABLE) && !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ +static UINT multipart_flag; + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +//#define TEST_CHUNKED + +/* This is a HTTP get packet captured by wireshark. HEAD index.html*/ +static char pkt[] = { + 0x50, 0x4f, 0x53, 0x54, 0x20, 0x2f, 0x20, 0x48, /* POST / H */ + 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, /* TTP/1.1. */ + 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, /* .User-Ag */ + 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, /* ent: cur */ + 0x6c, 0x2f, 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, /* l/7.32.0 */ +#ifdef TEST_CHUNKED + 0x0d, 0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, + 0x6e, 0x6b, 0x65, 0x64, +#endif + 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, /* ..Host: */ + 0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, /* 192.168. */ + 0x30, 0x2e, 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, /* 0.123..A */ + 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, /* ccept: * */ + 0x2f, 0x2a, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* *..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, /* ent-Type */ + 0x3a, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* : multip */ + 0x61, 0x72, 0x74, 0x2f, 0x66, 0x6f, 0x72, 0x6d, /* art/form */ + 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, 0x62, /* -data; b */ + 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x79, 0x3d, /* oundary= */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, /* t-Length */ + 0x3a, 0x20, 0x31, 0x35, 0x32, 0x31, 0x0d, 0x0a, /* : 1521.. */ + 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x3a, 0x20, /* Expect: */ + 0x31, 0x30, 0x30, 0x2d, 0x63, 0x6f, 0x6e, 0x74, /* 100-cont */ + 0x69, 0x6e, 0x75, 0x65, 0x0d, 0x0a, 0x0d, 0x0a, /* inue.... */ +#ifdef TEST_CHUNKED + 0x38, 0x30, 0x0d, 0x0a, +#endif + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x0d, 0x0a, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, /* e"....te */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ +#ifdef TEST_CHUNKED + 0x0d, 0x0a, + 0x35, 0x37, 0x31, 0x0d, 0x0a, +#endif + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, 0x74, 0x65, /* sttestte */ + 0x73, 0x74, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* st..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x32, 0x22, 0x0d, /* ample2". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, /* t2test2t */ + 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, /* est2test */ + 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, /* 2test2te */ + 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, 0x74, 0x32, /* st2test2 */ + 0x74, 0x65, 0x73, 0x74, 0x32, 0x74, 0x65, 0x73, /* test2tes */ + 0x74, 0x32, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, /* t2..---- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, /* --4ebf00 */ + 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, 0x0d, 0x0a, /* fbcf09.. */ + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* Content- */ + 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, /* Disposit */ + 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, 0x6f, 0x72, /* ion: for */ + 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x20, /* m-data; */ + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x65, 0x78, /* name="ex */ + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x33, 0x22, 0x0d, /* ample3". */ + 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x33, /* ...test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, /* 3test3te */ + 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, /* st3test3 */ + 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, /* test3tes */ + 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x74, /* t3test3t */ + 0x65, 0x73, 0x74, 0x33, 0x74, 0x65, 0x73, 0x74, /* est3test */ + 0x33, 0x74, 0x65, 0x73, 0x74, 0x33, 0x0d, 0x0a, /* 3test3.. */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, /* ------4e */ + 0x62, 0x66, 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, /* bf00fbcf */ + 0x30, 0x39, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, /* 09..Cont */ + 0x65, 0x6e, 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, /* ent-Disp */ + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, /* osition: */ + 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, /* form-da */ + 0x74, 0x61, 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* ta; name */ + 0x3d, 0x22, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, /* ="exampl */ + 0x65, 0x34, 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, /* e4"....t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, /* est4test */ + 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, /* 4test4te */ + 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, /* st4test4 */ + 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, 0x65, 0x73, /* test4tes */ + 0x74, 0x34, 0x74, 0x65, 0x73, 0x74, 0x34, 0x74, /* t4test4t */ + 0x65, 0x73, 0x74, 0x34, 0x0d, 0x0a, 0x2d, 0x2d, /* est4..-- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x65, 0x62, 0x66, /* ----4ebf */ + 0x30, 0x30, 0x66, 0x62, 0x63, 0x66, 0x30, 0x39, /* 00fbcf09 */ + 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* ..Conten */ + 0x74, 0x2d, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, /* t-Dispos */ + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x66, /* ition: f */ + 0x6f, 0x72, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, /* orm-data */ + 0x3b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, /* ; name=" */ + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x35, /* example5 */ + 0x22, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x73, /* "....tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, /* 5test5te */ + 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, /* st5test5 */ + 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, /* test5tes */ + 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, 0x35, 0x74, /* t5test5t */ + 0x65, 0x73, 0x74, 0x35, 0x74, 0x65, 0x73, 0x74, /* est5test */ + 0x35, 0x0d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* 5..----- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, /* -------- */ + 0x2d, 0x34, 0x65, 0x62, 0x66, 0x30, 0x30, 0x66, /* -4ebf00f */ + 0x62, 0x63, 0x66, 0x30, 0x39, 0x2d, 0x2d, 0x0d, /* bcf09--. */ + 0x0a, /* . */ +#ifdef TEST_CHUNKED + 0x0d, 0x0a, + 0x30, 0x0d, 0x0a, 0x0d, 0x0a, +#endif +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multipart_underflow_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + multipart_flag = 0; + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write packet into the packet payload. */ + status = nx_packet_data_append(my_packet, pkt , sizeof(pkt), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the request. */ + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if((status) || (multipart_flag != 1)) + { + + if (status) + nx_packet_release(my_packet); + + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Multipart Fragment Test..............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +ULONG offset, total_length; +ULONG length; +UCHAR buffer[1440]; +UINT count = 0; +UINT status; +NX_PACKET *response_pkt; + + /* Set first 5 bytes to 0. */ + buffer[0] = 0xFF; + buffer[1] = 0xFF; + buffer[2] = 0xFF; + buffer[3] = 0xFF; + buffer[4] = 0xFF; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + while(nx_web_http_server_get_entity_header(server_ptr, &packet_ptr, buffer + 5, sizeof(buffer) - 5) == NX_SUCCESS) + { + if ((buffer[0] & buffer[1] & buffer[2] & buffer[3] & buffer[4]) != 0xFF) + { + + /* Detected underflow. */ + error_counter++; + } + + multipart_flag = 1; + + /* Send the result. */ + total_length = 0; + count++; + + while(nx_web_http_server_get_entity_content(server_ptr, &packet_ptr, &offset, &length) == NX_SUCCESS) + { + /* Print content data. */ + nx_packet_data_extract_offset(packet_ptr, offset, buffer + 5, length, &length); + buffer[length + 5] = 0; + total_length += length; + } + + /* Check the data length. */ + /* if((count == 1) && (total_length != 196)) + error_counter++; */ + if((count == 2) && (total_length != 175)) + error_counter++; + else if((count == 3) && (total_length != 195)) + error_counter++; + else if((count == 4) && (total_length != 205)) + error_counter++; + else if((count == 5) && (total_length != 220)) + error_counter++; + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, &response_pkt, NX_WEB_HTTP_STATUS_OK, 800, "text/html", "Server: NetXDuo HTTP 5.3\r\n"); + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt)) + nx_packet_release(response_pkt); + } + else + error_counter++; + } + else + { + return(NX_SUCCESS); + } + + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multipart_underflow_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Multipart Underflow Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_multiple_sessions_test.c b/test/regression/web_test/netx_web_multiple_sessions_test.c new file mode 100644 index 00000000..0af2532a --- /dev/null +++ b/test/regression/web_test/netx_web_multiple_sessions_test.c @@ -0,0 +1,549 @@ +/* This case tests multiple sessions. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL client_pool_1; +static NX_WEB_HTTP_CLIENT my_client; +static NX_WEB_HTTP_CLIENT my_client_1; +static NX_IP client_ip; +static NX_IP client_ip_1; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_CLIENT_ADDRESS_1 IP_ADDRESS(1,2,3,6) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0xb0, 0x09, 0xb8, 0x40, 0x00, 0x80, 0x06, /* ....@... */ + 0x6e, 0x5b, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* n[...i.. */ + 0x00, 0x7b, 0xc4, 0x77, 0x00, 0x50, 0x51, 0x6d, /* .{.w.PQm */ + 0xbc, 0x22, 0x77, 0x7f, 0x23, 0xc7, 0x50, 0x18, /* ."w.#.P. */ + 0xfa, 0xf0, 0x20, 0x9c, 0x00, 0x00, 0x47, 0x45, /* .. ...GE */ + 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, /* T /index */ + 0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, /* .htm HTT */ + 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, /* P/1.1..U */ + 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, /* ser-Agen */ + 0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, /* t: curl/ */ + 0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, /* 7.32.0.. */ + 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, /* Host: 19 */ + 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, /* 2.168.0. */ + 0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, /* 123..Acc */ + 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, /* ept: */ + 0x0d, 0x0a, 0x49, 0x66, 0x2d, 0x4d, 0x6f, 0x64, /* ..If-Mod */ + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x53, 0x69, /* ified-Si */ + 0x6e, 0x63, 0x65, 0x3a, 0x20, 0x54, 0x75, 0x65, /* nce: Tue */ + 0x2c, 0x20, 0x30, 0x31, 0x20, 0x4a, 0x61, 0x6e, /* , 01 Jan */ + 0x20, 0x32, 0x30, 0x31, 0x33, 0x20, 0x30, 0x30, /* 2013 00 */ + 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x20, 0x47, /* :00:00 G */ + 0x4d, 0x54, 0x0d, 0x0a, 0x0d, 0x0a /* MT.... */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multiple_sessions_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_1, "HTTP Client Packet Pool 1", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_1, "HTTP Client IP 1", HTTP_CLIENT_ADDRESS_1, + 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip_1, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_1); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *my_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + status = nx_web_http_client_create(&my_client_1, "HTTP Client 1", &client_ip_1, &client_pool_1, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + status = nx_web_http_client_connect(&my_client_1, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + status = nx_web_http_client_secure_connect(&my_client_1, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt) - 54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = _nx_web_http_client_send(&my_client, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client_1, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt) - 54), &client_pool_1, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = _nx_web_http_client_send(&my_client_1, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + status = nx_web_http_client_delete(&my_client_1); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Multiple Sessions Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multiple_sessions_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Multiple Sessions Test................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_multiple_sessions_timeout_test.c b/test/regression/web_test/netx_web_multiple_sessions_timeout_test.c new file mode 100644 index 00000000..afcca741 --- /dev/null +++ b/test/regression/web_test/netx_web_multiple_sessions_timeout_test.c @@ -0,0 +1,485 @@ +/* This case tests multiple sessions. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTPS_ENABLE) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_PACKET_POOL client_pool_1; +static NX_WEB_HTTP_CLIENT my_client; +static NX_WEB_HTTP_CLIENT my_client_1; +static NX_IP client_ip; +static NX_IP client_ip_1; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define HTTP_CLIENT_ADDRESS_1 IP_ADDRESS(1,2,3,6) + +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000]; +static CHAR crypto_metadata_client_1[20000]; +static UCHAR tls_packet_buffer[18500]; +static UCHAR tls_packet_buffer_1[18500]; +static NX_SECURE_X509_CERT certificate, trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static NX_TCP_SOCKET test_client_socket; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multiple_sessions_timeout_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool_1, "HTTP Client Packet Pool 1", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip_1, "HTTP Client IP 1", HTTP_CLIENT_ADDRESS_1, + 0xFFFFFF00UL, &client_pool_1, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip_1, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip_1); + if (status) + error_counter++; +} + +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} + +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback_1(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client_1, sizeof(crypto_metadata_client_1)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer_1, sizeof(tls_packet_buffer_1)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_tcp_socket_create(&client_ip, &test_client_socket, "test client socket", + NX_WEB_HTTP_TYPE_OF_SERVICE, NX_WEB_HTTP_FRAGMENT_OPTION, NX_WEB_HTTP_TIME_TO_LIVE, + 1536, NX_NULL, NX_NULL); + if (status) + error_counter++; + + status = nx_tcp_client_socket_bind(&test_client_socket, NX_ANY_PORT, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + status = nxd_tcp_client_socket_connect(&test_client_socket, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, NX_WAIT_FOREVER); + if (status) + { + error_counter++; + } + + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + status += nx_web_http_client_create(&my_client_1, "HTTP Client 1", &client_ip_1, &client_pool_1, 1536); + + /* Check status. */ + if (status) + error_counter++; + + status = nx_web_http_client_get_secure_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", sizeof("https://1.2.3.4/test.txt") - 1, + "1.2.3.4", 7, "name", 4, "password", 8, + tls_setup_callback, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_web_http_client_get_secure_start_extended(&my_client_1, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", sizeof("https://1.2.3.4/test.txt") - 1, + "1.2.3.4", 7, "name", 4, "password", 8, + tls_setup_callback_1, NX_WAIT_FOREVER); + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client_1, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + status = nx_web_http_client_delete(&my_client_1); + if (status) + error_counter++; + + /* Set the flag. */ + https_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTPS_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Multiple Sessions Timeout Test........................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_multiple_sessions_timeout_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Multiple Sessions Timeout Test........................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_non_block_basic_test.c b/test/regression/web_test/netx_web_non_block_basic_test.c new file mode 100644 index 00000000..f816ed88 --- /dev/null +++ b/test/regression/web_test/netx_web_non_block_basic_test.c @@ -0,0 +1,516 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_EXTENDED_NOTIFY_SUPPORT) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; +static TX_SEMAPHORE establish_semaphore; +static TX_SEMAPHORE data_semaphore; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x31, 0x32, /* gth: 12 */ +0x31, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 1..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +}; + +static char pkt1[] = { +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; + +static char pkt2[] = { +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_non_block_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the test control semaphore. */ + tx_semaphore_create(&establish_semaphore, "Web Establish", 0); + tx_semaphore_create(&data_semaphore, "Web Data", 0); +} + +static VOID http_response_callback(NX_WEB_HTTP_CLIENT *client_ptr, CHAR *field_name, UINT field_name_length, + CHAR *field_value, UINT field_value_length) +{ + if (memcmp(field_name, "Content-Type", field_name_length) == 0) + { + if (memcmp(field_value, "text/plain", field_value_length) != 0) + error_counter++; + } + else if(memcmp(field_name, "Content-Length", field_name_length) == 0) + { + if (memcmp(field_value, "121", field_value_length) != 0) + error_counter++; + } +#ifndef NX_WEB_HTTP_KEEPALIVE_DISABLE + else if(memcmp(field_name, "Connection", field_name_length) == 0) + { + if (memcmp(field_value, "keep-alive", field_value_length) != 0) + error_counter++; + } +#endif +} + +static VOID tcp_establish_notify(NX_TCP_SOCKET *socket_ptr) +{ + + tx_semaphore_put(&establish_semaphore); +} + +static VOID tcp_receive_callback(NX_TCP_SOCKET *socket_ptr) +{ + + tx_semaphore_put(&data_semaphore); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + nx_tcp_socket_establish_notify(&my_client.nx_web_http_client_socket, tcp_establish_notify); + nx_tcp_socket_receive_notify(&my_client.nx_web_http_client_socket, tcp_receive_callback); + + /* Set the header callback routine. */ + nx_web_http_client_response_header_callback_set(&my_client, http_response_callback); + + /* Connect to server. */ + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_IN_PROGRESS) + error_counter++; + + status = tx_semaphore_get(&establish_semaphore, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != TX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + + status = tx_semaphore_get(&data_semaphore, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != TX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + while (1) + { + + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, NX_NO_WAIT); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status == NX_WEB_HTTP_GET_DONE) + { + nx_packet_release(recv_packet); + break; + } + else if (status == NX_NO_PACKET) + { + continue; + } + else + { + error_counter++; + break; + } + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + http_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Non Block Basic Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt, sizeof(pkt), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt1, sizeof(pkt1), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt2, sizeof(pkt2), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_non_block_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Non Block Basic Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_non_block_reconnect_test.c b/test/regression/web_test/netx_web_non_block_reconnect_test.c new file mode 100644 index 00000000..92511083 --- /dev/null +++ b/test/regression/web_test/netx_web_non_block_reconnect_test.c @@ -0,0 +1,537 @@ +/* This case tests reconnection in non-blocking mode. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_ENABLE_EXTENDED_NOTIFY_SUPPORT) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; +static TX_SEMAPHORE establish_semaphore; +static TX_SEMAPHORE data_semaphore; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x31, 0x32, /* gth: 12 */ +0x31, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 1..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +}; + +static char pkt1[] = { +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; + +static char pkt2[] = { +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_non_block_reconnect_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_DONT_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; + + /* Create the test control semaphore. */ + tx_semaphore_create(&establish_semaphore, "Web Establish", 0); + tx_semaphore_create(&data_semaphore, "Web Data", 0); +} + +static VOID http_response_callback(NX_WEB_HTTP_CLIENT *client_ptr, CHAR *field_name, UINT field_name_length, + CHAR *field_value, UINT field_value_length) +{ + if (memcmp(field_name, "Content-Type", field_name_length) == 0) + { + if (memcmp(field_value, "text/plain", field_value_length) != 0) + error_counter++; + } + else if(memcmp(field_name, "Content-Length", field_name_length) == 0) + { + if (memcmp(field_value, "121", field_value_length) != 0) + error_counter++; + } +#ifndef NX_WEB_HTTP_KEEPALIVE_DISABLE + else if(memcmp(field_name, "Connection", field_name_length) == 0) + { + if (memcmp(field_value, "keep-alive", field_value_length) != 0) + error_counter++; + } +#endif +} + +static VOID tcp_establish_notify(NX_TCP_SOCKET *socket_ptr) +{ + + tx_semaphore_put(&establish_semaphore); +} + +static VOID tcp_receive_callback(NX_TCP_SOCKET *socket_ptr) +{ + + tx_semaphore_put(&data_semaphore); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + nx_tcp_socket_establish_notify(&my_client.nx_web_http_client_socket, tcp_establish_notify); + nx_tcp_socket_receive_notify(&my_client.nx_web_http_client_socket, tcp_receive_callback); + + /* Set the header callback routine. */ + nx_web_http_client_response_header_callback_set(&my_client, http_response_callback); + + /* Connect to server. */ + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_IN_PROGRESS) + error_counter++; + + status = tx_semaphore_get(&establish_semaphore, NX_IP_PERIODIC_RATE); + + /* Server isn't stared, should be failed. */ + if (status == TX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + tx_thread_resume(&server_thread); + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Reconnect to server. */ + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_NO_WAIT); + + /* Check status. */ + if (status != NX_IN_PROGRESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = tx_semaphore_get(&establish_semaphore, NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != TX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_NO_WAIT); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + + status = tx_semaphore_get(&data_semaphore, 2 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status != TX_SUCCESS) + { + printf("ERROR!\n"); + test_control_return(1); + } + + while (1) + { + + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, NX_NO_WAIT); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status == NX_WEB_HTTP_GET_DONE) + { + nx_packet_release(recv_packet); + break; + } + else if (status == NX_NO_PACKET) + { + continue; + } + else + { + error_counter++; + break; + } + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + http_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Non Block Reconnect Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt, sizeof(pkt), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt1, sizeof(pkt1), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt2, sizeof(pkt2), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_non_block_reconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Non Block Reconenct Test..............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_one_session_test.c b/test/regression/web_test/netx_web_one_session_test.c new file mode 100644 index 00000000..94913e93 --- /dev/null +++ b/test/regression/web_test/netx_web_one_session_test.c @@ -0,0 +1,360 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static UINT loop = 1; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_one_session_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + + /* Wait HTTP server started. */ + while (!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + status = nx_web_http_client_request_header_add(&my_client, "Connection", 10, "close", 5, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + tx_thread_sleep(11 * NX_IP_PERIODIC_RATE); + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Send a GET request. */ + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + http_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web One Session Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + my_server.nx_web_http_server_tcpserver.nx_tcpserver_sessions_count = 1; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + http_server_start = 1; + + /* Wait HTTP test finished. */ + while (!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_one_session_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web One Session Test......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_packet_allocate_test.c b/test/regression/web_test/netx_web_packet_allocate_test.c new file mode 100644 index 00000000..ebc7de4e --- /dev/null +++ b/test/regression/web_test/netx_web_packet_allocate_test.c @@ -0,0 +1,580 @@ +/* This case tests if the allocated packet is 4-byte alignment. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#ifdef NX_WEB_HTTPS_ENABLE +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len +#endif /* NX_WEB_HTTPS_ENABLE */ + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session); +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); +static UINT driver_packet_check(NX_IP *ip_ptr, NX_PACKET *packet_ptr); +extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_packet_allocate_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_GET, "/test.txt", "1.2.3.4", + 0, NX_FALSE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while(1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Packet Allocate Test.................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + packet_process_callback = driver_packet_check; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; +CHAR *content_buffer = "NETX packet allocate test"; +UINT content_length = strlen(content_buffer); + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, content_length * 2, "text/html", + "Server: NetX HTTPS Experimental\r\n"); + if (status) + { + return (status); + } + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, NX_WAIT_FOREVER); + if (status) + { + return (status); + } + + nx_packet_data_append(response_pkt, content_buffer, content_length, server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + + status = nx_web_http_server_callback_data_send(server_ptr, content_buffer, content_length); + if (status) + { + return(status); + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +/* Define the packet check function. */ +static UINT driver_packet_check(NX_IP *ip_ptr, NX_PACKET *packet_ptr) +{ + + /* Check if the packet is four-byte alignment. */ + if ((UINT)(packet_ptr -> nx_packet_prepend_ptr) & 0x3) + { + error_counter++; + } + + return (1); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_packet_allocate_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Packet Allocate Test..................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_post_basic_test.c b/test/regression/web_test/netx_web_post_basic_test.c new file mode 100644 index 00000000..7163597b --- /dev/null +++ b/test/regression/web_test/netx_web_post_basic_test.c @@ -0,0 +1,484 @@ +/* This case tests basic POST method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 4; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 2; +#endif /* NX_WEB_HTTPS_ENABLE */ + +/* POST AAAAAAAAAA*/ +static char pkt[] = { + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 /* AAAAAAAAAA */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_post_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i < 2) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send POST request. */ + if (i == 0) + { + status = nx_web_http_client_post_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT,"/test.txt", + "www.abc.com", "name", "password", sizeof(pkt), NX_WAIT_FOREVER); + } + else if (i == 1) + { + status = nx_web_http_client_post_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/test.txt", 9, + "www.abc.com", 11, "name", 4, "password", 8, sizeof(pkt), NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 2) + { + status = nx_web_http_client_post_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/test.txt", + "www.abc.com", "name", "password", sizeof(pkt), tls_setup_callback, NX_WAIT_FOREVER); + } + else + { + status = nx_web_http_client_post_secure_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/test.txt", 9, + "www.abc.com", 11, "name", 4, "password", 8, sizeof(pkt), tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Write test data into the packet payload. */ + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + + /* Send the POST request. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 1) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 3) + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Post Basic Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop/2; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_post_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Post Basic Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_post_long_message_test.c b/test/regression/web_test/netx_web_post_long_message_test.c new file mode 100644 index 00000000..05d27f12 --- /dev/null +++ b/test/regression/web_test/netx_web_post_long_message_test.c @@ -0,0 +1,401 @@ +/* This case tests basic POST method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#define MESSAGE_LENGTH (4 * 1024) +/* POST AAAAAAAAAA*/ +static char pkt[] = { + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', + 'Y', 'Z', '0', '1', '2', '3', '4', '5', +}; + +static UCHAR server_pool_area[SERVER_PACKET_SIZE * 16]; +static UCHAR client_pool_area[SERVER_PACKET_SIZE * 16]; + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_post_large_packet_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + server_pool_area, sizeof(server_pool_area)); + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + client_pool_area, sizeof(client_pool_area)); + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Post long message */ + status = nx_web_http_client_post_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT,"/test.txt", + "www.abc.com", "name", "password", MESSAGE_LENGTH, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + for (i = 0; i < MESSAGE_LENGTH / sizeof(pkt); i++) + { + /* Write test data into the packet payload. */ + status = nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + } + + /* Send the POST request. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + error_counter++; + nx_packet_release(send_packet); + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + http_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Post Long Message Test................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +ULONG offset, total_length; +ULONG length = 0; +UCHAR buffer[sizeof(pkt)]; +UINT i = 0, actual_size; +UINT status; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + nx_web_http_server_content_length_get(packet_ptr, &length); + if (length != MESSAGE_LENGTH) + { + error_counter++; + } + + total_length = 0; + + while (total_length < MESSAGE_LENGTH) + { + offset = 0; + while (offset != sizeof(pkt)) + { + status = nx_web_http_server_content_get_extended(server_ptr, packet_ptr, total_length + offset, &buffer[offset], sizeof(pkt) - offset, &actual_size); + offset += actual_size; + } + + total_length += offset; + + if (actual_size == 0) + { + break; + } + } + + if (total_length != MESSAGE_LENGTH) + error_counter++; + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_response_send_extended(server_ptr, NX_WEB_HTTP_STATUS_OK, sizeof(NX_WEB_HTTP_STATUS_OK) - 1, + "hello", 5, NX_NULL, 0); + if(status) + { + error_counter++; + } + } + else + { + return(NX_SUCCESS); + } + + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_post_large_packet_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Post Long Message Test................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_put_basic_test.c b/test/regression/web_test/netx_web_put_basic_test.c new file mode 100644 index 00000000..3e7d71d8 --- /dev/null +++ b/test/regression/web_test/netx_web_put_basic_test.c @@ -0,0 +1,513 @@ +/* This case tests basic PUT method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 4; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 2; +#endif /* NX_WEB_HTTPS_ENABLE */ + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_put_basic_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i < 2) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send PUT request. */ + if (i == 0) + { + + status = nx_web_http_client_put_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT,"http://1.2.3.4/http_put_test.html", + "www.abc.com", "name", "password", 103, NX_WAIT_FOREVER); + } + else if (i == 1) + { + + status = nx_web_http_client_put_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/http_put_test2.html", 34, + "www.abc.com", 11, "name", 4, "password", 8, 103, NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 2) + { + + status = nx_web_http_client_put_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/https_put_test.html", + "www.abc.com", "name", "password", 103, tls_setup_callback, NX_WAIT_FOREVER); + } + else + { + + status = nx_web_http_client_put_secure_start_extended(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "https://1.2.3.4/https_put_test2.html", 36, + "www.abc.com", 11, "name", 4, "password", 8, 103, tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + { + error_counter++; + break; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + /* Build a simple 103-byte HTML page. */ + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, + "NetX HTTP Test\r\n", 44, + &client_pool, NX_WAIT_FOREVER); + + /* Send the PUT request. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + error_counter++; + + nx_packet_data_append(send_packet, "\r\n", 8, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + nx_packet_data_append(send_packet, "\r\n", 9, + &client_pool, NX_WAIT_FOREVER); + + /* Send the PUT request. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 1) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else if (i == 3) + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Put Basic Test........................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop/2; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_put_basic_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Put Basic Test........................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_request_in_multiple_packets_test.c b/test/regression/web_test/netx_web_request_in_multiple_packets_test.c new file mode 100644 index 00000000..3371ebb9 --- /dev/null +++ b/test/regression/web_test/netx_web_request_in_multiple_packets_test.c @@ -0,0 +1,527 @@ +/* This case tests the ability of the HTTP server to process HTTP request string in multiple packets. + * Packet1. GET /index.htm HTTP/1.0 + * Packet2. CR + * Packet3. LF + * Packet4. CR + * Packet5. LF + */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_request_in_multiple_packets_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Build simple request. */ + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_data_append(my_packet, "GET /index.htm HTTP/1.0" , 23, &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_data_append(my_packet, "\r" , 1, &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_data_append(my_packet, "\n" , 1, &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_data_append(my_packet, "\r" , 1, &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_data_append(my_packet, "\n" , 1, &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = _nx_web_http_client_send(&my_client, my_packet, NX_WAIT_FOREVER); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 200. */ + if((buffer_ptr[9] != '2') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Request in Multiple Packets Test......................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_request_in_multiple_packets_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Request in Multiple Packets Test......................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_response_in_multiple_packets_test.c b/test/regression/web_test/netx_web_response_in_multiple_packets_test.c new file mode 100644 index 00000000..821ac6f5 --- /dev/null +++ b/test/regression/web_test/netx_web_response_in_multiple_packets_test.c @@ -0,0 +1,565 @@ +/* This case tests response in multiple packets. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x48, 0x54, /* ......HT */ +0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, /* TP/1.0 2 */ +0x30, 0x30, 0x20, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, /* 00 ..Con */ +}; + +static char pkt1[] = { +0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, /* tent-Len */ +0x67, 0x74, 0x68, 0x3a, 0x20, 0x20, 0x31, 0x32, /* gth: 12 */ +0x31, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* 1..Conte */ +0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, /* nt-Type: */ +0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* text/pl */ +0x61, 0x69, 0x6e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, /* ain....< */ +0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, /* html>... */ +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; + +static char pkt2[] = { +0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, /* .. */ +0x0a, 0x0d, 0x0a, 0x3c, 0x74, 0x69, 0x74, 0x6c, /* ...Main W */ +0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3c, 0x2f, 0x74, /* indow..< */ +0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, /* /head>.. */ +0x0d, 0x0a, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, /* .. */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_response_in_multiple_packets_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + if (i == 0) + { + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Response in Multiple Packets Test....................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; + + /* Process multipart data. */ + if(request_type == NX_WEB_HTTP_SERVER_GET_REQUEST) + { + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt, sizeof(pkt), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt1, sizeof(pkt1), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + + /* Allocate a response packet. */ + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, TX_WAIT_FOREVER); + + /* Check status. */ + if (status) + { + error_counter++; + } + + status = nx_packet_data_append(response_pkt, pkt2, sizeof(pkt2), &server_pool, NX_WAIT_FOREVER); + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_response_in_multiple_packets_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Response in Multiple Packets Test.....................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_secure_connect_fail_test.c b/test/regression/web_test/netx_web_secure_connect_fail_test.c new file mode 100644 index 00000000..e738be45 --- /dev/null +++ b/test/regression/web_test/netx_web_secure_connect_fail_test.c @@ -0,0 +1,381 @@ +/* This case tests client connect three times to server to see + if server actually clear the seesion materials. +*/ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTPS_ENABLE) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_secure_connect_fail_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} + +static UINT tls_setup_callback_fail(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ + return(1); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Wait HTTPS server started. */ + while (!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Secure connect fail. */ + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback_fail, NX_IP_PERIODIC_RATE); + if (!status) + error_counter++; + + /* Send a GET request. */ + status = nx_web_http_client_get_secure_start(&my_client, &server_ip_address, + NX_WEB_HTTPS_SERVER_PORT, "/index.htm", + "www.abc.com", "name", "password", + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + https_client_stop = 1; +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTPS_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Secure Connect Fail Test.............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while (!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_secure_connect_fail_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Secure Connect Fail Test..............................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_secure_reconnect_test.c b/test/regression/web_test/netx_web_secure_reconnect_test.c new file mode 100644 index 00000000..924bc075 --- /dev/null +++ b/test/regression/web_test/netx_web_secure_reconnect_test.c @@ -0,0 +1,374 @@ +/* This case tests reconnection when TLS connection fail. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTPS_ENABLE) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static UINT tls_setup_callback(NX_SECURE_TLS_SESSION *tls_session); + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_secure_reconnect_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + ca_cert_der[0] = ca_cert_der[0] + 1; /* Modify the cert data to make TLS connection fail. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_TCP_SOCKET client_socket; +NX_SECURE_TLS_SESSION client_tls_session; + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_tcp_socket_create(&client_ip, &client_socket, "client socket", + NX_WEB_HTTP_TYPE_OF_SERVICE, NX_WEB_HTTP_FRAGMENT_OPTION, NX_WEB_HTTP_TIME_TO_LIVE, + 1536, NX_NULL, NX_NULL); + if (status) + error_counter++; + + status = nx_tcp_client_socket_bind(&client_socket, NX_ANY_PORT, NX_WAIT_FOREVER); + if (status) + error_counter++; + + for (i = 0; i < loop; i++) + { + status = nxd_tcp_client_socket_connect(&client_socket, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + error_counter++; + + tls_setup_callback(&client_tls_session); + + status = nx_secure_tls_session_start(&client_tls_session, &client_socket, NX_IP_PERIODIC_RATE); + + if (status) + { + + nx_secure_tls_session_end(&client_tls_session, NX_NO_WAIT); + nx_secure_tls_session_delete(&client_tls_session); + + nx_tcp_socket_disconnect(&client_socket, NX_NO_WAIT); + } + else + { + error_counter++; + } + } + + nx_tcp_client_socket_unbind(&client_socket); + nx_tcp_socket_delete(&client_socket); + + /* Set the flag. */ + https_client_stop = 1; +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Secure Reconnect Test................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + server_port = NX_WEB_HTTPS_SERVER_PORT; + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while (!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + /* Check if there is packet leak. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_secure_reconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Secure Reconnect Test.................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_server_chunked_content_process_test.c b/test/regression/web_test/netx_web_server_chunked_content_process_test.c new file mode 100644 index 00000000..510c9af9 --- /dev/null +++ b/test/regression/web_test/netx_web_server_chunked_content_process_test.c @@ -0,0 +1,657 @@ +/* This case tests server getting chunked content. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static char pkt[] = { +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +0x74, 0x65, 0x73, 0x74, 0x74, 0x65, 0x73, 0x74, /* testtest */ +}; + +static UINT test_chunk[] = {20, 120, 19, 34}; +static UINT test_num = sizeof(test_chunk)/sizeof(UINT); + +#define HEADER_CONTAIN_CONTENT 1 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_server_chunked_content_process_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, j; +UINT status; +NX_PACKET *send_packet, *recv_packet; +UINT chunk_size = 0; +CHAR *put_test; +UINT more_data; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Check status. */ + if (status) + error_counter++; + + /* Test chunked PUT request. */ + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + put_test = "http_put_test.html"; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + put_test = "https_put_test.html"; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Check status. */ + if (status) + error_counter++; + + /* Initialize the request. */ + status = nx_web_http_client_request_initialize(&my_client, NX_WEB_HTTP_METHOD_PUT, put_test, "www.abc.com", + 0, NX_TRUE, "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + +#if HEADER_CONTAIN_CONTENT + + /* For test, append chunked data to the header packet. */ + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, "\r\n19\r\n", 6, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + nx_packet_data_append(my_client.nx_web_http_client_request_packet_ptr, pkt, 25, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); +#endif + + /* Send the request. */ + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + for (j = 0; j < test_num; j++) + { + + if (j != (test_num - 1)) + { + more_data = NX_TRUE; + } + else + { + more_data = NX_FALSE; + } + + chunk_size = test_chunk[j]; + + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + if (status) + error_counter++; + + status = nx_web_http_client_request_chunked_set(&my_client, chunk_size, send_packet); + if (status) + error_counter++; + + nx_packet_data_append(send_packet, pkt, chunk_size, my_client.nx_web_http_client_packet_pool_ptr, NX_WAIT_FOREVER); + + status = nx_web_http_client_request_packet_send(&my_client, send_packet, more_data, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + if (status) + { + break; + } + else + { + nx_packet_release(recv_packet); + } + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + nx_packet_release(recv_packet); + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Server Chunked Content Process Test..................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +NX_PACKET *response_pkt; +UINT status; +UINT i = 0; +UINT content_length = 0; +UINT total_length = 0; +UCHAR buffer[4000]; +UINT length; + + /* Process content. */ + if(request_type == NX_WEB_HTTP_SERVER_PUT_REQUEST) + { + + for (i = 0; i < test_num; i++) + { + total_length += test_chunk[i]; + } + +#if HEADER_CONTAIN_CONTENT + total_length += 0x19; +#endif + + while (1) + { + + status = nx_web_http_server_content_get(server_ptr, packet_ptr, content_length, buffer, sizeof(buffer), &length); + + if (status) + { + break; + } + else + { + content_length += length; + } + + status = nx_web_http_server_content_get_extended(server_ptr, packet_ptr, content_length, buffer, sizeof(buffer), &length); + + if (status) + { + break; + } + else + { + content_length += length; + } + } + + if (content_length != total_length) + { + error_counter++; + } + + status = nx_web_http_server_packet_content_find(server_ptr, &packet_ptr, (ULONG *)&length); + + /* Release the received content packet. */ + nx_packet_release(packet_ptr); + + if (length != content_length) + { + error_counter++; + } + + /* Generate HTTP header. */ + status = nx_web_http_server_callback_generate_response_header(server_ptr, + &response_pkt, NX_WEB_HTTP_STATUS_OK, 0, "text/html", + NX_NULL); + if (status) + { + return(status); + } + + status = nx_web_http_server_callback_packet_send(server_ptr, response_pkt); + if (status) + { + nx_packet_release(response_pkt); + return(status); + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_server_chunked_content_process_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Server Chunked Content Process Test...................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_server_content_process_test.c b/test/regression/web_test/netx_web_server_content_process_test.c new file mode 100644 index 00000000..7fe55f29 --- /dev/null +++ b/test/regression/web_test/netx_web_server_content_process_test.c @@ -0,0 +1,659 @@ +/* This case tests server getting content. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_PACKET_CHAIN) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm); +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr); + +static UINT test_count; + +/* POST AAAAAAAAAA*/ +static char pkt[] = { + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 /* AAAAAAAAAA */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_server_content_process_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*16); + pointer = pointer + SERVER_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*16); + pointer = pointer + CLIENT_PACKET_SIZE * 16; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *send_packet; +NX_PACKET *recv_packet; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + for (test_count = 0; test_count < 2; test_count++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send POST request. */ + if (i == 0) + { + status = nx_web_http_client_post_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "/test.txt?ad", + "www.abc.com", "name", "password", sizeof(pkt), NX_WAIT_FOREVER); + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + if (status) + { + printf("Error in nx_web_http_client_secure_connect: 0x%x\n", status); + error_counter++; + } + + status = nx_web_http_client_request_initialize(&my_client, + NX_WEB_HTTP_METHOD_POST, /* GET, PUT, DELETE, POST, HEAD */ + "/test.txt;12", + "www.abc.com", + sizeof(pkt), /* Used by PUT and POST */ + NX_FALSE, /* If true, input_size is ignored. */ + "name", + "password", + NX_WAIT_FOREVER); + if (status) + { + printf("Error in nx_web_http_client_request_initialize: 0x%x\n", status); + error_counter++; + } + + status = nx_web_http_client_request_send(&my_client, NX_WAIT_FOREVER); + if (status) + { + printf("Error in nx_web_http_client_request_send: 0x%x\n", status); + error_counter++; + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &send_packet, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Write test data into the packet payload. */ + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &client_pool, NX_WAIT_FOREVER); + + /* Send the POST data. */ + status = nx_web_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); + if (status) + { + nx_packet_release(send_packet); + error_counter++; + } + + /* Get response from server. */ + while (1) + { + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, NX_WAIT_FOREVER); + + if (status) + break; + else + nx_packet_release(recv_packet); + } + + /* Check status. */ + if (status != NX_WEB_HTTP_GET_DONE) + error_counter++; + else + { + if (memcmp(recv_packet -> nx_packet_prepend_ptr, pkt, sizeof(pkt)) != 0) + { + error_counter++; + } + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + } + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Server Content Process Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + authentication_check, server_request_callback); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the application's authentication check. This is called by + the HTTP server whenever a new request is received. */ +static UINT authentication_check(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, + CHAR *resource, CHAR **name, CHAR **password, CHAR **realm) +{ + + /* Just use a simple name, password, and realm for all + requests and resources. */ + *name = "name"; + *password = "password"; + *realm = "NetX Duo HTTP demo"; + + /* Request basic authentication. */ + return(NX_WEB_HTTP_BASIC_AUTHENTICATE); +} + +/* Define the server request callback function. */ +static UINT server_request_callback(NX_WEB_HTTP_SERVER *server_ptr, UINT request_type, CHAR *resource, NX_PACKET *packet_ptr) +{ +UINT length; +NX_PACKET *response_pkt; +UCHAR buffer[4000]; +CHAR param[10]; +UINT param_size; +ULONG content_length; +UINT status; + + + memset(buffer, 0, sizeof(buffer)); + length = 0; + + /* Process content. */ + if (request_type == NX_WEB_HTTP_SERVER_POST_REQUEST) + { + + /* Get the content data location. */ + if (test_count == 0) + { + status = nx_web_http_server_content_get(server_ptr, packet_ptr, 0, buffer, sizeof(buffer), &length); + } + else + { + status = nx_web_http_server_content_get_extended(server_ptr, packet_ptr, 0, buffer, sizeof(buffer), &length); + } + + if (status) + { + return(status); + } + + /* FIXME: HACK! The parameter and query parsing won't parse past the other symbol (e.g. ';' or '?') + so check queries with HTTP and params with HTTPS. */ + +#ifdef NX_WEB_HTTPS_ENABLE + if(!server_ptr->nx_web_http_is_https_server) + { +#endif + /* Look for queries and parameters. */ + status = nx_web_http_server_query_get(packet_ptr, 0, param, ¶m_size, sizeof(param)); + + if(status != NX_SUCCESS || strncmp(param, "ad", 2) != 0) + { + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + } + else + { + /* HTTPS, check params. */ + status = nx_web_http_server_param_get(packet_ptr, 0, param, ¶m_size, sizeof(param)); + + if(status != NX_SUCCESS || strncmp(param, "12", 2) != 0) + { + error_counter++; + } + } +#endif + + status = nx_web_http_server_packet_content_find(server_ptr, &packet_ptr, &content_length); + + /* Release the received content packet. */ + nx_packet_release(packet_ptr); + + if(status != NX_SUCCESS || content_length != sizeof(pkt)) + { + error_counter++; + } + + if (length != sizeof(pkt)) + { + error_counter++; + } + + if (memcmp(buffer, pkt, length) != 0) + { + error_counter++; + } + + /* make sure we don't overwrite our buffer! */ + if(length > sizeof(buffer)) + { + length = sizeof(buffer); + } + + /* Send HTTP header. */ + status = nx_web_http_server_callback_response_send(server_ptr, NX_WEB_HTTP_STATUS_OK, buffer, NX_NULL); + + if(status) + { + return(status); + } + + status = nx_web_http_server_response_packet_allocate(server_ptr, &response_pkt, NX_IP_PERIODIC_RATE); + + if(status) + { + return(status); + } + + if(length > 0) + { + /* Only send what is in the buffer. */ + status = nx_packet_data_append(response_pkt, buffer, length, server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER); + } + + if(status == NX_SUCCESS) + { + if(nx_web_http_server_callback_packet_send(server_ptr, response_pkt) != NX_SUCCESS) + { + nx_packet_release(response_pkt); + } + } + } + else + { + /* Indicate we have not processed the response to client yet. */ + return(NX_SUCCESS); + } + + /* Indicate the response to client is transmitted. */ + return(NX_WEB_HTTP_CALLBACK_COMPLETED); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_server_content_process_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Server Content Process Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_server_type_get_extended_test.c b/test/regression/web_test/netx_web_server_type_get_extended_test.c new file mode 100644 index 00000000..19bbdd17 --- /dev/null +++ b/test/regression/web_test/netx_web_server_type_get_extended_test.c @@ -0,0 +1,208 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; + +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_server_type_get_extended_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; +UCHAR type[20]; +UINT type_length; + + + /* Print out test information banner. */ + printf("NetX Test: Web Server Type Retrieve Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "TEST.TXT"); + status += fx_file_open(&ram_disk, &my_file, "TEST.TXT", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + + + /* Type is "text/html", should return 9. */ + status = nx_web_http_server_type_get_extended(&my_server, "test.htm", 8, type, sizeof(type), &type_length); + if (status || type_length != 9) + error_counter++; + + /* The max size of destination string is not enough, should return error. */ + status = nx_web_http_server_type_get_extended(&my_server, "test.htm", 8, type, 9, &type_length); + if (status != NX_WEB_HTTP_ERROR) + error_counter++; + + /* Type is default "text/plain", should return 10. */ + status = nx_web_http_server_type_get_extended(&my_server, "test.xml", 8, type, sizeof(type), &type_length); + if (status != NX_WEB_HTTP_EXTENSION_MIME_DEFAULT || type_length != 10) + error_counter++; + + /* The max size of destination string is not enough, should return error. */ + status = nx_web_http_server_type_get_extended(&my_server, "test.xml", 8, type, 5, &type_length); + if (status != NX_WEB_HTTP_ERROR) + error_counter++; + + /* Type is default "text/plain", should return 10. */ + status = nx_web_http_server_type_get_extended(&my_server, "test", 4, type, sizeof(type), &type_length); + if (status != NX_WEB_HTTP_EXTENSION_MIME_DEFAULT || type_length != 10) + error_counter++; + + /* The max size of destination string is not enough, should return error. */ + status = nx_web_http_server_type_get_extended(&my_server, "test", 4, type, 5, &type_length); + if (status != NX_WEB_HTTP_ERROR) + error_counter++; + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_server_type_get_extended_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Server Type Retrieve Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_status_400_test.c b/test/regression/web_test/netx_web_status_400_test.c new file mode 100644 index 00000000..43db126f --- /dev/null +++ b/test/regression/web_test/netx_web_status_400_test.c @@ -0,0 +1,499 @@ +/* This case tests status 400. + * 1. If Request-URIis an absoluteURI, the host is part of the Request-URI. Any Host header + * field value in the request MUST be ignored. + * 2. If the Request-URIis not an absoluteURI, and the request includes a Hostheader field, + * the host is determined by the Hostheader field value. + * 3. If the host as determined by rule 1 or 2 is not a valid host on the server, the response + * MUST be a 400 (Bad Request) error message. + * + * Change Host field value from 192.168.0.123 to 192.168.0.120 . + * */ +/* FIXME XWH: Not support. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +/* This is a HTTP get packet captured by wireshark. + * curl 192.168.0.123 + * 123: pkt[120] = 0x31, pkt[121] = 0x32, pkt[122] = 0x33 + * 122: pkt[120] = 0x31, pkt[121] = 0x32, pkt[122] = 0x32 + * */ +static char pkt[] = { +0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ +0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ +0x00, 0x7e, 0x0b, 0xd2, 0x40, 0x00, 0x80, 0x06, /* .~..@... */ +0x6c, 0x73, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* ls...i.. */ +0x00, 0x7b, 0xca, 0x95, 0x00, 0x50, 0x66, 0x2b, /* .{...Pf+ */ +0xe7, 0x60, 0xb6, 0xa2, 0xe6, 0xf3, 0x50, 0x18, /* .`....P. */ +0xfa, 0xf0, 0x59, 0x33, 0x00, 0x00, 0x47, 0x45, /* ..Y3..GE */ +0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, /* T /index */ +0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, /* .htm HTT */ +0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, /* P/1.1..U */ +0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, /* ser-Agen */ +0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, /* t: curl/ */ +0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, /* 7.32.0.. */ +0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, /* Host: 19 */ +0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, /* 2.168.0. */ +0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, /* 123..Acc */ +0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, /* ept: */ +0x0d, 0x0a, 0x0d, 0x0a /* .... */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_400_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < 2 ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Change '3' to '2'. */ + pkt[122] = '2'; + + /* Write Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt) - 54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = _nx_web_http_client_send(&my_client, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 400. */ + if((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Status 400 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_400_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Status 400 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_status_404_test.c b/test/regression/web_test/netx_web_status_404_test.c new file mode 100644 index 00000000..ce519910 --- /dev/null +++ b/test/regression/web_test/netx_web_status_404_test.c @@ -0,0 +1,498 @@ +/* This case tests status 404. + * If Tthe server has not found anything matching the Request-URI. + * 404 should be sent. + * */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +/* This is a HTTP get packet captured by wireshark. + * curl 192.168.0.123/aaa.index + * */ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0x7c, 0x3a, 0xff, 0x40, 0x00, 0x80, 0x06, /* .|:.@... */ + 0x3d, 0x48, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* =H...i.. */ + 0x00, 0x7b, 0xcb, 0xef, 0x00, 0x50, 0x4d, 0x7b, /* .{...PM{ */ + 0x22, 0xf0, 0xcf, 0xed, 0x46, 0xa4, 0x50, 0x18, /* "...F.P. */ + 0xfa, 0xf0, 0x2e, 0x84, 0x00, 0x00, 0x47, 0x45, /* ......GE */ + 0x54, 0x20, 0x2f, 0x61, 0x61, 0x61, 0x2e, 0x68, /* T /aaa.h */ + 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, /* tm HTTP/ */ + 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x73, 0x65, /* 1.1..Use */ + 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, /* r-Agent: */ + 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, 0x37, 0x2e, /* curl/7. */ + 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x48, 0x6f, /* 32.0..Ho */ + 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32, 0x2e, /* st: 192. */ + 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31, 0x32, /* 168.0.12 */ + 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, /* 3..Accep */ + 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, /* t: */ + 0x0d, 0x0a /* .. */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_404_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Write Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt) - 54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = _nx_web_http_client_send(&my_client, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 304. */ + if((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '4')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Status 404 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_404_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Status 404 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_status_501_test.c b/test/regression/web_test/netx_web_status_501_test.c new file mode 100644 index 00000000..c670888a --- /dev/null +++ b/test/regression/web_test/netx_web_status_501_test.c @@ -0,0 +1,494 @@ +/* This case tests status 501. + * If the method is unrecognized or not implemented by the origin server, + * should repond 501. + * + * Change GET to AET to build a unrecognized method packet. + * */ +/* FIXME XWH: Not support. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#include "test_device_cert.c" +#include "test_ca_cert.c" +#define ca_cert_der test_ca_cert_der +#define ca_cert_der_len test_ca_cert_der_len + +#define DEMO_STACK_SIZE 4096 + +/* Set up FileX and file memory resources. */ +static CHAR ram_disk_memory[4096]; +static FX_MEDIA ram_disk; +static UCHAR media_memory[4096]; + +static UCHAR server_stack[16000]; + +/* Define device drivers. */ +extern void _fx_ram_driver(FX_MEDIA *media_ptr); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_WEB_HTTP_SERVER my_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; +static UINT http_server_start = 0; +static UINT http_client_stop = 0; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(192,168,0,105) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(192,168,0,123) + +#ifdef NX_WEB_HTTPS_ENABLE +static UINT https_server_start = 0; +static UINT https_client_stop = 0; +static UINT loop = 2; +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static CHAR crypto_metadata_client[20000 * NX_WEB_HTTP_SERVER_SESSION_MAX]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +#else +static UINT loop = 1; +#endif /* NX_WEB_HTTPS_ENABLE */ + +extern UINT _nx_web_http_client_receive(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET **packet_ptr, ULONG wait_option); +extern UINT _nx_web_http_client_send(NX_WEB_HTTP_CLIENT *client_ptr, NX_PACKET *packet_ptr, ULONG wait_option); + +/* This is a HTTP get packet captured by wireshark. + * curl 192.168.0.123 + * GET: pkt[54] = 0x47, pkt[55] = 0x45, pkt[56] = 0x54 + * AET: pkt[54] = 'A' , pkt[55] = 0x45, pkt[56] = 0x54 + * */ +static char pkt[] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ + 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ + 0x00, 0x75, 0x47, 0x4a, 0x40, 0x00, 0x80, 0x06, /* .uGJ@... */ + 0x31, 0x04, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* 1....i.. */ + 0x00, 0x7b, 0xe8, 0xeb, 0x00, 0x50, 0xe5, 0x59, /* .{...P.Y */ + 0x56, 0x32, 0x41, 0xf1, 0x07, 0xf0, 0x50, 0x18, /* V2A...P. */ + 0xfa, 0xf0, 0x65, 0x69, 0x00, 0x00, 0x47, 0x45, /* ..ei..GE */ + 0x54, 0x20, 0x2f, 0x20, 0x48, 0x54, 0x54, 0x50, /* T / HTTP */ + 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x73, /* /1.1..Us */ + 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, /* er-Agent */ + 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, 0x37, /* : curl/7 */ + 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x48, /* .32.0..H */ + 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32, /* ost: 192 */ + 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31, /* .168.0.1 */ + 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, /* 23..Acce */ + 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, /* pt: */ + 0x0a, 0x0d, 0x0a /* ... */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_501_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +#ifdef NX_WEB_HTTPS_ENABLE +/* Define the TLS setup callback function. */ +static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(&(client_ptr -> nx_web_http_client_tls_session), tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + return(status); + } + + /* Add a CA Certificate to our trusted store for verifying incoming server certificates. */ + nx_secure_x509_certificate_initialize(&trusted_certificate, ca_cert_der, ca_cert_der_len, NX_NULL, 0, NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(&(client_ptr -> nx_web_http_client_tls_session), &trusted_certificate); + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(&(client_ptr -> nx_web_http_client_tls_session), &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + return(NX_SUCCESS); +} +#endif /* NX_WEB_HTTPS_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *my_packet; +CHAR *buffer_ptr; + + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop ; i++) + { + if (i == 0) + { + + /* Wait HTTP server started. */ + while(!http_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + + /* Wait HTTPS server started. */ + while(!https_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + + /* Connect to server. */ + if (i == 0) + { + status = nx_web_http_client_connect(&my_client, &server_ip_address, NX_WEB_HTTP_SERVER_PORT, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + status = nx_web_http_client_secure_connect(&my_client, &server_ip_address, NX_WEB_HTTPS_SERVER_PORT, + tls_setup_callback, NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* Allocate a packet. */ + status = nx_web_http_client_request_packet_allocate(&my_client, &my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Change 'G' to 'A' .*/ + pkt[54] = 'A'; + + /* Write Get packet into the packet payload. */ + status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt) - 54), &client_pool, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Send the packet out. */ + status = _nx_web_http_client_send(&my_client, my_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + { + nx_packet_release(my_packet); + error_counter++; + } + + /* Receive the response from http server. */ + status = _nx_web_http_client_receive(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; + + /* Check the status, If success , it should be 501. */ + if((buffer_ptr[9] != '5') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) + error_counter++; + + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_client_stop = 1; + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_client_stop = 1; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; +FX_FILE my_file; +UINT server_port = NX_WEB_HTTP_SERVER_PORT; + + + /* Print out test information banner. */ + printf("NetX Test: Web Status 501 Test......................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + fx_media_format(&ram_disk, + _fx_ram_driver, // Driver entry + ram_disk_memory, // RAM disk memory pointer + media_memory, // Media buffer pointer + sizeof(media_memory), // Media buffer size + "MY_RAM_DISK", // Volume Name + 1, // Number of FATs + 32, // Directory Entries + 0, // Hidden sectors + 256, // Total sectors + 512, // Sector size + 8, // Sectors per cluster + 1, // Heads + 1); // Sectors per track + + /* Open the RAM disk. */ + status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)) ; + status += fx_file_create(&ram_disk, "index.htm"); + status += fx_file_open(&ram_disk, &my_file, "index.htm", FX_OPEN_FOR_WRITE); + status += fx_file_write(&my_file, "https server", 12); + status += fx_file_close(&my_file); + if(status) + error_counter++; + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < loop; i++) + { + + if (i == 1) + { + server_port = NX_WEB_HTTPS_SERVER_PORT; + } + + /* Create the HTTP Server. */ + status = nx_web_http_server_create(&my_server, "My HTTP Server", &server_ip, server_port, &ram_disk, + &server_stack, sizeof(server_stack), &server_pool, + NX_NULL, NX_NULL); + if (status) + error_counter++; + +#ifdef NX_WEB_HTTPS_ENABLE + /* Set TLS for HTTPS. */ + if (i == 1) + { + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + /* Setup TLS session data for the TCP server. */ + status = nx_web_http_server_secure_configure(&my_server, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + error_counter++; + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + /* OK to start the HTTP Server. */ + status = nx_web_http_server_start(&my_server); + if (status) + error_counter++; + + /* Set the flag. */ + if (i == 0) + { + http_server_start = 1; + + /* Wait HTTP test finished. */ + while(!http_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#ifdef NX_WEB_HTTPS_ENABLE + else + { + https_server_start = 1; + + /* Wait HTTPS test finished. */ + while(!https_client_stop) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } +#endif /* NX_WEB_HTTPS_ENABLE */ + + status = nx_web_http_server_delete(&my_server); + if (status) + error_counter++; + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_501_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Status 501 Test.......................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_status_code_test.c b/test/regression/web_test/netx_web_status_code_test.c new file mode 100644 index 00000000..7e7f0533 --- /dev/null +++ b/test/regression/web_test/netx_web_status_code_test.c @@ -0,0 +1,397 @@ +/* This case tests basic GET method. */ +#include "tx_api.h" +#include "nx_api.h" +#include "fx_api.h" +#include "nx_web_http_client.h" +#include "nx_web_http_server.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) + +#define DEMO_STACK_SIZE 4096 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* Set up the HTTP client global variables. */ + +#define CLIENT_PACKET_SIZE (NX_WEB_HTTP_CLIENT_MIN_PACKET_SIZE * 2) + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_WEB_HTTP_CLIENT my_client; +static NX_IP client_ip; +static UINT error_counter; + +/* Set up the HTTP server global variables */ + +#define SERVER_PACKET_SIZE (NX_WEB_HTTP_SERVER_MIN_PACKET_SIZE * 2) + +static NX_TCP_SOCKET server_socket; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static NXD_ADDRESS server_ip_address; + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + +/* Define status maps. */ +static NX_WEB_HTTP_CLIENT_STATUS_MAP test_status_maps[] = +{ + {"100", NX_WEB_HTTP_STATUS_CODE_CONTINUE}, + {"101", NX_WEB_HTTP_STATUS_CODE_SWITCHING_PROTOCOLS}, + {"201", NX_WEB_HTTP_STATUS_CODE_CREATED}, + {"202", NX_WEB_HTTP_STATUS_CODE_ACCEPTED}, + {"203", NX_WEB_HTTP_STATUS_CODE_NON_AUTH_INFO}, + {"204", NX_WEB_HTTP_STATUS_CODE_NO_CONTENT}, + {"205", NX_WEB_HTTP_STATUS_CODE_RESET_CONTENT}, + {"206", NX_WEB_HTTP_STATUS_CODE_PARTIAL_CONTENT}, + {"300", NX_WEB_HTTP_STATUS_CODE_MULTIPLE_CHOICES}, + {"301", NX_WEB_HTTP_STATUS_CODE_MOVED_PERMANETLY}, + {"302", NX_WEB_HTTP_STATUS_CODE_FOUND}, + {"303", NX_WEB_HTTP_STATUS_CODE_SEE_OTHER}, + {"304", NX_WEB_HTTP_STATUS_CODE_NOT_MODIFIED}, + {"305", NX_WEB_HTTP_STATUS_CODE_USE_PROXY}, + {"307", NX_WEB_HTTP_STATUS_CODE_TEMPORARY_REDIRECT}, + {"400", NX_WEB_HTTP_STATUS_CODE_BAD_REQUEST}, + {"401", NX_WEB_HTTP_STATUS_CODE_UNAUTHORIZED}, + {"402", NX_WEB_HTTP_STATUS_CODE_PAYMENT_REQUIRED}, + {"403", NX_WEB_HTTP_STATUS_CODE_FORBIDDEN}, + {"404", NX_WEB_HTTP_STATUS_CODE_NOT_FOUND}, + {"405", NX_WEB_HTTP_STATUS_CODE_METHOD_NOT_ALLOWED}, + {"406", NX_WEB_HTTP_STATUS_CODE_NOT_ACCEPTABLE}, + {"407", NX_WEB_HTTP_STATUS_CODE_PROXY_AUTH_REQUIRED}, + {"408", NX_WEB_HTTP_STATUS_CODE_REQUEST_TIMEOUT}, + {"409", NX_WEB_HTTP_STATUS_CODE_CONFLICT}, + {"410", NX_WEB_HTTP_STATUS_CODE_GONE}, + {"411", NX_WEB_HTTP_STATUS_CODE_LENGTH_REQUIRED}, + {"412", NX_WEB_HTTP_STATUS_CODE_PRECONDITION_FAILED}, + {"413", NX_WEB_HTTP_STATUS_CODE_ENTITY_TOO_LARGE}, + {"414", NX_WEB_HTTP_STATUS_CODE_URL_TOO_LARGE}, + {"415", NX_WEB_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA}, + {"416", NX_WEB_HTTP_STATUS_CODE_RANGE_NOT_SATISFY}, + {"417", NX_WEB_HTTP_STATUS_CODE_EXPECTATION_FAILED}, + {"500", NX_WEB_HTTP_STATUS_CODE_INTERNAL_ERROR}, + {"501", NX_WEB_HTTP_STATUS_CODE_NOT_IMPLEMENTED}, + {"502", NX_WEB_HTTP_STATUS_CODE_BAD_GATEWAY}, + {"503", NX_WEB_HTTP_STATUS_CODE_SERVICE_UNAVAILABLE}, + {"504", NX_WEB_HTTP_STATUS_CODE_GATEWAY_TIMEOUT}, + {"505", NX_WEB_HTTP_STATUS_CODE_VERSION_ERROR}, +}; + +static UINT test_count = sizeof(test_status_maps)/sizeof(NX_WEB_HTTP_CLIENT_STATUS_MAP); + +static char pkt[] = { +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, /* HTTP/1.1 */ +0x20, 0x32, 0x30, 0x30, 0x20, 0x0d, 0x0a, 0x0d, /* 200 ... */ +0x0a, /* . */ +}; + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_code_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY, NX_WEB_HTTP_SERVER_PRIORITY, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, + pointer, SERVER_PACKET_SIZE*8); + pointer = pointer + SERVER_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the HTTP Client thread. */ + status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + NX_WEB_HTTP_SERVER_PRIORITY + 2, NX_WEB_HTTP_SERVER_PRIORITY + 2, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, + pointer, CLIENT_PACKET_SIZE*8); + pointer = pointer + CLIENT_PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i; +UINT status; +NX_PACKET *recv_packet; + + + /* Wait server to set up. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* First loop test HTTP, second loop test HTTPS. */ + for (i = 0; i < test_count ; i++) + { + + /* Create an HTTP client instance. */ + status = nx_web_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 1536); + + /* Check status. */ + if (status) + error_counter++; + + /* Send a GET request. */ + status = nx_web_http_client_get_start(&my_client, &server_ip_address, + NX_WEB_HTTP_SERVER_PORT, "http://1.2.3.4/test.txt", + "1.2.3.4", "name", "password", NX_WAIT_FOREVER); + + /* Check status. */ + if (status) + error_counter++; + + /* Get response from server. */ + status = nx_web_http_client_response_body_get(&my_client, &recv_packet, 1 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (test_status_maps[i].nx_web_http_client_status_string[0] == '2') + { + if (status != NX_SUCCESS && status != NX_WEB_HTTP_GET_DONE) + error_counter++; + } + else if (status != test_status_maps[i].nx_web_http_client_status_code) + { + error_counter++; + } + + if (recv_packet) + { + nx_packet_release(recv_packet); + } + + status = nx_web_http_client_delete(&my_client); + if (status) + error_counter++; + + tx_thread_resume(&server_thread); + } +} + +/* Define the helper HTTP server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT status; +NX_PACKET *recv_packet; +NX_PACKET *send_packet; +UINT i; + + /* Print out test information banner. */ + printf("NetX Test: Web Status Code Test......................................"); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Create a TCP socket act as the HTTP server. */ + status = nx_tcp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 2048, NX_NULL, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Bind the TCP socket to the IP port. */ + status = nx_tcp_server_socket_listen(&server_ip, 80, &server_socket, 5, NX_NULL); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Act as the HTTP server to receive the Client query and send the HTTP server response. */ + for (i = 0; i < test_count; i++ ) + { + + /* Wait for a connection request. */ + status = nx_tcp_server_socket_accept(&server_socket, 500); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Receive a TCP packet. */ + status = nx_tcp_socket_receive(&server_socket, &recv_packet, 10 * NX_IP_PERIODIC_RATE); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Release the packet. */ + nx_packet_release(recv_packet); + + nx_packet_allocate(&server_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); + + /* Set the test status code. */ + pkt[9] = test_status_maps[i].nx_web_http_client_status_string[0]; + pkt[10] = test_status_maps[i].nx_web_http_client_status_string[1]; + pkt[11] = test_status_maps[i].nx_web_http_client_status_string[2]; + + nx_packet_data_append(send_packet, pkt, sizeof(pkt), &server_pool, NX_WAIT_FOREVER); + + /* Send the TCP response packet. */ + status = nx_tcp_socket_send(&server_socket, send_packet, 200); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Disconnect the server socket. */ + status = nx_tcp_socket_disconnect(&server_socket, 200); + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unbind the UDP socket. */ + status = nx_tcp_server_socket_relisten(&server_ip, 80, &server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + tx_thread_suspend(&server_thread); + } + + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&server_socket); + + /* Unbind the UDP socket. */ + status = nx_tcp_server_socket_unlisten(&server_ip, 80); + + /* Check status. */ + if (status) + { + error_counter++; + } + /* Delete the TCP socket. */ + status = nx_tcp_socket_delete(&server_socket); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Check packet pool. */ + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_status_code_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web Status Code Test......................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/web_test/netx_web_tcpserver_rst_test.c b/test/regression/web_test/netx_web_tcpserver_rst_test.c new file mode 100644 index 00000000..2d546bab --- /dev/null +++ b/test/regression/web_test/netx_web_tcpserver_rst_test.c @@ -0,0 +1,243 @@ +/* This case tests the tcpserver on handling RST packet. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-235 + */ +#include "nx_api.h" +#include "nx_tcpserver.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + +#define DEMO_STACK_SIZE 2048 +#define PACKET_SIZE 256 +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define SERVER_PORT 1234 +#define LOOP 100 + +static NX_TCP_SESSION session_buffer[5]; +static NX_TCPSERVER tcpserver; +static TX_THREAD server_thread; +static TX_THREAD test_threads[10]; +static NX_TCP_SOCKET test_sockets[10]; +static UINT run_count[10]; +static NX_IP ip_0; +static NX_PACKET_POOL pool_0; +static UINT error_counter; +static UCHAR pool_area[(sizeof(NX_PACKET) + PACKET_SIZE) * 64]; +static UCHAR tcpserver_stack[DEMO_STACK_SIZE]; +static UCHAR test_thread_stack[10][DEMO_STACK_SIZE]; +static TX_SEMAPHORE sema_0; + +static void thread_test_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_tcpserver_rst_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the packet pool. */ + status = nx_packet_pool_create(&pool_0, "Packet Pool", PACKET_SIZE, + pool_area, sizeof(pool_area)); + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "IP 0", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&ip_0); + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +static void connection_end(NX_TCPSERVER *server_ptr, NX_TCP_SESSION *session_ptr) +{ + nx_tcp_socket_disconnect(&session_ptr -> nx_tcp_session_socket, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&session_ptr -> nx_tcp_session_socket); +} + +static void thread_test_entry(ULONG thread_input) +{ +NX_TCP_SOCKET *socket_ptr = &test_sockets[thread_input]; +UINT status; +UINT i; + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_0, socket_ptr, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + for (i = 0; i < LOOP; i++) + { + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(socket_ptr, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + status = nx_tcp_client_socket_connect(socket_ptr, SERVER_ADDRESS, SERVER_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + nx_tcp_socket_disconnect(socket_ptr, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(socket_ptr); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + + run_count[thread_input]++; + } + + nx_tcp_socket_delete(socket_ptr); + tx_semaphore_put(&sema_0); +} + + +/* Define the server thread. */ +static void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: Web TCPServer RST Test...................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcpserver_create(&ip_0, &tcpserver, "TCP server", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 200, NX_NULL, NX_NULL, connection_end, NX_NULL, 60 * NX_IP_PERIODIC_RATE, + tcpserver_stack, sizeof(tcpserver_stack), session_buffer, + sizeof(session_buffer), 4, 1); + if (status) + { + error_counter++; + } + + status = nx_tcpserver_start(&tcpserver, SERVER_PORT, 20); + if (status) + { + error_counter++; + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + run_count[i] = 0; + tx_thread_create(&test_threads[i], "Test thread", thread_test_entry, i, + test_thread_stack[i], DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (tx_semaphore_get(&sema_0, 30 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + break; + } + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (run_count[i] != LOOP) + { + error_counter++; + } + } + + nx_tcpserver_stop(&tcpserver); + nx_tcpserver_delete(&tcpserver); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_tcpserver_rst_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web TCPServer RST Test....................................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_tcpserver_tls_fail_rst_test.c b/test/regression/web_test/netx_web_tcpserver_tls_fail_rst_test.c new file mode 100644 index 00000000..d617d896 --- /dev/null +++ b/test/regression/web_test/netx_web_tcpserver_tls_fail_rst_test.c @@ -0,0 +1,283 @@ +/* This case tests the tcpserver on handling RST packet when TLS connection is failed. + */ +#include "nx_api.h" +#include "nx_tcpserver.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(NX_WEB_HTTPS_ENABLE) +#include "test_device_cert.c" + +#define DEMO_STACK_SIZE 2048 +#define PACKET_SIZE 256 +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define SERVER_PORT 1234 +#define LOOP 100 + +static NX_TCP_SESSION session_buffer[2]; +static NX_TCPSERVER tcpserver; +static TX_THREAD server_thread; +static TX_THREAD test_threads[4]; +static NX_TCP_SOCKET test_sockets[4]; +static NX_IP ip_0; +static NX_PACKET_POOL pool_0; +static UINT error_counter; +static UCHAR pool_area[(sizeof(NX_PACKET) + PACKET_SIZE) * 64]; +static UCHAR tcpserver_stack[DEMO_STACK_SIZE]; +static UCHAR test_thread_stack[4][DEMO_STACK_SIZE]; +static TX_SEMAPHORE sema_0; +static NX_SECURE_TLS_SESSION test_session[4]; + +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; +static CHAR crypto_metadata_server[20000 * 2]; +static CHAR crypto_metadata_client[20000 * 2]; +static UCHAR tls_packet_buffer[18500]; +static NX_SECURE_X509_CERT certificate; +static NX_SECURE_X509_CERT trusted_certificate; +static NX_SECURE_X509_CERT remote_certificate, remote_issuer; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; + +static void thread_test_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_tcpserver_tls_faile_rst_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the packet pool. */ + status = nx_packet_pool_create(&pool_0, "Packet Pool", PACKET_SIZE, + pool_area, sizeof(pool_area)); + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_0, "IP 0", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1024, + pointer, 4096, 1); + pointer = pointer + 4096; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&ip_0, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&ip_0); + if (status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +static void connection_end(NX_TCPSERVER *server_ptr, NX_TCP_SESSION *session_ptr) +{ + nx_secure_tls_session_end(&(session_ptr -> nx_tcp_session_tls_session), NX_NO_WAIT); + nx_tcp_socket_disconnect(&session_ptr -> nx_tcp_session_socket, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&session_ptr -> nx_tcp_session_socket); +} + +static void thread_test_entry(ULONG thread_input) +{ +NX_TCP_SOCKET *socket_ptr = &test_sockets[thread_input]; +NX_SECURE_TLS_SESSION *session_ptr = &test_session[thread_input]; +UINT status; + + /* Initialize and create TLS session. */ + status = nx_secure_tls_session_create(session_ptr, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Allocate space for packet reassembly. */ + status = nx_secure_tls_session_packet_buffer_set(session_ptr, tls_packet_buffer, sizeof(tls_packet_buffer)); + + /* Check status. */ + if (status) + { + error_counter++; + } + + /* Need to allocate space for the certificate coming in from the remote host. */ + nx_secure_tls_remote_certificate_allocate(session_ptr, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(session_ptr, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_0, socket_ptr, "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(socket_ptr, NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + status = nx_tcp_client_socket_connect(socket_ptr, SERVER_ADDRESS, SERVER_PORT, NX_WAIT_FOREVER); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + status = nx_secure_tls_session_start(session_ptr, socket_ptr, NX_IP_PERIODIC_RATE); + if (!status) + { + error_counter++; + } + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + nx_secure_tls_session_end(session_ptr, NX_IP_PERIODIC_RATE); + nx_secure_tls_session_delete(session_ptr); + + nx_tcp_socket_disconnect(socket_ptr, NX_NO_WAIT); + + /* Unbind the socket. */ + status = nx_tcp_client_socket_unbind(socket_ptr); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + nx_tcp_socket_delete(socket_ptr); + tx_semaphore_put(&sema_0); +} + + +/* Define the server thread. */ +static void thread_server_entry(ULONG thread_input) +{ +UINT i; +UINT status; + + + /* Print out test information banner. */ + printf("NetX Test: Web TCPServer TLS Fail RST Test..........................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcpserver_create(&ip_0, &tcpserver, "TCP server", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 200, NX_NULL, NX_NULL, connection_end, NX_NULL, 60 * NX_IP_PERIODIC_RATE, + tcpserver_stack, sizeof(tcpserver_stack), session_buffer, + sizeof(session_buffer), 4, 1); + if (status) + { + error_counter++; + } + + /* Initialize device certificate (used for all sessions in HTTPS server). */ + memset(&certificate, 0, sizeof(certificate)); + nx_secure_x509_certificate_initialize(&certificate, test_device_cert_der, test_device_cert_der_len, NX_NULL, 0, test_device_cert_key_der, test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + + status = nx_tcpserver_tls_setup(&tcpserver, &nx_crypto_tls_ciphers, + crypto_metadata_server, sizeof(crypto_metadata_server), + tls_packet_buffer, sizeof(tls_packet_buffer), + &certificate, NX_NULL, 0, NX_NULL, 0, NX_NULL, 0); + if (status) + { + error_counter++; + } + + status = nx_tcpserver_start(&tcpserver, SERVER_PORT, 20); + if (status) + { + error_counter++; + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + tx_thread_create(&test_threads[i], "Test thread", thread_test_entry, i, + test_thread_stack[i], DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + } + + for (i = 0; i < sizeof(test_threads) / sizeof(TX_THREAD); i++) + { + if (tx_semaphore_get(&sema_0, 30 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + break; + } + } + + nx_tcpserver_stop(&tcpserver); + nx_tcpserver_delete(&tcpserver); + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_tcpserver_tls_faile_rst_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Web TCPServer TLS Fail RST Test...........................N/A\n"); + + test_control_return(3); +} +#endif diff --git a/test/regression/web_test/netx_web_tcpserver_two_listen_test.c b/test/regression/web_test/netx_web_tcpserver_two_listen_test.c new file mode 100644 index 00000000..6cf52d84 --- /dev/null +++ b/test/regression/web_test/netx_web_tcpserver_two_listen_test.c @@ -0,0 +1,275 @@ +/* This case tests the tcpserver on handling two session listen situation. + * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-238 + */ +#include "nx_api.h" +#include "nx_tcpserver.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && !defined(NX_DISABLE_RESET_DISCONNECT) + +#define LOOP 100 +#define SERVER_PORT 1234 +#define DEMO_STACK_SIZE 2048 + + +/* Define the ThreadX and NetX object control blocks... */ + +static NX_TCP_SESSION session_buffer[2]; +static NX_TCPSERVER tcpserver; +static TX_THREAD server_thread; +static NX_PACKET_POOL pool_server; +static NX_PACKET_POOL pool_client; +static NX_IP ip_server; +static NX_IP ip_client; +static NX_TCP_SOCKET test_sockets[3]; +static TX_SEMAPHORE sema_0; + +static UINT data_received; +static UCHAR send_buff[256]; +static UCHAR recv_buff[256]; +static UCHAR tcpserver_stack[DEMO_STACK_SIZE]; + + +#define SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) + + +/* Define the counters used in the demo application... */ + +static ULONG error_counter; + +/* Define timeout in ticks for connecting and sending/receiving data. */ + +/* Define function prototypes. */ + +static void thread_server_entry(ULONG thread_input); +static void thread_test_entry(ULONG thread_input); + +/* Replace the 'ram' driver with your actual Ethernet driver. */ +extern void _nx_ram_network_driver_512(struct NX_IP_DRIVER_STRUCT *driver_req); + + +/* Define the application's TCPServer callback routines. */ + +static void receive_data(NX_TCPSERVER *server_ptr, NX_TCP_SESSION *session_ptr); +static void connection_end(NX_TCPSERVER *server_ptr, NX_TCP_SESSION *session_ptr); + + +/* Define what the initial system looks like. */ +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_tcpserver_two_listen_test_application_define(void *first_unused_memory) +#endif +{ + +UINT status; +CHAR *pointer; + + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create the server thread. */ + tx_thread_create(&server_thread, "server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create packet pool. */ + status = nx_packet_pool_create(&pool_server, "Server NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&ip_server, "Server NetX IP Instance", SERVER_ADDRESS, + 0xFFFFFF00UL, &pool_server, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Create another packet pool. */ + status = nx_packet_pool_create(&pool_client, "Client NetX Packet Pool", 600, pointer, 8192); + pointer = pointer + 8192; + if(status) + error_counter++; + + /* Create another IP instance. */ + status = nx_ip_create(&ip_client, "Client NetX IP Instance", CLIENT_ADDRESS, + 0xFFFFFF00UL, &pool_client, _nx_ram_network_driver_512, + pointer, 4096, 1); + pointer = pointer + 4096; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 0. */ + status = nx_arp_enable(&ip_server, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for IP Instance 1. */ + status = nx_arp_enable(&ip_client, (void *) pointer, 1024); + pointer = pointer + 1024; + if(status) + error_counter++; + + /* Enable TCP processing for both IP instances. */ + status = nx_tcp_enable(&ip_server); + status += nx_tcp_enable(&ip_client); + if(status) + error_counter++; + + status = tx_semaphore_create(&sema_0, "Semaphore", 0); + if (status) + error_counter++; +} + +/* Define the Server thread. */ +static void thread_server_entry(ULONG thread_input) +{ + +UINT i; +UINT status; +NX_PACKET *packet_ptr; + + /* Print out test information banner. */ + printf("NetX Test: Web TCPServer Two Listen Test............................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + status = nx_tcpserver_create(&ip_server, &tcpserver, "TCP server", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, + 200, NX_NULL, receive_data, connection_end, NX_NULL, 60 * NX_IP_PERIODIC_RATE, + tcpserver_stack, sizeof(tcpserver_stack), session_buffer, + sizeof(session_buffer), 4, 1); + if (status) + { + error_counter++; + } + + status = nx_tcpserver_start(&tcpserver, SERVER_PORT, 20); + if (status) + { + error_counter++; + } + + /* Initialize test sockets. */ + for (i = 0; i < sizeof(test_sockets) / sizeof(NX_TCP_SOCKET); i++) + { + + /* Create Client socket. */ + status = nx_tcp_socket_create(&ip_client, &test_sockets[i], "Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + error_counter++; + return; + } + + /* Bind the socket. */ + status = nx_tcp_client_socket_bind(&test_sockets[i], NX_ANY_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + break; + } + } + + /* Connect to server. */ + status = nx_tcp_client_socket_connect(&test_sockets[0], SERVER_ADDRESS, SERVER_PORT, NX_IP_PERIODIC_RATE); + + /* Check for error. */ + if (status) + { + error_counter++; + } + + /* Send data to server. */ + nx_packet_allocate(&pool_client, &packet_ptr, NX_TCP_PACKET, NX_NO_WAIT); + nx_packet_data_append(packet_ptr, "ABC", 3, &pool_client, NX_NO_WAIT); + nx_tcp_socket_send(&test_sockets[0], packet_ptr, NX_NO_WAIT); + + /* Disconnect immediately. */ + nx_tcp_socket_disconnect(&test_sockets[0], NX_IP_PERIODIC_RATE); + + if (tx_semaphore_get(&sema_0, 5 * NX_IP_PERIODIC_RATE)) + { + error_counter++; + } + + /* Let another two sockets connect to server without block. */ + nx_tcp_client_socket_connect(&test_sockets[1], SERVER_ADDRESS, SERVER_PORT, NX_NO_WAIT); + nx_tcp_client_socket_connect(&test_sockets[2], SERVER_ADDRESS, SERVER_PORT, NX_NO_WAIT); + + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Make sure the state of sockets is ESTABLISHED. */ + if (test_sockets[1].nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + error_counter++; + } + if (test_sockets[2].nx_tcp_socket_state != NX_TCP_ESTABLISHED) + { + error_counter++; + } + + nx_tcpserver_stop(&tcpserver); + nx_tcpserver_delete(&tcpserver); + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + + +static void receive_data(NX_TCPSERVER *server_ptr, NX_TCP_SESSION *session_ptr) +{ + tx_semaphore_put(&sema_0); +} + +static void connection_end(NX_TCPSERVER *server_ptr, NX_TCP_SESSION *session_ptr) +{ + nx_tcp_socket_disconnect(&session_ptr -> nx_tcp_session_socket, NX_NO_WAIT); + nx_tcp_server_socket_unaccept(&session_ptr -> nx_tcp_session_socket); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_web_tcpserver_two_listen_test_application_define(void *first_unused_memory) +#endif +{ + /* Print out test information banner. */ + printf("NetX Test: Web TCPServer Two Listen Test.............................N/A\n"); + test_control_return(3); +} +#endif + + diff --git a/test/regression/web_test/test_ca_cert.c b/test/regression/web_test/test_ca_cert.c new file mode 100644 index 00000000..02ed1b48 --- /dev/null +++ b/test/regression/web_test/test_ca_cert.c @@ -0,0 +1,84 @@ +static unsigned char test_ca_cert_der[] = { + 0x30, 0x82, 0x03, 0xc7, 0x30, 0x82, 0x02, 0xaf, 0xa0, 0x03, 0x02, 0x01, + 0x02, 0x02, 0x09, 0x00, 0xa1, 0x79, 0xb0, 0x6a, 0x32, 0xbc, 0x48, 0x67, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x0b, 0x05, 0x00, 0x30, 0x7a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x08, 0x0c, 0x02, 0x43, 0x41, 0x31, 0x12, 0x30, 0x10, 0x06, + 0x03, 0x55, 0x04, 0x07, 0x0c, 0x09, 0x53, 0x61, 0x6e, 0x20, 0x44, 0x69, + 0x65, 0x67, 0x6f, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x0d, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x4c, 0x6f, + 0x67, 0x69, 0x63, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, + 0x0c, 0x0b, 0x4e, 0x65, 0x74, 0x58, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, + 0x4e, 0x65, 0x74, 0x58, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, + 0x36, 0x31, 0x31, 0x31, 0x31, 0x31, 0x39, 0x35, 0x30, 0x30, 0x38, 0x5a, + 0x17, 0x0d, 0x32, 0x36, 0x31, 0x31, 0x30, 0x39, 0x31, 0x39, 0x35, 0x30, + 0x30, 0x38, 0x5a, 0x30, 0x7a, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x04, 0x08, 0x0c, 0x02, 0x43, 0x41, 0x31, 0x12, 0x30, 0x10, 0x06, + 0x03, 0x55, 0x04, 0x07, 0x0c, 0x09, 0x53, 0x61, 0x6e, 0x20, 0x44, 0x69, + 0x65, 0x67, 0x6f, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, + 0x0c, 0x0d, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x4c, 0x6f, + 0x67, 0x69, 0x63, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, + 0x0c, 0x0b, 0x4e, 0x65, 0x74, 0x58, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, + 0x4e, 0x65, 0x74, 0x58, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, + 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, + 0x82, 0x01, 0x01, 0x00, 0xd1, 0xdc, 0x3c, 0xe1, 0x1c, 0x7a, 0x3d, 0xb7, + 0x76, 0xcf, 0xab, 0xd7, 0x3c, 0x38, 0xb0, 0x81, 0xb6, 0x37, 0x52, 0xa3, + 0x3d, 0x6f, 0xcd, 0x89, 0xa6, 0xa2, 0xf3, 0xa8, 0xb0, 0x8d, 0xee, 0x0b, + 0x36, 0x94, 0x83, 0x0e, 0x7f, 0x39, 0x87, 0x6e, 0xee, 0x19, 0xe2, 0x1f, + 0x92, 0x3d, 0x01, 0x05, 0x4f, 0x11, 0xcd, 0xcb, 0xa0, 0x79, 0xfc, 0x9d, + 0x6e, 0x93, 0xb1, 0xb7, 0x03, 0xf3, 0xfe, 0xeb, 0x30, 0x67, 0x38, 0x85, + 0x28, 0xdf, 0x93, 0xdb, 0xcb, 0xcb, 0xb1, 0xbe, 0xd3, 0xe1, 0xc2, 0x7d, + 0x8d, 0xbb, 0x70, 0x76, 0x99, 0x08, 0x7c, 0x3f, 0x21, 0x2f, 0x37, 0x97, + 0xf7, 0xe8, 0x6e, 0x8c, 0x7e, 0xbc, 0x30, 0x5f, 0xbf, 0x32, 0x51, 0x1d, + 0x66, 0x76, 0xad, 0x39, 0xfc, 0x94, 0xd4, 0x65, 0xf6, 0xd2, 0x0b, 0x37, + 0xd3, 0x4a, 0xe6, 0xe1, 0xdf, 0x4a, 0x8f, 0x3b, 0x33, 0x16, 0xbe, 0xf7, + 0xd9, 0xbd, 0x73, 0x64, 0xdf, 0x34, 0xa3, 0x55, 0xe7, 0xac, 0xab, 0xa7, + 0xae, 0xc2, 0x20, 0x46, 0xc2, 0xd1, 0xe3, 0x25, 0x3a, 0x47, 0x68, 0x92, + 0xac, 0xd6, 0x12, 0xa4, 0x0a, 0xce, 0xdc, 0xe2, 0x24, 0x12, 0xee, 0xe1, + 0xb2, 0xcd, 0x09, 0xa8, 0xef, 0x36, 0xea, 0x76, 0xf9, 0xb6, 0x63, 0xaa, + 0xac, 0xdd, 0x46, 0x06, 0x6e, 0xd9, 0x1e, 0x08, 0xac, 0x57, 0x12, 0x6c, + 0x21, 0xef, 0x8e, 0xae, 0xf0, 0x27, 0xf1, 0x5c, 0x79, 0xb4, 0xb6, 0x26, + 0x92, 0x11, 0xda, 0xca, 0x80, 0x5e, 0x92, 0x4c, 0xb5, 0xd8, 0xb5, 0x84, + 0x95, 0xe3, 0xef, 0xbc, 0x7e, 0x7d, 0x68, 0x74, 0x4c, 0x34, 0x1a, 0x50, + 0x6d, 0x2d, 0x5f, 0x1b, 0x0e, 0xbe, 0xf5, 0xb4, 0xf1, 0x32, 0x16, 0x44, + 0x24, 0x7a, 0x0e, 0x4b, 0xcd, 0xfa, 0xa5, 0x03, 0x95, 0x2e, 0x44, 0x65, + 0xa8, 0x74, 0xea, 0x17, 0xdd, 0x99, 0xbd, 0xcb, 0x02, 0x03, 0x01, 0x00, + 0x01, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, + 0x04, 0x16, 0x04, 0x14, 0x1b, 0x8d, 0x06, 0xd9, 0x6b, 0xad, 0xee, 0x82, + 0x24, 0x26, 0x55, 0x9a, 0x1b, 0x03, 0x44, 0x92, 0x0a, 0x06, 0x92, 0x48, + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, + 0x14, 0x1b, 0x8d, 0x06, 0xd9, 0x6b, 0xad, 0xee, 0x82, 0x24, 0x26, 0x55, + 0x9a, 0x1b, 0x03, 0x44, 0x92, 0x0a, 0x06, 0x92, 0x48, 0x30, 0x0c, 0x06, + 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, + 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x70, 0xc7, 0x6a, 0x75, 0x27, + 0x14, 0xa0, 0x1c, 0xe0, 0xe0, 0x84, 0x7c, 0x6c, 0x16, 0xa9, 0x0d, 0x4d, + 0xb1, 0xc3, 0x87, 0x37, 0xf6, 0x86, 0x89, 0x6f, 0x73, 0xf0, 0x59, 0x9b, + 0x8c, 0xa4, 0x83, 0x10, 0x2d, 0xb7, 0x8b, 0xd0, 0x9a, 0x81, 0xe0, 0x5c, + 0xd7, 0x20, 0x6f, 0xdc, 0xfc, 0xc8, 0xa0, 0xc2, 0x8e, 0x54, 0xe6, 0xfb, + 0x61, 0x85, 0x37, 0x4b, 0x22, 0x47, 0x09, 0x95, 0x44, 0x12, 0x75, 0xf0, + 0xcf, 0x0b, 0x90, 0x48, 0xb0, 0x02, 0x4c, 0xef, 0x3f, 0xde, 0x6a, 0xfd, + 0xb1, 0x8b, 0x88, 0xd7, 0x84, 0xe5, 0x34, 0x02, 0x96, 0x0a, 0x3f, 0xa8, + 0x8c, 0xbd, 0x1a, 0xd8, 0xf7, 0xf9, 0xe5, 0x49, 0x87, 0xd0, 0x20, 0x4f, + 0xd8, 0xcd, 0xc0, 0xb9, 0x11, 0x2a, 0xd9, 0x0f, 0x75, 0xa6, 0xee, 0x76, + 0x15, 0x9f, 0x12, 0x50, 0x68, 0x4c, 0xc0, 0x05, 0x46, 0x8d, 0xdd, 0x93, + 0x74, 0x31, 0x82, 0x20, 0x37, 0x24, 0x58, 0xb2, 0x88, 0x9b, 0x21, 0xc1, + 0x48, 0xc4, 0x8d, 0x68, 0x3b, 0x91, 0x2c, 0x34, 0xcb, 0x94, 0xd0, 0xbc, + 0xe3, 0x05, 0x24, 0x05, 0xcc, 0xea, 0x05, 0xb1, 0x52, 0x74, 0x4a, 0x23, + 0x65, 0xc4, 0x40, 0x04, 0x86, 0xb1, 0x80, 0x61, 0x97, 0xdc, 0x94, 0x16, + 0x4e, 0x63, 0x31, 0x72, 0x4e, 0x45, 0xe8, 0x3e, 0x3b, 0xb6, 0x99, 0xae, + 0xd8, 0x91, 0x25, 0x3d, 0x62, 0x92, 0x6d, 0x72, 0x01, 0x2c, 0xca, 0x67, + 0x0a, 0xec, 0x00, 0xeb, 0x10, 0xff, 0x6d, 0xac, 0x89, 0x19, 0x2c, 0xb7, + 0xb3, 0xa5, 0xf7, 0xa1, 0x4a, 0xc3, 0xc1, 0xdd, 0xaf, 0xb5, 0x1a, 0x16, + 0x44, 0xdc, 0xa8, 0xb5, 0xca, 0xd0, 0x30, 0xaa, 0x7e, 0x73, 0xd5, 0x2e, + 0x65, 0xd6, 0xf9, 0xbf, 0x5f, 0xda, 0x6f, 0x13, 0xe9, 0xd7, 0x12, 0x6c, + 0x3a, 0x6c, 0x50, 0x26, 0x78, 0x6e, 0xc6, 0xeb, 0x75, 0xe1, 0x3c +}; +static unsigned int test_ca_cert_der_len = 971; diff --git a/test/regression/web_test/test_device_cert.c b/test/regression/web_test/test_device_cert.c new file mode 100644 index 00000000..bb21fb43 --- /dev/null +++ b/test/regression/web_test/test_device_cert.c @@ -0,0 +1,190 @@ +static unsigned char test_device_cert_der[] = { + 0x30, 0x82, 0x03, 0xd2, 0x30, 0x82, 0x02, 0xba, 0xa0, 0x03, 0x02, 0x01, + 0x02, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x7a, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x43, 0x41, 0x31, + 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x09, 0x53, 0x61, + 0x6e, 0x20, 0x44, 0x69, 0x65, 0x67, 0x6f, 0x31, 0x16, 0x30, 0x14, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0d, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x31, 0x14, 0x30, 0x12, 0x06, + 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x0b, 0x4e, 0x65, 0x74, 0x58, 0x20, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x65, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x13, 0x4e, 0x65, 0x74, 0x58, 0x20, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, + 0x1e, 0x17, 0x0d, 0x31, 0x36, 0x31, 0x31, 0x31, 0x31, 0x31, 0x39, 0x35, + 0x31, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x36, 0x31, 0x31, 0x30, 0x39, + 0x31, 0x39, 0x35, 0x31, 0x30, 0x30, 0x5a, 0x30, 0x62, 0x31, 0x0b, 0x30, + 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x02, 0x43, 0x41, 0x31, + 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0d, 0x45, 0x78, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x31, + 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x0b, 0x4e, 0x65, + 0x74, 0x58, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x31, 0x18, 0x30, + 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x77, 0x77, 0x77, 0x2e, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, + 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, + 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xae, 0x03, 0x2c, 0xec, + 0xa2, 0x79, 0xd1, 0x15, 0x20, 0x88, 0x4d, 0xcd, 0xa2, 0x1b, 0x05, 0xe3, + 0xbd, 0x55, 0xad, 0xc6, 0x1f, 0x64, 0xe8, 0xb5, 0xc5, 0x0d, 0x67, 0xfc, + 0x7e, 0xda, 0xfb, 0x70, 0xf6, 0xc9, 0x47, 0x87, 0x3a, 0xaa, 0x88, 0x00, + 0xf1, 0xa7, 0xf7, 0xe1, 0xf5, 0x2c, 0x54, 0x0e, 0x33, 0xda, 0xbe, 0x9c, + 0x66, 0x30, 0xd9, 0x40, 0xeb, 0x1d, 0xce, 0xe1, 0x55, 0x15, 0x2b, 0x11, + 0x47, 0x6c, 0x7e, 0x88, 0xc6, 0x24, 0xcf, 0x87, 0x1b, 0xb5, 0x1f, 0x47, + 0xb9, 0xef, 0xad, 0x29, 0xd3, 0x2e, 0x43, 0xee, 0x39, 0xdd, 0x09, 0x54, + 0xba, 0xfc, 0xed, 0xbc, 0x2e, 0x0e, 0x53, 0x15, 0x37, 0xcb, 0xc5, 0xf5, + 0xee, 0x70, 0x2a, 0xe8, 0x01, 0x6d, 0xb1, 0x39, 0x94, 0x5a, 0xc2, 0x8a, + 0x00, 0x04, 0xa9, 0xff, 0xea, 0x56, 0xf7, 0xd7, 0xa8, 0x1b, 0xa4, 0x26, + 0xcd, 0x28, 0xaf, 0xfa, 0x52, 0x85, 0x1c, 0x26, 0x3e, 0x5e, 0x01, 0xf7, + 0xe1, 0x66, 0xff, 0xac, 0xad, 0x9c, 0x98, 0x2f, 0xe0, 0x7e, 0x9f, 0xf1, + 0x33, 0x31, 0xc3, 0x7f, 0xe6, 0x58, 0x5d, 0xd8, 0x5f, 0x7d, 0x2b, 0x5a, + 0x55, 0xcf, 0xb1, 0x91, 0x53, 0x41, 0x04, 0xac, 0x86, 0x5e, 0x01, 0x35, + 0x2b, 0x74, 0x8d, 0x46, 0x4d, 0x48, 0xc0, 0x5f, 0x83, 0x67, 0xb5, 0x6d, + 0x52, 0x3f, 0x3e, 0xe6, 0xec, 0xf8, 0x2e, 0x10, 0x28, 0xdb, 0x69, 0xa6, + 0x9d, 0x4b, 0xde, 0x19, 0x2e, 0xd2, 0x5f, 0xc8, 0xa9, 0x3b, 0x52, 0xe9, + 0xb2, 0xcd, 0x6e, 0x19, 0x22, 0xf9, 0x99, 0xa6, 0xcc, 0xf5, 0xd3, 0xec, + 0xff, 0x0c, 0x77, 0x6f, 0x25, 0x92, 0x07, 0x4c, 0x64, 0x7d, 0x34, 0x49, + 0x6f, 0xff, 0x0a, 0xa8, 0x15, 0x64, 0x72, 0x2d, 0x4f, 0x42, 0x05, 0xe8, + 0x2b, 0x01, 0xf1, 0xe3, 0x65, 0x94, 0x23, 0xd9, 0xdf, 0x5e, 0x3b, 0xb5, + 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x7b, 0x30, 0x79, 0x30, 0x09, 0x06, + 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x2c, 0x06, 0x09, + 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x1f, 0x16, + 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x53, 0x4c, 0x20, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, + 0x0e, 0x04, 0x16, 0x04, 0x14, 0x8d, 0xb0, 0xee, 0x8f, 0x6b, 0x43, 0x52, + 0x29, 0xf4, 0x25, 0xff, 0x3c, 0xda, 0x5f, 0xb3, 0xce, 0x9b, 0x7b, 0x75, + 0xe1, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, + 0x80, 0x14, 0x1b, 0x8d, 0x06, 0xd9, 0x6b, 0xad, 0xee, 0x82, 0x24, 0x26, + 0x55, 0x9a, 0x1b, 0x03, 0x44, 0x92, 0x0a, 0x06, 0x92, 0x48, 0x30, 0x0d, + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, + 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x75, 0x83, 0x89, 0xab, 0x84, 0x52, + 0x5f, 0xa4, 0x9e, 0x98, 0xca, 0xa3, 0xf9, 0xab, 0xd4, 0x04, 0x32, 0xa4, + 0x8c, 0x96, 0x90, 0x39, 0x88, 0x92, 0xc3, 0xcd, 0x51, 0xc3, 0x01, 0x35, + 0x03, 0x78, 0xfa, 0x0d, 0x1e, 0x7b, 0x79, 0xe9, 0x7d, 0xd8, 0x68, 0x7a, + 0x65, 0xc6, 0x00, 0x7c, 0xa1, 0x7a, 0x52, 0xc9, 0xa3, 0xf4, 0x0b, 0xbd, + 0x76, 0x24, 0xdf, 0xde, 0x22, 0x2d, 0x95, 0xc5, 0xb6, 0x54, 0xb1, 0xac, + 0xb6, 0x9a, 0xe4, 0x68, 0x0f, 0x97, 0x4a, 0x44, 0xa2, 0x87, 0x01, 0x82, + 0xd4, 0x25, 0xbd, 0x01, 0xbc, 0x35, 0x8a, 0x6d, 0xb7, 0x7c, 0x48, 0xaa, + 0x92, 0xd7, 0x57, 0x76, 0x6a, 0xb0, 0xc9, 0x46, 0xa6, 0xbe, 0xbf, 0x0f, + 0xf0, 0xea, 0x62, 0x57, 0x71, 0x42, 0xf6, 0x67, 0xa7, 0xa1, 0x50, 0x87, + 0x14, 0x8e, 0x32, 0xd0, 0x5e, 0xc9, 0x7b, 0x79, 0x7e, 0xfa, 0x17, 0xc7, + 0xad, 0xbd, 0xc3, 0x98, 0x79, 0x45, 0xfb, 0x7f, 0xf7, 0xe6, 0x9f, 0x77, + 0xb3, 0x44, 0xc3, 0xaf, 0x6b, 0x61, 0x6a, 0x04, 0x68, 0x24, 0x2d, 0x31, + 0xf1, 0x28, 0x2c, 0xf4, 0xf0, 0x07, 0xfe, 0xfd, 0x66, 0x98, 0x77, 0x37, + 0x7b, 0x80, 0x1f, 0xb2, 0x49, 0xe4, 0xa6, 0x24, 0x72, 0x42, 0xf4, 0xca, + 0x91, 0x80, 0xa1, 0xb2, 0x0a, 0xc9, 0xc0, 0x93, 0xa7, 0x22, 0x0b, 0x13, + 0x8a, 0xb2, 0x75, 0x4b, 0x66, 0xf9, 0x87, 0x3a, 0x51, 0x97, 0xc7, 0x1e, + 0x2b, 0x61, 0x81, 0x5c, 0xf0, 0xf8, 0x4c, 0xdb, 0x36, 0xc7, 0xba, 0x49, + 0xd9, 0x04, 0x6a, 0x95, 0xb0, 0x7f, 0xfc, 0xce, 0xca, 0x23, 0xad, 0xf9, + 0xaf, 0x8a, 0x72, 0x8e, 0xab, 0xb8, 0x8b, 0x7e, 0xf7, 0x39, 0xa6, 0x22, + 0x56, 0x03, 0x72, 0x06, 0xc3, 0x57, 0x1f, 0x32, 0xaa, 0xb5, 0xa6, 0x00, + 0x67, 0x88, 0x4b, 0x40, 0xe9, 0x5e, 0x4a, 0x6f, 0x76, 0xe8 +}; +static unsigned int test_device_cert_der_len = 982; + +static unsigned char test_device_cert_key_der[] = { + 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, + 0xae, 0x03, 0x2c, 0xec, 0xa2, 0x79, 0xd1, 0x15, 0x20, 0x88, 0x4d, 0xcd, + 0xa2, 0x1b, 0x05, 0xe3, 0xbd, 0x55, 0xad, 0xc6, 0x1f, 0x64, 0xe8, 0xb5, + 0xc5, 0x0d, 0x67, 0xfc, 0x7e, 0xda, 0xfb, 0x70, 0xf6, 0xc9, 0x47, 0x87, + 0x3a, 0xaa, 0x88, 0x00, 0xf1, 0xa7, 0xf7, 0xe1, 0xf5, 0x2c, 0x54, 0x0e, + 0x33, 0xda, 0xbe, 0x9c, 0x66, 0x30, 0xd9, 0x40, 0xeb, 0x1d, 0xce, 0xe1, + 0x55, 0x15, 0x2b, 0x11, 0x47, 0x6c, 0x7e, 0x88, 0xc6, 0x24, 0xcf, 0x87, + 0x1b, 0xb5, 0x1f, 0x47, 0xb9, 0xef, 0xad, 0x29, 0xd3, 0x2e, 0x43, 0xee, + 0x39, 0xdd, 0x09, 0x54, 0xba, 0xfc, 0xed, 0xbc, 0x2e, 0x0e, 0x53, 0x15, + 0x37, 0xcb, 0xc5, 0xf5, 0xee, 0x70, 0x2a, 0xe8, 0x01, 0x6d, 0xb1, 0x39, + 0x94, 0x5a, 0xc2, 0x8a, 0x00, 0x04, 0xa9, 0xff, 0xea, 0x56, 0xf7, 0xd7, + 0xa8, 0x1b, 0xa4, 0x26, 0xcd, 0x28, 0xaf, 0xfa, 0x52, 0x85, 0x1c, 0x26, + 0x3e, 0x5e, 0x01, 0xf7, 0xe1, 0x66, 0xff, 0xac, 0xad, 0x9c, 0x98, 0x2f, + 0xe0, 0x7e, 0x9f, 0xf1, 0x33, 0x31, 0xc3, 0x7f, 0xe6, 0x58, 0x5d, 0xd8, + 0x5f, 0x7d, 0x2b, 0x5a, 0x55, 0xcf, 0xb1, 0x91, 0x53, 0x41, 0x04, 0xac, + 0x86, 0x5e, 0x01, 0x35, 0x2b, 0x74, 0x8d, 0x46, 0x4d, 0x48, 0xc0, 0x5f, + 0x83, 0x67, 0xb5, 0x6d, 0x52, 0x3f, 0x3e, 0xe6, 0xec, 0xf8, 0x2e, 0x10, + 0x28, 0xdb, 0x69, 0xa6, 0x9d, 0x4b, 0xde, 0x19, 0x2e, 0xd2, 0x5f, 0xc8, + 0xa9, 0x3b, 0x52, 0xe9, 0xb2, 0xcd, 0x6e, 0x19, 0x22, 0xf9, 0x99, 0xa6, + 0xcc, 0xf5, 0xd3, 0xec, 0xff, 0x0c, 0x77, 0x6f, 0x25, 0x92, 0x07, 0x4c, + 0x64, 0x7d, 0x34, 0x49, 0x6f, 0xff, 0x0a, 0xa8, 0x15, 0x64, 0x72, 0x2d, + 0x4f, 0x42, 0x05, 0xe8, 0x2b, 0x01, 0xf1, 0xe3, 0x65, 0x94, 0x23, 0xd9, + 0xdf, 0x5e, 0x3b, 0xb5, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, + 0x01, 0x00, 0xa5, 0x22, 0x2c, 0x52, 0xd0, 0x09, 0x4c, 0x4a, 0x81, 0x59, + 0xf8, 0x83, 0xa9, 0x4f, 0x7d, 0xb2, 0x56, 0xad, 0xe5, 0x3f, 0xfb, 0xf0, + 0xf6, 0x09, 0xf1, 0x5b, 0x3c, 0x90, 0x58, 0x0e, 0x15, 0xc9, 0x68, 0xd9, + 0x30, 0x40, 0xfb, 0x82, 0x73, 0x98, 0x79, 0xbb, 0xcd, 0xb8, 0x27, 0xc3, + 0x8e, 0x6c, 0xff, 0xf6, 0x99, 0x26, 0xb0, 0xaf, 0xb0, 0xac, 0x33, 0xb3, + 0x50, 0xed, 0x73, 0xa1, 0xa8, 0x02, 0x38, 0xc6, 0x93, 0xf9, 0xd6, 0x17, + 0x7e, 0xbd, 0x97, 0xa4, 0xb5, 0x6f, 0x8a, 0xdb, 0x11, 0x78, 0x7c, 0x89, + 0x0e, 0x3c, 0x17, 0xbb, 0x54, 0x2c, 0x8d, 0x5a, 0x93, 0x7d, 0x1e, 0x33, + 0xc7, 0xd2, 0x7d, 0xe5, 0xaa, 0x12, 0x2d, 0xd9, 0x52, 0x4e, 0x63, 0x74, + 0xa6, 0x57, 0x9f, 0x1a, 0xd6, 0x3c, 0xc1, 0xb1, 0xab, 0x66, 0x4a, 0x0b, + 0x88, 0x1d, 0xa6, 0xd1, 0xbc, 0x60, 0x7a, 0x17, 0x1f, 0x8f, 0x9b, 0x35, + 0x57, 0xf8, 0xd0, 0x1c, 0xd3, 0xa6, 0x56, 0xc8, 0x03, 0x9c, 0x08, 0x3b, + 0x1b, 0x5b, 0xc2, 0x03, 0x3b, 0x3a, 0xa4, 0xe8, 0xed, 0x75, 0x66, 0xb0, + 0x85, 0x56, 0x40, 0xfe, 0xae, 0x97, 0x7e, 0xc0, 0x79, 0x49, 0x13, 0x8b, + 0x01, 0x0c, 0xae, 0x4c, 0x3d, 0x54, 0x47, 0xc5, 0x51, 0x40, 0x3d, 0xcc, + 0x4d, 0x17, 0xb3, 0x4e, 0x1d, 0x85, 0x1c, 0x41, 0x07, 0x03, 0x5e, 0xf9, + 0xfa, 0x17, 0x81, 0x24, 0x34, 0xaa, 0xbf, 0x67, 0x73, 0xb6, 0x9c, 0x67, + 0x36, 0xd9, 0xee, 0xf7, 0x86, 0x4c, 0x4d, 0x79, 0xca, 0xd7, 0xfd, 0x72, + 0xf9, 0xb3, 0x73, 0xc3, 0x57, 0xe5, 0x39, 0x72, 0x93, 0x56, 0xc2, 0xec, + 0xf8, 0x25, 0xe4, 0x8f, 0xba, 0xd0, 0x6f, 0x23, 0x8c, 0x39, 0x9e, 0x05, + 0x1a, 0x4e, 0xdc, 0x5e, 0xcd, 0x17, 0x59, 0x94, 0x37, 0x22, 0xb7, 0x39, + 0x50, 0x65, 0xdc, 0x91, 0x3c, 0xe1, 0x02, 0x81, 0x81, 0x00, 0xe4, 0xc6, + 0x42, 0xe5, 0xea, 0xe5, 0x32, 0xf3, 0x51, 0x36, 0x7b, 0x8c, 0x5b, 0x72, + 0x24, 0x1a, 0x4a, 0x44, 0x4f, 0x64, 0xe5, 0xa7, 0x74, 0xd9, 0xb2, 0x29, + 0x8a, 0x08, 0xcf, 0x9b, 0xd2, 0x9d, 0xc4, 0x20, 0x4c, 0xd3, 0x60, 0x4d, + 0xf7, 0xb7, 0xac, 0x92, 0x6b, 0x2b, 0x95, 0x73, 0x6e, 0x57, 0x00, 0x20, + 0x9d, 0xb2, 0xf6, 0xbd, 0x0b, 0xbb, 0xaa, 0x7e, 0x7e, 0x3e, 0x53, 0xfb, + 0x79, 0x7e, 0x45, 0xd5, 0x2e, 0xab, 0x5e, 0xff, 0x5c, 0x0a, 0x45, 0x2d, + 0x27, 0x19, 0xb0, 0x59, 0x0a, 0x39, 0x89, 0xf6, 0xae, 0xc6, 0xe2, 0xd1, + 0x07, 0x58, 0xbe, 0x95, 0x27, 0xaf, 0xf7, 0xa6, 0x2f, 0xaa, 0x37, 0x25, + 0x7c, 0x7b, 0xd3, 0xda, 0x13, 0x76, 0x0a, 0xb6, 0x6c, 0x99, 0x53, 0x5d, + 0xa5, 0x75, 0xfa, 0x10, 0x9b, 0x7f, 0xfe, 0xd7, 0xb4, 0x18, 0x95, 0xa8, + 0x65, 0x85, 0x07, 0xc5, 0xc4, 0xad, 0x02, 0x81, 0x81, 0x00, 0xc2, 0xb8, + 0x8e, 0xed, 0x9d, 0x4a, 0x1f, 0x9c, 0xda, 0x73, 0xf0, 0x2c, 0x35, 0x91, + 0xe4, 0x40, 0x78, 0xe1, 0x12, 0xf3, 0x08, 0xef, 0xdf, 0x97, 0xa0, 0xb0, + 0xdd, 0xea, 0xc2, 0xb9, 0x5b, 0xf8, 0xa1, 0xac, 0x32, 0xfd, 0xb8, 0xe9, + 0x0f, 0xed, 0xfd, 0xe0, 0xdc, 0x38, 0x90, 0x5e, 0xf5, 0x4c, 0x02, 0xc3, + 0x1a, 0x72, 0x18, 0xf7, 0xfe, 0xb7, 0xb8, 0x2a, 0xf8, 0x72, 0xbb, 0x99, + 0x56, 0xec, 0x85, 0x58, 0x31, 0x7e, 0x64, 0xdf, 0x02, 0x05, 0xe3, 0xb2, + 0xbb, 0xe2, 0x1b, 0xd6, 0x43, 0x73, 0xf8, 0x0f, 0xaf, 0x89, 0x57, 0x44, + 0x5f, 0x30, 0x1c, 0xe5, 0x78, 0xbf, 0x0b, 0xe7, 0x4b, 0xbe, 0x80, 0x2f, + 0x3d, 0x35, 0x44, 0xfc, 0x9e, 0x0d, 0x85, 0x5d, 0x94, 0x6e, 0xe9, 0x6a, + 0x72, 0xa7, 0x46, 0xd8, 0x64, 0x6c, 0xe9, 0x61, 0x92, 0xa0, 0xb6, 0xd1, + 0xee, 0xa6, 0xa6, 0xf4, 0x2c, 0x29, 0x02, 0x81, 0x81, 0x00, 0xb4, 0xa7, + 0x7b, 0x1c, 0x64, 0x29, 0x29, 0xda, 0xca, 0x3e, 0xe3, 0xc1, 0x2a, 0x55, + 0x2f, 0xfd, 0x32, 0xb8, 0x4e, 0x99, 0xb6, 0x60, 0x4d, 0xfd, 0xba, 0x9a, + 0xe2, 0xcd, 0xa2, 0x63, 0xc2, 0x25, 0xa3, 0x42, 0x7e, 0x68, 0x4c, 0x9c, + 0x45, 0x09, 0x5d, 0xd5, 0x21, 0x9c, 0x01, 0x20, 0x6d, 0xf9, 0x75, 0xb8, + 0x4b, 0xcf, 0x8e, 0xd8, 0x29, 0xf3, 0xbf, 0xe6, 0xb3, 0x7a, 0x34, 0x87, + 0x58, 0xa1, 0x46, 0x33, 0xd9, 0xee, 0xa9, 0xcd, 0xac, 0xb8, 0xcf, 0x77, + 0xa0, 0x70, 0xc0, 0xb9, 0x0f, 0x41, 0xf0, 0x98, 0x43, 0xdb, 0xfa, 0x30, + 0x66, 0x44, 0xc5, 0xfa, 0xb2, 0xa4, 0x5a, 0x43, 0x79, 0x50, 0x48, 0xcb, + 0xe9, 0x49, 0x3f, 0x39, 0xee, 0x34, 0x40, 0xb1, 0x5d, 0x80, 0x96, 0x3c, + 0x54, 0xf4, 0x9c, 0xcb, 0x90, 0x7f, 0xba, 0x96, 0x4b, 0x39, 0x3e, 0xb5, + 0x03, 0xb5, 0xd1, 0x35, 0x72, 0xe1, 0x02, 0x81, 0x80, 0x60, 0x14, 0xd5, + 0x61, 0xe6, 0x24, 0xf7, 0x28, 0x5c, 0x9a, 0xac, 0xbe, 0x03, 0xc8, 0xf3, + 0x49, 0xe4, 0xdb, 0x9a, 0x90, 0x15, 0xae, 0xd7, 0x33, 0x68, 0x75, 0x1d, + 0x6b, 0x83, 0x9e, 0x17, 0x05, 0xbe, 0x30, 0xcc, 0x10, 0x6a, 0x37, 0x86, + 0x46, 0xb6, 0xe9, 0x47, 0x81, 0x19, 0xab, 0xe1, 0x7a, 0x1a, 0x3a, 0xcf, + 0x47, 0xd1, 0x8e, 0x3d, 0x3f, 0xc6, 0x3e, 0x5d, 0xcd, 0xaf, 0x47, 0xe0, + 0x9e, 0x60, 0xc5, 0xbd, 0xd6, 0x52, 0x4b, 0xc0, 0x21, 0xcb, 0xd3, 0x1b, + 0xe6, 0x5c, 0x3a, 0x03, 0x9a, 0xab, 0xa2, 0x81, 0xc9, 0x51, 0x28, 0x49, + 0x97, 0xe2, 0x0a, 0x50, 0xe4, 0x64, 0x29, 0x43, 0x34, 0xc2, 0xe7, 0x8c, + 0x5a, 0x46, 0xaa, 0x28, 0x0b, 0x1f, 0xed, 0xa7, 0x1a, 0x7b, 0x4e, 0xad, + 0x38, 0x61, 0x3a, 0xd1, 0x82, 0xf4, 0x3d, 0xd3, 0x2e, 0x3e, 0x47, 0xa4, + 0x6c, 0xd3, 0x20, 0xd4, 0xd1, 0x02, 0x81, 0x80, 0x68, 0x1a, 0x8d, 0x3c, + 0x18, 0x3f, 0x42, 0x5e, 0x38, 0x6d, 0x0a, 0x1e, 0x52, 0xd5, 0x8f, 0xd6, + 0x32, 0xff, 0x7c, 0x1c, 0xf3, 0x20, 0x8b, 0x92, 0xa5, 0x44, 0xff, 0x08, + 0x21, 0xa1, 0xce, 0x68, 0x8b, 0x03, 0xe0, 0x90, 0xeb, 0x01, 0x4e, 0x85, + 0xf9, 0xc5, 0xb7, 0x86, 0xee, 0xd0, 0x59, 0x10, 0x73, 0x98, 0x2a, 0xcb, + 0xf6, 0xfe, 0x0d, 0xba, 0x07, 0x91, 0x18, 0xf6, 0xbc, 0x93, 0x8a, 0x91, + 0xdd, 0x80, 0x16, 0x37, 0xdf, 0x75, 0x46, 0x87, 0x68, 0xee, 0xf4, 0x76, + 0x0c, 0xc5, 0x87, 0x38, 0xf5, 0xb6, 0xda, 0x8a, 0xee, 0x62, 0xc8, 0xc0, + 0xa2, 0x8d, 0xbf, 0xd5, 0xf8, 0xba, 0xb5, 0x74, 0xf0, 0x07, 0xa6, 0x1c, + 0xcf, 0x76, 0x61, 0xbe, 0xa4, 0x88, 0x4a, 0x95, 0xb0, 0xa3, 0x70, 0x73, + 0xa1, 0x6f, 0x73, 0xf0, 0xe8, 0x38, 0x8d, 0xe8, 0xd0, 0x7e, 0x2c, 0x0c, + 0xdc, 0x21, 0xfa, 0xc1 +}; + +static unsigned int test_device_cert_key_der_len = 1192; diff --git a/test/regression/web_test/test_utility.h b/test/regression/web_test/test_utility.h new file mode 100644 index 00000000..c5cdbb92 --- /dev/null +++ b/test/regression/web_test/test_utility.h @@ -0,0 +1,53 @@ +#ifndef __TEST_UTILITY_H +#define __TEST_UTILITY_H + +extern void test_control_return(UINT status); + +// Utility function to print buffer +static void print_buffer(const UCHAR* buf, ULONG size) +{ +UINT i; + printf("Buffer of size: %ld. Data:\n", size); + if(buf) + { + for(i = 0; i < size; ++i) + { + printf("%02x ", (UINT)buf[i]); + if((i+1) % 8 == 0) + { + printf("\n"); + } + } + } + else + { + printf("NULL buffer passed as number\n"); + } + printf("\n"); +} + + +UINT _txe_mutex_get(TX_MUTEX *mutex_ptr, ULONG wait_option); +UINT _txe_mutex_put(TX_MUTEX *mutex_ptr); + + +#define TEST(prefix, name) void prefix ## _ ##name() +#define EXPECT_EQ(expected, actual) \ + if(expected != actual) \ + { \ + printf("\nERROR! File: %s Line: %d\n", __FILE__, __LINE__); \ + printf("Expected: 0x%x, (%d) Got: 0x%x (%d)\n", expected, expected, actual, actual); \ + test_control_return(1); \ + } + +#define EXPECT_TRUE(statement) \ + if(!statement) \ + { \ + printf("\nERROR! File: %s Line: %d\n", __FILE__, __LINE__); \ + printf("Expected statement to be true!\n"); \ + test_control_return(1); \ + } + + + +#endif diff --git a/test/regression/websocket_test/netx_websocket_16_bit_payload_length_test.c b/test/regression/websocket_test/netx_websocket_16_bit_payload_length_test.c new file mode 100644 index 00000000..3ae2b047 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_16_bit_payload_length_test.c @@ -0,0 +1,626 @@ +/* This case tests websocket process data ability when the frame is with 16-bit payload length. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_16_bit_normal_frame[] = +{ +0x82, 0x7E, 0x01, 0x00, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +}; + +/* Below 3 packets compose one complete frame */ +static UCHAR server_response_frame_packet_1[] = //Fragmented: beginning frame +{ +0x02, 0x7E, 0x01, +}; + +static UCHAR server_response_frame_packet_2[] = +{ +0x00, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, // End of the beginning frame +0x00, 0x7E, 0x02, 0x20, // Begin of the continuation frame +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +}; + +static UCHAR server_response_frame_packet_3[] = +{ +0x80, 0x04, 0x01, 0x02, 0x03, 0x04, // Fragmented: termination frame +0x8A, 0x02, 0x00, 0x00, // A PONG frame which shall be filtered +0x82, 0x7E, 0x01, 0x40, // A single 16-bit frame +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_16_bit_payload_length_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1460, NX_NULL, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* ---- Normal frame test ---- */ + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) || (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr -> nx_packet_length != 256) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 256; i++) + { + if (*(packet_ptr -> nx_packet_prepend_ptr + i) != (i % 32)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr); + + /* ---- Fragemented frames in multi-packets test ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr1 -> nx_packet_append_ptr = packet_ptr1 -> nx_packet_prepend_ptr; + packet_ptr1 -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary beginning frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) && (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 256) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 256; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i % 32)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr1); + + /* Receive the responsed binary continuation frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) && (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 544) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 544; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i % 32)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr1); + + /* Receive the responsed binary termination frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) && (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i + 1)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr1); + + /* The responsed PONG frame returns NX_NO_PACKET */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_NO_PACKET) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 320) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 320; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i % 32)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr1); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket 16-bit Payload Length Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1460, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_16_bit_normal_frame, sizeof(server_response_16_bit_normal_frame), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_frame_packet_1, sizeof(server_response_frame_packet_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_frame_packet_2, sizeof(server_response_frame_packet_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_frame_packet_3, sizeof(server_response_frame_packet_3), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_16_bit_payload_length_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket 16-bit Payload Length Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_common_process.c b/test/regression/websocket_test/netx_websocket_common_process.c new file mode 100644 index 00000000..7a902510 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_common_process.c @@ -0,0 +1,155 @@ +/* This file contains common process functions. */ +#include "tx_api.h" +#include "nx_api.h" + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" + +#define TEST_CONNECT_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" +#define TEST_CONNECT_GUID_SIZE (sizeof(TEST_CONNECT_GUID) - 1) +#define TEST_CONNECT_DIGEST_SIZE 20 /* The length of SHA-1 hash is 20 bytes */ +#define TEST_CONNECT_KEY_SIZE 32 /* Make it larger than the minimum length (28 bytes )for the encoded key */ + +static UCHAR connect_key[TEST_CONNECT_KEY_SIZE]; +static UINT connect_key_size; + +UINT _server_connect_response_process(NX_PACKET *packet_ptr) +{ +UCHAR *buffer_ptr; +UINT offset = 0; +UCHAR *field_name; +UINT field_name_length; +UCHAR *field_value; +UINT field_value_length; +NX_SHA1 SH; +UCHAR digest[TEST_CONNECT_DIGEST_SIZE]; + + buffer_ptr = packet_ptr -> nx_packet_prepend_ptr; + + /* Skip over the first Command line (GET /xxx HTTP/1.1\r\n). */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && + (*buffer_ptr != '\r') && (*(buffer_ptr + 1) != '\n')) + { + buffer_ptr++; + offset++; + } + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Skip over the first Host line (Host: xxx\r\n). */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && + (*buffer_ptr != '\r') && (*(buffer_ptr + 1) != '\n')) + { + buffer_ptr++; + offset++; + } + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Loop until we find the "cr,lf,cr,lf" token. */ + while (((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != 0)) + { + + /* Check for the token. This signals a blank line, which also + specifies the start of the content. */ + if ((*buffer_ptr == '\r') && + (*(buffer_ptr + 1) == '\n')) + { + + /* Adjust the offset. */ + offset = offset + 2; + break; + } + + /* We haven't seen the so we are still processing header data. + Extract the field name and it's value. */ + field_name = buffer_ptr; + field_name_length = 0; + + /* Look for the ':' that separates the field name from its value. */ + while(*buffer_ptr != ':') + { + buffer_ptr++; + field_name_length++; + } + offset += field_name_length; + + /* Skip ':'. */ + buffer_ptr++; + offset++; + + /* Now skip over white space. */ + while ((buffer_ptr < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr == ' ')) + { + buffer_ptr++; + offset++; + } + + /* Now get the field value. */ + field_value = buffer_ptr; + field_value_length = 0; + + /* Loop until we see a . */ + while(((buffer_ptr + 1) < packet_ptr -> nx_packet_append_ptr) && (*buffer_ptr != '\r') && (*(buffer_ptr+1) != '\n')) + { + buffer_ptr++; + field_value_length++; + } + offset += field_value_length; + + /* Skip over the CR,LF. */ + buffer_ptr += 2; + offset += 2; + + /* Check the upgrade. */ + if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Upgrade", sizeof("Upgrade") - 1) == NX_SUCCESS) + { + if (_nx_websocket_client_name_compare((UCHAR *)field_value, field_value_length, (UCHAR *)"websocket", sizeof("websocket") - 1)) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + } + else if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Connection", sizeof("Connection") - 1) == NX_SUCCESS) + { + if (_nx_websocket_client_name_compare((UCHAR *)field_value, field_value_length, (UCHAR *)"Upgrade", sizeof("Upgrade") - 1)) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + } + else if (_nx_websocket_client_name_compare((UCHAR *)field_name, field_name_length, (UCHAR *)"Sec-WebSocket-Key", sizeof("Sec-WebSocket-Key") - 1) == NX_SUCCESS) + { + + /* Calculate the SHA-1 hash of the concatenation of the client key and the Globally Unique Identifier (GUID) + Referenced in RFC 6455, Section 1.3, Page 6 */ + _nx_sha1_initialize(&SH); + _nx_sha1_update(&SH, field_value, field_value_length); + _nx_sha1_update(&SH, (UCHAR*)TEST_CONNECT_GUID, TEST_CONNECT_GUID_SIZE); + _nx_sha1_digest_calculate(&SH, digest); + + /* Encode the hash and compare it with the field value from the server. */ + _nx_utility_base64_encode(digest, TEST_CONNECT_DIGEST_SIZE, connect_key, TEST_CONNECT_KEY_SIZE, &connect_key_size); + } + } + + /* Check if the all fields are processed. */ + if (offset != packet_ptr -> nx_packet_length) + { + return(NX_WEBSOCKET_INVALID_PACKET); + } + + return(NX_SUCCESS); +} + +#endif + +void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number) +{ + *error_counter = (*error_counter) + 1; + + printf("Error: File %s:%d\n", filename, line_number); +} + diff --git a/test/regression/websocket_test/netx_websocket_connect_test.c b/test/regression/websocket_test/netx_websocket_connect_test.c new file mode 100644 index 00000000..59619e98 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_connect_test.c @@ -0,0 +1,570 @@ +/* This case tests websocket connect corresponding logic, especially focusing on testing secure connect feature */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_client_session; +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#endif /* NX_SECURE_ENABLE */ + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR bad_server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, //0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_connect_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NX_SECURE_TLS_SESSION* tls_session) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif /* NX_SECURE_ENABLE */ + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + /* The first time is to test whether the bad response from server will be checked and found */ + if (status != NX_WEBSOCKET_INVALID_PACKET || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_websocket_client_delete(&client_websocket); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Re-create WebSocket for secure test. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + client_tls_setup(&tls_client_session); + + status = nx_secure_tls_session_start(&tls_client_session, &test_client, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_secure_connect(&client_websocket, &tls_client_session, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_secure_tls_packet_allocate(&tls_client_session, &client_pool, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Append client test data. */ + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_secure_tls_session_send(&tls_client_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_secure_tls_session_receive(&tls_client_session, &packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + } + + nx_websocket_client_delete(&client_websocket); + if (client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* End session. */ + nx_secure_tls_session_delete(&tls_client_session); + +#endif + + /* TCP Disconnect. */ + status = nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Connect Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Bad server response test */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, bad_server_switch_101, sizeof(bad_server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /* ---- Insecure websocket connect test ---- */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /* ---- Secure websocket connect test ---- */ + +#ifdef NX_SECURE_ENABLE + + status = nx_secure_tls_session_start(&tls_server_session, &test_server, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + tx_thread_sleep(1); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + nx_packet_release(packet_ptr); + + status = nx_secure_tls_packet_allocate(&tls_server_session, &server_pool, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Append response 101. */ + status = nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive client data. */ + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + /* Send a response */ + status = nx_secure_tls_packet_allocate(&tls_server_session, &server_pool, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&test_server); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_connect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Connect Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_delete_test.c b/test/regression/websocket_test/netx_websocket_delete_test.c new file mode 100644 index 00000000..a5be9cd6 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_delete_test.c @@ -0,0 +1,395 @@ +/* This case tests websocket delete corresponding logic. Also pay attention +on the influence brought by the disconnecting state on other functions */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, // The second frame will be on the processing packet list +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 2 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_delete_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* This test is significant only when is error checking is enabled */ +#ifndef NX_DISABLE_ERROR_CHECKING + status = nx_websocket_client_delete(&client_websocket); + if (status != NX_PTR_ERROR || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +#endif /* NX_DISABLE_ERROR_CHECKING */ + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Only receive and parse the first frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + + /* Test the delete function which shall clean up unused resources */ + status = nx_websocket_client_delete(&client_websocket); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The waiting list shall be empty after calling delete */ + if (client_websocket.nx_websocket_client_processing_packet != NX_NULL) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Delete Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response, sizeof(server_response), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_delete_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Delete Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_disconnect_test.c b/test/regression/websocket_test/netx_websocket_disconnect_test.c new file mode 100644 index 00000000..449407c2 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_disconnect_test.c @@ -0,0 +1,430 @@ +/* This case tests websocket disconnect corresponding logic, mainly focusing on the influence +brought by the disconnect state which may hinder other functions such as send/receive */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR server_response_2[] = +{ +0x88, 0x00, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_disconnect_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* The disconnect shall fail since is succeed only when the state is connected */ + status = nx_websocket_client_disconnect(&client_websocket, 0); + if (status != NX_WEBSOCKET_INVALID_STATE || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The first response from the server shall be an unfragmented frame */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + + /* Test normal disconnect which shall return success */ + status = nx_websocket_client_disconnect(&client_websocket, 0); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (client_websocket.nx_websocket_client_state != NX_WEBSOCKET_CLIENT_STATE_DISCONNECT_SENT) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status != NX_WEBSOCKET_DISCONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (client_websocket.nx_websocket_client_state != NX_WEBSOCKET_CLIENT_STATE_IDLE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Re-disconnect shall fail */ + status = nx_websocket_client_disconnect(&client_websocket, 0); + if (status != NX_WEBSOCKET_INVALID_STATE || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Send data shall be fine */ + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status != NX_WEBSOCKET_NOT_CONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nx_packet_release(packet_ptr); + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Disconnect Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_2, sizeof(server_response_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_disconnect_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Disconnect Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_fin_test.c b/test/regression/websocket_test/netx_websocket_fin_test.c new file mode 100644 index 00000000..82dadf7c --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_fin_test.c @@ -0,0 +1,466 @@ +/* This case tests websocket fin bit. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR server_response_2_1[] = +{ +0x02, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: false +}; + +static UCHAR server_response_2_2[] = +{ +0x00, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: false +}; + +static UCHAR server_response_2_3[] = +{ +0x80, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: true +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_fin_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + error_counter++; + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + error_counter++; + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + error_counter++; + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + error_counter++; + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + error_counter++; + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + error_counter++; +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if(status) + error_counter++; + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + error_counter++; + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if(status) + error_counter++; + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* ---- Unfragment frame test ---- */ + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + /* The first response from the server shall be an unfragmented frame */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) + error_counter++; + + nx_packet_release(packet_ptr); + + /* ---- Fragment frames test ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + /* Append and send data. */ + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if(status) + error_counter++; + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + /* The second response from the server shall be the beginning frame of fragmented frames */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) + error_counter++; + + nx_packet_release(packet_ptr1); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + /* The third response from the server shall be the continuation frame of fragmented frames */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) + error_counter++; + + nx_packet_release(packet_ptr1); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + /* The fourth response from the server shall be the termination frame of fragmented frames */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) + error_counter++; + + nx_packet_release(packet_ptr1); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +static + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Fin Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + error_counter++; + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_2_1, sizeof(server_response_2_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + nx_packet_data_append(packet_ptr, server_response_2_2, sizeof(server_response_2_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + nx_packet_data_append(packet_ptr, server_response_2_3, sizeof(server_response_2_3), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + error_counter++; + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + error_counter++; + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + error_counter++; + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_fin_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Fin Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_mask_test.c b/test/regression/websocket_test/netx_websocket_mask_test.c new file mode 100644 index 00000000..dadbe8ec --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_mask_test.c @@ -0,0 +1,461 @@ +/* This case tests websocket mask feature. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + +static NX_WEBSOCKET_CLIENT server_websocket; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x81, 0x84, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04 // Opcode: text +}; + +static UCHAR server_response_2_1[] = +{ +0x02, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: false; Opcode: binary +}; + +static UCHAR server_response_2_2[] = +{ +0x80, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: false; Opcode: binary +}; + +static UCHAR server_response_3[] = +{ +0x88, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: true; Opcode: close connection +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_mask_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* ---- Unfragment frame test ---- */ + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, 500); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The first response from the server shall be an unfragmented frame with opcode text frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) || (code != NX_WEBSOCKET_OPCODE_TEXT_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr); + + /* ---- Fragment frames test ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 500); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The second response from the server shall be the beginning frame of fragmented frames with opcode binary frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) || (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr1); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 500); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The third response from the server shall be the termination frame of fragmented frames */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr1); + + /* The fourth response from the server shall be opcode with close connection */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 500); + if (status != NX_WEBSOCKET_DISCONNECTED) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +UINT op_code; + + /* Print out test information banner. */ + printf("NetX Test: Websocket Mask Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_2_1, sizeof(server_response_2_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_2_2, sizeof(server_response_2_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_3, sizeof(server_response_3), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_mask_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Mask Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_multi_instance_test.c b/test/regression/websocket_test/netx_websocket_multi_instance_test.c new file mode 100644 index 00000000..6641ad84 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_multi_instance_test.c @@ -0,0 +1,621 @@ +/* This case tests the condition when multi websocket instances are working at the same time. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +/* ---- Variables for the first instance ---- */ +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, // The second frame will be on the processing packet list +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +/* ---- Variables for the second instance ---- */ +static UINT test1_done = NX_FALSE; + +static TX_THREAD client1_thread; +static NX_TCP_SOCKET test_client1; + +static NX_TCP_SOCKET test_server1; +static TX_THREAD server1_thread; +static UINT test_server1_start = 0; +static UINT test_client1_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client1_websocket; +static UCHAR *client1_websocket_host; +static UINT client1_websocket_host_length; +static UCHAR *client1_websocket_uri_path; +static UINT client1_websocket_uri_path_length; + +static void thread_client1_entry(ULONG thread_input); +static void thread_server1_entry(ULONG thread_input); + +#define TEST_CLIENT1_ADDRESS IP_ADDRESS(1,2,3,6) +#define TEST_SERVER1_PORT 81 + +#define TEST1_HOST_NAME "1.2.3.5" +#define TEST1_URI_PATH "/test" +#define TEST1_PROTOCOL "test" + +static UCHAR server1_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server1_response[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, // The second frame will be on the processing packet list +}; + +static UCHAR client1_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; +static ULONG error1_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 2 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_multi_instance_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + error1_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Create a helper thread for the server1. */ + tx_thread_create(&server1_thread, "Test Server1 thread", thread_server1_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 10); + pointer = pointer + PACKET_SIZE * 10; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client1 thread. */ + status = tx_thread_create(&client1_thread, "Test Client1", thread_client1_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 10); + pointer = pointer + PACKET_SIZE * 10; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Only receive and parse the first frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, 5 * NX_IP_PERIODIC_RATE); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + nx_websocket_client_delete(&client_websocket); + if (client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Multi-instance Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response, sizeof(server_response), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE || test1_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (error_counter || error1_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +void thread_client1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client1, "Client1 Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client1_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status || client1_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client1, TEST_SERVER1_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server1_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client1, &server_ip_address, TEST_SERVER1_PORT, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client1_websocket, &test_client1, + TEST1_HOST_NAME, sizeof(TEST1_HOST_NAME) - 1, + (UCHAR *)TEST1_URI_PATH, sizeof(TEST1_URI_PATH) - 1, + (UCHAR *)TEST1_PROTOCOL, sizeof(TEST1_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status || client1_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + /* Append and send data. */ + status = nx_packet_data_append(packet_ptr, client1_test_data, sizeof(client1_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client1_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status || client1_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + /* Only receive and parse the first frame from server. */ + status = nx_websocket_client_receive(&client1_websocket, &packet_ptr, &code, 5 * NX_IP_PERIODIC_RATE); + if (status || client1_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + if (packet_ptr -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + } + + nx_tcp_client_socket_unbind(&test_client1); + nx_tcp_socket_delete(&test_client1); + + nx_websocket_client_delete(&client1_websocket); + if (client1_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error1_counter, __FILE__, __LINE__); + + test1_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server1_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server1, "Test Server1 Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER1_PORT, &test_server1, 5, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server1_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server1, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server1, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server1_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server1_switch_101, sizeof(server1_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server1, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server1_response, sizeof(server1_response), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server1, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test1_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER1_PORT); + nx_tcp_socket_delete(&test_server1); +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_multi_instance_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Multi-instance Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_non_block_test.c b/test/regression/websocket_test/netx_websocket_non_block_test.c new file mode 100644 index 00000000..5e93ffab --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_non_block_test.c @@ -0,0 +1,622 @@ +/* This case test websocket in non-blocking mode. */ + +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT status); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; +static UINT tcp_received = NX_FALSE; +static UINT connect_succeed = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + +#ifdef NX_SECURE_ENABLE + +#include "../web_test/test_device_cert.c" +#include "../web_test/test_ca_cert.c" + +/* Declare external cryptosuites. */ +extern const NX_SECURE_TLS_CRYPTO nx_crypto_tls_ciphers; + +static NX_SECURE_TLS_SESSION tls_client_session; +static NX_SECURE_TLS_SESSION tls_server_session; +static NX_SECURE_X509_CERT server_local_certificate; + +/* Define crypto metadata buffer. */ +static UCHAR client_metadata[5*4096]; +static UCHAR server_metadata[5*4096]; + +/* For remote certificate. */ +static NX_SECURE_X509_CERT remote_certificate, remote_issuer, ca_certificate; +static UCHAR remote_cert_buffer[2000]; +static UCHAR remote_issuer_buffer[2000]; +static UCHAR tls_packet_buffer[2][4096]; + +#endif /* NX_SECURE_ENABLE */ + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_non_block_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +#ifdef NX_SECURE_ENABLE + +/* Define the callback function for tls connection. */ +static UINT client_tls_setup(NX_SECURE_TLS_SESSION* tls_session) +{ +UINT status; + + /* Create a tls session. */ + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + client_metadata, + sizeof(client_metadata)); + + if (status) + { + return status; + } + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[0], sizeof(tls_packet_buffer[0])); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_certificate, remote_cert_buffer, sizeof(remote_cert_buffer)); + nx_secure_tls_remote_certificate_allocate(tls_session, &remote_issuer, remote_issuer_buffer, sizeof(remote_issuer_buffer)); + + nx_secure_x509_certificate_initialize(&ca_certificate, test_ca_cert_der, test_ca_cert_der_len, + NX_NULL, 0, NX_NULL, 0, NX_SECURE_X509_KEY_TYPE_NONE); + nx_secure_tls_trusted_certificate_add(tls_session, &ca_certificate); + + return(NX_SUCCESS); +} + +static UINT server_tls_setup(NX_SECURE_TLS_SESSION *tls_session) +{ +UINT status; + + status = nx_secure_tls_session_create(tls_session, + &nx_crypto_tls_ciphers, + server_metadata, + sizeof(server_metadata)); + if (status) + { + return status; + } + + memset(&server_local_certificate, 0, sizeof(server_local_certificate)); + nx_secure_x509_certificate_initialize(&server_local_certificate, + test_device_cert_der, test_device_cert_der_len, + NX_NULL, 0, test_device_cert_key_der, + test_device_cert_key_der_len, NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER); + + nx_secure_tls_local_certificate_add(tls_session, &server_local_certificate); + + nx_secure_tls_session_packet_buffer_set(tls_session, tls_packet_buffer[1], sizeof(tls_packet_buffer[1])); + + return(NX_SUCCESS); +} +#endif /* NX_SECURE_ENABLE */ + +static VOID connection_status_callback(NX_WEBSOCKET_CLIENT *websocket_client_ptr, VOID *context, UINT status) +{ + NX_PARAMETER_NOT_USED(websocket_client_ptr); + NX_PARAMETER_NOT_USED(context); + + if (status != NX_SUCCESS) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + connect_succeed = NX_TRUE; +} + +static VOID tcp_receive_callback(NX_TCP_SOCKET *socket_ptr) +{ + if (&test_client == socket_ptr) + { + tcp_received = NX_TRUE; + } +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the tcp receive callback. */ + nx_tcp_socket_receive_notify(&test_client, tcp_receive_callback); + + /* Set WebSocket client connect callback */ + nx_websocket_client_connection_status_callback_set(&client_websocket, NX_NULL, connection_status_callback); + if (client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_NO_WAIT); /* Set 0 to do non-blocking test */ + if (status != NX_IN_PROGRESS || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < 5; i++) + { + if (tcp_received == NX_TRUE) + { + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status == NX_SUCCESS) + { + if (connect_succeed == NX_FALSE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + break; + } + else + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } + if (i == 5 || connect_succeed == NX_FALSE || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_websocket_client_delete(&client_websocket); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + tcp_received = NX_FALSE; + connect_succeed = NX_FALSE; + + /* Re-create WebSocket for secure test. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set WebSocket client connect callback */ + nx_websocket_client_connection_status_callback_set(&client_websocket, NX_NULL, connection_status_callback); + if (client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + client_tls_setup(&tls_client_session); + + status = nx_secure_tls_session_start(&tls_client_session, &test_client, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_secure_connect(&client_websocket, &tls_client_session, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_NO_WAIT); + if (status != NX_IN_PROGRESS || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (UINT i = 0; i < 5; i++) + { + if (tcp_received == NX_TRUE) + { + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status == NX_SUCCESS) + { + if (connect_succeed == NX_FALSE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + break; + } + else + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } + if (i == 5 || connect_succeed == NX_FALSE || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + tcp_received = NX_FALSE; + + status = nx_secure_tls_packet_allocate(&tls_client_session, &client_pool, &packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Append client test data. */ + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_secure_tls_session_send(&tls_client_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive data */ + for (UINT i = 0; i < 5; i++) + { + if (tcp_received == NX_TRUE) + { + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if ((status == NX_SUCCESS) && (code == NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + { + break; + } + else + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + } + } + if (i == 5 || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr); + } + + nx_websocket_client_delete(&client_websocket); + if (client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* End session. */ + nx_secure_tls_session_delete(&tls_client_session); + +#endif + + /* TCP Disconnect. */ + status = nx_tcp_socket_disconnect(&test_client, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Non Block Test....................................."); + + /* Check for earlier error. */ + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + +#ifdef NX_SECURE_ENABLE + /* Session setup. */ + server_tls_setup(&tls_server_session); +#endif + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* ---- Insecure websocket connect test ---- */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + /* ---- Secure websocket connect test ---- */ + +#ifdef NX_SECURE_ENABLE + + status = nx_secure_tls_session_start(&tls_server_session, &test_server, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + nx_packet_release(packet_ptr); + + status = nx_secure_tls_packet_allocate(&tls_server_session, &server_pool, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Append response 101. */ + status = nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive client data. */ + status = nx_secure_tls_session_receive(&tls_server_session, &packet_ptr, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + /* Send a response */ + status = nx_secure_tls_packet_allocate(&tls_server_session, &server_pool, &packet_ptr, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_secure_tls_session_send(&tls_server_session, packet_ptr, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr); + + /* End session. */ + nx_secure_tls_session_end(&tls_server_session, NX_NO_WAIT); +#endif + + /* Disconnect. */ + status = nx_tcp_socket_disconnect(&test_server, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Unaccept the server socket. */ + status = nx_tcp_server_socket_unaccept(&test_server); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_non_block_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Non Block Test.............................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_one_frame_in_packets_test.c b/test/regression/websocket_test/netx_websocket_one_frame_in_packets_test.c new file mode 100644 index 00000000..5325323b --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_one_frame_in_packets_test.c @@ -0,0 +1,447 @@ +/* This case tests websocket process data ability when one websocket frame is composited by several TCP packets. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR server_response_2_1[] = +{ +0x82 +}; + +static UCHAR server_response_2_2[] = +{ +0x04, +}; + +static UCHAR server_response_2_3[] = +{ +0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_one_frame_in_packets_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* ---- Normal frame test ---- */ + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The first response from the server shall be an unfragmented frame */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr); + + /* ---- One frame in packets test ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr1 -> nx_packet_append_ptr = packet_ptr1 -> nx_packet_prepend_ptr; + packet_ptr1 -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_NO_WAIT); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr1); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket One Frame in Packets Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_2_1, sizeof(server_response_2_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_2_2, sizeof(server_response_2_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_2_3, sizeof(server_response_2_3), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_one_frame_in_packets_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket One Frame in Packets Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_one_packet_with_multi_frames_test.c b/test/regression/websocket_test/netx_websocket_one_packet_with_multi_frames_test.c new file mode 100644 index 00000000..ea865117 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_one_packet_with_multi_frames_test.c @@ -0,0 +1,893 @@ +/* This case tests websocket process data ability when one tcp/tls packet includes multi-frames. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +/* Test 0 purposes to test fragmented frames in 1 packet */ +static UCHAR server_response_one_packet_multi_frame[] = +{ +0x02, 0x04, 0x00, 0x01, 0x02, 0x03, // Fragmented: beginning frame +0x00, 0x04, 0x04, 0x05, 0x06, 0x07, // Fragmented: continuation frame +0x80, 0x04, 0x08, 0x09, 0x0A, 0x0B, // Fragmented: termination frame +}; + +/* Test 1 purposes to test 3 frame in 3 packets */ +static UCHAR server_response_frame_packet_1_1[] = +{ +0x82 +}; + +static UCHAR server_response_frame_packet_1_2[] = +{ +0x04, +}; + +static UCHAR server_response_frame_packet_1_3[] = +{ +0x01, 0x02, 0x03, 0x04, // Data payload for the binary frame +0x89, 0x02, 0x00, 0x00, // A PING frame +0x82, 0x04, 0x11, 0x22, 0x33, 0x44, +}; + +/* Test 3 purposes to test 1 frame in 2 packets */ +static UCHAR server_response_frame_packet_2_1[] = +{ +0x82, 0x04, 0x01, // 1 byte data payload in the first packet +}; + +static UCHAR server_response_frame_packet_2_2[] = +{ +0x02, 0x03, 0x04, // 3 bytes data payload in the second packet +}; + +/* Test 3 purposes to test 2 packets with 2 complete frames */ +static UCHAR server_response_frame_packet_3_1[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +static UCHAR server_response_frame_packet_3_2[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, +}; + +/* Test 4 purposes to test 3 packets with first frame in 2 packets */ +static UCHAR server_response_frame_packet_4_1[] = +{ +0x82, 0x02, 0x01, 0x02, // Frame 1 +}; + +static UCHAR server_response_frame_packet_4_2[] = +{ +0x82, 0x0A, 0x00, 0x01, // Frame 2 begin +}; + +static UCHAR server_response_frame_packet_4_3[] = +{ +0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, // Frame 2 end +0x82, 0x0A, 0x01, 0x02, // Frame 3 begin +}; + +static UCHAR server_response_frame_packet_4_4[] = +{ +0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, // Frame 3 end +}; + +static UCHAR server_response_frame_packet_4_5[] = +{ +0x82, 0x04, 0x01, 0x02, 0x03, 0x04, // Frame 4 +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 5 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_one_packet_with_multi_frames_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 10); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NX_PACKET *packet_ptr2; +NX_PACKET *packet_ptr3; +NX_PACKET *packet_ptr4; +NX_PACKET *packet_ptr5; +NX_PACKET *data_packet; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* ---- Test 0 ---- */ + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + + /* First frame in the packet */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, 5*NX_IP_PERIODIC_RATE); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The first response shall be the beginning frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) || (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr -> nx_packet_next || packet_ptr -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr -> nx_packet_prepend_ptr + i) != i) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + nx_packet_release(packet_ptr); + + /* Second frame in the packet */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The second frame shall be the continuation frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) || (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr -> nx_packet_next || packet_ptr -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr -> nx_packet_prepend_ptr + i) != (i + 4)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + nx_packet_release(packet_ptr); + + /* Third frame in the packet */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, NX_NO_WAIT); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The third frame shall be the termination frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) || (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr -> nx_packet_next || packet_ptr -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr -> nx_packet_prepend_ptr + i) != (i + 8)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + nx_packet_release(packet_ptr); + + /* ---- Test 1 ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr1 -> nx_packet_append_ptr = packet_ptr1 -> nx_packet_prepend_ptr; + packet_ptr1 -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5*NX_IP_PERIODIC_RATE); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i + 1)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + nx_packet_release(packet_ptr1); + + /* Receive the responsed PING frame from server */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_NO_WAIT); + if (status != NX_NO_PACKET || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_NO_WAIT); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (0x11 * (i + 1))) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + nx_packet_release(packet_ptr1); + + /* ---- Test 2 ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr1 -> nx_packet_append_ptr = packet_ptr1 -> nx_packet_prepend_ptr; + packet_ptr1 -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5*NX_IP_PERIODIC_RATE); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 1) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + if (*(packet_ptr1 -> nx_packet_prepend_ptr) != 1) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr1); + + /* Receive the responsed binary frame from server */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_NO_WAIT); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 3) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + if ((packet_ptr1 -> nx_packet_prepend_ptr[0] != 2) || (packet_ptr1 -> nx_packet_prepend_ptr[1] != 3) || (packet_ptr1 -> nx_packet_prepend_ptr[2] != 4)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr1); + + /* ---- Test 3 ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + packet_ptr1 -> nx_packet_append_ptr = packet_ptr1 -> nx_packet_prepend_ptr; + packet_ptr1 -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 5*NX_IP_PERIODIC_RATE); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i+1)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr1); + + /* Receive the responsed binary frame from server */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, NX_NO_WAIT); + if (status || client_websocket.nx_websocket_client_mutex.tx_mutex_ownership_count != 0) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* Check whether received data are correct */ + else + { + /* Check whether received data are correct */ + for (UINT i = 0; i < 4; i++) + { + if (*(packet_ptr1 -> nx_packet_prepend_ptr + i) != (i+1)) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + } + } + nx_packet_release(packet_ptr1); + + /* ---- Test 4 ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&client_pool, &packet_ptr2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&client_pool, &packet_ptr3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&client_pool, &packet_ptr4, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&client_pool, &packet_ptr5, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Copy the contents of the current packet into the new allocated packet; and update the packet length */ + memcpy((void *)&packet_ptr1 -> nx_packet_prepend_ptr[0], (void *)server_response_frame_packet_4_1, sizeof(server_response_frame_packet_4_1)); + packet_ptr1 -> nx_packet_append_ptr += sizeof(server_response_frame_packet_4_1); + packet_ptr1 -> nx_packet_length = sizeof(server_response_frame_packet_4_1) + sizeof(server_response_frame_packet_4_2) + + sizeof(server_response_frame_packet_4_3) + sizeof(server_response_frame_packet_4_4) + + sizeof(server_response_frame_packet_4_5); + + memcpy((void *)&packet_ptr2 -> nx_packet_prepend_ptr[0], (void *)server_response_frame_packet_4_2, sizeof(server_response_frame_packet_4_2)); + packet_ptr2 -> nx_packet_append_ptr += sizeof(server_response_frame_packet_4_2); + packet_ptr2 -> nx_packet_length = sizeof(server_response_frame_packet_4_2); + + memcpy((void *)&packet_ptr3 -> nx_packet_prepend_ptr[0], (void *)server_response_frame_packet_4_3, sizeof(server_response_frame_packet_4_3)); + packet_ptr3 -> nx_packet_append_ptr += sizeof(server_response_frame_packet_4_3); + packet_ptr3 -> nx_packet_length = sizeof(server_response_frame_packet_4_3); + + memcpy((void *)&packet_ptr4 -> nx_packet_prepend_ptr[0], (void *)server_response_frame_packet_4_4, sizeof(server_response_frame_packet_4_4)); + packet_ptr4 -> nx_packet_append_ptr += sizeof(server_response_frame_packet_4_4); + packet_ptr4 -> nx_packet_length = sizeof(server_response_frame_packet_4_4); + + memcpy((void *)&packet_ptr5 -> nx_packet_prepend_ptr[0], (void *)server_response_frame_packet_4_5, sizeof(server_response_frame_packet_4_5)); + packet_ptr5 -> nx_packet_append_ptr += sizeof(server_response_frame_packet_4_5); + packet_ptr5 -> nx_packet_length = sizeof(server_response_frame_packet_4_5); + + packet_ptr1 -> nx_packet_next = packet_ptr2; + packet_ptr2 -> nx_packet_next = packet_ptr3; + packet_ptr3 -> nx_packet_next = packet_ptr4; + packet_ptr4 -> nx_packet_next = packet_ptr5; + packet_ptr5 -> nx_packet_next = NX_NULL; + packet_ptr1 -> nx_packet_last = packet_ptr5; + + /* Receive the responsed binary frame from server */ + status = _nx_websocket_client_data_process(&client_websocket, &packet_ptr1, &code); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 2) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr1); + packet_ptr1 = NX_NULL; + + /* Check the waiting list */ + if (client_websocket.nx_websocket_client_processing_packet) + { + data_packet = client_websocket.nx_websocket_client_processing_packet; + for (i = 0; i < 3; i++) + { + if (data_packet -> nx_packet_next == NX_NULL) + break; + else + data_packet = data_packet -> nx_packet_next; + } + + if (i != 3 || client_websocket.nx_websocket_client_processing_packet -> nx_packet_last != data_packet) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server */ + status = _nx_websocket_client_data_process(&client_websocket, &packet_ptr1, &code); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A chained packet shall be obtained */ + if (packet_ptr1 -> nx_packet_next == NX_NULL || packet_ptr1 -> nx_packet_last == NX_NULL || packet_ptr1 -> nx_packet_next != packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 10) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr1); + packet_ptr1 = NX_NULL; + + /* Check the waiting list */ + if (client_websocket.nx_websocket_client_processing_packet) + { + data_packet = client_websocket.nx_websocket_client_processing_packet; + for (i = 0; i < 2; i++) + { + if (data_packet -> nx_packet_next == NX_NULL) + break; + else + data_packet = data_packet -> nx_packet_next; + } + + if (i != 2 || client_websocket.nx_websocket_client_processing_packet -> nx_packet_last != data_packet) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server */ + status = _nx_websocket_client_data_process(&client_websocket, &packet_ptr1, &code); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A chained packet shall be obtained */ + if (packet_ptr1 -> nx_packet_next == NX_NULL || packet_ptr1 -> nx_packet_last == NX_NULL || packet_ptr1 -> nx_packet_next != packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 10) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr1); + packet_ptr1 = NX_NULL; + + /* Check the waiting list */ + if (client_websocket.nx_websocket_client_processing_packet) + { + if (client_websocket.nx_websocket_client_processing_packet -> nx_packet_next != NX_NULL) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (client_websocket.nx_websocket_client_processing_packet -> nx_packet_last != NX_NULL) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed binary frame from server */ + status = _nx_websocket_client_data_process(&client_websocket, &packet_ptr1, &code); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* A single packet shall not be with next or last pointer */ + if (packet_ptr1 -> nx_packet_next || packet_ptr1 -> nx_packet_last) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + if (packet_ptr1 -> nx_packet_length != 4) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_release(packet_ptr1); + + /* Check the waiting list */ + if (client_websocket.nx_websocket_client_processing_packet != NX_NULL) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket One Packet with Multi-frames Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_one_packet_multi_frame, sizeof(server_response_one_packet_multi_frame), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_frame_packet_1_1, sizeof(server_response_frame_packet_1_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_frame_packet_1_2, sizeof(server_response_frame_packet_1_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_frame_packet_1_3, sizeof(server_response_frame_packet_1_3), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 3: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_frame_packet_2_1, sizeof(server_response_frame_packet_2_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_frame_packet_2_2, sizeof(server_response_frame_packet_2_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 4: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_frame_packet_3_1, sizeof(server_response_frame_packet_3_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_frame_packet_3_2, sizeof(server_response_frame_packet_3_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_one_packet_with_multi_frames_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket One Packet with Multi-frames Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_opcode_test.c b/test/regression/websocket_test/netx_websocket_opcode_test.c new file mode 100644 index 00000000..02d9d471 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_opcode_test.c @@ -0,0 +1,460 @@ +/* This case tests websocket opcode. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_1[] = +{ +0x81, 0x04, 0x01, 0x02, 0x03, 0x04, // Opcode: text +}; + +static UCHAR server_response_2_1[] = +{ +0x02, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: false; Opcode: binary +}; + +static UCHAR server_response_2_2[] = +{ +0x80, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: false; Opcode: binary +}; + +static UCHAR server_response_3[] = +{ +0x88, 0x04, 0x01, 0x02, 0x03, 0x04, // FIN: true; Opcode: close connection +}; + +static UCHAR client_test_data[] = +{ +0x11, 0x22, 0x33, 0x44, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 3 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_opcode_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1000, NX_NULL, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* ---- Unfragment frame test ---- */ + + /* Append and send data. */ + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + status = nx_packet_data_append(packet_ptr, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, 500); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The first response from the server shall be an unfragmented frame with opcode text frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) || (code != NX_WEBSOCKET_OPCODE_TEXT_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr); + + /* ---- Fragment frames test ---- */ + + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Append and send data. */ + status = nx_packet_data_append(packet_ptr1, client_test_data, sizeof(client_test_data), &client_pool, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 500); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + /* The second response from the server shall be the beginning frame of fragmented frames with opcode binary frame */ + if ((client_websocket.nx_websocket_client_frame_fragmented == NX_FALSE) || (code != NX_WEBSOCKET_OPCODE_BINARY_FRAME)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr1); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 500); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + nx_packet_release(packet_ptr1); + + /* The third response from the server shall be the termination frame of fragmented frames. */ + if (client_websocket.nx_websocket_client_frame_fragmented == NX_TRUE) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* The fourth response from the server shall be the opcode with close connection. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr1, &code, 500); + if ((status != NX_WEBSOCKET_DISCONNECTED) || (client_pool.nx_packet_pool_invalid_releases)) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Opcode Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1000, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_1, sizeof(server_response_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 2: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_response_2_1, sizeof(server_response_2_1), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_2_2, sizeof(server_response_2_2), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&server_pool, &packet_ptr, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + nx_packet_data_append(packet_ptr, server_response_3, sizeof(server_response_3), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_opcode_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Opcode Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/test/regression/websocket_test/netx_websocket_send_chain_packets_test.c b/test/regression/websocket_test/netx_websocket_send_chain_packets_test.c new file mode 100644 index 00000000..81d021b1 --- /dev/null +++ b/test/regression/websocket_test/netx_websocket_send_chain_packets_test.c @@ -0,0 +1,442 @@ +/* This case tests websocket send ability when there are chain packets. */ +#include "tx_api.h" +#include "nx_api.h" + +extern void test_control_return(UINT); + +#if !defined(NX_DISABLE_IPV4) && defined(__PRODUCT_NETXDUO__) && !defined(NX_DISABLE_PACKET_CHAIN) +#include "nx_websocket_client.h" +#include "netx_websocket_common_process.c" + +#define DEMO_STACK_SIZE 4096 +#define PACKET_SIZE 1536 +#define TOTAL_SIZE DEMO_STACK_SIZE + (PACKET_SIZE * 8) + 2048 + 1024 + +/* Define device drivers. */ +extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); + +static UINT test_done = NX_FALSE; + +static TX_THREAD client_thread; +static NX_PACKET_POOL client_pool; +static NX_TCP_SOCKET test_client; +static NX_IP client_ip; + +static NX_TCP_SOCKET test_server; +static NX_PACKET_POOL server_pool; +static TX_THREAD server_thread; +static NX_IP server_ip; +static UINT test_server_start = 0; +static UINT test_client_stop = 0; + +/* Set up the websocket global variables */ +static NX_WEBSOCKET_CLIENT client_websocket; +static UCHAR *client_websocket_host; +static UINT client_websocket_host_length; +static UCHAR *client_websocket_uri_path; +static UINT client_websocket_uri_path_length; + + +static void thread_client_entry(ULONG thread_input); +static void thread_server_entry(ULONG thread_input); + +#define TEST_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) +#define TEST_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) +#define TEST_SERVER_PORT 80 + +#define TEST_HOST_NAME "1.2.3.4" +#define TEST_URI_PATH "/test" +#define TEST_PROTOCOL "test" + +static UCHAR server_switch_101[] = +{ +0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0x20, // HTTP1.1/ +0x31, 0x30, 0x31, 0x20, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, // 101 Switching +0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x0d, 0x0a, // Protocols\r\n +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x3a, 0x20, // Upgrade: +0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x0d, 0x0a, // WebSocket\r\n +0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, // Connection: +0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0d, 0x0a, // Upgrade\r\n +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, // Sec-WebSocket-Protocol: +0x74, 0x2d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x20, +0x74, 0x65, 0x73, 0x74, 0x0d, 0x0a, // test +0x53, 0x65, 0x63, 0x2d, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, // Sec-WebSocket-Accept: +0x65, 0x74, 0x2d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, +0x35, 0x75, 0x31, 0x6c, 0x55, 0x72, 0x32, 0x57, 0x68, 0x70, 0x34, 0x64, 0x44, 0x57, 0x6e, // 5u1lUr2Whp4dDWnskk9JcJZobO0= +0x73, 0x6b, 0x6b, 0x39, 0x4a, 0x63, 0x4a, 0x5a, 0x6f, 0x62, 0x4f, 0x30, 0x3d, 0x0d, 0x0a, +0x0d, 0x0a, +}; + +static UCHAR server_response_16_bit_normal_frame[] = +{ +0x82, 0x7E, 0x01, 0x00, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +}; + +/* Below 3 packets compose one complete frame */ +static UCHAR client_send_frame_packet_1[] = +{ +0x82, 0x7E, 0x01, 0x00, 0x11, 0x22, 0x33, 0x44, // header +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +}; + +static UCHAR client_send_frame_packet_2[] = +{ +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +}; + +static UCHAR client_send_frame_packet_3[] = +{ +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, +}; + +static UCHAR server_test_data[] = +{ +0x82, 0x00, +}; + +static ULONG error_counter; + +extern void SET_ERROR_COUNTER(ULONG *error_counter, CHAR *filename, int line_number); + +#define TEST_LOOP 2 + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_send_chain_packets_test_application_define(void *first_unused_memory) +#endif +{ +CHAR *pointer; +UINT status; + + + error_counter = 0; + + /* Setup the working pointer. */ + pointer = (CHAR *) first_unused_memory; + + /* Create a helper thread for the server. */ + tx_thread_create(&server_thread, "Test Server thread", thread_server_entry, 0, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + pointer = pointer + DEMO_STACK_SIZE; + + /* Initialize the NetX system. */ + nx_system_initialize(); + + /* Create the server packet pool. */ + status = nx_packet_pool_create(&server_pool, "Test Server Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&server_ip, "Test Server IP", TEST_SERVER_ADDRESS, + 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable ARP and supply ARP cache memory for the server IP instance. */ + status = nx_arp_enable(&server_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&server_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Test Client thread. */ + status = tx_thread_create(&client_thread, "Test Client", thread_client_entry, 0, + pointer, DEMO_STACK_SIZE, + 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); + pointer = pointer + DEMO_STACK_SIZE; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create the Client packet pool. */ + status = nx_packet_pool_create(&client_pool, "Test Client Packet Pool", PACKET_SIZE, + pointer, PACKET_SIZE * 8); + pointer = pointer + PACKET_SIZE * 8; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create an IP instance. */ + status = nx_ip_create(&client_ip, "Test Client IP", TEST_CLIENT_ADDRESS, + 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, + pointer, 2048, 1); + pointer = pointer + 2048; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + status = nx_arp_enable(&client_ip, (void *) pointer, 1024); + pointer = pointer + 1024; + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Enable TCP traffic. */ + status = nx_tcp_enable(&client_ip); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); +} + +void thread_client_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; +NX_PACKET *packet_ptr1; +NX_PACKET *packet_ptr2; +NX_PACKET *packet_ptr3; +NXD_ADDRESS server_ip_address; +UINT code; + + /* Create client socket. */ + status = nx_tcp_socket_create(&client_ip, &test_client, "Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, + NX_IP_TIME_TO_LIVE, 1460, NX_NULL, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Create WebSocket. */ + status = nx_websocket_client_create(&client_websocket, (UCHAR *)" ", &client_ip, &client_pool); + + /* Check status. */ + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Give IP task and driver a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + /* Bind and connect to server. */ + status = nx_tcp_client_socket_bind(&test_client, TEST_SERVER_PORT, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Wait test server started. */ + while(!test_server_start) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + /* Set server IP address. */ + server_ip_address.nxd_ip_address.v4 = TEST_SERVER_ADDRESS; + server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; + + /* Connect to the server */ + status = nxd_tcp_client_socket_connect(&test_client, &server_ip_address, TEST_SERVER_PORT, NX_WAIT_FOREVER); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Upgrade to websocket */ + status = nx_websocket_client_connect(&client_websocket, &test_client, + TEST_HOST_NAME, sizeof(TEST_HOST_NAME) - 1, + (UCHAR *)TEST_URI_PATH, sizeof(TEST_URI_PATH) - 1, + (UCHAR *)TEST_PROTOCOL, sizeof(TEST_PROTOCOL) - 1, + NX_WAIT_FOREVER); + + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + status = nx_packet_allocate(&client_pool, &packet_ptr1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&client_pool, &packet_ptr2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + status = nx_packet_allocate(&client_pool, &packet_ptr3, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Copy the contents of the current packet into the new allocated packet; and update the packet length */ + memcpy((void *)&packet_ptr1 -> nx_packet_prepend_ptr[0], (void *)client_send_frame_packet_1, sizeof(client_send_frame_packet_1)); + packet_ptr1 -> nx_packet_append_ptr += sizeof(client_send_frame_packet_1); + packet_ptr1 -> nx_packet_length = sizeof(client_send_frame_packet_1) + sizeof(client_send_frame_packet_2) + sizeof(client_send_frame_packet_3); + + memcpy((void *)&packet_ptr2 -> nx_packet_prepend_ptr[0], (void *)client_send_frame_packet_2, sizeof(client_send_frame_packet_2)); + packet_ptr2 -> nx_packet_append_ptr += sizeof(client_send_frame_packet_2); + packet_ptr2 -> nx_packet_length = sizeof(client_send_frame_packet_2); + + memcpy((void *)&packet_ptr3 -> nx_packet_prepend_ptr[0], (void *)client_send_frame_packet_3, sizeof(client_send_frame_packet_3)); + packet_ptr3 -> nx_packet_append_ptr += sizeof(client_send_frame_packet_3); + packet_ptr3 -> nx_packet_length = sizeof(client_send_frame_packet_3); + + packet_ptr1 -> nx_packet_next = packet_ptr2; + packet_ptr2 -> nx_packet_next = packet_ptr3; + packet_ptr3 -> nx_packet_next = NX_NULL; + packet_ptr1 -> nx_packet_last = packet_ptr3; + + status = nx_websocket_client_send(&client_websocket, packet_ptr1, NX_WEBSOCKET_OPCODE_BINARY_FRAME, NX_TRUE, NX_WAIT_FOREVER); + if (status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Receive the responsed data from server. */ + status = nx_websocket_client_receive(&client_websocket, &packet_ptr, &code, 5 * NX_IP_PERIODIC_RATE); + if (status != NX_NO_PACKET) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + nx_tcp_client_socket_unbind(&test_client); + nx_tcp_socket_delete(&test_client); + + test_done = NX_TRUE; +} + +/* Define the helper Test server thread. */ +void thread_server_entry(ULONG thread_input) +{ +UINT i, status; +NX_PACKET *packet_ptr; + + + /* Print out test information banner. */ + printf("NetX Test: Websocket Send Chain Packets Test....................................."); + + /* Check for earlier error. */ + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + + /* Give NetX a chance to initialize the system. */ + tx_thread_sleep(NX_IP_PERIODIC_RATE); + + status = nx_tcp_socket_create(&server_ip, &test_server, "Test Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1460, + NX_NULL, NX_NULL); + + status = nx_tcp_server_socket_listen(&server_ip, TEST_SERVER_PORT, &test_server, 5, NX_NULL); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + /* Set the flag. */ + test_server_start = 1; + + /* Accept a connection from test client. */ + status = nx_tcp_server_socket_accept(&test_server, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + + for (i = 0; i < TEST_LOOP; i++) + { + + /* Receive client data. */ + status = nx_tcp_socket_receive(&test_server, &packet_ptr, 5 * NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + else + { + /* Response data. */ + switch (i) + { + case 0: + /* Update the value in the field Sec-Protocol-Accept since it is calculated based on a random value */ + _server_connect_response_process(packet_ptr); + memcpy(&server_switch_101[127], connect_key, 28); + + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_switch_101, sizeof(server_switch_101), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + case 1: + packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr; + packet_ptr -> nx_packet_length = 0; + nx_packet_data_append(packet_ptr, server_test_data, sizeof(server_test_data), &server_pool, NX_IP_PERIODIC_RATE); + status = nx_tcp_socket_send(&test_server, packet_ptr, NX_IP_PERIODIC_RATE); + if(status) + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + break; + default: + break; + } + } + } + + /* Wait for test done. */ + while (test_done == NX_FALSE) + { + tx_thread_sleep(NX_IP_PERIODIC_RATE); + } + + nx_tcp_server_socket_unlisten(&server_ip, TEST_SERVER_PORT); + nx_tcp_socket_delete(&test_server); + + if (client_pool.nx_packet_pool_available != client_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + else if (client_pool.nx_packet_pool_invalid_releases) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if (server_pool.nx_packet_pool_available != server_pool.nx_packet_pool_total) + { + SET_ERROR_COUNTER(&error_counter, __FILE__, __LINE__); + } + + if(error_counter) + { + printf("ERROR!\n"); + test_control_return(1); + } + else + { + printf("SUCCESS!\n"); + test_control_return(0); + } +} + +#else + +#ifdef CTEST +VOID test_application_define(void *first_unused_memory) +#else +void netx_websocket_send_chain_packets_test_application_define(void *first_unused_memory) +#endif +{ + + /* Print out test information banner. */ + printf("NetX Test: Websocket Send Chain Packets Test.....................................N/A\n"); + + test_control_return(3); +} +#endif + diff --git a/utility/iperf/nx_iperf.c b/utility/iperf/nx_iperf.c index ae8d784c..c549ea25 100644 --- a/utility/iperf/nx_iperf.c +++ b/utility/iperf/nx_iperf.c @@ -81,6 +81,1983 @@ EXECUTION_TIME idle_time = 0; extern TX_THREAD *_tx_thread_created_ptr; #endif +/* Define the constants. */ +const unsigned char mslogo_jpg[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, + 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x01, 0xd7, 0x00, 0x00, 0x00, 0x9c, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x2d, 0x6c, 0xe1, + 0xda, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, + 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, + 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, + 0xb1, 0x8f, 0x0b, 0xfc, 0x61, 0x05, 0x00, 0x00, + 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, + 0x2e, 0x22, 0x00, 0x00, 0x2e, 0x22, 0x01, 0xaa, + 0xe2, 0xdd, 0x92, 0x00, 0x00, 0x19, 0xc7, 0x49, + 0x44, 0x41, 0x54, 0x78, 0x5e, 0xed, 0xdd, 0x07, + 0xb8, 0x2c, 0x67, 0x5d, 0xc7, 0xf1, 0x7b, 0x91, + 0x2a, 0x10, 0x08, 0x08, 0xa1, 0xb7, 0x18, 0x20, + 0x14, 0xe9, 0x01, 0x44, 0x40, 0x5a, 0x00, 0x43, + 0x53, 0x8c, 0x08, 0x04, 0x43, 0x4d, 0x10, 0x94, + 0x26, 0x20, 0xc2, 0x23, 0x21, 0x54, 0x45, 0x10, + 0x69, 0x81, 0x50, 0x05, 0x42, 0x53, 0xe0, 0x41, + 0x50, 0x90, 0xa0, 0x14, 0x41, 0x41, 0x88, 0x0a, + 0xc6, 0x12, 0x5a, 0x10, 0x41, 0xa2, 0xb4, 0x20, + 0xd2, 0x04, 0x21, 0xfe, 0xbe, 0xb3, 0xb3, 0xcb, + 0xec, 0xbb, 0xef, 0xec, 0xee, 0xec, 0xd9, 0xbd, + 0xf7, 0x9c, 0x73, 0xbf, 0x9f, 0xe7, 0xf9, 0x9f, + 0x99, 0xdd, 0x9d, 0x99, 0xdd, 0xb3, 0x3b, 0x33, + 0xef, 0xbc, 0x75, 0xf6, 0x48, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x3a, 0xa0, 0xec, 0x6d, 0xa7, 0xbb, + 0xc2, 0x37, 0xee, 0x76, 0x15, 0xfe, 0x9f, 0x7f, + 0x4d, 0x5c, 0xa2, 0x79, 0x62, 0x33, 0xce, 0x3a, + 0xe8, 0xad, 0x67, 0x5e, 0x8b, 0x99, 0x13, 0x4e, + 0xdd, 0x73, 0x52, 0x26, 0xf7, 0x60, 0x7e, 0x83, + 0x8e, 0x38, 0xf1, 0xc8, 0x3d, 0x9f, 0x69, 0xe7, + 0x25, 0x49, 0x3b, 0xc0, 0xb9, 0xda, 0xe9, 0x6e, + 0x72, 0xd1, 0xc4, 0xc5, 0x36, 0x18, 0x07, 0x27, + 0xc6, 0x2e, 0x94, 0xa8, 0x2d, 0xb3, 0xce, 0xd8, + 0x8d, 0xbf, 0x91, 0x24, 0xed, 0x6a, 0x9e, 0xb8, + 0x25, 0x49, 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, + 0xd6, 0xcc, 0xc4, 0x55, 0x92, 0xa4, 0x35, 0x33, + 0x71, 0x95, 0x24, 0x69, 0xcd, 0x4c, 0x5c, 0x25, + 0x49, 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, 0xd6, + 0xcc, 0xc4, 0x55, 0xd2, 0xda, 0x9c, 0x73, 0xce, + 0x39, 0x17, 0x49, 0x1c, 0x9b, 0x78, 0x45, 0xe2, + 0xbd, 0x89, 0x0f, 0x27, 0xde, 0x9d, 0x38, 0x39, + 0x71, 0x58, 0xbb, 0x98, 0xb4, 0xeb, 0x99, 0xb8, + 0x6a, 0xbf, 0xc9, 0xc9, 0x76, 0x6f, 0xe2, 0xd2, + 0x89, 0xab, 0x25, 0xce, 0xdb, 0x3e, 0xad, 0x1d, + 0xa8, 0xfd, 0x2d, 0x7f, 0x35, 0xb3, 0x9f, 0x4e, + 0xfc, 0x61, 0xe2, 0x7e, 0x89, 0x9f, 0x4d, 0xdc, + 0x38, 0x71, 0xdb, 0xc4, 0x71, 0x89, 0xeb, 0x24, + 0xa4, 0x03, 0xc2, 0x6e, 0x1c, 0xa1, 0xe9, 0xac, + 0xc4, 0x21, 0xcd, 0x13, 0x9b, 0xf1, 0xc5, 0x83, + 0xde, 0x7a, 0xe6, 0x65, 0x99, 0x39, 0xe1, 0xd4, + 0x3d, 0xaf, 0xce, 0xe4, 0x3e, 0xcc, 0x6f, 0xd0, + 0x55, 0x4f, 0x3c, 0x72, 0xcf, 0xa7, 0xda, 0xf9, + 0x41, 0x72, 0xb2, 0x23, 0xa7, 0x30, 0x6f, 0x04, + 0xa9, 0xd3, 0xf6, 0xee, 0xdd, 0xfb, 0xe7, 0xed, + 0xfc, 0xca, 0xf2, 0x3e, 0x0c, 0xa6, 0xf1, 0xf0, + 0x44, 0xdf, 0xfe, 0xf4, 0xfe, 0xbc, 0xcf, 0x07, + 0xda, 0xf9, 0x46, 0xd6, 0x61, 0x80, 0x0c, 0x4e, + 0xc2, 0x47, 0x25, 0xb8, 0xc8, 0xfb, 0x8f, 0xc4, + 0x71, 0x59, 0xee, 0x1d, 0x99, 0x6a, 0x07, 0xc9, + 0x6f, 0xc9, 0xef, 0xf7, 0xc2, 0xc4, 0x83, 0x9b, + 0x27, 0xfa, 0x1d, 0x9d, 0xdf, 0xf7, 0x4d, 0xed, + 0xfc, 0x7e, 0x91, 0xcf, 0xca, 0xe4, 0x81, 0x89, + 0x4b, 0x31, 0x53, 0xf8, 0x40, 0x3e, 0xdf, 0xfb, + 0xdb, 0x79, 0x69, 0x4b, 0x4c, 0x5c, 0x87, 0xdb, + 0x49, 0x89, 0xeb, 0x9d, 0x33, 0x79, 0xdb, 0xe8, + 0x51, 0x15, 0xb9, 0x8c, 0xc3, 0x73, 0x42, 0xf9, + 0xbf, 0xd1, 0xc3, 0xd5, 0xe4, 0x7d, 0x38, 0x59, + 0xbd, 0x74, 0xf4, 0xa8, 0xea, 0x89, 0x79, 0x8f, + 0xa7, 0xb4, 0xf3, 0x8d, 0xac, 0xf3, 0xc7, 0x99, + 0xfc, 0xe2, 0xe8, 0xd1, 0xc4, 0xb7, 0x12, 0xd7, + 0xcc, 0xb2, 0x9f, 0x1b, 0x3d, 0xd4, 0x4e, 0x90, + 0xdf, 0xf2, 0x31, 0x99, 0x3c, 0x73, 0xf4, 0x68, + 0xae, 0xed, 0x90, 0xb8, 0x5e, 0x26, 0x93, 0xcf, + 0x26, 0x6a, 0x25, 0x25, 0x7f, 0x9b, 0xb8, 0x69, + 0x3e, 0x63, 0x93, 0x02, 0x4b, 0x5b, 0x61, 0xb1, + 0xf0, 0x81, 0xed, 0x27, 0x13, 0xb7, 0x18, 0xcd, + 0xae, 0x26, 0x27, 0x2b, 0x2e, 0x68, 0x8e, 0x1f, + 0x3d, 0x5a, 0x4e, 0xd6, 0x39, 0x4f, 0x26, 0x77, + 0x1c, 0x3d, 0x9a, 0x72, 0xc1, 0xc4, 0xed, 0x47, + 0xb3, 0xda, 0x09, 0xf2, 0x5b, 0x72, 0xa1, 0xf9, + 0xc4, 0xd1, 0xa3, 0x19, 0x67, 0x26, 0xde, 0x90, + 0xe0, 0x42, 0x8a, 0xf9, 0xaa, 0x6c, 0xe3, 0x7c, + 0x89, 0xcb, 0xb7, 0x0f, 0x37, 0xed, 0xde, 0x89, + 0xbe, 0x2a, 0x88, 0x1b, 0x25, 0xae, 0x31, 0x9a, + 0x95, 0xb6, 0xc6, 0xc4, 0x55, 0x0f, 0x68, 0xa7, + 0xab, 0xe2, 0x84, 0x74, 0x83, 0xd1, 0xec, 0xd2, + 0xc8, 0x19, 0xf4, 0xe5, 0x96, 0xff, 0xb7, 0x9d, + 0x6a, 0x67, 0x20, 0xb1, 0xa2, 0x5a, 0xa0, 0xf4, + 0x07, 0x89, 0xab, 0x27, 0x17, 0x78, 0xcf, 0xc4, + 0x2f, 0x65, 0xfe, 0x6a, 0x89, 0x49, 0x15, 0x44, + 0x12, 0xd3, 0x8b, 0x26, 0x8e, 0x4e, 0xbc, 0x26, + 0x0f, 0x3f, 0x9f, 0xf8, 0xed, 0xe6, 0x85, 0x0d, + 0xca, 0x7b, 0x71, 0xbe, 0x9b, 0x57, 0xd2, 0xc4, + 0xeb, 0xbf, 0x32, 0x9a, 0x95, 0xb6, 0xc6, 0xc4, + 0x55, 0x77, 0xcd, 0x49, 0xe7, 0xe2, 0xed, 0xfc, + 0x2a, 0xc8, 0xb5, 0x0e, 0xaa, 0x5e, 0xc8, 0xc9, + 0x96, 0x84, 0x95, 0xfa, 0xd6, 0x12, 0x45, 0xfa, + 0x7f, 0x36, 0x9a, 0xd5, 0x0e, 0x71, 0xab, 0x76, + 0xda, 0xc5, 0x5d, 0x9c, 0x1e, 0x9b, 0xdf, 0xf9, + 0xfb, 0xa3, 0x87, 0xa3, 0xdf, 0x3c, 0xf1, 0x4d, + 0xe6, 0xb3, 0xbf, 0x3d, 0x3b, 0x93, 0x2f, 0x26, + 0xfe, 0x28, 0x71, 0x4c, 0x82, 0xbb, 0x58, 0xed, + 0x8b, 0x2a, 0xaa, 0x1b, 0x26, 0x9a, 0x3b, 0x5a, + 0xcd, 0x71, 0xaf, 0x7c, 0x3e, 0x1b, 0xd7, 0x69, + 0xcb, 0x4c, 0x5c, 0x45, 0x51, 0xec, 0x2f, 0x8f, + 0x66, 0x87, 0xc9, 0x49, 0x88, 0x3b, 0x10, 0xad, + 0xb4, 0x6e, 0x3c, 0x36, 0xf1, 0x8c, 0x04, 0x0d, + 0x99, 0xfe, 0x3b, 0xf1, 0xae, 0xc4, 0x6d, 0x72, + 0x02, 0xfe, 0x4a, 0xa6, 0xda, 0x39, 0xae, 0xd2, + 0x4e, 0xbb, 0xde, 0xdd, 0x4d, 0x58, 0x2b, 0xae, + 0x99, 0xb8, 0xc0, 0x68, 0x76, 0x9f, 0x3a, 0x36, + 0xb1, 0x28, 0x11, 0xbf, 0x5c, 0x82, 0xd6, 0xcd, + 0xd2, 0x96, 0x98, 0xb8, 0x0a, 0xf7, 0x4f, 0x42, + 0xd9, 0xce, 0x0e, 0xc2, 0xc9, 0xea, 0xc7, 0x47, + 0xb3, 0xc3, 0xe4, 0xe4, 0xfb, 0xbd, 0xc4, 0xe3, + 0x33, 0x7b, 0x85, 0xc4, 0x4f, 0x24, 0xee, 0x90, + 0xc7, 0xdc, 0x8b, 0x57, 0x3b, 0x0b, 0x17, 0x67, + 0x25, 0x72, 0xa5, 0xdb, 0x4a, 0xf6, 0x6f, 0xf6, + 0x53, 0x8a, 0xa7, 0xbb, 0x7e, 0x98, 0x38, 0x6d, + 0x34, 0x3b, 0xe5, 0xbe, 0xed, 0x54, 0x5a, 0x99, + 0x89, 0xeb, 0x81, 0xe7, 0x0b, 0x09, 0x4e, 0x2a, + 0x5d, 0xd7, 0x4b, 0x0c, 0xaa, 0x37, 0xcd, 0xc9, + 0xea, 0xc7, 0x32, 0x79, 0xd0, 0xe8, 0xd1, 0xc4, + 0x7f, 0x26, 0x06, 0xd5, 0x99, 0x26, 0x41, 0xfd, + 0x61, 0x82, 0x22, 0xc3, 0xf6, 0x19, 0xed, 0x02, + 0x3f, 0x68, 0xa7, 0xdb, 0x09, 0x5d, 0xbe, 0xb8, + 0x88, 0xeb, 0xfa, 0x87, 0xc4, 0x93, 0x47, 0xb3, + 0x53, 0xee, 0x94, 0xfd, 0x9b, 0xa2, 0x6a, 0x69, + 0x65, 0x26, 0xae, 0x07, 0x1e, 0x72, 0x87, 0x1f, + 0x1a, 0xcd, 0x4e, 0x90, 0xb2, 0xd1, 0xe9, 0x7f, + 0x88, 0x9b, 0x27, 0x28, 0xde, 0xeb, 0xa2, 0x1e, + 0x75, 0x9f, 0x9e, 0x58, 0x49, 0xe4, 0x13, 0x17, + 0x4b, 0x1c, 0x9e, 0xb8, 0x41, 0x82, 0x01, 0x29, + 0x2e, 0x9c, 0xd8, 0x52, 0x6a, 0xcd, 0xfa, 0x89, + 0xf3, 0xb4, 0xb1, 0x70, 0x5b, 0x59, 0x86, 0x38, + 0x77, 0xe2, 0x12, 0x89, 0xc3, 0x12, 0x57, 0x4d, + 0x5c, 0x92, 0xe7, 0xda, 0x45, 0x56, 0x96, 0x6d, + 0x9c, 0x2b, 0x71, 0xf1, 0xc4, 0xb5, 0x12, 0xd7, + 0x4f, 0x5c, 0x25, 0x71, 0xfe, 0xc4, 0x4a, 0xff, + 0x23, 0xeb, 0x25, 0x2e, 0x90, 0xb8, 0x6c, 0xe2, + 0xea, 0x09, 0xb6, 0x77, 0x50, 0x62, 0x37, 0x9f, + 0x0f, 0x6a, 0xb9, 0x51, 0x5a, 0x32, 0xbf, 0x3b, + 0xf1, 0xa5, 0xe6, 0xd1, 0x8f, 0x50, 0x64, 0x5d, + 0xe6, 0x72, 0x0f, 0x48, 0xd9, 0x27, 0x86, 0x1e, + 0x07, 0x2c, 0x4f, 0xeb, 0x6f, 0x8e, 0xc9, 0x83, + 0x13, 0xe7, 0xe5, 0xb9, 0xf6, 0xe5, 0x03, 0xca, + 0xae, 0xfa, 0xa7, 0xed, 0xe7, 0x3a, 0x2d, 0x3b, + 0x75, 0xad, 0x9f, 0xeb, 0xa9, 0x89, 0x53, 0x12, + 0x7c, 0xf6, 0xae, 0xb3, 0x13, 0x97, 0x4d, 0x0e, + 0xf2, 0x3b, 0xa3, 0x87, 0xf3, 0x65, 0xdb, 0x9c, + 0x98, 0xba, 0x03, 0x54, 0x90, 0xa8, 0x92, 0xd8, + 0xfe, 0x7d, 0xa2, 0x2c, 0x2a, 0xae, 0xf5, 0x73, + 0xbd, 0x6b, 0x26, 0x65, 0x3f, 0xd7, 0x2f, 0x66, + 0xb9, 0xdf, 0x6c, 0xe7, 0x7b, 0x71, 0xc0, 0x66, + 0xf2, 0x0b, 0x09, 0xd6, 0xff, 0xe9, 0xc4, 0xa5, + 0x13, 0x5d, 0x34, 0x98, 0xfa, 0x44, 0xe2, 0x9d, + 0x89, 0x57, 0x67, 0x9b, 0xa7, 0xf3, 0x24, 0xb2, + 0x2e, 0x8d, 0xb7, 0x68, 0xc9, 0x5a, 0x7a, 0x52, + 0x96, 0xfb, 0x4c, 0x5e, 0xbf, 0x64, 0xe6, 0x1f, + 0x9d, 0xe0, 0xbb, 0xa3, 0x7b, 0x08, 0xe5, 0xe5, + 0xac, 0x7f, 0xcb, 0xbc, 0x3e, 0x53, 0x8f, 0x98, + 0xe5, 0xaf, 0x98, 0x09, 0x8d, 0x72, 0xee, 0x90, + 0xb8, 0x76, 0xe2, 0x22, 0x89, 0xae, 0x6f, 0x24, + 0xc8, 0x21, 0xfd, 0x69, 0xe2, 0x55, 0xd9, 0xc6, + 0x97, 0x79, 0x72, 0x19, 0xd9, 0x36, 0xdb, 0x63, + 0xd4, 0x23, 0xba, 0x2d, 0xf1, 0x3e, 0xdd, 0xe3, + 0xf5, 0x7b, 0x89, 0x4f, 0x26, 0xde, 0x9b, 0x78, + 0x7e, 0xb6, 0x3b, 0x77, 0x1f, 0xc9, 0xb6, 0x58, + 0x97, 0x6e, 0x57, 0xd4, 0x91, 0xdf, 0x32, 0x41, + 0x37, 0x2c, 0xba, 0x44, 0x8d, 0xf1, 0x7f, 0x52, + 0xff, 0xfd, 0x37, 0x09, 0x1a, 0x1a, 0xbd, 0xad, + 0xe7, 0xff, 0xa5, 0xb4, 0xa2, 0xdb, 0x7d, 0x8b, + 0xdf, 0xa1, 0xfc, 0xbd, 0x3f, 0x96, 0xf8, 0xa7, + 0xd1, 0x6c, 0xd5, 0xad, 0x13, 0xf4, 0x37, 0xed, + 0xa2, 0xcf, 0xf5, 0x87, 0x47, 0xb3, 0x13, 0xdf, + 0xca, 0x67, 0x58, 0x34, 0x30, 0xc5, 0x42, 0xf9, + 0xcc, 0xbc, 0xd7, 0xbf, 0x27, 0x28, 0x6d, 0x19, + 0x63, 0x7f, 0xbd, 0x72, 0xb6, 0xff, 0xf9, 0xbc, + 0xfe, 0xe2, 0xcc, 0x97, 0xdd, 0xc9, 0x3e, 0x9a, + 0xd7, 0x8e, 0x68, 0xe7, 0xe7, 0xca, 0xfa, 0x74, + 0xdf, 0xf9, 0xad, 0xd1, 0xa3, 0x2d, 0xe1, 0x3d, + 0x9f, 0xc7, 0x4c, 0xb6, 0xc9, 0x85, 0x6a, 0xf7, + 0xf3, 0xe2, 0x65, 0x79, 0x7d, 0xee, 0x20, 0x17, + 0x59, 0x8f, 0x3a, 0xf0, 0x13, 0x47, 0x8f, 0xa6, + 0x3c, 0x22, 0xeb, 0x7e, 0xb5, 0x9d, 0x67, 0x39, + 0x5a, 0x78, 0xbf, 0x68, 0xf4, 0x68, 0xca, 0x09, + 0x59, 0xee, 0xcc, 0xbc, 0xce, 0x39, 0xf4, 0x37, + 0x12, 0x77, 0x49, 0x50, 0x0f, 0xcd, 0xfe, 0x71, + 0x46, 0x5e, 0xa3, 0x77, 0xc0, 0x8c, 0x2c, 0x7f, + 0xdd, 0x4c, 0xb8, 0x40, 0xa7, 0xbe, 0x9a, 0x7d, + 0x6b, 0xdc, 0x28, 0xec, 0xbb, 0x09, 0x7e, 0xdb, + 0xbf, 0x4c, 0xbc, 0x32, 0xeb, 0x7f, 0x9c, 0x27, + 0x0f, 0x04, 0x26, 0xae, 0xc3, 0xed, 0x86, 0xc4, + 0xf5, 0xe7, 0x13, 0x0c, 0xd4, 0x50, 0x16, 0x93, + 0x1d, 0x93, 0x9d, 0xff, 0xb5, 0xed, 0x7c, 0xaf, + 0x6c, 0x97, 0x93, 0x15, 0x2d, 0x42, 0xcf, 0xdf, + 0x3c, 0x31, 0x42, 0x0e, 0x80, 0x04, 0xe6, 0x7f, + 0x12, 0xcb, 0x24, 0xae, 0x4f, 0xc8, 0xe4, 0xa9, + 0xa3, 0x47, 0x13, 0x9f, 0xc8, 0x72, 0x57, 0x6f, + 0xe7, 0x67, 0x64, 0x1d, 0x7e, 0x5f, 0x4e, 0xe6, + 0xbf, 0x97, 0xb8, 0x32, 0xcf, 0x2d, 0x81, 0xc4, + 0xed, 0x52, 0xd9, 0x6e, 0x73, 0xd1, 0x90, 0x6d, + 0x90, 0x60, 0x72, 0xa2, 0x2d, 0xdd, 0x24, 0x41, + 0xa2, 0x4c, 0x6b, 0xe5, 0x72, 0xff, 0xa1, 0xc1, + 0xd5, 0x21, 0xd9, 0xc6, 0xa4, 0xc8, 0x3b, 0xdb, + 0x61, 0x84, 0xa9, 0xa7, 0x25, 0xee, 0x9f, 0x58, + 0xb6, 0x75, 0x29, 0xad, 0x65, 0x7f, 0x27, 0xf1, + 0xcc, 0x6c, 0xab, 0xb7, 0xc1, 0x4f, 0xb6, 0xcd, + 0xf6, 0x58, 0xee, 0x61, 0x89, 0xf2, 0x04, 0x5b, + 0xc3, 0x89, 0xf3, 0xb9, 0xed, 0xfc, 0x8c, 0x6c, + 0x8f, 0x13, 0xe2, 0xf3, 0x13, 0x0c, 0x45, 0xb8, + 0x2c, 0x2e, 0x4e, 0x1e, 0x9a, 0xed, 0x72, 0x52, + 0x9c, 0xc8, 0xb6, 0x5e, 0x91, 0xc9, 0xd0, 0x52, + 0x8e, 0x55, 0x9d, 0x9d, 0xf7, 0xe7, 0x7b, 0xde, + 0x92, 0x7c, 0x66, 0x2e, 0xd8, 0xf8, 0x3e, 0xbb, + 0xde, 0x97, 0xb8, 0x55, 0xb6, 0xcf, 0xeb, 0x5c, + 0x6c, 0xf0, 0xb8, 0x74, 0xed, 0xbc, 0x3e, 0xef, + 0x22, 0xa1, 0x91, 0xf5, 0xb9, 0x58, 0x98, 0xfa, + 0x9e, 0x56, 0xf4, 0xe6, 0xbc, 0x5f, 0x73, 0xc1, + 0x99, 0x6d, 0xb2, 0x7f, 0x94, 0xa5, 0x1e, 0x0f, + 0xcc, 0xeb, 0x2f, 0x6f, 0xe7, 0xab, 0xb2, 0x1e, + 0x17, 0x04, 0x0c, 0x86, 0x51, 0xba, 0x62, 0xd6, + 0x9d, 0xec, 0xf7, 0x59, 0x8e, 0x8b, 0xcc, 0x5a, + 0xe3, 0x41, 0xf6, 0x11, 0xaa, 0x8d, 0xde, 0x9e, + 0x28, 0x47, 0xb1, 0xfa, 0x4e, 0xb6, 0x31, 0x75, + 0x6c, 0x67, 0x3b, 0x9c, 0x43, 0xd8, 0xf7, 0xee, + 0x99, 0x58, 0x94, 0x9e, 0xb0, 0x5d, 0xce, 0x99, + 0x0f, 0xcf, 0x76, 0x38, 0x2e, 0x77, 0x35, 0x8b, + 0x85, 0x0f, 0x40, 0xd9, 0xb1, 0xbf, 0x9d, 0x49, + 0x99, 0x73, 0xc5, 0xb2, 0x0d, 0x9b, 0x28, 0x62, + 0xeb, 0x26, 0xac, 0x78, 0x59, 0x3b, 0xdd, 0x88, + 0x7c, 0x2e, 0x12, 0x19, 0xba, 0x70, 0x90, 0xab, + 0x5a, 0x36, 0x61, 0xc5, 0xb2, 0x17, 0x90, 0x24, + 0xa8, 0x9c, 0x50, 0x16, 0x5e, 0x98, 0xe5, 0xb3, + 0x90, 0x53, 0xf9, 0x48, 0x82, 0x5c, 0xd5, 0x90, + 0x6e, 0x1b, 0xe4, 0x16, 0xb8, 0xa0, 0x78, 0x7b, + 0xb6, 0x71, 0xe1, 0xe6, 0x99, 0x42, 0x9e, 0x27, + 0x37, 0xf9, 0xc6, 0xc4, 0x23, 0x13, 0xcb, 0x24, + 0xac, 0xbd, 0xf8, 0x2d, 0x13, 0xe4, 0x34, 0x19, + 0x7a, 0x72, 0x48, 0xc2, 0x8a, 0xa6, 0x5f, 0x6a, + 0xd6, 0x7f, 0x18, 0xdb, 0xd9, 0xa9, 0xf2, 0xd9, + 0x39, 0xc7, 0xd5, 0x2e, 0x80, 0x5f, 0x9f, 0xe3, + 0xa0, 0x9d, 0xdd, 0xf3, 0xd7, 0x09, 0xfa, 0xda, + 0x96, 0xf6, 0x75, 0xc3, 0xa6, 0xb2, 0x78, 0x7a, + 0x7f, 0xa0, 0xe4, 0xa6, 0x96, 0xb0, 0xce, 0xc8, + 0x77, 0xcb, 0x3e, 0x42, 0x42, 0x7e, 0xaf, 0xc4, + 0x32, 0xc7, 0x19, 0xbf, 0x05, 0xdf, 0xe9, 0xfb, + 0xb2, 0xee, 0x56, 0xba, 0xff, 0xed, 0x08, 0x26, + 0xae, 0x07, 0x2e, 0x86, 0x2b, 0x2c, 0x1b, 0x36, + 0x8d, 0x8b, 0x0b, 0x7b, 0xe5, 0xa0, 0xe0, 0xe4, + 0x5f, 0x0e, 0x3c, 0x41, 0x43, 0x26, 0x0e, 0xc8, + 0x8d, 0x68, 0x4f, 0xee, 0x0c, 0xaf, 0x47, 0x82, + 0xb3, 0xa9, 0x7d, 0x96, 0x62, 0xbd, 0xb2, 0x78, + 0x79, 0x46, 0x3e, 0xcb, 0x95, 0x32, 0xf9, 0x8b, + 0xc4, 0xa1, 0xcd, 0x13, 0xab, 0x61, 0x14, 0xaa, + 0xd7, 0x65, 0x5b, 0xb5, 0xc4, 0xf3, 0x11, 0x89, + 0xbb, 0x8d, 0x66, 0x67, 0xf0, 0x45, 0x94, 0xbf, + 0xd9, 0x3c, 0xe4, 0xaa, 0x29, 0xf2, 0x3c, 0x5f, + 0xf3, 0x68, 0x38, 0x72, 0x4e, 0xcf, 0x49, 0xec, + 0xe4, 0xd6, 0xb3, 0xe4, 0xda, 0xcb, 0xb6, 0x01, + 0x14, 0xa9, 0xbf, 0x65, 0x34, 0xdb, 0x5c, 0x6c, + 0x52, 0x62, 0xc1, 0x45, 0x5b, 0xe9, 0x9e, 0xf9, + 0x8d, 0x86, 0x5c, 0x3c, 0x6d, 0x05, 0x25, 0x49, + 0x7d, 0x23, 0x5d, 0xed, 0x4b, 0xb4, 0xe0, 0x5f, + 0x26, 0x61, 0xa5, 0xa8, 0x98, 0x52, 0xb0, 0x5a, + 0x57, 0x2c, 0xf0, 0x1d, 0x13, 0x35, 0x34, 0xa0, + 0x3c, 0x25, 0xdb, 0xd8, 0xd5, 0xe9, 0x8f, 0x89, + 0xeb, 0x01, 0x2a, 0x27, 0x94, 0x33, 0x32, 0x29, + 0xeb, 0x6f, 0x38, 0xd9, 0xd3, 0xbd, 0x66, 0x9e, + 0x23, 0x13, 0xe5, 0x01, 0xf5, 0xda, 0x6c, 0x6f, + 0xa9, 0xba, 0xda, 0x15, 0xdd, 0x3d, 0xf1, 0xa8, + 0xd1, 0xec, 0x0c, 0xea, 0x74, 0xc8, 0xe9, 0x3d, + 0x24, 0x41, 0x71, 0xf7, 0xd1, 0x89, 0x13, 0x12, + 0xd4, 0xfd, 0x0e, 0x41, 0xb1, 0xf0, 0x18, 0x27, + 0x5b, 0x8a, 0xe2, 0x19, 0x83, 0x76, 0xd2, 0x40, + 0x2b, 0x27, 0x03, 0x12, 0x9b, 0xd7, 0x27, 0x6a, + 0x89, 0x30, 0x89, 0x1e, 0x27, 0x1b, 0xc6, 0xd9, + 0xa5, 0x0e, 0x96, 0xa2, 0x53, 0x72, 0xda, 0xb5, + 0x1c, 0x11, 0xee, 0x94, 0xf8, 0xb5, 0xd1, 0xec, + 0x48, 0xb6, 0x4f, 0x69, 0x00, 0xf5, 0xbd, 0x25, + 0xba, 0xb6, 0x90, 0x50, 0x92, 0x53, 0x20, 0x71, + 0xbf, 0x69, 0x82, 0x7e, 0xc2, 0xbd, 0xf5, 0x57, + 0xd9, 0x16, 0xf5, 0xb5, 0x2f, 0x48, 0xd4, 0x8e, + 0x71, 0x8a, 0xe4, 0x28, 0x5e, 0x24, 0xe7, 0xcd, + 0x08, 0x4b, 0x0f, 0x4d, 0xf0, 0x7f, 0xf1, 0x5d, + 0x96, 0x58, 0xff, 0x05, 0xd9, 0xde, 0xf8, 0x37, + 0xa7, 0x41, 0x1c, 0xf5, 0xbc, 0xe3, 0xa8, 0xb5, + 0x0e, 0x67, 0xa8, 0xc3, 0xee, 0x32, 0x65, 0x7c, + 0x2d, 0x51, 0xe2, 0x7f, 0x2c, 0x97, 0xfb, 0x60, + 0x62, 0xab, 0x6a, 0x17, 0x06, 0xa7, 0x66, 0x7f, + 0x2d, 0x8b, 0x44, 0x69, 0x43, 0x50, 0xa2, 0xfa, + 0x83, 0xfd, 0x7d, 0x11, 0xaa, 0xa2, 0x28, 0x2e, + 0x5f, 0x26, 0x6a, 0xfb, 0x03, 0xfb, 0xdb, 0xb1, + 0x95, 0xcf, 0xb4, 0x3f, 0xb0, 0x6f, 0x8d, 0x75, + 0x8f, 0x03, 0xe6, 0x1b, 0xd9, 0x17, 0x38, 0x4f, + 0x30, 0xb2, 0x16, 0xdd, 0xe8, 0xba, 0xb8, 0xf8, + 0x63, 0x3f, 0xa2, 0x94, 0x84, 0xe2, 0x7c, 0x8a, + 0x8c, 0x6f, 0x96, 0xa8, 0x8d, 0x6f, 0x4e, 0x15, + 0x12, 0x45, 0xc9, 0xbb, 0xd6, 0xb2, 0x45, 0x66, + 0x3b, 0x42, 0x5b, 0xe7, 0xfa, 0x2f, 0x09, 0x8a, + 0x36, 0x36, 0xe5, 0xac, 0x83, 0xde, 0x7a, 0x66, + 0x33, 0xca, 0xcb, 0x09, 0xa7, 0xee, 0x39, 0x29, + 0x93, 0x79, 0x77, 0x9d, 0x59, 0x87, 0x23, 0x4e, + 0x3c, 0xb2, 0xa9, 0xdf, 0x1c, 0x2c, 0x07, 0x41, + 0xb5, 0xce, 0x35, 0x07, 0x71, 0x33, 0x7e, 0x6f, + 0x5e, 0xa7, 0x45, 0x24, 0x09, 0x53, 0x17, 0xf5, + 0x32, 0x87, 0x65, 0x99, 0xea, 0x55, 0x67, 0xd6, + 0x21, 0x87, 0x4a, 0xc2, 0x30, 0x46, 0xa2, 0xc2, + 0x60, 0xfb, 0x67, 0xe4, 0x35, 0x4e, 0xc4, 0x6b, + 0xad, 0x73, 0xcd, 0x72, 0x14, 0x9f, 0x72, 0x21, + 0x50, 0x36, 0x80, 0x01, 0xf5, 0xbc, 0xe4, 0xa2, + 0x3f, 0x9f, 0xf5, 0x9a, 0x27, 0xc6, 0xb2, 0x1e, + 0x93, 0xdb, 0x24, 0x78, 0x5f, 0x06, 0xa7, 0x58, + 0x54, 0xe7, 0x0a, 0x56, 0x22, 0xa7, 0x47, 0xe2, + 0x3c, 0x6e, 0x78, 0xc4, 0x49, 0x82, 0xdf, 0x98, + 0x62, 0x6f, 0x2e, 0x3c, 0x6a, 0x37, 0x28, 0x20, + 0xe7, 0x4e, 0xa2, 0xfe, 0xc1, 0xca, 0xe7, 0x20, + 0xc1, 0xa4, 0xbe, 0x8f, 0xbb, 0x06, 0x95, 0x68, + 0x44, 0x76, 0x68, 0xd6, 0x61, 0xca, 0xb2, 0x9c, + 0x94, 0xca, 0x46, 0x3d, 0xb8, 0x59, 0x96, 0xa1, + 0xa1, 0xd1, 0x94, 0xf6, 0x7f, 0xa4, 0xb1, 0xd3, + 0xb9, 0xf3, 0xfa, 0xa4, 0xe4, 0x20, 0xcf, 0xf3, + 0x21, 0xf8, 0x6e, 0xf8, 0xff, 0x4b, 0xd4, 0x29, + 0xdf, 0x37, 0xcb, 0x4f, 0x9d, 0xc8, 0xdb, 0x6d, + 0x91, 0x80, 0x92, 0x83, 0xab, 0x75, 0xcb, 0xe2, + 0xa4, 0x79, 0xaf, 0xca, 0xff, 0x47, 0xd7, 0xae, + 0xa6, 0x0d, 0x42, 0xc7, 0x13, 0xb2, 0xdc, 0xd3, + 0xdb, 0xf9, 0x19, 0x59, 0x87, 0x61, 0x10, 0xcb, + 0x31, 0xa4, 0x69, 0xac, 0x53, 0x76, 0xed, 0xda, + 0x92, 0xbc, 0x0f, 0x7d, 0x70, 0xc9, 0x11, 0x96, + 0x45, 0x90, 0xfc, 0x1f, 0xfc, 0x3f, 0x13, 0xed, + 0x77, 0xc6, 0x7e, 0x76, 0xd5, 0xe6, 0x89, 0x1f, + 0x79, 0x4b, 0x96, 0xe5, 0xe2, 0x6e, 0xcb, 0xf2, + 0x1e, 0x24, 0x34, 0x5c, 0x34, 0x74, 0x1b, 0x92, + 0xe1, 0x49, 0x89, 0x13, 0xbb, 0xdf, 0x6d, 0x96, + 0xdd, 0x5f, 0x75, 0xae, 0x60, 0x67, 0x38, 0x39, + 0x41, 0x4e, 0xba, 0x7b, 0x1c, 0xf0, 0xbd, 0x71, + 0xa1, 0xc5, 0x10, 0x91, 0xaf, 0x6a, 0x9e, 0xfd, + 0x11, 0xce, 0x03, 0x34, 0xbe, 0x7b, 0x49, 0xf7, + 0xff, 0x40, 0x96, 0xe7, 0x09, 0x8e, 0x1f, 0x2e, + 0x10, 0xbb, 0xfe, 0x31, 0x71, 0xbd, 0x2c, 0x3f, + 0xa4, 0x34, 0x66, 0xc7, 0xd8, 0x6d, 0x39, 0x57, + 0x76, 0x8a, 0x9f, 0x4a, 0x50, 0xac, 0xb1, 0xa9, + 0xa0, 0x55, 0xdc, 0xd8, 0xaf, 0x27, 0x6a, 0xcb, + 0xac, 0x33, 0x7a, 0x07, 0x3c, 0x5f, 0x03, 0x12, + 0x5e, 0xae, 0xba, 0xbb, 0xb8, 0x1a, 0xad, 0x8e, + 0x50, 0x93, 0x83, 0x84, 0x5c, 0x13, 0x57, 0x9c, + 0x5d, 0xd4, 0xe7, 0xd1, 0xf8, 0x65, 0x53, 0xb8, + 0xe3, 0x4e, 0x2d, 0x61, 0x25, 0x91, 0x38, 0x2a, + 0x07, 0xe6, 0x4c, 0xc2, 0x0a, 0x9e, 0x4b, 0xd0, + 0xc8, 0x84, 0x7b, 0x8a, 0xd6, 0x72, 0x64, 0x35, + 0xe4, 0x34, 0x1f, 0x92, 0xf5, 0xbe, 0xdc, 0xae, + 0x4f, 0x7c, 0x2d, 0x41, 0xab, 0x4a, 0x4e, 0x00, + 0xb4, 0x9e, 0x2c, 0x91, 0x68, 0xdf, 0x31, 0xcb, + 0xcc, 0x24, 0xac, 0xc8, 0x73, 0xbc, 0x37, 0xc5, + 0xd9, 0xb5, 0x3a, 0xee, 0x83, 0x13, 0xdd, 0xab, + 0x77, 0x8a, 0xda, 0x4a, 0xe4, 0x9c, 0xab, 0xdf, + 0x2f, 0xef, 0x97, 0x78, 0x67, 0xa2, 0x2c, 0x92, + 0x67, 0x98, 0xbf, 0xda, 0xb0, 0x84, 0x24, 0xdc, + 0x77, 0xcf, 0xf2, 0x33, 0x27, 0xd5, 0x76, 0x5b, + 0xec, 0x6b, 0x3f, 0x97, 0xa0, 0xd5, 0x70, 0x89, + 0x04, 0x66, 0x61, 0xb1, 0xf9, 0x36, 0xc3, 0x45, + 0x60, 0x99, 0xb0, 0x92, 0x6b, 0x9f, 0x19, 0x62, + 0x33, 0xff, 0x3b, 0xe7, 0x8e, 0xa9, 0x04, 0xb7, + 0x75, 0xc7, 0xec, 0xf7, 0x5b, 0xbe, 0x58, 0x6f, + 0x13, 0x33, 0x72, 0x7b, 0x65, 0xc2, 0x4a, 0xe9, + 0xd1, 0xd3, 0xf8, 0xfe, 0xb7, 0x91, 0xdf, 0x4f, + 0xd4, 0x8e, 0x03, 0x12, 0x56, 0x3e, 0x68, 0xad, + 0x65, 0x34, 0x89, 0xf1, 0x4c, 0xc2, 0x8a, 0x3c, + 0xc7, 0x77, 0x4b, 0x89, 0x4e, 0xd9, 0x88, 0x89, + 0xd2, 0x95, 0xb2, 0xc8, 0x5e, 0xda, 0xfe, 0x72, + 0x20, 0xdc, 0x39, 0x51, 0x62, 0x98, 0xc1, 0x89, + 0x3c, 0x7e, 0xc6, 0xe8, 0xe9, 0x29, 0x6f, 0x6e, + 0x5f, 0x9e, 0x92, 0xe7, 0x9f, 0x3a, 0x7a, 0x79, + 0x0a, 0xc5, 0x8a, 0x8d, 0xcc, 0xd3, 0x1f, 0xf3, + 0x5b, 0xcd, 0xb3, 0xd3, 0x66, 0x06, 0x65, 0xcf, + 0x73, 0x4f, 0x18, 0xbd, 0x34, 0x85, 0x9c, 0xc3, + 0x44, 0x1e, 0xd3, 0x67, 0xee, 0x63, 0xcd, 0x2b, + 0xd3, 0xbe, 0x92, 0x28, 0x5b, 0x3a, 0x2f, 0x25, + 0xeb, 0x5d, 0xbe, 0xd9, 0xc2, 0xac, 0x2f, 0x24, + 0x7a, 0x87, 0xe4, 0xcb, 0x6b, 0x37, 0x6c, 0x96, + 0x9a, 0xf5, 0xac, 0x76, 0x91, 0xb9, 0xb2, 0xdc, + 0xa5, 0x12, 0xdf, 0x6e, 0xd6, 0x98, 0x46, 0x0e, + 0xb3, 0x91, 0xf9, 0xa3, 0x46, 0x4f, 0xcd, 0x18, + 0x34, 0x98, 0x7c, 0x96, 0x7f, 0xf6, 0x68, 0xb5, + 0x29, 0x3f, 0x48, 0x2c, 0xdb, 0xb5, 0xe4, 0xb8, + 0x66, 0x8d, 0x59, 0x33, 0x37, 0x79, 0xc8, 0x73, + 0x7c, 0x6f, 0x25, 0xea, 0xed, 0x7a, 0xe5, 0x75, + 0x1a, 0x4a, 0x95, 0xe6, 0xdd, 0xb2, 0x70, 0x25, + 0xd9, 0x66, 0xed, 0x7d, 0x5e, 0xd7, 0xbe, 0x3c, + 0x23, 0xaf, 0x5d, 0x23, 0xc1, 0xf7, 0x54, 0xe2, + 0x22, 0x7a, 0x65, 0x59, 0x9f, 0xe3, 0xe2, 0x4d, + 0xcd, 0x96, 0xa6, 0xb1, 0x1f, 0xd3, 0xc5, 0x6a, + 0x46, 0x9e, 0xff, 0x7e, 0xb3, 0xc4, 0xb4, 0x85, + 0x37, 0xd9, 0xc8, 0x32, 0x47, 0x8c, 0x16, 0x9d, + 0x31, 0x55, 0x84, 0x9b, 0xc7, 0xf4, 0x9b, 0xae, + 0x59, 0x74, 0x1c, 0xd4, 0xb6, 0xff, 0xdd, 0x44, + 0xed, 0x02, 0x78, 0x4a, 0x96, 0x79, 0x5b, 0xb3, + 0xf4, 0xb4, 0xa9, 0xaa, 0x91, 0xdd, 0x64, 0x5b, + 0x5d, 0x2e, 0x6d, 0xd9, 0x29, 0x67, 0xf3, 0xff, + 0xd0, 0xf0, 0xe5, 0xa0, 0xe6, 0xf1, 0x66, 0x7c, + 0x7d, 0xcf, 0x31, 0x07, 0x37, 0x7d, 0x31, 0x93, + 0x4c, 0x51, 0xaf, 0xd6, 0xad, 0xab, 0xdb, 0x84, + 0x27, 0xee, 0xbd, 0xfd, 0x9e, 0xff, 0x6a, 0xe7, + 0x07, 0xc9, 0x8e, 0x3b, 0xb7, 0x58, 0x18, 0x59, + 0x86, 0x06, 0x4c, 0xd4, 0xa3, 0x75, 0x8b, 0xa0, + 0xc8, 0x6d, 0xd1, 0x07, 0x90, 0xe2, 0xce, 0x46, + 0x96, 0xa3, 0x61, 0xc7, 0xbf, 0x25, 0xba, 0xb9, + 0x17, 0xea, 0xce, 0xe8, 0x1b, 0xdb, 0xe4, 0x0c, + 0xb3, 0xcc, 0x5a, 0x8b, 0x85, 0xb3, 0x0c, 0x39, + 0x65, 0x8a, 0xc4, 0xcb, 0x12, 0x96, 0xa7, 0x67, + 0x39, 0xd6, 0x1f, 0x2c, 0xdb, 0xec, 0x2b, 0x16, + 0x7e, 0x6e, 0xb6, 0x49, 0x63, 0xa2, 0xaa, 0xac, + 0x47, 0x1d, 0xe7, 0xef, 0x8e, 0x1e, 0x4d, 0x70, + 0x45, 0x7e, 0xad, 0xac, 0x47, 0x55, 0xc4, 0x42, + 0xd9, 0x06, 0xbf, 0x05, 0xbf, 0x49, 0x17, 0x45, + 0xc2, 0x74, 0x15, 0xfa, 0x5e, 0x5e, 0xe7, 0xe6, + 0xf6, 0x5c, 0x60, 0x94, 0xff, 0x2f, 0xb9, 0x63, + 0xbe, 0xbf, 0xe7, 0x65, 0x39, 0xee, 0x79, 0x3b, + 0x57, 0xb6, 0xf3, 0x77, 0x99, 0x5c, 0x7f, 0xf4, + 0x68, 0x82, 0xbe, 0xa7, 0xd7, 0xcf, 0xfa, 0x7c, + 0xe6, 0xb9, 0xb2, 0x3e, 0x63, 0x46, 0xd3, 0x72, + 0xb5, 0xcc, 0x65, 0xbd, 0x3c, 0xeb, 0x53, 0x92, + 0x30, 0x91, 0x65, 0xb7, 0x65, 0xb1, 0x70, 0xde, + 0x83, 0xc4, 0x84, 0xfe, 0x95, 0xe5, 0xff, 0x70, + 0xe7, 0xbc, 0x0f, 0x7d, 0x8e, 0x67, 0x64, 0x1d, + 0xce, 0x1f, 0x7c, 0x77, 0x34, 0xb8, 0xe9, 0xe2, + 0xb9, 0x1b, 0x2d, 0xf3, 0xdd, 0xd5, 0x64, 0xbb, + 0xb4, 0x07, 0xe0, 0x66, 0xf2, 0x5d, 0x94, 0x84, + 0x70, 0x7f, 0xdb, 0x49, 0xc3, 0xaa, 0xae, 0xac, + 0xb3, 0xbf, 0x8a, 0x85, 0xe9, 0x33, 0x4d, 0x17, + 0xb0, 0xaa, 0xac, 0x57, 0x3b, 0x6e, 0xb9, 0x40, + 0x3c, 0x32, 0xeb, 0x8d, 0x1e, 0xf5, 0xc8, 0xba, + 0x5c, 0x88, 0x96, 0xa5, 0x3f, 0x27, 0x65, 0x3d, + 0xea, 0xfc, 0x77, 0x9d, 0xdd, 0x98, 0xb8, 0x6e, + 0xbc, 0x9f, 0x6b, 0x12, 0xd7, 0xe6, 0x64, 0x92, + 0xc4, 0x75, 0x9f, 0xf4, 0x73, 0x4d, 0x52, 0xb8, + 0xd6, 0x7e, 0xae, 0xd9, 0x99, 0xa7, 0x4e, 0x6c, + 0x59, 0xee, 0x1d, 0x99, 0x94, 0xf7, 0x57, 0x7d, + 0x4c, 0x96, 0x9b, 0xe4, 0xca, 0xb2, 0x4c, 0xad, + 0x7e, 0x96, 0x93, 0xfd, 0xa4, 0x2e, 0x31, 0xcb, + 0xac, 0x3b, 0x71, 0xa5, 0x4f, 0x6b, 0x2d, 0x17, + 0x7d, 0xe3, 0x2c, 0x47, 0x57, 0x98, 0xc1, 0xb2, + 0xcd, 0xbe, 0xc4, 0x75, 0x6e, 0x1f, 0xdf, 0xac, + 0x47, 0x91, 0x1e, 0x0d, 0x95, 0xba, 0xb8, 0xe8, + 0xb9, 0x4c, 0xd6, 0x5b, 0xaa, 0xce, 0x28, 0xdb, + 0x20, 0x47, 0x47, 0xdf, 0xd8, 0x2e, 0x4e, 0xd8, + 0x57, 0xc8, 0x36, 0xc8, 0x31, 0xb0, 0xff, 0x72, + 0x62, 0xac, 0x76, 0xd4, 0x0f, 0x4e, 0x86, 0xe4, + 0xf0, 0x48, 0x88, 0xaa, 0xd5, 0x05, 0xd9, 0x06, + 0x17, 0x41, 0x5f, 0x4f, 0x94, 0xb9, 0x8f, 0xa9, + 0xdf, 0x6a, 0x91, 0x6c, 0x87, 0xfa, 0x30, 0x8a, + 0xed, 0xba, 0x3e, 0x90, 0x6d, 0x4c, 0xdd, 0xff, + 0x37, 0xcb, 0x6d, 0xd7, 0xc4, 0xf5, 0x71, 0x99, + 0x70, 0x63, 0x88, 0x2e, 0xea, 0x0f, 0xf9, 0xae, + 0x7b, 0xab, 0x09, 0xb2, 0x1e, 0x0d, 0xca, 0xe8, + 0x47, 0xdd, 0xc5, 0xef, 0x7b, 0x83, 0xac, 0xc7, + 0x05, 0xca, 0x20, 0xd9, 0x1e, 0xd5, 0x48, 0xd4, + 0x97, 0x97, 0xbf, 0x07, 0x55, 0x0d, 0x14, 0xbd, + 0x8e, 0x1e, 0x15, 0xb2, 0xde, 0xfe, 0x4a, 0x5c, + 0x17, 0x1d, 0x07, 0xdc, 0xec, 0xbe, 0xac, 0x83, + 0xa6, 0xc1, 0xd3, 0x3f, 0x8f, 0x66, 0xe7, 0xe2, + 0xd8, 0x2e, 0x7b, 0x23, 0xac, 0xad, 0x4e, 0x7b, + 0xbb, 0xd9, 0x6d, 0x75, 0xae, 0x5a, 0xcd, 0x4b, + 0xda, 0x69, 0xd7, 0xfd, 0x72, 0x20, 0x35, 0x47, + 0x7e, 0x3b, 0x2d, 0x47, 0xca, 0xe1, 0x84, 0xb3, + 0xd1, 0xbe, 0xad, 0x51, 0x6b, 0xe6, 0x4f, 0x43, + 0xab, 0x95, 0x2e, 0x36, 0x16, 0x20, 0x91, 0x98, + 0xa7, 0x56, 0x1f, 0xfa, 0xd9, 0x9c, 0x18, 0x96, + 0x4a, 0x58, 0x5b, 0xb5, 0x44, 0x9d, 0xef, 0xb6, + 0xa9, 0x17, 0xcc, 0xb6, 0x48, 0x68, 0xb9, 0xb2, + 0xef, 0x1b, 0x9f, 0x99, 0xa2, 0x70, 0xea, 0xbb, + 0x68, 0x3c, 0xf6, 0x9a, 0x44, 0xad, 0xbf, 0x2f, + 0xdb, 0xaa, 0x75, 0xbd, 0x19, 0x5a, 0x77, 0x4f, + 0x43, 0xa0, 0xd2, 0x8e, 0x18, 0x6f, 0xb7, 0xdd, + 0x5f, 0x6b, 0xad, 0xde, 0xb9, 0xe8, 0x38, 0x21, + 0xaf, 0x53, 0x15, 0x52, 0x8d, 0xbc, 0x5e, 0xab, + 0x03, 0xe4, 0x3c, 0x39, 0xf8, 0x3e, 0xaf, 0xd9, + 0x1e, 0xfd, 0x9a, 0x29, 0x86, 0x2e, 0x13, 0x56, + 0x5a, 0x79, 0x3f, 0x3a, 0xbf, 0xf7, 0xe8, 0xd1, + 0xf6, 0x52, 0xab, 0x6f, 0xef, 0xe2, 0xe2, 0xb4, + 0xc4, 0x7e, 0x48, 0xfd, 0xf6, 0xa2, 0xa8, 0x75, + 0xf3, 0x2b, 0x2f, 0xc4, 0x77, 0x0d, 0x13, 0x57, + 0x81, 0x06, 0x1e, 0x65, 0x17, 0x01, 0x06, 0x4a, + 0x18, 0x37, 0xcb, 0x3f, 0x3c, 0x31, 0x95, 0x63, + 0x09, 0xae, 0x8e, 0x27, 0xc3, 0x0a, 0x6e, 0x08, + 0x0d, 0x7e, 0x4a, 0x24, 0xae, 0xe4, 0x8e, 0xd7, + 0x6d, 0x51, 0xa3, 0xa7, 0xda, 0xa0, 0x0f, 0x43, + 0x3f, 0x47, 0x73, 0x3f, 0xd3, 0x8a, 0x49, 0x62, + 0x98, 0x13, 0x2e, 0x0d, 0xc4, 0x68, 0x9d, 0xcc, + 0xa8, 0x50, 0x7d, 0x28, 0xea, 0x24, 0x17, 0xfd, + 0xf1, 0x9c, 0xc0, 0xef, 0x93, 0x68, 0x9e, 0x6c, + 0xd1, 0x42, 0xb6, 0x76, 0x5c, 0x0f, 0x1d, 0x11, + 0xa7, 0x56, 0xfc, 0x5c, 0x16, 0xb1, 0x6e, 0x57, + 0xec, 0xb7, 0xb5, 0x91, 0xbe, 0x28, 0x76, 0x27, + 0x47, 0x3b, 0x2f, 0xfa, 0xfa, 0xf4, 0x0e, 0xea, + 0xf3, 0x9a, 0x65, 0x49, 0x39, 0x19, 0xca, 0x90, + 0x63, 0xa7, 0x8b, 0x01, 0x5c, 0xc8, 0x1d, 0x32, + 0xdd, 0x8e, 0x16, 0x7d, 0xae, 0xea, 0xe0, 0x27, + 0x9a, 0x65, 0xe2, 0x2a, 0x4e, 0xe8, 0x14, 0x41, + 0xd1, 0x07, 0xaf, 0x34, 0x6e, 0x3a, 0x7f, 0x5c, + 0xa2, 0x1c, 0xf0, 0xe0, 0xa5, 0xfb, 0xe0, 0xca, + 0xbb, 0x76, 0x32, 0x67, 0x9f, 0xdd, 0x1f, 0x27, + 0xf9, 0x5a, 0x0e, 0xb5, 0x2c, 0xb6, 0x5b, 0xa4, + 0xef, 0xe4, 0x3c, 0xd5, 0x47, 0x38, 0xdf, 0xeb, + 0x9f, 0x64, 0x42, 0xbd, 0x1f, 0x45, 0xe2, 0xf3, + 0x72, 0xc6, 0x9c, 0xe8, 0x18, 0x83, 0x76, 0xd2, + 0xa8, 0x2c, 0xfa, 0xea, 0x05, 0x87, 0x0e, 0x24, + 0x51, 0x8e, 0xc0, 0x85, 0x41, 0x77, 0x3c, 0xda, + 0x8f, 0x16, 0xf5, 0xd5, 0x5e, 0x05, 0x2d, 0xf7, + 0xcb, 0xaa, 0x93, 0x79, 0xf8, 0x4d, 0x6a, 0x09, + 0xf5, 0xa3, 0xf2, 0xfb, 0x2e, 0x1c, 0x52, 0x71, + 0x1b, 0x1b, 0x52, 0x52, 0x73, 0x40, 0x33, 0x71, + 0xd5, 0x18, 0x75, 0x39, 0x93, 0x8e, 0xe2, 0xad, + 0xa3, 0x73, 0x05, 0x4e, 0x2b, 0xc0, 0xb2, 0xae, + 0x91, 0x46, 0x38, 0xd5, 0x16, 0xc5, 0x6b, 0x56, + 0xcb, 0x6d, 0x71, 0xd2, 0xdf, 0x1f, 0xc5, 0x93, + 0x14, 0x29, 0x96, 0x86, 0x76, 0x4d, 0xe9, 0x1b, + 0x7c, 0xa2, 0xd6, 0x35, 0x86, 0x22, 0x67, 0xc6, + 0x99, 0xa5, 0xce, 0x8e, 0x6e, 0x0e, 0x7d, 0xb9, + 0x5e, 0x8e, 0xe1, 0xe7, 0xe5, 0x77, 0x1a, 0x8f, + 0xc1, 0x4b, 0x6e, 0xba, 0x76, 0x67, 0xa2, 0xa1, + 0xed, 0x10, 0x48, 0x4c, 0x4a, 0x2b, 0x35, 0xac, + 0xdb, 0x97, 0xf2, 0x3d, 0x90, 0x73, 0xa7, 0xcf, + 0xf1, 0x26, 0x1c, 0x9b, 0xed, 0xb7, 0xb3, 0xfd, + 0xb2, 0x0c, 0x7d, 0x65, 0x19, 0xc0, 0xa3, 0xbc, + 0xfa, 0xa4, 0xbe, 0xb2, 0x56, 0x05, 0xb3, 0x4e, + 0x9b, 0x3e, 0xa7, 0xd7, 0x8e, 0x49, 0x72, 0xe8, + 0xb4, 0x13, 0x58, 0x25, 0x7a, 0x1b, 0x4f, 0xed, + 0x74, 0x26, 0xae, 0x6a, 0xe4, 0x44, 0x4e, 0xb1, + 0x70, 0xd9, 0xff, 0x8f, 0x56, 0xd7, 0xd4, 0x19, + 0x35, 0x75, 0x82, 0x1d, 0x6f, 0xc8, 0xf2, 0x43, + 0x8b, 0x19, 0x57, 0x41, 0x43, 0x89, 0x12, 0xfb, + 0x2c, 0x77, 0xc2, 0xd9, 0xd7, 0x6a, 0x75, 0x96, + 0x57, 0xce, 0x89, 0xb4, 0x56, 0x74, 0xdd, 0xe7, + 0x3a, 0xed, 0xb4, 0x8b, 0x3b, 0x95, 0xf4, 0xde, + 0x29, 0x27, 0xdf, 0xf3, 0xe9, 0x09, 0xea, 0xbb, + 0xa9, 0x7f, 0xa6, 0xff, 0x21, 0xa5, 0x0c, 0x25, + 0x12, 0x56, 0x46, 0xa7, 0x02, 0x09, 0x75, 0xad, + 0xb8, 0xba, 0x6c, 0x3d, 0xdc, 0x2b, 0xff, 0x13, + 0x25, 0x03, 0x54, 0x0b, 0x94, 0xa6, 0xba, 0x4a, + 0x6d, 0x53, 0xdc, 0x6d, 0x69, 0xc8, 0x6f, 0x32, + 0x04, 0x7d, 0x80, 0xe7, 0xf6, 0x79, 0xcd, 0x77, + 0xc7, 0xc5, 0x1f, 0xc7, 0x4c, 0x79, 0x77, 0x24, + 0xf6, 0xe5, 0xe3, 0xf3, 0x5b, 0x2e, 0x4e, 0x9d, + 0xfb, 0x2d, 0x53, 0x24, 0xbb, 0xc9, 0x01, 0x74, + 0x50, 0xab, 0x8b, 0xbf, 0x50, 0xfe, 0xaf, 0xd3, + 0x56, 0x8c, 0x4d, 0xb4, 0x9f, 0xd8, 0x16, 0x4c, + 0x5c, 0xd5, 0x45, 0x0e, 0xa9, 0xc4, 0x78, 0xc3, + 0x5d, 0x9c, 0x1c, 0xe6, 0xb6, 0x58, 0x5c, 0x23, + 0x5a, 0x04, 0xd7, 0x8a, 0xa1, 0x1e, 0xb0, 0x4c, + 0x0e, 0x62, 0xcd, 0x3e, 0xda, 0x4e, 0xbb, 0x28, + 0x6a, 0x2d, 0xbb, 0xd6, 0x54, 0xe5, 0xf3, 0xb2, + 0x6c, 0x39, 0x00, 0x07, 0x3e, 0x94, 0x13, 0x4c, + 0x59, 0x62, 0x30, 0x23, 0xcb, 0xd0, 0xa1, 0x9f, + 0xc6, 0x4e, 0x0c, 0x3a, 0x51, 0xfb, 0x4e, 0x9a, + 0xee, 0x23, 0x59, 0x86, 0xd7, 0xe8, 0x3a, 0x52, + 0xba, 0x55, 0x3e, 0x43, 0x79, 0x91, 0xd4, 0x87, + 0xbb, 0xbc, 0xd4, 0x4e, 0xe4, 0xd4, 0x07, 0x6f, + 0xca, 0x96, 0x6e, 0x52, 0x80, 0x76, 0x9f, 0xa8, + 0x15, 0xc5, 0x92, 0xeb, 0xa7, 0x45, 0x33, 0xff, + 0xff, 0xb2, 0x41, 0xfd, 0x6b, 0x89, 0xdf, 0xb0, + 0x77, 0xc8, 0xbe, 0xf6, 0xfd, 0x19, 0x8d, 0xab, + 0x1c, 0xe1, 0x8a, 0x76, 0x02, 0x0c, 0x6f, 0x58, + 0x1b, 0xf6, 0xb1, 0x4f, 0xed, 0x02, 0xa9, 0x1c, + 0x3d, 0xaa, 0x66, 0xe8, 0x0d, 0x1a, 0x86, 0xaa, + 0xb5, 0x98, 0xbe, 0x5d, 0xfe, 0xf7, 0x9d, 0x52, + 0x1f, 0xbf, 0xcf, 0x98, 0xb8, 0xaa, 0x8b, 0xfe, + 0x6a, 0x8b, 0x5a, 0x95, 0x9e, 0x96, 0x18, 0x3a, + 0x6e, 0xef, 0xaa, 0xe8, 0xe3, 0x5a, 0xab, 0x9f, + 0x62, 0x58, 0xbf, 0x7b, 0xb7, 0x27, 0xb3, 0xb9, + 0xb2, 0x0c, 0x03, 0x51, 0xb4, 0x8f, 0xb6, 0x84, + 0x71, 0x83, 0x6b, 0xb9, 0x46, 0x06, 0xc3, 0xa0, + 0x28, 0xb2, 0x57, 0xfb, 0xfe, 0x74, 0x33, 0xa9, + 0x15, 0x0b, 0x4f, 0x8a, 0xd7, 0xb3, 0x1c, 0x83, + 0x0d, 0xb4, 0x8f, 0x7a, 0xb1, 0x7c, 0xad, 0xdb, + 0x43, 0xb7, 0x6f, 0x77, 0xad, 0x1f, 0x27, 0x89, + 0xe5, 0xe3, 0x16, 0x6d, 0x3f, 0xaf, 0x93, 0xc8, + 0xd5, 0x46, 0xe0, 0xa1, 0x81, 0x13, 0x5d, 0x68, + 0xd6, 0xa1, 0xf6, 0x21, 0x16, 0x0e, 0x42, 0xb0, + 0x04, 0x06, 0x64, 0x60, 0x44, 0xae, 0xd2, 0x3b, + 0x92, 0xb0, 0x71, 0xaf, 0x60, 0x46, 0x19, 0x5a, + 0x2a, 0xb2, 0x0e, 0xdd, 0xec, 0x6a, 0xc5, 0xeb, + 0x14, 0x0d, 0xf7, 0x35, 0x36, 0xe0, 0xde, 0xa7, + 0xb5, 0x62, 0xce, 0xa7, 0x66, 0x9b, 0x43, 0x2f, + 0x4c, 0x6a, 0xad, 0xd7, 0xef, 0x90, 0xf7, 0xee, + 0x4d, 0xc4, 0xf2, 0x1a, 0xfb, 0xe1, 0xe0, 0x56, + 0xcd, 0x03, 0x71, 0xd3, 0x8a, 0x12, 0x2d, 0x88, + 0xb9, 0x33, 0xce, 0xd2, 0xd8, 0x0f, 0x89, 0xdd, + 0xcc, 0xc4, 0x55, 0x13, 0x39, 0x01, 0x90, 0x83, + 0x5a, 0x94, 0x2b, 0x7d, 0x45, 0x96, 0xdb, 0x27, + 0x47, 0x45, 0xde, 0x87, 0x5c, 0x58, 0xd9, 0xf9, + 0x1e, 0x9c, 0xdc, 0xe8, 0x06, 0x44, 0x4b, 0xd9, + 0xde, 0x56, 0x55, 0x79, 0x8d, 0xa2, 0x4d, 0x12, + 0xa3, 0xde, 0x11, 0x67, 0x96, 0x95, 0xcf, 0x42, + 0xb1, 0x39, 0xfd, 0x81, 0x4b, 0xe4, 0x26, 0xb8, + 0xc3, 0x0d, 0xdd, 0x2e, 0xfa, 0x70, 0x31, 0x50, + 0x0e, 0x40, 0x01, 0x4e, 0xa0, 0xd4, 0xc3, 0x8d, + 0x51, 0xb4, 0xfb, 0xdc, 0x6c, 0x6b, 0x5e, 0xd1, + 0x1e, 0xff, 0x6f, 0xad, 0x21, 0xd5, 0x64, 0xc0, + 0x8f, 0xa0, 0x58, 0xb2, 0x96, 0xf3, 0xe1, 0xe6, + 0x07, 0x0f, 0xee, 0x3b, 0xa9, 0xe5, 0x79, 0x12, + 0x56, 0xfa, 0x78, 0x96, 0xa5, 0x15, 0xe0, 0x46, + 0xef, 0xcd, 0x18, 0xc8, 0x6b, 0x50, 0xdb, 0xce, + 0x4d, 0xf3, 0xfe, 0xe4, 0x18, 0xb7, 0x82, 0xb6, + 0x01, 0xb5, 0xc4, 0xa7, 0x36, 0xac, 0xe1, 0x22, + 0xf4, 0x97, 0x7f, 0xcf, 0x68, 0x76, 0x0a, 0x75, + 0xe0, 0xdd, 0x21, 0x50, 0x1b, 0xf9, 0xec, 0x24, + 0x30, 0xec, 0x93, 0xe5, 0xfe, 0xc8, 0x58, 0xc2, + 0xbd, 0x7d, 0x7e, 0xe7, 0xe0, 0x06, 0xfb, 0x25, + 0xba, 0xbc, 0x54, 0x07, 0x5c, 0xc8, 0xfb, 0x73, + 0x2e, 0xa7, 0xee, 0xb3, 0xd6, 0x65, 0x6c, 0x9d, + 0x28, 0x15, 0xa1, 0x0f, 0x74, 0xe9, 0x39, 0xf9, + 0x0c, 0xdd, 0x41, 0xff, 0x7b, 0x65, 0x39, 0x2e, + 0xa4, 0xc8, 0xe1, 0xef, 0xea, 0xf4, 0xc7, 0xc4, + 0x55, 0x25, 0x5a, 0x9f, 0xf6, 0x75, 0x4b, 0xe1, + 0x84, 0xbd, 0xca, 0x89, 0x6a, 0x2b, 0xf8, 0x3c, + 0xb5, 0x13, 0x0d, 0x75, 0x5b, 0x0c, 0x1e, 0xfe, + 0x9e, 0x1c, 0xac, 0xe4, 0x26, 0x0e, 0x4f, 0x1c, + 0x92, 0xa0, 0x1e, 0xf4, 0x1e, 0x09, 0x46, 0xbe, + 0xe1, 0x24, 0x50, 0x1d, 0x27, 0x79, 0x45, 0x0c, + 0x64, 0x5e, 0x6b, 0x31, 0x4b, 0x8e, 0xe5, 0xf4, + 0xbc, 0xe7, 0x23, 0x13, 0xd7, 0x49, 0xf0, 0x39, + 0x2e, 0x97, 0xb8, 0x6d, 0x82, 0x8b, 0x15, 0x72, + 0x7c, 0xb5, 0xfe, 0x7c, 0x8f, 0x4f, 0x82, 0xd5, + 0xed, 0xfa, 0x40, 0xa2, 0x49, 0xce, 0xe7, 0xd3, + 0x59, 0xef, 0xe4, 0xc4, 0x6d, 0x12, 0x4d, 0x8e, + 0x34, 0x53, 0x82, 0x44, 0xf7, 0xc9, 0x89, 0x5a, + 0x37, 0x93, 0x49, 0xce, 0x28, 0xdb, 0x64, 0x74, + 0x25, 0xc6, 0x49, 0x2e, 0x71, 0xbc, 0x33, 0x78, + 0x01, 0xc3, 0x02, 0xd2, 0x58, 0xed, 0x50, 0xb6, + 0x99, 0x38, 0x2c, 0x41, 0xc2, 0xc4, 0x5d, 0x68, + 0x18, 0x07, 0xb9, 0x44, 0xbd, 0xf0, 0xd4, 0x20, + 0x20, 0x5b, 0x54, 0xab, 0x67, 0xe3, 0xff, 0x64, + 0x78, 0xbc, 0x5b, 0x24, 0x18, 0x2a, 0xf2, 0x46, + 0x09, 0x46, 0x5b, 0x5b, 0x4a, 0x96, 0xe5, 0xc2, + 0xa0, 0x36, 0xa0, 0x0b, 0x09, 0x39, 0xa5, 0x0e, + 0x83, 0xe4, 0x3b, 0x64, 0x72, 0x4a, 0xf3, 0x60, + 0x1a, 0x2f, 0x4c, 0xe5, 0x0e, 0xf3, 0xde, 0x24, + 0xe8, 0x0c, 0x32, 0x52, 0x36, 0xb4, 0xe3, 0x2a, + 0x86, 0x2e, 0x6b, 0xc7, 0x67, 0x99, 0x87, 0x2c, + 0x11, 0xdd, 0x2a, 0x86, 0xda, 0x85, 0x1c, 0x9e, + 0x95, 0xe5, 0x9e, 0x99, 0xe0, 0xb7, 0x3b, 0x5f, + 0xe2, 0x82, 0x09, 0x6e, 0x08, 0x40, 0x7b, 0x89, + 0x72, 0x60, 0xfc, 0xb5, 0x6b, 0xbf, 0x17, 0x06, + 0x7f, 0x29, 0xaf, 0xd0, 0xa8, 0xe7, 0x7e, 0x6f, + 0x3e, 0x0b, 0x8d, 0xeb, 0xae, 0x9d, 0x98, 0x2a, + 0xe6, 0xcf, 0xe3, 0x0b, 0x25, 0xc6, 0xc7, 0x03, + 0xbf, 0x7f, 0xb7, 0x85, 0xfb, 0xae, 0x54, 0x5e, + 0x65, 0xed, 0x6c, 0x8e, 0xd0, 0x34, 0x25, 0x3b, + 0xf2, 0x52, 0x23, 0x34, 0x95, 0xb2, 0x1e, 0x77, + 0x46, 0xa9, 0xb5, 0xb8, 0x24, 0xd7, 0xda, 0x3b, + 0xbe, 0x69, 0xd6, 0xe3, 0xe4, 0x4d, 0x02, 0xbc, + 0xb6, 0xbb, 0xe2, 0x20, 0xcb, 0x92, 0x03, 0xe5, + 0x86, 0xd6, 0x0c, 0xcb, 0x37, 0x0f, 0xc5, 0x78, + 0x7c, 0x86, 0xee, 0x7e, 0xcd, 0xe7, 0x39, 0x24, + 0xdb, 0x5d, 0x74, 0x57, 0x9c, 0x9b, 0x64, 0x99, + 0xda, 0xc8, 0x36, 0x13, 0x59, 0x97, 0x09, 0xb9, + 0xbf, 0x5a, 0xc2, 0xd5, 0xc5, 0xe7, 0xe0, 0x33, + 0xcc, 0xbb, 0x78, 0x65, 0xdf, 0xe1, 0xee, 0x34, + 0x93, 0x93, 0x54, 0xb6, 0x4f, 0xff, 0xd6, 0xf2, + 0xd6, 0x67, 0x5c, 0xe8, 0xd0, 0x52, 0x99, 0x93, + 0x15, 0xff, 0x7f, 0x2d, 0x67, 0x46, 0x43, 0xa3, + 0xeb, 0x66, 0x5b, 0x93, 0x84, 0x3f, 0xdb, 0xa2, + 0x7e, 0x90, 0x62, 0xfe, 0x9b, 0x37, 0x4f, 0xd4, + 0xf1, 0xde, 0x7c, 0xd6, 0x79, 0x5d, 0x8a, 0x28, + 0xcd, 0x60, 0xb0, 0xff, 0x72, 0x3f, 0x6a, 0xe4, + 0x7d, 0x56, 0x19, 0xa1, 0x89, 0x3e, 0xd3, 0xe5, + 0xed, 0x0e, 0xbb, 0xf8, 0x4c, 0xfc, 0xbf, 0x67, + 0x67, 0x3b, 0xe3, 0x56, 0xd0, 0x73, 0x65, 0x9b, + 0x3f, 0x93, 0xc9, 0x5f, 0x25, 0xca, 0x73, 0xda, + 0x6b, 0xb2, 0x8d, 0x95, 0x8a, 0x4a, 0xb3, 0x4d, + 0x1a, 0x25, 0xf1, 0xff, 0x95, 0xa5, 0x12, 0xb4, + 0x9a, 0xbe, 0x52, 0xb6, 0x3b, 0x1e, 0xf6, 0xf3, + 0xc4, 0x4c, 0xd6, 0x71, 0x2f, 0xd6, 0x77, 0x65, + 0x9b, 0x4d, 0xbd, 0x7c, 0xb6, 0x49, 0x69, 0x0b, + 0xc3, 0x92, 0x56, 0xc7, 0x1e, 0x0e, 0x4a, 0x75, + 0xb8, 0x30, 0xe3, 0x7b, 0xea, 0x96, 0xcc, 0xf0, + 0x7b, 0xd5, 0x7e, 0xcf, 0x65, 0x47, 0x68, 0x5a, + 0x38, 0xfa, 0x59, 0xd6, 0xe5, 0x3b, 0xa6, 0xc4, + 0x85, 0x11, 0xd4, 0x6a, 0xd8, 0xaf, 0xd8, 0x36, + 0xe7, 0x62, 0xea, 0x9b, 0xd9, 0x6f, 0xd9, 0x47, + 0xba, 0x9f, 0x93, 0xef, 0x95, 0xcf, 0x54, 0x6b, + 0x3f, 0xb0, 0x2b, 0x98, 0x73, 0x55, 0x4d, 0xad, + 0x61, 0x13, 0x07, 0xcc, 0xda, 0x07, 0x57, 0x5f, + 0x46, 0x0e, 0x40, 0xc6, 0xee, 0xe5, 0x42, 0x61, + 0x51, 0x83, 0x10, 0x4e, 0x34, 0xe5, 0xc9, 0x75, + 0x6d, 0xf2, 0x39, 0x98, 0x70, 0xf3, 0x70, 0x46, + 0xf2, 0x99, 0x24, 0x8a, 0x15, 0x7c, 0x8e, 0x79, + 0xc7, 0x16, 0xc3, 0x48, 0x3e, 0x28, 0xdb, 0x9b, + 0xb7, 0x8d, 0x31, 0x72, 0xe8, 0x74, 0x8b, 0x21, + 0x57, 0x54, 0x4b, 0x58, 0xa9, 0x0b, 0xbd, 0x5f, + 0xb6, 0x35, 0x95, 0xa3, 0x6e, 0x1f, 0x73, 0xd3, + 0xf5, 0x79, 0x17, 0x0c, 0xfc, 0x43, 0xf3, 0x12, + 0x56, 0xb6, 0xc1, 0x90, 0x7b, 0xd5, 0x84, 0x75, + 0x0b, 0xb8, 0x50, 0xaa, 0x35, 0xba, 0x1a, 0xe3, + 0xfb, 0x1b, 0x8a, 0xbe, 0xad, 0xb5, 0xdf, 0xbe, + 0x76, 0x9f, 0xd6, 0xa5, 0xe4, 0xff, 0x66, 0x20, + 0x8f, 0xb2, 0x05, 0x3d, 0xb8, 0x78, 0x1f, 0x27, + 0x82, 0x24, 0x52, 0xcd, 0x58, 0xe3, 0xeb, 0x94, + 0xf7, 0xe6, 0x62, 0x90, 0x41, 0xed, 0xfb, 0x1a, + 0xbb, 0xb1, 0x7f, 0x91, 0xe8, 0x77, 0x13, 0x2c, + 0x7e, 0x2f, 0x6e, 0x97, 0xb8, 0x51, 0xf9, 0x6c, + 0xec, 0xb7, 0x8c, 0xab, 0x3e, 0x73, 0x1b, 0xc4, + 0x16, 0xbf, 0x03, 0xfb, 0x2b, 0x77, 0x28, 0xe3, + 0x0e, 0x4d, 0x8c, 0xcc, 0xb4, 0xe5, 0xaa, 0x99, + 0x9d, 0xc6, 0xc4, 0x55, 0x35, 0xef, 0x4b, 0x94, + 0xdd, 0x2e, 0x68, 0x58, 0x34, 0x37, 0x67, 0xb7, + 0x49, 0x39, 0xa0, 0x29, 0xb2, 0xe4, 0x26, 0x09, + 0x43, 0x6f, 0xa0, 0xbd, 0xd6, 0x2b, 0x63, 0x4e, + 0x2c, 0x09, 0xc6, 0x08, 0xa6, 0x01, 0x07, 0xc5, + 0xaf, 0x43, 0x90, 0x8b, 0xa6, 0xc5, 0x2f, 0xf7, + 0xc5, 0xac, 0xde, 0x2f, 0x77, 0x20, 0xba, 0x45, + 0xdc, 0x2e, 0xdb, 0xaa, 0xdd, 0x03, 0x96, 0xcf, + 0xca, 0xc5, 0x08, 0x2d, 0x7f, 0xa9, 0xb7, 0x5e, + 0xd8, 0x22, 0xb9, 0xc0, 0x05, 0xcd, 0xad, 0xb3, + 0x8d, 0xf2, 0xbe, 0x9d, 0x5b, 0x96, 0x6d, 0x92, + 0x33, 0xe5, 0xe4, 0x3c, 0xa4, 0xf5, 0x6c, 0xaf, + 0x24, 0x70, 0x24, 0x32, 0xb5, 0x92, 0x16, 0xba, + 0x38, 0xd5, 0xea, 0x4d, 0x87, 0xe8, 0x1b, 0x67, + 0x77, 0xdc, 0x2a, 0x99, 0x0b, 0x9e, 0x79, 0x17, + 0x28, 0x2b, 0xcb, 0xf7, 0x44, 0xc3, 0x34, 0x4a, + 0xc6, 0x6a, 0xf5, 0xe7, 0x25, 0x86, 0x2d, 0x64, + 0x90, 0x8b, 0x5a, 0x83, 0xa3, 0xb5, 0xcb, 0x67, + 0xa3, 0x2b, 0x1e, 0x37, 0x92, 0xa7, 0xdf, 0xee, + 0x2a, 0xc7, 0x18, 0xad, 0xef, 0x97, 0xb9, 0xb8, + 0xdc, 0xb1, 0x36, 0x76, 0x95, 0xbf, 0x5f, 0x58, + 0x2c, 0x3c, 0x25, 0x27, 0x1d, 0x8a, 0x04, 0xcb, + 0x22, 0xcc, 0x0f, 0xe7, 0xc0, 0x58, 0xd8, 0x71, + 0x3b, 0xeb, 0x72, 0xf7, 0x13, 0x46, 0x66, 0x1a, + 0x7b, 0xe1, 0xa2, 0x13, 0x6d, 0xd6, 0xe1, 0x62, + 0x8d, 0x84, 0xb9, 0x1c, 0xdd, 0xe7, 0xe4, 0xac, + 0x3b, 0xd5, 0x50, 0x2a, 0xcb, 0x52, 0x3f, 0x54, + 0x8e, 0x57, 0xfc, 0xb9, 0x2c, 0x37, 0x77, 0x00, + 0x80, 0xf6, 0x3d, 0x18, 0xa7, 0xf4, 0xf8, 0x04, + 0x2d, 0x43, 0x6b, 0x75, 0x99, 0x1c, 0xb4, 0x24, + 0x3c, 0x9c, 0x9c, 0x48, 0x58, 0xce, 0xc8, 0x76, + 0x33, 0x69, 0xd6, 0x67, 0xdf, 0x28, 0xef, 0x7f, + 0x0a, 0x72, 0x7f, 0xcb, 0x0c, 0x3e, 0x3e, 0x91, + 0x6d, 0x51, 0x4f, 0xc8, 0xf7, 0x44, 0x42, 0x4b, + 0x1f, 0xd6, 0xda, 0x49, 0x96, 0x84, 0x84, 0x0b, + 0x15, 0x8a, 0xda, 0x5f, 0x9c, 0xf7, 0xe8, 0x4d, + 0x90, 0xb3, 0x3d, 0xc6, 0x0e, 0xa6, 0x55, 0x31, + 0xff, 0x1f, 0x5d, 0x6b, 0x6a, 0x57, 0xfb, 0x6c, + 0x8f, 0xcf, 0xc9, 0xbe, 0xc7, 0xf7, 0xda, 0x37, + 0xb8, 0xc4, 0x44, 0xb6, 0xcb, 0x84, 0x61, 0xf8, + 0x68, 0x0c, 0x43, 0xfd, 0x70, 0x6d, 0x7c, 0x58, + 0x50, 0xcc, 0x48, 0xae, 0x92, 0xdf, 0xf9, 0x8d, + 0xd9, 0xf6, 0xc2, 0x04, 0x39, 0xdb, 0xe6, 0x3b, + 0x2e, 0x1b, 0x60, 0xbd, 0x28, 0xeb, 0xbe, 0xb2, + 0x9d, 0xef, 0x95, 0x75, 0xe9, 0xbb, 0xcb, 0xcd, + 0x21, 0x8e, 0x4a, 0x94, 0xa3, 0x57, 0xf1, 0xde, + 0xef, 0xcf, 0x76, 0x16, 0xd6, 0x99, 0x67, 0x3b, + 0xdc, 0xbb, 0xb6, 0xd6, 0x60, 0x8c, 0x7b, 0xdd, + 0x6e, 0x29, 0x27, 0x97, 0x6d, 0xb3, 0x2f, 0x53, + 0xff, 0x59, 0x16, 0x0d, 0x93, 0x4b, 0x24, 0x31, + 0xa3, 0xf8, 0x9d, 0xef, 0x60, 0x95, 0xdc, 0x76, + 0x89, 0x6e, 0x59, 0x33, 0x37, 0x57, 0xc8, 0x67, + 0xa0, 0x91, 0x12, 0xb7, 0xbd, 0xa3, 0xf4, 0xe6, + 0xd0, 0xc4, 0xf8, 0xbb, 0x22, 0x77, 0xcb, 0x45, + 0x2f, 0xed, 0x20, 0x18, 0x31, 0xed, 0x9b, 0x59, + 0x96, 0xb1, 0x91, 0x6b, 0xdf, 0xfd, 0x5d, 0xf2, + 0x7a, 0xf7, 0x2e, 0x57, 0x14, 0x79, 0x4f, 0x6e, + 0x77, 0xd8, 0x31, 0xe8, 0x38, 0xc8, 0x76, 0x98, + 0xd0, 0xf5, 0x88, 0xcf, 0x47, 0x3f, 0xe0, 0xbe, + 0x01, 0x5e, 0xf8, 0x3d, 0xb9, 0x2f, 0x31, 0x89, + 0x3f, 0x17, 0x2c, 0x1f, 0xcd, 0xfb, 0x64, 0xb2, + 0x7b, 0x99, 0xb8, 0x0e, 0xb7, 0x63, 0x12, 0xd7, + 0xdd, 0x2e, 0x07, 0x36, 0x5d, 0x0f, 0xa8, 0xa3, + 0xe5, 0xe4, 0xc3, 0xc9, 0x8f, 0xdc, 0x20, 0xb9, + 0x15, 0x6e, 0x35, 0x76, 0x56, 0x0e, 0x5e, 0x12, + 0xa2, 0x8d, 0xcb, 0xe7, 0x60, 0xbf, 0xa3, 0x6e, + 0x90, 0x96, 0xc3, 0x74, 0xb7, 0x21, 0x51, 0xa4, + 0x3e, 0x8e, 0xba, 0xb9, 0x4f, 0x26, 0xe8, 0xa3, + 0xba, 0xf4, 0x55, 0x7a, 0x7b, 0xc2, 0xe2, 0x7f, + 0xe3, 0x44, 0xca, 0xad, 0xd3, 0x48, 0xc4, 0xe9, + 0x06, 0xc4, 0xf6, 0x38, 0x41, 0x7d, 0x69, 0xc8, + 0xf6, 0xba, 0xb2, 0x6d, 0x12, 0x01, 0x12, 0x57, + 0x8a, 0xea, 0x28, 0xd2, 0xe4, 0x82, 0x80, 0xe2, + 0x4f, 0xea, 0xc0, 0x3e, 0x95, 0xed, 0x2e, 0xbc, + 0xa5, 0xdd, 0x3a, 0xb5, 0xff, 0x2b, 0x9f, 0x83, + 0x22, 0x44, 0x8e, 0x5b, 0x9e, 0xe0, 0x18, 0x26, + 0xe7, 0xfc, 0xd5, 0x55, 0xff, 0xcf, 0xdd, 0xa8, + 0xdd, 0xcf, 0xb8, 0x98, 0xa4, 0x5b, 0x15, 0xdf, + 0x0b, 0xb9, 0xc7, 0xef, 0xe4, 0x3b, 0xca, 0x64, + 0xff, 0xcb, 0xe7, 0x23, 0xd1, 0xa7, 0x45, 0x33, + 0x31, 0x1e, 0xc8, 0x83, 0xcf, 0x48, 0xa2, 0x4e, + 0x17, 0xbf, 0xaf, 0x1f, 0x48, 0xbf, 0xa7, 0x89, + 0xeb, 0x70, 0x26, 0xae, 0x92, 0xa4, 0xb9, 0xac, + 0x73, 0x95, 0x24, 0x69, 0xcd, 0x4c, 0x5c, 0x25, + 0x49, 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, 0xd6, + 0xcc, 0xc4, 0x55, 0x92, 0xa4, 0x35, 0x33, 0x71, + 0x95, 0x24, 0x69, 0xcd, 0x4c, 0x5c, 0x25, 0x49, + 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, 0xd6, 0xcc, + 0xc4, 0x55, 0x92, 0xa4, 0x35, 0xdb, 0x6d, 0x83, + 0x48, 0xf0, 0x97, 0x7b, 0x0a, 0x96, 0x43, 0xa9, + 0xad, 0xd3, 0x77, 0xf7, 0x1c, 0x73, 0x70, 0x33, + 0xc6, 0xee, 0x39, 0xef, 0x6a, 0x46, 0x07, 0xda, + 0xe4, 0x80, 0x15, 0xf8, 0xc8, 0xde, 0xdb, 0x37, + 0xc3, 0x9c, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, + 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, + 0x5b, 0xb7, 0x67, 0xcf, 0xff, 0x03, 0x27, 0xa6, + 0xaa, 0x9c, 0x80, 0xec, 0x5b, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, + 0x60, 0x82, +}; + +unsigned int mslogo_jpg_size = sizeof(mslogo_jpg); + +const unsigned char nxlogo_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, + 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, + 0x00, 0x55, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc7, 0x5e, 0x18, 0xd4, + 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x2e, + 0x23, 0x00, 0x00, 0x2e, 0x23, 0x01, 0x78, 0xa5, 0x3f, 0x76, 0x00, + 0x00, 0x0a, 0x4f, 0x69, 0x43, 0x43, 0x50, 0x50, 0x68, 0x6f, 0x74, + 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x49, 0x43, 0x43, 0x20, 0x70, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, + 0x53, 0x67, 0x54, 0x53, 0xe9, 0x16, 0x3d, 0xf7, 0xde, 0xf4, 0x42, + 0x4b, 0x88, 0x80, 0x94, 0x4b, 0x6f, 0x52, 0x15, 0x08, 0x20, 0x52, + 0x42, 0x8b, 0x80, 0x14, 0x91, 0x26, 0x2a, 0x21, 0x09, 0x10, 0x4a, + 0x88, 0x21, 0xa1, 0xd9, 0x15, 0x51, 0xc1, 0x11, 0x45, 0x45, 0x04, + 0x1b, 0xc8, 0xa0, 0x88, 0x03, 0x8e, 0x8e, 0x80, 0x8c, 0x15, 0x51, + 0x2c, 0x0c, 0x8a, 0x0a, 0xd8, 0x07, 0xe4, 0x21, 0xa2, 0x8e, 0x83, + 0xa3, 0x88, 0x8a, 0xca, 0xfb, 0xe1, 0x7b, 0xa3, 0x6b, 0xd6, 0xbc, + 0xf7, 0xe6, 0xcd, 0xfe, 0xb5, 0xd7, 0x3e, 0xe7, 0xac, 0xf3, 0x9d, + 0xb3, 0xcf, 0x07, 0xc0, 0x08, 0x0c, 0x96, 0x48, 0x33, 0x51, 0x35, + 0x80, 0x0c, 0xa9, 0x42, 0x1e, 0x11, 0xe0, 0x83, 0xc7, 0xc4, 0xc6, + 0xe1, 0xe4, 0x2e, 0x40, 0x81, 0x0a, 0x24, 0x70, 0x00, 0x10, 0x08, + 0xb3, 0x64, 0x21, 0x73, 0xfd, 0x23, 0x01, 0x00, 0xf8, 0x7e, 0x3c, + 0x3c, 0x2b, 0x22, 0xc0, 0x07, 0xbe, 0x00, 0x01, 0x78, 0xd3, 0x0b, + 0x08, 0x00, 0xc0, 0x4d, 0x9b, 0xc0, 0x30, 0x1c, 0x87, 0xff, 0x0f, + 0xea, 0x42, 0x99, 0x5c, 0x01, 0x80, 0x84, 0x01, 0xc0, 0x74, 0x91, + 0x38, 0x4b, 0x08, 0x80, 0x14, 0x00, 0x40, 0x7a, 0x8e, 0x42, 0xa6, + 0x00, 0x40, 0x46, 0x01, 0x80, 0x9d, 0x98, 0x26, 0x53, 0x00, 0xa0, + 0x04, 0x00, 0x60, 0xcb, 0x63, 0x62, 0xe3, 0x00, 0x50, 0x2d, 0x00, + 0x60, 0x27, 0x7f, 0xe6, 0xd3, 0x00, 0x80, 0x9d, 0xf8, 0x99, 0x7b, + 0x01, 0x00, 0x5b, 0x94, 0x21, 0x15, 0x01, 0xa0, 0x91, 0x00, 0x20, + 0x13, 0x65, 0x88, 0x44, 0x00, 0x68, 0x3b, 0x00, 0xac, 0xcf, 0x56, + 0x8a, 0x45, 0x00, 0x58, 0x30, 0x00, 0x14, 0x66, 0x4b, 0xc4, 0x39, + 0x00, 0xd8, 0x2d, 0x00, 0x30, 0x49, 0x57, 0x66, 0x48, 0x00, 0xb0, + 0xb7, 0x00, 0xc0, 0xce, 0x10, 0x0b, 0xb2, 0x00, 0x08, 0x0c, 0x00, + 0x30, 0x51, 0x88, 0x85, 0x29, 0x00, 0x04, 0x7b, 0x00, 0x60, 0xc8, + 0x23, 0x23, 0x78, 0x00, 0x84, 0x99, 0x00, 0x14, 0x46, 0xf2, 0x57, + 0x3c, 0xf1, 0x2b, 0xae, 0x10, 0xe7, 0x2a, 0x00, 0x00, 0x78, 0x99, + 0xb2, 0x3c, 0xb9, 0x24, 0x39, 0x45, 0x81, 0x5b, 0x08, 0x2d, 0x71, + 0x07, 0x57, 0x57, 0x2e, 0x1e, 0x28, 0xce, 0x49, 0x17, 0x2b, 0x14, + 0x36, 0x61, 0x02, 0x61, 0x9a, 0x40, 0x2e, 0xc2, 0x79, 0x99, 0x19, + 0x32, 0x81, 0x34, 0x0f, 0xe0, 0xf3, 0xcc, 0x00, 0x00, 0xa0, 0x91, + 0x15, 0x11, 0xe0, 0x83, 0xf3, 0xfd, 0x78, 0xce, 0x0e, 0xae, 0xce, + 0xce, 0x36, 0x8e, 0xb6, 0x0e, 0x5f, 0x2d, 0xea, 0xbf, 0x06, 0xff, + 0x22, 0x62, 0x62, 0xe3, 0xfe, 0xe5, 0xcf, 0xab, 0x70, 0x40, 0x00, + 0x00, 0xe1, 0x74, 0x7e, 0xd1, 0xfe, 0x2c, 0x2f, 0xb3, 0x1a, 0x80, + 0x3b, 0x06, 0x80, 0x6d, 0xfe, 0xa2, 0x25, 0xee, 0x04, 0x68, 0x5e, + 0x0b, 0xa0, 0x75, 0xf7, 0x8b, 0x66, 0xb2, 0x0f, 0x40, 0xb5, 0x00, + 0xa0, 0xe9, 0xda, 0x57, 0xf3, 0x70, 0xf8, 0x7e, 0x3c, 0x3c, 0x45, + 0xa1, 0x90, 0xb9, 0xd9, 0xd9, 0xe5, 0xe4, 0xe4, 0xd8, 0x4a, 0xc4, + 0x42, 0x5b, 0x61, 0xca, 0x57, 0x7d, 0xfe, 0x67, 0xc2, 0x5f, 0xc0, + 0x57, 0xfd, 0x6c, 0xf9, 0x7e, 0x3c, 0xfc, 0xf7, 0xf5, 0xe0, 0xbe, + 0xe2, 0x24, 0x81, 0x32, 0x5d, 0x81, 0x47, 0x04, 0xf8, 0xe0, 0xc2, + 0xcc, 0xf4, 0x4c, 0xa5, 0x1c, 0xcf, 0x92, 0x09, 0x84, 0x62, 0xdc, + 0xe6, 0x8f, 0x47, 0xfc, 0xb7, 0x0b, 0xff, 0xfc, 0x1d, 0xd3, 0x22, + 0xc4, 0x49, 0x62, 0xb9, 0x58, 0x2a, 0x14, 0xe3, 0x51, 0x12, 0x71, + 0x8e, 0x44, 0x9a, 0x8c, 0xf3, 0x32, 0xa5, 0x22, 0x89, 0x42, 0x92, + 0x29, 0xc5, 0x25, 0xd2, 0xff, 0x64, 0xe2, 0xdf, 0x2c, 0xfb, 0x03, + 0x3e, 0xdf, 0x35, 0x00, 0xb0, 0x6a, 0x3e, 0x01, 0x7b, 0x91, 0x2d, + 0xa8, 0x5d, 0x63, 0x03, 0xf6, 0x4b, 0x27, 0x10, 0x58, 0x74, 0xc0, + 0xe2, 0xf7, 0x00, 0x00, 0xf2, 0xbb, 0x6f, 0xc1, 0xd4, 0x28, 0x08, + 0x03, 0x80, 0x68, 0x83, 0xe1, 0xcf, 0x77, 0xff, 0xef, 0x3f, 0xfd, + 0x47, 0xa0, 0x25, 0x00, 0x80, 0x66, 0x49, 0x92, 0x71, 0x00, 0x00, + 0x5e, 0x44, 0x24, 0x2e, 0x54, 0xca, 0xb3, 0x3f, 0xc7, 0x08, 0x00, + 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x1b, 0xf4, 0xc1, 0x18, + 0x2c, 0xc0, 0x06, 0x1c, 0xc1, 0x05, 0xdc, 0xc1, 0x0b, 0xfc, 0x60, + 0x36, 0x84, 0x42, 0x24, 0xc4, 0xc2, 0x42, 0x10, 0x42, 0x0a, 0x64, + 0x80, 0x1c, 0x72, 0x60, 0x29, 0xac, 0x82, 0x42, 0x28, 0x86, 0xcd, + 0xb0, 0x1d, 0x2a, 0x60, 0x2f, 0xd4, 0x40, 0x1d, 0x34, 0xc0, 0x51, + 0x68, 0x86, 0x93, 0x70, 0x0e, 0x2e, 0xc2, 0x55, 0xb8, 0x0e, 0x3d, + 0x70, 0x0f, 0xfa, 0x61, 0x08, 0x9e, 0xc1, 0x28, 0xbc, 0x81, 0x09, + 0x04, 0x41, 0xc8, 0x08, 0x13, 0x61, 0x21, 0xda, 0x88, 0x01, 0x62, + 0x8a, 0x58, 0x23, 0x8e, 0x08, 0x17, 0x99, 0x85, 0xf8, 0x21, 0xc1, + 0x48, 0x04, 0x12, 0x8b, 0x24, 0x20, 0xc9, 0x88, 0x14, 0x51, 0x22, + 0x4b, 0x91, 0x35, 0x48, 0x31, 0x52, 0x8a, 0x54, 0x20, 0x55, 0x48, + 0x1d, 0xf2, 0x3d, 0x72, 0x02, 0x39, 0x87, 0x5c, 0x46, 0xba, 0x91, + 0x3b, 0xc8, 0x00, 0x32, 0x82, 0xfc, 0x86, 0xbc, 0x47, 0x31, 0x94, + 0x81, 0xb2, 0x51, 0x3d, 0xd4, 0x0c, 0xb5, 0x43, 0xb9, 0xa8, 0x37, + 0x1a, 0x84, 0x46, 0xa2, 0x0b, 0xd0, 0x64, 0x74, 0x31, 0x9a, 0x8f, + 0x16, 0xa0, 0x9b, 0xd0, 0x72, 0xb4, 0x1a, 0x3d, 0x8c, 0x36, 0xa1, + 0xe7, 0xd0, 0xab, 0x68, 0x0f, 0xda, 0x8f, 0x3e, 0x43, 0xc7, 0x30, + 0xc0, 0xe8, 0x18, 0x07, 0x33, 0xc4, 0x6c, 0x30, 0x2e, 0xc6, 0xc3, + 0x42, 0xb1, 0x38, 0x2c, 0x09, 0x93, 0x63, 0xcb, 0xb1, 0x22, 0xac, + 0x0c, 0xab, 0xc6, 0x1a, 0xb0, 0x56, 0xac, 0x03, 0xbb, 0x89, 0xf5, + 0x63, 0xcf, 0xb1, 0x77, 0x04, 0x12, 0x81, 0x45, 0xc0, 0x09, 0x36, + 0x04, 0x77, 0x42, 0x20, 0x61, 0x1e, 0x41, 0x48, 0x58, 0x4c, 0x58, + 0x4e, 0xd8, 0x48, 0xa8, 0x20, 0x1c, 0x24, 0x34, 0x11, 0xda, 0x09, + 0x37, 0x09, 0x03, 0x84, 0x51, 0xc2, 0x27, 0x22, 0x93, 0xa8, 0x4b, + 0xb4, 0x26, 0xba, 0x11, 0xf9, 0xc4, 0x18, 0x62, 0x32, 0x31, 0x87, + 0x58, 0x48, 0x2c, 0x23, 0xd6, 0x12, 0x8f, 0x13, 0x2f, 0x10, 0x7b, + 0x88, 0x43, 0xc4, 0x37, 0x24, 0x12, 0x89, 0x43, 0x32, 0x27, 0xb9, + 0x90, 0x02, 0x49, 0xb1, 0xa4, 0x54, 0xd2, 0x12, 0xd2, 0x46, 0xd2, + 0x6e, 0x52, 0x23, 0xe9, 0x2c, 0xa9, 0x9b, 0x34, 0x48, 0x1a, 0x23, + 0x93, 0xc9, 0xda, 0x64, 0x6b, 0xb2, 0x07, 0x39, 0x94, 0x2c, 0x20, + 0x2b, 0xc8, 0x85, 0xe4, 0x9d, 0xe4, 0xc3, 0xe4, 0x33, 0xe4, 0x1b, + 0xe4, 0x21, 0xf2, 0x5b, 0x0a, 0x9d, 0x62, 0x40, 0x71, 0xa4, 0xf8, + 0x53, 0xe2, 0x28, 0x52, 0xca, 0x6a, 0x4a, 0x19, 0xe5, 0x10, 0xe5, + 0x34, 0xe5, 0x06, 0x65, 0x98, 0x32, 0x41, 0x55, 0xa3, 0x9a, 0x52, + 0xdd, 0xa8, 0xa1, 0x54, 0x11, 0x35, 0x8f, 0x5a, 0x42, 0xad, 0xa1, + 0xb6, 0x52, 0xaf, 0x51, 0x87, 0xa8, 0x13, 0x34, 0x75, 0x9a, 0x39, + 0xcd, 0x83, 0x16, 0x49, 0x4b, 0xa5, 0xad, 0xa2, 0x95, 0xd3, 0x1a, + 0x68, 0x17, 0x68, 0xf7, 0x69, 0xaf, 0xe8, 0x74, 0xba, 0x11, 0xdd, + 0x95, 0x1e, 0x4e, 0x97, 0xd0, 0x57, 0xd2, 0xcb, 0xe9, 0x47, 0xe8, + 0x97, 0xe8, 0x03, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x15, 0x83, 0xc7, + 0x88, 0x67, 0x28, 0x19, 0x9b, 0x18, 0x07, 0x18, 0x67, 0x19, 0x77, + 0x18, 0xaf, 0x98, 0x4c, 0xa6, 0x19, 0xd3, 0x8b, 0x19, 0xc7, 0x54, + 0x30, 0x37, 0x31, 0xeb, 0x98, 0xe7, 0x99, 0x0f, 0x99, 0x6f, 0x55, + 0x58, 0x2a, 0xb6, 0x2a, 0x7c, 0x15, 0x91, 0xca, 0x0a, 0x95, 0x4a, + 0x95, 0x26, 0x95, 0x1b, 0x2a, 0x2f, 0x54, 0xa9, 0xaa, 0xa6, 0xaa, + 0xde, 0xaa, 0x0b, 0x55, 0xf3, 0x55, 0xcb, 0x54, 0x8f, 0xa9, 0x5e, + 0x53, 0x7d, 0xae, 0x46, 0x55, 0x33, 0x53, 0xe3, 0xa9, 0x09, 0xd4, + 0x96, 0xab, 0x55, 0xaa, 0x9d, 0x50, 0xeb, 0x53, 0x1b, 0x53, 0x67, + 0xa9, 0x3b, 0xa8, 0x87, 0xaa, 0x67, 0xa8, 0x6f, 0x54, 0x3f, 0xa4, + 0x7e, 0x59, 0xfd, 0x89, 0x06, 0x59, 0xc3, 0x4c, 0xc3, 0x4f, 0x43, + 0xa4, 0x51, 0xa0, 0xb1, 0x5f, 0xe3, 0xbc, 0xc6, 0x20, 0x0b, 0x63, + 0x19, 0xb3, 0x78, 0x2c, 0x21, 0x6b, 0x0d, 0xab, 0x86, 0x75, 0x81, + 0x35, 0xc4, 0x26, 0xb1, 0xcd, 0xd9, 0x7c, 0x76, 0x2a, 0xbb, 0x98, + 0xfd, 0x1d, 0xbb, 0x8b, 0x3d, 0xaa, 0xa9, 0xa1, 0x39, 0x43, 0x33, + 0x4a, 0x33, 0x57, 0xb3, 0x52, 0xf3, 0x94, 0x66, 0x3f, 0x07, 0xe3, + 0x98, 0x71, 0xf8, 0x9c, 0x74, 0x4e, 0x09, 0xe7, 0x28, 0xa7, 0x97, + 0xf3, 0x7e, 0x8a, 0xde, 0x14, 0xef, 0x29, 0xe2, 0x29, 0x1b, 0xa6, + 0x34, 0x4c, 0xb9, 0x31, 0x65, 0x5c, 0x6b, 0xaa, 0x96, 0x97, 0x96, + 0x58, 0xab, 0x48, 0xab, 0x51, 0xab, 0x47, 0xeb, 0xbd, 0x36, 0xae, + 0xed, 0xa7, 0x9d, 0xa6, 0xbd, 0x45, 0xbb, 0x59, 0xfb, 0x81, 0x0e, + 0x41, 0xc7, 0x4a, 0x27, 0x5c, 0x27, 0x47, 0x67, 0x8f, 0xce, 0x05, + 0x9d, 0xe7, 0x53, 0xd9, 0x53, 0xdd, 0xa7, 0x0a, 0xa7, 0x16, 0x4d, + 0x3d, 0x3a, 0xf5, 0xae, 0x2e, 0xaa, 0x6b, 0xa5, 0x1b, 0xa1, 0xbb, + 0x44, 0x77, 0xbf, 0x6e, 0xa7, 0xee, 0x98, 0x9e, 0xbe, 0x5e, 0x80, + 0x9e, 0x4c, 0x6f, 0xa7, 0xde, 0x79, 0xbd, 0xe7, 0xfa, 0x1c, 0x7d, + 0x2f, 0xfd, 0x54, 0xfd, 0x6d, 0xfa, 0xa7, 0xf5, 0x47, 0x0c, 0x58, + 0x06, 0xb3, 0x0c, 0x24, 0x06, 0xdb, 0x0c, 0xce, 0x18, 0x3c, 0xc5, + 0x35, 0x71, 0x6f, 0x3c, 0x1d, 0x2f, 0xc7, 0xdb, 0xf1, 0x51, 0x43, + 0x5d, 0xc3, 0x40, 0x43, 0xa5, 0x61, 0x95, 0x61, 0x97, 0xe1, 0x84, + 0x91, 0xb9, 0xd1, 0x3c, 0xa3, 0xd5, 0x46, 0x8d, 0x46, 0x0f, 0x8c, + 0x69, 0xc6, 0x5c, 0xe3, 0x24, 0xe3, 0x6d, 0xc6, 0x6d, 0xc6, 0xa3, + 0x26, 0x06, 0x26, 0x21, 0x26, 0x4b, 0x4d, 0xea, 0x4d, 0xee, 0x9a, + 0x52, 0x4d, 0xb9, 0xa6, 0x29, 0xa6, 0x3b, 0x4c, 0x3b, 0x4c, 0xc7, + 0xcd, 0xcc, 0xcd, 0xa2, 0xcd, 0xd6, 0x99, 0x35, 0x9b, 0x3d, 0x31, + 0xd7, 0x32, 0xe7, 0x9b, 0xe7, 0x9b, 0xd7, 0x9b, 0xdf, 0xb7, 0x60, + 0x5a, 0x78, 0x5a, 0x2c, 0xb6, 0xa8, 0xb6, 0xb8, 0x65, 0x49, 0xb2, + 0xe4, 0x5a, 0xa6, 0x59, 0xee, 0xb6, 0xbc, 0x6e, 0x85, 0x5a, 0x39, + 0x59, 0xa5, 0x58, 0x55, 0x5a, 0x5d, 0xb3, 0x46, 0xad, 0x9d, 0xad, + 0x25, 0xd6, 0xbb, 0xad, 0xbb, 0xa7, 0x11, 0xa7, 0xb9, 0x4e, 0x93, + 0x4e, 0xab, 0x9e, 0xd6, 0x67, 0xc3, 0xb0, 0xf1, 0xb6, 0xc9, 0xb6, + 0xa9, 0xb7, 0x19, 0xb0, 0xe5, 0xd8, 0x06, 0xdb, 0xae, 0xb6, 0x6d, + 0xb6, 0x7d, 0x61, 0x67, 0x62, 0x17, 0x67, 0xb7, 0xc5, 0xae, 0xc3, + 0xee, 0x93, 0xbd, 0x93, 0x7d, 0xba, 0x7d, 0x8d, 0xfd, 0x3d, 0x07, + 0x0d, 0x87, 0xd9, 0x0e, 0xab, 0x1d, 0x5a, 0x1d, 0x7e, 0x73, 0xb4, + 0x72, 0x14, 0x3a, 0x56, 0x3a, 0xde, 0x9a, 0xce, 0x9c, 0xee, 0x3f, + 0x7d, 0xc5, 0xf4, 0x96, 0xe9, 0x2f, 0x67, 0x58, 0xcf, 0x10, 0xcf, + 0xd8, 0x33, 0xe3, 0xb6, 0x13, 0xcb, 0x29, 0xc4, 0x69, 0x9d, 0x53, + 0x9b, 0xd3, 0x47, 0x67, 0x17, 0x67, 0xb9, 0x73, 0x83, 0xf3, 0x88, + 0x8b, 0x89, 0x4b, 0x82, 0xcb, 0x2e, 0x97, 0x3e, 0x2e, 0x9b, 0x1b, + 0xc6, 0xdd, 0xc8, 0xbd, 0xe4, 0x4a, 0x74, 0xf5, 0x71, 0x5d, 0xe1, + 0x7a, 0xd2, 0xf5, 0x9d, 0x9b, 0xb3, 0x9b, 0xc2, 0xed, 0xa8, 0xdb, + 0xaf, 0xee, 0x36, 0xee, 0x69, 0xee, 0x87, 0xdc, 0x9f, 0xcc, 0x34, + 0x9f, 0x29, 0x9e, 0x59, 0x33, 0x73, 0xd0, 0xc3, 0xc8, 0x43, 0xe0, + 0x51, 0xe5, 0xd1, 0x3f, 0x0b, 0x9f, 0x95, 0x30, 0x6b, 0xdf, 0xac, + 0x7e, 0x4f, 0x43, 0x4f, 0x81, 0x67, 0xb5, 0xe7, 0x23, 0x2f, 0x63, + 0x2f, 0x91, 0x57, 0xad, 0xd7, 0xb0, 0xb7, 0xa5, 0x77, 0xaa, 0xf7, + 0x61, 0xef, 0x17, 0x3e, 0xf6, 0x3e, 0x72, 0x9f, 0xe3, 0x3e, 0xe3, + 0x3c, 0x37, 0xde, 0x32, 0xde, 0x59, 0x5f, 0xcc, 0x37, 0xc0, 0xb7, + 0xc8, 0xb7, 0xcb, 0x4f, 0xc3, 0x6f, 0x9e, 0x5f, 0x85, 0xdf, 0x43, + 0x7f, 0x23, 0xff, 0x64, 0xff, 0x7a, 0xff, 0xd1, 0x00, 0xa7, 0x80, + 0x25, 0x01, 0x67, 0x03, 0x89, 0x81, 0x41, 0x81, 0x5b, 0x02, 0xfb, + 0xf8, 0x7a, 0x7c, 0x21, 0xbf, 0x8e, 0x3f, 0x3a, 0xdb, 0x65, 0xf6, + 0xb2, 0xd9, 0xed, 0x41, 0x8c, 0xa0, 0xb9, 0x41, 0x15, 0x41, 0x8f, + 0x82, 0xad, 0x82, 0xe5, 0xc1, 0xad, 0x21, 0x68, 0xc8, 0xec, 0x90, + 0xad, 0x21, 0xf7, 0xe7, 0x98, 0xce, 0x91, 0xce, 0x69, 0x0e, 0x85, + 0x50, 0x7e, 0xe8, 0xd6, 0xd0, 0x07, 0x61, 0xe6, 0x61, 0x8b, 0xc3, + 0x7e, 0x0c, 0x27, 0x85, 0x87, 0x85, 0x57, 0x86, 0x3f, 0x8e, 0x70, + 0x88, 0x58, 0x1a, 0xd1, 0x31, 0x97, 0x35, 0x77, 0xd1, 0xdc, 0x43, + 0x73, 0xdf, 0x44, 0xfa, 0x44, 0x96, 0x44, 0xde, 0x9b, 0x67, 0x31, + 0x4f, 0x39, 0xaf, 0x2d, 0x4a, 0x35, 0x2a, 0x3e, 0xaa, 0x2e, 0x6a, + 0x3c, 0xda, 0x37, 0xba, 0x34, 0xba, 0x3f, 0xc6, 0x2e, 0x66, 0x59, + 0xcc, 0xd5, 0x58, 0x9d, 0x58, 0x49, 0x6c, 0x4b, 0x1c, 0x39, 0x2e, + 0x2a, 0xae, 0x36, 0x6e, 0x6c, 0xbe, 0xdf, 0xfc, 0xed, 0xf3, 0x87, + 0xe2, 0x9d, 0xe2, 0x0b, 0xe3, 0x7b, 0x17, 0x98, 0x2f, 0xc8, 0x5d, + 0x70, 0x79, 0xa1, 0xce, 0xc2, 0xf4, 0x85, 0xa7, 0x16, 0xa9, 0x2e, + 0x12, 0x2c, 0x3a, 0x96, 0x40, 0x4c, 0x88, 0x4e, 0x38, 0x94, 0xf0, + 0x41, 0x10, 0x2a, 0xa8, 0x16, 0x8c, 0x25, 0xf2, 0x13, 0x77, 0x25, + 0x8e, 0x0a, 0x79, 0xc2, 0x1d, 0xc2, 0x67, 0x22, 0x2f, 0xd1, 0x36, + 0xd1, 0x88, 0xd8, 0x43, 0x5c, 0x2a, 0x1e, 0x4e, 0xf2, 0x48, 0x2a, + 0x4d, 0x7a, 0x92, 0xec, 0x91, 0xbc, 0x35, 0x79, 0x24, 0xc5, 0x33, + 0xa5, 0x2c, 0xe5, 0xb9, 0x84, 0x27, 0xa9, 0x90, 0xbc, 0x4c, 0x0d, + 0x4c, 0xdd, 0x9b, 0x3a, 0x9e, 0x16, 0x9a, 0x76, 0x20, 0x6d, 0x32, + 0x3d, 0x3a, 0xbd, 0x31, 0x83, 0x92, 0x91, 0x90, 0x71, 0x42, 0xaa, + 0x21, 0x4d, 0x93, 0xb6, 0x67, 0xea, 0x67, 0xe6, 0x66, 0x76, 0xcb, + 0xac, 0x65, 0x85, 0xb2, 0xfe, 0xc5, 0x6e, 0x8b, 0xb7, 0x2f, 0x1e, + 0x95, 0x07, 0xc9, 0x6b, 0xb3, 0x90, 0xac, 0x05, 0x59, 0x2d, 0x0a, + 0xb6, 0x42, 0xa6, 0xe8, 0x54, 0x5a, 0x28, 0xd7, 0x2a, 0x07, 0xb2, + 0x67, 0x65, 0x57, 0x66, 0xbf, 0xcd, 0x89, 0xca, 0x39, 0x96, 0xab, + 0x9e, 0x2b, 0xcd, 0xed, 0xcc, 0xb3, 0xca, 0xdb, 0x90, 0x37, 0x9c, + 0xef, 0x9f, 0xff, 0xed, 0x12, 0xc2, 0x12, 0xe1, 0x92, 0xb6, 0xa5, + 0x86, 0x4b, 0x57, 0x2d, 0x1d, 0x58, 0xe6, 0xbd, 0xac, 0x6a, 0x39, + 0xb2, 0x3c, 0x71, 0x79, 0xdb, 0x0a, 0xe3, 0x15, 0x05, 0x2b, 0x86, + 0x56, 0x06, 0xac, 0x3c, 0xb8, 0x8a, 0xb6, 0x2a, 0x6d, 0xd5, 0x4f, + 0xab, 0xed, 0x57, 0x97, 0xae, 0x7e, 0xbd, 0x26, 0x7a, 0x4d, 0x6b, + 0x81, 0x5e, 0xc1, 0xca, 0x82, 0xc1, 0xb5, 0x01, 0x6b, 0xeb, 0x0b, + 0x55, 0x0a, 0xe5, 0x85, 0x7d, 0xeb, 0xdc, 0xd7, 0xed, 0x5d, 0x4f, + 0x58, 0x2f, 0x59, 0xdf, 0xb5, 0x61, 0xfa, 0x86, 0x9d, 0x1b, 0x3e, + 0x15, 0x89, 0x8a, 0xae, 0x14, 0xdb, 0x17, 0x97, 0x15, 0x7f, 0xd8, + 0x28, 0xdc, 0x78, 0xe5, 0x1b, 0x87, 0x6f, 0xca, 0xbf, 0x99, 0xdc, + 0x94, 0xb4, 0xa9, 0xab, 0xc4, 0xb9, 0x64, 0xcf, 0x66, 0xd2, 0x66, + 0xe9, 0xe6, 0xde, 0x2d, 0x9e, 0x5b, 0x0e, 0x96, 0xaa, 0x97, 0xe6, + 0x97, 0x0e, 0x6e, 0x0d, 0xd9, 0xda, 0xb4, 0x0d, 0xdf, 0x56, 0xb4, + 0xed, 0xf5, 0xf6, 0x45, 0xdb, 0x2f, 0x97, 0xcd, 0x28, 0xdb, 0xbb, + 0x83, 0xb6, 0x43, 0xb9, 0xa3, 0xbf, 0x3c, 0xb8, 0xbc, 0x65, 0xa7, + 0xc9, 0xce, 0xcd, 0x3b, 0x3f, 0x54, 0xa4, 0x54, 0xf4, 0x54, 0xfa, + 0x54, 0x36, 0xee, 0xd2, 0xdd, 0xb5, 0x61, 0xd7, 0xf8, 0x6e, 0xd1, + 0xee, 0x1b, 0x7b, 0xbc, 0xf6, 0x34, 0xec, 0xd5, 0xdb, 0x5b, 0xbc, + 0xf7, 0xfd, 0x3e, 0xc9, 0xbe, 0xdb, 0x55, 0x01, 0x55, 0x4d, 0xd5, + 0x66, 0xd5, 0x65, 0xfb, 0x49, 0xfb, 0xb3, 0xf7, 0x3f, 0xae, 0x89, + 0xaa, 0xe9, 0xf8, 0x96, 0xfb, 0x6d, 0x5d, 0xad, 0x4e, 0x6d, 0x71, + 0xed, 0xc7, 0x03, 0xd2, 0x03, 0xfd, 0x07, 0x23, 0x0e, 0xb6, 0xd7, + 0xb9, 0xd4, 0xd5, 0x1d, 0xd2, 0x3d, 0x54, 0x52, 0x8f, 0xd6, 0x2b, + 0xeb, 0x47, 0x0e, 0xc7, 0x1f, 0xbe, 0xfe, 0x9d, 0xef, 0x77, 0x2d, + 0x0d, 0x36, 0x0d, 0x55, 0x8d, 0x9c, 0xc6, 0xe2, 0x23, 0x70, 0x44, + 0x79, 0xe4, 0xe9, 0xf7, 0x09, 0xdf, 0xf7, 0x1e, 0x0d, 0x3a, 0xda, + 0x76, 0x8c, 0x7b, 0xac, 0xe1, 0x07, 0xd3, 0x1f, 0x76, 0x1d, 0x67, + 0x1d, 0x2f, 0x6a, 0x42, 0x9a, 0xf2, 0x9a, 0x46, 0x9b, 0x53, 0x9a, + 0xfb, 0x5b, 0x62, 0x5b, 0xba, 0x4f, 0xcc, 0x3e, 0xd1, 0xd6, 0xea, + 0xde, 0x7a, 0xfc, 0x47, 0xdb, 0x1f, 0x0f, 0x9c, 0x34, 0x3c, 0x59, + 0x79, 0x4a, 0xf3, 0x54, 0xc9, 0x69, 0xda, 0xe9, 0x82, 0xd3, 0x93, + 0x67, 0xf2, 0xcf, 0x8c, 0x9d, 0x95, 0x9d, 0x7d, 0x7e, 0x2e, 0xf9, + 0xdc, 0x60, 0xdb, 0xa2, 0xb6, 0x7b, 0xe7, 0x63, 0xce, 0xdf, 0x6a, + 0x0f, 0x6f, 0xef, 0xba, 0x10, 0x74, 0xe1, 0xd2, 0x45, 0xff, 0x8b, + 0xe7, 0x3b, 0xbc, 0x3b, 0xce, 0x5c, 0xf2, 0xb8, 0x74, 0xf2, 0xb2, + 0xdb, 0xe5, 0x13, 0x57, 0xb8, 0x57, 0x9a, 0xaf, 0x3a, 0x5f, 0x6d, + 0xea, 0x74, 0xea, 0x3c, 0xfe, 0x93, 0xd3, 0x4f, 0xc7, 0xbb, 0x9c, + 0xbb, 0x9a, 0xae, 0xb9, 0x5c, 0x6b, 0xb9, 0xee, 0x7a, 0xbd, 0xb5, + 0x7b, 0x66, 0xf7, 0xe9, 0x1b, 0x9e, 0x37, 0xce, 0xdd, 0xf4, 0xbd, + 0x79, 0xf1, 0x16, 0xff, 0xd6, 0xd5, 0x9e, 0x39, 0x3d, 0xdd, 0xbd, + 0xf3, 0x7a, 0x6f, 0xf7, 0xc5, 0xf7, 0xf5, 0xdf, 0x16, 0xdd, 0x7e, + 0x72, 0x27, 0xfd, 0xce, 0xcb, 0xbb, 0xd9, 0x77, 0x27, 0xee, 0xad, + 0xbc, 0x4f, 0xbc, 0x5f, 0xf4, 0x40, 0xed, 0x41, 0xd9, 0x43, 0xdd, + 0x87, 0xd5, 0x3f, 0x5b, 0xfe, 0xdc, 0xd8, 0xef, 0xdc, 0x7f, 0x6a, + 0xc0, 0x77, 0xa0, 0xf3, 0xd1, 0xdc, 0x47, 0xf7, 0x06, 0x85, 0x83, + 0xcf, 0xfe, 0x91, 0xf5, 0x8f, 0x0f, 0x43, 0x05, 0x8f, 0x99, 0x8f, + 0xcb, 0x86, 0x0d, 0x86, 0xeb, 0x9e, 0x38, 0x3e, 0x39, 0x39, 0xe2, + 0x3f, 0x72, 0xfd, 0xe9, 0xfc, 0xa7, 0x43, 0xcf, 0x64, 0xcf, 0x26, + 0x9e, 0x17, 0xfe, 0xa2, 0xfe, 0xcb, 0xae, 0x17, 0x16, 0x2f, 0x7e, + 0xf8, 0xd5, 0xeb, 0xd7, 0xce, 0xd1, 0x98, 0xd1, 0xa1, 0x97, 0xf2, + 0x97, 0x93, 0xbf, 0x6d, 0x7c, 0xa5, 0xfd, 0xea, 0xc0, 0xeb, 0x19, + 0xaf, 0xdb, 0xc6, 0xc2, 0xc6, 0x1e, 0xbe, 0xc9, 0x78, 0x33, 0x31, + 0x5e, 0xf4, 0x56, 0xfb, 0xed, 0xc1, 0x77, 0xdc, 0x77, 0x1d, 0xef, + 0xa3, 0xdf, 0x0f, 0x4f, 0xe4, 0x7c, 0x20, 0x7f, 0x28, 0xff, 0x68, + 0xf9, 0xb1, 0xf5, 0x53, 0xd0, 0xa7, 0xfb, 0x93, 0x19, 0x93, 0x93, + 0xff, 0x04, 0x03, 0x98, 0xf3, 0xfc, 0x63, 0x33, 0x2d, 0xdb, 0x00, + 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25, + 0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0x80, + 0xe9, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, + 0x3a, 0x98, 0x00, 0x00, 0x17, 0x6f, 0x92, 0x5f, 0xc5, 0x46, 0x00, + 0x00, 0x25, 0xa0, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xec, 0x9d, + 0x79, 0x94, 0x25, 0x55, 0x9d, 0xe7, 0xbf, 0xbf, 0x1b, 0xf1, 0xf6, + 0xf7, 0x72, 0xad, 0x5c, 0xaa, 0xa8, 0x3d, 0x6b, 0x2f, 0x76, 0x41, + 0x60, 0x4a, 0xb4, 0xb1, 0x65, 0x5c, 0xda, 0xb6, 0x15, 0x6c, 0x04, + 0xec, 0xd1, 0x43, 0xab, 0xad, 0x07, 0x41, 0x1a, 0xa4, 0x6d, 0x9d, + 0x46, 0xa4, 0x68, 0xa8, 0xee, 0x39, 0x72, 0xa6, 0xad, 0xee, 0x71, + 0x10, 0x97, 0x71, 0x03, 0xb4, 0x61, 0x46, 0x4b, 0xc7, 0x6d, 0xc0, + 0x06, 0x51, 0xb1, 0x9a, 0x62, 0x69, 0x4a, 0xaa, 0x84, 0xda, 0xf7, + 0x25, 0x2b, 0xf7, 0xcc, 0x97, 0x6f, 0x8d, 0xb8, 0x77, 0xfe, 0x78, + 0x2f, 0x5f, 0x46, 0xc6, 0x8b, 0xe5, 0xde, 0xb7, 0x64, 0x15, 0x95, + 0xf1, 0xcb, 0x13, 0xe7, 0x45, 0xdc, 0xb8, 0xb1, 0x64, 0x44, 0xdc, + 0x4f, 0x7c, 0x7f, 0xbf, 0x7b, 0xe3, 0x5e, 0x12, 0x42, 0x20, 0xb0, + 0xc0, 0x02, 0x0b, 0xec, 0x6c, 0x30, 0xbd, 0x32, 0xf7, 0x4a, 0x28, + 0xb8, 0x1a, 0x73, 0xdb, 0xe8, 0x2c, 0xfb, 0x7f, 0x82, 0x37, 0xf5, + 0x9c, 0x06, 0x5a, 0x60, 0x73, 0x11, 0x4a, 0xf4, 0x3a, 0xfa, 0xbf, + 0x44, 0x8d, 0xff, 0x5b, 0x3d, 0x60, 0x0b, 0xa0, 0x18, 0x00, 0x2d, + 0xb0, 0x26, 0x00, 0x85, 0x9a, 0xb0, 0xcf, 0x66, 0xc0, 0x8d, 0x6c, + 0x30, 0x20, 0x17, 0x40, 0xf8, 0x1d, 0x4b, 0x34, 0x00, 0x68, 0x6e, + 0xe7, 0xa0, 0x02, 0x32, 0xd5, 0xf3, 0x0c, 0xc0, 0x18, 0x00, 0x6d, + 0x4e, 0x82, 0xaa, 0x11, 0x20, 0xa3, 0x1a, 0xd3, 0x65, 0x0b, 0xf9, + 0xeb, 0xd1, 0x05, 0x15, 0x75, 0xae, 0xf7, 0xcb, 0x27, 0x6a, 0x54, + 0x81, 0xd4, 0xa0, 0xe3, 0x07, 0x16, 0x00, 0xed, 0x8c, 0x51, 0x54, + 0xb2, 0x70, 0xaa, 0x15, 0x54, 0x8d, 0x06, 0x2a, 0x35, 0xf1, 0xfa, + 0x34, 0xa3, 0x40, 0x37, 0x1a, 0x56, 0x32, 0xfb, 0x15, 0x8a, 0x69, + 0xd4, 0x60, 0x70, 0x05, 0xe0, 0x0b, 0x80, 0x36, 0x6b, 0xa0, 0x22, + 0xc5, 0xe5, 0x46, 0xe4, 0x21, 0x0f, 0x05, 0x56, 0x0f, 0xe4, 0xfc, + 0xd6, 0x89, 0x3a, 0xae, 0x6d, 0xb3, 0x63, 0x5c, 0x42, 0x61, 0x3b, + 0xe1, 0xf2, 0xff, 0xd4, 0xbb, 0x2c, 0x9b, 0x26, 0x0b, 0x3e, 0x31, + 0x0b, 0xd7, 0x36, 0x00, 0xda, 0xeb, 0x14, 0x5e, 0x24, 0xe1, 0x86, + 0x91, 0x02, 0x50, 0x6a, 0x9d, 0xf7, 0x5a, 0xb6, 0x9e, 0x1f, 0x29, + 0x9c, 0x5b, 0xbd, 0x10, 0x6e, 0x94, 0x02, 0xa3, 0x1a, 0x0b, 0x9c, + 0x4a, 0xec, 0xac, 0x56, 0xa8, 0xd8, 0xd3, 0x6b, 0x81, 0x91, 0xdf, + 0xb1, 0xb9, 0x87, 0xdb, 0xe9, 0xb4, 0x1f, 0xbf, 0x3c, 0xf5, 0x54, + 0x78, 0x38, 0xc1, 0xf0, 0xac, 0x01, 0xdf, 0xd9, 0x08, 0x34, 0x55, + 0xa5, 0x41, 0x92, 0xb0, 0x80, 0x4b, 0x3e, 0xf2, 0x59, 0x2f, 0xb3, + 0x9d, 0xca, 0xbe, 0x6b, 0x85, 0x62, 0xbd, 0x8a, 0xd2, 0x0d, 0xb0, + 0xb3, 0x61, 0xa2, 0xce, 0x3c, 0x2a, 0x8a, 0xaa, 0x96, 0x75, 0x7e, + 0x79, 0x34, 0x8f, 0x3c, 0x2a, 0x40, 0x13, 0x8a, 0xe7, 0xe5, 0xf4, + 0x42, 0x70, 0x4b, 0xf3, 0x52, 0xa8, 0x01, 0xd0, 0xce, 0x40, 0x17, + 0xb1, 0x1e, 0x65, 0x45, 0x35, 0x02, 0x8d, 0x1a, 0xb8, 0x4f, 0x55, + 0x78, 0xd6, 0x0b, 0xbe, 0x7a, 0x94, 0xdc, 0x6c, 0x83, 0x4d, 0x36, + 0x5d, 0x45, 0x55, 0x89, 0x1a, 0xe0, 0xd3, 0x88, 0x34, 0xfb, 0x7a, + 0xd9, 0xe3, 0xab, 0x9c, 0xa7, 0x9b, 0x5b, 0x4d, 0x75, 0x2a, 0xea, + 0x00, 0x68, 0x0a, 0x50, 0x12, 0x35, 0xa8, 0x0b, 0xbf, 0x02, 0xed, + 0x07, 0x1c, 0xaa, 0x03, 0x54, 0xcc, 0x03, 0x2c, 0x2a, 0x80, 0x53, + 0x01, 0x9a, 0xaa, 0x02, 0x54, 0x51, 0x70, 0xf5, 0xac, 0x6b, 0x86, + 0x22, 0x53, 0x8d, 0x4b, 0xc9, 0xaa, 0x23, 0x15, 0xd7, 0x4f, 0x16, + 0x32, 0x42, 0x72, 0x1b, 0x51, 0xc3, 0x7e, 0x54, 0x20, 0x57, 0x8b, + 0xbb, 0xeb, 0xe4, 0xa6, 0x8a, 0x1a, 0x42, 0x02, 0x73, 0x1a, 0x68, + 0x7e, 0x6a, 0xa1, 0x96, 0xc2, 0x2e, 0x03, 0x18, 0xaa, 0x01, 0x68, + 0xaa, 0xeb, 0x64, 0xd2, 0x1a, 0x01, 0xba, 0x7a, 0x21, 0x56, 0x4f, + 0xcd, 0xab, 0x4a, 0x9e, 0x46, 0x34, 0x65, 0x10, 0x75, 0x02, 0x4d, + 0x46, 0x9d, 0x71, 0x87, 0x02, 0x2c, 0x24, 0xe0, 0x21, 0x0b, 0x23, + 0x2e, 0x01, 0x39, 0x21, 0x09, 0x41, 0xaf, 0x63, 0x92, 0xe5, 0x58, + 0x4e, 0xe7, 0xac, 0x0a, 0xa9, 0x46, 0xd7, 0xdc, 0x9e, 0x15, 0x40, + 0x93, 0xa9, 0x9d, 0x53, 0x71, 0xf3, 0xfc, 0xd2, 0x54, 0xd6, 0xcb, + 0x6c, 0xe7, 0xb6, 0xec, 0x96, 0xa7, 0x51, 0xc0, 0x54, 0x01, 0x7d, + 0xbd, 0x95, 0x09, 0xcd, 0xaa, 0x48, 0x68, 0x26, 0xd0, 0xbc, 0xd4, + 0x46, 0xa3, 0xd5, 0x96, 0x97, 0x6a, 0x72, 0xcb, 0xa3, 0x9a, 0xae, + 0x9a, 0xc7, 0x29, 0xff, 0xd4, 0xcb, 0x5d, 0xe5, 0x3c, 0x49, 0xe1, + 0x85, 0x41, 0xa7, 0x53, 0xc1, 0xe9, 0xa7, 0x11, 0x60, 0x2a, 0xe0, + 0x52, 0x2d, 0xf8, 0xa4, 0xb8, 0xae, 0x96, 0x3c, 0xaa, 0xfb, 0xf3, + 0xdb, 0x4e, 0x15, 0x7e, 0x32, 0xea, 0x4e, 0x45, 0xd9, 0x9d, 0x89, + 0x71, 0x35, 0x51, 0x47, 0x5a, 0x2d, 0x6e, 0x96, 0x1f, 0xe4, 0xb8, + 0xc7, 0xbe, 0x65, 0x41, 0x63, 0xcf, 0xeb, 0x97, 0x66, 0xdf, 0x07, + 0x57, 0x84, 0x98, 0xa8, 0x21, 0xbf, 0xd7, 0xf9, 0x93, 0xc3, 0xb2, + 0xd7, 0x3d, 0x98, 0xd5, 0xda, 0x54, 0xfd, 0x34, 0x43, 0x4c, 0x36, + 0xae, 0x54, 0x0b, 0xb4, 0x98, 0x0b, 0x64, 0xbc, 0x00, 0x44, 0x3e, + 0xdb, 0xc8, 0x82, 0x4c, 0x45, 0xf1, 0x35, 0x5a, 0xdd, 0xb9, 0xb9, + 0xd7, 0x24, 0x79, 0xcd, 0x9d, 0xe2, 0x96, 0xcd, 0x6a, 0xbc, 0xab, + 0xaa, 0xd6, 0x54, 0x9a, 0x66, 0xa8, 0xa8, 0xad, 0x46, 0x2a, 0x30, + 0x19, 0xd5, 0xa5, 0x02, 0x34, 0xbf, 0x6d, 0x55, 0xd6, 0x73, 0x17, + 0x40, 0x3a, 0xad, 0x93, 0x85, 0x20, 0x24, 0x5c, 0xd5, 0x59, 0x6b, + 0x2a, 0xa2, 0x9f, 0x06, 0x80, 0xc9, 0x2a, 0x30, 0x2f, 0xf5, 0x62, + 0x2f, 0xe8, 0x4e, 0xf0, 0x62, 0x12, 0x70, 0x52, 0x99, 0x9c, 0xf6, + 0x55, 0x0b, 0x34, 0x6b, 0x49, 0x53, 0x75, 0x9f, 0xa1, 0xb0, 0x5e, + 0xc6, 0x05, 0x55, 0x6d, 0xd2, 0x51, 0x0f, 0xd0, 0xfc, 0xdc, 0x94, + 0x7a, 0x63, 0x64, 0x8d, 0x70, 0x25, 0x9d, 0x00, 0x81, 0x1a, 0x81, + 0x04, 0x05, 0x28, 0x35, 0x62, 0x72, 0x3b, 0x86, 0x17, 0xd8, 0x84, + 0x24, 0x70, 0xdd, 0xd2, 0xc8, 0xe1, 0xda, 0x35, 0x25, 0xf6, 0xa6, + 0x9f, 0x81, 0x10, 0xb3, 0x17, 0x42, 0xbb, 0xda, 0x60, 0x92, 0x00, + 0x62, 0x0a, 0xdb, 0xb0, 0x06, 0x82, 0x4f, 0x55, 0x11, 0xaa, 0xa8, + 0x36, 0x15, 0xc0, 0xc1, 0x27, 0x7d, 0x36, 0x9a, 0x77, 0x34, 0x22, + 0x86, 0xa6, 0xda, 0x18, 0xb6, 0xd6, 0x66, 0x16, 0xaa, 0x2a, 0xab, + 0x16, 0x80, 0x41, 0x41, 0x3d, 0xc9, 0x4c, 0xbc, 0x46, 0xa8, 0xf1, + 0x06, 0xec, 0x4b, 0xe6, 0x9c, 0xfd, 0x62, 0x6c, 0x4e, 0x80, 0x13, + 0x67, 0x0a, 0xd0, 0x64, 0xe2, 0x62, 0xb2, 0xae, 0x17, 0x73, 0x98, + 0x67, 0x92, 0x10, 0x62, 0x1e, 0xdb, 0x31, 0x8f, 0xed, 0xdd, 0xf2, + 0x63, 0x16, 0xa0, 0x67, 0x3d, 0x2e, 0x6a, 0x80, 0x9c, 0x9f, 0xcb, + 0x5a, 0x6b, 0xe5, 0x01, 0x29, 0x42, 0xac, 0xd9, 0xdf, 0x72, 0xaa, + 0x36, 0xc1, 0x90, 0x49, 0x53, 0x8d, 0x79, 0xf9, 0xc5, 0xc2, 0xb8, + 0xa4, 0x22, 0xe3, 0x0a, 0xca, 0x8c, 0x37, 0x00, 0x52, 0xdc, 0x76, + 0x7e, 0xc2, 0x63, 0xde, 0x2d, 0xcd, 0xbe, 0xcc, 0x6a, 0x50, 0x85, + 0x7e, 0xf7, 0xb5, 0x2e, 0xb7, 0x54, 0x6f, 0x22, 0xc4, 0x64, 0x00, + 0xa6, 0xaa, 0x9a, 0x98, 0x07, 0x98, 0xfc, 0xd2, 0x9c, 0xd2, 0xfd, + 0x00, 0x47, 0x35, 0xa6, 0x91, 0xe2, 0xff, 0xd9, 0x58, 0xd7, 0x94, + 0x2c, 0xf7, 0xa0, 0x1a, 0x69, 0x24, 0xa1, 0xff, 0x08, 0x64, 0x79, + 0x73, 0x7a, 0x37, 0xb7, 0x24, 0x4b, 0xa8, 0x9c, 0x2c, 0x8f, 0x20, + 0xd9, 0x1e, 0x59, 0x72, 0xd8, 0xb2, 0x1a, 0x38, 0x54, 0x4e, 0x17, + 0xe5, 0x73, 0x20, 0x97, 0x87, 0x7a, 0xba, 0x78, 0x88, 0xca, 0x16, + 0x53, 0xc7, 0x99, 0x9a, 0xf3, 0xd6, 0x5f, 0xc2, 0x56, 0xc4, 0x84, + 0x65, 0x7f, 0xb2, 0xc1, 0x7c, 0xa1, 0x00, 0x37, 0x37, 0xd0, 0x71, + 0x1b, 0xe4, 0xa0, 0x00, 0x1c, 0xbf, 0x3c, 0xdc, 0x07, 0x56, 0x7e, + 0x70, 0xe3, 0x12, 0xfb, 0xf2, 0x02, 0xa1, 0x4c, 0x8c, 0x4e, 0x06, + 0x6e, 0x62, 0x36, 0x80, 0xa6, 0xda, 0x8c, 0x82, 0x24, 0xd4, 0x8e, + 0x1b, 0x68, 0x64, 0x97, 0x99, 0x47, 0x9a, 0xdb, 0x7a, 0x37, 0x55, + 0xe7, 0x04, 0x38, 0xbb, 0x62, 0xf3, 0x53, 0x8f, 0xf0, 0xf9, 0x5f, + 0xdd, 0x01, 0x4f, 0x16, 0x38, 0x4d, 0xef, 0xa9, 0x34, 0xa7, 0x01, + 0x60, 0x65, 0x44, 0xd0, 0x0c, 0xec, 0x94, 0x96, 0x8a, 0xd0, 0x60, + 0x82, 0x81, 0x43, 0x33, 0x0b, 0xd0, 0x8a, 0x26, 0x34, 0xd3, 0x84, + 0x56, 0x28, 0x42, 0x2b, 0x1a, 0x60, 0x86, 0x09, 0x8d, 0x73, 0x68, + 0x99, 0x9c, 0xd0, 0xf3, 0x05, 0x68, 0x86, 0x01, 0xdd, 0xe0, 0xd0, + 0x0a, 0x05, 0x68, 0xb9, 0x02, 0xb4, 0xa2, 0x01, 0xcd, 0x30, 0xc1, + 0x4c, 0x0e, 0x56, 0x28, 0x40, 0x1f, 0x1a, 0x15, 0xe1, 0x4c, 0x0e, + 0xa1, 0x6c, 0x0e, 0x7a, 0xae, 0x80, 0x90, 0x61, 0x42, 0x2b, 0x16, + 0x11, 0x32, 0x38, 0x34, 0xce, 0x41, 0x99, 0x1c, 0x34, 0x02, 0xc0, + 0x05, 0xa8, 0x50, 0x84, 0x66, 0x7f, 0x50, 0x0c, 0x43, 0x30, 0x2e, + 0x66, 0x84, 0x0e, 0x00, 0x00, 0x21, 0x9d, 0x4c, 0xb2, 0x00, 0x4b, + 0x08, 0x40, 0xd7, 0xc1, 0x43, 0x1a, 0xb8, 0x00, 0x28, 0xa4, 0x83, + 0x47, 0xc2, 0x30, 0x09, 0x40, 0x24, 0x8c, 0x3c, 0x63, 0x10, 0xb1, + 0x08, 0xf2, 0x21, 0x1d, 0x66, 0x32, 0x8e, 0x42, 0x5b, 0x0a, 0xc5, + 0x64, 0x82, 0x8a, 0x1a, 0x81, 0x6b, 0x1a, 0xb8, 0xae, 0xc3, 0x8c, + 0x84, 0x60, 0xc6, 0x22, 0x30, 0x35, 0x0d, 0xa6, 0xae, 0xc1, 0x08, + 0x87, 0x60, 0xc6, 0xa2, 0x64, 0x84, 0x42, 0x30, 0x35, 0x02, 0x0f, + 0xe9, 0x30, 0x23, 0x61, 0x98, 0x1a, 0x2b, 0xe5, 0x09, 0x87, 0x61, + 0x42, 0x07, 0x07, 0x83, 0x09, 0x1d, 0x26, 0x58, 0xb9, 0xb0, 0x89, + 0x19, 0xa8, 0x2b, 0x15, 0x47, 0xb3, 0x0c, 0x4b, 0x6b, 0x0e, 0x2b, + 0x36, 0x85, 0x2f, 0xe4, 0xb8, 0x43, 0x21, 0x97, 0x55, 0x45, 0x70, + 0x80, 0x90, 0x90, 0x54, 0x5c, 0x6e, 0x80, 0xe2, 0x0e, 0xeb, 0xb9, + 0x07, 0xf0, 0x64, 0xf7, 0xc9, 0x2c, 0xff, 0x23, 0xd9, 0x62, 0xa3, + 0xf6, 0x89, 0xe0, 0x5f, 0x1b, 0x2d, 0xad, 0xda, 0xf4, 0x06, 0x83, + 0xcc, 0xad, 0x86, 0xce, 0x4b, 0xd5, 0x30, 0x05, 0x30, 0xd9, 0xe7, + 0xfd, 0x96, 0xc9, 0x63, 0x9f, 0x4c, 0x42, 0xb9, 0x31, 0x45, 0xc5, + 0xe7, 0xfe, 0xbf, 0x52, 0x05, 0x39, 0xd3, 0xbf, 0xd5, 0x67, 0x59, + 0xd2, 0x24, 0x26, 0x34, 0x70, 0x30, 0x70, 0x30, 0x18, 0xd0, 0x72, + 0x39, 0x84, 0x0a, 0x05, 0xe8, 0xd9, 0x02, 0x42, 0x85, 0x02, 0x42, + 0x27, 0x07, 0x45, 0x6c, 0x60, 0x14, 0xc9, 0xf1, 0x34, 0x62, 0x63, + 0x69, 0x11, 0xc9, 0xe5, 0x11, 0x1e, 0x4f, 0x23, 0x9c, 0xce, 0x22, + 0x92, 0xc9, 0x22, 0x7c, 0xfc, 0x94, 0x88, 0x0f, 0x8e, 0x21, 0x91, + 0xc9, 0x22, 0x9a, 0xc9, 0x41, 0x2f, 0x14, 0xa1, 0x1b, 0x86, 0xd0, + 0x72, 0x05, 0x68, 0x65, 0x80, 0x69, 0x06, 0x87, 0x66, 0x18, 0x20, + 0x93, 0x83, 0x38, 0xaf, 0x86, 0xcd, 0xec, 0x58, 0x73, 0x6b, 0xf1, + 0x89, 0x20, 0x34, 0x06, 0xa1, 0x6b, 0x65, 0xe0, 0x95, 0x01, 0x16, + 0x0b, 0xc3, 0xd4, 0x75, 0x98, 0x21, 0x9d, 0xcc, 0x58, 0x14, 0x46, + 0x3c, 0x86, 0x7c, 0x5b, 0x12, 0x93, 0xf3, 0xe7, 0x51, 0xb6, 0xb5, + 0x05, 0xb9, 0x78, 0x04, 0x85, 0xd6, 0x24, 0x0a, 0xb1, 0x18, 0x0a, + 0xa9, 0x38, 0xf2, 0x6d, 0x29, 0xca, 0xb5, 0x26, 0x31, 0x79, 0x4e, + 0x37, 0x26, 0x13, 0x71, 0xca, 0x47, 0x42, 0x30, 0x23, 0x11, 0x14, + 0xa3, 0x61, 0x14, 0xb5, 0x30, 0x8c, 0xd2, 0xab, 0xa3, 0xfc, 0x0a, + 0x61, 0xe0, 0x15, 0xb4, 0xcd, 0x2c, 0xf2, 0xc2, 0x52, 0xf4, 0xed, + 0xf0, 0x53, 0x71, 0x1b, 0xfd, 0x54, 0x96, 0x53, 0x7e, 0xd3, 0x05, + 0x44, 0x32, 0x40, 0xe3, 0x35, 0x6c, 0x23, 0x3c, 0x7e, 0x9d, 0x20, + 0x4d, 0x0e, 0x80, 0x23, 0xc8, 0x7f, 0xb6, 0x55, 0x13, 0xd0, 0x64, + 0xaa, 0xfd, 0xdd, 0x9a, 0x4f, 0xc8, 0x42, 0x8c, 0xf9, 0xa4, 0xb9, + 0x4d, 0x24, 0xb1, 0xad, 0x0c, 0xf8, 0x54, 0x80, 0xc6, 0x2c, 0x6a, + 0x8a, 0xcd, 0x98, 0xd3, 0x20, 0xa0, 0xcd, 0xd0, 0x5a, 0x84, 0x02, + 0x74, 0xe4, 0x11, 0xce, 0xe4, 0x10, 0xce, 0xe4, 0x10, 0xca, 0x64, + 0x11, 0x19, 0x4d, 0x8b, 0x68, 0x09, 0x4a, 0x88, 0xf4, 0x0f, 0x89, + 0xc4, 0xde, 0x23, 0x68, 0x1f, 0x1c, 0x46, 0xcb, 0x58, 0x5a, 0x44, + 0xc6, 0xd3, 0x88, 0x8e, 0xa6, 0x11, 0xc9, 0x64, 0x11, 0x99, 0xcc, + 0x22, 0x94, 0xcb, 0x8b, 0xd0, 0x64, 0x16, 0xa1, 0x7c, 0x11, 0x7a, + 0x36, 0x07, 0x1d, 0x67, 0xdf, 0x18, 0x00, 0x8d, 0xc7, 0xa5, 0x00, + 0x19, 0x26, 0xc8, 0x30, 0xdd, 0x80, 0x2d, 0x94, 0x00, 0x1b, 0xd2, + 0x61, 0x46, 0x23, 0x30, 0xe2, 0x51, 0x14, 0x63, 0x51, 0x14, 0xe3, + 0x11, 0x2a, 0x26, 0xe2, 0x28, 0x24, 0x63, 0xc8, 0xb7, 0xb5, 0x20, + 0x9f, 0x8a, 0x23, 0xd7, 0xd9, 0x46, 0x99, 0x85, 0x3d, 0x18, 0x59, + 0xbe, 0x90, 0xc6, 0x5a, 0x92, 0xc8, 0xb5, 0x24, 0x91, 0x6b, 0x4d, + 0x52, 0x2e, 0x19, 0x47, 0x3e, 0x11, 0x43, 0x21, 0x16, 0x41, 0x21, + 0x14, 0x45, 0x11, 0x11, 0x14, 0x2a, 0xf0, 0x43, 0x19, 0x39, 0x46, + 0xd9, 0x75, 0xe6, 0x16, 0x87, 0x58, 0xf8, 0xaa, 0x2d, 0x2f, 0xc0, + 0x08, 0x0f, 0x28, 0xb9, 0x81, 0xc8, 0x94, 0x48, 0xf3, 0x9a, 0xdc, + 0x8e, 0x61, 0xdd, 0x0f, 0xb3, 0xe4, 0x23, 0x17, 0x77, 0xdd, 0xab, + 0xe6, 0xdb, 0xd5, 0x15, 0xa5, 0xca, 0xa8, 0x4f, 0xde, 0x83, 0xa4, + 0xf8, 0xa9, 0x32, 0x7b, 0xf3, 0x09, 0x37, 0x77, 0x4d, 0x15, 0x54, + 0xf6, 0x49, 0xab, 0x63, 0x5b, 0x52, 0x4c, 0x9b, 0x5e, 0x37, 0x05, + 0x25, 0xcd, 0x72, 0x06, 0x5a, 0x19, 0x56, 0x26, 0x74, 0x18, 0xd0, + 0x50, 0x40, 0x28, 0x9d, 0x41, 0x38, 0x9d, 0x43, 0xe4, 0xe4, 0x80, + 0x48, 0xee, 0x3b, 0x82, 0xce, 0xfe, 0x21, 0x91, 0x1c, 0x1c, 0x45, + 0x62, 0x70, 0x04, 0xc9, 0x5d, 0x87, 0x44, 0xfb, 0x89, 0x53, 0x68, + 0x9b, 0xc8, 0x88, 0x48, 0x7a, 0x12, 0xe1, 0xc9, 0x2c, 0x22, 0xb9, + 0x02, 0x34, 0x21, 0x02, 0x30, 0x9d, 0xed, 0x16, 0xd2, 0x61, 0xc6, + 0xa2, 0x28, 0xb6, 0x24, 0x90, 0x4f, 0xc4, 0xa9, 0xd0, 0xd1, 0x82, + 0xc9, 0x95, 0x4b, 0x30, 0x34, 0xbf, 0x9b, 0x26, 0x7a, 0xda, 0x30, + 0xd9, 0xd5, 0x89, 0xc9, 0x45, 0xbd, 0x34, 0xbc, 0xfc, 0x1c, 0x1a, + 0x4b, 0xc6, 0x91, 0x4f, 0xc6, 0x91, 0x0b, 0x45, 0x51, 0x84, 0x0e, + 0x03, 0x7a, 0x19, 0x73, 0x1c, 0x02, 0x66, 0x19, 0x01, 0x46, 0xa5, + 0xe8, 0xbb, 0xc1, 0x4c, 0x46, 0x71, 0xc9, 0xac, 0xe3, 0x15, 0x67, + 0x7b, 0x26, 0xdc, 0xb8, 0xe4, 0x64, 0x4a, 0x9c, 0x8f, 0x9b, 0xf2, + 0x74, 0x8b, 0xb7, 0x79, 0xbe, 0x85, 0x64, 0x80, 0x26, 0xf3, 0x01, + 0x37, 0xb9, 0x00, 0xcc, 0x0e, 0x07, 0xcd, 0x07, 0x52, 0x9a, 0x0f, + 0xc0, 0x54, 0xf2, 0xaa, 0xc1, 0x6e, 0x4a, 0x65, 0x31, 0x10, 0x74, + 0x00, 0x7a, 0x25, 0x2c, 0xcd, 0x60, 0x40, 0x47, 0x01, 0xa1, 0x53, + 0x83, 0x48, 0xf5, 0x0f, 0x89, 0xd4, 0xa9, 0x51, 0x24, 0x0f, 0x1f, + 0x13, 0xad, 0xaf, 0xec, 0x41, 0xef, 0xf1, 0x01, 0xd1, 0xda, 0x3f, + 0x8c, 0xc4, 0xd0, 0x28, 0x12, 0x63, 0x13, 0x22, 0x3a, 0x96, 0x46, + 0x64, 0x7c, 0x02, 0x51, 0x11, 0x28, 0xa8, 0xc0, 0x14, 0x2d, 0x16, + 0x45, 0xb1, 0xb5, 0xac, 0xe8, 0xda, 0x5b, 0x91, 0xed, 0xe9, 0x40, + 0xba, 0xab, 0x83, 0x26, 0x57, 0x2f, 0x45, 0xff, 0x9a, 0xe5, 0x34, + 0xd4, 0xdd, 0x8e, 0x74, 0x57, 0x3b, 0xa5, 0x17, 0x74, 0x63, 0x3c, + 0x92, 0x44, 0x0e, 0x3a, 0x0c, 0x30, 0x98, 0x65, 0x55, 0x27, 0x60, + 0x80, 0xca, 0x08, 0x71, 0x72, 0x7a, 0xeb, 0x81, 0x96, 0xe9, 0x91, + 0x5f, 0x65, 0x9d, 0x69, 0x3b, 0x27, 0x53, 0xc2, 0x3d, 0xf5, 0xaa, + 0xa4, 0xa9, 0x82, 0x9a, 0x17, 0xd0, 0x54, 0x02, 0xfd, 0x5e, 0x71, + 0x2a, 0x3f, 0x20, 0x59, 0x7f, 0x9d, 0xe6, 0xdd, 0x96, 0xfd, 0x00, + 0xe7, 0x9c, 0x46, 0x60, 0x65, 0x68, 0x09, 0x68, 0xe5, 0x38, 0x16, + 0x81, 0x50, 0x40, 0xb8, 0x50, 0x72, 0xf3, 0xe2, 0x07, 0x8f, 0x89, + 0xb6, 0x3f, 0xec, 0x17, 0xbd, 0x47, 0x4e, 0xa2, 0xf5, 0xd8, 0x29, + 0xb4, 0x1e, 0xeb, 0x17, 0xa9, 0x13, 0x03, 0x48, 0x1d, 0x38, 0x26, + 0xda, 0x47, 0x26, 0x10, 0x17, 0x3c, 0x80, 0x55, 0x60, 0xa7, 0xc7, + 0xa2, 0x61, 0x14, 0x17, 0xf6, 0xd2, 0xd8, 0x92, 0x05, 0x18, 0x9b, + 0xdf, 0x85, 0xf1, 0x73, 0xba, 0x69, 0x7c, 0x51, 0x0f, 0xc6, 0x96, + 0x2d, 0xa4, 0xc1, 0xf5, 0x7d, 0x34, 0xd0, 0xd9, 0x86, 0xc9, 0x64, + 0x12, 0x59, 0xc4, 0x90, 0x07, 0x81, 0x97, 0x95, 0x9d, 0x80, 0x09, + 0x82, 0x31, 0x03, 0x74, 0x66, 0x1d, 0xf0, 0xaa, 0xe7, 0xd7, 0x4f, + 0xe1, 0x09, 0x97, 0xca, 0x0f, 0x3f, 0xb0, 0x89, 0x5a, 0x81, 0xe6, + 0x57, 0x3b, 0xe9, 0xa5, 0x9e, 0x34, 0x0f, 0x70, 0xe9, 0x0e, 0xeb, + 0x75, 0x1f, 0x80, 0x79, 0x83, 0x8e, 0x55, 0xdc, 0x44, 0x2a, 0xbb, + 0x88, 0x0c, 0x45, 0x84, 0x26, 0xc7, 0x10, 0x3f, 0x78, 0x4c, 0x74, + 0x1e, 0x3d, 0x85, 0xd6, 0x43, 0xc7, 0x45, 0xdb, 0xc1, 0xe3, 0xe8, + 0x78, 0xf9, 0x35, 0xd1, 0xbb, 0xf7, 0x30, 0xe6, 0x0d, 0x8e, 0x8a, + 0xf8, 0xc8, 0x18, 0xe2, 0x41, 0xd1, 0x09, 0xec, 0xf5, 0x66, 0xf1, + 0x28, 0x0a, 0xf3, 0xda, 0x91, 0x99, 0xdf, 0x45, 0x63, 0x17, 0xaf, + 0xc5, 0x89, 0xbe, 0xc5, 0x34, 0xb4, 0x74, 0x3e, 0x8d, 0x2e, 0xea, + 0xc5, 0xc8, 0xe2, 0xf9, 0x34, 0xda, 0xdb, 0x83, 0x31, 0x84, 0x51, + 0x80, 0x06, 0xa3, 0x1c, 0xb3, 0x03, 0xcc, 0xb2, 0xba, 0x13, 0x8e, + 0x10, 0x73, 0x52, 0x5a, 0xa6, 0x0b, 0xa0, 0x0c, 0x5b, 0x9a, 0xe9, + 0x92, 0xd7, 0x94, 0x50, 0x70, 0x6e, 0x8a, 0x0d, 0xf0, 0x6e, 0xb8, + 0x2b, 0xdc, 0x80, 0x26, 0x0b, 0x33, 0xe6, 0x01, 0x33, 0x27, 0x88, + 0x59, 0x27, 0xdd, 0x65, 0x99, 0xd9, 0xd2, 0xbc, 0xf6, 0x31, 0x7d, + 0x1c, 0x02, 0x83, 0x06, 0x42, 0xa8, 0xbc, 0x15, 0x87, 0x66, 0x8c, + 0x23, 0x3e, 0x38, 0x82, 0xd4, 0x91, 0x53, 0xa2, 0x75, 0xef, 0x61, + 0x74, 0xfe, 0xf6, 0x25, 0xb1, 0x64, 0xf7, 0x61, 0xd1, 0xb5, 0xe7, + 0xa0, 0xe8, 0x3c, 0x72, 0x12, 0xed, 0x3c, 0x50, 0x5a, 0x81, 0xcd, + 0x11, 0x6b, 0x6f, 0x41, 0x66, 0xcd, 0x32, 0x1a, 0x58, 0xb6, 0x10, + 0x23, 0x17, 0xaf, 0xa5, 0xa3, 0x17, 0xae, 0xa5, 0x13, 0x4b, 0xe6, + 0xd3, 0x68, 0x6f, 0x27, 0xc6, 0x93, 0x6d, 0x48, 0x23, 0x8c, 0x02, + 0x38, 0x80, 0x02, 0xc8, 0xe2, 0xc4, 0x72, 0x17, 0x20, 0xf1, 0x4a, + 0x35, 0x86, 0x33, 0xac, 0x0c, 0xc9, 0x34, 0xa7, 0x7d, 0x0b, 0x07, + 0xf7, 0xd7, 0x2b, 0xbe, 0x66, 0x85, 0x9a, 0x23, 0xd0, 0x54, 0x61, + 0xe6, 0xe4, 0xe6, 0xb9, 0xc1, 0x4b, 0xb7, 0xa5, 0x79, 0x2d, 0x3b, + 0x41, 0x6f, 0x5a, 0x6f, 0x4d, 0xc5, 0xba, 0x42, 0xe5, 0x38, 0x57, + 0x0e, 0xd1, 0xe1, 0x51, 0x24, 0x5f, 0xdd, 0x27, 0xba, 0xb7, 0xed, + 0x14, 0x8b, 0x5e, 0x7e, 0x55, 0xf4, 0x6e, 0xdb, 0x81, 0xc5, 0x27, + 0x06, 0x44, 0xcb, 0xd8, 0x04, 0xa2, 0xc1, 0x23, 0x1d, 0x58, 0x60, + 0x33, 0x2d, 0x1c, 0x86, 0xd1, 0xdb, 0x89, 0xf4, 0x9a, 0xe5, 0xd4, + 0x7f, 0xf9, 0x05, 0x74, 0xe4, 0xdc, 0x15, 0x74, 0xf2, 0xb2, 0x73, + 0xe9, 0xe8, 0xfc, 0x2e, 0x8c, 0x85, 0x12, 0xc8, 0x42, 0x47, 0x11, + 0x26, 0x84, 0x45, 0xc9, 0xb9, 0x29, 0x30, 0x27, 0x68, 0x19, 0x96, + 0x65, 0xb7, 0x5f, 0xfb, 0x76, 0x4e, 0x6e, 0xa9, 0xa9, 0xa0, 0xd6, + 0xe0, 0x05, 0x34, 0xa7, 0x56, 0xe8, 0x5e, 0x31, 0x32, 0x37, 0x10, + 0xe9, 0x36, 0xa0, 0x39, 0x4d, 0x1a, 0x50, 0xd1, 0x56, 0xce, 0x00, + 0x64, 0x60, 0x08, 0x97, 0x73, 0x15, 0x11, 0x1a, 0x1b, 0x42, 0xcb, + 0xc1, 0xe3, 0xa2, 0x73, 0xfb, 0x2e, 0xcc, 0xff, 0xb7, 0xad, 0x7c, + 0xc5, 0xab, 0x07, 0xd1, 0x7d, 0xe8, 0xb8, 0x68, 0x3b, 0x35, 0x84, + 0x54, 0xf0, 0xa8, 0x06, 0x16, 0x58, 0x6d, 0x96, 0x8c, 0xa3, 0x70, + 0x4e, 0x0f, 0x8d, 0xad, 0x58, 0x8c, 0xc1, 0xcb, 0xcf, 0xa7, 0x43, + 0x57, 0x5e, 0x42, 0x07, 0x57, 0x2c, 0xa4, 0xa1, 0x05, 0xdd, 0x18, + 0xa5, 0x24, 0x32, 0x30, 0x21, 0x50, 0x28, 0x03, 0x4e, 0x54, 0x41, + 0xc9, 0xb0, 0xcd, 0x3b, 0x2d, 0x1b, 0x2e, 0xeb, 0x9d, 0xe0, 0xe8, + 0x04, 0x35, 0xaf, 0xd8, 0x9a, 0x2f, 0xd0, 0x54, 0x5d, 0x4c, 0x2f, + 0x50, 0x59, 0xa7, 0x90, 0x6d, 0xbe, 0x3a, 0x1f, 0x41, 0x43, 0x08, + 0x84, 0x30, 0x04, 0x4c, 0x84, 0xb2, 0xe3, 0x25, 0xf5, 0xf5, 0xd4, + 0xf3, 0x62, 0xc5, 0x6f, 0x5e, 0x10, 0xcb, 0x5e, 0xd8, 0x29, 0x16, + 0x9e, 0x18, 0x40, 0x4b, 0xd0, 0xec, 0x21, 0xb0, 0xc0, 0x9a, 0x6b, + 0x2d, 0x49, 0xe4, 0x56, 0x2e, 0xa1, 0x81, 0xb7, 0x5d, 0x46, 0xfb, + 0xae, 0xb8, 0x88, 0x0e, 0x6d, 0xb8, 0x90, 0x0e, 0xce, 0xeb, 0xc4, + 0x38, 0xa2, 0xc8, 0x96, 0x01, 0x47, 0x30, 0x7d, 0xc1, 0x55, 0xf4, + 0x59, 0x76, 0x02, 0xa0, 0x5b, 0x25, 0x85, 0x6b, 0x4d, 0xa8, 0x0a, + 0xd0, 0xbc, 0x5c, 0x4c, 0x27, 0x05, 0x16, 0xb2, 0xfc, 0x7a, 0xcd, + 0x4f, 0x2f, 0x97, 0x54, 0x18, 0x21, 0x04, 0x42, 0x1e, 0xd1, 0x3d, + 0xfb, 0x45, 0xef, 0xd3, 0xcf, 0xa1, 0xef, 0xa7, 0xbf, 0xe6, 0x6b, + 0x77, 0xec, 0x45, 0xef, 0x81, 0xa3, 0xa2, 0x23, 0x00, 0x58, 0x60, + 0x5e, 0xa6, 0x31, 0xc0, 0xe4, 0xcd, 0x3d, 0x06, 0x51, 0xe9, 0x33, + 0xad, 0xb9, 0x6a, 0x5d, 0xed, 0x48, 0xaf, 0x5a, 0x4a, 0x83, 0x57, + 0xbe, 0x81, 0xf6, 0xff, 0xc9, 0x9b, 0xe9, 0xb5, 0x4b, 0xd6, 0xd1, + 0x91, 0x68, 0x07, 0xc6, 0x21, 0x60, 0x22, 0x0f, 0xc0, 0xa8, 0x54, + 0x12, 0x58, 0xc1, 0x55, 0xb0, 0xcc, 0x5b, 0x7f, 0xed, 0xf3, 0x76, + 0xb5, 0x67, 0x3a, 0xb8, 0xa1, 0x6e, 0x1f, 0xde, 0x57, 0x01, 0x4d, + 0x36, 0x66, 0xe6, 0x14, 0xbc, 0xd7, 0x5d, 0x60, 0x65, 0x9f, 0xc2, + 0x33, 0x96, 0x19, 0x74, 0x44, 0x40, 0xd0, 0x41, 0xc5, 0x71, 0xa4, + 0x5e, 0xd8, 0x21, 0x96, 0xfc, 0xe4, 0x19, 0xb1, 0xee, 0x77, 0x2f, + 0x8b, 0xa5, 0xcf, 0x6d, 0x17, 0x8b, 0xb3, 0x79, 0x84, 0x82, 0x62, + 0x1a, 0x98, 0xac, 0xad, 0x5c, 0x4c, 0xf8, 0xf2, 0xdd, 0x0c, 0xcc, + 0xda, 0x73, 0x3e, 0xa6, 0x03, 0x26, 0x79, 0x03, 0xf8, 0xe4, 0x46, + 0x8e, 0x83, 0xc7, 0x9d, 0x89, 0xc4, 0x08, 0x78, 0xe8, 0x6e, 0x0d, + 0xcb, 0x96, 0x95, 0x8b, 0xd7, 0x0c, 0x92, 0x01, 0xa1, 0x30, 0x70, + 0xf3, 0xbd, 0x1c, 0x3b, 0xf7, 0x06, 0x83, 0x96, 0x4f, 0xd9, 0xaa, + 0xa5, 0x34, 0xb0, 0xe1, 0x22, 0x3a, 0xf0, 0xd6, 0xcb, 0x68, 0xef, + 0x3b, 0xdf, 0x44, 0xaf, 0x75, 0xf6, 0x62, 0x08, 0x0c, 0x05, 0xe4, + 0x40, 0x96, 0xfa, 0xd4, 0x82, 0x05, 0x5a, 0xd6, 0xf9, 0xa9, 0x65, + 0xc3, 0xf2, 0x6b, 0x38, 0x40, 0xcd, 0x80, 0x7b, 0x33, 0x8f, 0xca, + 0x24, 0x0b, 0x34, 0xb7, 0x78, 0x99, 0x55, 0x99, 0xb9, 0x81, 0x2b, + 0xec, 0x38, 0x1f, 0x02, 0x43, 0x04, 0x84, 0x0c, 0x92, 0x5b, 0xb7, + 0x8b, 0x65, 0x4f, 0x3c, 0x2b, 0xd6, 0x3c, 0xfe, 0xa4, 0xb8, 0x60, + 0xe7, 0x1e, 0x31, 0x3f, 0x78, 0x44, 0x02, 0xab, 0x47, 0x3d, 0x3d, + 0x74, 0xb7, 0x86, 0x8f, 0x7d, 0x92, 0x80, 0x31, 0x87, 0x0c, 0x09, + 0xe0, 0x5f, 0xbf, 0x2b, 0x70, 0xfd, 0xdf, 0x9a, 0x8e, 0xdb, 0xbf, + 0xf7, 0x2a, 0xc2, 0x0f, 0xbf, 0xa9, 0x4d, 0xeb, 0x01, 0xab, 0xa5, + 0x80, 0x1f, 0x7d, 0x5f, 0xe0, 0xba, 0xbf, 0x31, 0x51, 0x28, 0x06, + 0xd7, 0xda, 0xc9, 0xba, 0x3b, 0x90, 0x7e, 0xfb, 0x9b, 0xd8, 0xab, + 0x7f, 0x7a, 0x15, 0xed, 0xbc, 0xea, 0x52, 0xda, 0x3d, 0xef, 0x1c, + 0x0c, 0xa0, 0x08, 0x8e, 0x3c, 0x04, 0x44, 0x05, 0x5e, 0x05, 0x0b, + 0xc8, 0x0a, 0x2e, 0x90, 0x2b, 0xba, 0xc4, 0xd9, 0x3c, 0xdd, 0x4f, + 0x19, 0xa0, 0x4d, 0xc5, 0xcc, 0x9c, 0x9a, 0x61, 0xd8, 0x5d, 0xcc, + 0xb0, 0xcb, 0x14, 0x01, 0xca, 0x11, 0xb1, 0x08, 0x18, 0x34, 0x68, + 0x47, 0x0f, 0x63, 0xfe, 0x4f, 0x9e, 0xe6, 0xe7, 0x7f, 0xe7, 0xc7, + 0xe2, 0x8d, 0x5b, 0x5f, 0x16, 0xcb, 0x82, 0x47, 0x21, 0xb0, 0x46, + 0x59, 0x6b, 0x12, 0xd8, 0xf6, 0x7d, 0x0d, 0xab, 0x56, 0x11, 0x90, + 0xab, 0x56, 0x69, 0x82, 0x01, 0x1b, 0x6e, 0x30, 0xb1, 0x75, 0xfb, + 0x4c, 0x95, 0x95, 0x88, 0x03, 0x2f, 0x7e, 0x5f, 0xc3, 0xea, 0x35, + 0x0e, 0xdb, 0x45, 0x80, 0x63, 0x47, 0x81, 0xf3, 0xde, 0x67, 0x60, + 0x64, 0x3c, 0xb8, 0xc6, 0x32, 0xb6, 0xa0, 0x1b, 0xa3, 0xd7, 0x5c, + 0xcd, 0xb6, 0x7f, 0xe8, 0x3d, 0xb4, 0xed, 0xd2, 0x73, 0xe9, 0x00, + 0x62, 0x48, 0x23, 0x03, 0x02, 0x9f, 0x01, 0xb3, 0x7c, 0x19, 0x5e, + 0x79, 0x17, 0xb8, 0x39, 0xa9, 0x35, 0x57, 0xa8, 0x79, 0x01, 0xcd, + 0xad, 0x46, 0x53, 0x77, 0x71, 0x33, 0xad, 0x4a, 0x2c, 0x62, 0x99, + 0xc2, 0x20, 0x84, 0x11, 0x05, 0x03, 0x10, 0xfe, 0xfd, 0x0e, 0xb1, + 0xfc, 0x5f, 0x1e, 0x11, 0x57, 0x3d, 0xfe, 0xff, 0xf8, 0x1b, 0xc6, + 0x26, 0x82, 0x06, 0xac, 0x81, 0x35, 0xc7, 0x36, 0x5c, 0x48, 0xf8, + 0xcd, 0xf7, 0x34, 0x90, 0x93, 0xd2, 0x8a, 0x03, 0xcf, 0x6f, 0x13, + 0xd8, 0xf0, 0x21, 0x13, 0x45, 0x63, 0x3a, 0xf9, 0xb6, 0x0f, 0x32, + 0x7c, 0xe9, 0x7e, 0x06, 0x8c, 0x57, 0x43, 0x10, 0x61, 0xe0, 0xbd, + 0x1f, 0x37, 0xf1, 0xa3, 0xa7, 0x03, 0x57, 0xb3, 0x16, 0x7b, 0xf3, + 0x1b, 0x68, 0xf7, 0x2d, 0x7f, 0xc1, 0x7e, 0xf5, 0x67, 0x6f, 0xa5, + 0x97, 0xc2, 0x29, 0x8c, 0x21, 0x0b, 0xc0, 0x84, 0x61, 0x01, 0x59, + 0xde, 0x32, 0x5f, 0x70, 0x50, 0x6a, 0x45, 0x97, 0x78, 0x1a, 0x77, + 0x53, 0x68, 0xf6, 0xf6, 0x67, 0x4e, 0xdf, 0x60, 0x3a, 0xc5, 0xcc, + 0x42, 0x0e, 0xea, 0x2c, 0x5a, 0x01, 0x5a, 0x04, 0x0c, 0x84, 0xf0, + 0x73, 0x2f, 0x8a, 0xb5, 0xff, 0xf8, 0x75, 0xfe, 0x27, 0x3f, 0xff, + 0xb5, 0x38, 0x2f, 0x5f, 0x9c, 0x5b, 0x71, 0xb1, 0x68, 0x34, 0x0a, + 0xc6, 0x18, 0x4c, 0xd3, 0x44, 0x3e, 0x9f, 0x97, 0xce, 0x2f, 0x84, + 0x40, 0x36, 0x9b, 0x6d, 0xca, 0x39, 0xc5, 0xe3, 0x71, 0x44, 0xa3, + 0x51, 0x14, 0x8b, 0x45, 0x18, 0x86, 0x01, 0xd3, 0x2c, 0xb9, 0x60, + 0x9a, 0x56, 0xea, 0xce, 0x4c, 0xd7, 0x75, 0x70, 0xce, 0x31, 0x39, + 0x39, 0xd9, 0x90, 0xe3, 0xa5, 0x52, 0x29, 0x68, 0x9a, 0x36, 0xe3, + 0x58, 0xa6, 0x69, 0x82, 0x73, 0x0e, 0x4d, 0xd3, 0xc0, 0x18, 0xab, + 0x1c, 0x57, 0xd7, 0x75, 0x64, 0x32, 0x19, 0xa9, 0x6b, 0xe5, 0x65, + 0x5f, 0xbc, 0x83, 0xe1, 0xce, 0x5b, 0x19, 0x30, 0xe1, 0xb0, 0x32, + 0x09, 0xdc, 0x74, 0x3b, 0xc7, 0xb7, 0x7e, 0x54, 0xa2, 0xdd, 0xc2, + 0x1e, 0xe0, 0xc5, 0xc7, 0x75, 0x74, 0x77, 0x39, 0xc4, 0xce, 0x5a, + 0x80, 0x6f, 0x7c, 0x8b, 0xe3, 0xa3, 0xf7, 0xf0, 0x80, 0x4c, 0x75, + 0xda, 0xb9, 0x2b, 0xe9, 0xd8, 0x2d, 0x37, 0xb2, 0x7f, 0xfb, 0x8b, + 0xf7, 0xd0, 0x6f, 0x13, 0xed, 0x18, 0xc6, 0x24, 0x50, 0x6e, 0x08, + 0x92, 0x47, 0x49, 0x17, 0xdb, 0x95, 0x9b, 0x75, 0x32, 0x3d, 0x94, + 0x9a, 0x2b, 0xd0, 0xbc, 0x2a, 0x02, 0xa6, 0x26, 0x7b, 0xf0, 0x3f, + 0x5c, 0x51, 0x63, 0xa5, 0xdf, 0x28, 0x08, 0x11, 0x24, 0xc1, 0xf7, + 0xef, 0xc1, 0xd2, 0xbb, 0x37, 0xf3, 0x0f, 0x3c, 0xfa, 0x33, 0xfe, + 0x9f, 0xe6, 0x6a, 0x0d, 0xe5, 0x6d, 0xb7, 0xdd, 0x86, 0xdb, 0x6f, + 0xbf, 0x1d, 0xe9, 0x74, 0x1a, 0xd7, 0x5f, 0x7f, 0x3d, 0x76, 0xec, + 0xd8, 0xe1, 0x99, 0xff, 0xa6, 0x9b, 0x6e, 0xc2, 0x17, 0xbe, 0xf0, + 0x05, 0xfc, 0xe0, 0x07, 0x3f, 0xc0, 0x1d, 0x77, 0xdc, 0xd1, 0x94, + 0x73, 0xfa, 0xf8, 0xc7, 0x3f, 0x8e, 0x8d, 0x1b, 0x37, 0xa2, 0x50, + 0x28, 0xc0, 0x34, 0x4d, 0x68, 0x9a, 0x56, 0x01, 0x8b, 0x69, 0x9a, + 0x60, 0x8c, 0x61, 0xcb, 0x96, 0x2d, 0xb8, 0xf9, 0xe6, 0x9b, 0x1b, + 0x72, 0xbc, 0x07, 0x1f, 0x7c, 0x10, 0xd7, 0x5e, 0x7b, 0x2d, 0x84, + 0x10, 0xe0, 0x9c, 0x83, 0x73, 0x8e, 0x6c, 0x36, 0x0b, 0xd3, 0x34, + 0xa1, 0xeb, 0x3a, 0xe2, 0xf1, 0x92, 0x58, 0x67, 0x8c, 0x81, 0x88, + 0x70, 0xfd, 0xf5, 0xd7, 0xe3, 0xa9, 0xa7, 0x9e, 0xaa, 0xeb, 0x98, + 0xe1, 0x10, 0xf0, 0xfc, 0xf7, 0x35, 0x9c, 0x7f, 0x01, 0x01, 0x19, + 0xfb, 0x4a, 0xe0, 0xe4, 0x49, 0xe0, 0x82, 0x6b, 0x0c, 0x9c, 0x1a, + 0x06, 0x1e, 0xbc, 0x4b, 0xc3, 0x27, 0x3e, 0x4a, 0xd5, 0xea, 0x2c, + 0x0a, 0xec, 0xde, 0x0d, 0xbc, 0xf1, 0x06, 0x03, 0x63, 0x13, 0x01, + 0x90, 0x1a, 0x65, 0x6b, 0x97, 0xd3, 0xd1, 0xfb, 0xff, 0x9a, 0x3d, + 0xf6, 0xbe, 0x77, 0xd0, 0xef, 0xc0, 0x51, 0x44, 0x1e, 0x26, 0x08, + 0x39, 0x8b, 0x52, 0xcb, 0x7b, 0xb8, 0x9f, 0xf6, 0x2f, 0x0b, 0x2a, + 0x50, 0x93, 0xed, 0xd8, 0x4f, 0xa6, 0x82, 0x60, 0x5a, 0xb9, 0xe9, + 0x60, 0x88, 0xc3, 0xfc, 0xf2, 0x37, 0xf8, 0xbb, 0x2f, 0xbb, 0xce, + 0xfc, 0xfb, 0x47, 0x7e, 0xca, 0x37, 0xcc, 0xe5, 0xe6, 0x16, 0xd1, + 0x68, 0x14, 0x4b, 0x96, 0x2c, 0xc1, 0xfa, 0xf5, 0xeb, 0xf1, 0xc3, + 0x1f, 0xfe, 0x10, 0x8b, 0x16, 0x2d, 0xf2, 0xcc, 0x6f, 0x9a, 0x26, + 0x96, 0x2c, 0x59, 0x82, 0x48, 0x24, 0xd2, 0xb4, 0x73, 0xca, 0xe5, + 0x72, 0xe8, 0xe9, 0xe9, 0xc1, 0xa2, 0x45, 0x8b, 0xb0, 0x74, 0xe9, + 0x52, 0x68, 0x9a, 0x86, 0xf1, 0xf1, 0x71, 0xe4, 0xf3, 0x79, 0xc4, + 0xe3, 0x71, 0xf4, 0xf6, 0xf6, 0xa2, 0xb3, 0xb3, 0xb3, 0x61, 0xc7, + 0x6b, 0x6b, 0x6b, 0x43, 0x2a, 0x95, 0x42, 0x3e, 0x9f, 0xc7, 0xc8, + 0xc8, 0x08, 0x88, 0x08, 0x7d, 0x7d, 0x7d, 0x58, 0xb5, 0x6a, 0x15, + 0x96, 0x2f, 0x5f, 0x8e, 0x89, 0x89, 0x09, 0x8c, 0x8f, 0x8f, 0xc3, + 0x34, 0x4d, 0xcc, 0x9b, 0x37, 0x0f, 0xd1, 0x68, 0xfd, 0x1f, 0x77, + 0x14, 0x8a, 0xc0, 0x27, 0x36, 0x72, 0x14, 0x26, 0xcb, 0x4f, 0xe7, + 0x8c, 0x95, 0x40, 0xef, 0x32, 0xe0, 0x96, 0x1b, 0x18, 0x56, 0x2d, + 0x25, 0xdc, 0xf4, 0x7e, 0x02, 0x26, 0x1d, 0x5c, 0x4d, 0x0e, 0xdc, + 0x72, 0xbf, 0x19, 0xc0, 0xac, 0xc1, 0xf6, 0xea, 0x7e, 0xb1, 0xf0, + 0x9a, 0x4f, 0x99, 0x77, 0x7c, 0xe0, 0x53, 0xe6, 0xed, 0x03, 0xc3, + 0x68, 0x47, 0x12, 0x26, 0xaa, 0x1b, 0xd7, 0xdb, 0xbf, 0xdf, 0x76, + 0xea, 0x93, 0xd0, 0xca, 0x28, 0xcf, 0x9e, 0x4a, 0x65, 0xfa, 0xc2, + 0xaf, 0xfe, 0xd4, 0x29, 0x04, 0xe4, 0x0b, 0x08, 0xff, 0xe5, 0xa7, + 0xf9, 0xa7, 0x6e, 0xb9, 0x8f, 0xff, 0xd5, 0xe0, 0xa8, 0x68, 0x9d, + 0xeb, 0x37, 0xcf, 0xea, 0x36, 0xae, 0x58, 0xb1, 0x02, 0x5b, 0xb6, + 0x6c, 0x41, 0x5b, 0x5b, 0x9b, 0x6b, 0xfe, 0xb1, 0xb1, 0xb1, 0x19, + 0xbf, 0xcd, 0xb0, 0xe1, 0xe1, 0xe1, 0x2a, 0xc5, 0xb6, 0x76, 0xed, + 0x5a, 0xf4, 0xf5, 0xf5, 0x61, 0xf9, 0xf2, 0xe5, 0x58, 0xb1, 0x62, + 0x05, 0xee, 0xbc, 0xf3, 0xce, 0x86, 0x1d, 0xef, 0xb3, 0x9f, 0xfd, + 0x2c, 0x56, 0xac, 0x58, 0x81, 0xbe, 0xbe, 0x3e, 0xac, 0x5b, 0xb7, + 0x0e, 0x9f, 0xf9, 0xcc, 0x67, 0x66, 0xc0, 0xf5, 0x1d, 0xef, 0x78, + 0x07, 0x56, 0xaf, 0x5e, 0x8d, 0xbe, 0xbe, 0x3e, 0xac, 0x5c, 0xb9, + 0x12, 0x5b, 0xb7, 0x6e, 0x6d, 0xc8, 0x71, 0xb7, 0xfe, 0x5e, 0xe0, + 0x8b, 0x5f, 0xe3, 0x40, 0xd2, 0x61, 0x65, 0x1a, 0xb8, 0xf5, 0x46, + 0x86, 0x1f, 0xfc, 0x93, 0x86, 0x48, 0xb4, 0xfc, 0xbe, 0xb7, 0xb9, + 0xa5, 0xff, 0xfd, 0xeb, 0x1c, 0x4f, 0x6e, 0x0d, 0xe2, 0x66, 0xcd, + 0xb2, 0xc7, 0x7e, 0x21, 0x36, 0xbc, 0xe5, 0x83, 0xc6, 0xbd, 0xcf, + 0x3d, 0x2f, 0xd6, 0x21, 0x85, 0x02, 0xaa, 0x3f, 0x81, 0x74, 0xeb, + 0x65, 0xda, 0xb1, 0x8f, 0x46, 0xd5, 0xae, 0x97, 0xbd, 0x7b, 0xd9, + 0xd0, 0x40, 0x06, 0x87, 0xf6, 0xc1, 0x3b, 0xcd, 0x3b, 0xbe, 0xb9, + 0x85, 0x5f, 0x1d, 0xdc, 0xae, 0x92, 0xd9, 0x63, 0x41, 0x17, 0x5f, + 0x7c, 0x31, 0x1e, 0x7b, 0xec, 0x31, 0xc4, 0x62, 0x31, 0x69, 0x10, + 0x36, 0xda, 0xd2, 0xe9, 0xf4, 0x8c, 0xe5, 0x4c, 0x26, 0x53, 0x51, + 0x87, 0xa3, 0xa3, 0xa3, 0xd8, 0xbf, 0x7f, 0x3f, 0x8e, 0x1c, 0x39, + 0xd2, 0xb0, 0xe3, 0x1d, 0x3a, 0x74, 0x08, 0xc7, 0x8e, 0x1d, 0x43, + 0xb1, 0x58, 0x0a, 0x50, 0x15, 0x0a, 0x85, 0xca, 0x3a, 0xce, 0x79, + 0x25, 0xae, 0x96, 0xcd, 0x66, 0xb1, 0x6f, 0xdf, 0x3e, 0x8c, 0x8c, + 0x8c, 0x34, 0xec, 0xd8, 0xf7, 0x7f, 0x9d, 0x63, 0xdb, 0xb3, 0x40, + 0x55, 0x15, 0x94, 0x09, 0xb4, 0xb5, 0x01, 0xeb, 0xd7, 0x96, 0x1d, + 0x1c, 0x9b, 0xab, 0xb9, 0x6b, 0x07, 0xb0, 0xf1, 0x2b, 0x41, 0xdc, + 0xac, 0xe9, 0x6a, 0xed, 0x00, 0x16, 0xbf, 0xfb, 0x13, 0xe6, 0x5d, + 0x5b, 0xb7, 0x8a, 0xf3, 0x10, 0x47, 0x11, 0xee, 0x1d, 0xb4, 0x7a, + 0x8d, 0x9a, 0xe6, 0x09, 0x34, 0x99, 0xb1, 0x01, 0xaa, 0xfb, 0x19, + 0x8b, 0xc0, 0xf8, 0xbb, 0x2f, 0xf2, 0x0f, 0xff, 0x9f, 0x5f, 0x8a, + 0x2b, 0x83, 0xdb, 0xe4, 0x6d, 0x57, 0x5f, 0x7d, 0x35, 0xbe, 0xf1, + 0x8d, 0x6f, 0x40, 0xd7, 0xab, 0x7b, 0x41, 0x9f, 0x82, 0x4b, 0x2e, + 0x97, 0x6b, 0xaa, 0xcb, 0x69, 0x77, 0x73, 0x67, 0xd3, 0x84, 0xad, + 0xa9, 0xfd, 0x54, 0xa5, 0x40, 0x53, 0x14, 0x72, 0x0e, 0xb8, 0x75, + 0x93, 0x89, 0x42, 0xd6, 0xc1, 0xf5, 0x34, 0xcb, 0x51, 0x1a, 0xdb, + 0xb8, 0xf3, 0x42, 0x00, 0x7f, 0xfd, 0x0f, 0x26, 0xc6, 0xd3, 0xc1, + 0xb3, 0x3a, 0x1b, 0x36, 0x38, 0x8a, 0xf6, 0x1b, 0xef, 0xe4, 0x7f, + 0x3b, 0xd4, 0x8f, 0x0e, 0x84, 0x2a, 0xdd, 0x74, 0xfb, 0x8d, 0xcc, + 0x56, 0xc5, 0x2a, 0xbf, 0xa7, 0xc8, 0x0b, 0x6c, 0x33, 0xd3, 0xc3, + 0x30, 0x5e, 0xdb, 0x29, 0xfa, 0x1e, 0xf8, 0x0e, 0xbf, 0x2e, 0xb8, + 0x3d, 0xb6, 0x8b, 0x48, 0xa5, 0xcb, 0xb5, 0x69, 0xd3, 0x26, 0xf4, + 0xf7, 0xf7, 0x57, 0xd2, 0x6f, 0xb8, 0xe1, 0x06, 0x6c, 0xde, 0xbc, + 0xb9, 0x3a, 0xf6, 0x53, 0x56, 0x2f, 0xcd, 0x04, 0xda, 0xd4, 0x39, + 0xcd, 0x86, 0x1a, 0x3c, 0x13, 0x6c, 0xdb, 0x0e, 0x81, 0x7f, 0xfa, + 0xba, 0x8b, 0xeb, 0x89, 0x6a, 0x57, 0x73, 0xf3, 0xd7, 0x39, 0x7e, + 0xf1, 0x6c, 0xe0, 0x6a, 0xce, 0xa6, 0x1d, 0x3c, 0x2e, 0xe6, 0xdf, + 0xf3, 0x3f, 0xf8, 0x07, 0x11, 0x82, 0x01, 0xe7, 0x91, 0xd1, 0x7c, + 0xcd, 0x2f, 0x86, 0x26, 0xef, 0x7e, 0x86, 0x60, 0x3c, 0xfc, 0x53, + 0xf1, 0x16, 0xce, 0xab, 0x87, 0x31, 0x0b, 0x80, 0x56, 0xba, 0x94, + 0x5b, 0xb6, 0x6c, 0xc1, 0xb5, 0xd7, 0x5e, 0x3b, 0xc3, 0xdd, 0xbb, + 0xf9, 0xe6, 0x9b, 0xb1, 0x69, 0xd3, 0x26, 0xc7, 0xfc, 0xf5, 0x36, + 0x5b, 0x50, 0xb1, 0xbe, 0xbe, 0x3e, 0xac, 0x59, 0xb3, 0x06, 0xe7, + 0x9f, 0x7f, 0x3e, 0x2e, 0xbd, 0xf4, 0x52, 0xbc, 0xf9, 0xcd, 0x6f, + 0xc6, 0xea, 0xd5, 0xab, 0xcf, 0xaa, 0xfb, 0x70, 0xef, 0x43, 0x1c, + 0xcf, 0x3d, 0x2b, 0xe0, 0xd9, 0x99, 0x54, 0x04, 0x78, 0xed, 0xf7, + 0x02, 0xf7, 0x3c, 0x18, 0xb8, 0x9a, 0xa7, 0xc3, 0x1e, 0x7f, 0x82, + 0xbf, 0x65, 0x62, 0x10, 0x1d, 0xd0, 0x2b, 0x83, 0xa3, 0x78, 0x29, + 0xb2, 0x2a, 0x5e, 0x79, 0x01, 0xcd, 0x3a, 0xac, 0x94, 0xd7, 0x70, + 0x75, 0xe5, 0x40, 0x08, 0x68, 0xcf, 0x21, 0xb1, 0x38, 0xb8, 0x25, + 0xd5, 0x16, 0x0e, 0x87, 0x01, 0x00, 0x2d, 0x2d, 0x2d, 0x78, 0xf6, + 0xd9, 0x67, 0x71, 0xdd, 0x75, 0xd7, 0xc1, 0x30, 0xa6, 0x5b, 0x74, + 0x7e, 0xee, 0x73, 0x9f, 0xc3, 0x2d, 0xb7, 0xdc, 0x52, 0xb5, 0x9d, + 0x35, 0x4f, 0xb3, 0xed, 0xd1, 0x47, 0x1f, 0xc5, 0xab, 0xaf, 0xbe, + 0x8a, 0xed, 0xdb, 0xb7, 0x63, 0xdb, 0xb6, 0x6d, 0x78, 0xe6, 0x99, + 0x67, 0xf0, 0x91, 0x8f, 0x7c, 0xe4, 0xac, 0xba, 0x0f, 0x99, 0x1c, + 0xf0, 0xa9, 0x4d, 0x1c, 0xbc, 0xe8, 0x52, 0x2c, 0x18, 0x50, 0x2c, + 0x02, 0x7f, 0xf9, 0x79, 0x8e, 0xb1, 0xc0, 0xd5, 0x3c, 0x2d, 0x96, + 0xce, 0x22, 0x39, 0x99, 0x45, 0x0c, 0xb0, 0x0c, 0x74, 0x5d, 0xcd, + 0x25, 0x57, 0xb1, 0xe5, 0x37, 0x8c, 0x9d, 0xd3, 0x20, 0xa0, 0xce, + 0xa3, 0x1e, 0x33, 0x88, 0x05, 0xdd, 0x34, 0xd0, 0xec, 0xb1, 0x16, + 0x5f, 0x8f, 0x66, 0x8f, 0x93, 0xfd, 0xfc, 0xe7, 0x3f, 0xc7, 0x87, + 0x3f, 0xfc, 0x61, 0x3c, 0xf2, 0xc8, 0x23, 0x95, 0xb4, 0xcd, 0x9b, + 0x37, 0x63, 0x62, 0x62, 0x02, 0xdf, 0xfe, 0xf6, 0xb7, 0xab, 0x5c, + 0xcf, 0x59, 0x79, 0x33, 0x3e, 0xfe, 0x38, 0x8e, 0x1e, 0x3d, 0x8a, + 0x44, 0x22, 0x81, 0x78, 0x3c, 0x8e, 0x54, 0x2a, 0x85, 0xdd, 0xbb, + 0x77, 0x9f, 0x75, 0xf7, 0x62, 0xc3, 0x45, 0x04, 0x0a, 0xa1, 0xfa, + 0xd3, 0xa6, 0xf2, 0x93, 0xad, 0x85, 0x81, 0xab, 0xaf, 0xa0, 0xaa, + 0xcf, 0xa2, 0x02, 0x9b, 0x1d, 0x8b, 0x86, 0x91, 0x8b, 0x85, 0x91, + 0xaf, 0xd5, 0x73, 0x54, 0x1d, 0x68, 0xd8, 0x09, 0x6c, 0xa5, 0xc9, + 0x84, 0x76, 0xfd, 0xdb, 0xe9, 0xd7, 0x5f, 0xfa, 0x2e, 0x3e, 0x10, + 0xdc, 0x16, 0x9b, 0x17, 0xe3, 0xd0, 0x9e, 0xec, 0xd1, 0x47, 0x1f, + 0x45, 0x57, 0x57, 0x17, 0xbe, 0xf4, 0xa5, 0x2f, 0x95, 0xde, 0x07, + 0x8c, 0xe1, 0xc1, 0x07, 0x1f, 0xc4, 0x89, 0x13, 0x27, 0x66, 0xc4, + 0xd9, 0x66, 0xcb, 0x36, 0x6d, 0xda, 0x84, 0x97, 0x5f, 0x7e, 0xf9, + 0xac, 0xbe, 0x0f, 0x97, 0xac, 0x27, 0xdc, 0xf7, 0x69, 0x06, 0x2a, + 0xba, 0x3f, 0xdd, 0xcc, 0x00, 0xee, 0xbe, 0x95, 0xe1, 0x89, 0x67, + 0x05, 0xfe, 0xfd, 0x95, 0x00, 0x6a, 0xb3, 0x6d, 0x57, 0x5f, 0x41, + 0xcf, 0xb7, 0x76, 0x61, 0x18, 0xf9, 0xca, 0xd8, 0x9d, 0x5e, 0x83, + 0xa4, 0xc0, 0x96, 0xee, 0xdb, 0x6c, 0xc3, 0x6d, 0xc3, 0x6a, 0xb0, + 0xe5, 0x10, 0x7a, 0xe3, 0x25, 0xf4, 0x87, 0xeb, 0xfe, 0x33, 0x3d, + 0x1d, 0xdc, 0x16, 0xdb, 0x5b, 0xc7, 0xa5, 0x91, 0xe8, 0xe6, 0xcd, + 0x9b, 0x71, 0xff, 0xfd, 0xf7, 0x57, 0x96, 0x63, 0xb1, 0x18, 0x1e, + 0x7e, 0xf8, 0x61, 0xbc, 0xfb, 0xdd, 0xef, 0x06, 0x30, 0xbb, 0x31, + 0xb4, 0x64, 0x32, 0x39, 0xab, 0xd7, 0x24, 0x14, 0x9a, 0xdd, 0xaf, + 0xdf, 0x22, 0x61, 0xe0, 0x5f, 0x3e, 0xc7, 0x10, 0x4f, 0xa1, 0xba, + 0xbd, 0x99, 0xd5, 0xcc, 0x92, 0x4a, 0x7b, 0xe8, 0x1e, 0x86, 0x54, + 0x22, 0x78, 0x76, 0x67, 0xd3, 0xda, 0x52, 0x98, 0xb8, 0xf7, 0x16, + 0xed, 0xe1, 0xca, 0x10, 0xcb, 0x70, 0x9c, 0x9c, 0xd8, 0x64, 0x8d, + 0x1a, 0xf8, 0x82, 0xac, 0x8a, 0x82, 0x96, 0xf9, 0xe9, 0x6f, 0xa9, + 0x04, 0x04, 0x09, 0xe0, 0xab, 0xf7, 0x69, 0xff, 0x7c, 0xe9, 0x7a, + 0xda, 0x15, 0xdc, 0x1e, 0x7f, 0xa0, 0x01, 0xc0, 0x5d, 0x77, 0xdd, + 0x85, 0xaf, 0x7e, 0xf5, 0xab, 0x95, 0xe5, 0xae, 0xae, 0x2e, 0xdc, + 0x77, 0xdf, 0x7d, 0x00, 0x4a, 0xed, 0xb3, 0x9a, 0x65, 0xe2, 0x34, + 0xf7, 0x50, 0x68, 0x6d, 0xa6, 0xa1, 0x69, 0x9a, 0x63, 0xf3, 0x95, + 0x46, 0xda, 0xad, 0x37, 0x30, 0x5c, 0xbe, 0xc1, 0xe1, 0x6b, 0x00, + 0xa7, 0x88, 0x70, 0x16, 0x38, 0xff, 0x12, 0xc2, 0xe7, 0x3e, 0xc2, + 0x82, 0x87, 0x77, 0xb6, 0x5e, 0x70, 0x3a, 0x8a, 0x0f, 0xdd, 0xa3, + 0x6d, 0x5e, 0xb9, 0x16, 0x07, 0x90, 0x2f, 0x0f, 0x73, 0xe4, 0xdc, + 0xdd, 0xb6, 0x80, 0x7b, 0x5c, 0x4b, 0xea, 0xd3, 0x27, 0xe1, 0xf0, + 0xeb, 0xd4, 0x75, 0x87, 0x89, 0x22, 0xa8, 0xb5, 0x0d, 0x13, 0x3f, + 0x79, 0x48, 0xbb, 0x77, 0xc3, 0x85, 0xb4, 0x33, 0xb8, 0x4d, 0xd3, + 0xca, 0xcb, 0xcb, 0x3e, 0xf9, 0xc9, 0x4f, 0xe2, 0x89, 0x27, 0x9e, + 0x98, 0xd5, 0x73, 0x9a, 0xfa, 0x08, 0xfd, 0x4c, 0x30, 0x22, 0xaa, + 0x6a, 0x46, 0xd2, 0x48, 0xbb, 0x68, 0x2d, 0xe1, 0xde, 0xdb, 0x59, + 0xf5, 0xf7, 0x9c, 0x5e, 0xf5, 0x66, 0x69, 0xe0, 0x6f, 0x3e, 0xc6, + 0x70, 0xe9, 0xfa, 0xa0, 0x83, 0xe4, 0x66, 0x5b, 0x4b, 0x02, 0x93, + 0xdf, 0x7f, 0x40, 0xfb, 0xe2, 0x75, 0xd7, 0xd0, 0xd3, 0x48, 0x23, + 0x0a, 0xff, 0x8e, 0x1c, 0xe1, 0xe2, 0x2d, 0x92, 0x4c, 0x2d, 0xa7, + 0x7d, 0x08, 0x29, 0xfb, 0x60, 0xa0, 0x33, 0x07, 0x36, 0xc8, 0x82, + 0x75, 0x77, 0x61, 0xf8, 0x97, 0xdf, 0xd2, 0x36, 0x7e, 0xfa, 0x26, + 0xf6, 0xa3, 0x90, 0x0e, 0x63, 0xae, 0xdf, 0xb0, 0x44, 0x22, 0xe1, + 0xe9, 0x66, 0x19, 0x86, 0x81, 0x1b, 0x6f, 0xbc, 0x11, 0x2f, 0xbc, + 0xf0, 0xc2, 0xec, 0x3d, 0x44, 0x2d, 0x2d, 0x33, 0x96, 0xed, 0x6d, + 0xde, 0x18, 0x63, 0x0d, 0xf9, 0x9e, 0xd2, 0xd5, 0x05, 0xb4, 0xc4, + 0x15, 0x19, 0x63, 0x4d, 0x53, 0x68, 0x91, 0x30, 0xf0, 0x3f, 0xff, + 0x8e, 0x21, 0xe6, 0xe4, 0x6a, 0x26, 0x80, 0x7f, 0xf8, 0x1a, 0xc7, + 0x33, 0xdb, 0x04, 0x10, 0xab, 0x76, 0x3d, 0xf5, 0x68, 0xc9, 0xf5, + 0x4c, 0x04, 0x9d, 0x5c, 0x35, 0xcd, 0xae, 0xb8, 0x80, 0x76, 0x3d, + 0xf3, 0x5d, 0xed, 0xf3, 0xd7, 0xbc, 0x87, 0x7e, 0x8d, 0x09, 0x84, + 0xe1, 0xdd, 0xf7, 0x99, 0x5d, 0x4c, 0x55, 0xb1, 0x8a, 0xf9, 0xb8, + 0x9b, 0xc2, 0x05, 0x6e, 0xf6, 0xfe, 0xbc, 0xa7, 0xa1, 0x46, 0x30, + 0x90, 0x07, 0x45, 0xc3, 0xc8, 0x3f, 0xf0, 0x79, 0xf6, 0xbf, 0x9e, + 0xfe, 0xb6, 0xf6, 0xf7, 0x6f, 0xba, 0x98, 0x5e, 0x9b, 0xd3, 0x6f, + 0xa0, 0x32, 0x3c, 0xbc, 0xe2, 0x46, 0x43, 0x43, 0x43, 0x78, 0xff, + 0xfb, 0xdf, 0x8f, 0xc3, 0x87, 0x0f, 0xcf, 0x50, 0x2e, 0xcd, 0xb2, + 0xd6, 0xd6, 0x99, 0x9f, 0xd8, 0x6e, 0xdc, 0xb8, 0x11, 0xdf, 0xfc, + 0xe6, 0x37, 0xf1, 0xe8, 0xa3, 0x8f, 0xe2, 0x67, 0x3f, 0xfb, 0x19, + 0x76, 0xee, 0xdc, 0x89, 0x07, 0x1e, 0x78, 0x60, 0x56, 0x54, 0xab, + 0xae, 0xeb, 0x95, 0xa6, 0x2d, 0x8d, 0xb6, 0xbb, 0x3f, 0xce, 0x70, + 0xf9, 0x9b, 0x1c, 0x5c, 0xcd, 0x30, 0x70, 0x64, 0x5f, 0xa9, 0x6d, + 0xda, 0xe7, 0xbf, 0xcc, 0x21, 0x0c, 0x67, 0xd7, 0xf3, 0xa2, 0x37, + 0x12, 0xee, 0xfa, 0x58, 0xe0, 0x7a, 0x36, 0xda, 0x3a, 0x5a, 0x90, + 0xfe, 0xe2, 0x9d, 0xec, 0x91, 0x5f, 0x3f, 0xac, 0x6d, 0xbc, 0xf0, + 0x3c, 0xda, 0x8b, 0x34, 0x42, 0x1e, 0x30, 0x73, 0x1a, 0xf1, 0x09, + 0x4e, 0xae, 0xa7, 0xee, 0xa1, 0xce, 0xc8, 0x47, 0xa9, 0x99, 0x98, + 0xf9, 0xf9, 0x93, 0x01, 0xeb, 0x97, 0xf1, 0x06, 0x18, 0xd2, 0x88, + 0x6c, 0xb8, 0x8c, 0x76, 0xfc, 0xea, 0x3b, 0xda, 0x3f, 0xfe, 0xf0, + 0x97, 0xe2, 0x92, 0xfb, 0x1e, 0xe4, 0xef, 0xd9, 0xbe, 0x6b, 0xee, + 0xb5, 0x55, 0x8b, 0xc7, 0xe3, 0xe0, 0x9c, 0xfb, 0x2a, 0x9e, 0x43, + 0x87, 0x0e, 0xe1, 0x9a, 0x6b, 0xae, 0xc1, 0x93, 0x4f, 0x3e, 0x89, + 0xb6, 0xb6, 0xb6, 0xa6, 0xc6, 0xb9, 0xba, 0xba, 0xba, 0x00, 0x94, + 0xe2, 0x74, 0x42, 0x08, 0xbc, 0xeb, 0x5d, 0xef, 0xaa, 0xca, 0xf3, + 0xca, 0x2b, 0xaf, 0x34, 0xf5, 0x9a, 0x4c, 0x75, 0x25, 0xa4, 0x69, + 0x5a, 0xa5, 0xfb, 0xa0, 0x46, 0xda, 0x65, 0xe7, 0x11, 0xee, 0xfc, + 0x18, 0xab, 0x86, 0x59, 0x19, 0x68, 0x7f, 0xb7, 0x99, 0x23, 0x97, + 0x07, 0x7e, 0xf3, 0xa2, 0xc0, 0x63, 0x3f, 0x16, 0xf8, 0xc0, 0x75, + 0x54, 0xdd, 0x77, 0x5a, 0x1a, 0xb8, 0xf3, 0xaf, 0x18, 0x9e, 0xdc, + 0x2a, 0xf0, 0xd4, 0xb6, 0xa0, 0xd6, 0xb3, 0xee, 0x17, 0x69, 0x12, + 0x99, 0x8f, 0xfe, 0x39, 0x7b, 0xe6, 0xb6, 0x0f, 0xb1, 0x27, 0x16, + 0x2d, 0xc1, 0x51, 0x64, 0x21, 0x90, 0x05, 0xa1, 0xba, 0x9b, 0x20, + 0xa7, 0x01, 0x52, 0x5c, 0x87, 0xaf, 0xab, 0x88, 0x00, 0x89, 0x0e, + 0x1e, 0xed, 0x9d, 0x3c, 0x3a, 0xf5, 0x58, 0xeb, 0xd4, 0xfd, 0xf6, + 0x74, 0x8f, 0xb5, 0x0c, 0x61, 0xc4, 0x21, 0xb2, 0xa3, 0x68, 0xff, + 0xbf, 0xbf, 0x12, 0x17, 0x7d, 0xed, 0x71, 0x7e, 0xe5, 0x2f, 0xb7, + 0x8a, 0xb5, 0x73, 0xe5, 0x26, 0xf6, 0xf5, 0xf5, 0x21, 0x1a, 0x8d, + 0xe2, 0xe4, 0xc9, 0x93, 0x18, 0x1a, 0x1a, 0xf2, 0xcd, 0xbf, 0x6c, + 0xd9, 0x32, 0x24, 0x12, 0x09, 0x1c, 0x3b, 0x76, 0xac, 0xa1, 0x1f, + 0x69, 0x5b, 0x6d, 0xc1, 0x82, 0x05, 0xe8, 0xe9, 0xe9, 0x41, 0x2e, + 0x97, 0x83, 0x10, 0xa2, 0xa2, 0x06, 0x85, 0x10, 0xd0, 0x34, 0x0d, + 0xd1, 0x68, 0x14, 0x63, 0x63, 0x63, 0xd8, 0xbb, 0x77, 0x6f, 0xd3, + 0x8e, 0xdf, 0xd9, 0xd9, 0x89, 0x42, 0xa1, 0x80, 0x68, 0x34, 0x8a, + 0x03, 0x07, 0x0e, 0x60, 0x7c, 0xbc, 0x71, 0x7d, 0x5b, 0xc7, 0x22, + 0xc0, 0xb6, 0xef, 0x69, 0x38, 0xf7, 0x3c, 0x02, 0xec, 0x5f, 0x75, + 0xc5, 0x81, 0x17, 0x9f, 0x17, 0xd8, 0xf0, 0x61, 0x13, 0xf9, 0x72, + 0x53, 0xbf, 0xd5, 0x4b, 0x09, 0xcf, 0x3f, 0xae, 0x95, 0x6a, 0x36, + 0x8d, 0xea, 0xfc, 0x3b, 0x77, 0x00, 0x97, 0xdd, 0x60, 0x60, 0x32, + 0x1b, 0x40, 0xa9, 0x16, 0x5b, 0x7a, 0x0e, 0x06, 0x3f, 0xfa, 0x7e, + 0xf6, 0xec, 0x07, 0xde, 0x49, 0xdb, 0x56, 0xac, 0xa6, 0x03, 0xc8, + 0x43, 0x94, 0xc7, 0x6a, 0x9f, 0xea, 0xd4, 0x31, 0x6f, 0xfb, 0xad, + 0xa5, 0x1b, 0x6e, 0xe9, 0x31, 0x05, 0xdc, 0x46, 0x45, 0x77, 0xea, + 0xb9, 0x36, 0x84, 0xe9, 0xce, 0x1e, 0x67, 0x02, 0x4e, 0x43, 0x08, + 0x31, 0x08, 0x14, 0x10, 0x7f, 0xe6, 0x39, 0xb1, 0xe6, 0x5f, 0x7f, + 0x21, 0x2e, 0xf9, 0xe9, 0xaf, 0xf8, 0xfa, 0xc3, 0x27, 0xd0, 0x11, + 0xdc, 0xf2, 0xc0, 0x1a, 0x69, 0xf7, 0xdf, 0xca, 0xf0, 0x5f, 0xef, + 0x70, 0xe8, 0xad, 0x96, 0x01, 0x5c, 0x03, 0xde, 0xf6, 0x21, 0x13, + 0x4f, 0x3f, 0x3f, 0x53, 0x71, 0x7d, 0xe1, 0x13, 0x0c, 0xf7, 0x7c, + 0xd6, 0xa1, 0x0b, 0x6e, 0x00, 0x48, 0x01, 0xff, 0xfc, 0x15, 0x8e, + 0xdb, 0xfe, 0x5b, 0xf0, 0x49, 0x94, 0xac, 0x85, 0x74, 0x18, 0x7f, + 0x7c, 0x39, 0xed, 0x7e, 0xdf, 0xdb, 0x68, 0xfb, 0xf5, 0xef, 0x64, + 0xcf, 0xb7, 0x74, 0x63, 0xa8, 0x0c, 0x32, 0xd3, 0x02, 0xad, 0x82, + 0x03, 0xc8, 0xec, 0xa3, 0x40, 0x39, 0x0d, 0x46, 0xec, 0x54, 0x61, + 0xc0, 0x55, 0x06, 0x49, 0x71, 0x1a, 0x57, 0xc0, 0x3e, 0x50, 0x4a, + 0x18, 0xd5, 0xe3, 0x0b, 0x84, 0xab, 0x96, 0x09, 0x21, 0x44, 0x41, + 0xd0, 0xc1, 0x46, 0x4e, 0x62, 0xde, 0x2f, 0x7e, 0x2b, 0xd6, 0x7d, + 0xf7, 0xc7, 0xfc, 0xd2, 0xe7, 0x77, 0x88, 0x45, 0x83, 0x23, 0x48, + 0x06, 0x8f, 0x42, 0x60, 0xf5, 0xd8, 0x95, 0x6f, 0x20, 0x3c, 0xf3, + 0xb0, 0x06, 0x9a, 0x0a, 0x8c, 0x58, 0x2d, 0x09, 0xfc, 0xe4, 0x27, + 0x02, 0x7f, 0xfa, 0xa9, 0xea, 0xc6, 0x68, 0x1d, 0xad, 0xc0, 0xcb, + 0xff, 0x5b, 0xc7, 0xa2, 0xc5, 0xa8, 0xee, 0x4e, 0x48, 0x03, 0x04, + 0x01, 0x6f, 0xf9, 0x2f, 0x26, 0x7e, 0xf3, 0x62, 0xe0, 0x7a, 0x7a, + 0x40, 0xcc, 0x3c, 0x6f, 0x15, 0x9d, 0x78, 0xd7, 0x95, 0xf4, 0x87, + 0xeb, 0xde, 0x45, 0x2f, 0x9d, 0xb7, 0x86, 0x0e, 0x23, 0x84, 0x5c, + 0x79, 0x0c, 0x01, 0x13, 0x33, 0x7b, 0xa2, 0x75, 0x1a, 0xfd, 0xc9, + 0x3a, 0xac, 0x9d, 0xdd, 0xfd, 0xf4, 0x1d, 0xca, 0xae, 0x11, 0xe3, + 0x72, 0x3a, 0x8d, 0x8a, 0xee, 0x34, 0xa4, 0x9d, 0x8e, 0x99, 0x63, + 0x72, 0x96, 0xe6, 0x75, 0x68, 0x88, 0x00, 0x30, 0x11, 0x3e, 0x75, + 0x12, 0x9d, 0xbf, 0x78, 0x96, 0xaf, 0xf9, 0xd1, 0x53, 0x62, 0xfd, + 0x6f, 0x5e, 0x14, 0xcb, 0x07, 0x86, 0x03, 0xb8, 0x05, 0xa6, 0x66, + 0xdd, 0x1d, 0xc0, 0xbf, 0x7f, 0x4f, 0xc7, 0xb2, 0xf5, 0xa8, 0x76, + 0x35, 0x75, 0x20, 0x3b, 0x0a, 0x5c, 0xf4, 0x3e, 0x13, 0xbb, 0x0e, + 0x3a, 0x43, 0xe9, 0xfa, 0x77, 0x30, 0x7c, 0xef, 0x2b, 0xac, 0x54, + 0x74, 0xec, 0x59, 0xa2, 0xc0, 0xc9, 0xbd, 0xc0, 0x45, 0x7f, 0x6e, + 0xe0, 0xe4, 0x60, 0x70, 0xad, 0x2b, 0x97, 0x25, 0x8c, 0xe2, 0xfa, + 0x95, 0x74, 0xf2, 0xcf, 0xae, 0xa2, 0x9d, 0xef, 0xb9, 0x8a, 0x76, + 0x5e, 0xb0, 0x86, 0x8e, 0x21, 0x86, 0x49, 0x14, 0xcb, 0x6e, 0xa5, + 0xa8, 0xc0, 0xc9, 0x6b, 0x6c, 0x4e, 0xaf, 0x21, 0xec, 0x7c, 0x07, + 0x47, 0x91, 0x01, 0x9a, 0x97, 0xeb, 0xe9, 0x35, 0x3e, 0xa7, 0xcc, + 0xc8, 0xe9, 0xd5, 0x69, 0x04, 0x1d, 0x1a, 0x18, 0xa2, 0x00, 0x0c, + 0x84, 0x07, 0xfb, 0xd1, 0xbe, 0x73, 0x9f, 0x98, 0xbf, 0xe5, 0x29, + 0xb1, 0xee, 0x77, 0xff, 0x21, 0x96, 0xed, 0x3e, 0x28, 0xe6, 0x8d, + 0x4e, 0x20, 0x16, 0x3c, 0x3e, 0x81, 0x79, 0xd9, 0xc2, 0x1e, 0xe0, + 0x8a, 0x0b, 0x09, 0xf9, 0x3c, 0xaa, 0x6a, 0x2d, 0x49, 0x03, 0x4e, + 0x9d, 0x2a, 0xf5, 0x62, 0xeb, 0x66, 0x8c, 0x01, 0x6f, 0xbf, 0x82, + 0x10, 0x8e, 0x38, 0x8c, 0x8e, 0x2e, 0x80, 0x48, 0x04, 0xf8, 0xed, + 0x4b, 0x02, 0x27, 0x06, 0xe6, 0xee, 0x35, 0x66, 0x0c, 0x7c, 0xc5, + 0x62, 0x1a, 0x3a, 0x6f, 0x25, 0x4e, 0xbc, 0xf7, 0x8f, 0xd9, 0xce, + 0xcb, 0xcf, 0xa7, 0xc3, 0x7d, 0x0b, 0x31, 0x40, 0x29, 0xa4, 0xcb, + 0x5a, 0x4b, 0x40, 0xc0, 0x84, 0xf3, 0xc8, 0xe8, 0x5e, 0xcb, 0x06, + 0xdc, 0x07, 0x1a, 0xe6, 0xa8, 0xae, 0xf9, 0x94, 0x1e, 0x39, 0xdd, + 0x4b, 0xa5, 0x11, 0xdc, 0x47, 0x50, 0x77, 0x52, 0x6c, 0x4e, 0x80, + 0xd3, 0x1d, 0xe6, 0xa7, 0xa7, 0x29, 0xb8, 0x85, 0x40, 0xd0, 0x40, + 0xc8, 0x22, 0x76, 0xbc, 0x1f, 0x6d, 0xcf, 0xbc, 0x28, 0x96, 0xff, + 0xee, 0x3f, 0xc4, 0xd2, 0xa7, 0x9e, 0x13, 0xcb, 0x0f, 0x1e, 0x17, + 0x1d, 0x99, 0x2c, 0xc2, 0x41, 0x11, 0x0e, 0x2c, 0xb0, 0xe6, 0x1a, + 0x11, 0xc4, 0xfc, 0x2e, 0x8c, 0xbf, 0x61, 0x1d, 0x1d, 0xfb, 0xa3, + 0xcb, 0x68, 0xdf, 0x5b, 0x2f, 0xa5, 0x7d, 0x6b, 0xfb, 0xa8, 0x3f, + 0x92, 0x42, 0x1a, 0x04, 0xa3, 0x8c, 0x22, 0x01, 0x5e, 0x71, 0x0b, + 0xad, 0xae, 0xa2, 0x15, 0x54, 0x5e, 0xf3, 0x26, 0x66, 0x0e, 0x55, + 0x67, 0xb8, 0x80, 0xcc, 0xeb, 0x0b, 0x02, 0xd8, 0x81, 0x26, 0x03, + 0x35, 0xaf, 0x81, 0x52, 0x18, 0xaa, 0xfb, 0x04, 0x77, 0x82, 0x9b, + 0x66, 0x03, 0x9a, 0xe6, 0xb2, 0xbe, 0x34, 0x4f, 0x60, 0xd0, 0x41, + 0x08, 0x43, 0x80, 0xa0, 0x19, 0x63, 0x48, 0x1e, 0x3d, 0x85, 0xb6, + 0x5d, 0x07, 0x44, 0xf7, 0x2f, 0x9f, 0x13, 0xcb, 0x5f, 0xfa, 0x83, + 0x58, 0xb8, 0x7d, 0x97, 0x98, 0x3f, 0x34, 0x8a, 0xe0, 0xeb, 0xbb, + 0xc0, 0x02, 0x6b, 0x40, 0x1c, 0x6c, 0x5d, 0x1f, 0xf5, 0x9f, 0xbb, + 0x0a, 0x27, 0xdf, 0x76, 0x19, 0xed, 0xbd, 0x68, 0x1d, 0x1d, 0x5f, + 0x3a, 0x9f, 0x86, 0x5b, 0x3b, 0x31, 0x8e, 0x10, 0x0a, 0x15, 0x67, + 0x91, 0x57, 0x60, 0x63, 0x8f, 0x73, 0x59, 0x87, 0x9c, 0xf3, 0x9a, + 0x4c, 0x38, 0x8f, 0x8e, 0xee, 0x15, 0xfc, 0xb7, 0x36, 0xaa, 0x95, + 0x02, 0x9a, 0x9f, 0xeb, 0xe9, 0x56, 0x51, 0xe0, 0xa4, 0xd6, 0x9c, + 0x5c, 0x52, 0xcd, 0x03, 0x60, 0x4e, 0x79, 0xaa, 0xf7, 0xc7, 0xca, + 0x80, 0xd3, 0x21, 0xc0, 0xa0, 0xa1, 0x80, 0x50, 0xff, 0x49, 0xb4, + 0xed, 0x3e, 0x24, 0xba, 0x77, 0x1f, 0x12, 0x5d, 0x3b, 0xf6, 0xa0, + 0xe7, 0xb7, 0x2f, 0x89, 0x25, 0x87, 0x4e, 0x88, 0xf6, 0x20, 0x0e, + 0x17, 0x58, 0x60, 0xee, 0x96, 0x88, 0xa1, 0xb0, 0xa0, 0x9b, 0xc6, + 0x2f, 0x5a, 0x8b, 0xa3, 0x97, 0x9c, 0x4b, 0xc7, 0xd6, 0x2d, 0xa3, + 0xc1, 0xe5, 0x8b, 0x30, 0xb0, 0x7a, 0x29, 0x0d, 0xb0, 0x04, 0xb2, + 0x20, 0x98, 0x16, 0x05, 0xc6, 0x21, 0xaa, 0xbe, 0x0e, 0x72, 0x02, + 0x9a, 0xe9, 0x02, 0x2b, 0x37, 0x70, 0x39, 0xd5, 0x60, 0xba, 0xc1, + 0x4c, 0xb8, 0x00, 0x0d, 0x32, 0x40, 0xb3, 0xc2, 0x0c, 0x2e, 0x50, + 0xb3, 0xb6, 0x53, 0x23, 0x1b, 0x7c, 0xdc, 0x00, 0xe7, 0x04, 0x2b, + 0xdd, 0x25, 0x8f, 0x93, 0x02, 0x9c, 0xd9, 0x2e, 0x8e, 0xc0, 0x2a, + 0xa3, 0x85, 0x6a, 0x20, 0x10, 0x18, 0xd2, 0x88, 0x0e, 0x8d, 0x21, + 0xf9, 0xda, 0x7e, 0xd1, 0xbd, 0x7d, 0x97, 0x58, 0xb0, 0xe7, 0x30, + 0x3a, 0xf7, 0x1d, 0x15, 0x1d, 0xbb, 0x0e, 0x60, 0xde, 0xfe, 0xa3, + 0xa2, 0xd3, 0x30, 0x82, 0x9e, 0x75, 0x03, 0x9b, 0x5b, 0xd6, 0xd3, + 0x89, 0xf1, 0xb5, 0xcb, 0x69, 0x70, 0xe9, 0x39, 0x18, 0xe9, 0x5b, + 0x4c, 0x83, 0x6b, 0x97, 0xd1, 0xa9, 0x4b, 0xd6, 0xe3, 0xd8, 0xfc, + 0x79, 0x34, 0x1e, 0x6e, 0xc1, 0x24, 0x34, 0x98, 0x30, 0xcb, 0x8e, + 0x63, 0x11, 0x54, 0x9e, 0xe3, 0x36, 0xc8, 0x58, 0xa1, 0xe3, 0xa4, + 0xa8, 0x64, 0x61, 0xe7, 0x04, 0x30, 0x2b, 0xc4, 0x4c, 0x9b, 0x1a, + 0xf3, 0x85, 0x99, 0x17, 0xd0, 0xbc, 0x54, 0x1a, 0x3c, 0xa0, 0xe6, + 0x56, 0x71, 0xc0, 0x24, 0x21, 0xa7, 0x79, 0xc0, 0x4b, 0x43, 0x75, + 0x03, 0x5f, 0xa7, 0x63, 0x4c, 0x0f, 0xda, 0xa2, 0x81, 0xca, 0x90, + 0x03, 0x08, 0x0c, 0x06, 0xf4, 0xfc, 0x04, 0x62, 0x07, 0x8f, 0x89, + 0x8e, 0x63, 0xa7, 0xd0, 0xb6, 0x7d, 0x97, 0xe8, 0x79, 0x79, 0x97, + 0x38, 0xe7, 0xf0, 0x71, 0xb4, 0x9d, 0x18, 0x40, 0x6a, 0x60, 0x44, + 0x24, 0x86, 0xc7, 0x10, 0x7c, 0xb9, 0x17, 0xd8, 0xeb, 0x5a, 0x71, + 0xcd, 0x6b, 0xc7, 0x64, 0x77, 0x07, 0xa5, 0x17, 0xf5, 0x62, 0x6c, + 0xe5, 0x62, 0x1a, 0xbc, 0xec, 0x7c, 0x3a, 0xb2, 0x64, 0x01, 0x46, + 0x97, 0x2e, 0xa0, 0xa1, 0x8e, 0x79, 0x98, 0x40, 0x08, 0x45, 0x30, + 0x98, 0xe0, 0x10, 0x28, 0x80, 0xca, 0xe8, 0x10, 0x1e, 0x50, 0xb1, + 0xa7, 0x99, 0x2e, 0x90, 0xf3, 0x83, 0x95, 0x9b, 0x3b, 0xe9, 0x14, + 0x23, 0x93, 0xf9, 0xe4, 0xa9, 0xea, 0x63, 0x75, 0x19, 0xa0, 0xc9, + 0xb8, 0xa0, 0x32, 0xae, 0xa8, 0x17, 0xe0, 0x9c, 0x94, 0x97, 0xe6, + 0x01, 0x33, 0xcd, 0x65, 0xff, 0x4e, 0xc7, 0xa2, 0x19, 0xe9, 0x0c, + 0x34, 0x43, 0x0b, 0x0a, 0x68, 0x28, 0x22, 0x54, 0xcc, 0x20, 0x32, + 0x9a, 0x46, 0x7c, 0xff, 0x51, 0xd1, 0xf6, 0xda, 0x01, 0xd1, 0x73, + 0xa4, 0x1f, 0xad, 0x7b, 0x0e, 0xa2, 0x73, 0xc7, 0x1e, 0xd1, 0x3b, + 0x30, 0x22, 0x12, 0x23, 0xe3, 0x88, 0x4d, 0x66, 0x11, 0x9e, 0xcb, + 0x03, 0x26, 0x07, 0x76, 0x66, 0x58, 0x38, 0x04, 0xb3, 0xad, 0x05, + 0xd9, 0x8e, 0x56, 0xca, 0x2c, 0x3f, 0x07, 0x43, 0xe7, 0xad, 0xa2, + 0x53, 0x8b, 0x7a, 0x30, 0xd6, 0xb7, 0x90, 0x86, 0xd6, 0xad, 0xa0, + 0xfe, 0xce, 0x36, 0x4c, 0x26, 0x12, 0xc8, 0x21, 0x8c, 0x22, 0x74, + 0x18, 0xe0, 0xe5, 0x3a, 0xc7, 0x29, 0x7d, 0x24, 0x66, 0x40, 0xc3, + 0x0d, 0x26, 0x5e, 0x30, 0x73, 0x5b, 0x36, 0x5c, 0xb6, 0x35, 0x5d, + 0xd2, 0x38, 0xbc, 0xdb, 0x95, 0xf9, 0x7d, 0xee, 0x54, 0xf5, 0xdd, + 0xb9, 0x17, 0xd0, 0x64, 0xa0, 0x26, 0x1b, 0x5f, 0x73, 0xab, 0x1d, + 0x65, 0x92, 0x80, 0x92, 0xcd, 0xef, 0xb4, 0x6c, 0x3f, 0x7e, 0xf5, + 0xe0, 0xa5, 0x54, 0x76, 0x53, 0xa7, 0xab, 0x34, 0x04, 0x08, 0x0c, + 0x1c, 0x0c, 0x59, 0x44, 0x26, 0xd2, 0x88, 0x8d, 0xa7, 0x11, 0x1d, + 0x1c, 0x11, 0xc9, 0x53, 0xa3, 0x48, 0xec, 0x3d, 0x2c, 0xda, 0x77, + 0xec, 0xc1, 0xfc, 0xfe, 0x21, 0x91, 0xea, 0x1f, 0x42, 0x72, 0x78, + 0x0c, 0xf1, 0xd1, 0x09, 0x11, 0x1d, 0x9b, 0x40, 0x74, 0x32, 0xa8, + 0x79, 0x0d, 0xac, 0x0e, 0x0b, 0xe9, 0x30, 0x5b, 0x52, 0xc8, 0xb5, + 0xa7, 0x90, 0x6b, 0x6b, 0xa1, 0x6c, 0x77, 0x3b, 0x26, 0xbb, 0x3b, + 0x29, 0xbd, 0x7c, 0x21, 0x06, 0xcf, 0x5f, 0x49, 0xa7, 0xba, 0x3b, + 0x91, 0xee, 0x6a, 0xa7, 0x74, 0x47, 0x2b, 0x32, 0x2d, 0x09, 0xe4, + 0xf4, 0x04, 0xb2, 0x08, 0xc1, 0x80, 0x28, 0x63, 0xaa, 0x08, 0x4b, + 0x0f, 0x85, 0x55, 0xbd, 0x53, 0xcc, 0xec, 0xee, 0x0b, 0x15, 0x55, + 0xc6, 0x7d, 0xa0, 0xe6, 0x94, 0xdf, 0xf4, 0xc9, 0xcb, 0x15, 0x00, + 0xe6, 0x07, 0x31, 0xaf, 0x1e, 0x6b, 0x21, 0x13, 0x43, 0x73, 0x83, + 0x9a, 0x9f, 0x2b, 0xca, 0x7c, 0xe2, 0x6c, 0xcc, 0xa2, 0x98, 0xec, + 0xdf, 0x88, 0x92, 0x0f, 0xa0, 0xc8, 0x03, 0x56, 0x32, 0x13, 0xc1, + 0x79, 0x24, 0x66, 0xe6, 0x70, 0x7e, 0x33, 0x61, 0x37, 0xed, 0xc4, + 0x4e, 0x9f, 0x01, 0xc0, 0x60, 0x42, 0x83, 0x01, 0xcd, 0xcc, 0x23, + 0x9c, 0xce, 0x20, 0x92, 0xce, 0x20, 0xb2, 0xff, 0xa8, 0x68, 0x3b, + 0x72, 0x12, 0x1d, 0x03, 0xc3, 0x22, 0xd1, 0x3f, 0x82, 0xc4, 0xe1, + 0xe3, 0x68, 0xdd, 0x7f, 0x54, 0x74, 0x0e, 0x8f, 0x23, 0x3e, 0x31, + 0x29, 0x22, 0x13, 0x93, 0x88, 0xe4, 0xf2, 0xd0, 0x8b, 0x41, 0x0c, + 0x6f, 0x4e, 0x19, 0x63, 0x10, 0x91, 0x30, 0x8c, 0x44, 0x0c, 0xf9, + 0x96, 0x04, 0x0a, 0x2d, 0x09, 0xca, 0xcf, 0xef, 0xc6, 0xe8, 0xea, + 0xa5, 0x34, 0xdc, 0x53, 0x86, 0x54, 0x6f, 0x27, 0x26, 0x56, 0x2e, + 0xc6, 0x50, 0x47, 0x3b, 0x65, 0x92, 0x31, 0xe4, 0xa3, 0x31, 0xe4, + 0x11, 0x82, 0x01, 0x0d, 0x26, 0x58, 0x39, 0x24, 0x6f, 0x5a, 0x80, + 0x55, 0x2a, 0xfa, 0x4e, 0xe0, 0x72, 0xeb, 0xea, 0xcb, 0x9a, 0x66, + 0xba, 0xac, 0x93, 0x99, 0x64, 0x20, 0xe8, 0x04, 0x4e, 0xe1, 0x11, + 0xe8, 0xf7, 0x82, 0x99, 0x9b, 0x2a, 0x83, 0x4a, 0x0c, 0x4d, 0x05, + 0x6c, 0x4e, 0x90, 0x73, 0x82, 0x9b, 0x5b, 0xcc, 0x8d, 0x5c, 0xe0, + 0xc3, 0x7c, 0xe2, 0x73, 0xcc, 0x67, 0x3f, 0x4c, 0x11, 0x60, 0x4e, + 0xf3, 0x4e, 0xbf, 0xd3, 0xf3, 0xd3, 0x7f, 0x28, 0xbb, 0xb3, 0x62, + 0xc6, 0x1a, 0x13, 0x0c, 0x05, 0x84, 0x8a, 0x39, 0x84, 0x33, 0xe5, + 0x69, 0x3c, 0x2d, 0x22, 0xe3, 0x69, 0xc4, 0x46, 0xd3, 0x88, 0x0e, + 0x8e, 0x20, 0xbe, 0xe7, 0xb0, 0x68, 0xeb, 0x1f, 0x44, 0xdb, 0xc8, + 0x04, 0x62, 0xe3, 0x69, 0x11, 0x19, 0x4d, 0x23, 0x3a, 0x32, 0x8a, + 0x58, 0xff, 0xb0, 0x48, 0x4c, 0x66, 0x11, 0x2d, 0x14, 0xa1, 0x71, + 0x1e, 0xb8, 0xba, 0x67, 0xa2, 0x9a, 0x8a, 0x46, 0x50, 0xec, 0x68, + 0xc5, 0x64, 0x6f, 0x27, 0x65, 0x92, 0x09, 0xe4, 0x3a, 0x52, 0xc8, + 0xa7, 0x92, 0x94, 0xed, 0x6a, 0xc7, 0xe4, 0xd2, 0x73, 0x30, 0xbc, + 0xa8, 0x97, 0x26, 0x5a, 0x93, 0xc8, 0xb7, 0x24, 0x91, 0x6d, 0x4f, + 0x51, 0x36, 0x1e, 0x45, 0x21, 0x1e, 0x43, 0x31, 0x16, 0x45, 0x1e, + 0x11, 0x14, 0xcb, 0x63, 0x50, 0x8a, 0x8a, 0xc2, 0x32, 0x40, 0x15, + 0x50, 0xf1, 0x72, 0x30, 0x5c, 0xb8, 0x16, 0x78, 0x2f, 0x80, 0xc9, + 0x40, 0xce, 0x4d, 0xa1, 0x09, 0x9f, 0x65, 0x3f, 0xa5, 0xc5, 0xe1, + 0x5d, 0x43, 0x29, 0x5c, 0x80, 0x56, 0x33, 0xc8, 0x6a, 0x01, 0x9a, + 0x8c, 0x1b, 0x6a, 0x77, 0x41, 0x9d, 0x54, 0x9b, 0xdb, 0x68, 0xc8, + 0xf6, 0x5f, 0xcd, 0x53, 0x39, 0x79, 0x2f, 0x93, 0x4f, 0x1e, 0x92, + 0x04, 0x98, 0x1f, 0xd4, 0xbc, 0x46, 0x76, 0x9e, 0x9e, 0xb7, 0x02, + 0x6f, 0x7a, 0x2d, 0xcd, 0xd8, 0xa3, 0x00, 0x81, 0x43, 0x03, 0x2f, + 0xb9, 0xba, 0x66, 0x16, 0xa1, 0x91, 0x09, 0xc4, 0x26, 0x33, 0x88, + 0x8c, 0x4d, 0x8a, 0x48, 0x36, 0x87, 0xf0, 0x78, 0x49, 0xdd, 0x85, + 0xc7, 0x26, 0x10, 0x99, 0xc8, 0x88, 0xc8, 0x64, 0x16, 0x91, 0xb1, + 0x09, 0x84, 0x73, 0x05, 0x44, 0x4e, 0x0e, 0x88, 0xd8, 0x89, 0x21, + 0x24, 0x26, 0x26, 0x91, 0xc8, 0x64, 0xa1, 0xe7, 0x8b, 0xd0, 0x0d, + 0x03, 0x7a, 0x26, 0x27, 0xb4, 0x7c, 0x11, 0x9a, 0x61, 0x40, 0xcf, + 0x17, 0xa0, 0xcd, 0x75, 0x65, 0x48, 0x04, 0x1e, 0x8b, 0xc0, 0xd4, + 0x75, 0x98, 0x61, 0x1d, 0x66, 0x2c, 0x4a, 0x46, 0x38, 0x04, 0x33, + 0x1c, 0x82, 0x11, 0x8b, 0xc0, 0x48, 0xc4, 0x91, 0xeb, 0x6c, 0x45, + 0x7a, 0x61, 0x0f, 0x65, 0x92, 0x09, 0xe4, 0x53, 0x31, 0xe4, 0x5b, + 0x52, 0x28, 0xc4, 0x23, 0x94, 0x6f, 0x4b, 0x21, 0x1f, 0x8b, 0x21, + 0x9f, 0x8a, 0xa1, 0x90, 0x88, 0xa3, 0x90, 0x8c, 0x21, 0x9f, 0x4a, + 0x50, 0x3e, 0x95, 0x40, 0x36, 0x91, 0x42, 0xbe, 0x7c, 0xf7, 0xcc, + 0x72, 0xb0, 0x82, 0x5b, 0x8a, 0xab, 0x70, 0x68, 0x0e, 0x2a, 0x2c, + 0xea, 0x4a, 0x78, 0xa8, 0x14, 0xee, 0x31, 0xef, 0xb4, 0xce, 0x0d, + 0x6a, 0x7e, 0xeb, 0x4c, 0x87, 0x7d, 0xfb, 0xa9, 0x3d, 0xbf, 0xbc, + 0x6e, 0xc7, 0x84, 0xa2, 0x1a, 0x93, 0x82, 0x59, 0xad, 0x40, 0x73, + 0x52, 0x6b, 0x7e, 0xb1, 0x35, 0xaf, 0x8a, 0x04, 0x15, 0x90, 0xf8, + 0x29, 0x27, 0x59, 0x70, 0x11, 0x54, 0x54, 0x98, 0xf7, 0x70, 0xf4, + 0x5e, 0x69, 0xb0, 0x1c, 0xd7, 0xef, 0x1a, 0x4c, 0xc3, 0x0f, 0x15, + 0x00, 0xda, 0x8f, 0x3c, 0x55, 0x25, 0x31, 0x95, 0x0f, 0x95, 0x5f, + 0xb3, 0xec, 0x02, 0x9b, 0xd0, 0x78, 0x09, 0x5c, 0xba, 0x69, 0x82, + 0xe5, 0x8b, 0xe5, 0x79, 0x0e, 0x36, 0x9e, 0x16, 0xe1, 0xe1, 0x31, + 0x44, 0xd2, 0x19, 0x44, 0xf3, 0x05, 0x84, 0x27, 0xb3, 0x08, 0x65, + 0x72, 0x08, 0x15, 0x0d, 0xa1, 0x15, 0xcb, 0xc0, 0xcb, 0xe4, 0xa0, + 0x17, 0x8a, 0xd3, 0xdb, 0x9b, 0x1c, 0x5a, 0x26, 0x07, 0xcd, 0x30, + 0xc1, 0x8a, 0x45, 0x30, 0xd3, 0x84, 0x66, 0x72, 0x41, 0x9c, 0x43, + 0xe3, 0x02, 0xc4, 0x39, 0x28, 0x93, 0xab, 0x40, 0x92, 0x0a, 0x45, + 0x30, 0x93, 0x83, 0x91, 0xf5, 0xa1, 0x23, 0xc0, 0x30, 0xca, 0x2a, + 0x93, 0xa6, 0xd5, 0x0d, 0xd9, 0x1e, 0x4c, 0x51, 0x0a, 0x78, 0x73, + 0x8d, 0x81, 0x0b, 0x01, 0x8a, 0x84, 0x61, 0x86, 0x43, 0xa5, 0x07, + 0x5f, 0xd7, 0xc0, 0x89, 0x20, 0x74, 0x8d, 0x4c, 0x4d, 0x83, 0x28, + 0xab, 0x23, 0x33, 0xa4, 0x83, 0xeb, 0x1a, 0x4c, 0x5d, 0x83, 0x19, + 0xd2, 0x61, 0xc4, 0xa2, 0x30, 0xe3, 0x51, 0x18, 0xa5, 0x65, 0x32, + 0xca, 0x6e, 0x9e, 0x11, 0x8b, 0xa2, 0x10, 0x8b, 0x20, 0xd7, 0x96, + 0x42, 0x7e, 0x5e, 0x1b, 0xe5, 0x74, 0x1d, 0xa6, 0xa6, 0x81, 0x47, + 0x42, 0x30, 0x43, 0x3a, 0x4c, 0x5d, 0x87, 0xa1, 0x87, 0x60, 0x42, + 0x2f, 0x5f, 0xc9, 0x50, 0xe5, 0xb3, 0x76, 0x61, 0x29, 0x56, 0xc2, + 0x02, 0x23, 0xaa, 0x68, 0x27, 0x5e, 0x56, 0x55, 0x70, 0x04, 0x94, + 0xb5, 0xf0, 0xc2, 0x47, 0x91, 0x78, 0xb9, 0x5e, 0x6e, 0xa0, 0x93, + 0x81, 0x9c, 0x4c, 0x7e, 0xd3, 0x07, 0x42, 0xdc, 0x63, 0x5b, 0x2e, + 0x09, 0x60, 0xeb, 0x35, 0x00, 0xe4, 0x47, 0x74, 0x92, 0x82, 0x59, + 0x3d, 0x40, 0xf3, 0x73, 0x43, 0xfd, 0x62, 0x6d, 0x7e, 0x60, 0x93, + 0x55, 0x3f, 0xf5, 0xa4, 0xc9, 0xaa, 0x2e, 0xb7, 0xed, 0xa0, 0x00, + 0xb7, 0x5a, 0x26, 0x48, 0xa4, 0xc1, 0x06, 0x43, 0xd8, 0x70, 0x87, + 0xaa, 0x34, 0x0d, 0x02, 0x04, 0x61, 0x5b, 0x4f, 0x96, 0xbb, 0x46, + 0x0e, 0x8f, 0x10, 0xb3, 0x3c, 0x72, 0xa5, 0x63, 0x09, 0xcb, 0x76, + 0xbc, 0x72, 0x0e, 0x02, 0xc2, 0xf1, 0x99, 0x10, 0x96, 0x6d, 0xac, + 0xc7, 0x15, 0x2e, 0x4f, 0xd4, 0xd4, 0xde, 0xad, 0xe7, 0x69, 0x3d, + 0x03, 0xeb, 0x59, 0x54, 0xbf, 0xbd, 0x85, 0xc3, 0xbc, 0xa8, 0xa8, + 0xe0, 0xea, 0xe2, 0x64, 0x45, 0xd1, 0xcc, 0x2d, 0xdd, 0x7a, 0x6c, + 0x86, 0xcf, 0xb2, 0x9b, 0xf2, 0xe0, 0x1e, 0xcb, 0x32, 0x70, 0xf3, + 0x52, 0x37, 0xdc, 0x07, 0x86, 0xb2, 0x40, 0x14, 0x35, 0x82, 0x4a, + 0x48, 0xfe, 0x3f, 0x6e, 0x00, 0x13, 0xb5, 0x42, 0xcc, 0x6a, 0xf5, + 0x76, 0xe4, 0x2e, 0x1c, 0x1e, 0x5c, 0xaf, 0xbc, 0x34, 0xe3, 0x01, + 0xaf, 0x2e, 0x98, 0x5c, 0x01, 0x76, 0x5e, 0x40, 0xf2, 0x03, 0x24, + 0x53, 0x38, 0x06, 0x49, 0x6e, 0x03, 0x49, 0x98, 0xc1, 0x01, 0x8a, + 0xa8, 0x01, 0x68, 0xd5, 0xf3, 0xa2, 0x82, 0x03, 0xaf, 0xd1, 0xee, + 0xdd, 0xd2, 0xdd, 0x42, 0x08, 0xfe, 0x2f, 0x2f, 0x92, 0x56, 0xf1, + 0x2a, 0xcf, 0x93, 0x3d, 0x45, 0xf8, 0x6c, 0xe3, 0xf6, 0x66, 0xf7, + 0x6a, 0xbb, 0xe4, 0x35, 0xe0, 0x86, 0x2c, 0xd0, 0x20, 0x51, 0x60, + 0x1b, 0x35, 0xf9, 0xb9, 0x6b, 0x2a, 0xca, 0xce, 0x6f, 0x9d, 0x90, + 0x3c, 0x0e, 0x57, 0x84, 0x3a, 0xe0, 0xd3, 0xeb, 0x6c, 0x2d, 0x20, + 0x6b, 0x14, 0xd0, 0x9c, 0x0e, 0x4e, 0x0e, 0x0f, 0x10, 0x39, 0xcc, + 0xab, 0x28, 0x37, 0x2a, 0x4b, 0x62, 0x27, 0x80, 0xa0, 0x06, 0x40, + 0xd9, 0x21, 0xa2, 0xba, 0x3d, 0x24, 0xd7, 0xc9, 0xb9, 0x99, 0xb5, + 0xc0, 0xcb, 0xbf, 0x52, 0xc6, 0xed, 0x1a, 0x7b, 0x81, 0x8b, 0x3c, + 0x94, 0xb6, 0x3b, 0xa8, 0x9a, 0xd7, 0x36, 0x4f, 0xd4, 0x90, 0x26, + 0x24, 0xa1, 0x06, 0x05, 0xc0, 0xf9, 0x15, 0x4a, 0x59, 0xd5, 0xd6, + 0x0c, 0xc8, 0x09, 0x49, 0x08, 0xd5, 0x02, 0x3f, 0x95, 0xc9, 0xcf, + 0x95, 0x94, 0x89, 0x8d, 0xd5, 0x04, 0xb1, 0x66, 0x01, 0x0d, 0x0e, + 0xd0, 0xf2, 0x7b, 0x08, 0xad, 0xaa, 0x8e, 0xd9, 0xa0, 0xe8, 0x54, + 0x50, 0x99, 0xe5, 0xa2, 0xa9, 0xaa, 0x20, 0xbf, 0xfc, 0x4c, 0x01, + 0x40, 0xf5, 0xb8, 0x8d, 0xb2, 0x31, 0xc6, 0x7a, 0x20, 0x26, 0xdb, + 0x7e, 0x50, 0x16, 0x70, 0xb2, 0xaa, 0x0d, 0x67, 0x08, 0xd8, 0xbc, + 0xd4, 0x9a, 0x0c, 0xe8, 0xbc, 0x54, 0x18, 0x5c, 0x0a, 0xb0, 0x5f, + 0x41, 0x56, 0x85, 0x9b, 0x1b, 0x20, 0x4e, 0xd7, 0x04, 0x0f, 0x35, + 0x26, 0xe3, 0x3e, 0x0a, 0x09, 0x60, 0xd5, 0xdd, 0x73, 0xa6, 0x3e, + 0x4b, 0x0f, 0x20, 0x49, 0x9c, 0x34, 0x97, 0x28, 0x84, 0x5c, 0x52, + 0xd1, 0x01, 0xf5, 0xa9, 0x22, 0x26, 0xb1, 0x7f, 0x26, 0x09, 0x2c, + 0x28, 0xc2, 0x0c, 0xa8, 0x4f, 0x89, 0xd5, 0x03, 0x31, 0x3f, 0x35, + 0x46, 0x0a, 0x95, 0x44, 0xcd, 0x02, 0x99, 0x4c, 0xad, 0x97, 0xac, + 0xfb, 0xa9, 0x0a, 0x39, 0x15, 0xe0, 0xd5, 0xa2, 0xda, 0x20, 0x09, + 0x34, 0x48, 0xba, 0x7a, 0xb0, 0xb9, 0xa9, 0xa8, 0x11, 0xac, 0x7e, + 0x0a, 0x0c, 0xf0, 0x6e, 0xf8, 0xda, 0x14, 0x35, 0x36, 0x9b, 0x40, + 0x93, 0x05, 0x9c, 0x70, 0x51, 0x76, 0x76, 0xf5, 0xe6, 0x57, 0xa8, + 0x65, 0xd6, 0xcb, 0x42, 0x05, 0x0a, 0x10, 0x83, 0xc7, 0x7a, 0x2f, + 0x60, 0xfa, 0x41, 0xcc, 0x69, 0xbd, 0xdf, 0x75, 0x68, 0x96, 0x1a, + 0x23, 0xc7, 0x00, 0x7f, 0x73, 0xa0, 0x26, 0x7c, 0x62, 0xb1, 0x4e, + 0xeb, 0x55, 0x6a, 0xc5, 0x64, 0x5c, 0x1f, 0x59, 0xf7, 0xb3, 0x56, + 0xe8, 0x01, 0xf2, 0xf1, 0x38, 0x59, 0x00, 0xd5, 0x53, 0x71, 0xa1, + 0x72, 0x8e, 0xb5, 0x5c, 0xbb, 0xa6, 0x43, 0xec, 0x74, 0x00, 0xcd, + 0xaf, 0x32, 0x01, 0x0a, 0x80, 0x53, 0xa9, 0x49, 0xad, 0x25, 0x4d, + 0x56, 0x61, 0xa9, 0xc6, 0xb8, 0x64, 0xcf, 0xa1, 0x96, 0x3c, 0x50, + 0x58, 0x27, 0x0b, 0xb5, 0x5a, 0xdc, 0x4c, 0x6a, 0xf0, 0xb3, 0x51, + 0xab, 0x6a, 0x93, 0x55, 0x70, 0x2a, 0x40, 0x83, 0x42, 0x01, 0xf7, + 0xfd, 0x88, 0x5a, 0x41, 0xdd, 0xa9, 0xe6, 0x57, 0x55, 0x92, 0x2a, + 0xe7, 0xec, 0x05, 0x2d, 0x71, 0x3a, 0x00, 0x76, 0xa6, 0x00, 0xcd, + 0xef, 0x1f, 0x26, 0x8f, 0x87, 0x4a, 0xb6, 0x90, 0xd6, 0xd2, 0x84, + 0x64, 0xb6, 0x40, 0xe9, 0x74, 0x7e, 0x8d, 0x70, 0x23, 0x6b, 0x55, + 0x65, 0x2a, 0xae, 0xe4, 0x99, 0x08, 0x34, 0x51, 0x07, 0xe0, 0xbc, + 0x0a, 0x68, 0x3d, 0xea, 0x4e, 0xa5, 0x22, 0xa2, 0x56, 0xb7, 0xb6, + 0x5e, 0xc8, 0xca, 0xfe, 0x3f, 0x2a, 0x0a, 0x6c, 0xd6, 0x21, 0x76, + 0xa6, 0x01, 0xad, 0x51, 0x90, 0x73, 0x72, 0x47, 0x48, 0xa1, 0xa0, + 0xab, 0xb8, 0x6e, 0x8d, 0xac, 0x61, 0xac, 0x57, 0x71, 0xa9, 0xb4, + 0x05, 0x54, 0x75, 0x31, 0x67, 0x13, 0x64, 0x8d, 0x80, 0x9b, 0x0a, + 0xd8, 0x54, 0x0b, 0xae, 0x6a, 0x4d, 0xaa, 0xac, 0xda, 0x51, 0x01, + 0x4d, 0x23, 0x9a, 0xa3, 0xf8, 0x01, 0x5b, 0x15, 0x5e, 0xa7, 0x15, + 0x60, 0xaf, 0x17, 0xa0, 0xa9, 0xb8, 0xa9, 0x4e, 0x17, 0x9f, 0x5c, + 0x80, 0xa7, 0x12, 0x2b, 0x52, 0x85, 0x4c, 0xad, 0x79, 0x20, 0x19, + 0x17, 0x53, 0xd9, 0x0f, 0x14, 0xf3, 0x9d, 0x2e, 0x35, 0xd6, 0x48, + 0xc0, 0xc9, 0x28, 0x37, 0x55, 0xa0, 0xa9, 0xce, 0xd7, 0x0a, 0x42, + 0x15, 0x08, 0xaa, 0xba, 0xcc, 0xb2, 0xff, 0xdb, 0x19, 0xad, 0xbc, + 0xce, 0x46, 0xa0, 0xd5, 0x73, 0x61, 0x9d, 0xc0, 0xa6, 0x52, 0xc8, + 0xeb, 0x89, 0x45, 0xd5, 0x52, 0xc3, 0x28, 0x0b, 0x3e, 0x48, 0xba, + 0x90, 0xe4, 0xa2, 0x74, 0xfd, 0x3e, 0x61, 0xf3, 0x7b, 0x21, 0x34, + 0x0b, 0x72, 0xc2, 0x63, 0xff, 0x4e, 0x71, 0x56, 0x21, 0xb1, 0xad, + 0xf0, 0x51, 0xf9, 0xb5, 0xc6, 0xe1, 0xea, 0x55, 0x74, 0xaa, 0xdb, + 0xa9, 0xee, 0xaf, 0x16, 0x25, 0xfb, 0xba, 0x35, 0x1d, 0x67, 0xa7, + 0x09, 0xc5, 0x7c, 0xe4, 0xa2, 0x02, 0x65, 0xe1, 0xa7, 0x0a, 0x34, + 0x81, 0xe9, 0x1a, 0xd1, 0x7a, 0xd5, 0x94, 0x5a, 0xab, 0xfe, 0xfa, + 0xd2, 0x55, 0xd4, 0x9b, 0x6a, 0x01, 0x91, 0xdd, 0x46, 0xf8, 0xe4, + 0x57, 0x09, 0x4e, 0xab, 0xaa, 0x3a, 0x55, 0xd7, 0xcc, 0x2f, 0x2e, + 0xd7, 0x08, 0xb7, 0xb8, 0x51, 0x69, 0x67, 0x85, 0x9d, 0xad, 0x40, + 0x6b, 0x84, 0xb2, 0x13, 0x0d, 0x72, 0xd1, 0xdc, 0xd2, 0xb8, 0x02, + 0x50, 0x54, 0xa0, 0xe5, 0xd5, 0xb4, 0xc2, 0x0d, 0x88, 0x02, 0xcd, + 0x6b, 0x63, 0x46, 0x0d, 0xbc, 0x27, 0x2a, 0xdb, 0x0b, 0x45, 0xe8, + 0xd9, 0x41, 0x59, 0x0b, 0xec, 0x6a, 0x05, 0x22, 0x35, 0x70, 0xbb, + 0xd7, 0xa5, 0xab, 0x18, 0x00, 0xed, 0xf4, 0xba, 0xb0, 0x6e, 0x0f, + 0x94, 0x4a, 0x1c, 0xaa, 0x19, 0x79, 0x9b, 0x11, 0xd0, 0xa7, 0xd7, + 0xf9, 0x7d, 0x13, 0x0d, 0x5c, 0x57, 0x6b, 0x43, 0x5f, 0x55, 0xe5, + 0xa8, 0x0a, 0x65, 0x3f, 0xd5, 0x3a, 0x67, 0x2c, 0x00, 0x5a, 0x7d, + 0x85, 0x47, 0xc0, 0xff, 0x2b, 0x08, 0x99, 0x36, 0x77, 0x2a, 0x0f, + 0x63, 0x33, 0x82, 0xf7, 0xaa, 0xd0, 0xa2, 0x33, 0xec, 0x3e, 0x9c, + 0x0e, 0xe0, 0xd5, 0x0a, 0x29, 0xd5, 0xff, 0x81, 0x2b, 0xec, 0x47, + 0xcc, 0xf5, 0x42, 0x1a, 0x00, 0xed, 0xf4, 0x14, 0x30, 0x92, 0xdc, + 0x0f, 0x29, 0x1e, 0x4f, 0x05, 0x34, 0xcd, 0x00, 0xdd, 0x99, 0x7e, + 0x0f, 0x1a, 0x99, 0xcf, 0xad, 0x92, 0x21, 0x70, 0xfd, 0x02, 0xa0, + 0x05, 0x10, 0x54, 0xc8, 0x47, 0x0d, 0x2a, 0x30, 0x14, 0x5c, 0xf7, + 0xba, 0xf7, 0x11, 0x00, 0xea, 0x0c, 0xb3, 0xff, 0x3f, 0x00, 0x33, + 0x7e, 0xb5, 0x01, 0x3c, 0x57, 0x93, 0xe4, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +unsigned int nxlogo_png_size = sizeof(nxlogo_png); static void nx_iperf_send_image(NX_WEB_HTTP_SERVER *server_ptr, UCHAR *img, UINT imgsize); static void nx_iperf_print_tcp_rx_results(NX_WEB_HTTP_SERVER *server_ptr, NXD_ADDRESS *peer_ip_address); diff --git a/utility/iperf/nx_iperf.h b/utility/iperf/nx_iperf.h index fc449dec..a1e9f68d 100644 --- a/utility/iperf/nx_iperf.h +++ b/utility/iperf/nx_iperf.h @@ -20,6 +20,9 @@ /**************************************************************************/ /**************************************************************************/ +#ifndef NX_IPERF_H +#define NX_IPERF_H + /* Enable authentication. #define NX_IPERF_AUTH_ENABLE */ @@ -239,1980 +242,4 @@ typedef struct #define choosetesttag \ "Choose a test from the left.\r\n" -const unsigned char mslogo_jpg[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, - 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, - 0x00, 0x00, 0x01, 0xd7, 0x00, 0x00, 0x00, 0x9c, - 0x08, 0x06, 0x00, 0x00, 0x00, 0x2d, 0x6c, 0xe1, - 0xda, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, - 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, - 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, - 0xb1, 0x8f, 0x0b, 0xfc, 0x61, 0x05, 0x00, 0x00, - 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, - 0x2e, 0x22, 0x00, 0x00, 0x2e, 0x22, 0x01, 0xaa, - 0xe2, 0xdd, 0x92, 0x00, 0x00, 0x19, 0xc7, 0x49, - 0x44, 0x41, 0x54, 0x78, 0x5e, 0xed, 0xdd, 0x07, - 0xb8, 0x2c, 0x67, 0x5d, 0xc7, 0xf1, 0x7b, 0x91, - 0x2a, 0x10, 0x08, 0x08, 0xa1, 0xb7, 0x18, 0x20, - 0x14, 0xe9, 0x01, 0x44, 0x40, 0x5a, 0x00, 0x43, - 0x53, 0x8c, 0x08, 0x04, 0x43, 0x4d, 0x10, 0x94, - 0x26, 0x20, 0xc2, 0x23, 0x21, 0x54, 0x45, 0x10, - 0x69, 0x81, 0x50, 0x05, 0x42, 0x53, 0xe0, 0x41, - 0x50, 0x90, 0xa0, 0x14, 0x41, 0x41, 0x88, 0x0a, - 0xc6, 0x12, 0x5a, 0x10, 0x41, 0xa2, 0xb4, 0x20, - 0xd2, 0x04, 0x21, 0xfe, 0xbe, 0xb3, 0xb3, 0xcb, - 0xec, 0xbb, 0xef, 0xec, 0xee, 0xec, 0xd9, 0xbd, - 0xf7, 0x9c, 0x73, 0xbf, 0x9f, 0xe7, 0xf9, 0x9f, - 0x99, 0xdd, 0x9d, 0x99, 0xdd, 0xb3, 0x3b, 0x33, - 0xef, 0xbc, 0x75, 0xf6, 0x48, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x3a, 0xa0, 0xec, 0x6d, 0xa7, 0xbb, - 0xc2, 0x37, 0xee, 0x76, 0x15, 0xfe, 0x9f, 0x7f, - 0x4d, 0x5c, 0xa2, 0x79, 0x62, 0x33, 0xce, 0x3a, - 0xe8, 0xad, 0x67, 0x5e, 0x8b, 0x99, 0x13, 0x4e, - 0xdd, 0x73, 0x52, 0x26, 0xf7, 0x60, 0x7e, 0x83, - 0x8e, 0x38, 0xf1, 0xc8, 0x3d, 0x9f, 0x69, 0xe7, - 0x25, 0x49, 0x3b, 0xc0, 0xb9, 0xda, 0xe9, 0x6e, - 0x72, 0xd1, 0xc4, 0xc5, 0x36, 0x18, 0x07, 0x27, - 0xc6, 0x2e, 0x94, 0xa8, 0x2d, 0xb3, 0xce, 0xd8, - 0x8d, 0xbf, 0x91, 0x24, 0xed, 0x6a, 0x9e, 0xb8, - 0x25, 0x49, 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, - 0xd6, 0xcc, 0xc4, 0x55, 0x92, 0xa4, 0x35, 0x33, - 0x71, 0x95, 0x24, 0x69, 0xcd, 0x4c, 0x5c, 0x25, - 0x49, 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, 0xd6, - 0xcc, 0xc4, 0x55, 0xd2, 0xda, 0x9c, 0x73, 0xce, - 0x39, 0x17, 0x49, 0x1c, 0x9b, 0x78, 0x45, 0xe2, - 0xbd, 0x89, 0x0f, 0x27, 0xde, 0x9d, 0x38, 0x39, - 0x71, 0x58, 0xbb, 0x98, 0xb4, 0xeb, 0x99, 0xb8, - 0x6a, 0xbf, 0xc9, 0xc9, 0x76, 0x6f, 0xe2, 0xd2, - 0x89, 0xab, 0x25, 0xce, 0xdb, 0x3e, 0xad, 0x1d, - 0xa8, 0xfd, 0x2d, 0x7f, 0x35, 0xb3, 0x9f, 0x4e, - 0xfc, 0x61, 0xe2, 0x7e, 0x89, 0x9f, 0x4d, 0xdc, - 0x38, 0x71, 0xdb, 0xc4, 0x71, 0x89, 0xeb, 0x24, - 0xa4, 0x03, 0xc2, 0x6e, 0x1c, 0xa1, 0xe9, 0xac, - 0xc4, 0x21, 0xcd, 0x13, 0x9b, 0xf1, 0xc5, 0x83, - 0xde, 0x7a, 0xe6, 0x65, 0x99, 0x39, 0xe1, 0xd4, - 0x3d, 0xaf, 0xce, 0xe4, 0x3e, 0xcc, 0x6f, 0xd0, - 0x55, 0x4f, 0x3c, 0x72, 0xcf, 0xa7, 0xda, 0xf9, - 0x41, 0x72, 0xb2, 0x23, 0xa7, 0x30, 0x6f, 0x04, - 0xa9, 0xd3, 0xf6, 0xee, 0xdd, 0xfb, 0xe7, 0xed, - 0xfc, 0xca, 0xf2, 0x3e, 0x0c, 0xa6, 0xf1, 0xf0, - 0x44, 0xdf, 0xfe, 0xf4, 0xfe, 0xbc, 0xcf, 0x07, - 0xda, 0xf9, 0x46, 0xd6, 0x61, 0x80, 0x0c, 0x4e, - 0xc2, 0x47, 0x25, 0xb8, 0xc8, 0xfb, 0x8f, 0xc4, - 0x71, 0x59, 0xee, 0x1d, 0x99, 0x6a, 0x07, 0xc9, - 0x6f, 0xc9, 0xef, 0xf7, 0xc2, 0xc4, 0x83, 0x9b, - 0x27, 0xfa, 0x1d, 0x9d, 0xdf, 0xf7, 0x4d, 0xed, - 0xfc, 0x7e, 0x91, 0xcf, 0xca, 0xe4, 0x81, 0x89, - 0x4b, 0x31, 0x53, 0xf8, 0x40, 0x3e, 0xdf, 0xfb, - 0xdb, 0x79, 0x69, 0x4b, 0x4c, 0x5c, 0x87, 0xdb, - 0x49, 0x89, 0xeb, 0x9d, 0x33, 0x79, 0xdb, 0xe8, - 0x51, 0x15, 0xb9, 0x8c, 0xc3, 0x73, 0x42, 0xf9, - 0xbf, 0xd1, 0xc3, 0xd5, 0xe4, 0x7d, 0x38, 0x59, - 0xbd, 0x74, 0xf4, 0xa8, 0xea, 0x89, 0x79, 0x8f, - 0xa7, 0xb4, 0xf3, 0x8d, 0xac, 0xf3, 0xc7, 0x99, - 0xfc, 0xe2, 0xe8, 0xd1, 0xc4, 0xb7, 0x12, 0xd7, - 0xcc, 0xb2, 0x9f, 0x1b, 0x3d, 0xd4, 0x4e, 0x90, - 0xdf, 0xf2, 0x31, 0x99, 0x3c, 0x73, 0xf4, 0x68, - 0xae, 0xed, 0x90, 0xb8, 0x5e, 0x26, 0x93, 0xcf, - 0x26, 0x6a, 0x25, 0x25, 0x7f, 0x9b, 0xb8, 0x69, - 0x3e, 0x63, 0x93, 0x02, 0x4b, 0x5b, 0x61, 0xb1, - 0xf0, 0x81, 0xed, 0x27, 0x13, 0xb7, 0x18, 0xcd, - 0xae, 0x26, 0x27, 0x2b, 0x2e, 0x68, 0x8e, 0x1f, - 0x3d, 0x5a, 0x4e, 0xd6, 0x39, 0x4f, 0x26, 0x77, - 0x1c, 0x3d, 0x9a, 0x72, 0xc1, 0xc4, 0xed, 0x47, - 0xb3, 0xda, 0x09, 0xf2, 0x5b, 0x72, 0xa1, 0xf9, - 0xc4, 0xd1, 0xa3, 0x19, 0x67, 0x26, 0xde, 0x90, - 0xe0, 0x42, 0x8a, 0xf9, 0xaa, 0x6c, 0xe3, 0x7c, - 0x89, 0xcb, 0xb7, 0x0f, 0x37, 0xed, 0xde, 0x89, - 0xbe, 0x2a, 0x88, 0x1b, 0x25, 0xae, 0x31, 0x9a, - 0x95, 0xb6, 0xc6, 0xc4, 0x55, 0x0f, 0x68, 0xa7, - 0xab, 0xe2, 0x84, 0x74, 0x83, 0xd1, 0xec, 0xd2, - 0xc8, 0x19, 0xf4, 0xe5, 0x96, 0xff, 0xb7, 0x9d, - 0x6a, 0x67, 0x20, 0xb1, 0xa2, 0x5a, 0xa0, 0xf4, - 0x07, 0x89, 0xab, 0x27, 0x17, 0x78, 0xcf, 0xc4, - 0x2f, 0x65, 0xfe, 0x6a, 0x89, 0x49, 0x15, 0x44, - 0x12, 0xd3, 0x8b, 0x26, 0x8e, 0x4e, 0xbc, 0x26, - 0x0f, 0x3f, 0x9f, 0xf8, 0xed, 0xe6, 0x85, 0x0d, - 0xca, 0x7b, 0x71, 0xbe, 0x9b, 0x57, 0xd2, 0xc4, - 0xeb, 0xbf, 0x32, 0x9a, 0x95, 0xb6, 0xc6, 0xc4, - 0x55, 0x77, 0xcd, 0x49, 0xe7, 0xe2, 0xed, 0xfc, - 0x2a, 0xc8, 0xb5, 0x0e, 0xaa, 0x5e, 0xc8, 0xc9, - 0x96, 0x84, 0x95, 0xfa, 0xd6, 0x12, 0x45, 0xfa, - 0x7f, 0x36, 0x9a, 0xd5, 0x0e, 0x71, 0xab, 0x76, - 0xda, 0xc5, 0x5d, 0x9c, 0x1e, 0x9b, 0xdf, 0xf9, - 0xfb, 0xa3, 0x87, 0xa3, 0xdf, 0x3c, 0xf1, 0x4d, - 0xe6, 0xb3, 0xbf, 0x3d, 0x3b, 0x93, 0x2f, 0x26, - 0xfe, 0x28, 0x71, 0x4c, 0x82, 0xbb, 0x58, 0xed, - 0x8b, 0x2a, 0xaa, 0x1b, 0x26, 0x9a, 0x3b, 0x5a, - 0xcd, 0x71, 0xaf, 0x7c, 0x3e, 0x1b, 0xd7, 0x69, - 0xcb, 0x4c, 0x5c, 0x45, 0x51, 0xec, 0x2f, 0x8f, - 0x66, 0x87, 0xc9, 0x49, 0x88, 0x3b, 0x10, 0xad, - 0xb4, 0x6e, 0x3c, 0x36, 0xf1, 0x8c, 0x04, 0x0d, - 0x99, 0xfe, 0x3b, 0xf1, 0xae, 0xc4, 0x6d, 0x72, - 0x02, 0xfe, 0x4a, 0xa6, 0xda, 0x39, 0xae, 0xd2, - 0x4e, 0xbb, 0xde, 0xdd, 0x4d, 0x58, 0x2b, 0xae, - 0x99, 0xb8, 0xc0, 0x68, 0x76, 0x9f, 0x3a, 0x36, - 0xb1, 0x28, 0x11, 0xbf, 0x5c, 0x82, 0xd6, 0xcd, - 0xd2, 0x96, 0x98, 0xb8, 0x0a, 0xf7, 0x4f, 0x42, - 0xd9, 0xce, 0x0e, 0xc2, 0xc9, 0xea, 0xc7, 0x47, - 0xb3, 0xc3, 0xe4, 0xe4, 0xfb, 0xbd, 0xc4, 0xe3, - 0x33, 0x7b, 0x85, 0xc4, 0x4f, 0x24, 0xee, 0x90, - 0xc7, 0xdc, 0x8b, 0x57, 0x3b, 0x0b, 0x17, 0x67, - 0x25, 0x72, 0xa5, 0xdb, 0x4a, 0xf6, 0x6f, 0xf6, - 0x53, 0x8a, 0xa7, 0xbb, 0x7e, 0x98, 0x38, 0x6d, - 0x34, 0x3b, 0xe5, 0xbe, 0xed, 0x54, 0x5a, 0x99, - 0x89, 0xeb, 0x81, 0xe7, 0x0b, 0x09, 0x4e, 0x2a, - 0x5d, 0xd7, 0x4b, 0x0c, 0xaa, 0x37, 0xcd, 0xc9, - 0xea, 0xc7, 0x32, 0x79, 0xd0, 0xe8, 0xd1, 0xc4, - 0x7f, 0x26, 0x06, 0xd5, 0x99, 0x26, 0x41, 0xfd, - 0x61, 0x82, 0x22, 0xc3, 0xf6, 0x19, 0xed, 0x02, - 0x3f, 0x68, 0xa7, 0xdb, 0x09, 0x5d, 0xbe, 0xb8, - 0x88, 0xeb, 0xfa, 0x87, 0xc4, 0x93, 0x47, 0xb3, - 0x53, 0xee, 0x94, 0xfd, 0x9b, 0xa2, 0x6a, 0x69, - 0x65, 0x26, 0xae, 0x07, 0x1e, 0x72, 0x87, 0x1f, - 0x1a, 0xcd, 0x4e, 0x90, 0xb2, 0xd1, 0xe9, 0x7f, - 0x88, 0x9b, 0x27, 0x28, 0xde, 0xeb, 0xa2, 0x1e, - 0x75, 0x9f, 0x9e, 0x58, 0x49, 0xe4, 0x13, 0x17, - 0x4b, 0x1c, 0x9e, 0xb8, 0x41, 0x82, 0x01, 0x29, - 0x2e, 0x9c, 0xd8, 0x52, 0x6a, 0xcd, 0xfa, 0x89, - 0xf3, 0xb4, 0xb1, 0x70, 0x5b, 0x59, 0x86, 0x38, - 0x77, 0xe2, 0x12, 0x89, 0xc3, 0x12, 0x57, 0x4d, - 0x5c, 0x92, 0xe7, 0xda, 0x45, 0x56, 0x96, 0x6d, - 0x9c, 0x2b, 0x71, 0xf1, 0xc4, 0xb5, 0x12, 0xd7, - 0x4f, 0x5c, 0x25, 0x71, 0xfe, 0xc4, 0x4a, 0xff, - 0x23, 0xeb, 0x25, 0x2e, 0x90, 0xb8, 0x6c, 0xe2, - 0xea, 0x09, 0xb6, 0x77, 0x50, 0x62, 0x37, 0x9f, - 0x0f, 0x6a, 0xb9, 0x51, 0x5a, 0x32, 0xbf, 0x3b, - 0xf1, 0xa5, 0xe6, 0xd1, 0x8f, 0x50, 0x64, 0x5d, - 0xe6, 0x72, 0x0f, 0x48, 0xd9, 0x27, 0x86, 0x1e, - 0x07, 0x2c, 0x4f, 0xeb, 0x6f, 0x8e, 0xc9, 0x83, - 0x13, 0xe7, 0xe5, 0xb9, 0xf6, 0xe5, 0x03, 0xca, - 0xae, 0xfa, 0xa7, 0xed, 0xe7, 0x3a, 0x2d, 0x3b, - 0x75, 0xad, 0x9f, 0xeb, 0xa9, 0x89, 0x53, 0x12, - 0x7c, 0xf6, 0xae, 0xb3, 0x13, 0x97, 0x4d, 0x0e, - 0xf2, 0x3b, 0xa3, 0x87, 0xf3, 0x65, 0xdb, 0x9c, - 0x98, 0xba, 0x03, 0x54, 0x90, 0xa8, 0x92, 0xd8, - 0xfe, 0x7d, 0xa2, 0x2c, 0x2a, 0xae, 0xf5, 0x73, - 0xbd, 0x6b, 0x26, 0x65, 0x3f, 0xd7, 0x2f, 0x66, - 0xb9, 0xdf, 0x6c, 0xe7, 0x7b, 0x71, 0xc0, 0x66, - 0xf2, 0x0b, 0x09, 0xd6, 0xff, 0xe9, 0xc4, 0xa5, - 0x13, 0x5d, 0x34, 0x98, 0xfa, 0x44, 0xe2, 0x9d, - 0x89, 0x57, 0x67, 0x9b, 0xa7, 0xf3, 0x24, 0xb2, - 0x2e, 0x8d, 0xb7, 0x68, 0xc9, 0x5a, 0x7a, 0x52, - 0x96, 0xfb, 0x4c, 0x5e, 0xbf, 0x64, 0xe6, 0x1f, - 0x9d, 0xe0, 0xbb, 0xa3, 0x7b, 0x08, 0xe5, 0xe5, - 0xac, 0x7f, 0xcb, 0xbc, 0x3e, 0x53, 0x8f, 0x98, - 0xe5, 0xaf, 0x98, 0x09, 0x8d, 0x72, 0xee, 0x90, - 0xb8, 0x76, 0xe2, 0x22, 0x89, 0xae, 0x6f, 0x24, - 0xc8, 0x21, 0xfd, 0x69, 0xe2, 0x55, 0xd9, 0xc6, - 0x97, 0x79, 0x72, 0x19, 0xd9, 0x36, 0xdb, 0x63, - 0xd4, 0x23, 0xba, 0x2d, 0xf1, 0x3e, 0xdd, 0xe3, - 0xf5, 0x7b, 0x89, 0x4f, 0x26, 0xde, 0x9b, 0x78, - 0x7e, 0xb6, 0x3b, 0x77, 0x1f, 0xc9, 0xb6, 0x58, - 0x97, 0x6e, 0x57, 0xd4, 0x91, 0xdf, 0x32, 0x41, - 0x37, 0x2c, 0xba, 0x44, 0x8d, 0xf1, 0x7f, 0x52, - 0xff, 0xfd, 0x37, 0x09, 0x1a, 0x1a, 0xbd, 0xad, - 0xe7, 0xff, 0xa5, 0xb4, 0xa2, 0xdb, 0x7d, 0x8b, - 0xdf, 0xa1, 0xfc, 0xbd, 0x3f, 0x96, 0xf8, 0xa7, - 0xd1, 0x6c, 0xd5, 0xad, 0x13, 0xf4, 0x37, 0xed, - 0xa2, 0xcf, 0xf5, 0x87, 0x47, 0xb3, 0x13, 0xdf, - 0xca, 0x67, 0x58, 0x34, 0x30, 0xc5, 0x42, 0xf9, - 0xcc, 0xbc, 0xd7, 0xbf, 0x27, 0x28, 0x6d, 0x19, - 0x63, 0x7f, 0xbd, 0x72, 0xb6, 0xff, 0xf9, 0xbc, - 0xfe, 0xe2, 0xcc, 0x97, 0xdd, 0xc9, 0x3e, 0x9a, - 0xd7, 0x8e, 0x68, 0xe7, 0xe7, 0xca, 0xfa, 0x74, - 0xdf, 0xf9, 0xad, 0xd1, 0xa3, 0x2d, 0xe1, 0x3d, - 0x9f, 0xc7, 0x4c, 0xb6, 0xc9, 0x85, 0x6a, 0xf7, - 0xf3, 0xe2, 0x65, 0x79, 0x7d, 0xee, 0x20, 0x17, - 0x59, 0x8f, 0x3a, 0xf0, 0x13, 0x47, 0x8f, 0xa6, - 0x3c, 0x22, 0xeb, 0x7e, 0xb5, 0x9d, 0x67, 0x39, - 0x5a, 0x78, 0xbf, 0x68, 0xf4, 0x68, 0xca, 0x09, - 0x59, 0xee, 0xcc, 0xbc, 0xce, 0x39, 0xf4, 0x37, - 0x12, 0x77, 0x49, 0x50, 0x0f, 0xcd, 0xfe, 0x71, - 0x46, 0x5e, 0xa3, 0x77, 0xc0, 0x8c, 0x2c, 0x7f, - 0xdd, 0x4c, 0xb8, 0x40, 0xa7, 0xbe, 0x9a, 0x7d, - 0x6b, 0xdc, 0x28, 0xec, 0xbb, 0x09, 0x7e, 0xdb, - 0xbf, 0x4c, 0xbc, 0x32, 0xeb, 0x7f, 0x9c, 0x27, - 0x0f, 0x04, 0x26, 0xae, 0xc3, 0xed, 0x86, 0xc4, - 0xf5, 0xe7, 0x13, 0x0c, 0xd4, 0x50, 0x16, 0x93, - 0x1d, 0x93, 0x9d, 0xff, 0xb5, 0xed, 0x7c, 0xaf, - 0x6c, 0x97, 0x93, 0x15, 0x2d, 0x42, 0xcf, 0xdf, - 0x3c, 0x31, 0x42, 0x0e, 0x80, 0x04, 0xe6, 0x7f, - 0x12, 0xcb, 0x24, 0xae, 0x4f, 0xc8, 0xe4, 0xa9, - 0xa3, 0x47, 0x13, 0x9f, 0xc8, 0x72, 0x57, 0x6f, - 0xe7, 0x67, 0x64, 0x1d, 0x7e, 0x5f, 0x4e, 0xe6, - 0xbf, 0x97, 0xb8, 0x32, 0xcf, 0x2d, 0x81, 0xc4, - 0xed, 0x52, 0xd9, 0x6e, 0x73, 0xd1, 0x90, 0x6d, - 0x90, 0x60, 0x72, 0xa2, 0x2d, 0xdd, 0x24, 0x41, - 0xa2, 0x4c, 0x6b, 0xe5, 0x72, 0xff, 0xa1, 0xc1, - 0xd5, 0x21, 0xd9, 0xc6, 0xa4, 0xc8, 0x3b, 0xdb, - 0x61, 0x84, 0xa9, 0xa7, 0x25, 0xee, 0x9f, 0x58, - 0xb6, 0x75, 0x29, 0xad, 0x65, 0x7f, 0x27, 0xf1, - 0xcc, 0x6c, 0xab, 0xb7, 0xc1, 0x4f, 0xb6, 0xcd, - 0xf6, 0x58, 0xee, 0x61, 0x89, 0xf2, 0x04, 0x5b, - 0xc3, 0x89, 0xf3, 0xb9, 0xed, 0xfc, 0x8c, 0x6c, - 0x8f, 0x13, 0xe2, 0xf3, 0x13, 0x0c, 0x45, 0xb8, - 0x2c, 0x2e, 0x4e, 0x1e, 0x9a, 0xed, 0x72, 0x52, - 0x9c, 0xc8, 0xb6, 0x5e, 0x91, 0xc9, 0xd0, 0x52, - 0x8e, 0x55, 0x9d, 0x9d, 0xf7, 0xe7, 0x7b, 0xde, - 0x92, 0x7c, 0x66, 0x2e, 0xd8, 0xf8, 0x3e, 0xbb, - 0xde, 0x97, 0xb8, 0x55, 0xb6, 0xcf, 0xeb, 0x5c, - 0x6c, 0xf0, 0xb8, 0x74, 0xed, 0xbc, 0x3e, 0xef, - 0x22, 0xa1, 0x91, 0xf5, 0xb9, 0x58, 0x98, 0xfa, - 0x9e, 0x56, 0xf4, 0xe6, 0xbc, 0x5f, 0x73, 0xc1, - 0x99, 0x6d, 0xb2, 0x7f, 0x94, 0xa5, 0x1e, 0x0f, - 0xcc, 0xeb, 0x2f, 0x6f, 0xe7, 0xab, 0xb2, 0x1e, - 0x17, 0x04, 0x0c, 0x86, 0x51, 0xba, 0x62, 0xd6, - 0x9d, 0xec, 0xf7, 0x59, 0x8e, 0x8b, 0xcc, 0x5a, - 0xe3, 0x41, 0xf6, 0x11, 0xaa, 0x8d, 0xde, 0x9e, - 0x28, 0x47, 0xb1, 0xfa, 0x4e, 0xb6, 0x31, 0x75, - 0x6c, 0x67, 0x3b, 0x9c, 0x43, 0xd8, 0xf7, 0xee, - 0x99, 0x58, 0x94, 0x9e, 0xb0, 0x5d, 0xce, 0x99, - 0x0f, 0xcf, 0x76, 0x38, 0x2e, 0x77, 0x35, 0x8b, - 0x85, 0x0f, 0x40, 0xd9, 0xb1, 0xbf, 0x9d, 0x49, - 0x99, 0x73, 0xc5, 0xb2, 0x0d, 0x9b, 0x28, 0x62, - 0xeb, 0x26, 0xac, 0x78, 0x59, 0x3b, 0xdd, 0x88, - 0x7c, 0x2e, 0x12, 0x19, 0xba, 0x70, 0x90, 0xab, - 0x5a, 0x36, 0x61, 0xc5, 0xb2, 0x17, 0x90, 0x24, - 0xa8, 0x9c, 0x50, 0x16, 0x5e, 0x98, 0xe5, 0xb3, - 0x90, 0x53, 0xf9, 0x48, 0x82, 0x5c, 0xd5, 0x90, - 0x6e, 0x1b, 0xe4, 0x16, 0xb8, 0xa0, 0x78, 0x7b, - 0xb6, 0x71, 0xe1, 0xe6, 0x99, 0x42, 0x9e, 0x27, - 0x37, 0xf9, 0xc6, 0xc4, 0x23, 0x13, 0xcb, 0x24, - 0xac, 0xbd, 0xf8, 0x2d, 0x13, 0xe4, 0x34, 0x19, - 0x7a, 0x72, 0x48, 0xc2, 0x8a, 0xa6, 0x5f, 0x6a, - 0xd6, 0x7f, 0x18, 0xdb, 0xd9, 0xa9, 0xf2, 0xd9, - 0x39, 0xc7, 0xd5, 0x2e, 0x80, 0x5f, 0x9f, 0xe3, - 0xa0, 0x9d, 0xdd, 0xf3, 0xd7, 0x09, 0xfa, 0xda, - 0x96, 0xf6, 0x75, 0xc3, 0xa6, 0xb2, 0x78, 0x7a, - 0x7f, 0xa0, 0xe4, 0xa6, 0x96, 0xb0, 0xce, 0xc8, - 0x77, 0xcb, 0x3e, 0x42, 0x42, 0x7e, 0xaf, 0xc4, - 0x32, 0xc7, 0x19, 0xbf, 0x05, 0xdf, 0xe9, 0xfb, - 0xb2, 0xee, 0x56, 0xba, 0xff, 0xed, 0x08, 0x26, - 0xae, 0x07, 0x2e, 0x86, 0x2b, 0x2c, 0x1b, 0x36, - 0x8d, 0x8b, 0x0b, 0x7b, 0xe5, 0xa0, 0xe0, 0xe4, - 0x5f, 0x0e, 0x3c, 0x41, 0x43, 0x26, 0x0e, 0xc8, - 0x8d, 0x68, 0x4f, 0xee, 0x0c, 0xaf, 0x47, 0x82, - 0xb3, 0xa9, 0x7d, 0x96, 0x62, 0xbd, 0xb2, 0x78, - 0x79, 0x46, 0x3e, 0xcb, 0x95, 0x32, 0xf9, 0x8b, - 0xc4, 0xa1, 0xcd, 0x13, 0xab, 0x61, 0x14, 0xaa, - 0xd7, 0x65, 0x5b, 0xb5, 0xc4, 0xf3, 0x11, 0x89, - 0xbb, 0x8d, 0x66, 0x67, 0xf0, 0x45, 0x94, 0xbf, - 0xd9, 0x3c, 0xe4, 0xaa, 0x29, 0xf2, 0x3c, 0x5f, - 0xf3, 0x68, 0x38, 0x72, 0x4e, 0xcf, 0x49, 0xec, - 0xe4, 0xd6, 0xb3, 0xe4, 0xda, 0xcb, 0xb6, 0x01, - 0x14, 0xa9, 0xbf, 0x65, 0x34, 0xdb, 0x5c, 0x6c, - 0x52, 0x62, 0xc1, 0x45, 0x5b, 0xe9, 0x9e, 0xf9, - 0x8d, 0x86, 0x5c, 0x3c, 0x6d, 0x05, 0x25, 0x49, - 0x7d, 0x23, 0x5d, 0xed, 0x4b, 0xb4, 0xe0, 0x5f, - 0x26, 0x61, 0xa5, 0xa8, 0x98, 0x52, 0xb0, 0x5a, - 0x57, 0x2c, 0xf0, 0x1d, 0x13, 0x35, 0x34, 0xa0, - 0x3c, 0x25, 0xdb, 0xd8, 0xd5, 0xe9, 0x8f, 0x89, - 0xeb, 0x01, 0x2a, 0x27, 0x94, 0x33, 0x32, 0x29, - 0xeb, 0x6f, 0x38, 0xd9, 0xd3, 0xbd, 0x66, 0x9e, - 0x23, 0x13, 0xe5, 0x01, 0xf5, 0xda, 0x6c, 0x6f, - 0xa9, 0xba, 0xda, 0x15, 0xdd, 0x3d, 0xf1, 0xa8, - 0xd1, 0xec, 0x0c, 0xea, 0x74, 0xc8, 0xe9, 0x3d, - 0x24, 0x41, 0x71, 0xf7, 0xd1, 0x89, 0x13, 0x12, - 0xd4, 0xfd, 0x0e, 0x41, 0xb1, 0xf0, 0x18, 0x27, - 0x5b, 0x8a, 0xe2, 0x19, 0x83, 0x76, 0xd2, 0x40, - 0x2b, 0x27, 0x03, 0x12, 0x9b, 0xd7, 0x27, 0x6a, - 0x89, 0x30, 0x89, 0x1e, 0x27, 0x1b, 0xc6, 0xd9, - 0xa5, 0x0e, 0x96, 0xa2, 0x53, 0x72, 0xda, 0xb5, - 0x1c, 0x11, 0xee, 0x94, 0xf8, 0xb5, 0xd1, 0xec, - 0x48, 0xb6, 0x4f, 0x69, 0x00, 0xf5, 0xbd, 0x25, - 0xba, 0xb6, 0x90, 0x50, 0x92, 0x53, 0x20, 0x71, - 0xbf, 0x69, 0x82, 0x7e, 0xc2, 0xbd, 0xf5, 0x57, - 0xd9, 0x16, 0xf5, 0xb5, 0x2f, 0x48, 0xd4, 0x8e, - 0x71, 0x8a, 0xe4, 0x28, 0x5e, 0x24, 0xe7, 0xcd, - 0x08, 0x4b, 0x0f, 0x4d, 0xf0, 0x7f, 0xf1, 0x5d, - 0x96, 0x58, 0xff, 0x05, 0xd9, 0xde, 0xf8, 0x37, - 0xa7, 0x41, 0x1c, 0xf5, 0xbc, 0xe3, 0xa8, 0xb5, - 0x0e, 0x67, 0xa8, 0xc3, 0xee, 0x32, 0x65, 0x7c, - 0x2d, 0x51, 0xe2, 0x7f, 0x2c, 0x97, 0xfb, 0x60, - 0x62, 0xab, 0x6a, 0x17, 0x06, 0xa7, 0x66, 0x7f, - 0x2d, 0x8b, 0x44, 0x69, 0x43, 0x50, 0xa2, 0xfa, - 0x83, 0xfd, 0x7d, 0x11, 0xaa, 0xa2, 0x28, 0x2e, - 0x5f, 0x26, 0x6a, 0xfb, 0x03, 0xfb, 0xdb, 0xb1, - 0x95, 0xcf, 0xb4, 0x3f, 0xb0, 0x6f, 0x8d, 0x75, - 0x8f, 0x03, 0xe6, 0x1b, 0xd9, 0x17, 0x38, 0x4f, - 0x30, 0xb2, 0x16, 0xdd, 0xe8, 0xba, 0xb8, 0xf8, - 0x63, 0x3f, 0xa2, 0x94, 0x84, 0xe2, 0x7c, 0x8a, - 0x8c, 0x6f, 0x96, 0xa8, 0x8d, 0x6f, 0x4e, 0x15, - 0x12, 0x45, 0xc9, 0xbb, 0xd6, 0xb2, 0x45, 0x66, - 0x3b, 0x42, 0x5b, 0xe7, 0xfa, 0x2f, 0x09, 0x8a, - 0x36, 0x36, 0xe5, 0xac, 0x83, 0xde, 0x7a, 0x66, - 0x33, 0xca, 0xcb, 0x09, 0xa7, 0xee, 0x39, 0x29, - 0x93, 0x79, 0x77, 0x9d, 0x59, 0x87, 0x23, 0x4e, - 0x3c, 0xb2, 0xa9, 0xdf, 0x1c, 0x2c, 0x07, 0x41, - 0xb5, 0xce, 0x35, 0x07, 0x71, 0x33, 0x7e, 0x6f, - 0x5e, 0xa7, 0x45, 0x24, 0x09, 0x53, 0x17, 0xf5, - 0x32, 0x87, 0x65, 0x99, 0xea, 0x55, 0x67, 0xd6, - 0x21, 0x87, 0x4a, 0xc2, 0x30, 0x46, 0xa2, 0xc2, - 0x60, 0xfb, 0x67, 0xe4, 0x35, 0x4e, 0xc4, 0x6b, - 0xad, 0x73, 0xcd, 0x72, 0x14, 0x9f, 0x72, 0x21, - 0x50, 0x36, 0x80, 0x01, 0xf5, 0xbc, 0xe4, 0xa2, - 0x3f, 0x9f, 0xf5, 0x9a, 0x27, 0xc6, 0xb2, 0x1e, - 0x93, 0xdb, 0x24, 0x78, 0x5f, 0x06, 0xa7, 0x58, - 0x54, 0xe7, 0x0a, 0x56, 0x22, 0xa7, 0x47, 0xe2, - 0x3c, 0x6e, 0x78, 0xc4, 0x49, 0x82, 0xdf, 0x98, - 0x62, 0x6f, 0x2e, 0x3c, 0x6a, 0x37, 0x28, 0x20, - 0xe7, 0x4e, 0xa2, 0xfe, 0xc1, 0xca, 0xe7, 0x20, - 0xc1, 0xa4, 0xbe, 0x8f, 0xbb, 0x06, 0x95, 0x68, - 0x44, 0x76, 0x68, 0xd6, 0x61, 0xca, 0xb2, 0x9c, - 0x94, 0xca, 0x46, 0x3d, 0xb8, 0x59, 0x96, 0xa1, - 0xa1, 0xd1, 0x94, 0xf6, 0x7f, 0xa4, 0xb1, 0xd3, - 0xb9, 0xf3, 0xfa, 0xa4, 0xe4, 0x20, 0xcf, 0xf3, - 0x21, 0xf8, 0x6e, 0xf8, 0xff, 0x4b, 0xd4, 0x29, - 0xdf, 0x37, 0xcb, 0x4f, 0x9d, 0xc8, 0xdb, 0x6d, - 0x91, 0x80, 0x92, 0x83, 0xab, 0x75, 0xcb, 0xe2, - 0xa4, 0x79, 0xaf, 0xca, 0xff, 0x47, 0xd7, 0xae, - 0xa6, 0x0d, 0x42, 0xc7, 0x13, 0xb2, 0xdc, 0xd3, - 0xdb, 0xf9, 0x19, 0x59, 0x87, 0x61, 0x10, 0xcb, - 0x31, 0xa4, 0x69, 0xac, 0x53, 0x76, 0xed, 0xda, - 0x92, 0xbc, 0x0f, 0x7d, 0x70, 0xc9, 0x11, 0x96, - 0x45, 0x90, 0xfc, 0x1f, 0xfc, 0x3f, 0x13, 0xed, - 0x77, 0xc6, 0x7e, 0x76, 0xd5, 0xe6, 0x89, 0x1f, - 0x79, 0x4b, 0x96, 0xe5, 0xe2, 0x6e, 0xcb, 0xf2, - 0x1e, 0x24, 0x34, 0x5c, 0x34, 0x74, 0x1b, 0x92, - 0xe1, 0x49, 0x89, 0x13, 0xbb, 0xdf, 0x6d, 0x96, - 0xdd, 0x5f, 0x75, 0xae, 0x60, 0x67, 0x38, 0x39, - 0x41, 0x4e, 0xba, 0x7b, 0x1c, 0xf0, 0xbd, 0x71, - 0xa1, 0xc5, 0x10, 0x91, 0xaf, 0x6a, 0x9e, 0xfd, - 0x11, 0xce, 0x03, 0x34, 0xbe, 0x7b, 0x49, 0xf7, - 0xff, 0x40, 0x96, 0xe7, 0x09, 0x8e, 0x1f, 0x2e, - 0x10, 0xbb, 0xfe, 0x31, 0x71, 0xbd, 0x2c, 0x3f, - 0xa4, 0x34, 0x66, 0xc7, 0xd8, 0x6d, 0x39, 0x57, - 0x76, 0x8a, 0x9f, 0x4a, 0x50, 0xac, 0xb1, 0xa9, - 0xa0, 0x55, 0xdc, 0xd8, 0xaf, 0x27, 0x6a, 0xcb, - 0xac, 0x33, 0x7a, 0x07, 0x3c, 0x5f, 0x03, 0x12, - 0x5e, 0xae, 0xba, 0xbb, 0xb8, 0x1a, 0xad, 0x8e, - 0x50, 0x93, 0x83, 0x84, 0x5c, 0x13, 0x57, 0x9c, - 0x5d, 0xd4, 0xe7, 0xd1, 0xf8, 0x65, 0x53, 0xb8, - 0xe3, 0x4e, 0x2d, 0x61, 0x25, 0x91, 0x38, 0x2a, - 0x07, 0xe6, 0x4c, 0xc2, 0x0a, 0x9e, 0x4b, 0xd0, - 0xc8, 0x84, 0x7b, 0x8a, 0xd6, 0x72, 0x64, 0x35, - 0xe4, 0x34, 0x1f, 0x92, 0xf5, 0xbe, 0xdc, 0xae, - 0x4f, 0x7c, 0x2d, 0x41, 0xab, 0x4a, 0x4e, 0x00, - 0xb4, 0x9e, 0x2c, 0x91, 0x68, 0xdf, 0x31, 0xcb, - 0xcc, 0x24, 0xac, 0xc8, 0x73, 0xbc, 0x37, 0xc5, - 0xd9, 0xb5, 0x3a, 0xee, 0x83, 0x13, 0xdd, 0xab, - 0x77, 0x8a, 0xda, 0x4a, 0xe4, 0x9c, 0xab, 0xdf, - 0x2f, 0xef, 0x97, 0x78, 0x67, 0xa2, 0x2c, 0x92, - 0x67, 0x98, 0xbf, 0xda, 0xb0, 0x84, 0x24, 0xdc, - 0x77, 0xcf, 0xf2, 0x33, 0x27, 0xd5, 0x76, 0x5b, - 0xec, 0x6b, 0x3f, 0x97, 0xa0, 0xd5, 0x70, 0x89, - 0x04, 0x66, 0x61, 0xb1, 0xf9, 0x36, 0xc3, 0x45, - 0x60, 0x99, 0xb0, 0x92, 0x6b, 0x9f, 0x19, 0x62, - 0x33, 0xff, 0x3b, 0xe7, 0x8e, 0xa9, 0x04, 0xb7, - 0x75, 0xc7, 0xec, 0xf7, 0x5b, 0xbe, 0x58, 0x6f, - 0x13, 0x33, 0x72, 0x7b, 0x65, 0xc2, 0x4a, 0xe9, - 0xd1, 0xd3, 0xf8, 0xfe, 0xb7, 0x91, 0xdf, 0x4f, - 0xd4, 0x8e, 0x03, 0x12, 0x56, 0x3e, 0x68, 0xad, - 0x65, 0x34, 0x89, 0xf1, 0x4c, 0xc2, 0x8a, 0x3c, - 0xc7, 0x77, 0x4b, 0x89, 0x4e, 0xd9, 0x88, 0x89, - 0xd2, 0x95, 0xb2, 0xc8, 0x5e, 0xda, 0xfe, 0x72, - 0x20, 0xdc, 0x39, 0x51, 0x62, 0x98, 0xc1, 0x89, - 0x3c, 0x7e, 0xc6, 0xe8, 0xe9, 0x29, 0x6f, 0x6e, - 0x5f, 0x9e, 0x92, 0xe7, 0x9f, 0x3a, 0x7a, 0x79, - 0x0a, 0xc5, 0x8a, 0x8d, 0xcc, 0xd3, 0x1f, 0xf3, - 0x5b, 0xcd, 0xb3, 0xd3, 0x66, 0x06, 0x65, 0xcf, - 0x73, 0x4f, 0x18, 0xbd, 0x34, 0x85, 0x9c, 0xc3, - 0x44, 0x1e, 0xd3, 0x67, 0xee, 0x63, 0xcd, 0x2b, - 0xd3, 0xbe, 0x92, 0x28, 0x5b, 0x3a, 0x2f, 0x25, - 0xeb, 0x5d, 0xbe, 0xd9, 0xc2, 0xac, 0x2f, 0x24, - 0x7a, 0x87, 0xe4, 0xcb, 0x6b, 0x37, 0x6c, 0x96, - 0x9a, 0xf5, 0xac, 0x76, 0x91, 0xb9, 0xb2, 0xdc, - 0xa5, 0x12, 0xdf, 0x6e, 0xd6, 0x98, 0x46, 0x0e, - 0xb3, 0x91, 0xf9, 0xa3, 0x46, 0x4f, 0xcd, 0x18, - 0x34, 0x98, 0x7c, 0x96, 0x7f, 0xf6, 0x68, 0xb5, - 0x29, 0x3f, 0x48, 0x2c, 0xdb, 0xb5, 0xe4, 0xb8, - 0x66, 0x8d, 0x59, 0x33, 0x37, 0x79, 0xc8, 0x73, - 0x7c, 0x6f, 0x25, 0xea, 0xed, 0x7a, 0xe5, 0x75, - 0x1a, 0x4a, 0x95, 0xe6, 0xdd, 0xb2, 0x70, 0x25, - 0xd9, 0x66, 0xed, 0x7d, 0x5e, 0xd7, 0xbe, 0x3c, - 0x23, 0xaf, 0x5d, 0x23, 0xc1, 0xf7, 0x54, 0xe2, - 0x22, 0x7a, 0x65, 0x59, 0x9f, 0xe3, 0xe2, 0x4d, - 0xcd, 0x96, 0xa6, 0xb1, 0x1f, 0xd3, 0xc5, 0x6a, - 0x46, 0x9e, 0xff, 0x7e, 0xb3, 0xc4, 0xb4, 0x85, - 0x37, 0xd9, 0xc8, 0x32, 0x47, 0x8c, 0x16, 0x9d, - 0x31, 0x55, 0x84, 0x9b, 0xc7, 0xf4, 0x9b, 0xae, - 0x59, 0x74, 0x1c, 0xd4, 0xb6, 0xff, 0xdd, 0x44, - 0xed, 0x02, 0x78, 0x4a, 0x96, 0x79, 0x5b, 0xb3, - 0xf4, 0xb4, 0xa9, 0xaa, 0x91, 0xdd, 0x64, 0x5b, - 0x5d, 0x2e, 0x6d, 0xd9, 0x29, 0x67, 0xf3, 0xff, - 0xd0, 0xf0, 0xe5, 0xa0, 0xe6, 0xf1, 0x66, 0x7c, - 0x7d, 0xcf, 0x31, 0x07, 0x37, 0x7d, 0x31, 0x93, - 0x4c, 0x51, 0xaf, 0xd6, 0xad, 0xab, 0xdb, 0x84, - 0x27, 0xee, 0xbd, 0xfd, 0x9e, 0xff, 0x6a, 0xe7, - 0x07, 0xc9, 0x8e, 0x3b, 0xb7, 0x58, 0x18, 0x59, - 0x86, 0x06, 0x4c, 0xd4, 0xa3, 0x75, 0x8b, 0xa0, - 0xc8, 0x6d, 0xd1, 0x07, 0x90, 0xe2, 0xce, 0x46, - 0x96, 0xa3, 0x61, 0xc7, 0xbf, 0x25, 0xba, 0xb9, - 0x17, 0xea, 0xce, 0xe8, 0x1b, 0xdb, 0xe4, 0x0c, - 0xb3, 0xcc, 0x5a, 0x8b, 0x85, 0xb3, 0x0c, 0x39, - 0x65, 0x8a, 0xc4, 0xcb, 0x12, 0x96, 0xa7, 0x67, - 0x39, 0xd6, 0x1f, 0x2c, 0xdb, 0xec, 0x2b, 0x16, - 0x7e, 0x6e, 0xb6, 0x49, 0x63, 0xa2, 0xaa, 0xac, - 0x47, 0x1d, 0xe7, 0xef, 0x8e, 0x1e, 0x4d, 0x70, - 0x45, 0x7e, 0xad, 0xac, 0x47, 0x55, 0xc4, 0x42, - 0xd9, 0x06, 0xbf, 0x05, 0xbf, 0x49, 0x17, 0x45, - 0xc2, 0x74, 0x15, 0xfa, 0x5e, 0x5e, 0xe7, 0xe6, - 0xf6, 0x5c, 0x60, 0x94, 0xff, 0x2f, 0xb9, 0x63, - 0xbe, 0xbf, 0xe7, 0x65, 0x39, 0xee, 0x79, 0x3b, - 0x57, 0xb6, 0xf3, 0x77, 0x99, 0x5c, 0x7f, 0xf4, - 0x68, 0x82, 0xbe, 0xa7, 0xd7, 0xcf, 0xfa, 0x7c, - 0xe6, 0xb9, 0xb2, 0x3e, 0x63, 0x46, 0xd3, 0x72, - 0xb5, 0xcc, 0x65, 0xbd, 0x3c, 0xeb, 0x53, 0x92, - 0x30, 0x91, 0x65, 0xb7, 0x65, 0xb1, 0x70, 0xde, - 0x83, 0xc4, 0x84, 0xfe, 0x95, 0xe5, 0xff, 0x70, - 0xe7, 0xbc, 0x0f, 0x7d, 0x8e, 0x67, 0x64, 0x1d, - 0xce, 0x1f, 0x7c, 0x77, 0x34, 0xb8, 0xe9, 0xe2, - 0xb9, 0x1b, 0x2d, 0xf3, 0xdd, 0xd5, 0x64, 0xbb, - 0xb4, 0x07, 0xe0, 0x66, 0xf2, 0x5d, 0x94, 0x84, - 0x70, 0x7f, 0xdb, 0x49, 0xc3, 0xaa, 0xae, 0xac, - 0xb3, 0xbf, 0x8a, 0x85, 0xe9, 0x33, 0x4d, 0x17, - 0xb0, 0xaa, 0xac, 0x57, 0x3b, 0x6e, 0xb9, 0x40, - 0x3c, 0x32, 0xeb, 0x8d, 0x1e, 0xf5, 0xc8, 0xba, - 0x5c, 0x88, 0x96, 0xa5, 0x3f, 0x27, 0x65, 0x3d, - 0xea, 0xfc, 0x77, 0x9d, 0xdd, 0x98, 0xb8, 0x6e, - 0xbc, 0x9f, 0x6b, 0x12, 0xd7, 0xe6, 0x64, 0x92, - 0xc4, 0x75, 0x9f, 0xf4, 0x73, 0x4d, 0x52, 0xb8, - 0xd6, 0x7e, 0xae, 0xd9, 0x99, 0xa7, 0x4e, 0x6c, - 0x59, 0xee, 0x1d, 0x99, 0x94, 0xf7, 0x57, 0x7d, - 0x4c, 0x96, 0x9b, 0xe4, 0xca, 0xb2, 0x4c, 0xad, - 0x7e, 0x96, 0x93, 0xfd, 0xa4, 0x2e, 0x31, 0xcb, - 0xac, 0x3b, 0x71, 0xa5, 0x4f, 0x6b, 0x2d, 0x17, - 0x7d, 0xe3, 0x2c, 0x47, 0x57, 0x98, 0xc1, 0xb2, - 0xcd, 0xbe, 0xc4, 0x75, 0x6e, 0x1f, 0xdf, 0xac, - 0x47, 0x91, 0x1e, 0x0d, 0x95, 0xba, 0xb8, 0xe8, - 0xb9, 0x4c, 0xd6, 0x5b, 0xaa, 0xce, 0x28, 0xdb, - 0x20, 0x47, 0x47, 0xdf, 0xd8, 0x2e, 0x4e, 0xd8, - 0x57, 0xc8, 0x36, 0xc8, 0x31, 0xb0, 0xff, 0x72, - 0x62, 0xac, 0x76, 0xd4, 0x0f, 0x4e, 0x86, 0xe4, - 0xf0, 0x48, 0x88, 0xaa, 0xd5, 0x05, 0xd9, 0x06, - 0x17, 0x41, 0x5f, 0x4f, 0x94, 0xb9, 0x8f, 0xa9, - 0xdf, 0x6a, 0x91, 0x6c, 0x87, 0xfa, 0x30, 0x8a, - 0xed, 0xba, 0x3e, 0x90, 0x6d, 0x4c, 0xdd, 0xff, - 0x37, 0xcb, 0x6d, 0xd7, 0xc4, 0xf5, 0x71, 0x99, - 0x70, 0x63, 0x88, 0x2e, 0xea, 0x0f, 0xf9, 0xae, - 0x7b, 0xab, 0x09, 0xb2, 0x1e, 0x0d, 0xca, 0xe8, - 0x47, 0xdd, 0xc5, 0xef, 0x7b, 0x83, 0xac, 0xc7, - 0x05, 0xca, 0x20, 0xd9, 0x1e, 0xd5, 0x48, 0xd4, - 0x97, 0x97, 0xbf, 0x07, 0x55, 0x0d, 0x14, 0xbd, - 0x8e, 0x1e, 0x15, 0xb2, 0xde, 0xfe, 0x4a, 0x5c, - 0x17, 0x1d, 0x07, 0xdc, 0xec, 0xbe, 0xac, 0x83, - 0xa6, 0xc1, 0xd3, 0x3f, 0x8f, 0x66, 0xe7, 0xe2, - 0xd8, 0x2e, 0x7b, 0x23, 0xac, 0xad, 0x4e, 0x7b, - 0xbb, 0xd9, 0x6d, 0x75, 0xae, 0x5a, 0xcd, 0x4b, - 0xda, 0x69, 0xd7, 0xfd, 0x72, 0x20, 0x35, 0x47, - 0x7e, 0x3b, 0x2d, 0x47, 0xca, 0xe1, 0x84, 0xb3, - 0xd1, 0xbe, 0xad, 0x51, 0x6b, 0xe6, 0x4f, 0x43, - 0xab, 0x95, 0x2e, 0x36, 0x16, 0x20, 0x91, 0x98, - 0xa7, 0x56, 0x1f, 0xfa, 0xd9, 0x9c, 0x18, 0x96, - 0x4a, 0x58, 0x5b, 0xb5, 0x44, 0x9d, 0xef, 0xb6, - 0xa9, 0x17, 0xcc, 0xb6, 0x48, 0x68, 0xb9, 0xb2, - 0xef, 0x1b, 0x9f, 0x99, 0xa2, 0x70, 0xea, 0xbb, - 0x68, 0x3c, 0xf6, 0x9a, 0x44, 0xad, 0xbf, 0x2f, - 0xdb, 0xaa, 0x75, 0xbd, 0x19, 0x5a, 0x77, 0x4f, - 0x43, 0xa0, 0xd2, 0x8e, 0x18, 0x6f, 0xb7, 0xdd, - 0x5f, 0x6b, 0xad, 0xde, 0xb9, 0xe8, 0x38, 0x21, - 0xaf, 0x53, 0x15, 0x52, 0x8d, 0xbc, 0x5e, 0xab, - 0x03, 0xe4, 0x3c, 0x39, 0xf8, 0x3e, 0xaf, 0xd9, - 0x1e, 0xfd, 0x9a, 0x29, 0x86, 0x2e, 0x13, 0x56, - 0x5a, 0x79, 0x3f, 0x3a, 0xbf, 0xf7, 0xe8, 0xd1, - 0xf6, 0x52, 0xab, 0x6f, 0xef, 0xe2, 0xe2, 0xb4, - 0xc4, 0x7e, 0x48, 0xfd, 0xf6, 0xa2, 0xa8, 0x75, - 0xf3, 0x2b, 0x2f, 0xc4, 0x77, 0x0d, 0x13, 0x57, - 0x81, 0x06, 0x1e, 0x65, 0x17, 0x01, 0x06, 0x4a, - 0x18, 0x37, 0xcb, 0x3f, 0x3c, 0x31, 0x95, 0x63, - 0x09, 0xae, 0x8e, 0x27, 0xc3, 0x0a, 0x6e, 0x08, - 0x0d, 0x7e, 0x4a, 0x24, 0xae, 0xe4, 0x8e, 0xd7, - 0x6d, 0x51, 0xa3, 0xa7, 0xda, 0xa0, 0x0f, 0x43, - 0x3f, 0x47, 0x73, 0x3f, 0xd3, 0x8a, 0x49, 0x62, - 0x98, 0x13, 0x2e, 0x0d, 0xc4, 0x68, 0x9d, 0xcc, - 0xa8, 0x50, 0x7d, 0x28, 0xea, 0x24, 0x17, 0xfd, - 0xf1, 0x9c, 0xc0, 0xef, 0x93, 0x68, 0x9e, 0x6c, - 0xd1, 0x42, 0xb6, 0x76, 0x5c, 0x0f, 0x1d, 0x11, - 0xa7, 0x56, 0xfc, 0x5c, 0x16, 0xb1, 0x6e, 0x57, - 0xec, 0xb7, 0xb5, 0x91, 0xbe, 0x28, 0x76, 0x27, - 0x47, 0x3b, 0x2f, 0xfa, 0xfa, 0xf4, 0x0e, 0xea, - 0xf3, 0x9a, 0x65, 0x49, 0x39, 0x19, 0xca, 0x90, - 0x63, 0xa7, 0x8b, 0x01, 0x5c, 0xc8, 0x1d, 0x32, - 0xdd, 0x8e, 0x16, 0x7d, 0xae, 0xea, 0xe0, 0x27, - 0x9a, 0x65, 0xe2, 0x2a, 0x4e, 0xe8, 0x14, 0x41, - 0xd1, 0x07, 0xaf, 0x34, 0x6e, 0x3a, 0x7f, 0x5c, - 0xa2, 0x1c, 0xf0, 0xe0, 0xa5, 0xfb, 0xe0, 0xca, - 0xbb, 0x76, 0x32, 0x67, 0x9f, 0xdd, 0x1f, 0x27, - 0xf9, 0x5a, 0x0e, 0xb5, 0x2c, 0xb6, 0x5b, 0xa4, - 0xef, 0xe4, 0x3c, 0xd5, 0x47, 0x38, 0xdf, 0xeb, - 0x9f, 0x64, 0x42, 0xbd, 0x1f, 0x45, 0xe2, 0xf3, - 0x72, 0xc6, 0x9c, 0xe8, 0x18, 0x83, 0x76, 0xd2, - 0xa8, 0x2c, 0xfa, 0xea, 0x05, 0x87, 0x0e, 0x24, - 0x51, 0x8e, 0xc0, 0x85, 0x41, 0x77, 0x3c, 0xda, - 0x8f, 0x16, 0xf5, 0xd5, 0x5e, 0x05, 0x2d, 0xf7, - 0xcb, 0xaa, 0x93, 0x79, 0xf8, 0x4d, 0x6a, 0x09, - 0xf5, 0xa3, 0xf2, 0xfb, 0x2e, 0x1c, 0x52, 0x71, - 0x1b, 0x1b, 0x52, 0x52, 0x73, 0x40, 0x33, 0x71, - 0xd5, 0x18, 0x75, 0x39, 0x93, 0x8e, 0xe2, 0xad, - 0xa3, 0x73, 0x05, 0x4e, 0x2b, 0xc0, 0xb2, 0xae, - 0x91, 0x46, 0x38, 0xd5, 0x16, 0xc5, 0x6b, 0x56, - 0xcb, 0x6d, 0x71, 0xd2, 0xdf, 0x1f, 0xc5, 0x93, - 0x14, 0x29, 0x96, 0x86, 0x76, 0x4d, 0xe9, 0x1b, - 0x7c, 0xa2, 0xd6, 0x35, 0x86, 0x22, 0x67, 0xc6, - 0x99, 0xa5, 0xce, 0x8e, 0x6e, 0x0e, 0x7d, 0xb9, - 0x5e, 0x8e, 0xe1, 0xe7, 0xe5, 0x77, 0x1a, 0x8f, - 0xc1, 0x4b, 0x6e, 0xba, 0x76, 0x67, 0xa2, 0xa1, - 0xed, 0x10, 0x48, 0x4c, 0x4a, 0x2b, 0x35, 0xac, - 0xdb, 0x97, 0xf2, 0x3d, 0x90, 0x73, 0xa7, 0xcf, - 0xf1, 0x26, 0x1c, 0x9b, 0xed, 0xb7, 0xb3, 0xfd, - 0xb2, 0x0c, 0x7d, 0x65, 0x19, 0xc0, 0xa3, 0xbc, - 0xfa, 0xa4, 0xbe, 0xb2, 0x56, 0x05, 0xb3, 0x4e, - 0x9b, 0x3e, 0xa7, 0xd7, 0x8e, 0x49, 0x72, 0xe8, - 0xb4, 0x13, 0x58, 0x25, 0x7a, 0x1b, 0x4f, 0xed, - 0x74, 0x26, 0xae, 0x6a, 0xe4, 0x44, 0x4e, 0xb1, - 0x70, 0xd9, 0xff, 0x8f, 0x56, 0xd7, 0xd4, 0x19, - 0x35, 0x75, 0x82, 0x1d, 0x6f, 0xc8, 0xf2, 0x43, - 0x8b, 0x19, 0x57, 0x41, 0x43, 0x89, 0x12, 0xfb, - 0x2c, 0x77, 0xc2, 0xd9, 0xd7, 0x6a, 0x75, 0x96, - 0x57, 0xce, 0x89, 0xb4, 0x56, 0x74, 0xdd, 0xe7, - 0x3a, 0xed, 0xb4, 0x8b, 0x3b, 0x95, 0xf4, 0xde, - 0x29, 0x27, 0xdf, 0xf3, 0xe9, 0x09, 0xea, 0xbb, - 0xa9, 0x7f, 0xa6, 0xff, 0x21, 0xa5, 0x0c, 0x25, - 0x12, 0x56, 0x46, 0xa7, 0x02, 0x09, 0x75, 0xad, - 0xb8, 0xba, 0x6c, 0x3d, 0xdc, 0x2b, 0xff, 0x13, - 0x25, 0x03, 0x54, 0x0b, 0x94, 0xa6, 0xba, 0x4a, - 0x6d, 0x53, 0xdc, 0x6d, 0x69, 0xc8, 0x6f, 0x32, - 0x04, 0x7d, 0x80, 0xe7, 0xf6, 0x79, 0xcd, 0x77, - 0xc7, 0xc5, 0x1f, 0xc7, 0x4c, 0x79, 0x77, 0x24, - 0xf6, 0xe5, 0xe3, 0xf3, 0x5b, 0x2e, 0x4e, 0x9d, - 0xfb, 0x2d, 0x53, 0x24, 0xbb, 0xc9, 0x01, 0x74, - 0x50, 0xab, 0x8b, 0xbf, 0x50, 0xfe, 0xaf, 0xd3, - 0x56, 0x8c, 0x4d, 0xb4, 0x9f, 0xd8, 0x16, 0x4c, - 0x5c, 0xd5, 0x45, 0x0e, 0xa9, 0xc4, 0x78, 0xc3, - 0x5d, 0x9c, 0x1c, 0xe6, 0xb6, 0x58, 0x5c, 0x23, - 0x5a, 0x04, 0xd7, 0x8a, 0xa1, 0x1e, 0xb0, 0x4c, - 0x0e, 0x62, 0xcd, 0x3e, 0xda, 0x4e, 0xbb, 0x28, - 0x6a, 0x2d, 0xbb, 0xd6, 0x54, 0xe5, 0xf3, 0xb2, - 0x6c, 0x39, 0x00, 0x07, 0x3e, 0x94, 0x13, 0x4c, - 0x59, 0x62, 0x30, 0x23, 0xcb, 0xd0, 0xa1, 0x9f, - 0xc6, 0x4e, 0x0c, 0x3a, 0x51, 0xfb, 0x4e, 0x9a, - 0xee, 0x23, 0x59, 0x86, 0xd7, 0xe8, 0x3a, 0x52, - 0xba, 0x55, 0x3e, 0x43, 0x79, 0x91, 0xd4, 0x87, - 0xbb, 0xbc, 0xd4, 0x4e, 0xe4, 0xd4, 0x07, 0x6f, - 0xca, 0x96, 0x6e, 0x52, 0x80, 0x76, 0x9f, 0xa8, - 0x15, 0xc5, 0x92, 0xeb, 0xa7, 0x45, 0x33, 0xff, - 0xff, 0xb2, 0x41, 0xfd, 0x6b, 0x89, 0xdf, 0xb0, - 0x77, 0xc8, 0xbe, 0xf6, 0xfd, 0x19, 0x8d, 0xab, - 0x1c, 0xe1, 0x8a, 0x76, 0x02, 0x0c, 0x6f, 0x58, - 0x1b, 0xf6, 0xb1, 0x4f, 0xed, 0x02, 0xa9, 0x1c, - 0x3d, 0xaa, 0x66, 0xe8, 0x0d, 0x1a, 0x86, 0xaa, - 0xb5, 0x98, 0xbe, 0x5d, 0xfe, 0xf7, 0x9d, 0x52, - 0x1f, 0xbf, 0xcf, 0x98, 0xb8, 0xaa, 0x8b, 0xfe, - 0x6a, 0x8b, 0x5a, 0x95, 0x9e, 0x96, 0x18, 0x3a, - 0x6e, 0xef, 0xaa, 0xe8, 0xe3, 0x5a, 0xab, 0x9f, - 0x62, 0x58, 0xbf, 0x7b, 0xb7, 0x27, 0xb3, 0xb9, - 0xb2, 0x0c, 0x03, 0x51, 0xb4, 0x8f, 0xb6, 0x84, - 0x71, 0x83, 0x6b, 0xb9, 0x46, 0x06, 0xc3, 0xa0, - 0x28, 0xb2, 0x57, 0xfb, 0xfe, 0x74, 0x33, 0xa9, - 0x15, 0x0b, 0x4f, 0x8a, 0xd7, 0xb3, 0x1c, 0x83, - 0x0d, 0xb4, 0x8f, 0x7a, 0xb1, 0x7c, 0xad, 0xdb, - 0x43, 0xb7, 0x6f, 0x77, 0xad, 0x1f, 0x27, 0x89, - 0xe5, 0xe3, 0x16, 0x6d, 0x3f, 0xaf, 0x93, 0xc8, - 0xd5, 0x46, 0xe0, 0xa1, 0x81, 0x13, 0x5d, 0x68, - 0xd6, 0xa1, 0xf6, 0x21, 0x16, 0x0e, 0x42, 0xb0, - 0x04, 0x06, 0x64, 0x60, 0x44, 0xae, 0xd2, 0x3b, - 0x92, 0xb0, 0x71, 0xaf, 0x60, 0x46, 0x19, 0x5a, - 0x2a, 0xb2, 0x0e, 0xdd, 0xec, 0x6a, 0xc5, 0xeb, - 0x14, 0x0d, 0xf7, 0x35, 0x36, 0xe0, 0xde, 0xa7, - 0xb5, 0x62, 0xce, 0xa7, 0x66, 0x9b, 0x43, 0x2f, - 0x4c, 0x6a, 0xad, 0xd7, 0xef, 0x90, 0xf7, 0xee, - 0x4d, 0xc4, 0xf2, 0x1a, 0xfb, 0xe1, 0xe0, 0x56, - 0xcd, 0x03, 0x71, 0xd3, 0x8a, 0x12, 0x2d, 0x88, - 0xb9, 0x33, 0xce, 0xd2, 0xd8, 0x0f, 0x89, 0xdd, - 0xcc, 0xc4, 0x55, 0x13, 0x39, 0x01, 0x90, 0x83, - 0x5a, 0x94, 0x2b, 0x7d, 0x45, 0x96, 0xdb, 0x27, - 0x47, 0x45, 0xde, 0x87, 0x5c, 0x58, 0xd9, 0xf9, - 0x1e, 0x9c, 0xdc, 0xe8, 0x06, 0x44, 0x4b, 0xd9, - 0xde, 0x56, 0x55, 0x79, 0x8d, 0xa2, 0x4d, 0x12, - 0xa3, 0xde, 0x11, 0x67, 0x96, 0x95, 0xcf, 0x42, - 0xb1, 0x39, 0xfd, 0x81, 0x4b, 0xe4, 0x26, 0xb8, - 0xc3, 0x0d, 0xdd, 0x2e, 0xfa, 0x70, 0x31, 0x50, - 0x0e, 0x40, 0x01, 0x4e, 0xa0, 0xd4, 0xc3, 0x8d, - 0x51, 0xb4, 0xfb, 0xdc, 0x6c, 0x6b, 0x5e, 0xd1, - 0x1e, 0xff, 0x6f, 0xad, 0x21, 0xd5, 0x64, 0xc0, - 0x8f, 0xa0, 0x58, 0xb2, 0x96, 0xf3, 0xe1, 0xe6, - 0x07, 0x0f, 0xee, 0x3b, 0xa9, 0xe5, 0x79, 0x12, - 0x56, 0xfa, 0x78, 0x96, 0xa5, 0x15, 0xe0, 0x46, - 0xef, 0xcd, 0x18, 0xc8, 0x6b, 0x50, 0xdb, 0xce, - 0x4d, 0xf3, 0xfe, 0xe4, 0x18, 0xb7, 0x82, 0xb6, - 0x01, 0xb5, 0xc4, 0xa7, 0x36, 0xac, 0xe1, 0x22, - 0xf4, 0x97, 0x7f, 0xcf, 0x68, 0x76, 0x0a, 0x75, - 0xe0, 0xdd, 0x21, 0x50, 0x1b, 0xf9, 0xec, 0x24, - 0x30, 0xec, 0x93, 0xe5, 0xfe, 0xc8, 0x58, 0xc2, - 0xbd, 0x7d, 0x7e, 0xe7, 0xe0, 0x06, 0xfb, 0x25, - 0xba, 0xbc, 0x54, 0x07, 0x5c, 0xc8, 0xfb, 0x73, - 0x2e, 0xa7, 0xee, 0xb3, 0xd6, 0x65, 0x6c, 0x9d, - 0x28, 0x15, 0xa1, 0x0f, 0x74, 0xe9, 0x39, 0xf9, - 0x0c, 0xdd, 0x41, 0xff, 0x7b, 0x65, 0x39, 0x2e, - 0xa4, 0xc8, 0xe1, 0xef, 0xea, 0xf4, 0xc7, 0xc4, - 0x55, 0x25, 0x5a, 0x9f, 0xf6, 0x75, 0x4b, 0xe1, - 0x84, 0xbd, 0xca, 0x89, 0x6a, 0x2b, 0xf8, 0x3c, - 0xb5, 0x13, 0x0d, 0x75, 0x5b, 0x0c, 0x1e, 0xfe, - 0x9e, 0x1c, 0xac, 0xe4, 0x26, 0x0e, 0x4f, 0x1c, - 0x92, 0xa0, 0x1e, 0xf4, 0x1e, 0x09, 0x46, 0xbe, - 0xe1, 0x24, 0x50, 0x1d, 0x27, 0x79, 0x45, 0x0c, - 0x64, 0x5e, 0x6b, 0x31, 0x4b, 0x8e, 0xe5, 0xf4, - 0xbc, 0xe7, 0x23, 0x13, 0xd7, 0x49, 0xf0, 0x39, - 0x2e, 0x97, 0xb8, 0x6d, 0x82, 0x8b, 0x15, 0x72, - 0x7c, 0xb5, 0xfe, 0x7c, 0x8f, 0x4f, 0x82, 0xd5, - 0xed, 0xfa, 0x40, 0xa2, 0x49, 0xce, 0xe7, 0xd3, - 0x59, 0xef, 0xe4, 0xc4, 0x6d, 0x12, 0x4d, 0x8e, - 0x34, 0x53, 0x82, 0x44, 0xf7, 0xc9, 0x89, 0x5a, - 0x37, 0x93, 0x49, 0xce, 0x28, 0xdb, 0x64, 0x74, - 0x25, 0xc6, 0x49, 0x2e, 0x71, 0xbc, 0x33, 0x78, - 0x01, 0xc3, 0x02, 0xd2, 0x58, 0xed, 0x50, 0xb6, - 0x99, 0x38, 0x2c, 0x41, 0xc2, 0xc4, 0x5d, 0x68, - 0x18, 0x07, 0xb9, 0x44, 0xbd, 0xf0, 0xd4, 0x20, - 0x20, 0x5b, 0x54, 0xab, 0x67, 0xe3, 0xff, 0x64, - 0x78, 0xbc, 0x5b, 0x24, 0x18, 0x2a, 0xf2, 0x46, - 0x09, 0x46, 0x5b, 0x5b, 0x4a, 0x96, 0xe5, 0xc2, - 0xa0, 0x36, 0xa0, 0x0b, 0x09, 0x39, 0xa5, 0x0e, - 0x83, 0xe4, 0x3b, 0x64, 0x72, 0x4a, 0xf3, 0x60, - 0x1a, 0x2f, 0x4c, 0xe5, 0x0e, 0xf3, 0xde, 0x24, - 0xe8, 0x0c, 0x32, 0x52, 0x36, 0xb4, 0xe3, 0x2a, - 0x86, 0x2e, 0x6b, 0xc7, 0x67, 0x99, 0x87, 0x2c, - 0x11, 0xdd, 0x2a, 0x86, 0xda, 0x85, 0x1c, 0x9e, - 0x95, 0xe5, 0x9e, 0x99, 0xe0, 0xb7, 0x3b, 0x5f, - 0xe2, 0x82, 0x09, 0x6e, 0x08, 0x40, 0x7b, 0x89, - 0x72, 0x60, 0xfc, 0xb5, 0x6b, 0xbf, 0x17, 0x06, - 0x7f, 0x29, 0xaf, 0xd0, 0xa8, 0xe7, 0x7e, 0x6f, - 0x3e, 0x0b, 0x8d, 0xeb, 0xae, 0x9d, 0x98, 0x2a, - 0xe6, 0xcf, 0xe3, 0x0b, 0x25, 0xc6, 0xc7, 0x03, - 0xbf, 0x7f, 0xb7, 0x85, 0xfb, 0xae, 0x54, 0x5e, - 0x65, 0xed, 0x6c, 0x8e, 0xd0, 0x34, 0x25, 0x3b, - 0xf2, 0x52, 0x23, 0x34, 0x95, 0xb2, 0x1e, 0x77, - 0x46, 0xa9, 0xb5, 0xb8, 0x24, 0xd7, 0xda, 0x3b, - 0xbe, 0x69, 0xd6, 0xe3, 0xe4, 0x4d, 0x02, 0xbc, - 0xb6, 0xbb, 0xe2, 0x20, 0xcb, 0x92, 0x03, 0xe5, - 0x86, 0xd6, 0x0c, 0xcb, 0x37, 0x0f, 0xc5, 0x78, - 0x7c, 0x86, 0xee, 0x7e, 0xcd, 0xe7, 0x39, 0x24, - 0xdb, 0x5d, 0x74, 0x57, 0x9c, 0x9b, 0x64, 0x99, - 0xda, 0xc8, 0x36, 0x13, 0x59, 0x97, 0x09, 0xb9, - 0xbf, 0x5a, 0xc2, 0xd5, 0xc5, 0xe7, 0xe0, 0x33, - 0xcc, 0xbb, 0x78, 0x65, 0xdf, 0xe1, 0xee, 0x34, - 0x93, 0x93, 0x54, 0xb6, 0x4f, 0xff, 0xd6, 0xf2, - 0xd6, 0x67, 0x5c, 0xe8, 0xd0, 0x52, 0x99, 0x93, - 0x15, 0xff, 0x7f, 0x2d, 0x67, 0x46, 0x43, 0xa3, - 0xeb, 0x66, 0x5b, 0x93, 0x84, 0x3f, 0xdb, 0xa2, - 0x7e, 0x90, 0x62, 0xfe, 0x9b, 0x37, 0x4f, 0xd4, - 0xf1, 0xde, 0x7c, 0xd6, 0x79, 0x5d, 0x8a, 0x28, - 0xcd, 0x60, 0xb0, 0xff, 0x72, 0x3f, 0x6a, 0xe4, - 0x7d, 0x56, 0x19, 0xa1, 0x89, 0x3e, 0xd3, 0xe5, - 0xed, 0x0e, 0xbb, 0xf8, 0x4c, 0xfc, 0xbf, 0x67, - 0x67, 0x3b, 0xe3, 0x56, 0xd0, 0x73, 0x65, 0x9b, - 0x3f, 0x93, 0xc9, 0x5f, 0x25, 0xca, 0x73, 0xda, - 0x6b, 0xb2, 0x8d, 0x95, 0x8a, 0x4a, 0xb3, 0x4d, - 0x1a, 0x25, 0xf1, 0xff, 0x95, 0xa5, 0x12, 0xb4, - 0x9a, 0xbe, 0x52, 0xb6, 0x3b, 0x1e, 0xf6, 0xf3, - 0xc4, 0x4c, 0xd6, 0x71, 0x2f, 0xd6, 0x77, 0x65, - 0x9b, 0x4d, 0xbd, 0x7c, 0xb6, 0x49, 0x69, 0x0b, - 0xc3, 0x92, 0x56, 0xc7, 0x1e, 0x0e, 0x4a, 0x75, - 0xb8, 0x30, 0xe3, 0x7b, 0xea, 0x96, 0xcc, 0xf0, - 0x7b, 0xd5, 0x7e, 0xcf, 0x65, 0x47, 0x68, 0x5a, - 0x38, 0xfa, 0x59, 0xd6, 0xe5, 0x3b, 0xa6, 0xc4, - 0x85, 0x11, 0xd4, 0x6a, 0xd8, 0xaf, 0xd8, 0x36, - 0xe7, 0x62, 0xea, 0x9b, 0xd9, 0x6f, 0xd9, 0x47, - 0xba, 0x9f, 0x93, 0xef, 0x95, 0xcf, 0x54, 0x6b, - 0x3f, 0xb0, 0x2b, 0x98, 0x73, 0x55, 0x4d, 0xad, - 0x61, 0x13, 0x07, 0xcc, 0xda, 0x07, 0x57, 0x5f, - 0x46, 0x0e, 0x40, 0xc6, 0xee, 0xe5, 0x42, 0x61, - 0x51, 0x83, 0x10, 0x4e, 0x34, 0xe5, 0xc9, 0x75, - 0x6d, 0xf2, 0x39, 0x98, 0x70, 0xf3, 0x70, 0x46, - 0xf2, 0x99, 0x24, 0x8a, 0x15, 0x7c, 0x8e, 0x79, - 0xc7, 0x16, 0xc3, 0x48, 0x3e, 0x28, 0xdb, 0x9b, - 0xb7, 0x8d, 0x31, 0x72, 0xe8, 0x74, 0x8b, 0x21, - 0x57, 0x54, 0x4b, 0x58, 0xa9, 0x0b, 0xbd, 0x5f, - 0xb6, 0x35, 0x95, 0xa3, 0x6e, 0x1f, 0x73, 0xd3, - 0xf5, 0x79, 0x17, 0x0c, 0xfc, 0x43, 0xf3, 0x12, - 0x56, 0xb6, 0xc1, 0x90, 0x7b, 0xd5, 0x84, 0x75, - 0x0b, 0xb8, 0x50, 0xaa, 0x35, 0xba, 0x1a, 0xe3, - 0xfb, 0x1b, 0x8a, 0xbe, 0xad, 0xb5, 0xdf, 0xbe, - 0x76, 0x9f, 0xd6, 0xa5, 0xe4, 0xff, 0x66, 0x20, - 0x8f, 0xb2, 0x05, 0x3d, 0xb8, 0x78, 0x1f, 0x27, - 0x82, 0x24, 0x52, 0xcd, 0x58, 0xe3, 0xeb, 0x94, - 0xf7, 0xe6, 0x62, 0x90, 0x41, 0xed, 0xfb, 0x1a, - 0xbb, 0xb1, 0x7f, 0x91, 0xe8, 0x77, 0x13, 0x2c, - 0x7e, 0x2f, 0x6e, 0x97, 0xb8, 0x51, 0xf9, 0x6c, - 0xec, 0xb7, 0x8c, 0xab, 0x3e, 0x73, 0x1b, 0xc4, - 0x16, 0xbf, 0x03, 0xfb, 0x2b, 0x77, 0x28, 0xe3, - 0x0e, 0x4d, 0x8c, 0xcc, 0xb4, 0xe5, 0xaa, 0x99, - 0x9d, 0xc6, 0xc4, 0x55, 0x35, 0xef, 0x4b, 0x94, - 0xdd, 0x2e, 0x68, 0x58, 0x34, 0x37, 0x67, 0xb7, - 0x49, 0x39, 0xa0, 0x29, 0xb2, 0xe4, 0x26, 0x09, - 0x43, 0x6f, 0xa0, 0xbd, 0xd6, 0x2b, 0x63, 0x4e, - 0x2c, 0x09, 0xc6, 0x08, 0xa6, 0x01, 0x07, 0xc5, - 0xaf, 0x43, 0x90, 0x8b, 0xa6, 0xc5, 0x2f, 0xf7, - 0xc5, 0xac, 0xde, 0x2f, 0x77, 0x20, 0xba, 0x45, - 0xdc, 0x2e, 0xdb, 0xaa, 0xdd, 0x03, 0x96, 0xcf, - 0xca, 0xc5, 0x08, 0x2d, 0x7f, 0xa9, 0xb7, 0x5e, - 0xd8, 0x22, 0xb9, 0xc0, 0x05, 0xcd, 0xad, 0xb3, - 0x8d, 0xf2, 0xbe, 0x9d, 0x5b, 0x96, 0x6d, 0x92, - 0x33, 0xe5, 0xe4, 0x3c, 0xa4, 0xf5, 0x6c, 0xaf, - 0x24, 0x70, 0x24, 0x32, 0xb5, 0x92, 0x16, 0xba, - 0x38, 0xd5, 0xea, 0x4d, 0x87, 0xe8, 0x1b, 0x67, - 0x77, 0xdc, 0x2a, 0x99, 0x0b, 0x9e, 0x79, 0x17, - 0x28, 0x2b, 0xcb, 0xf7, 0x44, 0xc3, 0x34, 0x4a, - 0xc6, 0x6a, 0xf5, 0xe7, 0x25, 0x86, 0x2d, 0x64, - 0x90, 0x8b, 0x5a, 0x83, 0xa3, 0xb5, 0xcb, 0x67, - 0xa3, 0x2b, 0x1e, 0x37, 0x92, 0xa7, 0xdf, 0xee, - 0x2a, 0xc7, 0x18, 0xad, 0xef, 0x97, 0xb9, 0xb8, - 0xdc, 0xb1, 0x36, 0x76, 0x95, 0xbf, 0x5f, 0x58, - 0x2c, 0x3c, 0x25, 0x27, 0x1d, 0x8a, 0x04, 0xcb, - 0x22, 0xcc, 0x0f, 0xe7, 0xc0, 0x58, 0xd8, 0x71, - 0x3b, 0xeb, 0x72, 0xf7, 0x13, 0x46, 0x66, 0x1a, - 0x7b, 0xe1, 0xa2, 0x13, 0x6d, 0xd6, 0xe1, 0x62, - 0x8d, 0x84, 0xb9, 0x1c, 0xdd, 0xe7, 0xe4, 0xac, - 0x3b, 0xd5, 0x50, 0x2a, 0xcb, 0x52, 0x3f, 0x54, - 0x8e, 0x57, 0xfc, 0xb9, 0x2c, 0x37, 0x77, 0x00, - 0x80, 0xf6, 0x3d, 0x18, 0xa7, 0xf4, 0xf8, 0x04, - 0x2d, 0x43, 0x6b, 0x75, 0x99, 0x1c, 0xb4, 0x24, - 0x3c, 0x9c, 0x9c, 0x48, 0x58, 0xce, 0xc8, 0x76, - 0x33, 0x69, 0xd6, 0x67, 0xdf, 0x28, 0xef, 0x7f, - 0x0a, 0x72, 0x7f, 0xcb, 0x0c, 0x3e, 0x3e, 0x91, - 0x6d, 0x51, 0x4f, 0xc8, 0xf7, 0x44, 0x42, 0x4b, - 0x1f, 0xd6, 0xda, 0x49, 0x96, 0x84, 0x84, 0x0b, - 0x15, 0x8a, 0xda, 0x5f, 0x9c, 0xf7, 0xe8, 0x4d, - 0x90, 0xb3, 0x3d, 0xc6, 0x0e, 0xa6, 0x55, 0x31, - 0xff, 0x1f, 0x5d, 0x6b, 0x6a, 0x57, 0xfb, 0x6c, - 0x8f, 0xcf, 0xc9, 0xbe, 0xc7, 0xf7, 0xda, 0x37, - 0xb8, 0xc4, 0x44, 0xb6, 0xcb, 0x84, 0x61, 0xf8, - 0x68, 0x0c, 0x43, 0xfd, 0x70, 0x6d, 0x7c, 0x58, - 0x50, 0xcc, 0x48, 0xae, 0x92, 0xdf, 0xf9, 0x8d, - 0xd9, 0xf6, 0xc2, 0x04, 0x39, 0xdb, 0xe6, 0x3b, - 0x2e, 0x1b, 0x60, 0xbd, 0x28, 0xeb, 0xbe, 0xb2, - 0x9d, 0xef, 0x95, 0x75, 0xe9, 0xbb, 0xcb, 0xcd, - 0x21, 0x8e, 0x4a, 0x94, 0xa3, 0x57, 0xf1, 0xde, - 0xef, 0xcf, 0x76, 0x16, 0xd6, 0x99, 0x67, 0x3b, - 0xdc, 0xbb, 0xb6, 0xd6, 0x60, 0x8c, 0x7b, 0xdd, - 0x6e, 0x29, 0x27, 0x97, 0x6d, 0xb3, 0x2f, 0x53, - 0xff, 0x59, 0x16, 0x0d, 0x93, 0x4b, 0x24, 0x31, - 0xa3, 0xf8, 0x9d, 0xef, 0x60, 0x95, 0xdc, 0x76, - 0x89, 0x6e, 0x59, 0x33, 0x37, 0x57, 0xc8, 0x67, - 0xa0, 0x91, 0x12, 0xb7, 0xbd, 0xa3, 0xf4, 0xe6, - 0xd0, 0xc4, 0xf8, 0xbb, 0x22, 0x77, 0xcb, 0x45, - 0x2f, 0xed, 0x20, 0x18, 0x31, 0xed, 0x9b, 0x59, - 0x96, 0xb1, 0x91, 0x6b, 0xdf, 0xfd, 0x5d, 0xf2, - 0x7a, 0xf7, 0x2e, 0x57, 0x14, 0x79, 0x4f, 0x6e, - 0x77, 0xd8, 0x31, 0xe8, 0x38, 0xc8, 0x76, 0x98, - 0xd0, 0xf5, 0x88, 0xcf, 0x47, 0x3f, 0xe0, 0xbe, - 0x01, 0x5e, 0xf8, 0x3d, 0xb9, 0x2f, 0x31, 0x89, - 0x3f, 0x17, 0x2c, 0x1f, 0xcd, 0xfb, 0x64, 0xb2, - 0x7b, 0x99, 0xb8, 0x0e, 0xb7, 0x63, 0x12, 0xd7, - 0xdd, 0x2e, 0x07, 0x36, 0x5d, 0x0f, 0xa8, 0xa3, - 0xe5, 0xe4, 0xc3, 0xc9, 0x8f, 0xdc, 0x20, 0xb9, - 0x15, 0x6e, 0x35, 0x76, 0x56, 0x0e, 0x5e, 0x12, - 0xa2, 0x8d, 0xcb, 0xe7, 0x60, 0xbf, 0xa3, 0x6e, - 0x90, 0x96, 0xc3, 0x74, 0xb7, 0x21, 0x51, 0xa4, - 0x3e, 0x8e, 0xba, 0xb9, 0x4f, 0x26, 0xe8, 0xa3, - 0xba, 0xf4, 0x55, 0x7a, 0x7b, 0xc2, 0xe2, 0x7f, - 0xe3, 0x44, 0xca, 0xad, 0xd3, 0x48, 0xc4, 0xe9, - 0x06, 0xc4, 0xf6, 0x38, 0x41, 0x7d, 0x69, 0xc8, - 0xf6, 0xba, 0xb2, 0x6d, 0x12, 0x01, 0x12, 0x57, - 0x8a, 0xea, 0x28, 0xd2, 0xe4, 0x82, 0x80, 0xe2, - 0x4f, 0xea, 0xc0, 0x3e, 0x95, 0xed, 0x2e, 0xbc, - 0xa5, 0xdd, 0x3a, 0xb5, 0xff, 0x2b, 0x9f, 0x83, - 0x22, 0x44, 0x8e, 0x5b, 0x9e, 0xe0, 0x18, 0x26, - 0xe7, 0xfc, 0xd5, 0x55, 0xff, 0xcf, 0xdd, 0xa8, - 0xdd, 0xcf, 0xb8, 0x98, 0xa4, 0x5b, 0x15, 0xdf, - 0x0b, 0xb9, 0xc7, 0xef, 0xe4, 0x3b, 0xca, 0x64, - 0xff, 0xcb, 0xe7, 0x23, 0xd1, 0xa7, 0x45, 0x33, - 0x31, 0x1e, 0xc8, 0x83, 0xcf, 0x48, 0xa2, 0x4e, - 0x17, 0xbf, 0xaf, 0x1f, 0x48, 0xbf, 0xa7, 0x89, - 0xeb, 0x70, 0x26, 0xae, 0x92, 0xa4, 0xb9, 0xac, - 0x73, 0x95, 0x24, 0x69, 0xcd, 0x4c, 0x5c, 0x25, - 0x49, 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, 0xd6, - 0xcc, 0xc4, 0x55, 0x92, 0xa4, 0x35, 0x33, 0x71, - 0x95, 0x24, 0x69, 0xcd, 0x4c, 0x5c, 0x25, 0x49, - 0x5a, 0x33, 0x13, 0x57, 0x49, 0x92, 0xd6, 0xcc, - 0xc4, 0x55, 0x92, 0xa4, 0x35, 0xdb, 0x6d, 0x83, - 0x48, 0xf0, 0x97, 0x7b, 0x0a, 0x96, 0x43, 0xa9, - 0xad, 0xd3, 0x77, 0xf7, 0x1c, 0x73, 0x70, 0x33, - 0xc6, 0xee, 0x39, 0xef, 0x6a, 0x46, 0x07, 0xda, - 0xe4, 0x80, 0x15, 0xf8, 0xc8, 0xde, 0xdb, 0x37, - 0xc3, 0x9c, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, - 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, - 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, - 0x5b, 0xb7, 0x67, 0xcf, 0xff, 0x03, 0x27, 0xa6, - 0xaa, 0x9c, 0x80, 0xec, 0x5b, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, - 0x60, 0x82, -}; - -unsigned int mslogo_jpg_size = sizeof(mslogo_jpg); - -const unsigned char nxlogo_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, - 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, - 0x00, 0x55, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc7, 0x5e, 0x18, 0xd4, - 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x2e, - 0x23, 0x00, 0x00, 0x2e, 0x23, 0x01, 0x78, 0xa5, 0x3f, 0x76, 0x00, - 0x00, 0x0a, 0x4f, 0x69, 0x43, 0x43, 0x50, 0x50, 0x68, 0x6f, 0x74, - 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x49, 0x43, 0x43, 0x20, 0x70, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, - 0x53, 0x67, 0x54, 0x53, 0xe9, 0x16, 0x3d, 0xf7, 0xde, 0xf4, 0x42, - 0x4b, 0x88, 0x80, 0x94, 0x4b, 0x6f, 0x52, 0x15, 0x08, 0x20, 0x52, - 0x42, 0x8b, 0x80, 0x14, 0x91, 0x26, 0x2a, 0x21, 0x09, 0x10, 0x4a, - 0x88, 0x21, 0xa1, 0xd9, 0x15, 0x51, 0xc1, 0x11, 0x45, 0x45, 0x04, - 0x1b, 0xc8, 0xa0, 0x88, 0x03, 0x8e, 0x8e, 0x80, 0x8c, 0x15, 0x51, - 0x2c, 0x0c, 0x8a, 0x0a, 0xd8, 0x07, 0xe4, 0x21, 0xa2, 0x8e, 0x83, - 0xa3, 0x88, 0x8a, 0xca, 0xfb, 0xe1, 0x7b, 0xa3, 0x6b, 0xd6, 0xbc, - 0xf7, 0xe6, 0xcd, 0xfe, 0xb5, 0xd7, 0x3e, 0xe7, 0xac, 0xf3, 0x9d, - 0xb3, 0xcf, 0x07, 0xc0, 0x08, 0x0c, 0x96, 0x48, 0x33, 0x51, 0x35, - 0x80, 0x0c, 0xa9, 0x42, 0x1e, 0x11, 0xe0, 0x83, 0xc7, 0xc4, 0xc6, - 0xe1, 0xe4, 0x2e, 0x40, 0x81, 0x0a, 0x24, 0x70, 0x00, 0x10, 0x08, - 0xb3, 0x64, 0x21, 0x73, 0xfd, 0x23, 0x01, 0x00, 0xf8, 0x7e, 0x3c, - 0x3c, 0x2b, 0x22, 0xc0, 0x07, 0xbe, 0x00, 0x01, 0x78, 0xd3, 0x0b, - 0x08, 0x00, 0xc0, 0x4d, 0x9b, 0xc0, 0x30, 0x1c, 0x87, 0xff, 0x0f, - 0xea, 0x42, 0x99, 0x5c, 0x01, 0x80, 0x84, 0x01, 0xc0, 0x74, 0x91, - 0x38, 0x4b, 0x08, 0x80, 0x14, 0x00, 0x40, 0x7a, 0x8e, 0x42, 0xa6, - 0x00, 0x40, 0x46, 0x01, 0x80, 0x9d, 0x98, 0x26, 0x53, 0x00, 0xa0, - 0x04, 0x00, 0x60, 0xcb, 0x63, 0x62, 0xe3, 0x00, 0x50, 0x2d, 0x00, - 0x60, 0x27, 0x7f, 0xe6, 0xd3, 0x00, 0x80, 0x9d, 0xf8, 0x99, 0x7b, - 0x01, 0x00, 0x5b, 0x94, 0x21, 0x15, 0x01, 0xa0, 0x91, 0x00, 0x20, - 0x13, 0x65, 0x88, 0x44, 0x00, 0x68, 0x3b, 0x00, 0xac, 0xcf, 0x56, - 0x8a, 0x45, 0x00, 0x58, 0x30, 0x00, 0x14, 0x66, 0x4b, 0xc4, 0x39, - 0x00, 0xd8, 0x2d, 0x00, 0x30, 0x49, 0x57, 0x66, 0x48, 0x00, 0xb0, - 0xb7, 0x00, 0xc0, 0xce, 0x10, 0x0b, 0xb2, 0x00, 0x08, 0x0c, 0x00, - 0x30, 0x51, 0x88, 0x85, 0x29, 0x00, 0x04, 0x7b, 0x00, 0x60, 0xc8, - 0x23, 0x23, 0x78, 0x00, 0x84, 0x99, 0x00, 0x14, 0x46, 0xf2, 0x57, - 0x3c, 0xf1, 0x2b, 0xae, 0x10, 0xe7, 0x2a, 0x00, 0x00, 0x78, 0x99, - 0xb2, 0x3c, 0xb9, 0x24, 0x39, 0x45, 0x81, 0x5b, 0x08, 0x2d, 0x71, - 0x07, 0x57, 0x57, 0x2e, 0x1e, 0x28, 0xce, 0x49, 0x17, 0x2b, 0x14, - 0x36, 0x61, 0x02, 0x61, 0x9a, 0x40, 0x2e, 0xc2, 0x79, 0x99, 0x19, - 0x32, 0x81, 0x34, 0x0f, 0xe0, 0xf3, 0xcc, 0x00, 0x00, 0xa0, 0x91, - 0x15, 0x11, 0xe0, 0x83, 0xf3, 0xfd, 0x78, 0xce, 0x0e, 0xae, 0xce, - 0xce, 0x36, 0x8e, 0xb6, 0x0e, 0x5f, 0x2d, 0xea, 0xbf, 0x06, 0xff, - 0x22, 0x62, 0x62, 0xe3, 0xfe, 0xe5, 0xcf, 0xab, 0x70, 0x40, 0x00, - 0x00, 0xe1, 0x74, 0x7e, 0xd1, 0xfe, 0x2c, 0x2f, 0xb3, 0x1a, 0x80, - 0x3b, 0x06, 0x80, 0x6d, 0xfe, 0xa2, 0x25, 0xee, 0x04, 0x68, 0x5e, - 0x0b, 0xa0, 0x75, 0xf7, 0x8b, 0x66, 0xb2, 0x0f, 0x40, 0xb5, 0x00, - 0xa0, 0xe9, 0xda, 0x57, 0xf3, 0x70, 0xf8, 0x7e, 0x3c, 0x3c, 0x45, - 0xa1, 0x90, 0xb9, 0xd9, 0xd9, 0xe5, 0xe4, 0xe4, 0xd8, 0x4a, 0xc4, - 0x42, 0x5b, 0x61, 0xca, 0x57, 0x7d, 0xfe, 0x67, 0xc2, 0x5f, 0xc0, - 0x57, 0xfd, 0x6c, 0xf9, 0x7e, 0x3c, 0xfc, 0xf7, 0xf5, 0xe0, 0xbe, - 0xe2, 0x24, 0x81, 0x32, 0x5d, 0x81, 0x47, 0x04, 0xf8, 0xe0, 0xc2, - 0xcc, 0xf4, 0x4c, 0xa5, 0x1c, 0xcf, 0x92, 0x09, 0x84, 0x62, 0xdc, - 0xe6, 0x8f, 0x47, 0xfc, 0xb7, 0x0b, 0xff, 0xfc, 0x1d, 0xd3, 0x22, - 0xc4, 0x49, 0x62, 0xb9, 0x58, 0x2a, 0x14, 0xe3, 0x51, 0x12, 0x71, - 0x8e, 0x44, 0x9a, 0x8c, 0xf3, 0x32, 0xa5, 0x22, 0x89, 0x42, 0x92, - 0x29, 0xc5, 0x25, 0xd2, 0xff, 0x64, 0xe2, 0xdf, 0x2c, 0xfb, 0x03, - 0x3e, 0xdf, 0x35, 0x00, 0xb0, 0x6a, 0x3e, 0x01, 0x7b, 0x91, 0x2d, - 0xa8, 0x5d, 0x63, 0x03, 0xf6, 0x4b, 0x27, 0x10, 0x58, 0x74, 0xc0, - 0xe2, 0xf7, 0x00, 0x00, 0xf2, 0xbb, 0x6f, 0xc1, 0xd4, 0x28, 0x08, - 0x03, 0x80, 0x68, 0x83, 0xe1, 0xcf, 0x77, 0xff, 0xef, 0x3f, 0xfd, - 0x47, 0xa0, 0x25, 0x00, 0x80, 0x66, 0x49, 0x92, 0x71, 0x00, 0x00, - 0x5e, 0x44, 0x24, 0x2e, 0x54, 0xca, 0xb3, 0x3f, 0xc7, 0x08, 0x00, - 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x1b, 0xf4, 0xc1, 0x18, - 0x2c, 0xc0, 0x06, 0x1c, 0xc1, 0x05, 0xdc, 0xc1, 0x0b, 0xfc, 0x60, - 0x36, 0x84, 0x42, 0x24, 0xc4, 0xc2, 0x42, 0x10, 0x42, 0x0a, 0x64, - 0x80, 0x1c, 0x72, 0x60, 0x29, 0xac, 0x82, 0x42, 0x28, 0x86, 0xcd, - 0xb0, 0x1d, 0x2a, 0x60, 0x2f, 0xd4, 0x40, 0x1d, 0x34, 0xc0, 0x51, - 0x68, 0x86, 0x93, 0x70, 0x0e, 0x2e, 0xc2, 0x55, 0xb8, 0x0e, 0x3d, - 0x70, 0x0f, 0xfa, 0x61, 0x08, 0x9e, 0xc1, 0x28, 0xbc, 0x81, 0x09, - 0x04, 0x41, 0xc8, 0x08, 0x13, 0x61, 0x21, 0xda, 0x88, 0x01, 0x62, - 0x8a, 0x58, 0x23, 0x8e, 0x08, 0x17, 0x99, 0x85, 0xf8, 0x21, 0xc1, - 0x48, 0x04, 0x12, 0x8b, 0x24, 0x20, 0xc9, 0x88, 0x14, 0x51, 0x22, - 0x4b, 0x91, 0x35, 0x48, 0x31, 0x52, 0x8a, 0x54, 0x20, 0x55, 0x48, - 0x1d, 0xf2, 0x3d, 0x72, 0x02, 0x39, 0x87, 0x5c, 0x46, 0xba, 0x91, - 0x3b, 0xc8, 0x00, 0x32, 0x82, 0xfc, 0x86, 0xbc, 0x47, 0x31, 0x94, - 0x81, 0xb2, 0x51, 0x3d, 0xd4, 0x0c, 0xb5, 0x43, 0xb9, 0xa8, 0x37, - 0x1a, 0x84, 0x46, 0xa2, 0x0b, 0xd0, 0x64, 0x74, 0x31, 0x9a, 0x8f, - 0x16, 0xa0, 0x9b, 0xd0, 0x72, 0xb4, 0x1a, 0x3d, 0x8c, 0x36, 0xa1, - 0xe7, 0xd0, 0xab, 0x68, 0x0f, 0xda, 0x8f, 0x3e, 0x43, 0xc7, 0x30, - 0xc0, 0xe8, 0x18, 0x07, 0x33, 0xc4, 0x6c, 0x30, 0x2e, 0xc6, 0xc3, - 0x42, 0xb1, 0x38, 0x2c, 0x09, 0x93, 0x63, 0xcb, 0xb1, 0x22, 0xac, - 0x0c, 0xab, 0xc6, 0x1a, 0xb0, 0x56, 0xac, 0x03, 0xbb, 0x89, 0xf5, - 0x63, 0xcf, 0xb1, 0x77, 0x04, 0x12, 0x81, 0x45, 0xc0, 0x09, 0x36, - 0x04, 0x77, 0x42, 0x20, 0x61, 0x1e, 0x41, 0x48, 0x58, 0x4c, 0x58, - 0x4e, 0xd8, 0x48, 0xa8, 0x20, 0x1c, 0x24, 0x34, 0x11, 0xda, 0x09, - 0x37, 0x09, 0x03, 0x84, 0x51, 0xc2, 0x27, 0x22, 0x93, 0xa8, 0x4b, - 0xb4, 0x26, 0xba, 0x11, 0xf9, 0xc4, 0x18, 0x62, 0x32, 0x31, 0x87, - 0x58, 0x48, 0x2c, 0x23, 0xd6, 0x12, 0x8f, 0x13, 0x2f, 0x10, 0x7b, - 0x88, 0x43, 0xc4, 0x37, 0x24, 0x12, 0x89, 0x43, 0x32, 0x27, 0xb9, - 0x90, 0x02, 0x49, 0xb1, 0xa4, 0x54, 0xd2, 0x12, 0xd2, 0x46, 0xd2, - 0x6e, 0x52, 0x23, 0xe9, 0x2c, 0xa9, 0x9b, 0x34, 0x48, 0x1a, 0x23, - 0x93, 0xc9, 0xda, 0x64, 0x6b, 0xb2, 0x07, 0x39, 0x94, 0x2c, 0x20, - 0x2b, 0xc8, 0x85, 0xe4, 0x9d, 0xe4, 0xc3, 0xe4, 0x33, 0xe4, 0x1b, - 0xe4, 0x21, 0xf2, 0x5b, 0x0a, 0x9d, 0x62, 0x40, 0x71, 0xa4, 0xf8, - 0x53, 0xe2, 0x28, 0x52, 0xca, 0x6a, 0x4a, 0x19, 0xe5, 0x10, 0xe5, - 0x34, 0xe5, 0x06, 0x65, 0x98, 0x32, 0x41, 0x55, 0xa3, 0x9a, 0x52, - 0xdd, 0xa8, 0xa1, 0x54, 0x11, 0x35, 0x8f, 0x5a, 0x42, 0xad, 0xa1, - 0xb6, 0x52, 0xaf, 0x51, 0x87, 0xa8, 0x13, 0x34, 0x75, 0x9a, 0x39, - 0xcd, 0x83, 0x16, 0x49, 0x4b, 0xa5, 0xad, 0xa2, 0x95, 0xd3, 0x1a, - 0x68, 0x17, 0x68, 0xf7, 0x69, 0xaf, 0xe8, 0x74, 0xba, 0x11, 0xdd, - 0x95, 0x1e, 0x4e, 0x97, 0xd0, 0x57, 0xd2, 0xcb, 0xe9, 0x47, 0xe8, - 0x97, 0xe8, 0x03, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x15, 0x83, 0xc7, - 0x88, 0x67, 0x28, 0x19, 0x9b, 0x18, 0x07, 0x18, 0x67, 0x19, 0x77, - 0x18, 0xaf, 0x98, 0x4c, 0xa6, 0x19, 0xd3, 0x8b, 0x19, 0xc7, 0x54, - 0x30, 0x37, 0x31, 0xeb, 0x98, 0xe7, 0x99, 0x0f, 0x99, 0x6f, 0x55, - 0x58, 0x2a, 0xb6, 0x2a, 0x7c, 0x15, 0x91, 0xca, 0x0a, 0x95, 0x4a, - 0x95, 0x26, 0x95, 0x1b, 0x2a, 0x2f, 0x54, 0xa9, 0xaa, 0xa6, 0xaa, - 0xde, 0xaa, 0x0b, 0x55, 0xf3, 0x55, 0xcb, 0x54, 0x8f, 0xa9, 0x5e, - 0x53, 0x7d, 0xae, 0x46, 0x55, 0x33, 0x53, 0xe3, 0xa9, 0x09, 0xd4, - 0x96, 0xab, 0x55, 0xaa, 0x9d, 0x50, 0xeb, 0x53, 0x1b, 0x53, 0x67, - 0xa9, 0x3b, 0xa8, 0x87, 0xaa, 0x67, 0xa8, 0x6f, 0x54, 0x3f, 0xa4, - 0x7e, 0x59, 0xfd, 0x89, 0x06, 0x59, 0xc3, 0x4c, 0xc3, 0x4f, 0x43, - 0xa4, 0x51, 0xa0, 0xb1, 0x5f, 0xe3, 0xbc, 0xc6, 0x20, 0x0b, 0x63, - 0x19, 0xb3, 0x78, 0x2c, 0x21, 0x6b, 0x0d, 0xab, 0x86, 0x75, 0x81, - 0x35, 0xc4, 0x26, 0xb1, 0xcd, 0xd9, 0x7c, 0x76, 0x2a, 0xbb, 0x98, - 0xfd, 0x1d, 0xbb, 0x8b, 0x3d, 0xaa, 0xa9, 0xa1, 0x39, 0x43, 0x33, - 0x4a, 0x33, 0x57, 0xb3, 0x52, 0xf3, 0x94, 0x66, 0x3f, 0x07, 0xe3, - 0x98, 0x71, 0xf8, 0x9c, 0x74, 0x4e, 0x09, 0xe7, 0x28, 0xa7, 0x97, - 0xf3, 0x7e, 0x8a, 0xde, 0x14, 0xef, 0x29, 0xe2, 0x29, 0x1b, 0xa6, - 0x34, 0x4c, 0xb9, 0x31, 0x65, 0x5c, 0x6b, 0xaa, 0x96, 0x97, 0x96, - 0x58, 0xab, 0x48, 0xab, 0x51, 0xab, 0x47, 0xeb, 0xbd, 0x36, 0xae, - 0xed, 0xa7, 0x9d, 0xa6, 0xbd, 0x45, 0xbb, 0x59, 0xfb, 0x81, 0x0e, - 0x41, 0xc7, 0x4a, 0x27, 0x5c, 0x27, 0x47, 0x67, 0x8f, 0xce, 0x05, - 0x9d, 0xe7, 0x53, 0xd9, 0x53, 0xdd, 0xa7, 0x0a, 0xa7, 0x16, 0x4d, - 0x3d, 0x3a, 0xf5, 0xae, 0x2e, 0xaa, 0x6b, 0xa5, 0x1b, 0xa1, 0xbb, - 0x44, 0x77, 0xbf, 0x6e, 0xa7, 0xee, 0x98, 0x9e, 0xbe, 0x5e, 0x80, - 0x9e, 0x4c, 0x6f, 0xa7, 0xde, 0x79, 0xbd, 0xe7, 0xfa, 0x1c, 0x7d, - 0x2f, 0xfd, 0x54, 0xfd, 0x6d, 0xfa, 0xa7, 0xf5, 0x47, 0x0c, 0x58, - 0x06, 0xb3, 0x0c, 0x24, 0x06, 0xdb, 0x0c, 0xce, 0x18, 0x3c, 0xc5, - 0x35, 0x71, 0x6f, 0x3c, 0x1d, 0x2f, 0xc7, 0xdb, 0xf1, 0x51, 0x43, - 0x5d, 0xc3, 0x40, 0x43, 0xa5, 0x61, 0x95, 0x61, 0x97, 0xe1, 0x84, - 0x91, 0xb9, 0xd1, 0x3c, 0xa3, 0xd5, 0x46, 0x8d, 0x46, 0x0f, 0x8c, - 0x69, 0xc6, 0x5c, 0xe3, 0x24, 0xe3, 0x6d, 0xc6, 0x6d, 0xc6, 0xa3, - 0x26, 0x06, 0x26, 0x21, 0x26, 0x4b, 0x4d, 0xea, 0x4d, 0xee, 0x9a, - 0x52, 0x4d, 0xb9, 0xa6, 0x29, 0xa6, 0x3b, 0x4c, 0x3b, 0x4c, 0xc7, - 0xcd, 0xcc, 0xcd, 0xa2, 0xcd, 0xd6, 0x99, 0x35, 0x9b, 0x3d, 0x31, - 0xd7, 0x32, 0xe7, 0x9b, 0xe7, 0x9b, 0xd7, 0x9b, 0xdf, 0xb7, 0x60, - 0x5a, 0x78, 0x5a, 0x2c, 0xb6, 0xa8, 0xb6, 0xb8, 0x65, 0x49, 0xb2, - 0xe4, 0x5a, 0xa6, 0x59, 0xee, 0xb6, 0xbc, 0x6e, 0x85, 0x5a, 0x39, - 0x59, 0xa5, 0x58, 0x55, 0x5a, 0x5d, 0xb3, 0x46, 0xad, 0x9d, 0xad, - 0x25, 0xd6, 0xbb, 0xad, 0xbb, 0xa7, 0x11, 0xa7, 0xb9, 0x4e, 0x93, - 0x4e, 0xab, 0x9e, 0xd6, 0x67, 0xc3, 0xb0, 0xf1, 0xb6, 0xc9, 0xb6, - 0xa9, 0xb7, 0x19, 0xb0, 0xe5, 0xd8, 0x06, 0xdb, 0xae, 0xb6, 0x6d, - 0xb6, 0x7d, 0x61, 0x67, 0x62, 0x17, 0x67, 0xb7, 0xc5, 0xae, 0xc3, - 0xee, 0x93, 0xbd, 0x93, 0x7d, 0xba, 0x7d, 0x8d, 0xfd, 0x3d, 0x07, - 0x0d, 0x87, 0xd9, 0x0e, 0xab, 0x1d, 0x5a, 0x1d, 0x7e, 0x73, 0xb4, - 0x72, 0x14, 0x3a, 0x56, 0x3a, 0xde, 0x9a, 0xce, 0x9c, 0xee, 0x3f, - 0x7d, 0xc5, 0xf4, 0x96, 0xe9, 0x2f, 0x67, 0x58, 0xcf, 0x10, 0xcf, - 0xd8, 0x33, 0xe3, 0xb6, 0x13, 0xcb, 0x29, 0xc4, 0x69, 0x9d, 0x53, - 0x9b, 0xd3, 0x47, 0x67, 0x17, 0x67, 0xb9, 0x73, 0x83, 0xf3, 0x88, - 0x8b, 0x89, 0x4b, 0x82, 0xcb, 0x2e, 0x97, 0x3e, 0x2e, 0x9b, 0x1b, - 0xc6, 0xdd, 0xc8, 0xbd, 0xe4, 0x4a, 0x74, 0xf5, 0x71, 0x5d, 0xe1, - 0x7a, 0xd2, 0xf5, 0x9d, 0x9b, 0xb3, 0x9b, 0xc2, 0xed, 0xa8, 0xdb, - 0xaf, 0xee, 0x36, 0xee, 0x69, 0xee, 0x87, 0xdc, 0x9f, 0xcc, 0x34, - 0x9f, 0x29, 0x9e, 0x59, 0x33, 0x73, 0xd0, 0xc3, 0xc8, 0x43, 0xe0, - 0x51, 0xe5, 0xd1, 0x3f, 0x0b, 0x9f, 0x95, 0x30, 0x6b, 0xdf, 0xac, - 0x7e, 0x4f, 0x43, 0x4f, 0x81, 0x67, 0xb5, 0xe7, 0x23, 0x2f, 0x63, - 0x2f, 0x91, 0x57, 0xad, 0xd7, 0xb0, 0xb7, 0xa5, 0x77, 0xaa, 0xf7, - 0x61, 0xef, 0x17, 0x3e, 0xf6, 0x3e, 0x72, 0x9f, 0xe3, 0x3e, 0xe3, - 0x3c, 0x37, 0xde, 0x32, 0xde, 0x59, 0x5f, 0xcc, 0x37, 0xc0, 0xb7, - 0xc8, 0xb7, 0xcb, 0x4f, 0xc3, 0x6f, 0x9e, 0x5f, 0x85, 0xdf, 0x43, - 0x7f, 0x23, 0xff, 0x64, 0xff, 0x7a, 0xff, 0xd1, 0x00, 0xa7, 0x80, - 0x25, 0x01, 0x67, 0x03, 0x89, 0x81, 0x41, 0x81, 0x5b, 0x02, 0xfb, - 0xf8, 0x7a, 0x7c, 0x21, 0xbf, 0x8e, 0x3f, 0x3a, 0xdb, 0x65, 0xf6, - 0xb2, 0xd9, 0xed, 0x41, 0x8c, 0xa0, 0xb9, 0x41, 0x15, 0x41, 0x8f, - 0x82, 0xad, 0x82, 0xe5, 0xc1, 0xad, 0x21, 0x68, 0xc8, 0xec, 0x90, - 0xad, 0x21, 0xf7, 0xe7, 0x98, 0xce, 0x91, 0xce, 0x69, 0x0e, 0x85, - 0x50, 0x7e, 0xe8, 0xd6, 0xd0, 0x07, 0x61, 0xe6, 0x61, 0x8b, 0xc3, - 0x7e, 0x0c, 0x27, 0x85, 0x87, 0x85, 0x57, 0x86, 0x3f, 0x8e, 0x70, - 0x88, 0x58, 0x1a, 0xd1, 0x31, 0x97, 0x35, 0x77, 0xd1, 0xdc, 0x43, - 0x73, 0xdf, 0x44, 0xfa, 0x44, 0x96, 0x44, 0xde, 0x9b, 0x67, 0x31, - 0x4f, 0x39, 0xaf, 0x2d, 0x4a, 0x35, 0x2a, 0x3e, 0xaa, 0x2e, 0x6a, - 0x3c, 0xda, 0x37, 0xba, 0x34, 0xba, 0x3f, 0xc6, 0x2e, 0x66, 0x59, - 0xcc, 0xd5, 0x58, 0x9d, 0x58, 0x49, 0x6c, 0x4b, 0x1c, 0x39, 0x2e, - 0x2a, 0xae, 0x36, 0x6e, 0x6c, 0xbe, 0xdf, 0xfc, 0xed, 0xf3, 0x87, - 0xe2, 0x9d, 0xe2, 0x0b, 0xe3, 0x7b, 0x17, 0x98, 0x2f, 0xc8, 0x5d, - 0x70, 0x79, 0xa1, 0xce, 0xc2, 0xf4, 0x85, 0xa7, 0x16, 0xa9, 0x2e, - 0x12, 0x2c, 0x3a, 0x96, 0x40, 0x4c, 0x88, 0x4e, 0x38, 0x94, 0xf0, - 0x41, 0x10, 0x2a, 0xa8, 0x16, 0x8c, 0x25, 0xf2, 0x13, 0x77, 0x25, - 0x8e, 0x0a, 0x79, 0xc2, 0x1d, 0xc2, 0x67, 0x22, 0x2f, 0xd1, 0x36, - 0xd1, 0x88, 0xd8, 0x43, 0x5c, 0x2a, 0x1e, 0x4e, 0xf2, 0x48, 0x2a, - 0x4d, 0x7a, 0x92, 0xec, 0x91, 0xbc, 0x35, 0x79, 0x24, 0xc5, 0x33, - 0xa5, 0x2c, 0xe5, 0xb9, 0x84, 0x27, 0xa9, 0x90, 0xbc, 0x4c, 0x0d, - 0x4c, 0xdd, 0x9b, 0x3a, 0x9e, 0x16, 0x9a, 0x76, 0x20, 0x6d, 0x32, - 0x3d, 0x3a, 0xbd, 0x31, 0x83, 0x92, 0x91, 0x90, 0x71, 0x42, 0xaa, - 0x21, 0x4d, 0x93, 0xb6, 0x67, 0xea, 0x67, 0xe6, 0x66, 0x76, 0xcb, - 0xac, 0x65, 0x85, 0xb2, 0xfe, 0xc5, 0x6e, 0x8b, 0xb7, 0x2f, 0x1e, - 0x95, 0x07, 0xc9, 0x6b, 0xb3, 0x90, 0xac, 0x05, 0x59, 0x2d, 0x0a, - 0xb6, 0x42, 0xa6, 0xe8, 0x54, 0x5a, 0x28, 0xd7, 0x2a, 0x07, 0xb2, - 0x67, 0x65, 0x57, 0x66, 0xbf, 0xcd, 0x89, 0xca, 0x39, 0x96, 0xab, - 0x9e, 0x2b, 0xcd, 0xed, 0xcc, 0xb3, 0xca, 0xdb, 0x90, 0x37, 0x9c, - 0xef, 0x9f, 0xff, 0xed, 0x12, 0xc2, 0x12, 0xe1, 0x92, 0xb6, 0xa5, - 0x86, 0x4b, 0x57, 0x2d, 0x1d, 0x58, 0xe6, 0xbd, 0xac, 0x6a, 0x39, - 0xb2, 0x3c, 0x71, 0x79, 0xdb, 0x0a, 0xe3, 0x15, 0x05, 0x2b, 0x86, - 0x56, 0x06, 0xac, 0x3c, 0xb8, 0x8a, 0xb6, 0x2a, 0x6d, 0xd5, 0x4f, - 0xab, 0xed, 0x57, 0x97, 0xae, 0x7e, 0xbd, 0x26, 0x7a, 0x4d, 0x6b, - 0x81, 0x5e, 0xc1, 0xca, 0x82, 0xc1, 0xb5, 0x01, 0x6b, 0xeb, 0x0b, - 0x55, 0x0a, 0xe5, 0x85, 0x7d, 0xeb, 0xdc, 0xd7, 0xed, 0x5d, 0x4f, - 0x58, 0x2f, 0x59, 0xdf, 0xb5, 0x61, 0xfa, 0x86, 0x9d, 0x1b, 0x3e, - 0x15, 0x89, 0x8a, 0xae, 0x14, 0xdb, 0x17, 0x97, 0x15, 0x7f, 0xd8, - 0x28, 0xdc, 0x78, 0xe5, 0x1b, 0x87, 0x6f, 0xca, 0xbf, 0x99, 0xdc, - 0x94, 0xb4, 0xa9, 0xab, 0xc4, 0xb9, 0x64, 0xcf, 0x66, 0xd2, 0x66, - 0xe9, 0xe6, 0xde, 0x2d, 0x9e, 0x5b, 0x0e, 0x96, 0xaa, 0x97, 0xe6, - 0x97, 0x0e, 0x6e, 0x0d, 0xd9, 0xda, 0xb4, 0x0d, 0xdf, 0x56, 0xb4, - 0xed, 0xf5, 0xf6, 0x45, 0xdb, 0x2f, 0x97, 0xcd, 0x28, 0xdb, 0xbb, - 0x83, 0xb6, 0x43, 0xb9, 0xa3, 0xbf, 0x3c, 0xb8, 0xbc, 0x65, 0xa7, - 0xc9, 0xce, 0xcd, 0x3b, 0x3f, 0x54, 0xa4, 0x54, 0xf4, 0x54, 0xfa, - 0x54, 0x36, 0xee, 0xd2, 0xdd, 0xb5, 0x61, 0xd7, 0xf8, 0x6e, 0xd1, - 0xee, 0x1b, 0x7b, 0xbc, 0xf6, 0x34, 0xec, 0xd5, 0xdb, 0x5b, 0xbc, - 0xf7, 0xfd, 0x3e, 0xc9, 0xbe, 0xdb, 0x55, 0x01, 0x55, 0x4d, 0xd5, - 0x66, 0xd5, 0x65, 0xfb, 0x49, 0xfb, 0xb3, 0xf7, 0x3f, 0xae, 0x89, - 0xaa, 0xe9, 0xf8, 0x96, 0xfb, 0x6d, 0x5d, 0xad, 0x4e, 0x6d, 0x71, - 0xed, 0xc7, 0x03, 0xd2, 0x03, 0xfd, 0x07, 0x23, 0x0e, 0xb6, 0xd7, - 0xb9, 0xd4, 0xd5, 0x1d, 0xd2, 0x3d, 0x54, 0x52, 0x8f, 0xd6, 0x2b, - 0xeb, 0x47, 0x0e, 0xc7, 0x1f, 0xbe, 0xfe, 0x9d, 0xef, 0x77, 0x2d, - 0x0d, 0x36, 0x0d, 0x55, 0x8d, 0x9c, 0xc6, 0xe2, 0x23, 0x70, 0x44, - 0x79, 0xe4, 0xe9, 0xf7, 0x09, 0xdf, 0xf7, 0x1e, 0x0d, 0x3a, 0xda, - 0x76, 0x8c, 0x7b, 0xac, 0xe1, 0x07, 0xd3, 0x1f, 0x76, 0x1d, 0x67, - 0x1d, 0x2f, 0x6a, 0x42, 0x9a, 0xf2, 0x9a, 0x46, 0x9b, 0x53, 0x9a, - 0xfb, 0x5b, 0x62, 0x5b, 0xba, 0x4f, 0xcc, 0x3e, 0xd1, 0xd6, 0xea, - 0xde, 0x7a, 0xfc, 0x47, 0xdb, 0x1f, 0x0f, 0x9c, 0x34, 0x3c, 0x59, - 0x79, 0x4a, 0xf3, 0x54, 0xc9, 0x69, 0xda, 0xe9, 0x82, 0xd3, 0x93, - 0x67, 0xf2, 0xcf, 0x8c, 0x9d, 0x95, 0x9d, 0x7d, 0x7e, 0x2e, 0xf9, - 0xdc, 0x60, 0xdb, 0xa2, 0xb6, 0x7b, 0xe7, 0x63, 0xce, 0xdf, 0x6a, - 0x0f, 0x6f, 0xef, 0xba, 0x10, 0x74, 0xe1, 0xd2, 0x45, 0xff, 0x8b, - 0xe7, 0x3b, 0xbc, 0x3b, 0xce, 0x5c, 0xf2, 0xb8, 0x74, 0xf2, 0xb2, - 0xdb, 0xe5, 0x13, 0x57, 0xb8, 0x57, 0x9a, 0xaf, 0x3a, 0x5f, 0x6d, - 0xea, 0x74, 0xea, 0x3c, 0xfe, 0x93, 0xd3, 0x4f, 0xc7, 0xbb, 0x9c, - 0xbb, 0x9a, 0xae, 0xb9, 0x5c, 0x6b, 0xb9, 0xee, 0x7a, 0xbd, 0xb5, - 0x7b, 0x66, 0xf7, 0xe9, 0x1b, 0x9e, 0x37, 0xce, 0xdd, 0xf4, 0xbd, - 0x79, 0xf1, 0x16, 0xff, 0xd6, 0xd5, 0x9e, 0x39, 0x3d, 0xdd, 0xbd, - 0xf3, 0x7a, 0x6f, 0xf7, 0xc5, 0xf7, 0xf5, 0xdf, 0x16, 0xdd, 0x7e, - 0x72, 0x27, 0xfd, 0xce, 0xcb, 0xbb, 0xd9, 0x77, 0x27, 0xee, 0xad, - 0xbc, 0x4f, 0xbc, 0x5f, 0xf4, 0x40, 0xed, 0x41, 0xd9, 0x43, 0xdd, - 0x87, 0xd5, 0x3f, 0x5b, 0xfe, 0xdc, 0xd8, 0xef, 0xdc, 0x7f, 0x6a, - 0xc0, 0x77, 0xa0, 0xf3, 0xd1, 0xdc, 0x47, 0xf7, 0x06, 0x85, 0x83, - 0xcf, 0xfe, 0x91, 0xf5, 0x8f, 0x0f, 0x43, 0x05, 0x8f, 0x99, 0x8f, - 0xcb, 0x86, 0x0d, 0x86, 0xeb, 0x9e, 0x38, 0x3e, 0x39, 0x39, 0xe2, - 0x3f, 0x72, 0xfd, 0xe9, 0xfc, 0xa7, 0x43, 0xcf, 0x64, 0xcf, 0x26, - 0x9e, 0x17, 0xfe, 0xa2, 0xfe, 0xcb, 0xae, 0x17, 0x16, 0x2f, 0x7e, - 0xf8, 0xd5, 0xeb, 0xd7, 0xce, 0xd1, 0x98, 0xd1, 0xa1, 0x97, 0xf2, - 0x97, 0x93, 0xbf, 0x6d, 0x7c, 0xa5, 0xfd, 0xea, 0xc0, 0xeb, 0x19, - 0xaf, 0xdb, 0xc6, 0xc2, 0xc6, 0x1e, 0xbe, 0xc9, 0x78, 0x33, 0x31, - 0x5e, 0xf4, 0x56, 0xfb, 0xed, 0xc1, 0x77, 0xdc, 0x77, 0x1d, 0xef, - 0xa3, 0xdf, 0x0f, 0x4f, 0xe4, 0x7c, 0x20, 0x7f, 0x28, 0xff, 0x68, - 0xf9, 0xb1, 0xf5, 0x53, 0xd0, 0xa7, 0xfb, 0x93, 0x19, 0x93, 0x93, - 0xff, 0x04, 0x03, 0x98, 0xf3, 0xfc, 0x63, 0x33, 0x2d, 0xdb, 0x00, - 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25, - 0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0x80, - 0xe9, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, - 0x3a, 0x98, 0x00, 0x00, 0x17, 0x6f, 0x92, 0x5f, 0xc5, 0x46, 0x00, - 0x00, 0x25, 0xa0, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xec, 0x9d, - 0x79, 0x94, 0x25, 0x55, 0x9d, 0xe7, 0xbf, 0xbf, 0x1b, 0xf1, 0xf6, - 0xf7, 0x72, 0xad, 0x5c, 0xaa, 0xa8, 0x3d, 0x6b, 0x2f, 0x76, 0x41, - 0x60, 0x4a, 0xb4, 0xb1, 0x65, 0x5c, 0xda, 0xb6, 0x15, 0x6c, 0x04, - 0xec, 0xd1, 0x43, 0xab, 0xad, 0x07, 0x41, 0x1a, 0xa4, 0x6d, 0x9d, - 0x46, 0xa4, 0x68, 0xa8, 0xee, 0x39, 0x72, 0xa6, 0xad, 0xee, 0x71, - 0x10, 0x97, 0x71, 0x03, 0xb4, 0x61, 0x46, 0x4b, 0xc7, 0x6d, 0xc0, - 0x06, 0x51, 0xb1, 0x9a, 0x62, 0x69, 0x4a, 0xaa, 0x84, 0xda, 0xf7, - 0x25, 0x2b, 0xf7, 0xcc, 0x97, 0x6f, 0x8d, 0xb8, 0x77, 0xfe, 0x78, - 0x2f, 0x5f, 0x46, 0xc6, 0x8b, 0xe5, 0xde, 0xb7, 0x64, 0x15, 0x95, - 0xf1, 0xcb, 0x13, 0xe7, 0x45, 0xdc, 0xb8, 0xb1, 0x64, 0x44, 0xdc, - 0x4f, 0x7c, 0x7f, 0xbf, 0x7b, 0xe3, 0x5e, 0x12, 0x42, 0x20, 0xb0, - 0xc0, 0x02, 0x0b, 0xec, 0x6c, 0x30, 0xbd, 0x32, 0xf7, 0x4a, 0x28, - 0xb8, 0x1a, 0x73, 0xdb, 0xe8, 0x2c, 0xfb, 0x7f, 0x82, 0x37, 0xf5, - 0x9c, 0x06, 0x5a, 0x60, 0x73, 0x11, 0x4a, 0xf4, 0x3a, 0xfa, 0xbf, - 0x44, 0x8d, 0xff, 0x5b, 0x3d, 0x60, 0x0b, 0xa0, 0x18, 0x00, 0x2d, - 0xb0, 0x26, 0x00, 0x85, 0x9a, 0xb0, 0xcf, 0x66, 0xc0, 0x8d, 0x6c, - 0x30, 0x20, 0x17, 0x40, 0xf8, 0x1d, 0x4b, 0x34, 0x00, 0x68, 0x6e, - 0xe7, 0xa0, 0x02, 0x32, 0xd5, 0xf3, 0x0c, 0xc0, 0x18, 0x00, 0x6d, - 0x4e, 0x82, 0xaa, 0x11, 0x20, 0xa3, 0x1a, 0xd3, 0x65, 0x0b, 0xf9, - 0xeb, 0xd1, 0x05, 0x15, 0x75, 0xae, 0xf7, 0xcb, 0x27, 0x6a, 0x54, - 0x81, 0xd4, 0xa0, 0xe3, 0x07, 0x16, 0x00, 0xed, 0x8c, 0x51, 0x54, - 0xb2, 0x70, 0xaa, 0x15, 0x54, 0x8d, 0x06, 0x2a, 0x35, 0xf1, 0xfa, - 0x34, 0xa3, 0x40, 0x37, 0x1a, 0x56, 0x32, 0xfb, 0x15, 0x8a, 0x69, - 0xd4, 0x60, 0x70, 0x05, 0xe0, 0x0b, 0x80, 0x36, 0x6b, 0xa0, 0x22, - 0xc5, 0xe5, 0x46, 0xe4, 0x21, 0x0f, 0x05, 0x56, 0x0f, 0xe4, 0xfc, - 0xd6, 0x89, 0x3a, 0xae, 0x6d, 0xb3, 0x63, 0x5c, 0x42, 0x61, 0x3b, - 0xe1, 0xf2, 0xff, 0xd4, 0xbb, 0x2c, 0x9b, 0x26, 0x0b, 0x3e, 0x31, - 0x0b, 0xd7, 0x36, 0x00, 0xda, 0xeb, 0x14, 0x5e, 0x24, 0xe1, 0x86, - 0x91, 0x02, 0x50, 0x6a, 0x9d, 0xf7, 0x5a, 0xb6, 0x9e, 0x1f, 0x29, - 0x9c, 0x5b, 0xbd, 0x10, 0x6e, 0x94, 0x02, 0xa3, 0x1a, 0x0b, 0x9c, - 0x4a, 0xec, 0xac, 0x56, 0xa8, 0xd8, 0xd3, 0x6b, 0x81, 0x91, 0xdf, - 0xb1, 0xb9, 0x87, 0xdb, 0xe9, 0xb4, 0x1f, 0xbf, 0x3c, 0xf5, 0x54, - 0x78, 0x38, 0xc1, 0xf0, 0xac, 0x01, 0xdf, 0xd9, 0x08, 0x34, 0x55, - 0xa5, 0x41, 0x92, 0xb0, 0x80, 0x4b, 0x3e, 0xf2, 0x59, 0x2f, 0xb3, - 0x9d, 0xca, 0xbe, 0x6b, 0x85, 0x62, 0xbd, 0x8a, 0xd2, 0x0d, 0xb0, - 0xb3, 0x61, 0xa2, 0xce, 0x3c, 0x2a, 0x8a, 0xaa, 0x96, 0x75, 0x7e, - 0x79, 0x34, 0x8f, 0x3c, 0x2a, 0x40, 0x13, 0x8a, 0xe7, 0xe5, 0xf4, - 0x42, 0x70, 0x4b, 0xf3, 0x52, 0xa8, 0x01, 0xd0, 0xce, 0x40, 0x17, - 0xb1, 0x1e, 0x65, 0x45, 0x35, 0x02, 0x8d, 0x1a, 0xb8, 0x4f, 0x55, - 0x78, 0xd6, 0x0b, 0xbe, 0x7a, 0x94, 0xdc, 0x6c, 0x83, 0x4d, 0x36, - 0x5d, 0x45, 0x55, 0x89, 0x1a, 0xe0, 0xd3, 0x88, 0x34, 0xfb, 0x7a, - 0xd9, 0xe3, 0xab, 0x9c, 0xa7, 0x9b, 0x5b, 0x4d, 0x75, 0x2a, 0xea, - 0x00, 0x68, 0x0a, 0x50, 0x12, 0x35, 0xa8, 0x0b, 0xbf, 0x02, 0xed, - 0x07, 0x1c, 0xaa, 0x03, 0x54, 0xcc, 0x03, 0x2c, 0x2a, 0x80, 0x53, - 0x01, 0x9a, 0xaa, 0x02, 0x54, 0x51, 0x70, 0xf5, 0xac, 0x6b, 0x86, - 0x22, 0x53, 0x8d, 0x4b, 0xc9, 0xaa, 0x23, 0x15, 0xd7, 0x4f, 0x16, - 0x32, 0x42, 0x72, 0x1b, 0x51, 0xc3, 0x7e, 0x54, 0x20, 0x57, 0x8b, - 0xbb, 0xeb, 0xe4, 0xa6, 0x8a, 0x1a, 0x42, 0x02, 0x73, 0x1a, 0x68, - 0x7e, 0x6a, 0xa1, 0x96, 0xc2, 0x2e, 0x03, 0x18, 0xaa, 0x01, 0x68, - 0xaa, 0xeb, 0x64, 0xd2, 0x1a, 0x01, 0xba, 0x7a, 0x21, 0x56, 0x4f, - 0xcd, 0xab, 0x4a, 0x9e, 0x46, 0x34, 0x65, 0x10, 0x75, 0x02, 0x4d, - 0x46, 0x9d, 0x71, 0x87, 0x02, 0x2c, 0x24, 0xe0, 0x21, 0x0b, 0x23, - 0x2e, 0x01, 0x39, 0x21, 0x09, 0x41, 0xaf, 0x63, 0x92, 0xe5, 0x58, - 0x4e, 0xe7, 0xac, 0x0a, 0xa9, 0x46, 0xd7, 0xdc, 0x9e, 0x15, 0x40, - 0x93, 0xa9, 0x9d, 0x53, 0x71, 0xf3, 0xfc, 0xd2, 0x54, 0xd6, 0xcb, - 0x6c, 0xe7, 0xb6, 0xec, 0x96, 0xa7, 0x51, 0xc0, 0x54, 0x01, 0x7d, - 0xbd, 0x95, 0x09, 0xcd, 0xaa, 0x48, 0x68, 0x26, 0xd0, 0xbc, 0xd4, - 0x46, 0xa3, 0xd5, 0x96, 0x97, 0x6a, 0x72, 0xcb, 0xa3, 0x9a, 0xae, - 0x9a, 0xc7, 0x29, 0xff, 0xd4, 0xcb, 0x5d, 0xe5, 0x3c, 0x49, 0xe1, - 0x85, 0x41, 0xa7, 0x53, 0xc1, 0xe9, 0xa7, 0x11, 0x60, 0x2a, 0xe0, - 0x52, 0x2d, 0xf8, 0xa4, 0xb8, 0xae, 0x96, 0x3c, 0xaa, 0xfb, 0xf3, - 0xdb, 0x4e, 0x15, 0x7e, 0x32, 0xea, 0x4e, 0x45, 0xd9, 0x9d, 0x89, - 0x71, 0x35, 0x51, 0x47, 0x5a, 0x2d, 0x6e, 0x96, 0x1f, 0xe4, 0xb8, - 0xc7, 0xbe, 0x65, 0x41, 0x63, 0xcf, 0xeb, 0x97, 0x66, 0xdf, 0x07, - 0x57, 0x84, 0x98, 0xa8, 0x21, 0xbf, 0xd7, 0xf9, 0x93, 0xc3, 0xb2, - 0xd7, 0x3d, 0x98, 0xd5, 0xda, 0x54, 0xfd, 0x34, 0x43, 0x4c, 0x36, - 0xae, 0x54, 0x0b, 0xb4, 0x98, 0x0b, 0x64, 0xbc, 0x00, 0x44, 0x3e, - 0xdb, 0xc8, 0x82, 0x4c, 0x45, 0xf1, 0x35, 0x5a, 0xdd, 0xb9, 0xb9, - 0xd7, 0x24, 0x79, 0xcd, 0x9d, 0xe2, 0x96, 0xcd, 0x6a, 0xbc, 0xab, - 0xaa, 0xd6, 0x54, 0x9a, 0x66, 0xa8, 0xa8, 0xad, 0x46, 0x2a, 0x30, - 0x19, 0xd5, 0xa5, 0x02, 0x34, 0xbf, 0x6d, 0x55, 0xd6, 0x73, 0x17, - 0x40, 0x3a, 0xad, 0x93, 0x85, 0x20, 0x24, 0x5c, 0xd5, 0x59, 0x6b, - 0x2a, 0xa2, 0x9f, 0x06, 0x80, 0xc9, 0x2a, 0x30, 0x2f, 0xf5, 0x62, - 0x2f, 0xe8, 0x4e, 0xf0, 0x62, 0x12, 0x70, 0x52, 0x99, 0x9c, 0xf6, - 0x55, 0x0b, 0x34, 0x6b, 0x49, 0x53, 0x75, 0x9f, 0xa1, 0xb0, 0x5e, - 0xc6, 0x05, 0x55, 0x6d, 0xd2, 0x51, 0x0f, 0xd0, 0xfc, 0xdc, 0x94, - 0x7a, 0x63, 0x64, 0x8d, 0x70, 0x25, 0x9d, 0x00, 0x81, 0x1a, 0x81, - 0x04, 0x05, 0x28, 0x35, 0x62, 0x72, 0x3b, 0x86, 0x17, 0xd8, 0x84, - 0x24, 0x70, 0xdd, 0xd2, 0xc8, 0xe1, 0xda, 0x35, 0x25, 0xf6, 0xa6, - 0x9f, 0x81, 0x10, 0xb3, 0x17, 0x42, 0xbb, 0xda, 0x60, 0x92, 0x00, - 0x62, 0x0a, 0xdb, 0xb0, 0x06, 0x82, 0x4f, 0x55, 0x11, 0xaa, 0xa8, - 0x36, 0x15, 0xc0, 0xc1, 0x27, 0x7d, 0x36, 0x9a, 0x77, 0x34, 0x22, - 0x86, 0xa6, 0xda, 0x18, 0xb6, 0xd6, 0x66, 0x16, 0xaa, 0x2a, 0xab, - 0x16, 0x80, 0x41, 0x41, 0x3d, 0xc9, 0x4c, 0xbc, 0x46, 0xa8, 0xf1, - 0x06, 0xec, 0x4b, 0xe6, 0x9c, 0xfd, 0x62, 0x6c, 0x4e, 0x80, 0x13, - 0x67, 0x0a, 0xd0, 0x64, 0xe2, 0x62, 0xb2, 0xae, 0x17, 0x73, 0x98, - 0x67, 0x92, 0x10, 0x62, 0x1e, 0xdb, 0x31, 0x8f, 0xed, 0xdd, 0xf2, - 0x63, 0x16, 0xa0, 0x67, 0x3d, 0x2e, 0x6a, 0x80, 0x9c, 0x9f, 0xcb, - 0x5a, 0x6b, 0xe5, 0x01, 0x29, 0x42, 0xac, 0xd9, 0xdf, 0x72, 0xaa, - 0x36, 0xc1, 0x90, 0x49, 0x53, 0x8d, 0x79, 0xf9, 0xc5, 0xc2, 0xb8, - 0xa4, 0x22, 0xe3, 0x0a, 0xca, 0x8c, 0x37, 0x00, 0x52, 0xdc, 0x76, - 0x7e, 0xc2, 0x63, 0xde, 0x2d, 0xcd, 0xbe, 0xcc, 0x6a, 0x50, 0x85, - 0x7e, 0xf7, 0xb5, 0x2e, 0xb7, 0x54, 0x6f, 0x22, 0xc4, 0x64, 0x00, - 0xa6, 0xaa, 0x9a, 0x98, 0x07, 0x98, 0xfc, 0xd2, 0x9c, 0xd2, 0xfd, - 0x00, 0x47, 0x35, 0xa6, 0x91, 0xe2, 0xff, 0xd9, 0x58, 0xd7, 0x94, - 0x2c, 0xf7, 0xa0, 0x1a, 0x69, 0x24, 0xa1, 0xff, 0x08, 0x64, 0x79, - 0x73, 0x7a, 0x37, 0xb7, 0x24, 0x4b, 0xa8, 0x9c, 0x2c, 0x8f, 0x20, - 0xd9, 0x1e, 0x59, 0x72, 0xd8, 0xb2, 0x1a, 0x38, 0x54, 0x4e, 0x17, - 0xe5, 0x73, 0x20, 0x97, 0x87, 0x7a, 0xba, 0x78, 0x88, 0xca, 0x16, - 0x53, 0xc7, 0x99, 0x9a, 0xf3, 0xd6, 0x5f, 0xc2, 0x56, 0xc4, 0x84, - 0x65, 0x7f, 0xb2, 0xc1, 0x7c, 0xa1, 0x00, 0x37, 0x37, 0xd0, 0x71, - 0x1b, 0xe4, 0xa0, 0x00, 0x1c, 0xbf, 0x3c, 0xdc, 0x07, 0x56, 0x7e, - 0x70, 0xe3, 0x12, 0xfb, 0xf2, 0x02, 0xa1, 0x4c, 0x8c, 0x4e, 0x06, - 0x6e, 0x62, 0x36, 0x80, 0xa6, 0xda, 0x8c, 0x82, 0x24, 0xd4, 0x8e, - 0x1b, 0x68, 0x64, 0x97, 0x99, 0x47, 0x9a, 0xdb, 0x7a, 0x37, 0x55, - 0xe7, 0x04, 0x38, 0xbb, 0x62, 0xf3, 0x53, 0x8f, 0xf0, 0xf9, 0x5f, - 0xdd, 0x01, 0x4f, 0x16, 0x38, 0x4d, 0xef, 0xa9, 0x34, 0xa7, 0x01, - 0x60, 0x65, 0x44, 0xd0, 0x0c, 0xec, 0x94, 0x96, 0x8a, 0xd0, 0x60, - 0x82, 0x81, 0x43, 0x33, 0x0b, 0xd0, 0x8a, 0x26, 0x34, 0xd3, 0x84, - 0x56, 0x28, 0x42, 0x2b, 0x1a, 0x60, 0x86, 0x09, 0x8d, 0x73, 0x68, - 0x99, 0x9c, 0xd0, 0xf3, 0x05, 0x68, 0x86, 0x01, 0xdd, 0xe0, 0xd0, - 0x0a, 0x05, 0x68, 0xb9, 0x02, 0xb4, 0xa2, 0x01, 0xcd, 0x30, 0xc1, - 0x4c, 0x0e, 0x56, 0x28, 0x40, 0x1f, 0x1a, 0x15, 0xe1, 0x4c, 0x0e, - 0xa1, 0x6c, 0x0e, 0x7a, 0xae, 0x80, 0x90, 0x61, 0x42, 0x2b, 0x16, - 0x11, 0x32, 0x38, 0x34, 0xce, 0x41, 0x99, 0x1c, 0x34, 0x02, 0xc0, - 0x05, 0xa8, 0x50, 0x84, 0x66, 0x7f, 0x50, 0x0c, 0x43, 0x30, 0x2e, - 0x66, 0x84, 0x0e, 0x00, 0x00, 0x21, 0x9d, 0x4c, 0xb2, 0x00, 0x4b, - 0x08, 0x40, 0xd7, 0xc1, 0x43, 0x1a, 0xb8, 0x00, 0x28, 0xa4, 0x83, - 0x47, 0xc2, 0x30, 0x09, 0x40, 0x24, 0x8c, 0x3c, 0x63, 0x10, 0xb1, - 0x08, 0xf2, 0x21, 0x1d, 0x66, 0x32, 0x8e, 0x42, 0x5b, 0x0a, 0xc5, - 0x64, 0x82, 0x8a, 0x1a, 0x81, 0x6b, 0x1a, 0xb8, 0xae, 0xc3, 0x8c, - 0x84, 0x60, 0xc6, 0x22, 0x30, 0x35, 0x0d, 0xa6, 0xae, 0xc1, 0x08, - 0x87, 0x60, 0xc6, 0xa2, 0x64, 0x84, 0x42, 0x30, 0x35, 0x02, 0x0f, - 0xe9, 0x30, 0x23, 0x61, 0x98, 0x1a, 0x2b, 0xe5, 0x09, 0x87, 0x61, - 0x42, 0x07, 0x07, 0x83, 0x09, 0x1d, 0x26, 0x58, 0xb9, 0xb0, 0x89, - 0x19, 0xa8, 0x2b, 0x15, 0x47, 0xb3, 0x0c, 0x4b, 0x6b, 0x0e, 0x2b, - 0x36, 0x85, 0x2f, 0xe4, 0xb8, 0x43, 0x21, 0x97, 0x55, 0x45, 0x70, - 0x80, 0x90, 0x90, 0x54, 0x5c, 0x6e, 0x80, 0xe2, 0x0e, 0xeb, 0xb9, - 0x07, 0xf0, 0x64, 0xf7, 0xc9, 0x2c, 0xff, 0x23, 0xd9, 0x62, 0xa3, - 0xf6, 0x89, 0xe0, 0x5f, 0x1b, 0x2d, 0xad, 0xda, 0xf4, 0x06, 0x83, - 0xcc, 0xad, 0x86, 0xce, 0x4b, 0xd5, 0x30, 0x05, 0x30, 0xd9, 0xe7, - 0xfd, 0x96, 0xc9, 0x63, 0x9f, 0x4c, 0x42, 0xb9, 0x31, 0x45, 0xc5, - 0xe7, 0xfe, 0xbf, 0x52, 0x05, 0x39, 0xd3, 0xbf, 0xd5, 0x67, 0x59, - 0xd2, 0x24, 0x26, 0x34, 0x70, 0x30, 0x70, 0x30, 0x18, 0xd0, 0x72, - 0x39, 0x84, 0x0a, 0x05, 0xe8, 0xd9, 0x02, 0x42, 0x85, 0x02, 0x42, - 0x27, 0x07, 0x45, 0x6c, 0x60, 0x14, 0xc9, 0xf1, 0x34, 0x62, 0x63, - 0x69, 0x11, 0xc9, 0xe5, 0x11, 0x1e, 0x4f, 0x23, 0x9c, 0xce, 0x22, - 0x92, 0xc9, 0x22, 0x7c, 0xfc, 0x94, 0x88, 0x0f, 0x8e, 0x21, 0x91, - 0xc9, 0x22, 0x9a, 0xc9, 0x41, 0x2f, 0x14, 0xa1, 0x1b, 0x86, 0xd0, - 0x72, 0x05, 0x68, 0x65, 0x80, 0x69, 0x06, 0x87, 0x66, 0x18, 0x20, - 0x93, 0x83, 0x38, 0xaf, 0x86, 0xcd, 0xec, 0x58, 0x73, 0x6b, 0xf1, - 0x89, 0x20, 0x34, 0x06, 0xa1, 0x6b, 0x65, 0xe0, 0x95, 0x01, 0x16, - 0x0b, 0xc3, 0xd4, 0x75, 0x98, 0x21, 0x9d, 0xcc, 0x58, 0x14, 0x46, - 0x3c, 0x86, 0x7c, 0x5b, 0x12, 0x93, 0xf3, 0xe7, 0x51, 0xb6, 0xb5, - 0x05, 0xb9, 0x78, 0x04, 0x85, 0xd6, 0x24, 0x0a, 0xb1, 0x18, 0x0a, - 0xa9, 0x38, 0xf2, 0x6d, 0x29, 0xca, 0xb5, 0x26, 0x31, 0x79, 0x4e, - 0x37, 0x26, 0x13, 0x71, 0xca, 0x47, 0x42, 0x30, 0x23, 0x11, 0x14, - 0xa3, 0x61, 0x14, 0xb5, 0x30, 0x8c, 0xd2, 0xab, 0xa3, 0xfc, 0x0a, - 0x61, 0xe0, 0x15, 0xb4, 0xcd, 0x2c, 0xf2, 0xc2, 0x52, 0xf4, 0xed, - 0xf0, 0x53, 0x71, 0x1b, 0xfd, 0x54, 0x96, 0x53, 0x7e, 0xd3, 0x05, - 0x44, 0x32, 0x40, 0xe3, 0x35, 0x6c, 0x23, 0x3c, 0x7e, 0x9d, 0x20, - 0x4d, 0x0e, 0x80, 0x23, 0xc8, 0x7f, 0xb6, 0x55, 0x13, 0xd0, 0x64, - 0xaa, 0xfd, 0xdd, 0x9a, 0x4f, 0xc8, 0x42, 0x8c, 0xf9, 0xa4, 0xb9, - 0x4d, 0x24, 0xb1, 0xad, 0x0c, 0xf8, 0x54, 0x80, 0xc6, 0x2c, 0x6a, - 0x8a, 0xcd, 0x98, 0xd3, 0x20, 0xa0, 0xcd, 0xd0, 0x5a, 0x84, 0x02, - 0x74, 0xe4, 0x11, 0xce, 0xe4, 0x10, 0xce, 0xe4, 0x10, 0xca, 0x64, - 0x11, 0x19, 0x4d, 0x8b, 0x68, 0x09, 0x4a, 0x88, 0xf4, 0x0f, 0x89, - 0xc4, 0xde, 0x23, 0x68, 0x1f, 0x1c, 0x46, 0xcb, 0x58, 0x5a, 0x44, - 0xc6, 0xd3, 0x88, 0x8e, 0xa6, 0x11, 0xc9, 0x64, 0x11, 0x99, 0xcc, - 0x22, 0x94, 0xcb, 0x8b, 0xd0, 0x64, 0x16, 0xa1, 0x7c, 0x11, 0x7a, - 0x36, 0x07, 0x1d, 0x67, 0xdf, 0x18, 0x00, 0x8d, 0xc7, 0xa5, 0x00, - 0x19, 0x26, 0xc8, 0x30, 0xdd, 0x80, 0x2d, 0x94, 0x00, 0x1b, 0xd2, - 0x61, 0x46, 0x23, 0x30, 0xe2, 0x51, 0x14, 0x63, 0x51, 0x14, 0xe3, - 0x11, 0x2a, 0x26, 0xe2, 0x28, 0x24, 0x63, 0xc8, 0xb7, 0xb5, 0x20, - 0x9f, 0x8a, 0x23, 0xd7, 0xd9, 0x46, 0x99, 0x85, 0x3d, 0x18, 0x59, - 0xbe, 0x90, 0xc6, 0x5a, 0x92, 0xc8, 0xb5, 0x24, 0x91, 0x6b, 0x4d, - 0x52, 0x2e, 0x19, 0x47, 0x3e, 0x11, 0x43, 0x21, 0x16, 0x41, 0x21, - 0x14, 0x45, 0x11, 0x11, 0x14, 0x2a, 0xf0, 0x43, 0x19, 0x39, 0x46, - 0xd9, 0x75, 0xe6, 0x16, 0x87, 0x58, 0xf8, 0xaa, 0x2d, 0x2f, 0xc0, - 0x08, 0x0f, 0x28, 0xb9, 0x81, 0xc8, 0x94, 0x48, 0xf3, 0x9a, 0xdc, - 0x8e, 0x61, 0xdd, 0x0f, 0xb3, 0xe4, 0x23, 0x17, 0x77, 0xdd, 0xab, - 0xe6, 0xdb, 0xd5, 0x15, 0xa5, 0xca, 0xa8, 0x4f, 0xde, 0x83, 0xa4, - 0xf8, 0xa9, 0x32, 0x7b, 0xf3, 0x09, 0x37, 0x77, 0x4d, 0x15, 0x54, - 0xf6, 0x49, 0xab, 0x63, 0x5b, 0x52, 0x4c, 0x9b, 0x5e, 0x37, 0x05, - 0x25, 0xcd, 0x72, 0x06, 0x5a, 0x19, 0x56, 0x26, 0x74, 0x18, 0xd0, - 0x50, 0x40, 0x28, 0x9d, 0x41, 0x38, 0x9d, 0x43, 0xe4, 0xe4, 0x80, - 0x48, 0xee, 0x3b, 0x82, 0xce, 0xfe, 0x21, 0x91, 0x1c, 0x1c, 0x45, - 0x62, 0x70, 0x04, 0xc9, 0x5d, 0x87, 0x44, 0xfb, 0x89, 0x53, 0x68, - 0x9b, 0xc8, 0x88, 0x48, 0x7a, 0x12, 0xe1, 0xc9, 0x2c, 0x22, 0xb9, - 0x02, 0x34, 0x21, 0x02, 0x30, 0x9d, 0xed, 0x16, 0xd2, 0x61, 0xc6, - 0xa2, 0x28, 0xb6, 0x24, 0x90, 0x4f, 0xc4, 0xa9, 0xd0, 0xd1, 0x82, - 0xc9, 0x95, 0x4b, 0x30, 0x34, 0xbf, 0x9b, 0x26, 0x7a, 0xda, 0x30, - 0xd9, 0xd5, 0x89, 0xc9, 0x45, 0xbd, 0x34, 0xbc, 0xfc, 0x1c, 0x1a, - 0x4b, 0xc6, 0x91, 0x4f, 0xc6, 0x91, 0x0b, 0x45, 0x51, 0x84, 0x0e, - 0x03, 0x7a, 0x19, 0x73, 0x1c, 0x02, 0x66, 0x19, 0x01, 0x46, 0xa5, - 0xe8, 0xbb, 0xc1, 0x4c, 0x46, 0x71, 0xc9, 0xac, 0xe3, 0x15, 0x67, - 0x7b, 0x26, 0xdc, 0xb8, 0xe4, 0x64, 0x4a, 0x9c, 0x8f, 0x9b, 0xf2, - 0x74, 0x8b, 0xb7, 0x79, 0xbe, 0x85, 0x64, 0x80, 0x26, 0xf3, 0x01, - 0x37, 0xb9, 0x00, 0xcc, 0x0e, 0x07, 0xcd, 0x07, 0x52, 0x9a, 0x0f, - 0xc0, 0x54, 0xf2, 0xaa, 0xc1, 0x6e, 0x4a, 0x65, 0x31, 0x10, 0x74, - 0x00, 0x7a, 0x25, 0x2c, 0xcd, 0x60, 0x40, 0x47, 0x01, 0xa1, 0x53, - 0x83, 0x48, 0xf5, 0x0f, 0x89, 0xd4, 0xa9, 0x51, 0x24, 0x0f, 0x1f, - 0x13, 0xad, 0xaf, 0xec, 0x41, 0xef, 0xf1, 0x01, 0xd1, 0xda, 0x3f, - 0x8c, 0xc4, 0xd0, 0x28, 0x12, 0x63, 0x13, 0x22, 0x3a, 0x96, 0x46, - 0x64, 0x7c, 0x02, 0x51, 0x11, 0x28, 0xa8, 0xc0, 0x14, 0x2d, 0x16, - 0x45, 0xb1, 0xb5, 0xac, 0xe8, 0xda, 0x5b, 0x91, 0xed, 0xe9, 0x40, - 0xba, 0xab, 0x83, 0x26, 0x57, 0x2f, 0x45, 0xff, 0x9a, 0xe5, 0x34, - 0xd4, 0xdd, 0x8e, 0x74, 0x57, 0x3b, 0xa5, 0x17, 0x74, 0x63, 0x3c, - 0x92, 0x44, 0x0e, 0x3a, 0x0c, 0x30, 0x98, 0x65, 0x55, 0x27, 0x60, - 0x80, 0xca, 0x08, 0x71, 0x72, 0x7a, 0xeb, 0x81, 0x96, 0xe9, 0x91, - 0x5f, 0x65, 0x9d, 0x69, 0x3b, 0x27, 0x53, 0xc2, 0x3d, 0xf5, 0xaa, - 0xa4, 0xa9, 0x82, 0x9a, 0x17, 0xd0, 0x54, 0x02, 0xfd, 0x5e, 0x71, - 0x2a, 0x3f, 0x20, 0x59, 0x7f, 0x9d, 0xe6, 0xdd, 0x96, 0xfd, 0x00, - 0xe7, 0x9c, 0x46, 0x60, 0x65, 0x68, 0x09, 0x68, 0xe5, 0x38, 0x16, - 0x81, 0x50, 0x40, 0xb8, 0x50, 0x72, 0xf3, 0xe2, 0x07, 0x8f, 0x89, - 0xb6, 0x3f, 0xec, 0x17, 0xbd, 0x47, 0x4e, 0xa2, 0xf5, 0xd8, 0x29, - 0xb4, 0x1e, 0xeb, 0x17, 0xa9, 0x13, 0x03, 0x48, 0x1d, 0x38, 0x26, - 0xda, 0x47, 0x26, 0x10, 0x17, 0x3c, 0x80, 0x55, 0x60, 0xa7, 0xc7, - 0xa2, 0x61, 0x14, 0x17, 0xf6, 0xd2, 0xd8, 0x92, 0x05, 0x18, 0x9b, - 0xdf, 0x85, 0xf1, 0x73, 0xba, 0x69, 0x7c, 0x51, 0x0f, 0xc6, 0x96, - 0x2d, 0xa4, 0xc1, 0xf5, 0x7d, 0x34, 0xd0, 0xd9, 0x86, 0xc9, 0x64, - 0x12, 0x59, 0xc4, 0x90, 0x07, 0x81, 0x97, 0x95, 0x9d, 0x80, 0x09, - 0x82, 0x31, 0x03, 0x74, 0x66, 0x1d, 0xf0, 0xaa, 0xe7, 0xd7, 0x4f, - 0xe1, 0x09, 0x97, 0xca, 0x0f, 0x3f, 0xb0, 0x89, 0x5a, 0x81, 0xe6, - 0x57, 0x3b, 0xe9, 0xa5, 0x9e, 0x34, 0x0f, 0x70, 0xe9, 0x0e, 0xeb, - 0x75, 0x1f, 0x80, 0x79, 0x83, 0x8e, 0x55, 0xdc, 0x44, 0x2a, 0xbb, - 0x88, 0x0c, 0x45, 0x84, 0x26, 0xc7, 0x10, 0x3f, 0x78, 0x4c, 0x74, - 0x1e, 0x3d, 0x85, 0xd6, 0x43, 0xc7, 0x45, 0xdb, 0xc1, 0xe3, 0xe8, - 0x78, 0xf9, 0x35, 0xd1, 0xbb, 0xf7, 0x30, 0xe6, 0x0d, 0x8e, 0x8a, - 0xf8, 0xc8, 0x18, 0xe2, 0x41, 0xd1, 0x09, 0xec, 0xf5, 0x66, 0xf1, - 0x28, 0x0a, 0xf3, 0xda, 0x91, 0x99, 0xdf, 0x45, 0x63, 0x17, 0xaf, - 0xc5, 0x89, 0xbe, 0xc5, 0x34, 0xb4, 0x74, 0x3e, 0x8d, 0x2e, 0xea, - 0xc5, 0xc8, 0xe2, 0xf9, 0x34, 0xda, 0xdb, 0x83, 0x31, 0x84, 0x51, - 0x80, 0x06, 0xa3, 0x1c, 0xb3, 0x03, 0xcc, 0xb2, 0xba, 0x13, 0x8e, - 0x10, 0x73, 0x52, 0x5a, 0xa6, 0x0b, 0xa0, 0x0c, 0x5b, 0x9a, 0xe9, - 0x92, 0xd7, 0x94, 0x50, 0x70, 0x6e, 0x8a, 0x0d, 0xf0, 0x6e, 0xb8, - 0x2b, 0xdc, 0x80, 0x26, 0x0b, 0x33, 0xe6, 0x01, 0x33, 0x27, 0x88, - 0x59, 0x27, 0xdd, 0x65, 0x99, 0xd9, 0xd2, 0xbc, 0xf6, 0x31, 0x7d, - 0x1c, 0x02, 0x83, 0x06, 0x42, 0xa8, 0xbc, 0x15, 0x87, 0x66, 0x8c, - 0x23, 0x3e, 0x38, 0x82, 0xd4, 0x91, 0x53, 0xa2, 0x75, 0xef, 0x61, - 0x74, 0xfe, 0xf6, 0x25, 0xb1, 0x64, 0xf7, 0x61, 0xd1, 0xb5, 0xe7, - 0xa0, 0xe8, 0x3c, 0x72, 0x12, 0xed, 0x3c, 0x50, 0x5a, 0x81, 0xcd, - 0x11, 0x6b, 0x6f, 0x41, 0x66, 0xcd, 0x32, 0x1a, 0x58, 0xb6, 0x10, - 0x23, 0x17, 0xaf, 0xa5, 0xa3, 0x17, 0xae, 0xa5, 0x13, 0x4b, 0xe6, - 0xd3, 0x68, 0x6f, 0x27, 0xc6, 0x93, 0x6d, 0x48, 0x23, 0x8c, 0x02, - 0x38, 0x80, 0x02, 0xc8, 0xe2, 0xc4, 0x72, 0x17, 0x20, 0xf1, 0x4a, - 0x35, 0x86, 0x33, 0xac, 0x0c, 0xc9, 0x34, 0xa7, 0x7d, 0x0b, 0x07, - 0xf7, 0xd7, 0x2b, 0xbe, 0x66, 0x85, 0x9a, 0x23, 0xd0, 0x54, 0x61, - 0xe6, 0xe4, 0xe6, 0xb9, 0xc1, 0x4b, 0xb7, 0xa5, 0x79, 0x2d, 0x3b, - 0x41, 0x6f, 0x5a, 0x6f, 0x4d, 0xc5, 0xba, 0x42, 0xe5, 0x38, 0x57, - 0x0e, 0xd1, 0xe1, 0x51, 0x24, 0x5f, 0xdd, 0x27, 0xba, 0xb7, 0xed, - 0x14, 0x8b, 0x5e, 0x7e, 0x55, 0xf4, 0x6e, 0xdb, 0x81, 0xc5, 0x27, - 0x06, 0x44, 0xcb, 0xd8, 0x04, 0xa2, 0xc1, 0x23, 0x1d, 0x58, 0x60, - 0x33, 0x2d, 0x1c, 0x86, 0xd1, 0xdb, 0x89, 0xf4, 0x9a, 0xe5, 0xd4, - 0x7f, 0xf9, 0x05, 0x74, 0xe4, 0xdc, 0x15, 0x74, 0xf2, 0xb2, 0x73, - 0xe9, 0xe8, 0xfc, 0x2e, 0x8c, 0x85, 0x12, 0xc8, 0x42, 0x47, 0x11, - 0x26, 0x84, 0x45, 0xc9, 0xb9, 0x29, 0x30, 0x27, 0x68, 0x19, 0x96, - 0x65, 0xb7, 0x5f, 0xfb, 0x76, 0x4e, 0x6e, 0xa9, 0xa9, 0xa0, 0xd6, - 0xe0, 0x05, 0x34, 0xa7, 0x56, 0xe8, 0x5e, 0x31, 0x32, 0x37, 0x10, - 0xe9, 0x36, 0xa0, 0x39, 0x4d, 0x1a, 0x50, 0xd1, 0x56, 0xce, 0x00, - 0x64, 0x60, 0x08, 0x97, 0x73, 0x15, 0x11, 0x1a, 0x1b, 0x42, 0xcb, - 0xc1, 0xe3, 0xa2, 0x73, 0xfb, 0x2e, 0xcc, 0xff, 0xb7, 0xad, 0x7c, - 0xc5, 0xab, 0x07, 0xd1, 0x7d, 0xe8, 0xb8, 0x68, 0x3b, 0x35, 0x84, - 0x54, 0xf0, 0xa8, 0x06, 0x16, 0x58, 0x6d, 0x96, 0x8c, 0xa3, 0x70, - 0x4e, 0x0f, 0x8d, 0xad, 0x58, 0x8c, 0xc1, 0xcb, 0xcf, 0xa7, 0x43, - 0x57, 0x5e, 0x42, 0x07, 0x57, 0x2c, 0xa4, 0xa1, 0x05, 0xdd, 0x18, - 0xa5, 0x24, 0x32, 0x30, 0x21, 0x50, 0x28, 0x03, 0x4e, 0x54, 0x41, - 0xc9, 0xb0, 0xcd, 0x3b, 0x2d, 0x1b, 0x2e, 0xeb, 0x9d, 0xe0, 0xe8, - 0x04, 0x35, 0xaf, 0xd8, 0x9a, 0x2f, 0xd0, 0x54, 0x5d, 0x4c, 0x2f, - 0x50, 0x59, 0xa7, 0x90, 0x6d, 0xbe, 0x3a, 0x1f, 0x41, 0x43, 0x08, - 0x84, 0x30, 0x04, 0x4c, 0x84, 0xb2, 0xe3, 0x25, 0xf5, 0xf5, 0xd4, - 0xf3, 0x62, 0xc5, 0x6f, 0x5e, 0x10, 0xcb, 0x5e, 0xd8, 0x29, 0x16, - 0x9e, 0x18, 0x40, 0x4b, 0xd0, 0xec, 0x21, 0xb0, 0xc0, 0x9a, 0x6b, - 0x2d, 0x49, 0xe4, 0x56, 0x2e, 0xa1, 0x81, 0xb7, 0x5d, 0x46, 0xfb, - 0xae, 0xb8, 0x88, 0x0e, 0x6d, 0xb8, 0x90, 0x0e, 0xce, 0xeb, 0xc4, - 0x38, 0xa2, 0xc8, 0x96, 0x01, 0x47, 0x30, 0x7d, 0xc1, 0x55, 0xf4, - 0x59, 0x76, 0x02, 0xa0, 0x5b, 0x25, 0x85, 0x6b, 0x4d, 0xa8, 0x0a, - 0xd0, 0xbc, 0x5c, 0x4c, 0x27, 0x05, 0x16, 0xb2, 0xfc, 0x7a, 0xcd, - 0x4f, 0x2f, 0x97, 0x54, 0x18, 0x21, 0x04, 0x42, 0x1e, 0xd1, 0x3d, - 0xfb, 0x45, 0xef, 0xd3, 0xcf, 0xa1, 0xef, 0xa7, 0xbf, 0xe6, 0x6b, - 0x77, 0xec, 0x45, 0xef, 0x81, 0xa3, 0xa2, 0x23, 0x00, 0x58, 0x60, - 0x5e, 0xa6, 0x31, 0xc0, 0xe4, 0xcd, 0x3d, 0x06, 0x51, 0xe9, 0x33, - 0xad, 0xb9, 0x6a, 0x5d, 0xed, 0x48, 0xaf, 0x5a, 0x4a, 0x83, 0x57, - 0xbe, 0x81, 0xf6, 0xff, 0xc9, 0x9b, 0xe9, 0xb5, 0x4b, 0xd6, 0xd1, - 0x91, 0x68, 0x07, 0xc6, 0x21, 0x60, 0x22, 0x0f, 0xc0, 0xa8, 0x54, - 0x12, 0x58, 0xc1, 0x55, 0xb0, 0xcc, 0x5b, 0x7f, 0xed, 0xf3, 0x76, - 0xb5, 0x67, 0x3a, 0xb8, 0xa1, 0x6e, 0x1f, 0xde, 0x57, 0x01, 0x4d, - 0x36, 0x66, 0xe6, 0x14, 0xbc, 0xd7, 0x5d, 0x60, 0x65, 0x9f, 0xc2, - 0x33, 0x96, 0x19, 0x74, 0x44, 0x40, 0xd0, 0x41, 0xc5, 0x71, 0xa4, - 0x5e, 0xd8, 0x21, 0x96, 0xfc, 0xe4, 0x19, 0xb1, 0xee, 0x77, 0x2f, - 0x8b, 0xa5, 0xcf, 0x6d, 0x17, 0x8b, 0xb3, 0x79, 0x84, 0x82, 0x62, - 0x1a, 0x98, 0xac, 0xad, 0x5c, 0x4c, 0xf8, 0xf2, 0xdd, 0x0c, 0xcc, - 0xda, 0x73, 0x3e, 0xa6, 0x03, 0x26, 0x79, 0x03, 0xf8, 0xe4, 0x46, - 0x8e, 0x83, 0xc7, 0x9d, 0x89, 0xc4, 0x08, 0x78, 0xe8, 0x6e, 0x0d, - 0xcb, 0x96, 0x95, 0x8b, 0xd7, 0x0c, 0x92, 0x01, 0xa1, 0x30, 0x70, - 0xf3, 0xbd, 0x1c, 0x3b, 0xf7, 0x06, 0x83, 0x96, 0x4f, 0xd9, 0xaa, - 0xa5, 0x34, 0xb0, 0xe1, 0x22, 0x3a, 0xf0, 0xd6, 0xcb, 0x68, 0xef, - 0x3b, 0xdf, 0x44, 0xaf, 0x75, 0xf6, 0x62, 0x08, 0x0c, 0x05, 0xe4, - 0x40, 0x96, 0xfa, 0xd4, 0x82, 0x05, 0x5a, 0xd6, 0xf9, 0xa9, 0x65, - 0xc3, 0xf2, 0x6b, 0x38, 0x40, 0xcd, 0x80, 0x7b, 0x33, 0x8f, 0xca, - 0x24, 0x0b, 0x34, 0xb7, 0x78, 0x99, 0x55, 0x99, 0xb9, 0x81, 0x2b, - 0xec, 0x38, 0x1f, 0x02, 0x43, 0x04, 0x84, 0x0c, 0x92, 0x5b, 0xb7, - 0x8b, 0x65, 0x4f, 0x3c, 0x2b, 0xd6, 0x3c, 0xfe, 0xa4, 0xb8, 0x60, - 0xe7, 0x1e, 0x31, 0x3f, 0x78, 0x44, 0x02, 0xab, 0x47, 0x3d, 0x3d, - 0x74, 0xb7, 0x86, 0x8f, 0x7d, 0x92, 0x80, 0x31, 0x87, 0x0c, 0x09, - 0xe0, 0x5f, 0xbf, 0x2b, 0x70, 0xfd, 0xdf, 0x9a, 0x8e, 0xdb, 0xbf, - 0xf7, 0x2a, 0xc2, 0x0f, 0xbf, 0xa9, 0x4d, 0xeb, 0x01, 0xab, 0xa5, - 0x80, 0x1f, 0x7d, 0x5f, 0xe0, 0xba, 0xbf, 0x31, 0x51, 0x28, 0x06, - 0xd7, 0xda, 0xc9, 0xba, 0x3b, 0x90, 0x7e, 0xfb, 0x9b, 0xd8, 0xab, - 0x7f, 0x7a, 0x15, 0xed, 0xbc, 0xea, 0x52, 0xda, 0x3d, 0xef, 0x1c, - 0x0c, 0xa0, 0x08, 0x8e, 0x3c, 0x04, 0x44, 0x05, 0x5e, 0x05, 0x0b, - 0xc8, 0x0a, 0x2e, 0x90, 0x2b, 0xba, 0xc4, 0xd9, 0x3c, 0xdd, 0x4f, - 0x19, 0xa0, 0x4d, 0xc5, 0xcc, 0x9c, 0x9a, 0x61, 0xd8, 0x5d, 0xcc, - 0xb0, 0xcb, 0x14, 0x01, 0xca, 0x11, 0xb1, 0x08, 0x18, 0x34, 0x68, - 0x47, 0x0f, 0x63, 0xfe, 0x4f, 0x9e, 0xe6, 0xe7, 0x7f, 0xe7, 0xc7, - 0xe2, 0x8d, 0x5b, 0x5f, 0x16, 0xcb, 0x82, 0x47, 0x21, 0xb0, 0x46, - 0x59, 0x6b, 0x12, 0xd8, 0xf6, 0x7d, 0x0d, 0xab, 0x56, 0x11, 0x90, - 0xab, 0x56, 0x69, 0x82, 0x01, 0x1b, 0x6e, 0x30, 0xb1, 0x75, 0xfb, - 0x4c, 0x95, 0x95, 0x88, 0x03, 0x2f, 0x7e, 0x5f, 0xc3, 0xea, 0x35, - 0x0e, 0xdb, 0x45, 0x80, 0x63, 0x47, 0x81, 0xf3, 0xde, 0x67, 0x60, - 0x64, 0x3c, 0xb8, 0xc6, 0x32, 0xb6, 0xa0, 0x1b, 0xa3, 0xd7, 0x5c, - 0xcd, 0xb6, 0x7f, 0xe8, 0x3d, 0xb4, 0xed, 0xd2, 0x73, 0xe9, 0x00, - 0x62, 0x48, 0x23, 0x03, 0x02, 0x9f, 0x01, 0xb3, 0x7c, 0x19, 0x5e, - 0x79, 0x17, 0xb8, 0x39, 0xa9, 0x35, 0x57, 0xa8, 0x79, 0x01, 0xcd, - 0xad, 0x46, 0x53, 0x77, 0x71, 0x33, 0xad, 0x4a, 0x2c, 0x62, 0x99, - 0xc2, 0x20, 0x84, 0x11, 0x05, 0x03, 0x10, 0xfe, 0xfd, 0x0e, 0xb1, - 0xfc, 0x5f, 0x1e, 0x11, 0x57, 0x3d, 0xfe, 0xff, 0xf8, 0x1b, 0xc6, - 0x26, 0x82, 0x06, 0xac, 0x81, 0x35, 0xc7, 0x36, 0x5c, 0x48, 0xf8, - 0xcd, 0xf7, 0x34, 0x90, 0x93, 0xd2, 0x8a, 0x03, 0xcf, 0x6f, 0x13, - 0xd8, 0xf0, 0x21, 0x13, 0x45, 0x63, 0x3a, 0xf9, 0xb6, 0x0f, 0x32, - 0x7c, 0xe9, 0x7e, 0x06, 0x8c, 0x57, 0x43, 0x10, 0x61, 0xe0, 0xbd, - 0x1f, 0x37, 0xf1, 0xa3, 0xa7, 0x03, 0x57, 0xb3, 0x16, 0x7b, 0xf3, - 0x1b, 0x68, 0xf7, 0x2d, 0x7f, 0xc1, 0x7e, 0xf5, 0x67, 0x6f, 0xa5, - 0x97, 0xc2, 0x29, 0x8c, 0x21, 0x0b, 0xc0, 0x84, 0x61, 0x01, 0x59, - 0xde, 0x32, 0x5f, 0x70, 0x50, 0x6a, 0x45, 0x97, 0x78, 0x1a, 0x77, - 0x53, 0x68, 0xf6, 0xf6, 0x67, 0x4e, 0xdf, 0x60, 0x3a, 0xc5, 0xcc, - 0x42, 0x0e, 0xea, 0x2c, 0x5a, 0x01, 0x5a, 0x04, 0x0c, 0x84, 0xf0, - 0x73, 0x2f, 0x8a, 0xb5, 0xff, 0xf8, 0x75, 0xfe, 0x27, 0x3f, 0xff, - 0xb5, 0x38, 0x2f, 0x5f, 0x9c, 0x5b, 0x71, 0xb1, 0x68, 0x34, 0x0a, - 0xc6, 0x18, 0x4c, 0xd3, 0x44, 0x3e, 0x9f, 0x97, 0xce, 0x2f, 0x84, - 0x40, 0x36, 0x9b, 0x6d, 0xca, 0x39, 0xc5, 0xe3, 0x71, 0x44, 0xa3, - 0x51, 0x14, 0x8b, 0x45, 0x18, 0x86, 0x01, 0xd3, 0x2c, 0xb9, 0x60, - 0x9a, 0x56, 0xea, 0xce, 0x4c, 0xd7, 0x75, 0x70, 0xce, 0x31, 0x39, - 0x39, 0xd9, 0x90, 0xe3, 0xa5, 0x52, 0x29, 0x68, 0x9a, 0x36, 0xe3, - 0x58, 0xa6, 0x69, 0x82, 0x73, 0x0e, 0x4d, 0xd3, 0xc0, 0x18, 0xab, - 0x1c, 0x57, 0xd7, 0x75, 0x64, 0x32, 0x19, 0xa9, 0x6b, 0xe5, 0x65, - 0x5f, 0xbc, 0x83, 0xe1, 0xce, 0x5b, 0x19, 0x30, 0xe1, 0xb0, 0x32, - 0x09, 0xdc, 0x74, 0x3b, 0xc7, 0xb7, 0x7e, 0x54, 0xa2, 0xdd, 0xc2, - 0x1e, 0xe0, 0xc5, 0xc7, 0x75, 0x74, 0x77, 0x39, 0xc4, 0xce, 0x5a, - 0x80, 0x6f, 0x7c, 0x8b, 0xe3, 0xa3, 0xf7, 0xf0, 0x80, 0x4c, 0x75, - 0xda, 0xb9, 0x2b, 0xe9, 0xd8, 0x2d, 0x37, 0xb2, 0x7f, 0xfb, 0x8b, - 0xf7, 0xd0, 0x6f, 0x13, 0xed, 0x18, 0xc6, 0x24, 0x50, 0x6e, 0x08, - 0x92, 0x47, 0x49, 0x17, 0xdb, 0x95, 0x9b, 0x75, 0x32, 0x3d, 0x94, - 0x9a, 0x2b, 0xd0, 0xbc, 0x2a, 0x02, 0xa6, 0x26, 0x7b, 0xf0, 0x3f, - 0x5c, 0x51, 0x63, 0xa5, 0xdf, 0x28, 0x08, 0x11, 0x24, 0xc1, 0xf7, - 0xef, 0xc1, 0xd2, 0xbb, 0x37, 0xf3, 0x0f, 0x3c, 0xfa, 0x33, 0xfe, - 0x9f, 0xe6, 0x6a, 0x0d, 0xe5, 0x6d, 0xb7, 0xdd, 0x86, 0xdb, 0x6f, - 0xbf, 0x1d, 0xe9, 0x74, 0x1a, 0xd7, 0x5f, 0x7f, 0x3d, 0x76, 0xec, - 0xd8, 0xe1, 0x99, 0xff, 0xa6, 0x9b, 0x6e, 0xc2, 0x17, 0xbe, 0xf0, - 0x05, 0xfc, 0xe0, 0x07, 0x3f, 0xc0, 0x1d, 0x77, 0xdc, 0xd1, 0x94, - 0x73, 0xfa, 0xf8, 0xc7, 0x3f, 0x8e, 0x8d, 0x1b, 0x37, 0xa2, 0x50, - 0x28, 0xc0, 0x34, 0x4d, 0x68, 0x9a, 0x56, 0x01, 0x8b, 0x69, 0x9a, - 0x60, 0x8c, 0x61, 0xcb, 0x96, 0x2d, 0xb8, 0xf9, 0xe6, 0x9b, 0x1b, - 0x72, 0xbc, 0x07, 0x1f, 0x7c, 0x10, 0xd7, 0x5e, 0x7b, 0x2d, 0x84, - 0x10, 0xe0, 0x9c, 0x83, 0x73, 0x8e, 0x6c, 0x36, 0x0b, 0xd3, 0x34, - 0xa1, 0xeb, 0x3a, 0xe2, 0xf1, 0x92, 0x58, 0x67, 0x8c, 0x81, 0x88, - 0x70, 0xfd, 0xf5, 0xd7, 0xe3, 0xa9, 0xa7, 0x9e, 0xaa, 0xeb, 0x98, - 0xe1, 0x10, 0xf0, 0xfc, 0xf7, 0x35, 0x9c, 0x7f, 0x01, 0x01, 0x19, - 0xfb, 0x4a, 0xe0, 0xe4, 0x49, 0xe0, 0x82, 0x6b, 0x0c, 0x9c, 0x1a, - 0x06, 0x1e, 0xbc, 0x4b, 0xc3, 0x27, 0x3e, 0x4a, 0xd5, 0xea, 0x2c, - 0x0a, 0xec, 0xde, 0x0d, 0xbc, 0xf1, 0x06, 0x03, 0x63, 0x13, 0x01, - 0x90, 0x1a, 0x65, 0x6b, 0x97, 0xd3, 0xd1, 0xfb, 0xff, 0x9a, 0x3d, - 0xf6, 0xbe, 0x77, 0xd0, 0xef, 0xc0, 0x51, 0x44, 0x1e, 0x26, 0x08, - 0x39, 0x8b, 0x52, 0xcb, 0x7b, 0xb8, 0x9f, 0xf6, 0x2f, 0x0b, 0x2a, - 0x50, 0x93, 0xed, 0xd8, 0x4f, 0xa6, 0x82, 0x60, 0x5a, 0xb9, 0xe9, - 0x60, 0x88, 0xc3, 0xfc, 0xf2, 0x37, 0xf8, 0xbb, 0x2f, 0xbb, 0xce, - 0xfc, 0xfb, 0x47, 0x7e, 0xca, 0x37, 0xcc, 0xe5, 0xe6, 0x16, 0xd1, - 0x68, 0x14, 0x4b, 0x96, 0x2c, 0xc1, 0xfa, 0xf5, 0xeb, 0xf1, 0xc3, - 0x1f, 0xfe, 0x10, 0x8b, 0x16, 0x2d, 0xf2, 0xcc, 0x6f, 0x9a, 0x26, - 0x96, 0x2c, 0x59, 0x82, 0x48, 0x24, 0xd2, 0xb4, 0x73, 0xca, 0xe5, - 0x72, 0xe8, 0xe9, 0xe9, 0xc1, 0xa2, 0x45, 0x8b, 0xb0, 0x74, 0xe9, - 0x52, 0x68, 0x9a, 0x86, 0xf1, 0xf1, 0x71, 0xe4, 0xf3, 0x79, 0xc4, - 0xe3, 0x71, 0xf4, 0xf6, 0xf6, 0xa2, 0xb3, 0xb3, 0xb3, 0x61, 0xc7, - 0x6b, 0x6b, 0x6b, 0x43, 0x2a, 0x95, 0x42, 0x3e, 0x9f, 0xc7, 0xc8, - 0xc8, 0x08, 0x88, 0x08, 0x7d, 0x7d, 0x7d, 0x58, 0xb5, 0x6a, 0x15, - 0x96, 0x2f, 0x5f, 0x8e, 0x89, 0x89, 0x09, 0x8c, 0x8f, 0x8f, 0xc3, - 0x34, 0x4d, 0xcc, 0x9b, 0x37, 0x0f, 0xd1, 0x68, 0xfd, 0x1f, 0x77, - 0x14, 0x8a, 0xc0, 0x27, 0x36, 0x72, 0x14, 0x26, 0xcb, 0x4f, 0xe7, - 0x8c, 0x95, 0x40, 0xef, 0x32, 0xe0, 0x96, 0x1b, 0x18, 0x56, 0x2d, - 0x25, 0xdc, 0xf4, 0x7e, 0x02, 0x26, 0x1d, 0x5c, 0x4d, 0x0e, 0xdc, - 0x72, 0xbf, 0x19, 0xc0, 0xac, 0xc1, 0xf6, 0xea, 0x7e, 0xb1, 0xf0, - 0x9a, 0x4f, 0x99, 0x77, 0x7c, 0xe0, 0x53, 0xe6, 0xed, 0x03, 0xc3, - 0x68, 0x47, 0x12, 0x26, 0xaa, 0x1b, 0xd7, 0xdb, 0xbf, 0xdf, 0x76, - 0xea, 0x93, 0xd0, 0xca, 0x28, 0xcf, 0x9e, 0x4a, 0x65, 0xfa, 0xc2, - 0xaf, 0xfe, 0xd4, 0x29, 0x04, 0xe4, 0x0b, 0x08, 0xff, 0xe5, 0xa7, - 0xf9, 0xa7, 0x6e, 0xb9, 0x8f, 0xff, 0xd5, 0xe0, 0xa8, 0x68, 0x9d, - 0xeb, 0x37, 0xcf, 0xea, 0x36, 0xae, 0x58, 0xb1, 0x02, 0x5b, 0xb6, - 0x6c, 0x41, 0x5b, 0x5b, 0x9b, 0x6b, 0xfe, 0xb1, 0xb1, 0xb1, 0x19, - 0xbf, 0xcd, 0xb0, 0xe1, 0xe1, 0xe1, 0x2a, 0xc5, 0xb6, 0x76, 0xed, - 0x5a, 0xf4, 0xf5, 0xf5, 0x61, 0xf9, 0xf2, 0xe5, 0x58, 0xb1, 0x62, - 0x05, 0xee, 0xbc, 0xf3, 0xce, 0x86, 0x1d, 0xef, 0xb3, 0x9f, 0xfd, - 0x2c, 0x56, 0xac, 0x58, 0x81, 0xbe, 0xbe, 0x3e, 0xac, 0x5b, 0xb7, - 0x0e, 0x9f, 0xf9, 0xcc, 0x67, 0x66, 0xc0, 0xf5, 0x1d, 0xef, 0x78, - 0x07, 0x56, 0xaf, 0x5e, 0x8d, 0xbe, 0xbe, 0x3e, 0xac, 0x5c, 0xb9, - 0x12, 0x5b, 0xb7, 0x6e, 0x6d, 0xc8, 0x71, 0xb7, 0xfe, 0x5e, 0xe0, - 0x8b, 0x5f, 0xe3, 0x40, 0xd2, 0x61, 0x65, 0x1a, 0xb8, 0xf5, 0x46, - 0x86, 0x1f, 0xfc, 0x93, 0x86, 0x48, 0xb4, 0xfc, 0xbe, 0xb7, 0xb9, - 0xa5, 0xff, 0xfd, 0xeb, 0x1c, 0x4f, 0x6e, 0x0d, 0xe2, 0x66, 0xcd, - 0xb2, 0xc7, 0x7e, 0x21, 0x36, 0xbc, 0xe5, 0x83, 0xc6, 0xbd, 0xcf, - 0x3d, 0x2f, 0xd6, 0x21, 0x85, 0x02, 0xaa, 0x3f, 0x81, 0x74, 0xeb, - 0x65, 0xda, 0xb1, 0x8f, 0x46, 0xd5, 0xae, 0x97, 0xbd, 0x7b, 0xd9, - 0xd0, 0x40, 0x06, 0x87, 0xf6, 0xc1, 0x3b, 0xcd, 0x3b, 0xbe, 0xb9, - 0x85, 0x5f, 0x1d, 0xdc, 0xae, 0x92, 0xd9, 0x63, 0x41, 0x17, 0x5f, - 0x7c, 0x31, 0x1e, 0x7b, 0xec, 0x31, 0xc4, 0x62, 0x31, 0x69, 0x10, - 0x36, 0xda, 0xd2, 0xe9, 0xf4, 0x8c, 0xe5, 0x4c, 0x26, 0x53, 0x51, - 0x87, 0xa3, 0xa3, 0xa3, 0xd8, 0xbf, 0x7f, 0x3f, 0x8e, 0x1c, 0x39, - 0xd2, 0xb0, 0xe3, 0x1d, 0x3a, 0x74, 0x08, 0xc7, 0x8e, 0x1d, 0x43, - 0xb1, 0x58, 0x0a, 0x50, 0x15, 0x0a, 0x85, 0xca, 0x3a, 0xce, 0x79, - 0x25, 0xae, 0x96, 0xcd, 0x66, 0xb1, 0x6f, 0xdf, 0x3e, 0x8c, 0x8c, - 0x8c, 0x34, 0xec, 0xd8, 0xf7, 0x7f, 0x9d, 0x63, 0xdb, 0xb3, 0x40, - 0x55, 0x15, 0x94, 0x09, 0xb4, 0xb5, 0x01, 0xeb, 0xd7, 0x96, 0x1d, - 0x1c, 0x9b, 0xab, 0xb9, 0x6b, 0x07, 0xb0, 0xf1, 0x2b, 0x41, 0xdc, - 0xac, 0xe9, 0x6a, 0xed, 0x00, 0x16, 0xbf, 0xfb, 0x13, 0xe6, 0x5d, - 0x5b, 0xb7, 0x8a, 0xf3, 0x10, 0x47, 0x11, 0xee, 0x1d, 0xb4, 0x7a, - 0x8d, 0x9a, 0xe6, 0x09, 0x34, 0x99, 0xb1, 0x01, 0xaa, 0xfb, 0x19, - 0x8b, 0xc0, 0xf8, 0xbb, 0x2f, 0xf2, 0x0f, 0xff, 0x9f, 0x5f, 0x8a, - 0x2b, 0x83, 0xdb, 0xe4, 0x6d, 0x57, 0x5f, 0x7d, 0x35, 0xbe, 0xf1, - 0x8d, 0x6f, 0x40, 0xd7, 0xab, 0x7b, 0x41, 0x9f, 0x82, 0x4b, 0x2e, - 0x97, 0x6b, 0xaa, 0xcb, 0x69, 0x77, 0x73, 0x67, 0xd3, 0x84, 0xad, - 0xa9, 0xfd, 0x54, 0xa5, 0x40, 0x53, 0x14, 0x72, 0x0e, 0xb8, 0x75, - 0x93, 0x89, 0x42, 0xd6, 0xc1, 0xf5, 0x34, 0xcb, 0x51, 0x1a, 0xdb, - 0xb8, 0xf3, 0x42, 0x00, 0x7f, 0xfd, 0x0f, 0x26, 0xc6, 0xd3, 0xc1, - 0xb3, 0x3a, 0x1b, 0x36, 0x38, 0x8a, 0xf6, 0x1b, 0xef, 0xe4, 0x7f, - 0x3b, 0xd4, 0x8f, 0x0e, 0x84, 0x2a, 0xdd, 0x74, 0xfb, 0x8d, 0xcc, - 0x56, 0xc5, 0x2a, 0xbf, 0xa7, 0xc8, 0x0b, 0x6c, 0x33, 0xd3, 0xc3, - 0x30, 0x5e, 0xdb, 0x29, 0xfa, 0x1e, 0xf8, 0x0e, 0xbf, 0x2e, 0xb8, - 0x3d, 0xb6, 0x8b, 0x48, 0xa5, 0xcb, 0xb5, 0x69, 0xd3, 0x26, 0xf4, - 0xf7, 0xf7, 0x57, 0xd2, 0x6f, 0xb8, 0xe1, 0x06, 0x6c, 0xde, 0xbc, - 0xb9, 0x3a, 0xf6, 0x53, 0x56, 0x2f, 0xcd, 0x04, 0xda, 0xd4, 0x39, - 0xcd, 0x86, 0x1a, 0x3c, 0x13, 0x6c, 0xdb, 0x0e, 0x81, 0x7f, 0xfa, - 0xba, 0x8b, 0xeb, 0x89, 0x6a, 0x57, 0x73, 0xf3, 0xd7, 0x39, 0x7e, - 0xf1, 0x6c, 0xe0, 0x6a, 0xce, 0xa6, 0x1d, 0x3c, 0x2e, 0xe6, 0xdf, - 0xf3, 0x3f, 0xf8, 0x07, 0x11, 0x82, 0x01, 0xe7, 0x91, 0xd1, 0x7c, - 0xcd, 0x2f, 0x86, 0x26, 0xef, 0x7e, 0x86, 0x60, 0x3c, 0xfc, 0x53, - 0xf1, 0x16, 0xce, 0xab, 0x87, 0x31, 0x0b, 0x80, 0x56, 0xba, 0x94, - 0x5b, 0xb6, 0x6c, 0xc1, 0xb5, 0xd7, 0x5e, 0x3b, 0xc3, 0xdd, 0xbb, - 0xf9, 0xe6, 0x9b, 0xb1, 0x69, 0xd3, 0x26, 0xc7, 0xfc, 0xf5, 0x36, - 0x5b, 0x50, 0xb1, 0xbe, 0xbe, 0x3e, 0xac, 0x59, 0xb3, 0x06, 0xe7, - 0x9f, 0x7f, 0x3e, 0x2e, 0xbd, 0xf4, 0x52, 0xbc, 0xf9, 0xcd, 0x6f, - 0xc6, 0xea, 0xd5, 0xab, 0xcf, 0xaa, 0xfb, 0x70, 0xef, 0x43, 0x1c, - 0xcf, 0x3d, 0x2b, 0xe0, 0xd9, 0x99, 0x54, 0x04, 0x78, 0xed, 0xf7, - 0x02, 0xf7, 0x3c, 0x18, 0xb8, 0x9a, 0xa7, 0xc3, 0x1e, 0x7f, 0x82, - 0xbf, 0x65, 0x62, 0x10, 0x1d, 0xd0, 0x2b, 0x83, 0xa3, 0x78, 0x29, - 0xb2, 0x2a, 0x5e, 0x79, 0x01, 0xcd, 0x3a, 0xac, 0x94, 0xd7, 0x70, - 0x75, 0xe5, 0x40, 0x08, 0x68, 0xcf, 0x21, 0xb1, 0x38, 0xb8, 0x25, - 0xd5, 0x16, 0x0e, 0x87, 0x01, 0x00, 0x2d, 0x2d, 0x2d, 0x78, 0xf6, - 0xd9, 0x67, 0x71, 0xdd, 0x75, 0xd7, 0xc1, 0x30, 0xa6, 0x5b, 0x74, - 0x7e, 0xee, 0x73, 0x9f, 0xc3, 0x2d, 0xb7, 0xdc, 0x52, 0xb5, 0x9d, - 0x35, 0x4f, 0xb3, 0xed, 0xd1, 0x47, 0x1f, 0xc5, 0xab, 0xaf, 0xbe, - 0x8a, 0xed, 0xdb, 0xb7, 0x63, 0xdb, 0xb6, 0x6d, 0x78, 0xe6, 0x99, - 0x67, 0xf0, 0x91, 0x8f, 0x7c, 0xe4, 0xac, 0xba, 0x0f, 0x99, 0x1c, - 0xf0, 0xa9, 0x4d, 0x1c, 0xbc, 0xe8, 0x52, 0x2c, 0x18, 0x50, 0x2c, - 0x02, 0x7f, 0xf9, 0x79, 0x8e, 0xb1, 0xc0, 0xd5, 0x3c, 0x2d, 0x96, - 0xce, 0x22, 0x39, 0x99, 0x45, 0x0c, 0xb0, 0x0c, 0x74, 0x5d, 0xcd, - 0x25, 0x57, 0xb1, 0xe5, 0x37, 0x8c, 0x9d, 0xd3, 0x20, 0xa0, 0xce, - 0xa3, 0x1e, 0x33, 0x88, 0x05, 0xdd, 0x34, 0xd0, 0xec, 0xb1, 0x16, - 0x5f, 0x8f, 0x66, 0x8f, 0x93, 0xfd, 0xfc, 0xe7, 0x3f, 0xc7, 0x87, - 0x3f, 0xfc, 0x61, 0x3c, 0xf2, 0xc8, 0x23, 0x95, 0xb4, 0xcd, 0x9b, - 0x37, 0x63, 0x62, 0x62, 0x02, 0xdf, 0xfe, 0xf6, 0xb7, 0xab, 0x5c, - 0xcf, 0x59, 0x79, 0x33, 0x3e, 0xfe, 0x38, 0x8e, 0x1e, 0x3d, 0x8a, - 0x44, 0x22, 0x81, 0x78, 0x3c, 0x8e, 0x54, 0x2a, 0x85, 0xdd, 0xbb, - 0x77, 0x9f, 0x75, 0xf7, 0x62, 0xc3, 0x45, 0x04, 0x0a, 0xa1, 0xfa, - 0xd3, 0xa6, 0xf2, 0x93, 0xad, 0x85, 0x81, 0xab, 0xaf, 0xa0, 0xaa, - 0xcf, 0xa2, 0x02, 0x9b, 0x1d, 0x8b, 0x86, 0x91, 0x8b, 0x85, 0x91, - 0xaf, 0xd5, 0x73, 0x54, 0x1d, 0x68, 0xd8, 0x09, 0x6c, 0xa5, 0xc9, - 0x84, 0x76, 0xfd, 0xdb, 0xe9, 0xd7, 0x5f, 0xfa, 0x2e, 0x3e, 0x10, - 0xdc, 0x16, 0x9b, 0x17, 0xe3, 0xd0, 0x9e, 0xec, 0xd1, 0x47, 0x1f, - 0x45, 0x57, 0x57, 0x17, 0xbe, 0xf4, 0xa5, 0x2f, 0x95, 0xde, 0x07, - 0x8c, 0xe1, 0xc1, 0x07, 0x1f, 0xc4, 0x89, 0x13, 0x27, 0x66, 0xc4, - 0xd9, 0x66, 0xcb, 0x36, 0x6d, 0xda, 0x84, 0x97, 0x5f, 0x7e, 0xf9, - 0xac, 0xbe, 0x0f, 0x97, 0xac, 0x27, 0xdc, 0xf7, 0x69, 0x06, 0x2a, - 0xba, 0x3f, 0xdd, 0xcc, 0x00, 0xee, 0xbe, 0x95, 0xe1, 0x89, 0x67, - 0x05, 0xfe, 0xfd, 0x95, 0x00, 0x6a, 0xb3, 0x6d, 0x57, 0x5f, 0x41, - 0xcf, 0xb7, 0x76, 0x61, 0x18, 0xf9, 0xca, 0xd8, 0x9d, 0x5e, 0x83, - 0xa4, 0xc0, 0x96, 0xee, 0xdb, 0x6c, 0xc3, 0x6d, 0xc3, 0x6a, 0xb0, - 0xe5, 0x10, 0x7a, 0xe3, 0x25, 0xf4, 0x87, 0xeb, 0xfe, 0x33, 0x3d, - 0x1d, 0xdc, 0x16, 0xdb, 0x5b, 0xc7, 0xa5, 0x91, 0xe8, 0xe6, 0xcd, - 0x9b, 0x71, 0xff, 0xfd, 0xf7, 0x57, 0x96, 0x63, 0xb1, 0x18, 0x1e, - 0x7e, 0xf8, 0x61, 0xbc, 0xfb, 0xdd, 0xef, 0x06, 0x30, 0xbb, 0x31, - 0xb4, 0x64, 0x32, 0x39, 0xab, 0xd7, 0x24, 0x14, 0x9a, 0xdd, 0xaf, - 0xdf, 0x22, 0x61, 0xe0, 0x5f, 0x3e, 0xc7, 0x10, 0x4f, 0xa1, 0xba, - 0xbd, 0x99, 0xd5, 0xcc, 0x92, 0x4a, 0x7b, 0xe8, 0x1e, 0x86, 0x54, - 0x22, 0x78, 0x76, 0x67, 0xd3, 0xda, 0x52, 0x98, 0xb8, 0xf7, 0x16, - 0xed, 0xe1, 0xca, 0x10, 0xcb, 0x70, 0x9c, 0x9c, 0xd8, 0x64, 0x8d, - 0x1a, 0xf8, 0x82, 0xac, 0x8a, 0x82, 0x96, 0xf9, 0xe9, 0x6f, 0xa9, - 0x04, 0x04, 0x09, 0xe0, 0xab, 0xf7, 0x69, 0xff, 0x7c, 0xe9, 0x7a, - 0xda, 0x15, 0xdc, 0x1e, 0x7f, 0xa0, 0x01, 0xc0, 0x5d, 0x77, 0xdd, - 0x85, 0xaf, 0x7e, 0xf5, 0xab, 0x95, 0xe5, 0xae, 0xae, 0x2e, 0xdc, - 0x77, 0xdf, 0x7d, 0x00, 0x4a, 0xed, 0xb3, 0x9a, 0x65, 0xe2, 0x34, - 0xf7, 0x50, 0x68, 0x6d, 0xa6, 0xa1, 0x69, 0x9a, 0x63, 0xf3, 0x95, - 0x46, 0xda, 0xad, 0x37, 0x30, 0x5c, 0xbe, 0xc1, 0xe1, 0x6b, 0x00, - 0xa7, 0x88, 0x70, 0x16, 0x38, 0xff, 0x12, 0xc2, 0xe7, 0x3e, 0xc2, - 0x82, 0x87, 0x77, 0xb6, 0x5e, 0x70, 0x3a, 0x8a, 0x0f, 0xdd, 0xa3, - 0x6d, 0x5e, 0xb9, 0x16, 0x07, 0x90, 0x2f, 0x0f, 0x73, 0xe4, 0xdc, - 0xdd, 0xb6, 0x80, 0x7b, 0x5c, 0x4b, 0xea, 0xd3, 0x27, 0xe1, 0xf0, - 0xeb, 0xd4, 0x75, 0x87, 0x89, 0x22, 0xa8, 0xb5, 0x0d, 0x13, 0x3f, - 0x79, 0x48, 0xbb, 0x77, 0xc3, 0x85, 0xb4, 0x33, 0xb8, 0x4d, 0xd3, - 0xca, 0xcb, 0xcb, 0x3e, 0xf9, 0xc9, 0x4f, 0xe2, 0x89, 0x27, 0x9e, - 0x98, 0xd5, 0x73, 0x9a, 0xfa, 0x08, 0xfd, 0x4c, 0x30, 0x22, 0xaa, - 0x6a, 0x46, 0xd2, 0x48, 0xbb, 0x68, 0x2d, 0xe1, 0xde, 0xdb, 0x59, - 0xf5, 0xf7, 0x9c, 0x5e, 0xf5, 0x66, 0x69, 0xe0, 0x6f, 0x3e, 0xc6, - 0x70, 0xe9, 0xfa, 0xa0, 0x83, 0xe4, 0x66, 0x5b, 0x4b, 0x02, 0x93, - 0xdf, 0x7f, 0x40, 0xfb, 0xe2, 0x75, 0xd7, 0xd0, 0xd3, 0x48, 0x23, - 0x0a, 0xff, 0x8e, 0x1c, 0xe1, 0xe2, 0x2d, 0x92, 0x4c, 0x2d, 0xa7, - 0x7d, 0x08, 0x29, 0xfb, 0x60, 0xa0, 0x33, 0x07, 0x36, 0xc8, 0x82, - 0x75, 0x77, 0x61, 0xf8, 0x97, 0xdf, 0xd2, 0x36, 0x7e, 0xfa, 0x26, - 0xf6, 0xa3, 0x90, 0x0e, 0x63, 0xae, 0xdf, 0xb0, 0x44, 0x22, 0xe1, - 0xe9, 0x66, 0x19, 0x86, 0x81, 0x1b, 0x6f, 0xbc, 0x11, 0x2f, 0xbc, - 0xf0, 0xc2, 0xec, 0x3d, 0x44, 0x2d, 0x2d, 0x33, 0x96, 0xed, 0x6d, - 0xde, 0x18, 0x63, 0x0d, 0xf9, 0x9e, 0xd2, 0xd5, 0x05, 0xb4, 0xc4, - 0x15, 0x19, 0x63, 0x4d, 0x53, 0x68, 0x91, 0x30, 0xf0, 0x3f, 0xff, - 0x8e, 0x21, 0xe6, 0xe4, 0x6a, 0x26, 0x80, 0x7f, 0xf8, 0x1a, 0xc7, - 0x33, 0xdb, 0x04, 0x10, 0xab, 0x76, 0x3d, 0xf5, 0x68, 0xc9, 0xf5, - 0x4c, 0x04, 0x9d, 0x5c, 0x35, 0xcd, 0xae, 0xb8, 0x80, 0x76, 0x3d, - 0xf3, 0x5d, 0xed, 0xf3, 0xd7, 0xbc, 0x87, 0x7e, 0x8d, 0x09, 0x84, - 0xe1, 0xdd, 0xf7, 0x99, 0x5d, 0x4c, 0x55, 0xb1, 0x8a, 0xf9, 0xb8, - 0x9b, 0xc2, 0x05, 0x6e, 0xf6, 0xfe, 0xbc, 0xa7, 0xa1, 0x46, 0x30, - 0x90, 0x07, 0x45, 0xc3, 0xc8, 0x3f, 0xf0, 0x79, 0xf6, 0xbf, 0x9e, - 0xfe, 0xb6, 0xf6, 0xf7, 0x6f, 0xba, 0x98, 0x5e, 0x9b, 0xd3, 0x6f, - 0xa0, 0x32, 0x3c, 0xbc, 0xe2, 0x46, 0x43, 0x43, 0x43, 0x78, 0xff, - 0xfb, 0xdf, 0x8f, 0xc3, 0x87, 0x0f, 0xcf, 0x50, 0x2e, 0xcd, 0xb2, - 0xd6, 0xd6, 0x99, 0x9f, 0xd8, 0x6e, 0xdc, 0xb8, 0x11, 0xdf, 0xfc, - 0xe6, 0x37, 0xf1, 0xe8, 0xa3, 0x8f, 0xe2, 0x67, 0x3f, 0xfb, 0x19, - 0x76, 0xee, 0xdc, 0x89, 0x07, 0x1e, 0x78, 0x60, 0x56, 0x54, 0xab, - 0xae, 0xeb, 0x95, 0xa6, 0x2d, 0x8d, 0xb6, 0xbb, 0x3f, 0xce, 0x70, - 0xf9, 0x9b, 0x1c, 0x5c, 0xcd, 0x30, 0x70, 0x64, 0x5f, 0xa9, 0x6d, - 0xda, 0xe7, 0xbf, 0xcc, 0x21, 0x0c, 0x67, 0xd7, 0xf3, 0xa2, 0x37, - 0x12, 0xee, 0xfa, 0x58, 0xe0, 0x7a, 0x36, 0xda, 0x3a, 0x5a, 0x90, - 0xfe, 0xe2, 0x9d, 0xec, 0x91, 0x5f, 0x3f, 0xac, 0x6d, 0xbc, 0xf0, - 0x3c, 0xda, 0x8b, 0x34, 0x42, 0x1e, 0x30, 0x73, 0x1a, 0xf1, 0x09, - 0x4e, 0xae, 0xa7, 0xee, 0xa1, 0xce, 0xc8, 0x47, 0xa9, 0x99, 0x98, - 0xf9, 0xf9, 0x93, 0x01, 0xeb, 0x97, 0xf1, 0x06, 0x18, 0xd2, 0x88, - 0x6c, 0xb8, 0x8c, 0x76, 0xfc, 0xea, 0x3b, 0xda, 0x3f, 0xfe, 0xf0, - 0x97, 0xe2, 0x92, 0xfb, 0x1e, 0xe4, 0xef, 0xd9, 0xbe, 0x6b, 0xee, - 0xb5, 0x55, 0x8b, 0xc7, 0xe3, 0xe0, 0x9c, 0xfb, 0x2a, 0x9e, 0x43, - 0x87, 0x0e, 0xe1, 0x9a, 0x6b, 0xae, 0xc1, 0x93, 0x4f, 0x3e, 0x89, - 0xb6, 0xb6, 0xb6, 0xa6, 0xc6, 0xb9, 0xba, 0xba, 0xba, 0x00, 0x94, - 0xe2, 0x74, 0x42, 0x08, 0xbc, 0xeb, 0x5d, 0xef, 0xaa, 0xca, 0xf3, - 0xca, 0x2b, 0xaf, 0x34, 0xf5, 0x9a, 0x4c, 0x75, 0x25, 0xa4, 0x69, - 0x5a, 0xa5, 0xfb, 0xa0, 0x46, 0xda, 0x65, 0xe7, 0x11, 0xee, 0xfc, - 0x18, 0xab, 0x86, 0x59, 0x19, 0x68, 0x7f, 0xb7, 0x99, 0x23, 0x97, - 0x07, 0x7e, 0xf3, 0xa2, 0xc0, 0x63, 0x3f, 0x16, 0xf8, 0xc0, 0x75, - 0x54, 0xdd, 0x77, 0x5a, 0x1a, 0xb8, 0xf3, 0xaf, 0x18, 0x9e, 0xdc, - 0x2a, 0xf0, 0xd4, 0xb6, 0xa0, 0xd6, 0xb3, 0xee, 0x17, 0x69, 0x12, - 0x99, 0x8f, 0xfe, 0x39, 0x7b, 0xe6, 0xb6, 0x0f, 0xb1, 0x27, 0x16, - 0x2d, 0xc1, 0x51, 0x64, 0x21, 0x90, 0x05, 0xa1, 0xba, 0x9b, 0x20, - 0xa7, 0x01, 0x52, 0x5c, 0x87, 0xaf, 0xab, 0x88, 0x00, 0x89, 0x0e, - 0x1e, 0xed, 0x9d, 0x3c, 0x3a, 0xf5, 0x58, 0xeb, 0xd4, 0xfd, 0xf6, - 0x74, 0x8f, 0xb5, 0x0c, 0x61, 0xc4, 0x21, 0xb2, 0xa3, 0x68, 0xff, - 0xbf, 0xbf, 0x12, 0x17, 0x7d, 0xed, 0x71, 0x7e, 0xe5, 0x2f, 0xb7, - 0x8a, 0xb5, 0x73, 0xe5, 0x26, 0xf6, 0xf5, 0xf5, 0x21, 0x1a, 0x8d, - 0xe2, 0xe4, 0xc9, 0x93, 0x18, 0x1a, 0x1a, 0xf2, 0xcd, 0xbf, 0x6c, - 0xd9, 0x32, 0x24, 0x12, 0x09, 0x1c, 0x3b, 0x76, 0xac, 0xa1, 0x1f, - 0x69, 0x5b, 0x6d, 0xc1, 0x82, 0x05, 0xe8, 0xe9, 0xe9, 0x41, 0x2e, - 0x97, 0x83, 0x10, 0xa2, 0xa2, 0x06, 0x85, 0x10, 0xd0, 0x34, 0x0d, - 0xd1, 0x68, 0x14, 0x63, 0x63, 0x63, 0xd8, 0xbb, 0x77, 0x6f, 0xd3, - 0x8e, 0xdf, 0xd9, 0xd9, 0x89, 0x42, 0xa1, 0x80, 0x68, 0x34, 0x8a, - 0x03, 0x07, 0x0e, 0x60, 0x7c, 0xbc, 0x71, 0x7d, 0x5b, 0xc7, 0x22, - 0xc0, 0xb6, 0xef, 0x69, 0x38, 0xf7, 0x3c, 0x02, 0xec, 0x5f, 0x75, - 0xc5, 0x81, 0x17, 0x9f, 0x17, 0xd8, 0xf0, 0x61, 0x13, 0xf9, 0x72, - 0x53, 0xbf, 0xd5, 0x4b, 0x09, 0xcf, 0x3f, 0xae, 0x95, 0x6a, 0x36, - 0x8d, 0xea, 0xfc, 0x3b, 0x77, 0x00, 0x97, 0xdd, 0x60, 0x60, 0x32, - 0x1b, 0x40, 0xa9, 0x16, 0x5b, 0x7a, 0x0e, 0x06, 0x3f, 0xfa, 0x7e, - 0xf6, 0xec, 0x07, 0xde, 0x49, 0xdb, 0x56, 0xac, 0xa6, 0x03, 0xc8, - 0x43, 0x94, 0xc7, 0x6a, 0x9f, 0xea, 0xd4, 0x31, 0x6f, 0xfb, 0xad, - 0xa5, 0x1b, 0x6e, 0xe9, 0x31, 0x05, 0xdc, 0x46, 0x45, 0x77, 0xea, - 0xb9, 0x36, 0x84, 0xe9, 0xce, 0x1e, 0x67, 0x02, 0x4e, 0x43, 0x08, - 0x31, 0x08, 0x14, 0x10, 0x7f, 0xe6, 0x39, 0xb1, 0xe6, 0x5f, 0x7f, - 0x21, 0x2e, 0xf9, 0xe9, 0xaf, 0xf8, 0xfa, 0xc3, 0x27, 0xd0, 0x11, - 0xdc, 0xf2, 0xc0, 0x1a, 0x69, 0xf7, 0xdf, 0xca, 0xf0, 0x5f, 0xef, - 0x70, 0xe8, 0xad, 0x96, 0x01, 0x5c, 0x03, 0xde, 0xf6, 0x21, 0x13, - 0x4f, 0x3f, 0x3f, 0x53, 0x71, 0x7d, 0xe1, 0x13, 0x0c, 0xf7, 0x7c, - 0xd6, 0xa1, 0x0b, 0x6e, 0x00, 0x48, 0x01, 0xff, 0xfc, 0x15, 0x8e, - 0xdb, 0xfe, 0x5b, 0xf0, 0x49, 0x94, 0xac, 0x85, 0x74, 0x18, 0x7f, - 0x7c, 0x39, 0xed, 0x7e, 0xdf, 0xdb, 0x68, 0xfb, 0xf5, 0xef, 0x64, - 0xcf, 0xb7, 0x74, 0x63, 0xa8, 0x0c, 0x32, 0xd3, 0x02, 0xad, 0x82, - 0x03, 0xc8, 0xec, 0xa3, 0x40, 0x39, 0x0d, 0x46, 0xec, 0x54, 0x61, - 0xc0, 0x55, 0x06, 0x49, 0x71, 0x1a, 0x57, 0xc0, 0x3e, 0x50, 0x4a, - 0x18, 0xd5, 0xe3, 0x0b, 0x84, 0xab, 0x96, 0x09, 0x21, 0x44, 0x41, - 0xd0, 0xc1, 0x46, 0x4e, 0x62, 0xde, 0x2f, 0x7e, 0x2b, 0xd6, 0x7d, - 0xf7, 0xc7, 0xfc, 0xd2, 0xe7, 0x77, 0x88, 0x45, 0x83, 0x23, 0x48, - 0x06, 0x8f, 0x42, 0x60, 0xf5, 0xd8, 0x95, 0x6f, 0x20, 0x3c, 0xf3, - 0xb0, 0x06, 0x9a, 0x0a, 0x8c, 0x58, 0x2d, 0x09, 0xfc, 0xe4, 0x27, - 0x02, 0x7f, 0xfa, 0xa9, 0xea, 0xc6, 0x68, 0x1d, 0xad, 0xc0, 0xcb, - 0xff, 0x5b, 0xc7, 0xa2, 0xc5, 0xa8, 0xee, 0x4e, 0x48, 0x03, 0x04, - 0x01, 0x6f, 0xf9, 0x2f, 0x26, 0x7e, 0xf3, 0x62, 0xe0, 0x7a, 0x7a, - 0x40, 0xcc, 0x3c, 0x6f, 0x15, 0x9d, 0x78, 0xd7, 0x95, 0xf4, 0x87, - 0xeb, 0xde, 0x45, 0x2f, 0x9d, 0xb7, 0x86, 0x0e, 0x23, 0x84, 0x5c, - 0x79, 0x0c, 0x01, 0x13, 0x33, 0x7b, 0xa2, 0x75, 0x1a, 0xfd, 0xc9, - 0x3a, 0xac, 0x9d, 0xdd, 0xfd, 0xf4, 0x1d, 0xca, 0xae, 0x11, 0xe3, - 0x72, 0x3a, 0x8d, 0x8a, 0xee, 0x34, 0xa4, 0x9d, 0x8e, 0x99, 0x63, - 0x72, 0x96, 0xe6, 0x75, 0x68, 0x88, 0x00, 0x30, 0x11, 0x3e, 0x75, - 0x12, 0x9d, 0xbf, 0x78, 0x96, 0xaf, 0xf9, 0xd1, 0x53, 0x62, 0xfd, - 0x6f, 0x5e, 0x14, 0xcb, 0x07, 0x86, 0x03, 0xb8, 0x05, 0xa6, 0x66, - 0xdd, 0x1d, 0xc0, 0xbf, 0x7f, 0x4f, 0xc7, 0xb2, 0xf5, 0xa8, 0x76, - 0x35, 0x75, 0x20, 0x3b, 0x0a, 0x5c, 0xf4, 0x3e, 0x13, 0xbb, 0x0e, - 0x3a, 0x43, 0xe9, 0xfa, 0x77, 0x30, 0x7c, 0xef, 0x2b, 0xac, 0x54, - 0x74, 0xec, 0x59, 0xa2, 0xc0, 0xc9, 0xbd, 0xc0, 0x45, 0x7f, 0x6e, - 0xe0, 0xe4, 0x60, 0x70, 0xad, 0x2b, 0x97, 0x25, 0x8c, 0xe2, 0xfa, - 0x95, 0x74, 0xf2, 0xcf, 0xae, 0xa2, 0x9d, 0xef, 0xb9, 0x8a, 0x76, - 0x5e, 0xb0, 0x86, 0x8e, 0x21, 0x86, 0x49, 0x14, 0xcb, 0x6e, 0xa5, - 0xa8, 0xc0, 0xc9, 0x6b, 0x6c, 0x4e, 0xaf, 0x21, 0xec, 0x7c, 0x07, - 0x47, 0x91, 0x01, 0x9a, 0x97, 0xeb, 0xe9, 0x35, 0x3e, 0xa7, 0xcc, - 0xc8, 0xe9, 0xd5, 0x69, 0x04, 0x1d, 0x1a, 0x18, 0xa2, 0x00, 0x0c, - 0x84, 0x07, 0xfb, 0xd1, 0xbe, 0x73, 0x9f, 0x98, 0xbf, 0xe5, 0x29, - 0xb1, 0xee, 0x77, 0xff, 0x21, 0x96, 0xed, 0x3e, 0x28, 0xe6, 0x8d, - 0x4e, 0x20, 0x16, 0x3c, 0x3e, 0x81, 0x79, 0xd9, 0xc2, 0x1e, 0xe0, - 0x8a, 0x0b, 0x09, 0xf9, 0x3c, 0xaa, 0x6a, 0x2d, 0x49, 0x03, 0x4e, - 0x9d, 0x2a, 0xf5, 0x62, 0xeb, 0x66, 0x8c, 0x01, 0x6f, 0xbf, 0x82, - 0x10, 0x8e, 0x38, 0x8c, 0x8e, 0x2e, 0x80, 0x48, 0x04, 0xf8, 0xed, - 0x4b, 0x02, 0x27, 0x06, 0xe6, 0xee, 0x35, 0x66, 0x0c, 0x7c, 0xc5, - 0x62, 0x1a, 0x3a, 0x6f, 0x25, 0x4e, 0xbc, 0xf7, 0x8f, 0xd9, 0xce, - 0xcb, 0xcf, 0xa7, 0xc3, 0x7d, 0x0b, 0x31, 0x40, 0x29, 0xa4, 0xcb, - 0x5a, 0x4b, 0x40, 0xc0, 0x84, 0xf3, 0xc8, 0xe8, 0x5e, 0xcb, 0x06, - 0xdc, 0x07, 0x1a, 0xe6, 0xa8, 0xae, 0xf9, 0x94, 0x1e, 0x39, 0xdd, - 0x4b, 0xa5, 0x11, 0xdc, 0x47, 0x50, 0x77, 0x52, 0x6c, 0x4e, 0x80, - 0xd3, 0x1d, 0xe6, 0xa7, 0xa7, 0x29, 0xb8, 0x85, 0x40, 0xd0, 0x40, - 0xc8, 0x22, 0x76, 0xbc, 0x1f, 0x6d, 0xcf, 0xbc, 0x28, 0x96, 0xff, - 0xee, 0x3f, 0xc4, 0xd2, 0xa7, 0x9e, 0x13, 0xcb, 0x0f, 0x1e, 0x17, - 0x1d, 0x99, 0x2c, 0xc2, 0x41, 0x11, 0x0e, 0x2c, 0xb0, 0xe6, 0x1a, - 0x11, 0xc4, 0xfc, 0x2e, 0x8c, 0xbf, 0x61, 0x1d, 0x1d, 0xfb, 0xa3, - 0xcb, 0x68, 0xdf, 0x5b, 0x2f, 0xa5, 0x7d, 0x6b, 0xfb, 0xa8, 0x3f, - 0x92, 0x42, 0x1a, 0x04, 0xa3, 0x8c, 0x22, 0x01, 0x5e, 0x71, 0x0b, - 0xad, 0xae, 0xa2, 0x15, 0x54, 0x5e, 0xf3, 0x26, 0x66, 0x0e, 0x55, - 0x67, 0xb8, 0x80, 0xcc, 0xeb, 0x0b, 0x02, 0xd8, 0x81, 0x26, 0x03, - 0x35, 0xaf, 0x81, 0x52, 0x18, 0xaa, 0xfb, 0x04, 0x77, 0x82, 0x9b, - 0x66, 0x03, 0x9a, 0xe6, 0xb2, 0xbe, 0x34, 0x4f, 0x60, 0xd0, 0x41, - 0x08, 0x43, 0x80, 0xa0, 0x19, 0x63, 0x48, 0x1e, 0x3d, 0x85, 0xb6, - 0x5d, 0x07, 0x44, 0xf7, 0x2f, 0x9f, 0x13, 0xcb, 0x5f, 0xfa, 0x83, - 0x58, 0xb8, 0x7d, 0x97, 0x98, 0x3f, 0x34, 0x8a, 0xe0, 0xeb, 0xbb, - 0xc0, 0x02, 0x6b, 0x40, 0x1c, 0x6c, 0x5d, 0x1f, 0xf5, 0x9f, 0xbb, - 0x0a, 0x27, 0xdf, 0x76, 0x19, 0xed, 0xbd, 0x68, 0x1d, 0x1d, 0x5f, - 0x3a, 0x9f, 0x86, 0x5b, 0x3b, 0x31, 0x8e, 0x10, 0x0a, 0x15, 0x67, - 0x91, 0x57, 0x60, 0x63, 0x8f, 0x73, 0x59, 0x87, 0x9c, 0xf3, 0x9a, - 0x4c, 0x38, 0x8f, 0x8e, 0xee, 0x15, 0xfc, 0xb7, 0x36, 0xaa, 0x95, - 0x02, 0x9a, 0x9f, 0xeb, 0xe9, 0x56, 0x51, 0xe0, 0xa4, 0xd6, 0x9c, - 0x5c, 0x52, 0xcd, 0x03, 0x60, 0x4e, 0x79, 0xaa, 0xf7, 0xc7, 0xca, - 0x80, 0xd3, 0x21, 0xc0, 0xa0, 0xa1, 0x80, 0x50, 0xff, 0x49, 0xb4, - 0xed, 0x3e, 0x24, 0xba, 0x77, 0x1f, 0x12, 0x5d, 0x3b, 0xf6, 0xa0, - 0xe7, 0xb7, 0x2f, 0x89, 0x25, 0x87, 0x4e, 0x88, 0xf6, 0x20, 0x0e, - 0x17, 0x58, 0x60, 0xee, 0x96, 0x88, 0xa1, 0xb0, 0xa0, 0x9b, 0xc6, - 0x2f, 0x5a, 0x8b, 0xa3, 0x97, 0x9c, 0x4b, 0xc7, 0xd6, 0x2d, 0xa3, - 0xc1, 0xe5, 0x8b, 0x30, 0xb0, 0x7a, 0x29, 0x0d, 0xb0, 0x04, 0xb2, - 0x20, 0x98, 0x16, 0x05, 0xc6, 0x21, 0xaa, 0xbe, 0x0e, 0x72, 0x02, - 0x9a, 0xe9, 0x02, 0x2b, 0x37, 0x70, 0x39, 0xd5, 0x60, 0xba, 0xc1, - 0x4c, 0xb8, 0x00, 0x0d, 0x32, 0x40, 0xb3, 0xc2, 0x0c, 0x2e, 0x50, - 0xb3, 0xb6, 0x53, 0x23, 0x1b, 0x7c, 0xdc, 0x00, 0xe7, 0x04, 0x2b, - 0xdd, 0x25, 0x8f, 0x93, 0x02, 0x9c, 0xd9, 0x2e, 0x8e, 0xc0, 0x2a, - 0xa3, 0x85, 0x6a, 0x20, 0x10, 0x18, 0xd2, 0x88, 0x0e, 0x8d, 0x21, - 0xf9, 0xda, 0x7e, 0xd1, 0xbd, 0x7d, 0x97, 0x58, 0xb0, 0xe7, 0x30, - 0x3a, 0xf7, 0x1d, 0x15, 0x1d, 0xbb, 0x0e, 0x60, 0xde, 0xfe, 0xa3, - 0xa2, 0xd3, 0x30, 0x82, 0x9e, 0x75, 0x03, 0x9b, 0x5b, 0xd6, 0xd3, - 0x89, 0xf1, 0xb5, 0xcb, 0x69, 0x70, 0xe9, 0x39, 0x18, 0xe9, 0x5b, - 0x4c, 0x83, 0x6b, 0x97, 0xd1, 0xa9, 0x4b, 0xd6, 0xe3, 0xd8, 0xfc, - 0x79, 0x34, 0x1e, 0x6e, 0xc1, 0x24, 0x34, 0x98, 0x30, 0xcb, 0x8e, - 0x63, 0x11, 0x54, 0x9e, 0xe3, 0x36, 0xc8, 0x58, 0xa1, 0xe3, 0xa4, - 0xa8, 0x64, 0x61, 0xe7, 0x04, 0x30, 0x2b, 0xc4, 0x4c, 0x9b, 0x1a, - 0xf3, 0x85, 0x99, 0x17, 0xd0, 0xbc, 0x54, 0x1a, 0x3c, 0xa0, 0xe6, - 0x56, 0x71, 0xc0, 0x24, 0x21, 0xa7, 0x79, 0xc0, 0x4b, 0x43, 0x75, - 0x03, 0x5f, 0xa7, 0x63, 0x4c, 0x0f, 0xda, 0xa2, 0x81, 0xca, 0x90, - 0x03, 0x08, 0x0c, 0x06, 0xf4, 0xfc, 0x04, 0x62, 0x07, 0x8f, 0x89, - 0x8e, 0x63, 0xa7, 0xd0, 0xb6, 0x7d, 0x97, 0xe8, 0x79, 0x79, 0x97, - 0x38, 0xe7, 0xf0, 0x71, 0xb4, 0x9d, 0x18, 0x40, 0x6a, 0x60, 0x44, - 0x24, 0x86, 0xc7, 0x10, 0x7c, 0xb9, 0x17, 0xd8, 0xeb, 0x5a, 0x71, - 0xcd, 0x6b, 0xc7, 0x64, 0x77, 0x07, 0xa5, 0x17, 0xf5, 0x62, 0x6c, - 0xe5, 0x62, 0x1a, 0xbc, 0xec, 0x7c, 0x3a, 0xb2, 0x64, 0x01, 0x46, - 0x97, 0x2e, 0xa0, 0xa1, 0x8e, 0x79, 0x98, 0x40, 0x08, 0x45, 0x30, - 0x98, 0xe0, 0x10, 0x28, 0x80, 0xca, 0xe8, 0x10, 0x1e, 0x50, 0xb1, - 0xa7, 0x99, 0x2e, 0x90, 0xf3, 0x83, 0x95, 0x9b, 0x3b, 0xe9, 0x14, - 0x23, 0x93, 0xf9, 0xe4, 0xa9, 0xea, 0x63, 0x75, 0x19, 0xa0, 0xc9, - 0xb8, 0xa0, 0x32, 0xae, 0xa8, 0x17, 0xe0, 0x9c, 0x94, 0x97, 0xe6, - 0x01, 0x33, 0xcd, 0x65, 0xff, 0x4e, 0xc7, 0xa2, 0x19, 0xe9, 0x0c, - 0x34, 0x43, 0x0b, 0x0a, 0x68, 0x28, 0x22, 0x54, 0xcc, 0x20, 0x32, - 0x9a, 0x46, 0x7c, 0xff, 0x51, 0xd1, 0xf6, 0xda, 0x01, 0xd1, 0x73, - 0xa4, 0x1f, 0xad, 0x7b, 0x0e, 0xa2, 0x73, 0xc7, 0x1e, 0xd1, 0x3b, - 0x30, 0x22, 0x12, 0x23, 0xe3, 0x88, 0x4d, 0x66, 0x11, 0x9e, 0xcb, - 0x03, 0x26, 0x07, 0x76, 0x66, 0x58, 0x38, 0x04, 0xb3, 0xad, 0x05, - 0xd9, 0x8e, 0x56, 0xca, 0x2c, 0x3f, 0x07, 0x43, 0xe7, 0xad, 0xa2, - 0x53, 0x8b, 0x7a, 0x30, 0xd6, 0xb7, 0x90, 0x86, 0xd6, 0xad, 0xa0, - 0xfe, 0xce, 0x36, 0x4c, 0x26, 0x12, 0xc8, 0x21, 0x8c, 0x22, 0x74, - 0x18, 0xe0, 0xe5, 0x3a, 0xc7, 0x29, 0x7d, 0x24, 0x66, 0x40, 0xc3, - 0x0d, 0x26, 0x5e, 0x30, 0x73, 0x5b, 0x36, 0x5c, 0xb6, 0x35, 0x5d, - 0xd2, 0x38, 0xbc, 0xdb, 0x95, 0xf9, 0x7d, 0xee, 0x54, 0xf5, 0xdd, - 0xb9, 0x17, 0xd0, 0x64, 0xa0, 0x26, 0x1b, 0x5f, 0x73, 0xab, 0x1d, - 0x65, 0x92, 0x80, 0x92, 0xcd, 0xef, 0xb4, 0x6c, 0x3f, 0x7e, 0xf5, - 0xe0, 0xa5, 0x54, 0x76, 0x53, 0xa7, 0xab, 0x34, 0x04, 0x08, 0x0c, - 0x1c, 0x0c, 0x59, 0x44, 0x26, 0xd2, 0x88, 0x8d, 0xa7, 0x11, 0x1d, - 0x1c, 0x11, 0xc9, 0x53, 0xa3, 0x48, 0xec, 0x3d, 0x2c, 0xda, 0x77, - 0xec, 0xc1, 0xfc, 0xfe, 0x21, 0x91, 0xea, 0x1f, 0x42, 0x72, 0x78, - 0x0c, 0xf1, 0xd1, 0x09, 0x11, 0x1d, 0x9b, 0x40, 0x74, 0x32, 0xa8, - 0x79, 0x0d, 0xac, 0x0e, 0x0b, 0xe9, 0x30, 0x5b, 0x52, 0xc8, 0xb5, - 0xa7, 0x90, 0x6b, 0x6b, 0xa1, 0x6c, 0x77, 0x3b, 0x26, 0xbb, 0x3b, - 0x29, 0xbd, 0x7c, 0x21, 0x06, 0xcf, 0x5f, 0x49, 0xa7, 0xba, 0x3b, - 0x91, 0xee, 0x6a, 0xa7, 0x74, 0x47, 0x2b, 0x32, 0x2d, 0x09, 0xe4, - 0xf4, 0x04, 0xb2, 0x08, 0xc1, 0x80, 0x28, 0x63, 0xaa, 0x08, 0x4b, - 0x0f, 0x85, 0x55, 0xbd, 0x53, 0xcc, 0xec, 0xee, 0x0b, 0x15, 0x55, - 0xc6, 0x7d, 0xa0, 0xe6, 0x94, 0xdf, 0xf4, 0xc9, 0xcb, 0x15, 0x00, - 0xe6, 0x07, 0x31, 0xaf, 0x1e, 0x6b, 0x21, 0x13, 0x43, 0x73, 0x83, - 0x9a, 0x9f, 0x2b, 0xca, 0x7c, 0xe2, 0x6c, 0xcc, 0xa2, 0x98, 0xec, - 0xdf, 0x88, 0x92, 0x0f, 0xa0, 0xc8, 0x03, 0x56, 0x32, 0x13, 0xc1, - 0x79, 0x24, 0x66, 0xe6, 0x70, 0x7e, 0x33, 0x61, 0x37, 0xed, 0xc4, - 0x4e, 0x9f, 0x01, 0xc0, 0x60, 0x42, 0x83, 0x01, 0xcd, 0xcc, 0x23, - 0x9c, 0xce, 0x20, 0x92, 0xce, 0x20, 0xb2, 0xff, 0xa8, 0x68, 0x3b, - 0x72, 0x12, 0x1d, 0x03, 0xc3, 0x22, 0xd1, 0x3f, 0x82, 0xc4, 0xe1, - 0xe3, 0x68, 0xdd, 0x7f, 0x54, 0x74, 0x0e, 0x8f, 0x23, 0x3e, 0x31, - 0x29, 0x22, 0x13, 0x93, 0x88, 0xe4, 0xf2, 0xd0, 0x8b, 0x41, 0x0c, - 0x6f, 0x4e, 0x19, 0x63, 0x10, 0x91, 0x30, 0x8c, 0x44, 0x0c, 0xf9, - 0x96, 0x04, 0x0a, 0x2d, 0x09, 0xca, 0xcf, 0xef, 0xc6, 0xe8, 0xea, - 0xa5, 0x34, 0xdc, 0x53, 0x86, 0x54, 0x6f, 0x27, 0x26, 0x56, 0x2e, - 0xc6, 0x50, 0x47, 0x3b, 0x65, 0x92, 0x31, 0xe4, 0xa3, 0x31, 0xe4, - 0x11, 0x82, 0x01, 0x0d, 0x26, 0x58, 0x39, 0x24, 0x6f, 0x5a, 0x80, - 0x55, 0x2a, 0xfa, 0x4e, 0xe0, 0x72, 0xeb, 0xea, 0xcb, 0x9a, 0x66, - 0xba, 0xac, 0x93, 0x99, 0x64, 0x20, 0xe8, 0x04, 0x4e, 0xe1, 0x11, - 0xe8, 0xf7, 0x82, 0x99, 0x9b, 0x2a, 0x83, 0x4a, 0x0c, 0x4d, 0x05, - 0x6c, 0x4e, 0x90, 0x73, 0x82, 0x9b, 0x5b, 0xcc, 0x8d, 0x5c, 0xe0, - 0xc3, 0x7c, 0xe2, 0x73, 0xcc, 0x67, 0x3f, 0x4c, 0x11, 0x60, 0x4e, - 0xf3, 0x4e, 0xbf, 0xd3, 0xf3, 0xd3, 0x7f, 0x28, 0xbb, 0xb3, 0x62, - 0xc6, 0x1a, 0x13, 0x0c, 0x05, 0x84, 0x8a, 0x39, 0x84, 0x33, 0xe5, - 0x69, 0x3c, 0x2d, 0x22, 0xe3, 0x69, 0xc4, 0x46, 0xd3, 0x88, 0x0e, - 0x8e, 0x20, 0xbe, 0xe7, 0xb0, 0x68, 0xeb, 0x1f, 0x44, 0xdb, 0xc8, - 0x04, 0x62, 0xe3, 0x69, 0x11, 0x19, 0x4d, 0x23, 0x3a, 0x32, 0x8a, - 0x58, 0xff, 0xb0, 0x48, 0x4c, 0x66, 0x11, 0x2d, 0x14, 0xa1, 0x71, - 0x1e, 0xb8, 0xba, 0x67, 0xa2, 0x9a, 0x8a, 0x46, 0x50, 0xec, 0x68, - 0xc5, 0x64, 0x6f, 0x27, 0x65, 0x92, 0x09, 0xe4, 0x3a, 0x52, 0xc8, - 0xa7, 0x92, 0x94, 0xed, 0x6a, 0xc7, 0xe4, 0xd2, 0x73, 0x30, 0xbc, - 0xa8, 0x97, 0x26, 0x5a, 0x93, 0xc8, 0xb7, 0x24, 0x91, 0x6d, 0x4f, - 0x51, 0x36, 0x1e, 0x45, 0x21, 0x1e, 0x43, 0x31, 0x16, 0x45, 0x1e, - 0x11, 0x14, 0xcb, 0x63, 0x50, 0x8a, 0x8a, 0xc2, 0x32, 0x40, 0x15, - 0x50, 0xf1, 0x72, 0x30, 0x5c, 0xb8, 0x16, 0x78, 0x2f, 0x80, 0xc9, - 0x40, 0xce, 0x4d, 0xa1, 0x09, 0x9f, 0x65, 0x3f, 0xa5, 0xc5, 0xe1, - 0x5d, 0x43, 0x29, 0x5c, 0x80, 0x56, 0x33, 0xc8, 0x6a, 0x01, 0x9a, - 0x8c, 0x1b, 0x6a, 0x77, 0x41, 0x9d, 0x54, 0x9b, 0xdb, 0x68, 0xc8, - 0xf6, 0x5f, 0xcd, 0x53, 0x39, 0x79, 0x2f, 0x93, 0x4f, 0x1e, 0x92, - 0x04, 0x98, 0x1f, 0xd4, 0xbc, 0x46, 0x76, 0x9e, 0x9e, 0xb7, 0x02, - 0x6f, 0x7a, 0x2d, 0xcd, 0xd8, 0xa3, 0x00, 0x81, 0x43, 0x03, 0x2f, - 0xb9, 0xba, 0x66, 0x16, 0xa1, 0x91, 0x09, 0xc4, 0x26, 0x33, 0x88, - 0x8c, 0x4d, 0x8a, 0x48, 0x36, 0x87, 0xf0, 0x78, 0x49, 0xdd, 0x85, - 0xc7, 0x26, 0x10, 0x99, 0xc8, 0x88, 0xc8, 0x64, 0x16, 0x91, 0xb1, - 0x09, 0x84, 0x73, 0x05, 0x44, 0x4e, 0x0e, 0x88, 0xd8, 0x89, 0x21, - 0x24, 0x26, 0x26, 0x91, 0xc8, 0x64, 0xa1, 0xe7, 0x8b, 0xd0, 0x0d, - 0x03, 0x7a, 0x26, 0x27, 0xb4, 0x7c, 0x11, 0x9a, 0x61, 0x40, 0xcf, - 0x17, 0xa0, 0xcd, 0x75, 0x65, 0x48, 0x04, 0x1e, 0x8b, 0xc0, 0xd4, - 0x75, 0x98, 0x61, 0x1d, 0x66, 0x2c, 0x4a, 0x46, 0x38, 0x04, 0x33, - 0x1c, 0x82, 0x11, 0x8b, 0xc0, 0x48, 0xc4, 0x91, 0xeb, 0x6c, 0x45, - 0x7a, 0x61, 0x0f, 0x65, 0x92, 0x09, 0xe4, 0x53, 0x31, 0xe4, 0x5b, - 0x52, 0x28, 0xc4, 0x23, 0x94, 0x6f, 0x4b, 0x21, 0x1f, 0x8b, 0x21, - 0x9f, 0x8a, 0xa1, 0x90, 0x88, 0xa3, 0x90, 0x8c, 0x21, 0x9f, 0x4a, - 0x50, 0x3e, 0x95, 0x40, 0x36, 0x91, 0x42, 0xbe, 0x7c, 0xf7, 0xcc, - 0x72, 0xb0, 0x82, 0x5b, 0x8a, 0xab, 0x70, 0x68, 0x0e, 0x2a, 0x2c, - 0xea, 0x4a, 0x78, 0xa8, 0x14, 0xee, 0x31, 0xef, 0xb4, 0xce, 0x0d, - 0x6a, 0x7e, 0xeb, 0x4c, 0x87, 0x7d, 0xfb, 0xa9, 0x3d, 0xbf, 0xbc, - 0x6e, 0xc7, 0x84, 0xa2, 0x1a, 0x93, 0x82, 0x59, 0xad, 0x40, 0x73, - 0x52, 0x6b, 0x7e, 0xb1, 0x35, 0xaf, 0x8a, 0x04, 0x15, 0x90, 0xf8, - 0x29, 0x27, 0x59, 0x70, 0x11, 0x54, 0x54, 0x98, 0xf7, 0x70, 0xf4, - 0x5e, 0x69, 0xb0, 0x1c, 0xd7, 0xef, 0x1a, 0x4c, 0xc3, 0x0f, 0x15, - 0x00, 0xda, 0x8f, 0x3c, 0x55, 0x25, 0x31, 0x95, 0x0f, 0x95, 0x5f, - 0xb3, 0xec, 0x02, 0x9b, 0xd0, 0x78, 0x09, 0x5c, 0xba, 0x69, 0x82, - 0xe5, 0x8b, 0xe5, 0x79, 0x0e, 0x36, 0x9e, 0x16, 0xe1, 0xe1, 0x31, - 0x44, 0xd2, 0x19, 0x44, 0xf3, 0x05, 0x84, 0x27, 0xb3, 0x08, 0x65, - 0x72, 0x08, 0x15, 0x0d, 0xa1, 0x15, 0xcb, 0xc0, 0xcb, 0xe4, 0xa0, - 0x17, 0x8a, 0xd3, 0xdb, 0x9b, 0x1c, 0x5a, 0x26, 0x07, 0xcd, 0x30, - 0xc1, 0x8a, 0x45, 0x30, 0xd3, 0x84, 0x66, 0x72, 0x41, 0x9c, 0x43, - 0xe3, 0x02, 0xc4, 0x39, 0x28, 0x93, 0xab, 0x40, 0x92, 0x0a, 0x45, - 0x30, 0x93, 0x83, 0x91, 0xf5, 0xa1, 0x23, 0xc0, 0x30, 0xca, 0x2a, - 0x93, 0xa6, 0xd5, 0x0d, 0xd9, 0x1e, 0x4c, 0x51, 0x0a, 0x78, 0x73, - 0x8d, 0x81, 0x0b, 0x01, 0x8a, 0x84, 0x61, 0x86, 0x43, 0xa5, 0x07, - 0x5f, 0xd7, 0xc0, 0x89, 0x20, 0x74, 0x8d, 0x4c, 0x4d, 0x83, 0x28, - 0xab, 0x23, 0x33, 0xa4, 0x83, 0xeb, 0x1a, 0x4c, 0x5d, 0x83, 0x19, - 0xd2, 0x61, 0xc4, 0xa2, 0x30, 0xe3, 0x51, 0x18, 0xa5, 0x65, 0x32, - 0xca, 0x6e, 0x9e, 0x11, 0x8b, 0xa2, 0x10, 0x8b, 0x20, 0xd7, 0x96, - 0x42, 0x7e, 0x5e, 0x1b, 0xe5, 0x74, 0x1d, 0xa6, 0xa6, 0x81, 0x47, - 0x42, 0x30, 0x43, 0x3a, 0x4c, 0x5d, 0x87, 0xa1, 0x87, 0x60, 0x42, - 0x2f, 0x5f, 0xc9, 0x50, 0xe5, 0xb3, 0x76, 0x61, 0x29, 0x56, 0xc2, - 0x02, 0x23, 0xaa, 0x68, 0x27, 0x5e, 0x56, 0x55, 0x70, 0x04, 0x94, - 0xb5, 0xf0, 0xc2, 0x47, 0x91, 0x78, 0xb9, 0x5e, 0x6e, 0xa0, 0x93, - 0x81, 0x9c, 0x4c, 0x7e, 0xd3, 0x07, 0x42, 0xdc, 0x63, 0x5b, 0x2e, - 0x09, 0x60, 0xeb, 0x35, 0x00, 0xe4, 0x47, 0x74, 0x92, 0x82, 0x59, - 0x3d, 0x40, 0xf3, 0x73, 0x43, 0xfd, 0x62, 0x6d, 0x7e, 0x60, 0x93, - 0x55, 0x3f, 0xf5, 0xa4, 0xc9, 0xaa, 0x2e, 0xb7, 0xed, 0xa0, 0x00, - 0xb7, 0x5a, 0x26, 0x48, 0xa4, 0xc1, 0x06, 0x43, 0xd8, 0x70, 0x87, - 0xaa, 0x34, 0x0d, 0x02, 0x04, 0x61, 0x5b, 0x4f, 0x96, 0xbb, 0x46, - 0x0e, 0x8f, 0x10, 0xb3, 0x3c, 0x72, 0xa5, 0x63, 0x09, 0xcb, 0x76, - 0xbc, 0x72, 0x0e, 0x02, 0xc2, 0xf1, 0x99, 0x10, 0x96, 0x6d, 0xac, - 0xc7, 0x15, 0x2e, 0x4f, 0xd4, 0xd4, 0xde, 0xad, 0xe7, 0x69, 0x3d, - 0x03, 0xeb, 0x59, 0x54, 0xbf, 0xbd, 0x85, 0xc3, 0xbc, 0xa8, 0xa8, - 0xe0, 0xea, 0xe2, 0x64, 0x45, 0xd1, 0xcc, 0x2d, 0xdd, 0x7a, 0x6c, - 0x86, 0xcf, 0xb2, 0x9b, 0xf2, 0xe0, 0x1e, 0xcb, 0x32, 0x70, 0xf3, - 0x52, 0x37, 0xdc, 0x07, 0x86, 0xb2, 0x40, 0x14, 0x35, 0x82, 0x4a, - 0x48, 0xfe, 0x3f, 0x6e, 0x00, 0x13, 0xb5, 0x42, 0xcc, 0x6a, 0xf5, - 0x76, 0xe4, 0x2e, 0x1c, 0x1e, 0x5c, 0xaf, 0xbc, 0x34, 0xe3, 0x01, - 0xaf, 0x2e, 0x98, 0x5c, 0x01, 0x76, 0x5e, 0x40, 0xf2, 0x03, 0x24, - 0x53, 0x38, 0x06, 0x49, 0x6e, 0x03, 0x49, 0x98, 0xc1, 0x01, 0x8a, - 0xa8, 0x01, 0x68, 0xd5, 0xf3, 0xa2, 0x82, 0x03, 0xaf, 0xd1, 0xee, - 0xdd, 0xd2, 0xdd, 0x42, 0x08, 0xfe, 0x2f, 0x2f, 0x92, 0x56, 0xf1, - 0x2a, 0xcf, 0x93, 0x3d, 0x45, 0xf8, 0x6c, 0xe3, 0xf6, 0x66, 0xf7, - 0x6a, 0xbb, 0xe4, 0x35, 0xe0, 0x86, 0x2c, 0xd0, 0x20, 0x51, 0x60, - 0x1b, 0x35, 0xf9, 0xb9, 0x6b, 0x2a, 0xca, 0xce, 0x6f, 0x9d, 0x90, - 0x3c, 0x0e, 0x57, 0x84, 0x3a, 0xe0, 0xd3, 0xeb, 0x6c, 0x2d, 0x20, - 0x6b, 0x14, 0xd0, 0x9c, 0x0e, 0x4e, 0x0e, 0x0f, 0x10, 0x39, 0xcc, - 0xab, 0x28, 0x37, 0x2a, 0x4b, 0x62, 0x27, 0x80, 0xa0, 0x06, 0x40, - 0xd9, 0x21, 0xa2, 0xba, 0x3d, 0x24, 0xd7, 0xc9, 0xb9, 0x99, 0xb5, - 0xc0, 0xcb, 0xbf, 0x52, 0xc6, 0xed, 0x1a, 0x7b, 0x81, 0x8b, 0x3c, - 0x94, 0xb6, 0x3b, 0xa8, 0x9a, 0xd7, 0x36, 0x4f, 0xd4, 0x90, 0x26, - 0x24, 0xa1, 0x06, 0x05, 0xc0, 0xf9, 0x15, 0x4a, 0x59, 0xd5, 0xd6, - 0x0c, 0xc8, 0x09, 0x49, 0x08, 0xd5, 0x02, 0x3f, 0x95, 0xc9, 0xcf, - 0x95, 0x94, 0x89, 0x8d, 0xd5, 0x04, 0xb1, 0x66, 0x01, 0x0d, 0x0e, - 0xd0, 0xf2, 0x7b, 0x08, 0xad, 0xaa, 0x8e, 0xd9, 0xa0, 0xe8, 0x54, - 0x50, 0x99, 0xe5, 0xa2, 0xa9, 0xaa, 0x20, 0xbf, 0xfc, 0x4c, 0x01, - 0x40, 0xf5, 0xb8, 0x8d, 0xb2, 0x31, 0xc6, 0x7a, 0x20, 0x26, 0xdb, - 0x7e, 0x50, 0x16, 0x70, 0xb2, 0xaa, 0x0d, 0x67, 0x08, 0xd8, 0xbc, - 0xd4, 0x9a, 0x0c, 0xe8, 0xbc, 0x54, 0x18, 0x5c, 0x0a, 0xb0, 0x5f, - 0x41, 0x56, 0x85, 0x9b, 0x1b, 0x20, 0x4e, 0xd7, 0x04, 0x0f, 0x35, - 0x26, 0xe3, 0x3e, 0x0a, 0x09, 0x60, 0xd5, 0xdd, 0x73, 0xa6, 0x3e, - 0x4b, 0x0f, 0x20, 0x49, 0x9c, 0x34, 0x97, 0x28, 0x84, 0x5c, 0x52, - 0xd1, 0x01, 0xf5, 0xa9, 0x22, 0x26, 0xb1, 0x7f, 0x26, 0x09, 0x2c, - 0x28, 0xc2, 0x0c, 0xa8, 0x4f, 0x89, 0xd5, 0x03, 0x31, 0x3f, 0x35, - 0x46, 0x0a, 0x95, 0x44, 0xcd, 0x02, 0x99, 0x4c, 0xad, 0x97, 0xac, - 0xfb, 0xa9, 0x0a, 0x39, 0x15, 0xe0, 0xd5, 0xa2, 0xda, 0x20, 0x09, - 0x34, 0x48, 0xba, 0x7a, 0xb0, 0xb9, 0xa9, 0xa8, 0x11, 0xac, 0x7e, - 0x0a, 0x0c, 0xf0, 0x6e, 0xf8, 0xda, 0x14, 0x35, 0x36, 0x9b, 0x40, - 0x93, 0x05, 0x9c, 0x70, 0x51, 0x76, 0x76, 0xf5, 0xe6, 0x57, 0xa8, - 0x65, 0xd6, 0xcb, 0x42, 0x05, 0x0a, 0x10, 0x83, 0xc7, 0x7a, 0x2f, - 0x60, 0xfa, 0x41, 0xcc, 0x69, 0xbd, 0xdf, 0x75, 0x68, 0x96, 0x1a, - 0x23, 0xc7, 0x00, 0x7f, 0x73, 0xa0, 0x26, 0x7c, 0x62, 0xb1, 0x4e, - 0xeb, 0x55, 0x6a, 0xc5, 0x64, 0x5c, 0x1f, 0x59, 0xf7, 0xb3, 0x56, - 0xe8, 0x01, 0xf2, 0xf1, 0x38, 0x59, 0x00, 0xd5, 0x53, 0x71, 0xa1, - 0x72, 0x8e, 0xb5, 0x5c, 0xbb, 0xa6, 0x43, 0xec, 0x74, 0x00, 0xcd, - 0xaf, 0x32, 0x01, 0x0a, 0x80, 0x53, 0xa9, 0x49, 0xad, 0x25, 0x4d, - 0x56, 0x61, 0xa9, 0xc6, 0xb8, 0x64, 0xcf, 0xa1, 0x96, 0x3c, 0x50, - 0x58, 0x27, 0x0b, 0xb5, 0x5a, 0xdc, 0x4c, 0x6a, 0xf0, 0xb3, 0x51, - 0xab, 0x6a, 0x93, 0x55, 0x70, 0x2a, 0x40, 0x83, 0x42, 0x01, 0xf7, - 0xfd, 0x88, 0x5a, 0x41, 0xdd, 0xa9, 0xe6, 0x57, 0x55, 0x92, 0x2a, - 0xe7, 0xec, 0x05, 0x2d, 0x71, 0x3a, 0x00, 0x76, 0xa6, 0x00, 0xcd, - 0xef, 0x1f, 0x26, 0x8f, 0x87, 0x4a, 0xb6, 0x90, 0xd6, 0xd2, 0x84, - 0x64, 0xb6, 0x40, 0xe9, 0x74, 0x7e, 0x8d, 0x70, 0x23, 0x6b, 0x55, - 0x65, 0x2a, 0xae, 0xe4, 0x99, 0x08, 0x34, 0x51, 0x07, 0xe0, 0xbc, - 0x0a, 0x68, 0x3d, 0xea, 0x4e, 0xa5, 0x22, 0xa2, 0x56, 0xb7, 0xb6, - 0x5e, 0xc8, 0xca, 0xfe, 0x3f, 0x2a, 0x0a, 0x6c, 0xd6, 0x21, 0x76, - 0xa6, 0x01, 0xad, 0x51, 0x90, 0x73, 0x72, 0x47, 0x48, 0xa1, 0xa0, - 0xab, 0xb8, 0x6e, 0x8d, 0xac, 0x61, 0xac, 0x57, 0x71, 0xa9, 0xb4, - 0x05, 0x54, 0x75, 0x31, 0x67, 0x13, 0x64, 0x8d, 0x80, 0x9b, 0x0a, - 0xd8, 0x54, 0x0b, 0xae, 0x6a, 0x4d, 0xaa, 0xac, 0xda, 0x51, 0x01, - 0x4d, 0x23, 0x9a, 0xa3, 0xf8, 0x01, 0x5b, 0x15, 0x5e, 0xa7, 0x15, - 0x60, 0xaf, 0x17, 0xa0, 0xa9, 0xb8, 0xa9, 0x4e, 0x17, 0x9f, 0x5c, - 0x80, 0xa7, 0x12, 0x2b, 0x52, 0x85, 0x4c, 0xad, 0x79, 0x20, 0x19, - 0x17, 0x53, 0xd9, 0x0f, 0x14, 0xf3, 0x9d, 0x2e, 0x35, 0xd6, 0x48, - 0xc0, 0xc9, 0x28, 0x37, 0x55, 0xa0, 0xa9, 0xce, 0xd7, 0x0a, 0x42, - 0x15, 0x08, 0xaa, 0xba, 0xcc, 0xb2, 0xff, 0xdb, 0x19, 0xad, 0xbc, - 0xce, 0x46, 0xa0, 0xd5, 0x73, 0x61, 0x9d, 0xc0, 0xa6, 0x52, 0xc8, - 0xeb, 0x89, 0x45, 0xd5, 0x52, 0xc3, 0x28, 0x0b, 0x3e, 0x48, 0xba, - 0x90, 0xe4, 0xa2, 0x74, 0xfd, 0x3e, 0x61, 0xf3, 0x7b, 0x21, 0x34, - 0x0b, 0x72, 0xc2, 0x63, 0xff, 0x4e, 0x71, 0x56, 0x21, 0xb1, 0xad, - 0xf0, 0x51, 0xf9, 0xb5, 0xc6, 0xe1, 0xea, 0x55, 0x74, 0xaa, 0xdb, - 0xa9, 0xee, 0xaf, 0x16, 0x25, 0xfb, 0xba, 0x35, 0x1d, 0x67, 0xa7, - 0x09, 0xc5, 0x7c, 0xe4, 0xa2, 0x02, 0x65, 0xe1, 0xa7, 0x0a, 0x34, - 0x81, 0xe9, 0x1a, 0xd1, 0x7a, 0xd5, 0x94, 0x5a, 0xab, 0xfe, 0xfa, - 0xd2, 0x55, 0xd4, 0x9b, 0x6a, 0x01, 0x91, 0xdd, 0x46, 0xf8, 0xe4, - 0x57, 0x09, 0x4e, 0xab, 0xaa, 0x3a, 0x55, 0xd7, 0xcc, 0x2f, 0x2e, - 0xd7, 0x08, 0xb7, 0xb8, 0x51, 0x69, 0x67, 0x85, 0x9d, 0xad, 0x40, - 0x6b, 0x84, 0xb2, 0x13, 0x0d, 0x72, 0xd1, 0xdc, 0xd2, 0xb8, 0x02, - 0x50, 0x54, 0xa0, 0xe5, 0xd5, 0xb4, 0xc2, 0x0d, 0x88, 0x02, 0xcd, - 0x6b, 0x63, 0x46, 0x0d, 0xbc, 0x27, 0x2a, 0xdb, 0x0b, 0x45, 0xe8, - 0xd9, 0x41, 0x59, 0x0b, 0xec, 0x6a, 0x05, 0x22, 0x35, 0x70, 0xbb, - 0xd7, 0xa5, 0xab, 0x18, 0x00, 0xed, 0xf4, 0xba, 0xb0, 0x6e, 0x0f, - 0x94, 0x4a, 0x1c, 0xaa, 0x19, 0x79, 0x9b, 0x11, 0xd0, 0xa7, 0xd7, - 0xf9, 0x7d, 0x13, 0x0d, 0x5c, 0x57, 0x6b, 0x43, 0x5f, 0x55, 0xe5, - 0xa8, 0x0a, 0x65, 0x3f, 0xd5, 0x3a, 0x67, 0x2c, 0x00, 0x5a, 0x7d, - 0x85, 0x47, 0xc0, 0xff, 0x2b, 0x08, 0x99, 0x36, 0x77, 0x2a, 0x0f, - 0x63, 0x33, 0x82, 0xf7, 0xaa, 0xd0, 0xa2, 0x33, 0xec, 0x3e, 0x9c, - 0x0e, 0xe0, 0xd5, 0x0a, 0x29, 0xd5, 0xff, 0x81, 0x2b, 0xec, 0x47, - 0xcc, 0xf5, 0x42, 0x1a, 0x00, 0xed, 0xf4, 0x14, 0x30, 0x92, 0xdc, - 0x0f, 0x29, 0x1e, 0x4f, 0x05, 0x34, 0xcd, 0x00, 0xdd, 0x99, 0x7e, - 0x0f, 0x1a, 0x99, 0xcf, 0xad, 0x92, 0x21, 0x70, 0xfd, 0x02, 0xa0, - 0x05, 0x10, 0x54, 0xc8, 0x47, 0x0d, 0x2a, 0x30, 0x14, 0x5c, 0xf7, - 0xba, 0xf7, 0x11, 0x00, 0xea, 0x0c, 0xb3, 0xff, 0x3f, 0x00, 0x33, - 0x7e, 0xb5, 0x01, 0x3c, 0x57, 0x93, 0xe4, 0x00, 0x00, 0x00, 0x00, - 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 -}; - -unsigned int nxlogo_png_size = sizeof(nxlogo_png); - +#endif /* NX_IPERF_H */ -- cgit v1.3.1 From cb8dc31b2e7081e542c002232427378ca53f6f8a Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Tue, 28 Nov 2023 02:39:04 +0000 Subject: Enable all the build configurations. --- scripts/build_nxd.sh | 2 +- scripts/test_nxd.sh | 2 +- test/cmake/netxduo/CMakeLists.txt | 158 -------------------------------------- 3 files changed, 2 insertions(+), 160 deletions(-) diff --git a/scripts/build_nxd.sh b/scripts/build_nxd.sh index d9948699..2512fb67 100755 --- a/scripts/build_nxd.sh +++ b/scripts/build_nxd.sh @@ -1,3 +1,3 @@ #! /bin/bash -$(dirname `realpath $0`)/../test/cmake/netxduo/run.sh build default_build_coverage v4_full_build v6_full_build +$(dirname `realpath $0`)/../test/cmake/netxduo/run.sh build all diff --git a/scripts/test_nxd.sh b/scripts/test_nxd.sh index aad1f8bd..e0de4019 100755 --- a/scripts/test_nxd.sh +++ b/scripts/test_nxd.sh @@ -1,3 +1,3 @@ #! /bin/bash -CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo/run.sh test default_build_coverage v4_full_build +CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/cmake/netxduo/run.sh test all diff --git a/test/cmake/netxduo/CMakeLists.txt b/test/cmake/netxduo/CMakeLists.txt index 6ecaa22f..ef547351 100644 --- a/test/cmake/netxduo/CMakeLists.txt +++ b/test/cmake/netxduo/CMakeLists.txt @@ -24,16 +24,6 @@ set(BUILD_CONFIGURATIONS v4_no_chain_build v4_link_cap_build v4_address_check_build - v4_ipsec_build - v4_ipsec_dual_pool_build - v4_ipsec_packet_pad_build - v4_ipsec_small_build - v4_ipsec_full_build - v4_ipsec_no_frag_build - v4_ipsec_no_chain_build - v4_ipsec_no_check_build - v4_ipsec_no_reset_disconn_build - v4_ipsec_link_cap_build v6_build v6_only_build v6_only_link_cap_build @@ -55,22 +45,6 @@ set(BUILD_CONFIGURATIONS v6_address_change_build v6_multicast_build v6_no_rs_build - v6_ipsec_build - v6_ipsec_dual_pool_build - v6_ipsec_packet_pad_build - v6_ipsec_tahi_build - v6_ipsec_small_build - v6_ipsec_full_build - v6_ipsec_full_tahi_build - v6_ipsec_no_frag_build - v6_ipsec_no_chain_build - v6_ipsec_no_dad_build - v6_ipsec_no_check_build - v6_ipsec_no_check_tahi_build - v6_ipsec_no_icmpv6_error_build - v6_ipsec_no_reset_disconn_build - v6_ipsec_no_reset_disconn_tahi_build - v6_ipsec_link_cap_build v6_dhcp_tahi_build v6_bsd_raw_build v6_full_secure_build @@ -150,9 +124,6 @@ set(BSD set(TAHI -DNX_TAHI_ENABLE) set(IPV6 -DFEATURE_NX_IPV6) set(IPV6_PMTU_DISCOVERY -DNX_ENABLE_IPV6_PATH_MTU_DISCOVERY) -set(IPSEC -DNX_IPSEC_ENABLE -DNX_ENABLE_CCS -DNX_IPSEC_ANTI_REPLAY_ENABLE - -DNX_IPSEC_ESN_ENABLE -DNX_IPSEC_ENBALE_DEBUG_LOG) -set(IPSEC_TAHI -DNX_IPSEC_ENABLE) set(NO_DAD -DNX_DISABLE_IPV6_DAD) set(NO_ICMPV6_ERROR -DNX_DISABLE_ICMPV6_ERROR_MESSAGE) set(NO_CHAIN -DNX_DISABLE_PACKET_CHAIN -DNX_DISABLE_FRAGMENTATION) @@ -273,41 +244,6 @@ set(v4_no_chain_build ${IPV4} ${NO_CHAIN} ${MDNS_NO_SERVER}) set(v4_link_cap_build ${IPV4} ${LINK_CAP} ${RX_INTERFACE_CAPABILITY} ${MULTI_INTERFACE} ${TCPIP_OFFLOAD}) set(v4_address_check_build ${IPV4} ${ADDRESS_CHECK}) -set(v4_ipsec_build ${IPV4} ${IPSEC} ${PACKET_DEBUG}) -set(v4_ipsec_dual_pool_build ${IPV4} ${IPSEC} ${DUAL_POOL}) -set(v4_ipsec_packet_pad_build ${IPV4} ${IPSEC} ${PACKET_PAD}) -set(v4_ipsec_small_build - ${IPV4} - ${IPSEC} - ${NO_INFO} - ${NO_FRAG} - ${NO_CHECK} - ${NO_RESET_DISCONNECT} - ${MDNS_NO_CLIENT}) -set(v4_ipsec_full_build - ${IPV4} - ${IPSEC} - ${TCP_KEEPALIVE} - ${TCP_KEEPALIVE_INITIAL} - ${TCP_KEEPALIVE_RETRY} - ${TCP_KEEPALIVE_RETRIES} - ${TCP_WINDOW} - ${IP_STATIC_ROUTING} - ${BSD} - ${MULTI_INTERFACE} - ${MULTIPART} - ${NAT} - ${PACKET_DEBUG} - ${DUAL_POOL} - ${IP_PACKET_FILTER} - ${DHCP_ARP_PROBE}) -set(v4_ipsec_no_frag_build ${IPV4} ${IPSEC} ${NO_FRAG}) -set(v4_ipsec_no_chain_build ${IPV4} ${IPSEC} ${NO_CHAIN}) -set(v4_ipsec_no_check_build ${IPV4} ${IPSEC} ${NO_CHECK} ${BSD} - ${MULTI_INTERFACE} ${NAT}) -set(v4_ipsec_no_reset_disconn_build ${IPV4} ${IPSEC} ${NO_RESET_DISCONNECT} - ${MDNS_NO_SERVER}) -set(v4_ipsec_link_cap_build ${IPV4} ${IPSEC} ${LINK_CAP}) set(v6_build ${IPV6}) set(v6_only_build ${IPV6} ${NO_IPV4} ${TRACE} ${MDNS_NO_CLIENT}) set(v6_only_link_cap_build ${IPV6} ${NO_IPV4} ${LINK_CAP}) @@ -384,101 +320,7 @@ set(v6_link_cap_build ${IPV6} ${LINK_CAP} ${TX_RX_INTERFACE_CAPABILITY} ${MULTI_INTERFACE}) set(v6_address_change_build ${IPV6} ${ADDRESS_CHANGE_NOTIFY} ${MDNS_NO_SERVER}) set(v6_multicast_build ${IPV6} ${MULTICAST} ${MULTI_INTERFACE}) -set(v6_ipsec_build - ${IPV6} - ${IPSEC} - ${BSD} - ${BSD_DNS} - ${MULTI_INTERFACE} - ${NAT} - ${PACKET_DEBUG} - ${TCP_RX_LIMIT} - ${CREATE_TELNET_PACKET_POOL} - ${TELNET_MAX_CLIENTS} - ${TELNET_ACTIVITY_TIMEOUT} - ${TELNET_TIMEOUT_PERIOD} - ${LCP_PROTOCOL_RETRIES} - ${IPCP_PROTOCOL_RETRIES} - ${LOW_WATERMARK} - ${IP_PACKET_FILTER} - ${TRACE} - ${MDNS_IPV6}) -set(v6_ipsec_dual_pool_build ${IPV6} ${IPSEC} ${DUAL_POOL}) -set(v6_ipsec_packet_pad_build ${IPV6} ${IPSEC} ${PACKET_PAD}) -set(v6_ipsec_tahi_build - ${IPV6} - ${IPSEC_TAHI} - ${TAHI} - ${BSD} - ${MULTI_INTERFACE} - ${IPV6_PMTU_DISCOVERY} - ${NAT}) -set(v6_ipsec_small_build - ${IPV6} - ${IPSEC} - ${NO_INFO} - ${NO_FRAG} - ${NO_DAD} - ${NO_CHECK} - ${NO_ICMPV6_ERROR} - ${NO_RESET_DISCONNECT} - ${PACKET_DEBUG}) -set(v6_ipsec_full_build - ${IPV6} - ${IPSEC_TAHI} - ${IPV6_PMTU_DISCOVERY} - ${TCP_KEEPALIVE} - ${TCP_KEEPALIVE_INITIAL} - ${TCP_KEEPALIVE_RETRY} - ${TCP_KEEPALIVE_RETRIES} - ${TCP_WINDOW} - ${IP_STATIC_ROUTING} - ${TAHI} - ${MULTIPART} - ${DUAL_POOL} - ${LOW_WATERMARK} - ${IP_PACKET_FILTER} - ${DHCP_ARP_PROBE} - ${MDNS_IPV6}) -set(v6_ipsec_full_tahi_build - ${IPV6} - ${IPSEC_TAHI} - ${TCP_KEEPALIVE} - ${TCP_KEEPALIVE_INITIAL} - ${TCP_KEEPALIVE_RETRY} - ${TCP_KEEPALIVE_RETRIES} - ${TCP_WINDOW} - ${IP_STATIC_ROUTING} - ${TAHI} - ${BSD} - ${MULTI_INTERFACE} - ${STATELESS_AC} - ${NAT} - ${LOW_WATERMARK} - ${DHCP_ARP_PROBE} - ${IPV6_PMTU_DISCOVERY} - ${MDNS_IPV6}) -set(v6_ipsec_no_frag_build ${IPV6} ${IPSEC} ${NO_FRAG}) -set(v6_ipsec_no_chain_build ${IPV6} ${IPSEC} ${NO_CHAIN} ${MDNS_NO_CLIENT}) -set(v6_ipsec_no_dad_build ${IPV6} ${IPSEC} ${NO_DAD}) -set(v6_ipsec_no_check_build ${IPV6} ${IPSEC_TAHI} ${NO_CHECK} ${TAHI} - ${IPV6_PMTU_DISCOVERY}) -set(v6_ipsec_no_check_tahi_build - ${IPV6} - ${IPSEC_TAHI} - ${NO_CHECK} - ${TAHI} - ${BSD} - ${MULTI_INTERFACE} - ${STATELESS_AC} - ${NAT}) set(v6_no_rs_build ${IPV6} ${STATELESS_AC} ${NO_RS}) -set(v6_ipsec_no_icmpv6_error_build ${IPV6} ${IPSEC} ${NO_ICMPV6_ERROR}) -set(v6_ipsec_no_reset_disconn_build - ${IPV6} ${IPSEC_TAHI} ${NO_RESET_DISCONNECT} ${TAHI} ${IPV6_PMTU_DISCOVERY}) -set(v6_ipsec_no_reset_disconn_tahi_build - ${IPV6} ${IPSEC_TAHI} ${NO_RESET_DISCONNECT} ${TAHI} ${MDNS_NO_SERVER}) -set(v6_ipsec_link_cap_build ${IPV6} ${IPSEC} ${LINK_CAP}) set(v6_dhcp_tahi_build ${IPV6} ${ADDRESS_CHANGE_NOTIFY} ${DHCPV6_TAHI} ${TAHI} ${IPV6_PMTU_DISCOVERY}) set(v6_bsd_raw_build ${IPV6} ${BSD_RAW} ${MULTI_INTERFACE} ${RAW_ALL_STACK}) -- cgit v1.3.1 From bede32dcd438ba7420ba34d347712f6cf23d8267 Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Wed, 29 Nov 2023 01:56:56 +0000 Subject: Update the name of steps. --- .github/workflows/regression_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml index 0e19b390..d9256157 100644 --- a/.github/workflows/regression_test.yml +++ b/.github/workflows/regression_test.yml @@ -13,7 +13,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - nxd: + NetXDuo: permissions: contents: read issues: read @@ -28,7 +28,7 @@ jobs: cmake_path: ./test/cmake/netxduo result_affix: NetXDuo skip_deploy: true - deploy: + Deploy: permissions: contents: read issues: read @@ -36,7 +36,7 @@ jobs: pull-requests: write pages: write id-token: write - needs: [nxd] + needs: [NetXDuo] uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master with: skip_test: true -- cgit v1.3.1 From 4fc7650fcedd5b1e90fa4f2d7aa144f8795122ed Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Wed, 29 Nov 2023 06:19:27 +0000 Subject: Remove deprecated tests. --- .../netx_auto_ip_conflicts_check_test.c | 320 --- test/regression/bsd_test/bsd_test_setup.docx | Bin 24408 -> 0 bytes .../netx_bsd_tcp_getsockname_without_bind_test.c | 2 - .../regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c | 3 +- .../netx_bsd_tcp_servers_share_port_test.c | 4 +- .../regression/dhcp_test/netx_dhcp_03_01_02_test.c | 335 ---- .../regression/dhcp_test/netx_dhcp_03_01_03_test.c | 404 ---- .../regression/dhcp_test/netx_dhcp_03_04_01_test.c | 367 ---- ...client_arp_probe_fail_multiple_interface_test.c | 1033 ---------- ..._dhcp_client_arpprobe_fail_multiple_interface.c | 1077 ----------- .../dhcp_test/netx_dhcp_client_arpprobe_fails.c | 702 ------- .../netx_dhcp_client_arpprobe_multiple_interface.c | 950 --------- ..._dhcp_client_arpprobe_multiple_interface_test.c | 949 --------- .../dhcp_test/netx_dhcp_client_arpprobe_succeeds.c | 614 ------ .../dhcp_test/netx_dhcp_client_decline_test.c | 999 ---------- .../netx_dhcp_client_interface_0_only_test.c | 2 +- .../netx_dhcp_client_interface_1_only_test.c | 2 +- .../netx_dhcp_client_special_attributes_test.c | 12 +- .../dhcp_test/netx_dhcp_client_two_interfaces.c | 11 +- test/regression/ftp_test/netx_ftp_rst_test.c | 1 - .../ftp_test/netx_ftp_service_commands_dele_test.c | 396 ---- .../netx_ftp_service_commands_file_write_test.c | 2 +- .../netx_ftp_service_commands_m_d_dir_test.c | 424 ---- .../regression/ftp_test/netx_ftp_two_listen_test.c | 4 +- .../http_test/netx_http_status_400_test.c | 406 ---- .../http_test/netx_http_status_501_test.c | 315 --- test/regression/mdns_test/capture/_http._tcp.c | 59 - .../regression/mdns_test/capture/_http._tcp.pcapng | Bin 1376 -> 0 bytes .../mdns_test/capture/_pdl-datastream._tcp.c | 131 -- .../mdns_test/capture/_pdl-datastream._tcp.pcapng | Bin 2564 -> 0 bytes test/regression/mdns_test/capture/_printer._tcp.c | 125 -- .../mdns_test/capture/_printer._tcp.pcapng | Bin 2460 -> 0 bytes test/regression/mdns_test/capture/_smb._tcp.c | 102 - test/regression/mdns_test/capture/_smb._tcp.pcapng | Bin 1672 -> 0 bytes test/regression/mdns_test/capture/address_change.c | 346 ---- .../mdns_test/capture/address_change.pcapng | Bin 3152 -> 0 bytes .../capture/announcement_in_multiple_packets.c | 1935 ------------------- .../announcement_in_multiple_packets.pcapng | Bin 15852 -> 0 bytes .../mdns_test/capture/case_insensitivity.c | 36 - .../mdns_test/capture/case_insensitivity.pcapng | Bin 684 -> 0 bytes test/regression/mdns_test/capture/client_passive.c | 209 -- .../mdns_test/capture/client_passive.pcapng | Bin 2064 -> 0 bytes test/regression/mdns_test/capture/command.txt | 4 - .../mdns_test/capture/continuous_query.c | 122 -- .../mdns_test/capture/continuous_query.pcapng | Bin 2444 -> 0 bytes .../mdns_test/capture/continuous_query_a.c | 30 - .../mdns_test/capture/continuous_query_a.pcapng | Bin 640 -> 0 bytes .../capture/continuous_query_unique_answer.c | 53 - .../capture/continuous_query_unique_answer.pcapng | Bin 816 -> 0 bytes test/regression/mdns_test/capture/dns_sd_query.c | 351 ---- .../mdns_test/capture/dns_sd_query.pcapng | Bin 3432 -> 0 bytes .../capture/duplicate_question_suppression.c | 182 -- .../mdns_test/capture/error_response.pcapng | Bin 4384 -> 0 bytes test/regression/mdns_test/capture/ipv6_query.c | 68 - .../regression/mdns_test/capture/ipv6_query.pcapng | Bin 1376 -> 0 bytes .../mdns_test/capture/known_answer_suppression.c | 101 - .../capture/known_answer_suppression.pcapng | Bin 2088 -> 0 bytes .../known_answer_suppression_query_half_ttl.c | 172 -- .../known_answer_suppression_query_half_ttl.pcapng | Bin 1756 -> 0 bytes .../capture/known_answer_suppression_response.c | 82 - .../known_answer_suppression_response.pcapng | Bin 1048 -> 0 bytes .../capture/mdns_known_answer_suppression_unique.c | 26 - .../mdns_known_answer_suppression_unique.pcapng | Bin 644 -> 0 bytes .../capture/multiple_questions_per_query.c | 68 - .../capture/multiple_questions_per_query.pcapng | Bin 948 -> 0 bytes test/regression/mdns_test/capture/one_shot_query.c | 86 - .../mdns_test/capture/one_shot_query.pcapng | Bin 1080 -> 0 bytes .../mdns_test/capture/probing_conflict.c | 280 --- .../mdns_test/capture/probing_conflict.pcapng | Bin 2600 -> 0 bytes .../mdns_test/capture/probing_conflict_any_type.c | 139 -- .../capture/probing_conflict_any_type.pcapng | Bin 1492 -> 0 bytes .../mdns_test/capture/query_and_response_chaos.c | 2034 -------------------- .../capture/query_and_response_chaos.pcapng | Bin 16524 -> 0 bytes .../mdns_test/capture/query_and_response_v6.c | 99 - .../mdns_test/capture/query_and_response_v6.pcapng | Bin 1188 -> 0 bytes .../mdns_test/capture/query_during_probing_1.c | 240 --- .../capture/query_during_probing_1.pcapng | Bin 2292 -> 0 bytes .../mdns_test/capture/query_during_probing_2.c | 56 - .../capture/query_during_probing_2.pcapng | Bin 840 -> 0 bytes test/regression/mdns_test/capture/query_rr_a.c | 42 - .../regression/mdns_test/capture/query_rr_a.pcapng | Bin 732 -> 0 bytes .../mdns_test/capture/query_rr_timeout.c | 83 - .../mdns_test/capture/query_rr_timeout.pcapng | Bin 1052 -> 0 bytes .../mdns_test/capture/query_start_stop.c | 110 -- .../mdns_test/capture/query_start_stop.pcapng | Bin 1264 -> 0 bytes test/regression/mdns_test/capture/query_with_tc.c | 658 ------- .../mdns_test/capture/query_with_tc.pcapng | Bin 5644 -> 0 bytes .../mdns_test/capture/responder_cooperating.c | 52 - .../mdns_test/capture/responder_cooperating.pcapng | Bin 808 -> 0 bytes .../mdns_test/capture/responder_cooperating_2.c | 54 - .../capture/responder_cooperating_2.pcapng | Bin 828 -> 0 bytes test/regression/mdns_test/capture/response_a.c | 99 - .../regression/mdns_test/capture/response_a.pcapng | Bin 1196 -> 0 bytes .../mdns_test/capture/response_aggregation.c | 182 -- .../mdns_test/capture/response_aggregation.pcapng | Bin 1840 -> 0 bytes .../capture/response_in_multiple_packets.c | 470 ----- .../capture/response_in_multiple_packets.pcapng | Bin 4140 -> 0 bytes .../mdns_test/capture/response_interval.c | 85 - .../mdns_test/capture/response_interval.pcapng | Bin 1072 -> 0 bytes .../mdns_test/capture/response_interval_2.c | 520 ----- .../mdns_test/capture/response_interval_2.pcapng | Bin 4512 -> 0 bytes .../mdns_test/capture/response_no_delay.c | 36 - .../mdns_test/capture/response_no_delay.pcapng | Bin 684 -> 0 bytes .../mdns_test/capture/response_to_address_query.c | 42 - .../capture/response_to_address_query.pcapng | Bin 732 -> 0 bytes .../mdns_test/capture/response_with_tc.c | 110 -- .../mdns_test/capture/response_with_tc.pcapng | Bin 1272 -> 0 bytes test/regression/mdns_test/capture/rr_timeout.c | 87 - .../regression/mdns_test/capture/rr_timeout.pcapng | Bin 1088 -> 0 bytes test/regression/mdns_test/capture/send_goodbye.c | 229 --- .../mdns_test/capture/send_goodbye.pcapng | Bin 2220 -> 0 bytes .../mdns_test/capture/server_announcement.c | 282 --- .../mdns_test/capture/server_announcement.pcapng | Bin 2628 -> 0 bytes .../mdns_test/capture/server_announcement_v6.c | 327 ---- .../capture/server_announcement_v6.pcapng | Bin 3008 -> 0 bytes .../capture/server_announcement_with_txt.c | 276 --- .../capture/server_announcement_with_txt.pcapng | Bin 2604 -> 0 bytes .../mdns_test/capture/server_interface_reset.c | 628 ------ .../capture/server_interface_reset.pcapng | Bin 5396 -> 0 bytes test/regression/mdns_test/mdns_test_setup.docx | Bin 42485 -> 0 bytes .../netx_nat_entry_removed_after_timeout_test.c | 2 +- test/regression/netxduo_test/netx_11_23_test.c | 380 ---- test/regression/netxduo_test/netx_18_21_test.c | 371 ---- .../netx_arp_static_entry_pollute_test.c | 3 +- .../netx_tcp_ack_before_release_test.c | 313 --- .../netx_tcp_client_packet_leak_test.c | 3 +- .../netx_tcp_zero_window_probe_3_test.c | 4 +- .../netx_smtp_missing_last_250_EHLO_message_test.c | 2 +- test/regression/smtp_test/smtp_test_files.mk | 15 - .../netx_snmp_no_security_function_test.c | 4 +- .../snmp_test/netx_snmp_v2_get_bulk_request_test.c | 4 - test/regression/tahi_test/netx_tahi_test_3_43.c | 150 -- test/regression/tahi_test/netx_tahi_test_3_44.c | 150 -- test/regression/tahi_test/netx_tahi_test_3_45.c | 150 -- test/regression/tahi_test/netx_tahi_test_ipsec.c | 625 ------ test/regression/tahi_test/netx_tahi_test_ipsec_2.c | 899 --------- .../tahi_test/netx_tahi_test_ipsec_udp.c | 671 ------- .../tahi_test/netx_tahi_test_ipsec_udp_2.c | 968 ---------- test/regression/tahi_test/tahi_ipsec_001.c | 163 -- test/regression/tahi_test/tahi_ipsec_002.c | 147 -- test/regression/tahi_test/tahi_ipsec_003.c | 121 -- test/regression/tahi_test/tahi_ipsec_004.c | 119 -- test/regression/tahi_test/tahi_ipsec_005.c | 1411 -------------- test/regression/tahi_test/tahi_ipsec_006.c | 181 -- test/regression/tahi_test/tahi_ipsec_007.c | 135 -- test/regression/tahi_test/tahi_ipsec_008.c | 110 -- test/regression/tahi_test/tahi_ipsec_008_02.c | 46 - test/regression/tahi_test/tahi_ipsec_009.c | 82 - test/regression/tahi_test/tahi_ipsec_009_02.c | 32 - test/regression/tahi_test/tahi_ipsec_010.c | 148 -- test/regression/tahi_test/tahi_ipsec_012.c | 102 - test/regression/tahi_test/tahi_ipsec_013.c | 102 - test/regression/tahi_test/tahi_ipsec_014.c | 82 - test/regression/tahi_test/tahi_ipsec_015.c | 82 - test/regression/tahi_test/tahi_ipsec_016.c | 78 - test/regression/tahi_test/tahi_ipsec_017.c | 85 - test/regression/tahi_test/tahi_ipsec_018.c | 82 - test/regression/tahi_test/tahi_ipsec_019.c | 79 - test/regression/tahi_test/tahi_ipsec_022.c | 92 - test/regression/tahi_test/tahi_ipsec_023.c | 92 - test/regression/tahi_test/tahi_ipsec_024.c | 139 -- test/regression/tahi_test/tahi_ipsec_025.c | 169 -- test/regression/tahi_test/tahi_ipsec_026.c | 93 - test/regression/tahi_test/tahi_ipsec_udp_001.c | 165 -- test/regression/tahi_test/tahi_ipsec_udp_002.c | 147 -- test/regression/tahi_test/tahi_ipsec_udp_004.c | 119 -- test/regression/tahi_test/tahi_ipsec_udp_005.c | 1279 ------------ test/regression/tahi_test/tahi_ipsec_udp_006.c | 180 -- test/regression/tahi_test/tahi_ipsec_udp_007.c | 135 -- test/regression/tahi_test/tahi_ipsec_udp_008.c | 139 -- test/regression/tahi_test/tahi_ipsec_udp_009.c | 82 - test/regression/tahi_test/tahi_ipsec_udp_009_02.c | 32 - test/regression/tahi_test/tahi_ipsec_udp_010.c | 148 -- test/regression/tahi_test/tahi_ipsec_udp_011.c | 83 - test/regression/tahi_test/tahi_ipsec_udp_012.c | 101 - test/regression/tahi_test/tahi_ipsec_udp_013.c | 236 --- test/regression/tahi_test/tahi_ipsec_udp_014.c | 82 - test/regression/tahi_test/tahi_ipsec_udp_015.c | 82 - test/regression/tahi_test/tahi_ipsec_udp_016.c | 78 - test/regression/tahi_test/tahi_ipsec_udp_017.c | 85 - test/regression/tahi_test/tahi_ipsec_udp_018.c | 82 - test/regression/tahi_test/tahi_ipsec_udp_019.c | 79 - test/regression/tahi_test/tahi_ipsec_udp_022.c | 92 - test/regression/tahi_test/tahi_ipsec_udp_023.c | 92 - test/regression/tahi_test/tahi_ipsec_udp_024.c | 139 -- test/regression/tahi_test/tahi_ipsec_udp_025.c | 168 -- test/regression/tahi_test/tahi_ipsec_udp_026.c | 92 - .../netx_telnet_activity_timeout_test.c | 2 +- test/regression/telnet_test/netx_telnet_rst_test.c | 1 - .../telnet_test/netx_telnet_two_listen_test.c | 1 - test/regression/test/netxtestcontrol.c | 286 +-- .../test/nx_ram_network_driver_test_1500.c | 104 +- .../web_test/netx_web_tcpserver_rst_test.c | 4 +- .../web_test/netx_web_tcpserver_two_listen_test.c | 4 +- 194 files changed, 69 insertions(+), 33778 deletions(-) delete mode 100644 test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c delete mode 100644 test/regression/bsd_test/bsd_test_setup.docx delete mode 100644 test/regression/dhcp_test/netx_dhcp_03_01_02_test.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_03_01_03_test.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_03_04_01_test.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c delete mode 100644 test/regression/dhcp_test/netx_dhcp_client_decline_test.c delete mode 100644 test/regression/ftp_test/netx_ftp_service_commands_dele_test.c delete mode 100644 test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c delete mode 100644 test/regression/http_test/netx_http_status_400_test.c delete mode 100644 test/regression/http_test/netx_http_status_501_test.c delete mode 100644 test/regression/mdns_test/capture/_http._tcp.c delete mode 100644 test/regression/mdns_test/capture/_http._tcp.pcapng delete mode 100644 test/regression/mdns_test/capture/_pdl-datastream._tcp.c delete mode 100644 test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng delete mode 100644 test/regression/mdns_test/capture/_printer._tcp.c delete mode 100644 test/regression/mdns_test/capture/_printer._tcp.pcapng delete mode 100644 test/regression/mdns_test/capture/_smb._tcp.c delete mode 100644 test/regression/mdns_test/capture/_smb._tcp.pcapng delete mode 100644 test/regression/mdns_test/capture/address_change.c delete mode 100644 test/regression/mdns_test/capture/address_change.pcapng delete mode 100644 test/regression/mdns_test/capture/announcement_in_multiple_packets.c delete mode 100644 test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng delete mode 100644 test/regression/mdns_test/capture/case_insensitivity.c delete mode 100644 test/regression/mdns_test/capture/case_insensitivity.pcapng delete mode 100644 test/regression/mdns_test/capture/client_passive.c delete mode 100644 test/regression/mdns_test/capture/client_passive.pcapng delete mode 100644 test/regression/mdns_test/capture/command.txt delete mode 100644 test/regression/mdns_test/capture/continuous_query.c delete mode 100644 test/regression/mdns_test/capture/continuous_query.pcapng delete mode 100644 test/regression/mdns_test/capture/continuous_query_a.c delete mode 100644 test/regression/mdns_test/capture/continuous_query_a.pcapng delete mode 100644 test/regression/mdns_test/capture/continuous_query_unique_answer.c delete mode 100644 test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng delete mode 100644 test/regression/mdns_test/capture/dns_sd_query.c delete mode 100644 test/regression/mdns_test/capture/dns_sd_query.pcapng delete mode 100644 test/regression/mdns_test/capture/duplicate_question_suppression.c delete mode 100644 test/regression/mdns_test/capture/error_response.pcapng delete mode 100644 test/regression/mdns_test/capture/ipv6_query.c delete mode 100644 test/regression/mdns_test/capture/ipv6_query.pcapng delete mode 100644 test/regression/mdns_test/capture/known_answer_suppression.c delete mode 100644 test/regression/mdns_test/capture/known_answer_suppression.pcapng delete mode 100644 test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c delete mode 100644 test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng delete mode 100644 test/regression/mdns_test/capture/known_answer_suppression_response.c delete mode 100644 test/regression/mdns_test/capture/known_answer_suppression_response.pcapng delete mode 100644 test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c delete mode 100644 test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng delete mode 100644 test/regression/mdns_test/capture/multiple_questions_per_query.c delete mode 100644 test/regression/mdns_test/capture/multiple_questions_per_query.pcapng delete mode 100644 test/regression/mdns_test/capture/one_shot_query.c delete mode 100644 test/regression/mdns_test/capture/one_shot_query.pcapng delete mode 100644 test/regression/mdns_test/capture/probing_conflict.c delete mode 100644 test/regression/mdns_test/capture/probing_conflict.pcapng delete mode 100644 test/regression/mdns_test/capture/probing_conflict_any_type.c delete mode 100644 test/regression/mdns_test/capture/probing_conflict_any_type.pcapng delete mode 100644 test/regression/mdns_test/capture/query_and_response_chaos.c delete mode 100644 test/regression/mdns_test/capture/query_and_response_chaos.pcapng delete mode 100644 test/regression/mdns_test/capture/query_and_response_v6.c delete mode 100644 test/regression/mdns_test/capture/query_and_response_v6.pcapng delete mode 100644 test/regression/mdns_test/capture/query_during_probing_1.c delete mode 100644 test/regression/mdns_test/capture/query_during_probing_1.pcapng delete mode 100644 test/regression/mdns_test/capture/query_during_probing_2.c delete mode 100644 test/regression/mdns_test/capture/query_during_probing_2.pcapng delete mode 100644 test/regression/mdns_test/capture/query_rr_a.c delete mode 100644 test/regression/mdns_test/capture/query_rr_a.pcapng delete mode 100644 test/regression/mdns_test/capture/query_rr_timeout.c delete mode 100644 test/regression/mdns_test/capture/query_rr_timeout.pcapng delete mode 100644 test/regression/mdns_test/capture/query_start_stop.c delete mode 100644 test/regression/mdns_test/capture/query_start_stop.pcapng delete mode 100644 test/regression/mdns_test/capture/query_with_tc.c delete mode 100644 test/regression/mdns_test/capture/query_with_tc.pcapng delete mode 100644 test/regression/mdns_test/capture/responder_cooperating.c delete mode 100644 test/regression/mdns_test/capture/responder_cooperating.pcapng delete mode 100644 test/regression/mdns_test/capture/responder_cooperating_2.c delete mode 100644 test/regression/mdns_test/capture/responder_cooperating_2.pcapng delete mode 100644 test/regression/mdns_test/capture/response_a.c delete mode 100644 test/regression/mdns_test/capture/response_a.pcapng delete mode 100644 test/regression/mdns_test/capture/response_aggregation.c delete mode 100644 test/regression/mdns_test/capture/response_aggregation.pcapng delete mode 100644 test/regression/mdns_test/capture/response_in_multiple_packets.c delete mode 100644 test/regression/mdns_test/capture/response_in_multiple_packets.pcapng delete mode 100644 test/regression/mdns_test/capture/response_interval.c delete mode 100644 test/regression/mdns_test/capture/response_interval.pcapng delete mode 100644 test/regression/mdns_test/capture/response_interval_2.c delete mode 100644 test/regression/mdns_test/capture/response_interval_2.pcapng delete mode 100644 test/regression/mdns_test/capture/response_no_delay.c delete mode 100644 test/regression/mdns_test/capture/response_no_delay.pcapng delete mode 100644 test/regression/mdns_test/capture/response_to_address_query.c delete mode 100644 test/regression/mdns_test/capture/response_to_address_query.pcapng delete mode 100644 test/regression/mdns_test/capture/response_with_tc.c delete mode 100644 test/regression/mdns_test/capture/response_with_tc.pcapng delete mode 100644 test/regression/mdns_test/capture/rr_timeout.c delete mode 100644 test/regression/mdns_test/capture/rr_timeout.pcapng delete mode 100644 test/regression/mdns_test/capture/send_goodbye.c delete mode 100644 test/regression/mdns_test/capture/send_goodbye.pcapng delete mode 100644 test/regression/mdns_test/capture/server_announcement.c delete mode 100644 test/regression/mdns_test/capture/server_announcement.pcapng delete mode 100644 test/regression/mdns_test/capture/server_announcement_v6.c delete mode 100644 test/regression/mdns_test/capture/server_announcement_v6.pcapng delete mode 100644 test/regression/mdns_test/capture/server_announcement_with_txt.c delete mode 100644 test/regression/mdns_test/capture/server_announcement_with_txt.pcapng delete mode 100644 test/regression/mdns_test/capture/server_interface_reset.c delete mode 100644 test/regression/mdns_test/capture/server_interface_reset.pcapng delete mode 100644 test/regression/mdns_test/mdns_test_setup.docx delete mode 100644 test/regression/netxduo_test/netx_11_23_test.c delete mode 100644 test/regression/netxduo_test/netx_18_21_test.c delete mode 100644 test/regression/netxduo_test/netx_tcp_ack_before_release_test.c delete mode 100644 test/regression/smtp_test/smtp_test_files.mk delete mode 100644 test/regression/tahi_test/netx_tahi_test_3_43.c delete mode 100644 test/regression/tahi_test/netx_tahi_test_3_44.c delete mode 100644 test/regression/tahi_test/netx_tahi_test_3_45.c delete mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec.c delete mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec_2.c delete mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec_udp.c delete mode 100644 test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_001.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_002.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_003.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_004.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_005.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_006.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_007.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_008.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_008_02.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_009.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_009_02.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_010.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_012.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_013.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_014.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_015.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_016.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_017.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_018.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_019.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_022.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_023.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_024.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_025.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_026.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_001.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_002.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_004.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_005.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_006.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_007.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_008.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_009.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_009_02.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_010.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_011.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_012.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_013.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_014.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_015.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_016.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_017.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_018.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_019.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_022.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_023.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_024.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_025.c delete mode 100644 test/regression/tahi_test/tahi_ipsec_udp_026.c diff --git a/test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c b/test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c deleted file mode 100644 index 5586a280..00000000 --- a/test/regression/auto_ip_test/netx_auto_ip_conflicts_check_test.c +++ /dev/null @@ -1,320 +0,0 @@ -/* This is a small demo of the NetX TCP/IP stack using the AUTO IP module. */ - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_tcp.h" -#include "nx_arp.h" - -#include "nx_auto_ip.h" -#include "nx_ram_network_driver_test_1500.h" - - -#define DEMO_STACK_SIZE 4096 - -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD ntest_0; - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; - - - -/* Define the AUTO IP structures for each IP instance. */ - -static NX_AUTO_IP auto_ip_0; - - -/* Define the counters used in the demo application... */ -static ULONG address_changes; -static ULONG error_counter; -static UINT checkNum; -static UINT conflicts_check_counter; -static UINT conflicts_counter; -static UINT is_conflicted; - -/* Define thread prototypes. */ - -static void ntest_0_entry(ULONG thread_input); -static void ip_address_changed(NX_IP *ip_ptr, VOID *auto_ip_address); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static UINT my_arp_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); - -/* Define what the initial system looks like. */ -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_auto_ip_conflicts_check_test_application_define(void *first_unused_memory) -#endif -{ - -CHAR *pointer; -UINT status; - - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - - /* Initializes the variables. */ - error_counter = 0; - conflicts_check_counter = 0; - conflicts_counter = 0; - is_conflicted = NX_FALSE; - - checkNum = NX_AUTO_IP_PROBE_NUM + NX_AUTO_IP_ANNOUNCE_NUM; - - /* Create the main thread. */ - tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 4096, 1); - pointer = pointer + 4096; - - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check ARP enable status. */ - if (status) - error_counter++; - - /* Enable TCP processing for both IP instances. */ - status = nx_tcp_enable(&ip_0); - - /* Check UDP enable status. */ - if (status) - error_counter++; - - /* Create the AutoIP instance for each IP instance. */ - status = nx_auto_ip_create(&auto_ip_0, "AutoIP 0", &ip_0, pointer, 4096, 2); - pointer = pointer + 4096; - - /* Check AutoIP create status. */ - if (status) - error_counter++; - - /* Start both AutoIP instances. */ - status = nx_auto_ip_start(&auto_ip_0, IP_ADDRESS(169,254,10,10)); - - /* Check AutoIP start status. */ - if (status) - error_counter++; - - - /* Register an IP address change function for each IP instance. */ - status = nx_ip_address_change_notify(&ip_0, ip_address_changed, (void *) &auto_ip_0); - - /* Check IP address change notify status. */ - if (status) - error_counter++; -} - - - -/* Define the test threads. */ - -void ntest_0_entry(ULONG thread_input) -{ - -UINT status; -ULONG actual_status; -UINT i; - - printf("NetX Test: Auto_IP Conflicts Check Processing Test..................."); - - advanced_packet_process_callback = my_arp_packet_process; - - - /* Wait for IP address to be resolved. */ - for(i=0; i nx_packet_prepend_ptr; - - /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will - swap the endian of the ARP message. */ - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); - - /* Pickup the ARP message type. */ - message_type = (UINT) (*(message_ptr+1) & 0xFFFF); - - /* Pick up the sender's physical address from the message. */ - sender_physical_msw = (*(message_ptr+2) >> 16); - sender_physical_lsw = (*(message_ptr+2) << 16) | (*(message_ptr+3) >> 16); - target_ip_address = (*(message_ptr+6)); - - if (message_type != NX_ARP_OPTION_REQUEST) - error_counter++; - else - { - if((sender_physical_msw == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_physical_address_msw) && (sender_physical_lsw == ip_ptr -> nx_ip_interface[auto_ip_0.nx_ip_interface_index].nx_interface_physical_address_lsw) - && (target_ip_address == IP_ADDRESS(169,254,10,10)) && (conflicts_check_counter == 0)) - { - sender_physical_msw = 0; - conflicts_check_counter = 1; - conflicts_counter = auto_ip_0.nx_auto_ip_conflict_count; - } - else if(conflicts_check_counter == 1) - { - if(auto_ip_0.nx_auto_ip_conflict_count == (conflicts_counter + 1)) - is_conflicted = NX_TRUE; - - advanced_packet_process_callback = NX_NULL; - } - - } - - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); - - - return NX_TRUE; - - - -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_auto_ip_conflicts_check_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: Auto_IP Conflicts Check Processing Test...................N/A\n"); - - test_control_return(3); -} -#endif \ No newline at end of file diff --git a/test/regression/bsd_test/bsd_test_setup.docx b/test/regression/bsd_test/bsd_test_setup.docx deleted file mode 100644 index 38b4c031..00000000 Binary files a/test/regression/bsd_test/bsd_test_setup.docx and /dev/null differ diff --git a/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c b/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c index 62752fbb..7ddd1b4f 100644 --- a/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c +++ b/test/regression/bsd_test/netx_bsd_tcp_getsockname_without_bind_test.c @@ -1,5 +1,3 @@ -/* This NetX test verifies the issue report by JIRA: https://expresslogic.atlassian.net/projects/NETXDUO/issues/NETXDUO-223. */ - #include "tx_api.h" #include "nx_api.h" #if defined(NX_BSD_ENABLE) && !defined(NX_DISABLE_IPV4) diff --git a/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c b/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c index 773569f9..985785f7 100644 --- a/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c +++ b/test/regression/bsd_test/netx_bsd_tcp_rcvbuf_test.c @@ -1,5 +1,4 @@ -/* This NetX test concentrates on the basic BSD TCP window size when window scaling is used. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-284 */ +/* This NetX test concentrates on the basic BSD TCP window size when window scaling is used. */ #include "tx_api.h" #include "nx_api.h" diff --git a/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c b/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c index 290a1932..4a364b78 100644 --- a/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c +++ b/test/regression/bsd_test/netx_bsd_tcp_servers_share_port_test.c @@ -74,7 +74,7 @@ UINT status; /* Create a thread for the IPv4 server. */ status= tx_thread_create(&thread_server, "BSD App IPv4 Server", thread_server_entry, 0, pointer, DEMO_STACK_SIZE, - 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* jlc TX_AUTO_START */ + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; @@ -149,7 +149,7 @@ UINT status; /* Create a thread for IPv4 client. */ status= tx_thread_create(&thread_client, "BSD App IPpv4 Client", thread_client_entry, 0, pointer, DEMO_STACK_SIZE, - 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START);/* jlc TX_AUTO_START */ + 16, 16, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; diff --git a/test/regression/dhcp_test/netx_dhcp_03_01_02_test.c b/test/regression/dhcp_test/netx_dhcp_03_01_02_test.c deleted file mode 100644 index df3a819b..00000000 --- a/test/regression/dhcp_test/netx_dhcp_03_01_02_test.c +++ /dev/null @@ -1,335 +0,0 @@ -/* The 'request IP address' option MUST be set to the value of 'yiaddr' in the DHCPOFFER message from the server. - * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address - */ - -#include "tx_api.h" -#include "nx_api.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#include "nxd_dhcp_server.h" -#else -#include "nx_dhcp.h" -#include "nx_dhcp_server.h" -#endif -#include "netx_dhcp_clone_function.h" - -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 -#define NX_PACKET_SIZE 1536 -#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 - -#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) -#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) -#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) - -#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) -#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) -#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) - - -/* Define the ThreadX and NetX object control blocks... */ -static TX_THREAD client_thread; -static NX_PACKET_POOL client_pool; -static NX_IP client_ip; -static NX_DHCP dhcp_client; - -static TX_THREAD server_thread; -static NX_PACKET_POOL server_pool; -static NX_IP server_ip; -static NX_DHCP_SERVER dhcp_server; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static CHAR *pointer; - -static UINT flag; -/* Define thread prototypes. */ - -static void server_thread_entry(ULONG thread_input); -static void client_thread_entry(ULONG thread_input); - -/******** Optionally substitute your Ethernet driver here. ***********/ -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_03_01_02_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; - - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - /* Create the client thread. */ - tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - /* Create the server thread. */ - tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create the client packet pool. */ - status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); - pointer = pointer + NX_PACKET_POOL_SIZE; - - /* Check for pool creation error. */ - if (status) - error_counter++; - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); - pointer = pointer + NX_PACKET_POOL_SIZE; - - /* Check for pool creation error. */ - if (status) - error_counter++; - - /* Create an IP instance for the DHCP Client. */ - status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); - - pointer = pointer + 2048; - - /* Check for IP create errors. */ - if (status) - error_counter++; - - /* Create an IP instance for the DHCP Server. */ - status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); - - pointer = pointer + 2048; - - /* Check for IP create errors. */ - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for ARP enable errors. */ - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for ARP enable errors. */ - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&client_ip); - - /* Check for UDP enable errors. */ - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - - /* Check for UDP enable errors. */ - if (status) - error_counter++; - - /* Enable ICMP. */ - status = nx_icmp_enable(&client_ip); - - /* Check for errors. */ - if (status) - error_counter++; - - /* Enable ICMP. */ - status = nx_icmp_enable(&server_ip); - - /* Check for errors. */ - if (status) - error_counter++; - - return; -} - -/* Define the test threads. */ - -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT iface_index; -UINT addresses_added; - - printf("NetX Test: DHCP 03_01_02 Test........................................"); - - /* Create the DHCP Server. */ - status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, - "DHCP Server", &server_pool); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Check for errors creating the DHCP Server. */ - if (status) - error_counter++; - - /* Load the assignable DHCP IP addresses for the first interface. */ - iface_index = 0; - - status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, - END_IP_ADDRESS_LIST_0, &addresses_added); - - /* Check for errors creating the list. */ - if (status) - error_counter++; - - /* Verify all the addresses were added to the list. */ - if (addresses_added != 10) - error_counter++; - - status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, - NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); - - /* Check for errors setting network parameters. */ - if (status) - error_counter++; - - /* Start DHCP Server task. */ - status = nx_dhcp_server_start(&dhcp_server); - - /* Check for errors starting up the DHCP server. */ - if (status) - error_counter++; - - tx_thread_sleep(3* NX_IP_PERIODIC_RATE); - - if((error_counter) || (flag == 0)) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } - - return; -} - -/* Define the test threads. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; - - flag = 0; - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); - if (status) - error_counter++; - - /* set the udp packet receive function to mine. */ - client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; - - /* Start the DHCP Client. */ - status = nx_dhcp_start(&dhcp_client); - if (status) - error_counter++; - - /* Wait for DHCP to assign the IP address. */ - do - { - /* Check for address resolution. */ - status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - /* wait a bit. */ - tx_thread_sleep(NX_IP_PERIODIC_RATE); - } - - } while (status != NX_SUCCESS); - - /* Stopping the DHCP client. */ - nx_dhcp_stop(&dhcp_client); - - /* All done. Return resources to NetX and ThreadX. */ - nx_dhcp_delete(&dhcp_client); - -} - - -void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ - -UINT status; -ULONG message_type; -ULONG yiaddr; -ULONG request_ip_addr; - - /* Get the dhcp message type. */ - status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, - &message_type, (packet_ptr -> nx_packet_length - 8)); - if(status) - error_counter++; - - /* Check if the message is a DHCPOFFER. */ - if(message_type == NX_DHCP_TYPE_DHCPOFFER) - { - - /* Get the "request ip address" option value. */ - status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_IP_REQ, - &request_ip_addr, (packet_ptr -> nx_packet_length - 8)); - if(status) - error_counter++; - - /* Get yiaddr field value. */ - yiaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 8 + NX_BOOTP_OFFSET_YOUR_IP), 4); - - /* Check wether they are equal. */ - if(request_ip_addr != yiaddr) - error_counter++; - else - flag = 1; - - /* Restore the udp packet receiving function. */ - client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; - } - - /* Let server receives the packet. */ - _nx_udp_packet_receive(ip_ptr, packet_ptr); -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_03_01_02_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: NetX DHCP 03_01_02 Test...................................N/A\n"); - - test_control_return(3); -} -#endif diff --git a/test/regression/dhcp_test/netx_dhcp_03_01_03_test.c b/test/regression/dhcp_test/netx_dhcp_03_01_03_test.c deleted file mode 100644 index 06d32685..00000000 --- a/test/regression/dhcp_test/netx_dhcp_03_01_03_test.c +++ /dev/null @@ -1,404 +0,0 @@ -/* The DHCPREQUEST message MUST use the same value in the DHCP message header's 'secs' field and be sent to the same IP - * broadcast address as the original DHCPDISCOVER message. - * rfc 2131, page 16, 3.1 Client-server interaction - allocating a network address - */ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_dhcp_clone_function.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nx_ipv4.h" -#include "nxd_dhcp_client.h" -#include "nxd_dhcp_server.h" -#else -#include "nx_dhcp.h" -#include "nx_dhcp_server.h" -#include "nx_ip.h" -#endif - -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 -#define NX_PACKET_SIZE 1536 -#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 - -#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) -#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) -#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) - -#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) -#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) -#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) - - -/* Define the ThreadX and NetX object control blocks... */ -static TX_THREAD client_thread; -static NX_PACKET_POOL client_pool; -static NX_IP client_ip; -static NX_DHCP dhcp_client; - -static TX_THREAD server_thread; -static NX_PACKET_POOL server_pool; -static NX_IP server_ip; -static NX_DHCP_SERVER dhcp_server; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static CHAR *pointer; - -static UINT dhcp_offer_flag; -static UINT flag; - -/* Define thread prototypes. */ - -static void server_thread_entry(ULONG thread_input); -static void client_thread_entry(ULONG thread_input); - -/******** Optionally substitute your Ethernet driver here. ***********/ -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr); - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_03_01_03_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - /* Create the client thread. */ - tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - /* Create the server thread. */ - tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create the client packet pool. */ - status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); - pointer = pointer + NX_PACKET_POOL_SIZE; - - /* Check for pool creation error. */ - if (status) - error_counter++; - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); - pointer = pointer + NX_PACKET_POOL_SIZE; - - /* Check for pool creation error. */ - if (status) - error_counter++; - - /* Create an IP instance for the DHCP Client. */ - status = nx_ip_create(&client_ip, "DHCP Client", IP_ADDRESS(0, 0, 0, 0), 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); - - pointer = pointer + 2048; - - /* Check for IP create errors. */ - if (status) - error_counter++; - - /* Create an IP instance for the DHCP Server. */ - status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); - - pointer = pointer + 2048; - - /* Check for IP create errors. */ - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for ARP enable errors. */ - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for ARP enable errors. */ - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&client_ip); - - /* Check for UDP enable errors. */ - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - - /* Check for UDP enable errors. */ - if (status) - error_counter++; - - /* Enable ICMP. */ - status = nx_icmp_enable(&client_ip); - - /* Check for errors. */ - if (status) - error_counter++; - - /* Enable ICMP. */ - status = nx_icmp_enable(&server_ip); - - /* Check for errors. */ - if (status) - error_counter++; - - return; -} - -/* Define the test threads. */ - -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT iface_index; -UINT addresses_added; - - printf("NetX Test: DHCP 03_01_03 Test........................................"); - - /* Create the DHCP Server. */ - status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, - "DHCP Server", &server_pool); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Check for errors creating the DHCP Server. */ - if (status) - error_counter++; - - /* Load the assignable DHCP IP addresses for the first interface. */ - iface_index = 0; - - status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, - END_IP_ADDRESS_LIST_0, &addresses_added); - - /* Check for errors creating the list. */ - if (status) - error_counter++; - - /* Verify all the addresses were added to the list. */ - if (addresses_added != 10) - error_counter++; - - status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, - NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); - - /* Check for errors setting network parameters. */ - if (status) - error_counter++; - - /* Start DHCP Server task. */ - status = nx_dhcp_server_start(&dhcp_server); - - /* Check for errors starting up the DHCP server. */ - if (status) - error_counter++; - - tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); - - if((error_counter) || (flag == 0)) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } - - return; -} - -/* Define the test threads. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; - - dhcp_offer_flag = 0; - flag = 0; - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); - if (status) - error_counter++; - - advanced_packet_process_callback = my_packet_process; - client_ip.nx_ip_udp_packet_receive = my_udp_packet_receive; - - /* Start the DHCP Client. */ - status = nx_dhcp_start(&dhcp_client); - if (status) - error_counter++; - - /* Wait for DHCP to assign the IP address. */ - do - { - /* Check for address resolution. */ - status = nx_ip_status_check(&client_ip, NX_IP_ADDRESS_RESOLVED, (ULONG *) &status, NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - /* wait a bit. */ - tx_thread_sleep(NX_IP_PERIODIC_RATE); - } - - } while (status != NX_SUCCESS); - - /* Stopping the DHCP client. */ - nx_dhcp_stop(&dhcp_client); - - /* All done. Return resources to NetX and ThreadX. */ - nx_dhcp_delete(&dhcp_client); - - return; -} - - -static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - -static ULONG dhcp_discover_bcd_addr; -static ULONG dhcp_discover_secs; -ULONG dhcp_request_bcd_addr; -ULONG dhcp_request_secs; -UINT status; -ULONG message_type; - -#ifdef __PRODUCT_NETXDUO__ -NX_IPV4_HEADER *ip_header; -#else -NX_IP_HEADER *ip_header; -#endif -NX_UDP_HEADER *udp_header; -ULONG src_dst_port; - - udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); - src_dst_port = udp_header -> nx_udp_header_word_0; - NX_CHANGE_ULONG_ENDIAN(src_dst_port); - - /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ - if(src_dst_port == 0x00440043) - { - if(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_INIT) - { -#ifdef __PRODUCT_NETXDUO__ - ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; -#else - ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; -#endif - /* Get the destination ip address. */ - dhcp_discover_bcd_addr = ip_header -> nx_ip_header_destination_ip; - - /* Get secs field value. */ - dhcp_discover_secs = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_SECS), 2); - } - - /* Make sure in selecting state and dhcpoffer has been received. */ - else if((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_SELECTING) && (dhcp_offer_flag != 0)) - { - /* Get the dhcp message type. */ - status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, - &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); - if(status) - error_counter++; - - /* Check if the message is a DHCPREQUEST. */ - if(message_type == NX_DHCP_TYPE_DHCPREQUEST) - { -#ifdef __PRODUCT_NETXDUO__ - ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; -#else - ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; -#endif - /* Get the destination ip address. */ - dhcp_request_bcd_addr = ip_header -> nx_ip_header_destination_ip; - - /* Get secs field value. */ - dhcp_request_secs = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_SECS), 2); - - /* Check if the secs and broadcast address are the same as the original DHCPDISCOVER message. */ - if((dhcp_request_bcd_addr == dhcp_discover_bcd_addr) && (dhcp_request_secs == dhcp_discover_secs)) - flag = 1; - else - error_counter++; - - /* restore the callback to NULL. */ - advanced_packet_process_callback = NX_NULL; - } - } - } - - return NX_TRUE; - -} - -void my_udp_packet_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ - -UINT status; -ULONG message_type; - - /* Get the dhcp message type. */ - status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, - &message_type, (packet_ptr -> nx_packet_length - 8)); - if(status) - error_counter++; - - /* Check if the message is a DHCPOFFER. */ - if(message_type == NX_DHCP_TYPE_DHCPOFFER) - { - dhcp_offer_flag++; - - /* Restore the udp packet receiving function. */ - client_ip.nx_ip_udp_packet_receive = _nx_udp_packet_receive; - } - - /* Let server receives the packet. */ - _nx_udp_packet_receive(ip_ptr, packet_ptr); -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_03_01_03_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: NetX DHCP 03_01_03 Test...................................N/A\n"); - - test_control_return(3); -} -#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_03_04_01_test.c b/test/regression/dhcp_test/netx_dhcp_03_04_01_test.c deleted file mode 100644 index 9fde4650..00000000 --- a/test/regression/dhcp_test/netx_dhcp_03_04_01_test.c +++ /dev/null @@ -1,367 +0,0 @@ -/* The servers SHOULD unicast the DHCPACK reply to the address given in the 'ciaddr' filed of the DHCPINFORM message. - * rfc 2131, page 20, 3.4 Obtaining parameters with externally configured network address - */ - -#include "tx_api.h" -#include "nx_api.h" -#include "netx_dhcp_clone_function.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nx_ipv4.h" -#include "nxd_dhcp_client.h" -#include "nxd_dhcp_server.h" -#else -#include "nx_ip.h" -#include "nx_dhcp.h" -#include "nx_dhcp_server.h" -#endif - -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 -#define NX_PACKET_SIZE 1536 -#define NX_PACKET_POOL_SIZE NX_PACKET_SIZE * 8 - -#define NX_DHCP_SERVER_IP_ADDRESS_0 IP_ADDRESS(10,0,0,1) -#define START_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,10) -#define END_IP_ADDRESS_LIST_0 IP_ADDRESS(10,0,0,19) - -#define NX_DHCP_SUBNET_MASK_0 IP_ADDRESS(255,255,255,0) -#define NX_DHCP_DEFAULT_GATEWAY_0 IP_ADDRESS(10,0,0,1) -#define NX_DHCP_DNS_SERVER_0 IP_ADDRESS(10,0,0,1) - -#define CLIENT_IP_ADDRESS IP_ADDRESS(10,0,0,11) - -/* Define the ThreadX and NetX object control blocks... */ -static TX_THREAD client_thread; -static NX_PACKET_POOL client_pool; -static NX_IP client_ip; -static NX_DHCP dhcp_client; - -static TX_THREAD server_thread; -static NX_PACKET_POOL server_pool; -static NX_IP server_ip; -static NX_DHCP_SERVER dhcp_server; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static CHAR *pointer; - -static UINT dhcp_ack_flag; -static UINT dhcp_inform_count; - -/* Define thread prototypes. */ - -static void server_thread_entry(ULONG thread_input); -static void client_thread_entry(ULONG thread_input); - -/******** Optionally substitute your Ethernet driver here. ***********/ -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_03_04_01_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - /* Create the client thread. */ - tx_thread_create(&client_thread, "thread client", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - /* Create the server thread. */ - tx_thread_create(&server_thread, "thread server", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create the client packet pool. */ - status = nx_packet_pool_create(&client_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); - pointer = pointer + NX_PACKET_POOL_SIZE; - - /* Check for pool creation error. */ - if (status) - error_counter++; - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "NetX Main Packet Pool", 1024, pointer, NX_PACKET_POOL_SIZE); - pointer = pointer + NX_PACKET_POOL_SIZE; - - /* Check for pool creation error. */ - if (status) - error_counter++; - - /* Create an IP instance for the DHCP Client. */ - status = nx_ip_create(&client_ip, "DHCP Client", CLIENT_IP_ADDRESS, 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); - - pointer = pointer + 2048; - - /* Check for IP create errors. */ - if (status) - error_counter++; - - /* Create an IP instance for the DHCP Server. */ - status = nx_ip_create(&server_ip, "DHCP Server", NX_DHCP_SERVER_IP_ADDRESS_0, 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1500, pointer, 2048, 1); - - pointer = pointer + 2048; - - /* Check for IP create errors. */ - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for DHCP Client IP. */ - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for ARP enable errors. */ - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for DHCP Server IP. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for ARP enable errors. */ - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&client_ip); - - /* Check for UDP enable errors. */ - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - - /* Check for UDP enable errors. */ - if (status) - error_counter++; - - /* Enable ICMP. */ - status = nx_icmp_enable(&client_ip); - - /* Check for errors. */ - if (status) - error_counter++; - - /* Enable ICMP. */ - status = nx_icmp_enable(&server_ip); - - /* Check for errors. */ - if (status) - error_counter++; - - return; -} - -/* Define the test threads. */ - -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT iface_index; -UINT addresses_added; - - printf("NetX Test: DHCP 03_04_01 Test........................................"); - - /* Create the DHCP Server. */ - status = nx_dhcp_server_create(&dhcp_server, &server_ip, pointer, DEMO_STACK_SIZE, - "DHCP Server", &server_pool); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Check for errors creating the DHCP Server. */ - if (status) - error_counter++; - - /* Load the assignable DHCP IP addresses for the first interface. */ - iface_index = 0; - - status = nx_dhcp_create_server_ip_address_list(&dhcp_server, iface_index, START_IP_ADDRESS_LIST_0, - END_IP_ADDRESS_LIST_0, &addresses_added); - - /* Check for errors creating the list. */ - if (status) - error_counter++; - - /* Verify all the addresses were added to the list. */ - if (addresses_added != 10) - error_counter++; - - status = nx_dhcp_set_interface_network_parameters(&dhcp_server, iface_index, NX_DHCP_SUBNET_MASK_0, - NX_DHCP_DEFAULT_GATEWAY_0, NX_DHCP_DNS_SERVER_0); - - /* Check for errors setting network parameters. */ - if (status) - error_counter++; - - /* Start DHCP Server task. */ - status = nx_dhcp_server_start(&dhcp_server); - - /* Check for errors starting up the DHCP server. */ - if (status) - error_counter++; - - tx_thread_sleep(3 * NX_IP_PERIODIC_RATE); - - if((error_counter) || (dhcp_ack_flag == 0)) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } - - return; -} - -/* Define the test threads. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; - - dhcp_ack_flag = 0; - dhcp_inform_count = 0; - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp_client"); - if(status) - error_counter++; - - advanced_packet_process_callback = my_packet_process; - - /* Start the DHCP Client. */ - status = nx_dhcp_start(&dhcp_client); - if(status) - error_counter++; - - status = nx_dhcp_send_request(&dhcp_client, NX_DHCP_TYPE_DHCPINFORM); - if(status) - error_counter++; - - /* Stopping the DHCP client. */ - nx_dhcp_stop(&dhcp_client); - - /* All done. Return resources to NetX and ThreadX. */ - nx_dhcp_delete(&dhcp_client); - - return; -} - - -static UINT my_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - -UINT status; -ULONG message_type; -NX_UDP_HEADER *udp_header; -ULONG src_dst_port; - -static ULONG inform_ciaddr; -ULONG ack_dst_addr; - -#ifdef __PRODUCT_NETXDUO__ -NX_IPV4_HEADER *ip_header; -#else -NX_IP_HEADER *ip_header; -#endif - - udp_header = (NX_UDP_HEADER*)((packet_ptr -> nx_packet_prepend_ptr) + 20); - src_dst_port = udp_header -> nx_udp_header_word_0; - NX_CHANGE_ULONG_ENDIAN(src_dst_port); - - /* client port 68(0x44), server port 67(0x43). packet sent to server from client*/ - if(src_dst_port == 0x00440043) - { - /* Get the dhcp message type. */ - status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, - &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); - if(status) - error_counter++; - - /* Check if the message is a DHCPREQUEST. */ - if(message_type == NX_DHCP_TYPE_DHCPINFORM) - { - dhcp_inform_count++; - - /* Get ciaddr field value. */ - inform_ciaddr = dhcp_get_data((packet_ptr -> nx_packet_prepend_ptr + 20 + 8 + NX_BOOTP_OFFSET_CLIENT_IP), 4); - - } - } - /* Sent from server to client. */ - else if((src_dst_port == 0x00430044) && (dhcp_inform_count == 1)) - { - /* Get the dhcp message type. */ - status = dhcp_get_option_value((packet_ptr -> nx_packet_prepend_ptr + 20 + 8), NX_DHCP_SERVER_OPTION_DHCP_TYPE, - &message_type, (packet_ptr -> nx_packet_length - 20 - 8)); - if(status) - error_counter++; - - /* Check if the message is a DHCPNAK. */ - if(message_type == NX_DHCP_TYPE_DHCPACK) - { - dhcp_ack_flag++; - -#ifdef __PRODUCT_NETXDUO__ - ip_header = (NX_IPV4_HEADER*)packet_ptr -> nx_packet_prepend_ptr; -#else - ip_header = (NX_IP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; -#endif - /* Get the destination ip address. */ - ack_dst_addr = ip_header -> nx_ip_header_destination_ip; - - NX_CHANGE_ULONG_ENDIAN(ack_dst_addr); - - /* Check if Server unicast the DHCPACK to the address given in the 'ciaddr' field of the DHCPINFORM message. */ - if(ack_dst_addr != inform_ciaddr) - error_counter++; - - /* restore the callback to NULL. */ - advanced_packet_process_callback = NX_NULL; - } - - } - - return NX_TRUE; - -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_03_04_01_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: NetX DHCP 03_04_01 Test...................................N/A\n"); - - test_control_return(3); -} -#endif \ No newline at end of file diff --git a/test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c b/test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c deleted file mode 100644 index d2b83540..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_arp_probe_fail_multiple_interface_test.c +++ /dev/null @@ -1,1033 +0,0 @@ -/* Testing the multiple interface DHCP Client */ - -/* This is the DHCP Client that will run on both interfaces independently. - Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_INTERFACES >= 2. - There are two DHCP Client threads that are switching from manual to DHCP CLient address - mode, and switch from activated to deactivated. There is one server thread checking - for DHCP Client messages on primary and secondary interfaces. -*/ - - - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_ram_network_driver_test_1500.h" -#include "nx_arp.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - -#if (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) - -#define DEMO_STACK_SIZE 4096 -#define PACKET_PAYLOAD 1518 - - - -/* Define the ThreadX, NetX object control blocks... */ - -static NX_UDP_SOCKET server_socket; -static TX_THREAD client_thread; -static TX_THREAD server_thread; -static NX_PACKET_POOL client_pool; -static NX_PACKET_POOL server_pool; -static NX_IP client_ip; -static NX_IP server_ip; - -static UINT probe0 = NX_FALSE; -static UINT probe1 = NX_FALSE; -static UINT bound0 = NX_FALSE; -static UINT bound1 = NX_FALSE; -static UINT decline0 = NX_FALSE; -static UINT decline1 = NX_FALSE; - -/* Define the NetX DHCP object control block. */ -static NX_DHCP dhcp_client; -static ULONG dhcp_xid; - - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define NUM_RESPONSES 2 -static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; -static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client_running = NX_TRUE; - - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -static void server_thread_entry(ULONG thread_input); -static void client_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); -static void dhcp_test_initialize(); - -extern void test_control_return(UINT); -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); -static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); -static UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address); - - -/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 - because there are four entities (server 2 interfaces, client 2 interfaces - and the ram driver increases the MAC sequentially starting from - 11 22 33 44 56. */ - - -static char offer_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response0_size = 300; - -/* Frame (342 bytes) */ -static char ack_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response0_size = 300; - -static char offer_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response1_size = 300; - -/* Frame (342 bytes) */ -static char ack_response1[300] = { - - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response1_size = 300; - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_client_arp_probe_fail_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the DHCP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server_ip, - "Server IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - status = nx_ip_interface_attach(&server_ip, "Server secondary IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - - if (status) - error_counter++; - - /* Set up the Client. */ - - /* Create the main client thread. */ - status = tx_thread_create(&client_thread, "Client", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 12*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "Client IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 2048; - - status = nx_ip_interface_attach(&client_ip, "Client secondary IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp"); - - if (status) - error_counter++; - - /* Keep track of interface DHCP Client state changes. */ - status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); - - if (status) - error_counter++; - - return; -} - - -/* Define the DHCP client thread. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT time_keeper; - - - tx_thread_sleep(10); - - status = nx_dhcp_interface_enable(&dhcp_client, 1); - if (status != NX_SUCCESS) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Start DHCP on all enabled interfaces. */ - status = nx_dhcp_start(&dhcp_client); - if (status != NX_SUCCESS) - { - printf("ERROR!\n"); - test_control_return(1); - } - - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ - time_keeper = 0; - - while((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) && - (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND)) - { - tx_thread_sleep(100); - time_keeper += 100; - if (time_keeper > 1000) - { - break; - } - } - - if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE) || (decline0 == NX_TRUE)) - { - error_counter++; - } - - /* Now stop the DHCP Client 0. */ - nx_dhcp_interface_disable(&dhcp_client, 0); - - /* Verify the DHCP CLient is not enabled on the primary interface. */ - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) - { - error_counter++; - } - - /* Wait a bit for DHCP Client internally to decline the IP address. */ - tx_thread_sleep(30); - - if ((probe1 != NX_TRUE) || (decline1 != NX_TRUE) || (bound1 == NX_TRUE)) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) - { - error_counter++; - } - - client_running = NX_FALSE; - -} - - -/* Define the DHCP server thread. */ -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i, j, k, pkt_number; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test......"); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - i = 0; - j = 0; - k = 0; - pkt_number = 0; - - /* Set the advanced callback to ensure broadcast packets are routed correctly. */ - advanced_packet_process_callback = my_dhcp_process_bc_callback; - - /* Wait for Client requests */ - while ( i < (2*NUM_RESPONSES)) - { - - status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - error_counter++; - } - else - { - - UINT source_port; - ULONG source_ip_address; - UINT protocol; - UINT iface_index; - - /* Get the XID of DHCP message from DHCP Server. */ - dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); - - nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); - - /* Release the packet. */ - nx_packet_release(my_packet); - - if (iface_index == 0) - { - pkt_number = j; - - } - else - { - pkt_number = k; - - } - - status = nx_dhcp_response_packet_send(&server_socket, 68, pkt_number, iface_index); - - if (iface_index == 0) - j++; - else - k++; - - /* Check status. */ - if (status) - { - error_counter++; - } - } - - /* Advance the index for the next response. */ - i++; - } - - /* Set up a scenario to respond to Client ARP Probes on interface 1 */ - while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_ADDRESS_PROBING) - tx_thread_sleep(20); - - /* While the DHCP Client is in probe mode, send a conflict response. */ - status = send_arp_reply(&server_ip, 1, dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_ip_address); - - /* Check status. */ - if (status) - { - error_counter++; - } - /* Should get one more message from the Client, a DECLINE message. */ - status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - - error_counter++; - } - - /* Wait for the client to terminate the connection. */ - while(client_running == NX_TRUE) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server_socket); - - if(error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - -static void dhcp_test_initialize() -{ - - - /* Set up server responses on the primary interface. */ - dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; - dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; - - dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; - dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; - - /* Set up server responses on the secondary interface. */ - dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; - dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; - - dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; - dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; - -} - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) -{ - -UINT status; -NX_PACKET *response_packet; -UCHAR *work_ptr; -#ifdef __PRODUCT_NETXDUO__ -NXD_ADDRESS ip_address; -#else -ULONG ip_address; -NX_PACKET **response_packet_ptr_ptr; -#endif - -#ifdef __PRODUCT_NETXDUO__ - ip_address.nxd_ip_version = NX_IP_VERSION_V4; - ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; -#else - ip_address = 0xFFFFFFFF; -#endif - - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - if (iface_index == 0) - { - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, - dhcp_response0[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; - } - else if (iface_index == 1) - { - - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, - dhcp_response1[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; - } - - /* Now replace the XID in the server message with what we know is the Client XID. */ - work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); - NX_CHANGE_ULONG_ENDIAN(dhcp_xid); - memcpy(work_ptr, (void const *)(&dhcp_xid), 4); - - - /* Adjust the write pointer. */ - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ -#ifdef __PRODUCT_NETXDUO__ - status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); -#else - response_packet_ptr_ptr = &response_packet; - status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); -#endif - - /* Check the status. */ - if (status) - { - - error_counter++; - - nx_packet_release(response_packet); - } - - return status; -} - - -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - - -UCHAR *work_ptr; -ULONG *message_ptr; -UINT interface_index; -UINT packet_client_mac_lsw; -ULONG sender_physical_lsw; -NX_PACKET *packet_copy; - - - /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet - prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ - if (packet_ptr -> nx_packet_length < 200) - { - - message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (sender_physical_lsw == 0x22334458) - { - interface_index = 0; - } - else if (sender_physical_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ - { - - /* Set work_ptr. */ -#ifdef __PRODUCT_NETXDUO__ - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#else - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#endif - /* Pickup the target MAC address in the DHCP message. */ - packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | - (((ULONG)work_ptr[3]) << 16) | - (((ULONG)work_ptr[4]) << 8) | - ((ULONG)work_ptr[5]); - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (packet_client_mac_lsw == 0x22334458) - { - interface_index = 0; - } - else if (packet_client_mac_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - - /* Copy to a new packet and drop the original packet. */ - nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); - - /* Based on the packet mac address, set the packet interface based on the mac address */ - packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); - - if (packet_ptr -> nx_packet_length > 200) - { - - if (ip_ptr == &server_ip) - { - _nx_ip_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_ip_packet_receive(&server_ip, packet_copy); - } - } - else - { - - if (ip_ptr == &server_ip) - { - _nx_arp_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_arp_packet_receive(&server_ip, packet_copy); - } - } - - *operation_ptr = NX_RAMDRIVER_OP_DROP; - - return NX_TRUE; - -} - - -ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) -{ - -ULONG value = 0; - - - /* Process the data retrieval request. */ - while (size-- > 0) - { - - /* Build return value. */ - value = (value << 8) | *data++; - } - - /* Return value. */ - return(value); -} - -VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) -{ - - if (iface_index == 0) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_INIT) - { - /* Check if the Client has been reset to to INIT - after reaching the ARP probe state. This should not happen. */ - if (probe0 == NX_TRUE) - { - error_counter++; - } - } - } - else if (iface_index == 1) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe1 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound1 = NX_TRUE; - - /* This should not happen. */ - error_counter++; - } - else if (new_state == NX_DHCP_STATE_INIT) - { - /* Check if the Client has been reset to to INIT - after reaching the ARP probe state. */ - if (probe1 == NX_TRUE) - { - decline1 = NX_TRUE; - } - } - } - else - error_counter++; - - return; -} - - -UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address) -{ - -UINT status; -NX_PACKET *packet_ptr; -ULONG *message_ptr; -NX_IP_DRIVER driver_request; -NX_INTERFACE *nx_interface; -ULONG lsw, msw; - - - /* Allocate a packet to build the ARP message in. */ - status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &packet_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); - if (status != NX_SUCCESS) - { - - /* Error getting packet, so just get out! */ - return status; - } - - /* Stamp the packet with the outgoing interface information, which is the server primary interface. */ - nx_interface = &(ip_ptr -> nx_ip_interface[iface_index]); - - /* Store the probe address on the Client. */ - client_ip.nx_ip_interface[iface_index].nx_interface_ip_probe_address = probe_address;; - //nx_interface -> nx_interface_ip_probe_address = probe_address; - - packet_ptr -> nx_packet_ip_interface = nx_interface; - - /* Build the ARP request packet. */ - - /* Setup the size of the ARP message. */ - packet_ptr -> nx_packet_length = NX_ARP_MESSAGE_SIZE; - - /* Setup the append pointer to the end of the message. */ - packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ARP_MESSAGE_SIZE; - - /* Setup the pointer to the message area. */ - message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; - - /* Write the Hardware type into the message. */ - *message_ptr = (ULONG)(NX_ARP_HARDWARE_TYPE << 16) | (NX_ARP_PROTOCOL_TYPE); - *(message_ptr + 1) = (ULONG)(NX_ARP_HARDWARE_SIZE << 24) | (NX_ARP_PROTOCOL_SIZE << 16) | - NX_ARP_OPTION_REQUEST; - - /* Sender mac address. Note this is a phone MAC address from 'another' host on the network. */ - msw = 0x000c; - lsw = 0xf17dcaa6; - - *(message_ptr+2) = (ULONG) (msw << 16) |(lsw >> 16); - /* Rest of sender mac address,upper bytes of sender address */ - *(message_ptr + 3) = (ULONG)((lsw << 16) | (probe_address >> 16)); - - /* Target mac address */ - msw = 0x11; - lsw = 0x22334458; - - *(message_ptr+4) = (probe_address /* sender IP address */ << 16) | (msw & NX_LOWER_16_MASK); - *(message_ptr+5) = lsw; - - /* Target address */ - *(message_ptr+6) = (ULONG) 0x0; - - /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will - swap the endian of the ARP message. */ - NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); - - /* Send the ARP request to the driver. */ - driver_request.nx_ip_driver_ptr = ip_ptr; - driver_request.nx_ip_driver_command = NX_LINK_ARP_SEND; - driver_request.nx_ip_driver_packet = packet_ptr; - driver_request.nx_ip_driver_physical_address_msw = 0xFFFFUL; - driver_request.nx_ip_driver_physical_address_lsw = 0xFFFFFFFFUL; - driver_request.nx_ip_driver_interface = nx_interface; - (nx_interface -> nx_interface_link_driver_entry) (&driver_request); - - return NX_SUCCESS; -} - -#else -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_arp_probe_fail_multiple_interface_test_application_define(void * first_unused_memory) -#endif -{ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test........N/A\n"); - test_control_return(3); -} -#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) */ - - diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c deleted file mode 100644 index 1d9e1917..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface.c +++ /dev/null @@ -1,1077 +0,0 @@ -/* Testing the multiple interface DHCP Client */ - -/* This is the DHCP Client that will run on both interfaces independently. - Required: NX_MAX_PHYSICAL_INTERFACES = 2 and NX_DHCP_CLIENT_MAX_INTERFACES = 1. - There are two DHCP Client threads that are switching from manual to DHCP CLient address - mode, and switch from activated to deactivated. There is one server thread checking - for DHCP Client messages on primary and secondary interfaces. -*/ - - - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_ram_network_driver_test_1500.h" -extern void test_control_return(UINT); -#ifndef NX_DISABLE_IPV4 -#include "nx_arp.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - -#define DEMO_STACK_SIZE 4096 -#define PACKET_PAYLOAD 1518 - - - -/* Define the ThreadX, NetX object control blocks... */ - -static NX_UDP_SOCKET server0_socket; -static TX_THREAD client0_thread; -static TX_THREAD client1_thread; -static TX_THREAD server0_thread; -static NX_PACKET_POOL client_pool; -static NX_PACKET_POOL server_pool; -static NX_IP client_ip; -static NX_IP server0_ip; - -static UINT probe0 = NX_FALSE; -static UINT probe1 = NX_FALSE; -static UINT bound0 = NX_FALSE; -static UINT bound1 = NX_FALSE; -static UINT decline0 = NX_FALSE; -static UINT decline1 = NX_FALSE; - -/* Define the NetX FTP object control block. */ -static NX_DHCP dhcp_client; -static ULONG dhcp_xid; - - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define NUM_RESPONSES 2 -static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; -static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client0_running = NX_TRUE; -static UINT client1_running = NX_TRUE; - - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -static void server0_thread_entry(ULONG thread_input); -static void client0_thread_entry(ULONG thread_input); -static void client1_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); -static void dhcp_test_initialize(); - -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); -static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); -static UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address); - - -/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 - because there are four entities (server 2 interfaces, client 2 interfaces - and the ram driver increases the MAC sequentially starting from - 11 22 33 44 56. */ - - -static char offer_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response0_size = 300; - -/* Frame (342 bytes) */ -static char ack_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response0_size = 300; - -static char offer_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response1_size = 300; - -/* Frame (342 bytes) */ -static char ack_response1[300] = { - - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response1_size = 300; - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_arpprobe_fail_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the DHCP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server0_thread, "Server 0 thread ", server0_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server0_ip, - "Server 0 IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - status = nx_ip_interface_attach(&server0_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server0_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server0_ip); - - if (status) - error_counter++; - - /* Set up the Client. */ - - /* Create the main client thread. */ - status = tx_thread_create(&client0_thread, "Client 0", client0_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the secondary client thread. */ - status = tx_thread_create(&client1_thread, "Client 1", client1_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 12*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 2048; - - status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); - - if (status) - error_counter++; - - /* Keep track of interface DHCP Client state changes. */ - status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); - - if (status) - error_counter++; - - return; -} - - -/* Define the DHCP client thread. */ - -void client0_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT time_keeper; - - - tx_thread_sleep(10); - - /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ - status = nx_dhcp_interface_start(&dhcp_client, 0); - if (status != NX_SUCCESS) - { - error_counter++; - } - - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ - time_keeper = 0; - - while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - tx_thread_sleep(10); - time_keeper += 10; - if (time_keeper > 1000) - { - break; - } - } - - if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE) || (decline0 == NX_TRUE)) - { - error_counter++; - } - - /* Now stop the DHCP Client 0. */ - nx_dhcp_interface_disable(&dhcp_client, 0); - - /* Verify the DHCP CLient is not enabled on the primary interface. */ - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) - { - error_counter++; - } - client0_running = NX_FALSE; - -} - -void client1_thread_entry(ULONG thread_input) -{ - -UINT status; - - - tx_thread_sleep(10); - - if (NX_DHCP_CLIENT_MAX_RECORDS != 2) - { - error_counter++; - } - - status = nx_dhcp_interface_enable(&dhcp_client, 1); - if (status != NX_SUCCESS) - { - - error_counter++; - } - - status = nx_dhcp_interface_start(&dhcp_client, 1); - - if (status != NX_SUCCESS) - { - error_counter++; - } - else - { - - UINT time_keeper = 0; - while(probe1 == NX_FALSE) - { - tx_thread_sleep(20); - time_keeper += 20; - if (time_keeper > 1000) - { - break; - } - } - - /* Wait a bit for DHCP Clien to decline the IP address. */ - tx_thread_sleep(50); - - if ((probe1 != NX_TRUE) || (decline1 != NX_TRUE) || (bound1 == NX_TRUE)) - { - error_counter++; - } - - } - - if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) - { - error_counter++; - } - - client1_running = NX_FALSE; - -} - -/* Define the Primary DHCP server thread. */ -void server0_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i, j, k, pkt_number; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test........"); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server0_ip, &server0_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server0_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - i = 0; - j = 0; - k = 0; - pkt_number = 0; - - /* Set the advanced callback to ensure broadcast packets are routed correctly. */ - advanced_packet_process_callback = my_dhcp_process_bc_callback; - - /* Wait for Client requests */ - while ( i < (2*NUM_RESPONSES)) - { - - status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - error_counter++; - } - else - { - - UINT source_port; - ULONG source_ip_address; - UINT protocol; - UINT iface_index; - - /* Get the XID of DHCP message from DHCP Server. */ - dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); - - nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); - - /* Release the packet. */ - nx_packet_release(my_packet); - - if (iface_index == 0) - { - pkt_number = j; - - } - else - { - pkt_number = k; - - } - - status = nx_dhcp_response_packet_send(&server0_socket, 68, pkt_number, iface_index); - - if (iface_index == 0) - j++; - else - k++; - - /* Check status. */ - if (status) - { - error_counter++; - } - } - - /* Advance the index for the next response. */ - i++; - } - - /* Set up a scenario to respond to Client ARP Probes on interface 1 */ - while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_ADDRESS_PROBING) - tx_thread_sleep(20); - - /* While the DHCP Client is in probe mode, send a conflict response. */ - status = send_arp_reply(&server0_ip, 1, dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_ip_address); - - /* Check status. */ - if (status) - { - error_counter++; - } - /* Should get one more message from the Client, a DECLINE message. */ - status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - - error_counter++; - } - - /* Wait for the client to terminate the connection. */ - while((client0_running == NX_TRUE) || (client1_running == NX_TRUE)) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server0_socket); - - if(error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - -static void dhcp_test_initialize() -{ - - - /* Set up server responses on the primary interface. */ - dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; - dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; - - dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; - dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; - - /* Set up server responses on the secondary interface. */ - dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; - dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; - - dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; - dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; - -} - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) -{ - -UINT status; -NX_PACKET *response_packet; -UCHAR *work_ptr; -#ifdef __PRODUCT_NETXDUO__ -NXD_ADDRESS ip_address; -#else -ULONG ip_address; -NX_PACKET **response_packet_ptr_ptr; -#endif - -#ifdef __PRODUCT_NETXDUO__ - ip_address.nxd_ip_version = NX_IP_VERSION_V4; - ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; -#else - ip_address = 0xFFFFFFFF; -#endif - - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - if (iface_index == 0) - { - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, - dhcp_response0[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; - } - else if (iface_index == 1) - { - - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, - dhcp_response1[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; - } - - /* Now replace the XID in the server message with what we know is the Client XID. */ - work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); - NX_CHANGE_ULONG_ENDIAN(dhcp_xid); - memcpy(work_ptr, (void const *)(&dhcp_xid), 4); - - - /* Adjust the write pointer. */ - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ -#ifdef __PRODUCT_NETXDUO__ - status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); -#else - response_packet_ptr_ptr = &response_packet; - status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); -#endif - - /* Check the status. */ - if (status) - { - - error_counter++; - - nx_packet_release(response_packet); - } - - return status; -} - - -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - - -UCHAR *work_ptr; -ULONG *message_ptr; -UINT interface_index; -UINT packet_client_mac_lsw; -ULONG sender_physical_lsw; -NX_PACKET *packet_copy; - - - /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet - prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ - if (packet_ptr -> nx_packet_length < 200) - { - - message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (sender_physical_lsw == 0x22334458) - { - interface_index = 0; - } - else if (sender_physical_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ - { - - /* Set work_ptr. */ -#ifdef __PRODUCT_NETXDUO__ - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#else - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#endif - /* Pickup the target MAC address in the DHCP message. */ - packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | - (((ULONG)work_ptr[3]) << 16) | - (((ULONG)work_ptr[4]) << 8) | - ((ULONG)work_ptr[5]); - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (packet_client_mac_lsw == 0x22334458) - { - interface_index = 0; - } - else if (packet_client_mac_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - - /* Copy to a new packet and drop the original packet. */ - nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); - - /* Based on the packet mac address, set the packet interface based on the mac address */ - packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); - - if (packet_ptr -> nx_packet_length > 200) - { - - if (ip_ptr == &server0_ip) - { - _nx_ip_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_ip_packet_receive(&server0_ip, packet_copy); - } - } - else - { - - if (ip_ptr == &server0_ip) - { - _nx_arp_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_arp_packet_receive(&server0_ip, packet_copy); - } - } - - *operation_ptr = NX_RAMDRIVER_OP_DROP; - - return NX_TRUE; - -} - - -ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) -{ - -ULONG value = 0; - - - /* Process the data retrieval request. */ - while (size-- > 0) - { - - /* Build return value. */ - value = (value << 8) | *data++; - } - - /* Return value. */ - return(value); -} - -VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) -{ - - if (iface_index == 0) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_INIT) - { - /* Check if the Client has been reset to to INIT - after reaching the ARP probe state. This should not happen. */ - if (probe0 == NX_TRUE) - { - error_counter++; - } - } - } - else if (iface_index == 1) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe1 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound1 = NX_TRUE; - - /* This should not happen. */ - error_counter++; - } - else if (new_state == NX_DHCP_STATE_INIT) - { - /* Check if the Client has been reset to to INIT - after reaching the ARP probe state. */ - if (probe1 == NX_TRUE) - { - decline1 = NX_TRUE; - } - } - } - else - error_counter++; - - return; -} - - -UINT send_arp_reply(NX_IP *ip_ptr, UINT iface_index, ULONG probe_address) -{ - -UINT status; -NX_PACKET *packet_ptr; -ULONG *message_ptr; -NX_IP_DRIVER driver_request; -NX_INTERFACE *nx_interface; -ULONG lsw, msw; - - - /* Allocate a packet to build the ARP message in. */ - status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &packet_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); - if (status != NX_SUCCESS) - { - - /* Error getting packet, so just get out! */ - return status; - } - - /* Stamp the packet with the outgoing interface information, which is the server primary interface. */ - nx_interface = &(ip_ptr -> nx_ip_interface[iface_index]); - - /* Store the probe address on the Client. */ - client_ip.nx_ip_interface[iface_index].nx_interface_ip_probe_address = probe_address;; - //nx_interface -> nx_interface_ip_probe_address = probe_address; - - packet_ptr -> nx_packet_ip_interface = nx_interface; - - /* Build the ARP request packet. */ - - /* Setup the size of the ARP message. */ - packet_ptr -> nx_packet_length = NX_ARP_MESSAGE_SIZE; - - /* Setup the append pointer to the end of the message. */ - packet_ptr -> nx_packet_append_ptr = packet_ptr -> nx_packet_prepend_ptr + NX_ARP_MESSAGE_SIZE; - - /* Setup the pointer to the message area. */ - message_ptr = (ULONG *) packet_ptr -> nx_packet_prepend_ptr; - - /* Write the Hardware type into the message. */ - *message_ptr = (ULONG)(NX_ARP_HARDWARE_TYPE << 16) | (NX_ARP_PROTOCOL_TYPE); - *(message_ptr + 1) = (ULONG)(NX_ARP_HARDWARE_SIZE << 24) | (NX_ARP_PROTOCOL_SIZE << 16) | - NX_ARP_OPTION_REQUEST; - - /* Sender mac address. Note this is a phone MAC address from 'another' host on the network. */ - msw = 0x000c; - lsw = 0xf17dcaa6; - - *(message_ptr+2) = (ULONG) (msw << 16) |(lsw >> 16); - /* Rest of sender mac address,upper bytes of sender address */ - *(message_ptr + 3) = (ULONG)((lsw << 16) | (probe_address >> 16)); - - /* Target mac address */ - msw = 0x11; - lsw = 0x22334458; - - *(message_ptr+4) = (probe_address /* sender IP address */ << 16) | (msw & NX_LOWER_16_MASK); - *(message_ptr+5) = lsw; - - /* Target address */ - *(message_ptr+6) = (ULONG) 0x0; - - /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will - swap the endian of the ARP message. */ - NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); - - /* Send the ARP request to the driver. */ - driver_request.nx_ip_driver_ptr = ip_ptr; - driver_request.nx_ip_driver_command = NX_LINK_ARP_SEND; - driver_request.nx_ip_driver_packet = packet_ptr; - driver_request.nx_ip_driver_physical_address_msw = 0xFFFFUL; - driver_request.nx_ip_driver_physical_address_lsw = 0xFFFFFFFFUL; - driver_request.nx_ip_driver_interface = nx_interface; - (nx_interface -> nx_interface_link_driver_entry) (&driver_request); - - return NX_SUCCESS; -} -#else -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_arpprobe_fail_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Fail Test..........N/A\n"); - test_control_return(3); -} -#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c deleted file mode 100644 index 8ab50348..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_fails.c +++ /dev/null @@ -1,702 +0,0 @@ -/* Testing the multiple interface DHCP Client */ - -/* Test with NX_DHCP_CLIENT_SEND_ARP_PROBE enabled on the DHCP Client. Only using - one interface at present. To get this to work with a RAM driver, the 'DHCP server' - assigns its own address to the DHCP Client. When the Client sends the ARP probe - the server will automatically respond. On receiving this ARP message, the Client - IP stores it in its table. On the next expiration between sending probes, the Client - checks the ARP table, finds this entry and declares the IP address is not unique. - It sends a DECLINE message and start again in the INIT state. */ - - // jlc to do - // need to add a way to confirm DECLINE is sent e.g. add declines_recvd to the struct? - // need a way to 'stop' the client test. Right now it spins endlessly. - // test on NetX DUo 5.11 with the new ARP send probe/handle conflict logic - - -#include "tx_api.h" -#include "nx_api.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - -#define DEMO_STACK_SIZE 4096 -#define PACKET_PAYLOAD 1518 - -/* Define the ThreadX, NetX object control blocks... */ - -NX_UDP_SOCKET server_socket; -TX_THREAD client_thread; -TX_THREAD server_thread; -NX_PACKET_POOL client_pool; -NX_PACKET_POOL server_pool; -NX_IP client_ip; -NX_IP server_ip; - - -/* Define the NetX FTP object control block. */ -NX_DHCP dhcp_client; - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define NUM_RESPONSES 3 -static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client_running = NX_FALSE; -static UINT state_changes[2] = {0,0}; -static UINT renews[2] = {0,0}; -static UINT rebinds[2] = {0,0}; -static UINT bounds[2] = {0,0}; - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -void server_thread_entry(ULONG thread_input); -void client_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number); -static void dhcp_test_initialize(); -static UINT send_arp_reply(NX_DHCP *dhcp_ptr, UINT iface_index); -static void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state); -static void dhcp_interface_state_change0(NX_DHCP *dhcp_ptr, UCHAR new_state); -static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state); - -extern void test_control_return(UINT); -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); - - -static char offer_response[300] = { - -0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* {.....T. */ -0x58, 0xAD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* ........ 192.2.2.1*/ -//0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ '192.2.2.247*/ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response_size = 300; - -/* Frame (342 bytes) */ -static char ack_response[300] = { - -0x02, 0x01, 0x06, 0x00, 0x31, 0x9D, /* {.....T. */ -0x58, 0xAD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0x01, 0xc0, 0x02, /* ........ */ -//0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x57, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response_size = 300; - -// this isn't used but just leave it here. -static char arp_response[60] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x57, // dest -0x00, 0x0c, 0xf1, 0x7d, 0xca, 0xa6, // source -0x08, 0x06, -0x00, 0x01, -0x08, 0x00, -0x06, 0x04, 0x00, 0x02, -0x00, 0x0c, 0xf1, 0x7d, 0xca, 0xa6, // source mac - who cares, someone else -0xc0, 0x02, 0x02, 0xF7, // source IP - node who owns IP address already -0x00, 0x11, 0x22, 0x33, 0x44, 0x57, // target mac - dhcp client mac -0x00, 0x00, 0x00, 0x0, // target IP - should be zeroes? -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .\...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00 /* .... */ -}; - -static int arp_response_size = 60; - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_cilent_arpprobe_fails_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the FTP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, - pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server_ip, - "Server IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - if (status) - error_counter++; - - - /* Set up the Client. */ - - /* Create the main client thread. */ - status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 25*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - pointer = pointer + 25*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "NetX Client IP Instance", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - pointer = pointer + 2048; - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - - return; - -} - -/* Define the FTP client thread. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; - - - - /* Let the server set up. */ - tx_thread_sleep(30); - -#ifdef REQUEST_CLIENT_IP -ULONG requested_ip; -UINT skip_discover_message = NX_FALSE; -#endif - - tx_thread_sleep(20); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); - if (status) - error_counter++; - - /* Set the client IP if the host is configured to do so. */ -#ifdef REQUEST_CLIENT_IP - - requested_ip = (ULONG)CLIENT_IP_ADDRESS; - - /* Request a specific IP address using the DHCP client address option. */ - status = nx_dhcp_request_client_ip(&dhcp_client, requested_ip, skip_discover_message); - if (status) - error_counter++; - -#endif - - /* Register state change variable. */ - status = nx_dhcp_state_change_notify(&dhcp_client, dhcp_state_change); - if (status) - error_counter++; - - status = nx_dhcp_interface_state_change_notify(&dhcp_client, 0, dhcp_interface_state_change0); - if (status) - error_counter++; - status = nx_dhcp_interface_state_change_notify(&dhcp_client, 1, dhcp_interface_state_change1); - if (status) - error_counter++; - - /* Start the DHCP Client. */ - status = nx_dhcp_start(&dhcp_client); - if (status) - error_counter++; - - while(client_running == NX_FALSE) - { - tx_thread_sleep(100); - } - - // jlc add status_interface check on IP address - // then wait for ****; - // if declines != 1; error - // if state != INIT/SELECTING error - -} - - -/* Define the helper FTP server thread. */ -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test1............\n"); // jlc remove the \n - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - i = 0; - - /* Wait for Client requests */ - while ( i < NUM_RESPONSES) - { - - if (i <= 1) - { - - status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - - printf("ERRO7R!\n"); - error_counter++; - } - else - { - printf("\nRECVd %dth packet\n", i); - - /* Release the packet. */ - nx_packet_release(my_packet); - - printf("Server sending response back. \n"); - status = nx_dhcp_response_packet_send(&server_socket, 68, i); - } - } - else - { - - /* Wait for the dhcp client to start the ARP probe process. */ - while (dhcp_client.nx_dhcp_interface[0].nx_dhcp_probe_count == 0) - tx_thread_sleep(10); - printf("Owner should send the Probe reply\n"); - } - - /* Check status. */ - if (status) - { - - printf("ERROR8!\n"); - error_counter++; - } - - - /* Advance the index for the next response. */ - i++; - } - - /* Check status. */ - if (status) - { - - printf("ERRO7R!\n"); - error_counter++; - } - /* Should get one more message from the Client, a DECLINE message. */ - status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - - printf("ERRO7R!\n"); - error_counter++; - } - - - printf("All done, waiting for client to go away\n"); - - /* Wait for the client to terminate the connection. */ - while(client_running != NX_TRUE) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server_socket); - - if(error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - - -static void dhcp_test_initialize() -{ - - -/* Download data responses */ - dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; - dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; - - dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; - dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; - - dhcp_response[2].dhcp_response_pkt_data = &arp_response[0]; - dhcp_response[2].dhcp_response_pkt_size = arp_response_size ; - -} - - - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number) -{ -UINT status; -NX_PACKET *response_packet; - - printf("Sending %dth response\n", packet_number); - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, - dhcp_response[packet_number].dhcp_response_pkt_size); - - /* Adjust the write pointer. */ - response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ - status = nx_udp_socket_send(server_socket, response_packet, 0xFFFFFFFF, 68); - - - /* Check the status. */ - if (status) - nx_packet_release(response_packet); - - return status; -} - -UINT send_arp_reply(NX_DHCP *dhcp_ptr, UINT iface_index) -{ - -UINT status; -NX_PACKET *request_ptr; -ULONG *message_ptr; -NX_IP_DRIVER driver_request; -NX_IP *ip_ptr; -NX_INTERFACE *dhcp_interface; -ULONG lsw, msw, sender_ip_address; - - ip_ptr = dhcp_ptr -> nx_dhcp_ip_ptr; - - /* Allocate a packet to build the ARP message in. */ - status = nx_packet_allocate(ip_ptr -> nx_ip_default_packet_pool, &request_ptr, NX_PHYSICAL_HEADER, NX_NO_WAIT); - if (status != NX_SUCCESS) - { - - /* Error getting packet, so just get out! */ - return status; - } - /* Stamp the packet with the outgoing interface information. */ - dhcp_interface = &(ip_ptr -> nx_ip_interface[iface_index]); - request_ptr -> nx_packet_ip_interface = dhcp_interface; - - /* Build the ARP request packet. */ - - /* Setup the size of the ARP message. */ - request_ptr -> nx_packet_length = 28; - - /* Setup the append pointer to the end of the message. */ - request_ptr -> nx_packet_append_ptr = request_ptr -> nx_packet_prepend_ptr + 28; - - /* Setup the pointer to the message area. */ - message_ptr = (ULONG *) request_ptr -> nx_packet_prepend_ptr; - - /* Write the Hardware type into the message. */ - *message_ptr = (ULONG) (1 << 16) | (0x08); - *(message_ptr+1) = (ULONG) (6 << 24) | (4 << 16) | 2; - /* Sender mac address */ - msw = 0x0c; - lsw = 0xf17dcaa6; - *(message_ptr+2) = (ULONG) (msw << 16) |(lsw >> 16); - - /* Rest of sender mac address and sender IP address */ - sender_ip_address = dhcp_ptr -> nx_dhcp_interface[iface_index].nx_dhcp_ip_address; - *(message_ptr+3) = (ULONG) ((lsw << 16) | (sender_ip_address >> 16)); - - /* Target mac address */ - msw = 0x11; - lsw = 0x22334457; - *(message_ptr+4) = (msw << 16) |(lsw >> 16); - *(message_ptr+4) = (sender_ip_address << 16) | (msw & NX_LOWER_16_MASK); - *(message_ptr+5) = lsw; - - /* Target address */ - *(message_ptr+6) = (ULONG) 0x0; - - /* Endian swapping logic. If NX_LITTLE_ENDIAN is specified, these macros will - swap the endian of the ARP message. */ - NX_CHANGE_ULONG_ENDIAN(*(message_ptr)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+1)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+3)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+4)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+5)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr+6)); - - /* Send the ARP request to the driver. */ - driver_request.nx_ip_driver_ptr = ip_ptr; - driver_request.nx_ip_driver_command = NX_LINK_ARP_SEND; - driver_request.nx_ip_driver_packet = request_ptr; - driver_request.nx_ip_driver_physical_address_msw = 0xFFFFUL; - driver_request.nx_ip_driver_physical_address_lsw = 0xFFFFFFFFUL; - driver_request.nx_ip_driver_interface = dhcp_interface; - (dhcp_interface -> nx_interface_link_driver_entry) (&driver_request); - - return NX_SUCCESS; -} - -// jlc this does not get called. Is that correct behavior? -void dhcp_state_change(NX_DHCP *dhcp_ptr, UCHAR new_state) -{ - - dhcp_interface_state_change0(dhcp_ptr, new_state); -} - -void dhcp_interface_state_change0(NX_DHCP *dhcp_ptr, UCHAR new_state) -{ - -UINT dhcp_state; - - dhcp_state = (UINT)new_state; - - - /* Increment state changes counter. */ - state_changes[0]++; - - if (dhcp_state == NX_DHCP_STATE_RENEWING) - { - renews[0]++; - } - else if (dhcp_state == NX_DHCP_STATE_REBINDING) - { - rebinds[0]++; - } - else if (dhcp_state == NX_DHCP_STATE_BOUND) - { - bounds[0]++; - } - - return; -} - - -void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UCHAR new_state) -{ - -UINT dhcp_state; - - dhcp_state = (UINT)new_state; - - - /* Increment state changes counter. */ - state_changes[1]++; - - if (dhcp_state == NX_DHCP_STATE_RENEWING) - { - renews[1]++; - } - else if (dhcp_state == NX_DHCP_STATE_REBINDING) - { - rebinds[1]++; - } - else if (dhcp_state == NX_DHCP_STATE_BOUND) - { - bounds[1]++; - } - - return; -} - - diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c deleted file mode 100644 index 90366e09..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c +++ /dev/null @@ -1,950 +0,0 @@ -/* Testing the multiple interface DHCP Client */ - -/* This is the DHCP Client that will run on both interfaces independently. - Required: NX_MAX_PHYSICAL_INTERFACES = 2 and NX_DHCP_CLIENT_MAX_INTERFACES = 1. - There are two DHCP Client threads that are switching from manual to DHCP CLient address - mode, and switch from activated to deactivated. There is one server thread checking - for DHCP Client messages on primary and secondary interfaces. -*/ - - - -#include "tx_api.h" -#include "nx_api.h" -extern void test_control_return(UINT); -#ifndef NX_DISABLE_IPV4 -#include "nx_arp.h" -#include "nx_ram_network_driver_test_1500.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - -#define DEMO_STACK_SIZE 4096 -#define PACKET_PAYLOAD 1518 - - - -/* Define the ThreadX, NetX object control blocks... */ - -static NX_UDP_SOCKET server0_socket; -static TX_THREAD client0_thread; -static TX_THREAD client1_thread; -static TX_THREAD server0_thread; -static NX_PACKET_POOL client_pool; -static NX_PACKET_POOL server_pool; -static NX_IP client_ip; -static NX_IP server0_ip; - -static UINT probe0 = NX_FALSE; -static UINT probe1 = NX_FALSE; -static UINT bound0 = NX_FALSE; -static UINT bound1 = NX_FALSE; - -/* Define the NetX FTP object control block. */ -static NX_DHCP dhcp_client; -static ULONG dhcp_xid; - - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define NUM_RESPONSES 2 -static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; -static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client0_running = NX_TRUE; -static UINT client1_running = NX_TRUE; - - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -static void server0_thread_entry(ULONG thread_input); -static void client0_thread_entry(ULONG thread_input); -static void client1_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); -static void dhcp_test_initialize(); - -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); -static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); - - -/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 - because there are four entities (server 2 interfaces, client 2 interfaces - and the ram driver increases the MAC sequentially starting from - 11 22 33 44 56. */ - - -static char offer_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response0_size = 300; - -/* Frame (342 bytes) */ -static char ack_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response0_size = 300; - -static char offer_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response1_size = 300; - -/* Frame (342 bytes) */ -static char ack_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response1_size = 300; - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the DHCP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server0_thread, "Server 0 thread ", server0_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server0_ip, - "Server 0 IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - status = nx_ip_interface_attach(&server0_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server0_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server0_ip); - - if (status) - error_counter++; - - /* Set up the Client. */ - - /* Create the main client thread. */ - status = tx_thread_create(&client0_thread, "Client 0", client0_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the secondary client thread. */ - status = tx_thread_create(&client1_thread, "Client 1", client1_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 12*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 2048; - - status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); - - if (status) - error_counter++; - - /* Keep track of interface DHCP Client state changes. */ - status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); - - if (status) - error_counter++; - - return; -} - - -/* Define the DHCP client thread. */ - -void client0_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT time_keeper; - - - tx_thread_sleep(10); - - /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ - status = nx_dhcp_interface_start(&dhcp_client, 0); - if (status != NX_SUCCESS) - { - error_counter++; - } - - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ - time_keeper = 0; - - while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - tx_thread_sleep(10); - time_keeper += 10; - if (time_keeper > 1000) - { - break; - } - } - - if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE)) - { - error_counter++; - } - - /* Now stop the DHCP Client 0. */ - nx_dhcp_interface_disable(&dhcp_client, 0); - - /* Verify the DHCP CLient is not enabled on the primary interface. */ - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) - { - error_counter++; - } - client0_running = NX_FALSE; - -} - -void client1_thread_entry(ULONG thread_input) -{ - -UINT status; - - - tx_thread_sleep(10); - - if (NX_DHCP_CLIENT_MAX_RECORDS != 2) - { - error_counter++; - } - - status = nx_dhcp_interface_enable(&dhcp_client, 1); - if (status != NX_SUCCESS) - { - - error_counter++; - } - - status = nx_dhcp_interface_start(&dhcp_client, 1); - - if (status != NX_SUCCESS) - { - error_counter++; - } - else - { - - UINT time_keeper = 0; - while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - tx_thread_sleep(20); - time_keeper += 20; - if (time_keeper > 1000) - { - break; - } - } - - if ((probe1 != NX_TRUE) || (bound1 != NX_TRUE)) - { - error_counter++; - } - - /* Now disable DHCP Client 1 activity. This reinitializes the Client too. */ - status = nx_dhcp_interface_disable(&dhcp_client, 1); - if (status) - { - error_counter++; - } - } - - if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) - { - error_counter++; - } - client1_running = NX_FALSE; -} - -/* Define the Primary DHCP server thread. */ -void server0_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i, j, k, pkt_number; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test............."); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server0_ip, &server0_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server0_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - i = 0; - j = 0; - k = 0; - pkt_number = 0; - - /* Set the advanced callback to ensure broadcast packets are routed correctly. */ - advanced_packet_process_callback = my_dhcp_process_bc_callback; - - /* Wait for Client requests */ - while ( i < (2*NUM_RESPONSES)) - { - - status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - error_counter++; - } - else - { - - UINT source_port; - ULONG source_ip_address; - UINT protocol; - UINT iface_index; - - /* Get the XID of DHCP message from DHCP Server. */ - dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); - - nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); - - /* Release the packet. */ - nx_packet_release(my_packet); - - if (iface_index == 0) - { - pkt_number = j; - - } - else - { - pkt_number = k; - - } - - status = nx_dhcp_response_packet_send(&server0_socket, 68, pkt_number, iface_index); - - if (iface_index == 0) - j++; - else - k++; - - /* Check status. */ - if (status) - { - error_counter++; - } - } - - /* Advance the index for the next response. */ - i++; - } - - /* Wait for the client to terminate the connection. */ - while((client0_running == NX_TRUE) || (client1_running == NX_TRUE)) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server0_socket); - - if(error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - -static void dhcp_test_initialize() -{ - - - /* Set up server responses on the primary interface. */ - dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; - dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; - - dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; - dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; - - /* Set up server responses on the secondary interface. */ - dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; - dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; - - dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; - dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; - -} - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) -{ - -UINT status; -NX_PACKET *response_packet; -UCHAR *work_ptr; -#ifdef __PRODUCT_NETXDUO__ -NXD_ADDRESS ip_address; -#else -ULONG ip_address; -NX_PACKET **response_packet_ptr_ptr; -#endif - -#ifdef __PRODUCT_NETXDUO__ - ip_address.nxd_ip_version = NX_IP_VERSION_V4; - ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; -#else - ip_address = 0xFFFFFFFF; -#endif - - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - if (iface_index == 0) - { - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, - dhcp_response0[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; - } - else if (iface_index == 1) - { - - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, - dhcp_response1[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; - } - - /* Now replace the XID in the server message with what we know is the Client XID. */ - work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); - NX_CHANGE_ULONG_ENDIAN(dhcp_xid); - memcpy(work_ptr, (void const *)(&dhcp_xid), 4); - - - /* Adjust the write pointer. */ - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ -#ifdef __PRODUCT_NETXDUO__ - status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); -#else - response_packet_ptr_ptr = &response_packet; - status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); -#endif - - /* Check the status. */ - if (status) - { - - error_counter++; - - nx_packet_release(response_packet); - } - - return status; -} - - -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - - -UCHAR *work_ptr; -ULONG *message_ptr; -UINT interface_index; -UINT packet_client_mac_lsw; -ULONG sender_physical_lsw; -NX_PACKET *packet_copy; - - - /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet - prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ - if (packet_ptr -> nx_packet_length < 200) - { - - message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (sender_physical_lsw == 0x22334458) - { - interface_index = 0; - } - else if (sender_physical_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ - { - - /* Set work_ptr. */ -#ifdef __PRODUCT_NETXDUO__ - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#else - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#endif - /* Pickup the target MAC address in the DHCP message. */ - packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | - (((ULONG)work_ptr[3]) << 16) | - (((ULONG)work_ptr[4]) << 8) | - ((ULONG)work_ptr[5]); - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (packet_client_mac_lsw == 0x22334458) - { - interface_index = 0; - } - else if (packet_client_mac_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - - /* Copy to a new packet and drop the original packet. */ - nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); - - /* Based on the packet mac address, set the packet interface based on the mac address */ - packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); - - if (packet_ptr -> nx_packet_length > 200) - { - - if (ip_ptr == &server0_ip) - { - _nx_ip_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_ip_packet_receive(&server0_ip, packet_copy); - } - } - else - { - - if (ip_ptr == &server0_ip) - { - _nx_arp_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_arp_packet_receive(&server0_ip, packet_copy); - } - } - - *operation_ptr = NX_RAMDRIVER_OP_DROP; - - return NX_TRUE; - -} - -ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) -{ - -ULONG value = 0; - - - /* Process the data retrieval request. */ - while (size-- > 0) - { - - /* Build return value. */ - value = (value << 8) | *data++; - } - - /* Return value. */ - return(value); -} - -VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) -{ - - if (iface_index == 0) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound0 = NX_TRUE; - } - } - else if (iface_index == 1) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe1 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound1 = NX_TRUE; - } - } - else - error_counter++; - - return; -} - -#else -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_client_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test...............N/A\n"); - test_control_return(3); -} -#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c deleted file mode 100644 index b1bdbd19..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_test.c +++ /dev/null @@ -1,949 +0,0 @@ -/* Testing the multiple interface DHCP Client */ - -/* This is the DHCP Client that will run on both interfaces independently. - Required: NX_MAX_PHYSICAL_INTERFACES = 2 and NX_DHCP_CLIENT_MAX_INTERFACES = 1. - There are two DHCP Client threads that are switching from manual to DHCP CLient address - mode, and switch from activated to deactivated. There is one server thread checking - for DHCP Client messages on primary and secondary interfaces. -*/ - - - -#include "tx_api.h" -#include "nx_api.h" -extern void test_control_return(UINT); -#ifndef NX_DISABLE_IPV4 -#include "nx_arp.h" -#include "nx_ram_network_driver_test_1500.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - -#define DEMO_STACK_SIZE 4096 -#define PACKET_PAYLOAD 1518 - - - -/* Define the ThreadX, NetX object control blocks... */ - -static NX_UDP_SOCKET server0_socket; -static TX_THREAD client0_thread; -static TX_THREAD client1_thread; -static TX_THREAD server0_thread; -static NX_PACKET_POOL client_pool; -static NX_PACKET_POOL server_pool; -static NX_IP client_ip; -static NX_IP server0_ip; - -static UINT probe0 = NX_FALSE; -static UINT probe1 = NX_FALSE; -static UINT bound0 = NX_FALSE; -static UINT bound1 = NX_FALSE; - -/* Define the NetX FTP object control block. */ -static NX_DHCP dhcp_client; -static ULONG dhcp_xid; - - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define NUM_RESPONSES 2 -static DHCP_RESPONSE dhcp_response0[NUM_RESPONSES]; -static DHCP_RESPONSE dhcp_response1[NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client0_running = NX_TRUE; -static UINT client1_running = NX_TRUE; - - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -static void server0_thread_entry(ULONG thread_input); -static void client0_thread_entry(ULONG thread_input); -static void client1_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); -static void dhcp_test_initialize(); - -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); -static VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); - - -/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 - because there are four entities (server 2 interfaces, client 2 interfaces - and the ram driver increases the MAC sequentially starting from - 11 22 33 44 56. */ - - -static char offer_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response0_size = 300; - -/* Frame (342 bytes) */ -static char ack_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response0_size = 300; - -static char offer_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response1_size = 300; - -/* Frame (342 bytes) */ -static char ack_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response1_size = 300; - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_client_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the DHCP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server0_thread, "Server 0 thread ", server0_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server0_ip, - "Server 0 IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - status = nx_ip_interface_attach(&server0_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server0_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server0_ip); - - if (status) - error_counter++; - - /* Set up the Client. */ - - /* Create the main client thread. */ - status = tx_thread_create(&client0_thread, "Client 0", client0_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the secondary client thread. */ - status = tx_thread_create(&client1_thread, "Client 1", client1_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 12*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 12*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 2048; - - status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); - - if (status) - error_counter++; - - /* Keep track of interface DHCP Client state changes. */ - status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); - - if (status) - error_counter++; - - return; -} - - -/* Define the DHCP client thread. */ - -void client0_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT time_keeper; - - - tx_thread_sleep(10); - - /* Start DHCP on all enabled interfaces (which at the moment is just the primary interface). */ - status = nx_dhcp_interface_start(&dhcp_client, 0); - if (status != NX_SUCCESS) - { - error_counter++; - } - - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - /* Wait for the Client to bind an ARP adddress, including the ARP probe test. */ - time_keeper = 0; - - while(dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - tx_thread_sleep(10); - time_keeper += 10; - if (time_keeper > 1000) - { - break; - } - } - - if ((probe0 != NX_TRUE) || (bound0 != NX_TRUE)) - { - error_counter++; - } - - /* Now stop the DHCP Client 0. */ - nx_dhcp_interface_disable(&dhcp_client, 0); - - /* Verify the DHCP CLient is not enabled on the primary interface. */ - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[0].nx_interface_ip_address != 0x0) - { - error_counter++; - } - client0_running = NX_FALSE; - -} - -void client1_thread_entry(ULONG thread_input) -{ - -UINT status; - - - tx_thread_sleep(10); - - if (NX_DHCP_CLIENT_MAX_RECORDS != 2) - { - error_counter++; - } - - status = nx_dhcp_interface_enable(&dhcp_client, 1); - if (status != NX_SUCCESS) - { - - error_counter++; - } - - status = nx_dhcp_interface_start(&dhcp_client, 1); - - if (status != NX_SUCCESS) - { - error_counter++; - } - else - { - - UINT time_keeper = 0; - while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - tx_thread_sleep(20); - time_keeper += 20; - if (time_keeper > 1000) - { - break; - } - } - - if ((probe1 != NX_TRUE) || (bound1 != NX_TRUE)) - { - error_counter++; - } - - /* Now disable DHCP Client 1 activity. This reinitializes the Client too. */ - status = nx_dhcp_interface_disable(&dhcp_client, 1); - if (status) - { - error_counter++; - } - } - - if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - if (client_ip.nx_ip_interface[1].nx_interface_ip_address != 0x0) - { - error_counter++; - } - client1_running = NX_FALSE; -} - -/* Define the Primary DHCP server thread. */ -void server0_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i, j, k, pkt_number; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test............."); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server0_ip, &server0_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server0_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - i = 0; - j = 0; - k = 0; - pkt_number = 0; - - /* Set the advanced callback to ensure broadcast packets are routed correctly. */ - advanced_packet_process_callback = my_dhcp_process_bc_callback; - - /* Wait for Client requests */ - while ( i < (2*NUM_RESPONSES)) - { - - status = nx_udp_socket_receive(&server0_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - error_counter++; - } - else - { - - UINT source_port; - ULONG source_ip_address; - UINT protocol; - UINT iface_index; - - /* Get the XID of DHCP message from DHCP Server. */ - dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); - - nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); - - /* Release the packet. */ - nx_packet_release(my_packet); - - if (iface_index == 0) - { - pkt_number = j; - - } - else - { - pkt_number = k; - - } - - status = nx_dhcp_response_packet_send(&server0_socket, 68, pkt_number, iface_index); - - if (iface_index == 0) - j++; - else - k++; - - /* Check status. */ - if (status) - { - error_counter++; - } - } - - /* Advance the index for the next response. */ - i++; - } - - /* Wait for the client to terminate the connection. */ - while((client0_running == NX_TRUE) || (client1_running == NX_TRUE)) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server0_socket); - - if(error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - -static void dhcp_test_initialize() -{ - - - /* Set up server responses on the primary interface. */ - dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; - dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; - - dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; - dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; - - /* Set up server responses on the secondary interface. */ - dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; - dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; - - dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; - dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; - -} - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) -{ - -UINT status; -NX_PACKET *response_packet; -UCHAR *work_ptr; -#ifdef __PRODUCT_NETXDUO__ -NXD_ADDRESS ip_address; -#else -ULONG ip_address; -NX_PACKET **response_packet_ptr_ptr; -#endif - -#ifdef __PRODUCT_NETXDUO__ - ip_address.nxd_ip_version = NX_IP_VERSION_V4; - ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; -#else - ip_address = 0xFFFFFFFF; -#endif - - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - if (iface_index == 0) - { - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, - dhcp_response0[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; - } - else if (iface_index == 1) - { - - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, - dhcp_response1[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; - } - - /* Now replace the XID in the server message with what we know is the Client XID. */ - work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); - NX_CHANGE_ULONG_ENDIAN(dhcp_xid); - memcpy(work_ptr, (void const *)(&dhcp_xid), 4); - - - /* Adjust the write pointer. */ - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ -#ifdef __PRODUCT_NETXDUO__ - status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); -#else - response_packet_ptr_ptr = &response_packet; - status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); -#endif - - /* Check the status. */ - if (status) - { - - error_counter++; - - nx_packet_release(response_packet); - } - - return status; -} - - -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - - -UCHAR *work_ptr; -ULONG *message_ptr; -UINT interface_index; -UINT packet_client_mac_lsw; -ULONG sender_physical_lsw; -NX_PACKET *packet_copy; - - - /* Check if this is an IP or an ARP (smaller) packet. We don't know where the packet - prepend pointer is so assume anything less than 200 bytes is an ARP packet. */ - if (packet_ptr -> nx_packet_length < 200) - { - - message_ptr = (ULONG *)(packet_ptr -> nx_packet_prepend_ptr); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - sender_physical_lsw = (*(message_ptr + 2) << 16) | (*(message_ptr + 3) >> 16); - - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 2)); - NX_CHANGE_ULONG_ENDIAN(*(message_ptr + 3)); - - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (sender_physical_lsw == 0x22334458) - { - interface_index = 0; - } - else if (sender_physical_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - else /* if (packet_type == MY_DRIVER_ETHERNET_IP) */ - { - - /* Set work_ptr. */ -#ifdef __PRODUCT_NETXDUO__ - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#else - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#endif - /* Pickup the target MAC address in the DHCP message. */ - packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | - (((ULONG)work_ptr[3]) << 16) | - (((ULONG)work_ptr[4]) << 8) | - ((ULONG)work_ptr[5]); - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (packet_client_mac_lsw == 0x22334458) - { - interface_index = 0; - } - else if (packet_client_mac_lsw == 0x22334459) - { - interface_index = 1; - } - else - { - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - } - - /* Copy to a new packet and drop the original packet. */ - nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); - - /* Based on the packet mac address, set the packet interface based on the mac address */ - packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); - - if (packet_ptr -> nx_packet_length > 200) - { - - if (ip_ptr == &server0_ip) - { - _nx_ip_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_ip_packet_receive(&server0_ip, packet_copy); - } - } - else - { - - if (ip_ptr == &server0_ip) - { - _nx_arp_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_arp_packet_receive(&server0_ip, packet_copy); - } - } - - *operation_ptr = NX_RAMDRIVER_OP_DROP; - - return NX_TRUE; - -} - -ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) -{ - -ULONG value = 0; - - - /* Process the data retrieval request. */ - while (size-- > 0) - { - - /* Build return value. */ - value = (value << 8) | *data++; - } - - /* Return value. */ - return(value); -} - -VOID dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) -{ - - if (iface_index == 0) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound0 = NX_TRUE; - } - } - else if (iface_index == 1) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - probe1 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound1 = NX_TRUE; - } - } - else - error_counter++; - - return; -} -#else -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_client_arpprobe_multiple_interface_test_application_define(void *first_unused_memory) -#endif -{ - printf("NetX Test: DHCP Client Multiple Interface ARP Probe Test...............N/A\n"); - test_control_return(3); -} -#endif diff --git a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c b/test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c deleted file mode 100644 index 60a65219..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_arpprobe_succeeds.c +++ /dev/null @@ -1,614 +0,0 @@ -/* Testing the multiple interface DHCP Client. NX_DHCP_CLIENT_MAX_RECORDS should be set to 2. */ - -/* Test with NX_DHCP_CLIENT_SEND_ARP_PROBE enabled on the DHCP Client. Only using - interface 1 at present (primary interface is disabled for DHCP). The Client sends - three ARP probes without a conflict response ARP packet. It proceeds to the BOUND state. */ - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_ram_network_driver_test_1500.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - -#define DEMO_STACK_SIZE 2098 -#define PACKET_PAYLOAD 1518 - -/* Define the ThreadX, NetX object control blocks... */ - -NX_UDP_SOCKET server_socket; -TX_THREAD client_thread; -TX_THREAD server_thread; -NX_PACKET_POOL client_pool; -NX_PACKET_POOL server_pool; -NX_IP client_ip; -NX_IP server_ip; - - -/* Define the NetX DHCP object control block. */ -NX_DHCP dhcp_client; - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define NUM_RESPONSES 2 -static DHCP_RESPONSE dhcp_response[NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client_running = NX_TRUE; - -static UINT state_changes[2] = {0,0}; -static UINT bounds[2] = {0,0}; - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -void server_thread_entry(ULONG thread_input); -void client_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); -static void dhcp_test_initialize(); -static void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); -extern void test_control_return(UINT); -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); - - -static char offer_response[300] = { -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xf0, 0x1c, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xb4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ '192.2.2.247*/ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response_size = 300; - -/* Frame (342 bytes) */ -static char ack_response[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xf0, 0x1c, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xb4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response_size = 300; - - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_cilent_arpprobe_succeeds_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the FTP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server_thread, "Server thread ", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, - pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server_ip, - "Server IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - if (status) - error_counter++; - - /* Create the main client thread. */ - status = tx_thread_create(&client_thread, "Client thread ", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 5*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - pointer = pointer + 5*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "Client 0 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - pointer = pointer + 2048; - - status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - return; - } - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - return; - -} - -/* Define the DHCP client thread. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT time_keeper = 0; - - /* Let the server set up. */ - tx_thread_sleep(10); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); - if (status) - error_counter++; - - /* Register state change variable. */ - status = nx_dhcp_interface_enable(&dhcp_client, 1); - status |= nx_dhcp_interface_disable(&dhcp_client, 0); - if (status) - error_counter++; - - status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change1); - if (status) - error_counter++; - - /* Start the DHCP Client. */ - status = nx_dhcp_interface_start(&dhcp_client, 1); - if (status) - error_counter++; - - /* Put an upper limit on wait for achieving the bound state. */ - while((dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) && - (time_keeper < 1000)) - { - time_keeper += 100; - tx_thread_sleep(100); - } - - if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - error_counter++; - } - - if (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state != NX_DHCP_STATE_NOT_STARTED) - { - error_counter++; - } - - client_running = NX_FALSE; - - return; -} - - -/* Define the helper DHCP server thread. */ -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test............."); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server_ip, &server_socket, "Socket Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - i = 0; - - /* Set the advanced callback to ensure broadcast packets are routed correctly. */ - advanced_packet_process_callback = my_dhcp_process_bc_callback; - - /* Wait for Client requests */ - while ( i < NUM_RESPONSES) - { - - if (i <= 1) - { - - status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - - error_counter++; - } - else - { - /* Release the packet. */ - nx_packet_release(my_packet); - - status = nx_dhcp_response_packet_send(&server_socket, 68, i, 0); - - /* Check status. */ - if (status) - { - error_counter++; - } - } - } - else - { - - /* Wait for the dhcp client to start the ARP probe process. */ - while (dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_probe_count == 0) - tx_thread_sleep(10); - - } - - /* Advance the index for the next response. */ - i++; - } - - /* Wait for the client to terminate the connection. */ - while(client_running == NX_TRUE) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server_socket); - - if(error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - - -static void dhcp_test_initialize() -{ - - /* Set up server responses */ - dhcp_response[0].dhcp_response_pkt_data = &offer_response[0]; - dhcp_response[0].dhcp_response_pkt_size = offer_response_size ; - - dhcp_response[1].dhcp_response_pkt_data = &ack_response[0]; - dhcp_response[1].dhcp_response_pkt_size = ack_response_size ; -} - - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) -{ -UINT status; -NX_PACKET *response_packet; -#ifdef __PRODUCT_NETXDUO__ -NXD_ADDRESS ip_address; -#else -ULONG ip_address; -NX_PACKET **response_packet_ptr_ptr; -#endif - - -#ifdef __PRODUCT_NETXDUO__ - ip_address.nxd_ip_version = NX_IP_VERSION_V4; - ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; - -#else - ip_address = 0xFFFFFFFF; -#endif - - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response[packet_number].dhcp_response_pkt_data, - dhcp_response[packet_number].dhcp_response_pkt_size); - - /* Adjust the write pointer. */ - response_packet -> nx_packet_length = dhcp_response[packet_number].dhcp_response_pkt_size; - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ -#ifdef __PRODUCT_NETXDUO__ - status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); - -#else - - response_packet_ptr_ptr = &response_packet; - - status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); -#endif - /* Check the status. */ - if (status) - { - nx_packet_release(response_packet); - error_counter++; - } - - return status; -} - - -void dhcp_interface_state_change1(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) -{ - -UINT dhcp_state; - - dhcp_state = (UINT)new_state; - - - /* Increment state changes counter. */ - state_changes[1]++; - - if (dhcp_state == NX_DHCP_STATE_BOUND) - { - bounds[1]++; - } - - return; -} - - -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - -UCHAR *work_ptr; -UINT interface_index; -UINT packet_client_mac_lsw; -NX_PACKET *packet_copy; - - - /* Is this a DHCP packet e.g. not an ARP packet? */ - if (packet_ptr -> nx_packet_length < 200) - { - /* Maybe an ARP packet. let the RAM driver deal with it */ - return NX_TRUE; - } - - /* Set work_ptr. */ -#ifdef __PRODUCT_NETXDUO__ - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#else - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#endif - - /* Pickup the target MAC address in the DHCP message. */ - packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | - (((ULONG)work_ptr[3]) << 16) | - (((ULONG)work_ptr[4]) << 8) | - ((ULONG)work_ptr[5]); - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (ip_ptr == &client_ip) - { - if (packet_client_mac_lsw == 0x22334457) - { - interface_index = 0; - } - else if (packet_client_mac_lsw == 0x22334458) - { - interface_index = 1; - } - else - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - } - - /* Copy to a new packet and drop the original packet. */ - nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); - - /* Based on the IP instance and packet mac address, set the packet interface */ - - if (ip_ptr == &server_ip) - { - - packet_copy -> nx_packet_ip_interface = &(client_ip.nx_ip_interface[1]); - _nx_ip_packet_receive(&client_ip, packet_copy); - } - else - { - - packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); - - _nx_ip_packet_receive(&server_ip, packet_copy); - } - - *operation_ptr = NX_RAMDRIVER_OP_DROP; - - return NX_TRUE; - -} - - diff --git a/test/regression/dhcp_test/netx_dhcp_client_decline_test.c b/test/regression/dhcp_test/netx_dhcp_client_decline_test.c deleted file mode 100644 index 846fc74c..00000000 --- a/test/regression/dhcp_test/netx_dhcp_client_decline_test.c +++ /dev/null @@ -1,999 +0,0 @@ -/* Testing the multiple interface DHCP Client */ - -/* This is the DHCP Client that will run on both interfaces independently. - Interface 0 stays bound; interface 1 declines the IP address and tries - again at the INIT state to get a unique IP address. - - Required: NX_MAX_PHYSICAL_INTERFACES >= 2 and NX_DHCP_CLIENT_MAX_INTERFACES >= 2. - Also NX_DHCP_CLIENT_SEND_ARP_PROBE must be enabled. Requires longer timeout in regression - test netxtestcontrol. - - There is one server thread handling DHCP Client messages on both interfaces. -*/ - - - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_ram_network_driver_test_1500.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_dhcp_client.h" -#else -#include "nx_dhcp.h" -#endif - - -#if (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) - -#define DEMO_STACK_SIZE 4096 -#define PACKET_PAYLOAD 1518 - -static ULONG dhcp_xid = 0; -static UINT bound0 = NX_FALSE; -static UINT arp_probe0 = NX_FALSE; -static UINT init0 = NX_FALSE; - - -/* Define the ThreadX, NetX object control blocks... */ - -static UINT state_changes = 0; -static NX_UDP_SOCKET server_socket; -static TX_THREAD client_thread; -static TX_THREAD server_thread; -static NX_PACKET_POOL client_pool; -static NX_PACKET_POOL server_pool; -static NX_IP client_ip; -static NX_IP server_ip; - - -/* Define the NetX FTP object control block. */ -static NX_DHCP dhcp_client; - -typedef struct DHCP_RESPONSE_STRUCT -{ - char *dhcp_response_pkt_data; - int dhcp_response_pkt_size; -} DHCP_RESPONSE; - -#define DHCP0_NUM_RESPONSES 4 -#define DHCP1_NUM_RESPONSES 2 -static DHCP_RESPONSE dhcp_response0[DHCP0_NUM_RESPONSES]; -static DHCP_RESPONSE dhcp_response1[DHCP1_NUM_RESPONSES]; - -/* Define the counters used in the demo application... */ - -static UINT error_counter = 0; -static UINT client_running = NX_TRUE; - - -#define SERVER_PORT 67 - - -/* Replace the 'ram' driver with your Ethernet driver. */ -extern VOID nx_driver_ram_driver(NX_IP_DRIVER*); - -static void server_thread_entry(ULONG thread_input); -static void client_thread_entry(ULONG thread_input); - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket, UINT port, INT packet_number, UINT iface_index); -static void dhcp_test_initialize(); -static void dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state); - -extern void test_control_return(UINT); -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr); -static ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size); - -/* Note that the network is 192.2.2.0 and the MAC address is 11 22 33 44 56 - because there are four entities (server 2 interfaces, client 2 interfaces - and the ram driver increases the MAC sequentially starting from - 11 22 33 44 56. */ - - -static char offer_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response0_size = 300; - -/* Frame (342 bytes) */ -static char ack_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response0_size = 300; - -static char offer_response1[300] = { - -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xF7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x01, 0x01, 0x01, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int offer_response1_size = 300; - -/* Frame (342 bytes) */ -static char ack_response1[300] = { - -//0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#ifdef __PRODUCT_NETXDUO__ -0x02, 0x01, 0x06, 0x00, 0x2a, 0x3e, 0xF0, 0x1D, -#else -0x02, 0x01, 0x06, 0x00, 0x08, 0x0d, 0xB4, 0x55, -#endif -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x01, 0x01, 0xf7, 0xc0, 0x01, /* ........ */ -0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x59, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x01, 0x01, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x01, 0x01, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x01, 0x01, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int ack_response1_size = 300; - -static char second_offer_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x02, 0x01, 0x04, 0xff, /* Sc5..... */ -0xff, 0xff, 0x00, 0x3a, 0x04, 0x00, 0x06, 0xac, /* ...:.... */ -0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, 0x0a, 0x33, /* .;.....3 */ -0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, 0x04, 0xc0, /* ...Y06.. */ -0x02, 0x02, 0x01, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int second_offer_response0_size = 300; - -/* Frame (342 bytes) */ -static char second_ack_response0[300] = { - -0x02, 0x01, 0x06, 0x00, 0x13, 0xae, 0x1c, 0xeb, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x02, 0x02, 0xf7, 0xc0, 0x02, /* ........ */ -0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, /* ........ */ -0x22, 0x33, 0x44, 0x58, 0x00, 0x00, 0x00, 0x00, /* T....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x82, /* ......c. */ -0x53, 0x63, 0x35, 0x01, 0x05, 0x3a, 0x04, 0x00, /* Sc5..:.. */ -0x06, 0xac, 0x98, 0x3b, 0x04, 0x00, 0x0b, 0xae, /* ...;.... */ -0x0a, 0x33, 0x04, 0x00, 0x0d, 0x59, 0x30, 0x36, /* .3...Y06 */ -0x04, 0xc0, 0x02, 0x02, 0x01, 0x01, 0x04, 0xff, /* ........ */ -0xff, 0xff, 0x00, 0x03, 0x04, 0xc0, 0x02, 0x02, /* ........ */ -0x01, 0x06, 0x04, 0xc0, 0x02, 0x02, 0x01, 0xff, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* ...... */ -}; - -static int second_ack_response0_size = 300; - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_client_decline_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Set up the DHCP Server. */ - - /* Create the main server thread. */ - status = tx_thread_create(&server_thread, "Server Thread ", server_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "Server Packet Pool", 700, pointer , 700*10); - - pointer = pointer + 700*10; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server_ip, - "Server IP", - IP_ADDRESS(192,2,2,1), - 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_1024, - pointer, DEMO_STACK_SIZE, 1); - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - status = nx_ip_interface_attach(&server_ip, "Server IP", IP_ADDRESS(192,1,1,1), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + DEMO_STACK_SIZE; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable UDP traffic. */ - status = nx_udp_enable(&server_ip); - - if (status) - error_counter++; - - /* Set up the Client. */ - - /* Create the main client thread. */ - status = tx_thread_create(&client_thread, "Client Thread", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Create a packet pool for the client. */ - status = nx_packet_pool_create(&client_pool, "Client Packet Pool", PACKET_PAYLOAD, pointer, 7*PACKET_PAYLOAD); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 7*PACKET_PAYLOAD; - - /* Create an IP instance for the client. */ - status = nx_ip_create(&client_ip, "Client IP ", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_1024, pointer, 2048, 1); - - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - pointer = pointer + 2048; - - status = nx_ip_interface_attach(&client_ip, "Client 1 IP", IP_ADDRESS(0,0,0,0), 0xFFFFFF00UL, _nx_ram_network_driver_1024); - /* Check status. */ - if (status != NX_SUCCESS) - { - error_counter++; - } - - /* Enable ARP and supply ARP cache memory for the Client IP. */ - nx_arp_enable(&client_ip, (void *) pointer, 1024); - - pointer = pointer + 1024; - - /* Enable UDP for client IP instance. */ - nx_udp_enable(&client_ip); - nx_icmp_enable(&client_ip); - - /* Load up the server 'responses'. */ - dhcp_test_initialize(); - - /* Create the DHCP instance. */ - status = nx_dhcp_create(&dhcp_client, &client_ip, "dhcp0"); - if (status) - error_counter++; - - return; -} - - -/* Define the DHCP client thread. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; -UINT time_keeper; - - - tx_thread_sleep(10); - - /* Register state change variable. */ - status = nx_dhcp_interface_state_change_notify(&dhcp_client, dhcp_interface_state_change); - if (status) - { - printf("ERROR!\n"); - test_control_return(1); - } - - status = nx_dhcp_interface_enable(&dhcp_client, 1); - if (status != NX_SUCCESS) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Start DHCP on all interfaces. */ - status = nx_dhcp_start(&dhcp_client); - if (status != NX_SUCCESS) - { - printf("ERROR!\n"); - test_control_return(1); - } - - if ((dhcp_client.nx_dhcp_interface_record[0].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED) || - (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state == NX_DHCP_STATE_NOT_STARTED))) - { - printf("ERROR!\n"); - test_control_return(1); - } - - time_keeper = 0; - - /* Wait for the ARP probe state... */ - while(!arp_probe0) - { - - /* SHould not go directly to the BOUND state. */ - if (bound0) - { - printf("ERROR5!\n"); - test_control_return(1); - - } - - tx_thread_sleep(15); - time_keeper += 15; - if (time_keeper > 2000) - { - break; - } - } - - /* If it is in the ARP probe state, decline the IP address independently of the DHCP CLient*/ - if (arp_probe0) - { - - status = nx_dhcp_interface_decline(&dhcp_client, 0); - - if (status == NX_SUCCESS) - { - - /* Wait for the decline action to reset the DHCP CLient. */ - tx_thread_sleep(20); - - if (!init0) - { - printf("ERROR3!\n"); - test_control_return(1); - } - else - { - - /* Now wait for the DHCP Client to be bound. */ - time_keeper = 0; - while(!bound0) - { - tx_thread_sleep(100); - time_keeper += 100; - if (time_keeper > 2000) - { - break; - } - } - - if (bound0 != NX_TRUE) - { - printf("ERROR2!\n"); - test_control_return(1); - } - } - } - } - else - { - printf("ERROR1!\n"); - test_control_return(1); - } - - - time_keeper = 0; - - while(dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - tx_thread_sleep(100); - time_keeper += 100; - if (time_keeper > 1500) - { - break; - } - } - - if (dhcp_client.nx_dhcp_interface_record[1].nx_dhcp_state != NX_DHCP_STATE_BOUND) - { - printf("ERROR4!\n"); - test_control_return(1); - } - - /* Now disable DHCP Client 1 activity. This reinitializes the Client too. */ - status = nx_dhcp_interface_disable(&dhcp_client, 1); - if (status) - { - printf("ERROR7!\n"); - test_control_return(1); - } - - client_running = NX_FALSE; - -} - - -/* Define the Primary DHCP server thread. */ -void server_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -UINT i, j, k, pkt_number; - - /* Print out test information banner. */ - printf("NetX Test: DHCP Client Decline Test.................................."); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR6!\n"); - test_control_return(1); - } - - /* Create a socket as the server. */ - status = nx_udp_socket_create(&server_ip, &server_socket, "Socket 0 Server", NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 5); - - /* Check status. */ - if (status) - { - error_counter++; - } - - status = nx_udp_socket_bind(&server_socket, NX_DHCP_SERVER_UDP_PORT, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - i = 0; - j = 0; - k = 0; - pkt_number = 0; - - /* Set the advanced callback to ensure broadcast packets are routed correctly. */ - advanced_packet_process_callback = my_dhcp_process_bc_callback; - - /* Wait for Client requests */ - while ( i < (DHCP0_NUM_RESPONSES + DHCP1_NUM_RESPONSES + 1)) - { - - status = nx_udp_socket_receive(&server_socket, &my_packet, 10 * NX_IP_PERIODIC_RATE); - - /* Check status. */ - if (status) - { - error_counter++; - } - else - { - - UINT source_port; - ULONG source_ip_address; - UINT protocol; - UINT iface_index; - - /* Get the XID of DHCP message from DHCP Server. */ - dhcp_xid = dhcp_get_dhcp_data(my_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID, 4); - - nx_udp_packet_info_extract(my_packet, &source_ip_address, &protocol, &source_port, &iface_index); - - /* Release the packet. */ - nx_packet_release(my_packet); - - if (iface_index == 0) - { - pkt_number = j; - - } - else - { - pkt_number = k; - } - - - /* This is the decline message. The server - does not respond to this. */ - if ((iface_index == 0) && (j == 2) && (i == 4)) - { - i++; - continue; - } - - status = nx_dhcp_response_packet_send(&server_socket, 68, pkt_number, iface_index); - - /* Check status. */ - if (status) - { - error_counter++; - } - - if (iface_index == 0) - j++; - else - k++; - } - /* Advance the index for the next response. */ - i++; - } - - /* Wait for the client to terminate the connection. */ - while(client_running == NX_TRUE) - tx_thread_sleep(20); - - /* Delete the UDP socket. */ - nx_udp_socket_delete(&server_socket); - - if(error_counter) - { - - printf("ERROR5!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - }; -} - -static void dhcp_test_initialize() -{ - - - /* Set up server responses on the primary interface. */ - dhcp_response0[0].dhcp_response_pkt_data = &offer_response0[0]; - dhcp_response0[0].dhcp_response_pkt_size = offer_response0_size ; - - dhcp_response0[1].dhcp_response_pkt_data = &ack_response0[0]; - dhcp_response0[1].dhcp_response_pkt_size = ack_response0_size ; - - dhcp_response0[2].dhcp_response_pkt_data = &second_offer_response0[0]; - dhcp_response0[2].dhcp_response_pkt_size = second_offer_response0_size ; - - dhcp_response0[3].dhcp_response_pkt_data = &second_ack_response0[0]; - dhcp_response0[3].dhcp_response_pkt_size = second_ack_response0_size ; - - - /* Set up server responses on the secondary interface. */ - dhcp_response1[0].dhcp_response_pkt_data = &offer_response1[0]; - dhcp_response1[0].dhcp_response_pkt_size = offer_response1_size ; - - dhcp_response1[1].dhcp_response_pkt_data = &ack_response1[0]; - dhcp_response1[1].dhcp_response_pkt_size = ack_response1_size ; - -} - -static UINT nx_dhcp_response_packet_send(NX_UDP_SOCKET *server_socket_ptr, UINT port, INT packet_number, UINT iface_index) -{ - -UINT status; -NX_PACKET *response_packet; -UCHAR *work_ptr; -#ifdef __PRODUCT_NETXDUO__ -NXD_ADDRESS ip_address; -#else -ULONG ip_address; -NX_PACKET **response_packet_ptr_ptr; -#endif - -#ifdef __PRODUCT_NETXDUO__ - ip_address.nxd_ip_version = NX_IP_VERSION_V4; - ip_address.nxd_ip_address.v4 = 0xFFFFFFFF; -#else - ip_address = 0xFFFFFFFF; -#endif - - /* Allocate a response packet. */ - status = nx_packet_allocate(&server_pool, &response_packet, NX_TCP_PACKET, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - } - - /* Write the response messages into the packet payload! */ - if (iface_index == 0) - { - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response0[packet_number].dhcp_response_pkt_data, - dhcp_response0[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response0[packet_number].dhcp_response_pkt_size; - } - else if (iface_index == 1) - { - - memcpy(response_packet -> nx_packet_prepend_ptr, dhcp_response1[packet_number].dhcp_response_pkt_data, - dhcp_response1[packet_number].dhcp_response_pkt_size); - - response_packet -> nx_packet_length = dhcp_response1[packet_number].dhcp_response_pkt_size; - } - - /* Now replace the XID in the server message with what we know is the Client XID. */ - work_ptr = (UCHAR *)(response_packet -> nx_packet_prepend_ptr + NX_BOOTP_OFFSET_XID); - NX_CHANGE_ULONG_ENDIAN(dhcp_xid); - memcpy(work_ptr, (void const *)(&dhcp_xid), 4); - - - /* Adjust the write pointer. */ - response_packet -> nx_packet_append_ptr = response_packet -> nx_packet_prepend_ptr + response_packet -> nx_packet_length; - - /* Send the packet with the correct port. */ -#ifdef __PRODUCT_NETXDUO__ - status = nxd_udp_socket_source_send(server_socket_ptr, response_packet, &ip_address, 68, iface_index); -#else - response_packet_ptr_ptr = &response_packet; - status = nx_udp_socket_interface_send(server_socket_ptr, *response_packet_ptr_ptr, ip_address, 68, iface_index); -#endif - - /* Check the status. */ - if (status) - { - - error_counter++; - - nx_packet_release(response_packet); - } - - return status; -} - -void dhcp_interface_state_change(NX_DHCP *dhcp_ptr, UINT iface_index, UCHAR new_state) -{ - - if (iface_index == 0) - { - - if (new_state == NX_DHCP_STATE_ADDRESS_PROBING) - { - arp_probe0 = NX_TRUE; - } - else if ((arp_probe0 == NX_TRUE) && (new_state== NX_DHCP_STATE_INIT)) - { - init0 = NX_TRUE; - } - else if (new_state == NX_DHCP_STATE_BOUND) - { - bound0 = NX_TRUE; - } - } - - state_changes++; - - return; -} - -static UINT my_dhcp_process_bc_callback(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT *operation_ptr, UINT *delay_ptr) -{ - -UCHAR *work_ptr; -UINT interface_index; -UINT packet_client_mac_lsw; -NX_PACKET *packet_copy; - - - /* Is this a DHCP packet e.g. not an ARP packet? */ - if (packet_ptr -> nx_packet_length < 200) - { - /* Maybe an ARP packet. let the RAM driver deal with it */ - return NX_TRUE; - } - - /* Set work_ptr. */ -#ifdef __PRODUCT_NETXDUO__ - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IPV4_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#else - work_ptr = packet_ptr -> nx_packet_prepend_ptr + sizeof(NX_IP_HEADER) + sizeof(NX_UDP_HEADER) +NX_BOOTP_OFFSET_CLIENT_HW; -#endif - /* Pickup the target MAC address in the DHCP message. */ - packet_client_mac_lsw = (((ULONG)work_ptr[2]) << 24) | - (((ULONG)work_ptr[3]) << 16) | - (((ULONG)work_ptr[4]) << 8) | - ((ULONG)work_ptr[5]); - - /* Determine what interface to use based on MAC address and which IP instance is sending the packet. */ - if (packet_client_mac_lsw == 0x22334458) - { - interface_index = 0; - } - else if (packet_client_mac_lsw == 0x22334459) - { - interface_index = 1; - } - else - /* Don't know what this packet is. Let DHCP Client handle it. */ - return NX_TRUE; - - /* Copy to a new packet and drop the original packet. */ - nx_packet_copy(packet_ptr, &packet_copy, &client_pool, NX_WAIT_FOREVER); - - /* Based on the packet mac address, set the packet interface based on the mac address */ - packet_copy -> nx_packet_ip_interface = &(ip_ptr -> nx_ip_interface[interface_index]); - - if (ip_ptr == &server_ip) - { - _nx_ip_packet_receive(&client_ip, packet_copy); - } - else - { - _nx_ip_packet_receive(&server_ip, packet_copy); - } - - *operation_ptr = NX_RAMDRIVER_OP_DROP; - - return NX_TRUE; - -} - -ULONG dhcp_get_dhcp_data(UCHAR *data, UINT size) -{ - -ULONG value = 0; - - - /* Process the data retrieval request. */ - while (size-- > 0) - { - - /* Build return value. */ - value = (value << 8) | *data++; - } - - /* Return value. */ - return(value); -} -#else -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_dhcp_client_decline_test_application_define(void * first_unused_memory) -#endif -{ - printf("NetX Test: DHCP Client Decline Test..................................N/A!\n"); - test_control_return(3); -} -#endif /* (NX_MAX_PHYSICAL_INTERFACES >= 2) && (NX_DHCP_CLIENT_MAX_RECORDS >=2) */ - - - diff --git a/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c b/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c index 075cf74e..6ba73da3 100644 --- a/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c +++ b/test/regression/dhcp_test/netx_dhcp_client_interface_0_only_test.c @@ -365,7 +365,7 @@ NX_PACKET *my_packet; UINT i; /* Print out test information banner. */ - printf("NetX Test: DHCP Client Interface 0 Only Test.........................\n"); // jlc remove the \n + printf("NetX Test: DHCP Client Interface 0 Only Test.........................\n"); /* Check for earlier error. */ if(error_counter) diff --git a/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c b/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c index 82427832..ae256b70 100644 --- a/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c +++ b/test/regression/dhcp_test/netx_dhcp_client_interface_1_only_test.c @@ -397,7 +397,7 @@ NX_PACKET *my_packet; UINT i; /* Print out test information banner. */ - printf("NetX Test: DHCP Client Interface 1 Only Test...........................\n"); // jlc remove the \n + printf("NetX Test: DHCP Client Interface 1 Only Test...........................\n"); /* Check for earlier error. */ if(error_counter) diff --git a/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c b/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c index e3168c3c..ea7d21dc 100644 --- a/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c +++ b/test/regression/dhcp_test/netx_dhcp_client_special_attributes_test.c @@ -5,11 +5,6 @@ set state change callback, before setting the interface to 1. The DHCP Client should transfer those attributes to the new active interface, and clear them on the old interface.*/ - // jlc to do - // confirm BOUND state is achieved - // test on a real network to verify probe timeouts are correct. - // need a way to 'stop' the client test. Right now it spins endlessly. - #include "tx_api.h" #include "nx_api.h" @@ -376,11 +371,6 @@ UINT skip_discover_message = NX_FALSE; nx_dhcp_release(&dhcp_client); - // jlc add status_interface check on IP address - // then wait for ****; - // if declines != 1; error - // if state != INIT/SELECTING error - } @@ -393,7 +383,7 @@ NX_PACKET *my_packet; UINT i; /* Print out test information banner. */ - printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test1............\n"); // jlc remove the \n + printf("NetX Test: DHCP Client ARP Probe Multiple Interface Test1............\n"); /* Check for earlier error. */ if(error_counter) diff --git a/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c b/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c index 194e17a3..845404ee 100644 --- a/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c +++ b/test/regression/dhcp_test/netx_dhcp_client_two_interfaces.c @@ -19,7 +19,7 @@ #define DEMO_STACK_SIZE 4096 #define PACKET_PAYLOAD 1518 -extern NX_PACKET *packet_copy; // jlc ram testing +extern NX_PACKET *packet_copy; /* Define the ThreadX, NetX object control blocks... */ @@ -568,11 +568,6 @@ UINT status; { tx_thread_sleep(100); } - - // jlc add status_interface check on IP address - // then wait for ****; if renews[0] != 1; error - // then wait for expire, and ***; if rebounds != 1 error - } /* Define the helper DHCP server thread on interface 0. */ @@ -584,7 +579,7 @@ NX_PACKET *my_packet; UINT i, j, k; /* Print out test information banner. */ - printf("NetX Test: DHCP Client Two Interface Test............................\n"); // jlc remove the \n + printf("NetX Test: DHCP Client Two Interface Test............................\n"); /* Check for earlier error. */ if(error_counter) @@ -618,7 +613,7 @@ UINT i, j, k; /* Wait for Client requests */ //while (i < 3) // Reduce this to see client packet retransmissions - while (i < NUM_RESPONSES) // jlc this let's the DHCP protocol complete. + while (i < NUM_RESPONSES) { status = nx_udp_socket_receive(&server_socket0, &my_packet, 10 * NX_IP_PERIODIC_RATE); diff --git a/test/regression/ftp_test/netx_ftp_rst_test.c b/test/regression/ftp_test/netx_ftp_rst_test.c index f74ee0a2..2c6b72af 100644 --- a/test/regression/ftp_test/netx_ftp_rst_test.c +++ b/test/regression/ftp_test/netx_ftp_rst_test.c @@ -1,5 +1,4 @@ /* This case tests the FTP server on handling RST packet. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-235 */ #include "tx_api.h" #include "fx_api.h" diff --git a/test/regression/ftp_test/netx_ftp_service_commands_dele_test.c b/test/regression/ftp_test/netx_ftp_service_commands_dele_test.c deleted file mode 100644 index fb76202d..00000000 --- a/test/regression/ftp_test/netx_ftp_service_commands_dele_test.c +++ /dev/null @@ -1,396 +0,0 @@ - -#include "tx_api.h" -#include "fx_api.h" -#include "nx_api.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_ftp_client.h" -#include "nxd_ftp_server.h" -#else -#include "nx_ftp_client.h" -#include "nx_ftp_server.h" -#endif -#include "nx_tcp.h" - -extern void test_control_return(UINT); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 - -/* Define the ThreadX, NetX, and FileX object control blocks... */ -static TX_THREAD server_thread; -static TX_THREAD client_thread; -static NX_PACKET_POOL server_pool; -static NX_IP server_ip; -static NX_PACKET_POOL client_pool; -static NX_IP client_ip; -static FX_MEDIA ram_disk; - - -/* Define the NetX FTP object control blocks. */ -static NX_FTP_CLIENT ftp_client; -static NX_FTP_SERVER ftp_server; - -/* Define the counters used in the demo application... */ -static ULONG error_counter = 0; -static ULONG dele_counter = 0; -static ULONG fail_counter = 0; -static UINT test_done = NX_FALSE; - -/* Define the memory area for the FileX RAM disk. */ -static UCHAR ram_disk_memory[32000]; -static UCHAR ram_disk_sector_cache[512]; - - -#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) -#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) - -extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, - CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, - ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, - UINT heads, UINT sectors_per_track); - -/* Define the FileX and NetX driver entry functions. */ -extern void _fx_ram_driver(FX_MEDIA *media_ptr); -extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); -static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); -static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); - -static void client_thread_entry(ULONG thread_input); -static void thread_server_entry(ULONG thread_input); - - -/* Define server login/logout functions. These are stubs for functions that would -validate a client login request. */ -static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); -static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_ftp_service_commands_dele_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Create a helper thread for the server. */ - tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Create the packet pool for the FTP Server. */ - status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 256, pointer, 8192); - pointer = pointer + 8192; - if (status) - error_counter++; - - /* Create the IP instance for the FTP Server. */ - status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable TCP. */ - status = nx_tcp_enable(&server_ip); - if (status) - error_counter++; - - /* Create the FTP server. */ - status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, - server_login, server_logout); - pointer = pointer + DEMO_STACK_SIZE; - if (status) - error_counter++; - - /* Now set up the FTP Client. */ - - /* Create the main FTP client thread. */ - status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - if (status) - error_counter++; - - /* Create a packet pool for the FTP client. */ - status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); - pointer = pointer + 8192; - if (status) - error_counter++; - - /* Create an IP instance for the FTP client. */ - status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable TCP for client IP instance. */ - status = nx_tcp_enable(&client_ip); - if (status) - error_counter++; - -} - -/* Define the FTP client thread. */ - -void client_thread_entry(ULONG thread_input) -{ -UINT status; -NX_PACKET *my_packet; - - /* Format the RAM disk - the memory for the RAM disk was defined above. */ - status = _fx_media_format(&ram_disk, - _fx_ram_driver, /* Driver entry */ - ram_disk_memory, /* RAM disk memory pointer */ - ram_disk_sector_cache, /* Media buffer pointer */ - sizeof(ram_disk_sector_cache), /* Media buffer size */ - "MY_RAM_DISK", /* Volume Name */ - 1, /* Number of FATs */ - 32, /* Directory Entries */ - 0, /* Hidden sectors */ - 256, /* Total sectors */ - 128, /* Sector size */ - 1, /* Sectors per cluster */ - 1, /* Heads */ - 1); /* Sectors per track */ - - /* Check status. */ - if (status) - error_counter++; - - /* Open the RAM disk. */ - status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); - if (status) - error_counter++; - - /* Create an FTP client. */ - status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); - if (status) - error_counter++; - - /* Now connect with the NetX FTP (IPv4) server. */ - status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Create a File. */ - status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Allocate a FTP packet. */ - status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Write ABCs into the packet payload! */ - memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); - - /* Adjust the write pointer. */ - my_packet -> nx_packet_length = 28; - my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; - - /* Write the packet to the file test.txt. */ - status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Close the file. */ - status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - status = nx_ftp_client_file_delete(&ftp_client,"test.txt",NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Create a File. */ - status = nx_ftp_client_file_open(&ftp_client, "/test1.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Close the file. */ - status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - status = nx_ftp_client_file_delete(&ftp_client,"/test1.txt",NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - - client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; - - status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); - if (status == NX_SUCCESS) - error_counter++; - - status = nx_ftp_client_file_open(&ftp_client, "/test1.txt", NX_FTP_OPEN_FOR_READ, NX_IP_PERIODIC_RATE); - if (status == NX_SUCCESS) - error_counter++; - - client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; - - /* Disconnect from the server. */ - nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); - - - /* Delete the FTP client. */ - status = nx_ftp_client_delete(&ftp_client); - if (status) - error_counter++; - - /* Set the flag. */ - test_done = NX_TRUE; -} - - -/* Define the helper FTP server thread. */ -void thread_server_entry(ULONG thread_input) -{ - -UINT status; - - /* Print out test information banner. */ - printf("NetX Test: FTP Service Command DELE Test ............................"); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* OK to start the FTPv6 Server. */ - status = nx_ftp_server_start(&ftp_server); - if (status) - error_counter++; - - server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; - - /* Wait for test. */ - while(test_done == NX_FALSE) - tx_thread_sleep(NX_IP_PERIODIC_RATE); - - status = nx_ftp_server_delete(&ftp_server); - if(status) - error_counter++; - - if((error_counter) || ( dele_counter != 2 ) || (fail_counter != 2)) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } -} - -void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ -NX_TCP_HEADER *tcp_header_ptr; -UCHAR *message; - - tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - message = packet_ptr -> nx_packet_prepend_ptr + 20; - - /* Check the packet is a SYN one. */ - if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == 'D') - { - if(!memcmp(message,"DELE test.txt",13)) - dele_counter++; - else if(!memcmp(message,"DELE /test1.txt",15)) - { - dele_counter++; - /* Deal packets with default routing. */ - server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; - } - } - - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - - /* Let server receives the SYN packet. */ - _nx_tcp_packet_receive(ip_ptr, packet_ptr); -} - -void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ -NX_TCP_HEADER *tcp_header_ptr; -UCHAR *message; - - tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - message = packet_ptr -> nx_packet_prepend_ptr + 20; - - /* Check the packet is a SYN one. */ - if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == '5') - { - if(!memcmp(message,"550 File Open Fail",18)) - fail_counter++; - } - - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - - /* Let server receives the SYN packet. */ - _nx_tcp_packet_receive(ip_ptr, packet_ptr); -} - - -static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) -{ - /* Always return success. */ - return(NX_SUCCESS); -} - -static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) -{ - /* Always return success. */ - return(NX_SUCCESS); -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_ftp_service_commands_dele_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: FTP Service Command DELE Test ............................N/A\n"); - - test_control_return(3); -} -#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c b/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c index 36e23dae..d723ea3c 100644 --- a/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c +++ b/test/regression/ftp_test/netx_ftp_service_commands_file_write_test.c @@ -202,7 +202,7 @@ UCHAR c; 1, /* Number of FATs */ 32, /* Directory Entries */ 0, /* Hidden sectors */ - 25, /* Total sectors */ // jlc restore to 24 + 25, /* Total sectors */ 128, /* Sector size */ 1, /* Sectors per cluster */ 1, /* Heads */ diff --git a/test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c b/test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c deleted file mode 100644 index e9dcc5e9..00000000 --- a/test/regression/ftp_test/netx_ftp_service_commands_m_d_dir_test.c +++ /dev/null @@ -1,424 +0,0 @@ - -#include "tx_api.h" -#include "fx_api.h" -#include "nx_api.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_ftp_client.h" -#include "nxd_ftp_server.h" -#else -#include "nx_ftp_client.h" -#include "nx_ftp_server.h" -#endif -#include "nx_tcp.h" - -extern void test_control_return(UINT); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 - -/* Define the ThreadX, NetX, and FileX object control blocks... */ -static TX_THREAD server_thread; -static TX_THREAD client_thread; -static NX_PACKET_POOL server_pool; -static NX_IP server_ip; -static NX_PACKET_POOL client_pool; -static NX_IP client_ip; -static FX_MEDIA ram_disk; - - -/* Define the NetX FTP object control blocks. */ -static NX_FTP_CLIENT ftp_client; -static NX_FTP_SERVER ftp_server; - -/* Define the counters used in the demo application... */ -static ULONG error_counter = 0; -static ULONG mkd_counter = 0; -static ULONG rmd_counter = 0; -static ULONG dir_fail_counter = 0; -static UINT test_done = NX_FALSE; - -/* Define the memory area for the FileX RAM disk. */ -static UCHAR ram_disk_memory[32000]; -static UCHAR ram_disk_sector_cache[512]; - - -#define FTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) -#define FTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) - -extern UINT _fx_media_format(FX_MEDIA *media_ptr, VOID (*driver)(FX_MEDIA *media), VOID *driver_info_ptr, UCHAR *memory_ptr, UINT memory_size, - CHAR *volume_name, UINT number_of_fats, UINT directory_entries, UINT hidden_sectors, - ULONG total_sectors, UINT bytes_per_sector, UINT sectors_per_cluster, - UINT heads, UINT sectors_per_track); - -/* Define the FileX and NetX driver entry functions. */ -extern void _fx_ram_driver(FX_MEDIA *media_ptr); -extern void _nx_ram_network_driver_512(NX_IP_DRIVER *driver_req_ptr); -static void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr); -static void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr); - -static void client_thread_entry(ULONG thread_input); -static void thread_server_entry(ULONG thread_input); - - -/* Define server login/logout functions. These are stubs for functions that would -validate a client login request. */ -static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); -static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info); - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_ftp_service_commands_m_d_dir_test_application_define(void *first_unused_memory) -#endif -{ - -UINT status; -UCHAR *pointer; - - - /* Setup the working pointer. */ - pointer = (UCHAR *) first_unused_memory; - - /* Create a helper thread for the server. */ - tx_thread_create(&server_thread, "FTP Server thread", thread_server_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize NetX. */ - nx_system_initialize(); - - /* Create the packet pool for the FTP Server. */ - status = nx_packet_pool_create(&server_pool, "NetX Server Packet Pool", 256, pointer, 8192); - pointer = pointer + 8192; - if (status) - error_counter++; - - /* Create the IP instance for the FTP Server. */ - status = nx_ip_create(&server_ip, "NetX Server IP Instance", FTP_SERVER_ADDRESS, 0xFFFFFF00UL, - &server_pool, _nx_ram_network_driver_512, pointer, 2048, 1); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable TCP. */ - status = nx_tcp_enable(&server_ip); - if (status) - error_counter++; - - /* Create the FTP server. */ - status = nx_ftp_server_create(&ftp_server, "FTP Server Instance", &server_ip, &ram_disk, pointer, DEMO_STACK_SIZE, &server_pool, - server_login, server_logout); - pointer = pointer + DEMO_STACK_SIZE; - if (status) - error_counter++; - - /* Now set up the FTP Client. */ - - /* Create the main FTP client thread. */ - status = tx_thread_create(&client_thread, "FTP Client thread ", client_thread_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE ; - if (status) - error_counter++; - - /* Create a packet pool for the FTP client. */ - status = nx_packet_pool_create(&client_pool, "NetX Client Packet Pool", 256, pointer, 8192); - pointer = pointer + 8192; - if (status) - error_counter++; - - /* Create an IP instance for the FTP client. */ - status = nx_ip_create(&client_ip, "NetX Client IP Instance", FTP_CLIENT_ADDRESS, 0xFFFFFF00UL, - &client_pool, _nx_ram_network_driver_512, pointer, 2048, 1); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the FTP Client IP. */ - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - /* Enable TCP for client IP instance. */ - status = nx_tcp_enable(&client_ip); - if (status) - error_counter++; - -} - -/* Define the FTP client thread. */ - -void client_thread_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; - - /* Format the RAM disk - the memory for the RAM disk was defined above. */ - status = _fx_media_format(&ram_disk, - _fx_ram_driver, /* Driver entry */ - ram_disk_memory, /* RAM disk memory pointer */ - ram_disk_sector_cache, /* Media buffer pointer */ - sizeof(ram_disk_sector_cache), /* Media buffer size */ - "MY_RAM_DISK", /* Volume Name */ - 1, /* Number of FATs */ - 32, /* Directory Entries */ - 0, /* Hidden sectors */ - 256, /* Total sectors */ - 128, /* Sector size */ - 1, /* Sectors per cluster */ - 1, /* Heads */ - 1); /* Sectors per track */ - - /* Check status. */ - if (status) - error_counter++; - - /* Open the RAM disk. */ - status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, ram_disk_sector_cache, sizeof(ram_disk_sector_cache)); - if (status) - error_counter++; - - /* Create an FTP client. */ - status = nx_ftp_client_create(&ftp_client, "FTP Client", &client_ip, 2000, &client_pool); - if (status) - error_counter++; - - /* Now connect with the NetX FTP (IPv4) server. */ - status = nx_ftp_client_connect(&ftp_client, FTP_SERVER_ADDRESS, "name", "password", NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - status = nx_ftp_client_directory_create(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - status = nx_ftp_client_directory_create(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - /*To ensure the making dir successfully*/ - status = nx_ftp_client_directory_default_set(&ftp_client, "/abc" ,NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - /* Open a FTP file for writing. */ - status = nx_ftp_client_file_open(&ftp_client, "test.txt", NX_FTP_OPEN_FOR_WRITE, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Allocate a FTP packet. */ - status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Write ABCs into the packet payload! */ - memcpy(my_packet -> nx_packet_prepend_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28); - - /* Adjust the write pointer. */ - my_packet -> nx_packet_length = 28; - my_packet -> nx_packet_append_ptr = my_packet -> nx_packet_prepend_ptr + 28; - - /* Write the packet to the file test.txt. */ - status = nx_ftp_client_file_write(&ftp_client, my_packet, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - /* Close the file. */ - status = nx_ftp_client_file_close(&ftp_client, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - status = nx_ftp_client_directory_default_set(&ftp_client, "/def" ,NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - client_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_client; - status = nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); - if (status != NX_FTP_EXPECTED_2XX_CODE) - error_counter++; - - status = nx_ftp_client_directory_default_set(&ftp_client, "/" ,NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - status = nx_ftp_client_directory_delete(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - /*Check the response when deleting a dir deleted.*/ - status = nx_ftp_client_file_delete(&ftp_client, "/abc/test.txt",NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - status = nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); - if (status) - error_counter++; - - - /*Check if the two dir have been successfully deleted. */ - status = nx_ftp_client_directory_default_set(&ftp_client, "/abc" ,NX_IP_PERIODIC_RATE/2); - if (status == NX_SUCCESS) - error_counter++; - - status = nx_ftp_client_directory_default_set(&ftp_client, "/def" ,NX_IP_PERIODIC_RATE/2); - if (status == NX_SUCCESS) - error_counter++; - - status = nx_ftp_client_directory_delete(&ftp_client,"/abc",NX_IP_PERIODIC_RATE/2); - if (status != NX_FTP_EXPECTED_2XX_CODE) - error_counter++; - - status = nx_ftp_client_directory_delete(&ftp_client,"def",NX_IP_PERIODIC_RATE/2); - if (status != NX_FTP_EXPECTED_2XX_CODE) - error_counter++; - - client_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; - - /* Disconnect from the server. */ - status = nx_ftp_client_disconnect(&ftp_client, NX_IP_PERIODIC_RATE); - if (status) - error_counter++; - - - /* Delete the FTP client. */ - status = nx_ftp_client_delete(&ftp_client); - if (status) - error_counter++; - - /* Set the flag. */ - test_done = NX_TRUE; -} - - -/* Define the helper FTP server thread. */ -void thread_server_entry(ULONG thread_input) -{ - -UINT status; - - /* Print out test information banner. */ - printf("NetX Test: FTP Server Service Commands make dele dir Test............"); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* OK to start the FTPv6 Server. */ - status = nx_ftp_server_start(&ftp_server); - if (status) - error_counter++; - - server_ip.nx_ip_tcp_packet_receive = my_ftp_packet_receive_server; - - /* Wait for test. */ - while(test_done == NX_FALSE) - tx_thread_sleep(NX_IP_PERIODIC_RATE); - - status = nx_ftp_server_delete(&ftp_server); - if(status) - error_counter++; - - if((error_counter) || ( rmd_counter != 2 ) || (mkd_counter != 2) || (dir_fail_counter != 5)) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } -} - -void my_ftp_packet_receive_server(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ - NX_TCP_HEADER *tcp_header_ptr; - UCHAR *message; - - tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - message = packet_ptr -> nx_packet_prepend_ptr + 20; - - - if(!memcmp(message,"MKD /abc ",8) || !memcmp(message,"MKD def ",7)) - mkd_counter++; - else if(!memcmp(message,"RMD /abc ",8)) - rmd_counter++; - else if (!memcmp(message,"RMD def ",7)) - { - rmd_counter++; - server_ip.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; - } - - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - /* Let server receives the SYN packet. */ - _nx_tcp_packet_receive(ip_ptr, packet_ptr); -} - - -void my_ftp_packet_receive_client(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ -NX_TCP_HEADER *tcp_header_ptr; -UCHAR *message; - - tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - message = packet_ptr -> nx_packet_prepend_ptr + 20; - - if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) && *(message) == '5') - { - - if(!memcmp(message,"550 Delete Directory Fail",25) || !memcmp(message,"550 Change Dir Fail",19)) - dir_fail_counter++; - } - - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - /* Let server receives the SYN packet. */ - _nx_tcp_packet_receive(ip_ptr, packet_ptr); -} - -static UINT server_login(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) -{ - /* Always return success. */ - return(NX_SUCCESS); -} - -static UINT server_logout(struct NX_FTP_SERVER_STRUCT *ftp_server_ptr, ULONG client_ip_address, UINT client_port, CHAR *name, CHAR *password, CHAR *extra_info) -{ - /* Always return success. */ - return(NX_SUCCESS); -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_ftp_service_commands_m_d_dir_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: FTP Server Service Commands make dele dir Test............N/A\n"); - - test_control_return(3); -} -#endif \ No newline at end of file diff --git a/test/regression/ftp_test/netx_ftp_two_listen_test.c b/test/regression/ftp_test/netx_ftp_two_listen_test.c index 15461c72..d6b8d598 100644 --- a/test/regression/ftp_test/netx_ftp_two_listen_test.c +++ b/test/regression/ftp_test/netx_ftp_two_listen_test.c @@ -1,6 +1,4 @@ -/* This case tests the FTP server on handling two session listen situation. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-238 - */ +/* This case tests the FTP server on handling two session listen situation. */ #include "tx_api.h" #include "fx_api.h" #include "nx_api.h" diff --git a/test/regression/http_test/netx_http_status_400_test.c b/test/regression/http_test/netx_http_status_400_test.c deleted file mode 100644 index 56e7d352..00000000 --- a/test/regression/http_test/netx_http_status_400_test.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - 1. If Request-URIis an absoluteURI, the host is part of the Request-URI. Any Host header - field value in the request MUST be ignored. - 2. If the Request-URIis not an absoluteURI, and the request includes a Hostheader field, - the host is determined by the Hostheader field value. - 3. If the host as determined by rule 1 or 2 is not a valid host on the server, the response - MUST be a 400 (Bad Request) error message. - - Change Host field value from 192.168.0.123 to 192.168.0.120 .*/ - -#include "tx_api.h" -#include "nx_api.h" -#include "fx_api.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_http_client.h" -#include "nxd_http_server.h" -#else -#include "nx_http_client.h" -#include "nx_http_server.h" -#endif - -extern void test_control_return(UINT); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 - -/* Set up FileX and file memory resources. */ -static CHAR *ram_disk_memory; -static FX_MEDIA ram_disk; -static unsigned char media_memory[512]; - -/* Define device drivers. */ -extern void _fx_ram_driver(FX_MEDIA *media_ptr); -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); - - -/* This is a HTTP get packet captured by wireshark. - * curl 192.168.0.123 - * 123: pkt[120] = 0x31, pkt[121] = 0x32, pkt[122] = 0x33 - * 122: pkt[120] = 0x31, pkt[121] = 0x32, pkt[122] = 0x32 - * */ -static char pkt[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ -0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ -0x00, 0x7e, 0x0b, 0xd2, 0x40, 0x00, 0x80, 0x06, /* .~..@... */ -0x6c, 0x73, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* ls...i.. */ -0x00, 0x7b, 0xca, 0x95, 0x00, 0x50, 0x66, 0x2b, /* .{...Pf+ */ -0xe7, 0x60, 0xb6, 0xa2, 0xe6, 0xf3, 0x50, 0x18, /* .`....P. */ -0xfa, 0xf0, 0x59, 0x33, 0x00, 0x00, 0x47, 0x45, /* ..Y3..GE */ -0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, /* T /index */ -0x2e, 0x68, 0x74, 0x6d, 0x20, 0x48, 0x54, 0x54, /* .htm HTT */ -0x50, 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, /* P/1.1..U */ -0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, /* ser-Agen */ -0x74, 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, /* t: curl/ */ -0x37, 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, /* 7.32.0.. */ -0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, /* Host: 19 */ -0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, /* 2.168.0. */ -0x31, 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, /* 123..Acc */ -0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, /* ept: */ -0x0d, 0x0a, 0x0d, 0x0a /* .... */ - -}; - -/* Set up the HTTP client global variables. */ - -#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) - -static TX_THREAD client_thread; -static NX_PACKET_POOL client_pool; -static NX_HTTP_CLIENT my_client; -static NX_IP client_ip; - -static UINT error_counter; -static NX_TCP_SOCKET client_socket; - -/* Set up the HTTP server global variables */ - -#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) - -static NX_HTTP_SERVER my_server; -static NX_PACKET_POOL server_pool; -static TX_THREAD server_thread; -static NX_IP server_ip; -#ifdef __PRODUCT_NETXDUO__ -static NXD_ADDRESS server_ip_address; -static NXD_ADDRESS client_ip_address; -#else -static ULONG server_ip_address; -static ULONG client_ip_address; -#endif - - -static void thread_client_entry(ULONG thread_input); -static void thread_server_entry(ULONG thread_input); - -#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) -#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) - - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_http_status_400_test_application_define(void *first_unused_memory) -#endif -{ - -CHAR *pointer; -UINT status; - - error_counter = 0; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - /* Create a helper thread for the server. */ - tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, - pointer, SERVER_PACKET_SIZE*8); - pointer = pointer + SERVER_PACKET_SIZE * 8; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, - 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, - pointer, 4096, 1); - pointer = pointer + 4096; - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - - /* Enable TCP traffic. */ - status = nx_tcp_enable(&server_ip); - if (status) - error_counter++; - - /* Set up the server's IPv4 address here. */ -#ifdef __PRODUCT_NETXDUO__ - server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; - server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; - client_ip_address.nxd_ip_address.v4 = HTTP_CLIENT_ADDRESS; - client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; -#else - server_ip_address = HTTP_SERVER_ADDRESS; - client_ip_address = HTTP_CLIENT_ADDRESS; -#endif - - /* Create the HTTP Server. */ - status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, - pointer, 2048, &server_pool, NX_NULL, NX_NULL); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Save the memory pointer for the RAM disk. */ - ram_disk_memory = pointer; - - /* Create the HTTP Client thread. */ - status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - if (status) - error_counter++; - - /* Create the Client packet pool. */ - status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, - pointer, CLIENT_PACKET_SIZE*8); - pointer = pointer + CLIENT_PACKET_SIZE * 8; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, - 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, - pointer, 2048, 1); - pointer = pointer + 2048; - if (status) - error_counter++; - - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Enable TCP traffic. */ - status = nx_tcp_enable(&client_ip); - if (status) - error_counter++; -} - - -void thread_client_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -CHAR *buffer_ptr; -NX_PACKET *recv_packet; -NX_PACKET *send_packet; - - /* Format the RAM disk - the memory for the RAM disk was setup in - tx_application_define above. This must be set up before the client(s) start - sending requests. */ - status = fx_media_format(&ram_disk, - _fx_ram_driver, /* Driver entry */ - ram_disk_memory, /* RAM disk memory pointer */ - media_memory, /* Media buffer pointer */ - sizeof(media_memory), /* Media buffer size */ - "MY_RAM_DISK", /* Volume Name */ - 1, /* Number of FATs */ - 32, /* Directory Entries */ - 0, /* Hidden sectors */ - 256, /* Total sectors */ - 128, /* Sector size */ - 1, /* Sectors per cluster */ - 1, /* Heads */ - 1); /* Sectors per track */ - - /* Check the media format status. */ - if (status != FX_SUCCESS) - error_counter++; - - /* Open the RAM disk. */ - status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory)); - - /* Check the media open status. */ - if (status != FX_SUCCESS) - error_counter++; - - /* Create an HTTP client instance. */ - status = nx_http_client_create(&my_client, "HTTP Client", &client_ip, &client_pool, 600); - - /* Check status. */ - if (status) - error_counter++; - -#ifdef __PRODUCT_NETXDUO__ - - /* Now upload an HTML file to the HTTP IP server using the 'duo' service (supports IPv4 and IPv6). */ - status = nxd_http_client_put_start(&my_client, &server_ip_address, "/index.htm", - "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); -#else - - /* Now upload an HTML file to the HTTP IP server using the 'NetX' service (supports only IPv4). */ - status = nx_http_client_put_start(&my_client, HTTP_SERVER_ADDRESS, "/index.htm", - "name", "password", 103, 5 * NX_IP_PERIODIC_RATE); -#endif - - /* Check status. */ - if (status) - error_counter++; - - /* Allocate a packet. */ - status = nx_packet_allocate(&client_pool, &send_packet, NX_TCP_PACKET, NX_WAIT_FOREVER); - - /* Check status. */ - if(status) - error_counter++; - - /* Build a simple 103-byte HTML page. */ - nx_packet_data_append(send_packet, "\r\n", 8, - &client_pool, NX_WAIT_FOREVER); - nx_packet_data_append(send_packet, - "NetX HTTP Test\r\n", 44, - &client_pool, NX_WAIT_FOREVER); - nx_packet_data_append(send_packet, "\r\n", 8, - &client_pool, NX_WAIT_FOREVER); - nx_packet_data_append(send_packet, "

Another NetX Test Page!

\r\n", 25, - &client_pool, NX_WAIT_FOREVER); - nx_packet_data_append(send_packet, "\r\n", 9, - &client_pool, NX_WAIT_FOREVER); - nx_packet_data_append(send_packet, "\r\n", 9, - &client_pool, NX_WAIT_FOREVER); - - /* Complete the PUT by writing the total length. */ - status = nx_http_client_put_packet(&my_client, send_packet, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Create a socket. */ - status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, - NX_NULL, NX_NULL); - if(status) - error_counter++; - - /* Bind the socket. */ - status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Call connect to send an SYN. */ - status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Allocate a packet. */ - status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Change '3' to '2' .*/ - pkt[122] = '2'; - - /* Write Aet packet into the packet payload. */ - status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Send the packet out. */ - status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Receive the response from http server. */ - status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - else - { - - buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; - - /* Check the status, If success , it should be 200. */ - if((buffer_ptr[9] != '4') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '0')) - error_counter++; - - nx_packet_release(recv_packet); - } - - tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); - - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } - -} - - -/* Define the helper HTTP server thread. */ -void thread_server_entry(ULONG thread_input) -{ - -UINT status; - - /* Print out test information banner. */ - printf("NetX Test: HTTP Status 400 Test......................................"); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* OK to start the HTTP Server. */ - status = nx_http_server_start(&my_server); - if(status) - error_counter++; - - tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); - - status = nx_http_server_delete(&my_server); - if(status) - error_counter++; - -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_http_status_400_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: HTTP Status 400 Test......................................N/A\n"); - - test_control_return(3); -} -#endif diff --git a/test/regression/http_test/netx_http_status_501_test.c b/test/regression/http_test/netx_http_status_501_test.c deleted file mode 100644 index c62a5d70..00000000 --- a/test/regression/http_test/netx_http_status_501_test.c +++ /dev/null @@ -1,315 +0,0 @@ -/* If the method is unrecognized or not implemented by the origin server, - * should repond 501. - * change GET to AET to build a unrecognized method packet. */ -#include "tx_api.h" -#include "nx_api.h" -#include "fx_api.h" -#ifdef __PRODUCT_NETXDUO__ -#include "nxd_http_client.h" -#include "nxd_http_server.h" -#else -#include "nx_http_client.h" -#include "nx_http_server.h" -#endif - -extern void test_control_return(UINT); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 4096 - -/* Set up FileX and file memory resources. */ -static CHAR *ram_disk_memory; -static FX_MEDIA ram_disk; - -/* Define device drivers. */ -extern void _fx_ram_driver(FX_MEDIA *media_ptr); -extern void _nx_ram_network_driver_1024(NX_IP_DRIVER *driver_req_ptr); - - -/* This is a HTTP get packet captured by wireshark. - * curl 192.168.0.123 - * GET: pkt[54] = 0x47, pkt[55] = 0x45, pkt[56] = 0x54 - * AET: pkt[54] = 'A' , pkt[55] = 0x45, pkt[56] = 0x54 - * */ -static char pkt[] = { - 0x00, 0x11, 0x22, 0x33, 0x44, 0x57, 0xb8, 0xca, /* .."3DW.. */ - 0x3a, 0x95, 0xdb, 0x0b, 0x08, 0x00, 0x45, 0x00, /* :.....E. */ - 0x00, 0x75, 0x47, 0x4a, 0x40, 0x00, 0x80, 0x06, /* .uGJ@... */ - 0x31, 0x04, 0xc0, 0xa8, 0x00, 0x69, 0xc0, 0xa8, /* 1....i.. */ - 0x00, 0x7b, 0xe8, 0xeb, 0x00, 0x50, 0xe5, 0x59, /* .{...P.Y */ - 0x56, 0x32, 0x41, 0xf1, 0x07, 0xf0, 0x50, 0x18, /* V2A...P. */ - 0xfa, 0xf0, 0x65, 0x69, 0x00, 0x00, 0x47, 0x45, /* ..ei..GE */ - 0x54, 0x20, 0x2f, 0x20, 0x48, 0x54, 0x54, 0x50, /* T / HTTP */ - 0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x55, 0x73, /* /1.1..Us */ - 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, /* er-Agent */ - 0x3a, 0x20, 0x63, 0x75, 0x72, 0x6c, 0x2f, 0x37, /* : curl/7 */ - 0x2e, 0x33, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x48, /* .32.0..H */ - 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32, /* ost: 192 */ - 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31, /* .168.0.1 */ - 0x32, 0x33, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, /* 23..Acce */ - 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, /* pt: */ - 0x0a, 0x0d, 0x0a /* ... */ -}; - -/* Set up the HTTP client global variables. */ - -#define CLIENT_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) - -static TX_THREAD client_thread; -static NX_PACKET_POOL client_pool; -static NX_IP client_ip; - -static UINT error_counter; -static NX_TCP_SOCKET client_socket; - -/* Set up the HTTP server global variables */ - -#define SERVER_PACKET_SIZE (NX_HTTP_SERVER_MIN_PACKET_SIZE * 2) - -static NX_HTTP_SERVER my_server; -static NX_PACKET_POOL server_pool; -static TX_THREAD server_thread; -static NX_IP server_ip; -#ifdef __PRODUCT_NETXDUO__ -static NXD_ADDRESS server_ip_address; -static NXD_ADDRESS client_ip_address; -#else -static ULONG server_ip_address; -static ULONG client_ip_address; -#endif - - -static void thread_client_entry(ULONG thread_input); -static void thread_server_entry(ULONG thread_input); - -#define HTTP_SERVER_ADDRESS IP_ADDRESS(1,2,3,4) -#define HTTP_CLIENT_ADDRESS IP_ADDRESS(1,2,3,5) - - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_http_status_501_test_application_define(void *first_unused_memory) -#endif -{ - -CHAR *pointer; -UINT status; - - error_counter = 0; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - /* Create a helper thread for the server. */ - tx_thread_create(&server_thread, "HTTP Server thread", thread_server_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create the server packet pool. */ - status = nx_packet_pool_create(&server_pool, "HTTP Server Packet Pool", SERVER_PACKET_SIZE, - pointer, SERVER_PACKET_SIZE*8); - pointer = pointer + SERVER_PACKET_SIZE * 8; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&server_ip, "HTTP Server IP", HTTP_SERVER_ADDRESS, - 0xFFFFFF00UL, &server_pool, _nx_ram_network_driver_1024, - pointer, 4096, 1); - pointer = pointer + 4096; - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for the server IP instance. */ - status = nx_arp_enable(&server_ip, (void *) pointer, 1024); - pointer = pointer + 1024; - if (status) - error_counter++; - - - /* Enable TCP traffic. */ - status = nx_tcp_enable(&server_ip); - if (status) - error_counter++; - - /* Set up the server's IPv4 address here. */ -#ifdef __PRODUCT_NETXDUO__ - server_ip_address.nxd_ip_address.v4 = HTTP_SERVER_ADDRESS; - server_ip_address.nxd_ip_version = NX_IP_VERSION_V4; - client_ip_address.nxd_ip_address.v4 = HTTP_CLIENT_ADDRESS; - client_ip_address.nxd_ip_version = NX_IP_VERSION_V4; -#else - server_ip_address = HTTP_SERVER_ADDRESS; - client_ip_address = HTTP_CLIENT_ADDRESS; -#endif - - /* Create the HTTP Server. */ - status = nx_http_server_create(&my_server, "My HTTP Server", &server_ip, &ram_disk, - pointer, 2048, &server_pool, NX_NULL, NX_NULL); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Save the memory pointer for the RAM disk. */ - ram_disk_memory = pointer; - - /* Create the HTTP Client thread. */ - status = tx_thread_create(&client_thread, "HTTP Client", thread_client_entry, 0, - pointer, DEMO_STACK_SIZE, - 6, 6, TX_NO_TIME_SLICE, TX_AUTO_START); - pointer = pointer + DEMO_STACK_SIZE; - if (status) - error_counter++; - - /* Create the Client packet pool. */ - status = nx_packet_pool_create(&client_pool, "HTTP Client Packet Pool", CLIENT_PACKET_SIZE, - pointer, CLIENT_PACKET_SIZE*8); - pointer = pointer + CLIENT_PACKET_SIZE * 8; - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&client_ip, "HTTP Client IP", HTTP_CLIENT_ADDRESS, - 0xFFFFFF00UL, &client_pool, _nx_ram_network_driver_1024, - pointer, 2048, 1); - pointer = pointer + 2048; - if (status) - error_counter++; - - status = nx_arp_enable(&client_ip, (void *) pointer, 1024); - pointer = pointer + 2048; - if (status) - error_counter++; - - /* Enable TCP traffic. */ - status = nx_tcp_enable(&client_ip); - if (status) - error_counter++; -} - - -void thread_client_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; -CHAR *buffer_ptr; -NX_PACKET *recv_packet; - - /* Create a socket. */ - status = nx_tcp_socket_create(&client_ip, &client_socket, "Client Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 1024, - NX_NULL, NX_NULL); - if(status) - error_counter++; - - /* Bind the socket. */ - status = nx_tcp_client_socket_bind(&client_socket, 50295, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Call connect to send an SYN. */ - status = nx_tcp_client_socket_connect(&client_socket, HTTP_SERVER_ADDRESS, 80, 2 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Allocate a packet. */ - status = nx_packet_allocate(&client_pool, &my_packet, NX_TCP_PACKET, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Change 'G' to 'A' .*/ - pkt[54] = 'A'; - - /* Write Aet packet into the packet payload. */ - status = nx_packet_data_append(my_packet, &pkt[54] , (sizeof(pkt)-54), &client_pool, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Send the packet out. */ - status = nx_tcp_socket_send(&client_socket, my_packet, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Receive the response from http server. */ - status = nx_tcp_socket_receive(&client_socket, &recv_packet, 1 * NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - else - { - - buffer_ptr = (CHAR *)recv_packet ->nx_packet_prepend_ptr; - - /* Check the status, If success , it should be 200. */ - if((buffer_ptr[9] != '5') || (buffer_ptr[10] != '0') || (buffer_ptr[11] != '1')) - error_counter++; - - nx_packet_release(recv_packet); - } - - tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); - - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } - -} - - -/* Define the helper HTTP server thread. */ -void thread_server_entry(ULONG thread_input) -{ - -UINT status; - - /* Print out test information banner. */ - printf("NetX Test: HTTP Status 501 Test......................................"); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* OK to start the HTTP Server. */ - status = nx_http_server_start(&my_server); - if(status) - error_counter++; - - tx_thread_sleep(1 * NX_IP_PERIODIC_RATE); - - status = nx_http_server_delete(&my_server); - if(status) - error_counter++; - -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_http_status_501_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: HTTP Status 501 Test......................................N/A\n"); - - test_control_return(3); -} -#endif diff --git a/test/regression/mdns_test/capture/_http._tcp.c b/test/regression/mdns_test/capture/_http._tcp.c deleted file mode 100644 index 445c4975..00000000 --- a/test/regression/mdns_test/capture/_http._tcp.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (153 bytes) */ -static const unsigned char pkt2[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x8b, 0x76, 0xbf, 0x00, 0x00, 0xff, 0x11, /* ..v..... */ -0xa2, 0xfa, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ -0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ -0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ -0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00 /* . */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt3[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - diff --git a/test/regression/mdns_test/capture/_http._tcp.pcapng b/test/regression/mdns_test/capture/_http._tcp.pcapng deleted file mode 100644 index 0e0611c4..00000000 Binary files a/test/regression/mdns_test/capture/_http._tcp.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/_pdl-datastream._tcp.c b/test/regression/mdns_test/capture/_pdl-datastream._tcp.c deleted file mode 100644 index c4b60be4..00000000 --- a/test/regression/mdns_test/capture/_pdl-datastream._tcp.c +++ /dev/null @@ -1,131 +0,0 @@ -/* Frame (86 bytes) */ -static const unsigned char pkt1[86] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x48, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .H..@... */ -0xd9, 0xb7, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x34, /* .......4 */ -0x03, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .,...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* l..... */ -}; - -/* Frame (496 bytes) */ -static const unsigned char pkt2[496] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x01, 0xe2, 0x77, 0x3a, 0x00, 0x00, 0xff, 0x11, /* ..w:.... */ -0xa1, 0x28, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .(...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xce, /* ........ */ -0xee, 0x32, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .2...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ -0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ -0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, /* w...rout */ -0x65, 0x72, 0xc0, 0x21, 0x00, 0x01, 0x80, 0x01, /* er.!.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x04, 0xc0, 0x32, 0x00, 0x21, 0x80, 0x01, /* ...2.!.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, /* ...x.... */ -0x00, 0x00, 0x23, 0x8c, 0xc0, 0x41, 0xc0, 0x32, /* ..#..A.2 */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x01, 0x4e, 0x09, 0x74, 0x78, 0x74, 0x76, 0x65, /* .N.txtve */ -0x72, 0x73, 0x3d, 0x31, 0x05, 0x6e, 0x6f, 0x74, /* rs=1.not */ -0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, 0x61, /* e=.qtota */ -0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, 0x6f, /* l=1.prio */ -0x72, 0x69, 0x74, 0x79, 0x3d, 0x31, 0x30, 0x11, /* rity=10. */ -0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ty=Canon */ -0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, 0x64, /* MF4570d */ -0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, /* w.produc */ -0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* t=(Canon */ -0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* MF4500w */ -0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, 0x70, /* ).pdl=ap */ -0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, /* plicatio */ -0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, /* n/octet- */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, 0x61, /* stream*a */ -0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, 0x3d, /* dminurl= */ -0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x72, /* http://r */ -0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, 0x6f, /* outer.lo */ -0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, 0x77, /* cal./t_w */ -0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x67, /* elcom.cg */ -0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x46, /* i.usb_MF */ -0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x27, /* G=Canon' */ -0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, 0x3d, /* usb_MDL= */ -0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, 0x46, /* Canon MF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, 0x65, /* 4500w Se */ -0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, 0x46, /* ries (UF */ -0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, 0x0d, /* RII LT). */ -0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, /* transpar */ -0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, 0x69, /* ent=F.Bi */ -0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, 0x54, /* nary=F.T */ -0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, 0x6f, /* BCP=F.Co */ -0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, 0x6f, /* lor=F.Co */ -0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, 0x44, /* pies=T.D */ -0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, 0x0d, /* uplex=T. */ -0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, 0x73, /* PaperCus */ -0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, 0x69, /* tom=T.Bi */ -0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, 0x6c, /* nd=F.Col */ -0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, 0x53, /* late=T.S */ -0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, 0x74, /* ort=T.St */ -0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, 0x50, /* aple=F.P */ -0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, 0x50, /* unch=F.P */ -0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, 0x3d, /* aperMax= */ -0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, 0x34 /* legal-A4 */ -}; - -/* Frame (165 bytes) */ -static const unsigned char pkt3[165] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x97, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .g...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x83, /* ........ */ -0x26, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &3...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* l......_ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x93, 0x00, 0x29, 0x0c, 0x43, 0x61, 0x6e, /* ...).Can */ -0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ -0x77, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, /* w._pdl-d */ -0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, /* atastrea */ -0x6d, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* m._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ -}; - -/* Frame (165 bytes) */ -static const unsigned char pkt4[165] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x97, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x66, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .f...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x83, /* ........ */ -0x26, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &5...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* l......_ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x91, 0x00, 0x29, 0x0c, 0x43, 0x61, 0x6e, /* ...).Can */ -0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ -0x77, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, /* w._pdl-d */ -0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, /* atastrea */ -0x6d, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* m._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ -}; - diff --git a/test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng b/test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng deleted file mode 100644 index a6f33f69..00000000 Binary files a/test/regression/mdns_test/capture/_pdl-datastream._tcp.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/_printer._tcp.c b/test/regression/mdns_test/capture/_printer._tcp.c deleted file mode 100644 index c4fa12a6..00000000 --- a/test/regression/mdns_test/capture/_printer._tcp.c +++ /dev/null @@ -1,125 +0,0 @@ -/* Frame (79 bytes) */ -static const unsigned char pkt1[79] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x41, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .A..@... */ -0xd9, 0xbe, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ -0xc5, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ -}; - -/* Frame (497 bytes) */ -static const unsigned char pkt2[497] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x01, 0xe3, 0x77, 0x9c, 0x00, 0x00, 0xff, 0x11, /* ..w..... */ -0xa0, 0xc5, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xcf, /* ........ */ -0x46, 0x4d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FM...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ -0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ -0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, /* 0w...rou */ -0x74, 0x65, 0x72, 0xc0, 0x1a, 0x00, 0x01, 0x80, /* ter..... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ -0xa8, 0x00, 0x04, 0xc0, 0x2b, 0x00, 0x21, 0x80, /* ....+.!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x02, 0x03, 0xc0, 0x3a, 0xc0, /* ......:. */ -0x2b, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* +....... */ -0x94, 0x01, 0x56, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..V.txtv */ -0x65, 0x72, 0x73, 0x3d, 0x31, 0x07, 0x72, 0x70, /* ers=1.rp */ -0x3d, 0x61, 0x75, 0x74, 0x6f, 0x05, 0x6e, 0x6f, /* =auto.no */ -0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ -0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ -0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x32, 0x30, /* ority=20 */ -0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ -0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ -0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ -0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ -0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ -0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ -0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ -0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ -0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ -0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ -0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ -0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ -0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ -0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ -0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ -0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ -0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ -0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ -0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ -0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ -0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ -0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ -0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ -0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ -0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ -0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ -0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ -0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ -0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ -0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ -0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ -0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ -0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ -0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ -0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ -0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ -0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ -0x34 /* 4 */ -}; - -/* Frame (144 bytes) */ -static const unsigned char pkt3[144] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x82, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x7c, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .|...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6e, /* .......n */ -0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .<...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, /* al...... */ -0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, /* _printer */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x93, 0x00, 0x22, 0x0c, 0x43, /* .....".C */ -0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ -0x30, 0x30, 0x77, 0x08, 0x5f, 0x70, 0x72, 0x69, /* 00w._pri */ -0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, /* nter._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - -/* Frame (144 bytes) */ -static const unsigned char pkt4[144] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x82, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x7b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .{...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6e, /* .......n */ -0x18, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .>...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x08, /* al...... */ -0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, /* _printer */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x91, 0x00, 0x22, 0x0c, 0x43, /* .....".C */ -0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ -0x30, 0x30, 0x77, 0x08, 0x5f, 0x70, 0x72, 0x69, /* 00w._pri */ -0x6e, 0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, /* nter._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - diff --git a/test/regression/mdns_test/capture/_printer._tcp.pcapng b/test/regression/mdns_test/capture/_printer._tcp.pcapng deleted file mode 100644 index 0515f836..00000000 Binary files a/test/regression/mdns_test/capture/_printer._tcp.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/_smb._tcp.c b/test/regression/mdns_test/capture/_smb._tcp.c deleted file mode 100644 index cfe4fe11..00000000 --- a/test/regression/mdns_test/capture/_smb._tcp.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Frame (75 bytes) */ -static const unsigned char pkt1[75] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ -0xd9, 0xc2, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ -0xb3, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (332 bytes) */ -static const unsigned char pkt2[332] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ -0x01, 0x3e, 0x09, 0x17, 0x00, 0x00, 0xff, 0x11, /* .>...... */ -0x0f, 0x8f, 0xc0, 0xa8, 0x00, 0x65, 0xe0, 0x00, /* .....e.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */ -0x56, 0xdc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* V....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ -0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */ -0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */ -0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */ -0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */ -0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */ -0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */ -0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ -0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */ -0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */ -0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */ -0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */ -0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */ -0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ -0xa8, 0x00, 0x65, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..e.v... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x.. */ -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */ -0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */ -0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */ -0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */ -0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */ -0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */ -0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */ -0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */ -0x40, 0x00, 0x00, 0x08 /* @... */ -}; - -/* Frame (129 bytes) */ -static const unsigned char pkt3[129] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x73, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ -0xd9, 0x8b, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ -0x9d, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x93, 0x00, 0x1b, 0x09, 0x43, /* .......C */ -0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00 /* . */ -}; - -/* Frame (129 bytes) */ -static const unsigned char pkt4[129] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x73, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ -0xd9, 0x8a, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ -0x9d, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x04, 0x5f, 0x73, 0x6d, 0x62, /* ...._smb */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x91, 0x00, 0x1b, 0x09, 0x43, /* .......C */ -0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00 /* . */ -}; - diff --git a/test/regression/mdns_test/capture/_smb._tcp.pcapng b/test/regression/mdns_test/capture/_smb._tcp.pcapng deleted file mode 100644 index 33092eb7..00000000 Binary files a/test/regression/mdns_test/capture/_smb._tcp.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/address_change.c b/test/regression/mdns_test/capture/address_change.c deleted file mode 100644 index bcc439ac..00000000 --- a/test/regression/mdns_test/capture/address_change.c +++ /dev/null @@ -1,346 +0,0 @@ -/* Frame (269 bytes) */ -static const unsigned char pkt1[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt2[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt3[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt4[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt5[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt6[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (171 bytes) */ -static const unsigned char pkt7[171] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x9d, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x0a, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .....C.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ -0xee, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* ......B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, /* .x.....C */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, /* ..x...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x40 /* ..@ */ -}; - -/* Frame (138 bytes) */ -static const unsigned char pkt8[138] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x7c, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ -0x90, 0x2a, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .*...C.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ -0xb8, 0x73, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .s...... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, 0x0b, /* x.....C. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40 /* .@ */ -}; - -/* Frame (138 bytes) */ -static const unsigned char pkt9[138] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x7c, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ -0x90, 0x29, 0x0a, 0x00, 0x00, 0x43, 0xe0, 0x00, /* .)...C.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ -0xb8, 0x73, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .s...... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x43, 0x0b, /* x.....C. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40 /* .@ */ -}; - diff --git a/test/regression/mdns_test/capture/address_change.pcapng b/test/regression/mdns_test/capture/address_change.pcapng deleted file mode 100644 index 3f91b89f..00000000 Binary files a/test/regression/mdns_test/capture/address_change.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/announcement_in_multiple_packets.c b/test/regression/mdns_test/capture/announcement_in_multiple_packets.c deleted file mode 100644 index 2f5f64f3..00000000 --- a/test/regression/mdns_test/capture/announcement_in_multiple_packets.c +++ /dev/null @@ -1,1935 +0,0 @@ -/* Frame (1425 bytes) */ -static const unsigned char pkt1[1425] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0x83, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8b, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ -0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ -0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ -0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00 /* . */ -}; - -/* Frame (420 bytes) */ -static const unsigned char pkt2[420] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x96, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x17, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ -0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00 /* d... */ -}; - -/* Frame (1425 bytes) */ -static const unsigned char pkt3[1425] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0x83, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8b, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ -0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ -0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ -0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00 /* . */ -}; - -/* Frame (420 bytes) */ -static const unsigned char pkt4[420] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x96, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x15, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ -0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00 /* d... */ -}; - -/* Frame (1425 bytes) */ -static const unsigned char pkt5[1425] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0x83, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8b, 0x27, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .'...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x6f, /* .......o */ -0x19, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, /* ........ */ -0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, /* l......t */ -0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, /* al...... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x05, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x06, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x42, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* B.test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* ..test3. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st4._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 5._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, /* ..test7. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 7._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 9._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, /* st10._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 11._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00 /* . */ -}; - -/* Frame (420 bytes) */ -static const unsigned char pkt6[420] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x96, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x13, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x82, /* ........ */ -0x5b, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* [X...... */ -0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x06, 0x74, /* l......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, /* st12._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00 /* d... */ -}; - -/* Frame (1510 bytes) */ -static const unsigned char pkt7[1510] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xd8, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xd0, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ -0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ -0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ -0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ -0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ -}; - -/* Frame (1512 bytes) */ -static const unsigned char pkt8[1512] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xda, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ -0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - -/* Frame (119 bytes) */ -static const unsigned char pkt9[119] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x69, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ -0x90, 0x3d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .=...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ -0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ -}; - -/* Frame (1510 bytes) */ -static const unsigned char pkt10[1510] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xd8, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ -0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ -0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ -0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ -0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ -}; - -/* Frame (1512 bytes) */ -static const unsigned char pkt11[1512] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xda, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xca, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ -0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - -/* Frame (119 bytes) */ -static const unsigned char pkt12[119] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x69, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ -0x90, 0x3a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .:...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ -0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ -}; - -/* Frame (1510 bytes) */ -static const unsigned char pkt13[1510] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xd8, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xca, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc4, /* ........ */ -0xa2, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t1._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, /* test2._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, /* ..test2. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st2._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ -0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t3._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, /* l..test3 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* @.test4. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, /* .....d.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ -0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* ..._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ -0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t5._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st5._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st6._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, /* ...test6 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, /* .test7._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* l..test7 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* local. */ -}; - -/* Frame (1512 bytes) */ -static const unsigned char pkt14[1512] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xda, 0x00, 0x0e, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xc6, /* ........ */ -0xb1, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 8._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t8._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* .@.test9 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, /* ..d...._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, /* test10._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, 0x04, /* .test10. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 0._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, /* @.test11 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x04, /* ...d.... */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t11._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 12._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, 0x06, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, /* est12._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x06, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, /* st13._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* ...._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* l..test1 */ -0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 4._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, /* .d...._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - -/* Frame (119 bytes) */ -static const unsigned char pkt15[119] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x69, 0x00, 0x0f, 0x40, 0x00, 0xff, 0x11, /* .i..@... */ -0x90, 0x37, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .7...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x55, /* .......U */ -0x14, 0x46, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .F...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, /* .test14. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ -}; - diff --git a/test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng b/test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng deleted file mode 100644 index 64e3fd72..00000000 Binary files a/test/regression/mdns_test/capture/announcement_in_multiple_packets.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/case_insensitivity.c b/test/regression/mdns_test/capture/case_insensitivity.c deleted file mode 100644 index f60cf40d..00000000 --- a/test/regression/mdns_test/capture/case_insensitivity.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Frame (77 bytes) */ -static const unsigned char pkt1[77] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x3f, 0x3d, 0x61, 0x00, 0x00, 0xff, 0x11, /* .?=a.... */ -0xdc, 0x3e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .>...j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ -0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x45, /* RMMDNSTE */ -0x53, 0x54, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* ST.local */ -0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ -}; - -/* Frame (138 bytes) */ -static const unsigned char pkt2[138] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x7c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ -0x90, 0x2c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .,...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ -0xb9, 0x74, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .t...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40 /* .@ */ -}; - diff --git a/test/regression/mdns_test/capture/case_insensitivity.pcapng b/test/regression/mdns_test/capture/case_insensitivity.pcapng deleted file mode 100644 index 5b5b9cad..00000000 Binary files a/test/regression/mdns_test/capture/case_insensitivity.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/client_passive.c b/test/regression/mdns_test/capture/client_passive.c deleted file mode 100644 index 23c5714e..00000000 --- a/test/regression/mdns_test/capture/client_passive.c +++ /dev/null @@ -1,209 +0,0 @@ -/* Frame (134 bytes) */ -static const unsigned char pkt1[134] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ -0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ -0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ -0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ -0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ -0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ -}; - -/* Frame (134 bytes) */ -static const unsigned char pkt2[134] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ -0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ -0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ -0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ -0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ -0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ -}; - -/* Frame (134 bytes) */ -static const unsigned char pkt3[134] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0x78, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .x..@... */ -0xd9, 0x67, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .g...i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x64, /* .......d */ -0x0c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* l....... */ -0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0xc0, /* .ubuntu. */ -0x29, 0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01, 0x00, /* )....... */ -0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ -}; - -/* Frame (223 bytes) */ -static const unsigned char pkt4[223] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ -0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ -0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ -0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ -0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ -0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ -0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ -0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ -}; - -/* Frame (223 bytes) */ -static const unsigned char pkt5[223] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ -0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ -0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ -0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ -0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ -0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ -0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ -0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ -}; - -/* Frame (223 bytes) */ -static const unsigned char pkt6[223] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ -0xc6, 0xe4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x1e, 0x00, /* ........ */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x21, 0x80, /* ......!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ -0x75, 0x6e, 0x74, 0x75, 0xc0, 0x29, 0xc0, 0x5b, /* untu.).[ */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ -0xd4, 0x79, 0xc0, 0x5b, 0x00, 0x01, 0x80, 0x01, /* .y.[.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x69, 0x09, 0x5f, 0x73, 0x65, 0x72, 0x76, /* .i._serv */ -0x69, 0x63, 0x65, 0x73, 0x07, 0x5f, 0x64, 0x6e, /* ices._dn */ -0x73, 0x2d, 0x73, 0x64, 0x04, 0x5f, 0x75, 0x64, /* s-sd._ud */ -0x70, 0xc0, 0x29, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p.)..... */ -0x00, 0x11, 0x94, 0x00, 0x02, 0xc0, 0x1e /* ....... */ -}; - -/* Frame (223 bytes) */ -static const unsigned char pkt7[223] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x79, 0x08, 0x00, 0x45, 0x00, /* )..y..E. */ -0x00, 0xd1, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x0e, 0xc0, 0xa8, 0x00, 0x69, 0xe0, 0x00, /* .....i.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbd, /* ........ */ -0x6e, 0xb6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* n....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0xc0, 0x23, 0xc0, 0x34, 0x00, 0x0c, 0x00, /* p.#.4... */ -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x11, /* ........ */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0xc0, 0x34, 0xc0, 0x4d, 0x00, 0x21, 0x80, /* r.4.M.!. */ -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, /* ....P.ub */ -0x75, 0x6e, 0x74, 0x75, 0xc0, 0x23, 0xc0, 0x73, /* untu.#.s */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, /* ....)... */ -0xd4, 0x79, 0xc0, 0x73, 0x00, 0x01, 0x80, 0x01, /* .y.s.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x69, 0xc0, 0x4d, 0x00, 0x10, 0x80, 0x01, /* .i.M.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 /* ....... */ -}; - -/* Frame (107 bytes) */ -static const unsigned char pkt8[107] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x5d, 0x13, 0xc0, 0x00, 0x00, 0xff, 0x11, /* .]...... */ -0x06, 0x28, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .(...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x49, /* .......I */ -0x79, 0x60, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* y`...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0xc0, 0x23 /* p.# */ -}; - diff --git a/test/regression/mdns_test/capture/client_passive.pcapng b/test/regression/mdns_test/capture/client_passive.pcapng deleted file mode 100644 index d9878160..00000000 Binary files a/test/regression/mdns_test/capture/client_passive.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/command.txt b/test/regression/mdns_test/capture/command.txt deleted file mode 100644 index 6751f595..00000000 --- a/test/regression/mdns_test/capture/command.txt +++ /dev/null @@ -1,4 +0,0 @@ -service avahi-daemon stop -service avahi-daemon restart -mzclient -a IPv4 -t _smb._tcp -for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 ; do { mzclient -p "_http._tcp 80 $i Simple Web Server Test For Multiple Packets"& } ; done; diff --git a/test/regression/mdns_test/capture/continuous_query.c b/test/regression/mdns_test/capture/continuous_query.c deleted file mode 100644 index 92506de4..00000000 --- a/test/regression/mdns_test/capture/continuous_query.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (153 bytes) */ -static const unsigned char pkt2[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x8b, 0x7e, 0xd1, 0x00, 0x00, 0xff, 0x11, /* ..~..... */ -0x9a, 0xe8, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ -0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ -0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ -0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00 /* . */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt3[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt4[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt5[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x8d, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt6[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x85, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - diff --git a/test/regression/mdns_test/capture/continuous_query.pcapng b/test/regression/mdns_test/capture/continuous_query.pcapng deleted file mode 100644 index 4c880dbe..00000000 Binary files a/test/regression/mdns_test/capture/continuous_query.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/continuous_query_a.c b/test/regression/mdns_test/capture/continuous_query_a.c deleted file mode 100644 index 275318db..00000000 --- a/test/regression/mdns_test/capture/continuous_query_a.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Frame (79 bytes) */ -static const unsigned char pkt1[79] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x41, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .A..@... */ -0x90, 0xaf, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ -0xf0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .X...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x5f, 0x30, 0x05, 0x6c, 0x6f, 0x63, /* st_0.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01 /* al..... */ -}; - -/* Frame (89 bytes) */ -static const unsigned char pkt2[89] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x4b, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .K..@... */ -0x90, 0x5d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .]...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x37, /* .......7 */ -0xad, 0x78, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x5f, 0x30, 0x05, 0x6c, 0x6f, 0x63, /* st_0.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x42 /* B */ -}; - diff --git a/test/regression/mdns_test/capture/continuous_query_a.pcapng b/test/regression/mdns_test/capture/continuous_query_a.pcapng deleted file mode 100644 index 67deab8e..00000000 Binary files a/test/regression/mdns_test/capture/continuous_query_a.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/continuous_query_unique_answer.c b/test/regression/mdns_test/capture/continuous_query_unique_answer.c deleted file mode 100644 index 2e20a36b..00000000 --- a/test/regression/mdns_test/capture/continuous_query_unique_answer.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Frame (85 bytes) */ -static const unsigned char pkt1[85] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x47, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .G..@... */ -0x90, 0x61, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .a...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x33, /* .......3 */ -0xd8, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x43, /* .......C */ -0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01 /* ..... */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt2[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ -0x00, 0xff, 0x17, 0x8d, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0x01, 0x51, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .Q...l.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x67, 0xea, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* g....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x09, 0x43, /* .......C */ -0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, /* henbo-PC */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x78, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, /* x....... */ -0xbd, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ -0x2d, 0x50, 0x43, 0xc0, 0x20, 0xc0, 0x0c, 0x00, /* -PC. ... */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x23, 0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, /* #.netbio */ -0x73, 0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, /* s=CHENBO */ -0x2d, 0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, /* -PC.doma */ -0x69, 0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, /* in=WORKG */ -0x52, 0x4f, 0x55, 0x50, 0xc0, 0x37, 0x00, 0x01, /* ROUP.7.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x6c, 0xc0, 0x37, 0x00, 0x1c, /* ...l.7.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, /* .......1 */ -0xc0, 0x37, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* .7...... */ -0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ -0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, /* .....YDy */ -0xe1, 0x0a, 0xd7, 0xf4, 0xc0, 0x37, 0x00, 0x2f, /* .....7./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x37, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, /* .7..@... */ -0xc0, 0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .../.... */ -0x00, 0x78, 0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, /* .x...... */ -0x00, 0x00, 0x80, 0x00, 0x40 /* ....@ */ -}; - diff --git a/test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng b/test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng deleted file mode 100644 index eee3768c..00000000 Binary files a/test/regression/mdns_test/capture/continuous_query_unique_answer.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/dns_sd_query.c b/test/regression/mdns_test/capture/dns_sd_query.c deleted file mode 100644 index f42cc196..00000000 --- a/test/regression/mdns_test/capture/dns_sd_query.c +++ /dev/null @@ -1,351 +0,0 @@ -/* Frame (88 bytes) */ -static const unsigned char pkt1[88] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x4a, 0x58, 0x5c, 0x00, 0x00, 0xff, 0x11, /* .JX\.... */ -0xc1, 0x3e, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .>...d.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ -0xa2, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .O...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (88 bytes) */ -static const unsigned char pkt2[88] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4a, 0x02, 0xe1, 0x00, 0x00, 0xff, 0x11, /* .J...... */ -0xcd, 0xc4, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ -0xb4, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (106 bytes) */ -static const unsigned char pkt3[106] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ -0x00, 0x5c, 0x1e, 0xf3, 0x00, 0x00, 0xff, 0x11, /* .\...... */ -0xfa, 0x92, 0xc0, 0xa8, 0x00, 0x67, 0xe0, 0x00, /* .....g.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ -0x0a, 0xee, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0xc0, 0x23 /* .# */ -}; - -/* Frame (114 bytes) */ -static const unsigned char pkt4[114] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ -0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ -0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ -0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ -0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0xc0, 0x23 /* .# */ -}; - -/* Frame (160 bytes) */ -static const unsigned char pkt5[160] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x92, 0x17, 0x39, 0x00, 0x00, 0xff, 0x11, /* ...9.... */ -0x02, 0x7a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .z...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ -0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ -0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ -}; - -/* Frame (219 bytes) */ -static const unsigned char pkt6[219] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0xcd, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x23, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .#...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb9, /* ........ */ -0x69, 0x6d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* im...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .#...... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x65, 0xc0, 0x41, 0xc0, /* teste.A. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ -0x74, 0x64, 0xc0, 0x41, 0xc0, 0x0c, 0x00, 0x0c, /* td.A.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ -0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, /* ._testc. */ -0x41, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* A....... */ -0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, /* ......_t */ -0x65, 0x73, 0x74, 0x62, 0xc0, 0x41, 0xc0, 0x0c, /* estb.A.. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ -0x61, 0xc0, 0x41 /* a.A */ -}; - -/* Frame (212 bytes) */ -static const unsigned char pkt7[212] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0xc6, 0x58, 0x8e, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ -0xc0, 0x90, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ -0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x93, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ -0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ -0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ -0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x0f, /* ........ */ -0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ -0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ -0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ -0x00, 0x11, 0x94, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ -0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0xc0, 0x3f /* tp.? */ -}; - -/* Frame (225 bytes) */ -static const unsigned char pkt8[225] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0xd3, 0x02, 0xe2, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0xcd, 0x3a, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .:...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ -0x1b, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .:...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ -0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ -0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ -0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ -0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ -0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x09, /* ........ */ -0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ -0x47 /* G */ -}; - -/* Frame (212 bytes) */ -static const unsigned char pkt9[212] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0xc6, 0x58, 0xcf, 0x00, 0x00, 0xff, 0x11, /* ..X..... */ -0xc0, 0x4f, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .O...d.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xb2, /* ........ */ -0xa2, 0xcb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x90, 0x00, 0x0c, 0x04, 0x5f, 0x73, 0x6d, /* ....._sm */ -0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* b._tcp.# */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x91, 0x00, 0x0f, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ -0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ -0x6e, 0xc0, 0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* n.?..... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x12, 0x0f, /* ........ */ -0x5f, 0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, /* _pdl-dat */ -0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, /* astream. */ -0x3f, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ?....... */ -0x00, 0x11, 0x91, 0x00, 0x0b, 0x08, 0x5f, 0x70, /* ......_p */ -0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0xc0, 0x3f, /* rinter.? */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x91, 0x00, 0x08, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0xc0, 0x3f /* tp.? */ -}; - -/* Frame (225 bytes) */ -static const unsigned char pkt10[225] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0xd3, 0x02, 0xe3, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0xcd, 0x39, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* .9...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ -0x21, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* !F...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x91, 0x00, 0x14, 0x0c, 0x5f, 0x77, 0x6f, /* ....._wo */ -0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, /* rkstatio */ -0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x23, /* n._tcp.# */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, /* ....._te */ -0x73, 0x74, 0x65, 0xc0, 0x47, 0xc0, 0x0c, 0x00, /* ste.G... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x64, /* .._testd */ -0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* .G...... */ -0x00, 0x00, 0x11, 0x91, 0x00, 0x09, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x63, 0xc0, 0x47, 0xc0, /* testc.G. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x91, 0x00, 0x09, 0x06, 0x5f, 0x74, 0x65, 0x73, /* ...._tes */ -0x74, 0x62, 0xc0, 0x47, 0xc0, 0x0c, 0x00, 0x0c, /* tb.G.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x09, /* ........ */ -0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x61, 0xc0, /* ._testa. */ -0x47 /* G */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt11[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0x5a, 0x59, 0x32, 0x00, 0x00, 0xff, 0x11, /* .ZY2.... */ -0xbf, 0x58, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .X...d.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0xa3, 0x5f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ._...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x64, 0x03, 0x31, 0x30, 0x30, /* ...d.100 */ -0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ -0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ -0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ -0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ -0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ -0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ -0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ -0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ -}; - -/* Frame (136 bytes) */ -static const unsigned char pkt12[136] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7a, 0x02, 0xe4, 0x00, 0x00, 0xff, 0x11, /* .z...... */ -0xcd, 0x91, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x66, /* .......f */ -0x82, 0x29, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .)...... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x02, 0x01, 0x32, 0x01, 0x30, /* .....2.0 */ -0x01, 0x30, 0x02, 0x31, 0x30, 0x07, 0x69, 0x6e, /* .0.10.in */ -0x2d, 0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, /* -addr.ar */ -0x70, 0x61, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* pa...... */ -0x00, 0x00, 0x78, 0x00, 0x02, 0xc0, 0x0c, 0xc0, /* ..x..... */ -0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x05, 0xc0, 0x0c, 0x00, 0x01, 0x40 /* x......@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt13[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x45, 0x59, 0xc5, 0x00, 0x00, 0xff, 0x11, /* .EY..... */ -0xbf, 0xda, 0xc0, 0xa8, 0x00, 0x64, 0xe0, 0x00, /* .....d.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt14[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x02, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .E...... */ -0xcd, 0xc5, 0x0a, 0x00, 0x00, 0x02, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0x95, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .L...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - diff --git a/test/regression/mdns_test/capture/dns_sd_query.pcapng b/test/regression/mdns_test/capture/dns_sd_query.pcapng deleted file mode 100644 index 1b1d5f04..00000000 Binary files a/test/regression/mdns_test/capture/dns_sd_query.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/duplicate_question_suppression.c b/test/regression/mdns_test/capture/duplicate_question_suppression.c deleted file mode 100644 index 9d020109..00000000 --- a/test/regression/mdns_test/capture/duplicate_question_suppression.c +++ /dev/null @@ -1,182 +0,0 @@ - -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (76 bytes) */ -static const unsigned char pkt2[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (76 bytes) */ -static const unsigned char pkt3[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc0, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (76 bytes) */ -static const unsigned char pkt4[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xbf, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (153 bytes) */ -static const unsigned char pkt5[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x8b, 0xe6, 0x7f, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0x33, 0x3a, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* 3:...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ -0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ -0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ -0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00 /* . */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt6[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - - -/* Frame (135 bytes) */ -static const unsigned char pkt7[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - - -/* Frame (135 bytes) */ -static const unsigned char pkt8[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x82, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - - -/* Frame (76 bytes) */ -static const unsigned char pkt9[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - - -/* Frame (135 bytes) */ -static const unsigned char pkt10[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x81, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1,...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x78, 0x00, 0x1f, /* .....x.. */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; \ No newline at end of file diff --git a/test/regression/mdns_test/capture/error_response.pcapng b/test/regression/mdns_test/capture/error_response.pcapng deleted file mode 100644 index 74c0e330..00000000 Binary files a/test/regression/mdns_test/capture/error_response.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/ipv6_query.c b/test/regression/mdns_test/capture/ipv6_query.c deleted file mode 100644 index 6f9a8d10..00000000 --- a/test/regression/mdns_test/capture/ipv6_query.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Frame (96 bytes) */ -static const unsigned char pkt1[96] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ -0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0xfe, 0x80, /* ...*.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x00, 0x2a, 0x68, 0xc4, 0x00, 0x00, /* ...*h... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (185 bytes) */ -static const unsigned char pkt2[185] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* 33...... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x86, 0xdd, 0x60, 0x00, /* ..z...`. */ -0x00, 0x00, 0x00, 0x83, 0x11, 0x40, 0xfe, 0x80, /* .....@.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1e, /* ........ */ -0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, 0xff, 0x02, /* ....z... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x00, 0x83, 0x30, 0x75, 0x00, 0x00, /* ....0u.. */ -0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, /* .......C */ -0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, /* anonMF45 */ -0x30, 0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, /* 00w...ro */ -0x75, 0x74, 0x65, 0x72, 0xc0, 0x17, 0x00, 0x1c, /* uter.... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x02, 0x1e, 0x8f, 0xff, 0xfe, 0xb1, 0x7a, 0xd4, /* ......z. */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00 /* . */ -}; - -/* Frame (155 bytes) */ -static const unsigned char pkt3[155] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, /* "3DV..`. */ -0x00, 0x00, 0x00, 0x65, 0x11, 0xff, 0xfe, 0x80, /* ...e.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, /* "..3DV.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x00, 0x65, 0x6c, 0xde, 0x00, 0x00, /* ...el... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x93, 0x00, 0x1f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ -0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ -0x77, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* w._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00 /* al. */ -}; - diff --git a/test/regression/mdns_test/capture/ipv6_query.pcapng b/test/regression/mdns_test/capture/ipv6_query.pcapng deleted file mode 100644 index b2be51f4..00000000 Binary files a/test/regression/mdns_test/capture/ipv6_query.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/known_answer_suppression.c b/test/regression/mdns_test/capture/known_answer_suppression.c deleted file mode 100644 index 86a664f4..00000000 --- a/test/regression/mdns_test/capture/known_answer_suppression.c +++ /dev/null @@ -1,101 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0xd9, 0xc1, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x2c, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ,....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (153 bytes) */ -static const unsigned char pkt2[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x8b, 0x87, 0x82, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0x92, 0x37, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .7...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xe2, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* ...Canon */ -0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, /* MF4500w. */ -0x0c, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, /* ..router */ -0xc0, 0x17, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x04, /* .x...... */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0xc0, 0x37, 0xc0, 0x28, 0x00, 0x10, /* .P.7.(.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00 /* . */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt3[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x85, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt4[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x84, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x92, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (135 bytes) */ -static const unsigned char pkt5[135] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0x79, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* .y..@... */ -0xd9, 0x83, 0xc0, 0xa8, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x65, /* .......e */ -0x31, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 1....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x90, 0x00, 0x1f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0x05, 0x5f, 0x68, /* 4500w._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - diff --git a/test/regression/mdns_test/capture/known_answer_suppression.pcapng b/test/regression/mdns_test/capture/known_answer_suppression.pcapng deleted file mode 100644 index d84451bd..00000000 Binary files a/test/regression/mdns_test/capture/known_answer_suppression.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c b/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c deleted file mode 100644 index 064ff449..00000000 --- a/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.c +++ /dev/null @@ -1,172 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (255 bytes) */ -static const unsigned char pkt2[255] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ -0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ -0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (108 bytes) */ -static const unsigned char pkt3[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ -0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0xc0, 0x0c /* er.. */ -}; - -/* Frame (108 bytes) */ -static const unsigned char pkt4[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ -0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0xc0, 0x0c /* er.. */ -}; - -/* Frame (108 bytes) */ -static const unsigned char pkt5[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ -0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0xc0, 0x0c /* er.. */ -}; - -/* Frame (108 bytes) */ -static const unsigned char pkt6[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x2e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, /* .....<.. */ -0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0xc0, 0x0c /* er.. */ -}; - -/* Frame (76 bytes) */ -static const unsigned char pkt7[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (255 bytes) */ -static const unsigned char pkt8[255] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xf1, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ -0x19, 0x0d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3c, /* .......< */ -0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x3c, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .<...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x3c, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* <...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - diff --git a/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng b/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng deleted file mode 100644 index c77212ef..00000000 Binary files a/test/regression/mdns_test/capture/known_answer_suppression_query_half_ttl.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/known_answer_suppression_response.c b/test/regression/mdns_test/capture/known_answer_suppression_response.c deleted file mode 100644 index 4c22c6f6..00000000 --- a/test/regression/mdns_test/capture/known_answer_suppression_response.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Frame (75 bytes) */ -static const unsigned char pkt1[75] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x3d, 0x01, 0x81, 0x00, 0x00, 0xff, 0x11, /* .=...... */ -0x11, 0x81, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ -0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (373 bytes) */ -static const unsigned char pkt2[373] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x67, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .g..@... */ -0x8f, 0x40, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .@...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x53, /* .......S */ -0xf4, 0x39, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .9...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, /* NSTest._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x24, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* $.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40 /* ....@ */ -}; - -/* Frame (101 bytes) */ -static const unsigned char pkt3[101] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x57, 0x01, 0x82, 0x00, 0x00, 0xff, 0x11, /* .W...... */ -0x11, 0x66, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .f...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ -0x10, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, 0x0b, /* ....d... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ -}; - diff --git a/test/regression/mdns_test/capture/known_answer_suppression_response.pcapng b/test/regression/mdns_test/capture/known_answer_suppression_response.pcapng deleted file mode 100644 index e5ec8872..00000000 Binary files a/test/regression/mdns_test/capture/known_answer_suppression_response.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c b/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c deleted file mode 100644 index 4439693a..00000000 --- a/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Frame (171 bytes) */ -static const unsigned char pkt1[171] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x9d, 0x1e, 0x02, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0xf4, 0x9f, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ -0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ -0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ -0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ -0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ -0x80, 0x00, 0x40 /* ..@ */ -}; - diff --git a/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng b/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng deleted file mode 100644 index 12f971b9..00000000 Binary files a/test/regression/mdns_test/capture/mdns_known_answer_suppression_unique.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/multiple_questions_per_query.c b/test/regression/mdns_test/capture/multiple_questions_per_query.c deleted file mode 100644 index 076ea0e1..00000000 --- a/test/regression/mdns_test/capture/multiple_questions_per_query.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Frame (103 bytes) */ -static const unsigned char pkt1[103] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ -0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ -0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ -0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ -0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ -0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ -}; - -/* Frame (103 bytes) */ -static const unsigned char pkt2[103] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ -0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ -0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ -0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ -0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ -0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ -}; - -/* Frame (103 bytes) */ -static const unsigned char pkt3[103] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ -0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ -0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ -0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ -0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ -0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ -}; - -/* Frame (103 bytes) */ -static const unsigned char pkt4[103] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x59, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .Y..@... */ -0x90, 0x97, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x45, /* .......E */ -0xe9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5f, /* ......._ */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x74, /* test1._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x06, 0x5f, 0x74, /* ......_t */ -0x65, 0x73, 0x74, 0x32, 0xc0, 0x13, 0x00, 0x0c, /* est2.... */ -0x00, 0x01, 0x06, 0x5f, 0x74, 0x65, 0x73, 0x74, /* ..._test */ -0x33, 0xc0, 0x13, 0x00, 0x0c, 0x00, 0x01 /* 3...... */ -}; - diff --git a/test/regression/mdns_test/capture/multiple_questions_per_query.pcapng b/test/regression/mdns_test/capture/multiple_questions_per_query.pcapng deleted file mode 100644 index e19858a4..00000000 Binary files a/test/regression/mdns_test/capture/multiple_questions_per_query.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/one_shot_query.c b/test/regression/mdns_test/capture/one_shot_query.c deleted file mode 100644 index 81ca06ab..00000000 --- a/test/regression/mdns_test/capture/one_shot_query.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (255 bytes) */ -static const unsigned char pkt2[255] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xf1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xdd, /* ........ */ -0xf0, 0xbc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .$.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (108 bytes) */ -static const unsigned char pkt3[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x2d, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* -....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, /* .....d.. */ -0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0xc0, 0x0c /* er.. */ -}; - -/* Frame (108 bytes) */ -static const unsigned char pkt4[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x5e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x2d, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* -....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, /* .....d.. */ -0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* .Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0xc0, 0x0c /* er.. */ -}; - diff --git a/test/regression/mdns_test/capture/one_shot_query.pcapng b/test/regression/mdns_test/capture/one_shot_query.pcapng deleted file mode 100644 index e2b6395c..00000000 Binary files a/test/regression/mdns_test/capture/one_shot_query.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/probing_conflict.c b/test/regression/mdns_test/capture/probing_conflict.c deleted file mode 100644 index 95e3f484..00000000 --- a/test/regression/mdns_test/capture/probing_conflict.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Frame (225 bytes) */ -static const unsigned char pkt1[225] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xd3, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xd5, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbf, /* ........ */ -0x13, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .w...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0xff, 0x00, 0x01, 0x0f, 0x53, 0x69, 0x6d, /* .....Sim */ -0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, 0x53, 0x65, /* pleWebSe */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0f, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x14, 0x08, 0x70, 0x61, /* ..d...pa */ -0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ -0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ -0x31 /* 1 */ -}; - -/* Frame (235 bytes) */ -static const unsigned char pkt2[235] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbc, 0x39, 0x02, 0x08, 0x00, 0x45, 0x00, /* /.9...E. */ -0x00, 0xdd, 0x05, 0x71, 0x00, 0x00, 0xff, 0x11, /* ...q.... */ -0xca, 0xa2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc9, /* ........ */ -0x3d, 0x40, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* =@...... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x0f, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ -0x50, 0x43, 0xc0, 0x27, 0xc0, 0x0c, 0x00, 0x10, /* PC.'.... */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, /* ........ */ -0x09, 0x5b, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* .[paper= */ -0x41, 0x34, 0x0b, 0x56, 0x65, 0x72, 0x73, 0x69, /* A4.Versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x5d, 0xc0, 0x3e, /* on=01].> */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x01, 0xc0, 0x3e, /* .......> */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xc0, 0x93, 0x9d, 0xaa, 0xda, 0xe3, /* ........ */ -0xea, 0xba, 0xc0, 0x3e, 0x00, 0x2f, 0x80, 0x01, /* ...>./.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0xc0, 0x3e, /* ...x...> */ -0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0xc0, 0x0c, /* ..@..... */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ -0x80, 0x00, 0x40 /* ..@ */ -}; - -/* Frame (237 bytes) */ -static const unsigned char pkt3[237] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xdf, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xc8, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ -0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ -0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ -0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ -0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ -0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (237 bytes) */ -static const unsigned char pkt4[237] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xdf, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ -0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ -0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ -0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ -0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ -0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (237 bytes) */ -static const unsigned char pkt5[237] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xdf, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xc6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ -0x15, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .f...... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ -0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, /* .SimpleW */ -0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* ebServer */ -0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, /* (2)._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x13, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x57, 0x65, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, /* WebServe */ -0x72, 0x20, 0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, /* r (2)._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (261 bytes) */ -static const unsigned char pkt6[261] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xf7, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ -0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ -0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ -0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ -0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ -0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ -0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ -}; - -/* Frame (261 bytes) */ -static const unsigned char pkt7[261] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xf7, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xac, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ -0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ -0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ -0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ -0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ -0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ -0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ -}; - -/* Frame (261 bytes) */ -static const unsigned char pkt8[261] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x56, 0x08, 0x00, 0x45, 0x00, /* "3DV..E. */ -0x00, 0xf7, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xab, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe3, /* ........ */ -0xf7, 0x54, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .T...... */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x13, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, 0x62, /* impleWeb */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x28, /* Server ( */ -0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* 2)._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x13, /* .local.. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ -0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ -0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x26, 0x13, /* ....d.&. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x57, 0x65, /* SimpleWe */ -0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* bServer */ -0x28, 0x32, 0x29, 0x05, 0x5f, 0x68, 0x74, 0x74, /* (2)._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00 /* ocal. */ -}; - diff --git a/test/regression/mdns_test/capture/probing_conflict.pcapng b/test/regression/mdns_test/capture/probing_conflict.pcapng deleted file mode 100644 index 38fb0f1b..00000000 Binary files a/test/regression/mdns_test/capture/probing_conflict.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/probing_conflict_any_type.c b/test/regression/mdns_test/capture/probing_conflict_any_type.c deleted file mode 100644 index 27928f8a..00000000 --- a/test/regression/mdns_test/capture/probing_conflict_any_type.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Frame (132 bytes) */ -static const unsigned char pkt1[132] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x76, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* .v..@... */ -0x90, 0x38, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .8...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x62, /* .......b */ -0xce, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42 /* ...B */ -}; - -/* Frame (166 bytes) */ -static const unsigned char pkt2[166] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x98, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x58, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .X...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x84, /* ........ */ -0x43, 0x43, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* CC...... */ -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, /* ...x.... */ -0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, 0x75, /* ...P.ubu */ -0x6e, 0x74, 0x75, 0xc0, 0x23, 0xc0, 0x3a, 0x00, /* ntu.#.:. */ -0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, /* ...).... */ -0x8d, 0xc0, 0x3a, 0x00, 0x01, 0x80, 0x01, 0x00, /* ..:..... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x01, 0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x94, 0x00, 0x01, 0x00 /* ...... */ -}; - -/* Frame (132 bytes) */ -static const unsigned char pkt3[132] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x76, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .v..@... */ -0x90, 0x37, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .7...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x62, /* .......b */ -0xce, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42 /* ...B */ -}; - -/* Frame (132 bytes) */ -static const unsigned char pkt4[132] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x76, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .v..@... */ -0x90, 0x36, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .6...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x62, /* .......b */ -0xce, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42 /* ...B */ -}; - -/* Frame (98 bytes) */ -static const unsigned char pkt5[98] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x54, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .T..@... */ -0x90, 0x57, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .W...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x40, /* .......@ */ -0x13, 0xc0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ -0x00, 0x42 /* .B */ -}; - -/* Frame (98 bytes) */ -static const unsigned char pkt6[98] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x54, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .T..@... */ -0x90, 0x56, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .V...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x40, /* .......@ */ -0x13, 0xc0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ -0x00, 0x42 /* .B */ -}; - -/* Frame (98 bytes) */ -static const unsigned char pkt7[98] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x54, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .T..@... */ -0x90, 0x55, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .U...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x40, /* .......@ */ -0x13, 0xc0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ -0x00, 0x42 /* .B */ -}; - diff --git a/test/regression/mdns_test/capture/probing_conflict_any_type.pcapng b/test/regression/mdns_test/capture/probing_conflict_any_type.pcapng deleted file mode 100644 index 5ae65956..00000000 Binary files a/test/regression/mdns_test/capture/probing_conflict_any_type.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_and_response_chaos.c b/test/regression/mdns_test/capture/query_and_response_chaos.c deleted file mode 100644 index 6fe446b2..00000000 --- a/test/regression/mdns_test/capture/query_and_response_chaos.c +++ /dev/null @@ -1,2034 +0,0 @@ -/* Frame (83 bytes) */ -static const unsigned char pkt1[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x45, 0x44, 0x8b, 0x00, 0x00, 0xff, 0x11, /* .ED..... */ -0xd5, 0x0e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt2[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x0a, 0x11, 0x00, 0x00, 0xff, 0x11, /* .E...... */ -0x08, 0xe9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (158 bytes) */ -static const unsigned char pkt3[158] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x90, 0x44, 0x8c, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ -0xd4, 0xc2, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ -0xa7, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x80, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x80, 0x01, /* ........ */ -0xc0, 0x0c, 0x00, 0xff, 0x80, 0x01, 0xc0, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ -0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ -}; - -/* Frame (90 bytes) */ -static const unsigned char pkt4[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4c, 0x0a, 0x12, 0x00, 0x00, 0xff, 0x11, /* .L...... */ -0x08, 0xe1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x9b, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .p...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x80, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x07, 0x0a /* .. */ -}; - -/* Frame (158 bytes) */ -static const unsigned char pkt5[158] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x90, 0x44, 0x8d, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ -0xd4, 0xc1, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ -0x27, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* '0...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, /* ........ */ -0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ -0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ -}; - -/* Frame (90 bytes) */ -static const unsigned char pkt6[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4c, 0x0a, 0x13, 0x00, 0x00, 0xff, 0x11, /* .L...... */ -0x08, 0xe0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x07, 0x0a /* .. */ -}; - -/* Frame (158 bytes) */ -static const unsigned char pkt7[158] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x90, 0x44, 0x91, 0x00, 0x00, 0xff, 0x11, /* ..D..... */ -0xd4, 0xbd, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ -0x27, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* '0...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, /* ........ */ -0xc0, 0x0c, 0x00, 0xff, 0x00, 0x01, 0xc0, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xc0, 0x0c, /* .....j.. */ -0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, /* ..@..... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0xc0, 0x0c, 0x00, 0x1c, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba /* I?Y.~. */ -}; - -/* Frame (90 bytes) */ -static const unsigned char pkt8[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4c, 0x0a, 0x14, 0x00, 0x00, 0xff, 0x11, /* .L...... */ -0x08, 0xdf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x07, 0x0a /* .. */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt9[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0x5a, 0x44, 0x93, 0x00, 0x00, 0xff, 0x11, /* .ZD..... */ -0xd3, 0xf1, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ -0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ -0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ -0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ -0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ -0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ -0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ -0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ -0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt10[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x0a, 0x15, 0x00, 0x00, 0xff, 0x11, /* .~...... */ -0x08, 0xac, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt11[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x45, 0x44, 0x95, 0x00, 0x00, 0xff, 0x11, /* .ED..... */ -0xd5, 0x04, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt12[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x0a, 0x16, 0x00, 0x00, 0xff, 0x11, /* .E...... */ -0x08, 0xe4, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt13[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0x5a, 0x44, 0xab, 0x00, 0x00, 0xff, 0x11, /* .ZD..... */ -0xd3, 0xd9, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ -0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ -0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ -0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ -0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ -0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ -0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ -0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ -0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt14[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x0a, 0x17, 0x00, 0x00, 0xff, 0x11, /* .~...... */ -0x08, 0xaa, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt15[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0x5a, 0x45, 0x28, 0x00, 0x00, 0xff, 0x11, /* .ZE(.... */ -0xd3, 0x5c, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .\...j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ -0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ -0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ -0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ -0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ -0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ -0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ -0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ -0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt16[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x0a, 0x18, 0x00, 0x00, 0xff, 0x11, /* .~...... */ -0x08, 0xa9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt17[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x45, 0x45, 0x29, 0x00, 0x00, 0xff, 0x11, /* .EE).... */ -0xd4, 0x70, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .p...j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt18[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x0a, 0x19, 0x00, 0x00, 0xff, 0x11, /* .E...... */ -0x08, 0xe1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt19[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0x5a, 0x45, 0x51, 0x00, 0x00, 0xff, 0x11, /* .ZEQ.... */ -0xd3, 0x33, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .3...j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ -0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ -0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ -0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ -0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ -0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ -0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ -0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ -0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt20[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x0a, 0x1a, 0x00, 0x00, 0xff, 0x11, /* .~...... */ -0x08, 0xa7, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt21[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x45, 0x45, 0x75, 0x00, 0x00, 0xff, 0x11, /* .EEu.... */ -0xd4, 0x24, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .$...j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xde, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .;...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt22[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x0a, 0x1b, 0x00, 0x00, 0xff, 0x11, /* .E...... */ -0x08, 0xdf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (88 bytes) */ -static const unsigned char pkt23[88] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x4a, 0x45, 0x7a, 0x00, 0x00, 0xff, 0x11, /* .JEz.... */ -0xd4, 0x1a, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ -0xfd, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (88 bytes) */ -static const unsigned char pkt24[88] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4a, 0x0a, 0x1c, 0x00, 0x00, 0xff, 0x11, /* .J...... */ -0x08, 0xd9, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ -0xf6, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (106 bytes) */ -static const unsigned char pkt25[106] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ -0x00, 0x5c, 0x78, 0x77, 0x00, 0x00, 0xff, 0x11, /* .\xw.... */ -0xa1, 0x09, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .....l.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ -0x0a, 0xe9, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0xc0, 0x23 /* .# */ -}; - -/* Frame (114 bytes) */ -static const unsigned char pkt26[114] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ -0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ -0x00, 0x64, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .d..@... */ -0xd9, 0xe2, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x50, /* .......P */ -0x42, 0x75, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Bu...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x14, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0xc0, 0x23 /* .# */ -}; - -/* Frame (113 bytes) */ -static const unsigned char pkt27[113] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0x63, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .c..@... */ -0xd9, 0xd1, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4f, /* .......O */ -0x64, 0xfc, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* d....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x13, 0x0b, 0x5f, /* ......._ */ -0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ -0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, /* sh._tcp. */ -0x23 /* # */ -}; - -/* Frame (126 bytes) */ -static const unsigned char pkt28[126] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0x70, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .p..@... */ -0xd9, 0xc3, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5c, /* .......\ */ -0x3e, 0x43, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* >C...... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* p.#..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ -0x5f, 0x72, 0x66, 0x62, 0xc0, 0x3a /* _rfb.: */ -}; - -/* Frame (94 bytes) */ -static const unsigned char pkt29[94] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x50, 0x45, 0x7e, 0x00, 0x00, 0xff, 0x11, /* .PE~.... */ -0xd4, 0x10, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ -0x60, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* `....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x0c, 0x5f, 0x77, 0x6f, 0x72, /* ...._wor */ -0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* kstation */ -0xc0, 0x11, 0x00, 0x0c, 0x00, 0x01 /* ...... */ -}; - -/* Frame (94 bytes) */ -static const unsigned char pkt30[94] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x50, 0x0a, 0x1d, 0x00, 0x00, 0xff, 0x11, /* .P...... */ -0x08, 0xd2, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ -0x5a, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ZA...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x0c, 0x5f, 0x77, 0x6f, 0x72, /* ...._wor */ -0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, /* kstation */ -0xc0, 0x11, 0x00, 0x0c, 0x00, 0x01 /* ...... */ -}; - -/* Frame (332 bytes) */ -static const unsigned char pkt31[332] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x33, 0xc1, 0xbd, 0x08, 0x00, 0x45, 0x00, /* s3....E. */ -0x01, 0x3e, 0x78, 0x7d, 0x00, 0x00, 0xff, 0x11, /* .>x}.... */ -0xa0, 0x21, 0xc0, 0xa8, 0x00, 0x6c, 0xe0, 0x00, /* .!...l.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x2a, /* .......* */ -0x4f, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* O....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x04, 0x5f, /* ......._ */ -0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* smb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x0c, 0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, /* ..Chenbo */ -0x2d, 0x50, 0x43, 0xc0, 0x0c, 0x09, 0x43, 0x68, /* -PC...Ch */ -0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, 0x43, 0x0c, /* enbo-PC. */ -0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2d, /* _device- */ -0x69, 0x6e, 0x66, 0x6f, 0xc0, 0x11, 0x00, 0x10, /* info.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0e, /* ........ */ -0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x57, /* .model=W */ -0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0xc0, 0x27, /* indows.' */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbd, /* ........ */ -0x09, 0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, /* .Chenbo- */ -0x50, 0x43, 0xc0, 0x16, 0xc0, 0x27, 0x00, 0x10, /* PC...'.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x23, /* .......# */ -0x11, 0x6e, 0x65, 0x74, 0x62, 0x69, 0x6f, 0x73, /* .netbios */ -0x3d, 0x43, 0x48, 0x45, 0x4e, 0x42, 0x4f, 0x2d, /* =CHENBO- */ -0x50, 0x43, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, /* PC.domai */ -0x6e, 0x3d, 0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, /* n=WORKGR */ -0x4f, 0x55, 0x50, 0xc0, 0x76, 0x00, 0x01, 0x80, /* OUP.v... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ -0xa8, 0x00, 0x6c, 0xc0, 0x76, 0x00, 0x1c, 0x80, /* ..l.v... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, /* ....x.. */ -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xc0, /* ......1. */ -0x76, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, /* v....... */ -0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, /* x....... */ -0x00, 0x00, 0x00, 0x01, 0x59, 0x44, 0x79, 0xe1, /* ....YDy. */ -0x0a, 0xd7, 0xf4, 0xc0, 0x27, 0x00, 0x2f, 0x80, /* ....'./. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, /* ....x... */ -0x27, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* '......@ */ -0xc0, 0x76, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .v./.... */ -0x00, 0x78, 0x00, 0x08, 0xc0, 0x76, 0x00, 0x04, /* .x...v.. */ -0x40, 0x00, 0x00, 0x08 /* @... */ -}; - -/* Frame (242 bytes) */ -static const unsigned char pkt32[242] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xe8, 0x39, /* ..^....9 */ -0x35, 0x44, 0xfe, 0xd4, 0x08, 0x00, 0x45, 0x00, /* 5D....E. */ -0x00, 0xe4, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x62, 0xc0, 0xa8, 0x00, 0x02, 0xe0, 0x00, /* .b...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xd0, /* ........ */ -0xa0, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x31, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, /* 1.server */ -0x2d, 0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, /* -HP-Z210 */ -0x2d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, /* -Worksta */ -0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, /* tion [e8 */ -0x3a, 0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, /* :39:35:4 */ -0x34, 0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, /* 4:fe:d4] */ -0xc0, 0x0c, 0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, /* .../.... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, /* ........ */ -0x2f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* /.!..... */ -0x78, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, /* x.#..... */ -0x09, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, /* ..server */ -0x2d, 0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, /* -HP-Z210 */ -0x2d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, /* -Worksta */ -0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x1e, 0xc0, 0x7f, /* tion.... */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0xea, 0x39, 0x35, 0xff, 0xfe, 0x44, /* ...95..D */ -0xfe, 0xd4, 0xc0, 0x7f, 0x00, 0x01, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x02 /* .. */ -}; - -/* Frame (228 bytes) */ -static const unsigned char pkt33[228] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0xd6, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x5e, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* .^...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc2, /* ........ */ -0x8a, 0x5a, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .Z...... */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x2a, 0x27, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* *'catro- */ -0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ -0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, 0x61, /* -3010 [a */ -0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, /* 4:1f:72: */ -0x35, 0x33, 0x3a, 0x39, 0x62, 0x3a, 0x63, 0x36, /* 53:9b:c6 */ -0x5d, 0xc0, 0x0c, 0xc0, 0x2f, 0x00, 0x10, 0x80, /* ].../... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ -0xc0, 0x2f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* ./.!.... */ -0x00, 0x78, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x09, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ -0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ -0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x1e, /* x-3010.. */ -0xc0, 0x78, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* .x...... */ -0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ -0x00, 0x00, 0x00, 0x00, 0xa6, 0x1f, 0x72, 0xff, /* ......r. */ -0xfe, 0x53, 0x9b, 0xc6, 0xc0, 0x78, 0x00, 0x01, /* .S...x.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x14 /* .... */ -}; - -/* Frame (206 bytes) */ -static const unsigned char pkt34[206] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0xc0, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x75, 0xc0, 0xa8, 0x00, 0x13, 0xe0, 0x00, /* .u...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xac, /* ........ */ -0x17, 0x94, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, /* EL [a4:1 */ -0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, /* f:72:53: */ -0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, 0x0c, /* a0:f7].. */ -0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ./...... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, /* ....../. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ -0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x08, /* ........ */ -0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x45, 0x4c, /* catro-EL */ -0xc0, 0x1e, 0xc0, 0x6d, 0x00, 0x1c, 0x80, 0x01, /* ...m.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0x20, 0x01, /* ...x.. . */ -0x0d, 0xa8, 0x80, 0x08, 0x01, 0x27, 0x02, 0x0c, /* .....'.. */ -0x29, 0xff, 0xfe, 0xe5, 0x16, 0x93, 0xc0, 0x6d, /* )......m */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x13 /* ...... */ -}; - -/* Frame (160 bytes) */ -static const unsigned char pkt35[160] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x00, 0x92, 0x67, 0xcc, 0x00, 0x00, 0xff, 0x11, /* ..g..... */ -0xb1, 0xe6, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7e, /* .......~ */ -0xbc, 0x15, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x17, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0xc0, 0x23, 0xc0, 0x0c, 0x00, /* tcp.#... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x0b, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* .._print */ -0x65, 0x72, 0xc0, 0x44, 0xc0, 0x0c, 0x00, 0x0c, /* er.D.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x08, /* ........ */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0xc0, 0x44 /* ._http.D */ -}; - -/* Frame (222 bytes) */ -static const unsigned char pkt36[222] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0xd0, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x63, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* .c...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xbc, /* ........ */ -0x27, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* '....... */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x27, 0x24, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* '$dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, /* 10 [a4:1 */ -0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, /* f:72:53: */ -0x39, 0x32, 0x3a, 0x61, 0x36, 0x5d, 0xc0, 0x0c, /* 92:a6].. */ -0xc0, 0x2f, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ./...... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, /* ....../. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x10, /* ........ */ -0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* dc-OptiP */ -0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ -0xc0, 0x1e, 0xc0, 0x75, 0x00, 0x1c, 0x80, 0x01, /* ...u.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x1f, /* ........ */ -0x72, 0xff, 0xfe, 0x53, 0x92, 0xa6, 0xc0, 0x75, /* r..S...u */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x15 /* ...... */ -}; - -/* Frame (202 bytes) */ -static const unsigned char pkt37[202] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x6a, 0x2e, 0x7a, 0x08, 0x00, 0x45, 0x00, /* )j.z..E. */ -0x00, 0xbc, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x11, 0xc0, 0xa8, 0x00, 0x7b, 0xe0, 0x00, /* .....{.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xa8, /* ........ */ -0x1d, 0xc5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ -0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ -0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ -0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x2f, /* :7a].../ */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x01, 0x00, 0xc0, 0x2f, 0x00, 0x21, 0x80, /* ..../.!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x09, 0x06, 0x75, 0x62, /* ......ub */ -0x75, 0x6e, 0x74, 0x75, 0xc0, 0x1e, 0xc0, 0x6b, /* untu...k */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x6a, /* ....)..j */ -0x2e, 0x7a, 0xc0, 0x6b, 0x00, 0x01, 0x80, 0x01, /* .z.k.... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x00, 0x7b /* .{ */ -}; - -/* Frame (94 bytes) */ -static const unsigned char pkt38[94] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x50, 0x45, 0x81, 0x00, 0x00, 0xff, 0x11, /* .PE..... */ -0xd4, 0x0d, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ -0x75, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* u....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ -0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ -0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0xc0, 0x18, 0x00, 0x0c, 0x00, 0x01 /* ...... */ -}; - -/* Frame (94 bytes) */ -static const unsigned char pkt39[94] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x50, 0x0a, 0x1e, 0x00, 0x00, 0xff, 0x11, /* .P...... */ -0x08, 0xd1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ -0x6f, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* o^...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ -0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ -0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0xc0, 0x18, 0x00, 0x0c, 0x00, 0x01 /* ...... */ -}; - -/* Frame (163 bytes) */ -static const unsigned char pkt40[163] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x9b, 0xc6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0x95, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x9f, 0xc0, 0xa8, 0x00, 0x14, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x81, /* ........ */ -0xd2, 0x1f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ -0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ -0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, /* ........ */ -0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, /* .catro-O */ -0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, /* ptiPlex- */ -0x33, 0x30, 0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x2e, /* 3010.... */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x01, 0x00, 0xc0, 0x2e, 0x00, 0x21, 0x80, /* ......!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1c, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x16, 0x13, 0x63, 0x61, /* ......ca */ -0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x1d /* 0.. */ -}; - -/* Frame (141 bytes) */ -static const unsigned char pkt41[141] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0xa0, 0xf7, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0x7f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0xb6, 0xc0, 0xa8, 0x00, 0x13, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6b, /* .......k */ -0x96, 0xe5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x5f, /* ......._ */ -0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ -0x73, 0x68, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* sh._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ -0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x45, /* .catro-E */ -0x4c, 0xc0, 0x0c, 0xc0, 0x2e, 0x00, 0x10, 0x80, /* L....... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ -0xc0, 0x2e, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* ...!.... */ -0x00, 0x78, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x16, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ -0x2d, 0x45, 0x4c, 0xc0, 0x1d /* -EL.. */ -}; - -/* Frame (250 bytes) */ -static const unsigned char pkt42[250] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0xec, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x47, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* .G...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xd8, /* ........ */ -0x88, 0xc6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, /* 10...(.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00, 0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..(.!... */ -0x00, 0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x16, 0xa8, 0x10, 0x64, 0x63, 0x2d, 0x4f, /* ....dc-O */ -0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, /* ptiPlex- */ -0x33, 0x30, 0x31, 0x30, 0xc0, 0x17, 0x0b, 0x5f, /* 3010..._ */ -0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x2d, 0x73, /* udisks-s */ -0x73, 0x68, 0xc0, 0x12, 0x00, 0x0c, 0x00, 0x01, /* sh...... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x13, 0x10, 0x64, /* .......d */ -0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ -0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ -0x84, 0xc0, 0x9c, 0x00, 0x10, 0x80, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x9c, /* ........ */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, /* ........ */ -0xc0, 0x71 /* .q */ -}; - -/* Frame (97 bytes) */ -static const unsigned char pkt43[97] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x53, 0x45, 0x84, 0x00, 0x00, 0xff, 0x11, /* .SE..... */ -0xd4, 0x07, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3f, /* .......? */ -0x9a, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, 0x6c, /* ...._pdl */ -0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, /* -datastr */ -0x65, 0x61, 0x6d, 0xc0, 0x11, 0x00, 0x0c, 0x00, /* eam..... */ -0x01 /* . */ -}; - -/* Frame (97 bytes) */ -static const unsigned char pkt44[97] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x53, 0x0a, 0x1f, 0x00, 0x00, 0xff, 0x11, /* .S...... */ -0x08, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3f, /* .......? */ -0x94, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .7...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, 0x6c, /* ...._pdl */ -0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, /* -datastr */ -0x65, 0x61, 0x6d, 0xc0, 0x11, 0x00, 0x0c, 0x00, /* eam..... */ -0x01 /* . */ -}; - -/* Frame (173 bytes) */ -static const unsigned char pkt45[173] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xa4, 0x1f, /* ..^..... */ -0x72, 0x53, 0x92, 0xa6, 0x08, 0x00, 0x45, 0x00, /* rS....E. */ -0x00, 0x9f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0xd9, 0x94, 0xc0, 0xa8, 0x00, 0x15, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x8b, /* ........ */ -0x10, 0xea, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x72, 0x66, 0x62, 0x04, 0x5f, 0x74, 0x63, 0x70, /* rfb._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ -0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ -0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ -0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x0c, 0xc0, 0x27, 0x00, 0x10, 0x80, /* 0...'... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ -0xc0, 0x27, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .'.!.... */ -0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x17, 0x0c, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x16 /* 010.. */ -}; - -/* Frame (79 bytes) */ -static const unsigned char pkt46[79] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x41, 0x45, 0x8a, 0x00, 0x00, 0xff, 0x11, /* .AE..... */ -0xd4, 0x13, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ -0xc4, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ -}; - -/* Frame (79 bytes) */ -static const unsigned char pkt47[79] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x41, 0x0a, 0x20, 0x00, 0x00, 0xff, 0x11, /* .A. .... */ -0x08, 0xde, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ -0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ -}; - -/* Frame (562 bytes) */ -static const unsigned char pkt48[562] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x02, 0x24, 0x67, 0xcd, 0x00, 0x00, 0xff, 0x11, /* .$g..... */ -0xb0, 0x53, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* .S...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x10, /* ........ */ -0x25, 0xc3, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* %....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x04, 0x5f, /* stream._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, /* .....Can */ -0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* onMF4500 */ -0x77, 0xc0, 0x0c, 0x05, 0x5f, 0x68, 0x74, 0x74, /* w..._htt */ -0x70, 0xc0, 0x1c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* p....... */ -0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ -0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ -0x30, 0x77, 0xc0, 0x41, 0x06, 0x72, 0x6f, 0x75, /* 0w.A.rou */ -0x74, 0x65, 0x72, 0xc0, 0x21, 0x00, 0x01, 0x80, /* ter.!... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ -0xa8, 0x00, 0x04, 0xc0, 0x32, 0x00, 0x21, 0x80, /* ....2.!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x23, 0x8c, 0xc0, 0x62, 0xc0, /* ...#..b. */ -0x32, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* 2....... */ -0x94, 0x01, 0x4e, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..N.txtv */ -0x65, 0x72, 0x73, 0x3d, 0x31, 0x05, 0x6e, 0x6f, /* ers=1.no */ -0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ -0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ -0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x31, 0x30, /* ority=10 */ -0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ -0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ -0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ -0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ -0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ -0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ -0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ -0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ -0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ -0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ -0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ -0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ -0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ -0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ -0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ -0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ -0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ -0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ -0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ -0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ -0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ -0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ -0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ -0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ -0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ -0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ -0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ -0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ -0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ -0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ -0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ -0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ -0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ -0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ -0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ -0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ -0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ -0x34, 0xc0, 0x53, 0x00, 0x21, 0x80, 0x01, 0x00, /* 4.S.!... */ -0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x00, 0x50, 0xc0, 0x62, 0xc0, 0x53, 0x00, /* ..P.b.S. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x01, 0x00 /* .. */ -}; - -/* Frame (468 bytes) */ -static const unsigned char pkt49[468] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0xc6, 0x45, 0x95, 0x00, 0x00, 0xff, 0x11, /* ..E..... */ -0xd2, 0x83, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xb2, /* ........ */ -0x11, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* ........ */ -0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ -0x0b, 0x5f, 0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, /* ._udisks */ -0x2d, 0x73, 0x73, 0x68, 0xc0, 0x33, 0x00, 0x0c, /* -ssh.3.. */ -0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0xc0, 0x33, 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, /* .3...... */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ -0x00, 0x02, 0xc0, 0x2e, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ -0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ -0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0xc0, /* ation.3. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x02, 0xc0, 0x50, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..P..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ -0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, 0xc0, 0x0c, /* _rfb.3.. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x12, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, /* ..._pdl- */ -0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, /* datastre */ -0x61, 0x6d, 0xc0, 0x33, 0xc0, 0x0c, 0x00, 0x0c, /* am.3.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ -0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, /* ._printe */ -0x72, 0xc0, 0x33, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* r.3..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x09, /* ........ */ -0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ -0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, 0x13, /* ........ */ -0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, /* catro-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, /* 010.>.>. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x45, 0x4c, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* EL.>.>.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x13, /* ........ */ -0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* .dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x3e, 0xc0, 0x50, 0x00, 0x0c, 0x00, /* 0.>.P... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, /* ......*' */ -0x64, 0x63, 0x27, 0x73, 0x20, 0x72, 0x65, 0x6d, /* dc's rem */ -0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x6b, /* ote desk */ -0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x64, /* top on d */ -0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ -0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ -0x50, 0xc0, 0x50, 0x00, 0x0c, 0x00, 0x01, 0x00, /* P.P..... */ -0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ -0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ -0x30, 0x77, 0xc0, 0x50 /* 0w.P */ -}; - -/* Frame (468 bytes) */ -static const unsigned char pkt50[468] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x01, 0xc6, 0x0a, 0x21, 0x00, 0x00, 0xff, 0x11, /* ...!.... */ -0x07, 0x58, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .X...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xb2, /* ........ */ -0x0b, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* .9...... */ -0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ -0x0b, 0x5f, 0x75, 0x64, 0x69, 0x73, 0x6b, 0x73, /* ._udisks */ -0x2d, 0x73, 0x73, 0x68, 0xc0, 0x33, 0x00, 0x0c, /* -ssh.3.. */ -0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0xc0, 0x33, 0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, /* .3...... */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ -0x00, 0x02, 0xc0, 0x2e, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ -0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ -0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0xc0, /* ation.3. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x02, 0xc0, 0x50, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..P..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, 0x04, /* ........ */ -0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, 0xc0, 0x0c, /* _rfb.3.. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x12, 0x0f, 0x5f, 0x70, 0x64, 0x6c, 0x2d, /* ..._pdl- */ -0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, /* datastre */ -0x61, 0x6d, 0xc0, 0x33, 0xc0, 0x0c, 0x00, 0x0c, /* am.3.... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0b, /* ........ */ -0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, /* ._printe */ -0x72, 0xc0, 0x33, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* r.3..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0c, 0x09, /* ........ */ -0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ -0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x16, 0x13, /* ........ */ -0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, /* catro-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, /* 010.>.>. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x45, 0x4c, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* EL.>.>.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x13, /* ........ */ -0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* .dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x3e, 0xc0, 0x50, 0x00, 0x0c, 0x00, /* 0.>.P... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, /* ......*' */ -0x64, 0x63, 0x27, 0x73, 0x20, 0x72, 0x65, 0x6d, /* dc's rem */ -0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, 0x73, 0x6b, /* ote desk */ -0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, 0x20, 0x64, /* top on d */ -0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ -0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, /* ex-3010. */ -0x50, 0xc0, 0x50, 0x00, 0x0c, 0x00, 0x01, 0x00, /* P.P..... */ -0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ -0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ -0x30, 0x77, 0xc0, 0x50 /* 0w.P */ -}; - -/* Frame (447 bytes) */ -static const unsigned char pkt51[447] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0xb1, 0x45, 0x9f, 0x00, 0x00, 0xff, 0x11, /* ..E..... */ -0xd2, 0x8e, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x9d, /* ........ */ -0x79, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* yH...... */ -0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, /* ...._rfb */ -0xc0, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, 0x19, /* stream.. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, /* .......1 */ -0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, /* .server- */ -0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, /* HP-Z210- */ -0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* Workstat */ -0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, /* ion [e8: */ -0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, /* 39:35:44 */ -0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, /* :fe:d4]. */ -0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, 0x63, 0x61, /* ....*'ca */ -0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, /* 0 [a4:1f */ -0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, /* :72:53:9 */ -0x62, 0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, /* b:c6]... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, /* ....catr */ -0x6f, 0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, /* o-EL [a4 */ -0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, /* :1f:72:5 */ -0x33, 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, /* 3:a0:f7] */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x27, 0x24, 0x64, /* .....'$d */ -0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ -0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, /* ex-3010 */ -0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, /* [a4:1f:7 */ -0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, /* 2:53:92: */ -0x61, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, /* a6]..... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ -0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ -0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ -0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x29, /* :7a]...) */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x29, 0xc0, 0x34, 0x00, 0x0c, /* 10.).4.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x34 /* 4500w.4 */ -}; - -/* Frame (447 bytes) */ -static const unsigned char pkt52[447] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x01, 0xb1, 0x0a, 0x22, 0x00, 0x00, 0xff, 0x11, /* ...".... */ -0x07, 0x6c, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .l...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x9d, /* ........ */ -0x72, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* r....... */ -0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* workstat */ -0x69, 0x6f, 0x6e, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ion._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, /* ...._rfb */ -0xc0, 0x19, 0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, /* ......._ */ -0x70, 0x64, 0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, /* pdl-data */ -0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xc0, 0x19, /* stream.. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, /* .......1 */ -0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, /* .server- */ -0x48, 0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, /* HP-Z210- */ -0x57, 0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, /* Workstat */ -0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, /* ion [e8: */ -0x33, 0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, /* 39:35:44 */ -0x3a, 0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, /* :fe:d4]. */ -0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x94, 0x00, 0x2a, 0x27, 0x63, 0x61, /* ....*'ca */ -0x74, 0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* tro-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, /* 0 [a4:1f */ -0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, /* :72:53:9 */ -0x62, 0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, /* b:c6]... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, /* ....catr */ -0x6f, 0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, /* o-EL [a4 */ -0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, /* :1f:72:5 */ -0x33, 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, /* 3:a0:f7] */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x27, 0x24, 0x64, /* .....'$d */ -0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, /* c-OptiPl */ -0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, /* ex-3010 */ -0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, /* [a4:1f:7 */ -0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, /* 2:53:92: */ -0x61, 0x36, 0x5d, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, /* a6]..... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x1d, 0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, /* ..ubuntu */ -0x20, 0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, /* [00:0c: */ -0x32, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, /* 29:6a:2e */ -0x3a, 0x37, 0x61, 0x5d, 0xc0, 0x0c, 0xc0, 0x29, /* :7a]...) */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x29, 0xc0, 0x34, 0x00, 0x0c, /* 10.).4.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x0f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x34 /* 4500w.4 */ -}; - -/* Frame (497 bytes) */ -static const unsigned char pkt53[497] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x1e, /* ..^..... */ -0x8f, 0xb1, 0x7a, 0xd4, 0x08, 0x00, 0x45, 0x00, /* ..z...E. */ -0x01, 0xe3, 0x67, 0xce, 0x00, 0x00, 0xff, 0x11, /* ..g..... */ -0xb0, 0x93, 0xc0, 0xa8, 0x00, 0x04, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0xcf, /* ........ */ -0x46, 0x4d, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FM...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x11, 0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, /* ......Ca */ -0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, /* nonMF450 */ -0x30, 0x77, 0xc0, 0x0c, 0x06, 0x72, 0x6f, 0x75, /* 0w...rou */ -0x74, 0x65, 0x72, 0xc0, 0x1a, 0x00, 0x01, 0x80, /* ter..... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, /* ....x... */ -0xa8, 0x00, 0x04, 0xc0, 0x2b, 0x00, 0x21, 0x80, /* ....+.!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x02, 0x03, 0xc0, 0x3a, 0xc0, /* ......:. */ -0x2b, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, /* +....... */ -0x94, 0x01, 0x56, 0x09, 0x74, 0x78, 0x74, 0x76, /* ..V.txtv */ -0x65, 0x72, 0x73, 0x3d, 0x31, 0x07, 0x72, 0x70, /* ers=1.rp */ -0x3d, 0x61, 0x75, 0x74, 0x6f, 0x05, 0x6e, 0x6f, /* =auto.no */ -0x74, 0x65, 0x3d, 0x08, 0x71, 0x74, 0x6f, 0x74, /* te=.qtot */ -0x61, 0x6c, 0x3d, 0x31, 0x0b, 0x70, 0x72, 0x69, /* al=1.pri */ -0x6f, 0x72, 0x69, 0x74, 0x79, 0x3d, 0x32, 0x30, /* ority=20 */ -0x11, 0x74, 0x79, 0x3d, 0x43, 0x61, 0x6e, 0x6f, /* .ty=Cano */ -0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x37, 0x30, /* n MF4570 */ -0x64, 0x77, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, /* dw.produ */ -0x63, 0x74, 0x3d, 0x28, 0x43, 0x61, 0x6e, 0x6f, /* ct=(Cano */ -0x6e, 0x20, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, /* n MF4500 */ -0x77, 0x29, 0x1c, 0x70, 0x64, 0x6c, 0x3d, 0x61, /* w).pdl=a */ -0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, /* pplicati */ -0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, /* on/octet */ -0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2a, /* -stream* */ -0x61, 0x64, 0x6d, 0x69, 0x6e, 0x75, 0x72, 0x6c, /* adminurl */ -0x3d, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, /* =http:// */ -0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x6c, /* router.l */ -0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x2f, 0x74, 0x5f, /* ocal./t_ */ -0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, /* welcom.c */ -0x67, 0x69, 0x0d, 0x75, 0x73, 0x62, 0x5f, 0x4d, /* gi.usb_M */ -0x46, 0x47, 0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, /* FG=Canon */ -0x27, 0x75, 0x73, 0x62, 0x5f, 0x4d, 0x44, 0x4c, /* 'usb_MDL */ -0x3d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x20, 0x4d, /* =Canon M */ -0x46, 0x34, 0x35, 0x30, 0x30, 0x77, 0x20, 0x53, /* F4500w S */ -0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x28, 0x55, /* eries (U */ -0x46, 0x52, 0x49, 0x49, 0x20, 0x4c, 0x54, 0x29, /* FRII LT) */ -0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, /* .transpa */ -0x72, 0x65, 0x6e, 0x74, 0x3d, 0x46, 0x08, 0x42, /* rent=F.B */ -0x69, 0x6e, 0x61, 0x72, 0x79, 0x3d, 0x46, 0x06, /* inary=F. */ -0x54, 0x42, 0x43, 0x50, 0x3d, 0x46, 0x07, 0x43, /* TBCP=F.C */ -0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x46, 0x08, 0x43, /* olor=F.C */ -0x6f, 0x70, 0x69, 0x65, 0x73, 0x3d, 0x54, 0x08, /* opies=T. */ -0x44, 0x75, 0x70, 0x6c, 0x65, 0x78, 0x3d, 0x54, /* Duplex=T */ -0x0d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x43, 0x75, /* .PaperCu */ -0x73, 0x74, 0x6f, 0x6d, 0x3d, 0x54, 0x06, 0x42, /* stom=T.B */ -0x69, 0x6e, 0x64, 0x3d, 0x46, 0x09, 0x43, 0x6f, /* ind=F.Co */ -0x6c, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x54, 0x06, /* llate=T. */ -0x53, 0x6f, 0x72, 0x74, 0x3d, 0x54, 0x08, 0x53, /* Sort=T.S */ -0x74, 0x61, 0x70, 0x6c, 0x65, 0x3d, 0x46, 0x07, /* taple=F. */ -0x50, 0x75, 0x6e, 0x63, 0x68, 0x3d, 0x46, 0x11, /* Punch=F. */ -0x50, 0x61, 0x70, 0x65, 0x72, 0x4d, 0x61, 0x78, /* PaperMax */ -0x3d, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x41, /* =legal-A */ -0x34 /* 4 */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt54[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x01, 0x5a, 0x45, 0xa1, 0x00, 0x00, 0xff, 0x11, /* .ZE..... */ -0xd2, 0xe3, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0x63, 0x18, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* c....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x00, 0x6a, 0x03, 0x31, 0x30, 0x36, /* ...j.106 */ -0x01, 0x30, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, /* .0.168.1 */ -0x39, 0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, /* 92.in-ad */ -0x64, 0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, /* dr.arpa. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, /* ........ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x01, 0x32, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .2.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x31, 0x01, 0x30, 0x01, 0x30, 0x01, 0x34, /* .1.0.0.4 */ -0x03, 0x69, 0x70, 0x36, 0xc0, 0x40, 0x00, 0x0c, /* .ip6.@.. */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x02, /* .....x.. */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0x70, /* .......p */ -0x49, 0x3f, 0x59, 0x89, 0x7e, 0xba, 0x01, 0x41, /* I?Y.~..A */ -0x01, 0x42, 0x01, 0x45, 0x01, 0x37, 0x01, 0x39, /* .B.E.7.9 */ -0x01, 0x38, 0x01, 0x39, 0x01, 0x35, 0x01, 0x46, /* .8.9.5.F */ -0x01, 0x33, 0x01, 0x39, 0x01, 0x34, 0x01, 0x30, /* .3.9.4.0 */ -0x01, 0x37, 0x01, 0x44, 0x01, 0x39, 0x01, 0x30, /* .7.D.9.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x30, 0x01, 0x30, 0x01, 0x30, 0x01, 0x30, /* .0.0.0.0 */ -0x01, 0x38, 0x01, 0x45, 0x01, 0x46, 0xc0, 0xae, /* .8.E.F.. */ -0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, /* ......./ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, /* .....x.. */ -0xc0, 0x0c, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08 /* ....@... */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt55[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x0a, 0x23, 0x00, 0x00, 0xff, 0x11, /* .~.#.... */ -0x08, 0x9e, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (106 bytes) */ -static const unsigned char pkt56[106] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x5c, 0x45, 0xa5, 0x00, 0x00, 0xff, 0x11, /* .\E..... */ -0xd3, 0xdd, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ -0x7b, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* {....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ -0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ -0xc0, 0x0c /* .. */ -}; - -/* Frame (106 bytes) */ -static const unsigned char pkt57[106] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x5c, 0x0a, 0x24, 0x00, 0x00, 0xff, 0x11, /* .\.$.... */ -0x08, 0xbf, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x48, /* .......H */ -0x75, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* u-...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ -0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ -0xc0, 0x0c /* .. */ -}; - -/* Frame (850 bytes) */ -static const unsigned char pkt58[850] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x03, 0x44, 0x45, 0xac, 0x00, 0x00, 0xff, 0x11, /* .DE..... */ -0xd0, 0xee, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ -0xfa, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* .n...... */ -0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ -0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ -0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ -0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ -0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ -0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ -0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ -0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ -0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ -0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ -0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ -0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ -0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ -0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x90, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x91, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, /* ........ */ -0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ -0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x91, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0c, 0x09, /* ........ */ -0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ -0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x31, 0x2e, /* ......1. */ -0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ -0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ -0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ -0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ -0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ -0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ -0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ -0x11, 0x91, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ -0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ -0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ -0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ -0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ -0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ -0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ -0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ -0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ -0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ -0x00, 0x11, 0x91, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ -0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ -0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ -0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ -0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ -0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1d, /* ........ */ -0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ -0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ -0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ -0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ -0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ -0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ -0x91, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ -0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ -0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ -0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ -0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, 0x0c, /* ........ */ -0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ -0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ -0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x92, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ -0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ -0xc0, 0x90 /* .. */ -}; - -/* Frame (850 bytes) */ -static const unsigned char pkt59[850] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x03, 0x44, 0x0a, 0x25, 0x00, 0x00, 0xff, 0x11, /* .D.%.... */ -0x05, 0xd6, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ -0xf3, 0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* ........ */ -0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ -0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ -0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ -0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ -0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ -0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ -0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ -0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ -0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ -0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ -0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ -0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ -0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ -0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x90, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x91, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, /* ........ */ -0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ -0x00, 0x11, 0x91, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x91, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0c, 0x09, /* ........ */ -0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ -0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x31, 0x2e, /* ......1. */ -0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ -0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ -0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ -0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ -0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ -0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ -0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ -0x11, 0x91, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ -0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ -0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ -0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ -0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ -0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ -0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ -0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ -0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ -0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ -0x00, 0x11, 0x91, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ -0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ -0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ -0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ -0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ -0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x1d, /* ........ */ -0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ -0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ -0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ -0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ -0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ -0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ -0x91, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ -0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ -0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ -0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ -0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, 0x0c, /* ........ */ -0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ -0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x0f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ -0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x92, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ -0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ -0xc0, 0x90 /* .. */ -}; - -/* Frame (850 bytes) */ -static const unsigned char pkt60[850] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x03, 0x44, 0x45, 0xd0, 0x00, 0x00, 0xff, 0x11, /* .DE..... */ -0xd0, 0xca, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ -0x81, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* ........ */ -0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ -0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ -0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ -0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ -0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ -0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ -0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ -0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ -0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ -0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ -0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ -0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ -0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ -0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x87, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x88, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, /* ........ */ -0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ -0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x88, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0c, 0x09, /* ........ */ -0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ -0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x31, 0x2e, /* ......1. */ -0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ -0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ -0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ -0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ -0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ -0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ -0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ -0x11, 0x88, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ -0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ -0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ -0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ -0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ -0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ -0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ -0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ -0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ -0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ -0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ -0x00, 0x11, 0x88, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ -0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ -0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ -0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ -0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ -0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1d, /* ........ */ -0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ -0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ -0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ -0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ -0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ -0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ -0x88, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ -0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ -0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ -0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ -0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ -0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, 0x0c, /* ........ */ -0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ -0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ -0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x89, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ -0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ -0xc0, 0x90 /* .. */ -}; - -/* Frame (850 bytes) */ -static const unsigned char pkt61[850] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x03, 0x44, 0x0a, 0x26, 0x00, 0x00, 0xff, 0x11, /* .D.&.... */ -0x05, 0xd5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x03, 0x30, /* .......0 */ -0x7b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, /* {....... */ -0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x73, 0x6d, 0x62, 0x04, 0x5f, 0x74, /* ._smb._t */ -0x63, 0x70, 0xc0, 0x23, 0x00, 0x0c, 0x00, 0x01, /* cp.#.... */ -0x0c, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x74, /* ._workst */ -0x61, 0x74, 0x69, 0x6f, 0x6e, 0xc0, 0x33, 0x00, /* ation.3. */ -0x0c, 0x00, 0x01, 0x0b, 0x5f, 0x75, 0x64, 0x69, /* ...._udi */ -0x73, 0x6b, 0x73, 0x2d, 0x73, 0x73, 0x68, 0xc0, /* sks-ssh. */ -0x33, 0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, /* 3....._h */ -0x74, 0x74, 0x70, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ttp.3... */ -0x01, 0x04, 0x5f, 0x72, 0x66, 0x62, 0xc0, 0x33, /* .._rfb.3 */ -0x00, 0x0c, 0x00, 0x01, 0x0f, 0x5f, 0x70, 0x64, /* ....._pd */ -0x6c, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, /* l-datast */ -0x72, 0x65, 0x61, 0x6d, 0xc0, 0x33, 0x00, 0x0c, /* ream.3.. */ -0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ -0x74, 0x65, 0x72, 0xc0, 0x33, 0x00, 0x0c, 0x00, /* ter.3... */ -0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x11, 0x87, 0x00, 0x02, 0xc0, 0x2e, 0xc0, /* ........ */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x88, 0x00, 0x02, 0xc0, 0x3e, 0xc0, 0x0c, 0x00, /* ....>... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x02, 0xc0, 0x51, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ..Q..... */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, /* ........ */ -0x63, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* c....... */ -0x00, 0x11, 0x88, 0x00, 0x02, 0xc0, 0x6f, 0xc0, /* ......o. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x88, 0x00, 0x02, 0xc0, 0x7a, 0xc0, 0x0c, 0x00, /* ....z... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x02, 0xc0, 0x90, 0xc0, 0x2e, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0c, 0x09, /* ........ */ -0x43, 0x68, 0x65, 0x6e, 0x62, 0x6f, 0x2d, 0x50, /* Chenbo-P */ -0x43, 0xc0, 0x2e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, /* C...>... */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x31, 0x2e, /* ......1. */ -0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x48, /* server-H */ -0x50, 0x2d, 0x5a, 0x32, 0x31, 0x30, 0x2d, 0x57, /* P-Z210-W */ -0x6f, 0x72, 0x6b, 0x73, 0x74, 0x61, 0x74, 0x69, /* orkstati */ -0x6f, 0x6e, 0x20, 0x5b, 0x65, 0x38, 0x3a, 0x33, /* on [e8:3 */ -0x39, 0x3a, 0x33, 0x35, 0x3a, 0x34, 0x34, 0x3a, /* 9:35:44: */ -0x66, 0x65, 0x3a, 0x64, 0x34, 0x5d, 0xc0, 0x3e, /* fe:d4].> */ -0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* .>...... */ -0x11, 0x88, 0x00, 0x2a, 0x27, 0x63, 0x61, 0x74, /* ...*'cat */ -0x72, 0x6f, 0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, /* ro-OptiP */ -0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, /* lex-3010 */ -0x20, 0x5b, 0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, /* [a4:1f: */ -0x37, 0x32, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x62, /* 72:53:9b */ -0x3a, 0x63, 0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, /* :c6].>.> */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ -0x00, 0x1f, 0x1c, 0x63, 0x61, 0x74, 0x72, 0x6f, /* ...catro */ -0x2d, 0x45, 0x4c, 0x20, 0x5b, 0x61, 0x34, 0x3a, /* -EL [a4: */ -0x31, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x33, /* 1f:72:53 */ -0x3a, 0x61, 0x30, 0x3a, 0x66, 0x37, 0x5d, 0xc0, /* :a0:f7]. */ -0x3e, 0xc0, 0x3e, 0x00, 0x0c, 0x00, 0x01, 0x00, /* >.>..... */ -0x00, 0x11, 0x88, 0x00, 0x27, 0x24, 0x64, 0x63, /* ....'$dc */ -0x2d, 0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, /* -OptiPle */ -0x78, 0x2d, 0x33, 0x30, 0x31, 0x30, 0x20, 0x5b, /* x-3010 [ */ -0x61, 0x34, 0x3a, 0x31, 0x66, 0x3a, 0x37, 0x32, /* a4:1f:72 */ -0x3a, 0x35, 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x61, /* :53:92:a */ -0x36, 0x5d, 0xc0, 0x3e, 0xc0, 0x3e, 0x00, 0x0c, /* 6].>.>.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x1d, /* ........ */ -0x1a, 0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20, /* .ubuntu */ -0x5b, 0x30, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x32, /* [00:0c:2 */ -0x39, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x65, 0x3a, /* 9:6a:2e: */ -0x37, 0x61, 0x5d, 0xc0, 0x3e, 0xc0, 0x51, 0x00, /* 7a].>.Q. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x16, 0x13, 0x63, 0x61, 0x74, 0x72, 0x6f, 0x2d, /* ..catro- */ -0x4f, 0x70, 0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, /* OptiPlex */ -0x2d, 0x33, 0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, /* -3010.Q. */ -0x51, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* Q....... */ -0x88, 0x00, 0x0b, 0x08, 0x63, 0x61, 0x74, 0x72, /* ....catr */ -0x6f, 0x2d, 0x45, 0x4c, 0xc0, 0x51, 0xc0, 0x51, /* o-EL.Q.Q */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ -0x00, 0x13, 0x10, 0x64, 0x63, 0x2d, 0x4f, 0x70, /* ...dc-Op */ -0x74, 0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, /* tiPlex-3 */ -0x30, 0x31, 0x30, 0xc0, 0x51, 0xc0, 0x63, 0x00, /* 010.Q.c. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, /* ........ */ -0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, 0x72, /* *'dc's r */ -0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, 0x65, /* emote de */ -0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x6e, /* sktop on */ -0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, 0x69, /* dc-Opti */ -0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, 0x31, /* Plex-301 */ -0x30, 0xc0, 0x63, 0xc0, 0x63, 0x00, 0x0c, 0x00, /* 0.c.c... */ -0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, 0x0c, /* ........ */ -0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, 0x34, /* CanonMF4 */ -0x35, 0x30, 0x30, 0x77, 0xc0, 0x63, 0xc0, 0x6f, /* 500w.c.o */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x88, /* ........ */ -0x00, 0x2a, 0x27, 0x64, 0x63, 0x27, 0x73, 0x20, /* .*'dc's */ -0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x64, /* remote d */ -0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x20, 0x6f, /* esktop o */ -0x6e, 0x20, 0x64, 0x63, 0x2d, 0x4f, 0x70, 0x74, /* n dc-Opt */ -0x69, 0x50, 0x6c, 0x65, 0x78, 0x2d, 0x33, 0x30, /* iPlex-30 */ -0x31, 0x30, 0xc0, 0x6f, 0xc0, 0x7a, 0x00, 0x0c, /* 10.o.z.. */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x88, 0x00, 0x0f, /* ........ */ -0x0c, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x4d, 0x46, /* .CanonMF */ -0x34, 0x35, 0x30, 0x30, 0x77, 0xc0, 0x7a, 0xc0, /* 4500w.z. */ -0x90, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x89, 0x00, 0x0f, 0x0c, 0x43, 0x61, 0x6e, 0x6f, /* ....Cano */ -0x6e, 0x4d, 0x46, 0x34, 0x35, 0x30, 0x30, 0x77, /* nMF4500w */ -0xc0, 0x90 /* .. */ -}; - diff --git a/test/regression/mdns_test/capture/query_and_response_chaos.pcapng b/test/regression/mdns_test/capture/query_and_response_chaos.pcapng deleted file mode 100644 index 3231ae0e..00000000 Binary files a/test/regression/mdns_test/capture/query_and_response_chaos.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_and_response_v6.c b/test/regression/mdns_test/capture/query_and_response_v6.c deleted file mode 100644 index 1c5add67..00000000 --- a/test/regression/mdns_test/capture/query_and_response_v6.c +++ /dev/null @@ -1,99 +0,0 @@ -/* Frame (96 bytes) */ -static const unsigned char pkt1[96] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0xec, 0x17, /* 33...... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x86, 0xdd, 0x60, 0x00, /* /.....`. */ -0x00, 0x00, 0x00, 0x2a, 0x11, 0xff, 0x20, 0x01, /* ...*.. . */ -0x0d, 0xb1, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x00, 0x2a, 0xb0, 0x29, 0x00, 0x00, /* ...*.).. */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (466 bytes) */ -static const unsigned char pkt2[466] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x9c, 0xa2, 0xa8, 0x00, 0x00, /* ........ */ -0x84, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x06, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, 0x41, /* ...d...A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, /* cal..ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, /* ....B.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, /* ...."..3 */ -0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* DW.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, /* ....x... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, /* l...@... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x0b, 0x41, 0x52, /* on=01.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (122 bytes) */ -static const unsigned char pkt3[122] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0xec, 0x17, /* 33...... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x86, 0xdd, 0x60, 0x00, /* /.....`. */ -0x00, 0x00, 0x00, 0x44, 0x11, 0xff, 0x20, 0x01, /* ...D.. . */ -0x0d, 0xb1, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x02, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x00, 0x44, 0x6e, 0x5c, 0x00, 0x00, /* ...Dn\.. */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ..._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x00, 0x64, 0x00, 0x0e, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0xc0, 0x0c /* .. */ -}; - diff --git a/test/regression/mdns_test/capture/query_and_response_v6.pcapng b/test/regression/mdns_test/capture/query_and_response_v6.pcapng deleted file mode 100644 index a43980a9..00000000 Binary files a/test/regression/mdns_test/capture/query_and_response_v6.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_during_probing_1.c b/test/regression/mdns_test/capture/query_during_probing_1.c deleted file mode 100644 index 272c4fbf..00000000 --- a/test/regression/mdns_test/capture/query_during_probing_1.c +++ /dev/null @@ -1,240 +0,0 @@ -/* Frame (226 bytes) */ -static const unsigned char pkt1[226] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xd4, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xda, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ -0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00 /* .. */ -}; - -/* Frame (226 bytes) */ -static const unsigned char pkt2[226] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xd4, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xd9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ -0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00 /* .. */ -}; - -/* Frame (226 bytes) */ -static const unsigned char pkt3[226] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xd4, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xd8, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc0, /* ........ */ -0x6d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* m....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x04, 0x74, 0x65, /* ......te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* .test._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, /* ..test._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00 /* .. */ -}; - -/* Frame (338 bytes) */ -static const unsigned char pkt4[338] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x44, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ -0x8f, 0x67, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .g...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ -0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (338 bytes) */ -static const unsigned char pkt5[338] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x44, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ -0x8f, 0x66, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .f...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ -0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (338 bytes) */ -static const unsigned char pkt6[338] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x44, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .D..@... */ -0x8f, 0x65, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .e...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x30, /* .......0 */ -0x12, 0x57, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .W...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x04, 0x74, 0x65, 0x73, 0x74, 0x04, /* .@.test. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x04, 0x5f, 0x69, 0x70, /* d...._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x16, 0x04, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - diff --git a/test/regression/mdns_test/capture/query_during_probing_1.pcapng b/test/regression/mdns_test/capture/query_during_probing_1.pcapng deleted file mode 100644 index d2f41774..00000000 Binary files a/test/regression/mdns_test/capture/query_during_probing_1.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_during_probing_2.c b/test/regression/mdns_test/capture/query_during_probing_2.c deleted file mode 100644 index ae03bb09..00000000 --- a/test/regression/mdns_test/capture/query_during_probing_2.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Frame (86 bytes) */ -static const unsigned char pkt1[86] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x48, 0x00, 0xf6, 0x00, 0x00, 0xff, 0x11, /* .H...... */ -0x12, 0x01, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x34, /* .......4 */ -0x9a, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .e...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01, /* cal..!.. */ -0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01 /* ...... */ -}; - -/* Frame (289 bytes) */ -static const unsigned char pkt2[289] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x13, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x95, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xff, /* ........ */ -0x12, 0xde, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, /* test._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* B.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, /* ...x...A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x40, 0x04, 0x74, 0x65, 0x73, /* ...@.tes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1d, 0x04, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40 /* @ */ -}; - diff --git a/test/regression/mdns_test/capture/query_during_probing_2.pcapng b/test/regression/mdns_test/capture/query_during_probing_2.pcapng deleted file mode 100644 index 3dcc9558..00000000 Binary files a/test/regression/mdns_test/capture/query_during_probing_2.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_rr_a.c b/test/regression/mdns_test/capture/query_rr_a.c deleted file mode 100644 index fae6bf8f..00000000 --- a/test/regression/mdns_test/capture/query_rr_a.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Frame (77 bytes) */ -static const unsigned char pkt1[77] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x3f, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* .?..@... */ -0x90, 0x92, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ -0x51, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Qo...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ -}; - -/* Frame (77 bytes) */ -static const unsigned char pkt2[77] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x3f, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .?..@... */ -0x90, 0x91, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ -0x51, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Qo...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ -}; - -/* Frame (77 bytes) */ -static const unsigned char pkt3[77] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x3f, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .?..@... */ -0x90, 0x90, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ -0x51, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Qo...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ -}; - diff --git a/test/regression/mdns_test/capture/query_rr_a.pcapng b/test/regression/mdns_test/capture/query_rr_a.pcapng deleted file mode 100644 index 218922e0..00000000 Binary files a/test/regression/mdns_test/capture/query_rr_a.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_rr_timeout.c b/test/regression/mdns_test/capture/query_rr_timeout.c deleted file mode 100644 index d5146e29..00000000 --- a/test/regression/mdns_test/capture/query_rr_timeout.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Frame (108 bytes) */ -static const unsigned char pkt1[108] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x5e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .^..@... */ -0x90, 0x4a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .J...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4a, /* .......J */ -0x1e, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, /* ocal..!. */ -0x01, 0x04, 0x74, 0x65, 0x73, 0x74, 0x05, 0x5f, /* ..test._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x00, 0x01 /* .... */ -}; - -/* Frame (171 bytes) */ -static const unsigned char pkt2[171] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x9d, 0x02, 0xa0, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0x10, 0x02, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ -0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ -0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ -0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ -0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ -0x80, 0x00, 0x40 /* ..@ */ -}; - -/* Frame (81 bytes) */ -static const unsigned char pkt3[81] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x43, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* .C..@... */ -0x90, 0x64, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .d...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2f, /* ......./ */ -0x0d, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, /* ocal..!. */ -0x01 /* . */ -}; - -/* Frame (158 bytes) */ -static const unsigned char pkt4[158] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x90, 0x02, 0xa1, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0x10, 0x0e, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ -0xa0, 0x5c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .\...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ -0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ -0xc0, 0x33, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* .3...... */ -0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x07, 0x0a, /* .x...... */ -0xc0, 0x33, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* .3./.... */ -0x00, 0x78, 0x00, 0x05, 0xc0, 0x33, 0x00, 0x01, /* .x...3.. */ -0x40, 0xc0, 0x0c, 0x00, 0x2f, 0x80, 0x01, 0x00, /* @.../... */ -0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, 0x0c, 0x00, /* ..x..... */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - diff --git a/test/regression/mdns_test/capture/query_rr_timeout.pcapng b/test/regression/mdns_test/capture/query_rr_timeout.pcapng deleted file mode 100644 index 428723a5..00000000 Binary files a/test/regression/mdns_test/capture/query_rr_timeout.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_start_stop.c b/test/regression/mdns_test/capture/query_start_stop.c deleted file mode 100644 index 14823a6e..00000000 --- a/test/regression/mdns_test/capture/query_start_stop.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Frame (90 bytes) */ -static const unsigned char pkt1[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x4c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .L..@... */ -0x90, 0x5c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .\...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x46, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* F....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01 /* .. */ -}; - -/* Frame (199 bytes) */ -static const unsigned char pkt2[199] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0xb9, 0x1d, 0xbb, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0xf4, 0xca, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xa5, /* ........ */ -0x3b, 0x23, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ;#...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x07, /* ........ */ -0x04, 0x74, 0x65, 0x73, 0x74, 0xc0, 0x1a, 0x08, /* .test... */ -0x43, 0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, /* Catro-PC */ -0xc0, 0x25, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* .%...... */ -0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, 0x07, 0x0a, /* .x...... */ -0xc0, 0x36, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .6.!.... */ -0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0xc0, 0x3d, 0xc0, 0x36, 0x00, 0x10, /* .P.=.6.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00, 0xc0, 0x3d, 0x00, 0x2f, 0x80, 0x01, 0x00, /* ..=./... */ -0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, 0x3d, 0x00, /* ..x...=. */ -0x01, 0x40, 0xc0, 0x36, 0x00, 0x2f, 0x80, 0x01, /* .@.6./.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x09, 0xc0, 0x36, /* ...x...6 */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* ......@ */ -}; - -/* Frame (155 bytes) */ -static const unsigned char pkt3[155] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x8d, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x1a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x79, /* .......y */ -0xd4, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .~...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x73, 0x75, 0x62, 0x05, 0x5f, 0x68, 0x74, /* _sub._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* ..._prin */ -0x74, 0x65, 0x72, 0x04, 0x5f, 0x73, 0x75, 0x62, /* ter._sub */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x93, 0x00, 0x17, 0x04, 0x74, 0x65, 0x73, /* .....tes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00 /* al. */ -}; - -/* Frame (81 bytes) */ -static const unsigned char pkt4[81] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x43, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* .C..@... */ -0x90, 0x63, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .c...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2f, /* ......./ */ -0x2f, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* /....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01 /* . */ -}; - -/* Frame (171 bytes) */ -static const unsigned char pkt5[171] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x9d, 0x1d, 0xbc, 0x00, 0x00, 0xff, 0x11, /* ........ */ -0xf4, 0xe5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x89, /* ........ */ -0x2c, 0xb0, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ,....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x11, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x43, 0x61, /* ....P.Ca */ -0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0xc0, 0x1c, /* tro-PC.. */ -0xc0, 0x0c, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x33, 0x00, /* ......3. */ -0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x04, 0xc0, 0xa8, 0x07, 0x0a, 0xc0, 0x33, 0x00, /* ......3. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x05, 0xc0, 0x33, 0x00, 0x01, 0x40, 0xc0, 0x0c, /* ..3..@.. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x09, 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x00, /* ........ */ -0x80, 0x00, 0x40 /* ..@ */ -}; - diff --git a/test/regression/mdns_test/capture/query_start_stop.pcapng b/test/regression/mdns_test/capture/query_start_stop.pcapng deleted file mode 100644 index 78975aa4..00000000 Binary files a/test/regression/mdns_test/capture/query_start_stop.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/query_with_tc.c b/test/regression/mdns_test/capture/query_with_tc.c deleted file mode 100644 index 0b1a5aea..00000000 --- a/test/regression/mdns_test/capture/query_with_tc.c +++ /dev/null @@ -1,658 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x3e, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0x90, 0x6a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .j...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0xe3, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (1437 bytes) */ -static const unsigned char pkt2[1437] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x05, 0x8f, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8b, 0x61, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .a...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x7b, /* .......{ */ -0x26, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* &....... */ -0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* .,....._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x31, 0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, /* .1.01 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, 0x80, /* s...(... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, /* .P.ubunt */ -0x75, 0xc0, 0x17, 0xc0, 0x78, 0x00, 0x1c, 0x80, /* u...x... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, /* ....x... */ -0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, 0x8d, 0xc0, /* .)...... */ -0x78, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* x....... */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x01, 0xc0, /* x....... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x31, 0x2e, 0x31, 0x36, 0x20, 0x53, /* ..1.16 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0xc0, 0x0c, 0xc0, 0xb9, 0x00, 0x10, /* ts...... */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00, 0xc0, 0xb9, 0x00, 0x21, 0x80, 0x01, 0x00, /* ....!... */ -0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x31, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, 0x6d, /* 1.15 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0xc0, 0x0c, 0xc1, 0x17, 0x00, 0x10, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc1, /* ........ */ -0x17, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ -0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ -0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ -0xc1, 0x75, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* .u...... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc1, 0x75, 0x00, /* ......u. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ -0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ -0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ -0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x38, /* ....1.08 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc1, 0xd3, /* kets.... */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x01, 0x00, 0xc1, 0xd3, 0x00, 0x21, 0x80, /* ......!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x31, 0x2e, 0x31, 0x34, 0x20, 0x53, /* ..1.14 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0xc0, 0x0c, 0xc2, 0x31, 0x00, 0x10, /* ts...1.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00, 0xc2, 0x31, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..1.!... */ -0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x31, 0x2e, 0x31, 0x32, 0x20, 0x53, 0x69, 0x6d, /* 1.12 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0xc0, 0x0c, 0xc2, 0x8f, 0x00, 0x10, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc2, /* ........ */ -0x8f, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ -0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ -0x31, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 11 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ -0xc2, 0xed, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc2, 0xed, 0x00, /* ........ */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ -0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ -0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ -0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x39, /* ....1.09 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc3, 0x4b, /* kets...K */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x01, 0x00, 0xc3, 0x4b, 0x00, 0x21, 0x80, /* ....K.!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x31, 0x2e, 0x31, 0x30, 0x20, 0x53, /* ..1.10 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0xc0, 0x0c, 0xc3, 0xa9, 0x00, 0x10, /* ts...... */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00, 0xc3, 0xa9, 0x00, 0x21, 0x80, 0x01, 0x00, /* ....!... */ -0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, /* ..P.x... */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x31, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, 0x6d, /* 1.07 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0xc0, 0x0c, 0xc4, 0x07, 0x00, 0x10, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, 0xc4, /* ........ */ -0x07, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x78, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* x....... */ -0x50, 0xc0, 0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* P.x..... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ -0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ -0xc4, 0x65, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* .e...... */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc4, 0x65, 0x00, /* ......e. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ -0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ -0x78, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* x....... */ -0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, 0x30, 0x36, /* ....1.06 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, 0xc4, 0xc3, /* kets.... */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x01, 0x00, 0xc4, 0xc3, 0x00, 0x21, 0x80, /* ......!. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x08, 0x00, /* ....x... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, 0x78, 0xc0, /* ....P.x. */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x31, 0x2e, 0x30, 0x34, 0x20, 0x53, /* ..1.04 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0xc0, 0x0c, 0xc5, 0x21, 0x00, 0x10, /* ts...!.. */ -0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, /* ........ */ -0x00, 0xc5, 0x21, 0x00, 0x21, 0x80, 0x01, 0x00, /* ..!.!... */ -0x00, 0x00, 0x78, 0x00, 0x08, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x00, 0x50, 0xc0, 0x78 /* ..P.x */ -}; - -/* Frame (265 bytes) */ -static const unsigned char pkt3[265] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0xfb, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xf5, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xe7, /* ........ */ -0x83, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, /* ........ */ -0x00, 0x31, 0x2e, 0x30, 0x32, 0x20, 0x53, 0x69, /* .1.02 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0xc0, 0x0c, 0xc0, 0x28, 0x00, 0x10, 0x80, /* s...(... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x01, 0x00, /* ........ */ -0xc0, 0x28, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* .(.!.... */ -0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, /* .x...... */ -0x00, 0x50, 0x06, 0x75, 0x62, 0x75, 0x6e, 0x74, /* .P.ubunt */ -0x75, 0xc0, 0x17, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* u....... */ -0x01, 0x00, 0x00, 0x11, 0x94, 0x00, 0x31, 0x2e, /* ......1. */ -0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, 0x0c, /* ackets.. */ -0xc0, 0x8d, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x01, 0x00, 0xc0, 0x8d, 0x00, /* ........ */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* !.....x. */ -0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xc0, /* ......P. */ -0x78 /* x */ -}; - -/* Frame (1471 bytes) */ -static const unsigned char pkt4[1471] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xb1, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xf6, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ -0xd6, 0x19, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ -0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ -0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ -0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ -0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ -0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ -0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ -0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ -0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ -0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ -0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ -0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ -0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ -0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ -0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x93, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, /* .......A */ -0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ -0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ -0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ -0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ -0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, /* ......A. */ -0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ -0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ -0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ -0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, 0x00, /* ........ */ -0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x93, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ -0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ -0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ -0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ -0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (147 bytes) */ -static const unsigned char pkt5[147] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x85, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x21, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .!...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ -0xae, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x93, /* ........ */ -0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00 /* al. */ -}; - -/* Frame (1471 bytes) */ -static const unsigned char pkt6[1471] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xb1, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xf4, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0x9d, /* ........ */ -0xe4, 0x29, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, /* .)...... */ -0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, /* .......A */ -0x2e, 0x30, 0x31, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .01 Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ -0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ -0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ -0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, 0x36, /* ....A.16 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x41, 0x2e, 0x31, 0x35, 0x20, 0x53, 0x69, /* .A.15 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, /* ......A. */ -0x31, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 13 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, 0x38, 0x20, /* ...A.08 */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ -0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ -0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ -0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x41, 0x2e, 0x31, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.14 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, /* .....A.1 */ -0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ -0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ -0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ -0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x91, 0x00, 0x41, 0x2e, 0x31, 0x31, 0x20, 0x53, /* ..A.11 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, /* cal.._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, /* local... */ -0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, /* .......A */ -0x2e, 0x30, 0x39, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .09 Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ -0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ -0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ -0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, /* Packets. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* .._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x31, 0x30, /* ....A.10 */ -0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, /* Simple */ -0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, /* Web Serv */ -0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, /* er Test */ -0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, /* For Mult */ -0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, /* iple Pac */ -0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, /* kets._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, /* local.._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x41, 0x2e, 0x30, 0x37, 0x20, 0x53, 0x69, /* .A.07 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, /* al.._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, /* ......A. */ -0x30, 0x35, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 05 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, 0x36, 0x20, /* ...A.06 */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, /* r Test F */ -0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, /* or Multi */ -0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, /* ple Pack */ -0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ets._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x5f, 0x68, /* ocal.._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, 0x00, /* ........ */ -0x41, 0x2e, 0x30, 0x34, 0x20, 0x53, 0x69, 0x6d, /* A.04 Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, /* Server T */ -0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, /* est For */ -0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, /* Multiple */ -0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, /* Packets */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* l.._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x91, 0x00, 0x41, 0x2e, 0x30, /* .....A.0 */ -0x32, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* 2 Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, /* ver Test */ -0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, 0x6c, /* For Mul */ -0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, 0x61, /* tiple Pa */ -0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, 0x68, /* ckets._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* .local. */ -}; - -/* Frame (147 bytes) */ -static const unsigned char pkt7[147] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x85, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x1f, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x71, /* .......q */ -0xae, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* . ...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x91, /* ........ */ -0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00 /* al. */ -}; - diff --git a/test/regression/mdns_test/capture/query_with_tc.pcapng b/test/regression/mdns_test/capture/query_with_tc.pcapng deleted file mode 100644 index 0aaa1c21..00000000 Binary files a/test/regression/mdns_test/capture/query_with_tc.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/responder_cooperating.c b/test/regression/mdns_test/capture/responder_cooperating.c deleted file mode 100644 index efaf70d8..00000000 --- a/test/regression/mdns_test/capture/responder_cooperating.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Frame (88 bytes) */ -static const unsigned char pkt1[88] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4a, 0x09, 0xaa, 0x00, 0x00, 0xff, 0x11, /* .J...... */ -0x09, 0x4b, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .K...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x36, /* .......6 */ -0xf6, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* cal..... */ -}; - -/* Frame (112 bytes) */ -static const unsigned char pkt2[112] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x62, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .b..@... */ -0x90, 0x46, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .F...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4e, /* .......N */ -0x17, 0xa6, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - -/* Frame (113 bytes) */ -static const unsigned char pkt3[113] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x63, 0x09, 0xab, 0x00, 0x00, 0xff, 0x11, /* .c...... */ -0x09, 0x31, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .1...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4f, /* .......O */ -0x36, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 64...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* ........ */ -0x11, 0x94, 0x00, 0x0d, 0x05, 0x5f, 0x68, 0x74, /* ....._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, /* tp._tcp. */ -0x23 /* # */ -}; - diff --git a/test/regression/mdns_test/capture/responder_cooperating.pcapng b/test/regression/mdns_test/capture/responder_cooperating.pcapng deleted file mode 100644 index 4b814d29..00000000 Binary files a/test/regression/mdns_test/capture/responder_cooperating.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/responder_cooperating_2.c b/test/regression/mdns_test/capture/responder_cooperating_2.c deleted file mode 100644 index f9f41260..00000000 --- a/test/regression/mdns_test/capture/responder_cooperating_2.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Frame (87 bytes) */ -static const unsigned char pkt1[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x49, 0x0a, 0x5b, 0x00, 0x00, 0xff, 0x11, /* .I.[.... */ -0x08, 0x9b, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0xd3, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01 /* al..!.. */ -}; - -/* Frame (277 bytes) */ -static const unsigned char pkt2[277] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x07, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xa1, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xf3, /* ........ */ -0x9d, 0x88, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x78, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..x..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x24, 0x0b, 0x41, 0x52, /* ..x.$.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* @.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ -0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .B.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, /* ....x... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x40 /* l...@ */ -}; - diff --git a/test/regression/mdns_test/capture/responder_cooperating_2.pcapng b/test/regression/mdns_test/capture/responder_cooperating_2.pcapng deleted file mode 100644 index 808b3344..00000000 Binary files a/test/regression/mdns_test/capture/responder_cooperating_2.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_a.c b/test/regression/mdns_test/capture/response_a.c deleted file mode 100644 index 3338061c..00000000 --- a/test/regression/mdns_test/capture/response_a.c +++ /dev/null @@ -1,99 +0,0 @@ -/* Frame (110 bytes) */ -static const unsigned char pkt1[110] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x60, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .`..@... */ -0x90, 0x70, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .p...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......L */ -0xd6, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* ...... */ -}; - -/* Frame (110 bytes) */ -static const unsigned char pkt2[110] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x60, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .`..@... */ -0x90, 0x6f, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .o...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......L */ -0xd6, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* ...... */ -}; - -/* Frame (110 bytes) */ -static const unsigned char pkt3[110] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x60, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .`..@... */ -0x90, 0x6e, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .n...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x4c, /* .......L */ -0xd6, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* ...... */ -}; - -/* Frame (87 bytes) */ -static const unsigned char pkt4[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x49, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ -0x90, 0x84, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0x9d, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ -}; - -/* Frame (87 bytes) */ -static const unsigned char pkt5[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x49, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ -0x90, 0x83, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0x9d, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ -}; - -/* Frame (87 bytes) */ -static const unsigned char pkt6[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x49, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ -0x90, 0x82, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0x9d, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ -}; - diff --git a/test/regression/mdns_test/capture/response_a.pcapng b/test/regression/mdns_test/capture/response_a.pcapng deleted file mode 100644 index 86a96f79..00000000 Binary files a/test/regression/mdns_test/capture/response_a.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_aggregation.c b/test/regression/mdns_test/capture/response_aggregation.c deleted file mode 100644 index 2d235909..00000000 --- a/test/regression/mdns_test/capture/response_aggregation.c +++ /dev/null @@ -1,182 +0,0 @@ -/* Frame (140 bytes) */ -static const unsigned char pkt1[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x01, 0x4c, 0x00, 0x00, 0xff, 0x11, /* .~.L.... */ -0x11, 0x75, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* .u...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (79 bytes) */ -static const unsigned char pkt2[79] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x41, 0x01, 0x4d, 0x00, 0x00, 0xff, 0x11, /* .A.M.... */ -0x11, 0xb1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ -0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ -}; - -/* Frame (79 bytes) */ -static const unsigned char pkt3[79] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x41, 0x01, 0x4e, 0x00, 0x00, 0xff, 0x11, /* .A.N.... */ -0x11, 0xb0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2d, /* .......- */ -0xbe, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .H...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01 /* al..... */ -}; - -/* Frame (75 bytes) */ -static const unsigned char pkt4[75] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x3d, 0x01, 0x4f, 0x00, 0x00, 0xff, 0x11, /* .=.O.... */ -0x11, 0xb3, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ -0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (632 bytes) */ -static const unsigned char pkt5[632] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x02, 0x6a, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .j..@... */ -0x8e, 0x3e, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .>...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x56, /* .......V */ -0x66, 0x0b, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* f....... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x21, 0x0b, 0x41, 0x52, /* ..d.!.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* t._print */ -0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* er._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x1d, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, /* STest._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x08, 0x5f, /* NSTest._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, /* st._prin */ -0x74, 0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ter._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x08, 0x5f, /* NSTest._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x28, 0x0b, 0x41, 0x52, /* ..x.(.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x08, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, /* t._print */ -0x65, 0x72, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* er._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x0b, 0x41, 0x52, /* ....@.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x0b, 0x41, 0x52, /* .d....AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x24, 0x0b, 0x41, 0x52, 0x4d, /* .x.$.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .......@ */ -}; - -/* Frame (101 bytes) */ -static const unsigned char pkt6[101] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x57, 0x01, 0x50, 0x00, 0x00, 0xff, 0x11, /* .W.P.... */ -0x11, 0x98, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x43, /* .......C */ -0x10, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, 0x0b, /* ....d... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0xc0, 0x0c /* est.. */ -}; - -/* Frame (105 bytes) */ -static const unsigned char pkt7[105] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x5b, 0x01, 0x51, 0x00, 0x00, 0xff, 0x11, /* .[.Q.... */ -0x11, 0x93, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x47, /* .......G */ -0x26, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &....... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x5f, /* ......._ */ -0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x04, /* printer. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0xc0, /* al...... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x63, 0x00, 0x0e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* c...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0xc0, /* DNSTest. */ -0x0c /* . */ -}; - diff --git a/test/regression/mdns_test/capture/response_aggregation.pcapng b/test/regression/mdns_test/capture/response_aggregation.pcapng deleted file mode 100644 index a22ca99e..00000000 Binary files a/test/regression/mdns_test/capture/response_aggregation.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_in_multiple_packets.c b/test/regression/mdns_test/capture/response_in_multiple_packets.c deleted file mode 100644 index c59b4397..00000000 --- a/test/regression/mdns_test/capture/response_in_multiple_packets.c +++ /dev/null @@ -1,470 +0,0 @@ -/* Frame (75 bytes) */ -static const unsigned char pkt1[75] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x3d, 0x06, 0x3f, 0x00, 0x00, 0xff, 0x11, /* .=.?.... */ -0x0c, 0xc3, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ -0xa9, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .&...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (1497 bytes) */ -static const unsigned char pkt2[1497] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xcb, 0x00, 0x1d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xc7, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xb7, /* ........ */ -0x44, 0x6c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* Dl...... */ -0x00, 0x0e, 0x00, 0x00, 0x00, 0x0f, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, /* ..test1. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* l.._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ -0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st3._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, /* test4._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x17, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* l.._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x17, 0x05, 0x74, 0x65, /* ..d...te */ -0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st7._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x17, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x17, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, /* ..test9. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, /* al.._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, 0x74, /* ...d...t */ -0x65, 0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, /* est11._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, /* local.._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x18, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* ..test12 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x18, 0x06, 0x74, 0x65, 0x73, /* .d...tes */ -0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t13._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x04, 0x5f, 0x69, 0x70, /* cal.._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x06, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, /* ..x...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st1._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x05, /* ...d.... */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, 0x69, /* test1._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, /* .....x.. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x04, 0x5f, /* .test1._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, /* .....@.t */ -0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, 0x69, 0x70, /* est2._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x04, 0x5f, /* .test2._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x01, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, /* ...test2 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, /* x...test */ -0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 2._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x33, 0x04, /* @.test3. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 3._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, /* .d....te */ -0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st3._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, /* ...x...t */ -0x65, 0x73, 0x74, 0x33, 0x04, 0x5f, 0x69, 0x70, /* est3._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, 0x73, /* ...@.tes */ -0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t4._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, 0x69, 0x70, /* est4._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, 0x5f, /* .test4._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x34, 0x04, /* ..test4. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, /* test5._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00 /* . */ -}; - -/* Frame (1490 bytes) */ -static const unsigned char pkt3[1490] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x05, 0xc4, 0x00, 0x1e, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8a, 0xcd, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x05, 0xb0, /* ........ */ -0x12, 0x0c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x05, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, 0x69, 0x70, /* est5._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, /* ocal..!. */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, /* ....d... */ -0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, /* ....P.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, 0x5f, /* .test5._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x35, 0x04, /* ..test5. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x05, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x36, 0x04, 0x5f, 0x69, /* test6._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x36, 0x04, /* ..test6. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x01, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, /* ....test */ -0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 6._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, /* .x...tes */ -0x74, 0x36, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t6._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40, 0x05, 0x74, 0x65, 0x73, 0x74, 0x37, /* .@.test7 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t7._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x05, 0x74, /* ..d....t */ -0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, 0x70, /* est7._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, /* ....x... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0x04, 0x5f, 0x69, /* test7._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, /* local... */ -0x00, 0x00, 0x80, 0x00, 0x40, 0x05, 0x74, 0x65, /* ....@.te */ -0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st8._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x05, /* .local.. */ -0x74, 0x65, 0x73, 0x74, 0x38, 0x04, 0x5f, 0x69, /* test8._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, 0x04, /* ..test8. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1e, 0x05, 0x74, 0x65, 0x73, 0x74, 0x38, /* ...test8 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ -0x05, 0x74, 0x65, 0x73, 0x74, 0x39, 0x04, 0x5f, /* .test9._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x05, 0x74, 0x65, 0x73, 0x74, 0x39, /* l..test9 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x01, 0x00, 0x05, 0x74, 0x65, 0x73, /* d....tes */ -0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* t9._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x1e, 0x05, 0x74, 0x65, /* ..x...te */ -0x73, 0x74, 0x39, 0x04, 0x5f, 0x69, 0x70, 0x70, /* st9._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, /* cal..... */ -0x80, 0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, /* ..@.test */ -0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, /* local..t */ -0x65, 0x73, 0x74, 0x31, 0x30, 0x04, 0x5f, 0x69, /* est10._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x30, /* ..test10 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, /* x...test */ -0x31, 0x30, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 10._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* .@.test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, /* ocal..te */ -0x73, 0x74, 0x31, 0x31, 0x04, 0x5f, 0x69, 0x70, /* st11._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, /* ....d... */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, 0x04, /* .test11. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x31, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* 1._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, /* l....... */ -0x40, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* @.test12 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, /* ..!..... */ -0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, /* d....... */ -0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* P.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, /* cal..tes */ -0x74, 0x31, 0x32, 0x04, 0x5f, 0x69, 0x70, 0x70, /* t12._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, /* ...d.... */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x32, 0x04, 0x5f, /* test12._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32, /* ..test12 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, /* .......@ */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x06, 0x74, 0x65, 0x73, 0x74, /* al..test */ -0x31, 0x33, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 13._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x06, 0x74, /* ..d....t */ -0x65, 0x73, 0x74, 0x31, 0x33, 0x04, 0x5f, 0x69, /* est13._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, /* local../ */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x1f, /* .....x.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x33, 0x04, /* .test13. */ -0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, /* _ipp._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x05, 0x00, 0x00, 0x80, 0x00, 0x40, 0x06, /* ......@. */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, /* test14._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00 /* l. */ -}; - -/* Frame (154 bytes) */ -static const unsigned char pkt4[154] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x8c, 0x00, 0x1f, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x04, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x78, /* .......x */ -0xef, 0x93, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x74, /* .......t */ -0x65, 0x73, 0x74, 0x31, 0x34, 0x04, 0x5f, 0x69, /* est14._i */ -0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* pp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, /* .....d.. */ -0x00, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x34, /* ..test14 */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, /* ../..... */ -0x78, 0x00, 0x1f, 0x06, 0x74, 0x65, 0x73, 0x74, /* x...test */ -0x31, 0x34, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 14._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (360 bytes) */ -static const unsigned char pkt5[360] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x01, 0x5a, 0x06, 0x40, 0x00, 0x00, 0xff, 0x11, /* .Z.@.... */ -0x0b, 0xa5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x46, /* .......F */ -0x9e, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .#...... */ -0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* ........ */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x31, 0xc0, 0x0c, 0xc0, /* test1... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x32, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 2....... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x33, 0xc0, 0x0c, 0xc0, /* test3... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x34, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 4....... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x35, 0xc0, 0x0c, 0xc0, /* test5... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x36, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 6....... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x37, 0xc0, 0x0c, 0xc0, /* test7... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x38, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 8....... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x08, 0x05, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x39, 0xc0, 0x0c, 0xc0, /* test9... */ -0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x09, 0x06, 0x74, 0x65, 0x73, 0x74, /* d...test */ -0x31, 0x30, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, /* 10...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x09, /* .....d.. */ -0x06, 0x74, 0x65, 0x73, 0x74, 0x31, 0x31, 0xc0, /* .test11. */ -0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, 0x01, 0x00, /* ........ */ -0x00, 0x00, 0x64, 0x00, 0x09, 0x06, 0x74, 0x65, /* ..d...te */ -0x73, 0x74, 0x31, 0x32, 0xc0, 0x0c, 0xc0, 0x0c, /* st12.... */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x09, 0x06, 0x74, 0x65, 0x73, 0x74, 0x31, /* ...test1 */ -0x33, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x0c, 0x00, /* 3....... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x09, 0x06, /* ....d... */ -0x74, 0x65, 0x73, 0x74, 0x31, 0x34, 0xc0, 0x0c /* test14.. */ -}; - diff --git a/test/regression/mdns_test/capture/response_in_multiple_packets.pcapng b/test/regression/mdns_test/capture/response_in_multiple_packets.pcapng deleted file mode 100644 index 142ad0b7..00000000 Binary files a/test/regression/mdns_test/capture/response_in_multiple_packets.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_interval.c b/test/regression/mdns_test/capture/response_interval.c deleted file mode 100644 index da6c3385..00000000 --- a/test/regression/mdns_test/capture/response_interval.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x3e, 0x01, 0x16, 0x00, 0x00, 0xff, 0x11, /* .>...... */ -0x11, 0xeb, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0x26, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* &/...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt2[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x28, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .(...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0xbf, 0xcd, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* B.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, /* cal../.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, /* ...x...A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, /* ...@.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x14, 0x08, 0x70, 0x61, /* ..d...pa */ -0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ -0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ -0x31, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* 1.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (102 bytes) */ -static const unsigned char pkt3[102] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x58, 0x01, 0x17, 0x00, 0x00, 0xff, 0x11, /* .X...... */ -0x11, 0xd0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x44, /* .......D */ -0xe4, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .a...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0e, /* .....d.. */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0xc0, 0x0c /* Test.. */ -}; - diff --git a/test/regression/mdns_test/capture/response_interval.pcapng b/test/regression/mdns_test/capture/response_interval.pcapng deleted file mode 100644 index 9c60b1cf..00000000 Binary files a/test/regression/mdns_test/capture/response_interval.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_interval_2.c b/test/regression/mdns_test/capture/response_interval_2.c deleted file mode 100644 index 01f3f0ae..00000000 --- a/test/regression/mdns_test/capture/response_interval_2.c +++ /dev/null @@ -1,520 +0,0 @@ -/* Frame (269 bytes) */ -static const unsigned char pkt1[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt2[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt3[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt4[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt5[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt6[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt7[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x01, 0x25, 0x00, 0x00, 0xff, 0x11, /* .E.%.... */ -0x11, 0xd5, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (90 bytes) */ -static const unsigned char pkt8[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4c, 0x01, 0x26, 0x00, 0x00, 0xff, 0x11, /* .L.&.... */ -0x11, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x9b, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .p...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x80, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x07, 0x0a /* .. */ -}; - -/* Frame (90 bytes) */ -static const unsigned char pkt9[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4c, 0x01, 0x27, 0x00, 0x00, 0xff, 0x11, /* .L.'.... */ -0x11, 0xcc, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x07, 0x0a /* .. */ -}; - -/* Frame (90 bytes) */ -static const unsigned char pkt10[90] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x4c, 0x01, 0x28, 0x00, 0x00, 0xff, 0x11, /* .L.(.... */ -0x11, 0xcb, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x38, /* .......8 */ -0x1b, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .q...... */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, /* local... */ -0x00, 0x01, 0xc0, 0x0c, 0x00, 0x01, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0xc0, 0xa8, /* ...x.... */ -0x07, 0x0a /* .. */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt11[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x01, 0x29, 0x00, 0x00, 0xff, 0x11, /* .~.).... */ -0x11, 0x98, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt12[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x01, 0x2a, 0x00, 0x00, 0xff, 0x11, /* .E.*.... */ -0x11, 0xd0, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt13[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x01, 0x2b, 0x00, 0x00, 0xff, 0x11, /* .~.+.... */ -0x11, 0x96, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt14[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x01, 0x2c, 0x00, 0x00, 0xff, 0x11, /* .~.,.... */ -0x11, 0x95, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - -/* Frame (83 bytes) */ -static const unsigned char pkt15[83] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x45, 0x01, 0x2d, 0x00, 0x00, 0xff, 0x11, /* .E.-.... */ -0x11, 0xcd, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x31, /* .......1 */ -0xd7, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5f, /* ......._ */ -0x73, 0x6c, 0x65, 0x65, 0x70, 0x2d, 0x70, 0x72, /* sleep-pr */ -0x6f, 0x78, 0x79, 0x04, 0x5f, 0x75, 0x64, 0x70, /* oxy._udp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (94 bytes) */ -static const unsigned char pkt16[94] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x50, 0x01, 0x2e, 0x00, 0x00, 0xff, 0x11, /* .P...... */ -0x11, 0xc1, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x3c, /* .......< */ -0xa4, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x00, 0x01, /* cal..!.. */ -0xc0, 0x0c, 0x00, 0x10, 0x00, 0x01 /* ...... */ -}; - -/* Frame (340 bytes) */ -static const unsigned char pkt17[340] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x46, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .F..@... */ -0x8f, 0x62, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .b...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x32, /* .......2 */ -0xa4, 0x76, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .v...... */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* =01.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x16, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x40, 0x0b, /* cal...@. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, /* ocal../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, /* ....x.%. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - -/* Frame (140 bytes) */ -static const unsigned char pkt18[140] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0xec, 0x17, /* ..^..... */ -0x2f, 0xbd, 0xa4, 0xb1, 0x08, 0x00, 0x45, 0x00, /* /.....E. */ -0x00, 0x7e, 0x01, 0x2f, 0x00, 0x00, 0xff, 0x11, /* .~./.... */ -0x11, 0x92, 0xc0, 0xa8, 0x07, 0x0a, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x6a, /* .......j */ -0x06, 0xdb, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x08, 0x43, /* .......C */ -0x61, 0x74, 0x72, 0x6f, 0x2d, 0x50, 0x43, 0x05, /* atro-PC. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0xc0, 0xa8, 0x07, 0x0a, 0x02, 0x31, 0x30, 0x01, /* .....10. */ -0x37, 0x03, 0x31, 0x36, 0x38, 0x03, 0x31, 0x39, /* 7.168.19 */ -0x32, 0x07, 0x69, 0x6e, 0x2d, 0x61, 0x64, 0x64, /* 2.in-add */ -0x72, 0x04, 0x61, 0x72, 0x70, 0x61, 0x00, 0x00, /* r.arpa.. */ -0x0c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x02, 0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x2f, 0x80, /* ....../. */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x05, 0xc0, /* ....x... */ -0x0c, 0x00, 0x01, 0x40 /* ...@ */ -}; - diff --git a/test/regression/mdns_test/capture/response_interval_2.pcapng b/test/regression/mdns_test/capture/response_interval_2.pcapng deleted file mode 100644 index 3fbeaf81..00000000 Binary files a/test/regression/mdns_test/capture/response_interval_2.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_no_delay.c b/test/regression/mdns_test/capture/response_no_delay.c deleted file mode 100644 index a50db771..00000000 --- a/test/regression/mdns_test/capture/response_no_delay.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Frame (77 bytes) */ -static const unsigned char pkt1[77] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x3f, 0x48, 0x48, 0x00, 0x00, 0xff, 0x11, /* .?HH.... */ -0xd1, 0x57, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .W...j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ -0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ -}; - -/* Frame (138 bytes) */ -static const unsigned char pkt2[138] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x7c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* .|..@... */ -0x90, 0x2c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .,...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x68, /* .......h */ -0xb9, 0x74, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .t...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40 /* .@ */ -}; - diff --git a/test/regression/mdns_test/capture/response_no_delay.pcapng b/test/regression/mdns_test/capture/response_no_delay.pcapng deleted file mode 100644 index a079a034..00000000 Binary files a/test/regression/mdns_test/capture/response_no_delay.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_to_address_query.c b/test/regression/mdns_test/capture/response_to_address_query.c deleted file mode 100644 index 2e680bd5..00000000 --- a/test/regression/mdns_test/capture/response_to_address_query.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Frame (77 bytes) */ -static const unsigned char pkt1[77] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */ -0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */ -0x00, 0x3f, 0x5c, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .?\..... */ -0xbc, 0xba, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */ -0xa2, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01 /* ..... */ -}; - -/* Frame (186 bytes) */ -static const unsigned char pkt2[186] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xac, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xf9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x98, /* ........ */ -0x17, 0x2c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .,...... */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */ -0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x22, 0xff, /* ......". */ -0xfe, 0x33, 0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, /* .3DW.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x19, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, /* cal...@. */ -0x00, 0x08 /* .. */ -}; - diff --git a/test/regression/mdns_test/capture/response_to_address_query.pcapng b/test/regression/mdns_test/capture/response_to_address_query.pcapng deleted file mode 100644 index d1ba5af3..00000000 Binary files a/test/regression/mdns_test/capture/response_to_address_query.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/response_with_tc.c b/test/regression/mdns_test/capture/response_with_tc.c deleted file mode 100644 index 48089f81..00000000 --- a/test/regression/mdns_test/capture/response_with_tc.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Frame (76 bytes) */ -static const unsigned char pkt1[76] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .>..@... */ -0x90, 0xb2, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2a, /* .......* */ -0xe3, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01 /* .... */ -}; - -/* Frame (554 bytes) */ -static const unsigned char pkt2[554] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x02, 0x1c, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8e, 0x8c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x02, 0x08, /* ........ */ -0x00, 0x93, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x41, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .A.03 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x16, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x40, 0x2e, /* cal...@. */ -0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x2e, 0x30, 0x33, 0x20, 0x53, /* al..03 S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, /* Test Fo */ -0x72, 0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, /* r Multip */ -0x6c, 0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, /* le Packe */ -0x74, 0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* ts._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x2e, /* ...d.... */ -0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* 03 Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, /* rver Tes */ -0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, 0x75, /* t For Mu */ -0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x50, /* ltiple P */ -0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x05, 0x5f, /* ackets._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* ./.....x */ -0x00, 0x48, 0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, /* .H.03 Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, /* Server */ -0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, /* Test For */ -0x20, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, /* Multipl */ -0x65, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, /* e Packet */ -0x73, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* s._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (137 bytes) */ -static const unsigned char pkt3[137] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x7b, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* .{..@... */ -0x90, 0x75, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .u...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x67, /* .......g */ -0xcf, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0xc0, 0x0c, 0x00, 0x0c, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x31, /* .....d.1 */ -0x2e, 0x30, 0x33, 0x20, 0x53, 0x69, 0x6d, 0x70, /* .03 Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x54, 0x65, /* erver Te */ -0x73, 0x74, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x4d, /* st For M */ -0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, /* ultiple */ -0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0xc0, /* Packets. */ -0x0c /* . */ -}; - diff --git a/test/regression/mdns_test/capture/response_with_tc.pcapng b/test/regression/mdns_test/capture/response_with_tc.pcapng deleted file mode 100644 index 3a38cf5b..00000000 Binary files a/test/regression/mdns_test/capture/response_with_tc.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/rr_timeout.c b/test/regression/mdns_test/capture/rr_timeout.c deleted file mode 100644 index 0911d7ca..00000000 --- a/test/regression/mdns_test/capture/rr_timeout.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Frame (75 bytes) */ -static const unsigned char pkt1[75] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x3d, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .=..@... */ -0x90, 0x93, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x29, /* .......) */ -0x66, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* f....... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01 /* ... */ -}; - -/* Frame (185 bytes) */ -static const unsigned char pkt2[185] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0xab, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x45, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .E...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x97, /* ........ */ -0xa2, 0xd5, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x5f, /* ......._ */ -0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ipp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x0c, 0x00, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x14, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0xc0, 0x0c, 0xc0, 0x27, 0x00, /* ver...'. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x11, 0x94, 0x00, /* ........ */ -0x01, 0x00, 0xc0, 0x27, 0x00, 0x21, 0x80, 0x01, /* ...'.!.. */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x0f, 0x00, 0x00, /* ...x.... */ -0x00, 0x00, 0x00, 0x50, 0x06, 0x75, 0x62, 0x75, /* ...P.ubu */ -0x6e, 0x74, 0x75, 0xc0, 0x16, 0xc0, 0x5a, 0x00, /* ntu...Z. */ -0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x0c, 0x29, 0xff, 0xfe, 0x01, 0xd4, /* ...).... */ -0x8d, 0xc0, 0x5a, 0x00, 0x01, 0x80, 0x01, 0x00, /* ..Z..... */ -0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, /* ..x..... */ -0x01 /* . */ -}; - -/* Frame (129 bytes) */ -static const unsigned char pkt3[129] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x73, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .s..@... */ -0x90, 0x5c, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* .\...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x5f, /* ......._ */ -0x92, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x53, /* .......S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x21, 0x00, 0x01, 0x06, 0x75, 0x62, /* ..!...ub */ -0x75, 0x6e, 0x74, 0x75, 0x05, 0x6c, 0x6f, 0x63, /* untu.loc */ -0x61, 0x6c, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x06, /* al...... */ -0x75, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x05, 0x6c, /* ubuntu.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x00, /* ocal.... */ -0x01 /* . */ -}; - -/* Frame (158 bytes) */ -static const unsigned char pkt4[158] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x0c, /* ..^..... */ -0x29, 0x01, 0xd4, 0x8d, 0x08, 0x00, 0x45, 0x00, /* ).....E. */ -0x00, 0x90, 0x00, 0x00, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x60, 0x0a, 0x00, 0x00, 0x01, 0xe0, 0x00, /* .`...... */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x7c, /* .......| */ -0x3e, 0xb4, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* >....... */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0x75, /* .......u */ -0x62, 0x75, 0x6e, 0x74, 0x75, 0x05, 0x6c, 0x6f, /* buntu.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, /* cal..... */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, /* ...x.... */ -0x00, 0x01, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* ...Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x04, 0x5f, 0x69, 0x70, /* rver._ip */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0xc0, 0x13, /* p._tcp.. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0xc0, 0x0c, 0xc0, 0x0c, 0x00, 0x1c, 0x80, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, /* ...x.... */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, /* ........ */ -0x29, 0xff, 0xfe, 0x01, 0xd4, 0x8d /* )..... */ -}; - diff --git a/test/regression/mdns_test/capture/rr_timeout.pcapng b/test/regression/mdns_test/capture/rr_timeout.pcapng deleted file mode 100644 index f90a5d44..00000000 Binary files a/test/regression/mdns_test/capture/rr_timeout.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/send_goodbye.c b/test/regression/mdns_test/capture/send_goodbye.c deleted file mode 100644 index d25e2b6c..00000000 --- a/test/regression/mdns_test/capture/send_goodbye.c +++ /dev/null @@ -1,229 +0,0 @@ -/* Frame (153 bytes) */ -static const unsigned char pkt1[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x8b, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x23, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .#...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xc0, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, /* .....x.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00 /* . */ -}; - -/* Frame (153 bytes) */ -static const unsigned char pkt2[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x8b, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x22, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* ."...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xc0, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, /* .....x.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00 /* . */ -}; - -/* Frame (153 bytes) */ -static const unsigned char pkt3[153] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x8b, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x90, 0x21, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .!...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x77, /* .......w */ -0xc0, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* ........ */ -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x19, /* .....x.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00 /* . */ -}; - -/* Frame (295 bytes) */ -static const unsigned char pkt4[295] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x19, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x92, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x05, /* ........ */ -0xea, 0x95, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, /* .....ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* ....pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (295 bytes) */ -static const unsigned char pkt5[295] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x19, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x91, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x05, /* ........ */ -0xea, 0x95, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, /* .....ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* ....pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (295 bytes) */ -static const unsigned char pkt6[295] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x19, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x90, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x05, /* ........ */ -0xea, 0x95, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x5f, /* ......._ */ -0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, /* services */ -0x07, 0x5f, 0x64, 0x6e, 0x73, 0x2d, 0x73, 0x64, /* ._dns-sd */ -0x04, 0x5f, 0x75, 0x64, 0x70, 0x05, 0x6c, 0x6f, /* ._udp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, /* cal..... */ -0x00, 0x00, 0x11, 0x94, 0x00, 0x12, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x11, 0x94, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, /* .....ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x78, /* .!.....x */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x11, /* ........ */ -0x94, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* ....pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (237 bytes) */ -static const unsigned char pkt7[237] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xdf, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xc9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xcb, /* ........ */ -0xdf, 0xc3, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x5f, /* ......._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - diff --git a/test/regression/mdns_test/capture/send_goodbye.pcapng b/test/regression/mdns_test/capture/send_goodbye.pcapng deleted file mode 100644 index 87451e94..00000000 Binary files a/test/regression/mdns_test/capture/send_goodbye.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/server_announcement.c b/test/regression/mdns_test/capture/server_announcement.c deleted file mode 100644 index bd89e7e6..00000000 --- a/test/regression/mdns_test/capture/server_announcement.c +++ /dev/null @@ -1,282 +0,0 @@ -/* Frame (321 bytes) */ -static const unsigned char pkt1[321] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x33, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* .3..@... */ -0x8f, 0x9e, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x1f, /* ........ */ -0xe5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* .&...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, 0x70, /* .d...pap */ -0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ -0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00 /* . */ -}; - -/* Frame (87 bytes) */ -static const unsigned char pkt2[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x49, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ -0x90, 0x87, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0xa1, 0x99, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ -}; - -/* Frame (321 bytes) */ -static const unsigned char pkt3[321] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x33, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* .3..@... */ -0x8f, 0x9c, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x1f, /* ........ */ -0xe5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* .&...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, 0x70, /* .d...pap */ -0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ -0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00 /* . */ -}; - -/* Frame (87 bytes) */ -static const unsigned char pkt4[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x49, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ -0x90, 0x85, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0xa1, 0x99, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ -}; - -/* Frame (321 bytes) */ -static const unsigned char pkt5[321] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x33, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* .3..@... */ -0x8f, 0x9a, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x1f, /* ........ */ -0xe5, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, /* .&...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, /* est._ipp */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, /* cal..... */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, 0x70, /* .d...pap */ -0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ -0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ -0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* .._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, 0x4d, /* .d...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, 0x74, /* ._ipp._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00 /* . */ -}; - -/* Frame (87 bytes) */ -static const unsigned char pkt6[87] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0x49, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* .I..@... */ -0x90, 0x83, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x35, /* .......5 */ -0xa1, 0x99, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x04, 0xc0, 0xa8, 0x00, 0x1f /* d...... */ -}; - -/* Frame (234 bytes) */ -static const unsigned char pkt7[234] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xdc, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xee, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc8, /* ........ */ -0xf5, 0x0e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, /* ..d...pa */ -0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ -0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ -0x31, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 1.._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, /* ..d...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00 /* l. */ -}; - -/* Frame (234 bytes) */ -static const unsigned char pkt8[234] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xdc, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xed, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc8, /* ........ */ -0xf5, 0x0e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, /* ..d...pa */ -0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ -0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ -0x31, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 1.._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, /* ..d...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00 /* l. */ -}; - -/* Frame (234 bytes) */ -static const unsigned char pkt9[234] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xdc, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xec, 0x0a, 0x00, 0x00, 0x1f, 0xe0, 0x00, /* ........ */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xc8, /* ........ */ -0xf5, 0x0e, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, /* ..d..... */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, /* local..A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* st._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x15, 0x08, 0x70, 0x61, /* ..d...pa */ -0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, /* per=A4.v */ -0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, /* ersion=0 */ -0x31, 0x00, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, /* 1.._ipp. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x0c, 0x80, 0x01, 0x00, /* al...... */ -0x00, 0x00, 0x64, 0x00, 0x1d, 0x0b, 0x41, 0x52, /* ..d...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x04, 0x5f, 0x69, 0x70, 0x70, 0x04, 0x5f, /* t._ipp._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00 /* l. */ -}; - diff --git a/test/regression/mdns_test/capture/server_announcement.pcapng b/test/regression/mdns_test/capture/server_announcement.pcapng deleted file mode 100644 index bab8e0ac..00000000 Binary files a/test/regression/mdns_test/capture/server_announcement.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/server_announcement_v6.c b/test/regression/mdns_test/capture/server_announcement_v6.c deleted file mode 100644 index 579ad334..00000000 --- a/test/regression/mdns_test/capture/server_announcement_v6.c +++ /dev/null @@ -1,327 +0,0 @@ -/* Frame (334 bytes) */ -static const unsigned char pkt1[334] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ -0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ -0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ -0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ -0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ -}; - -/* Frame (334 bytes) */ -static const unsigned char pkt2[334] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ -0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ -0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ -0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ -0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ -}; - -/* Frame (334 bytes) */ -static const unsigned char pkt3[334] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x18, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x18, 0x58, 0xb1, 0x00, 0x00, /* ....X... */ -0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, /* ........ */ -0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, /* ocal.... */ -0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ....ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, /* .....x.. */ -0x0a, 0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, /* ...B.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x1c, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* ......x. */ -0x10, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, /* ..."..3D */ -0x57, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* W.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* !.....d. */ -0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, /* ......P. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* l..ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .......d */ -0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, /* ...paper */ -0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, /* =A4.vers */ -0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* ion=01 */ -}; - -/* Frame (466 bytes) */ -static const unsigned char pkt4[466] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ -0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ -0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (466 bytes) */ -static const unsigned char pkt5[466] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ -0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ -0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - -/* Frame (466 bytes) */ -static const unsigned char pkt6[466] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x11, /* 33...... */ -0x22, 0x33, 0x44, 0x57, 0x86, 0xdd, 0x60, 0x00, /* "3DW..`. */ -0x00, 0x00, 0x01, 0x9c, 0x11, 0xff, 0xfe, 0x80, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, /* ........ */ -0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, 0xff, 0x02, /* "..3DW.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x14, 0xe9, /* ........ */ -0x14, 0xe9, 0x01, 0x9c, 0x29, 0x22, 0x00, 0x00, /* ....)".. */ -0x84, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* ...ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x01, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x04, 0x0a, /* ....x... */ -0x00, 0x00, 0x42, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..B.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x1c, /* local... */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, 0x10, /* .....x.. */ -0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */ -0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x57, /* .."..3DW */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x19, 0x0b, 0x41, 0x52, /* ..x...AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x0b, 0x41, /* ..@....A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, /* st._http */ -0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, /* ._tcp.lo */ -0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, /* cal..!.. */ -0x00, 0x00, 0x00, 0x64, 0x00, 0x19, 0x00, 0x00, /* ...d.... */ -0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, /* ...P.ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, /* .local.. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x1e, 0x0b, /* ....d... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, /* est._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, /* ocal..AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, /* al../... */ -0x00, 0x00, 0x78, 0x00, 0x25, 0x0b, 0x41, 0x52, /* ..x.%.AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, 0x00, 0x80, /* al...... */ -0x00, 0x40 /* .@ */ -}; - diff --git a/test/regression/mdns_test/capture/server_announcement_v6.pcapng b/test/regression/mdns_test/capture/server_announcement_v6.pcapng deleted file mode 100644 index 33ac4663..00000000 Binary files a/test/regression/mdns_test/capture/server_announcement_v6.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/server_announcement_with_txt.c b/test/regression/mdns_test/capture/server_announcement_with_txt.c deleted file mode 100644 index 378822c4..00000000 --- a/test/regression/mdns_test/capture/server_announcement_with_txt.c +++ /dev/null @@ -1,276 +0,0 @@ -/* Frame (269 bytes) */ -static const unsigned char pkt1[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xaf, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt2[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xae, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (269 bytes) */ -static const unsigned char pkt3[269] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x00, 0xff, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0xad, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xeb, /* ........ */ -0x13, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* .%...... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* t._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, /* al...... */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, /* .x.....B */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, 0x74, /* Test._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x10, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, /* ......d. */ -0x14, 0x08, 0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, /* ..paper= */ -0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, /* A4.versi */ -0x6f, 0x6e, 0x3d, 0x30, 0x31 /* on=01 */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt4[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x2b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .+...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt5[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x2a, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .*...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - -/* Frame (398 bytes) */ -static const unsigned char pkt6[398] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x80, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x29, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .)...B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x6c, /* .......l */ -0x46, 0x47, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* FG...... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .@.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, /* NSTest._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* p.local. */ -0x00, 0x21, 0x80, 0x01, 0x00, 0x00, 0x00, 0x64, /* .!.....d */ -0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, /* .......P */ -0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, /* .ARMMDNS */ -0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, /* Test.loc */ -0x61, 0x6c, 0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* al..ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, 0x05, /* sion=01. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x1e, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* d...ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x25, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* %.ARMMDN */ -0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x5f, 0x68, /* STest._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x05, 0x00, 0x00, 0x80, 0x00, 0x40 /* .....@ */ -}; - diff --git a/test/regression/mdns_test/capture/server_announcement_with_txt.pcapng b/test/regression/mdns_test/capture/server_announcement_with_txt.pcapng deleted file mode 100644 index ee60fff2..00000000 Binary files a/test/regression/mdns_test/capture/server_announcement_with_txt.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/capture/server_interface_reset.c b/test/regression/mdns_test/capture/server_interface_reset.c deleted file mode 100644 index 7289bd9d..00000000 --- a/test/regression/mdns_test/capture/server_interface_reset.c +++ /dev/null @@ -1,628 +0,0 @@ -/* Frame (287 bytes) */ -static const unsigned char pkt1[287] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x11, 0x00, 0x01, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x9d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ -0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (287 bytes) */ -static const unsigned char pkt2[287] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x11, 0x00, 0x02, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x9c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ -0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (287 bytes) */ -static const unsigned char pkt3[287] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x11, 0x00, 0x03, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x9b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ -0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (428 bytes) */ -static const unsigned char pkt4[428] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x9e, 0x00, 0x04, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x0d, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ -0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - -/* Frame (428 bytes) */ -static const unsigned char pkt5[428] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x9e, 0x00, 0x05, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x0c, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ -0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - -/* Frame (428 bytes) */ -static const unsigned char pkt6[428] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x9e, 0x00, 0x06, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x0b, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ -0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - -/* Frame (288 bytes) */ -static const unsigned char pkt7[288] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x12, 0x00, 0x07, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x96, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfe, /* ........ */ -0x8f, 0x3f, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .?...... */ -0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, /* ......B. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, /* al..!... */ -0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, /* ........ */ -0x00, 0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, /* ..P.ARMM */ -0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, /* DNSTest. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, /* local..S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x00, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, /* .....pap */ -0x65, 0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, /* er=A4.ve */ -0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31, /* rsion=01 */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, /* l....... */ -0x00, 0x00, 0x00, 0x24, 0x11, 0x53, 0x69, 0x6d, /* ...$.Sim */ -0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, /* ple Web */ -0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, /* Server._ */ -0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, /* http._tc */ -0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00 /* p.local. */ -}; - -/* Frame (287 bytes) */ -static const unsigned char pkt8[287] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x11, 0x00, 0x08, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x96, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ -0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (287 bytes) */ -static const unsigned char pkt9[287] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x11, 0x00, 0x09, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x95, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ -0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (287 bytes) */ -static const unsigned char pkt10[287] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x11, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x94, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0xfd, /* ........ */ -0x5b, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* [....... */ -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x11, 0x53, 0x69, /* ......Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0xff, 0x00, 0x01, 0x0b, 0x41, 0x52, /* ......AR */ -0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, /* MMDNSTes */ -0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, /* t.local. */ -0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, /* .......x */ -0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x11, 0x53, /* .....B.S */ -0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, /* imple We */ -0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, /* b Server */ -0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, /* ._http._ */ -0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* tcp.loca */ -0x6c, 0x00, 0x00, 0x21, 0x80, 0x01, 0x00, 0x00, /* l..!.... */ -0x00, 0x64, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, /* .d...... */ -0x00, 0x50, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, /* .P.ARMMD */ -0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, /* NSTest.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, /* ocal..Si */ -0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, /* mple Web */ -0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x05, /* Server. */ -0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, /* _http._t */ -0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* cp.local */ -0x00, 0x00, 0x10, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x64, 0x00, 0x14, 0x08, 0x70, 0x61, 0x70, 0x65, /* d...pape */ -0x72, 0x3d, 0x41, 0x34, 0x0a, 0x76, 0x65, 0x72, /* r=A4.ver */ -0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x30, 0x31 /* sion=01 */ -}; - -/* Frame (428 bytes) */ -static const unsigned char pkt11[428] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x9e, 0x00, 0x0b, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x06, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ -0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - -/* Frame (428 bytes) */ -static const unsigned char pkt12[428] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x9e, 0x00, 0x0c, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x05, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ -0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - -/* Frame (428 bytes) */ -static const unsigned char pkt13[428] = { -0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */ -0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */ -0x01, 0x9e, 0x00, 0x0d, 0x40, 0x00, 0xff, 0x11, /* ....@... */ -0x8f, 0x04, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */ -0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x01, 0x8a, /* ........ */ -0x40, 0x19, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* @....... */ -0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */ -0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */ -0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */ -0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */ -0x6c, 0x00, 0x00, 0x2f, 0x80, 0x01, 0x00, 0x00, /* l../.... */ -0x00, 0x78, 0x00, 0x16, 0x0b, 0x41, 0x52, 0x4d, /* .x...ARM */ -0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x01, 0x40, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, /* .@.Simpl */ -0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, /* e Web Se */ -0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, /* rver._ht */ -0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, /* tp._tcp. */ -0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x21, /* local..! */ -0x80, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x19, /* .....d.. */ -0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x0b, 0x41, /* .....P.A */ -0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */ -0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */ -0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* ..Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x10, 0x80, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x14, 0x08, /* ....d... */ -0x70, 0x61, 0x70, 0x65, 0x72, 0x3d, 0x41, 0x34, /* paper=A4 */ -0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, /* .version */ -0x3d, 0x30, 0x31, 0x05, 0x5f, 0x68, 0x74, 0x74, /* =01._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x0c, 0x00, /* ocal.... */ -0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x24, 0x11, /* ....d.$. */ -0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x57, /* Simple W */ -0x65, 0x62, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, /* eb Serve */ -0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x04, /* r._http. */ -0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, 0x6f, 0x63, /* _tcp.loc */ -0x61, 0x6c, 0x00, 0x11, 0x53, 0x69, 0x6d, 0x70, /* al..Simp */ -0x6c, 0x65, 0x20, 0x57, 0x65, 0x62, 0x20, 0x53, /* le Web S */ -0x65, 0x72, 0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, /* erver._h */ -0x74, 0x74, 0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, /* ttp._tcp */ -0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */ -0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */ -0x2b, 0x11, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, /* +.Simple */ -0x20, 0x57, 0x65, 0x62, 0x20, 0x53, 0x65, 0x72, /* Web Ser */ -0x76, 0x65, 0x72, 0x05, 0x5f, 0x68, 0x74, 0x74, /* ver._htt */ -0x70, 0x04, 0x5f, 0x74, 0x63, 0x70, 0x05, 0x6c, /* p._tcp.l */ -0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, 0x05, 0x00, /* ocal.... */ -0x00, 0x80, 0x00, 0x40 /* ...@ */ -}; - diff --git a/test/regression/mdns_test/capture/server_interface_reset.pcapng b/test/regression/mdns_test/capture/server_interface_reset.pcapng deleted file mode 100644 index d4c77d98..00000000 Binary files a/test/regression/mdns_test/capture/server_interface_reset.pcapng and /dev/null differ diff --git a/test/regression/mdns_test/mdns_test_setup.docx b/test/regression/mdns_test/mdns_test_setup.docx deleted file mode 100644 index 0be0f8b2..00000000 Binary files a/test/regression/mdns_test/mdns_test_setup.docx and /dev/null differ diff --git a/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c b/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c index fb83e00a..9283f35e 100644 --- a/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c +++ b/test/regression/nat_test/netx_nat_entry_removed_after_timeout_test.c @@ -363,7 +363,7 @@ NX_NAT_TRANSLATION_ENTRY *entry_ptr; } /* Attempt to connect the socket to the external host on a destination port higher than the last entry in the table. */ - status = nx_tcp_client_socket_connect(&tcp_socket, NX_NAT_EXTERNAL_HOST, peer_port, TIME_SLICE); // jlc use symbols + status = nx_tcp_client_socket_connect(&tcp_socket, NX_NAT_EXTERNAL_HOST, peer_port, TIME_SLICE); /* Unbind the socket. */ status = nx_tcp_client_socket_unbind(&tcp_socket); diff --git a/test/regression/netxduo_test/netx_11_23_test.c b/test/regression/netxduo_test/netx_11_23_test.c deleted file mode 100644 index 1a8a902f..00000000 --- a/test/regression/netxduo_test/netx_11_23_test.c +++ /dev/null @@ -1,380 +0,0 @@ -/* 11.23 Local user initiates the close, a FIN segment can be constructed and placed on the outgoing segment queue. */ - -/* Procedure - 1 Establish the connection; - 2 Let the server socket send segments until the rx_window of the client socket reduce to 0; - 3 Call the disconnect API, check whether a FIN packet is sent out in the callback function; - 4 Let the client socket receive the packet; - 5 Check whether the FIN packet is received in the tcp packet receive function we defined.0 */ - -/* Warning: FIN segment is not placed on the outgoing segment queue. */ - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_tcp.h" -#include -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 2048 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD ntest_0; -static TX_THREAD ntest_1; - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; -static NX_IP ip_1; -static NX_TCP_SOCKET client_socket; -static NX_TCP_SOCKET server_socket; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static ULONG fin_counter; - -static UCHAR data_11_23[88]; - -/* Define thread prototypes. */ -static void ntest_0_entry(ULONG thread_input); -static void ntest_1_entry(ULONG thread_input); -static void ntest_0_connect_received(NX_TCP_SOCKET *server_socket, UINT port); -static void ntest_0_disconnect_received(NX_TCP_SOCKET *server_socket); -extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); -static void my_tcp_packet_receive_11_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr); - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_11_23_application_define(void *first_unused_memory) -#endif -{ - -CHAR *pointer; -UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - fin_counter = 0; - - /* Create the main thread. */ - tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Create the main thread. */ - tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 512, pointer, 8192); - pointer = pointer + 8192; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, - pointer, 2048, 1); - pointer = pointer + 2048; - - /* Create another IP instance. */ - status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, - pointer, 2048, 1); - pointer = pointer + 2048; - - if(status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for error. */ - if(status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for IP Instance 1. */ - status = nx_arp_enable(&ip_1, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check for error. */ - if(status) - error_counter++; - - /* Enable TCP processing for both IP instances. */ - status = nx_tcp_enable(&ip_0); - - /* Check for error. */ - if(status) - error_counter++; - - status = nx_tcp_enable(&ip_1); - - /* Check TCP enable status. */ - if(status) - error_counter++; -} - -/* Define the test threads. */ - -static void ntest_0_entry(ULONG thread_input) -{ - -UINT status; -UINT i; -ULONG actual_status; -NX_PACKET *my_packet; - - /* Print out test information banner. */ - printf("NetX Test: TCP Spec 11.23 Test......................................."); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Ensure the IP instance has been initialized. */ - status = nx_ip_status_check(&ip_0, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - /* Create a socket. */ - status = nx_tcp_socket_create(&ip_0, &server_socket, "Server Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 88, - NX_NULL, ntest_0_disconnect_received); - - /* Check for error. */ - if(status) - error_counter++; - - /* Setup this thread to listen. */ - status = nx_tcp_server_socket_listen(&ip_0, 12, &server_socket, 5, ntest_0_connect_received); - - /* Check for error. */ - if(status) - error_counter++; - - /* If accept return successfully, then it handles an illegal option length for MSS. */ - status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - - /* Create a packet to send. */ - status = nx_packet_allocate(&pool_0, &my_packet, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - srand((unsigned)time(NULL)); - for(i = 0;i < 88;i++) - { - data_11_23[i] = rand() % 256; - } - - status = nx_packet_data_append(my_packet, data_11_23, 88, &pool_0, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - /* Send packet to server. */ - status = nx_tcp_socket_send(&server_socket, my_packet, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - if(client_socket.nx_tcp_socket_rx_window_current != 0) - error_counter++; - - /* Disconnect the server socket. */ - status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - status = nx_tcp_server_socket_unaccept(&server_socket); - - /* Check for error. */ - if(status) - error_counter++; - - status = nx_tcp_server_socket_unlisten(&ip_0, 12); - - /* Check for error. */ - if(status) - error_counter++; - - /* Delete the socket. */ - status = nx_tcp_socket_delete(&server_socket); - - /* Check for error. */ - if(status) - error_counter++; - -} - -static void ntest_1_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *my_packet; - - /* Create a socket. */ - status = nx_tcp_socket_create(&ip_1, &client_socket, "Client Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 88, - NX_NULL, NX_NULL); - - /* Check for error. */ - if(status) - error_counter++; - - /* Bind the socket. */ - status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - /* Attempt to connect the socket. */ - status = _nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 5 * NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_11_23; - - - /* Receive a TCP message from the socket. */ - status = nx_tcp_socket_receive(&client_socket, &my_packet, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - else - { - if(client_socket.nx_tcp_socket_rx_window_current == 0) - error_counter++; - - nx_packet_release(my_packet); - } - - - /* Disconnect the server socket. */ - status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - /* Unbind the socket. */ - status = nx_tcp_client_socket_unbind(&client_socket); - - /* Check for error. */ - if(status) - error_counter++; - - /* Delete the socket. */ - status = nx_tcp_socket_delete(&client_socket); - - /* Check for error. */ - if(status) - error_counter++; - - /* Return error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - else if (fin_counter != 1) - { - printf("WARNING!\n"); - test_control_return(2); - } - /* Return success. */ - else - { - printf("SUCCESS!\n"); - test_control_return(0); - } - -} - -void my_tcp_packet_receive_11_23(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ - -NX_TCP_HEADER *tcp_header_ptr; - - tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - /* Check the packet is a FIN one. */ - if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_FIN_BIT) - { - fin_counter++; - ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; - } - - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - /* Let server receives the packet. */ - _nx_tcp_packet_receive(ip_ptr, packet_ptr); -} - - -static void ntest_0_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) -{ - - /* Check for the proper socket and port. */ - if((socket_ptr != &server_socket) || (port != 12)) - error_counter++; -} - -static void ntest_0_disconnect_received(NX_TCP_SOCKET *socket) -{ - - /* Check for proper disconnected socket. */ - if(socket != &server_socket) - error_counter++; -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_11_23_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: TCP Spec 11.23 Test.......................................N/A\n"); - - test_control_return(3); -} -#endif diff --git a/test/regression/netxduo_test/netx_18_21_test.c b/test/regression/netxduo_test/netx_18_21_test.c deleted file mode 100644 index 0c91493a..00000000 --- a/test/regression/netxduo_test/netx_18_21_test.c +++ /dev/null @@ -1,371 +0,0 @@ -/* 18.21 TCP MAY aggregate data requested by an application for - sending until accumulated data exceeds effective send MSS. */ - -/* Procedure - 1. Client connect with Server. - 2. Client send packet to Server. - 3. Server receives the packet. - */ - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ram_network_driver_test_1500.h" -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 2048 - -#define MSG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD ntest_0; -static TX_THREAD ntest_1; - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; -static NX_IP ip_1; -static NX_TCP_SOCKET client_socket; -static NX_TCP_SOCKET server_socket; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static ULONG data_packet_counter; -static ULONG is_aggregated; -static ULONG mss_option_18_21; - -/* Define thread prototypes. */ -static void ntest_0_entry(ULONG thread_input); -static void ntest_1_entry(ULONG thread_input); -static void ntest_1_connect_received(NX_TCP_SOCKET *server_socket, UINT port); -static void ntest_1_disconnect_received(NX_TCP_SOCKET *server_socket); -extern void _nx_ram_network_driver(struct NX_IP_DRIVER_STRUCT *driver_req); -static void my_tcp_packet_receive_18_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr); - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_18_21_application_define(void *first_unused_memory) -#endif -{ -CHAR *pointer; -UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - data_packet_counter = 0; - is_aggregated = NX_FALSE; - mss_option_18_21 = 0; - - /* Create the main thread. */ - tx_thread_create(&ntest_0, "thread 0", ntest_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Create the main thread. */ - tx_thread_create(&ntest_1, "thread 1", ntest_1_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, - pointer, 2048, 1); - pointer = pointer + 2048; - - /* Create another IP instance. */ - status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver, - pointer, 2048, 1); - pointer = pointer + 2048; - - if(status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable ARP and supply ARP cache memory for IP Instance 1. */ - status += nx_arp_enable(&ip_1, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable TCP processing for both IP instances. */ - status = nx_tcp_enable(&ip_0); - status += nx_tcp_enable(&ip_1); - - /* Check TCP enable status. */ - if(status) - error_counter++; -} - -/* Define the test threads. */ - -static void ntest_0_entry(ULONG thread_input) -{ -UINT status; -NX_PACKET *my_packet1; -NX_PACKET *my_packet2; - - /* Print out test information banner. */ - printf("NetX Test: TCP Spec 18.21 Test......................................."); - - /* Check for earlier error. */ - if(error_counter) - { - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket. */ - status = nx_tcp_socket_create(&ip_0, &client_socket, "Client Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 300, - NX_NULL, NX_NULL); - - /* Check for error. */ - if(status) - error_counter++; - - /* Bind the socket. */ - status = nx_tcp_client_socket_bind(&client_socket, 12, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - /* Call connect to send a SYN. */ - status = nx_tcp_client_socket_connect(&client_socket, IP_ADDRESS(1, 2, 3, 5), 12, 2 * NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - /* Get the MSS value of the connected socket. */ - mss_option_18_21 = client_socket.nx_tcp_socket_connect_mss; - - /* Create one packet. */ - status = nx_packet_allocate(&pool_0, &my_packet1, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - status = nx_packet_data_append(my_packet1, MSG, 40, &pool_0, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - /* Send the first packet. */ - status = nx_tcp_socket_send(&client_socket, my_packet1, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - /* Create one packet. */ - status = nx_packet_allocate(&pool_0, &my_packet2, NX_TCP_PACKET, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - status = nx_packet_data_append(my_packet2, MSG, mss_option_18_21 - 40, &pool_0, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - /* Send the first packet. */ - status = nx_tcp_socket_send(&client_socket, my_packet2, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - /* Disconnect this socket. */ - status = nx_tcp_socket_disconnect(&client_socket, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - /* Unbind the socket. */ - status = nx_tcp_client_socket_unbind(&client_socket); - - /* Check status... */ - if(status) - error_counter++; - - /* Delete the socket. */ - status = nx_tcp_socket_delete(&client_socket); - - /* Check status... */ - if(status) - error_counter++; - - /* Determine if the test was successful. */ - if((error_counter == 0) && (is_aggregated == NX_TRUE)) - { - printf("SUCCESS!\n"); - test_control_return(0); - } - else if((error_counter == 0) && (is_aggregated == NX_FALSE) && (data_packet_counter == 2)) - { - printf("WARNING!\n"); - test_control_return(2); - } - else - { - printf("ERROR!\n"); - test_control_return(1); - } - -} - -static void ntest_1_entry(ULONG thread_input) -{ -UINT status; -ULONG actual_status; -NX_PACKET *packet_ptr; - - /* Ensure the IP instance has been initialized. */ - status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - /* Create a socket. */ - status = nx_tcp_socket_create(&ip_1, &server_socket, "Server Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, - NX_NULL, ntest_1_disconnect_received); - - /* Check for error. */ - if(status) - error_counter++; - - /* Setup this thread to listen. */ - status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket, 5, ntest_1_connect_received); - - /* Check for error. */ - if(status) - error_counter++; - - /* Accept a client socket connection. */ - status = nx_tcp_server_socket_accept(&server_socket, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if(status) - error_counter++; - - ip_1.nx_ip_tcp_packet_receive = my_tcp_packet_receive_18_21; - - while(!(status = nx_tcp_socket_receive(&server_socket, &packet_ptr, 5 * NX_IP_PERIODIC_RATE))) - { - - if(((packet_ptr -> nx_packet_length == 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (void*)MSG, 40))) || - ((packet_ptr -> nx_packet_length == mss_option_18_21 - 40) && (!memcmp(packet_ptr -> nx_packet_prepend_ptr, (void*)MSG, mss_option_18_21 - 40)))) - data_packet_counter++; - - /* Release the packet. */ - nx_packet_release(packet_ptr); - } - - /* Disconnect the server socket. */ - status = nx_tcp_socket_disconnect(&server_socket, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if(status) - error_counter++; - - status = nx_tcp_server_socket_unaccept(&server_socket); - - /* Check for error. */ - if(status) - error_counter++; - - /* Unlisten on the server port. */ - status = nx_tcp_server_socket_unlisten(&ip_1, 12); - - /* Check for error. */ - if(status) - error_counter++; - - /* Delete the socket. */ - status = nx_tcp_socket_delete(&server_socket); - - /* Check for error. */ - if(status) - error_counter++; -} - -static void ntest_1_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) -{ - - /* Check for the proper socket and port. */ - if((socket_ptr != &server_socket) || (port != 12)) - error_counter++; -} - -static void ntest_1_disconnect_received(NX_TCP_SOCKET *socket) -{ - - /* Check for proper disconnected socket. */ - if(socket != &server_socket) - error_counter++; -} - -static void my_tcp_packet_receive_18_21(NX_IP *ip_ptr, NX_PACKET *packet_ptr) -{ -NX_TCP_HEADER *tcp_header_ptr; - - /* Point to TCP HEADER. */ - tcp_header_ptr = (NX_TCP_HEADER *)packet_ptr -> nx_packet_prepend_ptr; - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - - /* If the packets are aggregated. */ - if((tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_PSH_BIT) && (packet_ptr -> nx_packet_length - 20 == mss_option_18_21) && - (!memcmp((packet_ptr -> nx_packet_prepend_ptr + 20), (void*)MSG, 40)) && (!memcmp((packet_ptr -> nx_packet_prepend_ptr + 60), (void*)MSG, (mss_option_18_21 - 40)))) - is_aggregated = NX_TRUE; - - ip_1.nx_ip_tcp_packet_receive = _nx_tcp_packet_receive; - - NX_CHANGE_ULONG_ENDIAN(tcp_header_ptr -> nx_tcp_header_word_3); - _nx_tcp_packet_receive(ip_ptr, packet_ptr); -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_18_21_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: TCP Spec 18.21 Test.......................................N/A\n"); - - test_control_return(3); -} -#endif \ No newline at end of file diff --git a/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c b/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c index 9b70281a..8f9564bc 100644 --- a/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c +++ b/test/regression/netxduo_test/netx_arp_static_entry_pollute_test.c @@ -1,5 +1,4 @@ -/* This NetX test concentrates on the ARP static entry may be updated by ARP packet. - * JIRA: https://expresslogic.atlassian.net/projects/NETXDUO/issues/NETXDUO-222. */ +/* This NetX test concentrates on the ARP static entry may be updated by ARP packet. */ #include "tx_api.h" #include "nx_api.h" diff --git a/test/regression/netxduo_test/netx_tcp_ack_before_release_test.c b/test/regression/netxduo_test/netx_tcp_ack_before_release_test.c deleted file mode 100644 index eef390b5..00000000 --- a/test/regression/netxduo_test/netx_tcp_ack_before_release_test.c +++ /dev/null @@ -1,313 +0,0 @@ -/* This NetX test concentrates on the TCP receives ACK for the transmitting packet - * that has not been released by driver. */ - -#include "tx_api.h" -#include "nx_api.h" -#include "nx_tcp.h" -#include "nx_ram_network_driver_test_1500.h" - -extern void test_control_return(UINT status); - -#if !defined(NX_DISABLE_IPV4) - -#define DEMO_STACK_SIZE 2048 - - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; -static TX_THREAD thread_1; - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; -static NX_IP ip_1; -static NX_TCP_SOCKET client_socket_0; -static NX_TCP_SOCKET server_socket_0; -static NX_PACKET *process_packet; - - -/* Define the counters used in the demo application... */ - -static ULONG error_counter = 0; - - -/* Define thread prototypes. */ - -static void thread_0_entry(ULONG thread_input); -static void thread_1_entry(ULONG thread_input); -extern void _nx_ram_network_driver_256(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*advanced_packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr, - UINT *operation_ptr, UINT *delay_ptr); -static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, - UINT *operation_ptr, UINT *delay_ptr); - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tcp_ack_before_release_test_application_define(void *first_unused_memory) -#endif -{ - -CHAR *pointer; -UINT status; - - - error_counter = 0; - process_packet = NX_NULL; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Create the main thread. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, - pointer, DEMO_STACK_SIZE, - 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 256, pointer, 8192); - pointer = pointer + 8192; - - if (status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1, 2, 3, 4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, - pointer, 2048, 1); - pointer = pointer + 2048; - - /* Create another IP instance. */ - status += nx_ip_create(&ip_1, "NetX IP Instance 1", IP_ADDRESS(1, 2, 3, 5), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_256, - pointer, 2048, 1); - pointer = pointer + 2048; - - if (status) - error_counter++; - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable ARP and supply ARP cache memory for IP Instance 1. */ - status += nx_arp_enable(&ip_1, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Check ARP enable status. */ - if (status) - error_counter++; - - /* Enable TCP processing for both IP instances. */ - status = nx_tcp_enable(&ip_0); - status += nx_tcp_enable(&ip_1); - - /* Check TCP enable status. */ - if (status) - error_counter++; -} - - -/* Define the test threads. */ - -static void thread_0_entry(ULONG thread_input) -{ - -UINT status; -NX_PACKET *packet_ptr; - - /* Print out some test information banners. */ - printf("NetX Test: TCP ACK Before Release Test..............................."); - - /* Check for earlier error. */ - if (error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - - /* Create a socket. */ - status = nx_tcp_socket_create(&ip_0, &client_socket_0, "Client Socket 0", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 200, - NX_NULL, NX_NULL); - - /* Check for error. */ - if (status) - error_counter++; - - /* Bind the socket. */ - status = nx_tcp_client_socket_bind(&client_socket_0, 12, NX_NO_WAIT); - - /* Check for error. */ - if (status) - { - - printf("ERROR!\n"); - test_control_return(1); - } - - /* Attempt to connect the socket. */ - status = nx_tcp_client_socket_connect(&client_socket_0, IP_ADDRESS(1, 2, 3, 5), 12, NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if (status) - { - - printf("ERROR!\n"); - test_control_return(1); - } - - /* Send a packet. */ - status = nx_packet_allocate(&pool_0, &packet_ptr, NX_TCP_PACKET, NX_WAIT_FOREVER); - status += nx_packet_data_append(packet_ptr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ", 28, &pool_0, NX_IP_PERIODIC_RATE); - if(status) - error_counter++; - - /* Set the driver filter to delay the packet and receive fake ACK packet. */ - advanced_packet_process_callback = driver_packet_process; - process_packet = packet_ptr; - - /* Send the packet out! */ - status = nx_tcp_socket_send(&client_socket_0, packet_ptr, NX_IP_PERIODIC_RATE); - if (status) - { - error_counter++; - nx_packet_release(packet_ptr); - } - - /* Check the packet is not ACKed yet since driver should delay it for 1s. */ - if (client_socket_0.nx_tcp_socket_transmit_sent_count != 1) - { - error_counter++; - } - -#ifdef __PRODUCT_NETXDUO__ - /* Wakeup server thread. */ - tx_thread_resume(&thread_1); - - /* Disconnect the server socket. */ - status = nx_tcp_socket_disconnect(&client_socket_0, 2 * NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if (status) - error_counter++; -#endif /* __PRODUCT_NETXDUO__ */ - - /* Check status. */ - if (error_counter) - { - - printf("ERROR!\n"); - test_control_return(1); - } - else - { - - printf("SUCCESS!\n"); - test_control_return(0); - } -} - - -static void thread_1_entry(ULONG thread_input) -{ - -UINT status; -ULONG actual_status; - - - /* Ensure the IP instance has been initialized. */ - status = nx_ip_status_check(&ip_1, NX_IP_INITIALIZE_DONE, &actual_status, NX_IP_PERIODIC_RATE); - - /* Check status... */ - if (status != NX_SUCCESS) - error_counter++; - - /* Create a socket. */ - status = nx_tcp_socket_create(&ip_1, &server_socket_0, "Server Socket 0", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 100, - NX_NULL, NX_NULL); - - /* Check for error. */ - if (status) - error_counter++; - - /* Setup this thread to listen. */ - status = nx_tcp_server_socket_listen(&ip_1, 12, &server_socket_0, 5, NX_NULL); - - /* Check for error. */ - if (status) - error_counter++; - - /* Accept a client socket connection. */ - status = nx_tcp_server_socket_accept(&server_socket_0, 5 * NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if (status) - error_counter++; - -#ifdef __PRODUCT_NETXDUO__ - /* Let client run. */ - tx_thread_suspend(&thread_1); - - /* Disconnect the server socket. */ - status = nx_tcp_socket_disconnect(&server_socket_0, 2 * NX_IP_PERIODIC_RATE); - - /* Check for error. */ - if (status) - error_counter++; -#endif /* __PRODUCT_NETXDUO__ */ -} - -static UINT driver_packet_process(NX_IP *ip_ptr, NX_PACKET *packet_ptr, - UINT *operation_ptr, UINT *delay_ptr) -{ -ULONG seq; - - if (packet_ptr == process_packet) - { - - /* Delay the packet by driver. */ - *operation_ptr = NX_RAMDRIVER_OP_DELAY; - *delay_ptr = NX_IP_PERIODIC_RATE; - - advanced_packet_process_callback = NX_NULL; - - /* Send a fake packet that ACKs the delayed packet. */ - seq = server_socket_0.nx_tcp_socket_rx_sequence; - server_socket_0.nx_tcp_socket_rx_sequence = client_socket_0.nx_tcp_socket_tx_sequence; - _nx_tcp_packet_send_ack(&server_socket_0, - server_socket_0.nx_tcp_socket_tx_sequence); - server_socket_0.nx_tcp_socket_rx_sequence = seq; - } - - return NX_TRUE; -} -#else - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tcp_ack_before_release_test_application_define(void *first_unused_memory) -#endif -{ - - /* Print out test information banner. */ - printf("NetX Test: TCP ACK Before Release Test...............................N/A\n"); - - test_control_return(3); -} -#endif diff --git a/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c b/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c index 31efaec0..19f45fdd 100644 --- a/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c +++ b/test/regression/netxduo_test/netx_tcp_client_packet_leak_test.c @@ -1,5 +1,4 @@ -/* This NetX test concentrates TCP client packet leak issue - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-144. */ +/* This NetX test concentrates TCP client packet leak issue. */ #include "nx_api.h" extern void test_control_return(UINT status); diff --git a/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c b/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c index 6ed6e39b..ce9d1cae 100644 --- a/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c +++ b/test/regression/netxduo_test/netx_tcp_zero_window_probe_3_test.c @@ -1,6 +1,4 @@ -/* This case verifies bug reported by work item #2252. - https://expresslogic.visualstudio.com/X-Ware/_workitems/edit/2252/ -*/ +/* This case verifies bug reported by work item #2252. */ #include "tx_api.h" #include "nx_api.h" diff --git a/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c b/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c index 444affe5..99ac9814 100644 --- a/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c +++ b/test/regression/smtp_test/netx_smtp_missing_last_250_EHLO_message_test.c @@ -393,7 +393,7 @@ ULONG actual_status; #ifdef FEATURE_NX_IPV6 /* Sleep 5 seconds to finish DAD. */ - // jlc restore tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); + tx_thread_sleep(5 * NX_IP_PERIODIC_RATE); #endif /* FEATURE_NX_IPV6 */ /* Ensure the IP instance has been initialized. */ diff --git a/test/regression/smtp_test/smtp_test_files.mk b/test/regression/smtp_test/smtp_test_files.mk deleted file mode 100644 index 2f86999c..00000000 --- a/test/regression/smtp_test/smtp_test_files.mk +++ /dev/null @@ -1,15 +0,0 @@ -SMTP_TEST_LIB_SRCS = \ - netx_smtp_basic_function_test.c \ - smtp_250_ehlo_first_pkt.c \ - smtp_250_ehlo_last_pkt.c \ - smtp_250_ehlo_ok_pkt.c \ - smtp_220_greetings_ok.c \ - smtp_334_pkt.c \ - smtp_235_auth_passed.c \ - smtp_250_sender_ok.c \ - smtp_250_recipient_ok.c \ - smtp_354_enter_mail_pkt.c \ - smtp_250_message_saved.c \ - smtp_221_bye_pkt.c \ - -SMTP_TEST_LIB_OBJS = $(SMTP_TEST_LIB_SRCS:.c=.obj) diff --git a/test/regression/snmp_test/netx_snmp_no_security_function_test.c b/test/regression/snmp_test/netx_snmp_no_security_function_test.c index 8eac7c5f..a1b37c9c 100644 --- a/test/regression/snmp_test/netx_snmp_no_security_function_test.c +++ b/test/regression/snmp_test/netx_snmp_no_security_function_test.c @@ -1,5 +1,3 @@ -// JLC THIS TEST IS BADLY DONE, TEST IT PROPERLY, NOT BYTE BY BYTE! - /* This NetX test is a simple contact between agent and browser with no security. Note that NX_SNMP_FUNCTION_TESTING must be defined in nxd_snmp.c or else timer tick data (boot time, SysTimerTick, will not match the 'pre-recorded' data that the NetX SNMP Agent responses re compared with, and the test will fail. @@ -19,7 +17,7 @@ extern void test_control_return(UINT); #if !defined(NX_DISABLE_IPV4) -#define VERBOSE // jlc disable +#define VERBOSE #define DEMO_STACK_SIZE 2048 UCHAR *current_object_requested; diff --git a/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c b/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c index af45837f..1d26e9d2 100644 --- a/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c +++ b/test/regression/snmp_test/netx_snmp_v2_get_bulk_request_test.c @@ -1,7 +1,3 @@ -// JLC THIS TEST IS OBSOLETE. Several other tests do the exact same thing. REMOVE IT. Removed -// references to "v3" and handshake protocol. This is a V2 query and there is no handshaking -// - /* This NetX test concentrates on the SNMPv2 get bulk request. The first exchange is to 'contact' the SNMP agent. Then the manager makes a bulk request. The test is successful if the internal statistics show the correct number of variables requested, requests received, and bulk responses diff --git a/test/regression/tahi_test/netx_tahi_test_3_43.c b/test/regression/tahi_test/netx_tahi_test_3_43.c deleted file mode 100644 index c5444738..00000000 --- a/test/regression/tahi_test/netx_tahi_test_3_43.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" -#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; - - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; - -static NXD_ADDRESS ipv6_address_1; - - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); - -/* Define the test threads. */ - -extern TAHI_TEST_SEQ tahi_03_043[]; - -extern int tahi_03_043_size; - -static TAHI_TEST_SUITE test_suite[1]; -static void build_test_suite(void) -{ - test_suite[0].test_case = &tahi_03_043[0];test_suite[0].test_case_size = tahi_03_043_size; -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_3_43_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - pointer = pointer + 2048; - - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - /* Enable IPv6 */ - status = nxd_ipv6_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Check fragment enable status. */ - if(status) - error_counter++; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_udp_enable(&ip_0); - - /* Check fragment enable status. */ - if(status) - error_counter++; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); - - if(status) - error_counter++; -} - - -static void thread_0_entry(ULONG thread_input) -{ - int num_suite; - int i; - - - num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); - - for(i = 0; i < num_suite; i++) - { - if(test_suite[i].test_case) - netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); - } - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_44.c b/test/regression/tahi_test/netx_tahi_test_3_44.c deleted file mode 100644 index 3b5c7085..00000000 --- a/test/regression/tahi_test/netx_tahi_test_3_44.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" -#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; - - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; - -static NXD_ADDRESS ipv6_address_1; - - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); - -/* Define the test threads. */ - -extern TAHI_TEST_SEQ tahi_03_044[]; - -extern int tahi_03_044_size; - -static TAHI_TEST_SUITE test_suite[1]; -static void build_test_suite(void) -{ - test_suite[0].test_case = &tahi_03_044[0];test_suite[0].test_case_size = tahi_03_044_size; -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_3_44_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - pointer = pointer + 2048; - - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - /* Enable IPv6 */ - status = nxd_ipv6_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Check fragment enable status. */ - if(status) - error_counter++; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_udp_enable(&ip_0); - - /* Check fragment enable status. */ - if(status) - error_counter++; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); - - if(status) - error_counter++; -} - - -static void thread_0_entry(ULONG thread_input) -{ - int num_suite; - int i; - - - num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); - - for(i = 0; i < num_suite; i++) - { - if(test_suite[i].test_case) - netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); - } - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -#endif diff --git a/test/regression/tahi_test/netx_tahi_test_3_45.c b/test/regression/tahi_test/netx_tahi_test_3_45.c deleted file mode 100644 index a7f74972..00000000 --- a/test/regression/tahi_test/netx_tahi_test_3_45.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" -#if defined(FEATURE_NX_IPV6) && defined(NX_TAHI_ENABLE) -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; - - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; - -static NXD_ADDRESS ipv6_address_1; - - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); - -/* Define the test threads. */ - -extern TAHI_TEST_SEQ tahi_03_045[]; - -extern int tahi_03_045_size; - -static TAHI_TEST_SUITE test_suite[1]; -static void build_test_suite(void) -{ - test_suite[0].test_case = &tahi_03_045[0];test_suite[0].test_case_size = tahi_03_045_size; -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_3_45_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - pointer = pointer + 2048; - - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - /* Enable IPv6 */ - status = nxd_ipv6_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status = nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Check fragment enable status. */ - if(status) - error_counter++; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_udp_enable(&ip_0); - - /* Check fragment enable status. */ - if(status) - error_counter++; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1,64, NX_NULL); - - if(status) - error_counter++; -} - - -static void thread_0_entry(ULONG thread_input) -{ - int num_suite; - int i; - - - num_suite = sizeof(test_suite) / sizeof(TAHI_TEST_SUITE); - - for(i = 0; i < num_suite; i++) - { - if(test_suite[i].test_case) - netx_tahi_run_test_case(&ip_0, test_suite[i].test_case, test_suite[i].test_case_size); - } - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec.c b/test/regression/tahi_test/netx_tahi_test_ipsec.c deleted file mode 100644 index 292704c5..00000000 --- a/test/regression/tahi_test/netx_tahi_test_ipsec.c +++ /dev/null @@ -1,625 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" - -#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE - -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" -#include "nx_ipsec.h" -#include "nx_crypto.h" -#include "nx_crypto_3des.h" -#include "nx_crypto_aes.h" -#include "nx_crypto_des.h" -#include "nx_crypto_dh.h" -#include "nx_crypto_hmac_md5.h" -#include "nx_crypto_hmac_sha1.h" -#include "nx_crypto_md5.h" -#include "nx_crypto_null.h" -#include "nx_crypto_sha1.h" - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 -#define IPSEC_MAX_END_NODE 10 -#define IPSEC_SA_LIFETIME 5000 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; - - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static NXD_ADDRESS ipv6_address_1; -static NXD_ADDRESS ipv6_address_2; - -/* Define IPSEC related data. */ - -static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; -static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_aes_xcbc_mac[32]; -static UCHAR ingress_aes_xcbc_mac[32]; -static ULONG egress_spi[IPSEC_MAX_END_NODE]; -static ULONG ingress_spi[IPSEC_MAX_END_NODE]; -static UCHAR ingress_aes_ctr[32]; -static UCHAR egress_aes_ctr[32]; - -/* Define the Crypto Method */ - -static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; -static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; -static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; - - -/* 3DES, encrypt */ -static NX_CRYPTO_METHOD crypto_method_t_des = -{ - NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used */ - (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ - sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ - NX_NULL, /* 3DES-CBC cleanup routine, not used */ - _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ -}; - -/* HMAC SHA1 */ -static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = -{ - NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ - 0, /* IV size in bits, not used */ - NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ - 0, /* Block size in bytes, not used */ - 0, /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ -}; - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); -static void init_para(); -static UINT clean_sa(); -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); - -static UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); - -/* Define the test threads. */ -extern TAHI_TEST_SEQ tahi_ipsec_001[]; -extern TAHI_TEST_SEQ tahi_ipsec_002[]; -extern TAHI_TEST_SEQ tahi_ipsec_003[]; -extern TAHI_TEST_SEQ tahi_ipsec_004[]; -extern TAHI_TEST_SEQ tahi_ipsec_005[]; - -extern int tahi_ipsec_001_size; -extern int tahi_ipsec_002_size; -extern int tahi_ipsec_003_size; -extern int tahi_ipsec_004_size; -extern int tahi_ipsec_005_size; - -static TAHI_TEST_SUITE test_suite[10]; - -static void build_test_suite(void) -{ - test_suite[0].test_case = &tahi_ipsec_001[0]; test_suite[0].test_case_size = tahi_ipsec_001_size; - test_suite[1].test_case = &tahi_ipsec_002[0]; test_suite[1].test_case_size = tahi_ipsec_002_size; - test_suite[2].test_case = &tahi_ipsec_003[0]; test_suite[2].test_case_size = tahi_ipsec_003_size; - test_suite[3].test_case = &tahi_ipsec_004[0]; test_suite[3].test_case_size = tahi_ipsec_004_size; - test_suite[4].test_case = &tahi_ipsec_005[0]; test_suite[4].test_case_size = tahi_ipsec_005_size; -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_ipsec_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - - /* Check IP create status. */ - if(status) - error_counter++; - - pointer = pointer + 2048; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - - /* Enable IPv6 */ - status += nxd_ipv6_enable(&ip_0); - - /* Enable IPv6 */ - status += nx_ipsec_enable(&ip_0); - - /* Enable UDP */ - status += nx_udp_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status += nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); - - /* Set ipv6 version and address. */ - ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; - ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; - ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); - - /* Check fragment enable status. */ - if(status) - error_counter++; -} - -static void thread_0_entry(ULONG thread_input) -{ - - init_para(); - - netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); - - - create_sa(0,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - create_sa(1,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[1], egress_3des_cbc[1], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[1], egress_hmac_sha1[1], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[1], &egress_3des[1], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[1], &metadata_egress_hmac_sha1[1], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); - - - clean_sa(); - create_sa(2,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[2], egress_3des_cbc[2], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[2], egress_hmac_sha1[2], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[2], &egress_3des[2], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[2], &metadata_egress_hmac_sha1[2], sizeof(NX_SHA1_HMAC)); - create_sa(3,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[3], egress_3des_cbc[3], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[3], egress_hmac_sha1[3], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[3], &egress_3des[3], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[3], &metadata_egress_hmac_sha1[3], sizeof(NX_SHA1_HMAC)); - - netx_tahi_run_test_case(&ip_0, test_suite[2].test_case, test_suite[2].test_case_size); - - - clean_sa(); - create_sa(0,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[3].test_case, test_suite[3].test_case_size); - -#if 0 - clean_sa(); - create_sa(0,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); -#endif - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -/* Initialize parameters for IPSec. */ -static void init_para() -{ - UINT i; - - /* Setup addresses of selectors. */ - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; - memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - } - - /*Setup destination IP address. */ - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; - memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 8-2 */ - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - - /* Used by test case 9-2 */ - - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - - /* Used by test case 22 */ - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 23 */ - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); - - /* Used by test case 24-1 */ - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 24-2 */ - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - - /* Setup SPI. */ - ingress_spi[0] = 0x1000; - egress_spi[0] = 0x2000; - ingress_spi[1] = 0x3000; - egress_spi[1] = 0x4000; - ingress_spi[2] = 0x1000; - egress_spi[2] = 0x2000; - ingress_spi[3] = 0x1000; - egress_spi[3] = 0x3000; - ingress_spi[4] = 0x1000; - egress_spi[4] = 0x2000; - ingress_spi[5] = 0x1000; - egress_spi[5] = 0x2000; - ingress_spi[6] = 0x1000; - egress_spi[6] = 0x2000; - ingress_spi[7] = 0x1000; - egress_spi[7] = 0x2000; - ingress_spi[8] = 0x1000; - egress_spi[8] = 0x2000; - ingress_spi[9] = 0x3000; - egress_spi[9] = 0x4000; - - /* Setup encryption key. */ - memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); - memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); - - memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); - memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); - - memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); - memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); - - memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); - memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); - - memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); - memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); - - /* Setup selectors. */ - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; - -} - - -/* Clean SA for IPSec. */ -static UINT clean_sa() -{ - - UINT status = 0, i; - - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - if(ingress_sa[i].nx_ipsec_sa_id) - status = _nxe_ipsec_sa_delete(&ingress_sa[i]); - if(egress_sa[i].nx_ipsec_sa_id) - status += _nxe_ipsec_sa_delete(&egress_sa[i]); - - } - - return status; -} - -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) -{ - nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), - sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, - sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); - return; -} - -/* Create SA for IPSec. */ -UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) -{ - - UINT status; - - status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], - sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, - sa_encryption_key_ingress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, - sa_integrity_key_ingress, sa_integrity_key_len_in_bits); - - if (status) - error_counter++; - - status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], - sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, - sa_encryption_key_egress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, - sa_integrity_key_egress, sa_integrity_key_len_in_bits); - if (status) - error_counter++; - - return status; -} - -#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec_2.c b/test/regression/tahi_test/netx_tahi_test_ipsec_2.c deleted file mode 100644 index f154b5c6..00000000 --- a/test/regression/tahi_test/netx_tahi_test_ipsec_2.c +++ /dev/null @@ -1,899 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" - -#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE - -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" -#include "nx_ipsec.h" -#include "nx_crypto.h" -#include "nx_crypto_3des.h" -#include "nx_crypto_aes.h" -#include "nx_crypto_des.h" -#include "nx_crypto_dh.h" -#include "nx_crypto_hmac_md5.h" -#include "nx_crypto_hmac_sha1.h" -#include "nx_crypto_md5.h" -#include "nx_crypto_null.h" -#include "nx_crypto_sha1.h" - - - - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 -#define IPSEC_MAX_END_NODE 10 -#define IPSEC_SA_LIFETIME 5000 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; - - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static NXD_ADDRESS ipv6_address_1; -static NXD_ADDRESS ipv6_address_2; - -static NXD_ADDRESS tunnel_entry_address; -static NXD_ADDRESS tunnel_exit_address; - -/* Define IPSEC related data. */ - -static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; -static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_aes_xcbc_mac[32]; -static UCHAR ingress_aes_xcbc_mac[32]; -static ULONG egress_spi[IPSEC_MAX_END_NODE]; -static ULONG ingress_spi[IPSEC_MAX_END_NODE]; -static UCHAR ingress_aes_ctr[32]; -static UCHAR egress_aes_ctr[32]; - -/* Define the Crypto Method */ - -static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; - -static NX_CRYPTO_AES egress_aes[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_AES ingress_aes[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_AES egress_aes_xcbc; -static NX_CRYPTO_AES ingress_aes_xcbc; - -static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; -static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; - -/* NULL encrypt */ -static NX_CRYPTO_METHOD crypto_method_null = -{ - NX_CRYPTO_ENCRYPTION_NULL, /* Name of the crypto algorithm */ - 0, /* Key size in bits, not used */ - 0, /* IV size in bits, not used */ - 0, /* ICV size in bits, not used */ - 4, /* Block size in bytes */ - 0, /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_null_operation /* NULL operation */ -}; - - -/* 3DES, encrypt */ -static NX_CRYPTO_METHOD crypto_method_t_des = -{ - NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used */ - (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ - sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ - NX_NULL, /* 3DES-CBC cleanup routine, not used */ - _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ -}; - -/* AES-CBC. */ -static NX_CRYPTO_METHOD crypto_method_aes_cbc = -{ - NX_CRYPTO_ENCRYPTION_AES_CBC, /* AES crypto algorithm */ - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_AES_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used. */ - (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ - sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ - NX_NULL, /* AES-CBC cleanup routine, not used. */ - _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ - -}; - -/* AES-CTR. */ -static NX_CRYPTO_METHOD crypto_method_aes_ctr = -{ - NX_CRYPTO_ENCRYPTION_AES_CTR, /* AES crypto algorithm */ - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_AES_CTR_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used. */ - (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ - sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ - NX_NULL, /* AES-CBC cleanup routine, not used. */ - _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ -}; - -/* HMAC SHA1 */ -static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = -{ - NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ - 0, /* IV size in bits, not used */ - NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ - 0, /* Block size in bytes, not used */ - 0, /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ -}; - -/* AES_XCBC_96 */ -static NX_CRYPTO_METHOD crypto_method_aes_xcbc_mac = -{ - NX_CRYPTO_AUTHENTICATION_AES_XCBC_MAC_96, /* AES_XCBC_MAC algorithm */ - NX_CRYPTO_AES_XCBC_MAC_KEY_LEN_IN_BITS, /* Key size in bits */ - 0, /* IV size in bits, not used */ - NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ - 0, /* Block size in bytes, not used */ - sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_aes_xcbc_mac_operation /* AES_XCBC_MAC operation */ -}; - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); -static void init_para(); -static UINT clean_sa(); -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); - -static UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); - -/* Define the test threads. */ -extern TAHI_TEST_SEQ tahi_ipsec_006[]; -extern TAHI_TEST_SEQ tahi_ipsec_007[]; -extern TAHI_TEST_SEQ tahi_ipsec_008[]; -/* -extern TAHI_TEST_SEQ tahi_ipsec_008_02[]; -*/ -extern TAHI_TEST_SEQ tahi_ipsec_009[]; -extern TAHI_TEST_SEQ tahi_ipsec_009_02[]; -extern TAHI_TEST_SEQ tahi_ipsec_010[]; -extern TAHI_TEST_SEQ tahi_ipsec_011[]; -extern TAHI_TEST_SEQ tahi_ipsec_012[]; -extern TAHI_TEST_SEQ tahi_ipsec_013[]; -extern TAHI_TEST_SEQ tahi_ipsec_014[]; -extern TAHI_TEST_SEQ tahi_ipsec_015[]; -extern TAHI_TEST_SEQ tahi_ipsec_016[]; -extern TAHI_TEST_SEQ tahi_ipsec_017[]; -extern TAHI_TEST_SEQ tahi_ipsec_018[]; -extern TAHI_TEST_SEQ tahi_ipsec_019[]; -extern TAHI_TEST_SEQ tahi_ipsec_020[]; -extern TAHI_TEST_SEQ tahi_ipsec_021[]; -extern TAHI_TEST_SEQ tahi_ipsec_022[]; -extern TAHI_TEST_SEQ tahi_ipsec_023[]; -extern TAHI_TEST_SEQ tahi_ipsec_024[]; -extern TAHI_TEST_SEQ tahi_ipsec_025[]; -extern TAHI_TEST_SEQ tahi_ipsec_026[]; - -extern int tahi_ipsec_006_size; -extern int tahi_ipsec_007_size; -extern int tahi_ipsec_008_size; -//extern int tahi_ipsec_008_02_size; -extern int tahi_ipsec_009_size; -extern int tahi_ipsec_009_02_size; -extern int tahi_ipsec_010_size; -extern int tahi_ipsec_011_size; -extern int tahi_ipsec_012_size; -extern int tahi_ipsec_013_size; -extern int tahi_ipsec_014_size; -extern int tahi_ipsec_015_size; -extern int tahi_ipsec_016_size; -extern int tahi_ipsec_017_size; -extern int tahi_ipsec_018_size; -extern int tahi_ipsec_019_size; -extern int tahi_ipsec_020_size; -extern int tahi_ipsec_021_size; -extern int tahi_ipsec_022_size; -extern int tahi_ipsec_023_size; -extern int tahi_ipsec_024_size; -extern int tahi_ipsec_025_size; -extern int tahi_ipsec_026_size; - -static TAHI_TEST_SUITE test_suite[30]; - -static void build_test_suite(void) -{ - - test_suite[0].test_case = &tahi_ipsec_006[0]; test_suite[0].test_case_size = tahi_ipsec_006_size; - test_suite[1].test_case = &tahi_ipsec_007[0]; test_suite[1].test_case_size = tahi_ipsec_007_size; - test_suite[2].test_case = &tahi_ipsec_008[0]; test_suite[2].test_case_size = tahi_ipsec_008_size; -// test_suite[3].test_case = &tahi_ipsec_008_02[0]; test_suite[3].test_case_size = tahi_ipsec_008_02_size; - test_suite[4].test_case = &tahi_ipsec_009[0]; test_suite[4].test_case_size = tahi_ipsec_009_size; - test_suite[5].test_case = &tahi_ipsec_009_02[0]; test_suite[5].test_case_size = tahi_ipsec_009_02_size; - test_suite[6].test_case = &tahi_ipsec_010[0]; test_suite[6].test_case_size = tahi_ipsec_010_size; - // test_suite[7].test_case = &tahi_ipsec_011[0]; test_suite[7].test_case_size = tahi_ipsec_011_size; - test_suite[8].test_case = &tahi_ipsec_012[0]; test_suite[8].test_case_size = tahi_ipsec_012_size; - test_suite[9].test_case = &tahi_ipsec_013[0]; test_suite[9].test_case_size = tahi_ipsec_013_size; - test_suite[10].test_case = &tahi_ipsec_014[0]; test_suite[10].test_case_size = tahi_ipsec_014_size; - test_suite[11].test_case = &tahi_ipsec_015[0]; test_suite[11].test_case_size = tahi_ipsec_015_size; - test_suite[12].test_case = &tahi_ipsec_016[0]; test_suite[12].test_case_size = tahi_ipsec_016_size; - test_suite[13].test_case = &tahi_ipsec_017[0]; test_suite[13].test_case_size = tahi_ipsec_017_size; - test_suite[14].test_case = &tahi_ipsec_018[0]; test_suite[14].test_case_size = tahi_ipsec_018_size; - test_suite[15].test_case = &tahi_ipsec_019[0]; test_suite[15].test_case_size = tahi_ipsec_019_size; -// test_suite[16].test_case = &tahi_ipsec_020[0]; test_suite[16].test_case_size = tahi_ipsec_020_size; -// test_suite[17].test_case = &tahi_ipsec_021[0]; test_suite[17].test_case_size = tahi_ipsec_021_size; - test_suite[18].test_case = &tahi_ipsec_022[0]; test_suite[18].test_case_size = tahi_ipsec_022_size; - test_suite[19].test_case = &tahi_ipsec_023[0]; test_suite[19].test_case_size = tahi_ipsec_023_size; - test_suite[20].test_case = &tahi_ipsec_024[0]; test_suite[20].test_case_size = tahi_ipsec_024_size; - test_suite[21].test_case = &tahi_ipsec_025[0]; test_suite[21].test_case_size = tahi_ipsec_025_size; - test_suite[22].test_case = &tahi_ipsec_026[0]; test_suite[22].test_case_size = tahi_ipsec_026_size; - -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_ipsec_2_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1536, pointer, 1536*16); - pointer = pointer + 1536*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - pointer = pointer + 2048; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - /* Enable IPv6 */ - status += nxd_ipv6_enable(&ip_0); - - /* Enable IPv6 */ - status += nx_ipsec_enable(&ip_0); - - /* Enable UDP */ - status += nx_udp_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status += nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); - - /* Set ipv6 version and address. */ - ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; - ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; - ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); - - /* Check fragment enable status. */ - if(status) - error_counter++; -} - -static void thread_0_entry(ULONG thread_input) -{ -UINT status = 0; - - init_para(); - - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[2].test_case, test_suite[2].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); - - clean_sa(); - create_sa(5, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[5].test_case, test_suite[5].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[6].test_case, test_suite[6].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[8].test_case, test_suite[8].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[9].test_case, test_suite[8].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[10].test_case, test_suite[10].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_aes_xcbc_mac, - ingress_aes_xcbc_mac, egress_aes_xcbc_mac, - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &ingress_aes_xcbc, &egress_aes_xcbc, sizeof(NX_CRYPTO_AES)); - netx_tahi_run_test_case(&ip_0, test_suite[11].test_case, test_suite[11].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_null, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - 0, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - NX_NULL, NX_NULL, 0); - netx_tahi_run_test_case(&ip_0, test_suite[12].test_case, test_suite[12].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_aes_cbc, &crypto_method_aes_cbc, - ingress_aes_cbc[0], egress_aes_cbc[0], - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[13].test_case, test_suite[13].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_aes_ctr, &crypto_method_aes_ctr, - ingress_aes_ctr, egress_aes_ctr, - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[14].test_case, test_suite[14].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_null, &crypto_method_null, - ingress_3des_cbc[0], egress_3des_cbc[0], - 0, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - NX_NULL, NX_NULL, 0, - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[15].test_case, test_suite[15].test_case_size); - - -//----------------------------Tunnel Mode test-------------------------------// - - clean_sa(); - create_sa(6, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - //Setup the tunnel source and destination address on IPSEC_TUNNEL_MODE - tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; - tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; - tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; - - tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; - tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; - tunnel_exit_address.nxd_ip_address.v6[3] = 0x00000001; - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[6], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[18].test_case, test_suite[18].test_case_size); - - - tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; - tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; - tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; - - tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; - tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; - tunnel_exit_address.nxd_ip_address.v6[3] = 0x0000000e; - - clean_sa(); - create_sa(7, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[19].test_case, test_suite[19].test_case_size); - - clean_sa(); - create_sa(8, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - create_sa(9, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[9], egress_3des_cbc[9], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[9], egress_hmac_sha1[9], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[9], &egress_3des[9], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[8], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - status += _nx_ipsec_sa_tunnel_create(&egress_sa[9], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[20].test_case, test_suite[20].test_case_size); - - clean_sa(); - create_sa(7, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[21].test_case, test_suite[21].test_case_size); - - clean_sa(); - create_sa(7, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[22].test_case, test_suite[22].test_case_size); - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -/* Initialize parameters for IPSec. */ -static void init_para() -{ - UINT i; - - /* Setup addresses of selectors. */ - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; - memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - - ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - } - - /*Setup destination IP address. */ - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; - memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 8-2 */ - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - - /* Used by test case 9-2 */ - - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - - /* Used by test case 22 */ - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 23 */ - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); - - /* Used by test case 24-1 */ - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 24-2 */ - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - - /* Setup SPI. */ - ingress_spi[0] = 0x1000; - egress_spi[0] = 0x2000; - ingress_spi[1] = 0x3000; - egress_spi[1] = 0x4000; - ingress_spi[2] = 0x1000; - egress_spi[2] = 0x2000; - ingress_spi[3] = 0x1000; - egress_spi[3] = 0x3000; - ingress_spi[4] = 0x1000; - egress_spi[4] = 0x2000; - ingress_spi[5] = 0x1000; - egress_spi[5] = 0x2000; - ingress_spi[6] = 0x1000; - egress_spi[6] = 0x2000; - ingress_spi[7] = 0x1000; - egress_spi[7] = 0x2000; - ingress_spi[8] = 0x1000; - egress_spi[8] = 0x2000; - ingress_spi[9] = 0x3000; - egress_spi[9] = 0x4000; - - /* Setup encryption key. */ - memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); - memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); - - memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); - memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); - - memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); - memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); - - memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); - memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); - - memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); - memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); - - /* Setup selectors. */ - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; - -} - - -/* Clean SA for IPSec. */ -static UINT clean_sa() -{ - - UINT status = 0, i; - - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - if(ingress_sa[i].nx_ipsec_sa_id) - status = nx_ipsec_sa_delete(&ingress_sa[i]); - if(egress_sa[i].nx_ipsec_sa_id) - status += nx_ipsec_sa_delete(&egress_sa[i]); - - } - - return status; -} - -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) -{ - nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), - sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, - sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); - return; -} - -/* Create SA for IPSec. */ -UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) -{ - - UINT status; - - status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], - sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, - sa_encryption_key_ingress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, - sa_integrity_key_ingress, sa_integrity_key_len_in_bits); - - if (status) - error_counter++; - - status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], - sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, - sa_encryption_key_egress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, - sa_integrity_key_egress, sa_integrity_key_len_in_bits); - if (status) - error_counter++; - - return status; -} - -#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec_udp.c b/test/regression/tahi_test/netx_tahi_test_ipsec_udp.c deleted file mode 100644 index 674d27c8..00000000 --- a/test/regression/tahi_test/netx_tahi_test_ipsec_udp.c +++ /dev/null @@ -1,671 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" - -#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE - -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" -#include "nx_ipsec.h" -#include "nx_crypto.h" -#include "nx_crypto_3des.h" -#include "nx_crypto_aes.h" -#include "nx_crypto_des.h" -#include "nx_crypto_dh.h" -#include "nx_crypto_hmac_md5.h" -#include "nx_crypto_hmac_sha1.h" -#include "nx_crypto_md5.h" -#include "nx_crypto_null.h" -#include "nx_crypto_sha1.h" - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 -#define IPSEC_MAX_END_NODE 10 -#define IPSEC_SA_LIFETIME 5000 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; -static TX_THREAD thread_1; - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; -static NX_UDP_SOCKET socket_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static NXD_ADDRESS ipv6_address_1; -static NXD_ADDRESS ipv6_address_2; - -/* Define IPSEC related data. */ - -static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; -static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_aes_xcbc_mac[32]; -static UCHAR ingress_aes_xcbc_mac[32]; -static ULONG egress_spi[IPSEC_MAX_END_NODE]; -static ULONG ingress_spi[IPSEC_MAX_END_NODE]; -static UCHAR ingress_aes_ctr[32]; -static UCHAR egress_aes_ctr[32]; - -/* Define the Crypto Method */ - -static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; -static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; -static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; - - -/* 3DES, encrypt */ -static NX_CRYPTO_METHOD crypto_method_t_des = -{ - NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used */ - (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ - sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ - NX_NULL, /* 3DES-CBC cleanup routine, not used */ - _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ -}; - -/* HMAC SHA1 */ -static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = -{ - NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ - 0, /* IV size in bits, not used */ - NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ - 0, /* Block size in bytes, not used */ - 0, /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ -}; - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -static void thread_1_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); -static void init_para(); -static UINT clean_sa(); -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); - -static UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); -extern UINT _nxd_udp_socket_send(NX_UDP_SOCKET *socket_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *ip_address, UINT port); - -/* Define the test threads. */ -extern TAHI_TEST_SEQ tahi_ipsec_udp_001[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_002[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_004[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_005[]; - -extern int tahi_ipsec_udp_001_size; -extern int tahi_ipsec_udp_002_size; -extern int tahi_ipsec_udp_004_size; -extern int tahi_ipsec_udp_005_size; - -static TAHI_TEST_SUITE test_suite[10]; - -static void build_test_suite(void) -{ - - test_suite[0].test_case = &tahi_ipsec_udp_001[0]; test_suite[0].test_case_size = tahi_ipsec_udp_001_size; - test_suite[1].test_case = &tahi_ipsec_udp_002[0]; test_suite[1].test_case_size = tahi_ipsec_udp_002_size; - /* - test_suite[2].test_case = &tahi_ipsec_udp_003[0]; test_suite[2].test_case_size = tahi_ipsec_udp_003_size; - */ - test_suite[3].test_case = &tahi_ipsec_udp_004[0]; test_suite[3].test_case_size = tahi_ipsec_udp_004_size; - test_suite[4].test_case = &tahi_ipsec_udp_005[0]; test_suite[4].test_case_size = tahi_ipsec_udp_005_size; -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_ipsec_udp_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Create udp process thread. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1640, pointer, 1640*16); - pointer = pointer + 1640*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - pointer = pointer + 2048; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - - /* Enable IPv6 */ - status += nxd_ipv6_enable(&ip_0); - - /* Enable IPv6 */ - status += nx_ipsec_enable(&ip_0); - - /* Enable UDP */ - status += nx_udp_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status += nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); - - /* Set ipv6 version and address. */ - ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; - ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; - ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); - - /* Check fragment enable status. */ - if(status) - error_counter++; -} - -static void thread_0_entry(ULONG thread_input) -{ - - init_para(); - - netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); - - create_sa(0,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - create_sa(1,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[1], egress_3des_cbc[1], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[1], egress_hmac_sha1[1], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[1], &egress_3des[1], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[1], &metadata_egress_hmac_sha1[1], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); - - clean_sa(); - create_sa(0,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[3].test_case, test_suite[3].test_case_size); - -#if 0 - clean_sa(); - create_sa(0,NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des,&crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); -#endif - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -/* Initialize parameters for IPSec. */ -static void init_para() -{ - UINT i; - - /* Setup addresses of selectors. */ - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; - memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - } - - /*Setup destination IP address. */ - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; - memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 8-2 */ - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - - /* Used by test case 9-2 */ - - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - - /* Used by test case 22 */ - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 23 */ - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); - - /* Used by test case 24-1 */ - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 24-2 */ - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - - - /* Setup SPI. */ - ingress_spi[0] = 0x1000; - egress_spi[0] = 0x2000; - ingress_spi[1] = 0x3000; - egress_spi[1] = 0x4000; - ingress_spi[2] = 0x1000; - egress_spi[2] = 0x2000; - ingress_spi[3] = 0x1000; - egress_spi[3] = 0x3000; - ingress_spi[4] = 0x1000; - egress_spi[4] = 0x2000; - ingress_spi[5] = 0x1000; - egress_spi[5] = 0x2000; - ingress_spi[6] = 0x1000; - egress_spi[6] = 0x2000; - ingress_spi[7] = 0x1000; - egress_spi[7] = 0x2000; - ingress_spi[8] = 0x1000; - egress_spi[8] = 0x2000; - ingress_spi[9] = 0x3000; - egress_spi[9] = 0x4000; - - /* Setup encryption key. */ - memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); - memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); - - memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); - memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); - - - memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); - memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); - - memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); - memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); - - memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); - memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); - - /* Setup selectors. */ - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; - -} - - -/* Clean SA for IPSec. */ -static UINT clean_sa() -{ - - UINT status = 0, i; - - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - if(ingress_sa[i].nx_ipsec_sa_id) - status = nx_ipsec_sa_delete(&ingress_sa[i]); - if(egress_sa[i].nx_ipsec_sa_id) - status += nx_ipsec_sa_delete(&egress_sa[i]); - - } - - return status; -} - -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) -{ - - nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), - sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, - sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); - - return; -} - -/* Create SA for IPSec. */ -UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) -{ - - UINT status; - - status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], - sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, - sa_encryption_key_ingress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, - sa_integrity_key_ingress, sa_integrity_key_len_in_bits); - - if (status) - error_counter++; - - status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], - sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, - sa_encryption_key_egress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, - sa_integrity_key_egress, sa_integrity_key_len_in_bits); - if (status) - error_counter++; - - return status; -} - - -/* Process udp packet. */ -static void thread_1_entry(ULONG thread_input) -{ - - NX_PACKET *tx_packet, *rx_packet; - UINT status; - NX_IPV6_HEADER *ipv6_header; - NXD_ADDRESS ipv6_address; /* Destination Addresses. */ - - /* Create a UDP socket. */ - status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); - - if (status) - { - error_counter++; - return; - } - - /* Bind the UDP socket to the IP port. */ - status = nx_udp_socket_bind(&socket_0, 7, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - return; - } - - while(1) - { - status = nx_udp_socket_receive(&socket_0, &rx_packet, TX_WAIT_FOREVER); - if (status == NX_SUCCESS) - { - status = nx_packet_allocate(&pool_0, &tx_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); - if (status != NX_SUCCESS) - { - break; - } - - status = nx_packet_data_append(tx_packet, rx_packet -> nx_packet_prepend_ptr, rx_packet -> nx_packet_length, &pool_0, TX_WAIT_FOREVER); - if (status != NX_SUCCESS) - { - nx_packet_release(rx_packet); - break; - } - - ipv6_header = (NX_IPV6_HEADER*)(rx_packet -> nx_packet_ip_header); - ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; - memcpy(ipv6_address.nxd_ip_address.v6, ipv6_header -> nx_ip_header_source_ip, (sizeof(ULONG) << 2)); - - status = _nxd_udp_socket_send(&socket_0, tx_packet, &ipv6_address, 100 * NX_IP_PERIODIC_RATE); - if (status != NX_SUCCESS) - { - nx_packet_release(tx_packet); - } - - nx_packet_release(rx_packet); - } - } -} -#endif diff --git a/test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c b/test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c deleted file mode 100644 index 5881dbe0..00000000 --- a/test/regression/tahi_test/netx_tahi_test_ipsec_udp_2.c +++ /dev/null @@ -1,968 +0,0 @@ -#include "tx_api.h" -#include "nx_api.h" -#include "netx_tahi.h" - -#if defined FEATURE_NX_IPV6 && defined NX_IPSEC_ENABLE && defined NX_TAHI_ENABLE - -#include "nx_tcp.h" -#include "nx_ip.h" -#include "nx_ipv6.h" -#include "nx_icmpv6.h" -#include "nx_ipsec.h" -#include "nx_crypto.h" -#include "nx_crypto_3des.h" -#include "nx_crypto_aes.h" -#include "nx_crypto_des.h" -#include "nx_crypto_dh.h" -#include "nx_crypto_hmac_md5.h" -#include "nx_crypto_hmac_sha1.h" -#include "nx_crypto_md5.h" -#include "nx_crypto_null.h" -#include "nx_crypto_sha1.h" - -#define DEMO_STACK_SIZE 2048 -#define TEST_INTERFACE 0 -#define IPSEC_MAX_END_NODE 10 -#define IPSEC_SA_LIFETIME 5000 - -/* Define the ThreadX and NetX object control blocks... */ - -static TX_THREAD thread_0; -static TX_THREAD thread_1; - -static NX_PACKET_POOL pool_0; -static NX_IP ip_0; -static NX_UDP_SOCKET socket_0; - -/* Define the counters used in the demo application... */ - -static ULONG error_counter; -static NXD_ADDRESS ipv6_address_1; -static NXD_ADDRESS ipv6_address_2; - -static NXD_ADDRESS tunnel_entry_address; -static NXD_ADDRESS tunnel_exit_address; - -/* Define IPSEC related data. */ - -static NX_IPSEC_SELECTOR ingress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SELECTOR egress_selectors[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA ingress_sa[IPSEC_MAX_END_NODE]; -static NX_IPSEC_SA egress_sa[IPSEC_MAX_END_NODE]; -static UCHAR ingress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR ingress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR ingress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_hmac_sha1[IPSEC_MAX_END_NODE][20]; -static UCHAR egress_3des_cbc[IPSEC_MAX_END_NODE][24]; -static UCHAR egress_aes_cbc[IPSEC_MAX_END_NODE][32]; -static UCHAR egress_aes_xcbc_mac[32]; -static UCHAR ingress_aes_xcbc_mac[32]; -static ULONG egress_spi[IPSEC_MAX_END_NODE]; -static ULONG ingress_spi[IPSEC_MAX_END_NODE]; -static UCHAR ingress_aes_ctr[32]; -static UCHAR egress_aes_ctr[32]; - -/* Define the Crypto Method */ - -static NX_CRYPTO_3DES egress_3des[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_3DES ingress_3des[IPSEC_MAX_END_NODE]; - -static NX_CRYPTO_AES egress_aes[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_AES ingress_aes[IPSEC_MAX_END_NODE]; -static NX_CRYPTO_AES egress_aes_xcbc; -static NX_CRYPTO_AES ingress_aes_xcbc; - -static NX_SHA1_HMAC metadata_egress_hmac_sha1[IPSEC_MAX_END_NODE]; -static NX_SHA1_HMAC metadata_ingress_hmac_sha1[IPSEC_MAX_END_NODE]; - -/* NULL encrypt */ -static NX_CRYPTO_METHOD crypto_method_null = -{ - NX_CRYPTO_ENCRYPTION_NULL, /* Name of the crypto algorithm */ - 0, /* Key size in bits, not used */ - 0, /* IV size in bits, not used */ - 0, /* ICV size in bits, not used */ - 4, /* Block size in bytes */ - 0, /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_null_operation /* NULL operation */ -}; - -/* 3DES, encrypt */ -static NX_CRYPTO_METHOD crypto_method_t_des = -{ - NX_CRYPTO_ENCRYPTION_3DES_CBC, /* 3DES-CBC crypto algorithm */ - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_3DES_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used */ - (NX_CRYPTO_3DES_BLOCK_SIZE_IN_BITS>>3), /* Block size in bytes */ - sizeof(NX_CRYPTO_3DES), /* 768 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_3des_init, /* 3DES-CBC initialization routine. */ - NX_NULL, /* 3DES-CBC cleanup routine, not used */ - _nx_ipsec_crypto_method_3des_operation /* 3DES-CBC operation */ -}; - -/* AES-CBC. */ -static NX_CRYPTO_METHOD crypto_method_aes_cbc = -{ - NX_CRYPTO_ENCRYPTION_AES_CBC, /* AES crypto algorithm */ - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_AES_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used. */ - (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ - sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ - NX_NULL, /* AES-CBC cleanup routine, not used. */ - _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ - -}; - -/* AES-CTR. */ -static NX_CRYPTO_METHOD crypto_method_aes_ctr = -{ - NX_CRYPTO_ENCRYPTION_AES_CTR, /* AES crypto algorithm */ - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, /* Key size in bits */ - NX_CRYPTO_AES_CTR_IV_LEN_IN_BITS, /* IV size in bits */ - 0, /* ICV size in bits, not used. */ - (NX_CRYPTO_AES_BLOCK_SIZE_IN_BITS >> 3), /* Block size in bytes. */ - sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ - _nx_ipsec_crypto_method_aes_init, /* AES-CBC initialization routine. */ - NX_NULL, /* AES-CBC cleanup routine, not used. */ - _nx_ipsec_crypto_method_aes_operation /* AES-CBC operation */ -}; - -/* HMAC SHA1 */ -static NX_CRYPTO_METHOD crypto_method_hmac_sha1 = -{ - NX_CRYPTO_AUTHENTICATION_HMAC_SHA1_96, /* HMAC SHA1 algorithm */ - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, /* Key size in bits */ - 0, /* IV size in bits, not used */ - NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ - 0, /* Block size in bytes, not used */ - 0, /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_hmac_sha1_operation /* HMAC SHA1 operation */ -}; - -/* AES_XCBC_96 */ -static NX_CRYPTO_METHOD crypto_method_aes_xcbc_mac = -{ - NX_CRYPTO_AUTHENTICATION_AES_XCBC_MAC_96, /* AES_XCBC_MAC algorithm */ - NX_CRYPTO_AES_XCBC_MAC_KEY_LEN_IN_BITS, /* Key size in bits */ - 0, /* IV size in bits, not used */ - NX_CRYPTO_AUTHENTICATION_ICV_TRUNC_BITS, /* Transmitted ICV size in bits */ - 0, /* Block size in bytes, not used */ - sizeof(NX_CRYPTO_AES), /* 262 */ /* Metadata size in bytes */ - NX_NULL, /* Initialization routine, not used */ - NX_NULL, /* Cleanup routine, not used */ - _nx_ipsec_crypto_method_aes_xcbc_mac_operation /* AES_XCBC_MAC operation */ -}; - -/* Define thread prototypes. */ -static void thread_0_entry(ULONG thread_input); -static void thread_1_entry(ULONG thread_input); -extern void test_control_return(UINT status); -extern void _nx_ram_network_driver_1500(struct NX_IP_DRIVER_STRUCT *driver_req); -extern UINT (*packet_process_callback)(NX_IP *ip_ptr, NX_PACKET *packet_ptr); -static void init_para(); -static UINT clean_sa(); -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa); - -static UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size); -extern UINT _nxd_udp_socket_send(NX_UDP_SOCKET *socket_ptr, NX_PACKET *packet_ptr, NXD_ADDRESS *ip_address, UINT port); - -/* Define the test threads. */ -extern TAHI_TEST_SEQ tahi_ipsec_udp_006[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_007[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_008[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_009[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_009_02[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_010[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_011[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_012[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_013[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_014[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_015[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_016[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_017[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_018[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_019[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_020[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_021[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_022[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_023[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_024[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_025[]; -extern TAHI_TEST_SEQ tahi_ipsec_udp_026[]; - -extern int tahi_ipsec_udp_006_size; -extern int tahi_ipsec_udp_007_size; -extern int tahi_ipsec_udp_008_size; -/* -extern int tahi_ipsec_udp_008_02_size; -*/ -extern int tahi_ipsec_udp_009_size; -extern int tahi_ipsec_udp_009_02_size; -extern int tahi_ipsec_udp_010_size; -extern int tahi_ipsec_udp_011_size; -extern int tahi_ipsec_udp_012_size; -extern int tahi_ipsec_udp_013_size; -extern int tahi_ipsec_udp_014_size; -extern int tahi_ipsec_udp_015_size; -extern int tahi_ipsec_udp_016_size; -extern int tahi_ipsec_udp_017_size; -extern int tahi_ipsec_udp_018_size; -extern int tahi_ipsec_udp_019_size; -extern int tahi_ipsec_udp_020_size; -extern int tahi_ipsec_udp_021_size; -extern int tahi_ipsec_udp_022_size; -extern int tahi_ipsec_udp_023_size; -extern int tahi_ipsec_udp_024_size; -extern int tahi_ipsec_udp_025_size; -extern int tahi_ipsec_udp_026_size; - -static TAHI_TEST_SUITE test_suite[30]; - -static void build_test_suite(void) -{ - - test_suite[0].test_case = &tahi_ipsec_udp_006[0]; test_suite[0].test_case_size = tahi_ipsec_udp_006_size; - test_suite[1].test_case = &tahi_ipsec_udp_007[0]; test_suite[1].test_case_size = tahi_ipsec_udp_007_size; - test_suite[2].test_case = &tahi_ipsec_udp_008[0]; test_suite[2].test_case_size = tahi_ipsec_udp_008_size; - // test_suite[3].test_case = &tahi_ipsec_udp_008_02[0]; test_suite[3].test_case_size = tahi_ipsec_udp_008_02_size; - test_suite[4].test_case = &tahi_ipsec_udp_009[0]; test_suite[4].test_case_size = tahi_ipsec_udp_009_size; - test_suite[5].test_case = &tahi_ipsec_udp_009_02[0]; test_suite[5].test_case_size = tahi_ipsec_udp_009_02_size; - test_suite[6].test_case = &tahi_ipsec_udp_010[0]; test_suite[6].test_case_size = tahi_ipsec_udp_010_size; - test_suite[7].test_case = &tahi_ipsec_udp_011[0]; test_suite[7].test_case_size = tahi_ipsec_udp_011_size; - test_suite[8].test_case = &tahi_ipsec_udp_012[0]; test_suite[8].test_case_size = tahi_ipsec_udp_012_size; - test_suite[9].test_case = &tahi_ipsec_udp_013[0]; test_suite[9].test_case_size = tahi_ipsec_udp_013_size; - test_suite[10].test_case = &tahi_ipsec_udp_014[0]; test_suite[10].test_case_size = tahi_ipsec_udp_014_size; - test_suite[11].test_case = &tahi_ipsec_udp_015[0]; test_suite[11].test_case_size = tahi_ipsec_udp_015_size; - test_suite[12].test_case = &tahi_ipsec_udp_016[0]; test_suite[12].test_case_size = tahi_ipsec_udp_016_size; - test_suite[13].test_case = &tahi_ipsec_udp_017[0]; test_suite[13].test_case_size = tahi_ipsec_udp_017_size; - test_suite[14].test_case = &tahi_ipsec_udp_018[0]; test_suite[14].test_case_size = tahi_ipsec_udp_018_size; - test_suite[15].test_case = &tahi_ipsec_udp_019[0]; test_suite[15].test_case_size = tahi_ipsec_udp_019_size; - // test_suite[16].test_case = &tahi_ipsec_udp_020[0]; test_suite[16].test_case_size = tahi_ipsec_udp_020_size; - // test_suite[17].test_case = &tahi_ipsec_udp_021[0]; test_suite[17].test_case_size = tahi_ipsec_udp_021_size; - test_suite[18].test_case = &tahi_ipsec_udp_022[0]; test_suite[18].test_case_size = tahi_ipsec_udp_022_size; - test_suite[19].test_case = &tahi_ipsec_udp_023[0]; test_suite[19].test_case_size = tahi_ipsec_udp_023_size; - test_suite[20].test_case = &tahi_ipsec_udp_024[0]; test_suite[20].test_case_size = tahi_ipsec_udp_024_size; - test_suite[21].test_case = &tahi_ipsec_udp_025[0]; test_suite[21].test_case_size = tahi_ipsec_udp_025_size; - test_suite[22].test_case = &tahi_ipsec_udp_026[0]; test_suite[22].test_case_size = tahi_ipsec_udp_026_size; - -} - - -/* Define what the initial system looks like. */ - -#ifdef CTEST -VOID test_application_define(void *first_unused_memory) -#else -void netx_tahi_test_ipsec_udp_2_define(void *first_unused_memory) -#endif -{ - CHAR *pointer; - UINT status; - - /* Setup the working pointer. */ - pointer = (CHAR *) first_unused_memory; - - error_counter = 0; - memset(&test_suite, 0, sizeof(test_suite)); - - build_test_suite(); - - /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Create udp process thread. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 0, - pointer, DEMO_STACK_SIZE, - 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); - - pointer = pointer + DEMO_STACK_SIZE; - - /* Initialize the NetX system. */ - nx_system_initialize(); - - /* Create a packet pool. */ - status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", 1600, pointer, 1600*16); - pointer = pointer + 1600*16; - - if(status) - error_counter++; - - /* Create an IP instance. */ - status = nx_ip_create(&ip_0, "NetX IP Instance 0", IP_ADDRESS(1,2,3,4), 0xFFFFFF00UL, &pool_0, _nx_ram_network_driver_1500, - pointer, 2048, 1); - pointer = pointer + 2048; - - /* Enable ICMP for IP Instance 0 and 1. */ - status = nxd_icmp_enable(&ip_0); - - /* Check ARP enable status. */ - if(status) - error_counter++; - - /* Enable IPv6 */ - status += nxd_ipv6_enable(&ip_0); - - /* Enable IPv6 */ - status += nx_ipsec_enable(&ip_0); - - /* Enable UDP */ - status += nx_udp_enable(&ip_0); - - /* Enable ARP and supply ARP cache memory for IP Instance 0. */ - status += nx_arp_enable(&ip_0, (void *) pointer, 1024); - pointer = pointer + 1024; - - /* Enable fragment processing for IP Instance 0. */ - status = nx_ip_fragment_enable(&ip_0); - - /* Set ipv6 version and address. */ - ipv6_address_1.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_1.nxd_ip_address.v6[0] = 0xfe800000; - ipv6_address_1.nxd_ip_address.v6[1] = 0x00000000; - ipv6_address_1.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_1.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_1, 64, NX_NULL); - - /* Set ipv6 version and address. */ - ipv6_address_2.nxd_ip_version = NX_IP_VERSION_V6; - ipv6_address_2.nxd_ip_address.v6[0] = 0x3ffe0501; - ipv6_address_2.nxd_ip_address.v6[1] = 0xffff0000; - ipv6_address_2.nxd_ip_address.v6[2] = 0x021122ff; - ipv6_address_2.nxd_ip_address.v6[3] = 0xfe334456; - - status += nxd_ipv6_address_set(&ip_0, 0, &ipv6_address_2, 64, NX_NULL); - - /* Check fragment enable status. */ - if(status) - error_counter++; -} - -static void thread_0_entry(ULONG thread_input) -{ -UINT status = 0; - init_para(); - - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - netx_tahi_run_test_case(&ip_0, test_suite[0].test_case, test_suite[0].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[1].test_case, test_suite[1].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[2].test_case, test_suite[2].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[4].test_case, test_suite[4].test_case_size); - - clean_sa(); - create_sa(5, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[5].test_case, test_suite[5].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[6].test_case, test_suite[6].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[7].test_case, test_suite[7].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[8].test_case, test_suite[8].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[9].test_case, test_suite[8].test_case_size); - netx_tahi_run_test_case(&ip_0, test_suite[10].test_case, test_suite[10].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_aes_xcbc_mac, - ingress_aes_xcbc_mac, egress_aes_xcbc_mac, - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &ingress_aes_xcbc, &egress_aes_xcbc, sizeof(NX_CRYPTO_AES)); - netx_tahi_run_test_case(&ip_0, test_suite[11].test_case, test_suite[11].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_null, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - 0, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - NX_NULL, NX_NULL, 0); - netx_tahi_run_test_case(&ip_0, test_suite[12].test_case, test_suite[12].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_aes_cbc, &crypto_method_aes_cbc, - ingress_aes_cbc[0], egress_aes_cbc[0], - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[13].test_case, test_suite[13].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_aes_ctr, &crypto_method_aes_ctr, - ingress_aes_ctr, egress_aes_ctr, - NX_CRYPTO_AES_128_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_aes[0], &egress_aes[0], sizeof(NX_CRYPTO_AES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[14].test_case, test_suite[14].test_case_size); - - clean_sa(); - create_sa(0, NX_IPSEC_TRANSPORT_MODE, - &crypto_method_null, &crypto_method_null, - ingress_3des_cbc[0], egress_3des_cbc[0], - 0, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - NX_NULL, NX_NULL, 0, - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - netx_tahi_run_test_case(&ip_0, test_suite[15].test_case, test_suite[15].test_case_size); - -//----------------------------Tunnel Mode test-------------------------------// - - clean_sa(); - create_sa(6, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - //Setup the tunnel source and destination address on IPSEC_TUNNEL_MODE - tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; - tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; - tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; - - tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; - tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; - tunnel_exit_address.nxd_ip_address.v6[3] = 0x00000001; - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[6], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[18].test_case, test_suite[18].test_case_size); - - - tunnel_entry_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_entry_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_entry_address.nxd_ip_address.v6[1] = 0xffff0000; - tunnel_entry_address.nxd_ip_address.v6[2] = 0x021122ff; - tunnel_entry_address.nxd_ip_address.v6[3] = 0xfe334456; - - tunnel_exit_address.nxd_ip_version = NX_IP_VERSION_V6; - tunnel_exit_address.nxd_ip_address.v6[0] = 0x3ffe0501; - tunnel_exit_address.nxd_ip_address.v6[1] = 0xffff0001; - tunnel_exit_address.nxd_ip_address.v6[2] = 0x00000000; - tunnel_exit_address.nxd_ip_address.v6[3] = 0x0000000e; - - clean_sa(); - create_sa(7, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[19].test_case, test_suite[19].test_case_size); - - clean_sa(); - create_sa(8, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - create_sa(9, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[9], egress_3des_cbc[9], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[9], egress_hmac_sha1[9], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[9], &egress_3des[9], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[8], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - status += _nx_ipsec_sa_tunnel_create(&egress_sa[9], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[20].test_case, test_suite[20].test_case_size); - - clean_sa(); - create_sa(7, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[21].test_case, test_suite[21].test_case_size); - - - clean_sa(); - create_sa(7, NX_IPSEC_TUNNEL_MODE, - &crypto_method_t_des, &crypto_method_t_des, - ingress_3des_cbc[0], egress_3des_cbc[0], - NX_CRYPTO_3DES_KEY_LEN_IN_BITS, - &crypto_method_hmac_sha1, - ingress_hmac_sha1[0], egress_hmac_sha1[0], - NX_CRYPTO_HMAC_SHA1_KEY_LEN_IN_BITS, - &ingress_3des[0], &egress_3des[0], sizeof(NX_CRYPTO_3DES), - &metadata_ingress_hmac_sha1[0], &metadata_egress_hmac_sha1[0], sizeof(NX_SHA1_HMAC)); - - status += _nx_ipsec_sa_tunnel_create(&egress_sa[7], &tunnel_entry_address, &tunnel_exit_address); - if (status) - error_counter++; - netx_tahi_run_test_case(&ip_0, test_suite[22].test_case, test_suite[22].test_case_size); - - test_control_return(0xdeadbeef); - - /* Clear the flags. */ - -} - -/* Initialize parameters for IPSec. */ -static void init_para() -{ - UINT i; - - /* Setup addresses of selectors. */ - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[1] = 0xffff0000; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[2] = 0x021122ff; - egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6[3] = 0xfe334456; - memcpy(&egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[i].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[i].nx_ipsec_selector_address.nx_selector_src_address_start, sizeof(NXD_ADDRESS)); - - ingress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - egress_selectors[i].nx_ipsec_selector_next_layer_protocol_id = NX_NULL; - ingress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - egress_selectors[i].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_PROTECT; - } - - /*Setup destination IP address. */ - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[0] = 0x3ffe0501; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0001; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000001; - memcpy(&egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[0].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[1].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[1].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[2].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[2].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[3].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[3].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 8-2 */ - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - egress_selectors[4].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_BYPASS; - - /* Used by test case 9-2 */ - - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_address.v6, 0xFF, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6, 0, 16); - memset(&ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6, 0xFF, 16); - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - egress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_src_address_end.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_version = NX_IP_VERSION_V6; - ingress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - egress_selectors[5].nx_ipsec_selector_policy = NX_IPSEC_TRAFFIC_DROP; - - /* Used by test case 22 */ - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[6].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[6].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - /* Used by test case 23 */ - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[2] = 0x00000000; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000000; - memcpy(&egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[2] = 0xFFFFFFFF; - egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end.nxd_ip_address.v6[3] = 0xFFFFFFFF; - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[7].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[7].nx_ipsec_selector_address.nx_selector_dst_address_end, sizeof(NXD_ADDRESS)); - - - /* Used by test case 24-1 */ - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[0].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[1] = 0xffff0002; - memcpy(&egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[8].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - - /* Used by test case 24-2 */ - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, - &egress_selectors[8].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start.nxd_ip_address.v6[3] = 0x00000002; - memcpy(&egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_start, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - memcpy(&ingress_selectors[9].nx_ipsec_selector_address.nx_selector_src_address_end, - &egress_selectors[9].nx_ipsec_selector_address.nx_selector_dst_address_start, sizeof(NXD_ADDRESS)); - - - /* Setup SPI. */ - ingress_spi[0] = 0x1000; - egress_spi[0] = 0x2000; - ingress_spi[1] = 0x3000; - egress_spi[1] = 0x4000; - ingress_spi[2] = 0x1000; - egress_spi[2] = 0x2000; - ingress_spi[3] = 0x1000; - egress_spi[3] = 0x3000; - ingress_spi[4] = 0x1000; - egress_spi[4] = 0x2000; - ingress_spi[5] = 0x1000; - egress_spi[5] = 0x2000; - ingress_spi[6] = 0x1000; - egress_spi[6] = 0x2000; - ingress_spi[7] = 0x1000; - egress_spi[7] = 0x2000; - ingress_spi[8] = 0x1000; - egress_spi[8] = 0x2000; - ingress_spi[9] = 0x3000; - egress_spi[9] = 0x4000; - - /* Setup encryption key. */ - memcpy(&ingress_3des_cbc[0], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[0], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[0], "ipv6readylogo3descbcout1", 24); - memcpy(&egress_hmac_sha1[0], "ipv6readylogsha1out1", 20); - - memcpy(&ingress_3des_cbc[1], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[1], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[1], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[1], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[2], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[2], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[2], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[2], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_3des_cbc[3], "ipv6readylogo3descbcin01", 24); - memcpy(&ingress_hmac_sha1[3], "ipv6readylogsha1in01", 20); - memcpy(&egress_3des_cbc[3], "ipv6readylogo3descbcout3", 24); - memcpy(&egress_hmac_sha1[3], "ipv6readylogsha1out3", 20); - - memcpy(&ingress_aes_cbc[0], "ipv6readaescin01", 16); - memcpy(&egress_aes_cbc[0], "ipv6readaescout1", 16); - - memcpy(&ingress_aes_ctr, "ipv6readylogaescin01", 20); - memcpy(&egress_aes_ctr, "ipv6readylogaescout1", 20); - - memcpy(&ingress_3des_cbc[9], "ipv6readylogo3descbcin02", 24); - memcpy(&ingress_hmac_sha1[9], "ipv6readylogsha1in02", 20); - memcpy(&egress_3des_cbc[9], "ipv6readylogo3descbcout2", 24); - memcpy(&egress_hmac_sha1[9], "ipv6readylogsha1out2", 20); - - memcpy(&ingress_aes_xcbc_mac, "ipv6readaesxin01", 16); - memcpy(&egress_aes_xcbc_mac, "ipv6readaesxout1", 16); - - /* Setup selectors. */ - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[2].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 129; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - egress_selectors[2].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 128; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 0; - ingress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 0; - - egress_selectors[3].nx_ipsec_selector_next_layer_protocol_id = NX_PROTOCOL_ICMPV6; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_start = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_type_end = 1; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_start = 4; - egress_selectors[3].nx_ipsec_selector_next_layer_protocol.nx_ipsec_selector_icmp.nx_selector_icmp_code_end = 4; - -} - - -/* Clean SA for IPSec. */ -static UINT clean_sa() -{ - - UINT status = 0, i; - - for(i = 0; i < IPSEC_MAX_END_NODE; i++) - { - if(ingress_sa[i].nx_ipsec_sa_id) - status = nx_ipsec_sa_delete(&ingress_sa[i]); - if(egress_sa[i].nx_ipsec_sa_id) - status += nx_ipsec_sa_delete(&egress_sa[i]); - - } - - return status; -} - -static VOID sa_timeout_process(NX_IP *ip_ptr, NX_IPSEC_SA *sa) -{ - - nx_ipsec_sa_update(sa, sa->nx_ipsec_sa_spi, NX_IPSEC_SA_MATURE, IPSEC_SA_LIFETIME, (IPSEC_SA_LIFETIME - 3), - sa->nx_ipsec_sa_encrypt_key_string, sa->nx_ipsec_sa_encryption_method -> nx_crypto_key_size_in_bits, - sa->nx_ipsec_sa_integrity_key_string, sa->nx_ipsec_sa_integrity_method -> nx_crypto_key_size_in_bits); - - return; -} - -/* Create SA for IPSec. */ -UINT create_sa(UINT index, UCHAR sa_mode, - NX_CRYPTO_METHOD* sa_encryption_method_ingress, NX_CRYPTO_METHOD* sa_encryption_method_egress, - UCHAR *sa_encryption_key_ingress, UCHAR *sa_encryption_key_egress, - UINT sa_encryption_key_len_in_bits, - NX_CRYPTO_METHOD* sa_integrity_method, - UCHAR *sa_integrity_key_ingress, UCHAR *sa_integrity_key_egress, - UINT sa_integrity_key_len_in_bits, - VOID *crypto_metadata_area_ingress, VOID *crypto_metadata_area_egress, ULONG crypto_metadata_size, - VOID *authentication_metadata_area_ingress, VOID *authentication_metadata_area_egress, ULONG authentication_metadata_size) -{ - - UINT status; - - status = _nx_ipsec_sa_create(&ip_0, &ingress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_INGRESS, &ingress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, ingress_spi[index], - sa_encryption_method_ingress, crypto_metadata_area_ingress, crypto_metadata_size, - sa_encryption_key_ingress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_ingress, authentication_metadata_size, - sa_integrity_key_ingress, sa_integrity_key_len_in_bits); - - if (status) - error_counter++; - - status += _nx_ipsec_sa_create(&ip_0, &egress_sa[index], sa_mode, NX_PROTOCOL_NEXT_HEADER_ENCAP_SECURITY, - NX_IPSEC_MANUAL_KEY, NX_IPSEC_SA_EGRESS, &egress_selectors[index], IPSEC_SA_LIFETIME, - (IPSEC_SA_LIFETIME) - 3, sa_timeout_process, 0, egress_spi[index], - sa_encryption_method_egress, crypto_metadata_area_egress, crypto_metadata_size, - sa_encryption_key_egress, sa_encryption_key_len_in_bits, - sa_integrity_method, authentication_metadata_area_egress, authentication_metadata_size, - sa_integrity_key_egress, sa_integrity_key_len_in_bits); - if (status) - error_counter++; - - return status; -} - -/* Process udp packet. */ -static void thread_1_entry(ULONG thread_input) -{ - - NX_PACKET *tx_packet, *rx_packet; - UINT status; - NX_IPV6_HEADER *ipv6_header; - NXD_ADDRESS ipv6_address; /* Destination Addresses. */ - - /* Create a UDP socket. */ - status = nx_udp_socket_create(&ip_0, &socket_0, "Socket 0", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); - - if (status) - { - error_counter++; - return; - } - - /* Bind the UDP socket to the IP port. */ - status = nx_udp_socket_bind(&socket_0, 7, TX_WAIT_FOREVER); - - /* Check status. */ - if (status) - { - error_counter++; - return; - } - - while(1) - { - status = nx_udp_socket_receive(&socket_0, &rx_packet, TX_WAIT_FOREVER); - if (status == NX_SUCCESS) - { - status = nx_packet_allocate(&pool_0, &tx_packet, NX_UDP_PACKET, TX_WAIT_FOREVER); - if (status != NX_SUCCESS) - { - break; - } - - status = nx_packet_data_append(tx_packet, rx_packet -> nx_packet_prepend_ptr, rx_packet -> nx_packet_length, &pool_0, TX_WAIT_FOREVER); - if (status != NX_SUCCESS) - { - nx_packet_release(rx_packet); - break; - } - - ipv6_header = (NX_IPV6_HEADER*)(rx_packet -> nx_packet_ip_header); - ipv6_address.nxd_ip_version = NX_IP_VERSION_V6; - memcpy(ipv6_address.nxd_ip_address.v6, ipv6_header -> nx_ip_header_source_ip, (sizeof(ULONG) << 2)); - - status = _nxd_udp_socket_send(&socket_0, tx_packet, &ipv6_address, 100 * NX_IP_PERIODIC_RATE); - if (status != NX_SUCCESS) - { - nx_packet_release(tx_packet); - } - - nx_packet_release(rx_packet); - } - } -} - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_001.c b/test/regression/tahi_test/tahi_ipsec_001.c deleted file mode 100644 index 2ed33b24..00000000 --- a/test/regression/tahi_test/tahi_ipsec_001.c +++ /dev/null @@ -1,163 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - -#if 0 -static char pkt1[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt2[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt3[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, -0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt5[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, -0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, -0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, -0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, -0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -#if 0 -static char pkt6[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt7[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; -#endif - -static char pkt8[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, -0x27, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, -0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; - -static char pkt9[] = { -0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x21, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt10[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0x5e, 0xde, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt11[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x81, 0x00, -0x26, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, -0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; - -TAHI_TEST_SEQ tahi_ipsec_001[] = { - {TITLE, "IPSEC-001", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {CHECK, &pkt4[0], sizeof(pkt4), 5, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 6, 0, 0, 0, 0}, - - {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, - {CHECK, &pkt9[0], sizeof(pkt9), 5, 0, 0, 0, 0}, - {INJECT, &pkt10[0], sizeof(pkt10), 0, 0, 0, 0, 0}, - {CHECK, &pkt11[0], sizeof(pkt11), 5, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_001_size = sizeof(tahi_ipsec_001) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_002.c b/test/regression/tahi_test/tahi_ipsec_002.c deleted file mode 100644 index 8bb858fc..00000000 --- a/test/regression/tahi_test/tahi_ipsec_002.c +++ /dev/null @@ -1,147 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt3[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt4[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, -0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xc3, 0xcd, -0x45, 0xa5, 0x4a, 0x1b, 0x5b, 0xd7, 0xe6, 0x82, -0x6a, 0x43, 0x30, 0xff, 0x58, 0x56, 0x10, 0x1d, -0xc6, 0xa4, 0xd9, 0x5a, 0x04, 0xb8, 0x51, 0x57, -0x41, 0xc2, 0x27, 0xa8, 0xcb, 0x42, 0xc7, 0x31, -0x8d, 0x69, 0x1d, 0xa1, 0x5d, 0xb4, 0xd4, 0xb6, -0x44, 0xa2 }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xdb, -0x7b, 0x6d, 0x40, 0x42, 0xc4, 0xc7, 0x26, 0x1a, -0x21, 0x3d, 0xd3, 0xda, 0xe0, 0x04, 0xe7, 0xb1, -0x81, 0x65, 0x20, 0x0d, 0x06, 0x0d, 0x84, 0x03, -0x47, 0x76, 0x0e, 0xdc, 0x29, 0x06, 0xa5, 0x9d, -0x92, 0xe3 }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x46, 0xf6, -0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xa2, 0x3c, -0xec, 0x11, 0xcf, 0x7c, 0x42, 0xf6, 0xce, 0xdb, -0x38, 0x12, 0x60, 0x8a, 0xe8, 0x72, 0xdb, 0xfd, -0x2b, 0x4e, 0x7b, 0xda, 0xda, 0x51, 0x89, 0xf5, -0xc5, 0xc1, 0x10, 0xde, 0xf2, 0xed, 0x59, 0x45, -0x70, 0x17, 0xdb, 0x80, 0xd8, 0x7f, 0xd8, 0xb7, -0x4c, 0x7a }; - -#if 0 -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt8[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_002[] = { - {TITLE, "IPSEC-002", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, - {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_002_size = sizeof(tahi_ipsec_002) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_003.c b/test/regression/tahi_test/tahi_ipsec_003.c deleted file mode 100644 index 4d83247a..00000000 --- a/test/regression/tahi_test/tahi_ipsec_003.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x5b, -0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0xb1, 0x48, -0xcd, 0x18, 0xfd, 0x0e, 0x2d, 0xca, 0x81, 0x91, -0x6e, 0xa3, 0xcd, 0xe8, 0x52, 0x37, 0xd6, 0x5a, -0x75, 0x88, 0xfd, 0x12, 0xef, 0x19, 0x37, 0x2e, -0x7a, 0xdc, 0xe6, 0xab, 0xb5, 0xb6, 0xd3, 0x45, -0x26, 0x57, 0x12, 0x65, 0xd9, 0x81, 0x94, 0xef, -0xe2, 0x0b }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x27, 0x10, -0x7a, 0x69, 0x00, 0x16, 0xf2, 0x33, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x6c, 0x32, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x78, 0x7f, -0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0xd1, 0xa6, -0x97, 0x51, 0xa3, 0x0c, 0x3b, 0xff, 0x3d, 0xbc, -0x2f, 0x72, 0x15, 0xca, 0x85, 0x0c, 0xed, 0xc9, -0x3c, 0x16, 0x8f, 0x22, 0xa8, 0x06, 0xab, 0x70, -0xeb, 0x41, 0xc7, 0xff, 0xe4, 0x23, 0x6f, 0x98, -0x04, 0x25, 0xc4, 0xcd, 0x08, 0xff, 0xbb, 0x52, -0x6c, 0xf4, 0x91, 0x3e, 0x2b, 0xe6, 0xe6, 0x4f, -0x75, 0xba, 0x6c, 0x35, 0x90, 0x24, 0xfe, 0xf7, -0xc7, 0x7e, 0xf3, 0x12, 0x2b, 0xd3, 0x7e, 0x8b, -0x76, 0x0e, 0x09, 0x89, 0x8a, 0x7a, 0x80, 0x3f, -0x7f, 0x8c, 0xbc, 0x58, 0x2b, 0x4a, 0x11, 0x11, -0x37, 0x20, 0x9b, 0xc6, 0x4c, 0xa1, 0x3b, 0xd4, -0x7e, 0x55 }; - -TAHI_TEST_SEQ tahi_ipsec_003[] = { - {TITLE, "IPSEC-003", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_PROTOCOL_ICMPV6, 0, 0, 0x8100}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_PROTOCOL_ICMPV6, 0, 0, 0x0104}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_003_size = sizeof(tahi_ipsec_003) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_004.c b/test/regression/tahi_test/tahi_ipsec_004.c deleted file mode 100644 index ffaa6733..00000000 --- a/test/regression/tahi_test/tahi_ipsec_004.c +++ /dev/null @@ -1,119 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68, 0x48, -0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0xdd, 0x46, -0x5c, 0xea, 0xe5, 0x8d, 0x53, 0x63, 0x0c, 0xcb, -0x5e, 0xe8, 0x1e, 0x3a, 0x6d, 0xe6, 0xb1, 0x43, -0x1c, 0x50, 0x0d, 0x1e, 0x29, 0x06, 0x0b, 0xb3, -0xa0, 0xfe, 0x3c, 0x53, 0x3d, 0xb6, 0x4d, 0x5a, -0x36, 0xdf, 0x54, 0x0e, 0x93, 0x89, 0x8e, 0x44, -0x31, 0x72 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0x5a, 0x47, -0x8b, 0x08, 0x88, 0x5b, 0xd1, 0xce, 0x49, 0xfd, -0xe6, 0x6b }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb7, -0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0xef, 0x55, -0xca, 0x2d, 0xc0, 0x4a, 0x54, 0x46, 0x0f, 0x51, -0xfc, 0x9b, 0xf7, 0xd4, 0xfa, 0x10, 0xc4, 0x76, -0xae, 0xed, 0xce, 0x73, 0x41, 0x51, 0xe9, 0x20, -0xde, 0xf7, 0x03, 0x8c, 0x11, 0xbe, 0x1d, 0x64, -0x4d, 0xa5, 0x0d, 0x19, 0x89, 0x0f, 0x2a, 0xbd, -0x91, 0xfe }; - -TAHI_TEST_SEQ tahi_ipsec_004[] = { - {TITLE, "IPSEC-004", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_004_size = sizeof(tahi_ipsec_004) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_005.c b/test/regression/tahi_test/tahi_ipsec_005.c deleted file mode 100644 index d0905769..00000000 --- a/test/regression/tahi_test/tahi_ipsec_005.c +++ /dev/null @@ -1,1411 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x43, -0x0e, 0xfc, 0xdf, 0xe1, 0x55, 0x09, 0xe6, 0x10, -0x1c, 0xc7, 0x9e, 0xb4, 0x3b, 0xdc, 0x58, 0x5a, -0x0d, 0xf0, 0x56, 0x9e, 0x35, 0xab, 0x9c, 0x42, -0x33, 0xef, 0x87, 0x87, 0xa1, 0x2f, 0x31, 0xc4, -0x34, 0xd0, 0x88, 0x89, 0x32, 0x99, 0x11, 0x19, -0x61, 0x85, 0x5d, 0x0b, 0x92, 0x64, 0x77, 0xd0, -0xc3, 0x9c, 0x91, 0x5b, 0xbb, 0xd3, 0xed, 0xef, -0x48, 0x68, 0xdb, 0x33, 0xfd, 0x86, 0x3e, 0x83, -0xdd, 0xb3, 0x27, 0x52, 0xa7, 0x79, 0xb8, 0xfe, -0x24, 0x35, 0xb7, 0x6c, 0x19, 0xbc, 0x97, 0x9d, -0x95, 0xdf, 0x8d, 0xc0, 0x29, 0xab, 0xbc, 0x8a, -0x94, 0xce, 0x29, 0xd7, 0x14, 0xa2, 0xc4, 0x26, -0xa3, 0x23, 0xcf, 0xf0, 0xce, 0x0c, 0x42, 0x81, -0xd1, 0x39, 0x01, 0xbd, 0xfc, 0x76, 0xe6, 0xaa, -0x64, 0x1c, 0x18, 0x81, 0x2d, 0x46, 0x1e, 0x21, -0xf8, 0x5d, 0x77, 0xf4, 0x45, 0x94, 0x8b, 0xaf, -0x9a, 0x6a, 0x78, 0x2e, 0xc2, 0x9c, 0xf2, 0xa2, -0xb6, 0xfb, 0x98, 0xf2, 0x02, 0xc5, 0x58, 0x96, -0xc0, 0x13, 0xe5, 0xa9, 0xc4, 0xdc, 0x6b, 0xce, -0x07, 0xad, 0x54, 0xd3, 0x24, 0x0a, 0x05, 0x6f, -0xb8, 0x9b, 0x17, 0xc1, 0xc0, 0x1f, 0xec, 0x08, -0x76, 0x4f, 0x9e, 0x7f, 0x94, 0x22, 0xa0, 0x84, -0xca, 0xe5, 0xd7, 0x16, 0x73, 0x3d, 0x85, 0xd9, -0x0d, 0x18, 0xcf, 0x42, 0x4e, 0x59, 0x6d, 0x77, -0x45, 0x63, 0xd7, 0x4c, 0xe8, 0x12, 0xfa, 0x1b, -0x28, 0x8c, 0xdb, 0xe0, 0xcc, 0x46, 0xad, 0xc1, -0x2c, 0xb6, 0xab, 0xdb, 0x57, 0xd6, 0x08, 0x52, -0x54, 0x69, 0x96, 0x7c, 0x56, 0x4d, 0x8e, 0x9b, -0x6a, 0x23, 0xca, 0x67, 0xca, 0x05, 0xc4, 0x25, -0xba, 0x9f, 0xa0, 0x65, 0x4f, 0x4e, 0xee, 0x68, -0xa7, 0x8a, 0x5b, 0x5f, 0xfb, 0x76, 0x20, 0x7b, -0x3c, 0x88, 0xb3, 0xde, 0xdd, 0x59, 0x68, 0xc7, -0x55, 0x7d, 0x02, 0x70, 0x7f, 0xb2, 0x43, 0x2f, -0x40, 0xde, 0x25, 0x1a, 0xf9, 0xfa, 0xa3, 0x14, -0x87, 0xe3, 0xea, 0xff, 0xfd, 0xd6, 0xa3, 0x6f, -0xfe, 0x30, 0x0c, 0x61, 0xf2, 0x3f, 0xae, 0x7a, -0x6b, 0xc3, 0x29, 0x4b, 0x5e, 0xd2, 0x51, 0x32, -0x2a, 0x82, 0x3c, 0x16, 0x39, 0x72, 0x5d, 0x21, -0xd4, 0x14, 0x35, 0x5e, 0xdc, 0x62, 0x54, 0x77, -0x62, 0xf7, 0x0a, 0x7d, 0xc3, 0x7e, 0x88, 0xb1, -0xd2, 0x81, 0x83, 0x17, 0x2d, 0x54, 0x28, 0x21, -0x90, 0x36, 0xc0, 0x23, 0x89, 0x4d, 0x03, 0xf6, -0xea, 0x5b, 0x7e, 0x11, 0xf6, 0xe4, 0xeb, 0x7b, -0x26, 0xef, 0xa2, 0x48, 0xf9, 0xdd, 0xd1, 0xdd, -0xfd, 0x55, 0x33, 0x16, 0x73, 0xdb, 0x31, 0x26, -0x13, 0x26, 0xa8, 0x59, 0xef, 0x20, 0x12, 0xa6, -0x4a, 0x29, 0x33, 0x6a, 0x14, 0x12, 0xb5, 0x6d, -0x51, 0x49, 0xc0, 0xcf, 0x47, 0xd6, 0x0f, 0x0f, -0xef, 0x47, 0x59, 0x46, 0xbe, 0xe1, 0x72, 0x29, -0x76, 0xe3, 0xae, 0x62, 0x91, 0xb1, 0x6a, 0x66, -0x77, 0x65, 0x52, 0x89, 0xdd, 0x16, 0x6a, 0xbd, -0xae, 0xe4, 0x6e, 0x54, 0x8e, 0x40, 0x75, 0x30, -0xf1, 0xc9, 0x0b, 0x30, 0x15, 0x5d, 0x4b, 0x27, -0xe6, 0x35, 0x24, 0x19, 0x46, 0xdf, 0x7d, 0x7d, -0x73, 0xb6, 0x0c, 0x63, 0x15, 0x24, 0x01, 0xd2, -0xf1, 0x5a, 0xda, 0xb9, 0xf6, 0xe8, 0xf5, 0x97, -0x99, 0x51, 0x79, 0x4c, 0x3b, 0xbd, 0xa8, 0x92, -0x24, 0xf8, 0xb9, 0xcc, 0x27, 0xd5, 0xa4, 0xa2, -0xca, 0xec, 0x87, 0x00, 0x21, 0x3a, 0x73, 0x1e, -0x48, 0x22, 0x1d, 0x5f, 0x01, 0x5c, 0x95, 0x6e, -0xf1, 0xd0, 0x2a, 0x71, 0xa9, 0x2b, 0xee, 0x51, -0xaf, 0x9d, 0xd8, 0x76, 0xa2, 0x4b, 0xea, 0x90, -0xf4, 0xf6, 0xb6, 0x89, 0x9d, 0xf8, 0x17, 0x41, -0x5d, 0xa5, 0x72, 0xd9, 0xb0, 0xb8, 0x72, 0x0e, -0x4a, 0x51, 0x86, 0xcb, 0xe5, 0x10, 0xd2, 0x25, -0x95, 0x47, 0x1c, 0xd1, 0x7d, 0x7a, 0x94, 0xf6, -0x42, 0x8b, 0xd8, 0xbb, 0xbc, 0xe1, 0x00, 0x88, -0x23, 0x06, 0x80, 0xeb, 0xde, 0x21, 0xb0, 0xf1, -0xd7, 0x2f, 0x04, 0x3c, 0x09, 0x8e, 0xae, 0x6b, -0x68, 0x2e, 0x39, 0xa9, 0x5b, 0x53, 0x1a, 0xca, -0xbd, 0x0d, 0x77, 0xb5, 0x48, 0xf8, 0x50, 0x29, -0x6d, 0x6f, 0x72, 0xab, 0x77, 0x5f, 0xa5, 0x2e, -0xe0, 0x7c, 0x59, 0x5f, 0xe4, 0x52, 0x45, 0x57, -0x54, 0x62, 0x9b, 0xf5, 0x50, 0xea, 0xc1, 0x83, -0x35, 0x89, 0x64, 0x5a, 0x77, 0xd6, 0x10, 0x21, -0x7d, 0x20, 0x93, 0x01, 0x01, 0x85, 0x12, 0x7f, -0xaa, 0xeb, 0x8a, 0xda, 0xfa, 0x32, 0x45, 0xd7, -0x10, 0x6d, 0x65, 0xdf, 0x81, 0x47, 0x17, 0x44, -0x52, 0xc2, 0xd6, 0x13, 0x8f, 0xd6, 0xef, 0x40, -0xe4, 0x4d, 0xf5, 0xca, 0x2d, 0xc4, 0xbd, 0x31, -0x2d, 0xc3, 0x98, 0xd9, 0x6d, 0x39, 0x4f, 0xe1, -0x83, 0xba, 0xae, 0xf3, 0x96, 0x2b, 0x52, 0x1b, -0x54, 0xe9, 0x7c, 0x98, 0x29, 0x54, 0xe8, 0x23, -0x8b, 0x38, 0x95, 0xe5, 0xc0, 0x18, 0xca, 0xa8, -0x28, 0xc3, 0x65, 0xdf, 0x66, 0x8e, 0x12, 0x9c, -0xbd, 0x03, 0x7f, 0xba, 0xbe, 0x7c, 0x53, 0xf3, -0x56, 0xb0, 0xb3, 0xe3, 0xf2, 0x0d, 0x46, 0x6c, -0xc0, 0x8b, 0x24, 0x73, 0xd1, 0xea, 0xc1, 0xfe, -0x1c, 0xca, 0x79, 0xa0, 0x7e, 0x92, 0x78, 0x7d, -0x64, 0x7c, 0x77, 0xf0, 0x6f, 0x32, 0x3b, 0x68, -0xdf, 0x41, 0x57, 0x0d, 0x79, 0x18, 0x2c, 0xea, -0x40, 0x75, 0x2a, 0xb2, 0x89, 0xf5, 0xfa, 0xb8, -0x7a, 0x66, 0x7a, 0xaa, 0x23, 0x24, 0x8c, 0xdd, -0x77, 0x41, 0xf4, 0x89, 0x16, 0xf4, 0x83, 0x19, -0x00, 0x96, 0x19, 0x02, 0x61, 0x3c, 0x96, 0x3f, -0x60, 0x22, 0xdc, 0x2e, 0x98, 0xa2, 0x42, 0xf2, -0x89, 0x61, 0x3d, 0x63, 0x2a, 0x27, 0x1a, 0x6c, -0x0a, 0xc5, 0x1e, 0x5e, 0xd3, 0xde, 0xa5, 0xf4, -0x5a, 0x9d, 0xe5, 0xe9, 0x18, 0x4a, 0x6b, 0xd8, -0xdd, 0xaf, 0x4d, 0xca, 0x5d, 0x26, 0x18, 0x68, -0x28, 0x53, 0x14, 0x08, 0x3b, 0xce, 0x57, 0x6b, -0xf9, 0xd3, 0x73, 0xcb, 0x01, 0xbc, 0x70, 0x92, -0x6b, 0xa5, 0xb7, 0xa1, 0x77, 0x7d, 0x3c, 0xa5, -0x23, 0xaf, 0x20, 0xa1, 0x96, 0x99, 0xa3, 0x87, -0xdc, 0x1d, 0xad, 0xf0, 0x60, 0xc4, 0x02, 0xc1, -0x38, 0xe8, 0x4e, 0xf4, 0xc5, 0x8c, 0x50, 0xde, -0x9a, 0x1a, 0x9b, 0x68, 0xca, 0x96, 0xb4, 0x37, -0x3b, 0x2b, 0xe6, 0x04, 0xb1, 0x89, 0x4f, 0x27, -0xd6, 0x08, 0x15, 0x6c, 0x72, 0x4b, 0x6e, 0xbe, -0x85, 0x9c, 0x43, 0x72, 0xc0, 0x43, 0xe3, 0x26, -0xe0, 0x0a, 0xb6, 0x9e, 0x05, 0xe2, 0x33, 0x7f, -0xec, 0x52, 0x87, 0x9e, 0x58, 0x41, 0x5d, 0xbf, -0x12, 0x51, 0x8e, 0xa6, 0x19, 0xdf, 0xc5, 0xf4, -0xea, 0x98, 0x27, 0x72, 0xaa, 0x19, 0xa4, 0xae, -0x80, 0x84, 0x15, 0x8d, 0xb6, 0x04, 0xdd, 0x4a, -0x4f, 0xd4, 0x51, 0xa9, 0x5e, 0x03, 0xb5, 0x96, -0x54, 0x10, 0x66, 0x97, 0x38, 0x87, 0x0f, 0xa3, -0xc5, 0x7f, 0x24, 0x23, 0x46, 0x3d, 0xd4, 0x91, -0x06, 0x0c, 0x23, 0xe6, 0x40, 0x0d, 0x2f, 0x1c, -0x7b, 0xe2, 0x48, 0x06, 0x3a, 0x45, 0x38, 0x51, -0xae, 0xd8, 0xfb, 0xa9, 0xb6, 0x12, 0x47, 0xbb, -0xa9, 0x60, 0xeb, 0x62, 0x61, 0x6f, 0xfd, 0xc9, -0xf2, 0x67, 0xb0, 0xb4, 0x51, 0x3c, 0x5a, 0x48, -0xaf, 0x69, 0x18, 0xe2, 0xa0, 0x61, 0x5a, 0xc7, -0x0d, 0x0f, 0xe5, 0x09, 0x95, 0xed, 0x43, 0xba, -0x0a, 0xfc, 0xd3, 0xfb, 0xe7, 0x85, 0x1e, 0x63, -0xfe, 0x09, 0x6d, 0xe3, 0x2d, 0xd1, 0x72, 0x0e, -0x1d, 0x39, 0x8c, 0x89, 0x82, 0x9f, 0x92, 0x23, -0x25, 0xe5, 0xdb, 0xce, 0x84, 0x6d, 0xce, 0x98, -0x0f, 0x3f, 0x40, 0x89, 0x47, 0xbe, 0xf2, 0x51, -0xce, 0x82, 0x20, 0x02, 0x6a, 0xb9, 0x9a, 0x9f, -0x1e, 0x77, 0xdc, 0x66, 0x3f, 0x82, 0x26, 0xe3, -0x10, 0x6d, 0x02, 0xc9, 0x39, 0x09, 0xca, 0x2b, -0x0e, 0x8b, 0x7d, 0x91, 0x45, 0x52, 0x46, 0x0e, -0x59, 0x86, 0xc4, 0x1f, 0x3f, 0xa3, 0x88, 0x59, -0x0f, 0xa8, 0x4d, 0xe4, 0xd0, 0xa7, 0x41, 0x58, -0x9e, 0x9e, 0x09, 0x37, 0x55, 0xda, 0x32, 0x03, -0x48, 0x1e, 0xe7, 0x03, 0x6c, 0xb2, 0xb6, 0x21, -0xbb, 0x85, 0x0c, 0x55, 0xc1, 0xa1, 0x36, 0xf4, -0xa9, 0xb7, 0xbe, 0xc7, 0xfa, 0x95, 0x9f, 0xd5, -0x5c, 0x8e, 0x16, 0x99, 0x3c, 0x83, 0x2f, 0x4f, -0x54, 0x78, 0xaf, 0xb1, 0x33, 0xf9, 0xf0, 0x78, -0x21, 0x7f, 0x74, 0x29, 0x29, 0xa2, 0xdd, 0xd3, -0xaa, 0x56, 0xdb, 0x33, 0x9d, 0x46, 0xc1, 0xeb, -0x80, 0xd7, 0x98, 0xb5, 0x4f, 0x56, 0x56, 0x94, -0x3c, 0x4f, 0xb3, 0x3d, 0x9a, 0x88, 0xa4, 0xc3, -0x92, 0x56, 0x8b, 0xc0, 0xe4, 0xb7, 0xb1, 0x0c, -0xc4, 0x6a, 0x1c, 0x0f, 0x4c, 0x18, 0x03, 0xdc, -0x2d, 0xaa, 0x1c, 0xea, 0x52, 0xe2, 0x02, 0x12, -0x88, 0xdc, 0xa2, 0xe1, 0xa1, 0xb8, 0x0e, 0xcc, -0x7b, 0x19, 0x28, 0xac, 0x7d, 0xe6, 0x0c, 0xb1, -0xc6, 0x4b, 0xcc, 0x00, 0xde, 0x65, 0x69, 0xd6, -0xd4, 0xd6, 0x75, 0x12, 0xad, 0xaf, 0x2f, 0x8f, -0x56, 0x0f, 0xb2, 0xc9, 0x0a, 0xd9, 0xb9, 0x2a, -0x18, 0xc5, 0x79, 0x32, 0x96, 0xa3, 0x62, 0x36, -0x4c, 0xbe, 0xcd, 0xa8, 0x3e, 0x39, 0xc7, 0xdf, -0x69, 0x0f, 0x83, 0x36, 0x6e, 0x60, 0xf7, 0x49, -0x82, 0x40, 0x5d, 0xb7, 0xf8, 0x91, 0x99, 0xa0, -0x22, 0x9f, 0xec, 0xf2, 0x96, 0x49, 0x25, 0xa5, -0xa3, 0x0a, 0xd5, 0x11, 0x3b, 0xd7, 0xaf, 0x4f, -0x6b, 0x22, 0x83, 0x76, 0x81, 0x2e, 0x58, 0xb5, -0x72, 0x57, 0xe9, 0x3c, 0x5e, 0x62, 0x72, 0x7f, -0x9f, 0xf0, 0x71, 0xdd, 0x4c, 0xf9, 0x21, 0xf4, -0x68, 0x2e, 0x60, 0xb7, 0x9d, 0x0d, 0xa2, 0x69, -0x43, 0xf4, 0x7a, 0x89, 0x5c, 0x70, 0xe8, 0xb3, -0x96, 0x01, 0xb0, 0xf8, 0xda, 0xee, 0xbc, 0xea, -0x0f, 0x1c, 0xce, 0x13, 0xc9, 0x70, 0xf0, 0x6e, -0x21, 0x0f, 0x84, 0xaf, 0xf1, 0x43, 0xbe, 0xda, -0x28, 0x5f, 0x5f, 0x84, 0xf8, 0x3f, 0x83, 0x64, -0x03, 0x66, 0xff, 0x63, 0x0e, 0x40, 0xdc, 0x69, -0xcb, 0x85, 0xe4, 0x6a, 0x03, 0xc8, 0x70, 0x83, -0x47, 0xf2, 0xa8, 0x60, 0x50, 0x9b, 0xd3, 0x48, -0x51, 0xf5, 0xa7, 0xfc, 0xf3, 0x6c, 0x21, 0xc1, -0xa2, 0x67, 0xab, 0x44, 0xa7, 0x05, 0x93, 0xc5, -0x9d, 0x60, 0x1c, 0x61, 0x39, 0x7e, 0xe1, 0x35, -0x83, 0x27, 0x67, 0xbf, 0x5c, 0x72, 0xdb, 0x1c, -0xc3, 0x06, 0x78, 0xa4, 0x79, 0x86, 0xa0, 0x52, -0x9f, 0xc7, 0xaa, 0xe2, 0x23, 0xb5, 0x35, 0x63, -0x5b, 0x52, 0x54, 0x2d, 0x5d, 0xdb, 0x33, 0x34, -0x5d, 0x6d, 0x9d, 0xab, 0x23, 0x87, 0x1c, 0xdd, -0x06, 0x1a }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2b, 0xa5, -0xa3, 0x70, 0xf1, 0xba, 0xe4, 0x28, 0xf6, 0x3a, -0x99, 0x01, 0x2a, 0xa2, 0x79, 0x13, 0x04, 0xe5, -0xc9, 0x4b, 0x4f, 0x51, 0x13, 0xef, 0x95, 0xc4, -0x13, 0x28, 0xb2, 0x3c, 0xac, 0xdf, 0x21, 0x13, -0xf4, 0x33, 0xec, 0x69, 0xea, 0xe2, 0x39, 0xba, -0x0c, 0x9d, 0x9c, 0xa1, 0x61, 0xd8, 0xd3, 0x69, -0xb2, 0x77, 0x14, 0xde, 0x9f, 0x8f, 0x3c, 0xe4, -0xb0, 0x90, 0x59, 0xbe, 0xd9, 0x77, 0x44, 0xd1, -0x98, 0x6c, 0x77, 0x13, 0x4d, 0xc6, 0xab, 0x68, -0xc4, 0xe9, 0xac, 0x72, 0x1f, 0x2c, 0x3b, 0x13, -0xfe, 0xcd, 0x16, 0x4b, 0xb5, 0x65, 0xb4, 0x38, -0x33, 0xc1, 0x48, 0x2a, 0x84, 0xe4, 0xdd, 0x2a, -0x3c, 0x91, 0xb2, 0x87, 0x0f, 0x21, 0xc3, 0xee, -0x53, 0xb5, 0x02, 0x9f, 0x6b, 0xd7, 0x11, 0x44, -0xfe, 0x80, 0x76, 0x21, 0xf0, 0x93, 0xa3, 0x6b, -0x25, 0x59, 0x98, 0x63, 0xaa, 0x67, 0xb4, 0x85, -0x68, 0x3a, 0xaf, 0x83, 0x97, 0x96, 0xbb, 0xdb, -0xcb, 0x70, 0x9c, 0x09, 0xb1, 0xf3, 0xd9, 0x97, -0x45, 0xc4, 0x83, 0x8c, 0x2b, 0x5f, 0x04, 0xe8, -0x8f, 0xb1, 0x58, 0x11, 0x38, 0xe1, 0x3c, 0xa3, -0xca, 0x37, 0x69, 0xa7, 0x7f, 0x55, 0x42, 0xa9, -0x38, 0xfb, 0xa8, 0xad, 0xfc, 0x1e, 0x41, 0x08, -0xa5, 0x14, 0x23, 0xab, 0xa9, 0x7d, 0x9c, 0x90, -0x10, 0x2b, 0x6c, 0xc8, 0xe9, 0x9e, 0x2b, 0x8e, -0x45, 0x7e, 0xc8, 0x3b, 0x4b, 0xb7, 0xd3, 0xc1, -0xd8, 0x71, 0x84, 0xf7, 0x58, 0xce, 0x8f, 0xb6, -0x56, 0x49, 0x8d, 0x27, 0x55, 0x19, 0x6c, 0xbf, -0xb9, 0x25, 0x31, 0x47, 0xf7, 0xa8, 0x4b, 0xe7, -0xa8, 0x8b, 0x7b, 0xb5, 0x1c, 0x21, 0xde, 0xa9, -0x25, 0x94, 0x43, 0x11, 0xc2, 0x3e, 0x7e, 0xb1, -0xca, 0x10, 0x5b, 0x91, 0x21, 0x75, 0x31, 0x95, -0x02, 0x10, 0x68, 0x3c, 0x76, 0xc4, 0x97, 0xd2, -0x97, 0x67, 0xb1, 0x34, 0x5c, 0x4b, 0x25, 0xa9, -0x3d, 0x1f, 0xd5, 0x51, 0x21, 0x03, 0x05, 0x4d, -0x86, 0x87, 0xa6, 0xe1, 0xee, 0xe0, 0x1c, 0xbc, -0xa9, 0x4c, 0x1d, 0x9d, 0xae, 0xae, 0xd7, 0x7b, -0x0f, 0x86, 0xc6, 0xc6, 0x5f, 0xe3, 0x41, 0xe7, -0xde, 0x2c, 0x4c, 0xcd, 0x6b, 0x72, 0x6a, 0xb3, -0x9f, 0x93, 0xbf, 0xa0, 0x94, 0x0f, 0x19, 0x93, -0x9d, 0xc5, 0x43, 0x7e, 0x60, 0xd1, 0x66, 0x21, -0x4b, 0xaf, 0x1b, 0x26, 0xb5, 0x1f, 0x75, 0x01, -0x0a, 0x3d, 0xb7, 0xd0, 0x76, 0x8c, 0x4c, 0xb8, -0x05, 0xc7, 0x7c, 0x88, 0x58, 0x63, 0xfa, 0x54, -0x73, 0xa1, 0x31, 0x8f, 0xa6, 0x93, 0x41, 0x7b, -0x3e, 0x6e, 0x54, 0xa0, 0xcb, 0x53, 0x5b, 0x95, -0xb1, 0xae, 0x22, 0x20, 0x3f, 0xa8, 0xa0, 0xbd, -0x91, 0xff, 0xf5, 0x01, 0x61, 0x39, 0xc2, 0x2e, -0x50, 0x9e, 0xd1, 0x83, 0x89, 0x82, 0xea, 0x2c, -0x74, 0xf7, 0xc6, 0x7c, 0x7e, 0x0b, 0x53, 0x93, -0x8c, 0xbf, 0xf8, 0x23, 0xbd, 0xe1, 0x38, 0x84, -0x0e, 0x56, 0x90, 0x4b, 0xef, 0xeb, 0x00, 0x41, -0x4b, 0x1b, 0xf9, 0x6c, 0x88, 0xf3, 0x0b, 0xc4, -0x74, 0x0b, 0xff, 0x80, 0x3f, 0xff, 0x3d, 0xd7, -0x47, 0xd3, 0x67, 0x14, 0xb6, 0x99, 0xb6, 0x1b, -0xa9, 0x5b, 0x1e, 0x31, 0x5f, 0x1e, 0x83, 0xa7, -0x8e, 0x1e, 0x1e, 0x72, 0x86, 0x82, 0x47, 0xa4, -0x8c, 0x2e, 0xc8, 0xbc, 0xd4, 0x9b, 0x8e, 0x18, -0x0b, 0x3e, 0xe2, 0xf8, 0x16, 0x06, 0x25, 0xfc, -0x7a, 0x21, 0xac, 0x21, 0x67, 0xc8, 0xbf, 0x4e, -0x7a, 0xca, 0x4e, 0x1e, 0x79, 0x0e, 0xaf, 0x6b, -0xbe, 0xa1, 0x94, 0x7b, 0xc4, 0xde, 0xd5, 0x6d, -0xaf, 0xc6, 0x35, 0xca, 0x2f, 0x33, 0x71, 0xec, -0x37, 0x61, 0x3a, 0x21, 0x31, 0xba, 0x30, 0x12, -0x75, 0xe3, 0x60, 0x9a, 0x83, 0x68, 0xa5, 0xe4, -0x85, 0x6b, 0x4d, 0xfd, 0xf2, 0x89, 0xeb, 0xe5, -0x17, 0x19, 0x5a, 0xeb, 0x91, 0xa6, 0x07, 0x65, -0x09, 0xb7, 0x7f, 0x58, 0x9c, 0x04, 0xe3, 0xc5, -0xd0, 0xe6, 0x16, 0x5b, 0xab, 0xf7, 0x9c, 0x58, -0x1f, 0xa7, 0xeb, 0x02, 0x2f, 0xdd, 0x15, 0xc6, -0x60, 0xdf, 0x73, 0x5c, 0x14, 0x52, 0x60, 0x7c, -0x7c, 0xe5, 0xf6, 0x12, 0x3e, 0xdc, 0xe3, 0xad, -0x35, 0xc0, 0x4b, 0x12, 0xb1, 0x2c, 0x69, 0x6d, -0x11, 0xb4, 0xfd, 0xdc, 0x7b, 0x76, 0x99, 0x0b, -0xd8, 0x70, 0xb5, 0x96, 0xbc, 0x7f, 0x95, 0xc5, -0x32, 0x77, 0x51, 0xa0, 0x70, 0xc7, 0xe2, 0x5d, -0xde, 0x43, 0xc8, 0x02, 0xf2, 0x95, 0x14, 0xd9, -0x87, 0x80, 0x46, 0x54, 0x7c, 0x27, 0x35, 0x66, -0x19, 0xde, 0x60, 0xae, 0x47, 0x6d, 0xde, 0x6e, -0xaa, 0xc0, 0xcb, 0xe0, 0x66, 0xbf, 0xa0, 0xf2, -0x54, 0x22, 0x21, 0xd6, 0xa6, 0x43, 0xdd, 0x4f, -0x8e, 0xa7, 0x61, 0xb8, 0xd1, 0x9b, 0x44, 0xdb, -0x3e, 0xb0, 0xb9, 0x4d, 0xf9, 0x6e, 0xf9, 0x31, -0xb5, 0x2a, 0xa0, 0x53, 0xa0, 0x04, 0xd7, 0x2a, -0x69, 0x9d, 0x0d, 0xed, 0x7b, 0xc5, 0xfe, 0xbd, -0xdf, 0x48, 0x53, 0x05, 0xb9, 0xe9, 0x66, 0x08, -0x2a, 0x5c, 0xd7, 0x18, 0xe3, 0xf5, 0x83, 0xf1, -0x7c, 0xce, 0x70, 0xc3, 0x65, 0x9e, 0xbd, 0x52, -0x65, 0x23, 0x7f, 0xab, 0x34, 0x6f, 0x14, 0x42, -0x5a, 0x11, 0x8e, 0xfe, 0xa0, 0x24, 0x9d, 0xb9, -0x10, 0xe0, 0x06, 0x66, 0x71, 0xb6, 0xac, 0x46, -0xe5, 0xbb, 0x33, 0x49, 0x47, 0xd1, 0x65, 0x26, -0x33, 0xf6, 0xde, 0x3c, 0x93, 0x22, 0x06, 0xd1, -0x00, 0x8c, 0xf6, 0xec, 0x6b, 0x7d, 0xde, 0xce, -0xc8, 0x18, 0x90, 0x8d, 0xf5, 0x20, 0x22, 0x04, -0x8f, 0x80, 0xfc, 0x13, 0x7c, 0x80, 0xfd, 0x16, -0x82, 0x7d, 0x3a, 0xe4, 0x4f, 0xbe, 0x48, 0x1c, -0xcf, 0x78, 0x45, 0xd1, 0xca, 0x1e, 0xc4, 0x3f, -0xb8, 0x9e, 0x27, 0x80, 0xac, 0x12, 0xc9, 0x4c, -0xba, 0x7d, 0xc6, 0x70, 0xf7, 0x1f, 0x69, 0x4f, -0x3e, 0x64, 0x59, 0xc9, 0x5a, 0x01, 0x82, 0xaa, -0x2e, 0x7a, 0xa9, 0x63, 0x0d, 0xf0, 0x4d, 0x87, -0xf3, 0xa9, 0xab, 0xa5, 0x83, 0x8a, 0x5f, 0xc6, -0x27, 0x35, 0x0a, 0x5b, 0x76, 0xb2, 0x47, 0x88, -0x0f, 0x04, 0x33, 0x5b, 0xbf, 0x63, 0x79, 0xb2, -0x68, 0x60, 0x89, 0xc3, 0x6a, 0x25, 0x1d, 0x4c, -0x18, 0x27, 0x00, 0x24, 0x7f, 0x70, 0x05, 0x87, -0x1a, 0x0b, 0x90, 0x04, 0x94, 0xed, 0xec, 0x93, -0xc4, 0xc2, 0x0f, 0xb5, 0x22, 0x73, 0x54, 0x14, -0x43, 0x20, 0xf1, 0x57, 0x86, 0x84, 0xd8, 0xf9, -0x0e, 0x8b, 0xa6, 0xa8, 0x3c, 0x34, 0xf1, 0xa6, -0x1f, 0x9c, 0x1c, 0x13, 0x6a, 0xca, 0xba, 0xab, -0x98, 0xcc, 0x79, 0x16, 0x3b, 0x63, 0x58, 0x89, -0x9d, 0x11, 0xaf, 0x73, 0x81, 0x3d, 0x15, 0x41, -0x50, 0x2a, 0xd4, 0xae, 0x87, 0xfe, 0xfa, 0xf0, -0xcb, 0x33, 0xa4, 0xd0, 0xa9, 0x7a, 0x0e, 0xe2, -0x82, 0x1f, 0xfe, 0x9a, 0xc5, 0xd6, 0x12, 0x48, -0x43, 0xe1, 0xe6, 0xea, 0x04, 0xa2, 0xe7, 0xee, -0x56, 0xa9, 0xb5, 0x9c, 0x10, 0xa9, 0x51, 0x3a, -0x27, 0x65, 0xe1, 0xe4, 0x8c, 0x24, 0xf3, 0x01, -0x5d, 0xad, 0x7c, 0x33, 0x92, 0x93, 0xc4, 0x6f, -0x25, 0x48, 0xfb, 0x4d, 0x73, 0xc4, 0x2f, 0x16, -0x09, 0x78, 0xad, 0x1e, 0xf6, 0xef, 0xc8, 0x99, -0xbe, 0xe8, 0xb1, 0xdd, 0xa9, 0x9f, 0x00, 0xe0, -0x84, 0x7b, 0xcc, 0xcf, 0xc7, 0xc3, 0xa8, 0xb6, -0xed, 0xf6, 0x42, 0x37, 0x78, 0x0e, 0xf3, 0x33, -0x58, 0x54, 0x3c, 0x32, 0x9d, 0xac, 0xd8, 0x19, -0xb8, 0xb6, 0x4b, 0xf2, 0xbc, 0xe2, 0x83, 0xf2, -0x19, 0x5a, 0xac, 0x2a, 0x45, 0xee, 0x7d, 0xf3, -0x8c, 0x64, 0x67, 0x38, 0x11, 0x9d, 0x59, 0x6c, -0x45, 0xfb, 0x96, 0x51, 0x18, 0xc6, 0x8f, 0xc4, -0x91, 0x5a, 0x66, 0x54, 0x6d, 0x5c, 0x23, 0x88, -0x08, 0x5f, 0x2c, 0x56, 0x76, 0x0b, 0xf3, 0x58, -0xe2, 0x75, 0x35, 0x77, 0x6c, 0x8f, 0xbb, 0x0e, -0x3f, 0x23, 0x47, 0x1d, 0x9c, 0x5b, 0x03, 0x96, -0x55, 0xed, 0xbf, 0xf0, 0x55, 0x86, 0xc7, 0xbe, -0x09, 0xba, 0x13, 0x45, 0x83, 0xd9, 0x09, 0xae, -0x3e, 0x4f, 0xe2, 0xb7, 0x82, 0xda, 0xc9, 0xca, -0x2a, 0x80, 0xeb, 0x0a, 0xbe, 0x38, 0x81, 0x15, -0xc0, 0x6d, 0x9e, 0x2e, 0x46, 0xed, 0x5b, 0xf7, -0x4a, 0x2e, 0x40, 0x11, 0xb7, 0xb1, 0x4b, 0x99, -0xa0, 0x04, 0x82, 0x7c, 0x06, 0x3b, 0x08, 0x43, -0xae, 0xb3, 0xab, 0xef, 0x89, 0x24, 0x8b, 0xb7, -0x2d, 0x77, 0x51, 0x72, 0xae, 0xb3, 0xba, 0x7d, -0x16, 0x94, 0xb6, 0x43, 0x05, 0xb7, 0x0e, 0x69, -0x11, 0x42, 0x75, 0xd8, 0x1c, 0xd9, 0x2e, 0x0a, -0x7b, 0x9d, 0xbf, 0x9c, 0x6c, 0x99, 0x83, 0xc9, -0xe4, 0x11, 0x2c, 0xe8, 0x66, 0xc5, 0x60, 0x0b, -0x53, 0xf2, 0x37, 0x5b, 0xb0, 0xe1, 0xd3, 0x74, -0x3b, 0x64, 0x0b, 0x34, 0x37, 0xec, 0x0e, 0xbb, -0x15, 0x7d, 0xe1, 0x40, 0x45, 0x46, 0x94, 0x71, -0x2a, 0x8a, 0xba, 0x97, 0x4c, 0x08, 0xbf, 0x69, -0x50, 0xba, 0x7f, 0xbc, 0xc8, 0xe2, 0x9a, 0x0e, -0x96, 0xaa, 0x49, 0x8d, 0x7b, 0x30, 0xb7, 0x7d, -0x93, 0xec, 0x0a, 0xfc, 0x66, 0xed, 0x84, 0x3f, -0xad, 0x78, 0x23, 0xb8, 0xc7, 0xe6, 0x3b, 0xcc, -0x49, 0x13, 0x70, 0xfd, 0x23, 0x58, 0xc7, 0x94, -0x7c, 0x19, 0x36, 0xa1, 0x2b, 0xa6, 0xd8, 0x2a, -0x7e, 0xa7, 0x71, 0x9f, 0x59, 0x30, 0xf5, 0xc0, -0x18, 0x93, 0xa1, 0xf4, 0xcd, 0x1a, 0x03, 0x52, -0xd3, 0xe6, 0x52, 0xd2, 0x74, 0xc2, 0x17, 0x2d, -0x29, 0xd4, 0xb1, 0xd7, 0x5a, 0x8c, 0x70, 0x6c, -0x77, 0xc4, 0x42, 0x03, 0x13, 0x0c, 0x96, 0x28, -0x14, 0x3d, 0xf7, 0x26, 0xba, 0x0f, 0x41, 0xc4, -0xb5, 0x56, 0x29, 0x84, 0x4e, 0xf5, 0xeb, 0x9d, -0x4e, 0xe7, 0x60, 0xcd, 0x0c, 0x07, 0xb9, 0x43, -0x17, 0x2d, 0x90, 0x3e, 0x4a, 0x79, 0x6a, 0xf8, -0xec, 0x30, 0x49, 0x1c, 0x60, 0x84, 0x0d, 0x59, -0xd5, 0x3f, 0x89, 0x5a, 0x00, 0x45, 0xc4, 0x29, -0x6b, 0x3c, 0x58, 0xd4, 0x2a, 0xfd, 0x40, 0x3b, -0x5b, 0x2e, 0x89, 0x2e, 0x90, 0xb2, 0x7d, 0xb4, -0x42, 0xa9, 0x2f, 0x34, 0x55, 0x74, 0xd2, 0xc6, -0xfc, 0x31, 0x4d, 0x73, 0x6c, 0xdc, 0xf3, 0x1c, -0x71, 0x9f, 0x25, 0x8c, 0x45, 0x66, 0xff, 0xd7, -0x7c, 0x41, 0xe5, 0xf2, 0xb0, 0xd0, 0xbb, 0x06, -0xca, 0xfc, 0x13, 0xe2, 0x91, 0xc6, 0xd0, 0xf9, -0x9e, 0x32, 0x28, 0x3d, 0x3c, 0x1a, 0xa0, 0x63, -0xe8, 0x46, 0x4e, 0xe7, 0xc4, 0xbb, 0x77, 0xa9, -0xd2, 0xd4, 0x67, 0x51, 0xd7, 0x8f, 0x29, 0x25, -0x61, 0x6d, 0x46, 0x4d, 0xf5, 0x18, 0x43, 0x9a, -0x46, 0xd5, 0x45, 0xc0, 0xa0, 0xeb, 0xa9, 0xd5, -0xf1, 0xe6, 0x68, 0x63, 0x51, 0x8a, 0xdf, 0x30, -0x5d, 0xac }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, -0x8d, 0x8d, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x25, -0x57, 0x8f, 0xaf, 0x70, 0x4b, 0x80, 0x68, 0x59, -0x5f, 0x24, 0x81, 0xa7, 0xe8, 0x75, 0xd9, 0x0d, -0x62, 0x52, 0x24, 0xa8, 0xdf, 0x83, 0x13, 0x8d, -0x36, 0xfe, 0x55, 0x95, 0x8c, 0x5a, 0x0f, 0xa7, -0x91, 0x1e, 0xbe, 0xe9, 0x53, 0x01, 0x84, 0x8f, -0x57, 0xee, 0xd3, 0x86, 0x74, 0x8a, 0x19, 0xf1, -0xc6, 0xb0, 0xf4, 0xd4, 0x21, 0xec, 0xb1, 0xb0, -0x5e, 0xd5, 0xa9, 0x4a, 0xcd, 0x7d, 0x9c, 0x1f, -0x80, 0x26, 0x6b, 0x55, 0x54, 0xc9, 0xf6, 0x7c, -0xf3, 0x2c, 0x50, 0x3f, 0xc1, 0x85, 0x08, 0x81, -0x30, 0xf6, 0xa0, 0x3d, 0x3b, 0x06, 0xa8, 0x9d, -0x26, 0xa5, 0xf2, 0xd2, 0xe9, 0xf2, 0xf9, 0xa5, -0xea, 0x9e, 0x49, 0xec, 0xc4, 0xaa, 0xd6, 0x13, -0xb9, 0x49, 0x44, 0xf1, 0x9d, 0x3c, 0xa1, 0x85, -0x11, 0x35, 0x97, 0x0b, 0xde, 0xe6, 0x87, 0x7b, -0xa5, 0x58, 0x81, 0x06, 0x02, 0x4a, 0x47, 0xde, -0x24, 0x28, 0x85, 0x63, 0x67, 0xc6, 0x23, 0xca, -0x83, 0x7c, 0x5d, 0xb2, 0xf1, 0x8e, 0x78, 0x3d, -0x28, 0x79, 0xad, 0xf7, 0x2b, 0x7e, 0x55, 0x19, -0xc0, 0x29, 0x9e, 0x12, 0x79, 0x83, 0xd8, 0x5c, -0x49, 0x10, 0x46, 0xcf, 0xe3, 0xb2, 0xd9, 0x1e, -0x24, 0x3f, 0x1c, 0xc6, 0x60, 0x6a, 0xfe, 0xbd, -0x11, 0x09, 0x2d, 0x6c, 0x09, 0x13, 0x62, 0x2e, -0x78, 0x7f, 0x77, 0x30, 0x33, 0x93, 0x68, 0x03, -0xe2, 0x6b, 0x98, 0x7b, 0x9d, 0x4a, 0xcc, 0xb0, -0xd5, 0x35, 0xcb, 0xbd, 0x3c, 0xa2, 0x2f, 0x48, -0xa1, 0x07, 0x7c, 0xab, 0x5d, 0x0d, 0xbc, 0xf3, -0x8d, 0xe3, 0xd1, 0x2e, 0xb5, 0xa6, 0x49, 0x10, -0xf5, 0x50, 0x95, 0x83, 0x96, 0xc0, 0x7f, 0xde, -0x80, 0x0b, 0x4a, 0x39, 0xc4, 0xdc, 0x2d, 0xc9, -0x0a, 0x77, 0x2e, 0xc3, 0xb9, 0x30, 0xca, 0x0b, -0x07, 0x30, 0xa1, 0x85, 0xe7, 0x5a, 0xdc, 0xbb, -0x25, 0xa8, 0x0f, 0x17, 0x24, 0x1f, 0x9a, 0xa0, -0x28, 0x27, 0x73, 0xf8, 0xf9, 0x8f, 0x1d, 0x61, -0x40, 0x0b, 0x53, 0xbc, 0xe6, 0x75, 0x01, 0xfe, -0x53, 0xdc, 0xd4, 0x07, 0xd6, 0x3a, 0x69, 0x0d, -0x1d, 0xf9, 0x59, 0xaa, 0x2e, 0x58, 0xa7, 0x60, -0xf4, 0x42, 0x1f, 0x80, 0x06, 0x8c, 0x65, 0xd9, -0xb9, 0xf8, 0xe8, 0x0a, 0xa0, 0x30, 0xbb, 0x49, -0xe6, 0xbf, 0x39, 0x17, 0xc9, 0x68, 0x32, 0xae, -0x10, 0xc9, 0x6c, 0xa7, 0xee, 0x9f, 0xac, 0xd4, -0x72, 0x8c, 0x36, 0xe0, 0xc4, 0xfb, 0x90, 0xa2, -0x31, 0x5c, 0x62, 0xa3, 0x69, 0x44, 0xa5, 0x18, -0x78, 0x37, 0x38, 0xb6, 0xa4, 0x8b, 0x73, 0x62, -0x1d, 0xb2, 0xcf, 0x24, 0x90, 0xa0, 0xe1, 0xa4, -0x31, 0x5e, 0x58, 0x75, 0x88, 0x5f, 0x0a, 0x63, -0xaa, 0xeb, 0xf9, 0xef, 0x25, 0x79, 0x72, 0x9f, -0xf9, 0xc1, 0x56, 0xe6, 0x0f, 0x61, 0xc6, 0x66, -0xfc, 0xbb, 0xfb, 0x38, 0x0b, 0x6f, 0x24, 0x16, -0x4b, 0x05, 0x49, 0x46, 0xa8, 0x08, 0x9b, 0xbe, -0xa3, 0x86, 0xaa, 0xf1, 0x95, 0xf2, 0x0b, 0xf2, -0xf8, 0xe0, 0x0e, 0x32, 0xd3, 0x37, 0xc7, 0xbe, -0x73, 0x65, 0xe3, 0x66, 0x10, 0xfc, 0x5e, 0xf8, -0x44, 0x4a, 0x4b, 0xed, 0xfd, 0xe9, 0x5f, 0x8d, -0xa3, 0x11, 0x6f, 0x50, 0x7d, 0xf5, 0x45, 0x14, -0x27, 0x8b, 0xf6, 0x35, 0xd7, 0x34, 0x58, 0x5a, -0xc0, 0x5c, 0x56, 0x01, 0x2b, 0x7d, 0xa5, 0x4a, -0x81, 0xe7, 0x34, 0xa8, 0xa4, 0xb6, 0x99, 0xd9, -0x8e, 0x8e, 0x25, 0xe7, 0x7d, 0x00, 0x3f, 0xdd, -0x01, 0xab, 0xb0, 0xb9, 0x34, 0xd3, 0x1c, 0x22, -0x5f, 0x53, 0x9f, 0x2d, 0x19, 0x93, 0x89, 0x98, -0x69, 0x75, 0x09, 0x83, 0x2e, 0x4e, 0x89, 0xbb, -0x6c, 0x32, 0x34, 0x98, 0xbc, 0xa8, 0x9f, 0x95, -0x77, 0xcb, 0x47, 0xc9, 0x0f, 0x80, 0xcc, 0xdc, -0xb2, 0xb5, 0xa8, 0xc6, 0xa4, 0x2a, 0x3a, 0xa8, -0x8c, 0xfb, 0x25, 0xe0, 0xeb, 0x8f, 0x13, 0x3d, -0xc2, 0xe1, 0x5a, 0x03, 0x5f, 0xfd, 0xec, 0xb0, -0xba, 0x32, 0xc4, 0x58, 0x79, 0x60, 0x7d, 0xdd, -0x00, 0xd2, 0x31, 0x27, 0x0b, 0x29, 0x4a, 0x7c, -0xa5, 0x73, 0x75, 0xaa, 0xf0, 0x69, 0xb4, 0xac, -0xe1, 0x4b, 0xb5, 0x24, 0x1b, 0x03, 0xc0, 0x91, -0x6f, 0xda, 0xce, 0xb9, 0xaf, 0x08, 0xe6, 0x07, -0xc0, 0xad, 0xd4, 0x62, 0x45, 0xdb, 0x72, 0x7c, -0xd1, 0x8d, 0x32, 0x73, 0x06, 0xe5, 0x07, 0x08, -0x0b, 0x71, 0xba, 0x1b, 0xd0, 0x12, 0x57, 0x2f, -0x35, 0x99, 0x7d, 0x36, 0xe0, 0x8d, 0xe1, 0x8e, -0x54, 0x79, 0xa8, 0x21, 0x28, 0x40, 0x12, 0x87, -0xa2, 0xd6, 0x68, 0xf8, 0x4e, 0x6b, 0x6c, 0x07, -0xc2, 0x2b, 0x93, 0x2f, 0x42, 0x89, 0xfb, 0xf4, -0x21, 0x41, 0x92, 0x7b, 0xa5, 0xb7, 0xc1, 0xda, -0x8f, 0x1e, 0xc9, 0x16, 0x8e, 0x97, 0x79, 0xf1, -0xb3, 0x79, 0x0d, 0x1c, 0x48, 0x7f, 0x9e, 0x36, -0x6c, 0x4e, 0xfd, 0xad, 0xa2, 0x4c, 0xc9, 0xd8, -0x51, 0xf0, 0x4b, 0x1c, 0x94, 0xb8, 0x93, 0xcf, -0xe4, 0x4d, 0x93, 0xc7, 0x70, 0xd1, 0xeb, 0xd4, -0xdb, 0x7a, 0x97, 0xa4, 0x0c, 0xfc, 0x2d, 0x1a, -0xda, 0x78, 0x30, 0x27, 0x43, 0xf4, 0x2c, 0xc4, -0x07, 0xa8, 0x02, 0x06, 0xb4, 0xa4, 0x26, 0xe2, -0x41, 0x0b, 0x99, 0xf0, 0x0f, 0x5c, 0x7f, 0xfc, -0xe2, 0x91, 0x2f, 0x1f, 0xe0, 0x84, 0x1f, 0x05, -0x7b, 0x03, 0x1d, 0xd9, 0x8d, 0x78, 0xe1, 0xe7, -0x56, 0x7a, 0xc0, 0x94, 0xa3, 0x60, 0xa3, 0x17, -0x0b, 0xe2, 0xcb, 0x8b, 0x07, 0x24, 0x6a, 0x66, -0x2d, 0xf2, 0x62, 0x0d, 0xa3, 0x00, 0x29, 0x30, -0x3a, 0x88, 0xda, 0x61, 0x79, 0x02, 0x5d, 0x74, -0xe3, 0x6a, 0xa4, 0x9f, 0x97, 0xf9, 0xb4, 0x4a, -0x8f, 0x41, 0xcd, 0xca, 0x1c, 0x9a, 0x9c, 0xca, -0xf4, 0xf6, 0xa7, 0x39, 0xdb, 0x39, 0x20, 0xa3, -0x03, 0x44, 0xf3, 0x03, 0x5a, 0xae, 0xa8, 0xd5, -0xd9, 0x11, 0xfc, 0xf8, 0x75, 0x6d, 0xef, 0x5a, -0xce, 0x51, 0x7f, 0x3b, 0x09, 0x6f, 0xac, 0x06, -0x18, 0x4b, 0x1d, 0x2b, 0x59, 0xd4, 0xd4, 0xf7, -0xe2, 0x1c, 0xfa, 0xf0, 0x14, 0x96, 0xae, 0x25, -0x18, 0xc8, 0x9c, 0x41, 0x22, 0xa8, 0xac, 0x96, -0xfb, 0x40, 0xeb, 0xbd, 0x25, 0xaf, 0x95, 0xbf, -0x90, 0xd3, 0xa9, 0x63, 0x76, 0x69, 0x75, 0xaf, -0x51, 0x89, 0x34, 0xd1, 0x39, 0xff, 0x84, 0xcc, -0xa5, 0x79, 0x65, 0xde, 0x65, 0x6c, 0x91, 0xc5, -0xae, 0x8a, 0xa9, 0x95, 0xcd, 0x6f, 0xbd, 0xf8, -0x46, 0x39, 0x8f, 0xa3, 0x29, 0xdd, 0xc2, 0xe3, -0x5b, 0xbe, 0x0e, 0x38, 0x31, 0x97, 0x3e, 0xa0, -0x96, 0x1d, 0xbd, 0x98, 0xd0, 0xfa, 0xa7, 0x87, -0xe0, 0x74, 0x85, 0x78, 0xe4, 0x41, 0xba, 0x57, -0x45, 0xf4, 0x82, 0xfa, 0x2a, 0xba, 0xa1, 0xb9, -0xa8, 0x02, 0xb8, 0xa2, 0xaf, 0xf9, 0x3c, 0x3f, -0x2a, 0x04, 0xdf, 0xca, 0x5a, 0x54, 0x3b, 0xa3, -0x93, 0x4a, 0x12, 0x75, 0x40, 0x07, 0xdd, 0x13, -0x7b, 0x3c, 0x21, 0x12, 0xc2, 0x92, 0x22, 0x50, -0x40, 0xde, 0xb7, 0x0a, 0x7a, 0x87, 0xa0, 0x78, -0x16, 0x3d, 0x65, 0x4e, 0x80, 0x57, 0x7b, 0xd3, -0xdb, 0x1a, 0x43, 0x06, 0x0a, 0x4b, 0xf3, 0xba, -0x9d, 0x59, 0x89, 0x3d, 0xbd, 0xa6, 0x82, 0x38, -0xed, 0x8f, 0x4d, 0x37, 0xaa, 0x93, 0xba, 0xa5, -0x70, 0x79, 0x27, 0x03, 0x6b, 0xef, 0xdb, 0xd9, -0xc3, 0x32, 0x56, 0x2e, 0x26, 0x8d, 0x93, 0x55, -0x2e, 0x47, 0x38, 0x7e, 0x0c, 0x1b, 0x01, 0xfe, -0x5f, 0x6d, 0xc8, 0xee, 0x2e, 0xf5, 0x3d, 0xc4, -0x26, 0x45, 0xe5, 0x07, 0x60, 0x3f, 0xfe, 0xb7, -0xb8, 0xbf, 0x31, 0x41, 0x8c, 0x76, 0x0e, 0xa5, -0x06, 0x36, 0xf4, 0x09, 0x4b, 0x52, 0x7c, 0xf1, -0x15, 0x31, 0x94, 0x4b, 0x72, 0x21, 0xa6, 0x6b, -0x47, 0x7b, 0xce, 0xc0, 0xad, 0xdf, 0x99, 0x27, -0x7f, 0x49, 0xdc, 0xd7, 0xed, 0x1d, 0x62, 0x2d, -0x46, 0x5c, 0x75, 0x40, 0xb4, 0x5d, 0xdb, 0x16, -0x26, 0x08, 0xec, 0x21, 0xe7, 0x91, 0x53, 0xaf, -0x4f, 0x0b, 0x48, 0x38, 0xb0, 0x3a, 0x01, 0x51, -0xd0, 0x47, 0x04, 0x9c, 0x0d, 0x9f, 0xbf, 0x49, -0xe0, 0x58, 0x3c, 0x46, 0xd4, 0xfa, 0x36, 0x04, -0x05, 0x9a, 0xc5, 0xa3, 0x3a, 0x0a, 0x20, 0x5b, -0x58, 0x38, 0x9d, 0xf9, 0xa7, 0x97, 0x2d, 0xbd, -0x44, 0x76, 0xf8, 0xe4, 0xb3, 0x70, 0x60, 0x65, -0x89, 0xe2, 0x23, 0xbf, 0x31, 0x9c, 0xd8, 0xba, -0xca, 0x05, 0xe4, 0x8c, 0xc1, 0xe3, 0x11, 0x5a, -0x3e, 0x15, 0xce, 0x28, 0xfd, 0xb4, 0x88, 0xa9, -0x4a, 0xda, 0x56, 0x7c, 0x54, 0x52, 0x70, 0xb2, -0x22, 0x69, 0x17, 0x84, 0x9c, 0xc9, 0xdc, 0x10, -0xec, 0x0f, 0x6d, 0x63, 0xad, 0xd1 }; - -static char pkt6[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x43, -0x0e, 0xfc, 0xdf, 0xe1, 0x55, 0x09, 0xe6, 0x10, -0x1c, 0xc7, 0x9e, 0xb4, 0x3b, 0xdc, 0x58, 0x5a, -0x0d, 0xf0, 0x56, 0x9e, 0x35, 0xab, 0x9c, 0x42, -0x33, 0xef, 0x87, 0x87, 0xa1, 0x2f, 0x31, 0xc4, -0x34, 0xd0, 0x88, 0x89, 0x32, 0x99, 0x11, 0x19, -0x61, 0x85, 0x5d, 0x0b, 0x92, 0x64, 0x77, 0xd0, -0xc3, 0x9c, 0x91, 0x5b, 0xbb, 0xd3, 0xed, 0xef, -0x48, 0x68, 0xdb, 0x33, 0xfd, 0x86, 0x3e, 0x83, -0xdd, 0xb3, 0x27, 0x52, 0xa7, 0x79, 0xb8, 0xfe, -0x24, 0x35, 0xb7, 0x6c, 0x19, 0xbc, 0x97, 0x9d, -0x95, 0xdf, 0x8d, 0xc0, 0x29, 0xab, 0xbc, 0x8a, -0x94, 0xce, 0x29, 0xd7, 0x14, 0xa2, 0xc4, 0x26, -0xa3, 0x23, 0xcf, 0xf0, 0xce, 0x0c, 0x42, 0x81, -0xd1, 0x39, 0x01, 0xbd, 0xfc, 0x76, 0xe6, 0xaa, -0x64, 0x1c, 0x18, 0x81, 0x2d, 0x46, 0x1e, 0x21, -0xf8, 0x5d, 0x77, 0xf4, 0x45, 0x94, 0x8b, 0xaf, -0x9a, 0x6a, 0x78, 0x2e, 0xc2, 0x9c, 0xf2, 0xa2, -0xb6, 0xfb, 0x98, 0xf2, 0x02, 0xc5, 0x58, 0x96, -0xc0, 0x13, 0xe5, 0xa9, 0xc4, 0xdc, 0x6b, 0xce, -0x07, 0xad, 0x54, 0xd3, 0x24, 0x0a, 0x05, 0x6f, -0xb8, 0x9b, 0x17, 0xc1, 0xc0, 0x1f, 0xec, 0x08, -0x76, 0x4f, 0x9e, 0x7f, 0x94, 0x22, 0xa0, 0x84, -0xca, 0xe5, 0xd7, 0x16, 0x73, 0x3d, 0x85, 0xd9, -0x0d, 0x18, 0xcf, 0x42, 0x4e, 0x59, 0x6d, 0x77, -0x45, 0x63, 0xd7, 0x4c, 0xe8, 0x12, 0xfa, 0x1b, -0x28, 0x8c, 0xdb, 0xe0, 0xcc, 0x46, 0xad, 0xc1, -0x2c, 0xb6, 0xab, 0xdb, 0x57, 0xd6, 0x08, 0x52, -0x54, 0x69, 0x96, 0x7c, 0x56, 0x4d, 0x8e, 0x9b, -0x6a, 0x23, 0xca, 0x67, 0xca, 0x05, 0xc4, 0x25, -0xba, 0x9f, 0xa0, 0x65, 0x4f, 0x4e, 0xee, 0x68, -0xa7, 0x8a, 0x5b, 0x5f, 0xfb, 0x76, 0x20, 0x7b, -0x3c, 0x88, 0xb3, 0xde, 0xdd, 0x59, 0x68, 0xc7, -0x55, 0x7d, 0x02, 0x70, 0x7f, 0xb2, 0x43, 0x2f, -0x40, 0xde, 0x25, 0x1a, 0xf9, 0xfa, 0xa3, 0x14, -0x87, 0xe3, 0xea, 0xff, 0xfd, 0xd6, 0xa3, 0x6f, -0xfe, 0x30, 0x0c, 0x61, 0xf2, 0x3f, 0xae, 0x7a, -0x6b, 0xc3, 0x29, 0x4b, 0x5e, 0xd2, 0x51, 0x32, -0x2a, 0x82, 0x3c, 0x16, 0x39, 0x72, 0x5d, 0x21, -0xd4, 0x14, 0x35, 0x5e, 0xdc, 0x62, 0x54, 0x77, -0x62, 0xf7, 0x0a, 0x7d, 0xc3, 0x7e, 0x88, 0xb1, -0xd2, 0x81, 0x83, 0x17, 0x2d, 0x54, 0x28, 0x21, -0x90, 0x36, 0xc0, 0x23, 0x89, 0x4d, 0x03, 0xf6, -0xea, 0x5b, 0x7e, 0x11, 0xf6, 0xe4, 0xeb, 0x7b, -0x26, 0xef, 0xa2, 0x48, 0xf9, 0xdd, 0xd1, 0xdd, -0xfd, 0x55, 0x33, 0x16, 0x73, 0xdb, 0x31, 0x26, -0x13, 0x26, 0xa8, 0x59, 0xef, 0x20, 0x12, 0xa6, -0x4a, 0x29, 0x33, 0x6a, 0x14, 0x12, 0xb5, 0x6d, -0x51, 0x49, 0xc0, 0xcf, 0x47, 0xd6, 0x0f, 0x0f, -0xef, 0x47, 0x59, 0x46, 0xbe, 0xe1, 0x72, 0x29, -0x76, 0xe3, 0xae, 0x62, 0x91, 0xb1, 0x6a, 0x66, -0x77, 0x65, 0x52, 0x89, 0xdd, 0x16, 0x6a, 0xbd, -0xae, 0xe4, 0x6e, 0x54, 0x8e, 0x40, 0x75, 0x30, -0xf1, 0xc9, 0x0b, 0x30, 0x15, 0x5d, 0x4b, 0x27, -0xe6, 0x35, 0x24, 0x19, 0x46, 0xdf, 0x7d, 0x7d, -0x73, 0xb6, 0x0c, 0x63, 0x15, 0x24, 0x01, 0xd2, -0xf1, 0x5a, 0xda, 0xb9, 0xf6, 0xe8, 0xf5, 0x97, -0x99, 0x51, 0x79, 0x4c, 0x3b, 0xbd, 0xa8, 0x92, -0x24, 0xf8, 0xb9, 0xcc, 0x27, 0xd5, 0xa4, 0xa2, -0xca, 0xec, 0x87, 0x00, 0x21, 0x3a, 0x73, 0x1e, -0x48, 0x22, 0x1d, 0x5f, 0x01, 0x5c, 0x95, 0x6e, -0xf1, 0xd0, 0x2a, 0x71, 0xa9, 0x2b, 0xee, 0x51, -0xaf, 0x9d, 0xd8, 0x76, 0xa2, 0x4b, 0xea, 0x90, -0xf4, 0xf6, 0xb6, 0x89, 0x9d, 0xf8, 0x17, 0x41, -0x5d, 0xa5, 0x72, 0xd9, 0xb0, 0xb8, 0x72, 0x0e, -0x4a, 0x51, 0x86, 0xcb, 0xe5, 0x10, 0xd2, 0x25, -0x95, 0x47, 0x1c, 0xd1, 0x7d, 0x7a, 0x94, 0xf6, -0x42, 0x8b, 0xd8, 0xbb, 0xbc, 0xe1, 0x00, 0x88, -0x23, 0x06, 0x80, 0xeb, 0xde, 0x21, 0xb0, 0xf1, -0xd7, 0x2f, 0x04, 0x3c, 0x09, 0x8e, 0xae, 0x6b, -0x68, 0x2e, 0x39, 0xa9, 0x5b, 0x53, 0x1a, 0xca, -0xbd, 0x0d, 0x77, 0xb5, 0x48, 0xf8, 0x50, 0x29, -0x6d, 0x6f, 0x72, 0xab, 0x77, 0x5f, 0xa5, 0x2e, -0xe0, 0x7c, 0x59, 0x5f, 0xe4, 0x52, 0x45, 0x57, -0x54, 0x62, 0x9b, 0xf5, 0x50, 0xea, 0xc1, 0x83, -0x35, 0x89, 0x64, 0x5a, 0x77, 0xd6, 0x10, 0x21, -0x7d, 0x20, 0x93, 0x01, 0x01, 0x85, 0x12, 0x7f, -0xaa, 0xeb, 0x8a, 0xda, 0xfa, 0x32, 0x45, 0xd7, -0x10, 0x6d, 0x65, 0xdf, 0x81, 0x47, 0x17, 0x44, -0x52, 0xc2, 0xd6, 0x13, 0x8f, 0xd6, 0xef, 0x40, -0xe4, 0x4d, 0xf5, 0xca, 0x2d, 0xc4, 0xbd, 0x31, -0x2d, 0xc3, 0x98, 0xd9, 0x6d, 0x39, 0x4f, 0xe1, -0x83, 0xba, 0xae, 0xf3, 0x96, 0x2b, 0x52, 0x1b, -0x54, 0xe9, 0x7c, 0x98, 0x29, 0x54, 0xe8, 0x23, -0x8b, 0x38, 0x95, 0xe5, 0xc0, 0x18, 0xca, 0xa8, -0x28, 0xc3, 0x65, 0xdf, 0x66, 0x8e, 0x12, 0x9c, -0xbd, 0x03, 0x7f, 0xba, 0xbe, 0x7c, 0x53, 0xf3, -0x56, 0xb0, 0xb3, 0xe3, 0xf2, 0x0d, 0x46, 0x6c, -0xc0, 0x8b, 0x24, 0x73, 0xd1, 0xea, 0xc1, 0xfe, -0x1c, 0xca, 0x79, 0xa0, 0x7e, 0x92, 0x78, 0x7d, -0x64, 0x7c, 0x77, 0xf0, 0x6f, 0x32, 0x3b, 0x68, -0xdf, 0x41, 0x57, 0x0d, 0x79, 0x18, 0x2c, 0xea, -0x40, 0x75, 0x2a, 0xb2, 0x89, 0xf5, 0xfa, 0xb8, -0x7a, 0x66, 0x7a, 0xaa, 0x23, 0x24, 0x8c, 0xdd, -0x77, 0x41, 0xf4, 0x89, 0x16, 0xf4, 0x83, 0x19, -0x00, 0x96, 0x19, 0x02, 0x61, 0x3c, 0x96, 0x3f, -0x60, 0x22, 0xdc, 0x2e, 0x98, 0xa2, 0x42, 0xf2, -0x89, 0x61, 0x3d, 0x63, 0x2a, 0x27, 0x1a, 0x6c, -0x0a, 0xc5, 0x1e, 0x5e, 0xd3, 0xde, 0xa5, 0xf4, -0x5a, 0x9d, 0xe5, 0xe9, 0x18, 0x4a, 0x6b, 0xd8, -0xdd, 0xaf, 0x4d, 0xca, 0x5d, 0x26, 0x18, 0x68, -0x28, 0x53, 0x14, 0x08, 0x3b, 0xce, 0x57, 0x6b, -0xf9, 0xd3, 0x73, 0xcb, 0x01, 0xbc, 0x70, 0x92, -0x6b, 0xa5, 0xb7, 0xa1, 0x77, 0x7d, 0x3c, 0xa5, -0x23, 0xaf, 0x20, 0xa1, 0x96, 0x99, 0xa3, 0x87, -0xdc, 0x1d, 0xad, 0xf0, 0x60, 0xc4, 0x02, 0xc1, -0x38, 0xe8, 0x4e, 0xf4, 0xc5, 0x8c, 0x50, 0xde, -0x9a, 0x1a, 0x9b, 0x68, 0xca, 0x96, 0xb4, 0x37, -0x3b, 0x2b, 0xe6, 0x04, 0xb1, 0x89, 0x4f, 0x27, -0xd6, 0x08, 0x15, 0x6c, 0x72, 0x4b, 0x6e, 0xbe, -0x85, 0x9c, 0x43, 0x72, 0xc0, 0x43, 0xe3, 0x26, -0xe0, 0x0a, 0xb6, 0x9e, 0x05, 0xe2, 0x33, 0x7f, -0xec, 0x52, 0x87, 0x9e, 0x58, 0x41, 0x5d, 0xbf, -0x12, 0x51, 0x8e, 0xa6, 0x19, 0xdf, 0xc5, 0xf4, -0xea, 0x98, 0x27, 0x72, 0xaa, 0x19, 0xa4, 0xae, -0x80, 0x84, 0x15, 0x8d, 0xb6, 0x04, 0xdd, 0x4a, -0x4f, 0xd4, 0x51, 0xa9, 0x5e, 0x03, 0xb5, 0x96, -0x54, 0x10, 0x66, 0x97, 0x38, 0x87, 0x0f, 0xa3, -0xc5, 0x7f, 0x24, 0x23, 0x46, 0x3d, 0xd4, 0x91, -0x06, 0x0c, 0x23, 0xe6, 0x40, 0x0d, 0x2f, 0x1c, -0x7b, 0xe2, 0x48, 0x06, 0x3a, 0x45, 0x38, 0x51, -0xae, 0xd8, 0xfb, 0xa9, 0xb6, 0x12, 0x47, 0xbb, -0xa9, 0x60, 0xeb, 0x62, 0x61, 0x6f, 0xfd, 0xc9, -0xf2, 0x67, 0xb0, 0xb4, 0x51, 0x3c, 0x5a, 0x48, -0xaf, 0x69, 0x18, 0xe2, 0xa0, 0x61, 0x5a, 0xc7, -0x0d, 0x0f, 0xe5, 0x09, 0x95, 0xed, 0x43, 0xba, -0x0a, 0xfc, 0xd3, 0xfb, 0xe7, 0x85, 0x1e, 0x63, -0xfe, 0x09, 0x6d, 0xe3, 0x2d, 0xd1, 0x72, 0x0e, -0x1d, 0x39, 0x8c, 0x89, 0x82, 0x9f, 0x92, 0x23, -0x25, 0xe5, 0xdb, 0xce, 0x84, 0x6d, 0xce, 0x98, -0x0f, 0x3f, 0x40, 0x89, 0x47, 0xbe, 0xf2, 0x51, -0xce, 0x82, 0x20, 0x02, 0x6a, 0xb9, 0x9a, 0x9f, -0x1e, 0x77, 0xdc, 0x66, 0x3f, 0x82, 0x26, 0xe3, -0x10, 0x6d, 0x02, 0xc9, 0x39, 0x09, 0xca, 0x2b, -0x0e, 0x8b, 0x7d, 0x91, 0x45, 0x52, 0x46, 0x0e, -0x59, 0x86, 0xc4, 0x1f, 0x3f, 0xa3, 0x88, 0x59, -0x0f, 0xa8, 0x4d, 0xe4, 0xd0, 0xa7, 0x41, 0x58, -0x9e, 0x9e, 0x09, 0x37, 0x55, 0xda, 0x32, 0x03, -0x48, 0x1e, 0xe7, 0x03, 0x6c, 0xb2, 0xb6, 0x21, -0xbb, 0x85, 0x0c, 0x55, 0xc1, 0xa1, 0x36, 0xf4, -0xa9, 0xb7, 0xbe, 0xc7, 0xfa, 0x95, 0x9f, 0xd5, -0x5c, 0x8e, 0x16, 0x99, 0x3c, 0x83, 0x2f, 0x4f, -0x54, 0x78, 0xaf, 0xb1, 0x33, 0xf9, 0xf0, 0x78, -0x21, 0x7f, 0x74, 0x29, 0x29, 0xa2, 0xdd, 0xd3, -0xaa, 0x56, 0xdb, 0x33, 0x9d, 0x46, 0xc1, 0xeb, -0x80, 0xd7, 0x98, 0xb5, 0x4f, 0x56, 0x56, 0x94, -0x3c, 0x4f, 0xb3, 0x3d, 0x9a, 0x88, 0xa4, 0xc3, -0x92, 0x56, 0x8b, 0xc0, 0xe4, 0xb7, 0xb1, 0x0c, -0xc4, 0x6a, 0x1c, 0x0f, 0x4c, 0x18, 0x03, 0xdc, -0x2d, 0xaa, 0x1c, 0xea, 0x52, 0xe2, 0x02, 0x12, -0x88, 0xdc, 0xa2, 0xe1, 0xa1, 0xb8, 0x0e, 0xcc, -0x7b, 0x19, 0x28, 0xac, 0x7d, 0xe6, 0x0c, 0xb1, -0xc6, 0x4b, 0xcc, 0x00, 0xde, 0x65, 0x69, 0xd6, -0xd4, 0xd6, 0x75, 0x12, 0xad, 0xaf, 0x2f, 0x8f, -0x56, 0x0f, 0xb2, 0xc9, 0x0a, 0xd9, 0xb9, 0x2a, -0x18, 0xc5, 0x79, 0x32, 0x96, 0xa3, 0x62, 0x36, -0x4c, 0xbe, 0xcd, 0xa8, 0x3e, 0x39, 0xc7, 0xdf, -0x69, 0x0f, 0x83, 0x36, 0x6e, 0x60, 0xf7, 0x49, -0x82, 0x40, 0x5d, 0xb7, 0xf8, 0x91, 0x99, 0xa0, -0x22, 0x9f, 0xec, 0xf2, 0x96, 0x49, 0x25, 0xa5, -0xa3, 0x0a, 0xd5, 0x11, 0x3b, 0xd7, 0xaf, 0x4f, -0x6b, 0x22, 0x83, 0x76, 0x81, 0x2e, 0x58, 0xb5, -0x72, 0x57, 0xe9, 0x3c, 0x5e, 0x62, 0x72, 0x7f, -0x9f, 0xf0, 0x71, 0xdd, 0x4c, 0xf9, 0x21, 0xf4, -0x68, 0x2e, 0x60, 0xb7, 0x9d, 0x0d, 0xa2, 0x69, -0x43, 0xf4, 0x7a, 0x89, 0x5c, 0x70, 0xe8, 0xb3, -0x96, 0x01, 0xb0, 0xf8, 0xda, 0xee, 0xbc, 0xea, -0x0f, 0x1c, 0xce, 0x13, 0xc9, 0x70, 0xf0, 0x6e, -0x21, 0x0f, 0x84, 0xaf, 0xf1, 0x43, 0xbe, 0xda, -0x28, 0x5f, 0x5f, 0x84, 0xf8, 0x3f, 0x83, 0x64, -0x03, 0x66, 0xff, 0x63, 0x0e, 0x40, 0xdc, 0x69, -0xcb, 0x85, 0xe4, 0x6a, 0x03, 0xc8, 0x70, 0x83, -0x47, 0xf2, 0xa8, 0x60, 0x50, 0x9b, 0xd3, 0x48, -0x51, 0xf5, 0xa7, 0xfc, 0xf3, 0x6c, 0x21, 0xc1, -0xa2, 0x67, 0xab, 0x44, 0xa7, 0x05, 0x93, 0xc5, -0x9d, 0x60, 0x1c, 0x61, 0x39, 0x7e, 0xe1, 0x35, -0x83, 0x27, 0x67, 0xbf, 0x5c, 0x72, 0xdb, 0x1c, -0xc3, 0x06, 0x78, 0xa4, 0x79, 0x86, 0xa0, 0x52, -0x9f, 0xc7, 0xaa, 0xe2, 0x23, 0xb5, 0x35, 0x63, -0x5b, 0x52, 0x54, 0x2d, 0x5d, 0xdb, 0xb9, 0xc5, -0x1b, 0xa5, 0xb0, 0x66, 0x9c, 0x1e, 0xbd, 0x55, -0x8e, 0x85 }; - -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x04, 0xd8, 0x2c, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, -0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, -0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0x0e, 0x73, -0x64, 0xda, 0xdc, 0x87, 0xdd, 0xa7, 0x8a, 0xb1, -0xe0, 0x5f, 0x0d, 0xc6, 0x1b, 0x2b, 0x5e, 0xa7, -0x91, 0x58, 0x18, 0x49, 0x62, 0xc7, 0xfc, 0xdc, -0x19, 0xb6, 0xf4, 0xa9, 0xb0, 0x06, 0x71, 0x0d, -0xa4, 0x68, 0x69, 0xfe, 0x06, 0xe5, 0xca, 0xd0, -0x1c, 0x96, 0x85, 0x39, 0xe4, 0x63, 0x14, 0xba, -0xaf, 0x6e, 0x18, 0x94, 0x92, 0x45, 0xe8, 0xd6, -0xc5, 0x7b, 0x81, 0xde, 0x9e, 0x95, 0x45, 0x14, -0x9d, 0xa4, 0x5f, 0x2a, 0x98, 0x49, 0x88, 0x0a, -0xa4, 0x99, 0xfd, 0x7e, 0x0e, 0xab, 0x17, 0x93, -0xe4, 0xec, 0xc7, 0xdb, 0x02, 0xb9, 0x41, 0xa9, -0x16, 0x83, 0xb8, 0xe3, 0xbb, 0x58, 0xb6, 0xc7, -0x2c, 0x42, 0x44, 0xe1, 0xba, 0xe1, 0xe5, 0x5e, -0x9c, 0xdf, 0x9e, 0x66, 0x90, 0x8b, 0x62, 0x8f, -0x9c, 0xf7, 0x76, 0x20, 0x7b, 0x3b, 0xec, 0xc2, -0x6b, 0x21, 0x16, 0xc8, 0x86, 0x91, 0xaa, 0xd7, -0xd1, 0xb6, 0x95, 0xc3, 0xaa, 0x2f, 0x64, 0xf6, -0x55, 0x6d, 0x46, 0x16, 0x17, 0xf2, 0xc5, 0xd9, -0xa8, 0x34, 0x6e, 0x31, 0x1c, 0x88, 0xf7, 0x9b, -0x96, 0xee, 0xe0, 0x91, 0x6b, 0xe0, 0x57, 0x76, -0x36, 0x4c, 0xfb, 0x62, 0x54, 0xbe, 0x28, 0x0f, -0x31, 0xeb, 0x7b, 0xe3, 0x23, 0xe0, 0x8d, 0x77, -0xee, 0x9c, 0xf8, 0x65, 0xd5, 0xf8, 0x68, 0xb6, -0x54, 0xe3, 0xd9, 0xb0, 0x03, 0x12, 0x85, 0xf4, -0x38, 0x7f, 0x7c, 0x9d, 0xf9, 0xa4, 0xd6, 0x0a, -0xf2, 0xf9, 0x75, 0xf8, 0x9e, 0xe3, 0xc9, 0xe0, -0xa4, 0x46, 0x6b, 0x0e, 0x18, 0x19, 0xbd, 0xa9, -0x01, 0x80, 0x81, 0xb0, 0xed, 0xa5, 0xee, 0xf1, -0x4d, 0xf7, 0x08, 0x95, 0x30, 0xf3, 0x13, 0xb5, -0xd0, 0x25, 0x2f, 0x4d, 0x04, 0xa2, 0x70, 0x03, -0x00, 0xd1, 0xa3, 0xb9, 0xed, 0x81, 0x3f, 0x9a, -0xa9, 0xaf, 0x70, 0x9d, 0x5e, 0x11, 0x45, 0x69, -0xf0, 0xc1, 0x3e, 0xa9, 0x5c, 0x89, 0xb2, 0x42, -0x86, 0x2c, 0x63, 0xae, 0xcd, 0xe6, 0x60, 0xd4, -0x75, 0xf1, 0xeb, 0xbc, 0x7f, 0xdc, 0x44, 0x2e, -0xd5, 0xe4, 0x3f, 0xc4, 0x9c, 0x92, 0xa4, 0x1c, -0x23, 0xf7, 0x80, 0xae, 0x5a, 0x29, 0xe2, 0xd5, -0x30, 0x81, 0x2d, 0xed, 0x94, 0x4a, 0x49, 0x1b, -0xb2, 0xc2, 0x8b, 0xee, 0xc8, 0x2e, 0xb2, 0x7a, -0xeb, 0x2f, 0x36, 0x2e, 0x7e, 0xcb, 0x09, 0xcb, -0x9e, 0xbf, 0xf4, 0x99, 0xb2, 0x61, 0x87, 0x24, -0x91, 0x95, 0x24, 0xf0, 0x9c, 0x8c, 0x98, 0x9d, -0x37, 0x4f, 0x51, 0xff, 0x52, 0xc4, 0xa3, 0xd4, -0x95, 0xf1, 0xc8, 0x5e, 0xce, 0x2d, 0xa5, 0xc0, -0xe9, 0xb8, 0x53, 0x60, 0x0a, 0xe9, 0x26, 0xaa, -0x8f, 0x80, 0x2d, 0x67, 0x3d, 0x2d, 0xe9, 0x3c, -0xae, 0xa7, 0xd0, 0x5e, 0x31, 0xba, 0x14, 0xa1, -0xb1, 0xfc, 0xd5, 0x70, 0xe9, 0x03, 0xee, 0xfc, -0x29, 0xd0, 0x3b, 0x52, 0xad, 0xa3, 0xcc, 0x9f, -0x61, 0x17, 0x97, 0x94, 0xf0, 0x9c, 0xb0, 0x75, -0x5b, 0x3c, 0xdb, 0x1d, 0xef, 0xa0, 0x90, 0x45, -0x99, 0xb3, 0x1e, 0x9f, 0x0f, 0x44, 0xa1, 0xaf, -0x03, 0x49, 0x60, 0x88, 0xc4, 0xe6, 0xb5, 0x71, -0xad, 0x18, 0x48, 0x67, 0x40, 0x38, 0xd0, 0x0c, -0xa9, 0x6d, 0x8c, 0xbc, 0xab, 0x5e, 0x87, 0x9c, -0xd1, 0x99, 0x77, 0xea, 0x4b, 0xe6, 0xb7, 0x05, -0x05, 0xf1, 0x44, 0xfc, 0x77, 0x58, 0xc6, 0xfc, -0xfe, 0xd9, 0x0a, 0xc2, 0x09, 0x51, 0x7c, 0xec, -0x19, 0x69, 0x48, 0xa7, 0x81, 0xec, 0x0a, 0x60, -0x71, 0x15, 0x68, 0xba, 0x65, 0x29, 0x5c, 0xee, -0x78, 0x8c, 0x60, 0x51, 0x19, 0xf6, 0x37, 0x59, -0xd7, 0xc9, 0x97, 0xf5, 0xbb, 0xb3, 0x84, 0x64, -0x66, 0x49, 0x94, 0xd8, 0x3d, 0xc5, 0x95, 0x36, -0xc0, 0xc9, 0xa0, 0x55, 0x50, 0xec, 0x7c, 0x9b, -0xca, 0xf2, 0x27, 0x7f, 0x91, 0x5e, 0x58, 0x57, -0xaf, 0x6d, 0x38, 0x3e, 0x33, 0xdb, 0x51, 0xe3, -0xbf, 0xd2, 0xff, 0xb8, 0xff, 0x0c, 0x09, 0xcf, -0x3b, 0x03, 0x60, 0xb5, 0x80, 0xf1, 0xb1, 0xb3, -0xf6, 0x9c, 0xb1, 0x68, 0x65, 0x71, 0x26, 0xc3, -0x17, 0x5d, 0x3c, 0x17, 0x43, 0x20, 0x33, 0xa8, -0x63, 0x51, 0x80, 0x9b, 0x8e, 0xfe, 0x28, 0x26, -0x8c, 0xd2, 0x3d, 0xbf, 0x1d, 0x65, 0x1a, 0x5f, -0xbf, 0x37, 0xa7, 0x67, 0x58, 0x2c, 0xc0, 0xda, -0x2b, 0xa8, 0x55, 0x2c, 0x52, 0xf3, 0xc6, 0x59, -0xfb, 0x49, 0x5a, 0xaa, 0x20, 0x71, 0xa7, 0xf3, -0x24, 0x83, 0x5e, 0xc6, 0xbc, 0xac, 0xa0, 0xf5, -0xf7, 0x62, 0x74, 0x54, 0x11, 0xff, 0xcb, 0xf8, -0x0f, 0x4c, 0xf1, 0xc7, 0x1d, 0xb6, 0x9e, 0xcf, -0x11, 0x04, 0xa6, 0x8e, 0x16, 0x1b, 0x41, 0x30, -0x54, 0x49, 0x13, 0x9b, 0xb8, 0x24, 0xdf, 0x1c, -0x37, 0x0a, 0x7b, 0x06, 0xfa, 0x02, 0xa4, 0x80, -0x43, 0xe2, 0x36, 0xef, 0xb0, 0xba, 0x5a, 0x5e, -0xcb, 0x8a, 0x8b, 0xb8, 0xaa, 0x0b, 0xbe, 0x02, -0x70, 0x94, 0x46, 0xc0, 0x19, 0x40, 0xf6, 0x4e, -0x6d, 0x7f, 0x4d, 0xc9, 0xdc, 0xc9, 0x48, 0x1e, -0x1f, 0x3a, 0x7e, 0x3d, 0x69, 0x47, 0x53, 0xab, -0x45, 0x77, 0xba, 0x98, 0x15, 0x53, 0x66, 0xae, -0xc3, 0x60, 0xba, 0x9d, 0x29, 0x83, 0xa3, 0xdc, -0x1b, 0xf8, 0xad, 0x4d, 0xda, 0x9a, 0x09, 0xb0, -0x18, 0xfa, 0xf5, 0xbd, 0x73, 0x17, 0x1b, 0x7a, -0xc7, 0xdf, 0x8c, 0xc4, 0x5f, 0x2b, 0x99, 0x91, -0x4f, 0x1e, 0x6b, 0x07, 0x96, 0xfd, 0x45, 0xe2, -0x37, 0x21, 0x58, 0xf2, 0x93, 0x34, 0xe8, 0x06, -0x3b, 0xff, 0xfc, 0x9a, 0x6b, 0x1d, 0x6e, 0x9b, -0x61, 0xd3, 0xae, 0x6f, 0xe6, 0xa1, 0x86, 0xfc, -0x3a, 0xc9, 0x51, 0xa6, 0x70, 0x1d, 0xc8, 0x8c, -0xdd, 0x09, 0x28, 0x8c, 0x7f, 0x3d, 0xfa, 0x4d, -0xae, 0xd9, 0x9e, 0x29, 0xbe, 0x56, 0xc2, 0x8e, -0x3f, 0xef, 0xb2, 0x66, 0x2f, 0xa5, 0x95, 0x14, -0x13, 0xd1, 0xfd, 0xa5, 0xda, 0xca, 0x6d, 0x91, -0xf1, 0x8e, 0x42, 0x81, 0xd4, 0xff, 0x5d, 0xc4, -0x4c, 0x2e, 0x14, 0x7c, 0xbb, 0x3d, 0x40, 0x5a, -0x6d, 0x97, 0xd2, 0x3d, 0x2a, 0x1f, 0xdd, 0x9f, -0x84, 0xc6, 0x00, 0xe0, 0xa9, 0x13, 0xfa, 0xc8, -0x2d, 0xca, 0x95, 0x6e, 0xcc, 0xa9, 0x66, 0x1b, -0x5f, 0x98, 0xa6, 0x1b, 0xb2, 0x5a, 0x8f, 0x73, -0x96, 0x91, 0xe7, 0x5d, 0xb7, 0x8a, 0xb1, 0xfc, -0x7d, 0x93, 0x9b, 0x7b, 0x4d, 0x5c, 0x94, 0xaf, -0xaf, 0x4a, 0xb5, 0xb0, 0xe9, 0x27, 0x35, 0x6f, -0xcb, 0xa2, 0x4c, 0x35, 0xd6, 0x73, 0xe2, 0x43, -0x5c, 0xb6, 0x0e, 0x08, 0x16, 0x4d, 0xa7, 0xc5, -0xbb, 0xe6, 0xf7, 0xce, 0xaa, 0xce, 0x65, 0x08, -0x2f, 0x4c, 0x67, 0x1a, 0xce, 0xe7, 0x46, 0x4f, -0x2b, 0x05, 0x80, 0x6f, 0x33, 0x27, 0x61, 0x36, -0x53, 0xd9, 0xa0, 0x40, 0x6a, 0xc3, 0xa3, 0xce, -0xc9, 0xa9, 0x14, 0x93, 0xed, 0x6b, 0xda, 0x27, -0x95, 0xaf, 0xe0, 0x62, 0x42, 0xea, 0x15, 0xe5, -0x18, 0x1c, 0xb3, 0xec, 0x0f, 0xe9, 0x46, 0xc9, -0xc8, 0x57, 0x14, 0x5a, 0xf3, 0xd6, 0x91, 0xcf, -0xd6, 0x92, 0x43, 0x18, 0x47, 0x8d, 0x7a, 0x14, -0xcc, 0xf5, 0x24, 0x08, 0x17, 0x20, 0xc9, 0x33, -0xcb, 0x5b, 0xb8, 0xc2, 0x9a, 0xfc, 0xf0, 0x2e, -0xd4, 0x11, 0x18, 0xb9, 0xa3, 0x0c, 0x63, 0x9c, -0x86, 0xe3, 0x72, 0x13, 0xdf, 0xc5, 0x42, 0x93, -0x4f, 0x90, 0x8b, 0x5e, 0x2e, 0xa7, 0xec, 0x8d, -0x45, 0xe0, 0xca, 0x5b, 0x00, 0x91, 0x61, 0x9f, -0xd4, 0x0c, 0x68, 0x6a, 0xc9, 0xf1, 0x42, 0xa6, -0xb0, 0xfe, 0x60, 0xa7, 0x08, 0xff, 0x2c, 0x69, -0xfd, 0x40, 0x43, 0xe9, 0x96, 0x27, 0x42, 0x9e, -0xb3, 0xbe, 0xb4, 0xb2, 0x9c, 0x3c, 0xd7, 0x6d, -0xb5, 0x7e, 0x69, 0xce, 0xeb, 0x68, 0xd3, 0x01, -0xa2, 0x46, 0x1a, 0x60, 0xbc, 0x68, 0x4d, 0x26, -0xd0, 0x54, 0x4a, 0xda, 0x9c, 0x35, 0x36, 0xe6, -0xd0, 0x0b, 0x9d, 0xbb, 0x95, 0x63, 0xe1, 0x65, -0x48, 0xd0, 0xd6, 0x27, 0x71, 0xb5, 0x03, 0x6f, -0x9a, 0x6d, 0xcd, 0xd0, 0x7f, 0x46, 0xb8, 0x07, -0xcc, 0x1d, 0x16, 0x9b, 0xea, 0x39, 0x0e, 0x36, -0xd7, 0x8e, 0xa7, 0x47, 0xe6, 0x13, 0xce, 0x55, -0x3a, 0x8f, 0x9d, 0x8f, 0xe8, 0x8d, 0xec, 0x7d, -0xcf, 0x18, 0xb6, 0xf7, 0x69, 0x56, 0x2e, 0xb1, -0x1d, 0x9a, 0x49, 0x1b, 0x87, 0xc3, 0x71, 0xc9, -0xac, 0xb8, 0xf1, 0x2d, 0xdd, 0x0b, 0x34, 0x40, -0x21, 0xa2, 0x56, 0xaf, 0x5f, 0xe8, 0xc4, 0xc9, -0xb1, 0x03, 0x75, 0x55, 0x27, 0x17, 0x3a, 0xfe, -0x29, 0x92, 0x35, 0x1e, 0x55, 0x8a, 0xcc, 0x1d, -0x54, 0x07, 0x71, 0x74, 0x2f, 0x85, 0xf2, 0x55, -0x73, 0x40, 0x8f, 0xd0, 0x6f, 0xf0, 0xea, 0xd9, -0x67, 0x35, 0xd0, 0xb1, 0x90, 0x64, 0x3f, 0xf9, -0xcc, 0x34, 0x45, 0x87, 0x16, 0xf6, 0x37, 0xab, -0xa8, 0x14, 0x3c, 0xd9, 0x11, 0x73, 0xc3, 0x92, -0xa5, 0x40, 0x44, 0x1a, 0x3d, 0xb9, 0xdf, 0x61, -0x0b, 0xaf, 0xf9, 0x5a, 0x9d, 0x1f }; - -static char pkt8[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0xec, 0x2c, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, -0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x45, 0xf0, -0xf5, 0xbd, 0x35, 0xbe, 0xbb, 0xa0, 0xd5, 0x87, -0x8e, 0xcc, 0x7d, 0xb4, 0x55, 0x5e, 0x4e, 0x81, -0x9f, 0xbb, 0xca, 0xc5, 0x37, 0xd5, 0x43, 0x91, -0x3f, 0xb8, 0xe9, 0x72, 0xc6, 0x67, 0x1a, 0xc8, -0xd4, 0x94, 0x43, 0x54, 0xe7, 0x41, 0x68, 0xce, -0x2d, 0xba, 0x77, 0xbf, 0x14, 0xe7, 0x6a, 0xd9, -0x1f, 0xd4, 0x5b, 0xb5, 0xd8, 0xce, 0x8d, 0xc4, -0xc2, 0x9d, 0xbb, 0x4c, 0xce, 0x3e, 0x3b, 0xe0, -0xa7, 0x9a, 0x46, 0xb0, 0x8e, 0x6c, 0xcb, 0x21, -0x5c, 0x8e, 0xba, 0xb5, 0xe4, 0x9a, 0x18, 0x62, -0xb3, 0x6c, 0x5c, 0xc2, 0x74, 0x51, 0xe2, 0x3b, -0x96, 0xfd, 0xd3, 0x97, 0xad, 0xff, 0xb7, 0xff, -0xe0, 0x34, 0x63, 0xc4, 0x3c, 0x18, 0xf5, 0x67, -0x72, 0xcb, 0x09, 0x02, 0x42, 0x76, 0x87, 0x19, -0xe4, 0x71, 0xa3, 0x5d, 0x25, 0xe7, 0x44, 0x97, -0xf5, 0x58, 0x74, 0x66, 0xa3, 0x1c, 0x28, 0xe3, -0xb8, 0xa1, 0x5a, 0x23, 0x83, 0x66, 0x90, 0xa2, -0xdf, 0xd4, 0x23, 0x6f, 0xfe, 0xab, 0x70, 0x74, -0x72, 0xea, 0x9e, 0x13, 0xff, 0x95, 0x40, 0xa4, -0xed, 0x2c, 0x78, 0x92, 0x2b, 0x6b, 0xa1, 0x69, -0x9f, 0x10, 0x6a, 0x5b, 0xdd, 0xcf, 0x73, 0x7e, -0xa4, 0xd5, 0x22, 0x2a, 0xba, 0x1e, 0x41, 0x61, -0x09, 0x32, 0xbd, 0xe1, 0x9c, 0x67, 0x1a, 0x91, -0xfe, 0x91, 0x1c, 0x99, 0x16, 0xe4, 0xd5, 0x84, -0x1d, 0xc1, 0xa4, 0x72, 0x3d, 0xa0, 0x23, 0x5a, -0x0b, 0x03, 0x8e, 0x2f, 0x50, 0x87, 0x03, 0x95, -0x50, 0xaf, 0xf4, 0x06, 0x55, 0x98, 0xff, 0xa9, -0xcd, 0x6b, 0xa6, 0xaa, 0x0d, 0x23, 0xc4, 0x20, -0x14, 0x5c }; - -#if 0 -static char pkt9[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, -0x00, 0x00, 0x00, 0xff, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, -0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0x0e, 0x73, -0x64, 0xda, 0xdc, 0x87, 0xdd, 0xa7, 0x8a, 0xb1, -0xe0, 0x5f, 0x0d, 0xc6, 0x1b, 0x2b, 0x5e, 0xa7, -0x91, 0x58, 0x18, 0x49, 0x62, 0xc7, 0xfc, 0xdc, -0x19, 0xb6, 0xf4, 0xa9, 0xb0, 0x06, 0x71, 0x0d, -0xa4, 0x68, 0x69, 0xfe, 0x06, 0xe5, 0xca, 0xd0, -0x1c, 0x96, 0x85, 0x39, 0xe4, 0x63, 0x14, 0xba, -0xaf, 0x6e, 0x18, 0x94, 0x92, 0x45, 0xe8, 0xd6, -0xc5, 0x7b, 0x81, 0xde, 0x9e, 0x95, 0x45, 0x14, -0x9d, 0xa4, 0x5f, 0x2a, 0x98, 0x49, 0x88, 0x0a, -0xa4, 0x99, 0xfd, 0x7e, 0x0e, 0xab, 0x17, 0x93, -0xe4, 0xec, 0xc7, 0xdb, 0x02, 0xb9, 0x41, 0xa9, -0x16, 0x83, 0xb8, 0xe3, 0xbb, 0x58, 0xb6, 0xc7, -0x2c, 0x42, 0x44, 0xe1, 0xba, 0xe1, 0xe5, 0x5e, -0x9c, 0xdf, 0x9e, 0x66, 0x90, 0x8b, 0x62, 0x8f, -0x9c, 0xf7, 0x76, 0x20, 0x7b, 0x3b, 0xec, 0xc2, -0x6b, 0x21, 0x16, 0xc8, 0x86, 0x91, 0xaa, 0xd7, -0xd1, 0xb6, 0x95, 0xc3, 0xaa, 0x2f, 0x64, 0xf6, -0x55, 0x6d, 0x46, 0x16, 0x17, 0xf2, 0xc5, 0xd9, -0xa8, 0x34, 0x6e, 0x31, 0x1c, 0x88, 0xf7, 0x9b, -0x96, 0xee, 0xe0, 0x91, 0x6b, 0xe0, 0x57, 0x76, -0x36, 0x4c, 0xfb, 0x62, 0x54, 0xbe, 0x28, 0x0f, -0x31, 0xeb, 0x7b, 0xe3, 0x23, 0xe0, 0x8d, 0x77, -0xee, 0x9c, 0xf8, 0x65, 0xd5, 0xf8, 0x68, 0xb6, -0x54, 0xe3, 0xd9, 0xb0, 0x03, 0x12, 0x85, 0xf4, -0x38, 0x7f, 0x7c, 0x9d, 0xf9, 0xa4, 0xd6, 0x0a, -0xf2, 0xf9, 0x75, 0xf8, 0x9e, 0xe3, 0xc9, 0xe0, -0xa4, 0x46, 0x6b, 0x0e, 0x18, 0x19, 0xbd, 0xa9, -0x01, 0x80, 0x81, 0xb0, 0xed, 0xa5, 0xee, 0xf1, -0x4d, 0xf7, 0x08, 0x95, 0x30, 0xf3, 0x13, 0xb5, -0xd0, 0x25, 0x2f, 0x4d, 0x04, 0xa2, 0x70, 0x03, -0x00, 0xd1, 0xa3, 0xb9, 0xed, 0x81, 0x3f, 0x9a, -0xa9, 0xaf, 0x70, 0x9d, 0x5e, 0x11, 0x45, 0x69, -0xf0, 0xc1, 0x3e, 0xa9, 0x5c, 0x89, 0xb2, 0x42, -0x86, 0x2c, 0x63, 0xae, 0xcd, 0xe6, 0x60, 0xd4, -0x75, 0xf1, 0xeb, 0xbc, 0x7f, 0xdc, 0x44, 0x2e, -0xd5, 0xe4, 0x3f, 0xc4, 0x9c, 0x92, 0xa4, 0x1c, -0x23, 0xf7, 0x80, 0xae, 0x5a, 0x29, 0xe2, 0xd5, -0x30, 0x81, 0x2d, 0xed, 0x94, 0x4a, 0x49, 0x1b, -0xb2, 0xc2, 0x8b, 0xee, 0xc8, 0x2e, 0xb2, 0x7a, -0xeb, 0x2f, 0x36, 0x2e, 0x7e, 0xcb, 0x09, 0xcb, -0x9e, 0xbf, 0xf4, 0x99, 0xb2, 0x61, 0x87, 0x24, -0x91, 0x95, 0x24, 0xf0, 0x9c, 0x8c, 0x98, 0x9d, -0x37, 0x4f, 0x51, 0xff, 0x52, 0xc4, 0xa3, 0xd4, -0x95, 0xf1, 0xc8, 0x5e, 0xce, 0x2d, 0xa5, 0xc0, -0xe9, 0xb8, 0x53, 0x60, 0x0a, 0xe9, 0x26, 0xaa, -0x8f, 0x80, 0x2d, 0x67, 0x3d, 0x2d, 0xe9, 0x3c, -0xae, 0xa7, 0xd0, 0x5e, 0x31, 0xba, 0x14, 0xa1, -0xb1, 0xfc, 0xd5, 0x70, 0xe9, 0x03, 0xee, 0xfc, -0x29, 0xd0, 0x3b, 0x52, 0xad, 0xa3, 0xcc, 0x9f, -0x61, 0x17, 0x97, 0x94, 0xf0, 0x9c, 0xb0, 0x75, -0x5b, 0x3c, 0xdb, 0x1d, 0xef, 0xa0, 0x90, 0x45, -0x99, 0xb3, 0x1e, 0x9f, 0x0f, 0x44, 0xa1, 0xaf, -0x03, 0x49, 0x60, 0x88, 0xc4, 0xe6, 0xb5, 0x71, -0xad, 0x18, 0x48, 0x67, 0x40, 0x38, 0xd0, 0x0c, -0xa9, 0x6d, 0x8c, 0xbc, 0xab, 0x5e, 0x87, 0x9c, -0xd1, 0x99, 0x77, 0xea, 0x4b, 0xe6, 0xb7, 0x05, -0x05, 0xf1, 0x44, 0xfc, 0x77, 0x58, 0xc6, 0xfc, -0xfe, 0xd9, 0x0a, 0xc2, 0x09, 0x51, 0x7c, 0xec, -0x19, 0x69, 0x48, 0xa7, 0x81, 0xec, 0x0a, 0x60, -0x71, 0x15, 0x68, 0xba, 0x65, 0x29, 0x5c, 0xee, -0x78, 0x8c, 0x60, 0x51, 0x19, 0xf6, 0x37, 0x59, -0xd7, 0xc9, 0x97, 0xf5, 0xbb, 0xb3, 0x84, 0x64, -0x66, 0x49, 0x94, 0xd8, 0x3d, 0xc5, 0x95, 0x36, -0xc0, 0xc9, 0xa0, 0x55, 0x50, 0xec, 0x7c, 0x9b, -0xca, 0xf2, 0x27, 0x7f, 0x91, 0x5e, 0x58, 0x57, -0xaf, 0x6d, 0x38, 0x3e, 0x33, 0xdb, 0x51, 0xe3, -0xbf, 0xd2, 0xff, 0xb8, 0xff, 0x0c, 0x09, 0xcf, -0x3b, 0x03, 0x60, 0xb5, 0x80, 0xf1, 0xb1, 0xb3, -0xf6, 0x9c, 0xb1, 0x68, 0x65, 0x71, 0x26, 0xc3, -0x17, 0x5d, 0x3c, 0x17, 0x43, 0x20, 0x33, 0xa8, -0x63, 0x51, 0x80, 0x9b, 0x8e, 0xfe, 0x28, 0x26, -0x8c, 0xd2, 0x3d, 0xbf, 0x1d, 0x65, 0x1a, 0x5f, -0xbf, 0x37, 0xa7, 0x67, 0x58, 0x2c, 0xc0, 0xda, -0x2b, 0xa8, 0x55, 0x2c, 0x52, 0xf3, 0xc6, 0x59, -0xfb, 0x49, 0x5a, 0xaa, 0x20, 0x71, 0xa7, 0xf3, -0x24, 0x83, 0x5e, 0xc6, 0xbc, 0xac, 0xa0, 0xf5, -0xf7, 0x62, 0x74, 0x54, 0x11, 0xff, 0xcb, 0xf8, -0x0f, 0x4c, 0xf1, 0xc7, 0x1d, 0xb6, 0x9e, 0xcf, -0x11, 0x04, 0xa6, 0x8e, 0x16, 0x1b, 0x41, 0x30, -0x54, 0x49, 0x13, 0x9b, 0xb8, 0x24, 0xdf, 0x1c, -0x37, 0x0a, 0x7b, 0x06, 0xfa, 0x02, 0xa4, 0x80, -0x43, 0xe2, 0x36, 0xef, 0xb0, 0xba, 0x5a, 0x5e, -0xcb, 0x8a, 0x8b, 0xb8, 0xaa, 0x0b, 0xbe, 0x02, -0x70, 0x94, 0x46, 0xc0, 0x19, 0x40, 0xf6, 0x4e, -0x6d, 0x7f, 0x4d, 0xc9, 0xdc, 0xc9, 0x48, 0x1e, -0x1f, 0x3a, 0x7e, 0x3d, 0x69, 0x47, 0x53, 0xab, -0x45, 0x77, 0xba, 0x98, 0x15, 0x53, 0x66, 0xae, -0xc3, 0x60, 0xba, 0x9d, 0x29, 0x83, 0xa3, 0xdc, -0x1b, 0xf8, 0xad, 0x4d, 0xda, 0x9a, 0x09, 0xb0, -0x18, 0xfa, 0xf5, 0xbd, 0x73, 0x17, 0x1b, 0x7a, -0xc7, 0xdf, 0x8c, 0xc4, 0x5f, 0x2b, 0x99, 0x91, -0x4f, 0x1e, 0x6b, 0x07, 0x96, 0xfd, 0x45, 0xe2, -0x37, 0x21, 0x58, 0xf2, 0x93, 0x34, 0xe8, 0x06, -0x3b, 0xff, 0xfc, 0x9a, 0x6b, 0x1d, 0x6e, 0x9b, -0x61, 0xd3, 0xae, 0x6f, 0xe6, 0xa1, 0x86, 0xfc, -0x3a, 0xc9, 0x51, 0xa6, 0x70, 0x1d, 0xc8, 0x8c, -0xdd, 0x09, 0x28, 0x8c, 0x7f, 0x3d, 0xfa, 0x4d, -0xae, 0xd9, 0x9e, 0x29, 0xbe, 0x56, 0xc2, 0x8e, -0x3f, 0xef, 0xb2, 0x66, 0x2f, 0xa5, 0x95, 0x14, -0x13, 0xd1, 0xfd, 0xa5, 0xda, 0xca, 0x6d, 0x91, -0xf1, 0x8e, 0x42, 0x81, 0xd4, 0xff, 0x5d, 0xc4, -0x4c, 0x2e, 0x14, 0x7c, 0xbb, 0x3d, 0x40, 0x5a, -0x6d, 0x97, 0xd2, 0x3d, 0x2a, 0x1f, 0xdd, 0x9f, -0x84, 0xc6, 0x00, 0xe0, 0xa9, 0x13, 0xfa, 0xc8, -0x2d, 0xca, 0x95, 0x6e, 0xcc, 0xa9, 0x66, 0x1b, -0x5f, 0x98, 0xa6, 0x1b, 0xb2, 0x5a, 0x8f, 0x73, -0x96, 0x91, 0xe7, 0x5d, 0xb7, 0x8a, 0xb1, 0xfc, -0x7d, 0x93, 0x9b, 0x7b, 0x4d, 0x5c, 0x94, 0xaf, -0xaf, 0x4a, 0xb5, 0xb0, 0xe9, 0x27, 0x35, 0x6f, -0xcb, 0xa2, 0x4c, 0x35, 0xd6, 0x73, 0xe2, 0x43, -0x5c, 0xb6, 0x0e, 0x08, 0x16, 0x4d, 0xa7, 0xc5, -0xbb, 0xe6, 0xf7, 0xce, 0xaa, 0xce, 0x65, 0x08, -0x2f, 0x4c, 0x67, 0x1a, 0xce, 0xe7, 0x46, 0x4f, -0x2b, 0x05, 0x80, 0x6f, 0x33, 0x27, 0x61, 0x36, -0x53, 0xd9, 0xa0, 0x40, 0x6a, 0xc3, 0xa3, 0xce, -0xc9, 0xa9, 0x14, 0x93, 0xed, 0x6b, 0xda, 0x27, -0x95, 0xaf, 0xe0, 0x62, 0x42, 0xea, 0x15, 0xe5, -0x18, 0x1c, 0xb3, 0xec, 0x0f, 0xe9, 0x46, 0xc9, -0xc8, 0x57, 0x14, 0x5a, 0xf3, 0xd6, 0x91, 0xcf, -0xd6, 0x92, 0x43, 0x18, 0x47, 0x8d, 0x7a, 0x14, -0xcc, 0xf5, 0x24, 0x08, 0x17, 0x20, 0xc9, 0x33, -0xcb, 0x5b, 0xb8, 0xc2, 0x9a, 0xfc, 0xf0, 0x2e, -0xd4, 0x11, 0x18, 0xb9, 0xa3, 0x0c, 0x63, 0x9c, -0x86, 0xe3, 0x72, 0x13, 0xdf, 0xc5, 0x42, 0x93, -0x4f, 0x90, 0x8b, 0x5e, 0x2e, 0xa7, 0xec, 0x8d, -0x45, 0xe0, 0xca, 0x5b, 0x00, 0x91, 0x61, 0x9f, -0xd4, 0x0c, 0x68, 0x6a, 0xc9, 0xf1, 0x42, 0xa6, -0xb0, 0xfe, 0x60, 0xa7, 0x08, 0xff, 0x2c, 0x69, -0xfd, 0x40, 0x43, 0xe9, 0x96, 0x27, 0x42, 0x9e, -0xb3, 0xbe, 0xb4, 0xb2, 0x9c, 0x3c, 0xd7, 0x6d, -0xb5, 0x7e, 0x69, 0xce, 0xeb, 0x68, 0xd3, 0x01, -0xa2, 0x46, 0x1a, 0x60, 0xbc, 0x68, 0x4d, 0x26, -0xd0, 0x54, 0x4a, 0xda, 0x9c, 0x35, 0x36, 0xe6, -0xd0, 0x0b, 0x9d, 0xbb, 0x95, 0x63, 0xe1, 0x65, -0x48, 0xd0, 0xd6, 0x27, 0x71, 0xb5, 0x03, 0x6f, -0x9a, 0x6d, 0xcd, 0xd0, 0x7f, 0x46, 0xb8, 0x07, -0xcc, 0x1d, 0x16, 0x9b, 0xea, 0x39, 0x0e, 0x36, -0xd7, 0x8e, 0xa7, 0x47, 0xe6, 0x13, 0xce, 0x55, -0x3a, 0x8f, 0x9d, 0x8f, 0xe8, 0x8d, 0xec, 0x7d, -0xcf, 0x18, 0xb6, 0xf7, 0x69, 0x56, 0x2e, 0xb1, -0x1d, 0x9a, 0x49, 0x1b, 0x87, 0xc3, 0x71, 0xc9, -0xac, 0xb8, 0xf1, 0x2d, 0xdd, 0x0b, 0x34, 0x40, -0x21, 0xa2, 0x56, 0xaf, 0x5f, 0xe8, 0xc4, 0xc9, -0xb1, 0x03, 0x75, 0x55, 0x27, 0x17, 0x3a, 0xfe, -0x29, 0x92, 0x35, 0x1e, 0x55, 0x8a, 0xcc, 0x1d, -0x54, 0x07, 0x71, 0x74, 0x2f, 0x85, 0xf2, 0x55, -0x73, 0x40, 0x8f, 0xd0, 0x6f, 0xf0, 0xea, 0xd9, -0x67, 0x35, 0xd0, 0xb1, 0x90, 0x64, 0x3f, 0xf9, -0xcc, 0x34, 0x45, 0x87, 0x16, 0xf6, 0x37, 0xab, -0xa8, 0x14, 0x3c, 0xd9, 0x11, 0x73, 0xc3, 0x92, -0xa5, 0x40, 0x44, 0x1a, 0x3d, 0xb9, 0xdf, 0x61, -0x0b, 0xaf, 0xf9, 0x5a, 0x9d, 0x1f, 0x45, 0xf0, -0xf5, 0xbd, 0x35, 0xbe, 0xbb, 0xa0, 0xd5, 0x87, -0x8e, 0xcc, 0x7d, 0xb4, 0x55, 0x5e, 0x4e, 0x81, -0x9f, 0xbb, 0xca, 0xc5, 0x37, 0xd5, 0x43, 0x91, -0x3f, 0xb8, 0xe9, 0x72, 0xc6, 0x67, 0x1a, 0xc8, -0xd4, 0x94, 0x43, 0x54, 0xe7, 0x41, 0x68, 0xce, -0x2d, 0xba, 0x77, 0xbf, 0x14, 0xe7, 0x6a, 0xd9, -0x1f, 0xd4, 0x5b, 0xb5, 0xd8, 0xce, 0x8d, 0xc4, -0xc2, 0x9d, 0xbb, 0x4c, 0xce, 0x3e, 0x3b, 0xe0, -0xa7, 0x9a, 0x46, 0xb0, 0x8e, 0x6c, 0xcb, 0x21, -0x5c, 0x8e, 0xba, 0xb5, 0xe4, 0x9a, 0x18, 0x62, -0xb3, 0x6c, 0x5c, 0xc2, 0x74, 0x51, 0xe2, 0x3b, -0x96, 0xfd, 0xd3, 0x97, 0xad, 0xff, 0xb7, 0xff, -0xe0, 0x34, 0x63, 0xc4, 0x3c, 0x18, 0xf5, 0x67, -0x72, 0xcb, 0x09, 0x02, 0x42, 0x76, 0x87, 0x19, -0xe4, 0x71, 0xa3, 0x5d, 0x25, 0xe7, 0x44, 0x97, -0xf5, 0x58, 0x74, 0x66, 0xa3, 0x1c, 0x28, 0xe3, -0xb8, 0xa1, 0x5a, 0x23, 0x83, 0x66, 0x90, 0xa2, -0xdf, 0xd4, 0x23, 0x6f, 0xfe, 0xab, 0x70, 0x74, -0x72, 0xea, 0x9e, 0x13, 0xff, 0x95, 0x40, 0xa4, -0xed, 0x2c, 0x78, 0x92, 0x2b, 0x6b, 0xa1, 0x69, -0x9f, 0x10, 0x6a, 0x5b, 0xdd, 0xcf, 0x73, 0x7e, -0xa4, 0xd5, 0x22, 0x2a, 0xba, 0x1e, 0x41, 0x61, -0x09, 0x32, 0xbd, 0xe1, 0x9c, 0x67, 0x1a, 0x91, -0xfe, 0x91, 0x1c, 0x99, 0x16, 0xe4, 0xd5, 0x84, -0x1d, 0xc1, 0xa4, 0x72, 0x3d, 0xa0, 0x23, 0x5a, -0x0b, 0x03, 0x8e, 0x2f, 0x50, 0x87, 0x03, 0x95, -0x50, 0xaf, 0xf4, 0x06, 0x55, 0x98, 0xff, 0xa9, -0xcd, 0x6b, 0xa6, 0xaa, 0x0d, 0x23, 0xc4, 0x20, -0x14, 0x5c }; - -static char pkt10[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt11[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt12[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt13[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, -0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt14[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, -0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, -0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, -0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, -0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static char pkt15[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt16[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt17[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xd5, 0xb5, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x14, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, -0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, -0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0f, 0x06, 0x80, 0xfc, 0x0a, 0x00, -0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, -0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; - -static char pkt18[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xd5, 0xb5, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x14, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, -0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, -0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0f, 0x06, 0x80, 0xfc, 0x0a, 0x00, -0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, -0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; - -static char pkt19[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xd5, 0xb6, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x15, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, -0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, -0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, -0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, -0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0c, 0x06, 0x80, 0xfc, 0x0a, 0x00, -0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, -0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, -0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; - -static char pkt20[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xd5, 0xb6, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6b, 0x15, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, -0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, -0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, -0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, -0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0c, 0x06, 0x80, 0xfc, 0x0a, 0x00, -0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, -0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, -0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; -#endif - -TAHI_TEST_SEQ tahi_ipsec_005[] = { - {TITLE, "IPSEC-005", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, - {ASSEMBLE, &pkt7[0], sizeof(pkt7), 3, 0, 0, 0, 0}, - {AD_CHECK, &pkt8[0], sizeof(pkt8), 5, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_005_size = sizeof(tahi_ipsec_005) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_006.c b/test/regression/tahi_test/tahi_ipsec_006.c deleted file mode 100644 index 40af6caa..00000000 --- a/test/regression/tahi_test/tahi_ipsec_006.c +++ /dev/null @@ -1,181 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt0[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, -0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, -0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, -0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, -0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xea, 0xd1, -0x3a, 0x91, 0x23, 0xb5, 0x4e, 0xea, 0xea, 0x1d, -0x61, 0xbe, 0xf2, 0xaa, 0x23, 0x91, 0x78, 0xf8, -0x82, 0x25, 0xc0, 0xad, 0xf7, 0x6c, 0x68, 0x1c, -0xa3, 0xc7, 0x88, 0x6c, 0xcb, 0xc2, 0x3d, 0xa2, -0x47, 0x68 }; - -static char pkt2[] = { -0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt3[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt4[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, -0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xc3, 0xcd, -0x45, 0xa5, 0x4a, 0x1b, 0x5b, 0xd7, 0xe6, 0x82, -0x6a, 0x43, 0x30, 0xff, 0x58, 0x56, 0x10, 0x1d, -0xc6, 0xa4, 0xd9, 0x5a, 0x04, 0xb8, 0x51, 0x57, -0x41, 0xc2, 0x27, 0xa8, 0xcb, 0x42, 0xc7, 0x31, -0x8d, 0x69, 0x1d, 0xa1, 0x5d, 0xb4, 0xd4, 0xb6, -0x44, 0xa2 }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x24, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x96, -0xac, 0x2e, 0xb1, 0xb3, 0xdc, 0x8c, 0xfd, 0x67, -0xc6, 0xca, 0xcf, 0xcd, 0x5a, 0x0b, 0xfe, 0x0e, -0x0e, 0x7c }; - -static char pkt6[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xea, 0xd1, -0x3a, 0x91, 0x23, 0xb5, 0x4e, 0xea, 0xea, 0x1d, -0x61, 0xbe, 0xf2, 0xaa, 0x23, 0x91, 0x78, 0xf8, -0x82, 0x25, 0xc0, 0xad, 0xf7, 0x6c, 0x79, 0xb6, -0xa3, 0x10, 0x59, 0x74, 0x32, 0xe8, 0x7e, 0x7c, -0x1e, 0x59 }; - -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0xf6, -0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xae, 0x8c, -0xf7, 0x66, 0xa0, 0xed, 0x8f, 0x37, 0xe6, 0xe6, -0x55, 0x44, 0x41, 0x2b, 0x37, 0x0b, 0xf8, 0x57, -0xc4, 0x91, 0x3f, 0x54, 0xcf, 0xae, 0xdc, 0x79, -0x4b, 0xcd, 0x03, 0x75, 0x0f, 0x27, 0x5d, 0x43, -0x47, 0x04, 0x67, 0x2b, 0x51, 0x1d, 0x09, 0x5a, -0xeb, 0xd2 }; - -#if 0 -static char pkt8[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt9[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_006[] = { - {TITLE, "IPSEC-006", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt0[0], sizeof(pkt0), 0, 0, 0, 0, 0}, /* Add a RA packet.*/ - {WAIT, NX_NULL, 0, 10, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, - {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, - {INJECT, &pkt9[0], sizeof(pkt9), 0, 0, 0, 0, 0}, /* Send NA first. */ - {D_CHECK, &pkt7[0], sizeof(pkt7), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_006_size = sizeof(tahi_ipsec_006) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_007.c b/test/regression/tahi_test/tahi_ipsec_007.c deleted file mode 100644 index f516a844..00000000 --- a/test/regression/tahi_test/tahi_ipsec_007.c +++ /dev/null @@ -1,135 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x5b, -0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0x43, 0xcf, -0x37, 0xbd, 0x3b, 0x8d, 0x4b, 0x22, 0xa5, 0x67, -0xb4, 0x58, 0x1d, 0x7b, 0x3c, 0xfc, 0xcf, 0x25, -0xe5, 0x0e, 0x3c, 0xee, 0x5b, 0xc1, 0xb7, 0xc0, -0xa5, 0x0a, 0xff, 0x65, 0x49, 0x36, 0x32, 0xc0, -0x87, 0x6e, 0x88, 0x67, 0x50, 0xe4, 0x0e, 0x0d, -0x83, 0xd2 }; - -static char pkt3[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x23, -0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xb7, 0x6e, -0xae, 0xf1, 0xe4, 0xb0, 0x56, 0xd6, 0x3a, 0x9e, -0x0b, 0xb4, 0xd2, 0x0b, 0xe0, 0x1f, 0x54, 0x9d, -0x15, 0x82, 0x22, 0xa1, 0xe7, 0xa8, 0x0d, 0x5e, -0x9d, 0x9a }; - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xa5, 0x3b, -0x91, 0x77, 0x91, 0x16, 0x3e, 0xa0, 0x3d, 0xb1, -0x63, 0xb8 }; - -static char pkt5[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x7f, -0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0x7a, 0xca, -0x08, 0x9d, 0x64, 0xad, 0x5f, 0x8a, 0x52, 0xcc, -0xaf, 0x66, 0xe3, 0xf0, 0x49, 0x54, 0x0b, 0x22, -0x12, 0x4a, 0xc1, 0x68, 0x9d, 0x61, 0x25, 0xdb, -0x2d, 0x07, 0x13, 0x60, 0xed, 0x51, 0xf9, 0xca, -0x5d, 0xe5, 0xa2, 0xdb, 0x16, 0xdf, 0xfe, 0xe6, -0x60, 0xa2 }; - -#if 0 -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt7[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_007[] = { - {TITLE, "IPSEC-007", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, - {INJECT, &pkt7[0], sizeof(pkt7), 0, 0, 0, 0, 0}, /* Send NA first. */ - {D_CHECK, &pkt5[0], sizeof(pkt5), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_007_size = sizeof(tahi_ipsec_007) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_008.c b/test/regression/tahi_test/tahi_ipsec_008.c deleted file mode 100644 index ab4b7ca5..00000000 --- a/test/regression/tahi_test/tahi_ipsec_008.c +++ /dev/null @@ -1,110 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0x68, 0x48, -0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0xdd, 0x46, -0x5c, 0xea, 0xe5, 0x8d, 0x53, 0x63, 0x0c, 0xcb, -0x5e, 0xe8, 0x1e, 0x3a, 0x6d, 0xe6, 0xb1, 0x43, -0x1c, 0x50, 0x0d, 0x1e, 0x29, 0x06, 0x0b, 0xb3, -0xa0, 0xfe, 0x3c, 0x53, 0x3d, 0xb6, 0x46, 0x88, -0xb8, 0x74, 0xe6, 0x0f, 0x2c, 0x0e, 0x87, 0x70, -0xf5, 0x29 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, -0x13, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, -0x12, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -TAHI_TEST_SEQ tahi_ipsec_008[] = { - {TITLE, "IPSEC-008", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {CHECK, &pkt6[0], sizeof(pkt6), 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_008_size = sizeof(tahi_ipsec_008) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_008_02.c b/test/regression/tahi_test/tahi_ipsec_008_02.c deleted file mode 100644 index 8788b793..00000000 --- a/test/regression/tahi_test/tahi_ipsec_008_02.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, -0x13, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x81, 0x00, -0x12, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -TAHI_TEST_SEQ tahi_ipsec_008_02[] = { - {TITLE, "IPSEC-008_02", 12, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {CHECK, &pkt6[0], sizeof(pkt6), 3, 0, 0, 0, 0}, - {CHECK, NX_NULL, 0, 3, 0, 0, 0, 0}, - {CHECK, NX_NULL, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_008_02_size = sizeof(tahi_ipsec_008_02) / sizeof(TAHI_TEST_SEQ); - -#endif \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_ipsec_009.c b/test/regression/tahi_test/tahi_ipsec_009.c deleted file mode 100644 index ba5096eb..00000000 --- a/test/regression/tahi_test/tahi_ipsec_009.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xb7, -0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0xef, 0x55, -0xca, 0x2d, 0xc0, 0x4a, 0x54, 0x46, 0x0f, 0x51, -0xfc, 0x9b, 0xf7, 0xd4, 0xfa, 0x10, 0xc4, 0x76, -0xae, 0xed, 0xce, 0x73, 0x41, 0x51, 0xe9, 0x20, -0xde, 0xf7, 0x03, 0x8c, 0x11, 0xbe, 0xe2, 0xcc, -0xb2, 0xdd, 0xdb, 0xc2, 0xc6, 0xc4, 0xed, 0xd9, -0x60, 0xee }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_009[] = { - {TITLE, "IPSEC-009", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_009_size = sizeof(tahi_ipsec_009) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_009_02.c b/test/regression/tahi_test/tahi_ipsec_009_02.c deleted file mode 100644 index 8c0ccd2f..00000000 --- a/test/regression/tahi_test/tahi_ipsec_009_02.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, -0x13, 0x99, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -TAHI_TEST_SEQ tahi_ipsec_009_02[] = { - {TITLE, "IPSEC-009-02", 12, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_009_02_size = sizeof(tahi_ipsec_009_02) / sizeof(TAHI_TEST_SEQ); - -#endif \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_ipsec_010.c b/test/regression/tahi_test/tahi_ipsec_010.c deleted file mode 100644 index ca3c910d..00000000 --- a/test/regression/tahi_test/tahi_ipsec_010.c +++ /dev/null @@ -1,148 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x5b, -0xa0, 0x57, 0x89, 0x22, 0xed, 0x9b, 0x47, 0x4d, -0x4f, 0x12, 0xcc, 0x65, 0xb7, 0x6a, 0x49, 0x35, -0xb0, 0x9f, 0x05, 0x22, 0x91, 0x0f, 0x77, 0xd1, -0xdf, 0x02, 0x60, 0x46, 0x8f, 0x90, 0x46, 0x52, -0x54, 0x25 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2b, 0xa5, -0xa3, 0x70, 0xf1, 0xba, 0xe4, 0x28, 0x9a, 0x80, -0x5a, 0x60, 0xb6, 0x12, 0x7d, 0x8e, 0x4c, 0x29, -0x23, 0x38, 0x41, 0x5b, 0xe8, 0x84, 0x7e, 0x0b, -0x0b, 0x2c, 0xa0, 0x77, 0xa7, 0x97, 0xd9, 0x4b, -0x86, 0x7b, 0x25, 0xc1, 0xe7, 0xca, 0x17, 0xa7, -0x7f, 0x69 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x01, 0x2c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x5b, -0xa0, 0x57, 0x89, 0x22, 0xed, 0x9b, 0x47, 0x4d, -0x4f, 0x12, 0xcc, 0x65, 0xb7, 0x6a, 0x49, 0x3d, -0xa4, 0x94, 0xcf, 0x82, 0xa0, 0x58, 0x1f, 0xba, -0xbc, 0xa5, 0xd9, 0xe6, 0xfd, 0x38, 0x5d, 0x8c, -0xf2, 0xc1, 0xac, 0xa9, 0x5f, 0xe1, 0x98, 0xe5, -0x09, 0x0d, 0x51, 0xff, 0x2a, 0x71, 0x93, 0x21, -0x37, 0x17, 0x64, 0xb4, 0xe0, 0x6b, 0xfe, 0x17, -0x9c, 0x4e, 0x64, 0x7b, 0xea, 0x92, 0x22, 0xf1, -0xb6, 0xd4, 0xf3, 0x93, 0x50, 0xa7, 0x1f, 0x43, -0xa1, 0x76, 0xbb, 0xa3, 0x9e, 0x45, 0x44, 0x12, -0xb7, 0x6b, 0x87, 0x48, 0x36, 0xe3, 0xf5, 0x72, -0x78, 0x06, 0x2a, 0xa0, 0x7c, 0xcf, 0x8d, 0xa0, -0x3f, 0x09, 0x3a, 0x79, 0x14, 0x06, 0xa3, 0xa0, -0xa6, 0x95, 0x33, 0xf7, 0xe1, 0x4a, 0xa2, 0x19, -0xe0, 0x88, 0x86, 0xb4, 0xfd, 0xb5, 0xb2, 0xa7, -0x4c, 0xd8, 0x89, 0x7f, 0x3c, 0x02, 0xd3, 0x3a, -0xe1, 0xfd, 0xc1, 0x4f, 0x79, 0x78, 0x2e, 0x89, -0x24, 0x17, 0xfa, 0xcb, 0x93, 0x70, 0x73, 0x58, -0xd4, 0xc3, 0x30, 0x4f, 0xb4, 0x64, 0x3f, 0x2a, -0x74, 0xbf, 0x49, 0xcd, 0xbc, 0xbb, 0x38, 0x25, -0x10, 0x84, 0x6c, 0x14, 0x81, 0xfc, 0xad, 0x5a, -0xcc, 0xbd, 0xbd, 0x6f, 0xe6, 0x55, 0x05, 0xaa, -0x6d, 0xa7, 0x47, 0xcd, 0x6d, 0x89, 0xf9, 0xa5, -0x7a, 0x30, 0x77, 0x4c, 0x41, 0x32, 0xbc, 0xfc, -0x4f, 0x0b, 0x05, 0x49, 0xca, 0x2e, 0x00, 0x8b, -0xc8, 0x63, 0x13, 0xca, 0x25, 0x77, 0x8d, 0xbe, -0x7d, 0x21, 0x23, 0xe5, 0x9d, 0x40, 0x3e, 0xd5, -0x81, 0xcf, 0x08, 0x83, 0x09, 0x55, 0x9c, 0x02, -0x55, 0xb0, 0x4a, 0xc0, 0xe0, 0xe3, 0x03, 0x25, -0xde, 0xc0, 0x98, 0xf5, 0xe3, 0xe8, 0x9b, 0xa6, -0x0d, 0xd0, 0x75, 0xbf, 0x04, 0x67, 0x47, 0x68, -0x5a, 0xdb, 0x1f, 0x08, 0x0d, 0xfc, 0x25, 0x7d, -0x3d, 0x7b, 0xcd, 0x0a, 0x15, 0xa4, 0x1e, 0x5a, -0xe1, 0x95, 0x57, 0x4b, 0x4b, 0xb8, 0x01, 0x35, -0x72, 0xf2, 0x81, 0x82, 0x71, 0x0f, 0xe3, 0xd7, -0x48, 0x7f }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, -0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0x31, 0x8b, -0x80, 0x35, 0x94, 0xb1, 0xd3, 0xb4, 0xdf, 0x9d, -0x9b, 0x07, 0x97, 0x8e, 0x01, 0x4d, 0xe1, 0x07, -0x7c, 0x35, 0x6d, 0xd5, 0x57, 0xb2, 0xd6, 0xb5, -0x0b, 0x74, 0x75, 0x04, 0x68, 0xb6, 0x3c, 0x82, -0xe8, 0x4b }; - -TAHI_TEST_SEQ tahi_ipsec_010[] = { - {TITLE, "IPSEC-010", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_010_size = sizeof(tahi_ipsec_010) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_012.c b/test/regression/tahi_test/tahi_ipsec_012.c deleted file mode 100644 index a5b944ac..00000000 --- a/test/regression/tahi_test/tahi_ipsec_012.c +++ /dev/null @@ -1,102 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7a, 0x2f, -0x2d, 0x74, 0x96, 0x07, 0x1f, 0x0d, 0x82, 0x41, -0xc7, 0xf2, 0xa7, 0x7c, 0x7b, 0x41, 0x3a, 0xef, -0xcc, 0xf4, 0x64, 0xbd, 0xbf, 0x5f, 0x72, 0xdc, -0x46, 0xfa, 0xde, 0xa6, 0xe2, 0x7c, 0xde, 0x6c, -0x44, 0x63, 0x1c, 0xa7, 0x2c, 0xb7, 0xed, 0x7a, -0xfb, 0x04, 0xd3, 0x2c, 0xe0, 0xca, 0x00, 0x0d, -0x38, 0xe8 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x90, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xec, 0x69, -0xfd, 0xd9, 0x61, 0xd2, 0xa2, 0xb4, 0x20, 0xac, -0x2d, 0x26 }; - -TAHI_TEST_SEQ tahi_ipsec_012[] = { - {TITLE, "IPSEC-012", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0],sizeof(pkt5),0, 0, 0, 0, 0}, - {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_012_size = sizeof(tahi_ipsec_012) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_013.c b/test/regression/tahi_test/tahi_ipsec_013.c deleted file mode 100644 index 5a3f426a..00000000 --- a/test/regression/tahi_test/tahi_ipsec_013.c +++ /dev/null @@ -1,102 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x09, 0x5e, -0x03, 0x76, 0x2c, 0x70, 0xf7, 0x40, 0x93, 0x0d, -0x77, 0x9d, 0x7a, 0xd2, 0xaf, 0xb6, 0x1f, 0x55, -0x62, 0x92, 0x1e, 0x9b, 0xf8, 0xa8, 0x5e, 0xb1, -0x6e, 0x4b, 0x80, 0x1f, 0xf1, 0xa9, 0x2d, 0x25, -0x35, 0x69, 0x92, 0x1b, 0x23, 0x99, 0x2f, 0x92, -0x4e, 0xbb, 0xff, 0x74, 0xb1, 0xfe, 0x3a, 0xde, -0xe4, 0xaa }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xaa, 0xaa, -0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, -0xaa, 0xaa, 0xaa, 0xaa, 0x6d, 0x38, 0x5a, 0x47, -0x8b, 0x08, 0x88, 0x5b, 0xd1, 0xce, 0x49, 0xfd, -0xe6, 0x6b }; - -TAHI_TEST_SEQ tahi_ipsec_013[] = { - {TITLE, "IPSEC-013", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_013_size = sizeof(tahi_ipsec_013) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_014.c b/test/regression/tahi_test/tahi_ipsec_014.c deleted file mode 100644 index 32e154bf..00000000 --- a/test/regression/tahi_test/tahi_ipsec_014.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xe1, 0xf0, -0x67, 0x77, 0x03, 0xc5, 0x55, 0x38, 0xb0, 0x1f, -0x5e, 0x4f }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0xa5, 0x2c, -0xa7, 0x6f, 0x57, 0x41, 0xa8, 0x2a, 0x48, 0xc6, -0x65, 0xe7, 0x0b, 0x84, 0x6e, 0x78, 0x52, 0xf4, -0x83, 0x67, 0x4a, 0x71, 0x15, 0xfe, 0x8d, 0x85, -0x27, 0x2c, 0xe4, 0x03, 0x9a, 0x37, 0xa7, 0x9e, -0xcf, 0x14, 0x20, 0x06, 0x86, 0x14, 0xcd, 0x24, -0x60, 0xd4, 0xd2, 0x5d, 0x2e, 0x18, 0x7c, 0x6a, -0xe3, 0x92 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_014[] = { - {TITLE, "IPSEC-014", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_014_size = sizeof(tahi_ipsec_014) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_015.c b/test/regression/tahi_test/tahi_ipsec_015.c deleted file mode 100644 index 934e9041..00000000 --- a/test/regression/tahi_test/tahi_ipsec_015.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38, 0xa4, 0xa8, -0x86, 0xf5, 0x75, 0xa6, 0xcd, 0x0d, 0x52, 0x65, -0x67, 0x3a }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x74, 0xdf, -0xa0, 0x58, 0x64, 0x03, 0x4a, 0x47, 0xa0, 0x37, -0x93, 0x62, 0xa4, 0x07, 0x3f, 0x8d, 0xec, 0x0e, -0x2f, 0x4c, 0xb7, 0xd2, 0xb7, 0x31, 0xb0, 0xb5, -0x92, 0x33, 0x40, 0xd6, 0xb8, 0x89, 0xcc, 0xf8, -0x4b, 0x99, 0x20, 0xf2, 0x0e, 0x99, 0x0c, 0x74, -0xbb, 0xf3, 0xe8, 0x8a, 0xc5, 0x60, 0x89, 0x3e, -0x59, 0x0f }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_015[] = { - {TITLE, "IPSEC-015", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_015_size = sizeof(tahi_ipsec_015) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_016.c b/test/regression/tahi_test/tahi_ipsec_016.c deleted file mode 100644 index bd962cc7..00000000 --- a/test/regression/tahi_test/tahi_ipsec_016.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x28, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x3b, -0x39, 0xba, 0x4e, 0x12, 0xa2, 0xff, 0xbb, 0xa2, -0x71, 0xa4, 0x13, 0x3e, 0x91, 0x5f, 0x2e, 0xa6, -0x93, 0xcd, 0xba, 0x91, 0x6d, 0x38 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc4, 0x3c, -0x53, 0x2e, 0xaf, 0x5f, 0x18, 0x04, 0xfa, 0xeb, -0x30, 0x09, 0x0d, 0x92, 0xaa, 0x89, 0x43, 0x6a, -0xae, 0x69, 0x9d, 0x12, 0x4f, 0x4e, 0x9f, 0x5a, -0x97, 0x04, 0xd7, 0x27, 0x69, 0x5c, 0x5f, 0xab, -0x48, 0x2a, 0x44, 0x30, 0xe0, 0x55 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_016[] = { - {TITLE, "IPSEC-016", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_016_size = sizeof(tahi_ipsec_016) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_017.c b/test/regression/tahi_test/tahi_ipsec_017.c deleted file mode 100644 index 0b952f1a..00000000 --- a/test/regression/tahi_test/tahi_ipsec_017.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x58, -0x93, 0x6c, 0xa3, 0xc3, 0xe3, 0x73, 0x64, 0x62, -0xf2, 0x46, 0x31, 0x67, 0x99, 0x1d, 0xba, 0x56, -0x20, 0x17, 0x3e, 0x4a, 0xf9, 0xc8, 0x62, 0x98, -0x2e, 0x71, 0xff, 0x02, 0xa6, 0x85, 0x5a, 0xd0, -0x2d, 0x42, 0x23, 0x8c, 0xbc, 0x26, 0xfd, 0xc9, -0xf2, 0x26 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0xb1, -0xe3, 0x6d, 0x28, 0x86, 0xab, 0x0c, 0xa4, 0xbf, -0x43, 0x70, 0xe9, 0x50, 0x81, 0x39, 0x4a, 0x3b, -0xf6, 0xb1, 0x38, 0x92, 0x9b, 0xad, 0x94, 0xe2, -0x3f, 0xda, 0xb9, 0xbb, 0x1e, 0x0c, 0x20, 0x17, -0xe3, 0x21, 0xab, 0xce, 0xba, 0x5f, 0xe5, 0xb9, -0x15, 0x2e, 0x5f, 0xb3, 0xda, 0x37, 0x0a, 0x86, -0xea, 0xce, 0x93, 0x45, 0xcf, 0x28, 0x47, 0x50, -0x92, 0x35 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_017[] = { - {TITLE, "IPSEC-017", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_017_size = sizeof(tahi_ipsec_017) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_018.c b/test/regression/tahi_test/tahi_ipsec_018.c deleted file mode 100644 index 8555edda..00000000 --- a/test/regression/tahi_test/tahi_ipsec_018.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xad, -0xfa, 0x5d, 0x9a, 0x13, 0xd5, 0xfd, 0x62, 0x7d, -0x3b, 0x93, 0xa1, 0x5b, 0xd7, 0x75, 0xc2, 0x4b, -0xa4, 0x99, 0x2c, 0x25, 0x54, 0x24, 0xf3, 0xac, -0x1c, 0xe6, 0x8f, 0x72, 0x43, 0xa0, 0xdf, 0xda, -0x82, 0x1c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x57, 0x16, -0x52, 0x37, 0xdb, 0x2f, 0x9a, 0x4d, 0xa9, 0x89, -0x36, 0x77, 0x58, 0x06, 0x0e, 0x5a, 0x29, 0xca, -0x7f, 0xfc, 0x62, 0x0c, 0x72, 0x7a, 0x19, 0x07, -0x02, 0x56, 0x49, 0x10, 0xe6, 0xf3, 0xdd, 0x71, -0xf9, 0x5e, 0xa7, 0xb5, 0x41, 0x87, 0x27, 0x5d, -0x35, 0x8c, 0x5e, 0xf0, 0x05, 0x9e, 0xdb, 0x9f, -0x02, 0xbe }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_018[] = { - {TITLE, "IPSEC-018", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_018_size = sizeof(tahi_ipsec_018) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_019.c b/test/regression/tahi_test/tahi_ipsec_019.c deleted file mode 100644 index 6ba8c040..00000000 --- a/test/regression/tahi_test/tahi_ipsec_019.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, -0x13, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f, 0x00, 0x3a, 0xba, 0x19, -0x8b, 0x06, 0x67, 0x5d, 0x31, 0x3e, 0x5f, 0xd5, -0x7c, 0x50 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, -0x12, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f, 0x01, 0x02, 0x03, 0x04, -0x04, 0x3a, 0x47, 0x50, 0x6a, 0xdd, 0xbe, 0xe3, -0x26, 0xb5, 0xec, 0x8b, 0x07, 0xbe }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_019[] = { - {TITLE, "IPSEC-019", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_019_size = sizeof(tahi_ipsec_019) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_022.c b/test/regression/tahi_test/tahi_ipsec_022.c deleted file mode 100644 index ca079352..00000000 --- a/test/regression/tahi_test/tahi_ipsec_022.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xe5, -0x23, 0x8e, 0x82, 0xc1, 0xde, 0xab, 0x58, 0xa3, -0x1a, 0x7e, 0x20, 0x57, 0xd6, 0xa2, 0xc4, 0x41, -0x27, 0x06, 0x99, 0xba, 0xb7, 0xd9, 0x52, 0x6a, -0x21, 0x05, 0xc6, 0x72, 0x32, 0xc6, 0xe4, 0x8d, -0x73, 0xab, 0x10, 0x71, 0xeb, 0x36, 0x29, 0xe8, -0x57, 0xd8, 0x82, 0x0f, 0x74, 0xbf, 0x02, 0xd7, -0x9b, 0x39, 0x97, 0xec, 0xe1, 0xe5, 0x82, 0x1d, -0x67, 0x94, 0x12, 0xba, 0xbc, 0x47, 0x7a, 0x58, -0xf6, 0x9b, 0x99, 0x3d, 0x9f, 0x4e, 0x0f, 0x13, -0x9b, 0xc2 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5e, 0x62, -0xc3, 0x76, 0x20, 0x50, 0x07, 0x55, 0x6f, 0xef, -0xce, 0x13, 0x9c, 0x0f, 0xa4, 0xaf, 0x12, 0x60, -0x1e, 0x93, 0x73, 0x95, 0x34, 0xe4, 0x18, 0xcd, -0x2a, 0x05, 0x76, 0xab, 0x46, 0x1d, 0x9d, 0x3b, -0x2a, 0xd1, 0x96, 0xff, 0x00, 0xb4, 0x88, 0x78, -0x9e, 0x55, 0x7a, 0xdf, 0x4b, 0x26, 0xfb, 0x46, -0x7e, 0xe1, 0xf1, 0x2d, 0x95, 0x0c, 0xaf, 0xa2, -0x96, 0xb7, 0x9f, 0xca, 0xf7, 0x37, 0x94, 0x77, -0xf8, 0x8a, 0x59, 0x83, 0xde, 0xcf, 0x4d, 0x34, -0xc7, 0x7d, 0xc2, 0x59, 0xe2, 0x5c, 0x90, 0xad, -0x1f, 0x59, 0x52, 0xd9, 0xac, 0xc6, 0xf8, 0xe3, -0xa7, 0xb0 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_022[] = { - {TITLE, "IPSEC-022", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_022_size = sizeof(tahi_ipsec_022) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_023.c b/test/regression/tahi_test/tahi_ipsec_023.c deleted file mode 100644 index 63ed95d3..00000000 --- a/test/regression/tahi_test/tahi_ipsec_023.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xe5, -0x23, 0x8e, 0x82, 0xc1, 0xde, 0xab, 0x29, 0x84, -0x15, 0x51, 0xff, 0xe3, 0xd5, 0xe4, 0xc3, 0xd4, -0xc7, 0x3d, 0x34, 0x47, 0x77, 0x02, 0x35, 0xaf, -0x15, 0xdb, 0xd4, 0xba, 0xae, 0x95, 0x65, 0x1a, -0xa2, 0x78, 0x15, 0x52, 0x8d, 0xc4, 0x29, 0xfc, -0x74, 0xf9, 0x97, 0x10, 0x80, 0xb6, 0xea, 0x3c, -0xb0, 0x9d, 0xfc, 0x6a, 0x6d, 0x33, 0x80, 0x9a, -0xac, 0x49, 0xcd, 0xa9, 0xc9, 0x95, 0x6c, 0x79, -0x6f, 0xb7, 0xf2, 0x5f, 0x49, 0x94, 0x55, 0xfc, -0x9e, 0x65 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfb, 0x54, -0x9b, 0x32, 0x38, 0xc0, 0x1f, 0x38, 0xf1, 0x4d, -0xab, 0x84, 0xdd, 0x1d, 0x11, 0x14, 0xa6, 0xf9, -0x1d, 0x9d, 0x3d, 0xa2, 0x07, 0x15, 0x06, 0x42, -0xd6, 0x8e, 0x35, 0x02, 0x0e, 0x66, 0x0e, 0x2c, -0xfe, 0x33, 0x13, 0xc0, 0xc3, 0xc4, 0x4f, 0xab, -0x5c, 0xf0, 0x69, 0x47, 0x50, 0x3f, 0x79, 0x5a, -0x57, 0xe9, 0x08, 0x7e, 0x65, 0xb5, 0x5e, 0x9a, -0x3b, 0x22, 0x89, 0x7e, 0xbe, 0xbd, 0xb4, 0xf1, -0x14, 0x50, 0xaa, 0x2c, 0x49, 0xf0, 0x86, 0x73, -0x75, 0x4b, 0x8a, 0xc4, 0x7e, 0xb4, 0xc1, 0xb9, -0xb2, 0xbf, 0x05, 0x0b, 0xae, 0x73, 0xd7, 0x8f, -0x9a, 0x23 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_023[] = { - {TITLE, "IPSEC-023", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_023_size = sizeof(tahi_ipsec_023) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_024.c b/test/regression/tahi_test/tahi_ipsec_024.c deleted file mode 100644 index 7bd205b6..00000000 --- a/test/regression/tahi_test/tahi_ipsec_024.c +++ /dev/null @@ -1,139 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xe5, -0x23, 0x8e, 0x82, 0xc1, 0xde, 0xab, 0x29, 0x84, -0x15, 0x51, 0xff, 0xe3, 0xd5, 0xe4, 0xc3, 0xd4, -0xc7, 0x3d, 0x34, 0x47, 0x77, 0x02, 0x35, 0xaf, -0x15, 0xdb, 0xd4, 0xba, 0xae, 0x95, 0x65, 0x1a, -0xa2, 0x78, 0x15, 0x52, 0x8d, 0xc4, 0x29, 0xfc, -0x74, 0xf9, 0x97, 0x10, 0x80, 0xb6, 0xea, 0x3c, -0xb0, 0x9d, 0xfc, 0x6a, 0x6d, 0x33, 0x80, 0x9a, -0xac, 0x49, 0xcd, 0xa9, 0xc9, 0x95, 0x6c, 0x79, -0x6f, 0xb7, 0xf2, 0x5f, 0x49, 0x94, 0x55, 0xfc, -0x9e, 0x65 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa8, 0xd5, -0x78, 0x53, 0x4e, 0x00, 0xe5, 0x76, 0x92, 0xc5, -0x35, 0x63, 0xea, 0xee, 0x2d, 0xf0, 0xd3, 0x55, -0xf4, 0x44, 0x42, 0x26, 0xa5, 0x87, 0x52, 0x84, -0x58, 0xb5, 0x5c, 0x97, 0x1b, 0xcc, 0x6d, 0xd4, -0xaa, 0x66, 0x80, 0x5f, 0x03, 0x3f, 0xf1, 0x3a, -0xa4, 0x30, 0x5e, 0xdb, 0xad, 0xba, 0xce, 0x26, -0x68, 0xdc, 0x41, 0x40, 0xd0, 0x64, 0xe1, 0x36, -0xf7, 0x45, 0x7a, 0x35, 0xeb, 0x93, 0xee, 0xbc, -0x3f, 0xb4, 0x24, 0xa7, 0x63, 0x86, 0x94, 0x74, -0xa0, 0x86, 0x1a, 0x42, 0xcd, 0xe0, 0x81, 0x8d, -0xbb, 0x9a, 0x33, 0x5a, 0x30, 0x18, 0x8e, 0x5c, -0x28, 0x0f }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x73, -0x3a, 0xda, 0x5b, 0x57, 0x9a, 0x02, 0x84, 0x0f, -0x1a, 0x6c, 0xb3, 0x20, 0xd1, 0x23, 0x17, 0x72, -0x8b, 0x53, 0xcc, 0x50, 0xbb, 0x9e, 0x25, 0x7c, -0xa5, 0x0c, 0x8a, 0x05, 0xf0, 0x30, 0xbb, 0x08, -0xc0, 0xac, 0xf5, 0x51, 0x92, 0x04, 0x9e, 0x40, -0x3a, 0x63, 0x09, 0xe2, 0x7b, 0x92, 0xdb, 0x03, -0x42, 0xc6, 0xb0, 0x70, 0xdb, 0xb0, 0x2c, 0x82, -0x57, 0xac, 0x1c, 0x31, 0xbf, 0x33, 0x39, 0xb3, -0xbc, 0x3e, 0xcc, 0xa2, 0x42, 0x1e, 0x3b, 0xc1, -0x5f, 0x96 }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa6, 0x87, -0x7d, 0x79, 0x14, 0xc7, 0x56, 0x27, 0x61, 0xa0, -0xe7, 0x36, 0xec, 0x4f, 0x3a, 0xf3, 0xe0, 0x90, -0xa5, 0x8c, 0xaf, 0x7b, 0x2d, 0xd6, 0xbf, 0x27, -0xb9, 0x25, 0xe1, 0x6f, 0x63, 0x4b, 0x4a, 0xab, -0x43, 0xe1, 0x6d, 0x2f, 0xbd, 0xeb, 0xab, 0x04, -0x7f, 0x87, 0x45, 0x52, 0x39, 0xd2, 0x7f, 0x11, -0xb9, 0xc0, 0x83, 0x41, 0x80, 0xba, 0x42, 0x9a, -0x06, 0xa3, 0x0d, 0xed, 0x05, 0xee, 0x39, 0x01, -0x19, 0x30, 0xd5, 0x4d, 0xeb, 0x7c, 0x57, 0x33, -0x46, 0x1c, 0xc2, 0xa4, 0x0f, 0xf4, 0xe6, 0x72, -0xd9, 0xeb, 0x5a, 0xec, 0xeb, 0xe2, 0xe8, 0xa0, -0x9d, 0x30 }; - -TAHI_TEST_SEQ tahi_ipsec_024[] = { - {TITLE, "IPSEC-024", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_024_size = sizeof(tahi_ipsec_024) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_025.c b/test/regression/tahi_test/tahi_ipsec_025.c deleted file mode 100644 index 0dc54c21..00000000 --- a/test/regression/tahi_test/tahi_ipsec_025.c +++ /dev/null @@ -1,169 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbd, -0x5e, 0xcf, 0x95, 0x7f, 0xd6, 0x43, 0x59, 0x78, -0x73, 0x51, 0x34, 0x6a, 0x3a, 0x26, 0xb4, 0xe3, -0x2c, 0xf6, 0xfb, 0xf4, 0xc7, 0x3d, 0x68, 0xf7, -0xbe, 0xba, 0x09, 0x08, 0xed, 0x68, 0xe6, 0xfb, -0x95, 0xac, 0x68, 0xaa, 0x30, 0x13, 0xc2, 0x6c, -0x3e, 0xb3, 0x0f, 0x7a, 0xa8, 0x69, 0x96, 0xe0, -0x39, 0x32, 0xdd, 0x84, 0x3d, 0xfa, 0x9b, 0x19, -0x42, 0xf6, 0x5f, 0x10, 0xe3, 0x61, 0x91, 0xa0, -0x45, 0x8a, 0xb4, 0x5a, 0xd1, 0x15, 0x7c, 0x24, -0xea, 0xc2 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x93, 0x8d, -0x59, 0x4c, 0x25, 0xd7, 0x3b, 0x64, 0x2b, 0x9e, -0xcd, 0xe0, 0x2f, 0x8c, 0xf4, 0xcc, 0xed, 0x5f, -0x46, 0x21, 0x1b, 0xe7, 0xb4, 0xb6, 0x82, 0x98, -0x77, 0xce, 0x61, 0x52, 0xb0, 0x72, 0x56, 0x49, -0x8f, 0xd0, 0x87, 0xac, 0xff, 0xc9, 0xe3, 0xeb, -0xc2, 0xc9, 0x95, 0xdd, 0x63, 0xbd, 0x1e, 0x9f, -0x2a, 0xef, 0xb3, 0xfb, 0x51, 0x20, 0xb5, 0xc8, -0x71, 0x0d, 0x89, 0xba, 0x77, 0x6c, 0x15, 0xe3, -0x33, 0x7c, 0x18, 0x6a, 0xb6, 0x2e, 0x90, 0x35, -0xf0, 0xf2, 0xaf, 0x7e, 0xbd, 0xde, 0xe7, 0x40, -0xfa, 0xed }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x01, 0x54, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbd, -0x5e, 0xcf, 0x95, 0x7f, 0xd6, 0x43, 0x59, 0x78, -0x73, 0x51, 0x34, 0x6a, 0x3a, 0x26, 0xb4, 0xe3, -0x2c, 0xf6, 0xfb, 0xf4, 0xc7, 0x3d, 0x68, 0xf7, -0xbe, 0xba, 0x09, 0x08, 0xed, 0x68, 0xe6, 0xfb, -0x95, 0xac, 0x68, 0xaa, 0x30, 0x13, 0xc2, 0x6c, -0x3e, 0xb3, 0x0f, 0x7a, 0xa8, 0x69, 0x96, 0xe0, -0x39, 0x32, 0xdd, 0x84, 0x3d, 0xfa, 0xa7, 0x91, -0xb1, 0x91, 0xc9, 0xeb, 0xae, 0x69, 0x5c, 0xa3, -0x6d, 0xb9, 0xd8, 0x62, 0x07, 0xeb, 0xdd, 0x69, -0xd0, 0xec, 0xf6, 0x8a, 0x34, 0xbf, 0xb8, 0x2c, -0x7b, 0x09, 0x03, 0x78, 0xbd, 0x1f, 0x4d, 0xff, -0xbb, 0x9f, 0xab, 0x6f, 0xca, 0xb1, 0x00, 0x9f, -0x53, 0xef, 0x50, 0x44, 0xeb, 0xa1, 0x97, 0xd4, -0xa4, 0x3c, 0xd7, 0x6a, 0xf4, 0x7a, 0x9e, 0xfc, -0x06, 0x12, 0xca, 0xd9, 0x6b, 0x0f, 0xd7, 0x54, -0xdf, 0x43, 0xd1, 0x48, 0xfd, 0x91, 0x09, 0x42, -0x00, 0xf8, 0x87, 0x8f, 0xce, 0x7f, 0xeb, 0xc0, -0x54, 0xce, 0x13, 0xeb, 0x3c, 0x33, 0x2c, 0x1a, -0x40, 0xca, 0x29, 0xaa, 0x0e, 0xbc, 0x13, 0x4e, -0xdd, 0x46, 0x8f, 0x9e, 0x92, 0xaa, 0xa0, 0x16, -0x6b, 0x0e, 0x81, 0xed, 0x82, 0x50, 0x86, 0x70, -0x7b, 0xcf, 0x25, 0x02, 0x67, 0xf2, 0x7a, 0x8a, -0x2a, 0xc0, 0xfb, 0xc3, 0xcf, 0xb5, 0x53, 0xc8, -0x96, 0x78, 0x08, 0x05, 0x70, 0x8f, 0xf0, 0x2c, -0x84, 0x7b, 0x0e, 0x40, 0xc2, 0x2c, 0x34, 0x4e, -0x90, 0x2c, 0x08, 0xf7, 0x69, 0xab, 0xf5, 0xbf, -0x97, 0x82, 0x9a, 0x67, 0x13, 0x8c, 0x89, 0x63, -0xfc, 0x9e, 0xdf, 0xa4, 0x43, 0x71, 0xbd, 0xf9, -0x35, 0xac, 0xfa, 0xff, 0x68, 0x85, 0x48, 0xf2, -0x0c, 0x7a, 0xa6, 0x1d, 0xc6, 0x48, 0xeb, 0xf6, -0xdb, 0x34, 0x1e, 0x69, 0x31, 0x17, 0x28, 0xb2, -0xf8, 0xb6, 0x9f, 0xda, 0x3a, 0x1a, 0x3b, 0x68, -0xfb, 0xb0, 0xd9, 0xbe, 0xf6, 0x5f, 0x72, 0x2e, -0xd4, 0x1c, 0x59, 0x0a, 0x8a, 0x22, 0x92, 0x03, -0x6c, 0x9c, 0x1f, 0x23, 0x67, 0xd4, 0xdb, 0xbd, -0xd1, 0x09, 0xc7, 0x2a, 0x1b, 0x83, 0x69, 0xaf, -0x15, 0xbc, 0x80, 0xbd, 0xbf, 0x90, 0x3b, 0x97, -0xb6, 0xf2, 0x3b, 0x33, 0x94, 0x11, 0x3c, 0x29, -0x84, 0x37, 0x76, 0xf6, 0x19, 0x62, 0x3d, 0x94, -0xd8, 0x07, 0x33, 0xb0, 0x67, 0x29, 0x68, 0x7b, -0x84, 0xcd }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x56, 0x94, -0x44, 0x2b, 0x24, 0x86, 0x12, 0x67, 0x2b, 0x79, -0xb2, 0xc9, 0x36, 0xf4, 0x49, 0xf6, 0x5a, 0x25, -0xfe, 0x64, 0x5c, 0xeb, 0x1f, 0x32, 0xd3, 0x04, -0x74, 0xef, 0x88, 0x48, 0xc0, 0x5b, 0xc9, 0x20, -0x23, 0x5d, 0xd1, 0x5a, 0x78, 0x9c, 0xdc, 0x04, -0x8e, 0xeb, 0x82, 0x1a, 0x2e, 0x3d, 0x3a, 0xce, -0xde, 0x79, 0x8d, 0x87, 0x04, 0x28, 0xb9, 0xb8, -0x58, 0xe2, 0x1d, 0x29, 0x58, 0xf4, 0x7a, 0x29, -0x98, 0xbe, 0xda, 0xec, 0x8c, 0x11, 0xe5, 0x73, -0xb6, 0x37, 0x66, 0xbd, 0xfe, 0x51, 0x07, 0xf6, -0x6f, 0x0f }; - - -TAHI_TEST_SEQ tahi_ipsec_025[] = { - {TITLE, "IPSEC-025", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_025_size = sizeof(tahi_ipsec_025) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_026.c b/test/regression/tahi_test/tahi_ipsec_026.c deleted file mode 100644 index 4d4d834a..00000000 --- a/test/regression/tahi_test/tahi_ipsec_026.c +++ /dev/null @@ -1,93 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x23, -0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf7, 0xfa, -0x79, 0x03, 0x31, 0x95, 0xbb, 0x35, 0x83, 0xc1, -0x8e, 0x7a, 0x24, 0xd4, 0xe9, 0x11, 0x49, 0x4b, -0xa2, 0x52, 0x59, 0xb1, 0x69, 0x8f, 0xe2, 0x59, -0x38, 0x5f, 0x62, 0xcd, 0xbb, 0x17, 0xf0, 0x00, -0xb3, 0xd2, 0x12, 0xf8, 0xb1, 0x25, 0x7a, 0xc0, -0x2e, 0x83, 0x0b, 0x7f, 0x53, 0x73, 0x4c, 0xd2, -0xbb, 0x5c, 0x64, 0x2b, 0xc2, 0x52, 0xd5, 0x6a, -0x59, 0x76, 0xc6, 0x64, 0x33, 0xa3, 0xff, 0xf4, -0x48, 0x2b, 0xe3, 0x73, 0x13, 0x69, 0x9d, 0x53, -0x04, 0xaa, 0xbb, 0x4c, 0x84, 0x09, 0x23, 0x2d, -0xf6, 0xd9 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0xe6, -0x99, 0x78, 0xdf, 0x32, 0x82, 0x08, 0x16, 0xc2, -0xb6, 0xcc, 0xb9, 0x71, 0x07, 0x40, 0x8d, 0xd1, -0x3d, 0xe1, 0xbc, 0x7d, 0x44, 0x10, 0x67, 0xa4, -0xc3, 0x78, 0x6a, 0x9c, 0xa7, 0xef, 0xba, 0x4c, -0xec, 0x7b, 0x09, 0x05, 0xc3, 0x58, 0x25, 0x3e, -0x35, 0xf8, 0xa9, 0xd7, 0xf7, 0xb7, 0x4e, 0x7e, -0x38, 0xda, 0x37, 0x2b, 0xe1, 0xc5, 0xac, 0xa1, -0x0b, 0x09, 0x35, 0x10, 0x17, 0x61, 0xbd, 0x26, -0xb5, 0xe5, 0x47, 0xdb, 0x1a, 0xd6, 0xb8, 0x75, -0x06, 0x16, 0x11, 0x3b, 0x28, 0x4d, 0xad, 0x04, -0xce, 0x9f, 0xe0, 0xe0, 0xb6, 0x6b, 0x60, 0x6a, -0x5d, 0x30 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_026[] = { - {TITLE, "IPSEC-026", 9, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_026_size = sizeof(tahi_ipsec_026) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_001.c b/test/regression/tahi_test/tahi_ipsec_udp_001.c deleted file mode 100644 index 12386d79..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_001.c +++ /dev/null @@ -1,165 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -#if 0 -static char pkt1[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt2[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt3[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, -0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt5[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, -0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, -0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, -0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, -0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -#if 0 -static char pkt6[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt7[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; -#endif - -static char pkt8[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x80, 0x00, -0x27, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, -0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; - -static char pkt9[] = { -0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x21, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt10[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0x5e, 0xde, 0xe0, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt11[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x81, 0x00, -0x26, 0x78, 0x00, 0x00, 0x00, 0x00, 0x45, 0x63, -0x68, 0x6f, 0x44, 0x61, 0x74, 0x61 }; - -TAHI_TEST_SEQ tahi_ipsec_udp_001[] = { - {TITLE, "IPSEC-UDP-001", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {CHECK, &pkt4[0], sizeof(pkt4), 5, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 6, 0, 0, 0, 0}, - - {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, - {CHECK, &pkt9[0], sizeof(pkt9), 5, 0, 0, 0, 0}, - {INJECT, &pkt10[0], sizeof(pkt10), 0, 0, 0, 0, 0}, - {CHECK, &pkt11[0], sizeof(pkt11), 5, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_001_size = sizeof(tahi_ipsec_udp_001) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_002.c b/test/regression/tahi_test/tahi_ipsec_udp_002.c deleted file mode 100644 index 2daade0d..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_002.c +++ /dev/null @@ -1,147 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt3[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt4[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, -0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xae, 0xa2, -0x6e, 0x32, 0xe2, 0x9d, 0x35, 0x7a, 0xcd, 0xbb, -0x07, 0xba, 0xa0, 0xb0, 0x5d, 0xfd, 0x09, 0xce, -0xce, 0x57, 0xac, 0x4f, 0xfa, 0x22, 0xb1, 0x3f, -0x54, 0x43, 0x45, 0xd3, 0xa9, 0x96, 0x9a, 0xde, -0x15, 0x06, 0x9a, 0x2e, 0xc4, 0x4c, 0xc8, 0x69, -0x14, 0x3c }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x87, -0x9d, 0xb2, 0xd7, 0xac, 0x55, 0xff, 0x91, 0xbd, -0x22, 0xd9, 0x9d, 0x4c, 0x4f, 0xfb, 0xb4, 0x28, -0x0f, 0x1a, 0xce, 0x20, 0xda, 0x5f, 0xe0, 0xc2, -0x4e, 0x23, 0x27, 0xbf, 0x73, 0xa7, 0xc1, 0x3d, -0x9e, 0xce }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x46, 0xf6, -0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xb2, 0x94, -0x68, 0xee, 0xd0, 0x31, 0x8d, 0x9d, 0x94, 0x0c, -0x79, 0x96, 0x09, 0x38, 0xef, 0xce, 0xe7, 0xa9, -0x81, 0xfe, 0xda, 0x9a, 0x3e, 0x94, 0xbb, 0x4b, -0x01, 0xd6, 0x56, 0x9d, 0xb7, 0x65, 0x8e, 0x8b, -0x98, 0x75, 0x38, 0x43, 0xe2, 0x52, 0x6e, 0x86, -0x6a, 0x56 }; - -#if 0 -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt8[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_002[] = { - {TITLE, "IPSEC-UDP-002", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, - {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_002_size = sizeof(tahi_ipsec_udp_002) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_004.c b/test/regression/tahi_test/tahi_ipsec_udp_004.c deleted file mode 100644 index 9f0a9bd0..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_004.c +++ /dev/null @@ -1,119 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x5b, -0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0xc8, 0xc5, -0x80, 0x58, 0xa2, 0x96, 0xa5, 0xe3, 0x66, 0x3d, -0xca, 0xcf, 0xea, 0xac, 0x15, 0x46, 0x7e, 0x29, -0x12, 0x6f, 0x2b, 0x99, 0xa3, 0x5e, 0x79, 0x1e, -0xa1, 0xd9, 0x34, 0x3b, 0x7d, 0x5b, 0x84, 0xc7, -0xd0, 0x3d, 0x2d, 0xd0, 0xdb, 0x20, 0xe5, 0x81, -0x33, 0x13 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x52, 0x80, -0xaa, 0x15, 0x46, 0x2d, 0xd5, 0x7b, 0x9f, 0xc6, -0x3f, 0x5a }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x78, 0x7f, -0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0x61, 0x10, -0x51, 0x54, 0x2f, 0xdb, 0xdb, 0x75, 0xed, 0xb4, -0xde, 0xda, 0xe4, 0xce, 0x9f, 0xf0, 0x33, 0x12, -0xbd, 0x90, 0xea, 0xff, 0xfd, 0xf4, 0x43, 0x98, -0x96, 0x50, 0x4e, 0x9c, 0xec, 0x2b, 0x31, 0xf2, -0xeb, 0x63, 0x52, 0x89, 0x9d, 0xbc, 0x37, 0x67, -0xf1, 0xad }; - -TAHI_TEST_SEQ tahi_ipsec_udp_004[] = { - {TITLE, "IPSEC-UDP-004", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_004_size = sizeof(tahi_ipsec_udp_004) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_005.c b/test/regression/tahi_test/tahi_ipsec_udp_005.c deleted file mode 100644 index 8ef81a63..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_005.c +++ /dev/null @@ -1,1279 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xaa, -0x3b, 0x05, 0xde, 0xd4, 0xab, 0x24, 0xae, 0xfb, -0x59, 0x37, 0x13, 0x31, 0x53, 0x9f, 0x56, 0x88, -0x9f, 0x3c, 0xc8, 0x03, 0x68, 0x87, 0x04, 0xa3, -0xe6, 0x78, 0xdf, 0x38, 0x2f, 0xe5, 0x7d, 0x40, -0x61, 0xeb, 0xb1, 0x19, 0xeb, 0xfe, 0x61, 0x83, -0xf6, 0xaa, 0xb7, 0x17, 0x84, 0xdc, 0xab, 0x99, -0xd6, 0xdc, 0x26, 0x12, 0x02, 0x3f, 0x44, 0x7b, -0xaf, 0x60, 0xcc, 0x7b, 0x7c, 0xf1, 0x8d, 0x1e, -0x69, 0x1b, 0x71, 0x28, 0x9a, 0x1f, 0xe2, 0x07, -0xac, 0x8c, 0x77, 0x59, 0x9e, 0x1b, 0x1a, 0xa5, -0x36, 0xd5, 0x2f, 0xb8, 0xe4, 0xc2, 0xfb, 0x79, -0x02, 0x75, 0xe5, 0xe0, 0x1c, 0x43, 0xcb, 0xb0, -0x7a, 0xba, 0x2d, 0xad, 0xdb, 0x13, 0xbc, 0x70, -0x10, 0x46, 0x74, 0xc0, 0x31, 0xdf, 0x54, 0x19, -0x1f, 0xf8, 0x20, 0x71, 0x5b, 0xbe, 0xe2, 0xd4, -0xde, 0x1e, 0x6c, 0xee, 0x09, 0x0c, 0xb6, 0x81, -0x67, 0x75, 0x5c, 0x52, 0x55, 0x88, 0x57, 0xb4, -0x4a, 0x6d, 0xdd, 0xbb, 0x63, 0x87, 0xb1, 0xc7, -0xff, 0xdb, 0xe9, 0xf0, 0x69, 0x45, 0x81, 0x44, -0x1e, 0x05, 0xda, 0x86, 0x21, 0xf3, 0x74, 0xa2, -0xa8, 0x10, 0x99, 0x3c, 0x5b, 0x19, 0xf4, 0x39, -0x31, 0x9a, 0x83, 0xf6, 0x11, 0x9a, 0x65, 0x67, -0xd7, 0x9c, 0xb9, 0xe5, 0xba, 0x4a, 0x0a, 0x9f, -0x24, 0x36, 0xf4, 0x6f, 0x19, 0xc1, 0xfe, 0xab, -0xf3, 0xe2, 0x94, 0x21, 0xa3, 0xef, 0xc9, 0x03, -0xe1, 0x7b, 0x99, 0xef, 0x20, 0x1c, 0x66, 0x31, -0x7f, 0xab, 0x67, 0x38, 0xfb, 0xe3, 0x7a, 0x10, -0xd9, 0x83, 0x0c, 0x02, 0x07, 0x4e, 0xd0, 0xaa, -0x8d, 0x7d, 0x92, 0x72, 0x9f, 0x7a, 0x1c, 0xe7, -0x30, 0xc5, 0x8b, 0xb9, 0x65, 0xc5, 0x8d, 0x78, -0xaa, 0x4d, 0xb5, 0x45, 0x05, 0xdf, 0x8f, 0x90, -0xa0, 0x06, 0xbf, 0x49, 0xfa, 0xfb, 0xf2, 0xfb, -0x5b, 0x72, 0x68, 0xa6, 0xfb, 0x8d, 0x1f, 0x61, -0x34, 0xff, 0x67, 0x07, 0xd5, 0x9f, 0x1d, 0xbf, -0x8d, 0xae, 0x19, 0x6b, 0xd8, 0x7f, 0x7e, 0xe9, -0x02, 0x86, 0x36, 0x81, 0xf6, 0xc6, 0x5c, 0x23, -0xa4, 0x4a, 0x03, 0x70, 0xed, 0x09, 0x9c, 0xdb, -0xce, 0xb0, 0xf9, 0x84, 0x49, 0xc6, 0x61, 0x5d, -0x85, 0xa0, 0x7d, 0x18, 0x61, 0x37, 0x8b, 0x74, -0x54, 0xb9, 0x11, 0xe1, 0xf8, 0xaf, 0x95, 0x2c, -0xc8, 0x6a, 0x7c, 0x6b, 0xf3, 0x06, 0xec, 0xeb, -0x3c, 0xc9, 0x7a, 0x0f, 0x38, 0x65, 0x63, 0xc0, -0x02, 0x47, 0xae, 0xa9, 0x33, 0xea, 0xc9, 0xa3, -0xfd, 0x21, 0xd3, 0x28, 0x5d, 0x1a, 0xa8, 0x0d, -0xf4, 0x9c, 0x87, 0xab, 0x3b, 0xf5, 0x81, 0x29, -0xfd, 0x28, 0xef, 0xe4, 0x3b, 0x3e, 0xc2, 0xd1, -0x3b, 0xd9, 0xe5, 0x32, 0x4e, 0x0f, 0x2e, 0x64, -0xd0, 0x71, 0x4c, 0xc0, 0x44, 0x2b, 0x9e, 0x28, -0x68, 0x45, 0xa4, 0x4f, 0xe0, 0xb5, 0x9b, 0x42, -0xae, 0x6c, 0x94, 0xcd, 0xe5, 0x2b, 0x8f, 0x86, -0x52, 0x91, 0xa0, 0x2b, 0x97, 0x10, 0xf0, 0x79, -0xb3, 0x72, 0xce, 0x4b, 0x66, 0x63, 0xe1, 0xef, -0xb0, 0xae, 0xd9, 0x6d, 0xaf, 0x79, 0x38, 0xff, -0x6b, 0xfb, 0x9f, 0xa9, 0xe6, 0x68, 0x0e, 0x4b, -0x2a, 0x61, 0x09, 0xa4, 0x67, 0x98, 0xff, 0xe0, -0xff, 0xda, 0x27, 0xd2, 0x2b, 0x87, 0x51, 0x97, -0xe6, 0x61, 0x97, 0xec, 0x51, 0xf6, 0x17, 0x93, -0xcb, 0x28, 0x21, 0x6d, 0xfa, 0xb5, 0x18, 0x6b, -0x75, 0xd5, 0x8a, 0x48, 0x6a, 0x5b, 0xd5, 0x80, -0xc1, 0x22, 0xcc, 0x85, 0xa7, 0xda, 0x4b, 0xc0, -0xe2, 0xb6, 0xf0, 0xb5, 0xb4, 0xad, 0x43, 0x20, -0xae, 0x6f, 0xe8, 0x95, 0x96, 0x99, 0x56, 0x75, -0xfa, 0x8c, 0x91, 0x91, 0xb6, 0x26, 0x58, 0x29, -0x62, 0xf6, 0xa3, 0xec, 0x53, 0xdb, 0x7b, 0xf2, -0x3e, 0x79, 0xd3, 0x08, 0xce, 0x78, 0x2e, 0x58, -0xe7, 0xa9, 0xac, 0xbe, 0xf0, 0x85, 0x52, 0xf2, -0x8e, 0x46, 0x47, 0x28, 0xf3, 0x49, 0xac, 0x9c, -0xb2, 0xf3, 0x42, 0x3c, 0x13, 0x10, 0x82, 0xf6, -0xd6, 0x14, 0x09, 0x99, 0xd4, 0x6d, 0xe9, 0x3a, -0x2d, 0x6a, 0x31, 0x4b, 0x2a, 0xb9, 0x48, 0x26, -0xce, 0x3c, 0xe0, 0x1a, 0xca, 0x39, 0x17, 0xcf, -0xd8, 0xe6, 0x39, 0x95, 0x5b, 0x77, 0x28, 0x00, -0xff, 0x2a, 0x83, 0xd8, 0x3d, 0xd8, 0xeb, 0xfa, -0xe6, 0x37, 0x7c, 0xc4, 0x6d, 0xba, 0xbf, 0x85, -0x17, 0x3d, 0x68, 0x9e, 0xfd, 0x4b, 0x91, 0xd2, -0x13, 0x5a, 0xc8, 0x73, 0xbe, 0xc2, 0xa3, 0x7f, -0x58, 0x36, 0x8c, 0x29, 0x3f, 0xfd, 0x59, 0x9a, -0xbd, 0x5f, 0xf0, 0x16, 0xd5, 0xc1, 0x10, 0xcc, -0x54, 0x31, 0xe4, 0x3e, 0x84, 0xda, 0xda, 0x3e, -0x6c, 0x23, 0xf6, 0x5c, 0x46, 0x68, 0xed, 0xbb, -0x23, 0xb5, 0xd3, 0x57, 0xf3, 0xdb, 0x9a, 0x5a, -0x61, 0xba, 0x9f, 0xa7, 0x69, 0x31, 0x23, 0x47, -0x87, 0x13, 0x9a, 0x4f, 0x46, 0x35, 0xc2, 0x60, -0xd5, 0xf1, 0x77, 0x55, 0xd7, 0x83, 0xb0, 0xc3, -0x2f, 0x66, 0xaa, 0x14, 0xb3, 0x34, 0xd7, 0xa3, -0x6c, 0x66, 0x6f, 0x50, 0x91, 0xb9, 0x30, 0x3f, -0x62, 0xa4, 0x7b, 0xf5, 0x40, 0x46, 0x5c, 0x75, -0xfe, 0x6e, 0x3b, 0xe2, 0x62, 0x0f, 0xdb, 0x90, -0x06, 0x46, 0x4e, 0x31, 0x64, 0xc9, 0xd8, 0x4e, -0x02, 0xa5, 0x14, 0xd4, 0xa9, 0xa6, 0xea, 0x56, -0x01, 0xa6, 0x80, 0x7c, 0xa7, 0xff, 0xc6, 0xb1, -0x5f, 0x96, 0x49, 0xb5, 0x05, 0x96, 0x49, 0x54, -0x28, 0xa4, 0xd2, 0xb7, 0xee, 0xe9, 0x9b, 0x02, -0xfc, 0x26, 0xdc, 0x78, 0xa5, 0x11, 0x6b, 0x9f, -0x8e, 0x7c, 0xb3, 0x2a, 0xee, 0x91, 0x35, 0x16, -0x2f, 0x8d, 0xf9, 0x79, 0x4c, 0x16, 0xec, 0xa6, -0xa8, 0x73, 0xb8, 0x09, 0x3b, 0x89, 0x5e, 0xa5, -0xc4, 0xc5, 0xda, 0xdf, 0x5e, 0x25, 0xe2, 0xf4, -0xe7, 0x86, 0x73, 0x4a, 0xf8, 0x7b, 0x37, 0x6f, -0x09, 0x95, 0xfc, 0xb7, 0x3c, 0xcc, 0x5e, 0x72, -0x9e, 0x8d, 0x9d, 0x19, 0xd4, 0x2e, 0x5c, 0xb0, -0xa6, 0x8b, 0xc0, 0x15, 0x3f, 0x75, 0xf3, 0x05, -0xda, 0x13, 0x12, 0x22, 0xbe, 0xb7, 0x6c, 0x40, -0x94, 0x30, 0xa9, 0xb6, 0x0f, 0x71, 0xd2, 0x6f, -0x89, 0x35, 0xd7, 0xac, 0xee, 0xe9, 0x18, 0x93, -0x0d, 0x60, 0x1e, 0xa2, 0x49, 0xe1, 0x9b, 0x41, -0x18, 0x59, 0x7c, 0x38, 0x7f, 0x05, 0x84, 0x0b, -0x66, 0xab, 0x54, 0xba, 0xfc, 0x40, 0x5e, 0xa3, -0x1b, 0xc0, 0xb9, 0x3c, 0x51, 0x40, 0xcb, 0xd3, -0xe5, 0x96, 0x3b, 0x2b, 0x06, 0xc9, 0x4f, 0x17, -0xd7, 0x4f, 0xd7, 0x47, 0xe0, 0x85, 0x97, 0xde, -0x86, 0xa4, 0x2e, 0x64, 0x11, 0x00, 0x34, 0x44, -0x6a, 0x10, 0x96, 0xf1, 0x6d, 0x3a, 0xb1, 0x0d, -0xe4, 0xf2, 0x52, 0x00, 0xd3, 0x80, 0x76, 0x4d, -0x33, 0xa8, 0x41, 0xd1, 0x2b, 0x06, 0x37, 0x3f, -0xc1, 0x8e, 0x0c, 0x47, 0xd9, 0x85, 0x8c, 0x0e, -0x21, 0x57, 0xe9, 0xbd, 0x86, 0x3c, 0xf8, 0x23, -0xc3, 0xc3, 0xfd, 0x7d, 0x60, 0xea, 0x07, 0xab, -0x3c, 0x91, 0x2e, 0xb6, 0xf0, 0xec, 0xf6, 0xb0, -0x89, 0xaf, 0x55, 0xf3, 0x07, 0xe9, 0x60, 0x10, -0x40, 0x43, 0x91, 0x0d, 0x20, 0xc6, 0x37, 0x67, -0xbe, 0xdb, 0xab, 0xe7, 0xc5, 0x50, 0x60, 0x5d, -0xec, 0x7f, 0x5b, 0xd0, 0x02, 0x2f, 0xa1, 0xb3, -0x33, 0x70, 0xdb, 0x26, 0x15, 0x94, 0xda, 0x7d, -0xd7, 0x76, 0x11, 0x0e, 0xdd, 0x46, 0x98, 0x9f, -0x9d, 0xdc, 0xa0, 0x85, 0x2c, 0xd7, 0x4f, 0x85, -0xc4, 0x89, 0x77, 0x96, 0xd0, 0x02, 0x3f, 0x34, -0x44, 0x2b, 0x01, 0x04, 0x57, 0x1a, 0xc0, 0x5f, -0x3e, 0xb8, 0xea, 0x78, 0x05, 0x74, 0x9d, 0xf6, -0x16, 0x1d, 0xac, 0x46, 0x10, 0x14, 0xb9, 0x6f, -0x97, 0xa0, 0xdd, 0x2b, 0xd4, 0x5b, 0x25, 0x68, -0xba, 0x2b, 0x75, 0x14, 0xbf, 0x5f, 0xca, 0xa4, -0xcb, 0x23, 0xba, 0xa4, 0x5c, 0x2b, 0xeb, 0xc2, -0xfa, 0xfa, 0xed, 0x1f, 0xd2, 0x7d, 0x49, 0x5b, -0x6c, 0x5f, 0x94, 0xe2, 0xa7, 0xbc, 0xf5, 0x3c, -0x5c, 0xd8, 0xf3, 0x82, 0xc1, 0xba, 0xbc, 0xf3, -0x6e, 0x15, 0xf3, 0x2e, 0xc5, 0x44, 0x7f, 0xd3, -0x5e, 0xf4, 0xe7, 0xc5, 0xf9, 0x5a, 0xc5, 0x72, -0x37, 0xb1, 0xc8, 0x24, 0x0c, 0xe7, 0x0f, 0xe4, -0x02, 0x67, 0xff, 0x45, 0x7f, 0xcc, 0x38, 0xd5, -0x19, 0x5a, 0xe3, 0x83, 0x3d, 0xa9, 0x02, 0x2d, -0x84, 0xd3, 0xe8, 0x5f, 0x45, 0x11, 0xd4, 0x63, -0x44, 0xaf, 0xb5, 0xec, 0x6d, 0x63, 0x57, 0xec, -0x8e, 0xcf, 0xeb, 0x1a, 0x72, 0x4e, 0x82, 0x7d, -0xe2, 0x7f, 0x72, 0x9d, 0xff, 0xa0, 0x79, 0x17, -0xe4, 0xbd, 0x67, 0x20, 0xdb, 0xa7, 0xf3, 0xad, -0xba, 0xb4, 0x03, 0x4a, 0xd7, 0x57, 0xf8, 0xa2, -0x6e, 0xc6, 0x35, 0x45, 0xe6, 0x8d, 0x8d, 0x64, -0xb7, 0xdb, 0x7c, 0x91, 0x9c, 0x8a, 0xfe, 0xec, -0xf0, 0xe7, 0xf0, 0x22, 0x6b, 0x79, 0x40, 0x96, -0x2f, 0x19, 0x1a, 0xf2, 0xc8, 0x52, 0xd5, 0x00, -0xe6, 0xac, 0xad, 0x97, 0x54, 0xa6, 0xd3, 0xd5, -0x5f, 0xae, 0x97, 0x9d, 0x1e, 0x5a, 0x67, 0xb4, -0xd7, 0x69, 0x64, 0x73, 0x0c, 0x70, 0xf6, 0x25, -0xc1, 0xf5, 0xca, 0x9b, 0xe7, 0x82, 0xb9, 0xda, -0x2e, 0x76, 0xae, 0x2e, 0xcd, 0x5b, 0xce, 0x47, -0xa1, 0x40, 0xe6, 0xcf, 0xc9, 0xb6, 0x20, 0x24, -0xb8, 0x06, 0x06, 0xb2, 0xcb, 0x53, 0x16, 0x48, -0x8f, 0x6a, 0x44, 0x02, 0xc5, 0x19, 0x76, 0xdd, -0xfe, 0xa7, 0xe9, 0xbb, 0x16, 0x95, 0x1d, 0xed, -0x8a, 0xf3, 0xb3, 0xb1, 0x1f, 0x81, 0x76, 0xfc, -0x68, 0xb6, 0xef, 0x4a, 0xdc, 0x0d, 0xb9, 0xc9, -0x4e, 0x05, 0x7b, 0xc0, 0x0b, 0xa7, 0x67, 0xf6, -0xb9, 0x12, 0x60, 0x9b, 0x8d, 0x97, 0x5c, 0xe7, -0x36, 0xc3, 0x8c, 0x25, 0xcc, 0x7b, 0x9a, 0x47, -0x3c, 0x86, 0x0f, 0x4e, 0x6c, 0xff, 0x25, 0x30, -0x2f, 0xc2, 0x45, 0xc8, 0xb4, 0xe4, 0xad, 0x9a, -0x23, 0xbc, 0xfa, 0xc0, 0x07, 0x2d, 0x4e, 0xea, -0x4e, 0x3e, 0xc0, 0x5f, 0x61, 0xec, 0x2d, 0xd9, -0x95, 0x9d, 0x7a, 0xa8, 0xb3, 0xdd, 0x92, 0xce, -0x26, 0xd7, 0x41, 0x83, 0x2c, 0x5f, 0x4f, 0xa6, -0xf8, 0x21, 0xdf, 0x78, 0xb0, 0x50, 0x8e, 0xfa, -0xfd, 0xc8, 0x91, 0x07, 0xb4, 0x46, 0x2d, 0x88, -0x36, 0x9a, 0x65, 0x44, 0xab, 0x58, 0x81, 0x4f, -0x9a, 0x13, 0x17, 0x1d, 0x35, 0x8e, 0x9e, 0xf3, -0xaa, 0x55, 0xbc, 0x0c, 0xc3, 0xbe, 0xa3, 0x4b, -0x38, 0x1a, 0xd2, 0x42, 0x97, 0xe2, 0xed, 0x65, -0xea, 0xae, 0x9c, 0xe9, 0xf8, 0x5a, 0x44, 0xd3, -0xde, 0xae, 0x70, 0x2e, 0xfb, 0xa5, 0x77, 0x9b, -0xce, 0x8b, 0x15, 0x5d, 0x3d, 0xdc, 0xf7, 0xed, -0xd8, 0x67 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68, 0x48, -0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0x3c, 0x06, -0xaa, 0xcd, 0x0f, 0x2d, 0x70, 0x86, 0x90, 0xd1, -0x1c, 0xc6, 0x46, 0xb0, 0x13, 0xb4, 0x24, 0x14, -0x6b, 0x61, 0x9a, 0xae, 0xfa, 0xc1, 0x12, 0xd2, -0x9e, 0x0d, 0xea, 0xb8, 0x6c, 0x69, 0x5a, 0x3e, -0x34, 0xbe, 0x39, 0xf4, 0x02, 0xde, 0x40, 0x9b, -0x03, 0xeb, 0x87, 0x7b, 0x6b, 0xe5, 0xa5, 0x98, -0x0e, 0x68, 0xc2, 0x65, 0xf9, 0xef, 0x8a, 0x4e, -0xad, 0x48, 0x7e, 0xd6, 0xe6, 0x8d, 0x76, 0xa3, -0x87, 0x12, 0xb5, 0x3b, 0x65, 0x8e, 0x63, 0xb9, -0xa7, 0x1a, 0xeb, 0x2f, 0x3d, 0x54, 0x6a, 0x62, -0x9d, 0x95, 0x68, 0x4a, 0xfd, 0x64, 0x18, 0xd3, -0x16, 0xee, 0xcf, 0x92, 0x92, 0x02, 0x62, 0x3d, -0xb7, 0x74, 0x43, 0x09, 0x40, 0x2a, 0x0e, 0x7d, -0x62, 0xe0, 0x4b, 0xf6, 0x5b, 0x2b, 0xe5, 0x3e, -0xc0, 0x0d, 0xe4, 0x82, 0xcb, 0x53, 0xcd, 0xc9, -0x3a, 0xa8, 0xae, 0xd2, 0x67, 0x61, 0x3b, 0x65, -0xfd, 0x6b, 0xee, 0xa2, 0x1f, 0xaf, 0xa2, 0xfe, -0x35, 0xd0, 0x1c, 0xf8, 0x99, 0xeb, 0xcd, 0x72, -0x69, 0xfc, 0x64, 0x88, 0xd1, 0xe0, 0x23, 0x52, -0x9b, 0x37, 0x15, 0xa5, 0xbc, 0x13, 0xce, 0xce, -0x36, 0x2d, 0x04, 0x07, 0x04, 0x21, 0x2b, 0x6e, -0x2b, 0x2a, 0x41, 0x66, 0x82, 0x29, 0x25, 0x6c, -0x11, 0xfa, 0xe2, 0x82, 0xb4, 0xf1, 0x58, 0x40, -0x96, 0x34, 0x9b, 0x01, 0xd4, 0x94, 0x95, 0xed, -0x52, 0xce, 0x1f, 0x5c, 0xe4, 0x25, 0xe8, 0xc9, -0x14, 0x7b, 0x0c, 0x45, 0xee, 0x4a, 0xc2, 0x69, -0x42, 0x54, 0x3a, 0x9d, 0xc7, 0x75, 0x68, 0x95, -0x27, 0xf9, 0xa9, 0x7a, 0x9a, 0xfd, 0x40, 0xc8, -0xae, 0xdb, 0xf5, 0xca, 0xb6, 0x64, 0xee, 0x06, -0x93, 0x8b, 0x91, 0x7b, 0xcc, 0xac, 0xc7, 0x37, -0x37, 0xb8, 0x3f, 0x3a, 0x4d, 0xc6, 0x43, 0xf6, -0x3c, 0xb7, 0xc4, 0x15, 0x46, 0xb3, 0xe1, 0x8d, -0xce, 0xb3, 0x50, 0xd4, 0xac, 0x91, 0xfb, 0x4e, -0x9f, 0x91, 0x79, 0xa4, 0x9e, 0x28, 0xd5, 0x94, -0x1f, 0x48, 0x9a, 0x7d, 0x03, 0xbc, 0x03, 0x34, -0x4a, 0xbf, 0x83, 0x78, 0x78, 0x52, 0x18, 0xaf, -0xac, 0xc6, 0xf0, 0xdf, 0x41, 0x05, 0xce, 0x4c, -0x24, 0x50, 0xc1, 0xec, 0x70, 0x7c, 0x40, 0x03, -0x7f, 0xe2, 0x73, 0xbd, 0x1f, 0x03, 0x95, 0x93, -0x41, 0x54, 0x67, 0xd3, 0x8f, 0x39, 0xc1, 0x0b, -0xb0, 0x29, 0xcd, 0xc1, 0x7b, 0x2b, 0xdd, 0xac, -0x74, 0x8e, 0x95, 0x84, 0x34, 0x1b, 0xb0, 0x26, -0xc8, 0x14, 0x8d, 0x95, 0x41, 0xa4, 0x69, 0x04, -0xbe, 0x0d, 0xf4, 0xdf, 0xc8, 0x11, 0x54, 0x1d, -0x90, 0xb0, 0xae, 0xa1, 0x39, 0x98, 0xfd, 0x9c, -0x8d, 0x0a, 0x47, 0x1c, 0xac, 0x10, 0x21, 0x34, -0x02, 0x2e, 0x2a, 0xbc, 0x01, 0xe0, 0xdf, 0xe7, -0xce, 0x21, 0x5a, 0x39, 0x7e, 0xd0, 0x66, 0x01, -0x20, 0xc9, 0x5d, 0x14, 0xd3, 0x4b, 0xcd, 0x4b, -0xbd, 0x38, 0x1f, 0x69, 0x54, 0x68, 0x99, 0xce, -0x86, 0x9c, 0x3f, 0xad, 0xe3, 0x0f, 0xa4, 0xd5, -0x4f, 0xe4, 0xad, 0x8e, 0xbf, 0x00, 0x23, 0x77, -0x57, 0x18, 0xd6, 0xa8, 0x76, 0x28, 0x12, 0x5e, -0x9d, 0x93, 0x46, 0x68, 0x96, 0x38, 0x6c, 0x81, -0x0b, 0xb2, 0x9e, 0xb5, 0xdb, 0xdf, 0xbb, 0x16, -0x21, 0xf8, 0xc5, 0xc7, 0x4d, 0x25, 0xc8, 0xb6, -0xe2, 0x0f, 0xd7, 0x26, 0x9d, 0x9a, 0xc2, 0x70, -0x8d, 0x51, 0x53, 0x07, 0xc8, 0x4c, 0x8d, 0x51, -0x19, 0xc4, 0x2a, 0x2e, 0x3d, 0x61, 0x98, 0x14, -0x89, 0x73, 0xe4, 0x17, 0xcb, 0xda, 0xc5, 0xaa, -0x38, 0x58, 0x8b, 0x79, 0x45, 0xe3, 0x77, 0x80, -0x25, 0x61, 0xb3, 0xd6, 0xd0, 0xd5, 0xa4, 0xb8, -0x12, 0xd6, 0x66, 0x67, 0xb1, 0x2b, 0xfe, 0xc8, -0x91, 0x51, 0x54, 0xaa, 0xbe, 0x22, 0x1c, 0xef, -0xb0, 0x0b, 0x09, 0xca, 0x7c, 0x41, 0xe9, 0x17, -0x47, 0x11, 0x3a, 0x90, 0xde, 0x94, 0x1e, 0x6c, -0xac, 0xcc, 0xda, 0x12, 0xea, 0x90, 0x8f, 0x7a, -0x91, 0x6a, 0xaf, 0x21, 0x8b, 0x64, 0xf6, 0xb9, -0x3f, 0xd2, 0x24, 0x6c, 0xfc, 0x57, 0x55, 0xf5, -0x79, 0x88, 0x19, 0x5f, 0x77, 0xe0, 0x2f, 0x46, -0x50, 0x41, 0xcc, 0x7c, 0xc9, 0xba, 0xa6, 0x75, -0x65, 0xab, 0xce, 0x0f, 0x5a, 0x75, 0xd8, 0xff, -0x74, 0x1d, 0x52, 0x57, 0x88, 0x72, 0xfb, 0xa1, -0xc0, 0xdb, 0x51, 0xe1, 0xe9, 0x90, 0xcf, 0x71, -0xc4, 0xce, 0xf2, 0x49, 0x16, 0xe5, 0x99, 0x96, -0x2f, 0x26, 0x16, 0xf8, 0x26, 0x85, 0x9f, 0x3c, -0x39, 0xf2, 0x84, 0x41, 0x29, 0x6d, 0x5c, 0xd0, -0x25, 0xad, 0x1f, 0x3a, 0x9b, 0x1e, 0xbb, 0x5a, -0xa5, 0x24, 0x14, 0xaa, 0xe3, 0x53, 0x38, 0xfb, -0xc3, 0x03, 0x3e, 0x43, 0xa5, 0x0c, 0xd0, 0xd1, -0x23, 0xb7, 0x49, 0x67, 0x11, 0x58, 0xff, 0x62, -0xa9, 0x89, 0xc7, 0xd9, 0xe0, 0x4d, 0x33, 0x65, -0x3b, 0x49, 0xac, 0xe7, 0x7b, 0x16, 0x66, 0xf4, -0x7f, 0x22, 0xb4, 0x89, 0xe3, 0x9f, 0x6c, 0x60, -0xcc, 0x1b, 0x57, 0x6f, 0x9c, 0x7f, 0x82, 0x04, -0x86, 0x6a, 0x58, 0x08, 0x7e, 0xb2, 0x8c, 0xa7, -0x6f, 0x91, 0x32, 0x19, 0xe6, 0xda, 0xc4, 0xc7, -0x09, 0xe8, 0x5e, 0x6a, 0x84, 0x88, 0xbb, 0xb5, -0x47, 0x2f, 0xb6, 0x8c, 0x12, 0x08, 0x8d, 0xa7, -0x34, 0x3f, 0xac, 0x60, 0xc7, 0xea, 0x91, 0x44, -0x45, 0xaa, 0x6a, 0x0f, 0xf0, 0x79, 0x51, 0xc4, -0xc7, 0x0e, 0x2d, 0x86, 0x00, 0x72, 0xb4, 0x39, -0x50, 0xb3, 0x71, 0x3d, 0xd2, 0x38, 0xe0, 0xc3, -0xb3, 0x75, 0x55, 0xd9, 0xe5, 0xe9, 0x11, 0xfa, -0xa0, 0x64, 0x69, 0xfa, 0x06, 0xf6, 0x89, 0xe0, -0x5f, 0x32, 0x90, 0xfe, 0x8a, 0x6c, 0xb3, 0x71, -0xf5, 0x7c, 0x46, 0xc0, 0xbf, 0x7c, 0x04, 0xbd, -0x8a, 0x4b, 0x99, 0xbe, 0x67, 0xcc, 0x67, 0x18, -0x5b, 0x4c, 0xa2, 0x28, 0x41, 0x73, 0x06, 0xe5, -0x02, 0xf0, 0xb3, 0xad, 0xae, 0x0e, 0x80, 0xc7, -0x80, 0x2e, 0xe7, 0x59, 0x71, 0xc8, 0x5e, 0x34, -0x6a, 0xa4, 0x9e, 0x37, 0x73, 0xe5, 0xdb, 0xba, -0x3f, 0xc1, 0xa5, 0x8b, 0xac, 0x26, 0xfc, 0x3d, -0x71, 0xc8, 0xf6, 0x21, 0xc4, 0xb8, 0xc8, 0xb8, -0x6b, 0x9a, 0x94, 0x28, 0xb4, 0x45, 0xdb, 0x51, -0x19, 0x02, 0x75, 0x98, 0x35, 0xed, 0xc0, 0x06, -0x70, 0xec, 0xa4, 0x8c, 0x79, 0x47, 0x3b, 0x01, -0x10, 0x4a, 0xa7, 0x00, 0x0f, 0xb4, 0xde, 0x40, -0x75, 0xb3, 0xb4, 0xd9, 0x5b, 0xd2, 0x56, 0x2f, -0x0e, 0x54, 0xda, 0x4b, 0x8d, 0xea, 0x48, 0xa3, -0x92, 0x24, 0x51, 0xb1, 0x1c, 0x18, 0xd1, 0xc9, -0x7c, 0xcf, 0xd6, 0x8a, 0x1f, 0x16, 0x75, 0x28, -0xac, 0x29, 0xeb, 0x3c, 0x5d, 0x91, 0xb5, 0x3b, -0x60, 0xcd, 0xbe, 0xe1, 0x01, 0x2c, 0xbb, 0x25, -0x67, 0x51, 0xe7, 0x7b, 0x15, 0x46, 0xe4, 0x64, -0x9f, 0x67, 0x11, 0x9f, 0xab, 0x21, 0x6a, 0x43, -0xed, 0x36, 0x67, 0xef, 0x2f, 0xb7, 0x67, 0xf7, -0x3b, 0x56, 0x33, 0x59, 0x63, 0x9f, 0xc2, 0xb9, -0x55, 0x73, 0x57, 0xfd, 0xa8, 0xde, 0x44, 0x87, -0x56, 0xa9, 0x01, 0xe8, 0x4c, 0xa4, 0x65, 0xbe, -0x03, 0x16, 0x79, 0x4f, 0x6a, 0x11, 0x11, 0x95, -0xf6, 0x87, 0x19, 0x9c, 0x0f, 0x24, 0xc8, 0xc5, -0x54, 0x44, 0xb1, 0x5d, 0xbc, 0x96, 0x4b, 0x2b, -0x0f, 0x59, 0xcc, 0xed, 0xb3, 0xd6, 0xf1, 0x11, -0xa0, 0x5c, 0xac, 0x79, 0x6d, 0x35, 0x0f, 0xb2, -0xde, 0xa0, 0x11, 0xae, 0x4b, 0x7b, 0x6f, 0x6b, -0x82, 0x06, 0xe1, 0x05, 0x07, 0x7f, 0xc5, 0x71, -0x09, 0xa8, 0xb6, 0xc6, 0x5b, 0x5d, 0x5b, 0x14, -0xd2, 0xc6, 0x91, 0xd6, 0x6b, 0x7a, 0xfd, 0xe1, -0x6f, 0x33, 0x7a, 0x4d, 0xf0, 0x11, 0x1a, 0x45, -0x12, 0xfc, 0x27, 0x0e, 0xe0, 0x74, 0xab, 0x6f, -0xae, 0x3d, 0x31, 0xfd, 0xbb, 0x65, 0x0f, 0xd1, -0xb0, 0xa7, 0x07, 0xdb, 0x4c, 0x15, 0xde, 0xf1, -0x36, 0x97, 0x73, 0xb4, 0x51, 0xdf, 0xa9, 0x50, -0xc1, 0x1a, 0xa0, 0xe1, 0x75, 0xc8, 0x40, 0xbf, -0x05, 0xfe, 0xb9, 0xb3, 0xd7, 0xbd, 0x26, 0xc4, -0x1c, 0x25, 0xe7, 0xd6, 0xba, 0xdc, 0x1d, 0x6c, -0x86, 0x5f, 0xb6, 0x20, 0xdd, 0xe4, 0xf5, 0x07, -0xec, 0xc8, 0x2b, 0x07, 0x7e, 0xb3, 0x58, 0xcd, -0x18, 0xa4, 0x62, 0x34, 0xc2, 0xa5, 0x13, 0x55, -0x24, 0x9e, 0x4b, 0x9e, 0x53, 0xc1, 0x48, 0x8f, -0x57, 0x42, 0x81, 0x4e, 0x2a, 0x3c, 0xc7, 0x37, -0x8f, 0x53, 0xec, 0xed, 0x7c, 0xb6, 0x90, 0xb5, -0x43, 0x6c, 0xe2, 0xb7, 0xfb, 0xb8, 0xd7, 0x05, -0xc3, 0x80, 0xc5, 0xb1, 0xf7, 0x07, 0x06, 0xb3, -0xc1, 0xcc, 0xa3, 0xea, 0x0b, 0x6a, 0x83, 0xb9, -0x5b, 0xb4, 0x58, 0x7d, 0x37, 0xe6, 0x89, 0xeb, -0x4b, 0x03, 0xef, 0x90, 0x56, 0x09, 0x58, 0x57, -0xbe, 0x98, 0x84, 0x31, 0x10, 0x8b, 0xc3, 0x25, -0x63, 0x82, 0x83, 0xe3, 0xc6, 0xd9, 0x5d, 0xc3, -0x7e, 0xf1, 0xd2, 0x9a, 0x53, 0x51, 0x6b, 0xb6, -0x26, 0x36, 0xc0, 0x1a, 0xc6, 0x60, 0xaa, 0x41, -0x42, 0x76, 0x84, 0xd0, 0x3d, 0x2b, 0x29, 0x3a, -0xa4, 0x0b, 0xb8, 0x5a, 0x93, 0x7b, 0x6a, 0x1e, -0xe4, 0x8d, 0x92, 0x8e, 0x6f, 0xf0, 0xeb, 0x32, -0x4c, 0x9a, 0x63, 0xf0, 0x56, 0xf8, 0x80, 0x10, -0xeb, 0xa0, 0x4b, 0xdd, 0x5a, 0xf4, 0xd0, 0x20, -0x4c, 0x59, 0xd9, 0xc3, 0xdc, 0x7f, 0x2a, 0x87, -0x2f, 0x5e, 0xbe, 0x37, 0x3e, 0x26, 0x00, 0x08, -0x6a, 0x55, 0x30, 0xb1, 0xfd, 0x5e, 0xd8, 0x85, -0xde, 0xbc, 0xe6, 0x8c, 0x36, 0x94, 0xf1, 0x4c, -0x29, 0x0f, 0x3a, 0x3f, 0x2c, 0x89, 0xcb, 0xb2, -0x3e, 0x5b, 0x00, 0xea, 0x88, 0x54, 0xdb, 0xe8, -0x10, 0x91, 0x82, 0xc1, 0x48, 0xd6, 0x72, 0x5c, -0xa4, 0x4c, 0x1b, 0xbc, 0x61, 0xc0, 0x3f, 0x34, -0x45, 0xe1, 0x1c, 0xd2, 0x5b, 0x36, 0xd2, 0xd9, -0xcd, 0x15, 0xbb, 0x51, 0xbd, 0xd5, 0xd3, 0x59, -0x10, 0x71, 0x9a, 0x3b, 0xb9, 0x70, 0x32, 0x66, -0xef, 0x03, 0xdc, 0x36, 0x20, 0xe4, 0x89, 0x5e, -0x5a, 0x98, 0x04, 0x80, 0x7a, 0x48, 0xe7, 0xf4, -0xc5, 0x98, 0xff, 0x4b, 0x5f, 0xb5, 0x94, 0xf2, -0x38, 0x7e, 0x2c, 0xe9, 0x90, 0x6e, 0x20, 0x75, -0xce, 0x31, 0xed, 0x0c, 0x2a, 0xf1, 0x46, 0xf6, -0x37, 0x80, 0x6b, 0x8f, 0x52, 0x85, 0x9d, 0xd7, -0x2f, 0xe5, 0x89, 0xb1, 0xc7, 0x97, 0x69, 0xae, -0xe8, 0xf3, 0x7c, 0xed, 0x96, 0xdd, 0x5c, 0x70, -0xed, 0xbf, 0x42, 0xca, 0x24, 0xf6, 0x2f, 0x7c, -0xca, 0x84, 0xa9, 0xa7, 0xa9, 0x49, 0xb3, 0xcb, -0x4e, 0x61, 0x3d, 0xfb, 0xac, 0x78, 0xbe, 0x39, -0x87, 0x39, 0xaa, 0x38, 0xda, 0x15, 0x9d, 0x01, -0x35, 0x08 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x04, 0xd8, 0x3a, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x02, 0x00, -0xbd, 0xa7, 0x00, 0x00, 0x05, 0x00, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xb3, -0x32, 0x34, 0x9b, 0xde, 0x01, 0xd6, 0x40, 0x07, -0x60, 0x71, 0xef, 0xf8, 0xb1, 0x47, 0xa0, 0x6b, -0x20, 0x52, 0x79, 0x58, 0x71, 0x6d, 0x80, 0x19, -0x68, 0xa6, 0x1b, 0x79, 0xec, 0xee, 0x71, 0x16, -0x30, 0x02, 0x55, 0xf6, 0x4d, 0x84, 0x40, 0xe7, -0x1d, 0x96, 0x57, 0xfd, 0xb8, 0x06, 0x7b, 0x6d, -0xee, 0xfc, 0xbc, 0x46, 0x02, 0x0e, 0xc7, 0xc1, -0x00, 0xc9, 0x8c, 0x5c, 0xd6, 0x07, 0xb0, 0x77, -0x01, 0x52, 0xef, 0x95, 0xb9, 0x64, 0x9b, 0x4d, -0x55, 0x0b, 0x08, 0x77, 0x11, 0x40, 0x5c, 0x2e, -0xaa, 0xab, 0x77, 0xfa, 0x16, 0x1a, 0xa8, 0x0c, -0x23, 0x54, 0x3b, 0x26, 0x46, 0x7d, 0x16, 0xb3, -0x27, 0x32, 0xb9, 0x5b, 0xda, 0xd0, 0x02, 0xa6, -0x16, 0x4c, 0xd6, 0xdd, 0xf1, 0xde, 0x2c, 0xdc, -0x13, 0x3d, 0xb8, 0x60, 0x3f, 0x89, 0xf4, 0x7e, -0x4c, 0x40, 0xd8, 0xcb, 0xd3, 0x1c, 0x13, 0x68, -0xcb, 0xc6, 0x93, 0x7d, 0x3d, 0x96, 0xae, 0x62, -0xb1, 0x9e, 0xf2, 0xdb, 0x9c, 0xe8, 0xa2, 0xe1, -0x09, 0x60, 0xea, 0x5e, 0x54, 0xf7, 0x53, 0xd5, -0xd2, 0x66, 0xa1, 0xa9, 0x2d, 0x75, 0x8b, 0x3e, -0xf0, 0x72, 0x38, 0x76, 0xa7, 0x21, 0xaf, 0x42, -0xe6, 0xfb, 0xc0, 0x53, 0x0a, 0x65, 0xfe, 0xce, -0x6e, 0x9d, 0xee, 0x14, 0xa8, 0xce, 0x20, 0xaa, -0x31, 0xe9, 0xb2, 0x0d, 0x37, 0x7a, 0xf3, 0x0d, -0x91, 0xf1, 0x19, 0x1c, 0x8a, 0xeb, 0x30, 0xf6, -0xa4, 0x16, 0xc0, 0xff, 0x06, 0xea, 0x66, 0x74, -0xe2, 0x21, 0x8a, 0xcf, 0xcc, 0x16, 0x3c, 0x04, -0x62, 0xe6, 0x21, 0x24, 0x24, 0x24, 0xc2, 0xc0, -0x81, 0x64, 0x60, 0x02, 0x8e, 0x38, 0xb2, 0xf3, -0x3e, 0x28, 0x28, 0x2b, 0xe9, 0x6c, 0x67, 0x03, -0x94, 0x90, 0x3c, 0xaa, 0xa2, 0x94, 0x5b, 0xab, -0x91, 0xf5, 0x3d, 0x4e, 0x63, 0xc2, 0x4d, 0xe8, -0xdd, 0xe1, 0x73, 0x93, 0x63, 0xc5, 0x55, 0x32, -0xc3, 0xc6, 0x8c, 0x0f, 0x13, 0xb0, 0x2d, 0x76, -0x0a, 0x54, 0xbe, 0xa1, 0xcd, 0x9b, 0x1d, 0xc2, -0xa7, 0x95, 0x18, 0xd0, 0xf0, 0x8b, 0x3c, 0x78, -0x72, 0x3a, 0x8c, 0x51, 0xca, 0xf8, 0x2d, 0x85, -0xce, 0x03, 0xb9, 0xfc, 0xf6, 0x69, 0xe7, 0x00, -0x5e, 0x6b, 0x98, 0x3d, 0x2d, 0xbd, 0x97, 0x65, -0x4a, 0xc0, 0xc4, 0x1f, 0x95, 0x5e, 0x5c, 0xb0, -0x50, 0x51, 0x4c, 0x53, 0xa2, 0x4e, 0x93, 0xb6, -0x82, 0x76, 0xbd, 0x23, 0xe4, 0xd1, 0x45, 0x6c, -0x5c, 0x81, 0x3d, 0xc9, 0x07, 0xcc, 0x05, 0x68, -0xaa, 0x15, 0x6d, 0x0e, 0x45, 0x3e, 0xcf, 0xf5, -0xdb, 0x45, 0x45, 0x63, 0x05, 0xdf, 0xa4, 0x96, -0x40, 0x5e, 0x32, 0x57, 0x0b, 0x29, 0x35, 0xb1, -0x7d, 0x9d, 0x4e, 0xbc, 0xa9, 0x0e, 0x9a, 0x70, -0x50, 0x3c, 0x5e, 0xff, 0x14, 0x88, 0x77, 0xa2, -0xcb, 0xb7, 0x5d, 0xf8, 0x8e, 0x20, 0x1b, 0x4e, -0xeb, 0x9b, 0x61, 0xca, 0x02, 0x84, 0x28, 0x54, -0x2a, 0x72, 0x07, 0xee, 0x77, 0x66, 0x46, 0xc3, -0xbc, 0xad, 0x05, 0x16, 0x3a, 0x4b, 0xa3, 0xb0, -0x90, 0x99, 0x5b, 0x58, 0x97, 0xcf, 0x88, 0x14, -0xc4, 0x62, 0xf2, 0xe4, 0x40, 0x79, 0x4c, 0x7e, -0x13, 0x48, 0xae, 0x9e, 0xb2, 0xde, 0xab, 0x93, -0x08, 0xc3, 0x3e, 0x9d, 0x41, 0xaf, 0x7b, 0xf2, -0x0c, 0x6b, 0x82, 0xf5, 0xc8, 0x34, 0xad, 0xaa, -0xb6, 0xc5, 0xd0, 0x81, 0x9f, 0xb1, 0xde, 0x18, -0xd6, 0xdb, 0xaa, 0x7b, 0x1e, 0x30, 0x18, 0xd9, -0x7e, 0x7b, 0xf4, 0x9b, 0x9f, 0xd2, 0x69, 0x80, -0xa9, 0xd7, 0x99, 0x7d, 0xde, 0x2f, 0x4c, 0x4c, -0x41, 0x94, 0x30, 0xe3, 0xd5, 0x59, 0x7d, 0xe6, -0x85, 0x50, 0x1e, 0x55, 0xe9, 0xd3, 0xc5, 0xd8, -0x26, 0x4a, 0xe3, 0x2f, 0xee, 0x06, 0x02, 0x6f, -0x65, 0xae, 0xca, 0xf1, 0xdf, 0x4d, 0x47, 0xa7, -0x78, 0x22, 0x2f, 0xca, 0x71, 0xc7, 0xcb, 0x73, -0x58, 0xfe, 0x8c, 0xf0, 0x36, 0x84, 0xa5, 0x14, -0xbf, 0x2e, 0xa6, 0xd7, 0xcd, 0xda, 0xe3, 0x7b, -0x5e, 0xec, 0x49, 0x7b, 0x5e, 0xbf, 0xbd, 0x80, -0x1a, 0xa3, 0xc4, 0x9d, 0xf1, 0x1e, 0x84, 0x41, -0x65, 0x29, 0x98, 0x2d, 0x65, 0x93, 0x79, 0xa2, -0xc7, 0xed, 0x23, 0x49, 0x0d, 0xf3, 0x8e, 0x34, -0xe5, 0x60, 0xc9, 0x52, 0xfe, 0xd3, 0x24, 0x7e, -0x82, 0x16, 0xbb, 0xfc, 0xcb, 0x2a, 0x41, 0x20, -0x94, 0xe7, 0xae, 0xa9, 0x0b, 0x01, 0x37, 0x86, -0xf7, 0x2d, 0x72, 0x1e, 0xed, 0x24, 0x1f, 0x13, -0xef, 0x7e, 0xf6, 0x15, 0xe3, 0xd9, 0x37, 0xc4, -0x11, 0xf3, 0x85, 0x8f, 0x88, 0x1e, 0x6d, 0x75, -0x32, 0xf1, 0xd2, 0x41, 0x95, 0xa0, 0x09, 0xe0, -0x8c, 0x9d, 0xb5, 0x94, 0xb2, 0x69, 0xdb, 0xbd, -0xe2, 0x15, 0xc7, 0xad, 0x77, 0x2b, 0x2d, 0xe0, -0xed, 0x62, 0x88, 0x44, 0x99, 0x3b, 0xaf, 0xb1, -0x0c, 0x8b, 0x4f, 0xbe, 0x97, 0xa5, 0x2b, 0x3c, -0x33, 0xbf, 0xfd, 0x34, 0x46, 0xdf, 0x72, 0xa2, -0xe0, 0xef, 0x0d, 0xaa, 0x5a, 0xc9, 0x26, 0x2e, -0x4e, 0x01, 0xef, 0x78, 0x2c, 0x14, 0xcc, 0x4c, -0x83, 0x46, 0xfe, 0x98, 0x0f, 0x22, 0x0c, 0x3d, -0x08, 0x57, 0xb5, 0xac, 0xe1, 0x41, 0xd5, 0xda, -0x11, 0x94, 0xfe, 0xb2, 0xb5, 0x08, 0xcf, 0x06, -0x11, 0x0c, 0x96, 0x53, 0x41, 0xc9, 0x05, 0xbd, -0x50, 0xea, 0xd7, 0x16, 0xf9, 0x1b, 0x57, 0xc4, -0x8b, 0xf1, 0xc3, 0x54, 0x9e, 0x71, 0xcf, 0xa5, -0x7f, 0xef, 0x75, 0x86, 0x1c, 0xf7, 0x7b, 0x64, -0x4d, 0xdb, 0xe9, 0x44, 0x94, 0xfb, 0xb8, 0xa4, -0x33, 0x3b, 0x55, 0x7d, 0x29, 0x7a, 0xfa, 0x04, -0xf0, 0xf1, 0xf7, 0xd3, 0x16, 0xcd, 0x26, 0x87, -0xc8, 0x3f, 0x8d, 0xa3, 0x26, 0x56, 0x69, 0xd3, -0x06, 0x18, 0xa6, 0x79, 0xc5, 0x35, 0x94, 0xd2, -0xee, 0x23, 0x47, 0x7a, 0x5d, 0xbe, 0xc9, 0x16, -0x37, 0x6b, 0xc2, 0xa5, 0x95, 0x38, 0x4b, 0x19, -0x2d, 0x8e, 0x97, 0x44, 0xf1, 0xca, 0x7d, 0xe3, -0xda, 0x00, 0x30, 0xf6, 0x8e, 0x4d, 0x5f, 0x8f, -0xeb, 0xc2, 0x49, 0x97, 0x5a, 0xe0, 0x75, 0xab, -0xa9, 0x1d, 0xa1, 0xfe, 0xfe, 0x65, 0xd4, 0xb6, -0xf7, 0x67, 0x53, 0x38, 0x2c, 0xd7, 0x36, 0x44, -0x32, 0x51, 0x69, 0xea, 0x60, 0xac, 0xe6, 0x86, -0x98, 0xe3, 0xe6, 0xff, 0x41, 0x85, 0x5e, 0x34, -0x29, 0xbe, 0x7e, 0x97, 0x80, 0x0f, 0x3b, 0x71, -0x0b, 0x38, 0xf3, 0x0a, 0x5d, 0x22, 0xe2, 0x69, -0xc7, 0xc4, 0xd5, 0xf1, 0x84, 0x4c, 0xe5, 0x85, -0x61, 0xea, 0x27, 0x40, 0xd7, 0xb5, 0x04, 0x3a, -0xce, 0x5b, 0x0d, 0x78, 0x8c, 0xcb, 0x70, 0xe0, -0x75, 0x1e, 0x3a, 0x36, 0x0e, 0x80, 0x09, 0x54, -0x61, 0x60, 0x3c, 0x67, 0xd8, 0x4b, 0x3f, 0x9b, -0xda, 0x7a, 0xb0, 0xa9, 0x2e, 0x98, 0xa2, 0xf7, -0x23, 0xf9, 0x61, 0xbd, 0xc6, 0xcf, 0xa8, 0x16, -0x79, 0x66, 0xff, 0x65, 0x47, 0xcf, 0xf0, 0xa1, -0x18, 0x6f, 0x56, 0xd1, 0x3f, 0x24, 0x48, 0x1a, -0x5c, 0x61, 0x8e, 0x4b, 0x43, 0xb8, 0x8c, 0xaa, -0xa3, 0x53, 0x0c, 0xcb, 0xbe, 0x30, 0x1a, 0xf5, -0x96, 0x41, 0x93, 0xa5, 0x61, 0xbf, 0xc8, 0x2d, -0x0d, 0x52, 0xf1, 0x97, 0xe6, 0x84, 0xba, 0x2c, -0x81, 0xfb, 0xab, 0x0f, 0x15, 0xb9, 0xa5, 0x55, -0x2d, 0x01, 0x43, 0x3a, 0xa6, 0xf6, 0x1c, 0x95, -0x2d, 0xa1, 0x22, 0xf0, 0xec, 0xb4, 0xd5, 0xd8, -0xc5, 0x3d, 0xd0, 0xc1, 0xb9, 0x97, 0x6d, 0x5c, -0xb9, 0xfb, 0x7e, 0xdf, 0x94, 0xbb, 0x9f, 0x8b, -0x74, 0xf5, 0xa6, 0x7e, 0x7b, 0x9e, 0x17, 0xed, -0x2c, 0x99, 0xe0, 0x99, 0x41, 0x44, 0xa6, 0xce, -0x63, 0x1e, 0xa5, 0xd8, 0xba, 0xcb, 0xe1, 0x3c, -0x19, 0x59, 0x94, 0xe0, 0x26, 0x33, 0x9d, 0xc1, -0x83, 0xe1, 0x0a, 0x42, 0x9c, 0x9b, 0x14, 0xc0, -0xf7, 0xde, 0x4a, 0x9e, 0xb3, 0x42, 0xd9, 0x35, -0x2c, 0x86, 0x48, 0xf1, 0xf7, 0xde, 0xd8, 0x25, -0xd6, 0xb3, 0x55, 0x1f, 0xe9, 0x57, 0x34, 0xc6, -0x4a, 0x67, 0xe4, 0x7f, 0xfd, 0x08, 0x54, 0xc3, -0x19, 0x52, 0x7b, 0x55, 0x4a, 0x77, 0xd5, 0x5e, -0x7e, 0x5c, 0x0f, 0x64, 0xac, 0xfe, 0x3c, 0xf5, -0xc3, 0x95, 0xd4, 0xac, 0xb0, 0xbf, 0x52, 0x70, -0x25, 0x61, 0x99, 0xb8, 0x55, 0x9c, 0xce, 0xb7, -0xe4, 0x36, 0x72, 0x16, 0x16, 0xdd, 0x7e, 0x5a, -0xec, 0x95, 0x04, 0x57, 0xd7, 0x73, 0x80, 0x18, -0x2f, 0xe6, 0x7d, 0x56, 0xc9, 0xe7, 0x0f, 0x9a, -0x6d, 0x50, 0x34, 0x1f, 0xf4, 0x26, 0x35, 0xe5, -0xe8, 0x94, 0xbd, 0xef, 0xf7, 0x69, 0x28, 0xf7, -0x7b, 0x86, 0xc6, 0x80, 0x81, 0x71, 0xe8, 0xa8, -0xfd, 0x9e, 0x07, 0x2b, 0xba, 0xda }; - -static char pkt6[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xaa, -0x3b, 0x05, 0xde, 0xd4, 0xab, 0x24, 0xae, 0xfb, -0x59, 0x37, 0x13, 0x31, 0x53, 0x9f, 0x56, 0x88, -0x9f, 0x3c, 0xc8, 0x03, 0x68, 0x87, 0x04, 0xa3, -0xe6, 0x78, 0xdf, 0x38, 0x2f, 0xe5, 0x7d, 0x40, -0x61, 0xeb, 0xb1, 0x19, 0xeb, 0xfe, 0x61, 0x83, -0xf6, 0xaa, 0xb7, 0x17, 0x84, 0xdc, 0xab, 0x99, -0xd6, 0xdc, 0x26, 0x12, 0x02, 0x3f, 0x44, 0x7b, -0xaf, 0x60, 0xcc, 0x7b, 0x7c, 0xf1, 0x8d, 0x1e, -0x69, 0x1b, 0x71, 0x28, 0x9a, 0x1f, 0xe2, 0x07, -0xac, 0x8c, 0x77, 0x59, 0x9e, 0x1b, 0x1a, 0xa5, -0x36, 0xd5, 0x2f, 0xb8, 0xe4, 0xc2, 0xfb, 0x79, -0x02, 0x75, 0xe5, 0xe0, 0x1c, 0x43, 0xcb, 0xb0, -0x7a, 0xba, 0x2d, 0xad, 0xdb, 0x13, 0xbc, 0x70, -0x10, 0x46, 0x74, 0xc0, 0x31, 0xdf, 0x54, 0x19, -0x1f, 0xf8, 0x20, 0x71, 0x5b, 0xbe, 0xe2, 0xd4, -0xde, 0x1e, 0x6c, 0xee, 0x09, 0x0c, 0xb6, 0x81, -0x67, 0x75, 0x5c, 0x52, 0x55, 0x88, 0x57, 0xb4, -0x4a, 0x6d, 0xdd, 0xbb, 0x63, 0x87, 0xb1, 0xc7, -0xff, 0xdb, 0xe9, 0xf0, 0x69, 0x45, 0x81, 0x44, -0x1e, 0x05, 0xda, 0x86, 0x21, 0xf3, 0x74, 0xa2, -0xa8, 0x10, 0x99, 0x3c, 0x5b, 0x19, 0xf4, 0x39, -0x31, 0x9a, 0x83, 0xf6, 0x11, 0x9a, 0x65, 0x67, -0xd7, 0x9c, 0xb9, 0xe5, 0xba, 0x4a, 0x0a, 0x9f, -0x24, 0x36, 0xf4, 0x6f, 0x19, 0xc1, 0xfe, 0xab, -0xf3, 0xe2, 0x94, 0x21, 0xa3, 0xef, 0xc9, 0x03, -0xe1, 0x7b, 0x99, 0xef, 0x20, 0x1c, 0x66, 0x31, -0x7f, 0xab, 0x67, 0x38, 0xfb, 0xe3, 0x7a, 0x10, -0xd9, 0x83, 0x0c, 0x02, 0x07, 0x4e, 0xd0, 0xaa, -0x8d, 0x7d, 0x92, 0x72, 0x9f, 0x7a, 0x1c, 0xe7, -0x30, 0xc5, 0x8b, 0xb9, 0x65, 0xc5, 0x8d, 0x78, -0xaa, 0x4d, 0xb5, 0x45, 0x05, 0xdf, 0x8f, 0x90, -0xa0, 0x06, 0xbf, 0x49, 0xfa, 0xfb, 0xf2, 0xfb, -0x5b, 0x72, 0x68, 0xa6, 0xfb, 0x8d, 0x1f, 0x61, -0x34, 0xff, 0x67, 0x07, 0xd5, 0x9f, 0x1d, 0xbf, -0x8d, 0xae, 0x19, 0x6b, 0xd8, 0x7f, 0x7e, 0xe9, -0x02, 0x86, 0x36, 0x81, 0xf6, 0xc6, 0x5c, 0x23, -0xa4, 0x4a, 0x03, 0x70, 0xed, 0x09, 0x9c, 0xdb, -0xce, 0xb0, 0xf9, 0x84, 0x49, 0xc6, 0x61, 0x5d, -0x85, 0xa0, 0x7d, 0x18, 0x61, 0x37, 0x8b, 0x74, -0x54, 0xb9, 0x11, 0xe1, 0xf8, 0xaf, 0x95, 0x2c, -0xc8, 0x6a, 0x7c, 0x6b, 0xf3, 0x06, 0xec, 0xeb, -0x3c, 0xc9, 0x7a, 0x0f, 0x38, 0x65, 0x63, 0xc0, -0x02, 0x47, 0xae, 0xa9, 0x33, 0xea, 0xc9, 0xa3, -0xfd, 0x21, 0xd3, 0x28, 0x5d, 0x1a, 0xa8, 0x0d, -0xf4, 0x9c, 0x87, 0xab, 0x3b, 0xf5, 0x81, 0x29, -0xfd, 0x28, 0xef, 0xe4, 0x3b, 0x3e, 0xc2, 0xd1, -0x3b, 0xd9, 0xe5, 0x32, 0x4e, 0x0f, 0x2e, 0x64, -0xd0, 0x71, 0x4c, 0xc0, 0x44, 0x2b, 0x9e, 0x28, -0x68, 0x45, 0xa4, 0x4f, 0xe0, 0xb5, 0x9b, 0x42, -0xae, 0x6c, 0x94, 0xcd, 0xe5, 0x2b, 0x8f, 0x86, -0x52, 0x91, 0xa0, 0x2b, 0x97, 0x10, 0xf0, 0x79, -0xb3, 0x72, 0xce, 0x4b, 0x66, 0x63, 0xe1, 0xef, -0xb0, 0xae, 0xd9, 0x6d, 0xaf, 0x79, 0x38, 0xff, -0x6b, 0xfb, 0x9f, 0xa9, 0xe6, 0x68, 0x0e, 0x4b, -0x2a, 0x61, 0x09, 0xa4, 0x67, 0x98, 0xff, 0xe0, -0xff, 0xda, 0x27, 0xd2, 0x2b, 0x87, 0x51, 0x97, -0xe6, 0x61, 0x97, 0xec, 0x51, 0xf6, 0x17, 0x93, -0xcb, 0x28, 0x21, 0x6d, 0xfa, 0xb5, 0x18, 0x6b, -0x75, 0xd5, 0x8a, 0x48, 0x6a, 0x5b, 0xd5, 0x80, -0xc1, 0x22, 0xcc, 0x85, 0xa7, 0xda, 0x4b, 0xc0, -0xe2, 0xb6, 0xf0, 0xb5, 0xb4, 0xad, 0x43, 0x20, -0xae, 0x6f, 0xe8, 0x95, 0x96, 0x99, 0x56, 0x75, -0xfa, 0x8c, 0x91, 0x91, 0xb6, 0x26, 0x58, 0x29, -0x62, 0xf6, 0xa3, 0xec, 0x53, 0xdb, 0x7b, 0xf2, -0x3e, 0x79, 0xd3, 0x08, 0xce, 0x78, 0x2e, 0x58, -0xe7, 0xa9, 0xac, 0xbe, 0xf0, 0x85, 0x52, 0xf2, -0x8e, 0x46, 0x47, 0x28, 0xf3, 0x49, 0xac, 0x9c, -0xb2, 0xf3, 0x42, 0x3c, 0x13, 0x10, 0x82, 0xf6, -0xd6, 0x14, 0x09, 0x99, 0xd4, 0x6d, 0xe9, 0x3a, -0x2d, 0x6a, 0x31, 0x4b, 0x2a, 0xb9, 0x48, 0x26, -0xce, 0x3c, 0xe0, 0x1a, 0xca, 0x39, 0x17, 0xcf, -0xd8, 0xe6, 0x39, 0x95, 0x5b, 0x77, 0x28, 0x00, -0xff, 0x2a, 0x83, 0xd8, 0x3d, 0xd8, 0xeb, 0xfa, -0xe6, 0x37, 0x7c, 0xc4, 0x6d, 0xba, 0xbf, 0x85, -0x17, 0x3d, 0x68, 0x9e, 0xfd, 0x4b, 0x91, 0xd2, -0x13, 0x5a, 0xc8, 0x73, 0xbe, 0xc2, 0xa3, 0x7f, -0x58, 0x36, 0x8c, 0x29, 0x3f, 0xfd, 0x59, 0x9a, -0xbd, 0x5f, 0xf0, 0x16, 0xd5, 0xc1, 0x10, 0xcc, -0x54, 0x31, 0xe4, 0x3e, 0x84, 0xda, 0xda, 0x3e, -0x6c, 0x23, 0xf6, 0x5c, 0x46, 0x68, 0xed, 0xbb, -0x23, 0xb5, 0xd3, 0x57, 0xf3, 0xdb, 0x9a, 0x5a, -0x61, 0xba, 0x9f, 0xa7, 0x69, 0x31, 0x23, 0x47, -0x87, 0x13, 0x9a, 0x4f, 0x46, 0x35, 0xc2, 0x60, -0xd5, 0xf1, 0x77, 0x55, 0xd7, 0x83, 0xb0, 0xc3, -0x2f, 0x66, 0xaa, 0x14, 0xb3, 0x34, 0xd7, 0xa3, -0x6c, 0x66, 0x6f, 0x50, 0x91, 0xb9, 0x30, 0x3f, -0x62, 0xa4, 0x7b, 0xf5, 0x40, 0x46, 0x5c, 0x75, -0xfe, 0x6e, 0x3b, 0xe2, 0x62, 0x0f, 0xdb, 0x90, -0x06, 0x46, 0x4e, 0x31, 0x64, 0xc9, 0xd8, 0x4e, -0x02, 0xa5, 0x14, 0xd4, 0xa9, 0xa6, 0xea, 0x56, -0x01, 0xa6, 0x80, 0x7c, 0xa7, 0xff, 0xc6, 0xb1, -0x5f, 0x96, 0x49, 0xb5, 0x05, 0x96, 0x49, 0x54, -0x28, 0xa4, 0xd2, 0xb7, 0xee, 0xe9, 0x9b, 0x02, -0xfc, 0x26, 0xdc, 0x78, 0xa5, 0x11, 0x6b, 0x9f, -0x8e, 0x7c, 0xb3, 0x2a, 0xee, 0x91, 0x35, 0x16, -0x2f, 0x8d, 0xf9, 0x79, 0x4c, 0x16, 0xec, 0xa6, -0xa8, 0x73, 0xb8, 0x09, 0x3b, 0x89, 0x5e, 0xa5, -0xc4, 0xc5, 0xda, 0xdf, 0x5e, 0x25, 0xe2, 0xf4, -0xe7, 0x86, 0x73, 0x4a, 0xf8, 0x7b, 0x37, 0x6f, -0x09, 0x95, 0xfc, 0xb7, 0x3c, 0xcc, 0x5e, 0x72, -0x9e, 0x8d, 0x9d, 0x19, 0xd4, 0x2e, 0x5c, 0xb0, -0xa6, 0x8b, 0xc0, 0x15, 0x3f, 0x75, 0xf3, 0x05, -0xda, 0x13, 0x12, 0x22, 0xbe, 0xb7, 0x6c, 0x40, -0x94, 0x30, 0xa9, 0xb6, 0x0f, 0x71, 0xd2, 0x6f, -0x89, 0x35, 0xd7, 0xac, 0xee, 0xe9, 0x18, 0x93, -0x0d, 0x60, 0x1e, 0xa2, 0x49, 0xe1, 0x9b, 0x41, -0x18, 0x59, 0x7c, 0x38, 0x7f, 0x05, 0x84, 0x0b, -0x66, 0xab, 0x54, 0xba, 0xfc, 0x40, 0x5e, 0xa3, -0x1b, 0xc0, 0xb9, 0x3c, 0x51, 0x40, 0xcb, 0xd3, -0xe5, 0x96, 0x3b, 0x2b, 0x06, 0xc9, 0x4f, 0x17, -0xd7, 0x4f, 0xd7, 0x47, 0xe0, 0x85, 0x97, 0xde, -0x86, 0xa4, 0x2e, 0x64, 0x11, 0x00, 0x34, 0x44, -0x6a, 0x10, 0x96, 0xf1, 0x6d, 0x3a, 0xb1, 0x0d, -0xe4, 0xf2, 0x52, 0x00, 0xd3, 0x80, 0x76, 0x4d, -0x33, 0xa8, 0x41, 0xd1, 0x2b, 0x06, 0x37, 0x3f, -0xc1, 0x8e, 0x0c, 0x47, 0xd9, 0x85, 0x8c, 0x0e, -0x21, 0x57, 0xe9, 0xbd, 0x86, 0x3c, 0xf8, 0x23, -0xc3, 0xc3, 0xfd, 0x7d, 0x60, 0xea, 0x07, 0xab, -0x3c, 0x91, 0x2e, 0xb6, 0xf0, 0xec, 0xf6, 0xb0, -0x89, 0xaf, 0x55, 0xf3, 0x07, 0xe9, 0x60, 0x10, -0x40, 0x43, 0x91, 0x0d, 0x20, 0xc6, 0x37, 0x67, -0xbe, 0xdb, 0xab, 0xe7, 0xc5, 0x50, 0x60, 0x5d, -0xec, 0x7f, 0x5b, 0xd0, 0x02, 0x2f, 0xa1, 0xb3, -0x33, 0x70, 0xdb, 0x26, 0x15, 0x94, 0xda, 0x7d, -0xd7, 0x76, 0x11, 0x0e, 0xdd, 0x46, 0x98, 0x9f, -0x9d, 0xdc, 0xa0, 0x85, 0x2c, 0xd7, 0x4f, 0x85, -0xc4, 0x89, 0x77, 0x96, 0xd0, 0x02, 0x3f, 0x34, -0x44, 0x2b, 0x01, 0x04, 0x57, 0x1a, 0xc0, 0x5f, -0x3e, 0xb8, 0xea, 0x78, 0x05, 0x74, 0x9d, 0xf6, -0x16, 0x1d, 0xac, 0x46, 0x10, 0x14, 0xb9, 0x6f, -0x97, 0xa0, 0xdd, 0x2b, 0xd4, 0x5b, 0x25, 0x68, -0xba, 0x2b, 0x75, 0x14, 0xbf, 0x5f, 0xca, 0xa4, -0xcb, 0x23, 0xba, 0xa4, 0x5c, 0x2b, 0xeb, 0xc2, -0xfa, 0xfa, 0xed, 0x1f, 0xd2, 0x7d, 0x49, 0x5b, -0x6c, 0x5f, 0x94, 0xe2, 0xa7, 0xbc, 0xf5, 0x3c, -0x5c, 0xd8, 0xf3, 0x82, 0xc1, 0xba, 0xbc, 0xf3, -0x6e, 0x15, 0xf3, 0x2e, 0xc5, 0x44, 0x7f, 0xd3, -0x5e, 0xf4, 0xe7, 0xc5, 0xf9, 0x5a, 0xc5, 0x72, -0x37, 0xb1, 0xc8, 0x24, 0x0c, 0xe7, 0x0f, 0xe4, -0x02, 0x67, 0xff, 0x45, 0x7f, 0xcc, 0x38, 0xd5, -0x19, 0x5a, 0xe3, 0x83, 0x3d, 0xa9, 0x02, 0x2d, -0x84, 0xd3, 0xe8, 0x5f, 0x45, 0x11, 0xd4, 0x63, -0x44, 0xaf, 0xb5, 0xec, 0x6d, 0x63, 0x57, 0xec, -0x8e, 0xcf, 0xeb, 0x1a, 0x72, 0x4e, 0x82, 0x7d, -0xe2, 0x7f, 0x72, 0x9d, 0xff, 0xa0, 0x79, 0x17, -0xe4, 0xbd, 0x67, 0x20, 0xdb, 0xa7, 0xf3, 0xad, -0xba, 0xb4, 0x03, 0x4a, 0xd7, 0x57, 0xf8, 0xa2, -0x6e, 0xc6, 0x35, 0x45, 0xe6, 0x8d, 0x8d, 0x64, -0xb7, 0xdb, 0x7c, 0x91, 0x9c, 0x8a, 0xfe, 0xec, -0xf0, 0xe7, 0xf0, 0x22, 0x6b, 0x79, 0x40, 0x96, -0x2f, 0x19, 0x1a, 0xf2, 0xc8, 0x52, 0xd5, 0x00, -0xe6, 0xac, 0xad, 0x97, 0x54, 0xa6, 0xd3, 0xd5, -0x5f, 0xae, 0x97, 0x9d, 0x1e, 0x5a, 0x67, 0xb4, -0xd7, 0x69, 0x64, 0x73, 0x0c, 0x70, 0xf6, 0x25, -0xc1, 0xf5, 0xca, 0x9b, 0xe7, 0x82, 0xb9, 0xda, -0x2e, 0x76, 0xae, 0x2e, 0xcd, 0x5b, 0xce, 0x47, -0xa1, 0x40, 0xe6, 0xcf, 0xc9, 0xb6, 0x20, 0x24, -0xb8, 0x06, 0x06, 0xb2, 0xcb, 0x53, 0x16, 0x48, -0x8f, 0x6a, 0x44, 0x02, 0xc5, 0x19, 0x76, 0xdd, -0xfe, 0xa7, 0xe9, 0xbb, 0x16, 0x95, 0x1d, 0xed, -0x8a, 0xf3, 0xb3, 0xb1, 0x1f, 0x81, 0x76, 0xfc, -0x68, 0xb6, 0xef, 0x4a, 0xdc, 0x0d, 0xb9, 0xc9, -0x4e, 0x05, 0x7b, 0xc0, 0x0b, 0xa7, 0x67, 0xf6, -0xb9, 0x12, 0x60, 0x9b, 0x8d, 0x97, 0x5c, 0xe7, -0x36, 0xc3, 0x8c, 0x25, 0xcc, 0x7b, 0x9a, 0x47, -0x3c, 0x86, 0x0f, 0x4e, 0x6c, 0xff, 0x25, 0x30, -0x2f, 0xc2, 0x45, 0xc8, 0xb4, 0xe4, 0xad, 0x9a, -0x23, 0xbc, 0xfa, 0xc0, 0x07, 0x2d, 0x4e, 0xea, -0x4e, 0x3e, 0xc0, 0x5f, 0x61, 0xec, 0x2d, 0xd9, -0x95, 0x9d, 0x7a, 0xa8, 0xb3, 0xdd, 0x92, 0xce, -0x26, 0xd7, 0x41, 0x83, 0x2c, 0x5f, 0x4f, 0xa6, -0xf8, 0x21, 0xdf, 0x78, 0xb0, 0x50, 0x8e, 0xfa, -0xfd, 0xc8, 0x91, 0x07, 0xb4, 0x46, 0x2d, 0x88, -0x36, 0x9a, 0x65, 0x44, 0xab, 0x58, 0x81, 0x4f, -0x9a, 0x13, 0x17, 0x1d, 0x35, 0x8e, 0x9e, 0xf3, -0xaa, 0x55, 0xbc, 0x0c, 0xc3, 0xbe, 0xa3, 0x4b, -0x38, 0x1a, 0xd2, 0x42, 0x97, 0xe2, 0xed, 0x65, -0xea, 0xae, 0x9c, 0xe9, 0xf8, 0x5a, 0x44, 0xd3, -0xde, 0xae, 0x70, 0x2e, 0xfb, 0xa5, 0x41, 0xd7, -0xfa, 0x0f, 0x4b, 0x1e, 0x26, 0x24, 0xb3, 0x25, -0x15, 0x97 }; - -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x04, 0xd8, 0x2c, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, -0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb7, -0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0x2d, 0x70, -0xb4, 0x11, 0x1a, 0xcc, 0xf6, 0x93, 0x87, 0xd3, -0xf9, 0xc1, 0x42, 0x7c, 0x05, 0x1d, 0xc4, 0x74, -0x12, 0x77, 0x02, 0xa0, 0xce, 0x81, 0x7d, 0x32, -0xe4, 0x9c, 0x0d, 0x01, 0xbd, 0xd5, 0x5c, 0x1c, -0x01, 0x65, 0x6b, 0x34, 0x38, 0xb3, 0x71, 0x41, -0xed, 0x4d, 0x4a, 0xa7, 0xc8, 0xb3, 0x9a, 0x77, -0xd8, 0xc2, 0x84, 0x14, 0x68, 0x8e, 0xbf, 0x94, -0xda, 0xe3, 0xc0, 0x70, 0x56, 0x69, 0x3a, 0x65, -0x58, 0xae, 0x9d, 0xcd, 0x00, 0x45, 0x20, 0xf2, -0x59, 0xb0, 0x6c, 0x76, 0x16, 0xa2, 0x22, 0xde, -0xfc, 0x06, 0xe0, 0xf4, 0x52, 0x8d, 0x93, 0xe1, -0xd4, 0x92, 0x0c, 0x05, 0xf9, 0xfb, 0x52, 0xfb, -0xa8, 0xcf, 0xb1, 0x86, 0xdc, 0xe8, 0x07, 0x95, -0xfa, 0x1c, 0x38, 0xb9, 0xd0, 0x7a, 0x65, 0xe0, -0x36, 0xe1, 0x2f, 0xa8, 0x3a, 0xbf, 0xc7, 0xb7, -0x3e, 0xc4, 0xd5, 0x48, 0xfb, 0x6d, 0x40, 0xa2, -0xb5, 0xe2, 0xe7, 0x3a, 0x42, 0x7c, 0x1c, 0xc5, -0x36, 0xbc, 0x29, 0xca, 0x78, 0xf9, 0x36, 0xba, -0xf4, 0xb6, 0x8e, 0xe7, 0x74, 0xc7, 0xc9, 0x8a, -0x74, 0x2d, 0xfc, 0x66, 0x8d, 0x31, 0x62, 0x15, -0x59, 0x00, 0xbb, 0x53, 0xd3, 0x4b, 0xad, 0x8a, -0x97, 0x00, 0xf7, 0x90, 0xdd, 0x7a, 0xf2, 0xde, -0x02, 0x82, 0x75, 0xe8, 0xae, 0x82, 0x18, 0x14, -0xc2, 0xc3, 0x03, 0x27, 0x93, 0x0f, 0x2b, 0xc6, -0xb1, 0xd0, 0x8b, 0xae, 0x28, 0xbb, 0x3f, 0xb5, -0x47, 0x42, 0xc6, 0x73, 0x3a, 0xb2, 0xd8, 0x8f, -0x21, 0xde, 0x10, 0xb4, 0x5a, 0x8b, 0x54, 0x3d, -0x24, 0xc7, 0x8b, 0xbf, 0x0d, 0xc5, 0x81, 0x52, -0x1d, 0x21, 0x09, 0x61, 0xcc, 0x88, 0x2a, 0x6d, -0xe5, 0x45, 0xc7, 0x17, 0x94, 0x27, 0x18, 0x9b, -0x04, 0xea, 0xa5, 0x9b, 0x97, 0x79, 0xf9, 0x61, -0xe3, 0xc4, 0x5e, 0x31, 0x50, 0x06, 0x02, 0x43, -0x7c, 0x85, 0xf6, 0x4c, 0xc5, 0x10, 0x6d, 0x0f, -0xb3, 0x5e, 0x97, 0x01, 0x9f, 0x77, 0x5d, 0xcc, -0x68, 0x49, 0xae, 0xaa, 0x52, 0xcc, 0x6d, 0x81, -0xa9, 0x90, 0x81, 0x10, 0x09, 0x3f, 0xdd, 0x5c, -0x61, 0xcc, 0xc3, 0xc0, 0xc8, 0xc4, 0x5c, 0x0a, -0xb0, 0x63, 0x5b, 0xb0, 0xf4, 0xa1, 0x64, 0x4e, -0xd6, 0xc6, 0x81, 0xb2, 0x75, 0xc2, 0x7d, 0xaa, -0x01, 0xae, 0xe0, 0xf0, 0x4e, 0x62, 0x40, 0xb4, -0x13, 0xf1, 0xa7, 0x66, 0xef, 0xd4, 0xf1, 0xf1, -0xa9, 0x60, 0xce, 0x18, 0x6c, 0xb3, 0x36, 0xa6, -0x12, 0xed, 0xb6, 0x20, 0xca, 0x0b, 0x84, 0xde, -0xbc, 0xcb, 0x3c, 0x38, 0x6d, 0x03, 0xc8, 0xd0, -0xe1, 0x25, 0xc0, 0x49, 0x1d, 0x11, 0x7b, 0x41, -0x2a, 0x5d, 0x07, 0x74, 0x7d, 0x52, 0x5a, 0x53, -0xf6, 0xa7, 0xd7, 0xc0, 0xaa, 0x72, 0x4c, 0xcc, -0x62, 0x6b, 0x5e, 0xf6, 0x1d, 0xd1, 0xb9, 0x93, -0x01, 0x77, 0x0d, 0xa9, 0x48, 0xfb, 0x32, 0x30, -0x4c, 0x35, 0x74, 0x0d, 0x62, 0xfe, 0xea, 0xe6, -0x17, 0x76, 0x80, 0x55, 0x8f, 0xcd, 0x16, 0xe6, -0x0f, 0xaa, 0xf8, 0xc0, 0x6a, 0x8b, 0xe8, 0xa8, -0x21, 0x89, 0x58, 0xda, 0x4c, 0xcb, 0x70, 0x50, -0x6d, 0x3f, 0x5e, 0x4e, 0xcf, 0x7c, 0x0a, 0x04, -0xf9, 0x79, 0x77, 0xd3, 0x54, 0xaa, 0x92, 0xbe, -0x49, 0x1a, 0x23, 0x60, 0x1e, 0x4c, 0x06, 0xa4, -0xbb, 0x3d, 0xd1, 0x7c, 0xcd, 0xf3, 0xf6, 0x61, -0x4a, 0xee, 0x2b, 0x44, 0x77, 0x93, 0xe4, 0xe8, -0x5c, 0x80, 0x43, 0x09, 0x22, 0x95, 0x27, 0x60, -0xb2, 0x45, 0xf6, 0xfc, 0x2f, 0xd2, 0xf5, 0xfa, -0x0b, 0xdd, 0x00, 0x09, 0xb0, 0x63, 0xf4, 0x27, -0x23, 0x51, 0x88, 0x6e, 0x4b, 0x59, 0x20, 0x18, -0x97, 0x3e, 0xc8, 0xd1, 0x3f, 0x8a, 0xd1, 0xb5, -0xa4, 0xc5, 0x23, 0xcf, 0x08, 0xe9, 0x28, 0xf0, -0xfc, 0xff, 0x89, 0xcb, 0x8e, 0xc7, 0xcf, 0xf5, -0x8e, 0x82, 0x4e, 0xc3, 0x61, 0xf6, 0x20, 0x25, -0x9d, 0xd5, 0xd6, 0x19, 0xc9, 0x55, 0x88, 0x64, -0xd2, 0x97, 0xcd, 0x6c, 0x73, 0x53, 0x44, 0xa2, -0x44, 0xc4, 0x65, 0x16, 0x8e, 0x33, 0xbe, 0x85, -0x70, 0xcc, 0xc0, 0xac, 0x8a, 0xba, 0x4e, 0xa3, -0x7f, 0x1c, 0x6a, 0x0f, 0x7d, 0x9a, 0xad, 0x50, -0x45, 0xd7, 0x7e, 0x63, 0xc0, 0xfe, 0xb9, 0xaa, -0x91, 0x89, 0x85, 0x35, 0x52, 0x0b, 0x9b, 0xae, -0x62, 0xe5, 0x1e, 0x9d, 0x67, 0x39, 0xdc, 0x03, -0x27, 0x5b, 0x77, 0xdf, 0x80, 0x0f, 0xcc, 0x30, -0x12, 0x49, 0x0c, 0xb3, 0xed, 0x27, 0x87, 0x9e, -0x16, 0x80, 0x8c, 0x27, 0xd7, 0xfd, 0x3b, 0x78, -0xd7, 0x55, 0x32, 0x18, 0x19, 0xa8, 0x7b, 0x15, -0x45, 0x34, 0xf4, 0x94, 0x85, 0x0a, 0x48, 0x79, -0x62, 0x1c, 0x5a, 0x7a, 0x0e, 0x2d, 0xa8, 0xdf, -0x10, 0x5a, 0x13, 0xa6, 0x24, 0xdc, 0xf8, 0x0c, -0xe6, 0x1d, 0xef, 0x84, 0x6e, 0x2a, 0xc7, 0xe5, -0xcf, 0xb1, 0xd1, 0x7a, 0x22, 0x50, 0xcd, 0x6d, -0x83, 0xb0, 0x09, 0x95, 0x4a, 0x97, 0x43, 0x42, -0x49, 0xf0, 0xcf, 0x11, 0xb7, 0x85, 0x2f, 0x74, -0x57, 0x3a, 0xb8, 0xfc, 0x06, 0xe5, 0x5d, 0x82, -0x5b, 0xb9, 0x85, 0x82, 0xdf, 0xc7, 0xd1, 0x60, -0xc2, 0x21, 0x6f, 0x92, 0x70, 0xa4, 0xe2, 0x56, -0x54, 0xbd, 0x08, 0x6e, 0x3a, 0x3c, 0xa9, 0x9b, -0xd6, 0xac, 0xd6, 0x90, 0x1d, 0xa2, 0x3d, 0x61, -0x67, 0xc6, 0x09, 0x25, 0x3c, 0x81, 0x3a, 0xcf, -0x40, 0x99, 0x42, 0x37, 0xe1, 0x51, 0xd7, 0x35, -0xb1, 0x16, 0x42, 0x3b, 0x74, 0xf5, 0x45, 0x72, -0xa7, 0xbb, 0xe7, 0xf7, 0xce, 0x98, 0xbe, 0x12, -0xdc, 0xe1, 0x7e, 0x9b, 0x36, 0xb4, 0xd3, 0xc7, -0xa5, 0xd4, 0xf5, 0x10, 0xea, 0x53, 0x77, 0x77, -0x1a, 0x8d, 0x42, 0x53, 0x00, 0x62, 0x75, 0x7c, -0xc9, 0x7d, 0xa6, 0x63, 0xfe, 0xb1, 0xa0, 0xb8, -0x1d, 0x80, 0x4c, 0x91, 0x8d, 0xac, 0x0d, 0x0b, -0x27, 0x3f, 0x86, 0xf0, 0x27, 0xee, 0x75, 0xfb, -0x79, 0x88, 0x93, 0x70, 0x93, 0xbf, 0xc8, 0x67, -0x8e, 0xe7, 0x91, 0xe7, 0x86, 0x0a, 0x96, 0xfa, -0x2e, 0x44, 0x96, 0x55, 0x10, 0xa9, 0x78, 0x02, -0x3e, 0xfa, 0xdf, 0x9e, 0x15, 0xd9, 0xd9, 0xd0, -0x42, 0x13, 0x99, 0x7d, 0x17, 0x27, 0xae, 0xbf, -0x2a, 0x49, 0xa8, 0x0c, 0xa1, 0x55, 0x74, 0x09, -0x20, 0x46, 0x71, 0xb8, 0xc7, 0xb3, 0xb3, 0xbe, -0xf3, 0x11, 0xac, 0x9b, 0x54, 0xd7, 0xa9, 0x4d, -0x5a, 0x5f, 0x85, 0x28, 0x99, 0x64, 0x93, 0xbe, -0xc0, 0xe6, 0x8a, 0x25, 0x25, 0xeb, 0x49, 0xa3, -0x4e, 0xf0, 0x6e, 0x5f, 0x29, 0xf9, 0x4f, 0xe2, -0x51, 0xf5, 0xbd, 0x30, 0xeb, 0x31, 0x00, 0x91, -0x25, 0xa1, 0xb1, 0x5d, 0xd5, 0x9a, 0xee, 0x8c, -0x56, 0xaf, 0x24, 0x58, 0x19, 0x8b, 0x8e, 0x49, -0x16, 0x85, 0xda, 0xfd, 0x72, 0xbf, 0x0b, 0x96, -0x71, 0xb2, 0xc1, 0x18, 0xb3, 0xb3, 0xc5, 0xfc, -0x41, 0x45, 0xa8, 0x28, 0x75, 0xc7, 0xe7, 0xa7, -0xef, 0x3c, 0x91, 0xe2, 0x10, 0x0b, 0x6a, 0x4e, -0x79, 0x1b, 0x8c, 0xa8, 0x43, 0x6a, 0x0d, 0x42, -0xe6, 0x7e, 0x4f, 0xc5, 0x4e, 0x1e, 0x3c, 0x17, -0x35, 0xf1, 0x8f, 0xa6, 0xa1, 0x0c, 0x6e, 0x60, -0xb9, 0x98, 0xe3, 0xc0, 0x95, 0x26, 0xcd, 0xc9, -0x8c, 0x74, 0x48, 0x75, 0x85, 0xfb, 0x03, 0xec, -0x60, 0x97, 0xac, 0x62, 0xc6, 0x1f, 0xd4, 0x7f, -0xe1, 0x2f, 0xe7, 0xf9, 0x48, 0x5c, 0x01, 0xe0, -0x04, 0x91, 0x65, 0x71, 0x9b, 0x22, 0x5c, 0xf0, -0x5e, 0xc4, 0xe9, 0x64, 0xc9, 0x94, 0x8a, 0x08, -0x39, 0x6b, 0x9b, 0x1f, 0x73, 0x4a, 0xd6, 0x79, -0xeb, 0x02, 0x37, 0x9f, 0x1a, 0x01, 0x4a, 0xce, -0x30, 0x22, 0x31, 0x33, 0x2f, 0x40, 0xca, 0x6b, -0xd9, 0xf0, 0x4f, 0xc6, 0xf6, 0x5c, 0xbe, 0x42, -0x28, 0xd6, 0xfc, 0xcf, 0x47, 0x87, 0x76, 0xe0, -0xf6, 0xe8, 0x9a, 0xe5, 0xbb, 0x49, 0x0d, 0x32, -0x3d, 0xf1, 0x54, 0x87, 0x6b, 0xd5, 0x68, 0x69, -0xb0, 0x10, 0xa2, 0x77, 0xce, 0xd7, 0x52, 0x09, -0x40, 0xdd, 0xbe, 0xc0, 0x5f, 0x40, 0xa5, 0x88, -0x78, 0xbe, 0x81, 0x50, 0x05, 0x23, 0x86, 0x46, -0x16, 0x3a, 0x34, 0x72, 0xcc, 0xfe, 0x2d, 0x6c, -0xea, 0xbd, 0x2d, 0xdd, 0xf3, 0xbe, 0xde, 0x9d, -0x7b, 0xa9, 0x0c, 0x69, 0xae, 0xc3, 0x22, 0xb7, -0xe1, 0xa1, 0xf9, 0x9b, 0x48, 0x01, 0xbc, 0xb2, -0xe7, 0x48, 0xd9, 0xbc, 0x6f, 0x1e, 0xbb, 0x8b, -0xe6, 0x41, 0x2b, 0xf4, 0xc4, 0xbd, 0x9e, 0xab, -0x08, 0x1c, 0xdc, 0x45, 0x16, 0x1f, 0xa3, 0x5c, -0x14, 0xd5, 0x50, 0xad, 0x43, 0x4a, 0x9a, 0xcc, -0x7d, 0x2b, 0xf1, 0x4f, 0x1f, 0x73, 0x22, 0x6f, -0xa0, 0x81, 0x4c, 0xaa, 0x92, 0xb2, 0x29, 0xed, -0x07, 0x52, 0xaa, 0x67, 0xc5, 0x7b, 0x2f, 0x8d, -0x3d, 0xc0, 0x86, 0x2d, 0x53, 0xab, 0x4a, 0xb2, -0x3d, 0x31, 0x2b, 0xc6, 0x21, 0x38, 0x65, 0x64, -0x92, 0x67, 0xbf, 0x0b, 0xb8, 0xa8, 0xe8, 0x63, -0x64, 0x00, 0xcd, 0xa5, 0xfe, 0x05 }; - -static char pkt8[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0xec, 0x2c, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x32, 0x00, -0x04, 0xd0, 0x00, 0x00, 0x00, 0x01, 0x98, 0xc5, -0x22, 0x1f, 0x25, 0x30, 0x44, 0xb8, 0x34, 0x12, -0x59, 0x5a, 0xd4, 0xc1, 0x22, 0x39, 0xf8, 0x37, -0x52, 0xc9, 0x92, 0xae, 0x84, 0xef, 0x84, 0xb4, -0x7b, 0x98, 0x1b, 0x19, 0x8e, 0x0f, 0x0d, 0xda, -0xec, 0xf9, 0xef, 0x0a, 0xc0, 0xb7, 0x86, 0xeb, -0xc3, 0x85, 0xe0, 0x46, 0xbd, 0xc7, 0xdd, 0x3f, -0xd8, 0x38, 0xa9, 0x30, 0x9b, 0x67, 0xde, 0xb3, -0x25, 0x65, 0xf3, 0xf6, 0x7e, 0xb6, 0x02, 0x0e, -0xbc, 0xe1, 0x23, 0xc1, 0x24, 0x08, 0x22, 0x4b, -0x5e, 0x60, 0x7b, 0xb7, 0xf0, 0x3d, 0x75, 0x50, -0xf7, 0x5f, 0xf2, 0xba, 0x79, 0x43, 0xc3, 0x5f, -0xdb, 0x2f, 0x0c, 0xb9, 0xfd, 0x30, 0x82, 0x8a, -0x72, 0x3f, 0x3c, 0xd4, 0x54, 0xe7, 0xe9, 0xf4, -0x86, 0x3d, 0x02, 0x18, 0xf6, 0x3f, 0x18, 0x8a, -0xf8, 0x8c, 0xb7, 0x7a, 0x08, 0x1d, 0x26, 0x25, -0x5f, 0x85, 0x01, 0xe3, 0x85, 0x33, 0x5d, 0x52, -0xcd, 0x13, 0x22, 0xdd, 0x66, 0x46, 0xee, 0x95, -0xea, 0xea, 0x65, 0x8f, 0xdc, 0x68, 0x14, 0x80, -0x90, 0xa4, 0x3d, 0x32, 0x63, 0xfa, 0x42, 0xcd, -0x3b, 0xb0, 0x21, 0xa9, 0x2d, 0x95, 0xda, 0x43, -0x51, 0xa5, 0x84, 0x3b, 0xb7, 0x72, 0x06, 0xd7, -0xd8, 0xbe, 0xe1, 0xb5, 0xa5, 0xbb, 0x16, 0xee, -0xd3, 0x8f, 0xe1, 0xa8, 0x24, 0xde, 0x5f, 0x2a, -0x91, 0x9a, 0x42, 0xe7, 0x5a, 0xd2, 0x2e, 0x97, -0xe2, 0x07, 0xb6, 0x58, 0x8e, 0xb8, 0x8c, 0xf1, -0xbf, 0x1e, 0xc6, 0x3c, 0x48, 0x5f, 0x29, 0x18, -0x00, 0xdc, 0xee, 0xe9, 0xc3, 0x59, 0x15, 0x1e, -0x87, 0xeb, 0xb2, 0xea, 0x08, 0x93, 0xe3, 0x0a, -0x93, 0xe5 }; - -#if 0 -static char pkt9[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, -0x00, 0x00, 0x00, 0xff, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x05, 0xb4, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb7, -0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0x2d, 0x70, -0xb4, 0x11, 0x1a, 0xcc, 0xf6, 0x93, 0x87, 0xd3, -0xf9, 0xc1, 0x42, 0x7c, 0x05, 0x1d, 0xc4, 0x74, -0x12, 0x77, 0x02, 0xa0, 0xce, 0x81, 0x7d, 0x32, -0xe4, 0x9c, 0x0d, 0x01, 0xbd, 0xd5, 0x5c, 0x1c, -0x01, 0x65, 0x6b, 0x34, 0x38, 0xb3, 0x71, 0x41, -0xed, 0x4d, 0x4a, 0xa7, 0xc8, 0xb3, 0x9a, 0x77, -0xd8, 0xc2, 0x84, 0x14, 0x68, 0x8e, 0xbf, 0x94, -0xda, 0xe3, 0xc0, 0x70, 0x56, 0x69, 0x3a, 0x65, -0x58, 0xae, 0x9d, 0xcd, 0x00, 0x45, 0x20, 0xf2, -0x59, 0xb0, 0x6c, 0x76, 0x16, 0xa2, 0x22, 0xde, -0xfc, 0x06, 0xe0, 0xf4, 0x52, 0x8d, 0x93, 0xe1, -0xd4, 0x92, 0x0c, 0x05, 0xf9, 0xfb, 0x52, 0xfb, -0xa8, 0xcf, 0xb1, 0x86, 0xdc, 0xe8, 0x07, 0x95, -0xfa, 0x1c, 0x38, 0xb9, 0xd0, 0x7a, 0x65, 0xe0, -0x36, 0xe1, 0x2f, 0xa8, 0x3a, 0xbf, 0xc7, 0xb7, -0x3e, 0xc4, 0xd5, 0x48, 0xfb, 0x6d, 0x40, 0xa2, -0xb5, 0xe2, 0xe7, 0x3a, 0x42, 0x7c, 0x1c, 0xc5, -0x36, 0xbc, 0x29, 0xca, 0x78, 0xf9, 0x36, 0xba, -0xf4, 0xb6, 0x8e, 0xe7, 0x74, 0xc7, 0xc9, 0x8a, -0x74, 0x2d, 0xfc, 0x66, 0x8d, 0x31, 0x62, 0x15, -0x59, 0x00, 0xbb, 0x53, 0xd3, 0x4b, 0xad, 0x8a, -0x97, 0x00, 0xf7, 0x90, 0xdd, 0x7a, 0xf2, 0xde, -0x02, 0x82, 0x75, 0xe8, 0xae, 0x82, 0x18, 0x14, -0xc2, 0xc3, 0x03, 0x27, 0x93, 0x0f, 0x2b, 0xc6, -0xb1, 0xd0, 0x8b, 0xae, 0x28, 0xbb, 0x3f, 0xb5, -0x47, 0x42, 0xc6, 0x73, 0x3a, 0xb2, 0xd8, 0x8f, -0x21, 0xde, 0x10, 0xb4, 0x5a, 0x8b, 0x54, 0x3d, -0x24, 0xc7, 0x8b, 0xbf, 0x0d, 0xc5, 0x81, 0x52, -0x1d, 0x21, 0x09, 0x61, 0xcc, 0x88, 0x2a, 0x6d, -0xe5, 0x45, 0xc7, 0x17, 0x94, 0x27, 0x18, 0x9b, -0x04, 0xea, 0xa5, 0x9b, 0x97, 0x79, 0xf9, 0x61, -0xe3, 0xc4, 0x5e, 0x31, 0x50, 0x06, 0x02, 0x43, -0x7c, 0x85, 0xf6, 0x4c, 0xc5, 0x10, 0x6d, 0x0f, -0xb3, 0x5e, 0x97, 0x01, 0x9f, 0x77, 0x5d, 0xcc, -0x68, 0x49, 0xae, 0xaa, 0x52, 0xcc, 0x6d, 0x81, -0xa9, 0x90, 0x81, 0x10, 0x09, 0x3f, 0xdd, 0x5c, -0x61, 0xcc, 0xc3, 0xc0, 0xc8, 0xc4, 0x5c, 0x0a, -0xb0, 0x63, 0x5b, 0xb0, 0xf4, 0xa1, 0x64, 0x4e, -0xd6, 0xc6, 0x81, 0xb2, 0x75, 0xc2, 0x7d, 0xaa, -0x01, 0xae, 0xe0, 0xf0, 0x4e, 0x62, 0x40, 0xb4, -0x13, 0xf1, 0xa7, 0x66, 0xef, 0xd4, 0xf1, 0xf1, -0xa9, 0x60, 0xce, 0x18, 0x6c, 0xb3, 0x36, 0xa6, -0x12, 0xed, 0xb6, 0x20, 0xca, 0x0b, 0x84, 0xde, -0xbc, 0xcb, 0x3c, 0x38, 0x6d, 0x03, 0xc8, 0xd0, -0xe1, 0x25, 0xc0, 0x49, 0x1d, 0x11, 0x7b, 0x41, -0x2a, 0x5d, 0x07, 0x74, 0x7d, 0x52, 0x5a, 0x53, -0xf6, 0xa7, 0xd7, 0xc0, 0xaa, 0x72, 0x4c, 0xcc, -0x62, 0x6b, 0x5e, 0xf6, 0x1d, 0xd1, 0xb9, 0x93, -0x01, 0x77, 0x0d, 0xa9, 0x48, 0xfb, 0x32, 0x30, -0x4c, 0x35, 0x74, 0x0d, 0x62, 0xfe, 0xea, 0xe6, -0x17, 0x76, 0x80, 0x55, 0x8f, 0xcd, 0x16, 0xe6, -0x0f, 0xaa, 0xf8, 0xc0, 0x6a, 0x8b, 0xe8, 0xa8, -0x21, 0x89, 0x58, 0xda, 0x4c, 0xcb, 0x70, 0x50, -0x6d, 0x3f, 0x5e, 0x4e, 0xcf, 0x7c, 0x0a, 0x04, -0xf9, 0x79, 0x77, 0xd3, 0x54, 0xaa, 0x92, 0xbe, -0x49, 0x1a, 0x23, 0x60, 0x1e, 0x4c, 0x06, 0xa4, -0xbb, 0x3d, 0xd1, 0x7c, 0xcd, 0xf3, 0xf6, 0x61, -0x4a, 0xee, 0x2b, 0x44, 0x77, 0x93, 0xe4, 0xe8, -0x5c, 0x80, 0x43, 0x09, 0x22, 0x95, 0x27, 0x60, -0xb2, 0x45, 0xf6, 0xfc, 0x2f, 0xd2, 0xf5, 0xfa, -0x0b, 0xdd, 0x00, 0x09, 0xb0, 0x63, 0xf4, 0x27, -0x23, 0x51, 0x88, 0x6e, 0x4b, 0x59, 0x20, 0x18, -0x97, 0x3e, 0xc8, 0xd1, 0x3f, 0x8a, 0xd1, 0xb5, -0xa4, 0xc5, 0x23, 0xcf, 0x08, 0xe9, 0x28, 0xf0, -0xfc, 0xff, 0x89, 0xcb, 0x8e, 0xc7, 0xcf, 0xf5, -0x8e, 0x82, 0x4e, 0xc3, 0x61, 0xf6, 0x20, 0x25, -0x9d, 0xd5, 0xd6, 0x19, 0xc9, 0x55, 0x88, 0x64, -0xd2, 0x97, 0xcd, 0x6c, 0x73, 0x53, 0x44, 0xa2, -0x44, 0xc4, 0x65, 0x16, 0x8e, 0x33, 0xbe, 0x85, -0x70, 0xcc, 0xc0, 0xac, 0x8a, 0xba, 0x4e, 0xa3, -0x7f, 0x1c, 0x6a, 0x0f, 0x7d, 0x9a, 0xad, 0x50, -0x45, 0xd7, 0x7e, 0x63, 0xc0, 0xfe, 0xb9, 0xaa, -0x91, 0x89, 0x85, 0x35, 0x52, 0x0b, 0x9b, 0xae, -0x62, 0xe5, 0x1e, 0x9d, 0x67, 0x39, 0xdc, 0x03, -0x27, 0x5b, 0x77, 0xdf, 0x80, 0x0f, 0xcc, 0x30, -0x12, 0x49, 0x0c, 0xb3, 0xed, 0x27, 0x87, 0x9e, -0x16, 0x80, 0x8c, 0x27, 0xd7, 0xfd, 0x3b, 0x78, -0xd7, 0x55, 0x32, 0x18, 0x19, 0xa8, 0x7b, 0x15, -0x45, 0x34, 0xf4, 0x94, 0x85, 0x0a, 0x48, 0x79, -0x62, 0x1c, 0x5a, 0x7a, 0x0e, 0x2d, 0xa8, 0xdf, -0x10, 0x5a, 0x13, 0xa6, 0x24, 0xdc, 0xf8, 0x0c, -0xe6, 0x1d, 0xef, 0x84, 0x6e, 0x2a, 0xc7, 0xe5, -0xcf, 0xb1, 0xd1, 0x7a, 0x22, 0x50, 0xcd, 0x6d, -0x83, 0xb0, 0x09, 0x95, 0x4a, 0x97, 0x43, 0x42, -0x49, 0xf0, 0xcf, 0x11, 0xb7, 0x85, 0x2f, 0x74, -0x57, 0x3a, 0xb8, 0xfc, 0x06, 0xe5, 0x5d, 0x82, -0x5b, 0xb9, 0x85, 0x82, 0xdf, 0xc7, 0xd1, 0x60, -0xc2, 0x21, 0x6f, 0x92, 0x70, 0xa4, 0xe2, 0x56, -0x54, 0xbd, 0x08, 0x6e, 0x3a, 0x3c, 0xa9, 0x9b, -0xd6, 0xac, 0xd6, 0x90, 0x1d, 0xa2, 0x3d, 0x61, -0x67, 0xc6, 0x09, 0x25, 0x3c, 0x81, 0x3a, 0xcf, -0x40, 0x99, 0x42, 0x37, 0xe1, 0x51, 0xd7, 0x35, -0xb1, 0x16, 0x42, 0x3b, 0x74, 0xf5, 0x45, 0x72, -0xa7, 0xbb, 0xe7, 0xf7, 0xce, 0x98, 0xbe, 0x12, -0xdc, 0xe1, 0x7e, 0x9b, 0x36, 0xb4, 0xd3, 0xc7, -0xa5, 0xd4, 0xf5, 0x10, 0xea, 0x53, 0x77, 0x77, -0x1a, 0x8d, 0x42, 0x53, 0x00, 0x62, 0x75, 0x7c, -0xc9, 0x7d, 0xa6, 0x63, 0xfe, 0xb1, 0xa0, 0xb8, -0x1d, 0x80, 0x4c, 0x91, 0x8d, 0xac, 0x0d, 0x0b, -0x27, 0x3f, 0x86, 0xf0, 0x27, 0xee, 0x75, 0xfb, -0x79, 0x88, 0x93, 0x70, 0x93, 0xbf, 0xc8, 0x67, -0x8e, 0xe7, 0x91, 0xe7, 0x86, 0x0a, 0x96, 0xfa, -0x2e, 0x44, 0x96, 0x55, 0x10, 0xa9, 0x78, 0x02, -0x3e, 0xfa, 0xdf, 0x9e, 0x15, 0xd9, 0xd9, 0xd0, -0x42, 0x13, 0x99, 0x7d, 0x17, 0x27, 0xae, 0xbf, -0x2a, 0x49, 0xa8, 0x0c, 0xa1, 0x55, 0x74, 0x09, -0x20, 0x46, 0x71, 0xb8, 0xc7, 0xb3, 0xb3, 0xbe, -0xf3, 0x11, 0xac, 0x9b, 0x54, 0xd7, 0xa9, 0x4d, -0x5a, 0x5f, 0x85, 0x28, 0x99, 0x64, 0x93, 0xbe, -0xc0, 0xe6, 0x8a, 0x25, 0x25, 0xeb, 0x49, 0xa3, -0x4e, 0xf0, 0x6e, 0x5f, 0x29, 0xf9, 0x4f, 0xe2, -0x51, 0xf5, 0xbd, 0x30, 0xeb, 0x31, 0x00, 0x91, -0x25, 0xa1, 0xb1, 0x5d, 0xd5, 0x9a, 0xee, 0x8c, -0x56, 0xaf, 0x24, 0x58, 0x19, 0x8b, 0x8e, 0x49, -0x16, 0x85, 0xda, 0xfd, 0x72, 0xbf, 0x0b, 0x96, -0x71, 0xb2, 0xc1, 0x18, 0xb3, 0xb3, 0xc5, 0xfc, -0x41, 0x45, 0xa8, 0x28, 0x75, 0xc7, 0xe7, 0xa7, -0xef, 0x3c, 0x91, 0xe2, 0x10, 0x0b, 0x6a, 0x4e, -0x79, 0x1b, 0x8c, 0xa8, 0x43, 0x6a, 0x0d, 0x42, -0xe6, 0x7e, 0x4f, 0xc5, 0x4e, 0x1e, 0x3c, 0x17, -0x35, 0xf1, 0x8f, 0xa6, 0xa1, 0x0c, 0x6e, 0x60, -0xb9, 0x98, 0xe3, 0xc0, 0x95, 0x26, 0xcd, 0xc9, -0x8c, 0x74, 0x48, 0x75, 0x85, 0xfb, 0x03, 0xec, -0x60, 0x97, 0xac, 0x62, 0xc6, 0x1f, 0xd4, 0x7f, -0xe1, 0x2f, 0xe7, 0xf9, 0x48, 0x5c, 0x01, 0xe0, -0x04, 0x91, 0x65, 0x71, 0x9b, 0x22, 0x5c, 0xf0, -0x5e, 0xc4, 0xe9, 0x64, 0xc9, 0x94, 0x8a, 0x08, -0x39, 0x6b, 0x9b, 0x1f, 0x73, 0x4a, 0xd6, 0x79, -0xeb, 0x02, 0x37, 0x9f, 0x1a, 0x01, 0x4a, 0xce, -0x30, 0x22, 0x31, 0x33, 0x2f, 0x40, 0xca, 0x6b, -0xd9, 0xf0, 0x4f, 0xc6, 0xf6, 0x5c, 0xbe, 0x42, -0x28, 0xd6, 0xfc, 0xcf, 0x47, 0x87, 0x76, 0xe0, -0xf6, 0xe8, 0x9a, 0xe5, 0xbb, 0x49, 0x0d, 0x32, -0x3d, 0xf1, 0x54, 0x87, 0x6b, 0xd5, 0x68, 0x69, -0xb0, 0x10, 0xa2, 0x77, 0xce, 0xd7, 0x52, 0x09, -0x40, 0xdd, 0xbe, 0xc0, 0x5f, 0x40, 0xa5, 0x88, -0x78, 0xbe, 0x81, 0x50, 0x05, 0x23, 0x86, 0x46, -0x16, 0x3a, 0x34, 0x72, 0xcc, 0xfe, 0x2d, 0x6c, -0xea, 0xbd, 0x2d, 0xdd, 0xf3, 0xbe, 0xde, 0x9d, -0x7b, 0xa9, 0x0c, 0x69, 0xae, 0xc3, 0x22, 0xb7, -0xe1, 0xa1, 0xf9, 0x9b, 0x48, 0x01, 0xbc, 0xb2, -0xe7, 0x48, 0xd9, 0xbc, 0x6f, 0x1e, 0xbb, 0x8b, -0xe6, 0x41, 0x2b, 0xf4, 0xc4, 0xbd, 0x9e, 0xab, -0x08, 0x1c, 0xdc, 0x45, 0x16, 0x1f, 0xa3, 0x5c, -0x14, 0xd5, 0x50, 0xad, 0x43, 0x4a, 0x9a, 0xcc, -0x7d, 0x2b, 0xf1, 0x4f, 0x1f, 0x73, 0x22, 0x6f, -0xa0, 0x81, 0x4c, 0xaa, 0x92, 0xb2, 0x29, 0xed, -0x07, 0x52, 0xaa, 0x67, 0xc5, 0x7b, 0x2f, 0x8d, -0x3d, 0xc0, 0x86, 0x2d, 0x53, 0xab, 0x4a, 0xb2, -0x3d, 0x31, 0x2b, 0xc6, 0x21, 0x38, 0x65, 0x64, -0x92, 0x67, 0xbf, 0x0b, 0xb8, 0xa8, 0xe8, 0x63, -0x64, 0x00, 0xcd, 0xa5, 0xfe, 0x05, 0x98, 0xc5, -0x22, 0x1f, 0x25, 0x30, 0x44, 0xb8, 0x34, 0x12, -0x59, 0x5a, 0xd4, 0xc1, 0x22, 0x39, 0xf8, 0x37, -0x52, 0xc9, 0x92, 0xae, 0x84, 0xef, 0x84, 0xb4, -0x7b, 0x98, 0x1b, 0x19, 0x8e, 0x0f, 0x0d, 0xda, -0xec, 0xf9, 0xef, 0x0a, 0xc0, 0xb7, 0x86, 0xeb, -0xc3, 0x85, 0xe0, 0x46, 0xbd, 0xc7, 0xdd, 0x3f, -0xd8, 0x38, 0xa9, 0x30, 0x9b, 0x67, 0xde, 0xb3, -0x25, 0x65, 0xf3, 0xf6, 0x7e, 0xb6, 0x02, 0x0e, -0xbc, 0xe1, 0x23, 0xc1, 0x24, 0x08, 0x22, 0x4b, -0x5e, 0x60, 0x7b, 0xb7, 0xf0, 0x3d, 0x75, 0x50, -0xf7, 0x5f, 0xf2, 0xba, 0x79, 0x43, 0xc3, 0x5f, -0xdb, 0x2f, 0x0c, 0xb9, 0xfd, 0x30, 0x82, 0x8a, -0x72, 0x3f, 0x3c, 0xd4, 0x54, 0xe7, 0xe9, 0xf4, -0x86, 0x3d, 0x02, 0x18, 0xf6, 0x3f, 0x18, 0x8a, -0xf8, 0x8c, 0xb7, 0x7a, 0x08, 0x1d, 0x26, 0x25, -0x5f, 0x85, 0x01, 0xe3, 0x85, 0x33, 0x5d, 0x52, -0xcd, 0x13, 0x22, 0xdd, 0x66, 0x46, 0xee, 0x95, -0xea, 0xea, 0x65, 0x8f, 0xdc, 0x68, 0x14, 0x80, -0x90, 0xa4, 0x3d, 0x32, 0x63, 0xfa, 0x42, 0xcd, -0x3b, 0xb0, 0x21, 0xa9, 0x2d, 0x95, 0xda, 0x43, -0x51, 0xa5, 0x84, 0x3b, 0xb7, 0x72, 0x06, 0xd7, -0xd8, 0xbe, 0xe1, 0xb5, 0xa5, 0xbb, 0x16, 0xee, -0xd3, 0x8f, 0xe1, 0xa8, 0x24, 0xde, 0x5f, 0x2a, -0x91, 0x9a, 0x42, 0xe7, 0x5a, 0xd2, 0x2e, 0x97, -0xe2, 0x07, 0xb6, 0x58, 0x8e, 0xb8, 0x8c, 0xf1, -0xbf, 0x1e, 0xc6, 0x3c, 0x48, 0x5f, 0x29, 0x18, -0x00, 0xdc, 0xee, 0xe9, 0xc3, 0x59, 0x15, 0x1e, -0x87, 0xeb, 0xb2, 0xea, 0x08, 0x93, 0xe3, 0x0a, -0x93, 0xe5 }; - -static char pkt10[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt11[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt12[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0xd0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt13[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x10, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x85, 0x00, -0xad, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt14[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, -0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, -0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, -0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, -0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static char pkt15[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; - -static char pkt16[] = { -0x33, 0x33, 0xff, 0x33, 0x44, 0x56, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3a, 0xff, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x33, 0x44, 0x56, 0x87, 0x00, -0x89, 0x85, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56 }; -#endif - -TAHI_TEST_SEQ tahi_ipsec_udp_005[] = { - {TITLE, "IPSEC-UDP-005", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, - {ASSEMBLE, &pkt7[0], sizeof(pkt7), 3, 0, 0, 0, 0}, - {AD_CHECK, &pkt8[0], sizeof(pkt8), 5, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_005_size = sizeof(tahi_ipsec_udp_005) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_006.c b/test/regression/tahi_test/tahi_ipsec_udp_006.c deleted file mode 100644 index 47ee451f..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_006.c +++ /dev/null @@ -1,180 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt0[] = { -0x33, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x38, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x00, -0xb5, 0x77, 0x40, 0x00, 0x2a, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, -0x00, 0x00, 0x00, 0x00, 0x05, 0xdc, 0x03, 0x04, -0x40, 0xc0, 0x00, 0x27, 0x8d, 0x00, 0x00, 0x09, -0x3a, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x33, 0x33, 0xff, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xff, 0x02, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0xff, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; - -static char pkt3[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt4[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2d, 0xf4, -0x51, 0x58, 0xcf, 0x8c, 0xb1, 0x40, 0xae, 0xa2, -0x6e, 0x32, 0xe2, 0x9d, 0x35, 0x7a, 0xcd, 0xbb, -0x07, 0xba, 0xa0, 0xb0, 0x5d, 0xfd, 0x09, 0xce, -0xce, 0x57, 0xac, 0x4f, 0xfa, 0x22, 0xb1, 0x3f, -0x54, 0x43, 0x45, 0xd3, 0xa9, 0x96, 0x9a, 0xde, -0x15, 0x06, 0x9a, 0x2e, 0xc4, 0x4c, 0xc8, 0x69, -0x14, 0x3c }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x24, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x96, -0xac, 0x2e, 0xb1, 0xb3, 0xdc, 0x8c, 0xfd, 0x67, -0xc6, 0xca, 0xcf, 0xcd, 0x5a, 0x0b, 0xfe, 0x0e, -0x0e, 0x7c }; - -static char pkt6[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x0c, 0x4e, -0x1f, 0x6e, 0xae, 0xd5, 0xff, 0xa7, 0x6a, 0x83, -0xda, 0x78 }; - -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0xf6, -0xb5, 0x4b, 0x29, 0x31, 0x03, 0x47, 0xad, 0x1e, -0x61, 0xe3, 0x78, 0x5a, 0x39, 0xc6, 0xb9, 0x02, -0x9a, 0x45, 0x32, 0xc8, 0xe2, 0x5f, 0xab, 0x47, -0xe7, 0x43, 0xbb, 0xc6, 0x9d, 0xb2, 0x97, 0x5c, -0xe4, 0xcb, 0x7b, 0xbf, 0x65, 0x12, 0x13, 0xcf, -0xc0, 0x02, 0x1e, 0x35, 0x9d, 0x5f, 0x73, 0x20, -0xf1, 0x87 }; - -#if 0 -static char pkt8[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt9[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_006[] = { - {TITLE, "IPSEC-UDP-006", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt0[0], sizeof(pkt0), 0, 0, 0, 0, 0}, /* Add a RA packet.*/ - {WAIT, NX_NULL, 0, 10, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {CHECK, &pkt2[0], sizeof(pkt2), 3, 0, 0, 0, 0}, - {INJECT, &pkt3[0], sizeof(pkt3), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt4[0], sizeof(pkt4), 3, NX_NULL, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - - {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, - {INJECT, &pkt9[0], sizeof(pkt9), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt7[0], sizeof(pkt7), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_006_size = sizeof(tahi_ipsec_udp_006) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_007.c b/test/regression/tahi_test/tahi_ipsec_udp_007.c deleted file mode 100644 index d7890ea8..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_007.c +++ /dev/null @@ -1,135 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x5b, -0x70, 0x30, 0xb4, 0x5d, 0xfd, 0x20, 0xc8, 0xc5, -0x80, 0x58, 0xa2, 0x96, 0xa5, 0xe3, 0x66, 0x3d, -0xca, 0xcf, 0xea, 0xac, 0x15, 0x46, 0x7e, 0x29, -0x12, 0x6f, 0x2b, 0x99, 0xa3, 0x5e, 0x79, 0x1e, -0xa1, 0xd9, 0x34, 0x3b, 0x7d, 0x5b, 0xd7, 0x61, -0x6b, 0xe2, 0xb1, 0xb5, 0xaa, 0x80, 0xf5, 0xa7, -0x44, 0x80 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x23, -0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xb7, 0x6e, -0xae, 0xf1, 0xe4, 0xb0, 0x56, 0xd6, 0x3a, 0x9e, -0x0b, 0xb4, 0xd2, 0x0b, 0xe0, 0x1f, 0x54, 0x9d, -0x15, 0x82, 0x22, 0xa1, 0xe7, 0xa8, 0x0d, 0x5e, -0x9d, 0x9a }; - -static char pkt6[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x0c, 0x4e, -0x1f, 0x6e, 0xae, 0xd5, 0xff, 0xa7, 0x6a, 0x83, -0xda, 0x78 }; - -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x78, 0x7f, -0x8b, 0x1a, 0xd8, 0x59, 0x29, 0x50, 0x61, 0x10, -0x51, 0x54, 0x2f, 0xdb, 0xdb, 0x75, 0xed, 0xb4, -0xde, 0xda, 0xe4, 0xce, 0x9f, 0xf0, 0x33, 0x12, -0xbd, 0x90, 0xea, 0xff, 0xfd, 0xf4, 0x43, 0x98, -0x96, 0x50, 0x4e, 0x9c, 0xec, 0x2b, 0x3d, 0xfc, -0xc7, 0xb9, 0x3a, 0x50, 0xc5, 0x27, 0x70, 0x80, -0x23, 0x08 }; - -TAHI_TEST_SEQ tahi_ipsec_udp_007[] = { - {TITLE, "IPSEC-UDP-007", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt6[0], sizeof(pkt6), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt7[0], sizeof(pkt7), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_007_size = sizeof(tahi_ipsec_udp_007) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_008.c b/test/regression/tahi_test/tahi_ipsec_udp_008.c deleted file mode 100644 index 426edf6d..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_008.c +++ /dev/null @@ -1,139 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0x68, 0x48, -0x89, 0x2b, 0xa7, 0x56, 0x03, 0x6c, 0x35, 0xc6, -0xea, 0x63, 0x2c, 0x9b, 0x34, 0x06, 0xe1, 0x59, -0x18, 0xf1, 0x13, 0x15, 0x01, 0x10, 0x7d, 0x29, -0xec, 0x5f, 0x78, 0x81, 0x35, 0x21, 0x14, 0x49, -0x25, 0x1c, 0x95, 0x92, 0xc6, 0x5c, 0x93, 0xac, -0xe6, 0x77, 0x54, 0x89, 0x47, 0xea, 0x72, 0x2c, -0xe4, 0x39 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x27, 0x10, -0x00, 0x07, 0x00, 0x16, 0x6c, 0x95, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, -0x27, 0x10, 0x00, 0x16, 0x6c, 0x95, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -#if 0 -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt8[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_008[] = { - {TITLE, "IPSEC-UDP-008", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA first. */ - {CHECK, &pkt6[0], sizeof(pkt6), 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_008_size = sizeof(tahi_ipsec_udp_008) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_009.c b/test/regression/tahi_test/tahi_ipsec_udp_009.c deleted file mode 100644 index c0d60519..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_009.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0xff, 0xb7, -0xcd, 0x08, 0x3f, 0xd4, 0x77, 0x34, 0x4a, 0xdf, -0xa2, 0xe5, 0x8c, 0xe9, 0x3d, 0xe5, 0xed, 0xb6, -0x47, 0x2a, 0x4d, 0x19, 0x25, 0xf4, 0x84, 0x05, -0x37, 0xbf, 0xdd, 0x99, 0xd0, 0xc1, 0x1a, 0x27, -0x32, 0xbe, 0x52, 0x9f, 0xc7, 0xef, 0x52, 0x9c, -0xda, 0x65, 0x00, 0x29, 0x37, 0x8c, 0x28, 0xd0, -0xe4, 0x58 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_009[] = { - {TITLE, "IPSEC-UDP-009", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_009_size = sizeof(tahi_ipsec_udp_009) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_009_02.c b/test/regression/tahi_test/tahi_ipsec_udp_009_02.c deleted file mode 100644 index 94f81ca4..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_009_02.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x16, 0x11, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x27, 0x10, -0x00, 0x07, 0x00, 0x16, 0x6c, 0x95, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_009_02[] = { - {TITLE, "IPSEC-UDP-009-02", 16, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_009_02_size = sizeof(tahi_ipsec_udp_009_02) / sizeof(TAHI_TEST_SEQ); - -#endif \ No newline at end of file diff --git a/test/regression/tahi_test/tahi_ipsec_udp_010.c b/test/regression/tahi_test/tahi_ipsec_udp_010.c deleted file mode 100644 index 06c7b0a8..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_010.c +++ /dev/null @@ -1,148 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -0x1e, 0xa8, 0xa2, 0xda, 0x5b, 0x09, 0x5d, 0x65, -0x4b, 0xe8, 0x7e, 0x24, 0xc9, 0x6d, 0x2a, 0x7b, -0xe5, 0xa2, 0xe6, 0x23, 0x77, 0xad, 0xd1, 0xda, -0xe9, 0xe9, 0x76, 0xdf, 0x7f, 0x4c, 0x1d, 0x36, -0x95, 0xb2 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2b, 0xa5, -0xa3, 0x70, 0xf1, 0xba, 0xe4, 0x28, 0x8c, 0x86, -0x2a, 0x1b, 0x7a, 0xa0, 0x10, 0xdf, 0xd4, 0x91, -0x08, 0xa4, 0x67, 0x23, 0xb6, 0x63, 0xc3, 0x31, -0xa7, 0x1f, 0x30, 0x82, 0xf6, 0xe5, 0xf7, 0x8c, -0x22, 0xad, 0x3b, 0xff, 0x36, 0xc8, 0x3a, 0x12, -0xc8, 0xd5 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x01, 0x2c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, -0x1e, 0xa8, 0xa2, 0xda, 0x5b, 0x09, 0x5d, 0x65, -0x4b, 0xe8, 0x7e, 0x24, 0xc9, 0x6d, 0x53, 0xb5, -0x2e, 0xdb, 0x11, 0x85, 0xb3, 0x4a, 0x30, 0xfa, -0x7e, 0x7f, 0x68, 0x4d, 0xa5, 0xe5, 0x3d, 0xe7, -0xaf, 0x1f, 0x9c, 0x8f, 0x14, 0x2a, 0xd2, 0x47, -0xee, 0x7f, 0xca, 0xf0, 0x9c, 0xe4, 0x40, 0x3c, -0xae, 0x44, 0x8c, 0x0d, 0xf1, 0x4e, 0xbd, 0x6b, -0xa7, 0x33, 0x62, 0x69, 0xb6, 0xbf, 0xf2, 0xc1, -0xed, 0xac, 0x38, 0xb0, 0x91, 0x0e, 0xee, 0x12, -0xc8, 0x60, 0x8f, 0x00, 0x4d, 0x66, 0xbb, 0xe4, -0x4c, 0x5d, 0x8c, 0x0b, 0xc3, 0x51, 0x4a, 0x37, -0x30, 0xab, 0xe1, 0x1d, 0x06, 0x30, 0x50, 0xff, -0x98, 0x91, 0xd5, 0xe4, 0x7b, 0x2e, 0xac, 0xd0, -0x65, 0xfa, 0xcb, 0xee, 0xc1, 0x78, 0x46, 0xf2, -0x23, 0xf2, 0x58, 0x72, 0x00, 0xe2, 0x6b, 0xc9, -0xad, 0x67, 0x85, 0x4b, 0x07, 0x21, 0x4b, 0xf1, -0x33, 0xb5, 0x89, 0x5c, 0x44, 0x8c, 0xf0, 0x65, -0x6b, 0xc2, 0x7b, 0xe8, 0xc6, 0x8a, 0xa0, 0x36, -0xd1, 0x46, 0x00, 0xae, 0xa6, 0x24, 0x78, 0xa2, -0xea, 0x2f, 0x4d, 0xbb, 0xaa, 0x76, 0x56, 0x4f, -0x38, 0x6e, 0x95, 0xa6, 0xae, 0x97, 0xe7, 0x8b, -0xcc, 0x78, 0x03, 0x41, 0x09, 0x1a, 0x43, 0x12, -0xf7, 0xaa, 0xfd, 0x2b, 0x20, 0xa9, 0x5e, 0x02, -0x9d, 0xc7, 0xd2, 0xc4, 0x71, 0x49, 0x95, 0x48, -0x04, 0xf4, 0x02, 0x44, 0x86, 0xe0, 0xe5, 0xd7, -0x1c, 0x51, 0x68, 0x0d, 0x55, 0xab, 0x81, 0xcf, -0x55, 0x41, 0xb1, 0x2e, 0x09, 0x28, 0xf9, 0x89, -0x6b, 0x44, 0xf7, 0x89, 0x65, 0x63, 0x93, 0x7b, -0xd2, 0xee, 0x84, 0xcd, 0xee, 0x9f, 0x11, 0xe5, -0xa8, 0x21, 0x56, 0xf2, 0xf1, 0x69, 0xf4, 0xfa, -0x37, 0xc9, 0x95, 0x27, 0xcf, 0x47, 0x12, 0xb4, -0xda, 0x3f, 0x7e, 0xdd, 0xaf, 0x04, 0xb2, 0xb3, -0x3d, 0x7c, 0x05, 0xe2, 0x6c, 0x52, 0xf2, 0xf2, -0x92, 0x39, 0x92, 0x0f, 0x54, 0x10, 0x63, 0x4d, -0xea, 0x35, 0x07, 0x94, 0x4d, 0x32, 0xbd, 0x21, -0xb1, 0x27 }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x41, -0x83, 0x7d, 0xd9, 0x6f, 0xe1, 0x0a, 0xf5, 0xa3, -0xf7, 0xb6, 0xef, 0x50, 0x8d, 0xde, 0xfa, 0x51, -0xb3, 0xf6, 0x36, 0x2d, 0x9e, 0xf6, 0xd5, 0x96, -0x1a, 0x9a, 0xd8, 0x35, 0xd4, 0x87, 0x05, 0x28, -0xa8, 0x90, 0x01, 0x92, 0x23, 0xeb, 0xa1, 0x2e, -0x72, 0x6d }; - -TAHI_TEST_SEQ tahi_ipsec_udp_010[] = { - {TITLE, "IPSEC-UDP-010", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_010_size = sizeof(tahi_ipsec_udp_010) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_011.c b/test/regression/tahi_test/tahi_ipsec_udp_011.c deleted file mode 100644 index c163c1fe..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_011.c +++ /dev/null @@ -1,83 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x23, -0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x86, 0x9b, -0x37, 0xbd, 0xb8, 0x0e, 0x84, 0xed, 0x35, 0x21, -0x00, 0x71, 0xc8, 0x9b, 0xbc, 0xed, 0x88, 0x36, -0x5f, 0x47, 0x7f, 0x71, 0xcf, 0xdc, 0x81, 0x47, -0xcf, 0xd0, 0x74, 0xbe, 0x55, 0x19, 0x1a, 0x90, -0xf2, 0xd6, 0x58, 0x9d, 0x93, 0xab, 0x34, 0x89, -0xf3, 0x79 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7a, 0x2f, -0x2d, 0x74, 0x96, 0x07, 0x1f, 0x0d, 0x24, 0xef, -0x93, 0x6a, 0x7f, 0xef, 0x95, 0xec, 0x8a, 0xbf, -0xc7, 0x69, 0x93, 0xfb, 0xa8, 0x90, 0xa3, 0xf2, -0xae, 0x44, 0x77, 0xc4, 0x33, 0x21, 0x0b, 0xb7, -0x06, 0x12, 0x10, 0x10, 0x48, 0xb3, 0x9c, 0x8a, -0xb6, 0x26, 0x0d, 0xc5, 0x54, 0x72, 0x28, 0x39, -0x50, 0x1f }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_011[] = { - {TITLE, "IPSEC-UDP-011", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_011_size = sizeof(tahi_ipsec_udp_011) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_012.c b/test/regression/tahi_test/tahi_ipsec_udp_012.c deleted file mode 100644 index 8a8758ba..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_012.c +++ /dev/null @@ -1,101 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x09, 0x5e, -0x03, 0x76, 0x2c, 0x70, 0xf7, 0x40, 0x83, 0x1f, -0x0d, 0xfd, 0x14, 0xa0, 0x0e, 0x50, 0x3d, 0x24, -0x18, 0x87, 0x7e, 0xdd, 0xc5, 0x20, 0x45, 0x86, -0xff, 0x00, 0x47, 0xa1, 0xee, 0x28, 0x70, 0x68, -0x3d, 0xb2, 0x14, 0x4a, 0xfe, 0x05, 0xb8, 0x54, -0xab, 0x92, 0xd0, 0x41, 0x40, 0x4e, 0x73, 0x6b, -0xbc, 0x4a }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x90, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x62, 0x2a, -0x53, 0xb0, 0xbb, 0xfa, 0x2f, 0x14, 0x39, 0xd5, -0x7b, 0xe6 }; - -TAHI_TEST_SEQ tahi_ipsec_udp_012[] = { - {TITLE, "IPSEC-UDP-012", 13, 0, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_012_size = sizeof(tahi_ipsec_udp_012) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_013.c b/test/regression/tahi_test/tahi_ipsec_udp_013.c deleted file mode 100644 index 145a1f28..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_013.c +++ /dev/null @@ -1,236 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -#if 0 -static char pkt1[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xf7, 0xb5, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x10, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, -0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, -0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0f, 0xdd, 0x80, 0xfc, 0x0a, 0x00, -0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, -0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; - -static char pkt2[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xf7, 0xb5, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x10, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x46, 0x48, 0x45, 0x50, 0x46, -0x43, 0x45, 0x4c, 0x45, 0x48, 0x46, 0x43, 0x45, -0x50, 0x46, 0x46, 0x46, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x42, 0x4f, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0f, 0xdd, 0x80, 0xfc, 0x0a, 0x00, -0x44, 0x48, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x03, 0x9a, 0x84, 0x00, 0x0f, 0x01, -0x55, 0xaa, 0x64, 0x68, 0x75, 0x00 }; - -static char pkt3[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xf7, 0xb6, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x11, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, -0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, -0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, -0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, -0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0c, 0xdd, 0x80, 0xfc, 0x0a, 0x00, -0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, -0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, -0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; - -static char pkt4[] = { -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x16, -0x17, 0x3e, 0x5e, 0x5a, 0x08, 0x00, 0x45, 0x00, -0x00, 0xe8, 0xf7, 0xb6, 0x00, 0x00, 0x40, 0x11, -0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x0a, 0xff, -0xff, 0xff, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0xd4, -0x15, 0xe5, 0x11, 0x0a, 0x6c, 0x11, 0x0a, 0x00, -0x00, 0x01, 0x00, 0x8a, 0x00, 0xbe, 0x00, 0x00, -0x20, 0x45, 0x45, 0x45, 0x49, 0x46, 0x46, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, -0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41, -0x41, 0x00, 0x20, 0x41, 0x42, 0x41, 0x43, 0x46, -0x50, 0x46, 0x50, 0x45, 0x4e, 0x46, 0x44, 0x45, -0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x48, 0x46, -0x44, 0x45, 0x46, 0x46, 0x50, 0x46, 0x50, 0x41, -0x43, 0x41, 0x42, 0x00, 0xff, 0x53, 0x4d, 0x42, -0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x24, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x24, 0x00, 0x56, 0x00, 0x03, -0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x35, -0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, -0x4f, 0x54, 0x5c, 0x42, 0x52, 0x4f, 0x57, 0x53, -0x45, 0x00, 0x0c, 0xdd, 0x80, 0xfc, 0x0a, 0x00, -0x57, 0x4f, 0x52, 0x4b, 0x47, 0x52, 0x4f, 0x55, -0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x04, 0x09, 0x00, 0x10, 0x00, 0x80, 0x0f, 0x01, -0x55, 0xaa, 0x44, 0x48, 0x55, 0x00 }; -#endif - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x05, 0xa5, 0x2c, -0xa7, 0x6f, 0x57, 0x41, 0xa8, 0x2a, 0xe0, 0xfe, -0xc5, 0x18, 0x6f, 0x7a, 0x22, 0xe9, 0x5b, 0x04, -0x2c, 0xd1, 0x7a, 0xa2, 0x96, 0x28, 0x6d, 0x6f, -0xe8, 0x3f, 0x88, 0x91, 0xe3, 0xee, 0x9c, 0x6b, -0xc9, 0x76, 0x91, 0x79, 0x84, 0xab, 0xe7, 0x7a, -0xc3, 0xac, 0x44, 0xd7, 0x2f, 0xa6, 0x45, 0xeb, -0xff, 0x8d }; - -#if 0 -static char pkt7[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt8[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt9[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0xaa, 0xaa, -0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, -0xaa, 0xaa, 0xaa, 0xaa, 0x9b, 0xf4, 0x52, 0x80, -0xaa, 0x15, 0x46, 0x2d, 0xd5, 0x7b, 0x9f, 0xc6, -0x3f, 0x5a }; - -TAHI_TEST_SEQ tahi_ipsec_udp_013[] = { - {TITLE, "IPSEC-UDP-013", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {INJECT, &pkt8[0], sizeof(pkt8), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt9[0], sizeof(pkt9), 0, 0, 0, 0, 0}, - {N_CHECK, (char *)ER, 0, 3, 0, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_013_size = sizeof(tahi_ipsec_udp_013) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_014.c b/test/regression/tahi_test/tahi_ipsec_udp_014.c deleted file mode 100644 index 9342d79c..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_014.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0xb3, 0xa5, -0x5a, 0xf3, 0x4c, 0xb1, 0x1c, 0x27, 0x84, 0xf8, -0x1e, 0x3c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, 0xdf, -0xa0, 0x58, 0x64, 0x03, 0x4a, 0x47, 0x20, 0xcd, -0xe6, 0x14, 0x8d, 0x71, 0x7f, 0x8e, 0xc5, 0xc6, -0x5f, 0x6f, 0x6d, 0x9a, 0x53, 0x52, 0x62, 0xb8, -0x95, 0x51, 0xea, 0x30, 0x92, 0x0f, 0x09, 0xb7, -0x42, 0x61, 0xa3, 0x99, 0xca, 0x1d, 0xd9, 0x5f, -0x90, 0x52, 0x58, 0x02, 0xf8, 0xd7, 0xe5, 0x08, -0x6b, 0x4c }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_014[] = { - {TITLE, "IPSEC-UDP-014", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_014_size = sizeof(tahi_ipsec_udp_014) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_015.c b/test/regression/tahi_test/tahi_ipsec_udp_015.c deleted file mode 100644 index ebcb3ba2..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_015.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4, 0x54, 0x77, -0x54, 0x40, 0x58, 0xf4, 0xf0, 0x01, 0x84, 0xf9, -0x59, 0x45 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc4, 0x3c, -0x53, 0x2e, 0xaf, 0x5f, 0x18, 0x04, 0xc4, 0x83, -0xe2, 0xcb, 0xf5, 0x58, 0x2d, 0xee, 0x2a, 0x38, -0x72, 0x0d, 0x5a, 0xd1, 0x7c, 0xc4, 0x86, 0x21, -0xb7, 0x48, 0x32, 0xf1, 0xec, 0x62, 0x8f, 0x2d, -0xf7, 0x11, 0x84, 0x6b, 0x40, 0xe9, 0x93, 0xc8, -0xea, 0xc8, 0xa5, 0xf6, 0x5d, 0x41, 0x23, 0x95, -0x8e, 0x27 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_015[] = { - {TITLE, "IPSEC-UDP-015", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_015_size = sizeof(tahi_ipsec_udp_015) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_016.c b/test/regression/tahi_test/tahi_ipsec_udp_016.c deleted file mode 100644 index e50fc9ba..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_016.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x28, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x2f, -0xed, 0xbd, 0xfa, 0xd7, 0x85, 0xd7, 0x5b, 0x9d, -0xa8, 0x50, 0x6a, 0x45, 0xf8, 0xd3, 0x9d, 0x77, -0x72, 0xdf, 0x1f, 0x0e, 0x9b, 0xf4 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0xb1, -0xe3, 0x6d, 0x28, 0x86, 0xab, 0x0c, 0xfb, 0x49, -0xb8, 0x88, 0x93, 0xb8, 0xce, 0xf3, 0xfd, 0x16, -0x46, 0xc5, 0x25, 0xc0, 0x0c, 0xdd, 0x57, 0x2b, -0x3a, 0xfc, 0xce, 0xc2, 0xfe, 0x0f, 0x10, 0x97, -0x2b, 0x8e, 0x89, 0xca, 0x89, 0x57 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_016[] = { - {TITLE, "IPSEC-UDP-016", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_016_size = sizeof(tahi_ipsec_udp_016) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_017.c b/test/regression/tahi_test/tahi_ipsec_udp_017.c deleted file mode 100644 index da0adca4..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_017.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc5, -0x52, 0x01, 0x91, 0x04, 0xd7, 0xed, 0xcb, 0xe8, -0xf9, 0xb0, 0x7d, 0x8c, 0x73, 0x29, 0x80, 0xc6, -0xde, 0x36, 0x7d, 0x38, 0xa8, 0x4a, 0x71, 0x14, -0x4e, 0x53, 0x05, 0x28, 0x3d, 0x04, 0x12, 0x05, -0x21, 0xb9, 0xb8, 0x67, 0x14, 0x54, 0x5e, 0x9d, -0x0c, 0xac }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x44, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa4, 0xbf, -0x43, 0x70, 0xe9, 0x50, 0x81, 0x39, 0x57, 0x16, -0x52, 0x37, 0xdb, 0x2f, 0x9a, 0x4d, 0x73, 0x44, -0x8e, 0xcb, 0x2a, 0x26, 0xe3, 0x06, 0xba, 0x3e, -0x88, 0xa1, 0x44, 0x91, 0x47, 0x51, 0xfc, 0xb9, -0xf4, 0x0c, 0xee, 0x17, 0x6c, 0x1a, 0xa8, 0x75, -0xa1, 0xf9, 0xe8, 0xc0, 0xd6, 0xd1, 0xf1, 0x5e, -0x90, 0xfd, 0x82, 0xf0, 0x16, 0xf6, 0xf6, 0xc8, -0x44, 0xcb }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_017[] = { - {TITLE, "IPSEC-UDP-017", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_017_size = sizeof(tahi_ipsec_udp_017) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_018.c b/test/regression/tahi_test/tahi_ipsec_udp_018.c deleted file mode 100644 index 857d0dd4..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_018.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x34, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0xbd, -0xe9, 0xc0, 0x9a, 0x05, 0xb9, 0x6b, 0x62, 0x7d, -0x3b, 0x93, 0xa1, 0x5b, 0xd7, 0x75, 0xc2, 0x4b, -0xa4, 0x99, 0x2c, 0x25, 0x54, 0x0f, 0xcd, 0x16, -0x82, 0xbc, 0xc6, 0xa3, 0x15, 0x18, 0xaf, 0x53, -0x99, 0x2e }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5e, 0x62, -0xc3, 0x76, 0x20, 0x50, 0x07, 0x55, 0x85, 0x02, -0xc1, 0x2a, 0xe1, 0xbf, 0x80, 0x79, 0x33, 0xae, -0x5c, 0x25, 0xa0, 0x7f, 0x13, 0x86, 0xf3, 0xc3, -0x8e, 0xf3, 0x9a, 0x1a, 0xb0, 0x50, 0xae, 0x12, -0x95, 0x8b, 0xb7, 0xcb, 0x6e, 0xea, 0xbb, 0xcb, -0xff, 0x88, 0xd7, 0x43, 0xe1, 0x37, 0xff, 0x36, -0x56, 0xab }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_018[] = { - {TITLE, "IPSEC-UDP-018", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_018_size = sizeof(tahi_ipsec_udp_018) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_019.c b/test/regression/tahi_test/tahi_ipsec_udp_019.c deleted file mode 100644 index 79cb92d6..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_019.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x2c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x27, 0x10, -0x00, 0x07, 0x00, 0x16, 0x6c, 0x96, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f, 0x00, 0x11, 0x6a, 0x8c, -0xb1, 0xe2, 0x72, 0xcf, 0x9e, 0x87, 0x83, 0x21, -0x16, 0xd1 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x30, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, -0x27, 0x10, 0x00, 0x16, 0x6c, 0x96, 0x50, 0x61, -0x64, 0x4c, 0x65, 0x6e, 0x20, 0x69, 0x73, 0x20, -0x5a, 0x65, 0x72, 0x6f, 0x01, 0x02, 0x03, 0x04, -0x04, 0x11, 0xb0, 0x95, 0xad, 0xa9, 0x97, 0x25, -0xc2, 0xa3, 0xfc, 0x85, 0x83, 0xe5 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_019[] = { - {TITLE, "IPSEC-UDP-019", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {D_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_019_size = sizeof(tahi_ipsec_udp_019) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_022.c b/test/regression/tahi_test/tahi_ipsec_udp_022.c deleted file mode 100644 index 94f1230a..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_022.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, -0x8d, 0x47, 0xa9, 0xe7, 0x2e, 0x0c, 0xdc, 0x2b, -0x24, 0xf7, 0x94, 0x6d, 0x3c, 0xdb, 0x64, 0x10, -0x12, 0x2c, 0x37, 0x8e, 0xdd, 0xf2, 0xa4, 0x98, -0x55, 0x0a, 0x69, 0x5b, 0xd9, 0xa5, 0x7b, 0xf1, -0x95, 0x5b, 0x7c, 0xa0, 0xad, 0xd5, 0x8e, 0x1c, -0xd3, 0x6d, 0x4b, 0xaa, 0x80, 0x58, 0x54, 0x63, -0x7d, 0xb5, 0x12, 0xba, 0xe8, 0x49, 0xa5, 0x35, -0xb3, 0x4a, 0x44, 0x7e, 0xc5, 0xb4, 0x94, 0x7c, -0x6c, 0x41, 0xf1, 0xc7, 0x8d, 0x0b, 0xd7, 0x06, -0x4f, 0xc7 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfb, 0x54, -0x9b, 0x32, 0x38, 0xc0, 0x1f, 0x38, 0xd1, 0x44, -0x1e, 0xe6, 0xdd, 0x82, 0x67, 0xbb, 0x80, 0x33, -0x1f, 0x49, 0x40, 0x4e, 0xf6, 0xac, 0x79, 0xfd, -0x38, 0x7e, 0x2e, 0xe9, 0x03, 0x27, 0x5f, 0xee, -0xe3, 0xb1, 0x81, 0x62, 0xa5, 0xa7, 0xfc, 0x05, -0x4a, 0xf9, 0xe6, 0x52, 0x5a, 0x26, 0xfd, 0x54, -0x5a, 0xfb, 0x8d, 0x5a, 0x02, 0xa6, 0x57, 0x36, -0x3d, 0xb8, 0xc3, 0x61, 0x46, 0x06, 0xe2, 0xd3, -0x4c, 0x74, 0x0e, 0xa1, 0x0f, 0xdf, 0x2c, 0xe0, -0x27, 0x7a, 0x8c, 0x3f, 0x7a, 0xc5, 0x85, 0xa7, -0xbc, 0x71, 0xc4, 0x60, 0xa7, 0x30, 0xcf, 0x9b, -0xa7, 0x0f }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_022[] = { - {TITLE, "IPSEC-UDP-022", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_022_size = sizeof(tahi_ipsec_udp_022) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_023.c b/test/regression/tahi_test/tahi_ipsec_udp_023.c deleted file mode 100644 index 02af7b4a..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_023.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, -0x8d, 0x47, 0xa9, 0xe7, 0x2e, 0x0c, 0x69, 0x1d, -0x4d, 0x91, 0x4f, 0x6d, 0x16, 0x16, 0xfe, 0x41, -0xd9, 0x28, 0xac, 0xd2, 0xa8, 0xdd, 0x05, 0xc6, -0xe9, 0x23, 0x61, 0x69, 0x73, 0x0d, 0x39, 0x41, -0xbd, 0x4c, 0x8d, 0x19, 0x93, 0xc6, 0xd7, 0x17, -0x2e, 0xd1, 0xbc, 0xb6, 0x33, 0x01, 0xaa, 0xdb, -0x05, 0x76, 0x1c, 0xff, 0x3c, 0x69, 0xe2, 0x78, -0xb8, 0xaf, 0x5c, 0x51, 0x2e, 0xe4, 0x61, 0x63, -0x4b, 0x39, 0x72, 0x93, 0x3c, 0x73, 0xfe, 0x02, -0x40, 0xf3 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa8, 0xd5, -0x78, 0x53, 0x4e, 0x00, 0xe5, 0x76, 0xfd, 0x12, -0x92, 0xbe, 0xac, 0xe2, 0x76, 0x7b, 0xc8, 0x75, -0x4d, 0xff, 0x78, 0x3a, 0x27, 0xc1, 0x6a, 0x8f, -0xc0, 0x53, 0x3e, 0xfb, 0xc7, 0x1b, 0x9e, 0x24, -0x53, 0xc4, 0x0c, 0x85, 0x2c, 0x48, 0x5a, 0xb7, -0x0b, 0x85, 0x7a, 0xbc, 0x8a, 0xfa, 0xa3, 0xcc, -0xc2, 0x7f, 0x06, 0x9a, 0x7a, 0x20, 0x4e, 0xdf, -0x2e, 0xc5, 0x99, 0x48, 0xe3, 0x06, 0x9f, 0x29, -0xd7, 0x0b, 0x30, 0xb3, 0xb5, 0x02, 0x0f, 0x6d, -0x70, 0x6a, 0xe8, 0x68, 0x4f, 0x17, 0x44, 0x3c, -0x6d, 0xac, 0x39, 0x73, 0x5b, 0x24, 0xa6, 0x8a, -0x3e, 0x72 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_023[] = { - {TITLE, "IPSEC-UDP-023", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_023_size = sizeof(tahi_ipsec_udp_023) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_024.c b/test/regression/tahi_test/tahi_ipsec_udp_024.c deleted file mode 100644 index 0be7c7d3..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_024.c +++ /dev/null @@ -1,139 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, -0x8d, 0x47, 0xa9, 0xe7, 0x2e, 0x0c, 0x69, 0x1d, -0x4d, 0x91, 0x4f, 0x6d, 0x16, 0x16, 0xfe, 0x41, -0xd9, 0x28, 0xac, 0xd2, 0xa8, 0xdd, 0x05, 0xc6, -0xe9, 0x23, 0x61, 0x69, 0x73, 0x0d, 0x39, 0x41, -0xbd, 0x4c, 0x8d, 0x19, 0x93, 0xc6, 0xd7, 0x17, -0x2e, 0xd1, 0xbc, 0xb6, 0x33, 0x01, 0xaa, 0xdb, -0x05, 0x76, 0x1c, 0xff, 0x3c, 0x69, 0xe2, 0x78, -0xb8, 0xaf, 0x5c, 0x51, 0x2e, 0xe4, 0x61, 0x63, -0x4b, 0x39, 0x72, 0x93, 0x3c, 0x73, 0xfe, 0x02, -0x40, 0xf3 }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa6, 0x87, -0x7d, 0x79, 0x14, 0xc7, 0x56, 0x27, 0x31, 0x3c, -0xdf, 0x14, 0x08, 0xdc, 0x7f, 0x0b, 0x91, 0xb4, -0x84, 0xbb, 0x5e, 0x54, 0x97, 0x55, 0x0e, 0x2a, -0x6d, 0xd5, 0x46, 0xc7, 0x8e, 0xd9, 0x78, 0xdc, -0xd4, 0x71, 0x38, 0x8c, 0x18, 0x35, 0x39, 0x96, -0x42, 0x74, 0x5f, 0x2b, 0x11, 0xda, 0xb2, 0x89, -0x0d, 0x35, 0x3e, 0xed, 0x3a, 0xa8, 0xa7, 0xf5, -0x24, 0x95, 0xad, 0x33, 0xf3, 0x20, 0xac, 0xde, -0x77, 0xc6, 0xf4, 0x74, 0x2a, 0x7c, 0x8d, 0xcc, -0xfe, 0xe5, 0x77, 0x67, 0xe5, 0xac, 0xe2, 0x04, -0xb2, 0xd2, 0x64, 0x1c, 0x06, 0x80, 0x9c, 0x35, -0x56, 0xd4 }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x30, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x10, -0xde, 0x9d, 0xbc, 0xb7, 0x02, 0xe0, 0x20, 0x73, -0x02, 0x13, 0xd5, 0xab, 0x65, 0x10, 0x41, 0xf8, -0x2b, 0x2d, 0x7e, 0xcc, 0xc7, 0x6a, 0x8e, 0x77, -0x1b, 0xda, 0xe3, 0x97, 0x8a, 0x77, 0xc9, 0xb7, -0xc6, 0xfd, 0x53, 0xab, 0x8c, 0x10, 0x55, 0xff, -0x89, 0xc2, 0xe4, 0x10, 0x8f, 0xf4, 0x51, 0xa4, -0x0f, 0x88, 0xa0, 0xbd, 0x2f, 0x33, 0x67, 0x7e, -0x2a, 0xcd, 0xc5, 0x37, 0xe4, 0xdd, 0x40, 0x01, -0x71, 0x03, 0x58, 0xaf, 0xf8, 0x3e, 0x24, 0xb5, -0xd6, 0xf2 }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x93, 0x8d, -0x59, 0x4c, 0x25, 0xd7, 0x3b, 0x64, 0x4e, 0x25, -0x38, 0x6d, 0x24, 0xff, 0xb3, 0x79, 0x20, 0xca, -0x04, 0x09, 0x25, 0xbb, 0x00, 0x7d, 0xf4, 0x92, -0x5e, 0xfb, 0xfa, 0xf3, 0x20, 0x0c, 0xb4, 0xea, -0x5d, 0x2b, 0xd9, 0x64, 0x1e, 0x59, 0x19, 0xa0, -0x8e, 0xd1, 0x73, 0x59, 0x49, 0xd2, 0x17, 0xa0, -0xca, 0x37, 0xc0, 0xe6, 0x77, 0xe1, 0x4c, 0xc8, -0x87, 0xf8, 0x44, 0xbd, 0x50, 0x3b, 0xe2, 0x09, -0xa9, 0xe8, 0x5e, 0xf5, 0x0f, 0xde, 0xd4, 0x8d, -0xe5, 0x5f, 0xbe, 0x4a, 0x94, 0x2c, 0x7d, 0x8f, -0x86, 0x49, 0xe7, 0x50, 0x73, 0xf3, 0x9c, 0x44, -0x2c, 0xb2 }; - -TAHI_TEST_SEQ tahi_ipsec_udp_024[] = { - {TITLE, "IPSEC-UDP-024", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_024_size = sizeof(tahi_ipsec_udp_024) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_025.c b/test/regression/tahi_test/tahi_ipsec_udp_025.c deleted file mode 100644 index 05b2f2c5..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_025.c +++ /dev/null @@ -1,168 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x15, -0x08, 0x1d, 0xe6, 0x03, 0xd0, 0x19, 0xfc, 0xad, -0xae, 0x67, 0x70, 0xcd, 0x9a, 0xc8, 0x37, 0xc2, -0x56, 0x6a, 0x34, 0x0a, 0x41, 0x61, 0xf4, 0x48, -0x4a, 0xd2, 0x27, 0xce, 0xac, 0x23, 0x41, 0x60, -0x51, 0x65, 0x85, 0x2a, 0x5d, 0x35, 0x49, 0x06, -0xe1, 0xf6, 0x4d, 0x08, 0x91, 0x73, 0x92, 0x75, -0xee, 0x87, 0x3b, 0x0e, 0xfc, 0x34, 0xac, 0x18, -0xf6, 0x4c, 0x1a, 0x10, 0xd4, 0x77, 0x0f, 0x99, -0x94, 0x0a, 0x56, 0x4b, 0x38, 0x35, 0x52, 0x8f, -0xf5, 0x4c }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x56, 0x94, -0x44, 0x2b, 0x24, 0x86, 0x12, 0x67, 0xf2, 0x57, -0x44, 0x2c, 0x93, 0xe3, 0xb2, 0x6e, 0x15, 0x39, -0xc1, 0xc5, 0xc9, 0x59, 0xc1, 0x1e, 0x03, 0xa3, -0x2f, 0xc5, 0x70, 0xb4, 0xe5, 0xc1, 0xc2, 0x2d, -0x1b, 0x91, 0xee, 0x87, 0x2c, 0x66, 0x6c, 0xfc, -0x27, 0x86, 0x2f, 0xde, 0x92, 0xd4, 0x25, 0x52, -0xe4, 0x09, 0x9e, 0x01, 0x9e, 0x46, 0x19, 0x29, -0xb8, 0x98, 0xc2, 0xda, 0xc8, 0xc9, 0xab, 0xcc, -0xe8, 0x14, 0x08, 0xe7, 0xd7, 0x10, 0x77, 0xa8, -0xaf, 0x2a, 0x9a, 0x55, 0x10, 0x1a, 0x9a, 0xfa, -0x5e, 0x7b }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -static char pkt5[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x01, 0x54, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x15, -0x08, 0x1d, 0xe6, 0x03, 0xd0, 0x19, 0xfc, 0xad, -0xae, 0x67, 0x70, 0xcd, 0x9a, 0xc8, 0x37, 0xc2, -0x56, 0x6a, 0x34, 0x0a, 0x41, 0x61, 0xf4, 0x48, -0x4a, 0xd2, 0x27, 0xce, 0xac, 0x23, 0x41, 0x60, -0x51, 0x65, 0x85, 0x2a, 0x5d, 0x35, 0x49, 0x06, -0xe1, 0xf6, 0x4d, 0x08, 0x91, 0x73, 0x92, 0x75, -0xee, 0x87, 0x3b, 0x0e, 0xfc, 0x34, 0x59, 0xf7, -0xf7, 0x23, 0x3d, 0xea, 0xc5, 0xe1, 0x2e, 0x84, -0xf7, 0xf4, 0x7a, 0x0a, 0x10, 0xb0, 0x21, 0x1f, -0x88, 0x74, 0x0c, 0xa3, 0x5c, 0xf4, 0x23, 0xd6, -0xd9, 0x8c, 0x4d, 0x49, 0x11, 0x0a, 0xe6, 0x63, -0x26, 0xa1, 0xd3, 0x12, 0xa9, 0x56, 0xe6, 0x6e, -0x26, 0x2e, 0x7e, 0xda, 0x8f, 0xc5, 0x46, 0x53, -0x10, 0x0e, 0x01, 0x61, 0xa2, 0x0c, 0x3f, 0x90, -0xcb, 0x77, 0xe0, 0x26, 0xb9, 0xdb, 0xc1, 0x29, -0x24, 0xc6, 0x2c, 0x39, 0xd8, 0x75, 0x44, 0xad, -0xb6, 0xb3, 0x42, 0x08, 0xf0, 0x02, 0x99, 0x01, -0x15, 0x5d, 0x27, 0x51, 0x12, 0x10, 0x4f, 0xe2, -0x94, 0x69, 0x56, 0x12, 0x9b, 0x4e, 0x7d, 0xf3, -0x93, 0x9e, 0xee, 0xdb, 0x94, 0x68, 0x0b, 0xdb, -0xaf, 0xb4, 0xc0, 0x0f, 0xad, 0x77, 0x0b, 0xf7, -0xf5, 0x2c, 0xe8, 0x3d, 0x86, 0x94, 0xa1, 0xa1, -0x85, 0x82, 0xd5, 0x79, 0x13, 0x2e, 0x08, 0x14, -0xb1, 0x08, 0x38, 0x10, 0xd0, 0x07, 0x93, 0xd8, -0x07, 0x48, 0x26, 0xde, 0x23, 0x34, 0x8d, 0x2c, -0x62, 0xd6, 0x2f, 0x50, 0x16, 0xea, 0x4d, 0x32, -0xc9, 0x9e, 0xb2, 0xf8, 0x68, 0x34, 0x41, 0xa8, -0xf0, 0xa7, 0x23, 0x22, 0xf8, 0x90, 0xe3, 0xc2, -0x50, 0x57, 0x5c, 0x03, 0x88, 0x28, 0x4d, 0x86, -0x97, 0x23, 0x71, 0x45, 0x59, 0xbc, 0xbb, 0xbf, -0x95, 0x8e, 0xb0, 0x83, 0x94, 0xee, 0xd4, 0xd1, -0xb4, 0x2f, 0x9f, 0xeb, 0x20, 0x8b, 0x67, 0xf7, -0x40, 0x10, 0x84, 0x55, 0xe3, 0xe8, 0xbc, 0x22, -0xaf, 0xd8, 0xc7, 0x73, 0xae, 0x8c, 0x16, 0x84, -0x59, 0x40, 0x94, 0x53, 0xcb, 0xde, 0x22, 0x05, -0x55, 0xc3, 0xc6, 0x43, 0x3e, 0x90, 0x93, 0x4a, -0x81, 0xe3, 0x33, 0x7b, 0x80, 0xf2, 0xe0, 0x29, -0xe3, 0x57, 0xfe, 0xa1, 0x01, 0x80, 0x26, 0xb5, -0x63, 0xee, 0x1f, 0xa7, 0x16, 0x21, 0xd7, 0x19, -0x4a, 0x0d, 0x29, 0xe7, 0x82, 0x14, 0xd7, 0x98, -0x81, 0x39 }; - -static char pkt6[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5c, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x02, 0x44, 0xe6, -0x99, 0x78, 0xdf, 0x32, 0x82, 0x08, 0xd3, 0xec, -0x7e, 0x5f, 0x1a, 0xb6, 0x30, 0x49, 0x92, 0xf5, -0x90, 0xb8, 0xf3, 0x4b, 0x88, 0x84, 0x91, 0xa4, -0x26, 0x16, 0x3b, 0x33, 0xc4, 0x60, 0x80, 0x45, -0xa0, 0x5d, 0x13, 0xc5, 0x6d, 0xac, 0xeb, 0x9e, -0x06, 0x55, 0x27, 0x9e, 0x26, 0xc6, 0x25, 0x33, -0xe0, 0xa3, 0x68, 0x00, 0x78, 0x23, 0x4b, 0x9e, -0xf2, 0xf5, 0xfd, 0x53, 0x17, 0x0a, 0x41, 0x22, -0xc7, 0xa8, 0x94, 0x5d, 0x85, 0xb8, 0xdf, 0xcd, -0x52, 0x15, 0x71, 0x7a, 0x5a, 0x3a, 0x24, 0xe6, -0xdd, 0x9d }; - -TAHI_TEST_SEQ tahi_ipsec_udp_025[] = { - {TITLE, "IPSEC-UDP-025", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {DUMP,NX_NULL,0,0, 0, 0, 0, 0}, - {INJECT, &pkt5[0], sizeof(pkt5), 0, 0, 0, 0, 0}, - {TD_CHECK, &pkt6[0], sizeof(pkt6), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_025_size = sizeof(tahi_ipsec_udp_025) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/tahi_test/tahi_ipsec_udp_026.c b/test/regression/tahi_test/tahi_ipsec_udp_026.c deleted file mode 100644 index 7378aa4b..00000000 --- a/test/regression/tahi_test/tahi_ipsec_udp_026.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "nx_api.h" -#if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) && defined(NX_IPSEC_ENABLE) -#include "netx_tahi.h" - - -static char pkt1[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x00, 0x00, -0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x23, -0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xf1, 0x71, -0x71, 0x9c, 0x36, 0x13, 0x0d, 0xba, 0xbe, 0x4c, -0xb0, 0x39, 0x12, 0xb8, 0x79, 0x14, 0x17, 0xfd, -0xbc, 0x52, 0xb2, 0xb3, 0x37, 0x88, 0x65, 0xd3, -0xbc, 0x2e, 0xf0, 0xa7, 0x1c, 0xe1, 0x67, 0x7b, -0xe1, 0x7b, 0x3b, 0x8a, 0x56, 0x73, 0x7d, 0x9c, -0x91, 0x05, 0xa6, 0xf8, 0xbb, 0x9b, 0xcc, 0xf7, -0xc6, 0x59, 0xe4, 0xb5, 0x8c, 0x5d, 0x9c, 0x2e, -0xbf, 0x6b, 0x6e, 0xe0, 0xb1, 0xe4, 0x10, 0xc6, -0x01, 0xd1, 0x93, 0x9a, 0xa8, 0x35, 0x26, 0x02, -0xfb, 0x6e, 0x7b, 0xcd, 0xac, 0x23, 0x45, 0xac, -0xe8, 0x9b }; - -static char pkt2[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x64, 0x32, 0x40, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, -0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x59, 0x05, -0xb5, 0x6d, 0x8d, 0x7d, 0x15, 0x7d, 0x8b, 0x97, -0xb7, 0x42, 0x10, 0xb2, 0xba, 0x93, 0xea, 0x62, -0x49, 0xa2, 0x82, 0x8e, 0x83, 0x50, 0xa7, 0x1e, -0x81, 0x5f, 0xc9, 0x45, 0x47, 0x28, 0xd5, 0xbc, -0x08, 0x7e, 0x2a, 0x23, 0x42, 0x05, 0x3f, 0x04, -0x0e, 0x81, 0xfe, 0xf0, 0x5d, 0xb0, 0xda, 0x11, -0xcf, 0xcf, 0xc5, 0x56, 0xeb, 0x2d, 0x97, 0x96, -0x1a, 0xb9, 0x19, 0x6c, 0xde, 0x4b, 0x71, 0x8e, -0xe1, 0xfb, 0xca, 0x48, 0x0a, 0x1f, 0xae, 0x35, -0x33, 0x72, 0x32, 0x2b, 0x08, 0x38, 0x04, 0xa6, -0x30, 0xaa, 0x3d, 0xce, 0x7f, 0x22, 0x89, 0x35, -0xd9, 0xcf }; - -#if 0 -static char pkt3[] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x11, -0x22, 0x33, 0x44, 0x56, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x87, 0x00, -0x65, 0x50, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x01, 0x01, -0x00, 0x11, 0x22, 0x33, 0x44, 0x56 }; -#endif - -static char pkt4[] = { -0x00, 0x11, 0x22, 0x33, 0x44, 0x56, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0f, 0x86, 0xdd, 0x60, 0x00, -0x00, 0x00, 0x00, 0x20, 0x3a, 0xff, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x3f, 0xfe, -0x05, 0x01, 0xff, 0xff, 0x00, 0x00, 0x02, 0x11, -0x22, 0xff, 0xfe, 0x33, 0x44, 0x56, 0x88, 0x00, -0xe9, 0xda, 0xe0, 0x00, 0x00, 0x00, 0xfe, 0x80, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, -0x00, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x02, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0f }; - -TAHI_TEST_SEQ tahi_ipsec_udp_026[] = { - {TITLE, "IPSEC-UDP-026", 13, 0, 0, 0, 0, 0}, - {WAIT, NX_NULL, 0, 5, 0, 0, 0, 0}, - - {INJECT, &pkt1[0], sizeof(pkt1), 0, 0, 0, 0, 0}, - {INJECT, &pkt4[0], sizeof(pkt4), 0, 0, 0, 0, 0}, /* Send NA packet first. */ - {TD_CHECK, &pkt2[0], sizeof(pkt2), 3, NX_NULL, 0, 0, 0}, - - {CLEANUP, NX_NULL, 0, 0, 0, 0, 0, 0}, - {DUMP, NX_NULL, 0, 0, 0, 0, 0, 0} -}; - -int tahi_ipsec_udp_026_size = sizeof(tahi_ipsec_udp_026) / sizeof(TAHI_TEST_SEQ); - -#endif diff --git a/test/regression/telnet_test/netx_telnet_activity_timeout_test.c b/test/regression/telnet_test/netx_telnet_activity_timeout_test.c index 34eac7ec..5e1fec66 100644 --- a/test/regression/telnet_test/netx_telnet_activity_timeout_test.c +++ b/test/regression/telnet_test/netx_telnet_activity_timeout_test.c @@ -450,7 +450,7 @@ UINT packets_sent= 0; nx_packet_release(my_packet); /* Pickup the Server echo of the character. */ - status = nx_telnet_client_packet_receive(&my_client1, &my_packet, 4000); // jlc TELNET_TIMEOUT); + status = nx_telnet_client_packet_receive(&my_client1, &my_packet, 4000); if (status) error_counter++; diff --git a/test/regression/telnet_test/netx_telnet_rst_test.c b/test/regression/telnet_test/netx_telnet_rst_test.c index 2a8f2656..85c8ce6e 100644 --- a/test/regression/telnet_test/netx_telnet_rst_test.c +++ b/test/regression/telnet_test/netx_telnet_rst_test.c @@ -1,5 +1,4 @@ /* This case tests the Telnet server on handling RST packet. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-235 */ #include "tx_api.h" #include "nx_api.h" diff --git a/test/regression/telnet_test/netx_telnet_two_listen_test.c b/test/regression/telnet_test/netx_telnet_two_listen_test.c index 4f2b000a..a190702d 100644 --- a/test/regression/telnet_test/netx_telnet_two_listen_test.c +++ b/test/regression/telnet_test/netx_telnet_two_listen_test.c @@ -1,5 +1,4 @@ /* This case tests the Telnet server on handling two session listen situation. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-238 */ #include "tx_api.h" #include "nx_api.h" diff --git a/test/regression/test/netxtestcontrol.c b/test/regression/test/netxtestcontrol.c index 11f7a74f..68395044 100644 --- a/test/regression/test/netxtestcontrol.c +++ b/test/regression/test/netxtestcontrol.c @@ -337,7 +337,6 @@ void netx_rarp_branch_test_application_define(void*); void netx_tcp_duplicate_accept_test_application_define(void *); void netx_tcp_ack_check_for_syn_message_test_application_define(void *); void netx_tcp_ack_check_issue_test_application_define(void *); -void netx_tcp_ack_before_release_test_application_define(void *); void netx_tcp_basic_processing_test_application_define(void *); void netx_tcp_zero_window_test_application_define(void *); void netx_tcp_zero_window_probe_test_application_define(void *); @@ -373,7 +372,7 @@ void netx_tcp_fast_disconnect_test_application_define(void *); void netx_tcp_loopback_test_application_define(void *); void netx_tcp_out_of_order_packet_test_application_define(void *); void netx_tcp_out_of_order_ack_test_application_define(void *); -// jlc temporarily omitting this one void netx_tcp_out_of_order_packet_max_test_application_define(void *); +void netx_tcp_out_of_order_packet_max_test_application_define(void *); void netx_tcp_small_window_preempt_test_application_define(void *); void netx_tcp_small_window_test_application_define(void *); void netx_tcp_ipv4_interface2_mss_test_application_define(void *); @@ -598,7 +597,6 @@ void netx_10_25_application_define(void *); void netx_10_26_application_define(void *); void netx_11_18_application_define(void *); void netx_11_19_application_define(void *); -void netx_11_23_application_define(void *); void netx_11_24_application_define(void *); void netx_11_25_application_define(void *); void netx_11_26_application_define(void *); @@ -640,7 +638,6 @@ void netx_16_19_application_define(void *); void netx_16_21_application_define(void *); void netx_16_22_application_define(void *); void netx_17_17_application_define(void *); -void netx_18_21_application_define(void *); void netx_23_02_01_application_define(void *); void netx_23_02_02_application_define(void *); void netx_23_02_03_application_define(void *); @@ -664,111 +661,12 @@ void netx_106_17_application_define(void *); /* Application tests do not support for 64-bit mode yet. */ #ifndef XWARE_64 -/* IPSec specific function and encryption algorithm */ -void netx_ipsec_esp_transport_icmp_ipv4_icv_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_multiple_sas_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_key_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_spi_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_selector_port_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_retransmit_test_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_selector_next_layer_protocol_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_selector_policy_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_selector_type_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_selector_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_3des_basic_test_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_3des_interface_test_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_basic_test_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_interface_test_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_256_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_3des_null_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_3des_aes_xcbc_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_3des_md5_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_3des_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_192_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_aes_xcbc_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_md5_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_192_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_256_sha1_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_aes_xcbc_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_md5_test_define_application_define(void *); - -/* Combination of IPsec function and TCP/UDP/ICMP.. function. */ -void netx_ipsec_esp_transport_tcp_ipv4_test_define_application_define(void *); -void netx_ipsec_esp_transport_udp_ipv4_test_define_application_define(void *); -void netx_ipsec_esp_transport_udp_ipv4_selector_test_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv4_test_define_application_define(void *); - -void netx_ipsec_esp_tunnel_tcp_ipv4_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_udp_ipv4_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_icmp_ipv4_test_define_application_define(void *); - -void netx_ipsec_esp_transport_tcp_ipv4_interface2_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_tcp_ipv4_interface2_test_define_application_define(void *); - -void netx_ipsec_ah_transport_tcp_ipv4_basic_test_application_define(void *); -void netx_ipsec_ah_transport_tcp_ipv4_retransmit_test_application_define(void *); -void netx_ipsec_ah_transport_tcp_ipv4_test_define_application_define(void *); -void netx_ipsec_ah_transport_udp_ipv4_selector_test_application_define(void *); -void netx_ipsec_ah_transport_udp_ipv4_test_define_application_define(void *); -void netx_ipsec_ah_transport_icmp_ipv4_test_define_application_define(void *); - -void netx_ipsec_ah_tunnel_tcp_ipv4_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_udp_ipv4_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_icmp_ipv4_test_define_application_define(void *); - - -/* IPsec with IPv6 address.*/ -void netx_ipsec_esp_transport_tcp_ipv6_3des_interface_test_application_define(void*); -void netx_ipsec_esp_transport_tcp_ipv6_aes_interface_test_application_define(void*); -void netx_ipsec_esp_transport_tcp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_udp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_udp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_icmp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv6_interface2_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_transport_tcp_ipv6_interface2_global_address_test_define_application_define(void *); - -void netx_ipsec_esp_tunnel_tcp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_tcp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_udp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_icmp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_icmp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_tcp_ipv6_interface2_linklocal_address_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_tcp_ipv6_interface2_global_address_test_define_application_define(void *); - -void netx_ipsec_ah_transport_tcp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_ah_transport_tcp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_ah_transport_udp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_ah_transport_udp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_ah_transport_icmp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_ah_transport_icmp_ipv6_global_address_test_define_application_define(void *); - -void netx_ipsec_ah_tunnel_tcp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_tcp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_udp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_udp_ipv6_global_address_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_icmp_ipv6_linklocal_address_test_define_application_define(void *); -void netx_ipsec_ah_tunnel_icmp_ipv6_global_address_test_define_application_define(void *); - -/* IPsec with Fragment function. */ -void netx_ipsec_esp_transport_udp_ipv6_linklocal_address_fragment_test_define_application_define(void *); -void netx_ipsec_esp_transport_udp_ipv6_global_address_fragment_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_fragment_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_udp_ipv6_global_address_fragment_test_define_application_define(void *); -void netx_ipsec_esp_transport_udp_ipv4_fragment_test_define_application_define(void *); -void netx_ipsec_esp_tunnel_udp_ipv4_fragment_test_define_application_define(void *); - /* AUTO IP. */ void netx_auto_ip_basic_test_application_define(void *); void netx_auto_ip_address_check_test_application_define(void *); void netx_auto_ip_announce_num_test_application_define(void *); void netx_auto_ip_arp_dest_addr_test_application_define(void *); -void netx_auto_ip_conflicts_check_test_application_define(void *); void netx_auto_ip_max_conflicts_test_application_define(void *); @@ -789,13 +687,11 @@ void netx_websocket_send_chain_packets_test_application_define(void *); /* HTTP. */ void netx_http_basic_test_application_define(void *); -void netx_http_status_501_test_application_define(void *); void netx_http_if_modified_since_test_application_define(void *); void netx_http_head_basic_test_application_define(void *); void netx_http_post_basic_test_application_define(void *); void netx_http_delete_basic_test_application_define(void *); void netx_http_basic_authenticate_test_application_define(void *); -void netx_http_status_400_test_application_define(void *); void netx_http_status_404_test_application_define(void *); void netx_http_multipart_fragment_test_application_define(void *); void netx_http_multipart_underflow_test_application_define(void *); @@ -831,8 +727,6 @@ void netx_ftp_establish_data_connection_03_test_application_define(void *); void netx_ftp_establish_data_connection_05_test_application_define(void *); void netx_ftp_establish_data_connection_06_test_application_define(void *); void netx_ftp_establish_data_connection_08_test_application_define(void *); -void netx_ftp_service_commands_dele_test_application_define(void *); -void netx_ftp_service_commands_m_d_dir_test_application_define(void *); void netx_ftp_service_commands_nlist_test_application_define(void *); void netx_ftp_service_commands_rename_test_application_define(void *); void netx_ftp_service_commands_RETR_STOR_test_application_define(void *); @@ -986,12 +880,9 @@ void netx_dhcp_unicast_test_application_define(void *); void netx_dhcp_user_option_add_test_application_define(void *); void netx_dhcp_server_improper_term_test_application_define(void *); void netx_dhcp_03_01_01_test_application_define(void *); -void netx_dhcp_03_01_02_test_application_define(void *); -void netx_dhcp_03_01_03_test_application_define(void *); void netx_dhcp_03_02_01_test_application_define(void *); void netx_dhcp_03_02_02_test_application_define(void *); void netx_dhcp_03_02_03_test_application_define(void *); -void netx_dhcp_03_04_01_test_application_define(void *); void netx_dhcp_03_05_01_test_application_define(void *); void netx_dhcp_04_01_01_test_application_define(void *); void netx_dhcp_04_03_02_01_test_application_define(void *); @@ -1022,8 +913,6 @@ void netx_dhcp_client_ntp_option_test_application_define(void *); void netx_dhcp_skip_discover_test_application_define(void *); void netx_dhcp_coverage_test_applicaiton_define(void*); void netx_dhcp_client_nxe_api_test_application_define(void*); -//void netx_dhcp_client_arp_probe_fail_multiple_interface_test_application_define(void *); -//void netx_dhcp_client_decline_test_application_define(void *); void netx_dhcp_server_test_application_define(void *); void netx_dhcp_server_second_interface_test_application_define(void *); void netx_dhcp_server_options_test_application_define(void *); @@ -1193,18 +1082,6 @@ void netx_cloud_module_event_test_application_define(void*); #if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) -#ifndef XWARE_64 -#ifdef NX_IPSEC_ENABLE - -/* IPsec TAHI test.*/ -void netx_tahi_test_ipsec_define(void *); -void netx_tahi_test_ipsec_2_define(void *); -void netx_tahi_test_ipsec_udp_define(void *); -void netx_tahi_test_ipsec_udp_2_define(void *); - -#endif -#endif /* XWARE_64 */ - #ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY /* IPv6 TAHI test*/ void netx_tahi_test_1_define(void *); @@ -1702,10 +1579,6 @@ TEST_ENTRY test_control_tests[] = {netx_tcp_duplicate_accept_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_ack_check_for_syn_message_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_ack_check_issue_test_application_define, TEST_TIMEOUT_LOW}, -#if 0 - /* The logic has been fixed in TCP layer. Driver will release the packet after it is transmitted. */ - {netx_tcp_ack_before_release_test_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_tcp_basic_processing_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_zero_window_test_application_define, TEST_TIMEOUT_MID}, {netx_tcp_zero_window_probe_test_application_define, TEST_TIMEOUT_MID}, @@ -1759,7 +1632,7 @@ TEST_ENTRY test_control_tests[] = {netx_tcp_loopback_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_out_of_order_packet_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_out_of_order_ack_test_application_define, TEST_TIMEOUT_LOW}, -// jlc temporarily omitting this one {netx_tcp_out_of_order_packet_max_test_application_define, TEST_TIMEOUT_LOW}, + {netx_tcp_out_of_order_packet_max_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_small_window_preempt_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_small_window_test_application_define, TEST_TIMEOUT_LOW}, {netx_tcp_ipv4_interface2_mss_test_application_define, TEST_TIMEOUT_LOW}, @@ -1988,9 +1861,6 @@ TEST_ENTRY test_control_tests[] = {netx_10_26_application_define, TEST_TIMEOUT_LOW}, {netx_11_18_application_define, TEST_TIMEOUT_LOW}, {netx_11_19_application_define, TEST_TIMEOUT_LOW}, -#if 0 /* The warning test case does not help. */ - {netx_11_23_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_11_24_application_define, TEST_TIMEOUT_LOW}, {netx_11_25_application_define, TEST_TIMEOUT_LOW}, {netx_11_26_application_define, TEST_TIMEOUT_LOW}, @@ -2032,9 +1902,6 @@ TEST_ENTRY test_control_tests[] = {netx_16_21_application_define, TEST_TIMEOUT_LOW}, {netx_16_22_application_define, TEST_TIMEOUT_LOW}, {netx_17_17_application_define, TEST_TIMEOUT_LOW}, -#if 0 /* The warning test case does not help. */ - {netx_18_21_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_23_02_01_application_define, TEST_TIMEOUT_LOW}, {netx_23_02_02_application_define, TEST_TIMEOUT_LOW}, {netx_23_02_03_application_define, TEST_TIMEOUT_LOW}, @@ -2063,9 +1930,6 @@ TEST_ENTRY test_control_tests[] = {netx_auto_ip_address_check_test_application_define, TEST_TIMEOUT_LOW}, {netx_auto_ip_announce_num_test_application_define, TEST_TIMEOUT_LOW}, {netx_auto_ip_arp_dest_addr_test_application_define, TEST_TIMEOUT_LOW}, -#if 0 /* This test case makes no sense but output warning. Remove it temporary. */ - {netx_auto_ip_conflicts_check_test_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_auto_ip_max_conflicts_test_application_define, TEST_TIMEOUT_MID}, /* Websocket test. */ @@ -2083,11 +1947,6 @@ TEST_ENTRY test_control_tests[] = {netx_websocket_send_chain_packets_test_application_define, TEST_TIMEOUT_LOW}, /* Http test. */ - /* Not support, or Error. */ -#if 0 - {netx_http_status_501_test_application_define, TEST_TIMEOUT_LOW}, - {netx_http_status_400_test_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_http_if_modified_since_test_application_define, TEST_TIMEOUT_LOW}, {netx_http_basic_test_application_define, TEST_TIMEOUT_LOW}, {netx_http_status_404_test_application_define, TEST_TIMEOUT_LOW}, @@ -2121,10 +1980,6 @@ TEST_ENTRY test_control_tests[] = {netx_ftp_service_commands_rename_test_application_define, TEST_TIMEOUT_LOW}, {netx_ftp_service_commands_nlist_test_application_define, TEST_TIMEOUT_LOW}, {netx_ftp_service_commands_file_write_test_application_define, TEST_TIMEOUT_LOW}, -#if 0 - {netx_ftp_service_commands_m_d_dir_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ftp_service_commands_dele_test_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_ftp_establish_data_connection_08_test_application_define, TEST_TIMEOUT_LOW}, {netx_ftp_establish_data_connection_06_test_application_define, TEST_TIMEOUT_LOW}, {netx_ftp_establish_data_connection_03_test_application_define, TEST_TIMEOUT_LOW}, @@ -2254,13 +2109,6 @@ TEST_ENTRY test_control_tests[] = {netx_dhcp_server_improper_term_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_coverage_test_applicaiton_define, TEST_TIMEOUT_LOW}, {netx_dhcp_client_nxe_api_test_application_define, TEST_TIMEOUT_LOW}, - - /* Not support. */ -#if 0 - {netx_dhcp_03_04_01_test_application_define, TEST_TIMEOUT_LOW}, - {netx_dhcp_03_01_03_test_application_define, TEST_TIMEOUT_LOW}, - {netx_dhcp_03_01_02_test_application_define, TEST_TIMEOUT_LOW}, -#endif {netx_dhcp_04_04_01_02_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_04_04_01_01_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_04_03_05_01_test_application_define, TEST_TIMEOUT_LOW}, @@ -2292,8 +2140,6 @@ TEST_ENTRY test_control_tests[] = {netx_dhcp_client_server_source_port_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_client_parameter_request_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_client_ntp_option_test_application_define, TEST_TIMEOUT_LOW}, - //{netx_dhcp_client_arp_probe_fail_multiple_interface_test_application_define, TEST_TIMEOUT_MID}, - //{netx_dhcp_client_decline_test_application_define, TEST_TIMEOUT_MID}, {netx_dhcp_server_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_server_second_interface_test_application_define, TEST_TIMEOUT_LOW}, {netx_dhcp_server_options_test_application_define, TEST_TIMEOUT_LOW}, @@ -2396,107 +2242,6 @@ TEST_ENTRY test_control_tests[] = {netx_mdns_ram_test_define, TEST_TIMEOUT_MID}, #endif /* __PRODUCT_NETXDUO__ && !NX_DISABLE_IPV4 */ -#ifdef NX_IPSEC_ENABLE - /* IPSec specific function and encryption algorithm */ - {netx_ipsec_esp_transport_icmp_ipv4_icv_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_multiple_sas_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_key_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_spi_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_selector_next_layer_protocol_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_selector_policy_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_selector_type_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_selector_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_selector_port_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_retransmit_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_3des_basic_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_3des_interface_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_basic_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_interface_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_256_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_3des_null_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_3des_aes_xcbc_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_3des_md5_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_3des_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_192_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_aes_xcbc_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_cbc_128_md5_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_192_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_256_sha1_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_aes_xcbc_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_aes_ctr_128_md5_test_define_application_define, TEST_TIMEOUT_LOW}, - - /* Combination of IPsec function and TCP/UDP/ICMP.. function. */ - {netx_ipsec_esp_transport_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_udp_ipv4_selector_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv4_interface2_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_udp_ipv4_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, - - {netx_ipsec_esp_tunnel_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_tcp_ipv4_interface2_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_udp_ipv4_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, - - /* IPsec with IPv6 address.*/ - {netx_ipsec_esp_transport_tcp_ipv6_3des_interface_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv6_aes_interface_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv6_interface2_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_tcp_ipv6_interface2_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - - {netx_ipsec_esp_tunnel_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_tcp_ipv6_interface2_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_tcp_ipv6_interface2_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - - {netx_ipsec_ah_transport_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_tcp_ipv4_basic_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_tcp_ipv4_retransmit_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_udp_ipv4_selector_test_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - - {netx_ipsec_ah_tunnel_tcp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_udp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_icmp_ipv4_test_define_application_define, TEST_TIMEOUT_LOW}, - - {netx_ipsec_ah_transport_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_transport_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - - /* IPsec with Fragment function. */ - {netx_ipsec_esp_transport_udp_ipv6_linklocal_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_transport_udp_ipv6_global_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, - - - {netx_ipsec_ah_tunnel_tcp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_tcp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_udp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_udp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_icmp_ipv6_linklocal_address_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_ah_tunnel_icmp_ipv6_global_address_test_define_application_define, TEST_TIMEOUT_LOW}, - - /* IPsec with Fragment function. */ - {netx_ipsec_esp_tunnel_udp_ipv6_linklocal_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, - {netx_ipsec_esp_tunnel_udp_ipv6_global_address_fragment_test_define_application_define, TEST_TIMEOUT_LOW}, -#endif /* NX_IPSEC_ENABLE */ - /* BSD Test */ #ifdef NX_BSD_ENABLE {netx_bsd_getaddrinfo_test_application_define, TEST_TIMEOUT_MID}, @@ -2593,17 +2338,6 @@ TEST_ENTRY test_control_tests[] = #if defined(NX_TAHI_ENABLE) && defined(FEATURE_NX_IPV6) -#ifndef XWARE_64 -#ifdef NX_IPSEC_ENABLE - /* IPsec TAHI test. */ - {netx_tahi_test_ipsec_define, TEST_TIMEOUT_MID}, - {netx_tahi_test_ipsec_2_define, TEST_TIMEOUT_MID}, - {netx_tahi_test_ipsec_udp_define, TEST_TIMEOUT_MID}, - {netx_tahi_test_ipsec_udp_2_define, TEST_TIMEOUT_MID}, - -#endif -#endif /* XWARE_64 */ - #ifdef NX_ENABLE_IPV6_PATH_MTU_DISCOVERY /* IPv6 TAHI test*/ {netx_tahi_test_1_define, TEST_TIMEOUT_HIGH}, @@ -2661,15 +2395,7 @@ TEST_ENTRY test_control_tests[] = {netx_tahi_test_3_39_define, TEST_TIMEOUT_HIGH}, {netx_tahi_test_3_40_define, TEST_TIMEOUT_HIGH}, {netx_tahi_test_3_41_define, TEST_TIMEOUT_HIGH}, - {netx_tahi_test_3_42_define, TEST_TIMEOUT_HIGH}, - - /* Remove 2 hours test. */ -#if 0 - {netx_tahi_test_3_43_define, TEST_TIMEOUT_HIGH}, - {netx_tahi_test_3_44_define, TEST_TIMEOUT_HIGH}, - {netx_tahi_test_3_45_define, TEST_TIMEOUT_HIGH}, -#endif - + {netx_tahi_test_3_42_define, TEST_TIMEOUT_HIGH}, {netx_tahi_test_4_2_define, TEST_TIMEOUT_HIGH}, {netx_tahi_test_4_3_define, TEST_TIMEOUT_HIGH}, {netx_tahi_test_4_4_define, TEST_TIMEOUT_HIGH}, @@ -2905,12 +2631,6 @@ int main() printf("IPv6 is not built-in.\n"); #endif -#ifdef NX_IPSEC_ENABLE - printf("IPsec is built-in.\n"); -#else - printf("IPsec is not built-in.\n"); -#endif - #ifdef NX_TUNNEL_ENABLE printf("Tunnel is built-in.\n"); #else diff --git a/test/regression/test/nx_ram_network_driver_test_1500.c b/test/regression/test/nx_ram_network_driver_test_1500.c index e1f57c80..65bae081 100644 --- a/test/regression/test/nx_ram_network_driver_test_1500.c +++ b/test/regression/test/nx_ram_network_driver_test_1500.c @@ -1,23 +1,11 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 1996-2005 by Express Logic Inc. */ -/* */ -/* This software is copyrighted by and is the sole property of Express */ -/* Logic, Inc. All rights, title, ownership, or other interests */ -/* in the software remain the property of Express Logic, Inc. This */ -/* software may only be used in accordance with the corresponding */ -/* license agreement. Any unauthorized use, duplication, transmission, */ -/* distribution, or disclosure of this software is expressly forbidden. */ +/**************************************************************************/ /* */ -/* This Copyright notice may not be removed or modified without prior */ -/* written consent of Express Logic, Inc. */ -/* */ -/* Express Logic, Inc. reserves the right to modify this software */ -/* without notice. */ -/* */ -/* Express Logic, Inc. info@expresslogic.com */ -/* 11423 West Bernardo Court http://www.expresslogic.com */ -/* San Diego, CA 92127 */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ /* */ /**************************************************************************/ @@ -197,10 +185,10 @@ UINT write_pcap_file(NX_PACKET *packet_ptr); /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_set_pool PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -226,7 +214,7 @@ UINT write_pcap_file(NX_PACKET *packet_ptr); /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ UINT _nx_ram_network_driver_set_pool(NX_PACKET_POOL *pool_ptr) @@ -241,10 +229,10 @@ UINT _nx_ram_network_driver_set_pool(NX_PACKET_POOL *pool_ptr) /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_reset PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -270,7 +258,7 @@ UINT _nx_ram_network_driver_set_pool(NX_PACKET_POOL *pool_ptr) /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ void _nx_ram_network_driver_reset(void) @@ -299,10 +287,10 @@ void _nx_ram_network_driver_reset(void) /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_delay_entry PORTABLE C */ -/* 2.1b */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -327,7 +315,7 @@ void _nx_ram_network_driver_reset(void) /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx William E. Lamie Initial Version 2.0 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID _nx_ram_network_driver_delay_entry(ULONG timer_input) @@ -361,10 +349,10 @@ NX_IP_DRIVER *driver_req; /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_timer_clean PORTABLE C */ -/* 2.1b */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -387,7 +375,7 @@ NX_IP_DRIVER *driver_req; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx William E. Lamie Initial Version 2.0 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID _nx_ram_network_driver_timer_clean(VOID) @@ -411,10 +399,10 @@ VOID _nx_ram_network_driver_timer_clean(VOID) /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_internal PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -443,7 +431,7 @@ VOID _nx_ram_network_driver_timer_clean(VOID) /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID _nx_ram_network_driver_internal(NX_IP_DRIVER *driver_req_ptr, UINT mtu_size) @@ -1123,10 +1111,10 @@ UINT old_threshold = 0; /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -1152,7 +1140,7 @@ UINT old_threshold = 0; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr) @@ -1653,10 +1641,10 @@ UINT old_threshold = 0; /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_output PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -1688,7 +1676,7 @@ UINT old_threshold = 0; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID _nx_ram_network_driver_output(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id) @@ -1913,10 +1901,10 @@ UINT j; /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_receive PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -1953,7 +1941,7 @@ UINT j; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.8 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID _nx_ram_network_driver_receive(NX_IP *ip_ptr, NX_PACKET *packet_ptr, UINT interface_instance_id) @@ -2077,10 +2065,10 @@ UINT packet_type; /* FUNCTION RELEASE */ /* */ /* _nx_ram_network_driver_calculate_checksum PORTABLE C */ -/* 2.1b */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -2109,7 +2097,7 @@ UINT packet_type; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx William E. Lamie Initial Version 2.1b */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ UINT _nx_ram_network_driver_calculate_checksum(NX_INTERFACE *interface_ptr, NX_PACKET *packet_ptr, UCHAR is_check) @@ -2616,10 +2604,10 @@ NX_IPV6_HEADER *ipv6_header_ptr; /* FUNCTION RELEASE */ /* */ /* get_time_of_day PORTABLE C */ -/* 5.8 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -2644,7 +2632,7 @@ NX_IPV6_HEADER *ipv6_header_ptr; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID get_time_of_day(NX_TIME_VALUE *time_value) @@ -2679,10 +2667,10 @@ ULONG64 time; /* FUNCTION RELEASE */ /* */ /* create_pcap_file PORTABLE C */ -/* 5.10 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -2709,7 +2697,7 @@ ULONG64 time; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ UINT create_pcap_file(CHAR *file_name) @@ -2744,10 +2732,10 @@ NX_PCAP_FILE_HEADER pcap_file_header; /* FUNCTION RELEASE */ /* */ /* write_pcap_file PORTABLE C */ -/* 5.10 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -2774,7 +2762,7 @@ NX_PCAP_FILE_HEADER pcap_file_header; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ UINT write_pcap_file(NX_PACKET *packet_ptr) @@ -2818,10 +2806,10 @@ ULONG data_length; /* FUNCTION RELEASE */ /* */ /* close_pcap_file PORTABLE C */ -/* 5.10 */ +/* 6.x */ /* AUTHOR */ /* */ -/* William E. Lamie, Express Logic, Inc. */ +/* Wenhui Xie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ @@ -2845,7 +2833,7 @@ ULONG data_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yuxin Zhou Initial Version 5.10 */ +/* xx-xx-xxxx Wenhui Xie Initial Version 6.x */ /* */ /**************************************************************************/ VOID close_pcap_file() diff --git a/test/regression/web_test/netx_web_tcpserver_rst_test.c b/test/regression/web_test/netx_web_tcpserver_rst_test.c index 2d546bab..0277aea5 100644 --- a/test/regression/web_test/netx_web_tcpserver_rst_test.c +++ b/test/regression/web_test/netx_web_tcpserver_rst_test.c @@ -1,6 +1,4 @@ -/* This case tests the tcpserver on handling RST packet. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-235 - */ +/* This case tests the tcpserver on handling RST packet. */ #include "nx_api.h" #include "nx_tcpserver.h" diff --git a/test/regression/web_test/netx_web_tcpserver_two_listen_test.c b/test/regression/web_test/netx_web_tcpserver_two_listen_test.c index 6cf52d84..65258550 100644 --- a/test/regression/web_test/netx_web_tcpserver_two_listen_test.c +++ b/test/regression/web_test/netx_web_tcpserver_two_listen_test.c @@ -1,6 +1,4 @@ -/* This case tests the tcpserver on handling two session listen situation. - * JIRA: https://expresslogic.atlassian.net/browse/NETXDUO-238 - */ +/* This case tests the tcpserver on handling two session listen situation. */ #include "nx_api.h" #include "nx_tcpserver.h" -- cgit v1.3.1 From f066c4bf4e109775aa530954116a5372c3f774df Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Wed, 29 Nov 2023 07:36:10 +0000 Subject: Optimize comments. --- test/regression/pppoe_test/netx_pppoe_ac_name_test.c | 8 ++++---- test/regression/pppoe_test/netx_pppoe_api_extended_test.c | 6 +++--- test/regression/pppoe_test/netx_pppoe_api_test.c | 6 +++--- test/regression/pppoe_test/netx_pppoe_basic_test.c | 8 ++++---- test/regression/pppoe_test/netx_pppoe_session_control_test.c | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/regression/pppoe_test/netx_pppoe_ac_name_test.c b/test/regression/pppoe_test/netx_pppoe_ac_name_test.c index 0f3873d5..a1b2752a 100644 --- a/test/regression/pppoe_test/netx_pppoe_ac_name_test.c +++ b/test/regression/pppoe_test/netx_pppoe_ac_name_test.c @@ -10,7 +10,7 @@ extern void test_control_return(UINT); #if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) && !defined(NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) -/* Defined NX_PPP_PPPOE_ENABLE if use Express Logic's PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ +/* Defined NX_PPP_PPPOE_ENABLE if use PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ /* If the driver is not initialized in other module, define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE to initialize the driver in PPPoE module . In this demo, the driver has been initialized in IP module. */ @@ -61,11 +61,11 @@ extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); /* Define the callback functions. */ static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_server_packet_send(NX_PACKET *packet_ptr); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_client_packet_send(NX_PACKET *packet_ptr); static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); @@ -449,7 +449,7 @@ NX_PACKET *packet_ptr; static void ppp_server_packet_send(NX_PACKET *packet_ptr) { -/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +/* For PPP test, the session should be the first session, so set interfaceHandle as 0. */ UINT interfaceHandle = 0; /* Directly Call PPPoE send function to send out the data through PPPoE module. */ diff --git a/test/regression/pppoe_test/netx_pppoe_api_extended_test.c b/test/regression/pppoe_test/netx_pppoe_api_extended_test.c index 6467696c..07b027da 100644 --- a/test/regression/pppoe_test/netx_pppoe_api_extended_test.c +++ b/test/regression/pppoe_test/netx_pppoe_api_extended_test.c @@ -52,11 +52,11 @@ extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); /* Define the callback functions. */ static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_server_packet_send(NX_PACKET *packet_ptr); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_client_packet_send(NX_PACKET *packet_ptr); static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); @@ -446,7 +446,7 @@ NX_PACKET *packet_ptr; static void ppp_server_packet_send(NX_PACKET *packet_ptr) { -/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +/* For PPP test, the session should be the first session, so set interfaceHandle as 0. */ UINT interfaceHandle = 0; /* Directly Call PPPoE send function to send out the data through PPPoE module. */ diff --git a/test/regression/pppoe_test/netx_pppoe_api_test.c b/test/regression/pppoe_test/netx_pppoe_api_test.c index b32553ba..41286234 100644 --- a/test/regression/pppoe_test/netx_pppoe_api_test.c +++ b/test/regression/pppoe_test/netx_pppoe_api_test.c @@ -52,11 +52,11 @@ extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); /* Define the callback functions. */ static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_server_packet_send(NX_PACKET *packet_ptr); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_client_packet_send(NX_PACKET *packet_ptr); static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); @@ -439,7 +439,7 @@ NX_PACKET *packet_ptr; static void ppp_server_packet_send(NX_PACKET *packet_ptr) { -/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +/* For PPP test, the session should be the first session, so set interfaceHandle as 0. */ UINT interfaceHandle = 0; /* Directly Call PPPoE send function to send out the data through PPPoE module. */ diff --git a/test/regression/pppoe_test/netx_pppoe_basic_test.c b/test/regression/pppoe_test/netx_pppoe_basic_test.c index 59d2c211..ec6fae88 100644 --- a/test/regression/pppoe_test/netx_pppoe_basic_test.c +++ b/test/regression/pppoe_test/netx_pppoe_basic_test.c @@ -10,7 +10,7 @@ extern void test_control_return(UINT); #if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) && !defined(NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE) -/* Defined NX_PPP_PPPOE_ENABLE if use Express Logic's PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ +/* Defined NX_PPP_PPPOE_ENABLE if use PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ /* If the driver is not initialized in other module, define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE to initialize the driver in PPPoE module . In this demo, the driver has been initialized in IP module. */ @@ -61,11 +61,11 @@ extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); /* Define the callback functions. */ static void pppoe_server_packet_receive(UINT interfaceHandle, ULONG length, UCHAR *data, UINT packet_id); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_server_packet_send(NX_PACKET *packet_ptr); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_client_packet_send(NX_PACKET *packet_ptr); static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); @@ -433,7 +433,7 @@ NX_PACKET *packet_ptr; static void ppp_server_packet_send(NX_PACKET *packet_ptr) { -/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +/* For test, the session should be the first session, so set interfaceHandle as 0. */ UINT interfaceHandle = 0; /* Directly Call PPPoE send function to send out the data through PPPoE module. */ diff --git a/test/regression/pppoe_test/netx_pppoe_session_control_test.c b/test/regression/pppoe_test/netx_pppoe_session_control_test.c index fbe55af9..d782c03d 100644 --- a/test/regression/pppoe_test/netx_pppoe_session_control_test.c +++ b/test/regression/pppoe_test/netx_pppoe_session_control_test.c @@ -10,7 +10,7 @@ extern void test_control_return(UINT); #if !defined(NX_DISABLE_IPV4) && defined(NX_PPP_PPPOE_ENABLE) && defined(NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE) && defined(NX_PPPOE_CLIENT_INITIALIZE_DRIVER_ENABLE) && (NX_PHYSICAL_HEADER >= 24) -/* Defined NX_PPP_PPPOE_ENABLE if use Express Logic's PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ +/* Defined NX_PPP_PPPOE_ENABLE if use PPP, since PPP module has been modified to match PPPoE moduler under this definition. */ /* If the driver is not initialized in other module, define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE to initialize the driver in PPPoE module . In this demo, the driver has been initialized in IP module. */ @@ -58,11 +58,11 @@ extern void _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr); /***** Substitute your Ethernet driver entry function here *********/ extern void _nx_ram_network_driver(NX_IP_DRIVER *driver_req_ptr); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_server_packet_send(NX_PACKET *packet_ptr); -/* Define the porting layer function for Express Logic's PPP. +/* Define the porting layer function for PPP. Functions to be provided by PPP for calling by the PPPoE Stack. */ static void ppp_client_packet_send(NX_PACKET *packet_ptr); static void pppoe_client_packet_receive(NX_PACKET *packet_ptr); @@ -501,7 +501,7 @@ NX_PACKET *packet_ptr; static void ppp_server_packet_send(NX_PACKET *packet_ptr) { -/* For Express Logic's PPP test, the session should be the first session, so set interfaceHandle as 0. */ +/* For PPP test, the session should be the first session, so set interfaceHandle as 0. */ UINT interfaceHandle = 0; #ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE -- cgit v1.3.1 From ca00f855a2408ac7f4228054b56d8b0d00060f7f Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Wed, 29 Nov 2023 09:01:53 +0000 Subject: Remove useless lines. --- test/cmake/netxduo/regression/CMakeLists.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/test/cmake/netxduo/regression/CMakeLists.txt b/test/cmake/netxduo/regression/CMakeLists.txt index c2d25e5d..4042f782 100644 --- a/test/cmake/netxduo/regression/CMakeLists.txt +++ b/test/cmake/netxduo/regression/CMakeLists.txt @@ -11,7 +11,6 @@ set(auto_ip_test_cases ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_arp_dest_addr_test.c ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_basic_test.c ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_max_conflicts_test.c - # ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_conflicts_check_test.c ${SOURCE_DIR}/auto_ip_test/netx_auto_ip_announce_num_test.c) if("-DNX_BSD_ENABLE" IN_LIST ${CMAKE_BUILD_TYPE}) @@ -79,13 +78,10 @@ if(PRODUCT STREQUAL netxduo) endif() set(dhcp_test_cases - # ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_01_02_test.c - # ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_01_03_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_01_01_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_02_01_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_02_02_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_02_03_test.c - # ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_04_01_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_03_05_01_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_01_01_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_04_03_02_01_test.c @@ -97,9 +93,6 @@ set(dhcp_test_cases ${SOURCE_DIR}/dhcp_test/netx_dhcp_basic_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_basic_restore_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_user_option_add_test.c - # ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_arpprobe_fail_multiple_interface. - # c ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface_tes - # t.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_arpprobe_multiple_interface.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_packet_process_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_client_send_with_zero_source_address_test.c ${SOURCE_DIR}/dhcp_test/netx_dhcp_multiple_instances_test.c @@ -152,7 +145,6 @@ set(dns_test_cases set(ftp_test_cases ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_02_test.c - # ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_m_d_dir_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_03_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_client_invalid_username_password_length_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_client_pasv_file_write_test.c @@ -174,7 +166,6 @@ set(ftp_test_cases ${SOURCE_DIR}/ftp_test/netx_ftp_establish_data_connection_06_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_file_write_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_establish_data_connection_03_test.c - # ${SOURCE_DIR}/ftp_test/netx_ftp_service_commands_dele_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_access_control_commands_01_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_control_connection_test.c ${SOURCE_DIR}/ftp_test/netx_ftp_server_invalid_month_crash_test.c @@ -197,14 +188,12 @@ set(http_test_cases ${SOURCE_DIR}/http_test/netx_http_get_put_referred_URI_test.c ${SOURCE_DIR}/http_test/netx_http_if_modified_since_test.c ${SOURCE_DIR}/http_test/netx_http_client_change_connect_port_test.c - # ${SOURCE_DIR}/http_test/netx_http_status_400_test.c ${SOURCE_DIR}/http_test/netx_http_post_basic_test.c ${SOURCE_DIR}/http_test/netx_http_get_contentlength_packetleak_test.c ${SOURCE_DIR}/http_test/netx_http_status_404_test.c ${SOURCE_DIR}/http_test/netx_http_basic_test.c ${SOURCE_DIR}/http_test/netx_http_basic_authenticate_test.c ${SOURCE_DIR}/http_test/netx_http_get_content_length_test.c - # ${SOURCE_DIR}/http_test/netx_http_status_501_test.c ${SOURCE_DIR}/http_test/netx_http_request_in_multiple_packets_test.c ${SOURCE_DIR}/http_test/netx_http_head_basic_test.c ${SOURCE_DIR}/http_test/netx_http_delete_basic_test.c @@ -395,7 +384,6 @@ set(netxduo_test_cases ${SOURCE_DIR}/netxduo_test/netx_udp_socket_unbind_test.c ${SOURCE_DIR}/netxduo_test/netx_arp_static_entry_create_test.c ${SOURCE_DIR}/netxduo_test/netx_4_28_test.c - # ${SOURCE_DIR}/netxduo_test/netx_18_21_test.c ${SOURCE_DIR}/netxduo_test/netx_6_24_test.c ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_14.c ${SOURCE_DIR}/netxduo_test/netx_icmp_tunnel_ipv4_ipv4_ping_test.c @@ -499,7 +487,6 @@ set(netxduo_test_cases ${SOURCE_DIR}/netxduo_test/netx_5_18_test.c ${SOURCE_DIR}/netxduo_test/netx_tcp_overlapping_packet_test_8.c ${SOURCE_DIR}/netxduo_test/netx_4_17_test.c - # ${SOURCE_DIR}/netxduo_test/netx_11_23_test.c ${SOURCE_DIR}/netxduo_test/netx_ip_fragmentation_packet_copy_test.c ${SOURCE_DIR}/netxduo_test/netx_ipv6_multicast_interface_detach_test.c ${SOURCE_DIR}/netxduo_test/netx_udp_socket_delete_test.c @@ -738,7 +725,6 @@ set(netxduo_test_cases ${SOURCE_DIR}/netxduo_test/netx_packet_data_append_test.c ${SOURCE_DIR}/netxduo_test/netx_igmp_interface_indirect_report_send_test.c ${SOURCE_DIR}/netxduo_test/netx_17_17_test.c - # ${SOURCE_DIR}/netxduo_test/netx_tcp_ack_before_release_test.c ${SOURCE_DIR}/netxduo_test/netx_tcp_out_of_window_control_packet_test.c ${SOURCE_DIR}/netxduo_test/netx_1_04_test.c ${SOURCE_DIR}/netxduo_test/netx_10_25_test.c @@ -974,7 +960,6 @@ if(PRODUCT STREQUAL netxduo) ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_10.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_01.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_05.c - # ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_44.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_11.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_29.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_34.c @@ -993,7 +978,6 @@ if(PRODUCT STREQUAL netxduo) ${SOURCE_DIR}/tahi_test/netx_tahi_test_5.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_42.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_13.c - # ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_45.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_11.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_21.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_41.c @@ -1020,7 +1004,6 @@ if(PRODUCT STREQUAL netxduo) ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_11.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_08.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_4_8.c - # ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_43.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_23.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_3_36.c ${SOURCE_DIR}/tahi_test/netx_tahi_test_2_03.c -- cgit v1.3.1 From c505fcd28b818f95f38d82f040263738e555eae6 Mon Sep 17 00:00:00 2001 From: Wenhui Xie Date: Wed, 29 Nov 2023 09:11:48 +0000 Subject: Remove .gitignore. --- test/cmake/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 test/cmake/.gitignore diff --git a/test/cmake/.gitignore b/test/cmake/.gitignore deleted file mode 100644 index 58bc3cea..00000000 --- a/test/cmake/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -threadx -filex \ No newline at end of file -- cgit v1.3.1